2026-06-19 12:42:28 +08:00
|
|
|
import { fileURLToPath } from 'node:url'
|
2026-07-14 05:00:54 +08:00
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
|
import { LOADER_SMOKE_TEST_TIMEOUT_MS, runLoaderSmoke } from '@deepseek-ai/dsh-loader-smoke'
|
2026-06-19 12:42:28 +08:00
|
|
|
|
|
|
|
|
/**
|
2026-07-14 05:00:54 +08:00
|
|
|
* Keyless Loader-path smoke for examples/coding-agent: boot the real example
|
|
|
|
|
* through the stdio-agent bin and its `cordis.yml`, then close stdin without a
|
|
|
|
|
* prompt and assert the banner. The dummy key satisfies adapter construction;
|
|
|
|
|
* immediate EOF guarantees there is no model call.
|
2026-06-19 12:42:28 +08:00
|
|
|
*/
|
|
|
|
|
|
2026-07-15 15:57:57 +08:00
|
|
|
const binScript = fileURLToPath(new URL('../../../packages/examples/stdio-demo/src/bin.ts', import.meta.url))
|
2026-06-21 12:03:44 +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-06-19 12:42:28 +08:00
|
|
|
|
|
|
|
|
describe('coding-agent keyless smoke (real cordis.yml via the Loader)', () => {
|
|
|
|
|
it('boots the full plugin tree, prints its banner, and exits cleanly on EOF', async () => {
|
2026-07-14 05:00:54 +08:00
|
|
|
const { stdout } = await runLoaderSmoke({
|
|
|
|
|
label: 'coding-agent',
|
|
|
|
|
tempDirPrefix: 'coding-smoke-',
|
|
|
|
|
binScript,
|
|
|
|
|
configPath,
|
|
|
|
|
tsconfigPath,
|
|
|
|
|
env: { DEEPSEEK_API_KEY: 'keyless-smoke-no-call' },
|
|
|
|
|
})
|
2026-07-04 01:07:26 +08:00
|
|
|
expect(stdout).toContain('agent REPL ready.')
|
2026-07-14 05:00:54 +08:00
|
|
|
}, LOADER_SMOKE_TEST_TIMEOUT_MS)
|
2026-06-19 12:42:28 +08:00
|
|
|
})
|