@truefoundry/trueforge-core 0.2.1 → 0.3.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/core/llm/LLMTypes.js +2 -2
  2. package/dist/core/llm/LLMTypes.js.map +1 -1
  3. package/dist/core/llm/LLMTypes.mjs +2 -2
  4. package/dist/core/llm/LLMTypes.mjs.map +1 -1
  5. package/dist/core/llm/VercelAILLM.d.ts.map +1 -1
  6. package/dist/core/llm/VercelAILLM.js +3 -0
  7. package/dist/core/llm/VercelAILLM.js.map +1 -1
  8. package/dist/core/llm/VercelAILLM.mjs +3 -0
  9. package/dist/core/llm/VercelAILLM.mjs.map +1 -1
  10. package/dist/core/llm/toOpenAIChatMessage.d.ts +4 -3
  11. package/dist/core/llm/toOpenAIChatMessage.d.ts.map +1 -1
  12. package/dist/core/llm/toOpenAIChatMessage.js.map +1 -1
  13. package/dist/core/llm/toOpenAIChatMessage.mjs.map +1 -1
  14. package/dist/core/runtime/AgentThread.d.ts.map +1 -1
  15. package/dist/core/runtime/AgentThread.js +7 -1
  16. package/dist/core/runtime/AgentThread.js.map +1 -1
  17. package/dist/core/runtime/AgentThread.mjs +7 -1
  18. package/dist/core/runtime/AgentThread.mjs.map +1 -1
  19. package/dist/core/sandbox/provider/TFYSandboxProvider.d.ts.map +1 -1
  20. package/dist/core/sandbox/provider/TFYSandboxProvider.js +43 -14
  21. package/dist/core/sandbox/provider/TFYSandboxProvider.js.map +1 -1
  22. package/dist/core/sandbox/provider/TFYSandboxProvider.mjs +44 -15
  23. package/dist/core/sandbox/provider/TFYSandboxProvider.mjs.map +1 -1
  24. package/dist/core/util/errorLogFields.d.ts +1 -0
  25. package/dist/core/util/errorLogFields.d.ts.map +1 -1
  26. package/dist/core/util/errorLogFields.js +33 -6
  27. package/dist/core/util/errorLogFields.js.map +1 -1
  28. package/dist/core/util/errorLogFields.mjs +33 -6
  29. package/dist/core/util/errorLogFields.mjs.map +1 -1
  30. package/dist/core/web-search/ParallelWebSearchProvider.d.ts.map +1 -1
  31. package/dist/core/web-search/ParallelWebSearchProvider.js +5 -1
  32. package/dist/core/web-search/ParallelWebSearchProvider.js.map +1 -1
  33. package/dist/core/web-search/ParallelWebSearchProvider.mjs +5 -1
  34. package/dist/core/web-search/ParallelWebSearchProvider.mjs.map +1 -1
  35. package/dist/request-reply/client.d.ts +2 -2
  36. package/dist/request-reply/client.d.ts.map +1 -1
  37. package/dist/request-reply/client.js.map +1 -1
  38. package/dist/request-reply/client.mjs.map +1 -1
  39. package/dist/request-reply/executor.d.ts +3 -3
  40. package/dist/request-reply/executor.d.ts.map +1 -1
  41. package/dist/request-reply/executor.js +0 -1
  42. package/dist/request-reply/executor.js.map +1 -1
  43. package/dist/request-reply/executor.mjs +0 -1
  44. package/dist/request-reply/executor.mjs.map +1 -1
  45. package/dist/request-reply/index.d.ts +1 -0
  46. package/dist/request-reply/index.d.ts.map +1 -1
  47. package/dist/request-reply/index.js.map +1 -1
  48. package/dist/request-reply/index.mjs.map +1 -1
  49. package/dist/request-reply/redisClient.d.ts +4 -0
  50. package/dist/request-reply/redisClient.d.ts.map +1 -0
  51. package/dist/request-reply/redisClient.js +19 -0
  52. package/dist/request-reply/redisClient.js.map +1 -0
  53. package/dist/request-reply/redisClient.mjs +1 -0
  54. package/dist/request-reply/redisClient.mjs.map +1 -0
  55. package/package.json +1 -1
@@ -93,7 +93,7 @@ var RawAssistantMessageSchema = import_openaiSchemas.ChatCompletionAssistantMess
93
93
  }).extend({
94
94
  tool_calls: import_zod_openapi.z.array(RawToolCallSchema).optional(),
95
95
  thinking_blocks: import_zod_openapi.z.array(ThinkingBlockUnionSchema).optional(),
96
- /** Plain-text thinking content streamed incrementally for frontend display; redundant with thinking_blocks[].thinking. */
96
+ /** Plain-text thinking for frontend display; exact concat of streamed deltas when set on the assembled message. */
97
97
  reasoning_content: import_zod_openapi.z.string().optional(),
98
98
  /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */
99
99
  source: import_zod_openapi.z.string().optional()
@@ -118,7 +118,7 @@ var ExtendedChunkDeltaSchema = import_openaiSchemas.ChatCompletionChunkDeltaSche
118
118
  tool_calls: import_zod_openapi.z.array(ExtendedChunkDeltaToolCallSchema).optional(),
119
119
  /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */
120
120
  thinking_blocks: import_zod_openapi.z.array(ThinkingBlockUnionSchema).optional(),
121
- /** Plain-text thinking content streamed incrementally for frontend display; not stored redundant with thinking_blocks[].thinking. */
121
+ /** Plain-text thinking fragment for frontend display; assembled message stores the full concat separately. */
122
122
  reasoning_content: import_zod_openapi.z.string().optional()
123
123
  }).openapi("ExtendedChunkDelta");
