Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
# Conflicts: # packages/core/tools/src/schema.ts
This commit is contained in:
@@ -1807,6 +1807,25 @@ describe('defineTool validation (the runtime-validation Agent Note, part 1)', ()
|
||||
})
|
||||
|
||||
describe('defineTool presentation (presentCall / presentResult)', () => {
|
||||
it('preserves inline enum and const literals in inferred arguments', () => {
|
||||
defineTool({
|
||||
name: 'literal-args',
|
||||
description: 'literal arguments',
|
||||
parameters: {
|
||||
mode: { type: 'string', enum: ['read', 'write'], required: true },
|
||||
attempt: { type: 'integer', const: 1 },
|
||||
},
|
||||
output: {
|
||||
schema: { type: 'null' },
|
||||
render: () => [],
|
||||
},
|
||||
async execute(args) {
|
||||
expectTypeOf(args).toEqualTypeOf<{ mode: 'read' | 'write'; attempt?: 1 }>()
|
||||
return null
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('threads presentCall/presentResult onto the ToolDefinition with typed args', () => {
|
||||
const tool = defineContentToolFixture({
|
||||
name: 'demo',
|
||||
|
||||
Reference in New Issue
Block a user