eve 0.67.2 → 0.69.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 +120 -0
- package/bin/eve.js +15 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/approval/definition.d.ts +19 -5
- package/dist/src/channel/adapter.d.ts +2 -0
- package/dist/src/channel/auth/oidc.js +1 -1
- package/dist/src/channel/channel-address.d.ts +1 -4
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +4 -11
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/compiled-channel.d.ts +0 -2
- package/dist/src/channel/compiled-channel.js +2 -2
- package/dist/src/channel/cross-channel-receive.d.ts +1 -3
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/forwarded-principal.js +1 -1
- package/dist/src/channel/schedule-auth.d.ts +16 -0
- package/dist/src/channel/schedule-auth.js +1 -1
- package/dist/src/channel/session-callback.js +1 -1
- package/dist/src/channel/session.d.ts +3 -8
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/task-card.d.ts +121 -0
- package/dist/src/channel/task-card.js +1 -0
- package/dist/src/channel/types.d.ts +12 -54
- package/dist/src/chunks/{use-eve-agent-DXcE_8Ja.js → use-eve-agent-D_5129A9.js} +295 -205
- package/dist/src/chunks/{use-eve-agent-D4HVZBjn.js → use-eve-agent-Dab2MnT2.js} +295 -205
- package/dist/src/cli/commands/info.d.ts +11 -0
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/command-options.d.ts +3 -2
- package/dist/src/cli/dev/command.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +19 -18
- package/dist/src/cli/dev/tui/blocks.js +3 -3
- package/dist/src/cli/dev/tui/command-typeahead.d.ts +3 -6
- package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +10 -0
- package/dist/src/cli/dev/tui/diagnostic-presentation.js +3 -2
- package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +2 -0
- package/dist/src/cli/dev/tui/prompt-placeholder.js +1 -0
- package/dist/src/cli/dev/tui/rail.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +25 -2
- package/dist/src/cli/dev/tui/runner.js +3 -3
- package/dist/src/cli/dev/tui/status-line.d.ts +4 -2
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +44 -52
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/task-activity.d.ts +55 -0
- package/dist/src/cli/dev/tui/task-activity.js +1 -0
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +13 -30
- package/dist/src/cli/dev/tui/terminal-renderer.js +11 -11
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tool-block-groups.d.ts +6 -9
- package/dist/src/cli/dev/tui/tool-block-groups.js +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +16 -3
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +3 -1
- package/dist/src/cli/dev/tui/traces/trace-view.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/types.d.ts +11 -5
- package/dist/src/cli/dev/ui-options.d.ts +2 -2
- package/dist/src/cli/option-parsers.d.ts +3 -1
- package/dist/src/cli/option-parsers.js +1 -1
- package/dist/src/cli/ui/terminal-text.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +150 -9
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/agent-session.d.ts +28 -0
- package/dist/src/client/agent-session.js +1 -0
- package/dist/src/client/eve-agent-store-helpers.d.ts +1 -1
- package/dist/src/client/eve-agent-store-helpers.js +2 -2
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +2 -1
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/message-task-parts.d.ts +8 -0
- package/dist/src/client/message-task-parts.js +1 -0
- package/dist/src/client/optimistic-message-submissions.js +1 -1
- package/dist/src/client/session-controls.d.ts +0 -1
- package/dist/src/client/session-utils.d.ts +10 -0
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.d.ts +8 -16
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/stream-version.js +1 -1
- package/dist/src/client/types.d.ts +2 -4
- package/dist/src/compiled/.vendor-stamp.json +3 -2
- package/dist/src/compiled/@eve/catalog/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 +1 -1
- package/dist/src/compiled/@vercel/connect/LICENSE +202 -0
- package/dist/src/compiled/@vercel/connect/authorization-details.d.ts +11 -0
- package/dist/src/compiled/@vercel/connect/authorization.d.ts +47 -0
- package/dist/src/compiled/@vercel/connect/connector.d.ts +32 -0
- package/dist/src/compiled/@vercel/connect/index.d.ts +5 -0
- package/dist/src/compiled/@vercel/connect/index.js +26 -0
- package/dist/src/compiled/@vercel/connect/installation.d.ts +48 -0
- package/dist/src/compiled/@vercel/connect/token.d.ts +137 -0
- package/dist/src/compiled/@vercel/oidc/index.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +1 -1
- package/dist/src/compiler/bundled-extension.d.ts +7 -1
- package/dist/src/compiler/bundled-extension.js +1 -1
- package/dist/src/compiler/default-tool-policy.d.ts +2 -2
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/development-extensions.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +54 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/extension-mount-bindings.d.ts +5 -0
- package/dist/src/compiler/extension-mount-bindings.js +1 -0
- package/dist/src/compiler/load-binding-namespace.d.ts +10 -2
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.d.ts +19 -17
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/module-lifecycle.d.ts +2 -2
- package/dist/src/compiler/module-lifecycle.js +1 -1
- package/dist/src/compiler/module-map.d.ts +1 -1
- package/dist/src/compiler/module-map.js +3 -3
- package/dist/src/compiler/normalize-manifest-helpers.d.ts +18 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +2 -0
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/project-sources.d.ts +4 -0
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +5 -0
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/computer-use/extension/extension.d.ts +2 -0
- package/dist/src/computer-use/extension/extension.js +1 -0
- package/dist/src/computer-use/extension/lib/command-failure.d.ts +7 -0
- package/dist/src/computer-use/extension/lib/command-failure.js +2 -0
- package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-sandbox.d.ts +8 -0
- package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-sandbox.js +3 -3
- package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use.d.ts +2 -0
- package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use.js +2 -1
- package/dist/src/computer-use/extension/lib/sandbox.d.ts +1 -0
- package/dist/src/computer-use/extension/lib/sandbox.js +1 -0
- package/dist/src/computer-use/extension/lib/shell.d.ts +1 -0
- package/dist/src/computer-use/extension/lib/shell.js +1 -0
- package/dist/src/computer-use/extension/tools/computer_use.js +1 -0
- package/dist/src/computer-use/tools.d.ts +1 -0
- package/dist/src/computer-use/tools.js +1 -0
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.d.ts +5 -0
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -1
- package/dist/src/context/hook-lifecycle.d.ts +4 -3
- package/dist/src/context/hook-lifecycle.js +1 -1
- package/dist/src/context/key-names.d.ts +0 -1
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +8 -14
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-lifecycle.js +1 -1
- package/dist/src/context/memory-tools.d.ts +0 -1
- package/dist/src/context/provider.d.ts +1 -3
- package/dist/src/context/run-step.d.ts +2 -3
- package/dist/src/context/run-step.js +1 -1
- package/dist/src/context/serialize.js +1 -1
- package/dist/src/discover/bundled-extension.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/extensions.d.ts +0 -7
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/manifest.d.ts +4 -0
- package/dist/src/evals/assertions/run.d.ts +4 -3
- package/dist/src/evals/assertions/run.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +4 -4
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/reporters/assertion-scores.d.ts +19 -0
- package/dist/src/evals/runner/reporters/assertion-scores.js +1 -0
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/datadog-client.d.ts +123 -0
- package/dist/src/evals/runner/reporters/datadog-client.js +4 -0
- package/dist/src/evals/runner/reporters/datadog.d.ts +9 -98
- package/dist/src/evals/runner/reporters/datadog.js +2 -3
- package/dist/src/evals/session-content.js +1 -1
- package/dist/src/evals/session.d.ts +4 -4
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/types.d.ts +18 -15
- package/dist/src/eve-channel/create-request.d.ts +5 -4
- package/dist/src/eve-channel/create-request.js +1 -1
- package/dist/src/eve-channel/index.d.ts +0 -9
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +3 -7
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/eve-channel/support.d.ts +15 -5
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/eve-channel/turn-policy-request.d.ts +2 -0
- package/dist/src/eve-channel/turn-policy-request.js +1 -0
- package/dist/src/eve-channel/types.d.ts +4 -0
- package/dist/src/execution/agent-sessions/context.d.ts +60 -0
- package/dist/src/execution/agent-sessions/context.js +1 -0
- package/dist/src/{subagents/remote-dispatch.d.ts → execution/agent-sessions/remote.d.ts} +17 -40
- package/dist/src/execution/agent-sessions/remote.js +1 -0
- package/dist/src/execution/agent-sessions/requests.d.ts +20 -0
- package/dist/src/execution/agent-sessions/requests.js +1 -0
- package/dist/src/execution/agent-sessions/session.d.ts +12 -0
- package/dist/src/execution/agent-sessions/session.js +1 -0
- package/dist/src/execution/agent-sessions/steps.d.ts +59 -0
- package/dist/src/execution/agent-sessions/steps.js +1 -0
- package/dist/src/execution/agent-sessions/target.d.ts +45 -0
- package/dist/src/execution/agent-sessions/target.js +1 -0
- package/dist/src/execution/agent-sessions/usage.d.ts +18 -0
- package/dist/src/execution/agent-sessions/usage.js +1 -0
- package/dist/src/execution/authorization-callback-match.d.ts +2 -4
- package/dist/src/execution/authorization-callback-match.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -5
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.js +1 -1
- package/dist/src/execution/connection-announcement.d.ts +7 -0
- package/dist/src/execution/connection-announcement.js +4 -0
- package/dist/src/execution/continuation-conflict-step.d.ts +2 -3
- package/dist/src/execution/continuation-conflict-step.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +9 -27
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.d.ts +3 -2
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.d.ts +0 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +0 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +1 -3
- package/dist/src/execution/dynamic-workflow/schema.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.d.ts +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
- package/dist/src/execution/forward-session-input.d.ts +4 -0
- package/dist/src/execution/forward-session-input.js +1 -0
- package/dist/src/execution/legacy-remote-agent/protocol.d.ts +41 -0
- package/dist/src/execution/legacy-remote-agent/protocol.js +1 -0
- package/dist/src/execution/legacy-session/authorization.js +1 -1
- package/dist/src/execution/legacy-session/completion-step.js +1 -1
- package/dist/src/execution/legacy-session/inbox.js +1 -1
- package/dist/src/execution/legacy-session/input.js +1 -1
- package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/node-step.d.ts +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.d.ts +9 -6
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/publish-session-events.d.ts +130 -0
- package/dist/src/execution/publish-session-events.js +1 -0
- package/dist/src/execution/route-child-delivery.d.ts +5 -4
- package/dist/src/execution/route-child-delivery.js +1 -3
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session/admission.d.ts +1 -12
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/entry-input.d.ts +0 -2
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +13 -2
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +17 -3
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +27 -28
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.d.ts +5 -0
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/pending-turn-state.d.ts +2 -0
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/principal.d.ts +14 -0
- package/dist/src/execution/session/principal.js +1 -0
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/route-selected-delivery.js +1 -1
- package/dist/src/execution/session/state-cursor.d.ts +17 -15
- package/dist/src/execution/session/state-cursor.js +1 -1
- package/dist/src/execution/session/state-delta.d.ts +33 -0
- package/dist/src/execution/session/state-delta.js +1 -0
- package/dist/src/execution/session/timeout-steps.js +1 -1
- package/dist/src/execution/session/turn-event-handler.d.ts +27 -0
- package/dist/src/execution/session/turn-event-handler.js +1 -0
- package/dist/src/execution/session/turn-step-result.d.ts +1 -3
- package/dist/src/execution/session/turn-step-result.js +1 -1
- package/dist/src/execution/session/turn-step-types.d.ts +24 -15
- package/dist/src/execution/session/turn-step.d.ts +2 -2
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn-waiting-step.d.ts +4 -0
- package/dist/src/execution/session/turn-waiting-step.js +1 -0
- package/dist/src/execution/session/turn.d.ts +33 -2
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-callback-request.js +1 -1
- package/dist/src/execution/session-event-stream.d.ts +33 -0
- package/dist/src/execution/session-event-stream.js +1 -0
- package/dist/src/execution/session-inbox/inbox.d.ts +2 -0
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/release-step.js +1 -1
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.d.ts +11 -2
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/session.d.ts +0 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +21 -9
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +0 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/tasks/calls.d.ts +42 -0
- package/dist/src/execution/tasks/calls.js +1 -0
- package/dist/src/execution/tasks/model-step.d.ts +58 -0
- package/dist/src/execution/tasks/model-step.js +1 -0
- package/dist/src/execution/tasks/render.d.ts +66 -0
- package/dist/src/execution/tasks/render.js +8 -0
- package/dist/src/execution/tasks/session.d.ts +19 -0
- package/dist/src/execution/tasks/session.js +1 -0
- package/dist/src/execution/tasks/start.d.ts +34 -0
- package/dist/src/execution/tasks/start.js +1 -0
- package/dist/src/execution/tasks/steps.d.ts +31 -0
- package/dist/src/execution/tasks/steps.js +1 -0
- package/dist/src/execution/tasks/table.d.ts +192 -0
- package/dist/src/execution/tasks/table.js +1 -0
- package/dist/src/execution/tasks/task-id-input.d.ts +19 -0
- package/dist/src/execution/tasks/task-id-input.js +1 -0
- package/dist/src/execution/tasks/tool-entry-point.d.ts +11 -0
- package/dist/src/execution/tasks/tool-entry-point.js +1 -0
- package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
- package/dist/src/execution/tasks/workflow-target.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.d.ts +2 -9
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.d.ts +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/agent-router.d.ts +1 -1
- package/dist/src/execution/tools/agent-router.js +1 -1
- package/dist/src/execution/tools/connection-approval.d.ts +25 -0
- package/dist/src/execution/tools/connection-approval.js +1 -0
- package/dist/src/execution/tools/connection-search-rank.d.ts +21 -0
- package/dist/src/execution/tools/connection-search-rank.js +1 -0
- package/dist/src/execution/tools/connection-target.d.ts +13 -0
- package/dist/src/execution/tools/connection-target.js +1 -0
- package/dist/src/execution/tools/connection-tools.d.ts +10 -0
- package/dist/src/execution/tools/connection-tools.js +2 -0
- package/dist/src/execution/tools/load-skill.js +1 -1
- package/dist/src/execution/tools/workflow/answer.d.ts +10 -4
- package/dist/src/execution/tools/workflow/answer.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +73 -10
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +60 -19
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/cancel.d.ts +7 -2
- package/dist/src/execution/tools/workflow/cancel.js +1 -1
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +10 -4
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
- package/dist/src/execution/tools/workflow/{background.d.ts → harness-definition.d.ts} +6 -6
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -0
- package/dist/src/execution/tools/workflow/interrupt.d.ts +6 -0
- package/dist/src/execution/tools/workflow/interrupt.js +1 -0
- package/dist/src/execution/tools/workflow/messages.d.ts +135 -10
- package/dist/src/execution/tools/workflow/messages.js +1 -1
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
- package/dist/src/execution/tools/workflow/owner.d.ts +15 -4
- package/dist/src/execution/tools/workflow/owner.js +1 -1
- package/dist/src/execution/tools/workflow/serve.d.ts +3 -0
- package/dist/src/execution/tools/workflow/serve.js +1 -0
- package/dist/src/execution/tools/workflow/start.d.ts +18 -11
- package/dist/src/execution/tools/workflow/start.js +1 -1
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/tools/workflow/types.d.ts +0 -10
- package/dist/src/execution/tools/workflow/withdraw-step.d.ts +31 -0
- package/dist/src/execution/tools/workflow/withdraw-step.js +1 -0
- package/dist/src/execution/tools/workflow/workflow-owner-blocking.d.ts +3 -5
- package/dist/src/execution/tools/workflow/workflow-owner-blocking.js +1 -1
- package/dist/src/execution/tools/workflow/workflow.d.ts +3 -3
- package/dist/src/execution/tools/workflow/workflow.js +1 -1
- package/dist/src/execution/web-fetch/request.js +1 -1
- package/dist/src/execution/workflow-callback-url.d.ts +0 -5
- package/dist/src/execution/workflow-callback-url.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +3 -5
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-webhook-route.js +1 -1
- package/dist/src/extensions/code/extension/lib/connect-authentication.js +1 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +1 -1
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +3 -2
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/signed-commit.d.ts +1 -1
- package/dist/src/extensions/code/extension/lib/signed-commit.js +2 -2
- package/dist/src/extensions/code/tools.d.ts +2 -1
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/framework/sources/modules/agent.d.ts +1 -0
- package/dist/src/framework/sources/modules/agent.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.js +1 -1
- package/dist/src/harness/action-result-helpers.d.ts +1 -0
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/announcements.d.ts +22 -0
- package/dist/src/harness/announcements.js +1 -0
- package/dist/src/harness/approval-candidates.d.ts +10 -2
- package/dist/src/harness/approval-candidates.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.d.ts +4 -5
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/approval-recheck.d.ts +7 -0
- package/dist/src/harness/approval-recheck.js +1 -0
- package/dist/src/harness/authorization-event-fields.d.ts +13 -0
- package/dist/src/harness/authorization-event-fields.js +1 -0
- package/dist/src/harness/authorization.d.ts +2 -1
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/coordination.d.ts +31 -27
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +6 -1
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +7 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +4 -15
- package/dist/src/harness/hitl/session-limit-input-requests.d.ts +2 -0
- package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +5 -2
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.d.ts +11 -3
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/nested-actions.d.ts +23 -0
- package/dist/src/harness/nested-actions.js +1 -0
- package/dist/src/harness/pending-input-batches.d.ts +8 -6
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/provider-tool-history.d.ts +7 -2
- package/dist/src/harness/provider-tool-history.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +41 -36
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-model-output.js +1 -1
- package/dist/src/harness/tool-presentation.js +1 -1
- package/dist/src/harness/tools.d.ts +1 -5
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +6 -5
- package/dist/src/harness/types.d.ts +7 -15
- package/dist/src/harness/workflow-dispatch.d.ts +30 -0
- package/dist/src/harness/workflow-dispatch.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +5 -65
- package/dist/src/harness/workflow-tool-runs.js +1 -1
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +5 -2
- package/dist/src/instrumentation/lifecycle.js +1 -1
- package/dist/src/instrumentation/native-events.d.ts +0 -7
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +1 -4
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/state.d.ts +0 -6
- package/dist/src/instrumentation/state.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +10 -0
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +12 -6
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.d.ts +3 -0
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/bundler/extension-mount-plugin.d.ts +14 -0
- package/dist/src/internal/bundler/extension-mount-plugin.js +1 -0
- package/dist/src/internal/bundler/extension-scope-plugin.d.ts +8 -11
- package/dist/src/internal/bundler/extension-scope-plugin.js +2 -3
- package/dist/src/internal/invocation/workflow-execution.d.ts +2 -2
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/mount-state.d.ts +1 -0
- package/dist/src/internal/mount-state.js +1 -0
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.d.ts +2 -2
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +2 -4
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-generation-metadata.d.ts +13 -0
- package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -0
- package/dist/src/internal/nitro/development-generation.d.ts +2 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/build-application.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 +1 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/dev-workflow-world-setup.d.ts +1 -0
- package/dist/src/internal/nitro/host/dev-workflow-world-setup.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/node-esm-compat-banner.js +1 -1
- package/dist/src/internal/workflow/cancel-expired-development-run.d.ts +2 -0
- package/dist/src/internal/workflow/cancel-expired-development-run.js +1 -0
- package/dist/src/internal/workflow/development-runtime-compatibility.d.ts +12 -0
- package/dist/src/internal/workflow/development-runtime-compatibility.js +1 -0
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-protocol.d.ts +9 -0
- package/dist/src/internal/workflow/development-world-server.d.ts +2 -0
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/is-inactive-workflow-run-error.d.ts +2 -0
- package/dist/src/internal/workflow/is-inactive-workflow-run-error.js +1 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +4 -3
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/models/auto.d.ts +6 -0
- package/dist/src/models/auto.js +2 -2
- package/dist/src/protocol/message-version.d.ts +1 -0
- package/dist/src/protocol/message-version.js +1 -1
- package/dist/src/protocol/message.d.ts +126 -67
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/remote-agent-protocol.d.ts +16 -0
- package/dist/src/protocol/remote-agent-protocol.js +1 -0
- package/dist/src/protocol/routes.d.ts +0 -6
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +21 -0
- package/dist/src/protocol/task-tools.js +1 -0
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +25 -16
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
- package/dist/src/public/channels/chat-sdk/input-actions.d.ts +8 -0
- package/dist/src/public/channels/chat-sdk/input-actions.js +1 -0
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/linq/linqChannel.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/slack/action-status.d.ts +11 -12
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/attachments.js +1 -1
- package/dist/src/public/channels/slack/auth.d.ts +3 -0
- package/dist/src/public/channels/slack/auth.js +1 -1
- package/dist/src/public/channels/slack/connections.d.ts +6 -6
- package/dist/src/public/channels/slack/connections.js +1 -1
- package/dist/src/public/channels/slack/defaults.d.ts +13 -19
- package/dist/src/public/channels/slack/defaults.js +4 -4
- package/dist/src/public/channels/slack/hitl.d.ts +22 -13
- package/dist/src/public/channels/slack/hitl.js +2 -2
- package/dist/src/public/channels/slack/index.d.ts +4 -3
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/input-response.d.ts +1 -5
- package/dist/src/public/channels/slack/input-response.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/channels/slack/renderers.d.ts +76 -0
- package/dist/src/public/channels/slack/renderers.js +1 -0
- package/dist/src/public/channels/slack/session-operations.d.ts +6 -0
- package/dist/src/public/channels/slack/session-operations.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +47 -103
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/slack/task-card.d.ts +24 -0
- package/dist/src/public/channels/slack/task-card.js +1 -0
- package/dist/src/public/channels/telegram/hitl.d.ts +7 -1
- package/dist/src/public/channels/telegram/hitl.js +2 -1
- package/dist/src/public/channels/telegram/state.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +5 -0
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +6 -1
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +4 -6
- package/dist/src/public/definitions/connections/openapi.d.ts +7 -8
- package/dist/src/public/definitions/extension.d.ts +2 -2
- package/dist/src/public/definitions/extension.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +16 -4
- package/dist/src/public/definitions/state.d.ts +4 -2
- package/dist/src/public/definitions/state.js +1 -1
- package/dist/src/public/memory/index.d.ts +0 -1
- package/dist/src/public/models/openai/index.d.ts +1 -1
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/schedules/index.d.ts +1 -0
- package/dist/src/public/schedules/index.js +1 -1
- package/dist/src/public/server/index.d.ts +28 -0
- package/dist/src/public/server/index.js +1 -0
- package/dist/src/public/tools/index.d.ts +3 -2
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/no-reply.d.ts +1 -0
- package/dist/src/public/tools/no-reply.js +1 -0
- package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +6 -7
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +0 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.d.ts +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/channels/registry.js +1 -1
- package/dist/src/runtime/connections/mcp-client.d.ts +1 -2
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/tool-result.d.ts +27 -0
- package/dist/src/runtime/connections/tool-result.js +2 -0
- package/dist/src/runtime/connections/tool-signature.d.ts +14 -0
- package/dist/src/runtime/connections/tool-signature.js +1 -0
- package/dist/src/runtime/local-dev-capability.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +1 -3
- package/dist/src/runtime/prompt/compose.js +3 -3
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +1 -16
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow-reference.d.ts +6 -3
- package/dist/src/runtime/subagents/workflow-reference.js +1 -1
- package/dist/src/runtime/subagents/workflow.d.ts +12 -6
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -0
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +7 -7
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.d.ts +2 -0
- package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.js +1 -1
- package/dist/src/self-modification/scaffold.d.ts +2 -0
- package/dist/src/self-modification/scaffold.js +7 -0
- package/dist/src/self-modification/setup.js +1 -7
- package/dist/src/setup/boxes/model-capabilities.d.ts +2 -2
- package/dist/src/setup/boxes/model-capabilities.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/integrations/shopify/templates.d.ts +1 -1
- package/dist/src/setup/integrations/shopify/templates.js +31 -19
- package/dist/src/setup/integrations/web/setup.d.ts +0 -2
- package/dist/src/setup/integrations/web/setup.js +3 -3
- package/dist/src/setup/scaffold/create/agent-paths.d.ts +5 -0
- package/dist/src/setup/scaffold/create/agent-paths.js +1 -0
- package/dist/src/setup/scaffold/create/instructions-template.d.ts +1 -0
- package/dist/src/setup/scaffold/create/instructions-template.js +8 -0
- package/dist/src/setup/scaffold/create/project.js +3 -10
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +1 -1
- package/dist/src/shared/action-request-name.d.ts +3 -0
- package/dist/src/shared/action-request-name.js +1 -0
- package/dist/src/shared/action-types.d.ts +49 -21
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +0 -7
- package/dist/src/shared/chatgpt-model.d.ts +1 -1
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/connection-types.d.ts +2 -3
- package/dist/src/shared/default-agent-model.d.ts +10 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/shared/extension-mount.d.ts +2 -0
- package/dist/src/shared/extension-mount.js +1 -0
- package/dist/src/shared/format-duration.d.ts +2 -0
- package/dist/src/shared/format-duration.js +1 -0
- package/dist/src/shared/gateway-model-catalog.d.ts +25 -2
- package/dist/src/shared/gateway-model-catalog.js +1 -1
- package/dist/src/shared/input.d.ts +1 -0
- package/dist/src/shared/memory-state.d.ts +1 -0
- package/dist/src/shared/memory-state.js +1 -1
- package/dist/src/shared/model-helper.d.ts +2 -2
- package/dist/src/shared/model-helper.js +1 -1
- package/dist/src/shared/model-summary.d.ts +2 -6
- package/dist/src/shared/model-summary.js +1 -1
- package/dist/src/shared/presentation-text.d.ts +5 -0
- package/dist/src/shared/presentation-text.js +1 -1
- package/dist/src/shared/serialized-observability-state.d.ts +0 -4
- package/dist/src/shared/serialized-observability-state.js +1 -1
- package/dist/src/shared/value-delta.d.ts +39 -0
- package/dist/src/shared/value-delta.js +1 -0
- package/dist/src/subagents/adapter-state.d.ts +0 -2
- package/dist/src/subagents/adapter-state.js +1 -1
- package/dist/src/subagents/adapter.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/event-proxy-step.d.ts +16 -29
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +35 -17
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/subagents/invocation.d.ts +1 -2
- package/dist/src/subagents/parent-notification.d.ts +2 -1
- package/dist/src/subagents/parent-notification.js +1 -1
- package/dist/src/subagents/token-budget.d.ts +8 -9
- package/dist/src/subagents/token-budget.js +1 -1
- package/dist/src/subagents/tool.d.ts +6 -12
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/behavior.d.ts +5 -5
- package/dist/src/tools/definition.d.ts +58 -14
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/durable-callbacks.d.ts +1 -1
- package/dist/src/tools/dynamic.d.ts +6 -0
- package/dist/src/tools/framework/agent-contract.d.ts +2 -5
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/tools/framework/agent.d.ts +2 -5
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/connection-tools.d.ts +3 -0
- package/dist/src/tools/framework/connection-tools.js +1 -0
- package/dist/src/tools/provided/agent-router.d.ts +6 -3
- package/dist/src/tools/provided/agent-router.js +1 -1
- package/dist/src/{execution/tools → tools/provided}/ask-question-workflow.d.ts +3 -4
- package/dist/src/tools/provided/ask-question-workflow.js +1 -0
- package/dist/src/tools/provided/ask-question.d.ts +20 -5
- package/dist/src/tools/provided/ask-question.js +2 -1
- package/dist/src/tools/provided/interrupted.d.ts +18 -0
- package/dist/src/tools/provided/interrupted.js +1 -0
- package/dist/src/tools/provided/no-reply.d.ts +19 -0
- package/dist/src/tools/provided/no-reply.js +1 -0
- package/dist/src/tools/provided/sleep-workflow.d.ts +4 -0
- package/dist/src/tools/provided/sleep-workflow.js +1 -0
- package/dist/src/tools/provided/sleep.d.ts +11 -5
- package/dist/src/tools/provided/sleep.js +1 -1
- package/dist/src/tools/provided/task-cancel.d.ts +6 -0
- package/dist/src/tools/provided/task-cancel.js +1 -0
- package/dist/src/tools/provided/task-wait.d.ts +9 -0
- package/dist/src/tools/provided/task-wait.js +1 -0
- package/dist/src/tools/provided/workflow.d.ts +2 -2
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/schema-emission.d.ts +23 -0
- package/dist/src/tools/schema-emission.js +1 -0
- package/dist/src/tools/schema.d.ts +22 -8
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +187 -85
- package/dist/src/tools/workflow-definition.js +1 -1
- package/dist/src/tools/workflow-entry-point.d.ts +3 -0
- package/dist/src/tools/workflow-entry-point.js +1 -0
- package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -3
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-invocation-coordinator.d.ts +9 -18
- package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
- package/dist/src/tracing/agent-otel-content.d.ts +0 -2
- package/dist/src/tracing/agent-otel-content.js +3 -3
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +20 -0
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-usage.js +1 -1
- package/dist/src/tracing/agent-span-contract.d.ts +1 -1
- package/dist/src/tracing/agent-span-contract.js +1 -1
- package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
- package/dist/src/tracing/agent-span-id-generator.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.d.ts +1 -2
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-context-store.d.ts +2 -27
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +1 -19
- package/dist/src/tracing/content-attributes.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +36 -13
- package/docs/channels/chat-sdk.mdx +15 -4
- package/docs/channels/custom.mdx +89 -17
- package/docs/channels/eve.mdx +1 -1
- package/docs/channels/mcp.mdx +1 -1
- package/docs/channels/overview.mdx +14 -56
- package/docs/channels/slack.mdx +230 -35
- package/docs/channels/telegram.mdx +2 -0
- package/docs/concepts/built-in-tools.md +36 -28
- package/docs/concepts/context-control.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +10 -11
- package/docs/concepts/project-structure.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +67 -47
- package/docs/connections/mcp.mdx +4 -4
- package/docs/connections/openapi.mdx +2 -2
- package/docs/connections/overview.mdx +2 -2
- package/docs/evals/assertions.mdx +5 -5
- package/docs/evals/cases.mdx +1 -1
- package/docs/evals/reporters.mdx +6 -4
- package/docs/extensions.md +11 -2
- package/docs/guides/auth-and-route-protection.md +1 -1
- package/docs/guides/client/streaming.mdx +31 -11
- package/docs/guides/deployment/vercel.mdx +1 -1
- package/docs/guides/dev-tui.md +13 -3
- package/docs/guides/dynamic-capabilities.md +15 -10
- package/docs/guides/evaluate.md +29 -2
- package/docs/guides/frontend/overview.mdx +5 -7
- package/docs/guides/hooks.md +48 -12
- package/docs/guides/instrumentation/instrumentation.mdx +2 -0
- package/docs/guides/remote-agents.md +12 -14
- package/docs/guides/self-modification.md +10 -0
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +1 -1
- package/docs/patterns/multi-tenant-approvals.md +1 -1
- package/docs/protocols/ucp.mdx +20 -16
- package/docs/reference/cli.md +96 -22
- package/docs/reference/typescript-api.md +43 -41
- package/docs/schedules.mdx +14 -34
- package/docs/subagents/index.mdx +24 -56
- package/docs/tools/human-in-the-loop.md +50 -13
- package/docs/tools/meta.json +1 -1
- package/docs/tools/overview.mdx +79 -59
- package/docs/tools/tasks-upgrade.md +201 -0
- package/docs/tools/tasks.md +315 -0
- package/docs/tools/workflows.mdx +368 -154
- package/package.json +41 -14
- package/dist/src/channel/activity-renderer.d.ts +0 -21
- package/dist/src/channel/activity-renderer.js +0 -1
- package/dist/src/channel/activity-sink.d.ts +0 -2
- package/dist/src/channel/activity-sink.js +0 -1
- package/dist/src/eve-channel/activity-observer-request.d.ts +0 -7
- package/dist/src/eve-channel/activity-observer-request.js +0 -1
- package/dist/src/eve-channel/delivery-policy-request.d.ts +0 -4
- package/dist/src/eve-channel/delivery-policy-request.js +0 -1
- package/dist/src/execution/activity-cohort.d.ts +0 -20
- package/dist/src/execution/activity-cohort.js +0 -1
- package/dist/src/execution/activity-collector.d.ts +0 -12
- package/dist/src/execution/activity-collector.js +0 -1
- package/dist/src/execution/activity-events.d.ts +0 -8
- package/dist/src/execution/activity-events.js +0 -1
- package/dist/src/execution/activity-route.d.ts +0 -2
- package/dist/src/execution/activity-route.js +0 -1
- package/dist/src/execution/activity-work-id.d.ts +0 -9
- package/dist/src/execution/activity-work-id.js +0 -1
- package/dist/src/execution/activity-work.d.ts +0 -30
- package/dist/src/execution/activity-work.js +0 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +0 -7
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +0 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +0 -8
- package/dist/src/execution/dispatch-action-failures.js +0 -1
- package/dist/src/execution/dispatch-start-operation.d.ts +0 -15
- package/dist/src/execution/dispatch-start-operation.js +0 -1
- package/dist/src/execution/publish-channel-event.d.ts +0 -23
- package/dist/src/execution/publish-channel-event.js +0 -1
- package/dist/src/execution/scheduled-launch-delivery.d.ts +0 -7
- package/dist/src/execution/scheduled-launch-delivery.js +0 -1
- package/dist/src/execution/session/event-sink.d.ts +0 -26
- package/dist/src/execution/session/event-sink.js +0 -1
- package/dist/src/execution/session-activity-projection.d.ts +0 -16
- package/dist/src/execution/session-activity-projection.js +0 -1
- package/dist/src/execution/session-activity-renderer-step.d.ts +0 -15
- package/dist/src/execution/session-activity-renderer-step.js +0 -1
- package/dist/src/execution/session-activity.d.ts +0 -3
- package/dist/src/execution/session-activity.js +0 -1
- package/dist/src/execution/submit-activity.d.ts +0 -7
- package/dist/src/execution/submit-activity.js +0 -1
- package/dist/src/execution/task-event-callback.d.ts +0 -12
- package/dist/src/execution/task-event-callback.js +0 -1
- package/dist/src/execution/task-input-capability.d.ts +0 -4
- package/dist/src/execution/task-input-capability.js +0 -1
- package/dist/src/execution/task-input-response-route.d.ts +0 -2
- package/dist/src/execution/task-input-response-route.js +0 -1
- package/dist/src/execution/tasks/child/notify.d.ts +0 -44
- package/dist/src/execution/tasks/child/notify.js +0 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +0 -23
- package/dist/src/execution/tasks/parent/control-shared.js +0 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +0 -35
- package/dist/src/execution/tasks/parent/delegate.js +0 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +0 -22
- package/dist/src/execution/tasks/parent/dispatch.js +0 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +0 -27
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +0 -1
- package/dist/src/execution/tasks/parent/run-parent.d.ts +0 -58
- package/dist/src/execution/tasks/parent/run-parent.js +0 -1
- package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +0 -26
- package/dist/src/execution/tasks/parent/subagent-task-projection.js +0 -1
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +0 -12
- package/dist/src/execution/tasks/parent/task-cancel.js +0 -1
- package/dist/src/execution/tasks/parent/tool-execution.d.ts +0 -45
- package/dist/src/execution/tasks/parent/tool-execution.js +0 -1
- package/dist/src/execution/terminal-session-event.d.ts +0 -13
- package/dist/src/execution/terminal-session-event.js +0 -1
- package/dist/src/execution/tools/ask-question-workflow.js +0 -1
- package/dist/src/execution/tools/ask-question.d.ts +0 -19
- package/dist/src/execution/tools/ask-question.js +0 -2
- package/dist/src/execution/tools/connection-search.d.ts +0 -2
- package/dist/src/execution/tools/connection-search.js +0 -2
- package/dist/src/execution/tools/sleep-workflow.d.ts +0 -3
- package/dist/src/execution/tools/sleep-workflow.js +0 -1
- package/dist/src/execution/tools/sleep.d.ts +0 -10
- package/dist/src/execution/tools/sleep.js +0 -1
- package/dist/src/execution/tools/subagent/accept-event-step.d.ts +0 -7
- package/dist/src/execution/tools/subagent/accept-event-step.js +0 -1
- package/dist/src/execution/tools/subagent/emit-event-step.d.ts +0 -12
- package/dist/src/execution/tools/subagent/emit-event-step.js +0 -1
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +0 -42
- package/dist/src/execution/tools/subagent/invoke-agent.js +0 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +0 -44
- package/dist/src/execution/tools/subagent/invoke-preparation.js +0 -1
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +0 -64
- package/dist/src/execution/tools/subagent/invoke-step.js +0 -1
- package/dist/src/execution/tools/subagent/receipt-identity.d.ts +0 -11
- package/dist/src/execution/tools/subagent/receipt-identity.js +0 -1
- package/dist/src/execution/tools/subagent/start.d.ts +0 -51
- package/dist/src/execution/tools/subagent/start.js +0 -1
- package/dist/src/execution/tools/subagent/steer.d.ts +0 -13
- package/dist/src/execution/tools/subagent/steer.js +0 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +0 -24
- package/dist/src/execution/tools/subagent/task-agent-requests.js +0 -1
- package/dist/src/execution/tools/subagent/task-cancel.d.ts +0 -10
- package/dist/src/execution/tools/subagent/task-cancel.js +0 -1
- package/dist/src/execution/tools/tasks.d.ts +0 -3
- package/dist/src/execution/tools/tasks.js +0 -1
- package/dist/src/execution/tools/workflow/background.js +0 -1
- package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +0 -14
- package/dist/src/execution/tools/workflow/workflow-owner-background.js +0 -1
- package/dist/src/extensions/code/extension/tools/computer_use.js +0 -1
- package/dist/src/harness/background-tools.d.ts +0 -45
- package/dist/src/harness/background-tools.js +0 -1
- package/dist/src/instrumentation/background-task-runtime.d.ts +0 -18
- package/dist/src/instrumentation/background-task-runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.3.0/node_modules/@vercel/cli-config/dist/index.js +0 -21
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/authorization.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/connector.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/installation.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/base-url.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/default-scopes.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/env.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/url-validation.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-context.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/oauth.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-error.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-io.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-util.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/version.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
- package/dist/src/protocol/activity.d.ts +0 -112
- package/dist/src/protocol/activity.js +0 -1
- package/dist/src/protocol/agent-handle-error.d.ts +0 -13
- package/dist/src/protocol/agent-handle-error.js +0 -1
- package/dist/src/public/channels/slack/activity-plan.d.ts +0 -5
- package/dist/src/public/channels/slack/activity-plan.js +0 -1
- package/dist/src/public/channels/slack/activity.d.ts +0 -63
- package/dist/src/public/channels/slack/activity.js +0 -2
- package/dist/src/public/tools/connection-search.d.ts +0 -1
- package/dist/src/public/tools/connection-search.js +0 -1
- package/dist/src/public/tools/task-cancel.d.ts +0 -1
- package/dist/src/public/tools/task-cancel.js +0 -1
- package/dist/src/runtime/prompt/connections.d.ts +0 -9
- package/dist/src/runtime/prompt/connections.js +0 -2
- package/dist/src/shared/boundary-hook-error.d.ts +0 -4
- package/dist/src/shared/boundary-hook-error.js +0 -1
- package/dist/src/shared/empty-delivery.d.ts +0 -3
- package/dist/src/shared/empty-delivery.js +0 -1
- package/dist/src/subagents/agent-handle-errors.d.ts +0 -25
- package/dist/src/subagents/agent-handle-errors.js +0 -1
- package/dist/src/subagents/callback-step.d.ts +0 -11
- package/dist/src/subagents/callback-step.js +0 -1
- package/dist/src/subagents/continuation-bundle.d.ts +0 -13
- package/dist/src/subagents/continuation-bundle.js +0 -1
- package/dist/src/subagents/handle-dispatch.d.ts +0 -65
- package/dist/src/subagents/handle-dispatch.js +0 -1
- package/dist/src/subagents/handles/operation-id.d.ts +0 -15
- package/dist/src/subagents/handles/operation-id.js +0 -1
- package/dist/src/subagents/handles/prompt.d.ts +0 -52
- package/dist/src/subagents/handles/prompt.js +0 -3
- package/dist/src/subagents/handles/query.d.ts +0 -41
- package/dist/src/subagents/handles/query.js +0 -1
- package/dist/src/subagents/handles/state-key.d.ts +0 -8
- package/dist/src/subagents/handles/state-key.js +0 -1
- package/dist/src/subagents/handles/store.d.ts +0 -217
- package/dist/src/subagents/handles/store.js +0 -1
- package/dist/src/subagents/handles/transitions.d.ts +0 -103
- package/dist/src/subagents/handles/transitions.js +0 -1
- package/dist/src/subagents/remote-dispatch.js +0 -1
- package/dist/src/subagents/start-local.d.ts +0 -29
- package/dist/src/subagents/start-local.js +0 -1
- package/dist/src/subagents/start-remote.d.ts +0 -21
- package/dist/src/subagents/start-remote.js +0 -1
- package/dist/src/tasks/delivery-context.d.ts +0 -32
- package/dist/src/tasks/delivery-context.js +0 -4
- package/dist/src/tasks/delivery-policy.d.ts +0 -14
- package/dist/src/tasks/delivery-policy.js +0 -1
- package/dist/src/tasks/json.d.ts +0 -88
- package/dist/src/tasks/json.js +0 -1
- package/dist/src/tasks/notification.d.ts +0 -10
- package/dist/src/tasks/notification.js +0 -1
- package/dist/src/tasks/task-id.d.ts +0 -31
- package/dist/src/tasks/task-id.js +0 -1
- package/dist/src/tasks/task-inbox-token.d.ts +0 -2
- package/dist/src/tasks/task-inbox-token.js +0 -1
- package/dist/src/tasks/transitions.d.ts +0 -17
- package/dist/src/tasks/transitions.js +0 -1
- package/dist/src/tasks/types.d.ts +0 -136
- package/dist/src/tasks/types.js +0 -1
- package/dist/src/tools/framework/connection-search.d.ts +0 -3
- package/dist/src/tools/framework/connection-search.js +0 -1
- package/dist/src/tools/framework/task-cancel.d.ts +0 -4
- package/dist/src/tools/framework/task-cancel.js +0 -1
- package/dist/src/tools/framework/task-contract.d.ts +0 -19
- package/dist/src/tools/framework/task-contract.js +0 -1
- package/dist/src/tools/native-definition.d.ts +0 -7
- package/dist/src/tools/native-definition.js +0 -1
- package/dist/src/tracing/agent-invocation-terminal.d.ts +0 -18
- package/dist/src/tracing/agent-invocation-terminal.js +0 -1
- /package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-driver-source.d.ts +0 -0
- /package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-driver-source.js +0 -0
- /package/dist/src/{extensions/code → computer-use}/extension/tools/computer_use.d.ts +0 -0
- /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.d.ts +0 -0
- /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{createCompiledBindingNamespaceLoader,
|
|
2
|
-
`)}async function createProgrammaticCompiledModuleMap(e,t){let n={};for(let r of collectBoundNodeScopes(e)){let e={},i=Object.fromEntries(r.modules.map(({binding:e,sourceId:t})=>[t,e])),a=createCompiledBindingNamespaceLoader({bindings:i,registries:t});for(let{sourceId:t}of r.modules)e[t]=await
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{createCompiledBindingNamespaceLoader,resolveExtensionBindingMountId}from"#compiler/load-binding-namespace.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const compiledModuleNodeScopeSchema=z.object({modules:z.record(z.string(),z.object({}).passthrough())}).strict(),compiledModuleMapSchema=z.object({nodes:z.record(z.string(),compiledModuleNodeScopeSchema)}).strict();function createCompiledModuleMapSource(e){let t=dirnameFilesystemPath(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,i=!1,a=collectBoundNodeScopes(e.manifest).map(e=>{let a=new Map(e.mounts.map(e=>[e.mountSourceId,e])),o=new Map(e.mounts.map(e=>[e.mountId,e.mountSourceId])),s=new Map(e.modules.map(e=>[e.sourceId,`module_${r++}`]));return{modules:orderBoundModules(e.modules,e=>o.get(bindingMountId(e)??``)).map(({binding:e,sourceId:r})=>{let o=s.get(r);if(e.backing.kind===`filesystem`){let i=createImportSpecifier({fromDirectory:t,importSpecifierStyle:n,targetPath:e.backing.sourcePath})+(bindingMountId(e)===void 0?``:`?eve-mount=${encodeURIComponent(bindingMountId(e))}`),s=bindingMountId(e)!==void 0&&!a.has(r);return{bindingName:o,importSpecifier:s?void 0:i,initializer:`memoizeModuleNamespaceFactories(${s?`await import(${JSON.stringify(i)})`:`imported_${o}`})`,sourceId:r}}let c=a.get(r);if(c?.programmaticImport!==void 0){let e=`${c.programmaticImport.specifier}?eve-mount=${encodeURIComponent(c.mountId)}`;return{bindingName:o,initializer:`memoizeModuleNamespaceFactories({ default: (await import(${JSON.stringify(e)})).default(${JSON.stringify(c.programmaticImport.config)}) })`,sourceId:r}}return i=!0,{bindingName:o,initializer:`await loadProgrammaticModule(${JSON.stringify(e.backing)}, ${renderProgrammaticDependencies(e.backing.dependencies,s)})`,sourceId:r}}),nodeId:e.nodeId}}),o=a.flatMap(e=>e.modules),s=o.flatMap(e=>e.importSpecifier===void 0?[]:[`import * as imported_${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`]),c=o.flatMap(e=>e.initializer===void 0?[]:[`const ${e.bindingName} = ${e.initializer};`]);return[`// Generated by eve. Do not edit by hand.`,...i||o.length>0?[`import { loadFrameworkProgrammaticModule as loadProgrammaticModule, memoizeModuleNamespaceFactories } from ${JSON.stringify(normalizeEsmImportSpecifier(e.programmaticLoaderImportSpecifier??`eve/internal/programmatic-source-loader`))};`]:[],...s,...i||o.length>0?[``]:[],...c,...c.length>0?[``]:[],`export const moduleMap = ${renderModuleMap(a)};`,``,`export default moduleMap;`,``].join(`
|
|
2
|
+
`)}async function createProgrammaticCompiledModuleMap(e,t){let n={};for(let r of collectBoundNodeScopes(e)){let e={},i=Object.fromEntries(r.modules.map(({binding:e,sourceId:t})=>[t,e])),a=new Map(r.mounts.map(e=>[e.mountId,e.mountSourceId])),o=createCompiledBindingNamespaceLoader({bindings:i,registries:t,mountSourceId:e=>a.get(bindingMountId(e)??``)});for(let{sourceId:t}of r.modules)e[t]=await o(t);n[r.nodeId]={modules:e}}return{nodes:n}}function collectRuntimeModuleBindingsForManifest(e){let t=new Map(Object.entries(e.bindings).filter(([,e])=>e.usage.runtimeEntry));for(let n of e.remoteAgents)if(n.binding.usage.runtimeEntry){if(t.has(n.sourceId))throw Error(`Remote agent binding "${n.sourceId}" collides with a node binding.`);t.set(n.sourceId,n.binding)}return orderBoundModules([...t].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({binding:t,sourceId:e})))}function orderBoundModules(e,t){let n=new Map(e.map(e=>[e.sourceId,e])),r=[],i=new Set,a=new Set,visit=e=>{if(a.has(e.sourceId))return;if(i.has(e.sourceId))throw Error(`Compiled module dependency cycle includes "${e.sourceId}".`);i.add(e.sourceId);let o=t?.(e.binding);if(o!==void 0&&o!==e.sourceId){let e=n.get(o);e!==void 0&&visit(e)}if(e.binding.backing.kind===`programmatic`)for(let t of Object.values(e.binding.backing.dependencies??{})){let r=n.get(t);if(r===void 0)throw Error(`Programmatic binding "${e.sourceId}" depends on missing binding "${t}".`);visit(r)}i.delete(e.sourceId),a.add(e.sourceId),r.push(e)};for(let t of e)visit(t);return r}function renderProgrammaticDependencies(e,t){let n=Object.entries(e??{});return n.length===0?`Object.freeze({})`:`Object.freeze({ ${n.map(([e,n])=>`${JSON.stringify(e)}: ${t.get(n)}`).join(`, `)} })`}function collectBoundNodeScopes(e){return[{modules:collectRuntimeModuleBindingsForManifest(e),mounts:e.extensionMounts,nodeId:ROOT_COMPILED_AGENT_NODE_ID},...[...e.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>({modules:collectRuntimeModuleBindingsForManifest(e.agent),mounts:e.agent.extensionMounts,nodeId:e.nodeId}))]}function renderModuleMap(e){return renderFrozenObject([{key:`nodes`,value:renderFrozenObject(e.map(e=>({key:e.nodeId,value:renderFrozenObject([{key:`modules`,value:renderFrozenObject(e.modules.map(e=>({key:e.sourceId,value:e.bindingName})))}],3)})))}],0)}function renderFrozenObject(e,t=1){if(e.length===0)return`Object.freeze({})`;let n=` `.repeat(t),r=` `.repeat(t+1);return[`Object.freeze({`,e.map(e=>`${r}${JSON.stringify(e.key)}: ${e.value.replaceAll(`
|
|
3
3
|
`,`\n${r}`)}`).join(`,
|
|
4
4
|
`),`${n}})`].join(`
|
|
5
|
-
`)}function createImportSpecifier(e){if(e.importSpecifierStyle===`absolute`)return normalizeEsmImportSpecifier(normalizeFilesystemPath(e.targetPath));let t=relativeFilesystemPath(e.fromDirectory,e.targetPath);return t.startsWith(`.`)?t:`./${t}`}function dirnameFilesystemPath(e){let t=splitFilesystemPath(e);return t.segments.length===0?t.root.length===0?`.`:t.root:createFilesystemPath(t.root,t.segments.slice(0,-1))}function relativeFilesystemPath(e,t){let n=splitFilesystemPath(e),r=splitFilesystemPath(t);if(n.root!==r.root)return normalizeFilesystemPath(t);let i=0;for(;i<n.segments.length&&i<r.segments.length&&n.segments[i]===r.segments[i];)i+=1;return[...Array.from({length:n.segments.length-i},()=>`..`),...r.segments.slice(i)].join(`/`)||`.`}function normalizeFilesystemPath(e){let t=splitFilesystemPath(e);return createFilesystemPath(t.root,t.segments)}function splitFilesystemPath(e){let t=e.replaceAll(`\\`,`/`),n=``,r=t,i=t.match(/^[A-Za-z]:/);i===null?t.startsWith(`/`)&&(n=`/`,r=t.slice(1)):(n=i[0],r=t.slice(n.length),r.startsWith(`/`)&&(n+=`/`,r=r.slice(1)));let a=[];for(let e of r.split(`/`))e.length!==0&&e!==`.`&&(e===`..`?a.length>0&&a.at(-1)!==`..`?a.pop():n.length===0&&a.push(e):a.push(e));return{root:n,segments:a}}function createFilesystemPath(e,t){return e===`/`?t.length===0?`/`:`/${t.join(`/`)}`:e.endsWith(`/`)?t.length===0?e:`${e}${t.join(`/`)}`:e.length>0?t.length===0?e:`${e}/${t.join(`/`)}`:t.length===0?`.`:t.join(`/`)}export{collectRuntimeModuleBindingsForManifest,compiledModuleMapSchema,createCompiledModuleMapSource,createProgrammaticCompiledModuleMap,
|
|
5
|
+
`)}function createImportSpecifier(e){if(e.importSpecifierStyle===`absolute`)return normalizeEsmImportSpecifier(normalizeFilesystemPath(e.targetPath));let t=relativeFilesystemPath(e.fromDirectory,e.targetPath);return t.startsWith(`.`)?t:`./${t}`}function dirnameFilesystemPath(e){let t=splitFilesystemPath(e);return t.segments.length===0?t.root.length===0?`.`:t.root:createFilesystemPath(t.root,t.segments.slice(0,-1))}function relativeFilesystemPath(e,t){let n=splitFilesystemPath(e),r=splitFilesystemPath(t);if(n.root!==r.root)return normalizeFilesystemPath(t);let i=0;for(;i<n.segments.length&&i<r.segments.length&&n.segments[i]===r.segments[i];)i+=1;return[...Array.from({length:n.segments.length-i},()=>`..`),...r.segments.slice(i)].join(`/`)||`.`}function normalizeFilesystemPath(e){let t=splitFilesystemPath(e);return createFilesystemPath(t.root,t.segments)}function splitFilesystemPath(e){let t=e.replaceAll(`\\`,`/`),n=``,r=t,i=t.match(/^[A-Za-z]:/);i===null?t.startsWith(`/`)&&(n=`/`,r=t.slice(1)):(n=i[0],r=t.slice(n.length),r.startsWith(`/`)&&(n+=`/`,r=r.slice(1)));let a=[];for(let e of r.split(`/`))e.length!==0&&e!==`.`&&(e===`..`?a.length>0&&a.at(-1)!==`..`?a.pop():n.length===0&&a.push(e):a.push(e));return{root:n,segments:a}}function createFilesystemPath(e,t){return e===`/`?t.length===0?`/`:`/${t.join(`/`)}`:e.endsWith(`/`)?t.length===0?e:`${e}${t.join(`/`)}`:e.length>0?t.length===0?e:`${e}/${t.join(`/`)}`:t.length===0?`.`:t.join(`/`)}export{collectRuntimeModuleBindingsForManifest,compiledModuleMapSchema,createCompiledModuleMapSource,createProgrammaticCompiledModuleMap,resolveExtensionBindingMountId};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { NodeModuleEvaluationContext } from "#compiler/module-lifecycle.js";
|
|
2
|
+
import type { ComposedNodeSourceGraph, SelectedNodeConfig } from "#compiler/node-source-state.js";
|
|
1
3
|
import type { AgentSourceManifest, LocalSubagentSourceRef } from "#discover/manifest.js";
|
|
2
4
|
import type { CompiledAgentDefinition, CompiledExtensionMount, CompiledRemoteAgentNode, CompiledSubagentNode } from "#compiler/manifest.js";
|
|
3
5
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
6
|
+
import type { ExtensionCompileMount } from "#compiler/load-binding-namespace.js";
|
|
7
|
+
import type { FinalizedNodeSourceState } from "#compiler/node-source-state.js";
|
|
8
|
+
import type { CompilerDiagnostic } from "#compiler/diagnostics.js";
|
|
4
9
|
import { normalizeSubagentConfig } from "#compiler/normalize-subagent.js";
|
|
5
10
|
import { type AgentModuleCandidate, type AgentSourceOwner, type AgentSourceRegistry, type ComposedAgentModuleCandidates, type CompiledModuleBinding } from "#compiler/source-graph.js";
|
|
11
|
+
export declare function loadSelectedNodeConfig(state: ComposedNodeSourceGraph, evaluation: NodeModuleEvaluationContext): Promise<SelectedNodeConfig>;
|
|
6
12
|
export declare function collectSelectedSourceIds(composed: ComposedAgentModuleCandidates): Set<string>;
|
|
7
13
|
export declare function assertRootOnlyConfig(config: CompiledAgentDefinition, isRoot: boolean, agentId: string): void;
|
|
8
14
|
export declare function assertApplicationOverlayCanApplyToAllNodes(logicalPaths: readonly string[]): void;
|
|
@@ -25,5 +31,16 @@ export declare function createCompiledRemoteAgent(input: {
|
|
|
25
31
|
readonly source: LocalSubagentSourceRef;
|
|
26
32
|
readonly sourceRef: ModuleSourceRef;
|
|
27
33
|
}): CompiledRemoteAgentNode;
|
|
28
|
-
export declare function
|
|
34
|
+
export declare function compileChannelRoutes(state: FinalizedNodeSourceState, channels: readonly import("#compiler/manifest.js").CompiledChannelDefinition[], diagnostics: CompilerDiagnostic[], nodeId: string): import("#compiler/manifest.js").CompiledChannelRoutePlan;
|
|
35
|
+
export declare function resolveExtensionMountSource(manifest: AgentSourceManifest, mount: AgentSourceManifest["resolvedExtensions"][number], nodePath: string): {
|
|
36
|
+
mountId: string;
|
|
37
|
+
logicalPath: string;
|
|
38
|
+
mountSourceId: string;
|
|
39
|
+
mountSourcePath: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
export declare function createExtensionCompileMounts(manifest: AgentSourceManifest, nodePath: string): {
|
|
42
|
+
mounts: Map<string, ExtensionCompileMount>;
|
|
43
|
+
sourceIds: Map<string, string>;
|
|
44
|
+
};
|
|
45
|
+
export declare function compileExtensionMounts(manifest: AgentSourceManifest, composed: ComposedAgentModuleCandidates, nodePath: string): CompiledExtensionMount[];
|
|
29
46
|
export declare function mergeExternalDependencies(...lists: ReadonlyArray<readonly string[] | undefined>): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{posix}from"node:path";import{
|
|
1
|
+
import{posix}from"node:path";import{canonicalSourceSlot,createAgentModuleBinding,describeAgentSourceCandidate,extensionMountId,isAgentModuleCandidate}from"#compiler/source-graph.js";import{mountRefNamespace}from"#discover/extensions.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import"#compiler/normalize-subagent.js";async function loadSelectedNodeConfig(e,t){let n=e.composed.selected.get(`agent`);if(n===void 0||!isAgentModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createAgentModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:t.loadNamespace,source:a}),source:a}}function collectSelectedSourceIds(e){return new Set([...e.selected.values()].map(e=>e.sourceId))}function assertRootOnlyConfig(e,t,n){if(!t&&e.experimental?.workflow?.world!==void 0)throw Error(`Workflow world configuration is only supported on the root agent config. Remove "experimental.workflow.world" from "${n}".`)}function assertApplicationOverlayCanApplyToAllNodes(e){let t=e.find(e=>{let t=canonicalSourceSlot(e);return t===`agent`||t.startsWith(`channels/`)||t.startsWith(`schedules/`)||t.startsWith(`subagents/`)||t.startsWith(`extensions/`)});if(t!==void 0)throw Error(`Application programmatic source registered for all local nodes cannot declare "${t}".`)}function assertUniqueRegistryIds(e){let t=new Set;for(let n of e)for(let e of n.sources.keys()){if(t.has(e))throw Error(`Programmatic agent source id "${e}" is registered more than once.`);t.add(e)}}function assertNonExtensionSpecialTool(e,t){if(e.owner.kind===`extension`)throw Error(`${t} cannot be configured by an extension source.`)}function withExtensionNamespace(e,t){return t.kind===`extension`?{...e,extensionNamespace:t.namespace}:e}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw Error(`Compiled ${n} "${e}" is declared more than once.`);r.add(e)}}function withDiagnosticsSummary(e,t){return e.map(e=>(e.configResolver,{...e,agent:{...e.agent,diagnosticsSummary:t}}))}function expectSubagentDescription(e,t){if(e.description===void 0||e.description.trim().length===0)throw Error(`Subagent "${t.logicalPath}" must define a non-empty description.`);return e.description}function createCompiledRemoteAgent(e){let t=e.source.logicalPath.endsWith(`.ts`)||e.source.logicalPath.endsWith(`.js`)?e.source.logicalPath:posix.join(e.source.logicalPath,`agent.ts`),n=e.source.sourceId,r={backing:e.binding.backing,logicalPath:t,owner:e.owner,usage:e.binding.usage},i={backing:{kind:`resource`,sourcePath:e.source.entryPath},binding:r,description:e.definition.description,entryPath:e.source.entryPath,logicalPath:t,name:e.source.subagentId,nodeId:e.nodeId,owner:e.owner,parentNodeId:e.parentNodeId,path:e.definition.path,rootPath:e.source.rootPath,sourceId:n,sourceKind:`module`};return e.sourceRef.exportName!==void 0&&Object.assign(i,{exportName:e.sourceRef.exportName}),e.definition.tool!==void 0&&Object.assign(i,{tool:e.definition.tool}),e.definition.url!==void 0&&Object.assign(i,{url:e.definition.url}),i}function compileChannelRoutes(e,t,n,r){let i=createCompiledChannelRoutePlan({bindings:e.bindings,channels:t,diagnostics:n,nodeId:r,sources:Object.fromEntries(e.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});for(let t of i.effective)e.evaluation.requireRuntimeEntry(t.sourceId);return i}function resolveExtensionMountSource(e,t,n){let r=t.programmaticDeclaration??e.extensions.find(e=>mountRefNamespace(e.logicalPath)===t.namespace);if(r!==void 0)return{mountId:extensionMountId(n,t.namespace),logicalPath:r.logicalPath,mountSourceId:r.sourceId,mountSourcePath:posix.join(e.agentRoot,r.logicalPath)}}function createExtensionCompileMounts(e,t){let n=new Map,r=new Map;for(let i of e.resolvedExtensions){let a=resolveExtensionMountSource(e,i,t);a!==void 0&&(r.set(a.mountId,a.mountSourceId),n.set(a.mountId,{mountId:a.mountId,entry:i.programmaticDeclaration===void 0?{mountSourcePath:a.mountSourcePath,packageName:i.packageName,sourceRoot:i.sourceRoot,specifier:i.specifier}:void 0}))}return{mounts:n,sourceIds:r}}function compileExtensionMounts(e,t,n){let r=collectSelectedSourceIds(t);return e.resolvedExtensions.flatMap(t=>{let i=resolveExtensionMountSource(e,t,n);return i===void 0||!r.has(i.mountSourceId)?[]:[{externalDependencies:[...t.externalDependencies],mountLogicalPath:i.logicalPath,mountSourceId:i.mountSourceId,...t.programmaticDeclaration===void 0?{}:{programmaticImport:{specifier:t.programmaticDeclaration.importSpecifier,entryPath:t.programmaticDeclaration.entryPath,config:t.programmaticDeclaration.config}},mountSourcePath:i.mountSourcePath,namespace:t.namespace,packageName:t.packageName,specifier:t.specifier,mountId:i.mountId,sourceRoot:t.sourceRoot}]})}function mergeExternalDependencies(...e){return[...new Set(e.flatMap(e=>e??[]))]}export{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileChannelRoutes,compileExtensionMounts,createCompiledRemoteAgent,createExtensionCompileMounts,expectSubagentDescription,loadSelectedNodeConfig,mergeExternalDependencies,resolveExtensionMountSource,withDiagnosticsSummary,withExtensionNamespace};
|
|
@@ -8,6 +8,7 @@ export interface CompileAgentManifestOptions {
|
|
|
8
8
|
readonly sourceRegistries?: readonly AgentSourceRegistry[];
|
|
9
9
|
}
|
|
10
10
|
export interface NodeCompileInput {
|
|
11
|
+
readonly mountId?: string;
|
|
11
12
|
readonly developmentExtensionCandidates?: readonly AgentModuleCandidate[];
|
|
12
13
|
readonly extensionScope?: {
|
|
13
14
|
readonly namespace: string;
|
|
@@ -18,6 +19,7 @@ export interface NodeCompileInput {
|
|
|
18
19
|
readonly layer: AgentSourceLayer;
|
|
19
20
|
readonly manifest: AgentSourceManifest;
|
|
20
21
|
readonly nodeId: string;
|
|
22
|
+
readonly nodePath: string;
|
|
21
23
|
readonly owner: AgentSourceOwner;
|
|
22
24
|
readonly parentNodeId?: string;
|
|
23
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{noDevelopmentExtensions,prepareDevelopmentExtensions}from"#compiler/development-extensions.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createProgrammaticModuleCandidates,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate,isAgentModuleCandidate}from"#compiler/source-graph.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withDiagnosticsSummary,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{NodeModuleEvaluationContext,markConfigRuntimeEntries}from"#compiler/module-lifecycle.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{applyAgentToolPolicy,applyDefaultToolPolicy,assertFrameworkToolPolicy,canDisableToolWithoutSelectedSource}from"#compiler/default-tool-policy.js";import{resolveWorkspaceSubagentDefinition}from"#compiler/resolve-workspace-subagent.js";import{workspaceSubagentName}from"#public/definitions/workspace-agent.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileMemoryDefinition,deriveMemorySlot}from"#compiler/normalize-memory.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";import{frameworkAgentSourceRegistry,memoryWrapperTemplate}from"#framework/sources/registry.js";async function compileAgentManifest(e,t={}){let n=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(n);let r={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:n},i=t.diagnostics??[],a=await prepareDevelopmentExtensions({diagnostics:i,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,selection:t.developmentExtensions??noDevelopmentExtensions()}),o=await new AgentGraphCompiler(r,n,i).compileStaticNode({developmentExtensionCandidates:a.candidates,inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:a.manifest,nodeId:ROOT_COMPILED_AGENT_NODE_ID,owner:{kind:`application`}}),s=summarizeCompilerDiagnostics(i),c=withDiagnosticsSummary(o.descendants,s);return createCompiledAgentManifest({...o.manifest,diagnosticsSummary:s,subagents:c})}var AgentGraphCompiler=class{context;registries;diagnostics;constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId),applyAgentToolPolicy(t,n),applyDefaultToolPolicy(t,n);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let i=finalizeNodeSourceState(t,r);markConfigRuntimeEntries(n,i.evaluation);let a=await this.compileResources(e,i),o=await this.compileChildren(e,i,r),s=createCompiledAgentNodeManifest({...a,config:n,remoteAgents:o.remoteAgents});return{descendants:o.nodes,manifest:s}}async compileChildren(e,t,n){let r=[],i=[],a=collectSelectedSourceIds(t.composed),o=t.projected.subagents.filter(e=>a.has(e.candidate.sourceId));for(let t of o){let a=t.source,o=createCompiledSubagentNodeId(e.nodeId,a.sourceId),s={extensionScope:t.extensionScope??e.extensionScope,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:a.manifest,nodeId:o,owner:t.owner,parentNodeId:e.nodeId},c=await this.createPhaseOneNodeSourceState(s,n),l=normalizeSubagentConfig(c.selectedConfig.definition,`Expected the subagent config export "${c.selectedConfig.source.exportName??`default`}" from "${a.entryPath}" to match the public eve shape.`);if(l.kind===`remote`){let n=workspaceSubagentName(c.selectedConfig.definition),r=n===void 0?l:await resolveWorkspaceSubagentDefinition({definition:l,name:n,registries:this.registries,source:a});assertRemoteAgentDefinitionHasNoLocalPackageEntries(a);let s=c.selectedConfig.source.sourceId;c.evaluation.setBindings({[s]:c.selectedConfig.binding}),c.evaluation.requireRuntimeEntry(s);let u=c.evaluation.finalizeBindings()[s];if(u===void 0)throw Error(`Remote subagent "${o}" has no finalized config binding.`);i.push(createCompiledRemoteAgent({binding:u,definition:r,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,source:a,sourceRef:c.selectedConfig.source}));continue}let u,d;l.kind===`local`?(u=await compileAgentConfig(a.manifest,this.context,{binding:c.selectedConfig.binding,definition:l.definition,source:c.selectedConfig.source}),assertRootOnlyConfig(u,!1,a.manifest.agentId),applyAgentToolPolicy(c,u),applyDefaultToolPolicy(c,u)):d=l.build?.externalDependencies;let f=mergeExternalDependencies(n,u?.build?.externalDependencies,d,a.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));u!==void 0&&f.length>0&&(u={...u,build:{...u.build,externalDependencies:f}});let p=finalizeNodeSourceState(c,f);u===void 0?p.evaluation.requireRuntimeEntry(c.selectedConfig.source.sourceId):markConfigRuntimeEntries(u,p.evaluation);let m=await this.compileResources(s,p),h=await this.compileChildren(s,p,f),g={backing:t.candidate.backing,entryPath:a.entryPath,logicalPath:a.logicalPath,name:a.subagentId,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,rootPath:a.rootPath,sourceId:a.sourceId,sourceKind:`module`},_;_=u===void 0?{...g,agent:createCompiledAgentResources({...m,remoteAgents:h.remoteAgents}),configResolver:{build:l.kind===`dynamic`?l.build:void 0,eventNames:l.kind===`dynamic`?l.eventNames:[],exportName:c.selectedConfig.source.exportName,logicalPath:c.selectedConfig.source.logicalPath,sourceId:c.selectedConfig.source.sourceId,sourceKind:`module`}}:{...g,agent:createCompiledAgentNodeManifest({...m,config:u,remoteAgents:h.remoteAgents}),description:expectSubagentDescription(u,a)},r.push(_,...h.nodes)}return{nodes:r,remoteAgents:i}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...n.candidates,...i].filter(e=>e.backing.kind!==`resource`&&(canonicalSourceSlot(e.logicalPath)===`memory`||canonicalSourceSlot(e.logicalPath).startsWith(`memory/`))).map(e=>{let t=deriveMemorySlot(e.logicalPath);return instantiateProgrammaticTemplate({anchor:e,dependencies:{memory:e},logicalPath:`tools/${t}.ts`,owner:{feature:`memory`,kind:`framework`},parameters:{memoryExportName:e.exportName??`default`,memoryLogicalPath:e.logicalPath,slot:t},template:memoryWrapperTemplate})}),o=[...r,...e.developmentExtensionCandidates??[],...n.candidates,...a,...i],s=composeAgentModuleCandidates(o),c=projectSelectedSources({candidates:s.selected.values(),resources:n.resources});return{composed:s,orderedCandidates:o,projected:n,sourcesBySourceId:new Map(c.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t),r=new NodeModuleEvaluationContext(this.registries);return r.setBindings(Object.fromEntries([...n.composed.selected.values()].filter(isAgentModuleCandidate).map(e=>[e.sourceId,createAgentModuleBinding(e)]))),{evaluation:r,graph:n,selectedConfig:await this.loadSelectedConfig(n,r)}}async loadSelectedConfig(e,t){let n=e.composed.selected.get(`agent`);if(n===void 0||!isAgentModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createAgentModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:t.loadNamespace,source:a}),source:a}}async compileResources(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m,h=collectSelectedSourceIds(t.composed),g=t.evaluation.loadNamespace;for(let _ of t.orderedCandidates){if(!h.has(_.sourceId))continue;let v=t.sourcesBySourceId.get(_.sourceId);if(v===void 0)continue;let y=t.bindings[_.sourceId],b={binding:y,loadNamespace:g,owner:_.owner};switch(v.kind){case`config`:case`extension`:break;case`channel`:{let n=await compileChannelDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});n.kind===`disabled`?(t.composed=disableComposedCandidate({candidate:_,composed:t.composed}),delete t.bindings[_.sourceId],h.delete(_.sourceId)):p.push(...n.definitions);break}case`connection`:{let n=await compileConnectionDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});n.kind===`connection`?c.push(n.definition):l.push(withExtensionNamespace(n.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId);break}case`hook`:d.push(await compileHookEntry(v.source,{binding:y,loadNamespace:g})),t.evaluation.requireRuntimeEntry(_.sourceId);break;case`instructions`:{let n=await compileInstructionsEntry(e.manifest.agentRoot,v.source,b);n.kind===`instructions`?o.push(n.definition):(s.push(n.definition),t.evaluation.requireRuntimeEntry(_.sourceId));break}case`memory`:u.push(await compileMemoryDefinition(v.source,{binding:y,loadNamespace:g})),t.evaluation.requireRuntimeEntry(_.sourceId);break;case`sandbox`:m=await compileSandboxDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g}),m.inheritsParent||t.evaluation.requireRuntimeEntry(_.sourceId);break;case`schedule`:{let n=await compileScheduleDefinition(e.manifest.agentRoot,v.source,b);f.push(n),n.sourceKind===`module`&&n.hasRun&&t.evaluation.requireRuntimeEntry(_.sourceId);break}case`skill`:{let n=await compileSkillSource(e.manifest.agentRoot,v.source,b);n.kind===`skill`?i.push(n.definition):(a.push(withExtensionNamespace(n.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId));break}case`tool`:{let i=await compileToolEntry(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});assertFrameworkToolPolicy(_,i),i.kind===`disabled`?(t.composed=disableComposedCandidate({allowUnmatched:canDisableToolWithoutSelectedSource(t,i.name),candidate:_,composed:t.composed}),delete t.bindings[_.sourceId],h.delete(_.sourceId)):i.kind===`tool`?(n.push(i.definition),i.definition.hasExecute&&t.evaluation.requireRuntimeEntry(_.sourceId)):i.kind===`dynamic-tool`?(r.push(withExtensionNamespace(i.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId)):(assertNonExtensionSpecialTool(_,`Web search`),n.push(i.definition));break}}}if(m===void 0)throw Error(`Agent node "${e.nodeId}" has no selected sandbox source.`);assertUniqueBy(n,e=>e.name,`tool name`),assertUniqueBy(r,e=>e.slug,`dynamic tool slug`),assertUniqueBy(c,e=>e.connectionName,`connection name`),assertUniqueBy(l,e=>e.slug,`dynamic connection slug`),assertUniqueBy(i,e=>e.name,`skill name`);let _=createCompiledChannelRoutePlan({bindings:t.bindings,channels:p,diagnostics:this.diagnostics,nodeId:e.nodeId,sources:Object.fromEntries(t.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});for(let e of _.effective)t.evaluation.requireRuntimeEntry(e.sourceId);let v=compileExtensionMounts(e.manifest,t.composed);for(let e of v)t.evaluation.requireRuntimeEntry(e.mountSourceId);let y=t.evaluation.finalizeBindings();return createCompiledAgentResources({agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,bindings:y,channelRoutes:_,connections:c,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicConnections:l,dynamicInstructions:s,dynamicSkills:a,dynamicTools:r,extensionMounts:v,hooks:d,memories:u,instructions:o,sandbox:m,sandboxWorkspaces:e.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:f,skills:i,sourceComposition:t.composed.composition,tools:n})}};export{compileAgentManifest};
|
|
1
|
+
import{randomUUID}from"node:crypto";import{noDevelopmentExtensions,prepareDevelopmentExtensions}from"#compiler/development-extensions.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createProgrammaticModuleCandidates,disableComposedCandidate,instantiateProgrammaticTemplate,isAgentModuleCandidate}from"#compiler/source-graph.js";import{bindingMountId}from"#compiler/extension-mount-bindings.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileChannelRoutes,compileExtensionMounts,createCompiledRemoteAgent,createExtensionCompileMounts,expectSubagentDescription,loadSelectedNodeConfig,mergeExternalDependencies,withDiagnosticsSummary,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{NodeModuleEvaluationContext,markConfigRuntimeEntries}from"#compiler/module-lifecycle.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{applyAgentToolPolicy,applyDefaultToolPolicy,assertFrameworkToolPolicy,canDisableToolWithoutSelectedSource}from"#compiler/default-tool-policy.js";import{resolveWorkspaceSubagentDefinition}from"#compiler/resolve-workspace-subagent.js";import{workspaceSubagentName}from"#public/definitions/workspace-agent.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileMemoryDefinition,deriveMemorySlot}from"#compiler/normalize-memory.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";import{frameworkAgentSourceRegistry,memoryWrapperTemplate}from"#framework/sources/registry.js";async function compileAgentManifest(e,t={}){let n=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(n);let r={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:n},i=t.diagnostics??[],a=await prepareDevelopmentExtensions({diagnostics:i,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,selection:t.developmentExtensions??noDevelopmentExtensions()}),o=await new AgentGraphCompiler(r,n,i).compileStaticNode({developmentExtensionCandidates:a.candidates,inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:a.manifest,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodePath:``,owner:{kind:`application`}}),s=summarizeCompilerDiagnostics(i),c=withDiagnosticsSummary(o.descendants,s);return createCompiledAgentManifest({...o.manifest,diagnosticsSummary:s,subagents:c})}var AgentGraphCompiler=class{context;registries;diagnostics;mounts=new Map;evaluationId=randomUUID();constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId),applyAgentToolPolicy(t,n),applyDefaultToolPolicy(t,n);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let i=finalizeNodeSourceState(t,r);markConfigRuntimeEntries(n,i.evaluation);let a=await this.compileResources(e,i),o=await this.compileChildren(e,i,r),s=createCompiledAgentNodeManifest({...a,config:n,remoteAgents:o.remoteAgents});return{descendants:o.nodes,manifest:s}}async compileChildren(e,t,n){let r=[],i=[],a=collectSelectedSourceIds(t.composed),o=t.projected.subagents.filter(e=>a.has(e.candidate.sourceId));for(let t of o){let a=t.source,o=createCompiledSubagentNodeId(e.nodeId,a.sourceId),s={extensionScope:t.extensionScope??e.extensionScope,mountId:t.mountId,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:a.manifest,nodeId:o,nodePath:t.nodePath,owner:t.owner,parentNodeId:e.nodeId},c=await this.createPhaseOneNodeSourceState(s,n),l=normalizeSubagentConfig(c.selectedConfig.definition,`Expected the subagent config export "${c.selectedConfig.source.exportName??`default`}" from "${a.entryPath}" to match the public eve shape.`);if(l.kind===`remote`){let n=workspaceSubagentName(c.selectedConfig.definition),r=n===void 0?l:await resolveWorkspaceSubagentDefinition({definition:l,name:n,registries:this.registries,source:a});assertRemoteAgentDefinitionHasNoLocalPackageEntries(a);let s=c.selectedConfig.source.sourceId;c.evaluation.setBindings({[s]:c.selectedConfig.binding}),c.evaluation.requireRuntimeEntry(s);let u=c.evaluation.finalizeBindings()[s];if(u===void 0)throw Error(`Remote subagent "${o}" has no finalized config binding.`);i.push(createCompiledRemoteAgent({binding:u,definition:r,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,source:a,sourceRef:c.selectedConfig.source}));continue}let u,d;l.kind===`local`?(u=await compileAgentConfig(a.manifest,this.context,{binding:c.selectedConfig.binding,definition:l.definition,source:c.selectedConfig.source}),assertRootOnlyConfig(u,!1,a.manifest.agentId),applyAgentToolPolicy(c,u),applyDefaultToolPolicy(c,u)):d=l.build?.externalDependencies;let f=mergeExternalDependencies(n,u?.build?.externalDependencies,d,a.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));u!==void 0&&f.length>0&&(u={...u,build:{...u.build,externalDependencies:f}});let p=finalizeNodeSourceState(c,f);u===void 0?p.evaluation.requireRuntimeEntry(c.selectedConfig.source.sourceId):markConfigRuntimeEntries(u,p.evaluation);let m=await this.compileResources(s,p),h=await this.compileChildren(s,p,f),g={backing:t.candidate.backing,entryPath:a.entryPath,logicalPath:a.logicalPath,name:a.subagentId,nodeId:o,owner:t.owner,parentNodeId:e.nodeId,rootPath:a.rootPath,sourceId:a.sourceId,sourceKind:`module`},_;_=u===void 0?{...g,agent:createCompiledAgentResources({...m,remoteAgents:h.remoteAgents}),configResolver:{build:l.kind===`dynamic`?l.build:void 0,eventNames:l.kind===`dynamic`?l.eventNames:[],exportName:c.selectedConfig.source.exportName,logicalPath:c.selectedConfig.source.logicalPath,sourceId:c.selectedConfig.source.sourceId,sourceKind:`module`}}:{...g,agent:createCompiledAgentNodeManifest({...m,config:u,remoteAgents:h.remoteAgents}),description:expectSubagentDescription(u,a)},r.push(_,...h.nodes)}return{nodes:r,remoteAgents:i}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,mountId:e.mountId,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,nodePath:e.nodePath,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...n.candidates,...i].filter(e=>e.backing.kind!==`resource`&&(canonicalSourceSlot(e.logicalPath)===`memory`||canonicalSourceSlot(e.logicalPath).startsWith(`memory/`))).map(e=>{let t=deriveMemorySlot(e.logicalPath);return instantiateProgrammaticTemplate({anchor:e,dependencies:{memory:e},logicalPath:`tools/${t}.ts`,owner:{feature:`memory`,kind:`framework`},parameters:{memoryExportName:e.exportName??`default`,memoryLogicalPath:e.logicalPath,slot:t},template:memoryWrapperTemplate})}),o=[...r,...e.developmentExtensionCandidates??[],...n.candidates,...a,...i],s=composeAgentModuleCandidates(o),c=projectSelectedSources({candidates:s.selected.values(),resources:n.resources});return{composed:s,orderedCandidates:o,projected:n,sourcesBySourceId:new Map(c.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t),{mounts:r,sourceIds:i}=createExtensionCompileMounts(e.manifest,e.nodePath);for(let[e,t]of r)this.mounts.set(e,t);let a=new NodeModuleEvaluationContext(this.registries,e=>i.get(bindingMountId(e)??``),this.mounts,this.evaluationId);return a.setBindings(Object.fromEntries([...n.composed.selected.values()].filter(isAgentModuleCandidate).map(e=>[e.sourceId,createAgentModuleBinding(e)]))),{evaluation:a,graph:n,selectedConfig:await loadSelectedNodeConfig(n,a)}}async compileResources(e,t){let n=[],r=[],i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m,h=collectSelectedSourceIds(t.composed),g=t.evaluation.loadNamespace;for(let _ of t.orderedCandidates){if(!h.has(_.sourceId))continue;let v=t.sourcesBySourceId.get(_.sourceId);if(v===void 0)continue;let y=t.bindings[_.sourceId],b={binding:y,loadNamespace:g,owner:_.owner};switch(v.kind){case`config`:case`extension`:break;case`channel`:{let n=await compileChannelDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});n.kind===`disabled`?(t.composed=disableComposedCandidate({candidate:_,composed:t.composed}),delete t.bindings[_.sourceId],h.delete(_.sourceId)):p.push(...n.definitions);break}case`connection`:{let n=await compileConnectionDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});n.kind===`connection`?c.push(n.definition):l.push(withExtensionNamespace(n.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId);break}case`hook`:d.push(await compileHookEntry(v.source,{binding:y,loadNamespace:g})),t.evaluation.requireRuntimeEntry(_.sourceId);break;case`instructions`:{let n=await compileInstructionsEntry(e.manifest.agentRoot,v.source,b);n.kind===`instructions`?o.push(n.definition):(s.push(n.definition),t.evaluation.requireRuntimeEntry(_.sourceId));break}case`memory`:u.push(await compileMemoryDefinition(v.source,{binding:y,loadNamespace:g})),t.evaluation.requireRuntimeEntry(_.sourceId);break;case`sandbox`:m=await compileSandboxDefinition(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g}),m.inheritsParent||t.evaluation.requireRuntimeEntry(_.sourceId);break;case`schedule`:{let n=await compileScheduleDefinition(e.manifest.agentRoot,v.source,b);f.push(n),n.sourceKind===`module`&&n.hasRun&&t.evaluation.requireRuntimeEntry(_.sourceId);break}case`skill`:{let n=await compileSkillSource(e.manifest.agentRoot,v.source,b);n.kind===`skill`?i.push(n.definition):(a.push(withExtensionNamespace(n.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId));break}case`tool`:{assertFrameworkToolPolicy(_);let i=await compileToolEntry(e.manifest.agentRoot,v.source,{binding:y,loadNamespace:g});i.kind===`disabled`?(t.composed=disableComposedCandidate({allowUnmatched:canDisableToolWithoutSelectedSource(t,i.name),candidate:_,composed:t.composed}),delete t.bindings[_.sourceId],h.delete(_.sourceId)):i.kind===`tool`?(n.push(i.definition),i.definition.hasExecute&&t.evaluation.requireRuntimeEntry(_.sourceId)):i.kind===`dynamic-tool`?(r.push(withExtensionNamespace(i.definition,_.owner)),t.evaluation.requireRuntimeEntry(_.sourceId)):(assertNonExtensionSpecialTool(_,`Web search`),n.push(i.definition));break}}}if(m===void 0)throw Error(`Agent node "${e.nodeId}" has no selected sandbox source.`);assertUniqueBy(n,e=>e.name,`tool name`),assertUniqueBy(r,e=>e.slug,`dynamic tool slug`),assertUniqueBy(c,e=>e.connectionName,`connection name`),assertUniqueBy(l,e=>e.slug,`dynamic connection slug`),assertUniqueBy(i,e=>e.name,`skill name`);let _=compileChannelRoutes(t,p,this.diagnostics,e.nodeId),v=compileExtensionMounts(e.manifest,t.composed,e.nodePath);for(let e of v)t.evaluation.requireRuntimeEntry(e.mountSourceId);let y=t.evaluation.finalizeBindings();return createCompiledAgentResources({agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,bindings:y,channelRoutes:_,connections:c,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicConnections:l,dynamicInstructions:s,dynamicSkills:a,dynamicTools:r,extensionMounts:v,hooks:d,memories:u,instructions:o,sandbox:m,sandboxWorkspaces:e.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:f,skills:i,sourceComposition:t.composed.composition,tools:n})}};export{compileAgentManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{isDynamicSentinel}from"#dynamic/definition.js";const ALLOWED_DYNAMIC_SUBAGENT_EVENTS=new Set([`session.started`,`turn.started`]);function normalizeSubagentConfig(e,t){if(isDynamicSentinel(e)){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`build`,`events`,`kind`],t);let r=expectObjectRecord(n.events,t),i=[];for(let[e,n]of Object.entries(r)){if(!ALLOWED_DYNAMIC_SUBAGENT_EVENTS.has(e))throw Error(`${t} Dynamic subagents support only "session.started" and "turn.started" handlers.`);expectFunction(n,t),i.push(e)}let a=n.build===void 0?void 0:normalizeDynamicSubagentBuild(n.build,t);return a===void 0?{eventNames:i,kind:`dynamic`}:{build:a,eventNames:i,kind:`dynamic`}}if(typeof e==`object`&&e&&e.kind===`remote`){let n=expectObjectRecord(e,t);return expectOnlyKnownKeys(n,[`auth`,`description`,`forwardPrincipal`,`headers`,`kind`,`path`,`tool`,`url`],t),n.forwardPrincipal!==void 0&&expectBoolean(n.forwardPrincipal,`${t} Expected "forwardPrincipal" to be a boolean.`),{description:expectString(n.description,t),kind:`remote`,path:n.path===void 0?EVE_SESSION_ROUTE_PATH:expectString(n.path,t),tool:n.tool===void 0?void 0:expectBoolean(n.tool,t),url:typeof n.url==`function`?void 0:expectString(n.url,t)}}return{definition:e,kind:`local`}}function assertRemoteAgentDefinitionHasNoLocalPackageEntries(e){let t=e.manifest,n=[t.connections.length>0?`connections/`:void 0,t.hooks.length>0?`hooks/`:void 0,t.instructions.length>0?`instructions`:void 0,t.lib.length>0?`lib/`:void 0,t.sandbox===null?void 0:`sandbox/`,t.sandboxWorkspaces.length>0?`sandbox/workspace/`:void 0,t.schedules.length>0?`schedules/`:void 0,t.skills.length>0?`skills/`:void 0,t.subagents.length>0?`subagents/`:void 0,t.tools.length>0?`tools/`:void 0].filter(e=>e!==void 0);if(n.length>0)throw Error(`Remote subagent definition "${e.logicalPath}" cannot include local package entries. Remove unsupported entries: ${n.join(`, `)}.`)}function normalizeDynamicSubagentBuild(e,t){let n=expectObjectRecord(e,t);if(expectOnlyKnownKeys(n,[`externalDependencies`],t),n.externalDependencies===void 0)return{};if(!Array.isArray(n.externalDependencies))throw Error(t);return{externalDependencies:n.externalDependencies.map(e=>expectString(e,t))}}export{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TASK_TOOL_NAMES}from"#protocol/task-tools.js";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeToolDefinition}from"#internal/authored-definition/schema-backed.js";async function compileToolEntry(e,t,n){let r=normalizeToolDefinition(await loadModuleBackedDefinition({binding:n.binding,kind:`tool`,loadNamespace:n.loadNamespace,source:t}),`Expected the tool export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`),i=stripLogicalPathExtension(t.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`);if(TASK_TOOL_NAMES.includes(i))throw Error(`Tool "${t.logicalPath}" uses the reserved name "${i}". Rename its path; eve reserves "${i}" for its built-in task tool.`);if(r.kind===`disabled`)return{kind:`disabled`,name:i};if(r.kind===`web-search-tool`){if(i!==`web_search`)throw Error(`The webSearch() definition must be exported from "tools/web_search.ts", not "${t.logicalPath}".`);return{definition:{behavior:{availability:[],handling:{kind:`provider-tool`,provider:r.provider}},description:`Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`,exportName:t.exportName,hasExecute:!1,hasModelOutputProjection:!1,inputSchema:null,logicalPath:t.logicalPath,name:i,sourceId:t.sourceId,sourceKind:`module`,requiresApproval:!1},kind:`web-search-tool`}}if(r.kind===`dynamic-tool`)return{kind:`dynamic-tool`,definition:{eventNames:[...r.eventNames],exportName:t.exportName,logicalPath:t.logicalPath,rebindMissingCallbacks:r.rebindMissingCallbacks||void 0,slug:i,sourceId:t.sourceId,sourceKind:`module`}};let{workflow:a}=r.definition,o={suspend:a===void 0?`none`:`workflow`};return{kind:`tool`,definition:{availableInSubagents:r.definition.availableInSubagents,behavior:a===void 0?r.definition.behavior===void 0?{availability:[],shape:o}:{...r.definition.behavior,shape:o}:{availability:[],handling:{kind:`workflow-tool`,...a},shape:o},description:r.definition.description,exportName:t.exportName,hasExecute:r.definition.hasExecute,hasModelOutputProjection:r.definition.hasModelOutputProjection,inputSchema:r.definition.inputSchema??null,logicalPath:t.logicalPath,modelInputSchema:r.definition.modelInputSchema,name:i,outputSchema:r.definition.outputSchema,requiresApproval:r.definition.hasApproval,sourceId:t.sourceId,sourceKind:`module`,workflowProgram:r.definition.workflowProgram}}}export{compileToolEntry};
|
|
@@ -25,7 +25,9 @@ export type ProjectedResourceSource = {
|
|
|
25
25
|
};
|
|
26
26
|
export type ProjectedSource = ProjectedModuleSource | ProjectedResourceSource;
|
|
27
27
|
export interface ProjectedSubagentSource {
|
|
28
|
+
readonly mountId?: string;
|
|
28
29
|
readonly candidate: AgentResourceCandidate;
|
|
30
|
+
readonly nodePath: string;
|
|
29
31
|
readonly extensionScope?: {
|
|
30
32
|
readonly namespace: string;
|
|
31
33
|
readonly sourceRoot: string;
|
|
@@ -47,7 +49,9 @@ export declare function projectAgentSources(input: {
|
|
|
47
49
|
readonly layer?: AgentSourceLayer;
|
|
48
50
|
readonly manifest: AgentSourceManifest;
|
|
49
51
|
readonly nodeId: string;
|
|
52
|
+
readonly nodePath: string;
|
|
50
53
|
readonly owner?: AgentSourceOwner;
|
|
54
|
+
readonly mountId?: string;
|
|
51
55
|
}): ProjectedAgentSources;
|
|
52
56
|
export declare function projectSelectedSources(input: {
|
|
53
57
|
readonly candidates: Iterable<AgentSourceCandidate>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join}from"node:path";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{canonicalSourceSlot}from"#compiler/source-graph.js";const MODULE_KIND_BY_SLOT_ROOT={agent:`config`,channels:`channel`,extensions:`extension`,hooks:`hook`,instructions:`instructions`,memory:`memory`,sandbox:`sandbox`,schedules:`schedule`,skills:`skill`,tools:`tool`};function projectAgentSources(e){let t=e.owner??{kind:`application`},n=[],r=[],i=[];projectManifest({externalDependencies:e.externalDependencies,candidates:n,projection:createApplicationManifestSourceProjection(e.extensionScope),layer:e.layer??`application`,manifest:e.manifest,nodeId:e.nodeId,owner:t,resources:r,subagents:i});for(let t of[...e.manifest.resolvedExtensions].sort((e,t)=>e.namespace.localeCompare(t.namespace))){let a=
|
|
1
|
+
import{join,posix}from"node:path";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{canonicalSourceSlot,extensionMountId}from"#compiler/source-graph.js";import{mountRefNamespace}from"#discover/extensions.js";const MODULE_KIND_BY_SLOT_ROOT={agent:`config`,channels:`channel`,extensions:`extension`,hooks:`hook`,instructions:`instructions`,memory:`memory`,sandbox:`sandbox`,schedules:`schedule`,skills:`skill`,tools:`tool`};function projectAgentSources(e){let t=e.owner??{kind:`application`},n=[],r=[],i=[];projectManifest({externalDependencies:e.externalDependencies,candidates:n,projection:createApplicationManifestSourceProjection(e.extensionScope),layer:e.layer??`application`,manifest:e.manifest,nodeId:e.nodeId,subagentsPath:posix.join(e.nodePath,`subagents`),owner:t,mountId:e.mountId,declarationMountIds:new Map(e.manifest.extensions.map(t=>[t.sourceId,posix.join(e.nodePath,`extensions`,mountRefNamespace(t.logicalPath))])),resources:r,subagents:i});for(let t of[...e.manifest.resolvedExtensions].sort((e,t)=>e.namespace.localeCompare(t.namespace))){let a=extensionMountId(e.nodePath,t.namespace),o=createExtensionManifestSourceProjection(t),s={kind:`extension`,mountId:a,namespace:t.namespace,packageName:t.packageName};projectManifest({externalDependencies:mergeDependencies(e.externalDependencies,t.externalDependencies),candidates:n,projection:o,layer:`extension-package`,manifest:t.manifest,nodeId:e.nodeId,subagentsPath:posix.join(a,`subagents`),owner:s,mountId:a,resources:r,sourceIdPrefix:`ext:${t.namespace}:`,subagents:i}),t.overrides!==void 0&&projectManifest({externalDependencies:e.externalDependencies,candidates:n,projection:o,layer:`extension-override`,manifest:t.overrides,nodeId:e.nodeId,subagentsPath:posix.join(a,`subagents`),owner:{kind:`application`},mountId:a,resources:r,sourceIdPrefix:`ext-override:${t.namespace}:`,subagents:i})}return{candidates:n,resources:r,subagents:i}}function projectSelectedSources(e){let t=new Map(e.resources.map(e=>[e.candidate.sourceId,e])),n=[];for(let r of e.candidates)if(isModuleCandidate(r))n.push(projectModuleCandidate(r));else{let e=t.get(r.sourceId);e!==void 0&&n.push(e)}return n}function createFilesystemModuleCandidate(e){return{backing:{externalDependencies:[...e.externalDependencies],...e.owner.kind===`extension`&&e.extensionScope!==void 0?{extensionScope:e.extensionScope}:{},kind:`filesystem`,mountId:e.mountId,sourcePath:join(e.sourceRoot,e.source.logicalPath)},exportName:e.source.exportName,form:`direct`,layer:e.layer,logicalPath:e.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:e.sourceId??e.source.sourceId}}function createApplicationManifestSourceProjection(e){let t={logicalPath:e=>e,name:e=>e};return e!==void 0&&(t.extensionScope=e),t}function createExtensionManifestSourceProjection(e){let{namespace:t,sourceRoot:n}=e;return{extensionScope:{namespace:t,sourceRoot:n},logicalPath:e=>qualifyExtensionContributionLogicalPath(e,t),name:e=>`${t}__${e}`}}function projectManifest(e){let{projection:t}=e,sourceId=t=>`${e.sourceIdPrefix??``}${t}`,pushModule=(n,r,i=e.mountId)=>{let a=t.logicalPath(r??n.logicalPath),o=createFilesystemModuleCandidate({externalDependencies:e.externalDependencies,...t.extensionScope===void 0?{}:{extensionScope:t.extensionScope},layer:e.layer,logicalPath:a,nodeId:e.nodeId,owner:e.owner,mountId:i,source:n,sourceId:sourceId(n.sourceId),sourceRoot:e.manifest.agentRoot});e.candidates.push(o)},pushResource=(n,r)=>{let i=t.logicalPath(r.logicalPath),a={...r,...r.sourceKind===`skill-package`?{name:t.name(r.name)}:{},logicalPath:i,sourceId:sourceId(r.sourceId)},o={backing:{kind:`resource`,sourcePath:r.sourceKind===`skill-package`?r.skillFilePath:join(e.manifest.agentRoot,r.logicalPath)},form:`direct`,layer:e.layer,logicalPath:i,nodeId:e.nodeId,owner:e.owner,sourceId:a.sourceId};e.candidates.push(o),e.resources.push({candidate:o,kind:n,source:a})};if(e.manifest.configModule!==void 0){let t=e.manifest.configModule.logicalPath;pushModule(e.manifest.configModule,canonicalSourceSlot(t)===`agent`?void 0:`agent.ts`)}for(let t of e.manifest.extensions)pushModule(t,void 0,e.declarationMountIds?.get(t.sourceId));for(let t of e.manifest.channels)pushModule(t);for(let t of e.manifest.connections)pushModule(t);for(let t of e.manifest.hooks)pushModule(t);for(let t of e.manifest.memories)pushModule(t);e.manifest.sandbox!==null&&pushModule(e.manifest.sandbox);for(let t of e.manifest.tools)pushModule(t);for(let t of e.manifest.instructions)t.sourceKind===`module`?pushModule(t):pushResource(`instructions`,t);for(let t of e.manifest.schedules)t.sourceKind===`module`?pushModule(t):pushResource(`schedule`,t);for(let t of e.manifest.skills)t.sourceKind===`module`?pushModule(t):pushResource(`skill`,t);for(let n of e.manifest.subagents){let r=t.name(n.subagentId),i=t.logicalPath(n.logicalPath);if(r===`agent`)throw Error(`Subagent "${i}" uses the reserved name "agent". Rename its path; eve reserves "agent" for the built-in root-copy target.`);let a={...n,logicalPath:i,sourceId:sourceId(n.sourceId),subagentId:r},o={backing:{kind:`resource`,sourcePath:n.entryPath},form:`direct`,layer:e.layer,logicalPath:i,nodeId:e.nodeId,owner:e.owner,sourceId:a.sourceId};e.candidates.push(o),e.subagents.push({candidate:o,mountId:e.mountId,nodePath:posix.join(e.subagentsPath,n.subagentId),...t.extensionScope===void 0?{}:{extensionScope:t.extensionScope},owner:e.owner,source:a})}}function projectModuleCandidate(e){let t={exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId,sourceKind:`module`},n=canonicalSourceSlot(e.logicalPath);if(n.startsWith(`connections/`))return{candidate:e,kind:`connection`,source:{...t,connectionName:deriveConnectionName(e.logicalPath)}};let r=MODULE_KIND_BY_SLOT_ROOT[n.split(`/`,1)[0]];if(r===void 0)throw Error(`Agent module source slot "${e.logicalPath}" is not compiled yet.`);return{candidate:e,kind:r,source:t}}function isModuleCandidate(e){return e.backing.kind!==`resource`}const EXTENSION_CONTRIBUTION_ROOTS=new Set([`channels`,`connections`,`hooks`,`instructions`,`schedules`,`skills`,`subagents`,`tools`]);function qualifyExtensionContributionLogicalPath(e,t){let n=e.split(`/`);if(n.length===1){let n=stripLogicalPathExtension(e);if(n===`instructions`||n===`system`)return`instructions/${t}${e.slice(e.lastIndexOf(`.`))}`;throw Error(`Extension source slot "${e}" cannot be namespace-scoped.`)}let r=n[0];if(!EXTENSION_CONTRIBUTION_ROOTS.has(r))throw Error(`Extension source slot "${e}" cannot be namespace-scoped.`);return n[1]=`${t}__${n[1]}`,n.join(`/`)}function deriveConnectionName(e){let t=stripLogicalPathExtension(e).replace(/^connections\//,``);return t.endsWith(`/connection`)?t.slice(0,-11):t}function mergeDependencies(...e){return[...new Set(e.flat())]}export{projectAgentSources,projectSelectedSources,qualifyExtensionContributionLogicalPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";const compiledRemoteAgentNodeSchema=z.object({backing:z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),binding:z.object({backing:z.discriminatedUnion(`kind`,[z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),z.object({kind:z.literal(`programmatic`),moduleId:z.string(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict()]),logicalPath:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).strict(),description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),parentNodeId:z.string(),path:z.string(),rootPath:z.string(),tool:z.boolean().optional(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{mountIdSchema}from"#shared/extension-mount.js";const compiledRemoteAgentNodeSchema=z.object({backing:z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),binding:z.object({backing:z.discriminatedUnion(`kind`,[z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),mountId:z.string().optional(),sourcePath:z.string()}).strict(),z.object({kind:z.literal(`programmatic`),mountId:z.string().optional(),moduleId:z.string(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict()]),logicalPath:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),mountId:mountIdSchema,namespace:z.string(),packageName:z.string()}).strict()]),usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).strict(),description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),mountId:mountIdSchema,namespace:z.string(),packageName:z.string()}).strict()]),parentNodeId:z.string(),path:z.string(),rootPath:z.string(),tool:z.boolean().optional(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
@@ -43,13 +43,16 @@ export type AgentSourceOwner = {
|
|
|
43
43
|
readonly kind: "framework";
|
|
44
44
|
} | {
|
|
45
45
|
readonly kind: "extension";
|
|
46
|
+
readonly mountId: string;
|
|
46
47
|
readonly namespace: string;
|
|
47
48
|
readonly packageName: string;
|
|
48
49
|
};
|
|
50
|
+
export declare function extensionMountId(nodePath: string, namespace: string): string;
|
|
49
51
|
export type AgentSourceLayer = "framework-default" | "extension-package" | "extension-override" | "application";
|
|
50
52
|
export type AgentSourceForm = "derived" | "direct";
|
|
51
53
|
export type AgentModuleBacking = {
|
|
52
54
|
readonly externalDependencies: readonly string[];
|
|
55
|
+
readonly mountId?: string;
|
|
53
56
|
readonly extensionScope?: {
|
|
54
57
|
readonly namespace: string;
|
|
55
58
|
readonly sourceRoot: string;
|
|
@@ -58,6 +61,7 @@ export type AgentModuleBacking = {
|
|
|
58
61
|
readonly sourcePath: string;
|
|
59
62
|
} | {
|
|
60
63
|
readonly dependencies?: Readonly<Record<string, string>>;
|
|
64
|
+
readonly mountId?: string;
|
|
61
65
|
readonly kind: "programmatic";
|
|
62
66
|
readonly moduleId: string;
|
|
63
67
|
readonly parameters?: JsonObject;
|
|
@@ -79,6 +83,7 @@ export interface AgentModuleCandidate {
|
|
|
79
83
|
readonly owner: AgentSourceOwner;
|
|
80
84
|
readonly sourceId: string;
|
|
81
85
|
}
|
|
86
|
+
export declare function bindingMountId(binding: AgentModuleBinding): string | undefined;
|
|
82
87
|
export interface AgentModuleBinding {
|
|
83
88
|
readonly backing: AgentModuleBacking;
|
|
84
89
|
readonly logicalPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{posix}from"node:path";import{normalizeLogicalPath,stripLogicalPathExtension}from"#discover/filesystem.js";import{parseJsonObject}from"#shared/json.js";import{validateProgrammaticLogicalPath,validateProgrammaticLogicalPath as validateProgrammaticLogicalPath$1,validateProgrammaticLogicalPathInternal}from"#compiler/source-graph-paths.js";function memoizeModuleNamespaceFactories(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>{if(typeof t!=`function`)return[e,t];let n;return[e,new Proxy(t,{apply(e,t,r){return r.length>0?Reflect.apply(e,t,r):(n??=Promise.resolve().then(()=>Reflect.apply(e,t,r)),n)}})]})))}var ImmutableProgrammaticSourceMap=class{#e;constructor(e){this.#e=new Map(e),Object.freeze(this)}get size(){return this.#e.size}get[Symbol.toStringTag](){return`ImmutableProgrammaticSourceMap`}[Symbol.iterator](){return this.#e[Symbol.iterator]()}entries(){return this.#e.entries()}forEach(e,t){this.#e.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}keys(){return this.#e.keys()}values(){return this.#e.values()}};function isAgentModuleCandidate(e){return e.backing.kind!==`resource`}const LAYER_PRECEDENCE={"framework-default":0,"extension-package":1,"extension-override":2,application:3},FORM_PRECEDENCE={derived:0,direct:1},registeredProgrammaticTemplates=new WeakSet;function defineProgrammaticAgentSource(e){return defineProgrammaticAgentSourceInternal(e,!1)}function defineProgrammaticAgentSourceInternal(e,t){let n=expectNonEmpty(e.id,`Programmatic agent source id`),r=expectNonEmpty(e.revision,`Programmatic agent source "${n}" revision`),i=new Set,a=e.modules.map(e=>{let r=validateProgrammaticLogicalPathInternal(e.logicalPath,t);if(i.has(r))throw Error(`Programmatic agent source "${n}" declares "${r}" more than once.`);i.add(r);let a=e.semanticRevision===void 0?void 0:expectNonEmpty(e.semanticRevision,`Programmatic module "${n}:${r}" semanticRevision`);return Object.freeze({exportName:e.exportName,loadNamespace:e.loadNamespace,logicalPath:r,semanticRevision:a})});return Object.freeze({id:n,modules:Object.freeze(a),revision:r})}function defineProgrammaticExtensionMountDeclaration(e){return defineProgrammaticAgentSourceInternal(e,!0)}function createAgentSourceRegistry(e,t={}){let n=new Map,r=new Map,addSource=(e,t=!1)=>{let r=defineProgrammaticAgentSourceInternal(e,t);if(n.has(r.id))throw Error(`Programmatic agent source id "${r.id}" is registered more than once.`);return n.set(r.id,r),r},i=e.map(e=>{let t=addSource(e.source);return Object.freeze({applyTo:e.applyTo,source:t})});for(let e of t.extensionDeclarations??[])addSource(e,!0);for(let e of t.templates??[]){let t=addSource(e);if(t.modules.length!==1)throw Error(`Programmatic template source "${t.id}" must register exactly one module.`);let n=Object.freeze({module:t.modules[0],source:t});registeredProgrammaticTemplates.add(n),r.set(t.id,n)}return Object.freeze({registrations:Object.freeze(i),sources:new ImmutableProgrammaticSourceMap(n),templates:new ImmutableProgrammaticSourceMap(r)})}function createProgrammaticModuleCandidates(e){return e.registration.source.modules.map(t=>{let n=`${e.registration.source.id}:${t.logicalPath}`;return Object.freeze({backing:Object.freeze({kind:`programmatic`,moduleId:t.logicalPath,registryId:e.registration.source.id,revision:e.registration.source.revision,semanticRevision:t.semanticRevision}),exportName:t.exportName,form:`direct`,layer:e.layer,logicalPath:t.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:n})})}function instantiateProgrammaticTemplate(e){if(!registeredProgrammaticTemplates.has(e.template))throw Error(`Derived programmatic modules require a registered template.`);let t=validateProgrammaticLogicalPath$1(e.logicalPath),n=expectNonEmpty(e.anchor.sourceId,`Derived programmatic module anchor source id`),r=`${e.template.source.id}:${t}:from:${n}`;if(!Object.values(e.dependencies).some(e=>e.sourceId===n))throw Error(`Derived programmatic module "${r}" must include its anchor source as a dependency.`);let i=Object.freeze(Object.fromEntries(Object.entries(e.dependencies).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>{if(expectNonEmpty(t,`Derived programmatic module dependency alias`),n.nodeId!==e.anchor.nodeId)throw Error(`Derived programmatic module "${r}" cannot depend on source "${n.sourceId}" from another node.`);return[t,n.sourceId]}))),a=Object.freeze(parseJsonObject(e.parameters??{}));return Object.freeze({backing:Object.freeze({dependencies:i,kind:`programmatic`,moduleId:e.template.module.logicalPath,parameters:a,registryId:e.template.source.id,revision:e.template.source.revision,semanticRevision:e.template.module.semanticRevision}),exportName:e.template.module.exportName,form:`derived`,layer:e.anchor.layer,logicalPath:t,nodeId:e.anchor.nodeId,owner:e.owner,sourceId:r})}function composeAgentModuleCandidates(e){let t=new Map,n=new Set;for(let r of e){if(n.has(r.sourceId))throw Error(`Agent source id "${r.sourceId}" is declared more than once in node "${r.nodeId}".`);n.add(r.sourceId);let e=canonicalSourceSlot(r.logicalPath),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=new Map,i=[];for(let[e,n]of[...t].sort(([e],[t])=>e.localeCompare(t))){let t=new Set;for(let r of n){let n=`${r.layer}:${r.form}`;if(t.has(n))throw Error(`Agent source slot "${e}" has more than one ${r.layer} ${r.form} candidate.`);t.add(n)}let a=[...n].sort((e,t)=>LAYER_PRECEDENCE[t.layer]-LAYER_PRECEDENCE[e.layer]||FORM_PRECEDENCE[t.form]-FORM_PRECEDENCE[e.form]),o=a[0];r.set(e,o);for(let e of a.slice(1))i.push({kind:`shadowed`,source:describeAgentSourceCandidate(e),winnerSourceId:o.sourceId})}return validateSelectedCandidateDependencies(r),{composition:{entries:Object.freeze(i)},selected:r}}function disableComposedCandidate(e){let t=canonicalSourceSlot(e.candidate.logicalPath),n=new Map(e.composed.selected);if(n.get(t)?.sourceId!==e.candidate.sourceId)throw Error(`Only the selected source for "${t}" can disable that slot.`);if(!e.composed.composition.entries.some(t=>t.kind===`shadowed`&&t.winnerSourceId===e.candidate.sourceId)&&e.allowUnmatched!==!0)throw Error(`Source "${e.candidate.logicalPath}" disables a slot with no lower-precedence source.`);return n.delete(t),{composition:{entries:Object.freeze([...e.composed.composition.entries,{kind:`disabled`,source:describeAgentSourceCandidate(e.candidate)}])},selected:n}}function createAgentModuleBinding(e){return Object.freeze({backing:e.backing,logicalPath:e.logicalPath,owner:e.owner})}async function loadProgrammaticModuleNamespace(e){let t=e.registries.map(t=>t.sources.get(e.backing.registryId)).filter(e=>e!==void 0);if(t.length!==1)throw Error(`Expected exactly one registered programmatic source "${e.backing.registryId}", found ${t.length}.`);let n=t[0];if(n.revision!==e.backing.revision)throw Error(`Programmatic source "${n.id}" revision mismatch: artifact requires "${e.backing.revision}", registry provides "${n.revision}".`);let r=n.modules.find(t=>t.logicalPath===e.backing.moduleId);if(r===void 0)throw Error(`Programmatic source "${n.id}" does not register module "${e.backing.moduleId}".`);if(r.semanticRevision!==e.backing.semanticRevision)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" semantic revision does not match the compiled binding.`);let i=Object.fromEntries(Object.entries(e.backing.dependencies??{}).map(([t,i])=>{let a=e.dependencyNamespaces?.[t];if(a===void 0)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" requires unresolved binding "${i}" as dependency "${t}".`);return[t,a]})),a=await r.loadNamespace({dependencies:Object.freeze(i),parameters:Object.freeze(e.backing.parameters??{})});if(typeof a!=`object`||!a)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" loader must return a module namespace object.`);return a}function canonicalSourceSlot(e){let t=normalizeLogicalPath(e);if(t.length===0||t===`.`||t.startsWith(`../`)||t.includes(`/../`)||posix.normalize(t)!==t)throw Error(`Agent source logical path "${e}" is invalid.`);let n=stripLogicalPathExtension(t),r=n.match(/^connections\/([^/]+)\/connection$/);if(r!==null)return`connections/${r[1]}`;if(n===`sandbox/sandbox`)return`sandbox`;let i=n.match(/^skills\/([^/]+)\/SKILL$/);return i===null?n:`skills/${i[1]}`}function describeAgentSourceCandidate(e){return Object.freeze({backing:e.backing,form:e.form,layer:e.layer,logicalPath:e.logicalPath,owner:e.owner,sourceId:e.sourceId})}function validateSelectedCandidateDependencies(e){let t=new Set([...e.values()].map(e=>e.sourceId));for(let n of e.values())if(n.backing.kind===`programmatic`){for(let e of Object.values(n.backing.dependencies??{}))if(!t.has(e))throw Error(`Derived programmatic source "${n.sourceId}" depends on unselected source "${e}".`)}}function expectNonEmpty(e,t){if(e.trim().length===0)throw Error(`${t} must be non-empty.`);return e}export{canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createAgentSourceRegistry,createProgrammaticModuleCandidates,defineProgrammaticAgentSource,defineProgrammaticExtensionMountDeclaration,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate,isAgentModuleCandidate,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories,validateProgrammaticLogicalPath};
|
|
1
|
+
import{posix}from"node:path";import{normalizeLogicalPath,stripLogicalPathExtension}from"#discover/filesystem.js";import{parseJsonObject}from"#shared/json.js";import{validateProgrammaticLogicalPath,validateProgrammaticLogicalPath as validateProgrammaticLogicalPath$1,validateProgrammaticLogicalPathInternal}from"#compiler/source-graph-paths.js";function memoizeModuleNamespaceFactories(e){return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,t])=>{if(typeof t!=`function`)return[e,t];let n;return[e,new Proxy(t,{apply(e,t,r){return r.length>0?Reflect.apply(e,t,r):(n??=Promise.resolve().then(()=>Reflect.apply(e,t,r)),n)}})]})))}var ImmutableProgrammaticSourceMap=class{#e;constructor(e){this.#e=new Map(e),Object.freeze(this)}get size(){return this.#e.size}get[Symbol.toStringTag](){return`ImmutableProgrammaticSourceMap`}[Symbol.iterator](){return this.#e[Symbol.iterator]()}entries(){return this.#e.entries()}forEach(e,t){this.#e.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}keys(){return this.#e.keys()}values(){return this.#e.values()}};function extensionMountId(e,t){return posix.join(e,`extensions`,t)}function bindingMountId(e){return e.backing.kind===`filesystem`&&e.backing.mountId!==void 0?e.backing.mountId:e.owner.kind===`extension`?e.owner.mountId:void 0}function isAgentModuleCandidate(e){return e.backing.kind!==`resource`}const LAYER_PRECEDENCE={"framework-default":0,"extension-package":1,"extension-override":2,application:3},FORM_PRECEDENCE={derived:0,direct:1},registeredProgrammaticTemplates=new WeakSet;function defineProgrammaticAgentSource(e){return defineProgrammaticAgentSourceInternal(e,!1)}function defineProgrammaticAgentSourceInternal(e,t){let n=expectNonEmpty(e.id,`Programmatic agent source id`),r=expectNonEmpty(e.revision,`Programmatic agent source "${n}" revision`),i=new Set,a=e.modules.map(e=>{let r=validateProgrammaticLogicalPathInternal(e.logicalPath,t);if(i.has(r))throw Error(`Programmatic agent source "${n}" declares "${r}" more than once.`);i.add(r);let a=e.semanticRevision===void 0?void 0:expectNonEmpty(e.semanticRevision,`Programmatic module "${n}:${r}" semanticRevision`);return Object.freeze({exportName:e.exportName,loadNamespace:e.loadNamespace,logicalPath:r,semanticRevision:a})});return Object.freeze({id:n,modules:Object.freeze(a),revision:r})}function defineProgrammaticExtensionMountDeclaration(e){return defineProgrammaticAgentSourceInternal(e,!0)}function createAgentSourceRegistry(e,t={}){let n=new Map,r=new Map,addSource=(e,t=!1)=>{let r=defineProgrammaticAgentSourceInternal(e,t);if(n.has(r.id))throw Error(`Programmatic agent source id "${r.id}" is registered more than once.`);return n.set(r.id,r),r},i=e.map(e=>{let t=addSource(e.source);return Object.freeze({applyTo:e.applyTo,source:t})});for(let e of t.extensionDeclarations??[])addSource(e,!0);for(let e of t.templates??[]){let t=addSource(e);if(t.modules.length!==1)throw Error(`Programmatic template source "${t.id}" must register exactly one module.`);let n=Object.freeze({module:t.modules[0],source:t});registeredProgrammaticTemplates.add(n),r.set(t.id,n)}return Object.freeze({registrations:Object.freeze(i),sources:new ImmutableProgrammaticSourceMap(n),templates:new ImmutableProgrammaticSourceMap(r)})}function createProgrammaticModuleCandidates(e){return e.registration.source.modules.map(t=>{let n=`${e.registration.source.id}:${t.logicalPath}`;return Object.freeze({backing:Object.freeze({kind:`programmatic`,moduleId:t.logicalPath,registryId:e.registration.source.id,revision:e.registration.source.revision,semanticRevision:t.semanticRevision}),exportName:t.exportName,form:`direct`,layer:e.layer,logicalPath:t.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:n})})}function instantiateProgrammaticTemplate(e){if(!registeredProgrammaticTemplates.has(e.template))throw Error(`Derived programmatic modules require a registered template.`);let t=validateProgrammaticLogicalPath$1(e.logicalPath),n=expectNonEmpty(e.anchor.sourceId,`Derived programmatic module anchor source id`),r=`${e.template.source.id}:${t}:from:${n}`;if(!Object.values(e.dependencies).some(e=>e.sourceId===n))throw Error(`Derived programmatic module "${r}" must include its anchor source as a dependency.`);let i=Object.freeze(Object.fromEntries(Object.entries(e.dependencies).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>{if(expectNonEmpty(t,`Derived programmatic module dependency alias`),n.nodeId!==e.anchor.nodeId)throw Error(`Derived programmatic module "${r}" cannot depend on source "${n.sourceId}" from another node.`);return[t,n.sourceId]}))),a=Object.freeze(parseJsonObject(e.parameters??{}));return Object.freeze({backing:Object.freeze({dependencies:i,kind:`programmatic`,moduleId:e.template.module.logicalPath,parameters:a,registryId:e.template.source.id,revision:e.template.source.revision,semanticRevision:e.template.module.semanticRevision}),exportName:e.template.module.exportName,form:`derived`,layer:e.anchor.layer,logicalPath:t,nodeId:e.anchor.nodeId,owner:e.owner,sourceId:r})}function composeAgentModuleCandidates(e){let t=new Map,n=new Set;for(let r of e){if(n.has(r.sourceId))throw Error(`Agent source id "${r.sourceId}" is declared more than once in node "${r.nodeId}".`);n.add(r.sourceId);let e=canonicalSourceSlot(r.logicalPath),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=new Map,i=[];for(let[e,n]of[...t].sort(([e],[t])=>e.localeCompare(t))){let t=new Set;for(let r of n){let n=`${r.layer}:${r.form}`;if(t.has(n))throw Error(`Agent source slot "${e}" has more than one ${r.layer} ${r.form} candidate.`);t.add(n)}let a=[...n].sort((e,t)=>LAYER_PRECEDENCE[t.layer]-LAYER_PRECEDENCE[e.layer]||FORM_PRECEDENCE[t.form]-FORM_PRECEDENCE[e.form]),o=a[0];r.set(e,o);for(let e of a.slice(1))i.push({kind:`shadowed`,source:describeAgentSourceCandidate(e),winnerSourceId:o.sourceId})}return validateSelectedCandidateDependencies(r),{composition:{entries:Object.freeze(i)},selected:r}}function disableComposedCandidate(e){let t=canonicalSourceSlot(e.candidate.logicalPath),n=new Map(e.composed.selected);if(n.get(t)?.sourceId!==e.candidate.sourceId)throw Error(`Only the selected source for "${t}" can disable that slot.`);if(!e.composed.composition.entries.some(t=>t.kind===`shadowed`&&t.winnerSourceId===e.candidate.sourceId)&&e.allowUnmatched!==!0)throw Error(`Source "${e.candidate.logicalPath}" disables a slot with no lower-precedence source.`);return n.delete(t),{composition:{entries:Object.freeze([...e.composed.composition.entries,{kind:`disabled`,source:describeAgentSourceCandidate(e.candidate)}])},selected:n}}function createAgentModuleBinding(e){return Object.freeze({backing:e.backing,logicalPath:e.logicalPath,owner:e.owner})}async function loadProgrammaticModuleNamespace(e){let t=e.registries.map(t=>t.sources.get(e.backing.registryId)).filter(e=>e!==void 0);if(t.length!==1)throw Error(`Expected exactly one registered programmatic source "${e.backing.registryId}", found ${t.length}.`);let n=t[0];if(n.revision!==e.backing.revision)throw Error(`Programmatic source "${n.id}" revision mismatch: artifact requires "${e.backing.revision}", registry provides "${n.revision}".`);let r=n.modules.find(t=>t.logicalPath===e.backing.moduleId);if(r===void 0)throw Error(`Programmatic source "${n.id}" does not register module "${e.backing.moduleId}".`);if(r.semanticRevision!==e.backing.semanticRevision)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" semantic revision does not match the compiled binding.`);let i=Object.fromEntries(Object.entries(e.backing.dependencies??{}).map(([t,i])=>{let a=e.dependencyNamespaces?.[t];if(a===void 0)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" requires unresolved binding "${i}" as dependency "${t}".`);return[t,a]})),a=await r.loadNamespace({dependencies:Object.freeze(i),parameters:Object.freeze(e.backing.parameters??{})});if(typeof a!=`object`||!a)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" loader must return a module namespace object.`);return a}function canonicalSourceSlot(e){let t=normalizeLogicalPath(e);if(t.length===0||t===`.`||t.startsWith(`../`)||t.includes(`/../`)||posix.normalize(t)!==t)throw Error(`Agent source logical path "${e}" is invalid.`);let n=stripLogicalPathExtension(t),r=n.match(/^connections\/([^/]+)\/connection$/);if(r!==null)return`connections/${r[1]}`;if(n===`sandbox/sandbox`)return`sandbox`;let i=n.match(/^skills\/([^/]+)\/SKILL$/);return i===null?n:`skills/${i[1]}`}function describeAgentSourceCandidate(e){return Object.freeze({backing:e.backing,form:e.form,layer:e.layer,logicalPath:e.logicalPath,owner:e.owner,sourceId:e.sourceId})}function validateSelectedCandidateDependencies(e){let t=new Set([...e.values()].map(e=>e.sourceId));for(let n of e.values())if(n.backing.kind===`programmatic`){for(let e of Object.values(n.backing.dependencies??{}))if(!t.has(e))throw Error(`Derived programmatic source "${n.sourceId}" depends on unselected source "${e}".`)}}function expectNonEmpty(e,t){if(e.trim().length===0)throw Error(`${t} must be non-empty.`);return e}export{bindingMountId,canonicalSourceSlot,composeAgentModuleCandidates,createAgentModuleBinding,createAgentSourceRegistry,createProgrammaticModuleCandidates,defineProgrammaticAgentSource,defineProgrammaticExtensionMountDeclaration,describeAgentSourceCandidate,disableComposedCandidate,extensionMountId,instantiateProgrammaticTemplate,isAgentModuleCandidate,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories,validateProgrammaticLogicalPath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineExtension}from"eve/extension";var extension_default=defineExtension();export{extension_default as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const MAX_STREAM_CHARS=8e3;function boundedStream(e,t){let n=t.trim();if(n)return n.length<=MAX_STREAM_CHARS?`${e}:\n${n}`:`${e} (last ${MAX_STREAM_CHARS} characters):\n${n.slice(-8e3)}`}function commandFailureDetail(e){return[boundedStream(`stdout`,e.stdout),boundedStream(`stderr`,e.stderr)].filter(e=>e!==void 0).join(`
|
|
2
|
+
`)||`no command output`}export{commandFailureDetail};
|
|
@@ -6,4 +6,12 @@ export declare const COMPUTER_USE_REVALIDATION_KEY = "computer-use:0.12.5:2026-0
|
|
|
6
6
|
export declare function installComputerUse(sandbox: ComputerUseSandbox): Promise<void>;
|
|
7
7
|
/** Start the managed display and driver for one consumer sandbox session. */
|
|
8
8
|
export declare function startComputerUse(sandbox: Pick<SandboxSession, "resolvePath" | "run">): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Restart the desktop when a resumed sandbox lost its processes.
|
|
11
|
+
*
|
|
12
|
+
* Sandbox resume does not rerun consumer startup, so the display and driver
|
|
13
|
+
* started there are gone after a stop. The check is one cheap command when
|
|
14
|
+
* everything is already live.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ensureComputerUse(sandbox: Pick<SandboxSession, "resolvePath" | "run">, abortSignal?: AbortSignal): Promise<void>;
|
|
9
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)});if(r.exitCode!==0)throw Error(`computer-use installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}async function startComputerUse(e){let t={TERM:`xterm-256color`},n=await e.run({command:computerUseDisplayCommand(e),env:t});if(n.exitCode!==0)throw Error(`computer-use display startup failed (exit ${n.exitCode}): ${commandFailureDetail(n)}`);let r=await e.run({command:computerUseDriverStartCommand(e),env:t});if(r.exitCode!==0)throw Error(`computer-use driver startup failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}function computerUseInstallScript(e){let t=computerUsePaths(e);return`#!/usr/bin/env bash
|
|
1
|
+
import{commandFailureDetail}from"./command-failure.js";import{COMPUTER_USE_DRIVER_SOURCES}from"./computer-use-driver-source.js";import{shellQuote}from"./shell.js";import{computerUseDisplayCommand,computerUseDriverStartCommand,computerUsePaths,computerUseReadyCommand}from"./computer-use.js";const COMPUTER_USE_REVALIDATION_KEY=`computer-use:0.12.5:2026-09-17.1`;async function installComputerUse(e){let t=computerUsePaths(e),n=e.resolvePath(`.eve-code/install-computer-use.sh`);await e.run({command:`mkdir -p ${shellQuote(t.driverRoot)}`}),await Promise.all([...Object.entries(COMPUTER_USE_DRIVER_SOURCES).map(([n,r])=>e.writeTextFile({path:`${t.driverRoot}/${n}`,content:r})),e.writeTextFile({path:n,content:computerUseInstallScript(e)})]);let r=await e.run({command:[`set -e`,`if [ "$(id -u)" = 0 ]; then`,` bash ${shellQuote(n)}`,`elif command -v sudo >/dev/null 2>&1; then`,` sudo -n bash ${shellQuote(n)}`,`else`,` echo 'computer-use requires an apt-based sandbox image with root or passwordless sudo' >&2`,` exit 1`,`fi`].join(`
|
|
2
|
+
`)});if(r.exitCode!==0)throw Error(`computer-use installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}async function startComputerUse(e){let t={TERM:`xterm-256color`},n=await e.run({command:computerUseDisplayCommand(e),env:t});if(n.exitCode!==0)throw Error(`computer-use display startup failed (exit ${n.exitCode}): ${commandFailureDetail(n)}`);let r=await e.run({command:computerUseDriverStartCommand(e),env:t});if(r.exitCode!==0)throw Error(`computer-use driver startup failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}async function ensureComputerUse(e,t){(await e.run({command:computerUseReadyCommand(e),abortSignal:t})).exitCode!==0&&await startComputerUse(e)}function computerUseInstallScript(e){let t=computerUsePaths(e);return`#!/usr/bin/env bash
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
command -v apt-get >/dev/null || {
|
|
@@ -117,4 +117,4 @@ ln -sfn xdg-open ${shellQuote(`${t.managedBrowserRoot}/sensible-browser`)}
|
|
|
117
117
|
npm install --prefix ${shellQuote(t.driverRoot)} --ignore-scripts --no-audit --no-fund
|
|
118
118
|
apt-get clean
|
|
119
119
|
rm -rf /var/lib/apt/lists/*
|
|
120
|
-
`}export{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse};
|
|
120
|
+
`}export{COMPUTER_USE_REVALIDATION_KEY,ensureComputerUse,installComputerUse,startComputerUse};
|
|
@@ -28,6 +28,8 @@ export declare function recordingPath(sandbox: PathSandbox, path?: string): stri
|
|
|
28
28
|
export declare function computerUseDriverRequest(action: DriverAction, screenshot: string): ComputerUseDriverRequest;
|
|
29
29
|
export declare function computerUseDriverCommand(sandbox: PathSandbox): string;
|
|
30
30
|
export declare function computerUseDriverStartCommand(sandbox: PathSandbox): string;
|
|
31
|
+
/** Exit 0 only when the display, window manager, and driver are all live. */
|
|
32
|
+
export declare function computerUseReadyCommand(sandbox: PathSandbox): string;
|
|
31
33
|
export declare function computerUseDisplayCommand(sandbox: PathSandbox): string;
|
|
32
34
|
export declare function computerUseDesktopSizeCommand(sandbox: PathSandbox, size: "full_hd" | "large_16_9" | "social_16_9"): string;
|
|
33
35
|
export declare function computerUseLaunchCommand(sandbox: PathSandbox, action: LaunchAction): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import{shellQuote}from"./shell.js";function computerUsePaths(e){let t=e.resolvePath(`computer-use`);return{root:t,driverRoot:e.resolvePath(`.eve-code/computer-use-driver`),driverSocket:`${t}/cua-driver.sock`,latestScreenshot:`${t}/latest.png`,managedBrowserRoot:e.resolvePath(`.eve-code/managed-browser`)}}const FIREFOX_USER_JS=[`user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);`,`user_pref("ui.systemUsesDarkTheme", 1);`,`user_pref("browser.theme.toolbar-theme", 0);`,`user_pref("browser.theme.content-theme", 0);`,`user_pref("layout.css.prefers-color-scheme.content-override", 0);`,`user_pref("privacy.resistFingerprinting", false);`,`user_pref("browser.tabs.inTitlebar", 0);`,`user_pref("browser.toolbars.bookmarks.visibility", "never");`,`user_pref("browser.urlbar.quicksuggest.enabled", false);`,`user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false);`,`user_pref("browser.urlbar.suggest.quicksuggest.sponsored", false);`,`user_pref("browser.urlbar.suggest.searches", false);`,`user_pref("browser.urlbar.suggest.topsites", false);`,`user_pref("browser.urlbar.suggest.trending", false);`,`user_pref("browser.urlbar.suggest.history", false);`,`user_pref("browser.urlbar.suggest.bookmark", false);`,`user_pref("browser.urlbar.suggest.openpage", false);`,`user_pref("browser.urlbar.maxRichResults", 0);`,`user_pref("browser.newtabpage.activity-stream.feeds.topsites", false);`,`user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);`].join(`
|
|
2
2
|
`),TERMINAL_XRESOURCES=`XTerm*background: #0A0A0A.XTerm*foreground: #bbbbbb.XTerm*cursorColor: #bbbbbb.XTerm*pointerColor: #bbbbbb.XTerm*highlightColorMode: true.XTerm*highlightReverse: false.XTerm*highlightColor: #ffffff.XTerm*highlightTextColor: #000000.XTerm*scrollBar: false.XTerm*toolBar: false.XTerm*color0: #000000.XTerm*color1: #e52222.XTerm*color2: #a6e32d.XTerm*color3: #fc951e.XTerm*color4: #c48dff.XTerm*color5: #fa2573.XTerm*color6: #67d9f0.XTerm*color7: #f2f2f2.XTerm*color8: #555555.XTerm*color9: #ff5555.XTerm*color10: #55ff55.XTerm*color11: #ffff55.XTerm*color12: #5555ff.XTerm*color13: #ff55ff.XTerm*color14: #55ffff.XTerm*color15: #ffffff`.split(`.`).join(`
|
|
3
3
|
`);function screenshotPath(e,t){let n=computerUsePaths(e);return t===void 0?n.latestScreenshot:`${n.root}/${t}`}function recordingPath(e,t){return`${computerUsePaths(e).root}/${t??`recording-${crypto.randomUUID()}.mp4`}`}function computerUseDriverRequest(e,t){return{action:e,screenshotPath:t}}function computerUseDriverCommand(e){return`node ${shellQuote(`${computerUsePaths(e).driverRoot}/client.mjs`)}`}function computerUseDriverStartCommand(e){let t=computerUsePaths(e),n=`COMPUTER_USE_SOCKET_PATH=${shellQuote(t.driverSocket)}`,r=`COMPUTER_USE_ROOT=${shellQuote(t.root)}`,i=`COMPUTER_USE_REQUEST='{"action":"health"}' ${n} ${`node ${shellQuote(`${t.driverRoot}/client.mjs`)}`}`;return[`set -euo pipefail`,`mkdir -p ${shellQuote(t.root)}`,`if ! ${i} >/dev/null 2>&1; then`,` rm -f ${shellQuote(t.driverSocket)}`,` setsid -f env DISPLAY=:99 XCURSOR_SIZE=32 CUA_DRIVER_RS_TELEMETRY_ENABLED=false CUA_DRIVER_RS_UPDATE_CHECK=false ${n} ${r} node ${shellQuote(`${t.driverRoot}/server.mjs`)} </dev/null > ${shellQuote(`${t.root}/cua-driver.log`)} 2>&1`,`fi`,`for _ in $(seq 1 100); do`,` ${i} >/dev/null 2>&1 && exit 0`,` sleep 0.1`,`done`,`tail -n 200 ${shellQuote(`${t.root}/cua-driver.log`)} >&2 || true`,`exit 1`].join(`
|
|
4
|
+
`)}function computerUseReadyCommand(e){let t=computerUsePaths(e);return[`set -euo pipefail`,`xdpyinfo -display :99 >/dev/null 2>&1`,`DISPLAY=:99 xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null | grep -Eq 'window id # 0x[1-9a-f]'`,`COMPUTER_USE_REQUEST='{"action":"health"}' COMPUTER_USE_SOCKET_PATH=${shellQuote(t.driverSocket)} node ${shellQuote(`${t.driverRoot}/client.mjs`)} >/dev/null 2>&1`].join(`
|
|
4
5
|
`)}function computerUseDisplayCommand(e){let{root:t}=computerUsePaths(e),n=[xfconfSetCommand(`xsettings`,`/Net/ThemeName`,`string`,`Colloid-Dark`),xfconfSetCommand(`xsettings`,`/Net/PreferDarkTheme`,`bool`,`true`),xfconfSetCommand(`xsettings`,`/Net/IconThemeName`,`string`,`Adwaita`),xfconfSetCommand(`xsettings`,`/Gtk/CursorThemeSize`,`int`,`32`),xfconfSetCommand(`xfwm4`,`/general/theme`,`string`,`Colloid-Dark`),xfconfSetCommand(`xsettings`,`/Gtk/FontName`,`string`,`Geist 10`),xfconfSetCommand(`xsettings`,`/Gtk/MonospaceFontName`,`string`,`GeistMono Nerd Font 10`),xfconfSetCommand(`xfwm4`,`/general/button_layout`,`string`,`CHM|`),xfconfSetCommand(`xfwm4`,`/general/title_alignment`,`string`,`center`),xfconfSetCommand(`xfwm4`,`/general/title_font`,`string`,`Geist Medium 11`),xfconfSetCommand(`xfwm4`,`/general/show_dock_shadow`,`bool`,`false`),xfconfSetCommand(`xfwm4`,`/general/shadow_opacity`,`int`,`35`)];return[`set -euo pipefail`,`command -v Xvfb >/dev/null && command -v xfwm4 >/dev/null || exit 0`,`mkdir -p ${t}`,`if ! xdpyinfo -display :99 >/dev/null 2>&1; then`,` setsid -f Xvfb :99 -screen 0 1920x1080x24 -ac +extension RANDR > ${t}/xvfb.log 2>&1`,`fi`,`for _ in $(seq 1 50); do`,` xdpyinfo -display :99 >/dev/null 2>&1 && break`,` sleep 0.1`,`done`,`xdpyinfo -display :99 >/dev/null`,`dbus_output=$(dbus-launch --sh-syntax)`,`eval "$dbus_output"`,...n,`printf '%s' "$DBUS_SESSION_BUS_ADDRESS" > ${t}/dbus-session-address`,`chmod 0600 ${t}/dbus-session-address`,`setsid -f env DISPLAY=:99 DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" XCURSOR_SIZE=32 xfsettingsd --replace > ${t}/xfsettingsd.log 2>&1`,`for _ in $(seq 1 50); do`,` pgrep -f '[x]fsettingsd' >/dev/null && break`,` sleep 0.1`,`done`,`if ! pgrep -f '[x]fsettingsd' >/dev/null; then cat ${t}/xfsettingsd.log >&2 || true; echo 'xfsettingsd did not start' >&2; exit 1; fi`,`setsid -f env DISPLAY=:99 DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" XCURSOR_SIZE=32 xfwm4 --replace --compositor=on > ${t}/xfwm4.log 2>&1`,`for _ in $(seq 1 100); do`,` DISPLAY=:99 xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null | grep -Eq 'window id # 0x[1-9a-f]' && break`,` sleep 0.1`,`done`,`if ! DISPLAY=:99 xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null | grep -Eq 'window id # 0x[1-9a-f]'; then`,` cat ${t}/xfwm4.log >&2 || true`,` echo 'xfwm4 did not claim the X11 display' >&2`,` exit 1`,`fi`,`DISPLAY=:99 xsetroot -solid '#000000'`].join(`
|
|
5
6
|
`)}function desktopEnvironmentPrefix(e){let{root:t}=computerUsePaths(e);return`export DISPLAY=:99; export DBUS_SESSION_BUS_ADDRESS="$(cat ${t}/dbus-session-address)"; export XCURSOR_SIZE=32`}function xfconfSetCommand(e,t,n,r){return`DISPLAY=:99 xfconf-query -c ${e} -p ${t} --create -t ${n} -s ${shellQuote(r)}`}function computerUseDesktopSizeCommand(e,t){let n={full_hd:`1920x1080`,large_16_9:`1600x900`,social_16_9:`1280x720`}[t];return[desktopEnvironmentPrefix(e),`if xdotool search --onlyvisible --class firefox-esr >/dev/null 2>&1 || xdotool search --onlyvisible --classname ComputerUseTerminalPrimary >/dev/null 2>&1 || xdotool search --onlyvisible --classname ComputerUseTerminalSecondary >/dev/null 2>&1; then`,` echo 'desktop size must be selected before launching managed windows' >&2`,` exit 1`,`fi`,`xrandr --fb ${n}`,`xdpyinfo -display :99 | grep -q 'dimensions: *${n} pixels'`,"xdotool mousemove $(( ${dimensions%x*} / 2 )) $(( ${dimensions#*x} / 2 ))",`xsetroot -solid '#000000'`].join(`
|
|
6
7
|
`)}function computerUseLaunchCommand(e,t){let n=computerUsePaths(e),r=n.root;switch(t.app){case`xterm`:{let i=t.instance??`primary`,a=i===`primary`?`ComputerUseTerminalPrimary`:`ComputerUseTerminalSecondary`,o=i===`primary`?`Terminal 1`:`Terminal 2`,s=`DISPLAY=:99 xdotool search --onlyvisible --classname ${a}`;return[`mkdir -p ${r}`,`printf '%s\\n' ${shellQuote(TERMINAL_XRESOURCES)} > ${r}/Xresources`,`printf '%s\\n' ${shellQuote(`unset PROMPT_COMMAND; unset CI; export TERM=xterm-256color; export PATH='${n.managedBrowserRoot}:'"$PATH"; export PS1='▲ \\W/ '`)} > ${r}/terminal-rc`,desktopEnvironmentPrefix(e),`xrdb -merge ${r}/Xresources`,`if ! ${s} >/dev/null 2>&1; then`,` setsid -f env DISPLAY=:99 DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" xterm -name ${a} -title ${shellQuote(o)} -xrm '${a}*background: #0A0A0A' -xrm '${a}*foreground: #bbbbbb' -xrm '${a}*cursorColor: #bbbbbb' -xrm '${a}*highlightColorMode: true' -xrm '${a}*highlightReverse: false' -xrm '${a}*highlightColor: #ffffff' -xrm '${a}*highlightTextColor: #000000' -fa ${shellQuote(`GeistMono Nerd Font`)} -fs 18 -hm -selbg '#ffffff' -selfg '#000000' +bc +sb -e bash --noprofile --rcfile ${r}/terminal-rc -i </dev/null > ${r}/xterm-${i}.log 2>&1`,`fi`,`for _ in $(seq 1 50); do`,` ${s} >/dev/null 2>&1 && break`,` sleep 0.1`,`done`,`window=$(${s} | head -n 1)`,`xdotool windowactivate --sync "$window"`,requireWindowDecorationCommand(`"$window"`,`xterm ${i}`),computerUseWindowLayoutCommand(e,`maximized`,`"$window"`)].join(`
|
|
@@ -75,4 +76,4 @@ import{shellQuote}from"./shell.js";function computerUsePaths(e){let t=e.resolveP
|
|
|
75
76
|
`)}}}function requireWindowDecorationCommand(e,t){return[`for _ in $(seq 1 50); do`,` DISPLAY=:99 xprop -id ${e} _NET_FRAME_EXTENTS 2>/dev/null | grep -q '=.*,' && break`,` sleep 0.1`,`done`,`DISPLAY=:99 xprop -id ${e} _NET_FRAME_EXTENTS 2>/dev/null | grep -q '=.*,' || { echo ${shellQuote(`${t} opened without window-manager decorations`)} >&2; exit 1; }`].join(`
|
|
76
77
|
`)}function computerUseFocusCommand(e,t,n=`primary`){let r=t===`firefox`?`xdotool search --onlyvisible --class firefox-esr`:`xdotool search --onlyvisible --classname ${n===`primary`?`ComputerUseTerminalPrimary`:`ComputerUseTerminalSecondary`}`;return[desktopEnvironmentPrefix(e),`window=$(${r} | head -n 1)`,`test -n "$window" || { echo ${shellQuote(`${t} ${n} window is not running`)} >&2; exit 1; }`,`xdotool windowactivate --sync "$window"`].join(`
|
|
77
78
|
`)}function computerUseWindowLayoutCommand(e,t,n=`"$(DISPLAY=:99 xdotool getactivewindow)"`){let r={maximized:{height:`"$usable_height"`,width:`"$usable_width"`,x:`24`,y:`24`},left:{height:`"$usable_height"`,width:`"$left_width"`,x:`24`,y:`24`},right:{height:`"$usable_height"`,width:`"$right_width"`,x:`"$right_x"`,y:`24`}}[t];return[desktopEnvironmentPrefix(e),`dimensions=$(xdpyinfo -display :99 | awk '/dimensions:/{print $2; exit}')`,'screen_width="${dimensions%x*}"','screen_height="${dimensions#*x}"',`usable_width=$((screen_width - 48))`,`usable_height=$((screen_height - 48))`,`left_width=$(((usable_width - 12) / 2))`,`right_x=$((24 + left_width + 12))`,`right_width=$((usable_width - left_width - 12))`,`xdotool windowactivate --sync ${n}`,`xdotool windowmove ${n} ${r.x} ${r.y}`,`xdotool windowsize ${n} ${r.width} ${r.height}`].join(`
|
|
78
|
-
`)}export{computerUseDesktopSizeCommand,computerUseDisplayCommand,computerUseDriverCommand,computerUseDriverRequest,computerUseDriverStartCommand,computerUseFocusCommand,computerUseLaunchCommand,computerUsePaths,computerUseWindowLayoutCommand,recordingPath,screenshotPath};
|
|
79
|
+
`)}export{computerUseDesktopSizeCommand,computerUseDisplayCommand,computerUseDriverCommand,computerUseDriverRequest,computerUseDriverStartCommand,computerUseFocusCommand,computerUseLaunchCommand,computerUsePaths,computerUseReadyCommand,computerUseWindowLayoutCommand,recordingPath,screenshotPath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { COMPUTER_USE_REVALIDATION_KEY, installComputerUse, startComputerUse, } from "./computer-use-sandbox.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse}from"./computer-use-sandbox.js";export{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shellQuote(value: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function shellQuote(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}export{shellQuote};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computerUseDesktopSizeCommand,computerUseDriverCommand,computerUseDriverRequest,computerUseFocusCommand,computerUseLaunchCommand,computerUsePaths,computerUseWindowLayoutCommand,recordingPath,screenshotPath}from"../lib/computer-use.js";import{ensureComputerUse}from"../lib/computer-use-sandbox.js";import{z}from"#compiled/zod/index.js";import{defineTool}from"eve/tools";import{never}from"eve/tools/approval";const coordinate=z.number().int().min(0),screenshotFileName=z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*\.png$/u),recordingFileName=z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*\.mp4$/u),key=z.string().regex(/^[A-Za-z0-9_.-]+$/u),browserUrl=z.string().url().refine(isHttpUrl,{message:`browser URL must use HTTP or HTTPS`}),button=z.enum([`left`,`middle`,`wheel`,`right`,`back`,`forward`]).default(`left`),modifierKeys=z.array(key).min(1).max(4).optional();function typeActionShape(e){return{action:z.literal(`type`),text:z.string().min(1).max(e),typingDelayMs:z.number().int().min(0).max(200).optional(),typingStyle:z.literal(`natural`).optional()}}const typingStyleRefinement=[e=>e.typingDelayMs===void 0||e.typingStyle===void 0,{message:`type action cannot set both typingDelayMs and typingStyle`}],sequenceTypeActionSchema=z.object(typeActionShape(2e3)).refine(...typingStyleRefinement),typeActionSchema=z.object(typeActionShape(1e4)).refine(...typingStyleRefinement),movementStyle=z.enum([`natural`,`precision`]).optional(),pointerDurationMs=z.number().int().min(0).max(2e3).optional().describe(`optional cursor travel duration for recorded demos; use about 600ms`),precisionMovementStyle=z.literal(`precision`).optional(),dragPoint=z.object({x:coordinate.max(1919),y:coordinate.max(1079)}),windowSelectorSchema=z.discriminatedUnion(`app`,[z.object({app:z.literal(`firefox`)}),z.object({app:z.literal(`xterm`),instance:z.enum([`primary`,`secondary`])})]),windowRegionSchema=z.object({x:z.number().min(0).max(1),y:z.number().min(0).max(1),width:z.number().positive().max(1),height:z.number().positive().max(1)}).refine(e=>e.x+e.width<=1&&e.y+e.height<=1,{message:`window region must fit within the desktop`}),arrangeWindowsSchema=z.object({action:z.literal(`arrange_windows`),windows:z.array(z.object({selector:windowSelectorSchema,region:windowRegionSchema})).min(1).max(4),waitForMs:z.number().int().min(0).max(1e4).optional().default(5e3)}),sequenceActionSchema=z.discriminatedUnion(`action`,[z.object({action:z.literal(`click`),x:coordinate.max(1919),y:coordinate.max(1079),button,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`double_click`),x:coordinate.max(1919),y:coordinate.max(1079),button,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`triple_click`),x:coordinate.max(1919),y:coordinate.max(1079),button,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`drag`),path:z.array(dragPoint).min(2).max(100),movementStyle:precisionMovementStyle,durationMs:pointerDurationMs}),z.object({action:z.literal(`keypress`),keys:z.array(key).min(1).max(4)}),z.object({action:z.literal(`move`),x:coordinate.max(1919),y:coordinate.max(1079),durationMs:pointerDurationMs,movementStyle}),sequenceTypeActionSchema,z.object({action:z.literal(`wait`),durationMs:z.number().int().min(100).max(1e4)}),arrangeWindowsSchema,z.object({action:z.literal(`record_start`),path:recordingFileName}),z.object({action:z.literal(`record_stop`)})]),driverResponseSchema=z.object({backend:z.literal(`cua-driver`),screenshot:z.string(),state:z.string(),action:z.unknown().optional(),version:z.literal(`0.12.5`)}).passthrough(),inputSchema=z.union([z.union([z.object({action:z.literal(`set_desktop_size`),size:z.enum([`full_hd`,`large_16_9`,`social_16_9`])}),z.object({action:z.literal(`launch`),app:z.literal(`xterm`),instance:z.enum([`primary`,`secondary`]).optional().default(`primary`)}),z.object({action:z.literal(`focus`),app:z.literal(`firefox`)}),z.object({action:z.literal(`focus`),app:z.literal(`xterm`),instance:z.enum([`primary`,`secondary`]).optional().default(`primary`)}),z.object({action:z.literal(`arrange_pair`),pair:z.enum([`terminal_browser`,`terminal_terminal`]),waitForMs:z.number().int().min(0).max(1e4).optional().default(5e3)}),arrangeWindowsSchema,z.object({action:z.literal(`window_layout`),app:z.literal(`desktop`),layout:z.enum([`maximized`,`left`,`right`])}),z.object({action:z.literal(`launch`),app:z.literal(`firefox`),url:browserUrl.optional()})]),z.discriminatedUnion(`action`,[z.object({action:z.literal(`screenshot`),path:screenshotFileName.optional()}),z.object({action:z.literal(`click`),x:coordinate.max(1919),y:coordinate.max(1079),button,keys:modifierKeys,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`double_click`),x:coordinate.max(1919),y:coordinate.max(1079),button,keys:modifierKeys,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`triple_click`),x:coordinate.max(1919),y:coordinate.max(1079),button,keys:modifierKeys,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`drag`),path:z.array(dragPoint).min(2).max(100),keys:modifierKeys,movementStyle:precisionMovementStyle,durationMs:pointerDurationMs}),z.object({action:z.literal(`keypress`),keys:z.array(key).min(1).max(4)}),z.object({action:z.literal(`move`),x:coordinate.max(1919),y:coordinate.max(1079),keys:modifierKeys,durationMs:pointerDurationMs,movementStyle}),z.object({action:z.literal(`scroll`),x:coordinate.max(1919),y:coordinate.max(1079),scroll_x:z.number().finite().min(-1e4).max(1e4),scroll_y:z.number().finite().min(-1e4).max(1e4),keys:modifierKeys}),typeActionSchema,z.object({action:z.literal(`clipboard_read`),selection:z.enum([`clipboard`,`primary`])}),z.object({action:z.literal(`clipboard_write`),selection:z.enum([`clipboard`,`primary`]),text:z.string().max(1e4)}),z.object({action:z.literal(`wait`),durationMs:z.number().int().min(100).max(1e4).optional().default(2e3)}),z.object({action:z.literal(`record_start`),path:recordingFileName.optional()}),z.object({action:z.literal(`record_stop`)}),z.object({action:z.literal(`sequence`),actions:z.array(sequenceActionSchema).min(1).max(30)})])]);var computer_use_default=defineTool({description:`Pass the selected action inside request, for example {request:{action:"screenshot"}}. Execute an OpenAI computer-use action against the isolated X11 desktop. Use set_desktop_size before launching managed windows to select full_hd (1920x1080), large_16_9 (1600x900), or social_16_9 (1280x720); smaller desktops make fixed-size UI and terminal text occupy more of the recording. Each action runs through Cua Driver and returns a fresh screenshot path plus the foreground application grounding window, pointer position, and bounded accessibility elements with screen coordinates. Actions execute without a human approval prompt. Use those coordinates for the next action. Use launch with app firefox and an optional HTTP(S) URL for the browser. Use launch with app xterm and instance primary or secondary for up to two managed terminals. Use focus to activate an existing app without changing its geometry. Use arrange_pair for common 50/50 terminal/browser or two-terminal layouts. Use arrange_windows for custom one-to-four-window scenes with proportional regions; it resolves every managed selector before moving any window, rejects overlap and unreadable geometry, waits boundedly for newly opened windows, and verifies the applied scene. Use window_layout with app desktop only for a single active window. Do not launch either application through a shell command. The action shape follows the OpenAI computer tool: screenshot, click, double_click, triple_click, drag, keypress, move, scroll, type, clipboard_read, clipboard_write, and wait, plus constrained layout, launch, and recording lifecycle actions. arrange_windows is available inside sequence for a deterministic mid-demo transition after an interaction opens Firefox. Use sequence for a rehearsed recording so up to 30 actions execute in one sandbox round trip with only one final screenshot. Pointer movement remains direct when movementStyle is omitted, preserving faithful exploratory and bug-repro interaction. For polished recordings, explicitly use movementStyle natural for confident curved moves/clicks and precision for drags; precision approaches the drag start naturally, pauses briefly around mouse-down, makes one subtle undershoot and exact correction while held, then pauses before mouse-up. Natural duration is distance-based and deliberately brisk; durationMs can override styled moves, clicks, and drags when exact timing matters. Recording actions return the sandbox path of the MP4 file; recordings stop automatically after five minutes. Requests have a two-minute deadline including queue time. Typing is limited to 10000 characters total per request; paced typing additionally allows at most 1000 graphemes and 30000ms of planned delay across the whole sequence. Omit typingStyle and typingDelayMs for longer text. Paced typing timings retain only the final driver result and grapheme count.`,inputSchema:z.object({request:inputSchema}),approval:never(),async execute({request:e},t){let n=await t.getSandbox();if(`keys`in e&&e.action!==`keypress`&&e.keys?.length)throw Error(`computer-use pointer action modifiers are not supported`);e.action===`sequence`&&validateSequenceBudget(e.actions),await ensureComputerUse(n,t.abortSignal);let r=e.action===`arrange_pair`?arrangePairAction(e.pair,e.waitForMs):e.action===`sequence`?{...e,actions:e.actions.map(e=>e.action===`record_start`?{...e,path:recordingPath(n,e.path)}:e)}:e.action===`record_start`?{...e,path:recordingPath(n,e.path??`recording-${crypto.randomUUID()}.mp4`)}:e.action===`scroll`?{...e,scrollX:e.scroll_x,scrollY:e.scroll_y}:e;if(r.action===`set_desktop_size`||r.action===`launch`||r.action===`focus`||r.action===`window_layout`){let i=await n.run({command:r.action===`set_desktop_size`?computerUseDesktopSizeCommand(n,r.size):r.action===`launch`?computerUseLaunchCommand(n,r):r.action===`focus`?computerUseFocusCommand(n,r.app,r.app===`xterm`?r.instance:void 0):computerUseWindowLayoutCommand(n,r.layout),abortSignal:t.abortSignal});ensureSuccess(e.action,i)}let i=r.action===`screenshot`?screenshotPath(n,r.path):screenshotPath(n),a=r.action===`set_desktop_size`||r.action===`launch`||r.action===`focus`||r.action===`window_layout`?{action:`screenshot`}:r,o=await callComputerUseDriver(n,computerUseDriverRequest(a,i),t.abortSignal);if(o.screenshot!==i)throw Error(`computer-use driver returned an unexpected screenshot path`);let s={action:e.action,backend:o.backend,path:r.action===`screenshot`?i:r.action===`record_start`?r.path:r.action===`sequence`?r.actions.find(e=>e.action===`record_start`)?.path??null:null,screenshot:i,state:o.state,version:o.version};return(e.action===`clipboard_read`||e.action===`clipboard_write`)&&(s.result=o.action),r.action===`sequence`&&(s.timings=o.action),s}});async function callComputerUseDriver(e,t,n){let r=await e.run({command:computerUseDriverCommand(e),env:{COMPUTER_USE_REQUEST:JSON.stringify(t),COMPUTER_USE_SOCKET_PATH:computerUsePaths(e).driverSocket},abortSignal:n});ensureSuccess(t.action.action,r);try{return driverResponseSchema.parse(JSON.parse(r.stdout))}catch(e){throw Error(`computer-use driver returned an invalid response`,{cause:e})}}function arrangePairAction(e,t){return{action:`arrange_windows`,waitForMs:t,windows:[{selector:e===`terminal_browser`?{app:`firefox`}:{app:`xterm`,instance:`primary`},region:{x:0,y:0,width:.5,height:1}},{selector:e===`terminal_browser`?{app:`xterm`,instance:`primary`}:{app:`xterm`,instance:`secondary`},region:{x:.5,y:0,width:.5,height:1}}]}}function validateSequenceBudget(e){let t=e.reduce((e,t)=>e+(t.action===`type`?t.text.length:0),0),n=e.flatMap((e,t)=>e.action===`record_start`?[t]:[]),r=e.flatMap((e,t)=>e.action===`record_stop`?[t]:[]),i=n.length,a=r.length;if(t>1e4)throw Error(`computer-use sequence may type at most 10000 characters`);if(i>1||a>1)throw Error(`computer-use sequence may record at most one take`);if(i===0!=(a===0))throw Error(`computer-use recording sequence requires one start and one stop`);if(i===1&&(n[0]!==0||r[0]!==e.length-1))throw Error(`computer-use recording sequence must start first and stop last`)}function ensureSuccess(e,t){if(t.exitCode!==0)throw Error(`computer ${e} failed (exit ${t.exitCode}): ${t.stderr}`)}function isHttpUrl(e){if(!URL.canParse(e))return!1;let t=new URL(e).protocol;return t===`http:`||t===`https:`}export{computer_use_default as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as computer_use } from "./extension/tools/computer_use.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import computer_use_default from"./extension/tools/computer_use.js";export{computer_use_default as computer_use};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{SessionDynamicToolMetadataKey,SessionIdKey,StepDynamicToolMetadataKey,TurnDynamicToolMetadataKey}from"#context/keys.js";import{toInputSchema,toOutputSchema}from"#tools/schema.js";import{isCurrentDynamicToolMetadata}from"#context/dynamic-tool-metadata.js";import{createToolExecuteWithAuth}from"#execution/tool-auth.js";import{callDurableDynamicCallback,lookupDurableDynamicCallback}from"#tools/durable-callbacks.js";import{hasSchemaValidator}from"#tools/durable-schema.js";const log=createLogger(`dynamic-tools`);function missingCallbackError(e,t){return Error(`Dynamic tool "${e.name}" cannot replay its ${t} callback because it is not registered in this process. The tool was removed or renamed since this call was parked, or its resolver did not run. Restore the tool definition or start a new session.`)}function buildReplayedApproval(e,t){let n=e.callbacks.approvalRequest;if(n===void 0)return;let r=lookupDurableDynamicCallback(t,`approvalRequest`),i=r===void 0?async()=>(log.error(missingCallbackError(e,`approvalRequest`).message),`user-approval`):async e=>await callDurableDynamicCallback(r,n.closure,e),a=e.callbacks.approvalResponse;if(a===void 0)return i;let o=lookupDurableDynamicCallback(t,`approvalResponse`);return{request:i,response:o===void 0?async()=>{let t=missingCallbackError(e,`approvalResponse`);return log.error(t.message),{reason:t.message,status:`rejected`}}:async e=>await callDurableDynamicCallback(o,a.closure,e)}}function replayDynamicTools(e,t){if(e.length>0&&t.sessionId.length===0)throw Error(`Dynamic tool replay requires a session id.`);
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{SessionDynamicToolMetadataKey,SessionIdKey,StepDynamicToolMetadataKey,TurnDynamicToolMetadataKey}from"#context/keys.js";import{toInputSchema,toOutputSchema}from"#tools/schema.js";import{isCurrentDynamicToolMetadata}from"#context/dynamic-tool-metadata.js";import{createToolExecuteWithAuth}from"#execution/tool-auth.js";import{callDurableDynamicCallback,lookupDurableDynamicCallback}from"#tools/durable-callbacks.js";import{hasSchemaValidator}from"#tools/durable-schema.js";const log=createLogger(`dynamic-tools`);function missingCallbackError(e,t){return Error(`Dynamic tool "${e.name}" cannot replay its ${t} callback because it is not registered in this process. The tool was removed or renamed since this call was parked, or its resolver did not run. Restore the tool definition or start a new session.`)}function buildReplayedApproval(e,t){let n=e.callbacks.approvalRequest;if(n===void 0)return;let r=lookupDurableDynamicCallback(t,`approvalRequest`),i=r===void 0?async()=>(log.error(missingCallbackError(e,`approvalRequest`).message),`user-approval`):async e=>await callDurableDynamicCallback(r,n.closure,e),a=e.callbacks.approvalResponse;if(a===void 0)return i;let o=lookupDurableDynamicCallback(t,`approvalResponse`);return{request:i,response:o===void 0?async()=>{let t=missingCallbackError(e,`approvalResponse`);return log.error(t.message),{reason:t.message,status:`rejected`}}:async e=>await callDurableDynamicCallback(o,a.closure,e)}}function replayDynamicTools(e,t){if(e.length>0&&t.sessionId.length===0)throw Error(`Dynamic tool replay requires a session id.`);return e.map(e=>{let n={...e,...t},r=e.callbacks.approvalKey,i=r===void 0?void 0:lookupDurableDynamicCallback(n,`approvalKey`),a=e.callbacks.execute,o=lookupDurableDynamicCallback(n,`execute`),s=bindDynamicCallback(e,n,`labelComplete`,e.callbacks.label?.complete),c=bindDynamicCallback(e,n,`labelDelta`,e.callbacks.label?.delta),l=bindDynamicCallback(e,n,`labelStart`,e.callbacks.label?.start),u=bindDynamicCallback(e,n,`toModelOutput`,e.callbacks.toModelOutput),d={availableInSubagents:e.availableInSubagents,description:e.description,endsTurn:e.endsTurn,execute:createToolExecuteWithAuth({scope:e.name,execute:(t,n)=>{if(o===void 0)throw missingCallbackError(e,`execute`);return callDurableDynamicCallback(o,a.closure,t,n)}}),inputSchema:replayDynamicToolSchema(e,n,`inputSchema`),name:e.name,approval:buildReplayedApproval(e,n),...r===void 0?{}:{approvalKey:t=>{if(i===void 0)throw missingCallbackError(e,`approvalKey`);let n=callDurableDynamicCallback(i,r.closure,t);if(typeof n!=`string`)throw Error(`Dynamic tool "${e.name}" approvalKey callback must return a string.`);return n}},outputSchema:replayDynamicToolSchema(e,n,`outputSchema`)};return(s!==void 0||c!==void 0||l!==void 0)&&(d.label={complete:s,delta:c,start:l}),u!==void 0&&(d.toModelOutput=u),d})}function replayDynamicToolSchema(e,t,n){let r=e[n];if(r===void 0)return;let i=e.callbacks[n];if(i===void 0)return n===`inputSchema`?toInputSchema(r):toOutputSchema(r);let a=lookupDurableDynamicCallback(t,n),o;return{"~standard":{version:1,vendor:`eve`,jsonSchema:{input:()=>structuredClone(r),output:()=>structuredClone(r)},validate:async t=>{if(a===void 0)throw missingCallbackError(e,n);return o??=Promise.resolve(callDurableDynamicCallback(a,i.closure)).then(t=>{if(hasSchemaValidator(t))return t;if(typeof t!=`object`||!t)throw Error(`Dynamic tool "${e.name}" ${n} factory did not return a schema.`);return n===`inputSchema`?toInputSchema(t):toOutputSchema(t)}),(await o)[`~standard`].validate(t)}}}}function bindDynamicCallback(e,t,n,r){if(r===void 0)return;let i=lookupDurableDynamicCallback(t,n);return(...t)=>{if(i===void 0)throw missingCallbackError(e,n);return callDurableDynamicCallback(i,r.closure,...t)}}function requireCurrentDynamicToolMetadata(e){let t=e.find(e=>!isCurrentDynamicToolMetadata(e));if(t!==void 0)throw Error(`Dynamic tool "${t.name}" reached replay before its persisted metadata was converted to the current schema.`);return e}function buildResponseAuthorizationTools(e){let t=new Map;for(let n of e.context===void 0?[]:buildDynamicTools(e.context))t.has(n.name)||t.set(n.name,n);for(let[n,r]of e.authoredTools)t.has(n)||t.set(n,r);return t}function buildDynamicTools(e){let t=replayDynamicTools(requireCurrentDynamicToolMetadata(e.get(StepDynamicToolMetadataKey)??[]),{sessionId:e.get(SessionIdKey)??``,scope:`step`}),n=replayDynamicTools(requireCurrentDynamicToolMetadata(e.get(TurnDynamicToolMetadataKey)??[]),{sessionId:e.get(SessionIdKey)??``,scope:`turn`}),r=replayDynamicTools(requireCurrentDynamicToolMetadata(e.get(SessionDynamicToolMetadataKey)??[]),{sessionId:e.get(SessionIdKey)??``,scope:`session`});return[...t,...n,...r]}export{buildDynamicTools,buildResponseAuthorizationTools,replayDynamicTools};
|
|
@@ -20,3 +20,8 @@ export declare function refreshDynamicSessionSubagentsForRuntimeRevision(input:
|
|
|
20
20
|
}): Promise<void>;
|
|
21
21
|
export declare function buildDynamicSubagentTools(input: ContextReader): readonly HarnessToolDefinition[];
|
|
22
22
|
export declare function getDynamicSubagentSelection(input: ContextReader, nodeId: string): Exclude<DurableDynamicSubagentSelection, null> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The dynamic subagents selected for the current turn, by node id. A turn
|
|
25
|
+
* selection overrides the session's, and `null` withdraws one.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readDynamicSubagentSelections(input: ContextReader): Readonly<Record<string, DurableDynamicSubagentSelection>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{SessionDynamicSubagentRuntimeRevisionKey,SessionDynamicSubagentSelectionsKey,TurnDynamicSubagentSelectionsKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{buildResolveContext}from"#context/dynamic-resolve-context.js";import{createPreparedWorkflowToolHarnessDefinition}from"#execution/tools/workflow/
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{SessionDynamicSubagentRuntimeRevisionKey,SessionDynamicSubagentSelectionsKey,TurnDynamicSubagentSelectionsKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{buildResolveContext}from"#context/dynamic-resolve-context.js";import{createPreparedWorkflowToolHarnessDefinition}from"#execution/tools/workflow/harness-definition.js";import{createPreparedRuntimeSubagentTool}from"#runtime/subagents/registry.js";import{normalizeDynamicSubagentAgentConfig}from"#runtime/subagents/dynamic-agent-config.js";import{normalizeDynamicRemoteAgentConfig}from"#runtime/subagents/dynamic-remote-agent-config.js";const log=createLogger(`dynamic-subagents`),ALLOWED_DYNAMIC_SUBAGENT_EVENTS=new Set([`session.started`,`turn.started`]);async function resolveSelections(e){let t=await Promise.allSettled(e.resolvers.map(async t=>{let n=t.events[e.event.type];if(n===void 0)return[t.nodeId,null];let r=await n(e.event,buildResolveContext(e.ctx,e.messages));if(r==null)return[t.nodeId,null];if(isRemoteAgentDefinition(r)){let e=await normalizeDynamicRemoteAgentConfig({name:t.name,value:r}),n=t.tool===!1?{...e,tool:!1}:e,i=createPreparedRuntimeSubagentTool({description:n.description,kind:`remote`,logicalPath:t.logicalPath,name:t.name,nodeId:t.nodeId,path:n.path,sourceId:t.sourceId,sourceKind:t.sourceKind,tool:n.tool,url:n.url});return[t.nodeId,{kind:`remote`,prepared:i,remoteAgent:n}]}let i=await normalizeDynamicSubagentAgentConfig({name:t.name,state:e.ctx,value:r}),a=t.tool===!1?{...i,tool:!1}:i,o=createPreparedRuntimeSubagentTool({description:a.description,kind:`subagent`,logicalPath:t.logicalPath,name:t.name,nodeId:t.nodeId,sourceId:t.sourceId,sourceKind:t.sourceKind,tool:a.tool});return[t.nodeId,{agentConfig:a,kind:`subagent`,prepared:o}]})),n={};for(let r=0;r<t.length;r+=1){let i=t[r],a=e.resolvers[r];if(i.status===`rejected`){log.error(`Dynamic subagent resolver (${e.event.type}) threw — omitting subagent.`,{error:toErrorMessage(i.reason),subagentName:a.name}),n[a.nodeId]=null;continue}n[i.value[0]]=i.value[1]}return n}function isRemoteAgentDefinition(e){return typeof e==`object`&&!!e&&e.kind===`remote`}async function dispatchDynamicSubagentEvent(e){if(!ALLOWED_DYNAMIC_SUBAGENT_EVENTS.has(e.event.type))return;let t=e.resolvers.filter(t=>t.eventNames.includes(e.event.type)),n=await resolveSelections({...e,resolvers:t});e.event.type===`session.started`?e.ctx.set(SessionDynamicSubagentSelectionsKey,n):e.ctx.set(TurnDynamicSubagentSelectionsKey,n)}async function refreshDynamicSessionSubagentsForRuntimeRevision(e){if(e.ctx.get(SessionDynamicSubagentRuntimeRevisionKey)===e.runtimeRevision)return;let t=e.resolvers.filter(e=>e.eventNames.includes(`session.started`)),n=await resolveSelections({...e,resolvers:t});e.ctx.set(SessionDynamicSubagentSelectionsKey,n),e.ctx.set(SessionDynamicSubagentRuntimeRevisionKey,e.runtimeRevision)}function buildDynamicSubagentTools(e){let t=e.get(SessionDynamicSubagentSelectionsKey)??{},n=e.get(TurnDynamicSubagentSelectionsKey)??{},r={...t,...n},i=[],a=new Set;for(let e of Object.values(r))if(e!==null){if(a.has(e.prepared.name))throw Error(`Found multiple active dynamic subagents named "${e.prepared.name}". Subagent names must be unique at runtime.`);a.add(e.prepared.name),(e.kind===`subagent`?e.agentConfig.tool!==!1:e.remoteAgent.tool!==!1)&&i.push(createPreparedWorkflowToolHarnessDefinition(e.prepared))}return i}function getDynamicSubagentSelection(e,t){return readDynamicSubagentSelections(e)[t]??void 0}function readDynamicSubagentSelections(e){return{...e.get(SessionDynamicSubagentSelectionsKey),...e.get(TurnDynamicSubagentSelectionsKey)}}export{buildDynamicSubagentTools,dispatchDynamicSubagentEvent,getDynamicSubagentSelection,readDynamicSubagentSelections,refreshDynamicSessionSubagentsForRuntimeRevision};
|