| 1 | import type { |
| 2 | RuntimeImageInput, RuntimeEventEnvelope, RuntimeCapabilities, |
| 3 | RuntimeExperimentalCapabilities, DynamicToolSpec, DynamicToolSpecOutput, |
| 4 | DynamicToolItemStatus, DynamicToolCallParams, DynamicToolCallResult, |
| 5 | DynamicToolCallContent, TurnEnvironmentParams, |
| 6 | } from "../index.js"; |
| 7 | import { createRuntimeClient } from "../index.js"; |
| 8 | import type { Json } from "../generated/runtime.js"; |
| 9 | |
| 10 | type Assert<T extends true> = T; |
| 11 | type RootUndefinedIsRejected = Assert<undefined extends Json ? false : true>; |
| 12 | type ArrayUndefinedIsRejected = Assert<undefined[] extends Json ? false : true>; |
| 13 | type PublishedSpecRequiresDefault = Assert<{} extends Pick<DynamicToolSpecOutput, "defer_loading"> ? false : true>; |
| 14 | |
| 15 | declare const image: RuntimeImageInput; |
| 16 | declare const capabilities: RuntimeCapabilities; |
| 17 | declare const experimental: RuntimeExperimentalCapabilities; |
| 18 | declare const publishedSpec: DynamicToolSpecOutput; |
| 19 | declare const status: DynamicToolItemStatus; |
| 20 | declare const content: DynamicToolCallContent; |
| 21 | declare const environment: TurnEnvironmentParams; |
| 22 | |
| 23 | const inputSpec: DynamicToolSpec = { name: "fixture", description: "fixture", input_schema: {} }; |
| 24 | const result: DynamicToolCallResult = { success: false }; |
| 25 | const request: DynamicToolCallParams = { thread_id: "thread", turn_id: "turn", call_id: "call", tool: "fixture", arguments: {} }; |
| 26 | const event: RuntimeEventEnvelope = { |
| 27 | schema_version: 1, seq: 1, event: "tool_call.requested", kind: "tool_call.requested", |
| 28 | thread_id: "thread", turn_id: "turn", item_id: null, timestamp: "now", payload: request, |
| 29 | }; |
| 30 | const values: Json = [image, capabilities, experimental, inputSpec, publishedSpec, status, content, environment, result, request, event]; |
| 31 | const optionalMembers: Json = { optional: undefined, nested: { omitted: undefined, values } }; |
| 32 | void optionalMembers; |
| 33 | |
| 34 | const settlement: Promise<void> = createRuntimeClient().deliverDynamicToolResult(request, result, { signal: new AbortController().signal }); |
| 35 | void settlement; |
| 36 |