eve 0.64.1 → 0.66.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/CHANGELOG.md +42 -0
- package/README.md +1 -2
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/channel/resolve-text.d.ts +11 -7
- package/dist/src/channel/resolve-text.js +1 -1
- package/dist/src/channel/types.d.ts +4 -5
- package/dist/src/chunks/{use-eve-agent-BdKlQF32.js → use-eve-agent-BUeSjwIk.js} +244 -11
- package/dist/src/chunks/{use-eve-agent-IIuxkn6y.js → use-eve-agent-ydPlURM4.js} +244 -11
- package/dist/src/cli/dev/command-options.d.ts +1 -0
- package/dist/src/cli/dev/command.js +2 -2
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/argument-typeahead.d.ts +36 -0
- package/dist/src/cli/dev/tui/argument-typeahead.js +2 -0
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +2 -2
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +3 -2
- package/dist/src/cli/dev/tui/rail.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +3 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +2 -8
- package/dist/src/cli/dev/tui/setup-commands.js +1 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +0 -3
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -0
- package/dist/src/cli/dev/tui/terminal-renderer.js +10 -12
- package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +4 -4
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.d.ts +1 -1
- package/dist/src/cli/dev/tui/vercel-trusted-sources.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +1 -1
- package/dist/src/cli/invoke/result.js +1 -1
- package/dist/src/cli/telemetry/preference.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +0 -2
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/index.d.ts +1 -3
- package/dist/src/client/index.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -3
- package/dist/src/compiled/@agentclientprotocol/sdk/index.js +2 -51
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.js +7 -7
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.js +4 -4
- package/dist/src/compiled/@ai-sdk/otel/index.js +1 -1
- package/dist/src/compiled/@cfworker/json-schema/index.d.ts +18 -0
- package/dist/src/compiled/@cfworker/json-schema/index.js +2 -0
- package/dist/src/compiled/@modelcontextprotocol/server/index.js +9 -58
- package/dist/src/compiled/@opentelemetry/api/index.js +1 -1
- package/dist/src/compiled/@opentelemetry/otlp-transformer/index.js +1 -1
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +55 -55
- package/dist/src/compiled/@vercel/blob/index.js +14 -36
- package/dist/src/compiled/@vercel/oidc/index.js +6 -28
- package/dist/src/compiled/@vercel/otel/index.js +1 -1
- package/dist/src/compiled/@vercel/sandbox/index.js +13 -13
- package/dist/src/compiled/{@workflow/builders/LICENSE.md → @vercel/sdk/LICENSE} +2 -2
- package/dist/src/compiled/@vercel/sdk/index.d.ts +41 -0
- package/dist/src/compiled/@vercel/sdk/index.js +1 -0
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +2 -2
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/client/core-CspsxXR-.js +52 -0
- package/dist/src/compiled/_chunks/client/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/dist/src/compiled/_chunks/node/auth-Dztlx9pE.js +2 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DFx4eluc.js → attribute-changes-89Nwz7XW.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{chunk-5MU5Z6L3-CrYztnvh.js → chunk-5MU5Z6L3-z9-dfnHp.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{chunk-NWCAEW5Y-ClfmNvkQ.js → chunk-NWCAEW5Y-8afLJrun.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{dist-C3919PVU.js → dist-C3ZE62yI.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-CNT2vjZ4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{dist-xTushGCp.js → dist-DtXwQbZr.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{esm-DyLz8Egm.js → esm-DtrPCf49.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{experimental-evaluation-D8_K_Pe9.js → experimental-evaluation-Dm32egEG.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/frames-DnrfSd1P.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{functions-C06vHfWP.js → functions-DpZiBxgQ.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-bsd-WEBNKY2R-DcIEvZzd.js → getMachineId-bsd-WEBNKY2R-D5OkV-EY.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-darwin-LT47KAXP-C4nRhfn9.js → getMachineId-darwin-LT47KAXP-BqwKrkSO.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-linux-LTVQO6VW-BqQf2T4W.js → getMachineId-linux-LTVQO6VW-CJlbJ4KP.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-unsupported-UKWBA27G-oYffWhib.js → getMachineId-unsupported-UKWBA27G-C4Y3-LZG.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-win-NLJKOPY6-CpL96LtN.js → getMachineId-win-NLJKOPY6-CsPs71SE.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{global-DFW-hO6M.js → global-DIlFoH2w.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{helpers-Bw52uyzw.js → helpers-k3zcudWr.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{logger-DFNCa8Nl.js → logger-Bzc8jWWj.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BmJ263ZR.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{rolldown-runtime-DPpTSio4.js → rolldown-runtime-B_knIduE.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-BT6SQv5f.js → run-NLvREued.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-Cl0SYU0I.js → serialization-HCDeQWcR.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{signal-exit-B9U6kH7R.js → signal-exit-DZKTacNU.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/sleep-Bi508qmg.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{token-CrFhCmWs.js → token-1wSBbi5N.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-U5XEWlVM.js → token-BhlnqoHM.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-util-BkqzD0OM.js → token-util-Cm4Ec1Bg.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/token-util-DaeRTzDa.js +5 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-Dzhr6tzf.js → wait-until-DXLZx3tU.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{wrapper-CKui_eTd.js → wrapper-CzrF_dmI.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/ws-transport-BSM_Cl7a.js +1 -0
- package/dist/src/compiled/jose/index.js +1 -1
- package/dist/src/compiled/zod/index.js +1 -51
- package/dist/src/compiled/zod/v3.js +1 -0
- package/dist/src/compiled/zod/v4/core.js +1 -0
- package/dist/src/compiled/zod-validation-error/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +2 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/bundled-extension.d.ts +17 -0
- package/dist/src/compiler/bundled-extension.js +1 -0
- package/dist/src/compiler/compile-agent.d.ts +4 -0
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/development-extensions.d.ts +23 -0
- package/dist/src/compiler/development-extensions.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +20 -14
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +23 -0
- package/dist/src/compiler/normalize-manifest.d.ts +2 -7
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/source-graph-paths.d.ts +2 -0
- package/dist/src/compiler/source-graph-paths.js +1 -0
- package/dist/src/compiler/source-graph.d.ts +4 -1
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/build-base-tool-context.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +3 -3
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +18 -4
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/session-context.d.ts +5 -4
- package/dist/src/discover/bundled-extension.d.ts +11 -0
- package/dist/src/discover/bundled-extension.js +1 -0
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/manifest.d.ts +5 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/types.d.ts +2 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/node-step.d.ts +2 -4
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.d.ts +6 -0
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.d.ts +6 -2
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +7 -2
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +6 -2
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +6 -3
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +1 -1
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +2 -2
- package/dist/src/execution/sandbox/provider-host.js +1 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +5 -2
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/session/event-sink.d.ts +7 -13
- package/dist/src/execution/session/event-sink.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +2 -2
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +6 -8
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/agent-router.d.ts +1 -2
- package/dist/src/execution/tools/agent-router.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.d.ts +11 -0
- package/dist/src/execution/tools/ask-question-workflow.js +1 -0
- package/dist/src/execution/tools/ask-question.d.ts +19 -0
- package/dist/src/execution/tools/ask-question.js +2 -0
- package/dist/src/execution/tools/connection-search.js +1 -1
- package/dist/src/execution/tools/file-state.d.ts +1 -7
- package/dist/src/execution/tools/file-state.js +1 -1
- package/dist/src/execution/tools/load-skill.d.ts +9 -5
- package/dist/src/execution/tools/load-skill.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/sleep.d.ts +8 -9
- package/dist/src/execution/tools/sleep.js +1 -1
- package/dist/src/execution/tools/subagent/emit-event-step.d.ts +2 -1
- package/dist/src/execution/tools/subagent/emit-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
- package/dist/src/execution/tools/workflow/answer.d.ts +2 -0
- package/dist/src/execution/tools/workflow/answer.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +3 -2
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +5 -0
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/cancel.d.ts +0 -4
- package/dist/src/execution/tools/workflow/cancel.js +1 -1
- package/dist/src/execution/tools/workflow/start.d.ts +1 -0
- package/dist/src/execution/tools/workflow/start.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +57 -0
- package/dist/src/extensions/code/extension/extension.js +1 -0
- package/dist/src/extensions/code/extension/hooks/authenticate.d.ts +2 -0
- package/dist/src/extensions/code/extension/hooks/authenticate.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +87 -0
- package/dist/src/extensions/code/extension/lib/command-failure.d.ts +7 -0
- package/dist/src/extensions/code/extension/lib/command-failure.js +2 -0
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.d.ts +14 -0
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.js +1309 -0
- package/dist/src/extensions/code/extension/lib/computer-use-sandbox.d.ts +9 -0
- package/dist/src/extensions/code/extension/lib/computer-use-sandbox.js +120 -0
- package/dist/src/extensions/code/extension/lib/computer-use.d.ts +36 -0
- package/dist/src/extensions/code/extension/lib/computer-use.js +78 -0
- package/dist/src/extensions/code/extension/lib/connect-authentication.d.ts +7 -0
- package/dist/src/extensions/code/extension/lib/connect-authentication.js +1 -0
- package/dist/src/extensions/code/extension/lib/credentials.d.ts +13 -0
- package/dist/src/extensions/code/extension/lib/credentials.js +3 -0
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +30 -0
- package/dist/src/extensions/code/extension/lib/diagnostics.js +6 -0
- package/dist/src/extensions/code/extension/lib/generated-paths.d.ts +18 -0
- package/dist/src/extensions/code/extension/lib/generated-paths.js +2 -0
- package/dist/src/extensions/code/extension/lib/github-shell-schema.d.ts +11 -0
- package/dist/src/extensions/code/extension/lib/github-shell-schema.js +1 -0
- package/dist/src/extensions/code/extension/lib/github-shell.d.ts +53 -0
- package/dist/src/extensions/code/extension/lib/github-shell.js +1 -0
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +61 -0
- package/dist/src/extensions/code/extension/lib/grep-search.js +6 -0
- package/dist/src/extensions/code/extension/lib/guidelines.d.ts +25 -0
- package/dist/src/extensions/code/extension/lib/guidelines.js +2 -0
- package/dist/src/extensions/code/extension/lib/patch.d.ts +35 -0
- package/dist/src/extensions/code/extension/lib/patch.js +20 -0
- package/dist/src/extensions/code/extension/lib/prwatch-github.d.ts +70 -0
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -0
- package/dist/src/extensions/code/extension/lib/prwatch-registry.d.ts +27 -0
- package/dist/src/extensions/code/extension/lib/prwatch-registry.js +1 -0
- package/dist/src/extensions/code/extension/lib/prwatch.d.ts +2 -0
- package/dist/src/extensions/code/extension/lib/prwatch.js +1 -0
- package/dist/src/extensions/code/extension/lib/repository-root.d.ts +4 -0
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -0
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +12 -0
- package/dist/src/extensions/code/extension/lib/sandbox.js +2 -0
- package/dist/src/extensions/code/extension/lib/shell.d.ts +1 -0
- package/dist/src/extensions/code/extension/lib/shell.js +1 -0
- package/dist/src/extensions/code/extension/lib/signed-commit.d.ts +2 -0
- package/dist/src/extensions/code/extension/lib/signed-commit.js +130 -0
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +27 -0
- package/dist/src/extensions/code/extension/lib/tooling.js +92 -0
- package/dist/src/extensions/code/extension/skills/investigate/SKILL.md +30 -0
- package/dist/src/extensions/code/extension/skills/lookup-agent-run/SKILL.md +29 -0
- package/dist/src/extensions/code/extension/skills/pr/SKILL.md +53 -0
- package/dist/src/extensions/code/extension/skills/review/SKILL.md +21 -0
- package/dist/src/extensions/code/extension/subagents/worker/agent.d.ts +17 -0
- package/dist/src/extensions/code/extension/subagents/worker/agent.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/instructions.md +20 -0
- package/dist/src/extensions/code/extension/subagents/worker/sandbox.d.ts +2 -0
- package/dist/src/extensions/code/extension/subagents/worker/sandbox.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/glob.d.ts +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/glob.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/grep.d.ts +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/grep.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +2 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/read_file.d.ts +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/read_file.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/web_fetch.d.ts +2 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/web_fetch.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/web_search.d.ts +2 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/web_search.js +1 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/write_file.d.ts +2 -0
- package/dist/src/extensions/code/extension/subagents/worker/tools/write_file.js +1 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +28 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -0
- package/dist/src/extensions/code/extension/tools/computer_use.d.ts +400 -0
- package/dist/src/extensions/code/extension/tools/computer_use.js +1 -0
- package/dist/src/extensions/code/extension/tools/gh.d.ts +27 -0
- package/dist/src/extensions/code/extension/tools/gh.js +1 -0
- package/dist/src/extensions/code/extension/tools/grep.d.ts +28 -0
- package/dist/src/extensions/code/extension/tools/grep.js +1 -0
- package/dist/src/extensions/code/tools.d.ts +4 -0
- package/dist/src/extensions/code/tools.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +0 -6
- package/dist/src/harness/compaction-prompt.js +2 -2
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -2
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -15
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +0 -20
- package/dist/src/harness/input-request-class.js +1 -1
- package/dist/src/harness/input-requests.d.ts +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +9 -1
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +1 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.d.ts +0 -9
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +2 -9
- package/dist/src/internal/application/optional-package-import.d.ts +9 -0
- package/dist/src/internal/application/optional-package-import.js +1 -0
- package/dist/src/internal/application/optional-package-install.d.ts +1 -5
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/development-programmatic-source-loader.d.ts +6 -0
- package/dist/src/internal/development-programmatic-source-loader.js +1 -0
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +3 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +0 -2
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.7/node_modules/@vercel/cli-config/dist/index.js +21 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/envpath.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errors.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errutils.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/exec.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/fsutils.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/lookup.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/safety.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/authorization.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/connector.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/installation.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/internal/base-url.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/internal/default-scopes.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/internal/env.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/internal/url-validation.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_37d5e4f23f0f03cba2e0819e67e81b38/node_modules/@vercel/connect/dist/token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/auth-errors.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/get-context.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/oauth.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/token-error.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/token-io.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/token-util.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.8/node_modules/@vercel/oidc/dist/version.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +2 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +1 -0
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +1 -0
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +1 -0
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +1 -0
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +1 -0
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +1 -0
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +1 -0
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +1 -0
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +1 -0
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +1 -0
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +1 -0
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +1 -0
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +2 -0
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +1 -0
- package/dist/src/public/channels/github/checkout.d.ts +7 -2
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/github/defaults.js +1 -1
- package/dist/src/public/channels/slack/api-errors.d.ts +33 -0
- package/dist/src/public/channels/slack/api-errors.js +1 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/interaction-cards.js +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/memory/file/provider.js +1 -1
- package/dist/src/public/sandbox/docker.d.ts +7 -0
- package/dist/src/public/sandbox/index.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox.d.ts +7 -0
- package/dist/src/public/sandbox/vercel.d.ts +7 -0
- package/dist/src/public/skills/index.d.ts +1 -2
- package/dist/src/public/tools/ask-question.d.ts +1 -1
- package/dist/src/public/tools/ask-question.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/connections/mcp-client.d.ts +0 -7
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +0 -3
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/workspace/seed-files.js +1 -1
- package/dist/src/sandbox/providers/docker.d.ts +4 -4
- package/dist/src/sandbox/providers/just-bash.d.ts +2 -2
- package/dist/src/sandbox/providers/microsandbox.d.ts +4 -4
- package/dist/src/sandbox/providers/vercel.d.ts +4 -3
- package/dist/src/sandbox/state.d.ts +2 -0
- package/dist/src/self-modification/config.d.ts +6 -0
- package/dist/src/self-modification/extension/config-schema.d.ts +25 -0
- package/dist/src/self-modification/extension/config-schema.js +1 -0
- package/dist/src/self-modification/extension/extension.d.ts +3 -47
- package/dist/src/self-modification/extension/extension.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +6 -2
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +5 -1
- package/dist/src/self-modification/git.d.ts +5 -1
- package/dist/src/services/dev-client/request-headers.d.ts +1 -1
- package/dist/src/services/dev-client/request-headers.js +1 -1
- package/dist/src/setup/flows/model.d.ts +0 -108
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/integrations/discord/api.js +1 -1
- package/dist/src/setup/integrations/discord/connect.js +1 -1
- package/dist/src/setup/integrations/github/connect.js +1 -1
- package/dist/src/setup/integrations/linear/connect.js +1 -1
- package/dist/src/setup/integrations/linq/connect.js +1 -1
- package/dist/src/setup/integrations/photon/connect.js +1 -1
- package/dist/src/setup/integrations/teams/connect.js +1 -1
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/slack-connect.d.ts +1 -1
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/vercel-api-failure.js +1 -1
- package/dist/src/setup/vercel-deployment.js +1 -1
- package/dist/src/setup/vercel-project-api.d.ts +1 -1
- package/dist/src/setup/vercel-project-api.js +1 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/connection-types.d.ts +0 -2
- package/dist/src/shared/input.d.ts +1 -6
- package/dist/src/shared/sandbox-network-policy.d.ts +5 -4
- package/dist/src/shared/sandbox-session.d.ts +0 -15
- package/dist/src/shared/skill-package.d.ts +3 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +11 -1
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.d.ts +72 -2
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tools/behavior.d.ts +2 -5
- package/dist/src/tools/definition.d.ts +23 -5
- package/dist/src/tools/framework/agent-contract.d.ts +7 -6
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/tools/framework/agent.d.ts +4 -13
- package/dist/src/tools/framework/task-cancel.d.ts +1 -17
- package/dist/src/tools/framework/task-contract.d.ts +16 -137
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/provided/ask-question.d.ts +18 -0
- package/dist/src/tools/provided/ask-question.js +1 -0
- package/dist/src/tools/provided/bash.d.ts +11 -12
- package/dist/src/tools/provided/bash.js +1 -1
- package/dist/src/tools/provided/glob.d.ts +13 -14
- package/dist/src/tools/provided/glob.js +1 -1
- package/dist/src/tools/provided/grep.d.ts +17 -18
- package/dist/src/tools/provided/grep.js +1 -1
- package/dist/src/tools/provided/read-file.d.ts +14 -15
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/sleep.d.ts +2 -2
- package/dist/src/tools/provided/web-fetch.d.ts +13 -18
- package/dist/src/tools/provided/web-fetch.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/provided/write-file.d.ts +10 -11
- package/dist/src/tools/provided/write-file.js +1 -1
- package/dist/src/tools/schema.d.ts +40 -10
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +1 -1
- package/docs/agent-config.md +11 -11
- package/docs/channels/slack.mdx +1 -1
- package/docs/concepts/built-in-tools.md +16 -66
- package/docs/concepts/default-harness.md +1 -3
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +2 -2
- package/docs/connections/overview.mdx +1 -1
- package/docs/evals/assertions.mdx +2 -2
- package/docs/evals/judge.mdx +3 -3
- package/docs/extensions.md +4 -0
- package/docs/getting-started.mdx +2 -2
- package/docs/guides/deployment/vercel.mdx +6 -0
- package/docs/guides/dev-tui.md +2 -2
- package/docs/guides/dynamic-capabilities.md +2 -0
- package/docs/guides/evaluate.md +12 -9
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/hooks.md +6 -3
- package/docs/guides/instrumentation/agent-runs.mdx +101 -0
- package/docs/guides/instrumentation/instrumentation.mdx +2 -1
- package/docs/guides/instrumentation/meta.json +1 -1
- package/docs/guides/instrumentation/migration.md +5 -1
- package/docs/guides/instrumentation/otel.mdx +8 -27
- package/docs/guides/self-modification.md +37 -0
- package/docs/guides/session-context.md +11 -13
- package/docs/install-integrations.mdx +1 -1
- package/docs/meta.json +1 -0
- package/docs/reference/cli.md +10 -7
- package/docs/reference/typescript-api.md +42 -42
- package/docs/sandbox/index.mdx +11 -0
- package/docs/skills.mdx +5 -10
- package/docs/subagents/index.mdx +7 -5
- package/docs/tools/human-in-the-loop.md +22 -11
- package/docs/tools/overview.mdx +7 -1
- package/docs/tools/workflows.mdx +45 -20
- package/docs/tutorial/guard-the-spend.mdx +1 -1
- package/package.json +30 -9
- package/dist/src/cli/dev/tui/model-picker.d.ts +0 -50
- package/dist/src/cli/dev/tui/model-picker.js +0 -1
- package/dist/src/cli/dev/tui/todo-panel.d.ts +0 -44
- package/dist/src/cli/dev/tui/todo-panel.js +0 -1
- package/dist/src/compiled/@workflow/builders/index.d.ts +0 -62
- package/dist/src/compiled/@workflow/builders/index.js +0 -1
- package/dist/src/compiled/_chunks/client/errors-Cd0_QQdM.js +0 -2
- package/dist/src/compiled/_chunks/node/auth-DDrvYko5.js +0 -2
- package/dist/src/compiled/_chunks/node/schemas-g-rLPCNX.js +0 -50
- package/dist/src/compiled/_chunks/workflow/coerce-D0oqvQ_w.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-DjECvUyK.js +0 -2
- package/dist/src/compiled/_chunks/workflow/frames-D_Q-7A1N.js +0 -3
- package/dist/src/compiled/_chunks/workflow/resume-hook-BhA_nDEV.js +0 -1
- package/dist/src/compiled/_chunks/workflow/schemas-4CmFgxN_.js +0 -50
- package/dist/src/compiled/_chunks/workflow/sleep-DB4AH9-A.js +0 -1
- package/dist/src/compiled/_chunks/workflow/token-util-pP4KRRl0.js +0 -27
- package/dist/src/compiled/_chunks/workflow/ws-transport-BpTMh40s.js +0 -1
- package/dist/src/execution/compaction.d.ts +0 -14
- package/dist/src/execution/compaction.js +0 -1
- package/dist/src/execution/tools/todo.d.ts +0 -91
- package/dist/src/execution/tools/todo.js +0 -2
- package/dist/src/harness/hitl/question-input-requests.d.ts +0 -15
- package/dist/src/harness/hitl/question-input-requests.js +0 -1
- package/dist/src/harness/request-input-tool.d.ts +0 -4
- package/dist/src/harness/request-input-tool.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/lib/primitives.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/lib/schemas.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/aclaction.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/sdkvalidationerror.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/updateprojectblock.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/updateprojectprojectsbranchmatcher.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/defaultToZeroValue.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/fp.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/primitives.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/rfcdate.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/smartUnion.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/types/unrecognized.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/ZodError.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/external.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/errorUtil.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/parseUtil.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/util.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/locales/en.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/types.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/checks.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/coerce.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/compat.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/deep-partial.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/external.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/from-json-schema.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/in-out.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/iso.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/compile.js +0 -2
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.js +0 -3
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-generator.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/regexes.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.js +0 -46
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js +0 -3
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/visit.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ar.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/az.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/be.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/bg.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/bn.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ca.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ckb.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/cs.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/da.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/de.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/el.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/eo.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/es.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fa.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fi.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fr-CA.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/fr.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/gu.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/he.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hi.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hr.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hu.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/hy.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/id.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/index.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/is.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/it.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ja.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ka.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/kh.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/km.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/kn.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ko.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/lt.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/mk.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ms.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ne.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/nl.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/nn.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/no.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ota.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pl.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ps.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pt-BR.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/pt.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ro.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ru.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sk.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sl.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/sv.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ta.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/th.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/tk.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/tr.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ua.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/uk.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/ur.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/uz.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/vi.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/yo.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/zh-CN.js +0 -1
- package/dist/src/node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/zh-TW.js +0 -1
- package/dist/src/public/tools/todo.d.ts +0 -3
- package/dist/src/public/tools/todo.js +0 -1
- package/dist/src/runtime/skills/sandbox-access.d.ts +0 -22
- package/dist/src/runtime/skills/sandbox-access.js +0 -1
- package/dist/src/shared/skill-types.d.ts +0 -22
- package/dist/src/shared/skill-types.js +0 -1
- package/dist/src/tools/framework/ask-question.d.ts +0 -38
- package/dist/src/tools/framework/ask-question.js +0 -1
- package/dist/src/tools/provided/todo.d.ts +0 -8
- package/dist/src/tools/provided/todo.js +0 -2
- /package/dist/src/{node_modules/.pnpm/zod@4.5.4/node_modules/zod/v3/helpers/typeAliases.js → compiler/normalize-manifest-types.js} +0 -0
|
@@ -180,6 +180,8 @@ export interface AssertionResult {
|
|
|
180
180
|
readonly severity: AssertionSeverity;
|
|
181
181
|
readonly threshold?: number;
|
|
182
182
|
readonly passed: boolean;
|
|
183
|
+
/** Whether the assertion failed because its scorer threw instead of producing a score. */
|
|
184
|
+
readonly errored: boolean;
|
|
183
185
|
/** Human-readable failure detail, shown in console output and artifacts. */
|
|
184
186
|
readonly message?: string;
|
|
185
187
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createDurableSessionState}from"#execution/durable-session-store.js";import{executeTaskControlAction}from"#execution/tasks/parent/dispatch.js";import{cancelBackgroundAgentTask}from"#execution/tools/subagent/task-cancel.js";import{prepareCoordinationDispatch}from"#execution/coordination-dispatch-shared.js";import{startWorkflowTask}from"#execution/tools/workflow/start.js";async function dispatchCoordinationStep(e){"use step";let t=await prepareCoordinationDispatch({serializedContext:e.serializedContext,sessionState:e.sessionState});if(t===void 0)return{results:[],sessionState:e.sessionState};let{batch:n,session:r}=t,i=r,a=[];for(let r of t.plan){if(r.kind===`workflow-task`){let o=await startWorkflowTask({agents:t.workflowAgents,auth:t.auth,batchEvent:n.event,initiatorAuth:t.initiatorAuth,owner:e.workflowToolRunOwner,parentSession:t.parentSession,session:i,task:r.task});i=o.session,o.result!==void 0&&a.push(o.result);continue}if(r.kind===`task-control`){let e=await executeTaskControlAction({action:r.action,cancelOwnedWork:cancelBackgroundAgentTask,serializedContext:t.serializedContext,session:i});i=e.session,a.push(e.result)}}return{results:a,sessionState:i===r?t.sessionState:createDurableSessionState({session:i})}}export{dispatchCoordinationStep};
|
|
1
|
+
import{createDurableSessionState}from"#execution/durable-session-store.js";import{executeTaskControlAction}from"#execution/tasks/parent/dispatch.js";import{cancelBackgroundAgentTask}from"#execution/tools/subagent/task-cancel.js";import{prepareCoordinationDispatch}from"#execution/coordination-dispatch-shared.js";import{startWorkflowTask}from"#execution/tools/workflow/start.js";async function dispatchCoordinationStep(e){"use step";let t=await prepareCoordinationDispatch({serializedContext:e.serializedContext,sessionState:e.sessionState});if(t===void 0)return{results:[],sessionState:e.sessionState};let{batch:n,session:r}=t,i=r,a=[];for(let r of t.plan){if(r.kind===`workflow-task`){let o=await startWorkflowTask({agents:t.workflowAgents,auth:t.auth,batchEvent:n.event,canRequestInput:t.capabilities?.requestInput===!0,initiatorAuth:t.initiatorAuth,owner:e.workflowToolRunOwner,parentSession:t.parentSession,session:i,task:r.task});i=o.session,o.result!==void 0&&a.push(o.result);continue}if(r.kind===`task-control`){let e=await executeTaskControlAction({action:r.action,cancelOwnedWork:cancelBackgroundAgentTask,serializedContext:t.serializedContext,session:i});i=e.session,a.push(e.result)}}return{results:a,sessionState:i===r?t.sessionState:createDurableSessionState({session:i})}}export{dispatchCoordinationStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runJsProgram}from"#execution/dynamic-workflow/workflow.js";async function executeWorkflowProgram(e,t){"use workflow";return runJsProgram(e.js,t,{maxSubagents:e.maxSubagents??0})}executeWorkflowProgram.workflowId=`workflow//eve@0.
|
|
1
|
+
import{runJsProgram}from"#execution/dynamic-workflow/workflow.js";async function executeWorkflowProgram(e,t){"use workflow";return runJsProgram(e.js,t,{maxSubagents:e.maxSubagents??0})}executeWorkflowProgram.workflowId=`workflow//eve@0.66.0//executeWorkflowProgram`;export{executeWorkflowProgram};
|
|
@@ -25,10 +25,8 @@ export interface CreateExecutionNodeStepInput {
|
|
|
25
25
|
/** Cancellation signal forwarded to the tool-loop harness. */
|
|
26
26
|
readonly abortSignal?: AbortSignal;
|
|
27
27
|
/**
|
|
28
|
-
* Session-level capabilities propagated from the runtime
|
|
29
|
-
*
|
|
30
|
-
* registration and any other capability-gated behavior tracks the
|
|
31
|
-
* current run.
|
|
28
|
+
* Session-level capabilities propagated from the runtime, so
|
|
29
|
+
* capability-gated behavior tracks the current run.
|
|
32
30
|
*/
|
|
33
31
|
readonly capabilities?: SessionCapabilities;
|
|
34
32
|
/** Runs only a context clear and returns to the parked session. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{UNSPECIFIED_INPUT_SCHEMA}from"#tools/schema.js";import{createToolExecuteWithAuth}from"#execution/tool-auth.js";import{resolveRuntimeModelReference}from"#runtime/agent/resolve-model.js";import{createPreparedWorkflowToolHarnessDefinition,createWorkflowToolHarnessDefinition}from"#execution/tools/workflow/background.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{dispatchDynamicModelEvent}from"#context/dynamic-model-lifecycle.js";import{preparePersistedStepDynamicToolMetadata}from"#context/dynamic-tool-lifecycle.js";import{createToolLoopHarness}from"#harness/tool-loop.js";import{createTaskToolHarnessDefinitions}from"#execution/tools/tasks.js";import{findRegisteredRuntimeTool}from"#runtime/tools/registry.js";import{
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{UNSPECIFIED_INPUT_SCHEMA}from"#tools/schema.js";import{createToolExecuteWithAuth}from"#execution/tool-auth.js";import{resolveRuntimeModelReference}from"#runtime/agent/resolve-model.js";import{createPreparedWorkflowToolHarnessDefinition,createWorkflowToolHarnessDefinition}from"#execution/tools/workflow/background.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{dispatchDynamicModelEvent}from"#context/dynamic-model-lifecycle.js";import{preparePersistedStepDynamicToolMetadata}from"#context/dynamic-tool-lifecycle.js";import{createToolLoopHarness}from"#harness/tool-loop.js";import{createTaskToolHarnessDefinitions}from"#execution/tools/tasks.js";import{findRegisteredRuntimeTool}from"#runtime/tools/registry.js";import{WEB_SEARCH_TOOL_NAME,resolveWebSearchActivityLabel}from"#harness/provider-tool-schemas.js";const log=createLogger(`execution.node-step`);function createExecutionNodeStep(e){let t=createRuntimeModelResolver(e.modelResolutionScope),n=e.node.turnAgent.dynamicModel===void 0?void 0:createRuntimeDynamicModelEventDispatcher(e.modelResolutionScope,e.node.turnAgent.dynamicModel,e.abortSignal),r=createNodeHarnessTools({node:e.node}),i=e.instrumentation,a=i?.prepareExecution(),o=createToolLoopHarness({steeringSignal:e.steeringSignal,abortSignal:e.abortSignal,capabilities:e.capabilities,clearOnly:e.clearOnly,compactOnly:e.compactOnly,handleEvent:e.handleEvent,historyProjector:e.historyProjector,historyView:e.historyView,instrumentation:a,mode:e.mode,resolveStepDynamicTools:t=>preparePersistedStepDynamicToolMetadata({...t,resolvers:e.node.agent.dynamicToolResolvers??[]}),dispatchDynamicModelEvent:n,resolveModel:t,runtimeIdentity:buildRuntimeIdentity(e.node),tools:r});return i===void 0?o:async(e,t)=>{try{return await o(e,t)}finally{await i.flush()}}}function buildRuntimeIdentity(e){let t=resolveInstalledPackageInfo(),n={agentId:e.turnAgent.id,agentName:e.agent.config?.name,eveVersion:t.version},r=process.env.VERCEL_GIT_COMMIT_SHA?.trim(),i=process.env.VERCEL_GIT_COMMIT_REF?.trim(),a=process.env.VERCEL_DEPLOYMENT_CREATED_AT?.trim();return r||i||a?{...n,build:{deployedAt:a||void 0,gitBranch:i||void 0,gitSha:r||void 0}}:n}function createRuntimeModelResolver(e){return t=>resolveRuntimeModelReference(t,e)}function createRuntimeDynamicModelEventDispatcher(e,t,n){return r=>dispatchDynamicModelEvent({abortSignal:n,ctx:r.ctx,dynamicModel:t,event:r.event,messages:r.messages,scope:e})}function createNodeHarnessTools(e){let t=new Map;for(let n of e.node.turnAgent.tools){let r=resolveHarnessToolDefinition({node:e.node,tool:n});r!==null&&t.set(n.name,r)}return t}function resolveHarnessToolDefinition(e){let t=findRegisteredRuntimeTool(e.node.toolRegistry,e.tool.name);return isPreparedRuntimeWorkflowTool(e.tool)?t===null?createPreparedWorkflowToolHarnessDefinition(e.tool):createWorkflowToolHarnessDefinition({executeInput:t.definition.executeInput,definition:createRegisteredHarnessToolDefinition({behavior:e.tool.behavior,definition:t.definition,rootOnly:e.tool.rootOnly}),nodeId:e.tool.task.nodeId,workflowId:e.tool.task.workflowId}):t===null?(log.warn(`declared tool is not registered — omitting from toolset`,{toolName:e.tool.name,nodeId:e.node.nodeId}),null):createRegisteredHarnessToolDefinition({behavior:e.tool.behavior,definition:t.definition,rootOnly:e.tool.rootOnly})}function isPreparedRuntimeWorkflowTool(e){return e.task!==void 0}function createRegisteredHarnessToolDefinition(e){let t=e.definition;if(t.owner.kind===`framework`){let n=createTaskToolHarnessDefinitions().find(e=>e.name===t.name);if(n!==void 0)return{...n,behavior:e.behavior}}let n=t.execute;return{availableInSubagents:t.availableInSubagents,label:t.label??(t.owner.kind===`framework`&&t.name===WEB_SEARCH_TOOL_NAME?{start:resolveWebSearchActivityLabel}:void 0),approvalKey:t.approvalKey,behavior:e.behavior,description:t.description,execution:t.execution,executeInput:t.executeInput,execute:resolveAuthoredExecute({rawExecute:n,scope:t.name}),frameworkAction:t.owner.kind===`framework`&&t.name===LOAD_SKILL_TOOL_NAME?`load-skill`:void 0,inputSchema:t.inputSchema??UNSPECIFIED_INPUT_SCHEMA,name:t.name,approval:t.approval,outputSchema:t.outputSchema,rootOnly:e.rootOnly,toModelOutput:t.toModelOutput}}function resolveAuthoredExecute(e){let{rawExecute:t,scope:n}=e;return t===void 0?void 0:createToolExecuteWithAuth({execute:t,scope:n})}export{buildRuntimeIdentity,createExecutionNodeStep,createNodeHarnessTools};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readDurableSession,replaceDurableSessionSnapshot}from"#execution/durable-session-store.js";import{findBackgroundWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{resumeSessionInbox}from"#execution/session-inbox/resume.js";import{createTaskInputRequestId,retireProxyInputRequests}from"#harness/proxy-input-requests.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{routeDeliverPayload}from"#subagents/hitl-proxy.js";import{sendTaskInboundPayload}from"#execution/tasks/parent/run-parent.js";import{resumeWorkflowToolRunAnswers}from"#execution/tools/workflow/answer.js";async function routeProxiedDeliverStep(e){"use step";let t=readDurableSession(e.sessionState),n=e.delivery,r=new Map,i=new Map,a;for(let[e,
|
|
1
|
+
import{createInputResolvedEvent,encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{getPendingCoordinationBatch}from"#harness/coordination.js";import{readDurableSession,replaceDurableSessionSnapshot}from"#execution/durable-session-store.js";import{findBackgroundWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{resumeSessionInbox}from"#execution/session-inbox/resume.js";import{createTaskInputRequestId,retireProxyInputRequests}from"#harness/proxy-input-requests.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{routeDeliverPayload}from"#subagents/hitl-proxy.js";import{sendTaskInboundPayload}from"#execution/tasks/parent/run-parent.js";import{resumeWorkflowToolRunAnswers,resumeWorkflowToolRunDismissal}from"#execution/tools/workflow/answer.js";async function routeProxiedDeliverStep(e){"use step";let t=readDurableSession(e.sessionState),n=e.delivery,r=new Map,i=new Map,a,o=n.caller===void 0&&n.taskDeliveryId===void 0,s=new Set;for(let[e,c]of n.payloads.entries()){let l=routeDeliverPayload({allowRoute:(e,n)=>!s.has(e)&&(n.taskId===void 0||findBackgroundWorkflowToolRun(t.state,n.taskId)!==void 0),payload:c,resolveMessage:o,state:t.state});a??=l.parentAction,l.forSelf!==void 0&&r.set(e,l.forSelf);for(let[t,r]of l.forChildren.entries()){if(r.answerHook!==void 0)for(let e of r.retireRequestIds)s.add(e);let a=[r.childContinuationToken,r.childSessionInbox?.sessionId??``,r.childResponseUrl??``,r.taskId??``].join(`\0`),o=i.get(a)??{answerHook:r.answerHook,childContinuationToken:r.childContinuationToken,childSessionInbox:r.childSessionInbox,childResponseUrl:r.childResponseUrl,dismissedRequestIds:[],metadata:[],payloads:[],retireRequestIds:[],sourcePayloadIndexes:[],taskId:r.taskId},c=o.payloads.length;if(o.payloads.push(r.payload),o.dismissedRequestIds.push(...r.dismissedRequestIds??[]),o.retireRequestIds.push(...r.retireRequestIds),o.sourcePayloadIndexes.push(e),l.forSelf===void 0&&t===0)for(let t of n.deliveryMetadata??[])t.payloadIndex===e&&o.metadata.push({...t,payloadIndex:c});i.set(a,o)}}let c=!1;for(let a of i.values()){let i=a.taskId;if(i!==void 0){let e=findBackgroundWorkflowToolRun(t.state,i);if(e===void 0){mergeStrandedResponses(r,a,i);continue}if(await sendTaskInboundPayload({taskInboxToken:e.address.hookToken,payload:{auth:n.auth,childContinuationToken:a.childContinuationToken,childSessionInbox:a.childSessionInbox,childResponseUrl:a.childResponseUrl,inputResponses:coalesceDeliverPayloads(a.payloads).inputResponses??[],kind:`input-response`,taskId:i}})===`unreachable`){mergeStrandedResponses(r,a,i);continue}t=retireProxyInputRequests(t,a.retireRequestIds),c=!0;continue}if(a.answerHook!==void 0){let n=coalesceDeliverPayloads(a.payloads).inputResponses??[];await resumeWorkflowToolRunAnswers(a.childContinuationToken,n),a.dismissedRequestIds.length>0&&await resumeWorkflowToolRunDismissal(a.childContinuationToken),a.answerHook.question!==void 0&&await emitQuestionResolutions({dismissedRequestIds:a.dismissedRequestIds,responses:n,sessionState:t.state,sessionWritable:e.sessionWritable}),t=retireProxyInputRequests(t,a.retireRequestIds),c=!0;continue}let o={...n,deliveryMetadata:a.metadata.length===0?void 0:a.metadata,payloads:a.payloads};await resumeSessionInbox(a.childSessionInbox??a.childContinuationToken,o),t=retireProxyInputRequests(t,a.retireRequestIds),c=!0}let l={serializedContext:e.serializedContext??{},sessionState:c?replaceDurableSessionSnapshot({session:t,state:e.sessionState}):e.sessionState};if(a!==void 0)return{...l,...a};let u=[...r].sort(([e],[t])=>e-t),d=u.flatMap(([e],t)=>(n.deliveryMetadata??[]).filter(t=>t.payloadIndex===e).map(e=>({...e,payloadIndex:t}))),f=u.length===0?void 0:{...n,deliveryMetadata:d.length===0?void 0:d,payloads:u.map(([,e])=>e)};return{...l,kind:`continue`,remainder:f}}async function emitQuestionResolutions(e){let t=getPendingCoordinationBatch(e.sessionState)?.event;if(t===void 0)return;let n=[...e.responses.map(e=>({kind:`question`,outcome:`answered`,requestId:e.requestId,response:e})),...e.dismissedRequestIds.map(e=>({kind:`question`,outcome:`ignored`,requestId:e}))];if(n.length===0)return;let r=e.sessionWritable.getWriter();try{await r.write(encodeMessageStreamEvent(stampMessageStreamEvent(createInputResolvedEvent({resolutions:n,...t}))))}finally{r.releaseLock()}}function mergeStrandedResponses(e,t,n){for(let[r,i]of t.payloads.entries()){let a=t.sourcePayloadIndexes[r];if(a===void 0)continue;let o=(i.inputResponses??[]).map(e=>({...e,requestId:createTaskInputRequestId(n,e.requestId)}));if(o.length===0)continue;let s=e.get(a);e.set(a,{...s,inputResponses:[...s?.inputResponses??[],...o]})}}export{routeProxiedDeliverStep};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{recordTaskInputRequestStep,recordTerminalTaskViewsStep}from"#execution/tasks/parent/hitl-proxy-steps.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{emitSubagentEventStep}from"#execution/tools/subagent/emit-event-step.js";import{formatTaskNotification}from"#tasks/notification.js";import{routeProxiedDeliverStep}from"#execution/proxied-deliver-step.js";import{emitRecordedTaskInputRequestStep,runProxySubagentEventStep}from"#subagents/event-proxy-step.js";import{acceptTaskAuthorizationEventStep}from"#execution/tools/subagent/accept-event-step.js";import{applyTaskAgentRequest}from"#execution/tools/subagent/task-agent-requests.js";async function routeDeliverToChildren(e){let t=coalesceDeliverPayloads(e.delivery.payloads),n=e.serializedContext,r=e.sessionState,i=new Map,a=new Set((t.task?.views??[]).map(e=>e.taskId));for(let i of t.task?.inputRequests??[]){if(a.has(i.taskId))continue;let t=await recordTaskInputRequestStep({request:i,sessionState:r});if(r=t.sessionState,!t.accepted)continue;let o=await emitRecordedTaskInputRequestStep({sessionWritable:e.sessionWritable,request:t.request,serializedContext:n,sessionState:r});n=o.serializedContext,r=o.sessionState}for(let i of t.task?.agentRequests??[]){if(i.request.kind===`agent-invoke`&&a.has(i.taskId))continue;let t=await applyTaskAgentRequest({...i,ownerId:i.taskId},{sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r});n=t.serializedContext,r=t.sessionState}for(let i of t.task?.authorizationEvents??[]){if(i.hookPayload.event.type===`authorization.required`&&a.has(i.taskId)||!await acceptTaskAuthorizationEventStep({delivery:i,sessionState:r}))continue;let t=await runProxySubagentEventStep({hookPayload:i.hookPayload,sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r});n=t.serializedContext,r=t.sessionState}if((t.task?.views?.length??0)>0){let a=await recordTerminalTaskViewsStep({serializedContext:n,sessionState:r,views:t.task?.views??[]});n=a.serializedContext,r=a.sessionState;for(let e of a.views)i.set(e.taskId,e);for(let t of a.subagentCompletions)
|
|
1
|
+
import{recordTaskInputRequestStep,recordTerminalTaskViewsStep}from"#execution/tasks/parent/hitl-proxy-steps.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{emitSubagentEventStep}from"#execution/tools/subagent/emit-event-step.js";import{formatTaskNotification}from"#tasks/notification.js";import{routeProxiedDeliverStep}from"#execution/proxied-deliver-step.js";import{emitRecordedTaskInputRequestStep,runProxySubagentEventStep}from"#subagents/event-proxy-step.js";import{acceptTaskAuthorizationEventStep}from"#execution/tools/subagent/accept-event-step.js";import{applyTaskAgentRequest}from"#execution/tools/subagent/task-agent-requests.js";async function routeDeliverToChildren(e){let t=coalesceDeliverPayloads(e.delivery.payloads),n=e.serializedContext,r=e.sessionState,i=new Map,a=new Set((t.task?.views??[]).map(e=>e.taskId));for(let i of t.task?.inputRequests??[]){if(a.has(i.taskId))continue;let t=await recordTaskInputRequestStep({request:i,sessionState:r});if(r=t.sessionState,!t.accepted)continue;let o=await emitRecordedTaskInputRequestStep({sessionWritable:e.sessionWritable,request:t.request,serializedContext:n,sessionState:r});n=o.serializedContext,r=o.sessionState}for(let i of t.task?.agentRequests??[]){if(i.request.kind===`agent-invoke`&&a.has(i.taskId))continue;let t=await applyTaskAgentRequest({...i,ownerId:i.taskId},{sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r});n=t.serializedContext,r=t.sessionState}for(let i of t.task?.authorizationEvents??[]){if(i.hookPayload.event.type===`authorization.required`&&a.has(i.taskId)||!await acceptTaskAuthorizationEventStep({delivery:i,sessionState:r}))continue;let t=await runProxySubagentEventStep({hookPayload:i.hookPayload,sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r});n=t.serializedContext,r=t.sessionState}if((t.task?.views?.length??0)>0){let a=await recordTerminalTaskViewsStep({serializedContext:n,sessionState:r,views:t.task?.views??[]});n=a.serializedContext,r=a.sessionState;for(let e of a.views)i.set(e.taskId,e);for(let t of a.subagentCompletions){let i=await emitSubagentEventStep({event:t,sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r});n=i.serializedContext,r=i.sessionState}}let o=[],s=[];for(let[t,n]of e.delivery.payloads.entries()){let r={...n};if(delete r.task,r.message!==void 0&&n.task?.views!==void 0){let e=n.task.views.flatMap(({taskId:e})=>{let t=i.get(e);return t===void 0?[]:[formatTaskNotification(t)]});e.length===0?delete r.message:r.message=e.join(`
|
|
2
2
|
|
|
3
3
|
`)}if(Object.keys(r).length===0)continue;let a=o.length;o.push(r);for(let n of e.delivery.deliveryMetadata??[])n.payloadIndex===t&&s.push({...n,payloadIndex:a})}let c=o.length===0?void 0:{...e.delivery,deliveryMetadata:s.length===0?void 0:s,payloads:o};return c===void 0?{kind:`continue`,remainder:void 0,serializedContext:n,sessionState:r}:r.hasProxyInputRequests?await routeProxiedDeliverStep({delivery:c,sessionWritable:e.sessionWritable,serializedContext:n,sessionState:r}):{kind:`continue`,remainder:c,serializedContext:n,sessionState:r}}export{routeDeliverToChildren};
|
|
@@ -32,4 +32,10 @@ export declare function resolveDockerTemplateMarkerPath(appRoot: string, input:
|
|
|
32
32
|
}): string;
|
|
33
33
|
export declare function touchDockerTemplateMarker(markerPath: string, imageReference: string): Promise<void>;
|
|
34
34
|
export declare function dockerImageExists(cli: DockerCli, imageReference: string): Promise<boolean>;
|
|
35
|
+
export declare function commitDockerTemplateImage(input: {
|
|
36
|
+
readonly cli: DockerCli;
|
|
37
|
+
readonly containerIdentity: string;
|
|
38
|
+
readonly imageReference: string;
|
|
39
|
+
readonly templateKey: string;
|
|
40
|
+
}): Promise<"committed" | "reused">;
|
|
35
41
|
export declare function ensureDockerBaseImage(cli: DockerCli, options: ResolvedDockerSandboxOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir,readdir,rm,stat,utimes,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import"node:fs";import{resolveSandboxCacheDirectory}from"#internal/application/paths.js";import{expectDockerSuccess}from"#execution/sandbox/bindings/docker-utils.js";import{createDockerCli}from"#execution/sandbox/bindings/docker-cli.js";import{LOCAL_SANDBOX_TEMPLATE_RECENT_WINDOW_MS,LOCAL_SANDBOX_TEMPLATE_RETAIN_COUNT,selectStaleTemplateEntries}from"#execution/sandbox/bindings/local-template-prune.js";const DOCKER_TEMPLATE_IMAGE_REPOSITORY=`eve-sandbox-template`;async function pruneDockerSandboxTemplates(e){let t=e.dockerCli??createDockerCli(),n=resolveDockerTemplateMarkersDirectory(e.appRoot),r;try{r=await readdir(n,{withFileTypes:!0})}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e}let i=await Promise.all(r.filter(e=>e.isFile()).map(async e=>{let t=join(n,e.name);return{imageTag:e.name,mtimeMs:(await stat(t)).mtimeMs,path:t}})),a=selectStaleTemplateEntries(i,{now:e.now??Date.now(),recentWindowMs:e.recentWindowMs??LOCAL_SANDBOX_TEMPLATE_RECENT_WINDOW_MS,retainCount:e.retainCount??LOCAL_SANDBOX_TEMPLATE_RETAIN_COUNT});for(let e of a){let n=await t.run([`rmi`,dockerTemplateImageReferenceFromTag(e.imageTag)]),r=n.exitCode!==0&&/no such image/i.test(n.stderr);(n.exitCode===0||r)&&await rm(e.path,{force:!0})}}function dockerTemplateImageReference(e){return dockerTemplateImageReferenceFromTag(dockerTemplateImageTag(e))}function dockerTemplateImageReferenceFromTag(e){return`${DOCKER_TEMPLATE_IMAGE_REPOSITORY}:${e}`}function dockerTemplateImageTag(e){return`${e.templateKey.toLowerCase()}-${e.optionsHash}`}function resolveDockerTemplateMarkerPath(e,t){return join(resolveDockerTemplateMarkersDirectory(e),dockerTemplateImageTag(t))}async function touchDockerTemplateMarker(e,t){await mkdir(dirname(e),{recursive:!0});try{let t=new Date;await utimes(e,t,t)}catch{await writeFile(e,`${t}\n`)}}async function dockerImageExists(e,t){return(await e.run([`image`,`inspect`,`--format`,`{{.Id}}`,t])).exitCode===0}async function ensureDockerBaseImage(e,t){if(t.pullPolicy===`always`){expectDockerSuccess(await e.run([`pull`,t.image]),`pull base image "${t.image}"`);return}if(!await dockerImageExists(e,t.image)){if(t.pullPolicy===`never`)throw Error(`The local sandbox base image "${t.image}" is not present locally and pullPolicy is "never". Pull the image manually or relax the pull policy.`);expectDockerSuccess(await e.run([`pull`,t.image]),`pull base image "${t.image}"`)}}function resolveDockerTemplateMarkersDirectory(e){return join(resolveSandboxCacheDirectory(e),`docker`,`templates`)}export{DOCKER_TEMPLATE_IMAGE_REPOSITORY,dockerImageExists,dockerTemplateImageReference,ensureDockerBaseImage,pruneDockerSandboxTemplates,resolveDockerTemplateMarkerPath,touchDockerTemplateMarker};
|
|
1
|
+
import{mkdir,readdir,rm,stat,utimes,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import"node:fs";import{resolveSandboxCacheDirectory}from"#internal/application/paths.js";import{expectDockerSuccess}from"#execution/sandbox/bindings/docker-utils.js";import{createDockerCli}from"#execution/sandbox/bindings/docker-cli.js";import{DOCKER_SANDBOX_LABEL}from"#execution/sandbox/bindings/docker-container.js";import{LOCAL_SANDBOX_TEMPLATE_RECENT_WINDOW_MS,LOCAL_SANDBOX_TEMPLATE_RETAIN_COUNT,selectStaleTemplateEntries}from"#execution/sandbox/bindings/local-template-prune.js";const DOCKER_TEMPLATE_IMAGE_REPOSITORY=`eve-sandbox-template`;async function pruneDockerSandboxTemplates(e){let t=e.dockerCli??createDockerCli(),n=resolveDockerTemplateMarkersDirectory(e.appRoot),r;try{r=await readdir(n,{withFileTypes:!0})}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e}let i=await Promise.all(r.filter(e=>e.isFile()).map(async e=>{let t=join(n,e.name);return{imageTag:e.name,mtimeMs:(await stat(t)).mtimeMs,path:t}})),a=selectStaleTemplateEntries(i,{now:e.now??Date.now(),recentWindowMs:e.recentWindowMs??LOCAL_SANDBOX_TEMPLATE_RECENT_WINDOW_MS,retainCount:e.retainCount??LOCAL_SANDBOX_TEMPLATE_RETAIN_COUNT});for(let e of a){let n=await t.run([`rmi`,dockerTemplateImageReferenceFromTag(e.imageTag)]),r=n.exitCode!==0&&/no such image/i.test(n.stderr);(n.exitCode===0||r)&&await rm(e.path,{force:!0})}}function dockerTemplateImageReference(e){return dockerTemplateImageReferenceFromTag(dockerTemplateImageTag(e))}function dockerTemplateImageReferenceFromTag(e){return`${DOCKER_TEMPLATE_IMAGE_REPOSITORY}:${e}`}function dockerTemplateImageTag(e){return`${e.templateKey.toLowerCase()}-${e.optionsHash}`}function resolveDockerTemplateMarkerPath(e,t){return join(resolveDockerTemplateMarkersDirectory(e),dockerTemplateImageTag(t))}async function touchDockerTemplateMarker(e,t){await mkdir(dirname(e),{recursive:!0});try{let t=new Date;await utimes(e,t,t)}catch{await writeFile(e,`${t}\n`)}}async function dockerImageExists(e,t){return(await e.run([`image`,`inspect`,`--format`,`{{.Id}}`,t])).exitCode===0}async function commitDockerTemplateImage(e){let t=await e.cli.run([`commit`,`--change`,`LABEL ${DOCKER_SANDBOX_LABEL}=1`,`--change`,`LABEL ${DOCKER_SANDBOX_LABEL}.role=template`,`--change`,`LABEL ${DOCKER_SANDBOX_LABEL}.template-key=${e.templateKey}`,e.containerIdentity,e.imageReference]);return t.exitCode===0?`committed`:(/already(?:\s*|-)?exists/iu.test(`${t.stderr}\n${t.stdout}`)&&await dockerImageExists(e.cli,e.imageReference)||expectDockerSuccess(t,`commit sandbox template image "${e.imageReference}"`),`reused`)}async function ensureDockerBaseImage(e,t){if(t.pullPolicy===`always`){expectDockerSuccess(await e.run([`pull`,t.image]),`pull base image "${t.image}"`);return}if(!await dockerImageExists(e,t.image)){if(t.pullPolicy===`never`)throw Error(`The local sandbox base image "${t.image}" is not present locally and pullPolicy is "never". Pull the image manually or relax the pull policy.`);expectDockerSuccess(await e.run([`pull`,t.image]),`pull base image "${t.image}"`)}}function resolveDockerTemplateMarkersDirectory(e){return join(resolveSandboxCacheDirectory(e),`docker`,`templates`)}export{DOCKER_TEMPLATE_IMAGE_REPOSITORY,commitDockerTemplateImage,dockerImageExists,dockerTemplateImageReference,ensureDockerBaseImage,pruneDockerSandboxTemplates,resolveDockerTemplateMarkerPath,touchDockerTemplateMarker};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
|
+
type NetworkPolicySandboxSession = SandboxSession & {
|
|
4
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
5
|
+
};
|
|
2
6
|
import { type DockerCli } from "#execution/sandbox/bindings/docker-cli.js";
|
|
3
7
|
import { type SandboxProviderImplementation } from "#shared/sandbox-provider.js";
|
|
4
8
|
import type { DockerSandboxEnvironmentOptions, DockerSandboxRuntimeOptions } from "#public/sandbox/docker-sandbox.js";
|
|
@@ -28,4 +32,4 @@ type DockerSandboxSessionState = {
|
|
|
28
32
|
* session state across reconnects, so `shutdown` only stops the
|
|
29
33
|
* container and the next `create` restarts it with state intact.
|
|
30
34
|
*/
|
|
31
|
-
export declare function createDockerSandboxProvider(createOptions?: DockerSandboxEnvironmentOptions, dockerCli?: DockerCli): SandboxProviderImplementation<DockerSandboxRuntimeOptions, DockerSandboxPreparedArtifact, DockerSandboxSessionState,
|
|
35
|
+
export declare function createDockerSandboxProvider(createOptions?: DockerSandboxEnvironmentOptions, dockerCli?: DockerCli): SandboxProviderImplementation<DockerSandboxRuntimeOptions, DockerSandboxPreparedArtifact, DockerSandboxSessionState, NetworkPolicySandboxSession>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{expectDockerSuccess}from"#execution/sandbox/bindings/docker-utils.js";import{assertDockerDaemonAvailable,createDockerCli}from"#execution/sandbox/bindings/docker-cli.js";import{
|
|
1
|
+
import{randomUUID}from"node:crypto";import{expectDockerSuccess}from"#execution/sandbox/bindings/docker-utils.js";import{assertDockerDaemonAvailable,createDockerCli}from"#execution/sandbox/bindings/docker-cli.js";import{runDockerBaseSetup,startDockerContainer,stopDockerContainerIfRunning}from"#execution/sandbox/bindings/docker-container.js";import{setDockerNetworkPolicy}from"#execution/sandbox/bindings/docker-network.js";import{createDockerSandboxOptionsHash,resolveDockerSandboxOptions}from"#execution/sandbox/bindings/docker-options.js";import{createDockerInternalSession}from"#execution/sandbox/bindings/docker-session.js";import{DOCKER_TEMPLATE_IMAGE_REPOSITORY,commitDockerTemplateImage,dockerImageExists,dockerTemplateImageReference,ensureDockerBaseImage,pruneDockerSandboxTemplates,resolveDockerTemplateMarkerPath,touchDockerTemplateMarker}from"#execution/sandbox/bindings/docker-templates.js";import{buildSandboxDockerfile,dockerfileImageReference,materializeSandboxDockerfile}from"#execution/sandbox/dockerfile.js";import{hydrateSandboxProviderResources,prepareImmutableResources}from"#execution/sandbox/bindings/immutable-resources.js";import{createLoggingSandboxSession}from"#execution/sandbox/logging-session.js";import{buildSandboxSession}from"#execution/sandbox/session.js";import{createSandboxProviderIdentity}from"#execution/sandbox/provider-identity.js";import{isSandboxPreparedArtifactRecord,sandboxProviderResourceIdentity}from"#shared/sandbox-provider.js";import{SandboxTemplateNotProvisionedError}from"#shared/sandbox-template-error.js";const DOCKER_PROVIDER_NAME=`docker`;function createDockerSandboxProvider(e,t){let n=t??createDockerCli(),r=e??{},i=resolveDockerSandboxOptions(r),a=createDockerSandboxOptionsHash(i),o;function ensureDaemon(){return o??=assertDockerDaemonAvailable(n).catch(e=>{throw o=void 0,e}),o}async function openDockerSession(e,t,r,a,o){await ensureDaemon();let s=requirePreparedDockerArtifact(r);if(!await dockerImageExists(n,s.imageReference))throw new SandboxTemplateNotProvisionedError({providerName:DOCKER_PROVIDER_NAME,templateKey:s.imageReference});let c=await n.run([`container`,`inspect`,`--format`,`{{.State.Running}}`,a]);if(c.exitCode===0)c.stdout.trim()!==`true`&&expectDockerSuccess(await n.run([`start`,a]),`restart sandbox session container "${a}"`);else{if(!o)throw Error(`Docker sandbox session container "${a}" no longer exists.`);await startDockerContainer({cli:n,containerName:a,image:s.imageReference,initialNetworkPolicy:t?.networkPolicy??`allow-all`,options:i,role:`session`,tags:{agent:e.session.id,sessionId:e.session.id}})}let l=await resolveDockerHandleIdentity(n,a);return{sandbox:buildSandboxSession(createDockerInternalSession({cli:n,containerIdentity:l}),e=>setDockerNetworkPolicy(n,l,e)),async onSessionDelete(){await stopDockerContainerIfRunning(n,l),expectDockerSuccess(await n.run([`rm`,`-f`,l]),`delete sandbox session container "${a}"`)},async onSessionStop(){await stopDockerContainerIfRunning(n,l)},async onRuntimeShutdown(){await stopDockerContainerIfRunning(n,l)}}}return{async prepare(e){e.log?.(`checking Docker daemon`),await ensureDaemon();let t=await materializeSandboxDockerfile({files:e.files,storagePath:e.storagePath}),o=createSandboxProviderIdentity({dockerfile:t?.contentHash,optionsHash:a,resources:sandboxProviderResourceIdentity(e.resources),sourceRevision:e.sourceRevision,version:2}).slice(0,24),s={optionsHash:a,templateKey:o},c=dockerTemplateImageReference(s),l=e.resources.source,u=l.kind===`materialized`?await prepareImmutableResources({storagePath:e.storagePath,provider:DOCKER_PROVIDER_NAME,resourcesKey:l.key,sourcePath:l.path}):void 0,d=resolveDockerTemplateMarkerPath(e.storagePath,s);if(e.log?.(`checking cached template image "${c}"`),await dockerImageExists(n,c))return e.log?.(`reusing cached template image`),await touchDockerTemplateMarker(d,c),{imageReference:c};let f=i.image;t===void 0?(e.log?.(`checking base image "${i.image}"`),await ensureDockerBaseImage(n,i)):(f=dockerfileImageReference({dockerfile:t,templateKey:o}),e.log?.(`building sandbox Dockerfile "${t.path}"`),await buildSandboxDockerfile({cli:n,dockerfile:t,imageReference:f}));let p=`${o}-build-${randomUUID().slice(0,8)}`;e.log?.(`starting template build container`),await startDockerContainer({cli:n,containerName:p,image:f,initialNetworkPolicy:`allow-all`,options:i,resourcesPath:u,role:`template-build`});try{let t=await resolveDockerHandleIdentity(n,p);e.log?.(`preparing base runtime inside container`),await runDockerBaseSetup(n,t);let i=buildSandboxSession(createDockerInternalSession({cli:n,containerIdentity:t}),e=>setDockerNetworkPolicy(n,t,e));await hydrateSandboxProviderResources({copySkills:!0,log:e.log,resources:e.resources,session:i}),r.prepare!==void 0&&(e.log?.(`running sandbox preparation`),await r.prepare(createLoggingSandboxSession({log:e.log,session:i}))),e.log?.(`stopping template build container`),expectDockerSuccess(await n.run([`stop`,`-t`,`0`,t]),`stop template build container "${p}"`),e.log?.(`committing template image "${c}"`),await commitDockerTemplateImage({cli:n,containerIdentity:t,imageReference:c,templateKey:o})===`reused`&&e.log?.(`reusing concurrently published template image`),await touchDockerTemplateMarker(d,c)}finally{await n.run([`rm`,`-f`,p]).catch(()=>{})}return{imageReference:c}},async resume(e,t,n){let r=requireDockerSessionState(n);if(r.generation!==dockerGeneration(t,a))throw Error(`Docker sandbox session state is incompatible with this environment.`);return await openDockerSession(e,void 0,t,r.containerName,!1)},async start(e,t,n){let r=dockerSessionName(e.session.id,t,n,a);return{handle:await openDockerSession(e,t,n,r,!0),state:{containerName:r,generation:dockerGeneration(n,a),version:2}}}}}function dockerGeneration(e,t){return createSandboxProviderIdentity({artifact:e,environment:t,version:1})}function dockerSessionName(e,t,n,r){return`eve-sbx-${createSandboxProviderIdentity({artifact:n,environment:r,open:{networkPolicy:t?.networkPolicy},sessionId:e,version:1}).slice(0,32)}`}function requirePreparedDockerArtifact(e){if(!isSandboxPreparedArtifactRecord(e)||typeof e.imageReference!=`string`)throw Error(`Invalid prepared Docker artifact.`);return{imageReference:e.imageReference}}function requireDockerSessionState(e){if(!isSandboxPreparedArtifactRecord(e)||e.version!==2||typeof e.containerName!=`string`||typeof e.generation!=`string`)throw Error(`Invalid Docker sandbox session state.`);return{containerName:e.containerName,generation:e.generation,version:2}}async function resolveDockerHandleIdentity(e,t){let n=await e.run([`container`,`inspect`,`--format`,`{{.Id}}`,t]);expectDockerSuccess(n,`resolve sandbox container identity for "${t}"`);let r=n.stdout.trim();if(r.length===0)throw Error(`Docker returned an empty identity for sandbox container "${t}".`);return r}export{DOCKER_PROVIDER_NAME,DOCKER_TEMPLATE_IMAGE_REPOSITORY,createDockerSandboxProvider,pruneDockerSandboxTemplates};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SandboxProviderHandle, SandboxProviderHost } from "#shared/sandbox-provider.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
3
|
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
4
4
|
import type { SandboxProcess, SandboxRemovePathOptions, SandboxSpawnOptions } from "#shared/sandbox-session.js";
|
|
5
5
|
export interface JustBashSessionMetadata {
|
|
@@ -34,4 +34,4 @@ export declare function createBashSandbox(input: {
|
|
|
34
34
|
* Throw rather than silently no-op so brokering code surfaces the gap instead
|
|
35
35
|
* of leaking.
|
|
36
36
|
*/
|
|
37
|
-
export declare function createJustBashHandle(sandbox: BashSandbox): SandboxProviderHandle<
|
|
37
|
+
export declare function createJustBashHandle(sandbox: BashSandbox): SandboxProviderHandle<SandboxSession>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
3
|
import { type SandboxProviderImplementation } from "#shared/sandbox-provider.js";
|
|
4
4
|
export declare const JUST_BASH_PROVIDER_NAME = "just-bash";
|
|
5
5
|
type JustBashPreparedArtifact = {
|
|
@@ -10,7 +10,7 @@ type JustBashSessionState = {
|
|
|
10
10
|
readonly rootPath: string;
|
|
11
11
|
readonly version: 2;
|
|
12
12
|
};
|
|
13
|
-
export declare function createJustBashSandboxProvider(authoredOptions?: JustBashSandboxCreateOptions | undefined): SandboxProviderImplementation<undefined, JustBashPreparedArtifact, JustBashSessionState,
|
|
13
|
+
export declare function createJustBashSandboxProvider(authoredOptions?: JustBashSandboxCreateOptions | undefined): SandboxProviderImplementation<undefined, JustBashPreparedArtifact, JustBashSessionState, SandboxSession>;
|
|
14
14
|
export declare function pruneJustBashSandboxTemplates(input: {
|
|
15
15
|
readonly appRoot: string;
|
|
16
16
|
readonly now?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{access,cp,mkdir,rename,rm,utimes}from"node:fs/promises";import{dirname,join}from"node:path";import{
|
|
1
|
+
import{randomUUID}from"node:crypto";import{access,cp,mkdir,rename,rm,utimes}from"node:fs/promises";import{dirname,join}from"node:path";import{WORKSPACE_ROOT}from"#runtime/workspace/types.js";import{bufferToStream,streamToBuffer}from"#execution/sandbox/stream-utils.js";import{resolveSandboxModelPath}from"#shared/skill-paths.js";function createFileBackedInternalSandboxSession(e){return{resolvePath:resolveWorkspacePath,async spawn(t){return await e.sandbox.spawn(t)},async readFile(t){let n=await e.sandbox.readFileBytes(t.path);return n===null?null:bufferToStream(n)},async removePath(t){await e.sandbox.removePath(t)},async writeFile(t){let n=await streamToBuffer(t.content);await e.sandbox.writeFiles([{content:n,path:t.path}])}}}function resolveWorkspacePath(e){return e.startsWith(`/`)?e:`${WORKSPACE_ROOT}/${e}`}async function pathExists(e){try{return await access(e),!0}catch{return!1}}async function copyDirectoryAtomically(e,t){let n=`${t}.${randomUUID()}.tmp`;await rm(n,{force:!0,recursive:!0}),await mkdir(dirname(t),{recursive:!0});try{await cp(e,n,{recursive:!0}),await rename(n,t)}catch(e){if(await rm(n,{force:!0,recursive:!0}).catch(()=>{}),await pathExists(t))return;throw e}}async function touchDirectory(e){let t=new Date;await utimes(e,t,t)}function resolveLocalProviderTemplateRootPath(e,t,n){return join(resolveLocalProviderTemplatesDirectory(e,t),n)}function resolveLocalProviderTemplatesDirectory(e,t){return join(e,t,`templates`)}function resolveLocalProviderSessionRootPath(e,t,n){return join(e,t,`sessions`,n)}async function writeSandboxSeedFiles(e,t){for(let n of t){let t=await resolveSandboxModelPath({path:n.path,sandbox:e});typeof n.content==`string`?await e.writeTextFile({content:n.content,path:t}):await e.writeBinaryFile({content:n.content,path:t})}}export{copyDirectoryAtomically,createFileBackedInternalSandboxSession,pathExists,resolveLocalProviderSessionRootPath,resolveLocalProviderTemplateRootPath,resolveLocalProviderTemplatesDirectory,resolveWorkspacePath,touchDirectory,writeSandboxSeedFiles};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
|
+
type NetworkPolicySandboxSession = SandboxSession & {
|
|
4
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
5
|
+
};
|
|
1
6
|
import { MICROSANDBOX_METADATA_VERSION } from "#execution/sandbox/bindings/microsandbox-metadata.js";
|
|
2
7
|
import type { ResolvedMicrosandboxOptions } from "#execution/sandbox/bindings/microsandbox-options.js";
|
|
3
8
|
import type { MicrosandboxSandboxRuntimeOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
4
9
|
import { type SandboxProviderSessionContext, type SandboxProviderHandle, type SandboxProviderPrepareContext } from "#shared/sandbox-provider.js";
|
|
5
|
-
import type { MutableNetworkSandboxSession } from "#shared/sandbox-session.js";
|
|
6
10
|
export type MicrosandboxPreparedArtifact = {
|
|
7
11
|
readonly image: string | null;
|
|
8
12
|
readonly optionsHash: string;
|
|
@@ -28,7 +32,7 @@ export declare function createMicrosandboxHandle(input: {
|
|
|
28
32
|
readonly runtimeOptions?: MicrosandboxSandboxRuntimeOptions;
|
|
29
33
|
readonly sessionIdentity?: string;
|
|
30
34
|
}): Promise<{
|
|
31
|
-
readonly handle: SandboxProviderHandle<
|
|
35
|
+
readonly handle: SandboxProviderHandle<NetworkPolicySandboxSession>;
|
|
32
36
|
readonly state: {
|
|
33
37
|
readonly optionsHash: string;
|
|
34
38
|
readonly sessionIdentity: string;
|
|
@@ -36,3 +40,4 @@ export declare function createMicrosandboxHandle(input: {
|
|
|
36
40
|
};
|
|
37
41
|
}>;
|
|
38
42
|
export declare function clearActiveMicrosandboxSessionHandlesForTest(): void;
|
|
43
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
|
+
type NetworkPolicySandboxSession = SandboxSession & {
|
|
4
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
5
|
+
};
|
|
2
6
|
import { type MicrosandboxPreparedArtifact } from "#execution/sandbox/bindings/microsandbox-lifecycle.js";
|
|
3
7
|
import type { MicrosandboxSandboxCreateOptions, MicrosandboxSandboxRuntimeOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
4
8
|
import { type SandboxProviderImplementation } from "#shared/sandbox-provider.js";
|
|
@@ -9,4 +13,4 @@ export type MicrosandboxProviderSessionState = {
|
|
|
9
13
|
readonly sessionIdentity: string;
|
|
10
14
|
readonly version: 3;
|
|
11
15
|
};
|
|
12
|
-
export declare function createMicrosandboxSandboxProvider(authoredOptions?: MicrosandboxSandboxCreateOptions | undefined): SandboxProviderImplementation<MicrosandboxSandboxRuntimeOptions, MicrosandboxPreparedArtifact, MicrosandboxProviderSessionState,
|
|
16
|
+
export declare function createMicrosandboxSandboxProvider(authoredOptions?: MicrosandboxSandboxCreateOptions | undefined): SandboxProviderImplementation<MicrosandboxSandboxRuntimeOptions, MicrosandboxPreparedArtifact, MicrosandboxProviderSessionState, NetworkPolicySandboxSession>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
|
+
type NetworkPolicySandboxSession = SandboxSession & {
|
|
3
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
4
|
+
};
|
|
2
5
|
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
6
|
import { type SandboxProviderImplementation } from "#shared/sandbox-provider.js";
|
|
4
7
|
import type { VercelSandboxRuntimeOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
@@ -14,7 +17,7 @@ export type VercelSandboxSessionState = {
|
|
|
14
17
|
type VercelEnvironmentOptions = VercelCreateOptions & {
|
|
15
18
|
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
16
19
|
};
|
|
17
|
-
export declare function createVercelSandboxProvider(environmentOptions: Readonly<VercelEnvironmentOptions> | undefined): SandboxProviderImplementation<VercelSandboxRuntimeOptions, VercelSandboxPreparedArtifact, VercelSandboxSessionState,
|
|
20
|
+
export declare function createVercelSandboxProvider(environmentOptions: Readonly<VercelEnvironmentOptions> | undefined): SandboxProviderImplementation<VercelSandboxRuntimeOptions, VercelSandboxPreparedArtifact, VercelSandboxSessionState, NetworkPolicySandboxSession>;
|
|
18
21
|
export interface CreateVercelSandboxInput {
|
|
19
22
|
readonly createSandbox?: CreateVercelSandbox;
|
|
20
23
|
readonly createOptions?: VercelCreateOptions;
|
|
@@ -23,5 +26,5 @@ export interface CreateVercelSandboxInput {
|
|
|
23
26
|
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
24
27
|
readonly skipEmptyPreparation?: boolean;
|
|
25
28
|
}
|
|
26
|
-
export declare function createVercelSandbox(input?: CreateVercelSandboxInput): SandboxProviderImplementation<VercelSandboxRuntimeOptions, VercelSandboxPreparedArtifact, VercelSandboxSessionState,
|
|
29
|
+
export declare function createVercelSandbox(input?: CreateVercelSandboxInput): SandboxProviderImplementation<VercelSandboxRuntimeOptions, VercelSandboxPreparedArtifact, VercelSandboxSessionState, NetworkPolicySandboxSession>;
|
|
27
30
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{WORKSPACE_ROOT}from"#runtime/workspace/types.js";import{VERCEL_EVE_SANDBOX_IMAGE}from"#execution/sandbox/bindings/eve-image.js";import{streamToBuffer}from"#execution/sandbox/stream-utils.js";import{createLoggingSandboxSession}from"#execution/sandbox/logging-session.js";import{buildSandboxSession}from"#execution/sandbox/session.js";import{createSandboxProviderIdentity}from"#execution/sandbox/provider-identity.js";import{isSandboxPreparedArtifactRecord,providerResourceTargetFiles,sandboxProviderResourceIdentity}from"#shared/sandbox-provider.js";import{SandboxTemplateNotProvisionedError}from"#shared/sandbox-template-error.js";import{adaptMultiplexedCommandToSandboxProcess}from"#execution/sandbox/multiplexed-command.js";import{resolveSandboxModelPath}from"#shared/skill-paths.js";import{isVercelSandboxMissingError,isVercelSnapshotUnavailableError}from"#execution/sandbox/bindings/vercel-errors.js";import{ensureVercelSandboxTags,errorMessage,resolveVercelSandboxTags}from"#execution/sandbox/bindings/vercel-options.js";import{applyInitialVercelNetworkPolicy,createVercelNetworkPolicySetter,ensureVercelSandboxBaseRuntime,withBaseSetupNetworkPolicy}from"#execution/sandbox/bindings/vercel-base-runtime.js";import{createVercelEveImageSandbox}from"#execution/sandbox/bindings/vercel-create-sdk.js";import{getNamedVercelSandbox}from"#execution/sandbox/bindings/vercel-lookup.js";import{deleteUnusableVercelSandbox,deleteVercelSandbox,stopVercelSandbox}from"#execution/sandbox/bindings/vercel-lifecycle.js";import{normalizeVercelReadStream}from"#execution/sandbox/bindings/vercel-read-stream.js";function createVercelSandboxProvider(e){let{prepare:t,...n}=e??{};return createVercelSandbox({createOptions:n,prepare:t})}function createVercelSandbox(e={}){let t=e.loadSandboxModule??(async()=>await import(`#compiled/@vercel/sandbox/index.js`)),n=e.loadDeleteSandboxModule??(async()=>await import(`#compiled/@vercel/sandbox/index.js`)),r={timeout:DEFAULT_SANDBOX_TIMEOUT_MS,...e.createOptions},i=e.createSandbox??createVercelEveImageSandbox;async function openSession(e,a,o,s){let c=requirePreparedVercelTemplate(o),{mounts:l,...u}=a??{},d={...r,...u},f=resolveVercelSandboxTags(d.tags,{sessionId:e.session.id}),p=await t(),m={createOptions:d,createSandbox:i,resolveSessionCreateOptions:l===void 0?void 0:async()=>({mounts:l}),sandboxModule:p,sessionKey:s,snapshotId:c.snapshotId,tags:f},h;try{if(h=await ensureSession(m),h=await ensureUsableSession({input:m,loadDeleteSandboxModule:n,session:h}),h.created&&c.snapshotId===void 0&&u.networkPolicy!==void 0)try{await applyInitialVercelNetworkPolicy(h.sandbox,u.networkPolicy)}catch(t){try{await deleteVercelSandbox({createOptions:d,loadDeleteSandboxModule:n,sandbox:h.sandbox})}catch(n){throw AggregateError([t,n],`Failed to apply network policy and discard Vercel sandbox session "${e.session.id}".`,{cause:t})}throw t}}catch(t){throw isVercelSnapshotUnavailableError(t)&&c.snapshotId!==void 0?new SandboxTemplateNotProvisionedError({providerName:`vercel`,templateKey:c.snapshotId}):Error(`Failed to open Vercel sandbox session "${e.session.id}": ${errorMessage(t)}`,{cause:t})}return createHandle({createOptions:d,loadDeleteSandboxModule:n,sandbox:h.sandbox})}return{async prepare(n){let a=providerResourceTargetFiles(n.resources);if(e.skipEmptyPreparation===!0&&e.prepare===void 0&&a.length===0)return{};let o=`eve-sbx-tpl-vercel-${createSandboxProviderIdentity({createOptions:vercelIdentityOptions(r),resolvedImage:r.source===void 0?r.image??VERCEL_EVE_SANDBOX_IMAGE:void 0,resources:sandboxProviderResourceIdentity(n.resources),sourceRevision:n.sourceRevision,version:2}).slice(0,32)}`;try{return{snapshotId:(await ensureTemplateWithUnavailableRetry({createOptions:r,createSandbox:i,loadSandboxModule:t,log:n.log,prepareSandbox:e.prepare,seedFiles:a,templateKey:o})).template.snapshotId}}catch(e){throw Error(`Failed to prepare Vercel sandbox snapshot: ${errorMessage(e)}`,{cause:e})}},async resume(e,i,a){requirePreparedVercelTemplate(i);let o=requireVercelSessionState(a),s=await t(),c=await getNamedVercelSandbox({createOptions:r,sandboxModule:s,sandboxName:o.sandboxName});if(c===null)throw Error(`Vercel sandbox session "${o.sandboxName}" no longer exists.`);return await ensureVercelSandboxBaseRuntime(c),createHandle({createOptions:r,loadDeleteSandboxModule:n,sandbox:c})},async start(e,t,n){let i=vercelSessionName(e.session.id,t,n,r);return{handle:await openSession(e,t,n,i),state:{sandboxName:i,version:3}}}}}function vercelSessionName(e,t,n,r){let i=requirePreparedVercelTemplate(n);return`eve-sbx-vercel-${createSandboxProviderIdentity({artifact:i,createOptions:vercelIdentityOptions(r),options:vercelIdentityOptions(t),sessionId:e,version:1}).slice(0,32)}`}function vercelIdentityOptions(e){if(e===void 0)return;let t=new Set([`fetch`,`projectId`,`signal`,`teamId`,`token`]);return Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e)))}function requireVercelSessionState(e){if(!isSandboxPreparedArtifactRecord(e)||e.version!==3||typeof e.sandboxName!=`string`)throw Error(`Invalid Vercel sandbox session state.`);return{sandboxName:e.sandboxName,version:3}}function requirePreparedVercelTemplate(e){if(!isSandboxPreparedArtifactRecord(e)||e.snapshotId!==void 0&&typeof e.snapshotId!=`string`)throw Error(`Invalid prepared Vercel sandbox artifact.`);return e.snapshotId===void 0?{}:{snapshotId:e.snapshotId}}async function ensureTemplateWithUnavailableRetry(e){try{return await ensureTemplate(e)}catch(t){if(!isVercelSnapshotUnavailableError(t)&&!isVercelSandboxMissingError(t))throw t;return e.log?.(`cached template disappeared; rebuilding sandbox template`),await ensureTemplate(e)}}async function ensureTemplate(e){let t=await e.loadSandboxModule(),n=await getNamedVercelSandbox({createOptions:e.createOptions,sandboxModule:t,sandboxName:e.templateKey}),r=resolveVercelSandboxTags(e.createOptions.tags,e.tags),i=extractAuthorSnapshotId(e.createOptions);n!==null&&isUnprovisionedTerminalTemplateSandbox(n,i)&&(await n.delete(),n=null),n===null?n=await e.createSandbox({sandboxModule:t,createOptions:withBaseSetupNetworkPolicy({...e.createOptions,name:e.templateKey,persistent:!0,tags:r})}):await ensureVercelSandboxTags(n,r);let a=typeof n.currentSnapshotId==`string`&&n.currentSnapshotId.length>0&&n.currentSnapshotId!==i?n.currentSnapshotId:null;if(a!==null)return{template:{sandboxName:n.name,snapshotId:a,templateKey:e.templateKey}};e.log?.(`preparing base runtime inside sandbox`),await ensureVercelSandboxBaseRuntime(n),await applyInitialVercelNetworkPolicy(n,e.createOptions.networkPolicy);let o=buildSandboxSession(createVercelInternalSandboxSession(n),createVercelNetworkPolicySetter(n));await writeVercelSandboxSeedFiles({sandbox:n,seedFiles:e.seedFiles,session:o}),e.log?.(`running sandbox preparation`),await e.prepareSandbox?.(createLoggingSandboxSession({log:e.log,session:o}));let s=await n.snapshot();return{template:{sandboxName:n.name,snapshotId:s.snapshotId,templateKey:e.templateKey}}}async function ensureUsableSession(e){try{return await ensureVercelSandboxBaseRuntime(e.session.sandbox),e.session}catch(t){if(e.session.created||!isVercelSnapshotUnavailableError(t))throw t}await deleteUnusableVercelSandbox({createOptions:e.input.createOptions,loadDeleteSandboxModule:e.loadDeleteSandboxModule,sandbox:e.session.sandbox});let t=await ensureSession(e.input);return await ensureVercelSandboxBaseRuntime(t.sandbox),t}async function ensureSession(e){let t=e.sessionKey,n=await getNamedVercelSandbox({createOptions:e.createOptions,sandboxModule:e.sandboxModule,sandboxName:t});if(n!==null)return await ensureVercelSandboxTags(n,e.tags),{created:!1,sandbox:n};let r=createSessionCreateParams(e,t,await e.resolveSessionCreateOptions?.());return e.tags!==void 0&&(r.tags=e.tags),{created:!0,sandbox:await e.createSandbox({createOptions:r,sandboxModule:e.sandboxModule})}}function createSessionCreateParams(e,t,n={}){let r={...e.createOptions,...n};if(e.snapshotId===void 0)return withBaseSetupNetworkPolicy({...r,name:t,persistent:!0});let{image:i,runtime:a,source:o,...s}=r;return{...s,name:t,persistent:!0,source:{snapshotId:e.snapshotId,type:`snapshot`}}}function createHandle(e){let{sandbox:t}=e;return{sandbox:buildSandboxSession(createVercelInternalSandboxSession(t),createVercelNetworkPolicySetter(t)),async onSessionDelete(n){await deleteVercelSandbox({createOptions:e.createOptions,loadDeleteSandboxModule:e.loadDeleteSandboxModule,sandbox:t,signal:n?.abortSignal})},async onSessionStop(){await stopVercelSandbox(t)},async onRuntimeShutdown(){try{await stopVercelSandbox(t)}catch{}}}}function createVercelInternalSandboxSession(e){return{resolvePath:resolveVercelSandboxPath,async spawn(t){let n=await e.runCommand({args:[`-lc`,t.command],cmd:`bash`,cwd:t.workingDirectory??WORKSPACE_ROOT,detached:!0,env:t.env,signal:t.abortSignal});return adaptMultiplexedCommandToSandboxProcess({command:n,getOutput:e=>e.stream})},async readFile(t){return normalizeVercelReadStream(await e.readFile({path:t.path}))},async writeFile(t){let n=await streamToBuffer(t.content),r=await resolveVercelWritePath(e,t.path,t.abortSignal);await e.writeFiles([{content:n,path:r}],{signal:t.abortSignal})},async removePath(t){await e.fs.rm(t.path,{force:t.force,recursive:t.recursive,signal:t.abortSignal})}}}async function writeVercelSandboxSeedFiles(e){if(e.seedFiles.length===0)return;let t=await Promise.all(e.seedFiles.map(async t=>({content:typeof t.content==`string`?Buffer.from(t.content):t.content,path:await resolveSandboxModelPath({path:t.path,sandbox:e.session})})));await e.sandbox.writeFiles(t)}function resolveVercelSandboxPath(e){return e.startsWith(`/`)?e:`${WORKSPACE_ROOT}/${e}`}async function resolveVercelWritePath(e,t,n){let r=await e.runCommand({args:[`-m`,`--`,t],cmd:`realpath`,signal:n}),i=(await r.stdout()).trim();if(r.exitCode!==0||!i.startsWith(`/`)||i.includes(`
|
|
2
2
|
`))throw Error(`Failed to resolve Vercel Sandbox write path: ${t}`);return i}function isUnprovisionedTerminalTemplateSandbox(e,t){let n=e.currentSnapshotId;return typeof n==`string`&&n.length>0&&n!==t?!1:e.status===`aborted`||e.status===`failed`||e.status===`stopped`}function extractAuthorSnapshotId(e){let t=e.source;if(t?.type===`snapshot`&&typeof t.snapshotId==`string`)return t.snapshotId}const DEFAULT_SANDBOX_TIMEOUT_MS=18e5;export{createVercelSandbox,createVercelSandboxProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{contextStorage}from"#context/container.js";import{resolveSandboxCacheDirectory}from"#internal/application/paths.js";import{getSandboxEnvironmentRuntime,runWithSandboxConstructorRuntime}from"#shared/sandbox-environment.js";import{buildCallbackContext,withRuntimeSandboxLifecycle}from"#context/build-callback-context.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{trackActiveSandboxHandle}from"#execution/sandbox/active-handles.js";import{isSandboxPreparedArtifact}from"#shared/sandbox-provider.js";import{SandboxTemplateNotProvisionedError}from"#shared/sandbox-template-error.js";import{loadSandboxPreparedArtifact}from"#runtime/sandbox/prepared-artifacts.js";import{getRuntimeCompiledArtifactsSandboxAppRoot}from"#runtime/compiled-artifacts-source.js";import{ensureDevelopmentSandboxesPrepared}from"#execution/sandbox/development-lazy-prewarm.js";import{createSandboxProviderHost}from"#execution/sandbox/provider-host.js";async function ensureSandboxAccess(e){let t=e.state?.session??null,n,r,i,a=getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource)??process.cwd(),o=e.registry.sandbox;if(o===null)return{async captureState(){return{session:t}},async get(){return null},async stop(){}};async function open(n,i,s,c){if(r!==void 0)throw Error(`A sandbox definition can open only one sandbox.`);let l=o.inheritance,u=l?.definition??o.definition;if(u.kind!==`independent`)throw Error(`Sandbox "${u.logicalPath}" has no environment.`);if(s!==u.environment)throw Error(`Sandbox "${u.logicalPath}" selected a different environment.`);if(n!==getSandboxEnvironmentRuntime(u.environment))throw Error(`Sandbox "${u.logicalPath}" selected a different provider.`);if(t!==null)throw Error(`Sandbox "${u.logicalPath}" is already initialized.`);let d=l?.nodeId??e.nodeId,f=await loadSandboxPreparedArtifact({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:d,providerName:n.providerName});if(f===void 0)throw new SandboxTemplateNotProvisionedError({providerName:n.providerName,templateKey:d});let p={host:createSandboxProviderHost(a),session:c,storagePath:resolveSandboxCacheDirectory(a)};r=(async()=>{let e=await n.implementation.start(p,i,f);if(!isSandboxPreparedArtifact(e.state))throw Error(`Sandbox provider "${n.providerName}" returned non-serializable session state.`);return t={providerName:n.providerName,state:e.state,stateProtocolVersion:n.stateProtocolVersion},e.handle})().catch(e=>{throw r=void 0,e});let m=await r;return installHandle(n.providerName,m)}function installHandle(e,t){let r=withRuntimeSandboxLifecycle(t.sandbox,e=>t.onSessionDelete(e),()=>t.onSessionStop());return n={handle:t,providerName:e,sandbox:r},r}async function resumePersisted(n,i){if(t===null)throw Error(`Sandbox session state is missing.`);let s=getSandboxEnvironmentRuntime(n.environment);if(t.providerName!==s.providerName)throw Error(`Sandbox session state belongs to provider "${t.providerName}", not "${s.providerName}".`);if(t.stateProtocolVersion!==s.stateProtocolVersion)throw Error(`Sandbox session state protocol ${t.stateProtocolVersion} is incompatible with provider "${s.providerName}" protocol ${s.stateProtocolVersion}.`);let c=o.inheritance?.nodeId??e.nodeId,l=await loadSandboxPreparedArtifact({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:c,providerName:s.providerName});if(l===void 0)throw new SandboxTemplateNotProvisionedError({providerName:s.providerName,templateKey:c});let u={host:createSandboxProviderHost(a),session:i,storagePath:resolveSandboxCacheDirectory(a)};r=s.implementation.resume(u,l,t.state).catch(e=>{throw r=void 0,e});let d=await r;return installHandle(s.providerName,d),trackActiveSandboxHandle({handle:d,providerName:s.providerName,sessionId:e.sessionId}),d}async function resolveHandle(){let i=o.inheritance,a=i?.definition??o.definition;if(a.kind!==`independent`)throw Error(`Sandbox "${a.logicalPath}" has no resolved parent.`);isEveDevEnvironment()&&e.compiledArtifactsSource.kind===`disk`&&await ensureDevelopmentSandboxesPrepared({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:i?.nodeId??e.nodeId,providerName:getSandboxEnvironmentRuntime(a.environment).providerName});let s={...contextStorage.getStore()===void 0?{auth:{current:null,initiator:null},id:e.sessionId,turn:{id:`sandbox-initialization`,sequence:0}}:buildCallbackContext().session,id:e.sessionId};if(t!==null)return await resumePersisted(a,s);if(i!==void 0)await open(getSandboxEnvironmentRuntime(a.environment),void 0,a.environment,s);else try{let e=await runWithSandboxConstructorRuntime({open:({environment:e,options:t,provider:n})=>open(n,t,e,s)},async()=>a.selector({session:s}));if(n===void 0||e!==n.sandbox)throw Error(`Sandbox "${a.logicalPath}" must return the sandbox it opens.`)}catch(e){let i=n?.handle;if(n=void 0,r=void 0,t=null,i!==void 0)try{await i.onSessionDelete()}catch(t){throw AggregateError([e,t],`Sandbox "${a.logicalPath}" initialization and cleanup both failed.`,{cause:e})}throw e}if(n===void 0)throw Error(`Sandbox "${a.logicalPath}" did not open a provider handle.`);return trackActiveSandboxHandle({handle:n.handle,providerName:n.providerName,sessionId:e.sessionId}),n.handle}function requireHandle(){return i===void 0&&(i=resolveHandle().catch(e=>{throw i=void 0,e})),i}return{async captureState(){return r!==void 0&&await r,{session:t}},async delete(a){if(e.ownsSandbox===!1)throw Error(`Only the owning session can delete this sandbox.`);await(await requireHandle()).onSessionDelete(a),n=void 0,r=void 0,t=null,i=void 0},async get(){return await requireHandle(),n?.sandbox??null},async stop(){await(await requireHandle()).onSessionStop(),n=void 0,r=void 0,i=void 0}}}export{ensureSandboxAccess};
|
|
1
|
+
import{contextStorage}from"#context/container.js";import{resolveSandboxCacheDirectory}from"#internal/application/paths.js";import{getSandboxEnvironmentRuntime,runWithSandboxConstructorRuntime}from"#shared/sandbox-environment.js";import{buildCallbackContext,withRuntimeSandboxLifecycle}from"#context/build-callback-context.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{trackActiveSandboxHandle}from"#execution/sandbox/active-handles.js";import{isSandboxPreparedArtifact}from"#shared/sandbox-provider.js";import{SandboxTemplateNotProvisionedError}from"#shared/sandbox-template-error.js";import{loadSandboxPreparedArtifact}from"#runtime/sandbox/prepared-artifacts.js";import{getRuntimeCompiledArtifactsSandboxAppRoot}from"#runtime/compiled-artifacts-source.js";import{ensureDevelopmentSandboxesPrepared}from"#execution/sandbox/development-lazy-prewarm.js";import{createSandboxProviderHost}from"#execution/sandbox/provider-host.js";async function ensureSandboxAccess(e){let t=e.state?.session??null,n,r,i,a=getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource)??process.cwd(),o=e.registry.sandbox;if(o===null)return{async captureState(){return{session:t}},async get(){return null},async stop(){}};async function open(n,i,s,c){if(r!==void 0)throw Error(`A sandbox definition can open only one sandbox.`);let l=o.inheritance,u=l?.definition??o.definition;if(u.kind!==`independent`)throw Error(`Sandbox "${u.logicalPath}" has no environment.`);if(s!==u.environment)throw Error(`Sandbox "${u.logicalPath}" selected a different environment.`);if(n!==getSandboxEnvironmentRuntime(u.environment))throw Error(`Sandbox "${u.logicalPath}" selected a different provider.`);if(t!==null)throw Error(`Sandbox "${u.logicalPath}" is already initialized.`);let d=l?.nodeId??e.nodeId,f=await loadSandboxPreparedArtifact({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:d,providerName:n.providerName});if(f===void 0)throw new SandboxTemplateNotProvisionedError({providerName:n.providerName,templateKey:d});let p={host:createSandboxProviderHost(a),session:c,storagePath:resolveSandboxCacheDirectory(a)};r=(async()=>{let e=await n.implementation.start(p,i,f);if(!isSandboxPreparedArtifact(e.state))throw Error(`Sandbox provider "${n.providerName}" returned non-serializable session state.`);return t={providerName:n.providerName,state:e.state,stateProtocolVersion:n.stateProtocolVersion},e.handle})().catch(e=>{throw r=void 0,e});let m=await r;return installHandle(n.providerName,m)}function installHandle(e,t){let r=withRuntimeSandboxLifecycle(t.sandbox,e=>t.onSessionDelete(e),()=>t.onSessionStop());return n={handle:t,providerName:e,sandbox:r},r}async function resumePersisted(n,i){if(t===null)throw Error(`Sandbox session state is missing.`);let s=getSandboxEnvironmentRuntime(n.environment);if(t.providerName!==s.providerName)throw Error(`Sandbox session state belongs to provider "${t.providerName}", not "${s.providerName}".`);if(t.stateProtocolVersion!==s.stateProtocolVersion)throw Error(`Sandbox session state protocol ${t.stateProtocolVersion} is incompatible with provider "${s.providerName}" protocol ${s.stateProtocolVersion}.`);let c=o.inheritance?.nodeId??e.nodeId,l=await loadSandboxPreparedArtifact({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:c,providerName:s.providerName});if(l===void 0)throw new SandboxTemplateNotProvisionedError({providerName:s.providerName,templateKey:c});let u={host:createSandboxProviderHost(a),session:i,storagePath:resolveSandboxCacheDirectory(a)};r=s.implementation.resume(u,l,t.state).catch(e=>{throw r=void 0,e});let d=await r;return installHandle(s.providerName,d),trackActiveSandboxHandle({handle:d,providerName:s.providerName,sessionId:e.sessionId}),d}async function resolveHandle(){let i=o.inheritance,a=i?.definition??o.definition;if(a.kind!==`independent`)throw Error(`Sandbox "${a.logicalPath}" has no resolved parent.`);isEveDevEnvironment()&&e.compiledArtifactsSource.kind===`disk`&&await ensureDevelopmentSandboxesPrepared({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:i?.nodeId??e.nodeId,providerName:getSandboxEnvironmentRuntime(a.environment).providerName});let s={...contextStorage.getStore()===void 0?{auth:{current:null,initiator:null},id:e.sessionId,turn:{id:`sandbox-initialization`,sequence:0}}:buildCallbackContext().session,id:e.sessionId};if(t!==null)return await resumePersisted(a,s);if(i!==void 0)await open(getSandboxEnvironmentRuntime(a.environment),void 0,a.environment,s);else try{let e=await runWithSandboxConstructorRuntime({open:({environment:e,options:t,provider:n})=>open(n,t,e,s)},async()=>a.selector({session:s}));if(n===void 0||e!==n.sandbox)throw Error(`Sandbox "${a.logicalPath}" must return the sandbox it opens.`)}catch(e){let i=n?.handle;if(n=void 0,r=void 0,t=null,i!==void 0)try{await i.onSessionDelete()}catch(t){throw AggregateError([e,t],`Sandbox "${a.logicalPath}" initialization and cleanup both failed.`,{cause:e})}throw e}if(n===void 0)throw Error(`Sandbox "${a.logicalPath}" did not open a provider handle.`);return trackActiveSandboxHandle({handle:n.handle,providerName:n.providerName,sessionId:e.sessionId}),n.handle}function requireHandle(){return i===void 0&&(i=resolveHandle().catch(e=>{throw i=void 0,e})),i}let s=o.inheritance?.definition??o.definition;return{environment:s.kind===`independent`?s.environment:void 0,async captureState(){return r!==void 0&&await r,{session:t}},async delete(a){if(e.ownsSandbox===!1)throw Error(`Only the owning session can delete this sandbox.`);await(await requireHandle()).onSessionDelete(a),n=void 0,r=void 0,t=null,i=void 0},async get(){return await requireHandle(),n?.sandbox??null},async stop(){await(await requireHandle()).onSessionStop(),n=void 0,r=void 0,i=void 0}}}export{ensureSandboxAccess};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{MAX_OUTPUT_BYTES}from"#execution/sandbox/truncate-output.js";import{shellQuote}from"#execution/sandbox/shell-quote.js";import{normalizeModelPath}from"#execution/tools/file-state.js";import{resolveAbsoluteFilePath}from"#execution/sandbox/require-sandbox.js";import{ripgrepIsAvailable}from"#execution/sandbox/ripgrep-probe.js";async function executeGlobOnSandbox(e,t){let n=t.path??`/workspace`,r=await resolveAbsoluteFilePath(e,n),i=normalizeModelPath(r),a=Math.min(Math.max(1,t.limit??100),1e3),o=await ripgrepIsAvailable(e)?buildRipgrepCommand({normalizedPath:i,pattern:t.pattern}):buildPosixFindCommand({normalizedPath:i,pattern:t.pattern}),s=await e.run({command:o});if(s.exitCode!==0&&s.exitCode!==1||s.exitCode===1&&s.stderr.trim().length>0)throw buildGlobExecutionError(o,s.exitCode,s.stderr);let c=s.stdout.split(`
|
|
2
2
|
`).filter(e=>e.length>0),l=c.length>a,u=l?c.slice(0,a):c,d=[],f=0,p=!1;for(let e of u){let t=normalizeModelPath(e),n=Buffer.byteLength(t,`utf8`)+1;if(f+n>MAX_OUTPUT_BYTES&&d.length>0){p=!0;break}d.push(t),f+=n}if(d.length===0)return{content:`No files found`,count:0,path:i,truncated:!1};let m=l||p,h=[...d];return m&&(h.push(``),h.push(`(Results truncated: showing first ${d.length} results out of more. Use a more specific path or pattern to narrow results.)`)),{content:h.join(`
|
|
3
3
|
`),count:d.length,path:i,truncated:m}}function buildRipgrepCommand(e){return[`rg --files --hidden`,`--glob '!.git/*'`,`--glob ${shellQuote(e.pattern)}`,shellQuote(e.normalizedPath)].join(` `)}function buildPosixFindCommand(e){let t=translateGlobToFindPattern(e.pattern),n=t.includes(`/`)?`-path ${shellQuote(`*/${t}`)}`:`-name ${shellQuote(t)}`;return[`find ${shellQuote(e.normalizedPath)}`,`-type f`,`-not -path '*/.git/*'`,n].join(` `)}function translateGlobToFindPattern(e){let t=e.replaceAll(`**`,`*`);for(;t.startsWith(`*/`);)t=t.slice(2);return t}function buildGlobExecutionError(e,t,n){let r=n.trim(),i=r.length>0?r:`no stderr output`;return Error(`glob failed (exit ${t}): ${i}\nCommand: ${e}`)}export{executeGlobOnSandbox};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{MAX_OUTPUT_BYTES,capLineLength}from"#execution/sandbox/truncate-output.js";import{shellQuote}from"#execution/sandbox/shell-quote.js";import{normalizeModelPath}from"#execution/tools/file-state.js";import{resolveAbsoluteFilePath}from"#execution/sandbox/require-sandbox.js";import{ripgrepIsAvailable}from"#execution/sandbox/ripgrep-probe.js";async function executeGrepOnSandbox(e,t){let n=t.path??`/workspace`,r=await resolveAbsoluteFilePath(e,n),i=normalizeModelPath(r),a=Math.min(Math.max(1,t.limit??100),1e3),o=t.context!==void 0&&t.context>0?t.context:0,s=await ripgrepIsAvailable(e)?buildRipgrepCommand({contextLines:o,effectiveLimit:a,glob:t.glob,ignoreCase:t.ignoreCase??!1,literal:t.literal??!1,normalizedPath:i,pattern:t.pattern}):buildPosixGrepCommand({contextLines:o,effectiveLimit:a,glob:t.glob,ignoreCase:t.ignoreCase??!1,literal:t.literal??!1,normalizedPath:i,pattern:t.pattern}),c=await e.run({command:s});if(c.exitCode!==0&&c.exitCode!==1||c.exitCode===1&&c.stderr.trim().length>0)throw buildGrepExecutionError(s,c.exitCode,c.stderr);let l=c.stdout;return l.trim().length===0?{content:`No matches found`,matchCount:0,path:i,truncated:!1}:processOutput({effectiveLimit:a,normalizedPath:i,stdout:l})}function buildRipgrepCommand(e){let t=[`rg`,`--line-number`,`--color=never`,`--hidden`,`--glob '!.git/*'`];return e.ignoreCase&&t.push(`--ignore-case`),e.literal&&t.push(`--fixed-strings`),e.glob!==void 0&&t.push(`--glob ${shellQuote(e.glob)}`),e.contextLines>0&&t.push(`--context ${e.contextLines}`),t.push(`--max-count ${e.effectiveLimit}`),t.push(`--`),t.push(shellQuote(e.pattern)),t.push(shellQuote(e.normalizedPath)),t.join(` `)}function buildPosixGrepCommand(e){let t=[`grep`,`-r`,`-n`,`--exclude-dir=.git`];return e.ignoreCase&&t.push(`-i`),e.literal?t.push(`-F`):t.push(`-E`),e.glob!==void 0&&t.push(`--include=${shellQuote(e.glob)}`),e.contextLines>0&&t.push(`-C ${e.contextLines}`),t.push(`-m ${e.effectiveLimit}`),t.push(`-e ${shellQuote(e.pattern)}`),t.push(shellQuote(e.normalizedPath)),t.join(` `)}function processOutput(e){let t=e.stdout.split(`
|
|
2
2
|
`),n=[],r=0,i=0,a=!1;for(let e=0;e<t.length;e+=1){let o=t[e]??``;if(o.length===0&&e===t.length-1)continue;o!==`--`&&o.length>0&&/^.+:\d+:/.test(o)&&i++;let s=capLineLength(o),c=Buffer.byteLength(s,`utf8`)+1;if(r+c>MAX_OUTPUT_BYTES&&n.length>0){a=!0;break}n.push(s),r+=c}let o=a||i>=e.effectiveLimit,s=n.join(`
|
|
3
3
|
`);if(o){let t=[];i>=e.effectiveLimit&&t.push(`Match limit reached (${e.effectiveLimit}). Use a larger limit or more specific pattern.`),a&&t.push(`Output truncated due to size. Use a more specific path or pattern.`),s+=`\n\n[${t.join(` `)}]`}return{content:s,matchCount:i,path:e.normalizedPath,truncated:o}}function buildGrepExecutionError(e,t,n){let r=n.trim(),i=r.length>0?r:`no stderr output`;return Error(`grep failed (exit ${t}): ${i}\nCommand: ${e}`)}export{executeGrepOnSandbox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{truncateTail}from"#execution/sandbox/truncate-output.js";function createLoggingSandboxSession(e){let{log:t,session:n}=e;return{...n,async run(e){t?.(`preparation run: ${formatCommand(e.command)}`);let r=await n.run(e);if(r.exitCode===1)throw Error(formatPreparationRunFailure(e.command,r));return r},async spawn(e){return t?.(`preparation spawn: ${formatCommand(e.command)}`),await n.spawn(e)}
|
|
2
|
-
`)}function formatCapturedOutput(e,t){let n=truncateTail(t);return n.truncated?`[${e} truncated: showing last ${n.outputLines} of ${n.totalLines} lines]\n${n.output}`:n.output}function formatCommand(e){return truncateOneLine(e)}function
|
|
1
|
+
import{truncateTail}from"#execution/sandbox/truncate-output.js";function createLoggingSandboxSession(e){let{log:t,session:n}=e;return{...n,async run(e){t?.(`preparation run: ${formatCommand(e.command)}`);let r=await n.run(e);if(r.exitCode===1)throw Error(formatPreparationRunFailure(e.command,r));return r},async spawn(e){return t?.(`preparation spawn: ${formatCommand(e.command)}`),await n.spawn(e)},async writeFile(e){return t?.(`preparation write file: ${e.path}`),await n.writeFile(e)},async writeBinaryFile(e){return t?.(`preparation write binary file: ${e.path} (${e.content.byteLength} bytes)`),await n.writeBinaryFile(e)},async writeTextFile(e){return t?.(`preparation write text file: ${e.path} (${e.content.length} chars)`),await n.writeTextFile(e)},async removePath(e){return t?.(`preparation remove path: ${e.path}`),await n.removePath(e)}}}function formatPreparationRunFailure(e,t){return[`Sandbox preparation failed because sandbox.run command exited with code 1:`,e,``,`stdout:`,formatCapturedOutput(`stdout`,t.stdout),``,`stderr:`,formatCapturedOutput(`stderr`,t.stderr)].join(`
|
|
2
|
+
`)}function formatCapturedOutput(e,t){let n=truncateTail(t);return n.truncated?`[${e} truncated: showing last ${n.outputLines} of ${n.totalLines} lines]\n${n.output}`:n.output}function formatCommand(e){return truncateOneLine(e)}function truncateOneLine(e){let t=e.replaceAll(/\s+/g,` `).trim();return t.length<=240?t:`${t.slice(0,239)}…`}export{createLoggingSandboxSession};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve}from"node:path";function createSandboxProviderHost(e){return{async loadOptionalPackage(
|
|
1
|
+
import{resolve}from"node:path";import{importInstalledEnginePackage}from"#internal/application/optional-package-import.js";function createSandboxProviderHost(e){return{async loadOptionalPackage(t){try{return await t.importModule()}catch(n){try{return await importInstalledEnginePackage({appRoot:e,packageName:t.packageName})}catch(e){throw Error(t.missingMessage,{cause:AggregateError([n,e])})}}},resolveProjectPath(t){return resolve(e,t)}}}export{createSandboxProviderHost};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{loadContext}from"#context/container.js";import{
|
|
1
|
+
import{loadContext}from"#context/container.js";import{MAX_OUTPUT_BYTES,capLineLength}from"#execution/sandbox/truncate-output.js";import{buildReadFileTargetKey,createReadFileStamp,normalizeModelPath,setReadFileStamp}from"#execution/tools/file-state.js";import{resolveAbsoluteFilePath}from"#execution/sandbox/require-sandbox.js";async function executeReadFileOnSandbox(e,t){let{filePath:n,offset:r,limit:i}=t,a=await resolveAbsoluteFilePath(e,n),o=normalizeModelPath(a),s=r??1,c=i??2e3;if(s<1)throw Error(`offset must be >= 1. Received: ${s}.`);let l=await e.readTextFile({path:a});if(l===null)throw Error(`File not found: ${n}. Verify the path exists and is accessible in the sandbox.`);if(l.includes(`\0`))throw Error(`File "${n}" contains NUL bytes and appears to be a binary file. read_file only supports text files.`);let u=l.split(`
|
|
2
2
|
`),d=u.length>0&&u[u.length-1]===``?u.length-1:u.length;if(d===0){if(s>1)throw Error(`offset ${s} is past the end of the file (0 lines). Use the default offset to read an empty file.`)}else if(s>d)throw Error(`offset ${s} is past the end of the file (${d} lines).`);let f=createReadFileStamp({content:l,filePath:o}),p=buildReadFileTargetKey(o);if(setReadFileStamp(loadContext(),p,f),d===0)return{content:``,path:o,totalLines:0,truncated:!1};let m=s-1,h=Math.min(m+c,d),g=u.slice(m,h),_=[],v=0,y=!1;for(let e=0;e<g.length;e++){let t=`${s+e}: ${capLineLength(g[e]??``)}`,n=Buffer.byteLength(t,`utf8`)+1;if(v+n>MAX_OUTPUT_BYTES&&_.length>0){y=!0;break}_.push(t),v+=n}let b=_.join(`
|
|
3
3
|
`),x=s+_.length-1;return x<d||y?{content:b,nextOffset:x+1,path:o,totalLines:d,truncated:!0}:{content:b,path:o,totalLines:d,truncated:!1}}export{executeReadFileOnSandbox};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { InternalSandboxSession, MutableNetworkSandboxSession, SandboxSession } from "#shared/sandbox-session.js";
|
|
2
1
|
import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
|
+
type NetworkPolicySandboxSession = SandboxSession & {
|
|
3
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
import type { InternalSandboxSession, SandboxSession } from "#shared/sandbox-session.js";
|
|
3
6
|
export type { InternalSandboxSession };
|
|
4
7
|
/**
|
|
5
8
|
* Builds a public {@link SandboxSession} from provider-specific primitives.
|
|
@@ -13,5 +16,5 @@ export type { InternalSandboxSession };
|
|
|
13
16
|
* Providers without mutable firewall support omit `setNetworkPolicy`; the
|
|
14
17
|
* dedicated Vercel provider wires it to `sandbox.update`.
|
|
15
18
|
*/
|
|
16
|
-
export declare function buildSandboxSession(primitives: InternalSandboxSession, setNetworkPolicy: (policy: SandboxNetworkPolicy) => Promise<void>):
|
|
19
|
+
export declare function buildSandboxSession(primitives: InternalSandboxSession, setNetworkPolicy: (policy: SandboxNetworkPolicy) => Promise<void>): NetworkPolicySandboxSession;
|
|
17
20
|
export declare function buildSandboxSession(primitives: InternalSandboxSession): SandboxSession;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{bufferToStream,streamToBuffer}from"./stream-utils.js";function buildSandboxSession(e,t){async function run(t){let n=await e.spawn(t),[r,i,{exitCode:a}]=await Promise.all([collectStreamToString(n.stdout),collectStreamToString(n.stderr),n.wait()]);return{exitCode:a,stderr:i,stdout:r}}let n={resolvePath(t){return e.resolvePath(t)},run,async spawn(t){return await e.spawn(t)},async readFile(t){return await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)})},async readBinaryFile(t){let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:await streamToBuffer(n)},async readTextFile(t){validateReadTextFileOptions(t);let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:applyLineRange(decodeBytes(await streamToBuffer(n),t.encoding??`utf-8`),t)},async writeFile(t){await e.writeFile({abortSignal:t.abortSignal,content:t.content,path:e.resolvePath(t.path)})},async writeBinaryFile(t){await e.writeFile({abortSignal:t.abortSignal,content:bufferToStream(t.content),path:e.resolvePath(t.path)})},async writeTextFile(t){let n=encodeString(t.content,t.encoding??`utf-8`);await e.writeFile({abortSignal:t.abortSignal,content:bufferToStream(n),path:e.resolvePath(t.path)})},async removePath(t){await e.removePath({abortSignal:t.abortSignal,force:t.force,path:e.resolvePath(t.path),recursive:t.recursive})}};return t
|
|
1
|
+
import{bufferToStream,streamToBuffer}from"./stream-utils.js";function buildSandboxSession(e,t){async function run(t){let n=await e.spawn(t),[r,i,{exitCode:a}]=await Promise.all([collectStreamToString(n.stdout),collectStreamToString(n.stderr),n.wait()]);return{exitCode:a,stderr:i,stdout:r}}let n={resolvePath(t){return e.resolvePath(t)},run,async spawn(t){return await e.spawn(t)},async readFile(t){return await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)})},async readBinaryFile(t){let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:await streamToBuffer(n)},async readTextFile(t){validateReadTextFileOptions(t);let n=await e.readFile({abortSignal:t.abortSignal,path:e.resolvePath(t.path)});return n===null?null:applyLineRange(decodeBytes(await streamToBuffer(n),t.encoding??`utf-8`),t)},async writeFile(t){await e.writeFile({abortSignal:t.abortSignal,content:t.content,path:e.resolvePath(t.path)})},async writeBinaryFile(t){await e.writeFile({abortSignal:t.abortSignal,content:bufferToStream(t.content),path:e.resolvePath(t.path)})},async writeTextFile(t){let n=encodeString(t.content,t.encoding??`utf-8`);await e.writeFile({abortSignal:t.abortSignal,content:bufferToStream(n),path:e.resolvePath(t.path)})},async removePath(t){await e.removePath({abortSignal:t.abortSignal,force:t.force,path:e.resolvePath(t.path),recursive:t.recursive})}};return t===void 0?n:{...n,setNetworkPolicy:t}}async function collectStreamToString(e){let t=await streamToBuffer(e);return new TextDecoder().decode(t)}function validateReadTextFileOptions(e){let{startLine:t,endLine:n}=e;if(t!==void 0&&(!Number.isInteger(t)||t<1))throw Error(`startLine must be a positive integer (1-based).`);if(n!==void 0&&(!Number.isInteger(n)||n<1))throw Error(`endLine must be a positive integer (1-based).`);if(t!==void 0&&n!==void 0&&t>n)throw Error(`startLine must not be greater than endLine.`)}function splitLinesPreservingEndings(e){let t=[],n=0;for(let r=0;r<e.length;r++)e[r]===`\r`?r+1<e.length&&e[r+1]===`
|
|
2
2
|
`?(t.push(e.slice(n,r+2)),n=r+2,r++):(t.push(e.slice(n,r+1)),n=r+1):e[r]===`
|
|
3
3
|
`&&(t.push(e.slice(n,r+1)),n=r+1);return n<e.length&&t.push(e.slice(n)),t}function applyLineRange(e,t){if(t.startLine===void 0&&t.endLine===void 0)return e;let n=splitLinesPreservingEndings(e),r=n.length,i=t.startLine??1,a=Math.min(t.endLine??r,r);return i>r?``:n.slice(i-1,a).join(``)}function decodeBytes(e,t){return t===`utf-8`||t===`utf8`?new TextDecoder(`utf-8`,{fatal:!0}).decode(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(t)}function encodeString(e,t){return t===`utf-8`||t===`utf8`?new TextEncoder().encode(e):Buffer.from(e,t)}export{buildSandboxSession};
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
import { buildAdapterContext } from "#channel/adapter-context.js";
|
|
2
2
|
import { type ChannelAdapter } from "#channel/adapter.js";
|
|
3
3
|
import type { ContextContainer } from "#context/container.js";
|
|
4
|
-
import {
|
|
5
|
-
import type { resolveEffectiveAgentRuntime } from "#execution/effective-agent-config.js";
|
|
6
|
-
import type { HandleEventFn } from "#harness/types.js";
|
|
7
|
-
import type { ExecutionInstrumentation } from "#instrumentation/runtime.js";
|
|
8
|
-
import type { CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";
|
|
4
|
+
import { type MessageStreamEvent, type UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
9
5
|
export interface SessionEventSinkInput {
|
|
10
|
-
readonly abortSignal: AbortSignal | undefined;
|
|
11
6
|
readonly adapter: ChannelAdapter;
|
|
12
|
-
readonly bundle: CompiledBundle;
|
|
13
7
|
readonly ctx: ContextContainer;
|
|
14
|
-
readonly effectiveAgent: ReturnType<typeof resolveEffectiveAgentRuntime>;
|
|
15
|
-
readonly instrumentation: ExecutionInstrumentation | undefined;
|
|
16
8
|
readonly isFirstTurn: boolean;
|
|
17
9
|
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
18
10
|
readonly sessionId: string;
|
|
19
11
|
}
|
|
12
|
+
export interface PublishedSessionEvent {
|
|
13
|
+
readonly event: MessageStreamEvent;
|
|
14
|
+
readonly suppressed: boolean;
|
|
15
|
+
}
|
|
20
16
|
export interface SessionEventSink {
|
|
21
17
|
readonly adapterCtx: ReturnType<typeof buildAdapterContext>;
|
|
22
|
-
|
|
23
|
-
readonly effectiveNode: CompiledBundle["graph"]["root"];
|
|
24
|
-
readonly handleEvent: HandleEventFn;
|
|
18
|
+
emit(event: UnstampedMessageStreamEvent): Promise<PublishedSessionEvent>;
|
|
25
19
|
/** Closes the parent stream; only a terminal `done` step does this. */
|
|
26
20
|
close(): Promise<void>;
|
|
27
21
|
/** Releases the writer lock so the next step can acquire it. Safe after `close()`. */
|
|
28
22
|
release(): void;
|
|
29
23
|
}
|
|
30
|
-
/**
|
|
24
|
+
/** Publishes events without executing hooks or preparing model context. */
|
|
31
25
|
export declare function createSessionEventSink(input: SessionEventSinkInput): SessionEventSink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{callAdapterEventHandler}from"#channel/adapter.js";import{ScheduleIdKey,TurnDeliveryIdsKey,TurnTaskDeliveryKey}from"#context/keys.js";import{encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{
|
|
1
|
+
import{callAdapterEventHandler}from"#channel/adapter.js";import{ScheduleIdKey,TurnDeliveryIdsKey,TurnTaskDeliveryKey}from"#context/keys.js";import{encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{setChannelContext}from"#execution/channel-context.js";import*as activityCohort from"#execution/activity-cohort.js";import{observeSessionActivity}from"#execution/session-activity-projection.js";import{scheduledLaunchDeliveryEvent}from"#execution/scheduled-launch-delivery.js";import{forwardTaskEventToSessionCallback}from"#execution/task-event-callback.js";function createSessionEventSink(e){let{adapter:t,ctx:n}=e,r=buildAdapterContext(t,n),i=e.sessionWritable.getWriter(),deliver=async a=>{if(await forwardTaskEventToSessionCallback(n,a))return{event:stampMessageStreamEvent(a,n.get(TurnDeliveryIdsKey)),suppressed:!1};let o=scheduledLaunchDeliveryEvent(a,{isFirstTurn:e.isFirstTurn,isScheduled:n.get(ScheduleIdKey)!==void 0,taskPhase:n.get(TurnTaskDeliveryKey)});if(o===void 0)return{event:stampMessageStreamEvent(a,n.get(TurnDeliveryIdsKey)),suppressed:!0};let s=await callAdapterEventHandler(t,o,r);setChannelContext(n,{...t,state:{...r.state}});let c=stampMessageStreamEvent(s,n.get(TurnDeliveryIdsKey));return await i.write(encodeMessageStreamEvent(c)),{event:c,suppressed:!1}},a=!1,release=()=>{a||(a=!0,i.releaseLock())};return{adapterCtx:r,async emit(t){activityCohort.updateActivityBlockers(n,t);let r=await deliver(t);return observeSessionActivity({ctx:n,event:r.event,sessionId:e.sessionId}),r},close:async()=>{await i.close(),release()},release}}export{createSessionEventSink};
|
|
@@ -9,9 +9,9 @@ import type { RunMode } from "#shared/run-mode.js";
|
|
|
9
9
|
* Cross-deployment checkpoint contract. The successor may run a different eve
|
|
10
10
|
* build than the owner that produced it; bump when any field changes shape so
|
|
11
11
|
* an incompatible successor rejects the handoff instead of misreading state.
|
|
12
|
-
*
|
|
12
|
+
* Dynamic skill manifests retain instruction bodies and package revisions.
|
|
13
13
|
*/
|
|
14
|
-
export declare const SESSION_CHECKPOINT_VERSION =
|
|
14
|
+
export declare const SESSION_CHECKPOINT_VERSION = 8;
|
|
15
15
|
/** Everything a successor needs to continue an idle session. Hooks are derived from the state. */
|
|
16
16
|
export interface SessionCheckpoint {
|
|
17
17
|
readonly version: typeof SESSION_CHECKPOINT_VERSION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sessionHandoffMarkerToken}from"#execution/session-inbox/address.js";import{startSessionOwnerStep}from"#execution/workflow-runtime.js";import{createHook,getWorkflowMetadata}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,disposeHook}from"#execution/hook-ownership.js";import{sessionHookTokens}from"#execution/session/hook-tokens.js";import{isSessionIdleForHandoffStep}from"#execution/session/handoff-steps.js";import{readAcceptedDeploymentId}from"#execution/session/accepted-deployment.js";const SESSION_CHECKPOINT_VERSION=
|
|
1
|
+
import{sessionHandoffMarkerToken}from"#execution/session-inbox/address.js";import{startSessionOwnerStep}from"#execution/workflow-runtime.js";import{createHook,getWorkflowMetadata}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,disposeHook}from"#execution/hook-ownership.js";import{sessionHookTokens}from"#execution/session/hook-tokens.js";import{isSessionIdleForHandoffStep}from"#execution/session/handoff-steps.js";import{readAcceptedDeploymentId}from"#execution/session/accepted-deployment.js";const SESSION_CHECKPOINT_VERSION=8;function sessionAnchorToken(e){return`${e}:anchor`}var SessionHandoff=class{input;anchor;constructor(e){this.input=e}async tryTransfer(e,t){let{deploymentId:n,inbox:r}=this.input,i=readAcceptedDeploymentId(e.delivery);if(i===void 0)return{kind:`retained`,reason:`missing-deployment`};if(i===n)return{kind:`retained`,reason:`same-deployment`};if(!e.handoffEligible)return{kind:`retained`,reason:`busy`};if(!await isSessionIdleForHandoffStep(t))return{kind:`retained`,reason:`not-idle`};let a={...this.input.checkpoint,...t,version:8},o=sessionHookTokens(t);await this.ensureAnchor();let s=o.map(e=>createHook({token:sessionHandoffMarkerToken(e)}));await Promise.all(s.map(e=>claimHookOwnership(e)));try{let t=await r.release();if(t.length>0)return await this.recover(o,t),{kind:`retained`,reason:`accepted-during-release`};let n=[];try{let t=await this.startAndActivate(a,e.delivery,i);if(t.kind===`active`)return{kind:`transferred`};n=t.payloads}catch{}return await this.recover(o,n),{kind:`retained`,reason:`activation-failed`}}finally{await Promise.all(s.map(e=>disposeHook(e)))}}async awaitAnchoredResult(){if(this.anchor===void 0)throw Error(`Session anchor was never claimed.`);try{return await this.anchor}finally{await this.disposeAnchor()}}async disposeAnchor(){if(this.anchor===void 0)return;let e=this.anchor;this.anchor=void 0,await disposeHook(e)}async startAndActivate(e,t,n){let r=createHook({token:`${getWorkflowMetadata().workflowRunId}:handoff`});await claimHookOwnership(r);try{return await startSessionOwnerStep({activationToken:r.token,anchorRunId:this.input.sessionId,checkpoint:e,delivery:t,targetDeploymentId:n}),await r}finally{await disposeHook(r)}}async recover(e,t){await this.input.inbox.claimSessionHooks(e),this.input.inbox.restore(t)}async ensureAnchor(){this.input.isInitialOwner&&this.anchor===void 0&&(this.anchor=createHook({token:sessionAnchorToken(this.input.sessionId)}),await claimHookOwnership(this.anchor))}};export{SESSION_CHECKPOINT_VERSION,SessionHandoff,sessionAnchorToken};
|