feat: add canonical typed tool outputs

This commit is contained in:
Tianyi Cui
2026-07-21 03:08:35 +08:00
parent 8500974fd4
commit 66c36e7325
173 changed files with 3298 additions and 954 deletions
@@ -156,6 +156,12 @@ describe('dsh-tool-ralph', () => {
report: COMPLETE,
})
expect(result.isError).toBe(false)
if (result.isError) throw new Error('expected Ralph success')
expect(result.value).toEqual({
runId: 'ralph-1',
agentsStarted: 1,
result: { status: 'complete', roundsStarted: 1, report: COMPLETE },
})
expect((result.content[0] as { text: string }).text)
.toContain('Ralph worker reported completion after 1 round.')
expect((result.content[0] as { text: string }).text).toContain('All required gates pass.')
@@ -279,7 +285,7 @@ describe('dsh-tool-ralph', () => {
expect((await execute(ctx, { objective: 'Work.', maxRounds }, { agent: parent })).isError).toBe(true)
}
const missing = await execute(ctx, {}, { agent: parent })
expect(missing.error?.code).toBe('INVALID_ARGS')
expect(missing.error?.info?.code).toBe('INVALID_ARGS')
expect(engine.requests).toHaveLength(0)
})