124
124
  var LLMUserMessageSchema = import_openaiSchemas.ChatCompletionUserMessageParamSchema.pick({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/llm/LLMTypes.ts"],"sourcesContent":["// TODO(agent): We should not maintain choices anymore.\n// https://platform.claude.com/docs/en/api/messages/create\n// https://platform.openai.com/docs/api-reference/responses/object#responses-object-output\n// Check the above page and check code to and come up with a streaming structure that does not expose\n// choices to upstream.\n\n// TODO(agent): At this point, we can write the types from scratch. No point in keeping the old OpenAI baggage.\nimport { z } from '@hono/zod-openapi';\nimport type { ChatCompletionChunk } from 'openai/resources/chat';\nimport {\n ChatCompletionAssistantMessageParamSchema,\n ChatCompletionChunkDeltaSchema,\n ChatCompletionChunkDeltaToolCallSchema,\n ChatCompletionChunkFinishReasonSchema,\n ChatCompletionMessageToolCallSchema,\n ChatCompletionToolMessageParamSchema,\n ChatCompletionUserMessageParamSchema,\n} from './openaiSchemas';\n\nexport const ThinkingBlockSchema = z\n .object({\n type: z.literal('thinking').describe('Structured thinking block.'),\n thinking: z.string().describe('Thinking text content.'),\n signature: z.string().optional().describe('Optional provider signature for multi-turn replay.'),\n })\n .openapi('ThinkingBlock');\n\nexport const RedactedThinkingBlockSchema = z\n .object({\n type: z.literal('redacted_thinking').describe('Redacted thinking block.'),\n data: z.string().describe('Opaque redacted thinking payload from the provider.'),\n })\n .openapi('RedactedThinkingBlock');\n\nexport const ThinkingBlockUnionSchema = z.union([ThinkingBlockSchema, RedactedThinkingBlockSchema]);\n\nexport const InternalToolCallInfoSchema = z.object({\n type: z.enum(['truefoundry-system', 'mcp']).describe('Whether the tool is a system tool or MCP tool.'),\n mcp_server_id: z.string().describe('Internal MCP server id (empty for system tools).'),\n mcp_server_name: z.string().describe('Configured MCP server name (empty for system tools).'),\n original_tool_name: z.string().describe('Original tool name before any remapping.'),\n is_approval_required: z.boolean().optional().describe('Whether this tool call requires human approval.'),\n is_deferred: z.boolean().optional().describe('Whether the tool was loaded via deferred discovery.'),\n is_client_side: z.boolean().optional().describe('Whether the client must supply the tool result.'),\n // Runtime + wire: deviation from origin/main OpenAPI (which omitted this field) is accepted.\n is_thread_creation: z.boolean().optional().describe('Whether this tool call creates a subagent thread.'),\n});\n\nexport const TrueFoundrySystemToolInfoSchema = z\n .object({\n type: z.literal('truefoundry-system').describe('Built-in harness system tool.'),\n name: z.string().describe('System tool name.'),\n })\n .openapi('TrueFoundrySystemToolInfo');\n\nexport const MCPToolInfoSchema = z\n .object({\n type: z.literal('mcp').describe('Tool hosted on an MCP server.'),\n server_id: z.string().describe('Internal MCP server id.'),\n server_name: z.string().describe('Configured MCP server name.'),\n name: z.string().describe('Tool name on the MCP server.'),\n })\n .openapi('MCPToolInfo');\n\nexport const RawToolCallSchema = ChatCompletionMessageToolCallSchema.extend({\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('RawToolCall');\n\nexport const InternalEnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: InternalToolCallInfoSchema,\n});\n\nexport const ToolInfoSchema = z\n .discriminatedUnion('type', [TrueFoundrySystemToolInfoSchema, MCPToolInfoSchema])\n .openapi('ToolInfo');\n\nexport const EnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: ToolInfoSchema,\n}).openapi('ToolCall');\n\nexport const RawAssistantMessageSchema = ChatCompletionAssistantMessageParamSchema.omit({\n tool_calls: true,\n audio: true,\n function_call: true,\n})\n .extend({\n tool_calls: z.array(RawToolCallSchema).optional(),\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking content streamed incrementally for frontend display; redundant with thinking_blocks[].thinking. */\n reasoning_content: z.string().optional(),\n /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */\n source: z.string().optional(),\n })\n .openapi('RawAssistantMessage');\n\nexport const InternalEnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n}).extend({\n tool_calls: z.array(InternalEnrichedToolCallSchema).optional(),\n});\n\n// `thinking_blocks` / `source` omitted: kept on the internal message for context replay, hidden from the client event.\nexport const EnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n thinking_blocks: true,\n source: true,\n})\n .extend({\n tool_calls: z.array(EnrichedToolCallSchema).optional(),\n })\n .openapi('EnrichedAssistantMessage');\n\nexport const ExtendedChunkDeltaToolCallSchema = ChatCompletionChunkDeltaToolCallSchema.extend({\n tool_info: ToolInfoSchema.optional(),\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('ExtendedChunkDeltaToolCall');\n\nexport const ExtendedChunkDeltaSchema = ChatCompletionChunkDeltaSchema.omit({ tool_calls: true })\n .extend({\n tool_calls: z.array(ExtendedChunkDeltaToolCallSchema).optional(),\n /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking content streamed incrementally for frontend display; not stored — redundant with thinking_blocks[].thinking. */\n reasoning_content: z.string().optional(),\n })\n .openapi('ExtendedChunkDelta');\n\nexport const LLMUserMessageSchema = ChatCompletionUserMessageParamSchema.pick({\n role: true,\n content: true,\n}).openapi('LLMUserMessage');\n\nexport const LLMToolMessageSchema = ChatCompletionToolMessageParamSchema.omit({ content: true })\n .extend({\n // TODO(agent): Where do I update the Zod code for this change?\n content: z.string(),\n })\n .openapi('LLMToolMessage');\n\nexport const CompletionUsageSchema = z\n .object({\n input_tokens: z.number().int().nonnegative().describe('Input tokens for this completion.'),\n output_tokens: z.number().int().nonnegative().describe('Output tokens for this completion.'),\n total_tokens: z.number().int().nonnegative().describe('Total tokens (input + output).'),\n cache_read_tokens: z.number().int().nonnegative().optional().describe('Optional cache-read tokens.'),\n cache_write_tokens: z.number().int().nonnegative().optional().describe('Optional cache-write tokens.'),\n reasoning_tokens: z.number().int().nonnegative().optional().describe('Optional reasoning tokens.'),\n cost_in_usd: z.number().nonnegative().optional().describe('Optional estimated cost in USD.'),\n })\n .openapi('CompletionUsage');\n\nexport const FinishReasonSchema = ChatCompletionChunkFinishReasonSchema.openapi('FinishReason');\n\nexport type ThinkingBlock = z.infer<typeof ThinkingBlockSchema>;\nexport type RedactedThinkingBlock = z.infer<typeof RedactedThinkingBlockSchema>;\nexport type InternalToolCallInfo = z.infer<typeof InternalToolCallInfoSchema>;\nexport type TrueFoundrySystemToolInfo = z.infer<typeof TrueFoundrySystemToolInfoSchema>;\nexport type MCPToolInfo = z.infer<typeof MCPToolInfoSchema>;\nexport type ToolInfo = z.infer<typeof ToolInfoSchema>;\nexport type InternalEnrichedToolCall = z.infer<typeof InternalEnrichedToolCallSchema>;\nexport type EnrichedToolCall = z.infer<typeof EnrichedToolCallSchema>;\nexport type RawAssistantMessage = z.infer<typeof RawAssistantMessageSchema>;\nexport type InternalEnrichedAssistantMessage = z.infer<typeof InternalEnrichedAssistantMessageSchema>;\nexport type EnrichedAssistantMessage = z.infer<typeof EnrichedAssistantMessageSchema>;\nexport type ExtendedDeltaToolCall = z.infer<typeof ExtendedChunkDeltaToolCallSchema>;\nexport type ExtendedDelta = z.infer<typeof ExtendedChunkDeltaSchema>;\nexport type LLMUserMessage = z.infer<typeof LLMUserMessageSchema>;\nexport type LLMToolMessage = z.infer<typeof LLMToolMessageSchema>;\nexport type CompletionUsage = z.infer<typeof CompletionUsageSchema>;\nexport type FinishReason = z.infer<typeof FinishReasonSchema>;\n\nexport function getEmptyUsage(): CompletionUsage {\n return { input_tokens: 0, output_tokens: 0, total_tokens: 0 };\n}\n\n/**\n * Extended choice type that includes thought_signature in the delta.\n */\ninterface ExtendedChoice extends Omit<ChatCompletionChunk.Choice, 'delta'> {\n /**\n * A chat completion delta generated by streamed model responses, with thought_signature support.\n */\n delta: ExtendedDelta;\n}\n\n/**\n * Extended chat completion chunk that includes thought_signature in tool calls.\n * `usage` is harness-normalized; the LLM adapter maps the wire `usage` payload at the adapter boundary.\n */\nexport interface ExtendedChatCompletionChunk extends Omit<ChatCompletionChunk, 'choices' | 'usage'> {\n /**\n * A list of chat completion choices, with thought_signature support in deltas.\n */\n choices: ExtendedChoice[];\n usage?: CompletionUsage | null;\n}\n\nexport interface RawAssistantMessageWithUsage {\n output: RawAssistantMessage;\n usage: CompletionUsage;\n /** null when the stream ended without a finish_reason chunk (e.g. provider omitted it). */\n finish_reason: FinishReason | null;\n}\n\nexport const UNKNOWN_TOOL_NAME = 'unknown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,yBAAkB;AAElB,2BAQO;AAEA,IAAM,sBAAsB,qBAChC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,UAAU,EAAE,SAAS,4BAA4B;AAAA,EACjE,UAAU,qBAAE,OAAO,EAAE,SAAS,wBAAwB;AAAA,EACtD,WAAW,qBAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oDAAoD;AAChG,CAAC,EACA,QAAQ,eAAe;AAEnB,IAAM,8BAA8B,qBACxC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,mBAAmB,EAAE,S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AAO,EAAE,cAAc,GAAG,eAAe,GAAG,cAAc,EAAE;AAC9D;AA+BO,IAAM,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/llm/LLMTypes.ts"],"sourcesContent":["// TODO(agent): We should not maintain choices anymore.\n// https://platform.claude.com/docs/en/api/messages/create\n// https://platform.openai.com/docs/api-reference/responses/object#responses-object-output\n// Check the above page and check code to and come up with a streaming structure that does not expose\n// choices to upstream.\n\n// TODO(agent): At this point, we can write the types from scratch. No point in keeping the old OpenAI baggage.\nimport { z } from '@hono/zod-openapi';\nimport type { ChatCompletionChunk } from 'openai/resources/chat';\nimport {\n ChatCompletionAssistantMessageParamSchema,\n ChatCompletionChunkDeltaSchema,\n ChatCompletionChunkDeltaToolCallSchema,\n ChatCompletionChunkFinishReasonSchema,\n ChatCompletionMessageToolCallSchema,\n ChatCompletionToolMessageParamSchema,\n ChatCompletionUserMessageParamSchema,\n} from './openaiSchemas';\n\nexport const ThinkingBlockSchema = z\n .object({\n type: z.literal('thinking').describe('Structured thinking block.'),\n thinking: z.string().describe('Thinking text content.'),\n signature: z.string().optional().describe('Optional provider signature for multi-turn replay.'),\n })\n .openapi('ThinkingBlock');\n\nexport const RedactedThinkingBlockSchema = z\n .object({\n type: z.literal('redacted_thinking').describe('Redacted thinking block.'),\n data: z.string().describe('Opaque redacted thinking payload from the provider.'),\n })\n .openapi('RedactedThinkingBlock');\n\nexport const ThinkingBlockUnionSchema = z.union([ThinkingBlockSchema, RedactedThinkingBlockSchema]);\n\nexport const InternalToolCallInfoSchema = z.object({\n type: z.enum(['truefoundry-system', 'mcp']).describe('Whether the tool is a system tool or MCP tool.'),\n mcp_server_id: z.string().describe('Internal MCP server id (empty for system tools).'),\n mcp_server_name: z.string().describe('Configured MCP server name (empty for system tools).'),\n original_tool_name: z.string().describe('Original tool name before any remapping.'),\n is_approval_required: z.boolean().optional().describe('Whether this tool call requires human approval.'),\n is_deferred: z.boolean().optional().describe('Whether the tool was loaded via deferred discovery.'),\n is_client_side: z.boolean().optional().describe('Whether the client must supply the tool result.'),\n // Runtime + wire: deviation from origin/main OpenAPI (which omitted this field) is accepted.\n is_thread_creation: z.boolean().optional().describe('Whether this tool call creates a subagent thread.'),\n});\n\nexport const TrueFoundrySystemToolInfoSchema = z\n .object({\n type: z.literal('truefoundry-system').describe('Built-in harness system tool.'),\n name: z.string().describe('System tool name.'),\n })\n .openapi('TrueFoundrySystemToolInfo');\n\nexport const MCPToolInfoSchema = z\n .object({\n type: z.literal('mcp').describe('Tool hosted on an MCP server.'),\n server_id: z.string().describe('Internal MCP server id.'),\n server_name: z.string().describe('Configured MCP server name.'),\n name: z.string().describe('Tool name on the MCP server.'),\n })\n .openapi('MCPToolInfo');\n\nexport const RawToolCallSchema = ChatCompletionMessageToolCallSchema.extend({\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('RawToolCall');\n\nexport const InternalEnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: InternalToolCallInfoSchema,\n});\n\nexport const ToolInfoSchema = z\n .discriminatedUnion('type', [TrueFoundrySystemToolInfoSchema, MCPToolInfoSchema])\n .openapi('ToolInfo');\n\nexport const EnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: ToolInfoSchema,\n}).openapi('ToolCall');\n\nexport const RawAssistantMessageSchema = ChatCompletionAssistantMessageParamSchema.omit({\n tool_calls: true,\n audio: true,\n function_call: true,\n})\n .extend({\n tool_calls: z.array(RawToolCallSchema).optional(),\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking for frontend display; exact concat of streamed deltas when set on the assembled message. */\n reasoning_content: z.string().optional(),\n /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */\n source: z.string().optional(),\n })\n .openapi('RawAssistantMessage');\n\nexport const InternalEnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n}).extend({\n tool_calls: z.array(InternalEnrichedToolCallSchema).optional(),\n});\n\n// `thinking_blocks` / `source` omitted: kept on the internal message for context replay, hidden from the client event.\nexport const EnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n thinking_blocks: true,\n source: true,\n})\n .extend({\n tool_calls: z.array(EnrichedToolCallSchema).optional(),\n })\n .openapi('EnrichedAssistantMessage');\n\nexport const ExtendedChunkDeltaToolCallSchema = ChatCompletionChunkDeltaToolCallSchema.extend({\n tool_info: ToolInfoSchema.optional(),\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('ExtendedChunkDeltaToolCall');\n\nexport const ExtendedChunkDeltaSchema = ChatCompletionChunkDeltaSchema.omit({ tool_calls: true })\n .extend({\n tool_calls: z.array(ExtendedChunkDeltaToolCallSchema).optional(),\n /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking fragment for frontend display; assembled message stores the full concat separately. */\n reasoning_content: z.string().optional(),\n })\n .openapi('ExtendedChunkDelta');\n\nexport const LLMUserMessageSchema = ChatCompletionUserMessageParamSchema.pick({\n role: true,\n content: true,\n}).openapi('LLMUserMessage');\n\nexport const LLMToolMessageSchema = ChatCompletionToolMessageParamSchema.omit({ content: true })\n .extend({\n // TODO(agent): Where do I update the Zod code for this change?\n content: z.string(),\n })\n .openapi('LLMToolMessage');\n\nexport const CompletionUsageSchema = z\n .object({\n input_tokens: z.number().int().nonnegative().describe('Input tokens for this completion.'),\n output_tokens: z.number().int().nonnegative().describe('Output tokens for this completion.'),\n total_tokens: z.number().int().nonnegative().describe('Total tokens (input + output).'),\n cache_read_tokens: z.number().int().nonnegative().optional().describe('Optional cache-read tokens.'),\n cache_write_tokens: z.number().int().nonnegative().optional().describe('Optional cache-write tokens.'),\n reasoning_tokens: z.number().int().nonnegative().optional().describe('Optional reasoning tokens.'),\n cost_in_usd: z.number().nonnegative().optional().describe('Optional estimated cost in USD.'),\n })\n .openapi('CompletionUsage');\n\nexport const FinishReasonSchema = ChatCompletionChunkFinishReasonSchema.openapi('FinishReason');\n\nexport type ThinkingBlock = z.infer<typeof ThinkingBlockSchema>;\nexport type RedactedThinkingBlock = z.infer<typeof RedactedThinkingBlockSchema>;\nexport type InternalToolCallInfo = z.infer<typeof InternalToolCallInfoSchema>;\nexport type TrueFoundrySystemToolInfo = z.infer<typeof TrueFoundrySystemToolInfoSchema>;\nexport type MCPToolInfo = z.infer<typeof MCPToolInfoSchema>;\nexport type ToolInfo = z.infer<typeof ToolInfoSchema>;\nexport type InternalEnrichedToolCall = z.infer<typeof InternalEnrichedToolCallSchema>;\nexport type EnrichedToolCall = z.infer<typeof EnrichedToolCallSchema>;\nexport type RawAssistantMessage = z.infer<typeof RawAssistantMessageSchema>;\nexport type InternalEnrichedAssistantMessage = z.infer<typeof InternalEnrichedAssistantMessageSchema>;\nexport type EnrichedAssistantMessage = z.infer<typeof EnrichedAssistantMessageSchema>;\nexport type ExtendedDeltaToolCall = z.infer<typeof ExtendedChunkDeltaToolCallSchema>;\nexport type ExtendedDelta = z.infer<typeof ExtendedChunkDeltaSchema>;\nexport type LLMUserMessage = z.infer<typeof LLMUserMessageSchema>;\nexport type LLMToolMessage = z.infer<typeof LLMToolMessageSchema>;\nexport type CompletionUsage = z.infer<typeof CompletionUsageSchema>;\nexport type FinishReason = z.infer<typeof FinishReasonSchema>;\n\nexport function getEmptyUsage(): CompletionUsage {\n return { input_tokens: 0, output_tokens: 0, total_tokens: 0 };\n}\n\n/**\n * Extended choice type that includes thought_signature in the delta.\n */\ninterface ExtendedChoice extends Omit<ChatCompletionChunk.Choice, 'delta'> {\n /**\n * A chat completion delta generated by streamed model responses, with thought_signature support.\n */\n delta: ExtendedDelta;\n}\n\n/**\n * Extended chat completion chunk that includes thought_signature in tool calls.\n * `usage` is harness-normalized; the LLM adapter maps the wire `usage` payload at the adapter boundary.\n */\nexport interface ExtendedChatCompletionChunk extends Omit<ChatCompletionChunk, 'choices' | 'usage'> {\n /**\n * A list of chat completion choices, with thought_signature support in deltas.\n */\n choices: ExtendedChoice[];\n usage?: CompletionUsage | null;\n}\n\nexport interface RawAssistantMessageWithUsage {\n output: RawAssistantMessage;\n usage: CompletionUsage;\n /** null when the stream ended without a finish_reason chunk (e.g. provider omitted it). */\n finish_reason: FinishReason | null;\n}\n\nexport const UNKNOWN_TOOL_NAME = 'unknown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,yBAAkB;AAElB,2BAQO;AAEA,IAAM,sBAAsB,qBAChC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,UAAU,EAAE,SAAS,4BAA4B;AAAA,EACjE,UAAU,qBAAE,OAAO,EAAE,SAAS,wBAAwB;AAAA,EACtD,WAAW,qBAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oDAAoD;AAChG,CAAC,EACA,QAAQ,eAAe;AAEnB,IAAM,8BAA8B,qBACxC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,mBAAmB,EAAE,SAAS,0BAA0B;AAAA,EACxE,MAAM,qBAAE,OAAO,EAAE,SAAS,qDAAqD;AACjF,CAAC,EACA,QAAQ,uBAAuB;AAE3B,IAAM,2BAA2B,qBAAE,MAAM,CAAC,qBAAqB,2BAA2B,CAAC;AAE3F,IAAM,6BAA6B,qBAAE,OAAO;AAAA,EACjD,MAAM,qBAAE,KAAK,CAAC,sBAAsB,KAAK,CAAC,EAAE,SAAS,gDAAgD;AAAA,EACrG,eAAe,qBAAE,OAAO,EAAE,SAAS,kDAAkD;AAAA,EACrF,iBAAiB,qBAAE,OAAO,EAAE,SAAS,sDAAsD;AAAA,EAC3F,oBAAoB,qBAAE,OAAO,EAAE,SAAS,0CAA0C;AAAA,EAClF,sBAAsB,qBAAE,QAAQ,EAAE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E,OAAO;AACpB,CAAC,EACA,QAAQ,gBAAgB;AAEpB,IAAM,wBAAwB,qBAClC,OAAO;AAAA,EACN,cAAc,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,mCAAmC;AAAA,EACzF,eAAe,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,oCAAoC;AAAA,EAC3F,cAAc,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,gCAAgC;AAAA,EACtF,mBAAmB,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,6BAA6B;AAAA,EACnG,oBAAoB,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,8BAA8B;AAAA,EACrG,kBAAkB,qBAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,4BAA4B;AAAA,EACjG,aAAa,qBAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,iCAAiC;AAC7F,CAAC,EACA,QAAQ,iBAAiB;AAErB,IAAM,qBAAqB,2DAAsC,QAAQ,cAAc;AAoBvF,SAAS,gBAAiC;AAC/C,SAAO,EAAE,cAAc,GAAG,eAAe,GAAG,cAAc,EAAE;AAC9D;AA+BO,IAAM,oBAAoB;","names":[]}
@@ -57,7 +57,7 @@ var RawAssistantMessageSchema = ChatCompletionAssistantMessageParamSchema.omit({
57
57
  }).extend({
58
58
  tool_calls: z.array(RawToolCallSchema).optional(),
59
59
  thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),
60
- /** Plain-text thinking content streamed incrementally for frontend display; redundant with thinking_blocks[].thinking. */
60
+ /** Plain-text thinking for frontend display; exact concat of streamed deltas when set on the assembled message. */
61
61
  reasoning_content: z.string().optional(),
62
62
  /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */
63
63
  source: z.string().optional()
@@ -82,7 +82,7 @@ var ExtendedChunkDeltaSchema = ChatCompletionChunkDeltaSchema.omit({ tool_calls:
82
82
  tool_calls: z.array(ExtendedChunkDeltaToolCallSchema).optional(),
83
83
  /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */
84
84
  thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),
85
- /** Plain-text thinking content streamed incrementally for frontend display; not stored redundant with thinking_blocks[].thinking. */
85
+ /** Plain-text thinking fragment for frontend display; assembled message stores the full concat separately. */
86
86
  reasoning_content: z.string().optional()
87
87
  }).openapi("ExtendedChunkDelta");
88
88
  var LLMUserMessageSchema = ChatCompletionUserMessageParamSchema.pick({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/llm/LLMTypes.ts"],"sourcesContent":["// TODO(agent): We should not maintain choices anymore.\n// https://platform.claude.com/docs/en/api/messages/create\n// https://platform.openai.com/docs/api-reference/responses/object#responses-object-output\n// Check the above page and check code to and come up with a streaming structure that does not expose\n// choices to upstream.\n\n// TODO(agent): At this point, we can write the types from scratch. No point in keeping the old OpenAI baggage.\nimport { z } from '@hono/zod-openapi';\nimport type { ChatCompletionChunk } from 'openai/resources/chat';\nimport {\n ChatCompletionAssistantMessageParamSchema,\n ChatCompletionChunkDeltaSchema,\n ChatCompletionChunkDeltaToolCallSchema,\n ChatCompletionChunkFinishReasonSchema,\n ChatCompletionMessageToolCallSchema,\n ChatCompletionToolMessageParamSchema,\n ChatCompletionUserMessageParamSchema,\n} from './openaiSchemas';\n\nexport const ThinkingBlockSchema = z\n .object({\n type: z.literal('thinking').describe('Structured thinking block.'),\n thinking: z.string().describe('Thinking text content.'),\n signature: z.string().optional().describe('Optional provider signature for multi-turn replay.'),\n })\n .openapi('ThinkingBlock');\n\nexport const RedactedThinkingBlockSchema = z\n .object({\n type: z.literal('redacted_thinking').describe('Redacted thinking block.'),\n data: z.string().describe('Opaque redacted thinking payload from the provider.'),\n })\n .openapi('RedactedThinkingBlock');\n\nexport const ThinkingBlockUnionSchema = z.union([ThinkingBlockSchema, RedactedThinkingBlockSchema]);\n\nexport const InternalToolCallInfoSchema = z.object({\n type: z.enum(['truefoundry-system', 'mcp']).describe('Whether the tool is a system tool or MCP tool.'),\n mcp_server_id: z.string().describe('Internal MCP server id (empty for system tools).'),\n mcp_server_name: z.string().describe('Configured MCP server name (empty for system tools).'),\n original_tool_name: z.string().describe('Original tool name before any remapping.'),\n is_approval_required: z.boolean().optional().describe('Whether this tool call requires human approval.'),\n is_deferred: z.boolean().optional().describe('Whether the tool was loaded via deferred discovery.'),\n is_client_side: z.boolean().optional().describe('Whether the client must supply the tool result.'),\n // Runtime + wire: deviation from origin/main OpenAPI (which omitted this field) is accepted.\n is_thread_creation: z.boolean().optional().describe('Whether this tool call creates a subagent thread.'),\n});\n\nexport const TrueFoundrySystemToolInfoSchema = z\n .object({\n type: z.literal('truefoundry-system').describe('Built-in harness system tool.'),\n name: z.string().describe('System tool name.'),\n })\n .openapi('TrueFoundrySystemToolInfo');\n\nexport const MCPToolInfoSchema = z\n .object({\n type: z.literal('mcp').describe('Tool hosted on an MCP server.'),\n server_id: z.string().describe('Internal MCP server id.'),\n server_name: z.string().describe('Configured MCP server name.'),\n name: z.string().describe('Tool name on the MCP server.'),\n })\n .openapi('MCPToolInfo');\n\nexport const RawToolCallSchema = ChatCompletionMessageToolCallSchema.extend({\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('RawToolCall');\n\nexport const InternalEnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: InternalToolCallInfoSchema,\n});\n\nexport const ToolInfoSchema = z\n .discriminatedUnion('type', [TrueFoundrySystemToolInfoSchema, MCPToolInfoSchema])\n .openapi('ToolInfo');\n\nexport const EnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: ToolInfoSchema,\n}).openapi('ToolCall');\n\nexport const RawAssistantMessageSchema = ChatCompletionAssistantMessageParamSchema.omit({\n tool_calls: true,\n audio: true,\n function_call: true,\n})\n .extend({\n tool_calls: z.array(RawToolCallSchema).optional(),\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking content streamed incrementally for frontend display; redundant with thinking_blocks[].thinking. */\n reasoning_content: z.string().optional(),\n /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */\n source: z.string().optional(),\n })\n .openapi('RawAssistantMessage');\n\nexport const InternalEnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n}).extend({\n tool_calls: z.array(InternalEnrichedToolCallSchema).optional(),\n});\n\n// `thinking_blocks` / `source` omitted: kept on the internal message for context replay, hidden from the client event.\nexport const EnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n thinking_blocks: true,\n source: true,\n})\n .extend({\n tool_calls: z.array(EnrichedToolCallSchema).optional(),\n })\n .openapi('EnrichedAssistantMessage');\n\nexport const ExtendedChunkDeltaToolCallSchema = ChatCompletionChunkDeltaToolCallSchema.extend({\n tool_info: ToolInfoSchema.optional(),\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('ExtendedChunkDeltaToolCall');\n\nexport const ExtendedChunkDeltaSchema = ChatCompletionChunkDeltaSchema.omit({ tool_calls: true })\n .extend({\n tool_calls: z.array(ExtendedChunkDeltaToolCallSchema).optional(),\n /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking content streamed incrementally for frontend display; not stored — redundant with thinking_blocks[].thinking. */\n reasoning_content: z.string().optional(),\n })\n .openapi('ExtendedChunkDelta');\n\nexport const LLMUserMessageSchema = ChatCompletionUserMessageParamSchema.pick({\n role: true,\n content: true,\n}).openapi('LLMUserMessage');\n\nexport const LLMToolMessageSchema = ChatCompletionToolMessageParamSchema.omit({ content: true })\n .extend({\n // TODO(agent): Where do I update the Zod code for this change?\n content: z.string(),\n })\n .openapi('LLMToolMessage');\n\nexport const CompletionUsageSchema = z\n .object({\n input_tokens: z.number().int().nonnegative().describe('Input tokens for this completion.'),\n output_tokens: z.number().int().nonnegative().describe('Output tokens for this completion.'),\n total_tokens: z.number().int().nonnegative().describe('Total tokens (input + output).'),\n cache_read_tokens: z.number().int().nonnegative().optional().describe('Optional cache-read tokens.'),\n cache_write_tokens: z.number().int().nonnegative().optional().describe('Optional cache-write tokens.'),\n reasoning_tokens: z.number().int().nonnegative().optional().describe('Optional reasoning tokens.'),\n cost_in_usd: z.number().nonnegative().optional().describe('Optional estimated cost in USD.'),\n })\n .openapi('CompletionUsage');\n\nexport const FinishReasonSchema = ChatCompletionChunkFinishReasonSchema.openapi('FinishReason');\n\nexport type ThinkingBlock = z.infer<typeof ThinkingBlockSchema>;\nexport type RedactedThinkingBlock = z.infer<typeof RedactedThinkingBlockSchema>;\nexport type InternalToolCallInfo = z.infer<typeof InternalToolCallInfoSchema>;\nexport type TrueFoundrySystemToolInfo = z.infer<typeof TrueFoundrySystemToolInfoSchema>;\nexport type MCPToolInfo = z.infer<typeof MCPToolInfoSchema>;\nexport type ToolInfo = z.infer<typeof ToolInfoSchema>;\nexport type InternalEnrichedToolCall = z.infer<typeof InternalEnrichedToolCallSchema>;\nexport type EnrichedToolCall = z.infer<typeof EnrichedToolCallSchema>;\nexport type RawAssistantMessage = z.infer<typeof RawAssistantMessageSchema>;\nexport type InternalEnrichedAssistantMessage = z.infer<typeof InternalEnrichedAssistantMessageSchema>;\nexport type EnrichedAssistantMessage = z.infer<typeof EnrichedAssistantMessageSchema>;\nexport type ExtendedDeltaToolCall = z.infer<typeof ExtendedChunkDeltaToolCallSchema>;\nexport type ExtendedDelta = z.infer<typeof ExtendedChunkDeltaSchema>;\nexport type LLMUserMessage = z.infer<typeof LLMUserMessageSchema>;\nexport type LLMToolMessage = z.infer<typeof LLMToolMessageSchema>;\nexport type CompletionUsage = z.infer<typeof CompletionUsageSchema>;\nexport type FinishReason = z.infer<typeof FinishReasonSchema>;\n\nexport function getEmptyUsage(): CompletionUsage {\n return { input_tokens: 0, output_tokens: 0, total_tokens: 0 };\n}\n\n/**\n * Extended choice type that includes thought_signature in the delta.\n */\ninterface ExtendedChoice extends Omit<ChatCompletionChunk.Choice, 'delta'> {\n /**\n * A chat completion delta generated by streamed model responses, with thought_signature support.\n */\n delta: ExtendedDelta;\n}\n\n/**\n * Extended chat completion chunk that includes thought_signature in tool calls.\n * `usage` is harness-normalized; the LLM adapter maps the wire `usage` payload at the adapter boundary.\n */\nexport interface ExtendedChatCompletionChunk extends Omit<ChatCompletionChunk, 'choices' | 'usage'> {\n /**\n * A list of chat completion choices, with thought_signature support in deltas.\n */\n choices: ExtendedChoice[];\n usage?: CompletionUsage | null;\n}\n\nexport interface RawAssistantMessageWithUsage {\n output: RawAssistantMessage;\n usage: CompletionUsage;\n /** null when the stream ended without a finish_reason chunk (e.g. provider omitted it). */\n finish_reason: FinishReason | null;\n}\n\nexport const UNKNOWN_TOOL_NAME = 'unknown';\n"],"mappings":";AAOA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,sBAAsB,EAChC,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,UAAU,EAAE,SAAS,4BAA4B;AAAA,EACjE,UAAU,EAAE,OAAO,EAAE,SAAS,wBAAwB;AAAA,EACtD,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oDAAoD;AAChG,CAAC,EACA,QAAQ,eAAe;AAEnB,IAAM,8BAA8B,EACxC,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,mBAAmB,EAAE,SAAS,0BAA0B;AAAA,EACxE,MAAM,EAAE,OAAO,EAAE,SAAS,qDAAqD;AACjF,CAAC,EACA,QAAQ,uBAAuB;AAE3B,IAAM,2BAA2B,EAAE,MAAM,CAAC,qBAAqB,2BAA2B,CAAC;AAE3F,IAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,MAAM,EAAE,KAAK,CA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B;AAExB,IAAM,uBAAuB,qCAAqC,KAAK;AAAA,EAC5E,MAAM;AAAA,EACN,SAAS;AACX,CAAC,EAAE,QAAQ,gBAAgB;AAEpB,IAAM,uBAAuB,qCAAqC,KAAK,EAAE,SAAS,KAAK,CAAC,EAC5F,OAAO;AAAA;AAAA,EAEN,SAAS,EAAE,OAAO;AACpB,CAAC,EACA,QAAQ,gBAAgB;AAEpB,IAAM,wBAAwB,EAClC,OAAO;AAAA,EACN,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,mCAAmC;AAAA,EACzF,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,oCAAoC;AAAA,EAC3F,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,gCAAgC;AAAA,EACtF,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,6BAA6B;AAAA,EACnG,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,8BAA8B;AAAA,EACrG,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,4BAA4B;AAAA,EACjG,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,iCAAiC;AAC7F,CAAC,EACA,QAAQ,iBAAiB;AAErB,IAAM,qBAAqB,sCAAsC,QAAQ,cAAc;AAoBvF,SAAS,gBAAiC;AAC/C,SAAO,EAAE,cAAc,GAAG,eAAe,GAAG,cAAc,EAAE;AAC9D;AA+BO,IAAM,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/llm/LLMTypes.ts"],"sourcesContent":["// TODO(agent): We should not maintain choices anymore.\n// https://platform.claude.com/docs/en/api/messages/create\n// https://platform.openai.com/docs/api-reference/responses/object#responses-object-output\n// Check the above page and check code to and come up with a streaming structure that does not expose\n// choices to upstream.\n\n// TODO(agent): At this point, we can write the types from scratch. No point in keeping the old OpenAI baggage.\nimport { z } from '@hono/zod-openapi';\nimport type { ChatCompletionChunk } from 'openai/resources/chat';\nimport {\n ChatCompletionAssistantMessageParamSchema,\n ChatCompletionChunkDeltaSchema,\n ChatCompletionChunkDeltaToolCallSchema,\n ChatCompletionChunkFinishReasonSchema,\n ChatCompletionMessageToolCallSchema,\n ChatCompletionToolMessageParamSchema,\n ChatCompletionUserMessageParamSchema,\n} from './openaiSchemas';\n\nexport const ThinkingBlockSchema = z\n .object({\n type: z.literal('thinking').describe('Structured thinking block.'),\n thinking: z.string().describe('Thinking text content.'),\n signature: z.string().optional().describe('Optional provider signature for multi-turn replay.'),\n })\n .openapi('ThinkingBlock');\n\nexport const RedactedThinkingBlockSchema = z\n .object({\n type: z.literal('redacted_thinking').describe('Redacted thinking block.'),\n data: z.string().describe('Opaque redacted thinking payload from the provider.'),\n })\n .openapi('RedactedThinkingBlock');\n\nexport const ThinkingBlockUnionSchema = z.union([ThinkingBlockSchema, RedactedThinkingBlockSchema]);\n\nexport const InternalToolCallInfoSchema = z.object({\n type: z.enum(['truefoundry-system', 'mcp']).describe('Whether the tool is a system tool or MCP tool.'),\n mcp_server_id: z.string().describe('Internal MCP server id (empty for system tools).'),\n mcp_server_name: z.string().describe('Configured MCP server name (empty for system tools).'),\n original_tool_name: z.string().describe('Original tool name before any remapping.'),\n is_approval_required: z.boolean().optional().describe('Whether this tool call requires human approval.'),\n is_deferred: z.boolean().optional().describe('Whether the tool was loaded via deferred discovery.'),\n is_client_side: z.boolean().optional().describe('Whether the client must supply the tool result.'),\n // Runtime + wire: deviation from origin/main OpenAPI (which omitted this field) is accepted.\n is_thread_creation: z.boolean().optional().describe('Whether this tool call creates a subagent thread.'),\n});\n\nexport const TrueFoundrySystemToolInfoSchema = z\n .object({\n type: z.literal('truefoundry-system').describe('Built-in harness system tool.'),\n name: z.string().describe('System tool name.'),\n })\n .openapi('TrueFoundrySystemToolInfo');\n\nexport const MCPToolInfoSchema = z\n .object({\n type: z.literal('mcp').describe('Tool hosted on an MCP server.'),\n server_id: z.string().describe('Internal MCP server id.'),\n server_name: z.string().describe('Configured MCP server name.'),\n name: z.string().describe('Tool name on the MCP server.'),\n })\n .openapi('MCPToolInfo');\n\nexport const RawToolCallSchema = ChatCompletionMessageToolCallSchema.extend({\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('RawToolCall');\n\nexport const InternalEnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: InternalToolCallInfoSchema,\n});\n\nexport const ToolInfoSchema = z\n .discriminatedUnion('type', [TrueFoundrySystemToolInfoSchema, MCPToolInfoSchema])\n .openapi('ToolInfo');\n\nexport const EnrichedToolCallSchema = RawToolCallSchema.extend({\n tool_info: ToolInfoSchema,\n}).openapi('ToolCall');\n\nexport const RawAssistantMessageSchema = ChatCompletionAssistantMessageParamSchema.omit({\n tool_calls: true,\n audio: true,\n function_call: true,\n})\n .extend({\n tool_calls: z.array(RawToolCallSchema).optional(),\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking for frontend display; exact concat of streamed deltas when set on the assembled message. */\n reasoning_content: z.string().optional(),\n /** Source of the message: which provider/model sent it (`provider_type/provider_name/model_name`). */\n source: z.string().optional(),\n })\n .openapi('RawAssistantMessage');\n\nexport const InternalEnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n}).extend({\n tool_calls: z.array(InternalEnrichedToolCallSchema).optional(),\n});\n\n// `thinking_blocks` / `source` omitted: kept on the internal message for context replay, hidden from the client event.\nexport const EnrichedAssistantMessageSchema = RawAssistantMessageSchema.omit({\n tool_calls: true,\n thinking_blocks: true,\n source: true,\n})\n .extend({\n tool_calls: z.array(EnrichedToolCallSchema).optional(),\n })\n .openapi('EnrichedAssistantMessage');\n\nexport const ExtendedChunkDeltaToolCallSchema = ChatCompletionChunkDeltaToolCallSchema.extend({\n tool_info: ToolInfoSchema.optional(),\n provider_specific_fields: z.record(z.string(), z.unknown()).optional(),\n}).openapi('ExtendedChunkDeltaToolCall');\n\nexport const ExtendedChunkDeltaSchema = ChatCompletionChunkDeltaSchema.omit({ tool_calls: true })\n .extend({\n tool_calls: z.array(ExtendedChunkDeltaToolCallSchema).optional(),\n /** Structured thinking blocks from the gateway; accumulated into complete blocks (with signatures) for multi-turn replay. */\n thinking_blocks: z.array(ThinkingBlockUnionSchema).optional(),\n /** Plain-text thinking fragment for frontend display; assembled message stores the full concat separately. */\n reasoning_content: z.string().optional(),\n })\n .openapi('ExtendedChunkDelta');\n\nexport const LLMUserMessageSchema = ChatCompletionUserMessageParamSchema.pick({\n role: true,\n content: true,\n}).openapi('LLMUserMessage');\n\nexport const LLMToolMessageSchema = ChatCompletionToolMessageParamSchema.omit({ content: true })\n .extend({\n // TODO(agent): Where do I update the Zod code for this change?\n content: z.string(),\n })\n .openapi('LLMToolMessage');\n\nexport const CompletionUsageSchema = z\n .object({\n input_tokens: z.number().int().nonnegative().describe('Input tokens for this completion.'),\n output_tokens: z.number().int().nonnegative().describe('Output tokens for this completion.'),\n total_tokens: z.number().int().nonnegative().describe('Total tokens (input + output).'),\n cache_read_tokens: z.number().int().nonnegative().optional().describe('Optional cache-read tokens.'),\n cache_write_tokens: z.number().int().nonnegative().optional().describe('Optional cache-write tokens.'),\n reasoning_tokens: z.number().int().nonnegative().optional().describe('Optional reasoning tokens.'),\n cost_in_usd: z.number().nonnegative().optional().describe('Optional estimated cost in USD.'),\n })\n .openapi('CompletionUsage');\n\nexport const FinishReasonSchema = ChatCompletionChunkFinishReasonSchema.openapi('FinishReason');\n\nexport type ThinkingBlock = z.infer<typeof ThinkingBlockSchema>;\nexport type RedactedThinkingBlock = z.infer<typeof RedactedThinkingBlockSchema>;\nexport type InternalToolCallInfo = z.infer<typeof InternalToolCallInfoSchema>;\nexport type TrueFoundrySystemToolInfo = z.infer<typeof TrueFoundrySystemToolInfoSchema>;\nexport type MCPToolInfo = z.infer<typeof MCPToolInfoSchema>;\nexport type ToolInfo = z.infer<typeof ToolInfoSchema>;\nexport type InternalEnrichedToolCall = z.infer<typeof InternalEnrichedToolCallSchema>;\nexport type EnrichedToolCall = z.infer<typeof EnrichedToolCallSchema>;\nexport type RawAssistantMessage = z.infer<typeof RawAssistantMessageSchema>;\nexport type InternalEnrichedAssistantMessage = z.infer<typeof InternalEnrichedAssistantMessageSchema>;\nexport type EnrichedAssistantMessage = z.infer<typeof EnrichedAssistantMessageSchema>;\nexport type ExtendedDeltaToolCall = z.infer<typeof ExtendedChunkDeltaToolCallSchema>;\nexport type ExtendedDelta = z.infer<typeof ExtendedChunkDeltaSchema>;\nexport type LLMUserMessage = z.infer<typeof LLMUserMessageSchema>;\nexport type LLMToolMessage = z.infer<typeof LLMToolMessageSchema>;\nexport type CompletionUsage = z.infer<typeof CompletionUsageSchema>;\nexport type FinishReason = z.infer<typeof FinishReasonSchema>;\n\nexport function getEmptyUsage(): CompletionUsage {\n return { input_tokens: 0, output_tokens: 0, total_tokens: 0 };\n}\n\n/**\n * Extended choice type that includes thought_signature in the delta.\n */\ninterface ExtendedChoice extends Omit<ChatCompletionChunk.Choice, 'delta'> {\n /**\n * A chat completion delta generated by streamed model responses, with thought_signature support.\n */\n delta: ExtendedDelta;\n}\n\n/**\n * Extended chat completion chunk that includes thought_signature in tool calls.\n * `usage` is harness-normalized; the LLM adapter maps the wire `usage` payload at the adapter boundary.\n */\nexport interface ExtendedChatCompletionChunk extends Omit<ChatCompletionChunk, 'choices' | 'usage'> {\n /**\n * A list of chat completion choices, with thought_signature support in deltas.\n */\n choices: ExtendedChoice[];\n usage?: CompletionUsage | null;\n}\n\nexport interface RawAssistantMessageWithUsage {\n output: RawAssistantMessage;\n usage: CompletionUsage;\n /** null when the stream ended without a finish_reason chunk (e.g. provider omitted it). */\n finish_reason: FinishReason | null;\n}\n\nexport const UNKNOWN_TOOL_NAME = 'unknown';\n"],"mappings":";AAOA,SAAS,SAAS;AAElB;AAAA,EACE;AAAA,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G;AACH,wBAAuB,iBAAiB,CAAC,EACvC,MAAM,EACN,SAAS,GACV,EAAE;IACD,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,SAAS,EAAE,SAAS,CAAC;CACtB,GAAG,cAAc,CAAC,2BAA2B,EAAE,4BAA4B,EAAE,OAAO,CAAC,CAgPrF;AAMD,sFAAsF;AACtF,qBAAa,WAAY,YAAW,IAAI;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAEjD,YAAY,MAAM,EAAE,iBAAiB,EAIpC;IAEM,MAAM,CACX,IAAI,EAAE,wBAAwB,GAC7B,cAAc,CAAC,2BAA2B,EAAE,4BAA4B,EAAE,OAAO,CAAC,CAoGpF;IAEK,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAQlF;CACF"}
@@ -733,6 +733,7 @@ async function* mapStreamToChunks({
733
733
  const toolCallStates = /* @__PURE__ */ new Map();
734
734
  let nextToolIndex = 0;
735
735
  let accumulatedText = "";
736
+ let accumulatedReasoning = "";
736
737
  const accumulatedThinking = [];
737
738
  const thinkingByReasoningItem = /* @__PURE__ */ new Map();
738
739
  let currentThinkingBlock = null;
@@ -778,6 +779,7 @@ async function* mapStreamToChunks({
778
779
  case "reasoning-delta": {
779
780
  currentThinkingBlock ??= openThinkingBlock(part.providerMetadata);
780
781
  currentThinkingBlock.thinking += part.text;
782
+ accumulatedReasoning += part.text;
781
783
  applyReasoningSignature({ block: currentThinkingBlock, providerMetadata: part.providerMetadata });
782
784
  yield {
783
785
  ...makeBase(),
@@ -917,6 +919,7 @@ async function* mapStreamToChunks({
917
919
  const output = {
918
920
  role: "assistant",
919
921
  content: accumulatedText || null,
922
+ ...accumulatedReasoning.length > 0 ? { reasoning_content: accumulatedReasoning } : {},
920
923
  ...accumulatedThinking.length > 0 ? { thinking_blocks: accumulatedThinking } : {},
921
924
  ...toolCalls.length > 0 ? { tool_calls: toolCalls } : {}
922
925
  };