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 +0,0 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{resumeSessionInbox}from"#execution/session-inbox/resume.js";import{resumeWorkflowToolRunAnswers}from"#execution/tools/workflow/answer.js";import{formatTaskNotification,formatTaskOutput}from"#tasks/notification.js";import{submitActivity}from"#execution/submit-activity.js";import{workflowToolRunInputRequests}from"#execution/tools/workflow/owner-inbox.js";import{isTaskWorkflowTargetGone}from"#execution/tasks/workflow-target.js";import{isTerminalTaskStatus,taskAuthorizationRequestId}from"#tasks/types.js";const log=createLogger(`execution.tasks.run`);async function notifyTaskParent(e){"use step";let t=taskNotificationCommand(e);try{await resumeSessionInbox(e.token,t)}catch(e){if(!isTaskWorkflowTargetGone(e))throw e;log.warn(`task notification target is gone; the parent session already ended`,{taskDeliveryId:t.taskDeliveryId})}}function taskNotificationCommand(e){if(`view`in e){let{view:t,update:n}=e;if(n!==void 0)return{kind:`send`,payload:{message:`Background task ${t.taskId} (${t.metadata.name}) update: ${formatTaskOutput(n.report.update)}`},taskDeliveryId:`${t.taskId}:update:${t.taskId}:${n.index}:${n.report.from.callId}`};let r={message:formatTaskNotification(t)};return isTerminalTaskStatus(t.status)&&(r.task={views:[t]}),{kind:`send`,payload:r,taskDeliveryId:`${t.taskId}:ready:${t.status}`}}let{taskId:t,request:n}=e,{request:r}=n;if(r.kind===`authorization-request`)return taskAuthorizationCommand(r,t);if(r.kind===`agent-invoke`||r.kind===`agent-settled`){let e={replyTo:n.replyTo,request:r,taskId:t},i=r.kind===`agent-invoke`?r.invocationId:`${r.result.callId}:settled`;return{kind:`send`,payload:{task:{agentRequests:[e]}},taskDeliveryId:`${t}:agent:${n.from.runId}:${i}`}}let i=n.requestCoordinates??n.from;return{kind:`send`,payload:{task:{inputRequests:[{replyTo:n.replyTo,requests:workflowToolRunInputRequests(n),sequence:i.sequence,stepIndex:i.stepIndex,taskId:t,turnId:i.turnId}]}},taskDeliveryId:`${t}:input:${i.turnId}:${i.stepIndex}:${i.sequence}`}}function taskAuthorizationCommand(e,t){let{event:n}=e,r=n.event.data,i={task:{authorizationEvents:[{hookPayload:n,taskId:t}]}};return n.event.type===`authorization.required`&&(i.message=`Background task ${t} needs authorization.`),{kind:`send`,payload:i,taskDeliveryId:`${t}:authorization:${n.event.type}:${r.turnId}:${r.stepIndex}:${r.sequence}:${taskAuthorizationRequestId(n.event)}`}}async function emitTaskActivityStep(e){"use step";let t=projectTaskActivity({activityObserver:e.activityObserver,settledAt:new Date().toISOString(),view:e.view});await submitActivity({events:t,sink:e.activityObserver?.sink})}function projectTaskActivity(e){let t=e.activityObserver?.workIdentity;if(t===void 0)return[];let n=e.view.status;return n===`working`?[{eventId:`${t.id}:started`,kind:`work.started`,startedAt:e.settledAt,work:t}]:n!==`completed`&&n!==`failed`&&n!==`cancelled`?[]:[{eventId:`${t.id}:settled:${n}`,kind:`work.settled`,outcome:n,settledAt:e.settledAt,workId:t.id}]}async function deliverTaskInputResponsesStep(e){"use step";let t=new Set(e.requestIds),n={auth:e.answer.auth,kind:`send`,payload:{inputResponses:e.answer.inputResponses.filter(e=>t.has(e.requestId))},taskDeliveryId:`${e.answer.taskId}:${[...e.requestIds].sort().join(`,`)}`};try{if(e.answer.childResponseUrl!==void 0){let t=await fetch(e.answer.childResponseUrl,{body:JSON.stringify({inputResponses:n.payload.inputResponses}),headers:{"content-type":`application/json`},method:`POST`,redirect:`error`});if(t.status===404)return`unreachable`;if(!t.ok)throw Error(`Remote task input delivery failed with HTTP ${t.status}.`)}else e.answerHook===void 0?await resumeSessionInbox(e.answer.childSessionInbox??e.answer.childContinuationToken,n):await resumeWorkflowToolRunAnswers(e.answer.childContinuationToken,n.payload.inputResponses);return`delivered`}catch(t){if(isTaskWorkflowTargetGone(t))return log.warn(`task input answer target is gone; the child turn already ended`,{taskId:e.answer.taskId}),`unreachable`;throw t}}export{deliverTaskInputResponsesStep,emitTaskActivityStep,notifyTaskParent,projectTaskActivity};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { HarnessSession as RuntimeSession } from "#harness/types.js";
|
|
2
|
-
import type { RuntimeActionResult, RuntimeToolCallActionRequest } from "#shared/action-types.js";
|
|
3
|
-
import { type BackgroundWorkflowToolRun } from "#harness/workflow-tool-runs.js";
|
|
4
|
-
import type { TaskView } from "#tasks/types.js";
|
|
5
|
-
/**
|
|
6
|
-
* Result and lookup helpers shared by the task-control executors
|
|
7
|
-
* (`task_cancel` in the dispatch module,
|
|
8
|
-
* task controls in their own).
|
|
9
|
-
*/
|
|
10
|
-
/** Resolves owned index entries, or the ids this session does not own. */
|
|
11
|
-
export declare function lookupTaskEntries(session: RuntimeSession, taskIds: readonly string[]): {
|
|
12
|
-
readonly entries: BackgroundWorkflowToolRun[];
|
|
13
|
-
readonly kind: "found";
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: "unknown";
|
|
16
|
-
readonly unknown: string[];
|
|
17
|
-
};
|
|
18
|
-
/** One successful task-control result carrying full task views. */
|
|
19
|
-
export declare function createTaskViewsResult(action: RuntimeToolCallActionRequest, views: readonly TaskView[]): RuntimeActionResult;
|
|
20
|
-
/** One task-control error the model can act on. */
|
|
21
|
-
export declare function createTaskControlError(action: RuntimeToolCallActionRequest, message: string): RuntimeActionResult;
|
|
22
|
-
/** The ownership error for ids outside this session's task index. */
|
|
23
|
-
export declare function createUnknownTasksError(action: RuntimeToolCallActionRequest, unknown: readonly string[]): RuntimeActionResult;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getBackgroundTasks}from"#harness/workflow-tool-runs.js";import{taskViewsToJson}from"#tasks/json.js";function lookupTaskEntries(e,t){let n=[],r=[],i=getBackgroundTasks(e.state);for(let e of t){let t=i.get(e)?.run;t===void 0?r.push(e):n.push(t)}return r.length>0?{kind:`unknown`,unknown:r}:{entries:n,kind:`found`}}function createTaskViewsResult(e,t){return{callId:e.callId,kind:`tool-result`,output:taskViewsToJson(t),toolName:e.toolName}}function createTaskControlError(e,t){return{callId:e.callId,isError:!0,kind:`tool-result`,output:{message:t},toolName:e.toolName}}function createUnknownTasksError(e,t){return createTaskControlError(e,`Unknown task ids: ${t.join(`, `)}. Tasks belong to the session that created them.`)}export{createTaskControlError,createTaskViewsResult,createUnknownTasksError,lookupTaskEntries};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { HarnessSession } from "#harness/types.js";
|
|
2
|
-
import type { BackgroundWorkflowToolRun, TaskAgentDispatchContext } from "#harness/workflow-tool-runs.js";
|
|
3
|
-
import type { JsonValue } from "#shared/json.js";
|
|
4
|
-
import type { TaskMetadata } from "#tasks/types.js";
|
|
5
|
-
import type { ContextReader } from "#context/key.js";
|
|
6
|
-
import { type SessionAuth } from "#context/keys.js";
|
|
7
|
-
export declare function createTaskAgentDispatchContext(ctx: ContextReader, auth: SessionAuth): TaskAgentDispatchContext;
|
|
8
|
-
export type BackgroundTaskDraft = Omit<BackgroundWorkflowToolRun, "address"> & {
|
|
9
|
-
readonly address: {
|
|
10
|
-
readonly hookToken: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
/** Derives the replay-stable task identity before its owning run is started. */
|
|
14
|
-
export declare function prepareBackgroundTask(input: {
|
|
15
|
-
readonly callId: string;
|
|
16
|
-
readonly dispatchContext: TaskAgentDispatchContext;
|
|
17
|
-
readonly metadata: TaskMetadata;
|
|
18
|
-
readonly parentSessionId: string;
|
|
19
|
-
readonly parentStepIndex?: number;
|
|
20
|
-
readonly parentTurnId: string;
|
|
21
|
-
readonly session: HarnessSession;
|
|
22
|
-
}): BackgroundTaskDraft;
|
|
23
|
-
/** Releases task events only after the parent session index committed. */
|
|
24
|
-
export declare function acknowledgeDelegatedTasksStep(input: {
|
|
25
|
-
readonly tasks: readonly {
|
|
26
|
-
readonly taskInboxToken: string;
|
|
27
|
-
readonly taskId: string;
|
|
28
|
-
readonly taskRunId: string;
|
|
29
|
-
}[];
|
|
30
|
-
}): Promise<void>;
|
|
31
|
-
/** Silently terminates a task whose child dispatch failed before parent indexing. */
|
|
32
|
-
export declare function rejectDelegatedDispatch(input: {
|
|
33
|
-
readonly error: JsonValue;
|
|
34
|
-
readonly task: BackgroundWorkflowToolRun;
|
|
35
|
-
}): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SessionDynamicSubagentSelectionsKey,TurnDynamicSubagentSelectionsKey}from"#context/keys.js";import{getRun}from"#internal/workflow/runtime.js";import{sendTaskCommand,sendTaskCommandToOwner}from"#execution/tasks/parent/run-parent.js";import{deriveTaskId,deriveTaskInboxToken}from"#tasks/task-id.js";function createTaskAgentDispatchContext(e,t){return{auth:t,sessionDynamicSubagentSelections:e.get(SessionDynamicSubagentSelectionsKey),turnDynamicSubagentSelections:e.get(TurnDynamicSubagentSelectionsKey)}}function prepareBackgroundTask(e){let t=deriveTaskId({callId:e.callId,parentSessionId:e.parentSessionId,parentTurnId:e.parentTurnId});return{callId:e.callId,toolName:e.metadata.name,lifetime:`session`,origin:{turnId:e.parentTurnId,stepIndex:e.parentStepIndex??0},address:{hookToken:deriveTaskInboxToken({parentContinuationToken:e.session.continuationToken,taskId:t})},task:{dispatchContext:e.dispatchContext,metadata:e.metadata,taskId:t}}}async function acknowledgeDelegatedTasksStep(e){"use step";for(let t of e.tasks){if(await sendTaskCommandToOwner({command:{kind:`ready`},taskInboxToken:t.taskInboxToken,retryUnreachable:{attempts:20,delayMs:250}})!==void 0)continue;let e=await getRun(t.taskRunId).status;if(e!==`completed`&&e!==`cancelled`)throw Error(`Task run "${t.taskId}" did not accept its readiness command.`)}}async function rejectDelegatedDispatch(e){await sendTaskCommand({command:{data:e.error,kind:`reject-dispatch`},taskInboxToken:e.task.address.hookToken,retryUnreachable:{attempts:20,delayMs:250}})}export{acknowledgeDelegatedTasksStep,createTaskAgentDispatchContext,prepareBackgroundTask,rejectDelegatedDispatch};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { HarnessSession as RuntimeSession } from "#harness/types.js";
|
|
2
|
-
import { type BackgroundWorkflowToolRun } from "#harness/workflow-tool-runs.js";
|
|
3
|
-
import { type TaskExecutorCancel } from "#execution/tasks/parent/task-cancel.js";
|
|
4
|
-
import type { RuntimeActionResult, RuntimeToolCallActionRequest } from "#shared/action-types.js";
|
|
5
|
-
import { type TaskView } from "#tasks/types.js";
|
|
6
|
-
export declare function isTaskControlAction(action: RuntimeToolCallActionRequest): boolean;
|
|
7
|
-
export declare function executeTaskControlAction(input: {
|
|
8
|
-
readonly action: RuntimeToolCallActionRequest;
|
|
9
|
-
readonly cancelOwnedWork?: TaskExecutorCancel;
|
|
10
|
-
readonly serializedContext?: Record<string, unknown>;
|
|
11
|
-
readonly session: RuntimeSession;
|
|
12
|
-
}): Promise<{
|
|
13
|
-
readonly result: RuntimeActionResult;
|
|
14
|
-
readonly session: RuntimeSession;
|
|
15
|
-
}>;
|
|
16
|
-
/** Cancels task-owned work; the caller records the outcome in the parent session. */
|
|
17
|
-
export declare function cancelOwnedTask(input: {
|
|
18
|
-
readonly cancelOwnedWork?: TaskExecutorCancel;
|
|
19
|
-
readonly entry: BackgroundWorkflowToolRun;
|
|
20
|
-
readonly serializedContext?: Record<string, unknown>;
|
|
21
|
-
readonly session?: RuntimeSession;
|
|
22
|
-
}): Promise<TaskView>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sessionCommandHookToken}from"#execution/session-inbox/address.js";import{readWorkflowTaskView,recordWorkflowTaskView}from"#harness/workflow-tool-runs.js";import{sendTaskCommand}from"#execution/tasks/parent/run-parent.js";import"#tasks/types.js";import{createTaskControlError,createTaskViewsResult,createUnknownTasksError,lookupTaskEntries}from"#execution/tasks/parent/control-shared.js";import{notifyTaskParent}from"#execution/tasks/child/notify.js";import{cancelTaskOwnedWork}from"#execution/tasks/parent/task-cancel.js";import{TASK_CANCEL_TOOL_NAME,TASK_TOOL_NAMES}from"#tools/framework/task-contract.js";function isTaskControlAction(e){return e.kind===`tool-call`&&TASK_TOOL_NAMES.has(e.toolName)}async function executeTaskControlAction(e){let{action:t}=e,n=e.session,r=readTaskIds(t.input);if(r===void 0||r.length===0)return{result:createTaskControlError(t,"Provide a non-empty `taskIds` array."),session:n};let i=lookupTaskEntries(n,r);if(i.kind===`unknown`)return{result:createUnknownTasksError(t,i.unknown),session:n};if(t.toolName!==TASK_CANCEL_TOOL_NAME)return{result:createTaskControlError(t,`Unsupported task control "${t.toolName}".`),session:n};let a=[];for(let t of i.entries){let r=await cancelOwnedTask({cancelOwnedWork:e.cancelOwnedWork,entry:t,serializedContext:e.serializedContext,session:n});n={...n,state:recordWorkflowTaskView(n.state,r).state},a.push(r)}return{result:createTaskViewsResult(t,a),session:n}}async function cancelOwnedTask(e){let t=readWorkflowTaskView(e.entry.task);if(t!==void 0&&t.status!==`cancelled`)return t;let n=t??{metadata:e.entry.task.metadata,status:`cancelled`,taskId:e.entry.task.taskId};return await sendTaskCommand({command:{kind:`cancel`},taskInboxToken:e.entry.address.hookToken}),await cancelTaskOwnedWork({cancelOwnedWork:e.cancelOwnedWork,entry:e.entry,serializedContext:e.serializedContext,session:e.session}),e.session!==void 0&&await notifyTaskParent({token:sessionCommandHookToken(e.session.sessionId),view:n}),n}function readTaskIds(e){let t=e.taskIds;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&e.trim()!==``)}export{cancelOwnedTask,executeTaskControlAction,isTaskControlAction};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SubagentCompletedStreamEvent } from "#protocol/message.js";
|
|
2
|
-
import { type DurableSessionState } from "#execution/durable-session-store.js";
|
|
3
|
-
import type { TaskInputRequestDelivery, TaskView } from "#tasks/types.js";
|
|
4
|
-
/** Validates and records a generic task-owned workflow request. */
|
|
5
|
-
export declare function recordTaskInputRequestStep(input: {
|
|
6
|
-
readonly request: TaskInputRequestDelivery;
|
|
7
|
-
readonly sessionState: DurableSessionState;
|
|
8
|
-
}): Promise<{
|
|
9
|
-
readonly accepted: false;
|
|
10
|
-
readonly sessionState: DurableSessionState;
|
|
11
|
-
} | {
|
|
12
|
-
readonly accepted: true;
|
|
13
|
-
readonly request: TaskInputRequestDelivery;
|
|
14
|
-
readonly sessionState: DurableSessionState;
|
|
15
|
-
}>;
|
|
16
|
-
/** Records child outcomes in the parent; its first terminal decision wins. */
|
|
17
|
-
export declare function recordTerminalTaskViewsStep(input: {
|
|
18
|
-
readonly serializedContext: Record<string, unknown>;
|
|
19
|
-
readonly sessionState: DurableSessionState;
|
|
20
|
-
readonly views: readonly TaskView[];
|
|
21
|
-
}): Promise<{
|
|
22
|
-
readonly serializedContext: Record<string, unknown>;
|
|
23
|
-
readonly sessionState: DurableSessionState;
|
|
24
|
-
/** Newly recorded terminal outcomes eligible for model notification. */
|
|
25
|
-
readonly views: readonly TaskView[];
|
|
26
|
-
readonly subagentCompletions: readonly SubagentCompletedStreamEvent[];
|
|
27
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createEveTaskInputRoutePath}from"#protocol/routes.js";import{createLogger}from"#internal/logging.js";import{isInputRequest}from"#shared/input.js";import{contextStorage}from"#context/container.js";import{ActivityObserverKey}from"#context/keys.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{readDurableSession,replaceDurableSessionSnapshot}from"#execution/durable-session-store.js";import{getBackgroundTasks,recordWorkflowTaskView}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{clearProxyInputRequestsForTask,createTaskInputRequestId,upsertProxyInputRequestState}from"#harness/proxy-input-requests.js";import{bindSessionInstrumentation}from"#instrumentation/runtime.js";import{createRemoteTaskInputCallbackUrl}from"#execution/workflow-callback-url.js";import{submitActivity}from"#execution/submit-activity.js";import{applyTaskAgentHandleCommand}from"#subagents/handles/transitions.js";import{createTaskInputCapabilityToken}from"#execution/task-input-capability.js";import{projectTaskActivity}from"#execution/tasks/child/notify.js";const log=createLogger(`execution.tasks.parent`);async function recordTaskInputRequestStep(e){"use step";let t=readDurableSession(e.sessionState),n=getBackgroundTasks(t.state).get(e.request.taskId),r=e.request.requests??[e.request.request];if(n?.status!==`working`||r.length===0||!r.every(isInputRequest))return{accepted:!1,sessionState:e.sessionState};let i=r.map(t=>({...t,requestId:createTaskInputRequestId(e.request.taskId,t.requestId)})),a=getAgentHandleStore(t.state)?.handles.find(t=>t.phase===`claimed`&&t.ownerId===e.request.taskId),o=a?.phase===`claimed`&&a.address.kind===`agent/remote`?createRemoteTaskInputCallbackUrl(a.address.url,createEveTaskInputRoutePath(createTaskInputCapabilityToken(e.request.replyTo))):void 0,s=r.map((t,n)=>{let r=i[n],a={childContinuationToken:e.request.replyTo,childRequestId:t.requestId,kind:t.kind,taskId:e.request.taskId};return t.kind===`question`&&(a.question={...t.allowFreeform!==void 0&&{allowFreeform:t.allowFreeform},...t.options!==void 0&&{options:[...t.options]}}),o!==void 0&&(a.childResponseUrl=o),[r.requestId,a]}),c=upsertProxyInputRequestState({entries:s,forChildContinuationToken:e.request.replyTo,state:t.state});return{accepted:!0,request:e.request.requests===void 0?{...e.request,request:i[0]}:{...e.request,request:void 0,requests:i},sessionState:replaceDurableSessionSnapshot({session:{...t,state:c},state:e.sessionState})}}async function recordTerminalTaskViewsStep(e){"use step";let t=readDurableSession(e.sessionState),n=t,r=[],i=[],a=[];for(let t of e.views){let e=getBackgroundTasks(n.state).get(t.taskId)?.run;if(e===void 0)continue;let o=recordWorkflowTaskView(n.state,t);n={...n,state:o.state},o.firstOutcome&&o.view.metadata.kind===`subagent`&&o.view.status===`completed`&&a.push({type:`subagent.completed`,data:{callId:e.callId,subagentName:e.toolName,output:typeof o.view.lastOutput.data==`string`?o.view.lastOutput.data:JSON.stringify(o.view.lastOutput.data)}}),r.push(o.view),o.firstOutcome&&i.push(o.view),n=clearProxyInputRequestsForTask(n,t.taskId),n=applyTaskAgentHandleCommand(n,{kind:`release-owner`,ownerId:t.taskId}).session}return{serializedContext:await settleBackgroundTaskActions({serializedContext:e.serializedContext,session:n,views:r}),sessionState:n===t?e.sessionState:replaceDurableSessionSnapshot({session:n,state:e.sessionState}),views:i,subagentCompletions:a}}async function settleBackgroundTaskActions(e){if(e.views.length===0)return e.serializedContext;try{let t=await deserializeContext(e.serializedContext),n=t.get(ActivityObserverKey),r=new Date().toISOString(),i=getBackgroundTasks(e.session.state),a=e.views.flatMap(e=>{let t=i.get(e.taskId)?.run;return projectTaskActivity({activityObserver:n===void 0?void 0:{sink:n.sink,workIdentity:t?.task.activityWorkIdentity},settledAt:r,view:e})});await submitActivity({events:a,sink:n?.sink});let o=t.get(BundleKey);if(o===void 0)return e.serializedContext;let s=bindSessionInstrumentation({agentName:o.turnAgent.id,ctx:t,rootSessionId:e.session.rootSessionId??e.session.sessionId,sessionId:e.session.sessionId});if(s===void 0)return e.serializedContext;try{await contextStorage.run(t,()=>s.publishBackgroundTaskSettlements({acceptedAtMs:Date.now(),views:e.views}))}finally{await s.flush()}return serializeContext(t)}catch(t){return log.warn(`failed to settle background task instrumentation`,{error:t,sessionId:e.session.sessionId,taskIds:e.views.map(e=>e.taskId)}),e.serializedContext}}export{recordTaskInputRequestStep,recordTerminalTaskViewsStep};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { BackgroundWorkflowToolRunInput } from "#execution/tools/workflow/types.js";
|
|
2
|
-
import { type TaskCommand, type TaskRunInboundPayload } from "#tasks/types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Node-side admission and cancellation for session-owned workflow invocations.
|
|
5
|
-
*
|
|
6
|
-
* Every export must be called from inside a `"use step"` body; none of
|
|
7
|
-
* these are steps themselves so dispatch and tool steps can compose them
|
|
8
|
-
* inside one durable boundary.
|
|
9
|
-
*/
|
|
10
|
-
/** Starts a session-owned invocation through the common workflow entry. */
|
|
11
|
-
export declare function startTaskRun(input: BackgroundWorkflowToolRunInput): Promise<void>;
|
|
12
|
-
/** Resolves the task run that won ownership of one replay-stable command token. */
|
|
13
|
-
export declare function waitForTaskCommandOwner(input: {
|
|
14
|
-
readonly taskInboxToken: string;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
readonly runId: string;
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Submits one command to a task run.
|
|
20
|
-
*
|
|
21
|
-
* `unreachable` means the hook is not resumable — either the run
|
|
22
|
-
* already finished and disposed it (the task is terminal; read the
|
|
23
|
-
* final view) or, right after creation, the freshly started run has
|
|
24
|
-
* not registered it yet. Senders racing that startup window pass
|
|
25
|
-
* `retryUnreachable`; senders addressing an established task treat
|
|
26
|
-
* `unreachable` as the terminal signal.
|
|
27
|
-
*/
|
|
28
|
-
export declare function sendTaskCommand(input: {
|
|
29
|
-
readonly command: TaskCommand;
|
|
30
|
-
readonly taskInboxToken: string;
|
|
31
|
-
readonly retryUnreachable?: {
|
|
32
|
-
readonly attempts: number;
|
|
33
|
-
readonly delayMs: number;
|
|
34
|
-
};
|
|
35
|
-
}): Promise<"delivered" | "unreachable">;
|
|
36
|
-
/** Delivers one command and returns the accepting task workflow's run id. */
|
|
37
|
-
export declare function sendTaskCommandToOwner(input: {
|
|
38
|
-
readonly command: TaskCommand;
|
|
39
|
-
readonly taskInboxToken: string;
|
|
40
|
-
readonly retryUnreachable?: {
|
|
41
|
-
readonly attempts: number;
|
|
42
|
-
readonly delayMs: number;
|
|
43
|
-
};
|
|
44
|
-
}): Promise<{
|
|
45
|
-
readonly runId: string;
|
|
46
|
-
} | undefined>;
|
|
47
|
-
/**
|
|
48
|
-
* Hands one non-command inbound payload to a task run.
|
|
49
|
-
*
|
|
50
|
-
* Used for payloads the run must act on before it may record them —
|
|
51
|
-
* today only answered input batches, which it forwards to the child
|
|
52
|
-
* first. `unreachable` means the task already finished and disposed its
|
|
53
|
-
* hook, so the payload is stale by definition.
|
|
54
|
-
*/
|
|
55
|
-
export declare function sendTaskInboundPayload(input: {
|
|
56
|
-
readonly taskInboxToken: string;
|
|
57
|
-
readonly payload: TaskRunInboundPayload;
|
|
58
|
-
}): Promise<"delivered" | "unreachable">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{startWorkflowOnCurrentDeployment,waitForCommandHookOwner,workflowToolRunWorkflowReference}from"#execution/workflow-runtime.js";import{resumeHook}from"#internal/workflow/runtime.js";import{isTaskWorkflowTargetGone}from"#execution/tasks/workflow-target.js";import"#tasks/types.js";async function startTaskRun(e){await startWorkflowOnCurrentDeployment(workflowToolRunWorkflowReference,[e])}async function waitForTaskCommandOwner(e){return await waitForCommandHookOwner(e.taskInboxToken)}async function sendTaskCommand(e){return await sendTaskCommandToOwner(e)===void 0?`unreachable`:`delivered`}async function sendTaskCommandToOwner(e){let t={command:e.command,kind:`task-command`},n=Math.max(1,e.retryUnreachable?.attempts??1);for(let r=0;;r+=1)try{let n=await resumeHook(e.taskInboxToken,t);if(typeof n!=`object`||!n||!(`runId`in n)||typeof n.runId!=`string`)throw Error(`Task inbox hook "${e.taskInboxToken}" returned no owner run id.`);return{runId:n.runId}}catch(t){if(!isTaskWorkflowTargetGone(t))throw t;if(r+1>=n)return;await new Promise(t=>setTimeout(t,e.retryUnreachable?.delayMs??250))}}async function sendTaskInboundPayload(e){try{return await resumeHook(e.taskInboxToken,e.payload),`delivered`}catch(e){if(!isTaskWorkflowTargetGone(e))throw e;return`unreachable`}}export{sendTaskCommand,sendTaskCommandToOwner,sendTaskInboundPayload,startTaskRun,waitForTaskCommandOwner};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { loadContext } from "#context/container.js";
|
|
2
|
-
import { createSubagentReceiptIdentity } from "#execution/tools/subagent/receipt-identity.js";
|
|
3
|
-
import type { JsonObject } from "#shared/json.js";
|
|
4
|
-
export interface SubagentTaskProjection {
|
|
5
|
-
readonly identity?: ReturnType<typeof createSubagentReceiptIdentity>;
|
|
6
|
-
readonly metadata: {
|
|
7
|
-
readonly agentId: string;
|
|
8
|
-
readonly kind: "subagent";
|
|
9
|
-
readonly mode: "local" | "remote";
|
|
10
|
-
readonly name: string;
|
|
11
|
-
};
|
|
12
|
-
readonly receipt: {
|
|
13
|
-
readonly agentId: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export declare function projectSubagentTask(input: {
|
|
17
|
-
readonly ctx: ReturnType<typeof loadContext>;
|
|
18
|
-
readonly input: JsonObject;
|
|
19
|
-
readonly name: string;
|
|
20
|
-
readonly nodeId: string;
|
|
21
|
-
readonly taskInput: {
|
|
22
|
-
readonly callId: string;
|
|
23
|
-
readonly parentSessionId: string;
|
|
24
|
-
readonly parentTurnId: string;
|
|
25
|
-
};
|
|
26
|
-
}): SubagentTaskProjection;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";import{createSubagentReceiptIdentity}from"#execution/tools/subagent/receipt-identity.js";function projectSubagentTask(e){let t=e.input.agentId;if(typeof t==`string`&&t.trim()!==``)return{metadata:{agentId:t,kind:`subagent`,mode:readSubagentTaskMode(e.ctx,e.nodeId),name:e.name},receipt:{agentId:t}};let n=createSubagentReceiptIdentity({callId:e.taskInput.callId,nodeId:e.nodeId,parentSessionId:e.taskInput.parentSessionId,parentTurnId:e.taskInput.parentTurnId,subagentName:e.name});return{identity:n,metadata:{agentId:n.identity.id,kind:`subagent`,mode:readSubagentTaskMode(e.ctx,e.nodeId),name:e.name},receipt:{agentId:n.identity.id}}}function readSubagentTaskMode(e,t){let n=getDynamicSubagentSelection(e,t);return n===void 0?(e.get(BundleKey)?.subagentRegistry.subagentsByNodeId.get(t))?.definition.kind===`remote`?`remote`:`local`:n.kind===`remote`?`remote`:`local`}export{projectSubagentTask};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { HarnessSession } from "#harness/types.js";
|
|
2
|
-
import type { BackgroundWorkflowToolRun } from "#harness/workflow-tool-runs.js";
|
|
3
|
-
export interface TaskExecutorCancelContext {
|
|
4
|
-
readonly entry: BackgroundWorkflowToolRun;
|
|
5
|
-
readonly serializedContext?: Record<string, unknown>;
|
|
6
|
-
readonly session?: Pick<HarnessSession, "state">;
|
|
7
|
-
}
|
|
8
|
-
export type TaskExecutorCancel = (input: TaskExecutorCancelContext) => Promise<void>;
|
|
9
|
-
/** Cancels task-owned work and waits for the invocation cleanup boundary. */
|
|
10
|
-
export declare function cancelTaskOwnedWork(input: TaskExecutorCancelContext & {
|
|
11
|
-
readonly cancelOwnedWork?: TaskExecutorCancel;
|
|
12
|
-
}): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{settleWorkflowToolRunCancellation}from"#execution/tools/workflow/cancel.js";async function cancelTaskOwnedWork(e){await e.cancelOwnedWork?.(e),await settleWorkflowToolRunCancellation(e.entry.address.runId,`Task ${e.entry.task.taskId} was cancelled.`)}export{cancelTaskOwnedWork};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ContextContainer } from "#context/container.js";
|
|
2
|
-
import type { FrameworkContextProvider } from "#context/provider.js";
|
|
3
|
-
import type { HarnessSession, StepResult } from "#harness/types.js";
|
|
4
|
-
import { type BackgroundToolExecutor } from "#harness/background-tools.js";
|
|
5
|
-
interface BackgroundToolStepResult {
|
|
6
|
-
readonly backgroundTaskSession: HarnessSession;
|
|
7
|
-
readonly backgroundTasks: NonNullable<StepResult["backgroundTasks"]>;
|
|
8
|
-
}
|
|
9
|
-
export declare function runBackgroundStep(ctx: ContextContainer, session: HarnessSession, callback: (session: HarnessSession) => Promise<StepResult>): Promise<StepResult>;
|
|
10
|
-
/**
|
|
11
|
-
* Makes background tool work transactional with the harness step.
|
|
12
|
-
*
|
|
13
|
-
* Concretely: when the model calls a background tool,
|
|
14
|
-
* the tool does real external work mid-step — it creates a task run and
|
|
15
|
-
* delivers commands to its inbox — while the step itself can still fail. This
|
|
16
|
-
* provider scopes that work to the step so it either lands with the step or
|
|
17
|
-
* is compensated with it.
|
|
18
|
-
*
|
|
19
|
-
* Lifetime: one {@link BackgroundToolExecutionScope} per step. `create` runs
|
|
20
|
-
* before the authored callback; exactly one of `commit` or `rollback` settles
|
|
21
|
-
* the scope afterwards; `decorateStepResult` runs last, only after a
|
|
22
|
-
* successful commit. Nothing survives the step except retained tasks (below).
|
|
23
|
-
*
|
|
24
|
-
* - `commit` — step succeeded. Compensates executions that never settled
|
|
25
|
-
* (the tool neither delegated nor completed its task), then records the
|
|
26
|
-
* task entries onto the session being persisted.
|
|
27
|
-
* - `rollback` — step failed. Compensates incomplete executions, and settled
|
|
28
|
-
* ones too — unless the cause is turn cancellation: those tasks are already
|
|
29
|
-
* running, so they are retained for {@link readRetainedBackgroundToolResult}
|
|
30
|
-
* instead of killed.
|
|
31
|
-
* - `decorateStepResult` — attaches `backgroundTasks` and
|
|
32
|
-
* `backgroundTaskSession` to the {@link StepResult} so the turn loop keeps
|
|
33
|
-
* tracking the spawned tasks after the step returns.
|
|
34
|
-
*/
|
|
35
|
-
export declare const backgroundToolExecutionProvider: FrameworkContextProvider<BackgroundToolExecutor>;
|
|
36
|
-
/**
|
|
37
|
-
* Returns what a successful commit would have produced (session with task
|
|
38
|
-
* entries and executor session writes applied) when turn cancellation raced
|
|
39
|
-
* a successfully delegated task. `rollback` deliberately does not compensate
|
|
40
|
-
* settled records on cancellation — that would kill already-running tasks —
|
|
41
|
-
* so the cancellation epilogue reads this instead to keep those tasks tracked
|
|
42
|
-
* in durable state rather than orphaned. `undefined` when nothing was retained.
|
|
43
|
-
*/
|
|
44
|
-
export declare function readRetainedBackgroundToolResult(ctx: ContextContainer): BackgroundToolStepResult | undefined;
|
|
45
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sessionCommandHookToken}from"#execution/session-inbox/address.js";import{loadContext}from"#context/container.js";import{ActivityObserverKey,CapabilitiesKey}from"#context/keys.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{parseWorkflowToolInput}from"#execution/tools/workflow/background.js";import{getHarnessEmissionState}from"#harness/emission.js";import{deriveAgentOperationId}from"#subagents/handles/operation-id.js";import{getBackgroundTasks,registerWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore,writeHandles}from"#subagents/handles/store.js";import{runStep}from"#context/run-step.js";import{activeTurnId}from"#harness/active-turn-id.js";import{resolveWorkflowAgentMetadata}from"#execution/tools/subagent/metadata.js";import{AGENT_BUSY,AGENT_MISMATCH,AGENT_UNREACHABLE,formatAgentBusyMessage}from"#subagents/agent-handle-errors.js";import{startTaskRun,waitForTaskCommandOwner}from"#execution/tasks/parent/run-parent.js";import{isTurnCancellation}from"#harness/turn-cancellation.js";import{createTaskAgentDispatchContext,prepareBackgroundTask,rejectDelegatedDispatch}from"#execution/tasks/parent/delegate.js";import{applyTaskAgentHandleCommand}from"#subagents/handles/transitions.js";import{BackgroundToolExecutorKey}from"#harness/background-tools.js";import{deriveBackgroundTaskActivityObserver}from"#execution/activity-work.js";import{projectToolStartLabel}from"#harness/action-presentation.js";import{projectSubagentTask}from"#execution/tasks/parent/subagent-task-projection.js";import{steerBackgroundAgent}from"#execution/tools/subagent/steer.js";function runBackgroundStep(e,t,n){return runStep(e,t,n,[backgroundToolExecutionProvider])}const backgroundToolExecutionProvider={key:BackgroundToolExecutorKey,create(e,t){return{value:new BackgroundToolExecutionScope(t)}},async commit(e,t){return await requireExecutionScope(e).commit(t)},async rollback(e,t){await requireExecutionScope(e).rollback(t)},decorateStepResult(e,t){return requireExecutionScope(e).decorate(t)}};function readRetainedBackgroundToolResult(e){let t=e.get(BackgroundToolExecutorKey);return t instanceof BackgroundToolExecutionScope?t.retainedResult():void 0}var BackgroundToolExecutionScope=class{executions=new Map;records=[];agentHandleSession;agentHandlesChanged=!1;retained=!1;initialSession;constructor(e){this.initialSession=e,this.agentHandleSession=e}execute(e){let t=this.executions.get(e.options.toolCallId);if(t!==void 0)return t;if(!e.batch.calls.some(t=>t.callId===e.options.toolCallId))throw Error(`Background tool call "${e.options.toolCallId}" was not registered before execution.`);let n=this.start(e);return this.executions.set(e.options.toolCallId,n),n}async readAgentViews(){return(getAgentHandleStore(this.agentHandleSession.state)?.handles??[]).flatMap(e=>e.phase===`reserved`?[]:e.phase===`available`?[{availability:`available`,id:e.identity.id,name:e.identity.name}]:e.phase===`claimed`?[{availability:`busy`,id:e.identity.id,name:e.identity.name,taskId:e.ownerId,taskStatus:`working`}]:[])}hasPendingTasks(){return getBackgroundTasks(this.initialSession.state).query({state:`working`}).length>0||this.records.some(e=>e.settled&&e.task!==void 0)}async commit(e){let t=this.records.filter(e=>!e.settled);return t.length>0&&await this.compensate(t,Error(`Background tool execution did not delegate or complete its task.`)),this.apply(e)}decorate(e){let t=this.resultFields();return t===void 0?e:{...e,...t}}async rollback(e){let t=this.records.filter(e=>e.settled),n=this.records.filter(e=>!e.settled);if(n.length>0&&await this.compensate(n,e),t.length===0){this.retained=this.agentHandlesChanged&&isTurnCancellation(e);return}if(isTurnCancellation(e)){this.retained=!0;return}await this.compensate(t,e)}retainedResult(){return this.retained?this.resultFields():void 0}apply(e){let t=e;for(let e of this.records)e.settled&&e.task!==void 0&&(t=registerWorkflowToolRun(t,e.task));return this.agentHandlesChanged&&(t=writeHandles(t,getAgentHandleStore(this.agentHandleSession.state)?.handles??[])),t}resultFields(){let e=this.records.flatMap(e=>e.settled&&e.task!==void 0?[{callId:e.callId,taskInboxToken:e.task.address.hookToken,taskId:e.task.task.taskId,taskRunId:e.task.address.runId}]:[]);if(e.length!==0||this.agentHandlesChanged)return{backgroundTaskSession:this.apply(this.initialSession),backgroundTasks:e}}async start(e){let t={callId:e.options.toolCallId,settled:!1};this.records.push(t);let n=getHarnessEmissionState(this.initialSession.state),r=loadContext(),i=await this.startTask({ctx:r,emission:n,input:e,record:t});if(i.kind===`steered`)return t.settled=!0,i.receipt;let a=i.task;return t.task=a,t.settled=!0,{...i.receipt,status:`working`,taskId:a.task.taskId}}async startTask(e){let t=e.input.definition,n=parseWorkflowToolInput(e.input.toolInput,e.input.definition.name),r=activeTurnId(e.emission),i=t.nodeId===void 0?void 0:projectSubagentTask({ctx:e.ctx,input:n,name:e.input.definition.name,nodeId:t.nodeId??e.input.definition.name,taskInput:{callId:e.input.options.toolCallId,parentSessionId:this.initialSession.sessionId,parentTurnId:r}});if(i!==void 0&&i.identity===void 0&&!hasAgentHandle(this.agentHandleSession,i.metadata.agentId)){let{agentId:a,...o}=n;n=o,i=projectSubagentTask({ctx:e.ctx,input:o,name:e.input.definition.name,nodeId:t.nodeId??e.input.definition.name,taskInput:{callId:e.input.options.toolCallId,parentSessionId:this.initialSession.sessionId,parentTurnId:r}})}let a=i?.metadata??{kind:`tool`,name:e.input.definition.name},o=projectToolStartLabel(e.input.definition,e.input.toolInput),s=buildCallbackContext().session,c={activityObserver:deriveBackgroundTaskActivityObserver({activityObserver:e.ctx.get(ActivityObserverKey),callId:e.input.options.toolCallId,label:o,name:a.name,parentSessionId:this.initialSession.sessionId,parentTurnId:r,rootSessionId:this.initialSession.rootSessionId??this.initialSession.sessionId}),callId:e.input.options.toolCallId,dispatchContext:createTaskAgentDispatchContext(e.ctx,s.auth),metadata:a,parentSessionId:this.initialSession.sessionId,parentStepIndex:e.emission.stepIndex,parentTurnId:r,session:this.initialSession},l=prepareBackgroundTask(c),u={...l,task:{...l.task,activityWorkIdentity:c.activityObserver?.workIdentity}};if(t.nodeId!==void 0&&i!==void 0&&i.identity!==void 0){let t=i.identity;if(this.applyAgentHandleCommand({identity:t.identity,callId:c.callId,kind:`reserve`,operationId:t.operation.id,ownerId:u.task.taskId}).kind!==`ready`)throw Error(`Agent handle store rejected start operation "${t.operation.id}".`);e.record.reservation={agentId:t.identity.id,operationId:t.operation.id}}if(t.nodeId!==void 0&&i!==void 0&&i.identity===void 0){let t=deriveAgentOperationId({callId:c.callId,parentSessionId:c.parentSessionId,parentTurnId:r}),a=this.applyAgentHandleCommand({agentId:i.metadata.agentId,callId:c.callId,expectedTarget:i.metadata.mode,invokedName:i.metadata.name,kind:`claim`,operationId:t,ownerId:u.task.taskId});if(a.kind===`busy`&&a.handle.phase===`claimed`){let t=a.handle,r=getBackgroundTasks(this.agentHandleSession.state).get(t.ownerId);if(r?.metadata.kind===`subagent`&&r.metadata.agentId===t.identity.id&&r.metadata.name===t.identity.name&&r.status===`working`)return await steerBackgroundAgent({ctx:e.ctx,handle:t,callId:c.callId,input:n,session:this.agentHandleSession}),{kind:`steered`,receipt:{agentId:t.identity.id,taskId:r.taskId,status:`working`}}}readClaimedHandle(a)?e.record.claim={operationId:t,taskId:u.task.taskId}:throwAgentClaimError(i.metadata.agentId,a)}await startTaskRun({activityObserver:c.activityObserver,initialView:{metadata:u.task.metadata,status:`working`,taskId:u.task.taskId},parentContinuationToken:sessionCommandHookToken(this.initialSession.sessionId),taskInboxToken:u.address.hookToken,workflow:{agents:resolveWorkflowAgentMetadata(e.ctx),callId:c.callId,canRequestInput:e.ctx.get(CapabilitiesKey)?.requestInput===!0,executeInput:t.executeInput?.(n),input:n,session:s,stepIndex:e.emission.stepIndex,toolName:e.input.definition.name,workflowId:t.workflowId}});let d=await waitForTaskCommandOwner({taskInboxToken:u.address.hookToken}),f={...u,address:{...u.address,runId:d.runId}};return e.record.task=f,t.nodeId===void 0||i===void 0?{kind:`started`,task:f}:{kind:`started`,receipt:i.receipt,task:f}}applyAgentHandleCommand(e){let t=applyTaskAgentHandleCommand(this.agentHandleSession,e);return t.session!==this.agentHandleSession&&(this.agentHandleSession=t.session,this.agentHandlesChanged=!0),t.result}async compensate(e,t){let n=[];for(let r of e.toReversed()){if(r.task!==void 0)try{await rejectDelegatedDispatch({error:{code:`PARENT_STEP_FAILED`,message:t instanceof Error?t.message:String(t)},task:r.task})}catch(e){n.push(e)}r.claim!==void 0&&this.applyAgentHandleCommand({kind:`release-owner`,ownerId:r.claim.taskId}),r.reservation!==void 0&&r.task!==void 0&&this.applyAgentHandleCommand({agentId:r.reservation.agentId,kind:`remove`,ownerId:r.task.task.taskId})}if(n.length>0)throw AggregateError([t,...n],`Background tool execution failed and its tasks could not all be rejected.`,{cause:t})}};function hasAgentHandle(e,t){return getAgentHandleStore(e.state)?.handles.some(e=>e.identity.id===t)===!0}function requireExecutionScope(e){if(!(e instanceof BackgroundToolExecutionScope))throw Error(`The background tool executor is not owned by the task runtime.`);return e}function readClaimedHandle(e){return e.kind===`ready`&&e.handle?.phase===`claimed`}function throwAgentClaimError(e,t){throw t.kind===`mismatch`?Error(JSON.stringify({code:AGENT_MISMATCH,message:`Agent "${e}" no longer matches this subagent definition. Start a new agent instead.`})):t.kind===`busy`?Error(JSON.stringify({code:AGENT_BUSY,message:formatAgentBusyMessage({agentId:e,agentName:t.handle.identity.name,ownerId:`ownerId`in t.handle?t.handle.ownerId:void 0})})):Error(JSON.stringify({code:AGENT_UNREACHABLE,message:`Agent with id "${e}" is no longer reachable.`}))}export{backgroundToolExecutionProvider,readRetainedBackgroundToolResult,runBackgroundStep};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
2
|
-
type TerminalSessionEvent = Extract<UnstampedMessageStreamEvent, {
|
|
3
|
-
type: "session.completed" | "session.failed";
|
|
4
|
-
}>;
|
|
5
|
-
/** Delivers one out-of-turn terminal event through the native instrumentation lifecycle. */
|
|
6
|
-
export declare function emitTerminalSessionEvent(input: {
|
|
7
|
-
readonly errorId?: string;
|
|
8
|
-
readonly event: TerminalSessionEvent;
|
|
9
|
-
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
10
|
-
readonly serializedContext: Record<string, unknown>;
|
|
11
|
-
readonly turnId?: string;
|
|
12
|
-
}): Promise<void>;
|
|
13
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{callAdapterEventHandler}from"#channel/adapter.js";import{contextStorage}from"#context/container.js";import{ParentSessionKey}from"#context/keys.js";import{encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{deserializeContext}from"#context/serialize.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{bindSessionInstrumentation}from"#instrumentation/runtime.js";const log=createLogger(`execution.workflow-entry`);async function emitTerminalSessionEvent(e){let t=e.serializedContext[`eve.sessionId`]??``,n;try{n=await deserializeContext(e.serializedContext)}catch(n){log.error(`failed to restore context for terminal ${e.event.type} event`,{error:n,errorId:e.errorId,sessionId:t})}let handleEvent=async r=>{if(n!==void 0){let i=n.get(ChannelKey);if(i!==void 0)try{await callAdapterEventHandler(i,r,buildAdapterContext(i,n))}catch(n){log.error(`adapter failed to handle terminal ${r.type} event`,{error:n,errorId:e.errorId,sessionId:t})}}try{let t=e.sessionWritable.getWriter();try{await t.write(encodeMessageStreamEvent(stampMessageStreamEvent(r)))}finally{t.releaseLock()}}catch(n){log.error(`failed to write terminal ${r.type} event to durable stream`,{error:n,errorId:e.errorId,sessionId:t})}},r;if(n!==void 0)try{let e=n.require(BundleKey);r=bindSessionInstrumentation({agentName:e.turnAgent.id,ctx:n,rootSessionId:n.get(ParentSessionKey)?.rootSessionId??t,sessionId:t})}catch(n){log.error(`failed to bind instrumentation for terminal ${e.event.type} event`,{error:n,errorId:e.errorId,sessionId:t})}let i=r?.createHandleEvent({handleEvent,turnId:e.turnId})??handleEvent;try{n===void 0?await i(e.event):await contextStorage.run(n,()=>i(e.event))}catch(n){log.error(`instrumentation failed to handle terminal ${e.event.type} event`,{error:n,errorId:e.errorId,sessionId:t})}finally{try{await r?.flush()}catch(n){log.error(`failed to flush instrumentation after terminal ${e.event.type} event`,{error:n,errorId:e.errorId,sessionId:t})}}}export{emitTerminalSessionEvent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,dismissible:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){return e.status===`answered`?{answer:e.optionId??e.text??``,status:`answered`}:{status:e.status}}executeAskQuestionTool.workflowId=`workflow//eve@0.67.2//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export { executeAskQuestionTool } from "#execution/tools/ask-question-workflow.js";
|
|
2
|
-
export declare const ASK_QUESTION_TOOL_DESCRIPTION: string;
|
|
3
|
-
export interface AskQuestionInput {
|
|
4
|
-
options?: {
|
|
5
|
-
description: string;
|
|
6
|
-
label: string;
|
|
7
|
-
}[];
|
|
8
|
-
question: string;
|
|
9
|
-
}
|
|
10
|
-
export type AskQuestionOutput = {
|
|
11
|
-
answer: string;
|
|
12
|
-
status: "answered";
|
|
13
|
-
} | {
|
|
14
|
-
status: "dismissed";
|
|
15
|
-
} | {
|
|
16
|
-
status: "unavailable";
|
|
17
|
-
};
|
|
18
|
-
export declare const ASK_QUESTION_INPUT_SCHEMA: import("#tools/schema.js").ToolSchema<AskQuestionInput, AskQuestionInput>;
|
|
19
|
-
export declare const ASK_QUESTION_OUTPUT_SCHEMA: import("#tools/schema.js").ToolSchema<AskQuestionOutput, AskQuestionOutput>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{defineJsonSchema}from"#tools/schema.js";import{executeAskQuestionTool}from"#execution/tools/ask-question-workflow.js";const ASK_QUESTION_TOOL_DESCRIPTION=[`Ask the user a question and wait for the answer. Use this only when you cannot make good progress without the user's input: to choose between materially different approaches, fill in a missing requirement, or confirm something risky or irreversible. Do not ask for information you can find with your other tools, and do not ask the user to confirm routine steps.`,``,`Usage:`,`- Ask one focused question that includes the context needed to answer it.`,`- For a decision, offer 2-3 mutually exclusive options. Put the option you recommend first and end its label with "(Recommended)".`,`- Do not add an "Other" option; the user can always type their own answer.`,"- The result's `answer` is the chosen option's label or the user's own words.",`- If the status is "dismissed", the user moved on without answering; respond to their next message instead.`,`- If the status is "unavailable", no one can answer in this session; continue with your best judgment and state the assumption you made.`].join(`
|
|
2
|
-
`),ASK_QUESTION_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{options:{type:`array`,minItems:2,maxItems:3,items:{type:`object`,properties:{description:{type:`string`,minLength:1,maxLength:200,description:`One short sentence on the impact or tradeoff of choosing this option.`},label:{type:`string`,minLength:1,maxLength:80,description:`User-facing label, 1-5 words.`}},required:[`description`,`label`],additionalProperties:!1},description:`Two or three mutually exclusive choices, recommended option first. Omit for an open-ended question. Never include an "Other" option.`},question:{type:`string`,minLength:1,maxLength:2e3,description:`The question to show the user, with the context needed to answer it.`}},required:[`question`],additionalProperties:!1},e=>e.options!==void 0&&new Set(e.options.map(e=>e.label)).size!==e.options.length?`Option labels must be unique.`:void 0),ASK_QUESTION_OUTPUT_SCHEMA=defineJsonSchema({oneOf:[{type:`object`,properties:{answer:{type:`string`,description:`The chosen option's label, or the user's own words.`},status:{type:`string`,const:`answered`}},required:[`answer`,`status`],additionalProperties:!1},{type:`object`,properties:{status:{type:`string`,const:`dismissed`}},required:[`status`],additionalProperties:!1},{type:`object`,properties:{status:{type:`string`,const:`unavailable`}},required:[`status`],additionalProperties:!1}]});export{ASK_QUESTION_INPUT_SCHEMA,ASK_QUESTION_OUTPUT_SCHEMA,ASK_QUESTION_TOOL_DESCRIPTION,executeAskQuestionTool};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{loadContext}from"#context/container.js";import{toError}from"#shared/errors.js";import{defineJsonSchema}from"#tools/schema.js";import{stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{ContextKey}from"#context/key.js";import{ConnectionRegistryKey}from"#context/providers/connection-key.js";import{resolveApprovalPolicy}from"#approval/definition.js";import{getAuthorizationResults,requestAuthorization}from"#harness/authorization.js";import{createAuthorizationExecution}from"#runtime/connections/scoped-authorization.js";import{isConnectionAuthorizationFailedError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{defineTool}from"#tools/definition.js";import{resolveConnectionAuthorization}from"#runtime/connections/resolve-authorization.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";const logger=createLogger(`framework.connection-search-dynamic`),CONNECTION_SEARCH_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{connection:{type:`string`,description:`Optional: limit search to a specific connection name.`},keywords:{type:`string`,description:`Search keywords and expanded aliases. Distill intent into keywords; avoid stop words like 'a', 'the', 'in'.`},limit:{type:`number`,description:`Max results to return. Default 10.`}},required:[`keywords`],additionalProperties:!1}),CONNECTION_SEARCH_OUTPUT_SCHEMA=defineJsonSchema({type:`array`,items:{type:`object`,properties:{connection:{type:`string`},description:{type:`string`},error:{type:`string`},inputSchema:{type:`object`},needsAuthorization:{type:`boolean`},outputSchema:{type:`object`},qualifiedName:{type:`string`},tool:{type:`string`}},required:[`connection`,`description`],additionalProperties:!1}}),ConnectionSearchResultsKey=new ContextKey(`eve.connectionSearchResults`);function qualifiedConnectionToolName(e,t){return`${e}__${t}`}function tokenize(e){return e.toLowerCase().split(/[\s_\-./]+/).filter(e=>e.length>1)}function scoreMatch(e,t){let n=tokenize(t.name),r=tokenize(t.description),i=0;for(let t of e){for(let e of n)(e.includes(t)||t.includes(e))&&(i+=3);for(let e of r)(e.includes(t)||t.includes(e))&&(i+=1)}return i}async function resolveInteractiveAuth(e,t){let n=e.getConnections().find(e=>e.connectionName===t);if(n===void 0)return;let r=await resolveConnectionAuthorization(n);if(r!==void 0&&supportsInteractiveAuthorization(r))return{scope:n.connectionName,instanceId:n.instanceId,connection:{url:n.url??``},authorization:r}}async function completePendingAuthorizations(e,t,n){assertPendingConnectionAuthorizationInstances(e);for(let r of t){if(!getAuthorizationResults().some(e=>e.name===r.connectionName))continue;let t=await resolveInteractiveAuth(e,r.connectionName);t!==void 0&&await n.complete(t)}}async function executeConnectionSearch(e){let t=loadContext(),n=t.get(ConnectionRegistryKey);if(n===void 0)return[];let r=e.limit??10,i=tokenize(e.keywords),a=[],o=[],s=e.connection!==void 0&&e.connection!==``?n.getConnections().filter(t=>t.connectionName===e.connection):n.getConnections();if(e.connection&&s.length===0)throw Error(`Connection "${e.connection}" is not registered. Available connections: ${n.getConnectionNames().join(`, `)}.`);let c=createAuthorizationExecution();await completePendingAuthorizations(n,s,c);let l=[];for(let e of s){let t;try{t=await n.getClient(e.connectionName).getToolMetadata()}catch(t){if(isConnectionAuthorizationRequiredError(t)){let r=await resolveInteractiveAuth(n,e.connectionName);if(r!==void 0)try{let e=await c.handleError(t,r);l.push(...e.challenges)}catch(t){let n=toError(t);logger.warn(`connection authorization failed`,{connection:e.connectionName,error:n}),o.push({connection:e.connectionName,description:e.description,error:isConnectionAuthorizationFailedError(n)?n.message:`Failed to start authorization for "${e.connectionName}": ${n.message}`});continue}o.push({connection:e.connectionName,description:e.description,needsAuthorization:!0});continue}if(isConnectionAuthorizationFailedError(t)){logger.warn(`connection authorization failed`,{connection:e.connectionName,reason:t.reason,retryable:t.retryable,error:t}),o.push({connection:e.connectionName,description:e.description,error:`Authorization failed for ${e.connectionName}: ${t.message}`});continue}let r=toError(t);logger.warn(`failed to load connection tools`,{connection:e.connectionName,error:r}),o.push({connection:e.connectionName,description:e.description,error:`Failed to load tools for "${e.connectionName}": ${r.message}`});continue}for(let n of t){let t=scoreMatch(i,n);t>0&&a.push({item:{connection:e.connectionName,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,qualifiedName:qualifiedConnectionToolName(e.connectionName,n.name),tool:n.name},score:t})}}if(l.length>0)return requestAuthorization(l);let u=o.filter(e=>e.error!==void 0);if(s.length>0&&u.length===s.length)throw Error(u.map(e=>e.error).join(`
|
|
2
|
-
`));a.sort((e,t)=>t.score-e.score);let d=a.slice(0,r).map(e=>e.item);if(d.length>0){let e=[...d,...o],n=t.get(ConnectionSearchResultsKey)??[],r=new Map(n.map(e=>[e.qualifiedName,e]));for(let e of d)e.qualifiedName&&r.set(e.qualifiedName,e);return t.set(ConnectionSearchResultsKey,[...r.values()]),e}return s.map(e=>o.find(t=>t.connection===e.connectionName)||{connection:e.connectionName,description:e.description})}function connectionToolReplayIdentity(e){let t=loadContext(),n=t.get(ConnectionSearchResultsKey)?.find(t=>t.qualifiedName===e);if(n!==void 0)return t.get(ConnectionRegistryKey)?.getConnections().find(e=>e.connectionName===n.connection)?.instanceId}function assertConnectionToolInstance(e){if(typeof e.instanceId!=`string`)return;let{connectionName:t}=readDiscoveredToolClosure(e);if(loadContext().get(ConnectionRegistryKey)?.getConnections().find(e=>e.connectionName===t)?.instanceId!==e.instanceId)throw Error(`The connection for this tool call changed or is unavailable. Request a new tool call and approval.`)}function readDiscoveredToolClosure(e){let t=e.connectionName,n=e.toolName;if(typeof t!=`string`||typeof n!=`string`)throw Error(`Discovered connection tool callback metadata is invalid.`);return{connectionName:t,toolName:n}}async function executeDiscoveredConnectionTool(e,t,n){let{connectionName:r,toolName:i}=readDiscoveredToolClosure(e),a=loadContext().get(ConnectionRegistryKey);if(a===void 0)throw Error(`Connection registry is unavailable while replaying a discovered tool.`);assertConnectionToolInstance(e),assertPendingConnectionAuthorizationInstances(a);let o=await resolveInteractiveAuth(a,r),s=createAuthorizationExecution();o!==void 0&&await s.complete(o);try{return await a.getClient(r).executeTool(i,t,{abortSignal:n.abortSignal,callId:n.callId})}catch(e){return await s.handleError(e,o)}}function assertPendingConnectionAuthorizationInstances(e){let t=new Map(e.getConnections().map(e=>[e.connectionName,e]));for(let e of getAuthorizationResults())if(e.instanceId!==void 0&&t.get(e.name)?.instanceId!==e.instanceId)throw Error(`Authorization for "${e.name}" cannot complete because its resolved connection changed while sign-in was pending. Start sign-in again.`)}async function requestDiscoveredConnectionToolApproval(e,t){let{connectionName:n}=readDiscoveredToolClosure(e);assertConnectionToolInstance(e);let r=loadContext().get(ConnectionRegistryKey)?.getConnectionApproval(n);return r===void 0?`not-applicable`:await resolveApprovalPolicy(r)(t)}async function authorizeDiscoveredConnectionToolApproval(e,t){let{connectionName:n}=readDiscoveredToolClosure(e);assertConnectionToolInstance(e);let r=loadContext().get(ConnectionRegistryKey)?.getConnectionApproval(n),i=r===void 0||typeof r==`function`?void 0:r.response;return i===void 0?{reason:`Approval response authorization is unavailable.`,status:`rejected`}:await i(t)}async function resolveConnectionSearchDynamicTools(){let e=loadContext().get(ConnectionRegistryKey);if(!e||e.getConnections().length===0)return null;let t=e.getConnections(),n=t.map(e=>e.connectionName),r=new Set(n),i=(loadContext().get(ConnectionSearchResultsKey)??[]).filter(e=>r.has(e.connection)),a={},o=defineTool({description:`Search for tools across your connections. Discovered tools become directly callable by their qualified name (e.g. \`linear__list_issues\`) in your next response. Available connections: ${n.join(`, `)}.`,inputSchema:CONNECTION_SEARCH_INPUT_SCHEMA,async execute(e){return executeConnectionSearch(e)},outputSchema:CONNECTION_SEARCH_OUTPUT_SCHEMA});stampDurableDynamicToolCallbacks(o,{inputSchema:{callback:()=>CONNECTION_SEARCH_INPUT_SCHEMA,closure:{}},outputSchema:{callback:()=>CONNECTION_SEARCH_OUTPUT_SCHEMA,closure:{}},execute:{callback:(e,t)=>executeConnectionSearch(t),closure:{}}}),a.connection_search=o;for(let n of i){let r=n.connection,i=n.tool,o=e.getConnectionApproval(r),s=t.find(e=>e.connectionName===r)?.instanceId,c={connectionName:r,toolName:i};s!==void 0&&(c.instanceId=s);let l=defineTool({description:n.description,inputSchema:n.inputSchema??{type:`object`},approval:o,outputSchema:n.outputSchema,async execute(e,t){return await executeDiscoveredConnectionTool(c,e,t)}});stampDurableDynamicToolCallbacks(l,{execute:{callback:executeDiscoveredConnectionTool,closure:c},...o===void 0?{}:{approvalRequest:{callback:requestDiscoveredConnectionToolApproval,closure:c}},...o===void 0||typeof o==`function`||o.response===void 0?{}:{approvalResponse:{callback:authorizeDiscoveredConnectionToolApproval,closure:c}}}),a[qualifiedConnectionToolName(r,i)]=l}return a}export{connectionToolReplayIdentity,resolveConnectionSearchDynamicTools};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e){"use workflow";return await sleep(Math.ceil(e.seconds*1e3)),{waitedSeconds:e.seconds}}executeSleepTool.workflowId=`workflow//eve@0.67.2//executeSleepTool`;export{executeSleepTool};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { executeSleepTool } from "#execution/tools/sleep-workflow.js";
|
|
2
|
-
export declare const SLEEP_TOOL_DESCRIPTION = "Wait for a specified amount of time before continuing. Use this when a process or condition needs time to change before it is useful to check its progress or status again.";
|
|
3
|
-
export interface SleepToolInput {
|
|
4
|
-
seconds: number;
|
|
5
|
-
}
|
|
6
|
-
export interface SleepToolOutput {
|
|
7
|
-
waitedSeconds: number;
|
|
8
|
-
}
|
|
9
|
-
export declare const SLEEP_INPUT_SCHEMA: import("#tools/schema.js").ToolSchema<SleepToolInput, SleepToolInput>;
|
|
10
|
-
export declare const SLEEP_OUTPUT_SCHEMA: import("#tools/schema.js").ToolSchema<SleepToolOutput, SleepToolOutput>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineJsonSchema}from"#tools/schema.js";import{executeSleepTool}from"#execution/tools/sleep-workflow.js";const MAX_SLEEP_SECONDS=Math.floor((2**53-1)/1e3),SLEEP_TOOL_DESCRIPTION=`Wait for a specified amount of time before continuing. Use this when a process or condition needs time to change before it is useful to check its progress or status again.`,SLEEP_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{seconds:{type:`number`,exclusiveMinimum:0,maximum:MAX_SLEEP_SECONDS,description:`How long to wait, in seconds.`}},required:[`seconds`],additionalProperties:!1}),SLEEP_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{waitedSeconds:{type:`number`,exclusiveMinimum:0}},required:[`waitedSeconds`],additionalProperties:!1});export{SLEEP_INPUT_SCHEMA,SLEEP_OUTPUT_SCHEMA,SLEEP_TOOL_DESCRIPTION,executeSleepTool};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type DurableSessionState } from "#execution/durable-session-store.js";
|
|
2
|
-
import { type TaskAuthorizationEventDelivery } from "#tasks/types.js";
|
|
3
|
-
/** Accepts authorization events from the workflow task itself or an agent it owns. */
|
|
4
|
-
export declare function acceptTaskAuthorizationEventStep(input: {
|
|
5
|
-
readonly delivery: TaskAuthorizationEventDelivery;
|
|
6
|
-
readonly sessionState: DurableSessionState;
|
|
7
|
-
}): Promise<boolean>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readDurableSession}from"#execution/durable-session-store.js";import{getBackgroundTasks}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import"#tasks/types.js";async function acceptTaskAuthorizationEventStep(e){"use step";let{hookPayload:t,taskId:n}=e.delivery,r=readDurableSession(e.sessionState),i=getBackgroundTasks(r.state).get(n);if(i===void 0)return!1;if(i.metadata.kind===`tool`&&i.run.address.runId===t.childSessionId&&i.metadata.name===t.subagentName&&i.turnId===t.event.data.turnId)return t.event.type===`authorization.completed`||i.status===`working`;let a=getAgentHandleStore(r.state)?.handles??[],o=a.find(e=>e.phase===`claimed`&&e.ownerId===n&&e.identity.name===t.subagentName&&e.address.sessionId===t.childSessionId),s=a.filter(e=>e.phase===`reserved`&&e.ownerId===n&&e.identity.name===t.subagentName);return o===void 0&&s.length!==1?!1:i.status===`working`}export{acceptTaskAuthorizationEventStep};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type DurableSessionState } from "#execution/durable-session-store.js";
|
|
2
|
-
import type { UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
3
|
-
/** Publishes a subagent notification, then runs its hooks without model preparation. */
|
|
4
|
-
export declare function emitSubagentEventStep(input: {
|
|
5
|
-
readonly event: UnstampedMessageStreamEvent;
|
|
6
|
-
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
7
|
-
readonly serializedContext: Record<string, unknown>;
|
|
8
|
-
readonly sessionState: DurableSessionState;
|
|
9
|
-
}): Promise<{
|
|
10
|
-
readonly serializedContext: Record<string, unknown>;
|
|
11
|
-
readonly sessionState: DurableSessionState;
|
|
12
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{contextStorage}from"#context/container.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{withContextScope}from"#context/run-step.js";import{dispatchStreamEventHooks}from"#context/hook-lifecycle.js";import{createSessionEventSink}from"#execution/session/event-sink.js";import{reconcileSessionContinuationToken}from"#execution/reconcile-session-continuation-token.js";async function emitSubagentEventStep(e){"use step";let t=await deserializeContext(e.serializedContext),n=t.require(BundleKey),publish=async()=>{let n=createSessionEventSink({adapter:t.require(ChannelKey),ctx:t,isFirstTurn:e.sessionState.emissionState.sequence===0,sessionWritable:e.sessionWritable,sessionId:e.sessionState.sessionId});try{return await contextStorage.run(t,()=>n.emit(e.event))}finally{n.release()}},r=n.hookRegistry;if((r.streamEventsByType.get(e.event.type)?.length??0)===0&&r.streamEventsWildcard.length===0)return await publish(),{serializedContext:serializeContext(t),sessionState:e.sessionState};let i=resolveEffectiveAgentRuntime(n,t),a=hydrateDurableSession({durable:readDurableSession(e.sessionState),turnAgent:i.turnAgent,compactionOverrides:{thresholdPercent:i.thresholdPercent}}),o=await withContextScope(t,a,async e=>{let n=await publish();return n.suppressed||await dispatchStreamEventHooks({ctx:t,registry:r,event:n.event}),{result:void 0,session:e}});return{serializedContext:serializeContext(t),sessionState:createDurableSessionState({session:reconcileSessionContinuationToken(t,o.session)})}}export{emitSubagentEventStep};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { RuntimeActionResultHookPayload, SubagentAuthorizationEventHookPayload, SubagentInputRequestHookPayload } from "#channel/types.js";
|
|
2
|
-
import type { RuntimeSubagentChildResult } from "#shared/action-types.js";
|
|
3
|
-
import type { JsonValue } from "#shared/json.js";
|
|
4
|
-
import type { JsonObject } from "#shared/json.js";
|
|
5
|
-
import type { AgentInput } from "#tools/workflow-definition.js";
|
|
6
|
-
import type { ToolContext } from "#tools/definition.js";
|
|
7
|
-
export type InternalAgentInput = {
|
|
8
|
-
readonly agentId?: string;
|
|
9
|
-
readonly message: string;
|
|
10
|
-
readonly outputSchema?: JsonObject;
|
|
11
|
-
readonly target: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Asks the owning session to spawn an agent for a workflow tool run. Spawning
|
|
15
|
-
* needs owner-held material (auth, capabilities, the agent handle
|
|
16
|
-
* store) that a workflow tool body never has.
|
|
17
|
-
*/
|
|
18
|
-
export interface AgentInvocationRequest {
|
|
19
|
-
readonly input: InternalAgentInput;
|
|
20
|
-
readonly invocationId: string;
|
|
21
|
-
readonly kind: "agent-invoke";
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Tells the owning session that an owner-spawned agent replied to the run, so
|
|
25
|
-
* the owner can release the handle it reserved for `agent-invoke`.
|
|
26
|
-
*/
|
|
27
|
-
export interface AgentSettlementRequest {
|
|
28
|
-
readonly kind: "agent-settled";
|
|
29
|
-
readonly result: RuntimeSubagentChildResult;
|
|
30
|
-
}
|
|
31
|
-
export type AgentInvocationEvent = SubagentAuthorizationEventHookPayload | SubagentInputRequestHookPayload;
|
|
32
|
-
export type AgentInvocationReply = AgentInvocationEvent | RuntimeActionResultHookPayload | {
|
|
33
|
-
readonly kind: "agent-settled";
|
|
34
|
-
readonly callId: string;
|
|
35
|
-
};
|
|
36
|
-
/** Invokes an agent from a workflow tool. */
|
|
37
|
-
export declare function agent(ctx: ToolContext, target: string, input: AgentInput): Promise<JsonValue>;
|
|
38
|
-
/** Invokes an agent with a framework-selected replay-stable invocation id. */
|
|
39
|
-
export declare function invokeAgent(ctx: ToolContext, input: InternalAgentInput, options?: {
|
|
40
|
-
readonly invocationId?: string;
|
|
41
|
-
}): Promise<JsonValue>;
|
|
42
|
-
export declare function validateAgentInput(input: InternalAgentInput): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{createHook}from"#compiled/@workflow/core/index.js";import{disposeHook}from"#execution/hook-ownership.js";import{resumeHookStep}from"#execution/tools/workflow/resume-hook-step.js";import{readWorkflowToolRunOwner,readWorkflowToolRunRef}from"#execution/tools/workflow/ask.js";async function agent(e,t,n){return readWorkflowToolRunRef(e),validateAgentInput({...n,target:t}),await invokeAgent(e,{agentId:n.agentId,message:n.message,outputSchema:n.outputSchema,target:t})}async function invokeAgent(e,t,n={}){validateAgentInput(t);let r=readWorkflowToolRunRef(e),i=readWorkflowToolRunOwner(e),a=createHook(),o=n.invocationId??`${e.callId}:${a.token}`;try{await resumeHookStep(i.inbox,{kind:`request`,from:r,replyTo:a.token,request:{input:t,invocationId:o,kind:`agent-invoke`}});let n=a[Symbol.asyncIterator]();for(;;){let s=await nextAgentReply(n,e.abortSignal);if(s.done)break;let c=s.value;if(c.kind===`runtime-action-result`){let s=c.results.find(e=>e.kind===`subagent-result`&&e.callId===o);if(s!==void 0){if(s.origin===`child`)for(await resumeHookStep(i.inbox,{kind:`request`,from:r,replyTo:a.token,request:{kind:`agent-settled`,result:s}});;){let r=await nextAgentReply(n,e.abortSignal);if(r.done)throw Error(`Agent "${t.target}" closed before settlement.`);if(r.value.kind===`agent-settled`&&r.value.callId===o)break}if(s.isError===!0)throw s.output;return s.output}continue}if(c.kind!==`agent-settled`){if(c.kind===`subagent-input-request`){await resumeHookStep(i.inbox,{kind:`request`,from:r,replyTo:c.childSessionInbox?.sessionId===c.childSessionId?sessionInboxHookToken(sessionCommandHookToken(c.childSessionInbox.sessionId)):c.childContinuationToken,request:{kind:`input-batch`,requests:c.event.requests},requestCoordinates:{sequence:c.event.sequence,stepIndex:c.event.stepIndex,turnId:c.event.turnId}});continue}await resumeHookStep(i.inbox,{kind:`request`,from:r,replyTo:a.token,request:{event:c,kind:`authorization-request`}})}}}finally{try{await disposeHook(a)}catch{}}throw Error(`Agent "${t.target}" closed without a result.`)}async function nextAgentReply(e,t){if(t===void 0)return await e.next();if(t.aborted)throw t.reason;let n,r=new Promise((e,t)=>{n=t}),abort=()=>n?.(t.reason);t.addEventListener(`abort`,abort,{once:!0});try{return await Promise.race([e.next(),r])}finally{t.removeEventListener(`abort`,abort)}}function validateAgentInput(e){if(typeof e.target!=`string`||e.target.trim()===``)throw TypeError(`agent() requires a non-empty agent name as its first argument.`);if(typeof e.message!=`string`||e.message.trim()===``)throw TypeError("agent() requires a non-empty `message`.");if(e.outputSchema!==void 0&&(typeof e.outputSchema!=`object`||e.outputSchema===null||Array.isArray(e.outputSchema)))throw TypeError("agent() `outputSchema` must be a JSON Schema object.")}export{agent,invokeAgent,validateAgentInput};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ContextReader } from "#context/key.js";
|
|
2
|
-
import { type PreparedCoordinationDispatch } from "#execution/coordination-dispatch-shared.js";
|
|
3
|
-
import { type DurableSessionState } from "#execution/durable-session-store.js";
|
|
4
|
-
import type { RuntimeAgentDispatchRequest } from "#shared/action-types.js";
|
|
5
|
-
import type { RuntimeSubagentDispatchFailure } from "#shared/action-types.js";
|
|
6
|
-
import type { AgentInvocationRequest } from "#execution/tools/subagent/invoke-agent.js";
|
|
7
|
-
import { type CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";
|
|
8
|
-
import type { DynamicRemoteAgentConfig } from "#runtime/subagents/dynamic-remote-agent-config.js";
|
|
9
|
-
import { type RuntimeAgentHandleAction, type RuntimeSession } from "#subagents/handle-dispatch.js";
|
|
10
|
-
import type { SubagentStartTarget } from "#execution/tools/subagent/start.js";
|
|
11
|
-
type OwnerAgentDispatchPlanEntry = {
|
|
12
|
-
readonly kind: "resume";
|
|
13
|
-
readonly action: RuntimeAgentHandleAction;
|
|
14
|
-
readonly agentId: string;
|
|
15
|
-
readonly dynamicRemoteAgent?: DynamicRemoteAgentConfig;
|
|
16
|
-
} | {
|
|
17
|
-
readonly kind: "reject";
|
|
18
|
-
readonly result: RuntimeSubagentDispatchFailure;
|
|
19
|
-
} | {
|
|
20
|
-
readonly kind: "start";
|
|
21
|
-
readonly target: SubagentStartTarget;
|
|
22
|
-
};
|
|
23
|
-
/** Prepares one workflow-owner agent invocation from durable inputs. */
|
|
24
|
-
export declare function prepareOwnerAgentInvocation(input: {
|
|
25
|
-
readonly invocation: AgentInvocationRequest["input"];
|
|
26
|
-
readonly invocationId: string;
|
|
27
|
-
readonly knownAgentIds?: readonly string[];
|
|
28
|
-
readonly serializedContext: Record<string, unknown>;
|
|
29
|
-
readonly sessionState: DurableSessionState;
|
|
30
|
-
readonly taskId?: string;
|
|
31
|
-
}): Promise<Omit<PreparedCoordinationDispatch<OwnerAgentDispatchPlanEntry>, "sessionState">>;
|
|
32
|
-
export declare function planAgentDispatch(input: {
|
|
33
|
-
readonly action: RuntimeAgentDispatchRequest;
|
|
34
|
-
readonly bundle: CompiledBundle;
|
|
35
|
-
readonly ctx: ContextReader;
|
|
36
|
-
readonly knownAgentIds?: readonly string[];
|
|
37
|
-
readonly session: RuntimeSession;
|
|
38
|
-
}): OwnerAgentDispatchPlanEntry;
|
|
39
|
-
export declare function resolveAgentInvocationAction(input: {
|
|
40
|
-
readonly ctx: ContextReader;
|
|
41
|
-
readonly input: AgentInvocationRequest["input"];
|
|
42
|
-
readonly invocationId: string;
|
|
43
|
-
}): RuntimeAgentDispatchRequest;
|
|
44
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{SessionDynamicSubagentSelectionsKey,TurnDynamicSubagentSelectionsKey}from"#context/keys.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{getHarnessEmissionState}from"#harness/emission.js";import{deserializeContext}from"#context/serialize.js";import{readDurableSession}from"#execution/durable-session-store.js";import{getBackgroundTasks}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";import{activeTurnId}from"#harness/active-turn-id.js";import{prepareActionDispatch}from"#execution/coordination-dispatch-shared.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{AGENT_TOOL_DESCRIPTION,AGENT_TOOL_NAME}from"#tools/framework/agent-contract.js";import{isAgentHandleAction}from"#subagents/handle-dispatch.js";import{createRecursiveAgentRootOnlyResult,createUnavailableDynamicSubagentResult,getSubagentName}from"#execution/dispatch-action-failures.js";const log=createLogger(`execution.agent-invocation`);async function prepareOwnerAgentInvocation(e){let t=readDurableSession(e.sessionState),n=await deserializeContext(e.serializedContext),r=getHarnessEmissionState(t.state),i=e.taskId===void 0?void 0:getBackgroundTasks(t.state).get(e.taskId)?.run,a=resolveAgentInvocationAction({ctx:n,input:e.invocation,invocationId:e.invocationId});return await prepareActionDispatch({batch:{requests:[a],event:{...r,stepIndex:i?.origin.stepIndex??r.stepIndex,turnId:i?.origin.turnId??activeTurnId(r)}},ctx:n,durableSession:t,fanoutSize:1,plan:({bundle:t,ctx:n,session:r})=>[planAgentDispatch({action:a,bundle:t,ctx:n,knownAgentIds:e.knownAgentIds,session:r})],planReusesOwnerSandbox:({bundle:e,plan:t})=>ownerPlanReusesSandbox({bundle:e,plan:t}),serializedContext:e.serializedContext})}function planAgentDispatch(e){let t=new Set(e.knownAgentIds??(getAgentHandleStore(e.session.state)?.handles??[]).map(e=>e.identity.id)),n=e.action.input.agentId,r=typeof n==`string`&&n.trim()!==``?n:void 0;if(r!==void 0&&isAgentHandleAction(e.action)){if(t.has(r)){let t=e.bundle.subagentRegistry.dynamicNodeIds?.has(e.action.nodeId)===!0?getDynamicSubagentSelection(e.ctx,e.action.nodeId):void 0;return{action:e.action,agentId:r,dynamicRemoteAgent:e.action.kind===`remote-agent-call`&&t?.kind===`remote`?t.remoteAgent:void 0,kind:`resume`}}log.warn(`unknown agentId on subagent call; starting a new agent`,{agentId:r,callId:e.action.callId})}return classifyFreshStart(e)}function classifyFreshStart(e){let{action:t}=e,n=e.bundle.subagentRegistry.subagentsByNodeId,r=e.bundle.subagentRegistry.dynamicNodeIds?.has(t.nodeId)===!0,i=r?getDynamicSubagentSelection(e.ctx,t.nodeId):void 0;if(r&&(i===void 0||t.kind===`subagent-call`&&i.kind!==`subagent`||t.kind===`remote-agent-call`&&i.kind!==`remote`))return log.warn(`dynamic subagent call blocked after availability changed`,{callId:t.callId,nodeId:t.nodeId,subagentName:getSubagentName(t)}),{kind:`reject`,result:createUnavailableDynamicSubagentResult(t)};if(isRecursiveAgentAction(t,n)&&e.session.rootSessionId!==void 0)return log.warn(`recursive agent call blocked outside the root session`,{callId:t.callId,nodeId:t.nodeId,rootSessionId:e.session.rootSessionId,subagentName:t.subagentName}),{kind:`reject`,result:createRecursiveAgentRootOnlyResult(t)};if(t.kind===`remote-agent-call`)return{kind:`start`,target:{action:t,dynamicRemoteAgent:i?.kind===`remote`?i.remoteAgent:void 0,kind:`remote`}};let a=i?.kind===`subagent`?i.agentConfig:void 0,o=n.get(t.nodeId),s=a?.description??(o?.definition.kind===`subagent`?o.definition.description:void 0);return{kind:`start`,target:{action:t,dynamicSubagentAgentConfig:a,kind:`local`,source:s===void 0?{type:`runtime`}:{description:s,type:`local`}}}}function ownerPlanReusesSandbox(e){return e.plan.some(t=>{if(t.kind!==`start`||t.target.kind!==`local`)return!1;let n=t.target.action;return n.subagentName===`agent`&&!e.bundle.subagentRegistry.subagentsByNodeId.has(n.nodeId)||e.bundle.graph?.nodesByNodeId.get(n.nodeId)?.sandboxRegistry.sandbox.definition.kind===`parent`})}function isRecursiveAgentAction(e,t){return e.kind===`subagent-call`&&e.subagentName===`agent`&&!t.has(e.nodeId)}function resolveAgentInvocationAction(e){let t=e.ctx.require(BundleKey),n=t.subagentRegistry.subagentsByName.get(e.input.target),r=n===void 0?Object.values({...e.ctx.get(SessionDynamicSubagentSelectionsKey),...e.ctx.get(TurnDynamicSubagentSelectionsKey)}).find(t=>t!==null&&t.prepared?.name===e.input.target):void 0,i=n?.definition??r?.prepared??(e.input.target===AGENT_TOOL_NAME&&t.nodeId===void 0?{description:AGENT_TOOL_DESCRIPTION,kind:`subagent`,name:AGENT_TOOL_NAME,nodeId:ROOT_RUNTIME_AGENT_NODE_ID}:void 0);if(i===void 0)throw Error(`Agent target "${e.input.target}" is not available to this agent.`);let a={message:e.input.message};e.input.agentId!==void 0&&(a.agentId=e.input.agentId),e.input.outputSchema!==void 0&&(a.outputSchema=e.input.outputSchema);let o={callId:e.invocationId,description:i.description??``,input:a,name:i.name,nodeId:i.nodeId};return i.kind===`remote`?{...o,kind:`remote-agent-call`,remoteAgentName:i.name}:{...o,kind:`subagent-call`,subagentName:i.name}}export{planAgentDispatch,prepareOwnerAgentInvocation,resolveAgentInvocationAction};
|