Import the client, server, skills, tests, and build scripts as the starting point for the rebuild, then trim the surfaces this project does not ship: Electron desktop packaging, the marketing website, and the ESP32 firmware tree. CI keeps the web build, e2e, lockfile, release, and Docker workflows. Rename the package and CLI entry points to hermes-ui, drop the prepare hook so npm ci no longer triggers a build, and drop the removed tsconfig and nodemon references. Rewrite AGENTS.md, ARCHITECTURE.md, DEVELOPMENT.md, and the READMEs so the documented package map and hard rules match this repository. reference_code/ is ignored: it is a read-only snapshot, not an input to the build.
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
// @vitest-environment jsdom
|
|
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
CODING_AGENT_API_MODES,
|
|
inferCodingAgentApiMode,
|
|
normalizeCodingAgentApiMode,
|
|
} from '@/api/coding-agents'
|
|
|
|
describe('coding agent api modes', () => {
|
|
it('only exposes scoped coding-agent protocols supported by launch flows', () => {
|
|
expect(CODING_AGENT_API_MODES).toEqual([
|
|
'chat_completions',
|
|
'codex_responses',
|
|
'anthropic_messages',
|
|
])
|
|
})
|
|
|
|
it('keeps supported provider api modes and downgrades unsupported ones', () => {
|
|
expect(normalizeCodingAgentApiMode('anthropic_messages', 'codex_responses')).toBe('anthropic_messages')
|
|
expect(normalizeCodingAgentApiMode('bedrock_converse', 'chat_completions')).toBe('chat_completions')
|
|
expect(normalizeCodingAgentApiMode('codex_app_server', 'codex_responses')).toBe('codex_responses')
|
|
})
|
|
|
|
it('infers a safe fallback protocol from provider identity and base URL', () => {
|
|
expect(inferCodingAgentApiMode('anthropic', 'https://api.anthropic.com')).toBe('anthropic_messages')
|
|
expect(inferCodingAgentApiMode('deepseek', 'https://api.deepseek.com')).toBe('chat_completions')
|
|
expect(inferCodingAgentApiMode('xiaomi', 'https://api.xiaomimimo.com/v1')).toBe('chat_completions')
|
|
expect(inferCodingAgentApiMode('openrouter', 'https://openrouter.ai/api/v1')).toBe('chat_completions')
|
|
})
|
|
})
|