@truefoundry/trueforge-core 0.1.2 → 0.1.4-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.
- package/dist/agent-session/TurnResourceResolver.d.ts.map +1 -1
- package/dist/agent-session/TurnResourceResolver.js +1 -4
- package/dist/agent-session/TurnResourceResolver.js.map +1 -1
- package/dist/agent-session/TurnResourceResolver.mjs +1 -4
- package/dist/agent-session/TurnResourceResolver.mjs.map +1 -1
- package/dist/agent-session/index.d.ts +1 -1
- package/dist/agent-session/index.d.ts.map +1 -1
- package/dist/agent-session/index.js.map +1 -1
- package/dist/agent-session/index.mjs.map +1 -1
- package/dist/agent-session/schemas/agentSpec.d.ts +7 -28
- package/dist/agent-session/schemas/agentSpec.d.ts.map +1 -1
- package/dist/agent-session/schemas/agentSpec.js +15 -43
- package/dist/agent-session/schemas/agentSpec.js.map +1 -1
- package/dist/agent-session/schemas/agentSpec.mjs +15 -43
- package/dist/agent-session/schemas/agentSpec.mjs.map +1 -1
- package/dist/agent-session/schemas/session.d.ts +0 -39
- package/dist/agent-session/schemas/session.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +7 -0
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/runtime/AgentThread.d.ts.map +1 -1
- package/dist/core/runtime/AgentThread.js +25 -11
- package/dist/core/runtime/AgentThread.js.map +1 -1
- package/dist/core/runtime/AgentThread.mjs +25 -11
- package/dist/core/runtime/AgentThread.mjs.map +1 -1
- package/dist/core/sandbox/Sandbox.d.ts +15 -5
- package/dist/core/sandbox/Sandbox.d.ts.map +1 -1
- package/dist/core/sandbox/Sandbox.js +200 -84
- package/dist/core/sandbox/Sandbox.js.map +1 -1
- package/dist/core/sandbox/Sandbox.mjs +201 -85
- package/dist/core/sandbox/Sandbox.mjs.map +1 -1
- package/dist/core/sandbox/SandboxErrors.d.ts +7 -3
- package/dist/core/sandbox/SandboxErrors.d.ts.map +1 -1
- package/dist/core/sandbox/SandboxErrors.js +6 -6
- package/dist/core/sandbox/SandboxErrors.js.map +1 -1
- package/dist/core/sandbox/SandboxErrors.mjs +6 -6
- package/dist/core/sandbox/SandboxErrors.mjs.map +1 -1
- package/dist/core/sandbox/codeMode/CodeModeTransport.d.ts +22 -0
- package/dist/core/sandbox/codeMode/CodeModeTransport.d.ts.map +1 -1
- package/dist/core/sandbox/codeMode/CodeModeTransport.js.map +1 -1
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.d.ts +9 -1
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.d.ts.map +1 -1
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.js +12 -0
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.js.map +1 -1
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.mjs +12 -0
- package/dist/core/sandbox/codeMode/nats/CodeModeNatsTransport.mjs.map +1 -1
- package/dist/core/sandbox/constants.d.ts +0 -2
- package/dist/core/sandbox/constants.d.ts.map +1 -1
- package/dist/core/sandbox/constants.js +2 -5
- package/dist/core/sandbox/constants.js.map +1 -1
- package/dist/core/sandbox/constants.mjs +1 -3
- package/dist/core/sandbox/constants.mjs.map +1 -1
- package/dist/core/sandbox/provider/DaytonaProvider.d.ts +4 -0
- package/dist/core/sandbox/provider/DaytonaProvider.d.ts.map +1 -1
- package/dist/core/sandbox/provider/DaytonaProvider.js +27 -5
- package/dist/core/sandbox/provider/DaytonaProvider.js.map +1 -1
- package/dist/core/sandbox/provider/DaytonaProvider.mjs +27 -4
- package/dist/core/sandbox/provider/DaytonaProvider.mjs.map +1 -1
- package/dist/core/sandbox/provider/Provider.d.ts +13 -1
- package/dist/core/sandbox/provider/Provider.d.ts.map +1 -1
- package/dist/core/sandbox/provider/Provider.js.map +1 -1
- package/dist/core/sandbox/provider/Provider.mjs.map +1 -1
- package/dist/core/sandbox/provider/TFYSandboxProvider.d.ts +17 -2
- package/dist/core/sandbox/provider/TFYSandboxProvider.d.ts.map +1 -1
- package/dist/core/sandbox/provider/TFYSandboxProvider.js +81 -17
- package/dist/core/sandbox/provider/TFYSandboxProvider.js.map +1 -1
- package/dist/core/sandbox/provider/TFYSandboxProvider.mjs +82 -13
- package/dist/core/sandbox/provider/TFYSandboxProvider.mjs.map +1 -1
- package/dist/core/sandbox/provider/execEnv.d.ts +6 -0
- package/dist/core/sandbox/provider/execEnv.d.ts.map +1 -0
- package/dist/core/sandbox/provider/execEnv.js +55 -0
- package/dist/core/sandbox/provider/execEnv.js.map +1 -0
- package/dist/core/sandbox/provider/execEnv.mjs +30 -0
- package/dist/core/sandbox/provider/execEnv.mjs.map +1 -0
- package/dist/core/sandbox/sandboxImage.d.ts +2 -5
- package/dist/core/sandbox/sandboxImage.d.ts.map +1 -1
- package/dist/core/sandbox/sandboxImage.js +8 -1
- package/dist/core/sandbox/sandboxImage.js.map +1 -1
- package/dist/core/sandbox/sandboxImage.mjs +6 -1
- package/dist/core/sandbox/sandboxImage.mjs.map +1 -1
- package/dist/core/sandbox/sandboxRef.d.ts +26 -0
- package/dist/core/sandbox/sandboxRef.d.ts.map +1 -0
- package/dist/core/sandbox/sandboxRef.js +69 -0
- package/dist/core/sandbox/sandboxRef.js.map +1 -0
- package/dist/core/sandbox/sandboxRef.mjs +41 -0
- package/dist/core/sandbox/sandboxRef.mjs.map +1 -0
- package/dist/core/sandbox/sandboxScripts.gen.d.ts +1 -1
- package/dist/core/sandbox/sandboxScripts.gen.d.ts.map +1 -1
- package/dist/core/sandbox/sandboxScripts.gen.js +1 -1
- package/dist/core/sandbox/sandboxScripts.gen.js.map +1 -1
- package/dist/core/sandbox/sandboxScripts.gen.mjs +1 -1
- package/dist/core/sandbox/sandboxScripts.gen.mjs.map +1 -1
- package/dist/core/sandbox/skills/ISkillMounter.d.ts +7 -2
- package/dist/core/sandbox/skills/ISkillMounter.d.ts.map +1 -1
- package/dist/core/sandbox/skills/ISkillMounter.js.map +1 -1
- package/dist/core/sandbox/skills/SkillMounter.d.ts +7 -2
- package/dist/core/sandbox/skills/SkillMounter.d.ts.map +1 -1
- package/dist/core/sandbox/skills/SkillMounter.js +5 -6
- package/dist/core/sandbox/skills/SkillMounter.js.map +1 -1
- package/dist/core/sandbox/skills/SkillMounter.mjs +5 -6
- package/dist/core/sandbox/skills/SkillMounter.mjs.map +1 -1
- package/dist/core/sandbox/skills/constants.d.ts +4 -2
- package/dist/core/sandbox/skills/constants.d.ts.map +1 -1
- package/dist/core/sandbox/skills/constants.js +2 -5
- package/dist/core/sandbox/skills/constants.js.map +1 -1
- package/dist/core/sandbox/skills/constants.mjs +2 -4
- package/dist/core/sandbox/skills/constants.mjs.map +1 -1
- package/dist/core/sandbox/skills/index.d.ts +1 -1
- package/dist/core/sandbox/skills/index.d.ts.map +1 -1
- package/dist/core/sandbox/skills/index.js +0 -2
- package/dist/core/sandbox/skills/index.js.map +1 -1
- package/dist/core/sandbox/skills/index.mjs +1 -2
- package/dist/core/sandbox/skills/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/agent-session/schemas/agentSpec.ts"],"sourcesContent":["/** DB AgentSpec wire schema — FQN model names and name-only skill refs. */\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 ModelSpecSchema = 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('AgentSpecModel');\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.union([z.enum(TOOLS_SELECTOR_TAGS), LiteralToolSelectorSchema]);\n\n// require_approval_for_tools: @all, @write, @destructive, or a literal name.\nconst RequireApprovalToolSelectorSchema = z.union([\n z.enum(REQUIRE_APPROVAL_TOOLS_SELECTOR_TAGS),\n LiteralToolSelectorSchema,\n]);\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 CompactionSettingsSchema = z.object({\n enabled: z.boolean().default(true).describe('Summarize older history when context grows too large. Default: true.'),\n compaction_threshold_tokens: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Context size in tokens that triggers compaction. Default: 50000.'),\n});\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 BASIC_AUTH_USERNAME_PATTERN = /^\\S+$/;\n\n/** True when any hostname segment contains `*` (e.g. `*.github.com`). */\nfunction hostContainsWildcard(host: string): boolean {\n return host.split('.').some(segment => segment.includes('*'));\n}\n\nconst SandboxAuthInjectMatchSchema = z.object({\n hosts: z\n .array(\n z\n .string()\n .min(1)\n .refine(host => !hostContainsWildcard(host), {\n message: 'Hosts must be exact hostnames without wildcards',\n })\n .describe('Exact hostname to match (no wildcards).'),\n )\n .min(1)\n .describe('Hostnames that receive injected credentials.'),\n});\n\nconst SandboxBasicAuthDataSchema = z.object({\n type: z.literal('basic').describe('Basic auth credential type.'),\n username: z\n .string()\n .regex(BASIC_AUTH_USERNAME_PATTERN, 'Username must be non-empty and contain no whitespace')\n .describe('Basic-auth username (no whitespace).'),\n password: z.string().min(1).describe('Basic-auth password.'),\n});\n\nconst SandboxGitAuthInjectSchema = z.object({\n type: z.literal('git').describe('Inject credentials for git HTTPS clones.'),\n match: SandboxAuthInjectMatchSchema,\n auth_data: SandboxBasicAuthDataSchema,\n});\n\nconst SandboxNetworkPolicySchema = z\n .object({\n auth_inject: z\n .array(SandboxGitAuthInjectSchema)\n .max(1, 'At most one auth inject rule is supported (type: git)')\n .optional()\n .describe('Up to one rule injecting git basic-auth credentials for exact hosts.'),\n })\n .openapi('SandboxNetworkPolicy');\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 network_policy: SandboxNetworkPolicySchema.optional(),\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-only refs; DB sessions expand mount fields from ISkillStore at turn time.\n\nconst SKILL_NAME_REGEX = /^[A-Za-z0-9._-]+$/;\n\n/** Name-only skill selection; mount fields come from the skill store. */\nconst SkillNameRefSchema = z\n .object({\n name: z\n .string()\n .trim()\n .min(1)\n .max(64)\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('Name of a configured skill (also used as the skill directory name in the sandbox).'),\n })\n .strict()\n .openapi('SkillNameRef');\n\n// --- Response format / messages ---\n\nconst AgentSpecUserMessageSchema = z\n .object({\n type: z.literal('user.message').describe('Seed 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('Seed user message content injected at the start of every session.'),\n })\n .openapi('AgentSpecUserMessage');\n\n// --- Agent spec ---\n\nexport const AgentSpecSchema = z\n .object({\n model: ModelSpecSchema,\n instructions: z\n .string()\n .optional()\n .describe(\"Optional system prompt — the agent's role, behavior, and constraints.\"),\n messages: z\n .array(AgentSpecUserMessageSchema)\n .optional()\n .describe('Optional seed 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\n .array(SkillNameRefSchema)\n .optional()\n .describe('Optional name-only skill references. Requires `config.sandbox.enabled: true`.'),\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 SkillNameRef = z.infer<typeof SkillNameRefSchema>;\n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AAS,KAAK,EAAE;AACpF,CAAC,EACA,QAAQ,eAAe;AAK1B,IAAM,mBAAmB;AAGzB,IAAM,qBAAqB,EACxB,OAAO;AAAA,EACN,MAAM,EACH,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,IAAI,EAAE,EACN,MAAM,kBAAkB,2DAA2D,EACnF,OAAO,OAAK,MAAM,OAAO,MAAM,MAAM,8BAA8B,EACnE,OAAO,OAAK,CAAC,EAAE,WAAW,OAAO,GAAG,+CAA+C,EACnF,SAAS,oFAAoF;AAClG,CAAC,EACA,OAAO,EACP,QAAQ,cAAc;AAIzB,IAAM,6BAA6B,EAChC,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,cAAc,EAAE,SAAS,oBAAoB;AAAA,EAC7D,SAAS,EACN,OAAO,EACP,IAAI,GAAG,wCAAwC,EAC/C,OAAO,aAAW,QAAQ,KAAK,EAAE,SAAS,GAAG,wCAAwC,EACrF,SAAS,mEAAmE;AACjF,CAAC,EACA,QAAQ,sBAAsB;AAI1B,IAAM,kBAAkB,EAC5B,OAAO;AAAA,EACN,OAAO;AAAA,EACP,cAAc,EACX,OAAO,EACP,SAAS,EACT,SAAS,4EAAuE;AAAA,EACnF,UAAU,EACP,MAAM,0BAA0B,EAChC,SAAS,EACT,SAAS,qEAAqE;AAAA,EACjF,aAAa,EACV,MAAM,sBAAsB,EAC5B,SAAS,EACT,SAAS,mDAAmD;AAAA,EAC/D,iBAAiB,qBAAqB,SAAS;AAAA,EAC/C,QAAQ,EACL,MAAM,kBAAkB,EACxB,SAAS,EACT,SAAS,+EAA+E;AAAA;AAAA,EAE3F,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 name-only skill refs. */\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 CompactionSettingsSchema = z\n .object({\n enabled: z.boolean().default(true).describe('Summarize older history when context grows too large. Default: true.'),\n compaction_threshold_tokens: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Context size in tokens that triggers compaction. Default: 50000.'),\n })\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-only refs; DB sessions expand mount fields from ISkillStore at turn time.\n\nconst SKILL_NAME_REGEX = /^[A-Za-z0-9._-]+$/;\n\n/** Name-only 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 .max(64)\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('Name of a configured skill (also used as the skill directory name in the sandbox).'),\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\n .array(SkillSchema)\n .optional()\n .describe('Optional name-only skill references. Requires `config.sandbox.enabled: true`.'),\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,S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B,IAAM,cAAc,EACjB,OAAO;AAAA,EACN,MAAM,EACH,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,IAAI,EAAE,EACN,MAAM,kBAAkB,2DAA2D,EACnF,OAAO,OAAK,MAAM,OAAO,MAAM,MAAM,8BAA8B,EACnE,OAAO,OAAK,CAAC,EAAE,WAAW,OAAO,GAAG,+CAA+C,EACnF,SAAS,oFAAoF;AAClG,CAAC,EACA,OAAO,EACP,QAAQ,OAAO;AAIlB,IAAM,2BAA2B,EAC9B,OAAO;AAAA,EACN,MAAM,EAAE,QAAQ,cAAc,EAAE,SAAS,uBAAuB;AAAA,EAChE,SAAS,EACN,OAAO,EACP,IAAI,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,EACL,MAAM,WAAW,EACjB,SAAS,EACT,SAAS,+EAA+E;AAAA;AAAA,EAE3F,QAAQ,oBAAoB,QAAQ,MAAM,oBAAoB,MAAM,CAAC,CAAC,CAAC;AACzE,CAAC,EACA,SAAS,+EAA+E,EACxF,QAAQ,WAAW;","names":[]}
|
|
@@ -69,19 +69,6 @@ export declare const SessionAgentInlineSchema: z.ZodObject<{
|
|
|
69
69
|
sandbox: z.ZodDefault<z.ZodObject<{
|
|
70
70
|
enabled: z.ZodBoolean;
|
|
71
71
|
file_downloads: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
-
network_policy: z.ZodOptional<z.ZodObject<{
|
|
73
|
-
auth_inject: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"git">;
|
|
75
|
-
match: z.ZodObject<{
|
|
76
|
-
hosts: z.ZodArray<z.ZodString>;
|
|
77
|
-
}, z.core.$strip>;
|
|
78
|
-
auth_data: z.ZodObject<{
|
|
79
|
-
type: z.ZodLiteral<"basic">;
|
|
80
|
-
username: z.ZodString;
|
|
81
|
-
password: z.ZodString;
|
|
82
|
-
}, z.core.$strip>;
|
|
83
|
-
}, z.core.$strip>>>;
|
|
84
|
-
}, z.core.$strip>>;
|
|
85
72
|
}, z.core.$strip>>;
|
|
86
73
|
dynamic_sub_agents: z.ZodDefault<z.ZodObject<{
|
|
87
74
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -170,19 +157,6 @@ export declare const SessionAgentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
170
157
|
sandbox: z.ZodDefault<z.ZodObject<{
|
|
171
158
|
enabled: z.ZodBoolean;
|
|
172
159
|
file_downloads: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
-
network_policy: z.ZodOptional<z.ZodObject<{
|
|
174
|
-
auth_inject: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
175
|
-
type: z.ZodLiteral<"git">;
|
|
176
|
-
match: z.ZodObject<{
|
|
177
|
-
hosts: z.ZodArray<z.ZodString>;
|
|
178
|
-
}, z.core.$strip>;
|
|
179
|
-
auth_data: z.ZodObject<{
|
|
180
|
-
type: z.ZodLiteral<"basic">;
|
|
181
|
-
username: z.ZodString;
|
|
182
|
-
password: z.ZodString;
|
|
183
|
-
}, z.core.$strip>;
|
|
184
|
-
}, z.core.$strip>>>;
|
|
185
|
-
}, z.core.$strip>>;
|
|
186
160
|
}, z.core.$strip>>;
|
|
187
161
|
dynamic_sub_agents: z.ZodDefault<z.ZodObject<{
|
|
188
162
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -272,19 +246,6 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
272
246
|
sandbox: z.ZodDefault<z.ZodObject<{
|
|
273
247
|
enabled: z.ZodBoolean;
|
|
274
248
|
file_downloads: z.ZodDefault<z.ZodBoolean>;
|
|
275
|
-
network_policy: z.ZodOptional<z.ZodObject<{
|
|
276
|
-
auth_inject: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
277
|
-
type: z.ZodLiteral<"git">;
|
|
278
|
-
match: z.ZodObject<{
|
|
279
|
-
hosts: z.ZodArray<z.ZodString>;
|
|
280
|
-
}, z.core.$strip>;
|
|
281
|
-
auth_data: z.ZodObject<{
|
|
282
|
-
type: z.ZodLiteral<"basic">;
|
|
283
|
-
username: z.ZodString;
|
|
284
|
-
password: z.ZodString;
|
|
285
|
-
}, z.core.$strip>;
|
|
286
|
-
}, z.core.$strip>>>;
|
|
287
|
-
}, z.core.$strip>>;
|
|
288
249
|
}, z.core.$strip>>;
|
|
289
250
|
dynamic_sub_agents: z.ZodDefault<z.ZodObject<{
|
|
290
251
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -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;AAGtC,eAAO,MAAM,2BAA2B;;;;kBAWL,CAAC;AAEpC,eAAO,MAAM,wBAAwB
|
|
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;AAGtC,eAAO,MAAM,2BAA2B;;;;kBAWL,CAAC;AAEpC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAML,CAAC;AAEjC,oEAAoE;AACpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAEL,CAAC;AAE3B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUL,CAAC;AAEtB,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -48,11 +48,12 @@ export { describeUnknownError, extractErrorLogFields } from './util/errorLogFiel
|
|
|
48
48
|
export { PromiseTimeoutError, withTimeout } from './util/promiseUtils';
|
|
49
49
|
export { CodeModeDispatcher } from './sandbox/codeMode/CodeModeDispatcher';
|
|
50
50
|
export type { CodeModeLogger } from './sandbox/codeMode/CodeModeDispatcher';
|
|
51
|
-
export type { CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';
|
|
51
|
+
export type { CodeModeClientInstall, CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';
|
|
52
52
|
export { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from './sandbox/codeMode/types';
|
|
53
53
|
export type { CodeModeErrorSource, CodeModeReply, CodeModeRequest } from './sandbox/codeMode/types';
|
|
54
54
|
export { DaytonaSandboxProvider } from './sandbox/provider/DaytonaProvider';
|
|
55
55
|
export type { DaytonaSandboxProviderOptions } from './sandbox/provider/DaytonaProvider';
|
|
56
|
+
export { absolutizeRelativeExecEnv } from './sandbox/provider/execEnv';
|
|
56
57
|
export { ensureExecSuccess, shellEscape } from './sandbox/provider/Provider';
|
|
57
58
|
export type { ExecErrorResult, ExecResult, ExecSuccessResult, SandboxBuild, SandboxBuildMetadata, SandboxBuildStatus, SandboxExecParams, SandboxInit, SandboxProvider, } from './sandbox/provider/Provider';
|
|
58
59
|
export { TFYSandboxProvider } from './sandbox/provider/TFYSandboxProvider';
|
|
@@ -60,6 +61,8 @@ export { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand
|
|
|
60
61
|
export type { SandboxInfo } from './sandbox/Sandbox';
|
|
61
62
|
export { SandboxError, SandboxFileNotFoundError, SandboxFileTooLargeError, SandboxNotAvailableError, SandboxPathIsDirectoryError, validateNoPathTraversal, validateSandboxOwnedByTenant, } from './sandbox/SandboxErrors';
|
|
62
63
|
export { SANDBOX_IMAGE_URI } from './sandbox/sandboxImage';
|
|
64
|
+
export { existingSandboxIdForProvider, formatSandboxId, parseSandboxId, rawSandboxId } from './sandbox/sandboxRef';
|
|
65
|
+
export type { SandboxRefParts } from './sandbox/sandboxRef';
|
|
63
66
|
export { InstructionBuilder } from './InstructionBuilder';
|
|
64
67
|
export { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from './sandbox/skills';
|
|
65
68
|
export type { GitSkill, ISkillMounter } from './sandbox/skills';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAC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B,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAC3G,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnH,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACtG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -82,6 +82,7 @@ __export(core_exports, {
|
|
|
82
82
|
UserToolResponseMessageSchema: () => import_schema.UserToolResponseMessageSchema,
|
|
83
83
|
VERCEL_AI_PROVIDER_NAMES: () => import_VercelAILLM.VERCEL_AI_PROVIDER_NAMES,
|
|
84
84
|
VercelAILLM: () => import_VercelAILLM.VercelAILLM,
|
|
85
|
+
absolutizeRelativeExecEnv: () => import_execEnv.absolutizeRelativeExecEnv,
|
|
85
86
|
askUserQuestion: () => import_AskUserQuestion.askUserQuestion,
|
|
86
87
|
buildWriteAndRunScriptCommand: () => import_Sandbox.buildWriteAndRunScriptCommand,
|
|
87
88
|
contextCompaction: () => import_ContextCompaction.contextCompaction,
|
|
@@ -90,7 +91,9 @@ __export(core_exports, {
|
|
|
90
91
|
describeUnknownError: () => import_errorLogFields.describeUnknownError,
|
|
91
92
|
dynamicSubAgents: () => import_DynamicSubAgents.dynamicSubAgents,
|
|
92
93
|
ensureExecSuccess: () => import_Provider.ensureExecSuccess,
|
|
94
|
+
existingSandboxIdForProvider: () => import_sandboxRef.existingSandboxIdForProvider,
|
|
93
95
|
extractErrorLogFields: () => import_errorLogFields.extractErrorLogFields,
|
|
96
|
+
formatSandboxId: () => import_sandboxRef.formatSandboxId,
|
|
94
97
|
getSkillPath: () => import_skills.getSkillPath,
|
|
95
98
|
isAgentInputUserMessage: () => import_UserInputMessage.isAgentInputUserMessage,
|
|
96
99
|
isAuthRequired: () => import_IMCPServer.isAuthRequired,
|
|
@@ -99,6 +102,8 @@ __export(core_exports, {
|
|
|
99
102
|
largeToolResponse: () => import_LargeToolResponse.largeToolResponse,
|
|
100
103
|
newEventId: () => import_schema.newEventId,
|
|
101
104
|
openUI: () => import_OpenUI.openUI,
|
|
105
|
+
parseSandboxId: () => import_sandboxRef.parseSandboxId,
|
|
106
|
+
rawSandboxId: () => import_sandboxRef.rawSandboxId,
|
|
102
107
|
renderSkillPromptBody: () => import_skills.renderSkillPromptBody,
|
|
103
108
|
shellEscape: () => import_Provider.shellEscape,
|
|
104
109
|
toOpenAIResponseFormat: () => import_responseFormat.toOpenAIResponseFormat,
|
|
@@ -135,11 +140,13 @@ var import_promiseUtils = require("./util/promiseUtils.js");
|
|
|
135
140
|
var import_CodeModeDispatcher = require("./sandbox/codeMode/CodeModeDispatcher.js");
|
|
136
141
|
var import_types = require("./sandbox/codeMode/types.js");
|
|
137
142
|
var import_DaytonaProvider = require("./sandbox/provider/DaytonaProvider.js");
|
|
143
|
+
var import_execEnv = require("./sandbox/provider/execEnv.js");
|
|
138
144
|
var import_Provider = require("./sandbox/provider/Provider.js");
|
|
139
145
|
var import_TFYSandboxProvider = require("./sandbox/provider/TFYSandboxProvider.js");
|
|
140
146
|
var import_Sandbox = require("./sandbox/Sandbox.js");
|
|
141
147
|
var import_SandboxErrors = require("./sandbox/SandboxErrors.js");
|
|
142
148
|
var import_sandboxImage = require("./sandbox/sandboxImage.js");
|
|
149
|
+
var import_sandboxRef = require("./sandbox/sandboxRef.js");
|
|
143
150
|
var import_InstructionBuilder = require("./InstructionBuilder.js");
|
|
144
151
|
var import_skills = require("./sandbox/skills/index.js");
|
|
145
152
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -206,6 +213,7 @@ var import_skills = require("./sandbox/skills/index.js");
|
|
|
206
213
|
UserToolResponseMessageSchema,
|
|
207
214
|
VERCEL_AI_PROVIDER_NAMES,
|
|
208
215
|
VercelAILLM,
|
|
216
|
+
absolutizeRelativeExecEnv,
|
|
209
217
|
askUserQuestion,
|
|
210
218
|
buildWriteAndRunScriptCommand,
|
|
211
219
|
contextCompaction,
|
|
@@ -214,7 +222,9 @@ var import_skills = require("./sandbox/skills/index.js");
|
|
|
214
222
|
describeUnknownError,
|
|
215
223
|
dynamicSubAgents,
|
|
216
224
|
ensureExecSuccess,
|
|
225
|
+
existingSandboxIdForProvider,
|
|
217
226
|
extractErrorLogFields,
|
|
227
|
+
formatSandboxId,
|
|
218
228
|
getSkillPath,
|
|
219
229
|
isAgentInputUserMessage,
|
|
220
230
|
isAuthRequired,
|
|
@@ -223,6 +233,8 @@ var import_skills = require("./sandbox/skills/index.js");
|
|
|
223
233
|
largeToolResponse,
|
|
224
234
|
newEventId,
|
|
225
235
|
openUI,
|
|
236
|
+
parseSandboxId,
|
|
237
|
+
rawSandboxId,
|
|
226
238
|
renderSkillPromptBody,
|
|
227
239
|
shellEscape,
|
|
228
240
|
toOpenAIResponseFormat,
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["/**\n * Public agent execution harness.\n * Intentional consumer-facing exports only (production API).\n */\n\n// Runtime\nexport type { AgentDefinition, ModelParams } from './runtime/AgentDefinition';\nexport { AgentThread } from './runtime/AgentThread';\nexport type {\n AgentInfo,\n AgentParent,\n AgentSendInput,\n AgentThreadAppendContext,\n AgentThreadCreateSubAgent,\n AgentThreadEvent,\n AgentThreadExecutionEvent,\n AgentThreadExecutionResult,\n SubAgentCompletionMarker,\n} from './runtime/AgentThread.types';\nexport { AgentThreadOrchestrator } from './runtime/AgentThreadOrchestrator';\nexport type { CreateDynamicSubAgentThread } from './runtime/CreateDynamicSubAgentThread';\nexport { isAgentInputUserMessage, isEmptyMessageContent, isFileContentPart } from './runtime/UserInputMessage';\nexport type { AgentInputUserMessage } from './runtime/UserInputMessage';\n\n// Capability contracts\nexport type { AgentCapability, CapabilityState, JsonValue } from './capabilities/AgentCapability';\nexport type {\n AgentContextProcessorOutput,\n AgentThreadExecutionContext,\n PostToolCallAgentContextProcessor,\n PreLLMEphemeralAgentContextProcessor,\n} from './capabilities/AgentContextProcessor';\n\n// Built-in factories\nexport { askUserQuestion } from './capabilities/builtins/AskUserQuestion';\nexport {\n DEFAULT_CONTEXT_COMPACTION_THRESHOLD_TOKENS,\n contextCompaction,\n} from './capabilities/builtins/ContextCompaction';\nexport { currentDateTime } from './capabilities/builtins/CurrentDateTime';\nexport { SUB_AGENT_IDENTITY, dynamicSubAgents } from './capabilities/builtins/DynamicSubAgents';\nexport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n largeToolResponse,\n} from './capabilities/builtins/LargeToolResponse';\nexport { openUI } from './capabilities/builtins/OpenUI';\n\n// MCP contracts\nexport type { ApprovalDecision } from './events/schema';\nexport { ClientSideTool } from './mcp/ClientSideTool';\nexport { isAuthRequired, toolResultResponse } from './mcp/IMCPServer';\nexport type {\n AgentToolSchema,\n AuthRequiredResponse,\n CallToolResponse,\n IToolSet,\n ListToolsResponse,\n MCPAuthRequired,\n ToolSource,\n} from './mcp/IMCPServer';\nexport { LocalToolMCP, defineTool } from './mcp/LocalToolMCP';\nexport type { ToolDefinition } from './mcp/LocalToolMCP';\n\n// Remote MCP server, split into a shared, policy-free connection (`RemoteMCP`) and a per-agent policy\n// wrapper (`ToolSet`). `RemoteMCP` connects itself from a `url` + `headers`; the networking helpers\n// live in the harness-internal `remoteMcpClient` module.\nexport { RemoteMCP } from './mcp/RemoteMCP';\nexport type { RemoteMcpHeaders, ResolveHeadersResult } from './mcp/RemoteMCP';\nexport type { RemoteMcpConnection, RemoteMcpTransportType } from './mcp/remoteMcpClient';\nexport type { ToolSelectorConfig } from './mcp/ToolSelectorPolicy';\nexport {\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 './mcp/toolSelectors';\nexport { ToolSet } from './mcp/ToolSet';\n\n// LLM contracts\nexport type { AgentMetadata, ILLM, LLMCreateParams, LLMCreateParamsStreaming } from './llm/ILLM';\nexport { ResponseFormatSchema, toOpenAIResponseFormat } from './llm/responseFormat';\nexport type { ResponseFormat } from './llm/responseFormat';\nexport { SUPPORTED_REASONING_EFFORTS, VERCEL_AI_PROVIDER_NAMES, VercelAILLM } from './llm/VercelAILLM';\nexport type { VercelAILLMConfig, VercelAIProviderConfig, VercelAIProviderName } from './llm/VercelAILLM';\n\n// Event contracts\nexport {\n ActionRequiredEventSchema,\n AgentInputUserMessageSchema,\n EventIdSchema,\n EventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageDeltaEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ThreadOverwriteContextEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n UserToolApprovalMessageSchema,\n UserToolResponseMessageSchema,\n newEventId,\n} from './events/schema';\nexport type {\n AgentOutputEvent,\n MCPAuthRequiredEvent,\n MCPServerAuthInfo,\n MCPServerInitInfo,\n ThreadDoneEvent,\n ThreadOverwriteContextEvent,\n} from './events/schema';\nexport { CompletionUsageSchema } from './llm/LLMTypes';\nexport type { CompletionUsage } from './llm/LLMTypes';\nexport { InternalEventType } from './runtime/AgentThread.types';\nexport type { AgentThreadSendBatch, ContextMessage } from './runtime/AgentThread.types';\nexport { AgentThreadMetricsSchema } from './runtime/metrics';\nexport type { AgentThreadMetrics } from './runtime/metrics';\n\n// Tracing\nexport type {\n AgentExecutionTrace,\n AgentLocalToolTrace,\n AgentRemoteMcpToolTrace,\n AgentTracing,\n} from './tracing/AgentTracing';\n\n// Errors / utils\nexport { AgentHarnessError, McpConnectionError, McpDcrConfigurationError } from './errors';\nexport { describeUnknownError, extractErrorLogFields } from './util/errorLogFields';\nexport { PromiseTimeoutError, withTimeout } from './util/promiseUtils';\n\n// Sandbox (concrete implementation; provider details exported for composition)\nexport { CodeModeDispatcher } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeLogger } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';\nexport { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from './sandbox/codeMode/types';\nexport type { CodeModeErrorSource, CodeModeReply, CodeModeRequest } from './sandbox/codeMode/types';\nexport { DaytonaSandboxProvider } from './sandbox/provider/DaytonaProvider';\nexport type { DaytonaSandboxProviderOptions } from './sandbox/provider/DaytonaProvider';\nexport { ensureExecSuccess, shellEscape } from './sandbox/provider/Provider';\nexport type {\n ExecErrorResult,\n ExecResult,\n ExecSuccessResult,\n SandboxBuild,\n SandboxBuildMetadata,\n SandboxBuildStatus,\n SandboxExecParams,\n SandboxInit,\n SandboxProvider,\n} from './sandbox/provider/Provider';\nexport { TFYSandboxProvider } from './sandbox/provider/TFYSandboxProvider';\nexport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand } from './sandbox/Sandbox';\nexport type { SandboxInfo } from './sandbox/Sandbox';\nexport {\n SandboxError,\n SandboxFileNotFoundError,\n SandboxFileTooLargeError,\n SandboxNotAvailableError,\n SandboxPathIsDirectoryError,\n validateNoPathTraversal,\n validateSandboxOwnedByTenant,\n} from './sandbox/SandboxErrors';\nexport { SANDBOX_IMAGE_URI } from './sandbox/sandboxImage';\n\n// Skills: the ISkillMounter seam lets hosts plug in their own skill sources\nexport { InstructionBuilder } from './InstructionBuilder';\nexport { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from './sandbox/skills';\nexport type { GitSkill, ISkillMounter } from './sandbox/skills';\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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,yBAA4B;AAY5B,qCAAwC;AAExC,8BAAkF;AAalF,6BAAgC;AAChC,+BAGO;AACP,6BAAgC;AAChC,8BAAqD;AACrD,+BAKO;AACP,oBAAuB;AAIvB,4BAA+B;AAC/B,wBAAmD;AAUnD,0BAAyC;AAMzC,uBAA0B;AAI1B,2BAOO;AACP,qBAAwB;AAIxB,4BAA6D;AAE7D,yBAAmF;AAInF,oBAmBO;AASP,sBAAsC;AAEtC,IAAAA,sBAAkC;AAElC,qBAAyC;AAYzC,oBAAgF;AAChF,4BAA4D;AAC5D,0BAAiD;AAGjD,gCAAmC;AAGnC,mBAAsF;AAEtF,6BAAuC;AAEvC,sBAA+C;AAY/C,gCAAmC;AACnC,qBAAuF;AAEvF,2BAQO;AACP,0BAAkC;
|
|
1
|
+
{"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["/**\n * Public agent execution harness.\n * Intentional consumer-facing exports only (production API).\n */\n\n// Runtime\nexport type { AgentDefinition, ModelParams } from './runtime/AgentDefinition';\nexport { AgentThread } from './runtime/AgentThread';\nexport type {\n AgentInfo,\n AgentParent,\n AgentSendInput,\n AgentThreadAppendContext,\n AgentThreadCreateSubAgent,\n AgentThreadEvent,\n AgentThreadExecutionEvent,\n AgentThreadExecutionResult,\n SubAgentCompletionMarker,\n} from './runtime/AgentThread.types';\nexport { AgentThreadOrchestrator } from './runtime/AgentThreadOrchestrator';\nexport type { CreateDynamicSubAgentThread } from './runtime/CreateDynamicSubAgentThread';\nexport { isAgentInputUserMessage, isEmptyMessageContent, isFileContentPart } from './runtime/UserInputMessage';\nexport type { AgentInputUserMessage } from './runtime/UserInputMessage';\n\n// Capability contracts\nexport type { AgentCapability, CapabilityState, JsonValue } from './capabilities/AgentCapability';\nexport type {\n AgentContextProcessorOutput,\n AgentThreadExecutionContext,\n PostToolCallAgentContextProcessor,\n PreLLMEphemeralAgentContextProcessor,\n} from './capabilities/AgentContextProcessor';\n\n// Built-in factories\nexport { askUserQuestion } from './capabilities/builtins/AskUserQuestion';\nexport {\n DEFAULT_CONTEXT_COMPACTION_THRESHOLD_TOKENS,\n contextCompaction,\n} from './capabilities/builtins/ContextCompaction';\nexport { currentDateTime } from './capabilities/builtins/CurrentDateTime';\nexport { SUB_AGENT_IDENTITY, dynamicSubAgents } from './capabilities/builtins/DynamicSubAgents';\nexport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n largeToolResponse,\n} from './capabilities/builtins/LargeToolResponse';\nexport { openUI } from './capabilities/builtins/OpenUI';\n\n// MCP contracts\nexport type { ApprovalDecision } from './events/schema';\nexport { ClientSideTool } from './mcp/ClientSideTool';\nexport { isAuthRequired, toolResultResponse } from './mcp/IMCPServer';\nexport type {\n AgentToolSchema,\n AuthRequiredResponse,\n CallToolResponse,\n IToolSet,\n ListToolsResponse,\n MCPAuthRequired,\n ToolSource,\n} from './mcp/IMCPServer';\nexport { LocalToolMCP, defineTool } from './mcp/LocalToolMCP';\nexport type { ToolDefinition } from './mcp/LocalToolMCP';\n\n// Remote MCP server, split into a shared, policy-free connection (`RemoteMCP`) and a per-agent policy\n// wrapper (`ToolSet`). `RemoteMCP` connects itself from a `url` + `headers`; the networking helpers\n// live in the harness-internal `remoteMcpClient` module.\nexport { RemoteMCP } from './mcp/RemoteMCP';\nexport type { RemoteMcpHeaders, ResolveHeadersResult } from './mcp/RemoteMCP';\nexport type { RemoteMcpConnection, RemoteMcpTransportType } from './mcp/remoteMcpClient';\nexport type { ToolSelectorConfig } from './mcp/ToolSelectorPolicy';\nexport {\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 './mcp/toolSelectors';\nexport { ToolSet } from './mcp/ToolSet';\n\n// LLM contracts\nexport type { AgentMetadata, ILLM, LLMCreateParams, LLMCreateParamsStreaming } from './llm/ILLM';\nexport { ResponseFormatSchema, toOpenAIResponseFormat } from './llm/responseFormat';\nexport type { ResponseFormat } from './llm/responseFormat';\nexport { SUPPORTED_REASONING_EFFORTS, VERCEL_AI_PROVIDER_NAMES, VercelAILLM } from './llm/VercelAILLM';\nexport type { VercelAILLMConfig, VercelAIProviderConfig, VercelAIProviderName } from './llm/VercelAILLM';\n\n// Event contracts\nexport {\n ActionRequiredEventSchema,\n AgentInputUserMessageSchema,\n EventIdSchema,\n EventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageDeltaEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ThreadOverwriteContextEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n UserToolApprovalMessageSchema,\n UserToolResponseMessageSchema,\n newEventId,\n} from './events/schema';\nexport type {\n AgentOutputEvent,\n MCPAuthRequiredEvent,\n MCPServerAuthInfo,\n MCPServerInitInfo,\n ThreadDoneEvent,\n ThreadOverwriteContextEvent,\n} from './events/schema';\nexport { CompletionUsageSchema } from './llm/LLMTypes';\nexport type { CompletionUsage } from './llm/LLMTypes';\nexport { InternalEventType } from './runtime/AgentThread.types';\nexport type { AgentThreadSendBatch, ContextMessage } from './runtime/AgentThread.types';\nexport { AgentThreadMetricsSchema } from './runtime/metrics';\nexport type { AgentThreadMetrics } from './runtime/metrics';\n\n// Tracing\nexport type {\n AgentExecutionTrace,\n AgentLocalToolTrace,\n AgentRemoteMcpToolTrace,\n AgentTracing,\n} from './tracing/AgentTracing';\n\n// Errors / utils\nexport { AgentHarnessError, McpConnectionError, McpDcrConfigurationError } from './errors';\nexport { describeUnknownError, extractErrorLogFields } from './util/errorLogFields';\nexport { PromiseTimeoutError, withTimeout } from './util/promiseUtils';\n\n// Sandbox (concrete implementation; provider details exported for composition)\nexport { CodeModeDispatcher } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeLogger } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeClientInstall, CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';\nexport { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from './sandbox/codeMode/types';\nexport type { CodeModeErrorSource, CodeModeReply, CodeModeRequest } from './sandbox/codeMode/types';\nexport { DaytonaSandboxProvider } from './sandbox/provider/DaytonaProvider';\nexport type { DaytonaSandboxProviderOptions } from './sandbox/provider/DaytonaProvider';\nexport { absolutizeRelativeExecEnv } from './sandbox/provider/execEnv';\nexport { ensureExecSuccess, shellEscape } from './sandbox/provider/Provider';\nexport type {\n ExecErrorResult,\n ExecResult,\n ExecSuccessResult,\n SandboxBuild,\n SandboxBuildMetadata,\n SandboxBuildStatus,\n SandboxExecParams,\n SandboxInit,\n SandboxProvider,\n} from './sandbox/provider/Provider';\nexport { TFYSandboxProvider } from './sandbox/provider/TFYSandboxProvider';\nexport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand } from './sandbox/Sandbox';\nexport type { SandboxInfo } from './sandbox/Sandbox';\nexport {\n SandboxError,\n SandboxFileNotFoundError,\n SandboxFileTooLargeError,\n SandboxNotAvailableError,\n SandboxPathIsDirectoryError,\n validateNoPathTraversal,\n validateSandboxOwnedByTenant,\n} from './sandbox/SandboxErrors';\nexport { SANDBOX_IMAGE_URI } from './sandbox/sandboxImage';\nexport { existingSandboxIdForProvider, formatSandboxId, parseSandboxId, rawSandboxId } from './sandbox/sandboxRef';\nexport type { SandboxRefParts } from './sandbox/sandboxRef';\n\n// Skills: the ISkillMounter seam lets hosts plug in their own skill sources\nexport { InstructionBuilder } from './InstructionBuilder';\nexport { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from './sandbox/skills';\nexport type { GitSkill, ISkillMounter } from './sandbox/skills';\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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,yBAA4B;AAY5B,qCAAwC;AAExC,8BAAkF;AAalF,6BAAgC;AAChC,+BAGO;AACP,6BAAgC;AAChC,8BAAqD;AACrD,+BAKO;AACP,oBAAuB;AAIvB,4BAA+B;AAC/B,wBAAmD;AAUnD,0BAAyC;AAMzC,uBAA0B;AAI1B,2BAOO;AACP,qBAAwB;AAIxB,4BAA6D;AAE7D,yBAAmF;AAInF,oBAmBO;AASP,sBAAsC;AAEtC,IAAAA,sBAAkC;AAElC,qBAAyC;AAYzC,oBAAgF;AAChF,4BAA4D;AAC5D,0BAAiD;AAGjD,gCAAmC;AAGnC,mBAAsF;AAEtF,6BAAuC;AAEvC,qBAA0C;AAC1C,sBAA+C;AAY/C,gCAAmC;AACnC,qBAAuF;AAEvF,2BAQO;AACP,0BAAkC;AAClC,wBAA4F;AAI5F,gCAAmC;AACnC,oBAAmF;","names":["import_AgentThread"]}
|
package/dist/core/index.mjs
CHANGED
|
@@ -60,6 +60,7 @@ import { PromiseTimeoutError, withTimeout } from "./util/promiseUtils.mjs";
|
|
|
60
60
|
import { CodeModeDispatcher } from "./sandbox/codeMode/CodeModeDispatcher.mjs";
|
|
61
61
|
import { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from "./sandbox/codeMode/types.mjs";
|
|
62
62
|
import { DaytonaSandboxProvider } from "./sandbox/provider/DaytonaProvider.mjs";
|
|
63
|
+
import { absolutizeRelativeExecEnv } from "./sandbox/provider/execEnv.mjs";
|
|
63
64
|
import { ensureExecSuccess, shellEscape } from "./sandbox/provider/Provider.mjs";
|
|
64
65
|
import { TFYSandboxProvider } from "./sandbox/provider/TFYSandboxProvider.mjs";
|
|
65
66
|
import { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand } from "./sandbox/Sandbox.mjs";
|
|
@@ -73,6 +74,7 @@ import {
|
|
|
73
74
|
validateSandboxOwnedByTenant
|
|
74
75
|
} from "./sandbox/SandboxErrors.mjs";
|
|
75
76
|
import { SANDBOX_IMAGE_URI } from "./sandbox/sandboxImage.mjs";
|
|
77
|
+
import { existingSandboxIdForProvider, formatSandboxId, parseSandboxId, rawSandboxId } from "./sandbox/sandboxRef.mjs";
|
|
76
78
|
import { InstructionBuilder } from "./InstructionBuilder.mjs";
|
|
77
79
|
import { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from "./sandbox/skills/index.mjs";
|
|
78
80
|
export {
|
|
@@ -138,6 +140,7 @@ export {
|
|
|
138
140
|
UserToolResponseMessageSchema,
|
|
139
141
|
VERCEL_AI_PROVIDER_NAMES,
|
|
140
142
|
VercelAILLM,
|
|
143
|
+
absolutizeRelativeExecEnv,
|
|
141
144
|
askUserQuestion,
|
|
142
145
|
buildWriteAndRunScriptCommand,
|
|
143
146
|
contextCompaction,
|
|
@@ -146,7 +149,9 @@ export {
|
|
|
146
149
|
describeUnknownError,
|
|
147
150
|
dynamicSubAgents,
|
|
148
151
|
ensureExecSuccess,
|
|
152
|
+
existingSandboxIdForProvider,
|
|
149
153
|
extractErrorLogFields,
|
|
154
|
+
formatSandboxId,
|
|
150
155
|
getSkillPath,
|
|
151
156
|
isAgentInputUserMessage,
|
|
152
157
|
isAuthRequired,
|
|
@@ -155,6 +160,8 @@ export {
|
|
|
155
160
|
largeToolResponse,
|
|
156
161
|
newEventId,
|
|
157
162
|
openUI,
|
|
163
|
+
parseSandboxId,
|
|
164
|
+
rawSandboxId,
|
|
158
165
|
renderSkillPromptBody,
|
|
159
166
|
shellEscape,
|
|
160
167
|
toOpenAIResponseFormat,
|
package/dist/core/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["/**\n * Public agent execution harness.\n * Intentional consumer-facing exports only (production API).\n */\n\n// Runtime\nexport type { AgentDefinition, ModelParams } from './runtime/AgentDefinition';\nexport { AgentThread } from './runtime/AgentThread';\nexport type {\n AgentInfo,\n AgentParent,\n AgentSendInput,\n AgentThreadAppendContext,\n AgentThreadCreateSubAgent,\n AgentThreadEvent,\n AgentThreadExecutionEvent,\n AgentThreadExecutionResult,\n SubAgentCompletionMarker,\n} from './runtime/AgentThread.types';\nexport { AgentThreadOrchestrator } from './runtime/AgentThreadOrchestrator';\nexport type { CreateDynamicSubAgentThread } from './runtime/CreateDynamicSubAgentThread';\nexport { isAgentInputUserMessage, isEmptyMessageContent, isFileContentPart } from './runtime/UserInputMessage';\nexport type { AgentInputUserMessage } from './runtime/UserInputMessage';\n\n// Capability contracts\nexport type { AgentCapability, CapabilityState, JsonValue } from './capabilities/AgentCapability';\nexport type {\n AgentContextProcessorOutput,\n AgentThreadExecutionContext,\n PostToolCallAgentContextProcessor,\n PreLLMEphemeralAgentContextProcessor,\n} from './capabilities/AgentContextProcessor';\n\n// Built-in factories\nexport { askUserQuestion } from './capabilities/builtins/AskUserQuestion';\nexport {\n DEFAULT_CONTEXT_COMPACTION_THRESHOLD_TOKENS,\n contextCompaction,\n} from './capabilities/builtins/ContextCompaction';\nexport { currentDateTime } from './capabilities/builtins/CurrentDateTime';\nexport { SUB_AGENT_IDENTITY, dynamicSubAgents } from './capabilities/builtins/DynamicSubAgents';\nexport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n largeToolResponse,\n} from './capabilities/builtins/LargeToolResponse';\nexport { openUI } from './capabilities/builtins/OpenUI';\n\n// MCP contracts\nexport type { ApprovalDecision } from './events/schema';\nexport { ClientSideTool } from './mcp/ClientSideTool';\nexport { isAuthRequired, toolResultResponse } from './mcp/IMCPServer';\nexport type {\n AgentToolSchema,\n AuthRequiredResponse,\n CallToolResponse,\n IToolSet,\n ListToolsResponse,\n MCPAuthRequired,\n ToolSource,\n} from './mcp/IMCPServer';\nexport { LocalToolMCP, defineTool } from './mcp/LocalToolMCP';\nexport type { ToolDefinition } from './mcp/LocalToolMCP';\n\n// Remote MCP server, split into a shared, policy-free connection (`RemoteMCP`) and a per-agent policy\n// wrapper (`ToolSet`). `RemoteMCP` connects itself from a `url` + `headers`; the networking helpers\n// live in the harness-internal `remoteMcpClient` module.\nexport { RemoteMCP } from './mcp/RemoteMCP';\nexport type { RemoteMcpHeaders, ResolveHeadersResult } from './mcp/RemoteMCP';\nexport type { RemoteMcpConnection, RemoteMcpTransportType } from './mcp/remoteMcpClient';\nexport type { ToolSelectorConfig } from './mcp/ToolSelectorPolicy';\nexport {\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 './mcp/toolSelectors';\nexport { ToolSet } from './mcp/ToolSet';\n\n// LLM contracts\nexport type { AgentMetadata, ILLM, LLMCreateParams, LLMCreateParamsStreaming } from './llm/ILLM';\nexport { ResponseFormatSchema, toOpenAIResponseFormat } from './llm/responseFormat';\nexport type { ResponseFormat } from './llm/responseFormat';\nexport { SUPPORTED_REASONING_EFFORTS, VERCEL_AI_PROVIDER_NAMES, VercelAILLM } from './llm/VercelAILLM';\nexport type { VercelAILLMConfig, VercelAIProviderConfig, VercelAIProviderName } from './llm/VercelAILLM';\n\n// Event contracts\nexport {\n ActionRequiredEventSchema,\n AgentInputUserMessageSchema,\n EventIdSchema,\n EventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageDeltaEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ThreadOverwriteContextEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n UserToolApprovalMessageSchema,\n UserToolResponseMessageSchema,\n newEventId,\n} from './events/schema';\nexport type {\n AgentOutputEvent,\n MCPAuthRequiredEvent,\n MCPServerAuthInfo,\n MCPServerInitInfo,\n ThreadDoneEvent,\n ThreadOverwriteContextEvent,\n} from './events/schema';\nexport { CompletionUsageSchema } from './llm/LLMTypes';\nexport type { CompletionUsage } from './llm/LLMTypes';\nexport { InternalEventType } from './runtime/AgentThread.types';\nexport type { AgentThreadSendBatch, ContextMessage } from './runtime/AgentThread.types';\nexport { AgentThreadMetricsSchema } from './runtime/metrics';\nexport type { AgentThreadMetrics } from './runtime/metrics';\n\n// Tracing\nexport type {\n AgentExecutionTrace,\n AgentLocalToolTrace,\n AgentRemoteMcpToolTrace,\n AgentTracing,\n} from './tracing/AgentTracing';\n\n// Errors / utils\nexport { AgentHarnessError, McpConnectionError, McpDcrConfigurationError } from './errors';\nexport { describeUnknownError, extractErrorLogFields } from './util/errorLogFields';\nexport { PromiseTimeoutError, withTimeout } from './util/promiseUtils';\n\n// Sandbox (concrete implementation; provider details exported for composition)\nexport { CodeModeDispatcher } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeLogger } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';\nexport { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from './sandbox/codeMode/types';\nexport type { CodeModeErrorSource, CodeModeReply, CodeModeRequest } from './sandbox/codeMode/types';\nexport { DaytonaSandboxProvider } from './sandbox/provider/DaytonaProvider';\nexport type { DaytonaSandboxProviderOptions } from './sandbox/provider/DaytonaProvider';\nexport { ensureExecSuccess, shellEscape } from './sandbox/provider/Provider';\nexport type {\n ExecErrorResult,\n ExecResult,\n ExecSuccessResult,\n SandboxBuild,\n SandboxBuildMetadata,\n SandboxBuildStatus,\n SandboxExecParams,\n SandboxInit,\n SandboxProvider,\n} from './sandbox/provider/Provider';\nexport { TFYSandboxProvider } from './sandbox/provider/TFYSandboxProvider';\nexport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand } from './sandbox/Sandbox';\nexport type { SandboxInfo } from './sandbox/Sandbox';\nexport {\n SandboxError,\n SandboxFileNotFoundError,\n SandboxFileTooLargeError,\n SandboxNotAvailableError,\n SandboxPathIsDirectoryError,\n validateNoPathTraversal,\n validateSandboxOwnedByTenant,\n} from './sandbox/SandboxErrors';\nexport { SANDBOX_IMAGE_URI } from './sandbox/sandboxImage';\n\n// Skills: the ISkillMounter seam lets hosts plug in their own skill sources\nexport { InstructionBuilder } from './InstructionBuilder';\nexport { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from './sandbox/skills';\nexport type { GitSkill, ISkillMounter } from './sandbox/skills';\n"],"mappings":";AAOA,SAAS,mBAAmB;AAY5B,SAAS,+BAA+B;AAExC,SAAS,yBAAyB,uBAAuB,yBAAyB;AAalF,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,oBAAoB,wBAAwB;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAIvB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,0BAA0B;AAUnD,SAAS,cAAc,kBAAkB;AAMzC,SAAS,iBAAiB;AAI1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AAIxB,SAAS,sBAAsB,8BAA8B;AAE7D,SAAS,6BAA6B,0BAA0B,mBAAmB;AAInF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,6BAA6B;AAEtC,SAAS,yBAAyB;AAElC,SAAS,gCAAgC;AAYzC,SAAS,mBAAmB,oBAAoB,gCAAgC;AAChF,SAAS,sBAAsB,6BAA6B;AAC5D,SAAS,qBAAqB,mBAAmB;AAGjD,SAAS,0BAA0B;AAGnC,SAAS,2BAA2B,qBAAqB,6BAA6B;AAEtF,SAAS,8BAA8B;AAEvC,SAAS,mBAAmB,mBAAmB;AAY/C,SAAS,0BAA0B;AACnC,SAAS,gCAAgC,SAAS,qCAAqC;AAEvF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;
|
|
1
|
+
{"version":3,"sources":["../../src/core/index.ts"],"sourcesContent":["/**\n * Public agent execution harness.\n * Intentional consumer-facing exports only (production API).\n */\n\n// Runtime\nexport type { AgentDefinition, ModelParams } from './runtime/AgentDefinition';\nexport { AgentThread } from './runtime/AgentThread';\nexport type {\n AgentInfo,\n AgentParent,\n AgentSendInput,\n AgentThreadAppendContext,\n AgentThreadCreateSubAgent,\n AgentThreadEvent,\n AgentThreadExecutionEvent,\n AgentThreadExecutionResult,\n SubAgentCompletionMarker,\n} from './runtime/AgentThread.types';\nexport { AgentThreadOrchestrator } from './runtime/AgentThreadOrchestrator';\nexport type { CreateDynamicSubAgentThread } from './runtime/CreateDynamicSubAgentThread';\nexport { isAgentInputUserMessage, isEmptyMessageContent, isFileContentPart } from './runtime/UserInputMessage';\nexport type { AgentInputUserMessage } from './runtime/UserInputMessage';\n\n// Capability contracts\nexport type { AgentCapability, CapabilityState, JsonValue } from './capabilities/AgentCapability';\nexport type {\n AgentContextProcessorOutput,\n AgentThreadExecutionContext,\n PostToolCallAgentContextProcessor,\n PreLLMEphemeralAgentContextProcessor,\n} from './capabilities/AgentContextProcessor';\n\n// Built-in factories\nexport { askUserQuestion } from './capabilities/builtins/AskUserQuestion';\nexport {\n DEFAULT_CONTEXT_COMPACTION_THRESHOLD_TOKENS,\n contextCompaction,\n} from './capabilities/builtins/ContextCompaction';\nexport { currentDateTime } from './capabilities/builtins/CurrentDateTime';\nexport { SUB_AGENT_IDENTITY, dynamicSubAgents } from './capabilities/builtins/DynamicSubAgents';\nexport {\n DEFAULT_INDIVIDUAL_TOOL_TOKEN_THRESHOLD,\n DEFAULT_PREVIEW_NUMBER_OF_CHARACTERS,\n DEFAULT_TOTAL_TOOL_TOKEN_THRESHOLD,\n largeToolResponse,\n} from './capabilities/builtins/LargeToolResponse';\nexport { openUI } from './capabilities/builtins/OpenUI';\n\n// MCP contracts\nexport type { ApprovalDecision } from './events/schema';\nexport { ClientSideTool } from './mcp/ClientSideTool';\nexport { isAuthRequired, toolResultResponse } from './mcp/IMCPServer';\nexport type {\n AgentToolSchema,\n AuthRequiredResponse,\n CallToolResponse,\n IToolSet,\n ListToolsResponse,\n MCPAuthRequired,\n ToolSource,\n} from './mcp/IMCPServer';\nexport { LocalToolMCP, defineTool } from './mcp/LocalToolMCP';\nexport type { ToolDefinition } from './mcp/LocalToolMCP';\n\n// Remote MCP server, split into a shared, policy-free connection (`RemoteMCP`) and a per-agent policy\n// wrapper (`ToolSet`). `RemoteMCP` connects itself from a `url` + `headers`; the networking helpers\n// live in the harness-internal `remoteMcpClient` module.\nexport { RemoteMCP } from './mcp/RemoteMCP';\nexport type { RemoteMcpHeaders, ResolveHeadersResult } from './mcp/RemoteMCP';\nexport type { RemoteMcpConnection, RemoteMcpTransportType } from './mcp/remoteMcpClient';\nexport type { ToolSelectorConfig } from './mcp/ToolSelectorPolicy';\nexport {\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 './mcp/toolSelectors';\nexport { ToolSet } from './mcp/ToolSet';\n\n// LLM contracts\nexport type { AgentMetadata, ILLM, LLMCreateParams, LLMCreateParamsStreaming } from './llm/ILLM';\nexport { ResponseFormatSchema, toOpenAIResponseFormat } from './llm/responseFormat';\nexport type { ResponseFormat } from './llm/responseFormat';\nexport { SUPPORTED_REASONING_EFFORTS, VERCEL_AI_PROVIDER_NAMES, VercelAILLM } from './llm/VercelAILLM';\nexport type { VercelAILLMConfig, VercelAIProviderConfig, VercelAIProviderName } from './llm/VercelAILLM';\n\n// Event contracts\nexport {\n ActionRequiredEventSchema,\n AgentInputUserMessageSchema,\n EventIdSchema,\n EventType,\n MCPAuthRequiredEventSchema,\n MCPInitializeEventSchema,\n ModelMessageDeltaEventSchema,\n ModelMessageEventSchema,\n SandboxCreatedEventSchema,\n ThreadCreatedEventSchema,\n ThreadDoneEventSchema,\n ThreadOverwriteContextEventSchema,\n ToolApprovalRequiredEventSchema,\n ToolResponseEventSchema,\n ToolResponseRequiredEventSchema,\n UserToolApprovalMessageSchema,\n UserToolResponseMessageSchema,\n newEventId,\n} from './events/schema';\nexport type {\n AgentOutputEvent,\n MCPAuthRequiredEvent,\n MCPServerAuthInfo,\n MCPServerInitInfo,\n ThreadDoneEvent,\n ThreadOverwriteContextEvent,\n} from './events/schema';\nexport { CompletionUsageSchema } from './llm/LLMTypes';\nexport type { CompletionUsage } from './llm/LLMTypes';\nexport { InternalEventType } from './runtime/AgentThread.types';\nexport type { AgentThreadSendBatch, ContextMessage } from './runtime/AgentThread.types';\nexport { AgentThreadMetricsSchema } from './runtime/metrics';\nexport type { AgentThreadMetrics } from './runtime/metrics';\n\n// Tracing\nexport type {\n AgentExecutionTrace,\n AgentLocalToolTrace,\n AgentRemoteMcpToolTrace,\n AgentTracing,\n} from './tracing/AgentTracing';\n\n// Errors / utils\nexport { AgentHarnessError, McpConnectionError, McpDcrConfigurationError } from './errors';\nexport { describeUnknownError, extractErrorLogFields } from './util/errorLogFields';\nexport { PromiseTimeoutError, withTimeout } from './util/promiseUtils';\n\n// Sandbox (concrete implementation; provider details exported for composition)\nexport { CodeModeDispatcher } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeLogger } from './sandbox/codeMode/CodeModeDispatcher';\nexport type { CodeModeClientInstall, CodeModeTransport } from './sandbox/codeMode/CodeModeTransport';\nexport { CodeModeErrorSourceSchema, CodeModeReplySchema, CodeModeRequestSchema } from './sandbox/codeMode/types';\nexport type { CodeModeErrorSource, CodeModeReply, CodeModeRequest } from './sandbox/codeMode/types';\nexport { DaytonaSandboxProvider } from './sandbox/provider/DaytonaProvider';\nexport type { DaytonaSandboxProviderOptions } from './sandbox/provider/DaytonaProvider';\nexport { absolutizeRelativeExecEnv } from './sandbox/provider/execEnv';\nexport { ensureExecSuccess, shellEscape } from './sandbox/provider/Provider';\nexport type {\n ExecErrorResult,\n ExecResult,\n ExecSuccessResult,\n SandboxBuild,\n SandboxBuildMetadata,\n SandboxBuildStatus,\n SandboxExecParams,\n SandboxInit,\n SandboxProvider,\n} from './sandbox/provider/Provider';\nexport { TFYSandboxProvider } from './sandbox/provider/TFYSandboxProvider';\nexport { SKILL_DOWNLOAD_TIMEOUT_SECONDS, Sandbox, buildWriteAndRunScriptCommand } from './sandbox/Sandbox';\nexport type { SandboxInfo } from './sandbox/Sandbox';\nexport {\n SandboxError,\n SandboxFileNotFoundError,\n SandboxFileTooLargeError,\n SandboxNotAvailableError,\n SandboxPathIsDirectoryError,\n validateNoPathTraversal,\n validateSandboxOwnedByTenant,\n} from './sandbox/SandboxErrors';\nexport { SANDBOX_IMAGE_URI } from './sandbox/sandboxImage';\nexport { existingSandboxIdForProvider, formatSandboxId, parseSandboxId, rawSandboxId } from './sandbox/sandboxRef';\nexport type { SandboxRefParts } from './sandbox/sandboxRef';\n\n// Skills: the ISkillMounter seam lets hosts plug in their own skill sources\nexport { InstructionBuilder } from './InstructionBuilder';\nexport { SKILLS_PREAMBLE, SkillMounter, getSkillPath, renderSkillPromptBody } from './sandbox/skills';\nexport type { GitSkill, ISkillMounter } from './sandbox/skills';\n"],"mappings":";AAOA,SAAS,mBAAmB;AAY5B,SAAS,+BAA+B;AAExC,SAAS,yBAAyB,uBAAuB,yBAAyB;AAalF,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC,SAAS,oBAAoB,wBAAwB;AACrD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAIvB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB,0BAA0B;AAUnD,SAAS,cAAc,kBAAkB;AAMzC,SAAS,iBAAiB;AAI1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AAIxB,SAAS,sBAAsB,8BAA8B;AAE7D,SAAS,6BAA6B,0BAA0B,mBAAmB;AAInF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,6BAA6B;AAEtC,SAAS,yBAAyB;AAElC,SAAS,gCAAgC;AAYzC,SAAS,mBAAmB,oBAAoB,gCAAgC;AAChF,SAAS,sBAAsB,6BAA6B;AAC5D,SAAS,qBAAqB,mBAAmB;AAGjD,SAAS,0BAA0B;AAGnC,SAAS,2BAA2B,qBAAqB,6BAA6B;AAEtF,SAAS,8BAA8B;AAEvC,SAAS,iCAAiC;AAC1C,SAAS,mBAAmB,mBAAmB;AAY/C,SAAS,0BAA0B;AACnC,SAAS,gCAAgC,SAAS,qCAAqC;AAEvF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,8BAA8B,iBAAiB,gBAAgB,oBAAoB;AAI5F,SAAS,0BAA0B;AACnC,SAAS,iBAAiB,cAAc,cAAc,6BAA6B;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentThread.d.ts","sourceRoot":"","sources":["../../../src/core/runtime/AgentThread.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,WAAW,EAajB,MAAM,kBAAkB,CAAC;AAsB1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAE3B,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EAMtB,MAAM,qBAAqB,CAAC;AAsB7B,OAAO,EAAyD,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentThread.d.ts","sourceRoot":"","sources":["../../../src/core/runtime/AgentThread.ts"],"names":[],"mappings":"AAgBA,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,WAAW,EAajB,MAAM,kBAAkB,CAAC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{ role, tool_calls, thinking_blocks, source, ...rest } = assistantMessage;
|
|
151
|
+
const { role, tool_calls, thinking_blocks, source, content, ...rest } = assistantMessage;
|
|
152
152
|
void role;
|
|
153
153
|
void thinking_blocks;
|
|
154
154
|
void source;
|
|
155
155
|
const event = {
|
|
156
156
|
...rest,
|
|
157
|
+
// Tool-only completions store content: null on context (OpenAI replay) but the
|
|
158
|
+
// SSE placeholder omits the field. Drop null/empty here so listTurnEvents JSON
|
|
159
|
+
// matches a folded stream.
|
|
160
|
+
...content && { content },
|
|
157
161
|
tool_calls: tool_calls?.map(import_contextUtils.toEnrichedToolCall),
|
|
158
162
|
type: import_schema.EventType.MODEL_MESSAGE,
|
|
159
163
|
id,
|
|
@@ -281,7 +285,11 @@ async function buildModelMessageDeltaEvent({
|
|
|
281
285
|
...usage && { usage }
|
|
282
286
|
};
|
|
283
287
|
}
|
|
284
|
-
async function
|
|
288
|
+
async function enrichAssistantMessage({
|
|
289
|
+
assistantMessage,
|
|
290
|
+
toolMapping,
|
|
291
|
+
resolveUnderlyingTool
|
|
292
|
+
}) {
|
|
285
293
|
if (!assistantMessage.tool_calls?.length) {
|
|
286
294
|
const { tool_calls, ...rest } = assistantMessage;
|
|
287
295
|
void tool_calls;
|
|
@@ -297,11 +305,9 @@ async function buildContextAssistantMessage(assistantMessage, toolMapping) {
|
|
|
297
305
|
const tool_info = await toolInfo.toolSet.toolCallInfo(
|
|
298
306
|
{
|
|
299
307
|
name: toolInfo.originalToolName,
|
|
300
|
-
arguments: tryParseToolArgs(toolCall.function.arguments)
|
|
308
|
+
...resolveUnderlyingTool ? { arguments: tryParseToolArgs(toolCall.function.arguments) } : {}
|
|
301
309
|
},
|
|
302
|
-
|
|
303
|
-
// Hence, we resolve the underlying tool to get the tool information.
|
|
304
|
-
true
|
|
310
|
+
resolveUnderlyingTool
|
|
305
311
|
);
|
|
306
312
|
enrichedToolCalls.push({ ...toolCall, tool_info });
|
|
307
313
|
}
|
|
@@ -778,13 +784,21 @@ var AgentThread = class {
|
|
|
778
784
|
usage: result.value.usage,
|
|
779
785
|
toolMapping
|
|
780
786
|
});
|
|
781
|
-
const assistantMessage = await
|
|
782
|
-
result.value.output,
|
|
783
|
-
toolMapping
|
|
784
|
-
|
|
787
|
+
const assistantMessage = await enrichAssistantMessage({
|
|
788
|
+
assistantMessage: result.value.output,
|
|
789
|
+
toolMapping,
|
|
790
|
+
// During context persistence, we have the complete message and hence the tool arguments are available.
|
|
791
|
+
// Hence, we resolve the underlying tool to get the tool information.
|
|
792
|
+
resolveUnderlyingTool: true
|
|
793
|
+
});
|
|
785
794
|
const finishReason = result.value.finish_reason;
|
|
786
795
|
const agentAssistantMessage = buildModelMessageEvent({
|
|
787
|
-
assistantMessage
|
|
796
|
+
assistantMessage: await enrichAssistantMessage({
|
|
797
|
+
assistantMessage: result.value.output,
|
|
798
|
+
toolMapping,
|
|
799
|
+
// Same unresolved wrapper as SSE deltas so listTurnEvents matches a folded stream.
|
|
800
|
+
resolveUnderlyingTool: false
|
|
801
|
+
}),
|
|
788
802
|
threadId: this.threadId,
|
|
789
803
|
finishReason,
|
|
790
804
|
usage: modelMessageUsage,
|