refactor(agent-loop): simplify observable state machine

This commit is contained in:
_Kerman
2026-07-24 21:18:48 +08:00
parent fb0ef82aa6
commit b73eb7663c
131 changed files with 2011 additions and 4292 deletions

View File

@@ -67,6 +67,7 @@ export class LinkWorkspace {
try {
manifest = JSON.parse(await readFile(join(directory, 'package.json'), 'utf8')) as PackageManifest
} catch (error) {
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') continue
throw new Error(`cannot read linked package at ${directory}: ${String(error)}`)
}
if (!manifest.name || typeof manifest.name !== 'string') continue

View File

@@ -386,7 +386,7 @@ describe('package manager strategies', () => {
temporary.push(unreadable)
await mkdir(join(unreadable, 'vendor', 'bad'), { recursive: true })
await mkdir(join(unreadable, 'packages'), { recursive: true })
await expect(LinkWorkspace.open(unreadable)).rejects.toThrow('cannot read linked package')
await expect(LinkWorkspace.open(unreadable)).rejects.toThrow('not a DeepSeek Harness repository root')
const unnamed = await mkdtemp(join(tmpdir(), 'dsh-link-unnamed-'))
temporary.push(unnamed)
await mkdir(join(unnamed, 'vendor', 'unnamed'), { recursive: true })