2026-07-08 11:47:15 +08:00
|
|
|
import { fileURLToPath } from 'node:url'
|
2026-07-14 05:00:54 +08:00
|
|
|
import { describe, expect, it } from 'vitest'
|
2026-07-20 19:26:04 +08:00
|
|
|
import { LOADER_SMOKE_TEST_TIMEOUT_MS } from '@deepseek-ai/dsh-loader-smoke'
|
|
|
|
|
import { runTuiPtySmoke } from '../../tui-agent/tests/pty-harness.ts'
|
2026-07-08 11:47:15 +08:00
|
|
|
|
2026-07-25 12:43:59 +08:00
|
|
|
const binScript = fileURLToPath(new URL('../../../apps/cli/src/bin.ts', import.meta.url))
|
2026-07-08 11:47:15 +08:00
|
|
|
const configPath = fileURLToPath(new URL('../cordis.yml', import.meta.url))
|
2026-07-14 05:00:54 +08:00
|
|
|
const tsconfigPath = fileURLToPath(new URL('../../../tsconfig.json', import.meta.url))
|
2026-07-08 11:47:15 +08:00
|
|
|
|
2026-07-20 19:26:04 +08:00
|
|
|
describe('cordis-agent keyless smoke (real Loader tree in a PTY)', () => {
|
|
|
|
|
it('boots the full tool-cordis tree and exits cleanly through the TUI', async () => {
|
|
|
|
|
const output = await runTuiPtySmoke({
|
2026-07-14 05:00:54 +08:00
|
|
|
label: 'cordis-agent',
|
2026-07-20 19:26:04 +08:00
|
|
|
tempDirPrefix: 'cordis-agent-smoke-',
|
2026-07-14 05:00:54 +08:00
|
|
|
binScript,
|
|
|
|
|
configPath,
|
|
|
|
|
tsconfigPath,
|
|
|
|
|
env: { DEEPSEEK_API_KEY: 'keyless-smoke-no-call' },
|
2026-07-20 19:26:04 +08:00
|
|
|
actions: [{ waitFor: 'cordis-agent ready.', send: '/exit\r' }],
|
2026-07-14 05:00:54 +08:00
|
|
|
})
|
2026-07-20 19:26:04 +08:00
|
|
|
expect(output).toContain('cordis-agent ready.')
|
2026-07-14 05:00:54 +08:00
|
|
|
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
|
2026-07-08 11:47:15 +08:00
|
|
|
})
|