feat: return typed values from Code Mode

This commit is contained in:
Tianyi Cui
2026-07-21 04:37:09 +08:00
parent 66c36e7325
commit c1d7b0df81
50 changed files with 2155 additions and 580 deletions
@@ -45,7 +45,7 @@ describe('CodeRuntime service seam', () => {
const calls: unknown[] = []
const result = await runtime.run({
program: 'return 1',
bindings: [{ global: 'tools', functions: { probe: async args => void calls.push(args) } }],
bindings: [{ global: 'tools', functions: { probe: async (args) => { calls.push(args); return null } } }],
})
expect(result).toEqual({ logs: [] })
expect(calls).toEqual([{ from: 'stub' }])