@truefoundry/trueforge-core 0.2.0-rc.5 → 0.2.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.
- package/dist/agent-session/ITurnResourceResolver.d.ts +6 -0
- package/dist/agent-session/ITurnResourceResolver.d.ts.map +1 -1
- package/dist/agent-session/ITurnResourceResolver.js.map +1 -1
- package/dist/agent-session/SessionHandle.d.ts +1 -0
- package/dist/agent-session/SessionHandle.d.ts.map +1 -1
- package/dist/agent-session/SessionHandle.js +3 -0
- package/dist/agent-session/SessionHandle.js.map +1 -1
- package/dist/agent-session/SessionHandle.mjs +3 -0
- package/dist/agent-session/SessionHandle.mjs.map +1 -1
- package/dist/agent-session/TurnResourceResolver.d.ts +8 -0
- package/dist/agent-session/TurnResourceResolver.d.ts.map +1 -1
- package/dist/agent-session/TurnResourceResolver.js +4 -0
- package/dist/agent-session/TurnResourceResolver.js.map +1 -1
- package/dist/agent-session/TurnResourceResolver.mjs +4 -0
- package/dist/agent-session/TurnResourceResolver.mjs.map +1 -1
- package/dist/agent-session/builtinsFromSpec.d.ts +2 -0
- package/dist/agent-session/builtinsFromSpec.d.ts.map +1 -1
- package/dist/agent-session/builtinsFromSpec.js +5 -1
- package/dist/agent-session/builtinsFromSpec.js.map +1 -1
- package/dist/agent-session/builtinsFromSpec.mjs +5 -1
- package/dist/agent-session/builtinsFromSpec.mjs.map +1 -1
- package/dist/agent-session/index.d.ts +2 -2
- package/dist/agent-session/index.d.ts.map +1 -1
- package/dist/agent-session/index.js +2 -0
- package/dist/agent-session/index.js.map +1 -1
- package/dist/agent-session/index.mjs +3 -1
- package/dist/agent-session/index.mjs.map +1 -1
- package/dist/agent-session/models/TurnRecord.d.ts +1 -0
- package/dist/agent-session/models/TurnRecord.d.ts.map +1 -1
- package/dist/agent-session/models/TurnRecord.js.map +1 -1
- package/dist/agent-session/models/TurnRecord.mjs.map +1 -1
- package/dist/agent-session/schemas/agentSpec.d.ts +6 -0
- package/dist/agent-session/schemas/agentSpec.d.ts.map +1 -1
- package/dist/agent-session/schemas/agentSpec.js +7 -3
- package/dist/agent-session/schemas/agentSpec.js.map +1 -1
- package/dist/agent-session/schemas/agentSpec.mjs +7 -3
- package/dist/agent-session/schemas/agentSpec.mjs.map +1 -1
- package/dist/agent-session/schemas/events.d.ts +65 -2
- package/dist/agent-session/schemas/events.d.ts.map +1 -1
- package/dist/agent-session/schemas/events.js +32 -2
- package/dist/agent-session/schemas/events.js.map +1 -1
- package/dist/agent-session/schemas/events.mjs +26 -1
- package/dist/agent-session/schemas/events.mjs.map +1 -1
- package/dist/agent-session/schemas/session.d.ts +9 -0
- package/dist/agent-session/schemas/session.d.ts.map +1 -1
- package/dist/core/capabilities/builtins/OpenUI.d.ts.map +1 -1
- package/dist/core/capabilities/builtins/OpenUI.js +4 -2
- package/dist/core/capabilities/builtins/OpenUI.js.map +1 -1
- package/dist/core/capabilities/builtins/OpenUI.mjs +4 -2
- package/dist/core/capabilities/builtins/OpenUI.mjs.map +1 -1
- package/dist/core/capabilities/builtins/WebSearch.d.ts +32 -0
- package/dist/core/capabilities/builtins/WebSearch.d.ts.map +1 -0
- package/dist/core/capabilities/builtins/WebSearch.js +137 -0
- package/dist/core/capabilities/builtins/WebSearch.js.map +1 -0
- package/dist/core/capabilities/builtins/WebSearch.mjs +96 -0
- package/dist/core/capabilities/builtins/WebSearch.mjs.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +20 -0
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/mcp/RemoteMCP.d.ts +2 -0
- package/dist/core/mcp/RemoteMCP.d.ts.map +1 -1
- package/dist/core/mcp/RemoteMCP.js +3 -0
- package/dist/core/mcp/RemoteMCP.js.map +1 -1
- package/dist/core/mcp/RemoteMCP.mjs +4 -0
- package/dist/core/mcp/RemoteMCP.mjs.map +1 -1
- package/dist/core/mcp/ToolSelectorPolicy.d.ts +1 -1
- package/dist/core/mcp/ToolSelectorPolicy.js +1 -1
- package/dist/core/mcp/ToolSelectorPolicy.js.map +1 -1
- package/dist/core/mcp/ToolSelectorPolicy.mjs +1 -1
- package/dist/core/mcp/ToolSelectorPolicy.mjs.map +1 -1
- package/dist/core/mcp/remoteMcpClient.d.ts +5 -0
- package/dist/core/mcp/remoteMcpClient.d.ts.map +1 -1
- package/dist/core/mcp/remoteMcpClient.js +37 -6
- package/dist/core/mcp/remoteMcpClient.js.map +1 -1
- package/dist/core/mcp/remoteMcpClient.mjs +34 -5
- package/dist/core/mcp/remoteMcpClient.mjs.map +1 -1
- package/dist/core/mcp/toolSelectors.d.ts.map +1 -1
- package/dist/core/mcp/toolSelectors.js +1 -1
- package/dist/core/mcp/toolSelectors.js.map +1 -1
- package/dist/core/mcp/toolSelectors.mjs +1 -1
- package/dist/core/mcp/toolSelectors.mjs.map +1 -1
- package/dist/core/runtime/DeferredTool.d.ts.map +1 -1
- package/dist/core/runtime/DeferredTool.js +3 -1
- package/dist/core/runtime/DeferredTool.js.map +1 -1
- package/dist/core/runtime/DeferredTool.mjs +3 -1
- package/dist/core/runtime/DeferredTool.mjs.map +1 -1
- package/dist/core/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/core/sandbox/Sandbox.js +4 -1
- package/dist/core/sandbox/Sandbox.js.map +1 -1
- package/dist/core/sandbox/Sandbox.mjs +4 -1
- package/dist/core/sandbox/Sandbox.mjs.map +1 -1
- package/dist/core/web-search/ParallelWebSearchProvider.d.ts +24 -0
- package/dist/core/web-search/ParallelWebSearchProvider.d.ts.map +1 -0
- package/dist/core/web-search/ParallelWebSearchProvider.js +95 -0
- package/dist/core/web-search/ParallelWebSearchProvider.js.map +1 -0
- package/dist/core/web-search/ParallelWebSearchProvider.mjs +62 -0
- package/dist/core/web-search/ParallelWebSearchProvider.mjs.map +1 -0
- package/dist/core/web-search/WebSearchProvider.d.ts +42 -0
- package/dist/core/web-search/WebSearchProvider.d.ts.map +1 -0
- package/dist/core/web-search/WebSearchProvider.js +34 -0
- package/dist/core/web-search/WebSearchProvider.js.map +1 -0
- package/dist/core/web-search/WebSearchProvider.mjs +9 -0
- package/dist/core/web-search/WebSearchProvider.mjs.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/agent-session/schemas/agentSpec.ts"],"sourcesContent":["/** DB AgentSpec wire schema — FQN model names and skill refs (name + optional preload). */\nimport { z } from '@hono/zod-openapi';\nimport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n} from '../../core/capabilities/builtins/LargeToolResponse';\nimport { ResponseFormatSchema } from '../../core/llm/responseFormat';\nimport {\n DEFAULT_DISABLE_TOOLS,\n DEFAULT_ENABLE_TOOLS,\n DEFAULT_PRELOAD_TOOLS,\n DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS,\n REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS,\n TOOLS_SELECTOR_TAGS,\n} from '../../core/mcp/toolSelectors';\n\nexport const DEFAULT_AGENT_CONFIG_ITERATION_LIMIT = 100;\n\n// --- Model ---\n\nconst ModelParamsSchema = z\n .object({\n max_tokens: z.number().optional().describe('Maximum tokens to generate in the model response.'),\n temperature: z.number().optional().describe('Sampling temperature; higher values increase randomness.'),\n top_p: z.number().optional().describe('Nucleus sampling probability mass.'),\n top_k: z.number().optional().describe('Top-k sampling; keep only the k highest-probability tokens.'),\n parallel_tool_calls: z\n .boolean()\n .optional()\n .describe('Whether the model may emit multiple tool calls in one response.'),\n reasoning_effort: z.string().optional().describe('Provider-specific reasoning effort (e.g. low/medium/high).'),\n })\n .loose() // this ensures extra model params are allowed\n .describe(\n 'Model call parameters passed through to the provider. Known keys are documented; extra keys are allowed and forwarded as-is.',\n )\n .openapi('ModelParams');\n\n// Opaque runtime identifier; the hosting server owns naming conventions (e.g. provider/model).\nconst ModelSchema = z\n .object({\n name: z\n .string()\n .min(1, 'model.name must not be empty')\n .describe('Model FQN: `provider/model`, e.g. `openai/gpt-5.2`.'),\n params: ModelParamsSchema.optional(),\n })\n .openapi('Model');\n\n// --- MCP servers ---\n\n// Literal tool name (not a tag).\nconst LiteralToolSelectorSchema = z\n .string()\n .min(1)\n .refine(s => !s.startsWith('@'), { message: 'Invalid tool selector tag' });\n\n// enable_tools / disable_tools / preload_tools: @all, @read-only, or a literal name.\nconst EnableToolSelectorSchema = z\n .union([z.enum(TOOLS_SELECTOR_TAGS), LiteralToolSelectorSchema])\n .openapi('MCPServerToolSelector');\n\n// require_approval_for_tools: @all, @write, @destructive, or a literal name.\nconst RequireApprovalToolSelectorSchema = z\n .union([z.enum(REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS), LiteralToolSelectorSchema])\n .openapi('MCPServerApprovalToolSelector');\n\n// `preload` defaults to false; use `preload_tools` to eagerly load specific tools when not fully preloading.\n// Auth headers are not part of the spec — they come from the configured MCP server store.\nconst MCPServerRequestSchema = z\n .object({\n name: z\n .string()\n .min(1, 'mcp_servers[].name must not be empty')\n .describe('Name of a configured MCP server (Settings → Connectors).'),\n // Which tools to enable. Default: all tools.\n enable_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_ENABLE_TOOLS)\n .describe('Tools exposed to the agent: `@all`, `@read-only`, or literal tool names. Default: `[\"@all\"]`.'),\n // Which tools to disable (subtracted from enable_tools). Default: none.\n disable_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_DISABLE_TOOLS)\n .describe('Tools subtracted from the enabled set. Default: none.'),\n // When the server is not fully preloaded (`preload: false`), which tools to\n // still preload into context. A non-empty list implies `preload: false`.\n preload_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_PRELOAD_TOOLS)\n .describe(\n 'Tools loaded eagerly into context while the rest stay deferred. A non-empty list implies `preload: false`.',\n ),\n // Tools that require human approval before execution. Default: @write + @destructive.\n require_approval_for_tools: z\n .array(RequireApprovalToolSelectorSchema)\n .default(DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS)\n .describe(\n 'Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@write\", \"@destructive\"]`.',\n ),\n // Whether this server's tools are preloaded into context. Default: false.\n // When false, tools are discovered lazily and only `preload_tools` stay eager.\n preload: z\n .boolean()\n .optional()\n .default(false)\n .describe('When true, load all tool schemas upfront. Default: false (deferred discovery).'),\n })\n .openapi('MCPServer');\n\n// --- Runtime config ---\n\nconst InputTokensCompactionTriggerSchema = z\n .object({\n type: z.literal('input_tokens').describe('Trigger compaction when the estimated input reaches a token limit.'),\n value: z.number().int().positive().describe('Estimated input-token count that triggers compaction.'),\n })\n .strict()\n .openapi('InputTokensCompactionTrigger');\n\nconst CompactionSettingsSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Summarize older history when context grows too large. Default: true.'),\n trigger: InputTokensCompactionTriggerSchema.optional(),\n })\n .strict()\n .describe('Uses 80% of the model context length when the explicit trigger is omitted, or 50000 tokens if unknown.')\n .openapi('CompactionConfig');\n\nconst LargeToolResponseSettingsSchema = z.object({\n enabled: z.boolean().default(true).describe('Offload oversized tool responses to a sandbox file. Default: true.'),\n individual_tool_response_token_threshold: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD)\n .describe(\n `Token threshold for a single tool response before offloading. Default: ${String(DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD)}.`,\n ),\n total_tool_response_token_threshold: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD)\n .describe(\n `Combined tool-response token threshold before offloading. Default: ${String(DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD)}.`,\n ),\n preview_number_of_characters: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS)\n .describe(\n `Characters of preview kept in context after offloading. Default: ${String(DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS)}.`,\n ),\n});\n\nconst SandboxConfigSchema = z\n .object({\n enabled: z.boolean().describe('Give the agent a sandbox. Required for skills and Code Mode.'),\n file_downloads: z\n .boolean()\n .default(true)\n .describe('Allow downloading agent-produced files via the turn download endpoint. Default: true.'),\n })\n .openapi('SandboxConfig');\n\nconst DynamicSubAgentsConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Allow the agent to spawn dynamic subagents. Default: true.'),\n })\n .openapi('DynamicSubAgentsConfig');\n\nconst LargeToolResponseConfigSchema = LargeToolResponseSettingsSchema.pick({\n enabled: true,\n}).openapi('LargeToolResponseConfig');\n\nconst ContextManagementConfigSchema = z\n .object({\n compaction: CompactionSettingsSchema.default(() => ({ enabled: true })),\n large_tool_response: LargeToolResponseConfigSchema.default(() => ({ enabled: true })),\n })\n .openapi('ContextManagementConfig');\n\nconst GenerativeUIConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Enable Generative UI (OpenUI blocks). Default: true.'),\n })\n .openapi('GenerativeUIConfig');\n\nconst AskUserQuestionsConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Enable the `ask_user_question` tool. Default: true.'),\n })\n .openapi('AskUserQuestionsConfig');\n\nexport const RuntimeConfigSchema = z\n .object({\n iteration_limit: z\n .number()\n .int()\n .positive()\n .max(1024)\n .default(DEFAULT_AGENT_CONFIG_ITERATION_LIMIT)\n .describe(\n `Max agent-loop iterations per turn (1–1024). Default: ${String(DEFAULT_AGENT_CONFIG_ITERATION_LIMIT)}.`,\n ),\n sandbox: SandboxConfigSchema.default(() => ({ enabled: false, file_downloads: true })),\n dynamic_sub_agents: DynamicSubAgentsConfigSchema.default(() => ({ enabled: true })),\n context_management: ContextManagementConfigSchema.default(() => ({\n compaction: { enabled: true },\n large_tool_response: { enabled: true },\n })),\n generative_ui: GenerativeUIConfigSchema.default(() => ({ enabled: true })),\n ask_user_questions: AskUserQuestionsConfigSchema.default(() => ({ enabled: true })),\n })\n .openapi('RuntimeConfig');\n\n// --- Skills ---\n// Name (+ optional preload) refs; the skill store expands mounts at turn time.\n\nconst SKILL_NAME_REGEX = /^[A-Za-z0-9._\\-/:]+$/;\n\nconst MAX_AGENT_SKILLS = 50;\n\n/** Skill selection; mount fields come from the skill store. */\nconst SkillSchema = z\n .object({\n name: z\n .string()\n .trim()\n .min(1)\n .regex(SKILL_NAME_REGEX, 'Name may only contain letters, numbers, \".\", \"_\", \"-\", \"/\", and \":\"')\n .refine(v => v !== '.' && v !== '..', 'Name must not be \".\" or \"..\"')\n .refine(v => !v.startsWith('.tfy-'), 'Name must not use the reserved \".tfy-\" prefix')\n .describe('Skill name.'),\n preload: z.boolean().optional().default(false).describe('Inline SKILL.md into the prompt.'),\n })\n .strict()\n .openapi('Skill');\n\n// --- Initial messages (string-only; turn UserMessage also allows file parts) ---\n\nconst InitialUserMessageSchema = z\n .object({\n type: z.literal('user.message').describe('Initial message type.'),\n content: z\n .string()\n .min(1, 'User message content must not be empty')\n .refine(content => content.trim().length > 0, 'User message content must not be empty')\n .describe('Initial user message content injected at the start of every session.'),\n })\n .openapi('InitialUserMessage');\n\n// --- Agent spec ---\n\nexport const AgentSpecSchema = z\n .object({\n model: ModelSchema,\n instructions: z\n .string()\n .optional()\n .describe(\"Optional system prompt — the agent's role, behavior, and constraints.\"),\n messages: z\n .array(InitialUserMessageSchema)\n .optional()\n .describe('Optional initial user messages injected at the start of every session.'),\n mcp_servers: z\n .array(MCPServerRequestSchema)\n .optional()\n .describe('Optional MCP servers attached by configured name.'),\n response_format: ResponseFormatSchema.optional(),\n skills: z.array(SkillSchema).max(MAX_AGENT_SKILLS).optional().describe('Skills used in this agent.'),\n // Factory must parse so nested RuntimeConfig field defaults materialize.\n config: RuntimeConfigSchema.default(() => RuntimeConfigSchema.parse({})),\n })\n .describe('Complete agent definition used inline on a session or saved as a named agent.')\n .openapi('AgentSpec');\n\nexport type AgentSpec = z.infer<typeof AgentSpecSchema>;\nexport type Skill = z.infer<typeof SkillSchema>;\nexport type InitialUserMessage = z.infer<typeof InitialUserMessageSchema>;\n"],"mappings":";AACA,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,uCAAuC;AAIpD,IAAM,oBAAoB,EACvB,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mDAAmD;AAAA,EAC9F,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0DAA0D;AAAA,EACtG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oCAAoC;AAAA,EAC1E,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,6DAA6D;AAAA,EACnG,qBAAqB,EAClB,QAAQ,EACR,SAAS,EACT,SAAS,iEAAiE;AAAA,EAC7E,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,4DAA4D;AAC/G,CAAC,EACA,MAAM,EACN;AAAA,EACC;AACF,EACC,QAAQ,aAAa;AAGxB,IAAM,cAAc,EACjB,OAAO;AAAA,EACN,MAAM,EACH,OAAO,EACP,IAAI,GAAG,8BAA8B,EACrC,SAAS,qDAAqD;AAAA,EACjE,QAAQ,kBAAkB,SAAS;AACrC,CAAC,EACA,QAAQ,OAAO;AAKlB,IAAM,4BAA4B,EAC/B,OAAO,EACP,IAAI,CAAC,EACL,OAAO,OAAK,CAAC,EAAE,WAAW,GAAG,GAAG,EAAE,SAAS,4BAA4B,CAAC;AAG3E,IAAM,2BAA2B,EAC9B,MAAM,CAAC,EAAE,KAAK,mBAAmB,GAAG,yBAAyB,CAAC,EAC9D,QAAQ,uBAAuB;AAGlC,IAAM,oCAA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I,GAAG,wCAAwC,EAC/C,OAAO,aAAW,QAAQ,KAAK,EAAE,SAAS,GAAG,wCAAwC,EACrF,SAAS,sEAAsE;AACpF,CAAC,EACA,QAAQ,oBAAoB;AAIxB,IAAM,kBAAkB,EAC5B,OAAO;AAAA,EACN,OAAO;AAAA,EACP,cAAc,EACX,OAAO,EACP,SAAS,EACT,SAAS,4EAAuE;AAAA,EACnF,UAAU,EACP,MAAM,wBAAwB,EAC9B,SAAS,EACT,SAAS,wEAAwE;AAAA,EACpF,aAAa,EACV,MAAM,sBAAsB,EAC5B,SAAS,EACT,SAAS,mDAAmD;AAAA,EAC/D,iBAAiB,qBAAqB,SAAS;AAAA,EAC/C,QAAQ,EAAE,MAAM,WAAW,EAAE,IAAI,gBAAgB,EAAE,SAAS,EAAE,SAAS,4BAA4B;AAAA;AAAA,EAEnG,QAAQ,oBAAoB,QAAQ,MAAM,oBAAoB,MAAM,CAAC,CAAC,CAAC;AACzE,CAAC,EACA,SAAS,+EAA+E,EACxF,QAAQ,WAAW;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/agent-session/schemas/agentSpec.ts"],"sourcesContent":["/** DB AgentSpec wire schema — FQN model names and skill refs (name + optional preload). */\nimport { z } from '@hono/zod-openapi';\nimport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n} from '../../core/capabilities/builtins/LargeToolResponse';\nimport { ResponseFormatSchema } from '../../core/llm/responseFormat';\nimport {\n DEFAULT_DISABLE_TOOLS,\n DEFAULT_ENABLE_TOOLS,\n DEFAULT_PRELOAD_TOOLS,\n DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS,\n REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS,\n TOOLS_SELECTOR_TAGS,\n} from '../../core/mcp/toolSelectors';\n\nexport const DEFAULT_AGENT_CONFIG_ITERATION_LIMIT = 100;\n\n// --- Model ---\n\nconst ModelParamsSchema = z\n .object({\n max_tokens: z.number().optional().describe('Maximum tokens to generate in the model response.'),\n temperature: z.number().optional().describe('Sampling temperature; higher values increase randomness.'),\n top_p: z.number().optional().describe('Nucleus sampling probability mass.'),\n top_k: z.number().optional().describe('Top-k sampling; keep only the k highest-probability tokens.'),\n parallel_tool_calls: z\n .boolean()\n .optional()\n .describe('Whether the model may emit multiple tool calls in one response.'),\n reasoning_effort: z.string().optional().describe('Provider-specific reasoning effort (e.g. low/medium/high).'),\n })\n .loose() // this ensures extra model params are allowed\n .describe(\n 'Model call parameters passed through to the provider. Known keys are documented; extra keys are allowed and forwarded as-is.',\n )\n .openapi('ModelParams');\n\n// Opaque runtime identifier; the hosting server owns naming conventions (e.g. provider/model).\nconst ModelSchema = z\n .object({\n name: z\n .string()\n .min(1, 'model.name must not be empty')\n .describe('Model FQN: `provider/model`, e.g. `openai/gpt-5.2`.'),\n params: ModelParamsSchema.optional(),\n })\n .openapi('Model');\n\n// --- MCP servers ---\n\n// Literal tool name (not a tag).\nconst LiteralToolSelectorSchema = z\n .string()\n .min(1)\n .refine(s => !s.startsWith('@'), { message: 'Invalid tool selector tag' });\n\n// enable_tools / disable_tools / preload_tools: @all, @read-only, or a literal name.\nconst EnableToolSelectorSchema = z\n .union([z.enum(TOOLS_SELECTOR_TAGS), LiteralToolSelectorSchema])\n .openapi('MCPServerToolSelector');\n\n// require_approval_for_tools: @all, @write, @destructive, or a literal name.\nconst RequireApprovalToolSelectorSchema = z\n .union([z.enum(REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS), LiteralToolSelectorSchema])\n .openapi('MCPServerApprovalToolSelector');\n\n// `preload` defaults to false; use `preload_tools` to eagerly load specific tools when not fully preloading.\n// Auth headers are not part of the spec — they come from the configured MCP server store.\nconst MCPServerRequestSchema = z\n .object({\n name: z\n .string()\n .min(1, 'mcp_servers[].name must not be empty')\n .describe('Name of a configured MCP server (Settings → Connectors).'),\n // Which tools to enable. Default: all tools.\n enable_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_ENABLE_TOOLS)\n .describe('Tools exposed to the agent: `@all`, `@read-only`, or literal tool names. Default: `[\"@all\"]`.'),\n // Which tools to disable (subtracted from enable_tools). Default: none.\n disable_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_DISABLE_TOOLS)\n .describe('Tools subtracted from the enabled set. Default: none.'),\n // When the server is not fully preloaded (`preload: false`), which tools to\n // still preload into context. A non-empty list implies `preload: false`.\n preload_tools: z\n .array(EnableToolSelectorSchema)\n .default(DEFAULT_PRELOAD_TOOLS)\n .describe(\n 'Tools loaded eagerly into context while the rest stay deferred. A non-empty list implies `preload: false`.',\n ),\n // Tools that require human approval before execution. Default: @destructive only.\n require_approval_for_tools: z\n .array(RequireApprovalToolSelectorSchema)\n .default(DEFAULT_REQUIRE_APPROVAL_FOR_TOOLS)\n .describe(\n 'Tools that pause for human approval: `@all`, `@write`, `@destructive`, or literal names. Default: `[\"@destructive\"]`.',\n ),\n // Whether this server's tools are preloaded into context. Default: false.\n // When false, tools are discovered lazily and only `preload_tools` stay eager.\n preload: z\n .boolean()\n .optional()\n .default(false)\n .describe('When true, load all tool schemas upfront. Default: false (deferred discovery).'),\n })\n .openapi('MCPServer');\n\n// --- Runtime config ---\n\nconst InputTokensCompactionTriggerSchema = z\n .object({\n type: z.literal('input_tokens').describe('Trigger compaction when the estimated input reaches a token limit.'),\n value: z.number().int().positive().describe('Estimated input-token count that triggers compaction.'),\n })\n .strict()\n .openapi('InputTokensCompactionTrigger');\n\nconst CompactionSettingsSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Summarize older history when context grows too large. Default: true.'),\n trigger: InputTokensCompactionTriggerSchema.optional(),\n })\n .strict()\n .describe('Uses 80% of the model context length when the explicit trigger is omitted, or 50000 tokens if unknown.')\n .openapi('CompactionConfig');\n\nconst LargeToolResponseSettingsSchema = z.object({\n enabled: z.boolean().default(true).describe('Offload oversized tool responses to a sandbox file. Default: true.'),\n individual_tool_response_token_threshold: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD)\n .describe(\n `Token threshold for a single tool response before offloading. Default: ${String(DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD)}.`,\n ),\n total_tool_response_token_threshold: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD)\n .describe(\n `Combined tool-response token threshold before offloading. Default: ${String(DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD)}.`,\n ),\n preview_number_of_characters: z\n .number()\n .int()\n .positive()\n .optional()\n .default(DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS)\n .describe(\n `Characters of preview kept in context after offloading. Default: ${String(DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS)}.`,\n ),\n});\n\nconst SandboxConfigSchema = z\n .object({\n enabled: z.boolean().describe('Give the agent a sandbox. Required for skills and Code Mode.'),\n file_downloads: z\n .boolean()\n .default(true)\n .describe('Allow downloading agent-produced files via the turn download endpoint. Default: true.'),\n })\n .openapi('SandboxConfig');\n\nconst DynamicSubAgentsConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Allow the agent to spawn dynamic subagents. Default: true.'),\n })\n .openapi('DynamicSubAgentsConfig');\n\nconst LargeToolResponseConfigSchema = LargeToolResponseSettingsSchema.pick({\n enabled: true,\n}).openapi('LargeToolResponseConfig');\n\nconst ContextManagementConfigSchema = z\n .object({\n compaction: CompactionSettingsSchema.default(() => ({ enabled: true })),\n large_tool_response: LargeToolResponseConfigSchema.default(() => ({ enabled: true })),\n })\n .openapi('ContextManagementConfig');\n\nconst GenerativeUIConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Enable Generative UI (OpenUI blocks). Default: true.'),\n })\n .openapi('GenerativeUIConfig');\n\nconst AskUserQuestionsConfigSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Enable the `ask_user_question` tool. Default: true.'),\n })\n .openapi('AskUserQuestionsConfig');\n\nconst WebSearchConfigSchema = z\n .object({\n enabled: z\n .boolean()\n .default(false)\n .describe('Enable built-in web search and fetch tools. Default: false (host must configure a provider).'),\n })\n .openapi('WebSearchConfig');\n\nexport const RuntimeConfigSchema = z\n .object({\n iteration_limit: z\n .number()\n .int()\n .positive()\n .max(1024)\n .default(DEFAULT_AGENT_CONFIG_ITERATION_LIMIT)\n .describe(\n `Max agent-loop iterations per turn (1–1024). Default: ${String(DEFAULT_AGENT_CONFIG_ITERATION_LIMIT)}.`,\n ),\n sandbox: SandboxConfigSchema.default(() => ({ enabled: false, file_downloads: true })),\n dynamic_sub_agents: DynamicSubAgentsConfigSchema.default(() => ({ enabled: true })),\n context_management: ContextManagementConfigSchema.default(() => ({\n compaction: { enabled: true },\n large_tool_response: { enabled: true },\n })),\n generative_ui: GenerativeUIConfigSchema.default(() => ({ enabled: true })),\n ask_user_questions: AskUserQuestionsConfigSchema.default(() => ({ enabled: true })),\n web_search: WebSearchConfigSchema.default(() => ({ enabled: false })),\n })\n .openapi('RuntimeConfig');\n\n// --- Skills ---\n// Name (+ optional preload) refs; the skill store expands mounts at turn time.\n\nconst SKILL_NAME_REGEX = /^[A-Za-z0-9._\\-/:]+$/;\n\nconst MAX_AGENT_SKILLS = 50;\n\n/** Skill selection; mount fields come from the skill store. */\nconst SkillSchema = z\n .object({\n name: z\n .string()\n .trim()\n .min(1)\n .regex(SKILL_NAME_REGEX, 'Name may only contain letters, numbers, \".\", \"_\", \"-\", \"/\", and \":\"')\n .refine(v => v !== '.' && v !== '..', 'Name must not be \".\" or \"..\"')\n .refine(v => !v.startsWith('.tfy-'), 'Name must not use the reserved \".tfy-\" prefix')\n .describe('Skill name.'),\n preload: z.boolean().optional().default(false).describe('Inline SKILL.md into the prompt.'),\n })\n .strict()\n .openapi('Skill');\n\n// --- Initial messages (string-only; turn UserMessage also allows file parts) ---\n\nconst InitialUserMessageSchema = z\n .object({\n type: z.literal('user.message').describe('Initial message type.'),\n content: z\n .string()\n .min(1, 'User message content must not be empty')\n .refine(content => content.trim().length > 0, 'User message content must not be empty')\n .describe('Initial user message content injected at the start of every session.'),\n })\n .openapi('InitialUserMessage');\n\n// --- Agent spec ---\n\nexport const AgentSpecSchema = z\n .object({\n model: ModelSchema,\n instructions: z\n .string()\n .optional()\n .describe(\"Optional system prompt — the agent's role, behavior, and constraints.\"),\n messages: z\n .array(InitialUserMessageSchema)\n .optional()\n .describe('Optional initial user messages injected at the start of every session.'),\n mcp_servers: z\n .array(MCPServerRequestSchema)\n .optional()\n .describe('Optional MCP servers attached by configured name.'),\n response_format: ResponseFormatSchema.optional(),\n skills: z.array(SkillSchema).max(MAX_AGENT_SKILLS).optional().describe('Skills used in this agent.'),\n // Factory must parse so nested RuntimeConfig field defaults materialize.\n config: RuntimeConfigSchema.default(() => RuntimeConfigSchema.parse({})),\n })\n .describe('Complete agent definition used inline on a session or saved as a named agent.')\n .openapi('AgentSpec');\n\nexport type AgentSpec = z.infer<typeof AgentSpecSchema>;\nexport type Skill = z.infer<typeof SkillSchema>;\nexport type InitialUserMessage = z.infer<typeof InitialUserMessageSchema>;\n"],"mappings":";AACA,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,uCAAuC;AAIpD,IAAM,oBAAoB,EACvB,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mDAAmD;AAAA,EAC9F,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,0DAA0D;AAAA,EACtG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oCAAoC;AAAA,EAC1E,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,6DAA6D;AAAA,EACnG,qBAAqB,EA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AW,EAAE,IAAI,gBAAgB,EAAE,SAAS,EAAE,SAAS,4BAA4B;AAAA;AAAA,EAEnG,QAAQ,oBAAoB,QAAQ,MAAM,oBAAoB,MAAM,CAAC,CAAC,CAAC;AACzE,CAAC,EACA,SAAS,+EAA+E,EACxF,QAAQ,WAAW;","names":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turn/session event product schemas. Event payloads come from the harness; this
|
|
3
|
-
* module owns turn lifecycle events (turn.created / turn.done) and
|
|
4
|
-
* event unions the store writes. SSE streaming envelopes stay in
|
|
3
|
+
* module owns turn lifecycle events (turn.created / turn.update / turn.done) and
|
|
4
|
+
* the persisted event unions the store writes. SSE streaming envelopes stay in
|
|
5
|
+
* server/schemas.
|
|
5
6
|
*/
|
|
6
7
|
import { z } from '@hono/zod-openapi';
|
|
7
8
|
import type { WithRegisteredPassthrough } from '../../core/events/PassthroughEvents';
|
|
@@ -22,6 +23,7 @@ export declare const EventType: {
|
|
|
22
23
|
readonly USER_TOOL_RESPONSE: 'user.tool_response';
|
|
23
24
|
readonly USER_MESSAGE: 'user.message';
|
|
24
25
|
readonly TURN_CREATED: 'turn.created';
|
|
26
|
+
readonly TURN_UPDATE: 'turn.update';
|
|
25
27
|
readonly TURN_DONE: 'turn.done';
|
|
26
28
|
};
|
|
27
29
|
export declare const TurnCreatedEventSchema: z.ZodObject<{
|
|
@@ -189,6 +191,40 @@ export declare const TurnDoneEventSchema: z.ZodObject<{
|
|
|
189
191
|
created_at: z.ZodString;
|
|
190
192
|
thread_id: z.ZodNullable<z.ZodString>;
|
|
191
193
|
}, z.core.$strip>;
|
|
194
|
+
export declare const ActionRequiredSchema: z.ZodObject<{
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
export declare const TurnUpdateStatePausedSchema: z.ZodObject<{
|
|
198
|
+
status: z.ZodLiteral<"paused">;
|
|
199
|
+
action_required_on_events: z.ZodArray<z.ZodObject<{
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export declare const TurnUpdateStateRunningSchema: z.ZodObject<{
|
|
204
|
+
status: z.ZodLiteral<"running">;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export declare const TurnUpdateStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
207
|
+
status: z.ZodLiteral<"paused">;
|
|
208
|
+
action_required_on_events: z.ZodArray<z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
212
|
+
status: z.ZodLiteral<"running">;
|
|
213
|
+
}, z.core.$strip>], "status">;
|
|
214
|
+
export declare const TurnUpdateEventSchema: z.ZodObject<{
|
|
215
|
+
type: z.ZodLiteral<"turn.update">;
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
state: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
218
|
+
status: z.ZodLiteral<"paused">;
|
|
219
|
+
action_required_on_events: z.ZodArray<z.ZodObject<{
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
223
|
+
status: z.ZodLiteral<"running">;
|
|
224
|
+
}, z.core.$strip>], "status">;
|
|
225
|
+
created_at: z.ZodString;
|
|
226
|
+
thread_id: z.ZodNullable<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>;
|
|
192
228
|
/** Built-in durable turn events — lifecycle + content; no deltas, no passthrough. */
|
|
193
229
|
export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
194
230
|
type: z.ZodLiteral<"turn.created">;
|
|
@@ -226,6 +262,19 @@ export declare const SessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
226
262
|
}, z.core.$strip>;
|
|
227
263
|
created_at: z.ZodString;
|
|
228
264
|
thread_id: z.ZodNullable<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"turn.update">;
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
state: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
269
|
+
status: z.ZodLiteral<"paused">;
|
|
270
|
+
action_required_on_events: z.ZodArray<z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
}, z.core.$strip>>;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
status: z.ZodLiteral<"running">;
|
|
275
|
+
}, z.core.$strip>], "status">;
|
|
276
|
+
created_at: z.ZodString;
|
|
277
|
+
thread_id: z.ZodNullable<z.ZodString>;
|
|
229
278
|
}, z.core.$strip>, z.ZodObject<{
|
|
230
279
|
type: z.ZodLiteral<"turn.done">;
|
|
231
280
|
id: z.ZodString;
|
|
@@ -641,6 +690,19 @@ export declare const SessionEventItemSchema: z.ZodObject<{
|
|
|
641
690
|
}, z.core.$strip>;
|
|
642
691
|
created_at: z.ZodString;
|
|
643
692
|
thread_id: z.ZodNullable<z.ZodString>;
|
|
693
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
694
|
+
type: z.ZodLiteral<"turn.update">;
|
|
695
|
+
id: z.ZodString;
|
|
696
|
+
state: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
697
|
+
status: z.ZodLiteral<"paused">;
|
|
698
|
+
action_required_on_events: z.ZodArray<z.ZodObject<{
|
|
699
|
+
id: z.ZodString;
|
|
700
|
+
}, z.core.$strip>>;
|
|
701
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
702
|
+
status: z.ZodLiteral<"running">;
|
|
703
|
+
}, z.core.$strip>], "status">;
|
|
704
|
+
created_at: z.ZodString;
|
|
705
|
+
thread_id: z.ZodNullable<z.ZodString>;
|
|
644
706
|
}, z.core.$strip>, z.ZodObject<{
|
|
645
707
|
type: z.ZodLiteral<"turn.done">;
|
|
646
708
|
id: z.ZodString;
|
|
@@ -1019,6 +1081,7 @@ export declare const SessionEventItemSchema: z.ZodObject<{
|
|
|
1019
1081
|
}, z.core.$strip>], "type">;
|
|
1020
1082
|
}, z.core.$strip>;
|
|
1021
1083
|
export type TurnCreatedEvent = z.infer<typeof TurnCreatedEventSchema>;
|
|
1084
|
+
export type TurnUpdateEvent = z.infer<typeof TurnUpdateEventSchema>;
|
|
1022
1085
|
export type TurnDoneEvent = z.infer<typeof TurnDoneEventSchema>;
|
|
1023
1086
|
export type SessionEvent = z.infer<typeof SessionEventSchema>;
|
|
1024
1087
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/agent-session/schemas/events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/agent-session/schemas/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAsBrF,+EAA+E;AAC/E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;2BAEN,cAAc;0BACf,aAAa;wBACf,WAAW;CACd,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWL,CAAC;AAE/B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUL,CAAC;AAE5B,eAAO,MAAM,oBAAoB;;iBAIL,CAAC;AAE7B,eAAO,MAAM,2BAA2B;;;;;iBAOL,CAAC;AAEpC,eAAO,MAAM,4BAA4B;;iBAIL,CAAC;AAErC,e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/B,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,YAAY,CAAC,GAAG;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,kBAAkB,CAAC;CAC3B"}
|
|
@@ -20,11 +20,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/agent-session/schemas/events.ts
|
|
21
21
|
var events_exports = {};
|
|
22
22
|
__export(events_exports, {
|
|
23
|
+
ActionRequiredSchema: () => ActionRequiredSchema,
|
|
23
24
|
EventType: () => EventType,
|
|
24
25
|
SessionEventItemSchema: () => SessionEventItemSchema,
|
|
25
26
|
SessionEventSchema: () => SessionEventSchema,
|
|
26
27
|
TurnCreatedEventSchema: () => TurnCreatedEventSchema,
|
|
27
|
-
TurnDoneEventSchema: () => TurnDoneEventSchema
|
|
28
|
+
TurnDoneEventSchema: () => TurnDoneEventSchema,
|
|
29
|
+
TurnUpdateEventSchema: () => TurnUpdateEventSchema,
|
|
30
|
+
TurnUpdateStatePausedSchema: () => TurnUpdateStatePausedSchema,
|
|
31
|
+
TurnUpdateStateRunningSchema: () => TurnUpdateStateRunningSchema,
|
|
32
|
+
TurnUpdateStateSchema: () => TurnUpdateStateSchema
|
|
28
33
|
});
|
|
29
34
|
module.exports = __toCommonJS(events_exports);
|
|
30
35
|
var import_zod_openapi = require("@hono/zod-openapi");
|
|
@@ -33,6 +38,7 @@ var import_turn = require("./turn.js");
|
|
|
33
38
|
var EventType = {
|
|
34
39
|
...import_schema.EventType,
|
|
35
40
|
TURN_CREATED: "turn.created",
|
|
41
|
+
TURN_UPDATE: "turn.update",
|
|
36
42
|
TURN_DONE: "turn.done"
|
|
37
43
|
};
|
|
38
44
|
var TurnCreatedEventSchema = import_zod_openapi.z.object({
|
|
@@ -52,8 +58,27 @@ var TurnDoneEventSchema = import_zod_openapi.z.object({
|
|
|
52
58
|
created_at: import_zod_openapi.z.string().describe("ISO 8601 event timestamp."),
|
|
53
59
|
thread_id: import_zod_openapi.z.string().nullable().describe("Thread that owns the event; null for turn-level lifecycle events.")
|
|
54
60
|
}).openapi("TurnDoneEvent");
|
|
61
|
+
var ActionRequiredSchema = import_zod_openapi.z.object({
|
|
62
|
+
id: import_schema.EventIdSchema
|
|
63
|
+
}).openapi("ActionRequired");
|
|
64
|
+
var TurnUpdateStatePausedSchema = import_zod_openapi.z.object({
|
|
65
|
+
status: import_zod_openapi.z.literal("paused").describe("Turn is paused waiting for required actions."),
|
|
66
|
+
action_required_on_events: import_zod_openapi.z.array(ActionRequiredSchema).describe("Events that still need a user or client action.")
|
|
67
|
+
}).openapi("TurnUpdateStatePaused");
|
|
68
|
+
var TurnUpdateStateRunningSchema = import_zod_openapi.z.object({
|
|
69
|
+
status: import_zod_openapi.z.literal("running").describe("Turn is executing.")
|
|
70
|
+
}).openapi("TurnUpdateStateRunning");
|
|
71
|
+
var TurnUpdateStateSchema = import_zod_openapi.z.discriminatedUnion("status", [TurnUpdateStatePausedSchema, TurnUpdateStateRunningSchema]).describe("Live non-terminal turn status.").openapi("TurnUpdateState");
|
|
72
|
+
var TurnUpdateEventSchema = import_zod_openapi.z.object({
|
|
73
|
+
type: import_zod_openapi.z.literal(EventType.TURN_UPDATE).describe("Emitted when a turn pauses or resumes."),
|
|
74
|
+
id: import_schema.EventIdSchema,
|
|
75
|
+
state: TurnUpdateStateSchema,
|
|
76
|
+
created_at: import_zod_openapi.z.string().describe("ISO 8601 event timestamp."),
|
|
77
|
+
thread_id: import_zod_openapi.z.string().nullable().describe("Thread that owns the event; null for turn-level lifecycle events.")
|
|
78
|
+
}).openapi("TurnUpdateEvent");
|
|
55
79
|
var SessionEventSchema = import_zod_openapi.z.discriminatedUnion("type", [
|
|
56
80
|
TurnCreatedEventSchema,
|
|
81
|
+
TurnUpdateEventSchema,
|
|
57
82
|
TurnDoneEventSchema,
|
|
58
83
|
import_schema.ModelMessageEventSchema,
|
|
59
84
|
import_schema.ToolResponseEventSchema,
|
|
@@ -71,10 +96,15 @@ var SessionEventItemSchema = import_zod_openapi.z.object({
|
|
|
71
96
|
}).openapi("SessionEventItem");
|
|
72
97
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
98
|
0 && (module.exports = {
|
|
99
|
+
ActionRequiredSchema,
|
|
74
100
|
EventType,
|
|
75
101
|
SessionEventItemSchema,
|
|
76
102
|
SessionEventSchema,
|
|
77
103
|
TurnCreatedEventSchema,
|
|
78
|
-
TurnDoneEventSchema
|
|
104
|
+
TurnDoneEventSchema,
|
|
105
|
+
TurnUpdateEventSchema,
|
|
106
|
+
TurnUpdateStatePausedSchema,
|
|
107
|
+
TurnUpdateStateRunningSchema,
|
|
108
|
+
TurnUpdateStateSchema
|
|
79
109
|
});
|
|
80
110
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/agent-session/schemas/events.ts"],"sourcesContent":["/**\n * Turn/session event product schemas. Event payloads come from the harness; this\n * module owns turn lifecycle events (turn.created / turn.done) and the persisted
|
|
1
|
+
{"version":3,"sources":["../../../src/agent-session/schemas/events.ts"],"sourcesContent":["/**\n * Turn/session event product schemas. Event payloads come from the harness; this\n * module owns turn lifecycle events (turn.created / turn.update / turn.done) and\n * the persisted event unions the store writes. SSE streaming envelopes stay in\n * server/schemas.\n */\nimport { z } from '@hono/zod-openapi';\nimport type { WithRegisteredPassthrough } from '../../core/events/PassthroughEvents';\nimport {\n EventIdSchema,\n EventType as HarnessEventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n} from '../../core/events/schema';\nimport {\n TurnInputItemSchema,\n TurnStateCancelledSchema,\n TurnStateDoneSchema,\n TurnStateErrorSchema,\n TurnStateRunningSchema,\n} from './turn';\n\n/** Harness event types plus the turn lifecycle types owned by agentSession. */\nexport const EventType = {\n ...HarnessEventType,\n TURN_CREATED: 'turn.created',\n TURN_UPDATE: 'turn.update',\n TURN_DONE: 'turn.done',\n} as const;\n\nexport const TurnCreatedEventSchema = z\n .object({\n type: z.literal(EventType.TURN_CREATED).describe('Emitted when a turn starts.'),\n id: EventIdSchema,\n turn_id: z.string().describe('Id of the newly created turn.'),\n previous_turn_id: z.string().nullable().describe('Prior turn this turn chains from; null for a root turn.'),\n input: z.array(TurnInputItemSchema).optional().describe('Input items supplied when the turn was created.'),\n state: TurnStateRunningSchema,\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnCreatedEvent');\n\nexport const TurnDoneEventSchema = z\n .object({\n type: z.literal(EventType.TURN_DONE).describe('Emitted when a turn reaches a terminal state.'),\n id: EventIdSchema,\n state: z\n .discriminatedUnion('status', [TurnStateDoneSchema, TurnStateCancelledSchema, TurnStateErrorSchema])\n .describe('Terminal turn state (done, cancelled, or error).'),\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnDoneEvent');\n\nexport const ActionRequiredSchema = z\n .object({\n id: EventIdSchema,\n })\n .openapi('ActionRequired');\n\nexport const TurnUpdateStatePausedSchema = z\n .object({\n status: z.literal('paused').describe('Turn is paused waiting for required actions.'),\n action_required_on_events: z\n .array(ActionRequiredSchema)\n .describe('Events that still need a user or client action.'),\n })\n .openapi('TurnUpdateStatePaused');\n\nexport const TurnUpdateStateRunningSchema = z\n .object({\n status: z.literal('running').describe('Turn is executing.'),\n })\n .openapi('TurnUpdateStateRunning');\n\nexport const TurnUpdateStateSchema = z\n .discriminatedUnion('status', [TurnUpdateStatePausedSchema, TurnUpdateStateRunningSchema])\n .describe('Live non-terminal turn status.')\n .openapi('TurnUpdateState');\n\nexport const TurnUpdateEventSchema = z\n .object({\n type: z.literal(EventType.TURN_UPDATE).describe('Emitted when a turn pauses or resumes.'),\n id: EventIdSchema,\n state: TurnUpdateStateSchema,\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnUpdateEvent');\n\n/** Built-in durable turn events — lifecycle + content; no deltas, no passthrough. */\nexport const SessionEventSchema = z\n .discriminatedUnion('type', [\n TurnCreatedEventSchema,\n TurnUpdateEventSchema,\n TurnDoneEventSchema,\n ModelMessageEventSchema,\n ToolResponseEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n SandboxCreatedEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseRequiredEventSchema,\n ])\n .openapi('SessionEvent');\n\n/** One row on the session timeline: which turn emitted the event plus the event payload. */\nexport const SessionEventItemSchema = z\n .object({\n turn_id: z.string().describe('Turn that emitted this event.'),\n event: SessionEventSchema,\n })\n .openapi('SessionEventItem');\n\nexport type TurnCreatedEvent = z.infer<typeof TurnCreatedEventSchema>;\nexport type TurnUpdateEvent = z.infer<typeof TurnUpdateEventSchema>;\nexport type TurnDoneEvent = z.infer<typeof TurnDoneEventSchema>;\nexport type SessionEvent = z.infer<typeof SessionEventSchema>;\n/**\n * Durable turn event log entries: {@link SessionEvent} plus any registered\n * passthrough events. Every merged event must carry its monotonic ULID and\n * creation timestamp; shared by append and list operations.\n */\nexport type PersistedTurnEvent = WithRegisteredPassthrough<SessionEvent> & {\n id: string;\n created_at: string;\n};\nexport interface SessionEventItem {\n turn_id: string;\n event: PersistedTurnEvent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,yBAAkB;AAElB,oBAYO;AACP,kBAMO;AAGA,IAAM,YAAY;AAAA,EACvB,GAAG,cAAAA;AAAA,EACH,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AACb;AAEO,IAAM,yBAAyB,qBACnC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,UAAU,YAAY,EAAE,SAAS,6BAA6B;AAAA,EAC9E,IAAI;AAAA,EACJ,SAAS,qBAAE,OAAO,EAAE,SAAS,+BAA+B;AAAA,EAC5D,kBAAkB,qBAAE,OAAO,EAAE,SAAS,EAAE,SAAS,yDAAyD;AAAA,EAC1G,OAAO,qBAAE,MAAM,+BAAmB,EAAE,SAAS,EAAE,SAAS,iDAAiD;AAAA,EACzG,OAAO;AAAA,EACP,YAAY,qBAAE,OAAO,EAAE,SAAS,2BAA2B;AAAA,EAC3D,WAAW,qBAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mEAAmE;AAC/G,CAAC,EACA,QAAQ,kBAAkB;AAEtB,IAAM,sBAAsB,qBAChC,OAAO;AAAA,EACN,MAAM,qBAAE,QAAQ,UAAU,SAAS,EAAE,SAAS,+CAA+C;AAAA,EAC7F,IAAI;AAAA,EACJ,OAAO,qBACJ,mBAAmB,UAAU,CAAC,iCAAqB,sCAA0B,gCAAoB,CAAC,EAClG,SAAS,kDAAkD;AAAA,EAC9D,YAAY,qBAAE,OAAO,EAAE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C,EACA,QAAQ,kBAAkB;","names":["HarnessEventType"]}
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
var EventType = {
|
|
24
24
|
...HarnessEventType,
|
|
25
25
|
TURN_CREATED: "turn.created",
|
|
26
|
+
TURN_UPDATE: "turn.update",
|
|
26
27
|
TURN_DONE: "turn.done"
|
|
27
28
|
};
|
|
28
29
|
var TurnCreatedEventSchema = z.object({
|
|
@@ -42,8 +43,27 @@ var TurnDoneEventSchema = z.object({
|
|
|
42
43
|
created_at: z.string().describe("ISO 8601 event timestamp."),
|
|
43
44
|
thread_id: z.string().nullable().describe("Thread that owns the event; null for turn-level lifecycle events.")
|
|
44
45
|
}).openapi("TurnDoneEvent");
|
|
46
|
+
var ActionRequiredSchema = z.object({
|
|
47
|
+
id: EventIdSchema
|
|
48
|
+
}).openapi("ActionRequired");
|
|
49
|
+
var TurnUpdateStatePausedSchema = z.object({
|
|
50
|
+
status: z.literal("paused").describe("Turn is paused waiting for required actions."),
|
|
51
|
+
action_required_on_events: z.array(ActionRequiredSchema).describe("Events that still need a user or client action.")
|
|
52
|
+
}).openapi("TurnUpdateStatePaused");
|
|
53
|
+
var TurnUpdateStateRunningSchema = z.object({
|
|
54
|
+
status: z.literal("running").describe("Turn is executing.")
|
|
55
|
+
}).openapi("TurnUpdateStateRunning");
|
|
56
|
+
var TurnUpdateStateSchema = z.discriminatedUnion("status", [TurnUpdateStatePausedSchema, TurnUpdateStateRunningSchema]).describe("Live non-terminal turn status.").openapi("TurnUpdateState");
|
|
57
|
+
var TurnUpdateEventSchema = z.object({
|
|
58
|
+
type: z.literal(EventType.TURN_UPDATE).describe("Emitted when a turn pauses or resumes."),
|
|
59
|
+
id: EventIdSchema,
|
|
60
|
+
state: TurnUpdateStateSchema,
|
|
61
|
+
created_at: z.string().describe("ISO 8601 event timestamp."),
|
|
62
|
+
thread_id: z.string().nullable().describe("Thread that owns the event; null for turn-level lifecycle events.")
|
|
63
|
+
}).openapi("TurnUpdateEvent");
|
|
45
64
|
var SessionEventSchema = z.discriminatedUnion("type", [
|
|
46
65
|
TurnCreatedEventSchema,
|
|
66
|
+
TurnUpdateEventSchema,
|
|
47
67
|
TurnDoneEventSchema,
|
|
48
68
|
ModelMessageEventSchema,
|
|
49
69
|
ToolResponseEventSchema,
|
|
@@ -60,10 +80,15 @@ var SessionEventItemSchema = z.object({
|
|
|
60
80
|
event: SessionEventSchema
|
|
61
81
|
}).openapi("SessionEventItem");
|
|
62
82
|
export {
|
|
83
|
+
ActionRequiredSchema,
|
|
63
84
|
EventType,
|
|
64
85
|
SessionEventItemSchema,
|
|
65
86
|
SessionEventSchema,
|
|
66
87
|
TurnCreatedEventSchema,
|
|
67
|
-
TurnDoneEventSchema
|
|
88
|
+
TurnDoneEventSchema,
|
|
89
|
+
TurnUpdateEventSchema,
|
|
90
|
+
TurnUpdateStatePausedSchema,
|
|
91
|
+
TurnUpdateStateRunningSchema,
|
|
92
|
+
TurnUpdateStateSchema
|
|
68
93
|
};
|
|
69
94
|
//# sourceMappingURL=events.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/agent-session/schemas/events.ts"],"sourcesContent":["/**\n * Turn/session event product schemas. Event payloads come from the harness; this\n * module owns turn lifecycle events (turn.created / turn.done) and the persisted
|
|
1
|
+
{"version":3,"sources":["../../../src/agent-session/schemas/events.ts"],"sourcesContent":["/**\n * Turn/session event product schemas. Event payloads come from the harness; this\n * module owns turn lifecycle events (turn.created / turn.update / turn.done) and\n * the persisted event unions the store writes. SSE streaming envelopes stay in\n * server/schemas.\n */\nimport { z } from '@hono/zod-openapi';\nimport type { WithRegisteredPassthrough } from '../../core/events/PassthroughEvents';\nimport {\n EventIdSchema,\n EventType as HarnessEventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n} from '../../core/events/schema';\nimport {\n TurnInputItemSchema,\n TurnStateCancelledSchema,\n TurnStateDoneSchema,\n TurnStateErrorSchema,\n TurnStateRunningSchema,\n} from './turn';\n\n/** Harness event types plus the turn lifecycle types owned by agentSession. */\nexport const EventType = {\n ...HarnessEventType,\n TURN_CREATED: 'turn.created',\n TURN_UPDATE: 'turn.update',\n TURN_DONE: 'turn.done',\n} as const;\n\nexport const TurnCreatedEventSchema = z\n .object({\n type: z.literal(EventType.TURN_CREATED).describe('Emitted when a turn starts.'),\n id: EventIdSchema,\n turn_id: z.string().describe('Id of the newly created turn.'),\n previous_turn_id: z.string().nullable().describe('Prior turn this turn chains from; null for a root turn.'),\n input: z.array(TurnInputItemSchema).optional().describe('Input items supplied when the turn was created.'),\n state: TurnStateRunningSchema,\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnCreatedEvent');\n\nexport const TurnDoneEventSchema = z\n .object({\n type: z.literal(EventType.TURN_DONE).describe('Emitted when a turn reaches a terminal state.'),\n id: EventIdSchema,\n state: z\n .discriminatedUnion('status', [TurnStateDoneSchema, TurnStateCancelledSchema, TurnStateErrorSchema])\n .describe('Terminal turn state (done, cancelled, or error).'),\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnDoneEvent');\n\nexport const ActionRequiredSchema = z\n .object({\n id: EventIdSchema,\n })\n .openapi('ActionRequired');\n\nexport const TurnUpdateStatePausedSchema = z\n .object({\n status: z.literal('paused').describe('Turn is paused waiting for required actions.'),\n action_required_on_events: z\n .array(ActionRequiredSchema)\n .describe('Events that still need a user or client action.'),\n })\n .openapi('TurnUpdateStatePaused');\n\nexport const TurnUpdateStateRunningSchema = z\n .object({\n status: z.literal('running').describe('Turn is executing.'),\n })\n .openapi('TurnUpdateStateRunning');\n\nexport const TurnUpdateStateSchema = z\n .discriminatedUnion('status', [TurnUpdateStatePausedSchema, TurnUpdateStateRunningSchema])\n .describe('Live non-terminal turn status.')\n .openapi('TurnUpdateState');\n\nexport const TurnUpdateEventSchema = z\n .object({\n type: z.literal(EventType.TURN_UPDATE).describe('Emitted when a turn pauses or resumes.'),\n id: EventIdSchema,\n state: TurnUpdateStateSchema,\n created_at: z.string().describe('ISO 8601 event timestamp.'),\n thread_id: z.string().nullable().describe('Thread that owns the event; null for turn-level lifecycle events.'),\n })\n .openapi('TurnUpdateEvent');\n\n/** Built-in durable turn events — lifecycle + content; no deltas, no passthrough. */\nexport const SessionEventSchema = z\n .discriminatedUnion('type', [\n TurnCreatedEventSchema,\n TurnUpdateEventSchema,\n TurnDoneEventSchema,\n ModelMessageEventSchema,\n ToolResponseEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n SandboxCreatedEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseRequiredEventSchema,\n ])\n .openapi('SessionEvent');\n\n/** One row on the session timeline: which turn emitted the event plus the event payload. */\nexport const SessionEventItemSchema = z\n .object({\n turn_id: z.string().describe('Turn that emitted this event.'),\n event: SessionEventSchema,\n })\n .openapi('SessionEventItem');\n\nexport type TurnCreatedEvent = z.infer<typeof TurnCreatedEventSchema>;\nexport type TurnUpdateEvent = z.infer<typeof TurnUpdateEventSchema>;\nexport type TurnDoneEvent = z.infer<typeof TurnDoneEventSchema>;\nexport type SessionEvent = z.infer<typeof SessionEventSchema>;\n/**\n * Durable turn event log entries: {@link SessionEvent} plus any registered\n * passthrough events. Every merged event must carry its monotonic ULID and\n * creation timestamp; shared by append and list operations.\n */\nexport type PersistedTurnEvent = WithRegisteredPassthrough<SessionEvent> & {\n id: string;\n created_at: string;\n};\nexport interface SessionEventItem {\n turn_id: string;\n event: PersistedTurnEvent;\n}\n"],"mappings":";AAMA,SAAS,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BAA8B,EACxC,OAAO;AAAA,EACN,QAAQ,EAAE,QAAQ,QAAQ,EAAE,SAAS,8CAA8C;AAAA,EACnF,2BAA2B,EACxB,MAAM,oBAAoB,EAC1B,SAAS,iDAAiD;AAC/D,CAAC,EACA,QAAQ,uBAAuB;AAE3B,IAAM,+BAA+B,EACzC,OAAO;AAAA,EACN,QAAQ,EAAE,QAAQ,SAAS,EAAE,SAAS,oBAAoB;AAC5D,CAAC,EACA,QAAQ,wBAAwB;AAE5B,IAAM,wBAAwB,EAClC,mBAAmB,UAAU,CAAC,6BAA6B,4BAA4B,CAAC,EACxF,SAAS,gCAAgC,EACzC,QAAQ,iBAAiB;AAErB,IAAM,wBAAwB,EAClC,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,UAAU,WAAW,EAAE,SAAS,wCAAwC;AAAA,EACxF,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,YAAY,EAAE,OAAO,EAAE,SAAS,2BAA2B;AAAA,EAC3D,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mEAAmE;AAC/G,CAAC,EACA,QAAQ,iBAAiB;AAGrB,IAAM,qBAAqB,EAC/B,mBAAmB,QAAQ;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,EACA,QAAQ,cAAc;AAGlB,IAAM,yBAAyB,EACnC,OAAO;AAAA,EACN,SAAS,EAAE,OAAO,EAAE,SAAS,+BAA+B;AAAA,EAC5D,OAAO;AACT,CAAC,EACA,QAAQ,kBAAkB;","names":[]}
|
|
@@ -99,6 +99,9 @@ export declare const SessionAgentInlineSchema: z.ZodObject<{
|
|
|
99
99
|
ask_user_questions: z.ZodDefault<z.ZodObject<{
|
|
100
100
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
101
101
|
}, z.core.$strip>>;
|
|
102
|
+
web_search: z.ZodDefault<z.ZodObject<{
|
|
103
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
102
105
|
}, z.core.$strip>>;
|
|
103
106
|
}, z.core.$strip>;
|
|
104
107
|
}, z.core.$strict>;
|
|
@@ -191,6 +194,9 @@ export declare const SessionAgentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
191
194
|
ask_user_questions: z.ZodDefault<z.ZodObject<{
|
|
192
195
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
193
196
|
}, z.core.$strip>>;
|
|
197
|
+
web_search: z.ZodDefault<z.ZodObject<{
|
|
198
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
194
200
|
}, z.core.$strip>>;
|
|
195
201
|
}, z.core.$strip>;
|
|
196
202
|
}, z.core.$strict>], "type">;
|
|
@@ -303,6 +309,9 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
303
309
|
ask_user_questions: z.ZodDefault<z.ZodObject<{
|
|
304
310
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
305
311
|
}, z.core.$strip>>;
|
|
312
|
+
web_search: z.ZodDefault<z.ZodObject<{
|
|
313
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
314
|
+
}, z.core.$strip>>;
|
|
306
315
|
}, z.core.$strip>>;
|
|
307
316
|
}, z.core.$strip>;
|
|
308
317
|
}, z.core.$strict>], "type">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-session/schemas/session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAetC,eAAO,MAAM,qBAAqB,uCAiBL,CAAC;AAE9B,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,oBA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UX;IAEF,SAAS,CAAC,QAAQ,IAAI,cAAc,EAAE,CAErC;CACF;AAED,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,eAAe,CAW/F"}
|
|
@@ -264,6 +264,7 @@ function buildOpenUIInstruction(builder) {
|
|
|
264
264
|
OPENUI_IMPORTANT_RULES_TAG,
|
|
265
265
|
import_dedent.default`
|
|
266
266
|
- When asked about data, generate realistic/plausible data
|
|
267
|
+
- Prefer OpenUI charts for plot/chart/visualize; images only if downloadable
|
|
267
268
|
- Choose components that best represent the content (tables for comparisons, charts for trends, forms for input, etc.)
|
|
268
269
|
- When you render data in an openui block (tables, charts, KPI cards), do NOT repeat the same numbers/facts in the markdown text outside the block.
|
|
269
270
|
- Text outside the openui block can optionally include:
|
|
@@ -291,7 +292,7 @@ function buildOpenUIInstruction(builder) {
|
|
|
291
292
|
openui.addSection(
|
|
292
293
|
OPENUI_USER_INTERACTION_CHECKLIST_TAG,
|
|
293
294
|
import_dedent.default`
|
|
294
|
-
1.
|
|
295
|
+
1. Plot/chart/visualize or UI-heavy beyond markdown? Use openui.
|
|
295
296
|
2. \`\`\`openui\`\`\` fencing must be closed.`
|
|
296
297
|
);
|
|
297
298
|
}
|
|
@@ -317,7 +318,8 @@ function buildOpenUIDeferredInstruction(builder) {
|
|
|
317
318
|
Before writing any \`\`\`openui fence, the Agent MUST call ${GET_OPENUI_INSTRUCTIONS_TOOL_NAME} with arguments {}.
|
|
318
319
|
Do not invent OpenUI syntax or component APIs without loading those instructions.
|
|
319
320
|
|
|
320
|
-
|
|
321
|
+
Prefer OpenUI for plot/chart/visualize over sandbox code; sandbox images only for downloads.
|
|
322
|
+
Otherwise use OpenUI only when UI-heavy beyond markdown.
|
|
321
323
|
`.trim()
|
|
322
324
|
);
|
|
323
325
|
}
|