'use strict';

const test = require('node:test');
const assert = require('node:assert/strict');
const { resolveAgentType } = require('../lib/agent-type');

test('missing and blank AGENT_TYPE default to openclaw', () => {
  assert.equal(resolveAgentType(undefined), 'openclaw');
  assert.equal(resolveAgentType(''), 'openclaw');
  assert.equal(resolveAgentType('  '), 'openclaw');
});

test('supported AGENT_TYPE values are normalized', () => {
  assert.equal(resolveAgentType('OPENCLAW'), 'openclaw');
  assert.equal(resolveAgentType(' cutos-agent '), 'cutos-agent');
});

test('unsupported AGENT_TYPE fails fast', () => {
  assert.throws(() => resolveAgentType('other'), /AGENT_TYPE must be one of/);
});
