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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type PublishedSessionEvents, type SessionStepState } from "#execution/publish-session-events.js";
|
|
2
|
+
import { type SessionStateTransition } from "#execution/session/state-delta.js";
|
|
3
|
+
import { type ProxyInputRequest } from "#harness/proxy-input-requests.js";
|
|
4
|
+
/**
|
|
5
|
+
* Decides a run's request to withdraw a question. A question the session
|
|
6
|
+
* still offers is retired and relayed `cancelled`, so channels stop offering
|
|
7
|
+
* it. One it no longer offers was already answered or withdrawn when its turn
|
|
8
|
+
* was cancelled. Either way the run hears `withdrawn`, after any answer the
|
|
9
|
+
* session sent it first, so the question resolves from the session's first
|
|
10
|
+
* decision.
|
|
11
|
+
*/
|
|
12
|
+
export declare function withdrawWorkflowToolRunQuestionStep(input: WithdrawQuestionInput): Promise<SessionStateTransition>;
|
|
13
|
+
type WithdrawQuestionInput = SessionStepState & {
|
|
14
|
+
readonly control: string;
|
|
15
|
+
readonly requestId: string;
|
|
16
|
+
readonly runId: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Withdraws the requests a finished run left open: its own questions and those
|
|
20
|
+
* of the sessions it opened, which ended with it. Nobody can answer them now,
|
|
21
|
+
* so each is relayed `cancelled`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function withdrawFinishedRunQuestionsStep(input: SessionStepState & {
|
|
24
|
+
readonly runId: string;
|
|
25
|
+
}): Promise<SessionStateTransition>;
|
|
26
|
+
/**
|
|
27
|
+
* Retires the relayed requests `select` picks and relays the `input.resolved`
|
|
28
|
+
* that reports each one `cancelled`, for a step that owns the session.
|
|
29
|
+
*/
|
|
30
|
+
export declare function relayWithdrawnRequests(input: SessionStepState, select: (requestId: string, route: ProxyInputRequest) => boolean): Promise<PublishedSessionEvents>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readDurableSession,replaceDurableSessionSnapshot}from"#execution/durable-session-store.js";import{relaySessionEvents}from"#execution/publish-session-events.js";import{withSessionStateDelta}from"#execution/session/state-delta.js";import{withdrawProxyInputRequests}from"#harness/proxy-input-requests.js";import{resumeHook}from"#internal/workflow/runtime.js";import{ignoreGoneTarget}from"#execution/tasks/workflow-target.js";async function withdrawWorkflowToolRunQuestionStep(e){"use step";return await withSessionStateDelta(e,withdrawWorkflowToolRunQuestion)}async function withdrawWorkflowToolRunQuestion(e){let t={kind:`withdrawn`,requestId:e.requestId};return await ignoreGoneTarget(resumeHook(e.control,t)),await relayWithdrawnRequests(e,(t,n)=>t===e.requestId&&n.workflowAsk!==void 0&&n.runId===e.runId)}async function withdrawFinishedRunQuestionsStep(e){"use step";return await withSessionStateDelta(e,e=>relayWithdrawnRequests(e,(t,n)=>n.runId===e.runId))}async function relayWithdrawnRequests(e,t){let n=withdrawProxyInputRequests(readDurableSession(e.sessionState),t);return await relaySessionEvents({serializedContext:e.serializedContext,sessionState:replaceDurableSessionSnapshot({session:n.session,state:e.sessionState}),sessionWritable:e.sessionWritable},n.events)}export{relayWithdrawnRequests,withdrawFinishedRunQuestionsStep,withdrawWorkflowToolRunQuestionStep};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type ChannelReader } from "#execution/tools/workflow/owner-channels.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { WorkflowToolRunMessage, WorkflowToolRunControlMessage } from "#execution/tools/workflow/messages.js";
|
|
3
3
|
import type { WorkflowToolRunInput } from "#execution/tools/workflow/types.js";
|
|
4
4
|
export interface BlockingWorkflowOwner {
|
|
5
|
-
|
|
5
|
+
/** The session's commands, from the run's control hook. */
|
|
6
6
|
readonly commands: ChannelReader<"control", WorkflowToolRunControlMessage>;
|
|
7
|
-
readonly signal: AbortSignal;
|
|
8
|
-
handleCommand(message: WorkflowToolRunControlMessage): void;
|
|
9
7
|
handleMessage(message: WorkflowToolRunMessage): Promise<void>;
|
|
10
8
|
}
|
|
11
|
-
/**
|
|
9
|
+
/** The run's link to its session: commands arrive on its control hook, and its messages go to the session's inbox. */
|
|
12
10
|
export declare function createBlockingWorkflow(input: WorkflowToolRunInput): BlockingWorkflowOwner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHook}from"#compiled/@workflow/core/index.js";import{resumeHookStep}from"#execution/tools/workflow/resume-hook-step.js";import{
|
|
1
|
+
import{createHook}from"#compiled/@workflow/core/index.js";import{resumeHookStep}from"#execution/tools/workflow/resume-hook-step.js";import{createChannelReader}from"#execution/tools/workflow/owner-channels.js";function createBlockingWorkflow(e){let t=createHook({token:e.hookToken});return{commands:createChannelReader(`control`,t),handleMessage(t){return resumeHookStep(e.owner.inbox,t,{ifPresent:t.kind===`outcome`&&t.result.status===`cancelled`})}}}export{createBlockingWorkflow};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** Owns
|
|
3
|
-
export declare function workflowToolRunWorkflow(input: WorkflowToolRunInput
|
|
1
|
+
import type { WorkflowToolRunInput } from "#execution/tools/workflow/types.js";
|
|
2
|
+
/** Owns command intake, body execution, and settlement for one workflow tool call. */
|
|
3
|
+
export declare function workflowToolRunWorkflow(input: WorkflowToolRunInput): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sleep}from"#compiled/@workflow/core/index.js";import{normalizeSerializableError}from"#execution/workflow-errors.js";import{openWorkflowToolRunOwnerInbox}from"#execution/tools/workflow/owner.js";import{WORKFLOW_CANCELLATION_CLEANUP_MS}from"#execution/tools/workflow/cancellation-policy.js";import{createChannelReader,raceChannelReads}from"#execution/tools/workflow/owner-channels.js";import{createWorkflowBodyRef,
|
|
1
|
+
import{sleep}from"#compiled/@workflow/core/index.js";import{normalizeSerializableError}from"#execution/workflow-errors.js";import{openWorkflowToolRunOwnerInbox}from"#execution/tools/workflow/owner.js";import{WORKFLOW_CANCELLATION_CLEANUP_MS}from"#execution/tools/workflow/cancellation-policy.js";import{resumeHookStep}from"#execution/tools/workflow/resume-hook-step.js";import{createChannelReader,raceChannelReads}from"#execution/tools/workflow/owner-channels.js";import{createWorkflowBodyRef,startCallBody}from"#execution/tools/workflow/body.js";import{isWorkflowToolRunAskDecision,isWorkflowToolRunControlMessage}from"#execution/tools/workflow/messages.js";import{createBlockingWorkflow}from"#execution/tools/workflow/workflow-owner-blocking.js";import{startServeBody}from"#execution/tools/workflow/serve.js";async function workflowToolRunWorkflow(e){"use workflow";let t=createBlockingWorkflow(e),n=openWorkflowToolRunOwnerInbox();e.entry.entryPoint!==`execute`&&await reportTaskStarted(e);let r=startWorkflowBody({...e,owner:n.owner}),i=r.control.runSignal,a=createChannelReader(`body`,awaitBodyOutcome(r.outcome)),o=!0,s=0,c,l,u;try{for(;;){if(r.control.unwinding&&(l??=sleep(WORKFLOW_CANCELLATION_CLEANUP_MS).then(()=>`cancel`)),c!==void 0&&s>=n.owner.sent&&t.commands.landed.length===0&&t.commands.failure===void 0){u=c;break}let e;try{let r=[];o&&r.push(t.commands),r.push(n.reader),c===void 0&&r.push(a),e=await raceChannelReads(r,l)}catch(e){if(t.commands.failure!==void 0)throw e;u={status:`failed`,error:normalizeSerializableError(e)};break}if(e===`cancel`){if(!r.control.unwinding){l=void 0;continue}i.aborted||r.control.apply({kind:`end`,reason:`The task was cancelled and its serve body didn't return to receive() within 30 seconds.`});break}if(e.next.done){if(e.channel===`control`){o=!1;continue}if(e.channel===`body`){u={status:`failed`,error:`Workflow body ended without an outcome.`};break}if(i.aborted)break;return}if(e.channel===`control`){r.control.unwinding||(l=void 0),applyControlMessage(r,e.next.value);continue}if(e.channel===`body`){c=e.next.value;continue}let d=e.next.value;d.kind!==`outcome`&&(s+=1,await t.handleMessage(d))}}finally{await r.close()}if(i.aborted&&(u={status:`cancelled`,reason:i.reason instanceof Error?i.reason.message:String(i.reason??``)}),u!==void 0){let n=r.usage.total();await t.handleMessage({from:createWorkflowBodyRef(e),kind:`outcome`,result:u,...n!==void 0&&{usage:n}})}}async function reportTaskStarted(e){await resumeHookStep(e.owner.inbox,{from:createWorkflowBodyRef(e),kind:`started`},{ifPresent:!0})}function applyControlMessage(e,t){if(isWorkflowToolRunControlMessage(t)){if(isWorkflowToolRunAskDecision(t)){e.asks.settle(t);return}e.control.apply(t)}}function startWorkflowBody(e){switch(e.entry.entryPoint){case`execute`:case`task`:return startCallBody(e);case`serve`:return startServeBody(e)}}async function*awaitBodyOutcome(e){yield await e}workflowToolRunWorkflow.workflowId=`workflow//eve//workflowToolRunWorkflow`;export{workflowToolRunWorkflow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isLoopbackHostname,isPrivateOrReservedIpAddress}from"#shared/network-address.js";import{
|
|
1
|
+
import{isIP}from"node:net";import{isLoopbackHostname,isPrivateOrReservedIpAddress}from"#shared/network-address.js";import{lookup}from"node:dns";const REDIRECT_STATUSES=new Set([301,302,303,307,308]),UNSAFE_DESTINATION_ERROR=`URL must not target localhost, private, link-local, or reserved IP addresses.`;async function requestPublicUrl(e,t){let n=parseHttpsUrl(e);for(let e=0;;e++){let{dispatcher:r,response:i}=await requestOnce(n,t);try{let r=i.headers.get(`location`);if(r!==null&&REDIRECT_STATUSES.has(i.status)&&e<10){await cancelResponseBody(i),n=parseHttpsUrl(new URL(r,n).toString());continue}return await consumeResponse(i,t.maxResponseSize)}finally{await r.close()}}}function parseHttpsUrl(e){let t;try{t=new URL(e)}catch{throw Error(`URL must be a valid absolute https:// URL.`)}if(t.protocol!==`https:`)throw Error(`URL must start with https://`);return t}async function requestOnce(e,t){assertPublicHostname(e.hostname);let{Agent:n,Dispatcher1Wrapper:r}=await import(`undici`),i=new r(new n({connect:{lookup:createPublicLookup()}}));try{return{dispatcher:i,response:await fetchWithDispatcher(e,{dispatcher:i,headers:t.headers,redirect:`manual`,signal:t.signal})}}catch(e){throw await i.close(),e}}function fetchWithDispatcher(e,t){return fetch(e,t)}function assertPublicHostname(e){let t=e.replace(/^\[(.*)\]$/u,`$1`);if(isIP(t)!==0){assertPublicAddress(t);return}if(isLoopbackHostname(t))throw Error(UNSAFE_DESTINATION_ERROR)}function assertPublicAddress(e){if(isPrivateOrReservedIpAddress(e))throw Error(UNSAFE_DESTINATION_ERROR)}function createPublicLookup(){return(e,t,n)=>{lookup(e,{all:!0,verbatim:!0},(r,i)=>{if(r!==null){n(r,``,0);return}try{for(let{address:e}of i)assertPublicAddress(e)}catch(e){n(e,``,0);return}let a=t.family===void 0||t.family===0?i:i.filter(({family:e})=>e===t.family);if(a.length===0){let t=Error(`Unable to resolve URL hostname "${e}" in the requested IP family.`);Object.assign(t,{code:`ENOTFOUND`}),n(t,``,0);return}if(t.all===!0){n(null,a);return}let o=a[0];n(null,o.address,o.family)})}}async function consumeResponse(e,t){let n=parseContentLength(e.headers.get(`content-length`));if(n!==void 0&&n>t)throw await cancelResponseBody(e),createResponseTooLargeError();let r=await readBoundedBody(e,t),i=r.byteLength===0?null:Uint8Array.from(r).buffer;return new Response(i,{headers:e.headers,status:e.status,statusText:e.statusText})}function parseContentLength(e){if(e===null)return;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}async function readBoundedBody(e,t){if(e.body===null)return new Uint8Array;let n=e.body.getReader(),r=[],i=0;try{for(;;){let{done:e,value:a}=await n.read();if(e)break;if(i+=a.byteLength,i>t)throw await n.cancel(),createResponseTooLargeError();r.push(a)}}finally{n.releaseLock()}let a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.byteLength;return a}async function cancelResponseBody(e){try{await e.body?.cancel()}catch{}}function createResponseTooLargeError(){return Error(`Response too large (exceeds 5 MB limit).`)}export{requestPublicUrl};
|
|
@@ -28,8 +28,3 @@ export declare function resolveWorkflowCallbackBaseUrl(metadataUrl: string): str
|
|
|
28
28
|
* `new URL(path, base)` would drop for absolute paths.
|
|
29
29
|
*/
|
|
30
30
|
export declare function createWorkflowCallbackUrl(baseUrl: string, callbackPath: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Builds a callback to a remote task child without disclosing this deployment's
|
|
33
|
-
* protection bypass secret to an authored external origin.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createRemoteTaskInputCallbackUrl(baseUrl: string, callbackPath: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{joinEveRoutePath}from"#shared/eve-route-path.js";import{EVE_PUBLIC_ROUTE_PREFIX_ENV,normalizePublicRoutePrefix}from"#shared/public-route-prefix.js";
|
|
1
|
+
import{joinEveRoutePath}from"#shared/eve-route-path.js";import{EVE_PUBLIC_ROUTE_PREFIX_ENV,normalizePublicRoutePrefix}from"#shared/public-route-prefix.js";function resolveVercelProductionCallbackBaseUrl(){return process.env.VERCEL_ENV===`production`&&process.env.VERCEL_PROJECT_PRODUCTION_URL?`https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`:null}function resolveWorkflowCallbackBaseUrl(e){let t=process.env.WORKFLOW_LOCAL_BASE_URL?.trim()||void 0,n=(resolveVercelProductionCallbackBaseUrl()??t??e).replace(/\/$/,``),r=normalizePublicRoutePrefix(process.env[EVE_PUBLIC_ROUTE_PREFIX_ENV]);return r===void 0?n:`${n}${r}`}function createWorkflowCallbackUrl(e,t){let n=new URL(t,`http://eve.local`),r=new URL(e);r.pathname=joinEveRoutePath(r.pathname,n.pathname),r.search=n.search;let i=process.env.VERCEL_AUTOMATION_BYPASS_SECRET?.trim();return i&&r.searchParams.set(`x-vercel-protection-bypass`,i),r.toString()}export{createWorkflowCallbackUrl,resolveVercelProductionCallbackBaseUrl,resolveWorkflowCallbackBaseUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CancelTurnInput, CancelTurnResult, DeliverHookPayload, Runtime } from "#channel/types.js";
|
|
1
|
+
import type { CancelTurnInput, CancelTurnResult, DeliverHookPayload, DispatchSessionInput, Runtime, SessionCommand, SessionCommandResult } from "#channel/types.js";
|
|
2
2
|
import { type Run, type StartOptionsWithoutDeploymentId, type WorkflowFunction, type WorkflowMetadata } from "#internal/workflow/runtime.js";
|
|
3
3
|
import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
|
|
4
4
|
import type { SessionCheckpoint } from "#execution/session/handoff.js";
|
|
@@ -19,10 +19,6 @@ export declare const workflowEntryReference: {
|
|
|
19
19
|
export declare const sessionTimeoutWorkflowReference: {
|
|
20
20
|
workflowId: string;
|
|
21
21
|
};
|
|
22
|
-
/** Stable workflow reference for root-session activity collectors. */
|
|
23
|
-
export declare const activityCollectorWorkflowReference: {
|
|
24
|
-
workflowId: string;
|
|
25
|
-
};
|
|
26
22
|
/** Stable workflow reference for authored workflow tool runs. */
|
|
27
23
|
export declare const workflowToolRunWorkflowReference: {
|
|
28
24
|
workflowId: string;
|
|
@@ -46,6 +42,8 @@ export interface SessionOwnerStartInput {
|
|
|
46
42
|
}
|
|
47
43
|
/** Starts a successor owner and binds its output to the original session stream. */
|
|
48
44
|
export declare function startSessionOwnerStep(input: SessionOwnerStartInput): Promise<void>;
|
|
45
|
+
/** Sends one command to a session through its stable command inbox. */
|
|
46
|
+
export declare function dispatchWorkflowSessionCommand<TCommand extends SessionCommand>(input: DispatchSessionInput<TCommand>): Promise<SessionCommandResult<TCommand>>;
|
|
49
47
|
/** Requests cancellation through a session's stable command inbox. */
|
|
50
48
|
export declare function requestWorkflowTurnCancellation(input: CancelTurnInput): Promise<CancelTurnResult>;
|
|
51
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomBytes}from"node:crypto";import{createEveActivityRoutePath}from"#protocol/routes.js";import{createLogger,logError}from"#internal/logging.js";import{getChannelActivityPresentation}from"#channel/activity-renderer.js";import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{ActivityObserverKey}from"#context/keys.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{walkCauseChain}from"#shared/errors.js";import{normalizePersistedMessageStreamEvent}from"#protocol/message-version.js";import{cancelRun,getHookByToken,getRun,getWorld,start}from"#internal/workflow/runtime.js";import{serializeContext}from"#context/serialize.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{EntityConflictError,HookNotFoundError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{AcceptedSessionIdentityError,resolveSessionInbox,resumeSessionInbox}from"#execution/session-inbox/resume.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{buildSessionAttributes,buildSubagentRootAttributes,readParentLineage}from"#execution/eve-workflow-attributes.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{initializeSessionInstrumentation}from"#instrumentation/runtime.js";import{createWorkflowCallbackUrl,resolveWorkflowCallbackBaseUrl}from"#execution/workflow-callback-url.js";import{context,trace}from"#compiled/@opentelemetry/api/index.js";import{normalizeEveAttributes}from"#runtime/attributes/normalize.js";import{buildRunContext}from"#execution/runtime-context.js";import{parseNdjsonStream}from"#execution/ndjson-stream.js";import{SESSION_HANDOFF_VERSION}from"#execution/session/entry-input.js";import{buildInvocationAttributes}from"#internal/invocation/metadata.js";import{isAgentTraceContext}from"#tracing/agent-trace-context.js";import{ACTIVITY_COLLECTOR_WORKFLOW_NAME,SESSION_TIMEOUT_WORKFLOW_NAME,WORKFLOW_ENTRY_NAME,WORKFLOW_TOOL_RUN_WORKFLOW_NAME}from"#execution/stable-workflow-names.js";const EVE_PACKAGE_INFO=resolveInstalledPackageInfo(),COMMAND_HOOK_READY_TIMEOUT_MS=3e4,STABLE_ID_BASE=EVE_PACKAGE_INFO.name,log=createLogger(`execution.workflow-runtime`),workflowEntryReference={workflowId:`workflow//${STABLE_ID_BASE}//${WORKFLOW_ENTRY_NAME}`},sessionTimeoutWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${SESSION_TIMEOUT_WORKFLOW_NAME}`},activityCollectorWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${ACTIVITY_COLLECTOR_WORKFLOW_NAME}`},workflowToolRunWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${WORKFLOW_TOOL_RUN_WORKFLOW_NAME}`};function createWorkflowRuntime(e){return{async createSession(t){let n=await getCompiledRuntimeAgentBundle({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:e.nodeId}),r=buildRunContext({bundle:n,dynamicSubagentAgentConfig:e.dynamicSubagentAgentConfig,run:t}),i=resolveEffectiveAgentRuntime(n,r);initializeSessionInstrumentation({agentName:i.turnAgent.id,ctx:r});let a=i.limits?.sessionTimeoutMs,o=n.resolvedAgent.config?.experimental?.workflow?.retention,s,c=t.activityObserver;if(t.parent===void 0&&c===void 0&&(getChannelActivityPresentation(t.adapter)?.renderers.length??0)>0){let e=serializeContext(r),t=randomBytes(32).toString(`base64url`),n={expiresAt:new Date(Date.now()+(typeof a==`number`?a:864e5)).toISOString(),serializedContext:e,token:t};try{s=(await startWorkflowOnCurrentDeployment(activityCollectorWorkflowReference,[n],{experimental_retention:o})).runId;let e=process.env.VERCEL_URL?`https://${process.env.VERCEL_URL}`:`http://localhost:3000`,i=resolveWorkflowCallbackBaseUrl(e);c={sink:{url:createWorkflowCallbackUrl(i,createEveActivityRoutePath(t)),version:1}},r.set(ActivityObserverKey,c)}catch{await cancelActivityCollector(s),s=void 0,log.warn(`failed to start activity collector`)}}let l=serializeContext(r),u=readParentLineage(l),d={kind:`initial`,input:t.input,ownerDeploymentId:await resolveCurrentWorkflowDeploymentId(),serializedContext:l},f=t.taskId??t.callback?.taskId;t.limits!==void 0&&(d.limits=t.limits),f!==void 0&&(d.taskId=f),s!==void 0&&(d.activityCollectorRunId=s),t.continuationConflictCommand!==void 0&&(d.continuationConflictCommand=t.continuationConflictCommand),a!==void 0&&(d.sessionTimeoutMs=a),o!==void 0&&(d.retention=o);let p={...u.sessionId===void 0?buildSessionAttributes({serializedContext:l}):buildSubagentRootAttributes({identity:{nodeId:n.nodeId??ROOT_RUNTIME_AGENT_NODE_ID},parentCallId:u.callId,parentSessionId:u.sessionId,parentTurnId:u.turnId,rootSessionId:u.rootSessionId??u.sessionId,serializedContext:l}),...t.externalInvocation===void 0?{}:buildInvocationAttributes(t.externalInvocation)},m;try{let e={allowReservedAttributes:!0,attributes:normalizeEveAttributes(p)};o!==void 0&&(e.experimental_retention=o),m=await startWorkflowOnDeployment(workflowEntryReference,[d],d.ownerDeploymentId,e)}catch(e){throw await cancelActivityCollector(s),logError(log,`failed to start workflow run`,e,{continuationToken:t.continuationToken}),e}let h,getEvents=()=>(h??=parseNdjsonStream(()=>getRun(m.runId).getReadable(),normalizePersistedEvent),h);return{get events(){return getEvents()},sessionId:m.runId}},async dispatchContinuation(e){return await dispatchWorkflowCommand(e.continuationToken,e.command)},async dispatchSession(e){return await dispatchWorkflowCommand({sessionId:e.sessionId},e.command)},async getEventStream(e,t){return parseNdjsonStream(()=>getRun(e).getReadable({startIndex:t?.startIndex}),normalizePersistedEvent)},async getStreamTailIndex(e){let t=getRun(e).getReadable();try{return await t.getTailIndex()}finally{await t.cancel().catch(()=>{})}},async resolveContinuation(e){try{return await resolveSessionInbox(e)}catch(t){if(HookNotFoundError.is(t))return;throw logError(log,`failed to resolve session by continuation token`,t,{continuationToken:e}),t}}}}async function startSessionOwnerStep(e){"use step";let t={activationToken:e.activationToken,checkpoint:e.checkpoint,delivery:e.delivery,handoffVersion:SESSION_HANDOFF_VERSION,kind:`handoff`,ownerDeploymentId:e.targetDeploymentId,sessionWritable:getRun(e.anchorRunId).getWritable(),sessionId:e.anchorRunId};await startWorkflowOnDeployment(workflowEntryReference,[t],e.targetDeploymentId,e.checkpoint.retention===void 0?void 0:{experimental_retention:e.checkpoint.retention})}function normalizePersistedEvent(e){return normalizePersistedMessageStreamEvent(e)}async function cancelActivityCollector(e){if(e!==void 0)try{await cancelRun(await getWorld(),e,{cancelReason:`Root session creation did not complete`})}catch{log.warn(`failed to cancel unowned activity collector`)}}async function dispatchWorkflowCommand(e,t){let n;try{let r=await resumeSessionInbox(e,t);n={runId:r.ownerRunId,sessionId:await r.sessionId}}catch(n){if(isInactiveCommandTarget(n)){if(t.kind===`send`&&typeof e!=`string`)try{let t=await getRun(e.sessionId).status;if(t===`pending`||t===`running`)return{status:`session_not_active`,retryable:!0}}catch(e){if(!isInactiveCommandTarget(e))throw e}return inactiveCommandResult(t)}throw logError(log,`failed to dispatch session command`,n,{command:t.kind,token:e}),n}if(t.kind===`reset`){let t=typeof e==`string`?e:sessionCommandHookToken(e.sessionId),r=new Set([sessionCommandHookToken(n.sessionId),t]);await Promise.all([...r].map(e=>waitForHookRelease(sessionInboxHookToken(e),n.runId)))}return activeCommandResult(t,n.sessionId)}function activeCommandResult(e,t){return e.kind===`reset`?{previousSessionId:t,status:`reset`}:e.kind===`send`&&e.delivery!==void 0?{sessionId:t,status:`accepted`,deliveryId:e.delivery.deliveryId}:{sessionId:t,status:`accepted`}}function inactiveCommandResult(e){return e.kind===`send`?{status:`session_not_active`}:e.kind===`cancel`?{status:`no_active_turn`}:{status:`no_active_session`}}async function requestWorkflowTurnCancellation(e){let t={kind:`cancel`};return e.taskId!==void 0&&(t.taskId=e.taskId),e.tasks!==void 0&&(t.tasks=e.tasks),e.turnId!==void 0&&(t.turnId=e.turnId),await dispatchWorkflowCommand({sessionId:e.sessionId},t)}function isInactiveCommandTarget(e){if(e instanceof AcceptedSessionIdentityError)return!1;if(HookNotFoundError.is(e))return!0;for(let t of walkCauseChain(e))if(WorkflowRunNotFoundError.is(t)||RunExpiredError.is(t)||EntityConflictError.is(t))return!0;return!1}async function waitForCommandHookOwner(e){let t=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;)try{return normalizeWorkflowHook(await getHookByToken(e))}catch(e){if(!HookNotFoundError.is(e)||Date.now()>=t)throw e;await new Promise(e=>setTimeout(e,20))}}async function waitForHookRelease(e,t){let n=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;){try{if(normalizeWorkflowHook(await getHookByToken(e)).runId!==t)return}catch(e){if(HookNotFoundError.is(e))return;throw e}if(Date.now()>=n)throw Error(`Timed out waiting for session "${t}" to release inbox "${e}".`);await new Promise(e=>setTimeout(e,20))}}async function startWorkflowOnCurrentDeployment(e,t,n){return await startWorkflowOnDeployment(e,t,await resolveCurrentWorkflowDeploymentId(),n)}async function startWorkflowOnDeployment(e,t,n,r){return await withWorkflowStartContext(async()=>{if(n.length===0||n===`latest`)throw Error(`Workflow starts require an exact deployment id.`);return await start(e,t,{...r,deploymentId:n})})}async function resolveCurrentWorkflowDeploymentId(){let e=process.env.VERCEL_DEPLOYMENT_ID?.trim()||await(await getWorld()).getDeploymentId();if(e.length===0||e===`latest`)throw Error(`Workflow runtime could not resolve an exact deployment id.`);return e}async function withWorkflowStartContext(e){let t=context.active(),n=isAgentTraceContext(t)?trace.deleteSpan(t):t;return await context.with(n,e)}function normalizeWorkflowHook(e){if(typeof e!=`object`||!e||!(`runId`in e))throw Error(`Workflow hook did not include a run id.`);let t=e.runId;if(typeof t!=`string`||t.length===0)throw Error(`Workflow hook did not include a run id.`);return{runId:t}}export{activityCollectorWorkflowReference,createWorkflowRuntime,requestWorkflowTurnCancellation,sessionTimeoutWorkflowReference,startSessionOwnerStep,startWorkflowOnCurrentDeployment,waitForCommandHookOwner,workflowEntryReference,workflowToolRunWorkflowReference};
|
|
1
|
+
import{createLogger,logError}from"#internal/logging.js";import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{walkCauseChain}from"#shared/errors.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{serializeContext}from"#context/serialize.js";import{AcceptedSessionIdentityError,resolveSessionInbox,resumeSessionInbox}from"#execution/session-inbox/resume.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{EntityConflictError,HookNotFoundError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{getHookByToken,getRun,getWorld,start}from"#internal/workflow/runtime.js";import{initializeSessionInstrumentation}from"#instrumentation/runtime.js";import{buildSessionAttributes,buildSubagentRootAttributes,readParentLineage}from"#execution/eve-workflow-attributes.js";import{context,trace}from"#compiled/@opentelemetry/api/index.js";import{normalizeEveAttributes}from"#runtime/attributes/normalize.js";import{buildRunContext}from"#execution/runtime-context.js";import{readSessionEventStream,readSessionStreamTailIndex}from"#execution/session-event-stream.js";import{SESSION_HANDOFF_VERSION}from"#execution/session/entry-input.js";import{buildInvocationAttributes}from"#internal/invocation/metadata.js";import{isAgentTraceContext}from"#tracing/agent-trace-context.js";import{SESSION_TIMEOUT_WORKFLOW_NAME,WORKFLOW_ENTRY_NAME,WORKFLOW_TOOL_RUN_WORKFLOW_NAME}from"#execution/stable-workflow-names.js";const EVE_PACKAGE_INFO=resolveInstalledPackageInfo(),COMMAND_HOOK_READY_TIMEOUT_MS=3e4,STABLE_ID_BASE=EVE_PACKAGE_INFO.name,log=createLogger(`execution.workflow-runtime`),workflowEntryReference={workflowId:`workflow//${STABLE_ID_BASE}//${WORKFLOW_ENTRY_NAME}`},sessionTimeoutWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${SESSION_TIMEOUT_WORKFLOW_NAME}`},workflowToolRunWorkflowReference={workflowId:`workflow//${STABLE_ID_BASE}//${WORKFLOW_TOOL_RUN_WORKFLOW_NAME}`};function createWorkflowRuntime(e){return{async createSession(t){let n=await getCompiledRuntimeAgentBundle({compiledArtifactsSource:e.compiledArtifactsSource,nodeId:e.nodeId}),r=buildRunContext({bundle:n,dynamicSubagentAgentConfig:e.dynamicSubagentAgentConfig,run:t}),i=resolveEffectiveAgentRuntime(n,r);initializeSessionInstrumentation({agentName:i.turnAgent.id,ctx:r});let a=i.limits?.sessionTimeoutMs,o=n.resolvedAgent.config?.experimental?.workflow?.retention,s=serializeContext(r),c=readParentLineage(s),l={kind:`initial`,input:t.input,ownerDeploymentId:await resolveCurrentWorkflowDeploymentId(),serializedContext:s};t.limits!==void 0&&(l.limits=t.limits),t.continuationConflictCommand!==void 0&&(l.continuationConflictCommand=t.continuationConflictCommand),a!==void 0&&(l.sessionTimeoutMs=a),o!==void 0&&(l.retention=o);let u={...c.sessionId===void 0?buildSessionAttributes({serializedContext:s}):buildSubagentRootAttributes({identity:{nodeId:n.nodeId??ROOT_RUNTIME_AGENT_NODE_ID},parentCallId:c.callId,parentSessionId:c.sessionId,parentTurnId:c.turnId,rootSessionId:c.rootSessionId??c.sessionId,serializedContext:s}),...t.externalInvocation===void 0?{}:buildInvocationAttributes(t.externalInvocation)},d;try{let e={allowReservedAttributes:!0,attributes:normalizeEveAttributes(u)};o!==void 0&&(e.experimental_retention=o),d=await startWorkflowOnDeployment(workflowEntryReference,[l],l.ownerDeploymentId,e)}catch(e){throw logError(log,`failed to start workflow run`,e,{continuationToken:t.continuationToken}),e}let f,getEvents=()=>(f??=readSessionEventStream(d.runId),f);return{get events(){return getEvents()},sessionId:d.runId}},async dispatchContinuation(e){return await dispatchWorkflowCommand(e.continuationToken,e.command)},async dispatchSession(e){return await dispatchWorkflowSessionCommand(e)},async getEventStream(e,t){return readSessionEventStream(e,t?.startIndex)},async getStreamTailIndex(e){return await readSessionStreamTailIndex(e)},async resolveContinuation(e){try{return await resolveSessionInbox(e)}catch(t){if(HookNotFoundError.is(t))return;throw logError(log,`failed to resolve session by continuation token`,t,{continuationToken:e}),t}}}}async function startSessionOwnerStep(e){"use step";let t={activationToken:e.activationToken,checkpoint:e.checkpoint,delivery:e.delivery,handoffVersion:SESSION_HANDOFF_VERSION,kind:`handoff`,ownerDeploymentId:e.targetDeploymentId,sessionWritable:getRun(e.anchorRunId).getWritable(),sessionId:e.anchorRunId};await startWorkflowOnDeployment(workflowEntryReference,[t],e.targetDeploymentId,e.checkpoint.retention===void 0?void 0:{experimental_retention:e.checkpoint.retention})}async function dispatchWorkflowCommand(e,t){let n;try{let r=await resumeSessionInbox(e,t);n={runId:r.ownerRunId,sessionId:await r.sessionId}}catch(n){if(isInactiveCommandTarget(n)){if(t.kind===`send`&&typeof e!=`string`)try{let t=await getRun(e.sessionId).status;if(t===`pending`||t===`running`)return{status:`session_not_active`,retryable:!0}}catch(e){if(!isInactiveCommandTarget(e))throw e}return inactiveCommandResult(t)}throw logError(log,`failed to dispatch session command`,n,{command:t.kind,token:e}),n}if(t.kind===`reset`){let t=typeof e==`string`?e:sessionCommandHookToken(e.sessionId),r=new Set([sessionCommandHookToken(n.sessionId),t]);await Promise.all([...r].map(e=>waitForHookRelease(sessionInboxHookToken(e),n.runId)))}return activeCommandResult(t,n.sessionId)}function activeCommandResult(e,t){return e.kind===`reset`?{previousSessionId:t,status:`reset`}:e.kind===`send`&&e.delivery!==void 0?{sessionId:t,status:`accepted`,deliveryId:e.delivery.deliveryId}:{sessionId:t,status:`accepted`}}function inactiveCommandResult(e){return e.kind===`send`?{status:`session_not_active`}:e.kind===`cancel`?{status:`no_active_turn`}:{status:`no_active_session`}}async function dispatchWorkflowSessionCommand(e){return await dispatchWorkflowCommand({sessionId:e.sessionId},e.command)}async function requestWorkflowTurnCancellation(e){let t={kind:`cancel`};return e.turnId!==void 0&&(t.turnId=e.turnId),await dispatchWorkflowCommand({sessionId:e.sessionId},t)}function isInactiveCommandTarget(e){if(e instanceof AcceptedSessionIdentityError)return!1;if(HookNotFoundError.is(e))return!0;for(let t of walkCauseChain(e))if(WorkflowRunNotFoundError.is(t)||RunExpiredError.is(t)||EntityConflictError.is(t))return!0;return!1}async function waitForCommandHookOwner(e){let t=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;)try{return normalizeWorkflowHook(await getHookByToken(e))}catch(e){if(!HookNotFoundError.is(e)||Date.now()>=t)throw e;await new Promise(e=>setTimeout(e,20))}}async function waitForHookRelease(e,t){let n=Date.now()+COMMAND_HOOK_READY_TIMEOUT_MS;for(;;){try{if(normalizeWorkflowHook(await getHookByToken(e)).runId!==t)return}catch(e){if(HookNotFoundError.is(e))return;throw e}if(Date.now()>=n)throw Error(`Timed out waiting for session "${t}" to release inbox "${e}".`);await new Promise(e=>setTimeout(e,20))}}async function startWorkflowOnCurrentDeployment(e,t,n){return await startWorkflowOnDeployment(e,t,await resolveCurrentWorkflowDeploymentId(),n)}async function startWorkflowOnDeployment(e,t,n,r){return await withWorkflowStartContext(async()=>{if(n.length===0||n===`latest`)throw Error(`Workflow starts require an exact deployment id.`);return await start(e,t,{...r,deploymentId:n})})}async function resolveCurrentWorkflowDeploymentId(){let e=process.env.VERCEL_DEPLOYMENT_ID?.trim()||await(await getWorld()).getDeploymentId();if(e.length===0||e===`latest`)throw Error(`Workflow runtime could not resolve an exact deployment id.`);return e}async function withWorkflowStartContext(e){let t=context.active(),n=isAgentTraceContext(t)?trace.deleteSpan(t):t;return await context.with(n,e)}function normalizeWorkflowHook(e){if(typeof e!=`object`||!e||!(`runId`in e))throw Error(`Workflow hook did not include a run id.`);let t=e.runId;if(typeof t!=`string`||t.length===0)throw Error(`Workflow hook did not include a run id.`);return{runId:t}}export{createWorkflowRuntime,dispatchWorkflowSessionCommand,requestWorkflowTurnCancellation,sessionTimeoutWorkflowReference,startSessionOwnerStep,startWorkflowOnCurrentDeployment,waitForCommandHookOwner,workflowEntryReference,workflowToolRunWorkflowReference};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{walkCauseChain}from"#shared/errors.js";import{
|
|
1
|
+
import{walkCauseChain}from"#shared/errors.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{resumeWebhook}from"#internal/workflow/runtime.js";const WORKFLOW_WEBHOOK_ROUTE_PATTERN=`/.well-known/workflow/v1/webhook/:token`;async function handleWorkflowWebhookRequest(e,t){let n=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing webhook token.`,ok:!1},{status:400});try{let t=new Request(e.url,{method:e.method,headers:new Headers(e.headers),body:e.body,signal:e.signal,duplex:`half`});return await resumeWebhook(n,t)}catch(e){for(let t of walkCauseChain(e))if(HookNotFoundError.is(t))return Response.json({error:`Webhook not pending.`,ok:!1},{status:404});throw e}}export{WORKFLOW_WEBHOOK_ROUTE_PATTERN,handleWorkflowWebhookRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../extension.js";import{
|
|
1
|
+
import"../extension.js";import{authenticateVercel}from"./credentials.js";import{ConnectError,ConnectorInstallationRequiredError,getToken}from"#compiled/@vercel/connect/index.js";async function authenticateTurn(e,t,n=getToken){if(e.vercel===void 0)return;let r=await t(),i=await resolveToken(e.vercel.connector,{subject:{type:`app`}},n);await authenticateVercel(r,{token:i,delivery:e.vercel.delivery,broker:e.broker})}async function resolveToken(e,t,n){try{let r=await n(e,t);if(r.length===0)throw Error(`Connect returned an empty token`);return r}catch(t){let n=t instanceof ConnectorInstallationRequiredError?`connector installation is required`:t instanceof ConnectError?`Connect rejected the token request`:`Connect token request failed`,r=t instanceof Error?t.message:String(t);throw Error(`${n} for ${JSON.stringify(e)}: ${r}`,{cause:t})}}export{authenticateTurn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{shellQuote}from"./shell.js";import{toolingPaths}from"./tooling.js";import{validateRepositoryRoot}from"./repository-root.js";import{posix}from"node:path";import{getToken}from"#compiled/@vercel/connect/index.js";const MAX_OUTPUT_BYTES=1e5,leaseQueues=new Map,ALLOWED_GIT_REMOTE_COMMANDS=new Set([`fetch`,`ls-remote`,`pull`,`push`]);function githubShellApproval(e){if(!e)return`not-applicable`;try{return validateGitHubShellInput(e),`not-applicable`}catch(e){return{type:`denied`,reason:e instanceof Error?e.message:`Invalid GitHub command.`}}}async function executeGitHubShell(e,t,n){if(!t)throw Error(`GitHub command access is not configured for this agent.`);let r=validateGitHubShellInput(e),i=await n.getSandbox(),a=resolveWorkingDirectory(i,e.workingDirectory);(r[0]===`git`||r[0]===`gh-signed-commit`)&&(a=await validateRepositoryRoot(i,a));let o=e.permissions[0].repositories,s=await assertCommandTargets(r,o,a,i),c=repositoryNames(o,t.org),l={authorizationDetails:[{type:`github_app_installation`,org:t.org,repositories:c}],subject:{type:`app`}},u=await(n.getConnectToken??getToken)(t.connector,l);if(!u)throw Error(`Connect returned an empty token for ${JSON.stringify(t.connector)}.`);let d=executablePath(r[0],i),f=s?[`-c`,`protocol.allow=never`,`-c`,`protocol.https.allow=always`,r[1],`https://github.com/${s}.git`,...r.slice(3)]:r.slice(1),p=`cd ${shellQuote(a)} && exec ${shellQuote(d)} ${f.map(shellQuote).join(` `)}`,m=`Basic ${Buffer.from(`x-access-token:${u}`).toString(`base64`)}`,h=crypto.randomUUID(),g=`eve-github-${h}`,_=`/tmp/eve-code-gh-${h}`,v=`Basic ${Buffer.from(`x-access-token:${g}`).toString(`base64`)}`,y;try{y=await withGitHubCredentialLease(i,n.sessionId,{authorization:m,placeholder:g,placeholderAuthorization:v,token:u},()=>{let e={GH_CONFIG_DIR:_,GH_PROMPT_DISABLED:`1`};return r[0]!==`git`&&(e.GH_TOKEN=g),e.GIT_CONFIG_COUNT=`2`,e.GIT_CONFIG_KEY_0=`http.https://github.com/.extraheader`,e.GIT_CONFIG_VALUE_0=`Authorization: ${v}`,e.GIT_CONFIG_KEY_1=`core.hooksPath`,e.GIT_CONFIG_VALUE_1=`/dev/null`,e.GIT_TERMINAL_PROMPT=`0`,e.PATH=`/usr/local/bin:/usr/bin:/bin`,i.run({command:p,env:e})},t.broker)}finally{await i.removePath({path:_,recursive:!0,force:!0})}let b=sanitizeOutput(y.stdout,u,m),x=sanitizeOutput(y.stderr,u,m);return{exitCode:y.exitCode,stdout:b.value,stderr:x.value,truncated:b.truncated||x.truncated}}async function withGitHubCredentialLease(e,t,n,r,i){let a=leaseQueues.get(t)??Promise.resolve(),o,s=new Promise(e=>{o=e}),c=a.then(()=>s);leaseQueues.set(t,c),await a;try{return await i(e,{"api.github.com":[{match:{headers:[{key:{exact:`authorization`},value:{regex:`^(?:token|Bearer) ${n.placeholder}$`}}]},transform:[{headers:{authorization:`Bearer ${n.token}`}}]}],"github.com":[{match:{headers:[{key:{exact:`authorization`},value:{exact:n.placeholderAuthorization}}]},transform:[{headers:{authorization:n.authorization}}]}]}),await r()}finally{try{await i(e,null)}finally{o(),leaseQueues.get(t)===c&&leaseQueues.delete(t)}}}function parseCommand(e){let t=e.trim();if(!t)throw Error(`GitHub command must not be empty.`);let n=[],r=``,i=null,a=!1,o=!1;for(let e of t){if(a){r+=e,a=!1,o=!0;continue}if(e===`\\`&&i!==`single`){a=!0,o=!0;continue}if(i===`single`){e===`'`?i=null:r+=e;continue}if(i===`double`){if(e===`"`)i=null;else if(e===`$`||e==="`")throw unsupportedSyntax();else r+=e;continue}if(e===`'`)i=`single`,o=!0;else if(e===`"`)i=`double`,o=!0;else if(/\s/u.test(e))o&&=(n.push(r),r=``,!1);else if(";&|<>$`(){}".includes(e))throw unsupportedSyntax();else r+=e,o=!0}if(a||i)throw Error(`GitHub command contains an unfinished quote or escape.`);if(o&&n.push(r),n.length===0)throw Error(`GitHub command must not be empty.`);return n}function validateGitHubShellInput(e){let t=parseCommand(e.command),n=e.permissions[0];if(e.permissions.length!==1||n?.provider!==`github`)throw Error(`Exactly one GitHub permission is required.`);if(n.access!==`write`)throw Error(`GitHub App commands require explicit write-capable access.`);if(!e.description.trim())throw Error(`description must describe the intended result.`);let[r,i]=t;if(r===`gh`){if(!i)throw Error(`A gh subcommand is required.`)}else if(r===`git`){if(!i||!ALLOWED_GIT_REMOTE_COMMANDS.has(i))throw Error(`Authenticated git supports only fetch, ls-remote, pull, and push; clone with gh repo clone.`)}else if(r!==`gh-signed-commit`)throw Error(`GitHub commands must use gh, an authenticated git remote command, or gh-signed-commit.`);return t}async function assertCommandTargets(e,t,n,r){let i=new Set(t.map(e=>e.toLowerCase())),a,o;if(e[0]===`git`){if(e[2]!==`origin`)throw Error(`Authenticated git commands must use the validated origin remote.`);let t=e[1]===`push`,i=await r.run({command:`cd ${shellQuote(n)} && git remote get-url ${t?`--push `:``}origin`,env:{GIT_TERMINAL_PROMPT:`0`,PATH:`/usr/bin:/bin`}});if(i.exitCode!==0)throw Error(`Could not resolve the origin GitHub repository.`);a=repositoryFromRemote(i.stdout.trim()),o=[a]}else if(e[0]===`gh-signed-commit`){if(o=repoFlagTargets(e.slice(1)),o.length===0)throw Error(`gh-signed-commit requires an explicit --repo owner/repository target.`)}else o=repoFlagTargets(e.slice(1)),e[1]===`repo`&&(e[2]===`clone`||e[2]===`view`||e[2]===`fork`)&&e[3]&&!e[3].startsWith(`-`)&&o.push(canonicalRepository(e[3]));for(let e of o)if(!i.has(e.toLowerCase()))throw Error(`Command target ${JSON.stringify(e)} is not in the declared repositories.`);return a}function repoFlagTargets(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`--repo`||r===`-R`){let i=e[n+1];if(!i)throw Error(`${r} requires an owner/repository value.`);t.push(canonicalRepository(i)),n+=1}else r?.startsWith(`--repo=`)&&t.push(canonicalRepository(r.slice(7)))}return t}function repositoryFromRemote(e){let t=/^https:\/\/github\.com\/([^/]+\/[^/]+?)(?:\.git)?$/iu.exec(e);if(t?.[1])return canonicalRepository(t[1]);let n=/^git@github\.com:([^/]+\/[^/]+?)(?:\.git)?$/iu.exec(e);if(n?.[1])return canonicalRepository(n[1]);throw Error(`The origin remote is not a canonical GitHub repository URL.`)}function canonicalRepository(e){let t=e.replace(/\.git$/iu,``);if(!/^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/u.test(t))throw Error(`Invalid GitHub repository ${JSON.stringify(e)}.`);return t}function repositoryNames(e,t){if(e.length!==1)throw Error(`Exactly one GitHub repository is required.`);let n=new Set;for(let r of e){let e=/^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)$/u.exec(r);if(!e)throw Error(`Invalid GitHub repository ${JSON.stringify(r)}.`);if(e[1]?.toLowerCase()!==t.toLowerCase())throw Error(`Repository ${JSON.stringify(r)} is outside ${t}.`);n.add(e[2])}if(n.size!==1)throw Error(`Exactly one GitHub repository is required.`);return[...n]}function executablePath(e,t){return e===`gh`?toolingPaths(t).ghReal:e===`gh-signed-commit`?toolingPaths(t).trustedSignedCommit:`git`}function resolveWorkingDirectory(e,t){let n=posix.resolve(`/`,e.resolvePath(``)),r=posix.resolve(`/`,e.resolvePath(t?.trim()||``));if(r!==n&&!r.startsWith(`${n}/`))throw Error(`GitHub command workingDirectory must stay inside the sandbox workspace.`);return r}function sanitizeOutput(e,t,n){let r=e.replaceAll(t,`[redacted]`).replaceAll(n,`[redacted]`);return Buffer.byteLength(r)<=MAX_OUTPUT_BYTES?{value:r,truncated:!1}:{value:`[output truncated: showing final ${MAX_OUTPUT_BYTES} bytes]\n${Buffer.from(r).subarray(-1e5).toString()}`,truncated:!0}}function unsupportedSyntax(){return Error(`GitHub commands support argv syntax only, not pipes, redirects, substitutions, or shell operators.`)}export{executeGitHubShell,githubShellApproval,parseCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import extension_default from"../extension.js";import{
|
|
1
|
+
import extension_default from"../extension.js";import{z}from"#compiled/zod/index.js";import{deleteTokenCacheEntry,getToken}from"#compiled/@vercel/connect/index.js";const RepoSchema=z.string().trim().regex(/^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/u).transform(e=>e.toLowerCase()),PullRequestWatchInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive(),reviewOwner:z.string().trim().min(1),redHeadOid:z.string().regex(/^[0-9a-f]{40}$/iu).transform(e=>e.toLowerCase())}),PrwatchDeleteInputSchema=z.object({repo:RepoSchema,pullRequestNumber:z.number().int().positive()}),PullRequestSchema=z.object({head:z.object({sha:z.string().min(1)}),html_url:z.string().url(),merged:z.boolean().optional().default(!1),state:z.enum([`open`,`closed`])}),ReviewSchema=z.object({commit_id:z.string().nullable(),state:z.string(),submitted_at:z.string().nullable(),user:z.object({login:z.string()}).nullable()});function initialPullRequestWatchNotificationState(){return{previousSnapshot:null,redHeadPolls:0,redHeadWakeSent:!1}}function framePullRequestWatchWake(e){return`${e}\n\nThis is an internal watch wake, not a request for a progress report. Continue any necessary work. Send a user-facing response only when the original request is complete or a new blocker requires human input. Do not report that nothing changed or that work is still in progress.`}function reviewFingerprint(e){return e?.ownerReviewState===null||e===null?null:`${e.ownerReviewState}:${e.ownerReviewSubmittedAt??``}`}function advancePullRequestWatchNotification(e){let t=e.state.previousSnapshot,n=e.snapshot.headOid!==(t?.headOid??e.redHeadOid),r=t!==null&&reviewFingerprint(e.snapshot)!==reviewFingerprint(t),i=e.snapshot.headOid===e.redHeadOid,a=i?e.state.redHeadPolls+1:0,o=null;return n?o=`head_changed`:r?o=`owner_review_changed`:i&&!e.state.redHeadWakeSent&&a===e.staleAfterPolls&&(o=`red_head_stalled`),{state:{previousSnapshot:e.snapshot,redHeadPolls:a,redHeadWakeSent:e.state.redHeadWakeSent||o===`red_head_stalled`},wakeReason:o}}var RetryablePullRequestWatchError=class extends Error{},GitHubWatchResponseError=class extends Error{status;constructor(e,t){super(t),this.name=`GitHubWatchResponseError`,this.status=e}};function errorStatus(e){return typeof e!=`object`||!e||!(`status`in e)?null:typeof e.status==`number`?e.status:null}function shouldRefreshPullRequestWatchToken(e){return errorStatus(e)===401}function isRetryablePullRequestWatchError(e){let t=errorStatus(e);return t===429||t!==null&&t>=500||e instanceof RetryablePullRequestWatchError||e instanceof TypeError||e instanceof Error&&(/^GitHub watch (?:request|token request) failed:/u.test(e.message)||/\((?:429|5\d{2})\b/u.test(e.message))}function pullRequestWatchSnapshot(e){let t=e.reviewOwner.toLowerCase(),n=e.pullRequest.head.sha.toLowerCase(),r=e.reviews.filter(e=>e.commit_id?.toLowerCase()===n&&e.user?.login.toLowerCase()===t).at(-1);return{headOid:n,ownerApprovedCurrentHead:r?.state.toUpperCase()===`APPROVED`,ownerReviewState:r?.state.toUpperCase()??null,ownerReviewSubmittedAt:r?.submitted_at??null,state:e.pullRequest.merged?`merged`:e.pullRequest.state,url:e.pullRequest.html_url}}function repoParts(e){let[t,n]=e.split(`/`);if(t===void 0||n===void 0)throw Error(`Invalid GitHub repository: ${e}`);return{owner:t,name:n}}function repoFullName(e){let t=repoParts(e);return`${t.owner}/${t.name}`}function repoApiPath(e){let t=repoParts(e);return`/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.name)}`}function redactGithubToken(e,t){return t.length===0?e:e.split(t).join(`[redacted]`)}function githubHeaders(e){return{Accept:`application/vnd.github+json`,Authorization:`Bearer ${e}`,"X-GitHub-Api-Version":`2022-11-28`}}function githubTokenParams(e,t){return{authorizationDetails:[{org:e,repositories:[t],type:`github_app_installation`}],subject:{type:`app`}}}async function mintWatchToken(e){let t=extension_default.config.github;if(t===void 0)throw Error(`GitHub is not configured for this agent.`);let n=repoParts(e);if(n.owner!==t.org.toLowerCase())throw Error(`Repository ${e} is outside ${t.org}.`);let r=await getToken(t.connector,githubTokenParams(t.org,n.name));if(r.length===0)throw Error(`Connect returned an empty GitHub token for ${e}.`);return r}async function invalidateWatchToken(e){let t=extension_default.config.github;if(t===void 0)return;let n=repoParts(e);deleteTokenCacheEntry(t.connector,githubTokenParams(t.org,n.name))}async function githubJson(e,t){let n;try{n=await fetch(e,{headers:githubHeaders(t)})}catch(e){throw new RetryablePullRequestWatchError(`GitHub watch request failed: ${e instanceof Error?e.message:String(e)}`)}if(n.ok)return n.json();let r=await n.text().catch(()=>``),i=`GitHub request failed (${n.status} ${n.statusText})`+(r.length>0?`: ${redactGithubToken(r,t)}`:``);throw n.status===429||n.status>=500?new RetryablePullRequestWatchError(i):new GitHubWatchResponseError(n.status,i)}async function readPullRequestWatchSnapshotWithToken(e,t){let n=`https://api.github.com${repoApiPath(e.repo)}/pulls/${e.pullRequestNumber}`,r=PullRequestSchema.parse(await githubJson(n,t));if(r.state===`closed`||r.merged)return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:[]});let i=[];for(let r=1;r<=20;r+=1){let a=z.array(ReviewSchema).parse(await githubJson(`${n}/reviews?per_page=100&page=${r}`,t));if(i.push(...a),a.length<100)break;if(r===20)throw Error(`PR #${e.pullRequestNumber} has too many reviews to verify`)}return pullRequestWatchSnapshot({pullRequest:r,reviewOwner:e.reviewOwner,reviews:i})}async function readPullRequestWatchSnapshot(e){for(let t=0;t<2;t+=1){let n;try{n=await mintWatchToken(e.repo)}catch(e){throw isRetryablePullRequestWatchError(e)?new RetryablePullRequestWatchError(`GitHub watch token request failed: ${e instanceof Error?e.message:String(e)}`):e}try{return await readPullRequestWatchSnapshotWithToken(e,n)}catch(n){if(t>0||!shouldRefreshPullRequestWatchToken(n))throw n;await invalidateWatchToken(e.repo)}}throw Error(`Pull request watch token refresh exhausted unexpectedly.`)}export{PrwatchDeleteInputSchema,PullRequestWatchInputSchema,advancePullRequestWatchNotification,framePullRequestWatchWake,initialPullRequestWatchNotificationState,isRetryablePullRequestWatchError,pullRequestWatchSnapshot,readPullRequestWatchSnapshot,repoFullName,shouldRefreshPullRequestWatchToken};
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import type { SandboxSession } from "eve/sandbox";
|
|
3
3
|
type ToolingSandbox = Pick<SandboxSession, "resolvePath" | "run" | "writeTextFile">;
|
|
4
4
|
/** Include in the consumer's sandbox `revalidationKey` so cached templates rebuild when the tooling changes. */
|
|
5
|
-
export declare const CODE_TOOLING_REVALIDATION_KEY = "eve-code-tooling:3:
|
|
5
|
+
export declare const CODE_TOOLING_REVALIDATION_KEY = "eve-code-tooling:3:3:6.0.3";
|
|
6
6
|
/** Install CLI wrappers, signed commits, and TypeScript diagnostics. */
|
|
7
7
|
export declare function installCodeTooling(sandbox: ToolingSandbox, options?: {
|
|
8
8
|
readonly vercel?: boolean;
|
|
9
9
|
}): Promise<void>;
|
|
10
10
|
export { authenticateGitHub, authenticateVercel, type BrokeredCredentialOptions, } from "./credentials.ts";
|
|
11
|
-
|
|
11
|
+
/** @deprecated Import from `eve/computer-use/sandbox` and mount `eve/computer-use`. */
|
|
12
|
+
export { COMPUTER_USE_REVALIDATION_KEY, installComputerUse, startComputerUse, } from "eve/computer-use/sandbox";
|
|
12
13
|
export { executeGitHubShell, githubShellApproval, type GitHubLeaseRule, type GitHubShellInput, type GitHubShellOutput, } from "./github-shell.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{GH_SIGNED_COMMIT_SOURCE}from"./signed-commit.js";import{DIAGNOSTICS_WORKER_SOURCE,TYPESCRIPT_VERSION,ghWrapperSource,toolingPaths,typescriptInstallCommand,vercelWrapperSource}from"./tooling.js";import{authenticateGitHub,authenticateVercel}from"./credentials.js";import{commandFailureDetail}from"./command-failure.js";import{
|
|
1
|
+
import{GH_SIGNED_COMMIT_SOURCE}from"./signed-commit.js";import{DIAGNOSTICS_WORKER_SOURCE,TYPESCRIPT_VERSION,ghWrapperSource,toolingPaths,typescriptInstallCommand,vercelWrapperSource}from"./tooling.js";import{authenticateGitHub,authenticateVercel}from"./credentials.js";import{commandFailureDetail}from"./command-failure.js";import{executeGitHubShell,githubShellApproval}from"./github-shell.js";import{COMPUTER_USE_REVALIDATION_KEY,installComputerUse,startComputerUse}from"eve/computer-use/sandbox";const CODE_TOOLING_REVALIDATION_KEY=`eve-code-tooling:3:3:${TYPESCRIPT_VERSION}`;async function installCodeTooling(e,t={}){let n=toolingPaths(e);await Promise.all([e.writeTextFile({path:n.ghWrapper,content:ghWrapperSource(e)}),e.writeTextFile({path:n.signedCommit,content:GH_SIGNED_COMMIT_SOURCE}),e.writeTextFile({path:n.workerSource,content:DIAGNOSTICS_WORKER_SOURCE}),...t.vercel===!0?[e.writeTextFile({path:n.vercelWrapper,content:vercelWrapperSource(e)})]:[]]);let r=await e.run({command:toolingInstallCommand(e,t.vercel===!0)});if(r.exitCode!==0)throw Error(`eve-code tooling installation failed (exit ${r.exitCode}): ${commandFailureDetail(r)}`)}function toolingInstallCommand(e,t){let n=toolingPaths(e),quote=e=>`'${e.replaceAll(`'`,`'"'"'`)}'`;return[`set -e`,`mkdir -p ${quote(n.root)}`,`if ! command -v gh >/dev/null 2>&1; then`,` command -v apt-get >/dev/null 2>&1 || { echo 'eve-code requires gh or apt-get' >&2; exit 1; }`,` if [ "$(id -u)" = 0 ]; then APT=apt-get; else command -v sudo >/dev/null 2>&1 || { echo 'eve-code needs root or sudo to install gh' >&2; exit 1; }; APT='sudo -n apt-get'; fi`,` $APT update && $APT install -y gh`,`fi`,`chmod 755 ${quote(n.ghWrapper)} ${quote(n.signedCommit)}`,`if [ "$(id -u)" = 0 ]; then INSTALL=install; else INSTALL='sudo -n install'; fi`,`$INSTALL -d -o root -g root -m 755 ${quote(n.trustedRoot)} ${quote(n.typescriptRoot)}`,`[ -x /usr/bin/gh ] || { echo 'eve-code requires gh at /usr/bin/gh' >&2; exit 1; }`,`$INSTALL -m 755 /usr/bin/gh ${quote(n.ghReal)}`,`$INSTALL -m 755 ${quote(n.signedCommit)} ${quote(n.trustedSignedCommit)}`,`$INSTALL -m 644 ${quote(n.workerSource)} ${quote(n.worker)}`,`$INSTALL -m 755 ${quote(n.ghWrapper)} /usr/local/bin/gh`,`$INSTALL -m 755 ${quote(n.trustedSignedCommit)} /usr/local/bin/gh-signed-commit`,typescriptInstallCommand(e),...t?[`if [ "$(id -u)" = 0 ]; then npm install -g vercel@latest; else sudo -n npm install -g vercel@latest; fi`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vercel`,`$INSTALL -m 755 ${quote(n.vercelWrapper)} /usr/local/bin/vc`]:[]].join(`
|
|
2
2
|
`)}export{CODE_TOOLING_REVALIDATION_KEY,COMPUTER_USE_REVALIDATION_KEY,authenticateGitHub,authenticateVercel,executeGitHubShell,githubShellApproval,installCodeTooling,installComputerUse,startComputerUse};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const GH_SIGNED_COMMIT_VERSION = "
|
|
1
|
+
export declare const GH_SIGNED_COMMIT_VERSION = "3";
|
|
2
2
|
export declare const GH_SIGNED_COMMIT_SOURCE: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const GH_SIGNED_COMMIT_VERSION=`
|
|
1
|
+
const GH_SIGNED_COMMIT_VERSION=`3`,GH_SIGNED_COMMIT_SOURCE=String.raw`#!/usr/bin/env node
|
|
2
2
|
const { execFileSync } = require("node:child_process");
|
|
3
3
|
|
|
4
4
|
const args = process.argv.slice(2);
|
|
@@ -120,7 +120,7 @@ async function request(method, path, body) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function git(...values) {
|
|
123
|
-
return execFileSync("git", values, { stdio: ["ignore", "pipe", "inherit"] });
|
|
123
|
+
return execFileSync("git", values, { stdio: ["ignore", "pipe", "inherit"], maxBuffer: Infinity });
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
function fail(message) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as apply_patch } from "./extension/tools/apply_patch.ts";
|
|
2
|
-
|
|
2
|
+
/** @deprecated Import from `eve/computer-use/tools` and mount `eve/computer-use`. */
|
|
3
|
+
export { computer_use } from "../../computer-use/tools.ts";
|
|
3
4
|
export { default as gh } from "./extension/tools/gh.ts";
|
|
4
5
|
export { default as grep } from "./extension/tools/grep.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import computer_use_default from"../../computer-use/extension/tools/computer_use.js";import"../../computer-use/tools.js";import grep_default from"./extension/tools/grep.js";import apply_patch_default from"./extension/tools/apply_patch.js";import gh_default from"./extension/tools/gh.js";export{apply_patch_default as apply_patch,computer_use_default as computer_use,gh_default as gh,grep_default as grep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{defineAgent}from"#public/definitions/agent.js";var agent_default=defineAgent({model:DEFAULT_AGENT_MODEL_ID});export{agent_default as default};
|
|
1
|
+
import{DEFAULT_AGENT_MODEL_ID,DEFAULT_AGENT_REASONING}from"#shared/default-agent-model.js";import{defineAgent}from"#public/definitions/agent.js";var agent_default=defineAgent({model:DEFAULT_AGENT_MODEL_ID,reasoning:DEFAULT_AGENT_REASONING});export{agent_default as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createAgentSourceRegistry,defineProgrammaticAgentSource,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";const revision=`eve@${resolveInstalledPackageInfo().version}:compiled-manifest-v52`,localDefaults=defineProgrammaticAgentSource({id:`eve:defaults`,revision,modules:[{logicalPath:`agent.ts`,loadNamespace:()=>import(`#framework/sources/modules/agent.js`)},{logicalPath:`sandbox.ts`,semanticRevision:`eve:default-sandbox:v1`,loadNamespace:()=>import(`#framework/sources/modules/sandbox.js`)},{logicalPath:`tools/bash.ts`,loadNamespace:()=>import(`#tools/provided/bash.js`)},{logicalPath:`tools/read_file.ts`,loadNamespace:()=>import(`#tools/provided/read-file.js`)},{logicalPath:`tools/write_file.ts`,loadNamespace:()=>import(`#tools/provided/write-file.js`)},{logicalPath:`tools/web_fetch.ts`,loadNamespace:()=>import(`#tools/provided/web-fetch.js`)},{logicalPath:`tools/load_skill.ts`,loadNamespace:()=>import(`#tools/provided/load-skill.js`)},{logicalPath:`tools/
|
|
1
|
+
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createAgentSourceRegistry,defineProgrammaticAgentSource,loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";const revision=`eve@${resolveInstalledPackageInfo().version}:compiled-manifest-v52`,localDefaults=defineProgrammaticAgentSource({id:`eve:defaults`,revision,modules:[{logicalPath:`agent.ts`,loadNamespace:()=>import(`#framework/sources/modules/agent.js`)},{logicalPath:`sandbox.ts`,semanticRevision:`eve:default-sandbox:v1`,loadNamespace:()=>import(`#framework/sources/modules/sandbox.js`)},{logicalPath:`tools/bash.ts`,loadNamespace:()=>import(`#tools/provided/bash.js`)},{logicalPath:`tools/read_file.ts`,loadNamespace:()=>import(`#tools/provided/read-file.js`)},{logicalPath:`tools/write_file.ts`,loadNamespace:()=>import(`#tools/provided/write-file.js`)},{logicalPath:`tools/web_fetch.ts`,loadNamespace:()=>import(`#tools/provided/web-fetch.js`)},{logicalPath:`tools/load_skill.ts`,loadNamespace:()=>import(`#tools/provided/load-skill.js`)},{logicalPath:`tools/connection_tools.ts`,loadNamespace:()=>import(`#tools/framework/connection-tools.js`)},{logicalPath:`tools/web_search.ts`,loadNamespace:()=>import(`#tools/provided/web-search.js`)}]}),rootDefaults=defineProgrammaticAgentSource({id:`eve:root-defaults`,revision,modules:[{logicalPath:`tools/agent.ts`,loadNamespace:()=>import(`#tools/framework/agent.js`)},{logicalPath:`channels/eve.ts`,loadNamespace:()=>import(`#framework/sources/modules/eve-channel.js`)},{logicalPath:`channels/home.ts`,loadNamespace:()=>import(`#framework/sources/modules/home-channel.js`)}]}),memoryWrapperTemplateSource=defineProgrammaticAgentSource({id:`eve:memory-wrapper`,revision,modules:[{logicalPath:`tools/memory-wrapper.ts`,loadNamespace:async e=>{let{loadMemoryWrapperNamespace:t}=await import(`#framework/sources/modules/memory-wrapper.js`);return await t(e)}}]}),frameworkAgentSourceRegistry=createAgentSourceRegistry([{applyTo:`all-local-nodes`,source:localDefaults},{applyTo:`root`,source:rootDefaults}],{templates:[memoryWrapperTemplateSource]}),memoryWrapperTemplate=frameworkAgentSourceRegistry.templates.get(memoryWrapperTemplateSource.id);async function loadFrameworkProgrammaticModule(e,t){return memoizeModuleNamespaceFactories(await loadProgrammaticModuleNamespace({backing:e,dependencyNamespaces:t,registries:[frameworkAgentSourceRegistry]}))}export{frameworkAgentSourceRegistry,loadFrameworkProgrammaticModule,memoryWrapperTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{normalizePresentationText}from"#shared/presentation-text.js";import{parseJsonObject}from"#shared/json.js";import{createRuntimeActionRequestFromToolCall}from"#harness/coordination.js";function createPresentedRuntimeActionRequestFromToolCall(e){let t=createRuntimeActionRequestFromToolCall(e),n=projectToolStartLabel(e.tools.get(e.toolCall.toolName),t.input);return n===void 0?{action:t}:{action:t,presentationLabel:n}}function projectToolStartLabel(e,t){let n=e?.label?.start;if(n!==void 0)try{let e=normalizePresentationText(n(parseJsonObject(t)));return e===``?void 0:e}catch{return}}function collectActionPresentation(e){let t=Object.fromEntries(e.flatMap(({action:e,presentationLabel:t})=>t===void 0?[]:[[e.callId,{label:t}]]));return Object.keys(t).length===0?void 0:t}export{collectActionPresentation,createPresentedRuntimeActionRequestFromToolCall,projectToolStartLabel};
|
|
@@ -46,4 +46,5 @@ export declare function createToolResultMessagePartFromToolError(toolError: Type
|
|
|
46
46
|
* response messages array).
|
|
47
47
|
*/
|
|
48
48
|
export declare function createRuntimeToolResultFromMessagePart(part: ToolResultPart): RuntimeToolResultActionResult;
|
|
49
|
+
export declare function isToolResultError(output: ToolResultPart["output"]): boolean;
|
|
49
50
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toError}from"#shared/errors.js";import{parseJsonValue}from"#shared/json.js";import{authorizationPendingAsJsonObject,isAuthorizationPendingModelOutput,isAuthorizationSignal}from"#harness/authorization.js";import{withToolOutputSerializationError}from"#harness/tool-output-serialization.js";function toJsonValue(e){return isAuthorizationSignal(e)?parseJsonValue(authorizationPendingAsJsonObject({connections:e.challenges.map(e=>e.name)})):isAuthorizationPendingModelOutput(e)?parseJsonValue(authorizationPendingAsJsonObject(e)):parseJsonValue(e===void 0?null:e)}function createRuntimeToolResultFromValue(e){let t={callId:e.callId,kind:`tool-result`,output:toolResultOutputToJsonValue({output:{type:e.isError===!0?`error-json`:`json`,value:e.isError===!0&&e.output instanceof Error?e.output.message:e.output},toolCallId:e.callId,toolName:e.toolName}),toolName:e.toolName};return e.isError===!0?{...t,isError:!0}:t}function createRuntimeToolResultFromStepResult(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,output:e.output,toolName:e.toolName})}function createRuntimeToolResultFromToolError(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,isError:!0,output:toError(e.error),toolName:e.toolName})}function createToolResultMessagePartFromToolError(e){return{type:`tool-result`,toolCallId:e.toolCallId,toolName:e.toolName,output:{type:`error-text`,value:toError(e.error).message}}}function createRuntimeToolResultFromMessagePart(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,output:toolResultOutputToJsonValue({output:e.output,toolCallId:e.toolCallId,toolName:e.toolName}),toolName:e.toolName,isError:isToolResultError(e.output)})}function toolResultOutputToJsonValue(e){return withToolOutputSerializationError({boundary:`action.result`,toolCallId:e.toolCallId,toolName:e.toolName},()=>{switch(e.output.type){case`text`:case`error-text`:return e.output.value;case`json`:case`error-json`:return toJsonValue(e.output.value);case`execution-denied`:return{code:`TOOL_EXECUTION_DENIED`,message:e.output.reason??`Tool execution was denied.`};case`content`:return toJsonValue(e.output.value)}})}function isToolResultError(e){return e.type===`error-json`||e.type===`error-text`||e.type===`execution-denied`}export{createRuntimeToolResultFromMessagePart,createRuntimeToolResultFromStepResult,createRuntimeToolResultFromToolError,createRuntimeToolResultFromValue,createToolResultMessagePartFromToolError};
|
|
1
|
+
import{toError}from"#shared/errors.js";import{parseJsonValue}from"#shared/json.js";import{authorizationPendingAsJsonObject,isAuthorizationPendingModelOutput,isAuthorizationSignal}from"#harness/authorization.js";import{withToolOutputSerializationError}from"#harness/tool-output-serialization.js";function toJsonValue(e){return isAuthorizationSignal(e)?parseJsonValue(authorizationPendingAsJsonObject({connections:e.challenges.map(e=>e.name)})):isAuthorizationPendingModelOutput(e)?parseJsonValue(authorizationPendingAsJsonObject(e)):parseJsonValue(e===void 0?null:e)}function createRuntimeToolResultFromValue(e){let t={callId:e.callId,kind:`tool-result`,output:toolResultOutputToJsonValue({output:{type:e.isError===!0?`error-json`:`json`,value:e.isError===!0&&e.output instanceof Error?e.output.message:e.output},toolCallId:e.callId,toolName:e.toolName}),toolName:e.toolName};return e.isError===!0?{...t,isError:!0}:t}function createRuntimeToolResultFromStepResult(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,output:e.output,toolName:e.toolName})}function createRuntimeToolResultFromToolError(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,isError:!0,output:toError(e.error),toolName:e.toolName})}function createToolResultMessagePartFromToolError(e){return{type:`tool-result`,toolCallId:e.toolCallId,toolName:e.toolName,output:{type:`error-text`,value:toError(e.error).message}}}function createRuntimeToolResultFromMessagePart(e){return createRuntimeToolResultFromValue({callId:e.toolCallId,output:toolResultOutputToJsonValue({output:e.output,toolCallId:e.toolCallId,toolName:e.toolName}),toolName:e.toolName,isError:isToolResultError(e.output)})}function toolResultOutputToJsonValue(e){return withToolOutputSerializationError({boundary:`action.result`,toolCallId:e.toolCallId,toolName:e.toolName},()=>{switch(e.output.type){case`text`:case`error-text`:return e.output.value;case`json`:case`error-json`:return toJsonValue(e.output.value);case`execution-denied`:return{code:`TOOL_EXECUTION_DENIED`,message:e.output.reason??`Tool execution was denied.`};case`content`:return toJsonValue(e.output.value)}})}function isToolResultError(e){return e.type===`error-json`||e.type===`error-text`||e.type===`execution-denied`}export{createRuntimeToolResultFromMessagePart,createRuntimeToolResultFromStepResult,createRuntimeToolResultFromToolError,createRuntimeToolResultFromValue,createToolResultMessagePartFromToolError,isToolResultError};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolSet } from "ai";
|
|
2
2
|
import type { HarnessToolDefinition } from "#harness/execute-tool.js";
|
|
3
3
|
import type { HarnessSession, HarnessToolMap } from "#harness/types.js";
|
|
4
|
-
type AdvertisedToolSession = Pick<HarnessSession, "rootSessionId"
|
|
4
|
+
type AdvertisedToolSession = Pick<HarnessSession, "rootSessionId">;
|
|
5
5
|
type AdvertisedToolMapInput = {
|
|
6
6
|
readonly session: AdvertisedToolSession;
|
|
7
7
|
readonly tools: HarnessToolMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function getAdvertisedTools(e){return`modelTools`in e?getAdvertisedModelTools(e):isToolDefinitionList(e.tools)?filterUnavailableToolDefinitions(e.tools,e.session):filterUnavailableToolMap(e.tools,e.session)}async function getAdvertisedModelTools(e){return{harnessTools:filterUnavailableToolMap(e.tools,e.session),modelTools:e.modelTools,session:e.session}}function filterUnavailableToolDefinitions(e,t){let n=[];for(let r of e)shouldHideTool(r,t)||n.push(r);return n}function filterUnavailableToolMap(e,t){let n=new Map;for(let[r,i]of e)shouldHideTool(i,t)||n.set(r,i);return n}function shouldHideTool(e,t){let n=t.rootSessionId!==void 0;return e.rootOnly===!0||e.availableInSubagents===!1||e.behavior?.availability.includes(`root-session`)===!0?n
|
|
1
|
+
function getAdvertisedTools(e){return`modelTools`in e?getAdvertisedModelTools(e):isToolDefinitionList(e.tools)?filterUnavailableToolDefinitions(e.tools,e.session):filterUnavailableToolMap(e.tools,e.session)}async function getAdvertisedModelTools(e){return{harnessTools:filterUnavailableToolMap(e.tools,e.session),modelTools:e.modelTools,session:e.session}}function filterUnavailableToolDefinitions(e,t){let n=[];for(let r of e)shouldHideTool(r,t)||n.push(r);return n}function filterUnavailableToolMap(e,t){let n=new Map;for(let[r,i]of e)shouldHideTool(i,t)||n.set(r,i);return n}function shouldHideTool(e,t){let n=t.rootSessionId!==void 0;return e.rootOnly===!0||e.availableInSubagents===!1||e.behavior?.availability.includes(`root-session`)===!0?n:!1}function isToolDefinitionList(e){return Array.isArray(e)}export{getAdvertisedTools};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ContextContainer } from "#context/container.js";
|
|
2
|
+
/**
|
|
3
|
+
* Framework state announced to the model as an append-only `context.state`
|
|
4
|
+
* message. The harness appends a message only when `value` differs from the
|
|
5
|
+
* last value it announced for the same key, so the cached prompt prefix never
|
|
6
|
+
* changes. Compaction clears the record, which makes the next announcement a
|
|
7
|
+
* fresh baseline.
|
|
8
|
+
*/
|
|
9
|
+
export interface Announcement {
|
|
10
|
+
/** Canonical state. Only a changed value produces a message. */
|
|
11
|
+
readonly value: string;
|
|
12
|
+
/**
|
|
13
|
+
* Renders the message for `value`. `previous` is the last announced value,
|
|
14
|
+
* or `undefined` for a baseline. Returning `undefined` records the value
|
|
15
|
+
* without adding a message.
|
|
16
|
+
*/
|
|
17
|
+
render(previous: string | undefined): string | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Sets or clears the announcement `key` for the current step. */
|
|
20
|
+
export declare function setPendingAnnouncement(ctx: ContextContainer, key: string, announcement: Announcement | undefined): void;
|
|
21
|
+
/** The announcements set for the current step. */
|
|
22
|
+
export declare function getPendingAnnouncements(ctx: Pick<ContextContainer, "get"> | undefined): Readonly<Record<string, Announcement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ContextKey}from"#context/key.js";const PendingAnnouncementsKey=new ContextKey(`eve.pendingAnnouncements`);function setPendingAnnouncement(e,t,n){let{[t]:r,...i}=e.get(PendingAnnouncementsKey)??{};e.setVirtualContext(PendingAnnouncementsKey,n===void 0?i:{...i,[t]:n})}function getPendingAnnouncements(e){return e?.get(PendingAnnouncementsKey)??{}}export{getPendingAnnouncements,setPendingAnnouncement};
|
|
@@ -2,8 +2,11 @@ import type { SessionAuthContext } from "#channel/types.js";
|
|
|
2
2
|
import type { AuthorizationChallenge } from "#harness/authorization.js";
|
|
3
3
|
import type { SessionStateMap } from "#harness/types.js";
|
|
4
4
|
type ApprovalCandidateStatus = "pending" | "authorization-required" | "allowed" | "rejected" | "failed" | "timed-out" | "stale";
|
|
5
|
+
/** What a responder submitted: a candidate settles its request this way once allowed. */
|
|
6
|
+
export type ApprovalCandidateDecision = "approve" | "cancel";
|
|
5
7
|
interface ApprovalCandidateAuditRecord {
|
|
6
8
|
readonly candidateId: string;
|
|
9
|
+
readonly decision: ApprovalCandidateDecision;
|
|
7
10
|
readonly requestId: string;
|
|
8
11
|
readonly responder: ApprovalResponderIdentity;
|
|
9
12
|
readonly status: ApprovalCandidateStatus;
|
|
@@ -29,6 +32,7 @@ export interface ApprovalSettlementAuditRecord {
|
|
|
29
32
|
}
|
|
30
33
|
export interface ActiveApprovalCandidate {
|
|
31
34
|
readonly candidateId: string;
|
|
35
|
+
readonly decision: ApprovalCandidateDecision;
|
|
32
36
|
readonly requestId: string;
|
|
33
37
|
readonly responder: SessionAuthContext;
|
|
34
38
|
readonly status: "pending" | "authorization-required";
|
|
@@ -41,10 +45,11 @@ interface ApprovalStateTransition {
|
|
|
41
45
|
readonly changed: boolean;
|
|
42
46
|
readonly state: SessionStateMap | undefined;
|
|
43
47
|
}
|
|
44
|
-
/** Creates or deduplicates one responder's
|
|
48
|
+
/** Creates or deduplicates one responder's candidate decision for a pending request. */
|
|
45
49
|
export declare function createApprovalCandidate(input: {
|
|
46
50
|
readonly candidateIdPrefix: string;
|
|
47
51
|
readonly createdAt: number;
|
|
52
|
+
readonly decision: ApprovalCandidateDecision;
|
|
48
53
|
readonly expiresAt: number;
|
|
49
54
|
readonly requestId: string;
|
|
50
55
|
readonly responder: SessionAuthContext;
|
|
@@ -85,7 +90,10 @@ export declare function expireApprovalCandidates(input: {
|
|
|
85
90
|
readonly now: number;
|
|
86
91
|
readonly state: SessionStateMap | undefined;
|
|
87
92
|
}): SessionStateMap | undefined;
|
|
88
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Atomically settles a request with an allowed candidate's decision; every
|
|
95
|
+
* losing candidate becomes stale.
|
|
96
|
+
*/
|
|
89
97
|
export declare function settleAllowedCandidate(input: {
|
|
90
98
|
readonly candidateId: string;
|
|
91
99
|
readonly settledAt: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const APPROVAL_STATE_KEY=`eve.runtime.hitl.approvalState`;function createApprovalCandidate(e){let t=expireApprovalCandidates({now:e.createdAt,state:e.state}),n=readApprovalState(t);if(n.settlements[e.requestId]!==void 0)return{changed:!1,state:t};let r=e.responder;if(Object.values(n.activeCandidates).find(t=>t.requestId===e.requestId&&sameResponder(t.responder,r))!==void 0)return{changed:!1,state:t};let i=n.activeCandidates[e.candidateIdPrefix]!==void 0||n.candidateHistory.some(t=>t.candidateId===e.candidateIdPrefix)?`${e.candidateIdPrefix}.${n.nextCandidateSequence.toString(36)}`:e.candidateIdPrefix;if(n.activeCandidates[i]!==void 0||n.candidateHistory.some(e=>e.candidateId===i))throw Error(`Approval candidate id collision: "${i}".`);let a={candidateId:i,createdAt:e.createdAt,expiresAt:e.expiresAt,requestId:e.requestId,responder:r,status:`pending`};return{changed:!0,state:writeApprovalState(t,{...n,activeCandidates:{...n.activeCandidates,[a.candidateId]:a},nextCandidateSequence:n.nextCandidateSequence+1})}}function markApprovalCandidatePendingEventEmitted(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];return n===void 0||n.pendingEventEmitted===!0?e.state:writeApprovalState(e.state,{...t,activeCandidates:{...t.activeCandidates,[e.candidateId]:{...n,pendingEventEmitted:!0}}})}function markApprovalCandidateHistoryEventEmitted(e){let t=readApprovalState(e.state),n=!1,r=t.candidateHistory.map(t=>t.candidateId!==e.candidateId||t.eventEmitted===!0?t:(n=!0,{...t,eventEmitted:!0}));return n?writeApprovalState(e.state,{...t,candidateHistory:r}):e.state}function markApprovalSettlementEventEmitted(e){let t=readApprovalState(e.state),n=t.settlements[e.requestId];return n===void 0||n.eventEmitted===!0?e.state:writeApprovalState(e.state,{...t,settlements:{...t.settlements,[e.requestId]:{...n,eventEmitted:!0}}})}function markApprovalCandidateAuthorizationRequired(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];if(n===void 0)return e.state;let r={...n,authorizationChallenges:e.authorizationChallenges,expiresAt:e.expiresAt??n.expiresAt,status:`authorization-required`};return writeApprovalState(e.state,{...t,activeCandidates:{...t.activeCandidates,[e.candidateId]:r}})}function finishApprovalCandidate(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];if(n===void 0)return e.state;let r={...t.activeCandidates};return delete r[e.candidateId],writeApprovalState(e.state,{...t,activeCandidates:r,candidateHistory:[...t.candidateHistory,toCandidateAuditRecord({candidate:n,completedAt:e.completedAt,reason:e.reason,status:e.status})]})}function expireApprovalCandidates(e){let t=e.state,n=Object.values(readApprovalState(t).activeCandidates);for(let r of n)r.expiresAt>e.now||(t=finishApprovalCandidate({candidateId:r.candidateId,completedAt:e.now,state:t,status:`timed-out`}));return t}function settleAllowedCandidate(e){let t=expireApprovalCandidates({now:e.settledAt,state:e.state}),n=readApprovalState(t),r=n.activeCandidates[e.candidateId];if(r===void 0){let r=n.candidateHistory.find(t=>t.candidateId===e.candidateId);if((r&&n.settlements[r.requestId])!==void 0)return{changed:!1,state:t};throw Error(`Unknown approval candidate "${e.candidateId}".`)}return settleRequest({actor:projectResponder(r.responder),candidateId:r.candidateId,outcome
|
|
1
|
+
const APPROVAL_STATE_KEY=`eve.runtime.hitl.approvalState`;function createApprovalCandidate(e){let t=expireApprovalCandidates({now:e.createdAt,state:e.state}),n=readApprovalState(t);if(n.settlements[e.requestId]!==void 0)return{changed:!1,state:t};let r=e.responder;if(Object.values(n.activeCandidates).find(t=>t.requestId===e.requestId&&t.decision===e.decision&&sameResponder(t.responder,r))!==void 0)return{changed:!1,state:t};let i=n.activeCandidates[e.candidateIdPrefix]!==void 0||n.candidateHistory.some(t=>t.candidateId===e.candidateIdPrefix)?`${e.candidateIdPrefix}.${n.nextCandidateSequence.toString(36)}`:e.candidateIdPrefix;if(n.activeCandidates[i]!==void 0||n.candidateHistory.some(e=>e.candidateId===i))throw Error(`Approval candidate id collision: "${i}".`);let a={candidateId:i,createdAt:e.createdAt,decision:e.decision,expiresAt:e.expiresAt,requestId:e.requestId,responder:r,status:`pending`};return{changed:!0,state:writeApprovalState(t,{...n,activeCandidates:{...n.activeCandidates,[a.candidateId]:a},nextCandidateSequence:n.nextCandidateSequence+1})}}function markApprovalCandidatePendingEventEmitted(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];return n===void 0||n.pendingEventEmitted===!0?e.state:writeApprovalState(e.state,{...t,activeCandidates:{...t.activeCandidates,[e.candidateId]:{...n,pendingEventEmitted:!0}}})}function markApprovalCandidateHistoryEventEmitted(e){let t=readApprovalState(e.state),n=!1,r=t.candidateHistory.map(t=>t.candidateId!==e.candidateId||t.eventEmitted===!0?t:(n=!0,{...t,eventEmitted:!0}));return n?writeApprovalState(e.state,{...t,candidateHistory:r}):e.state}function markApprovalSettlementEventEmitted(e){let t=readApprovalState(e.state),n=t.settlements[e.requestId];return n===void 0||n.eventEmitted===!0?e.state:writeApprovalState(e.state,{...t,settlements:{...t.settlements,[e.requestId]:{...n,eventEmitted:!0}}})}function markApprovalCandidateAuthorizationRequired(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];if(n===void 0)return e.state;let r={...n,authorizationChallenges:e.authorizationChallenges,expiresAt:e.expiresAt??n.expiresAt,status:`authorization-required`};return writeApprovalState(e.state,{...t,activeCandidates:{...t.activeCandidates,[e.candidateId]:r}})}function finishApprovalCandidate(e){let t=readApprovalState(e.state),n=t.activeCandidates[e.candidateId];if(n===void 0)return e.state;let r={...t.activeCandidates};return delete r[e.candidateId],writeApprovalState(e.state,{...t,activeCandidates:r,candidateHistory:[...t.candidateHistory,toCandidateAuditRecord({candidate:n,completedAt:e.completedAt,reason:e.reason,status:e.status})]})}function expireApprovalCandidates(e){let t=e.state,n=Object.values(readApprovalState(t).activeCandidates);for(let r of n)r.expiresAt>e.now||(t=finishApprovalCandidate({candidateId:r.candidateId,completedAt:e.now,state:t,status:`timed-out`}));return t}function settleAllowedCandidate(e){let t=expireApprovalCandidates({now:e.settledAt,state:e.state}),n=readApprovalState(t),r=n.activeCandidates[e.candidateId];if(r===void 0){let r=n.candidateHistory.find(t=>t.candidateId===e.candidateId);if((r&&n.settlements[r.requestId])!==void 0)return{changed:!1,state:t};throw Error(`Unknown approval candidate "${e.candidateId}".`)}return settleRequest({actor:projectResponder(r.responder),candidateId:r.candidateId,outcome:r.decision===`cancel`?`cancelled`:`allowed`,requestId:r.requestId,settledAt:e.settledAt,state:t})}function settleDirectApprovalResponse(e){let t=expireApprovalCandidates({now:e.settledAt,state:e.state});return settleRequest({actor:projectResponder(e.actor),outcome:e.outcome,requestId:e.requestId,settledAt:e.settledAt,state:t})}function getActiveApprovalCandidate(e,t){return readApprovalState(e).activeCandidates[t]}function getApprovalAuditState(e){let t=readApprovalState(e);return{activeCandidates:Object.values(t.activeCandidates),candidateHistory:t.candidateHistory,settlements:Object.values(t.settlements)}}function settleRequest(e){let t=readApprovalState(e.state);if(t.settlements[e.requestId]!==void 0)return{changed:!1,state:e.state};let n={actor:e.actor,candidateId:e.candidateId,outcome:e.outcome,requestId:e.requestId,settledAt:e.settledAt},r={},i=[...t.candidateHistory];for(let n of Object.values(t.activeCandidates)){if(n.requestId!==e.requestId){r[n.candidateId]=n;continue}i.push(toCandidateAuditRecord({candidate:n,completedAt:e.settledAt,status:n.candidateId===e.candidateId?`allowed`:`stale`}))}let a={activeCandidates:r,candidateHistory:i,nextCandidateSequence:t.nextCandidateSequence,settlements:{...t.settlements,[e.requestId]:n}};return{changed:!0,state:writeApprovalState(e.state,a)}}function toCandidateAuditRecord(e){let{authorizationChallenges:t,responder:n,...r}=e.candidate;return{...r,completedAt:e.completedAt,responder:projectResponder(n),reason:e.reason,status:e.status}}function projectResponder(e){return{authenticator:e.authenticator,issuer:e.issuer,principalId:e.principalId,principalType:e.principalType}}function sameResponder(e,t){return e.authenticator===t.authenticator&&e.issuer===t.issuer&&e.principalId===t.principalId&&e.principalType===t.principalType}function readActiveCandidates(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t,decision:t.decision===`cancel`?`cancel`:`approve`}]))}function readApprovalState(e){let t=e?.[APPROVAL_STATE_KEY];if(typeof t!=`object`||!t)return{activeCandidates:{},candidateHistory:[],nextCandidateSequence:0,settlements:{}};let n=t;return{activeCandidates:typeof n.activeCandidates==`object`&&n.activeCandidates!==null?readActiveCandidates(n.activeCandidates):{},candidateHistory:Array.isArray(n.candidateHistory)?n.candidateHistory:[],nextCandidateSequence:typeof n.nextCandidateSequence==`number`&&Number.isSafeInteger(n.nextCandidateSequence)&&n.nextCandidateSequence>=0?n.nextCandidateSequence:deriveNextCandidateSequence(n),settlements:typeof n.settlements==`object`&&n.settlements!==null?n.settlements:{}}}function deriveNextCandidateSequence(e){return Object.keys(e.activeCandidates??{}).length+(Array.isArray(e.candidateHistory)?e.candidateHistory.length:0)}function writeApprovalState(e,t){return{...e,[APPROVAL_STATE_KEY]:t}}export{createApprovalCandidate,expireApprovalCandidates,finishApprovalCandidate,getActiveApprovalCandidate,getApprovalAuditState,markApprovalCandidateAuthorizationRequired,markApprovalCandidateHistoryEventEmitted,markApprovalCandidatePendingEventEmitted,markApprovalSettlementEventEmitted,settleAllowedCandidate,settleDirectApprovalResponse};
|
|
@@ -13,17 +13,16 @@ interface ApprovalDeliveryResult {
|
|
|
13
13
|
*
|
|
14
14
|
* | State | Input | Transition |
|
|
15
15
|
* | --- | --- | --- |
|
|
16
|
-
* | pending request | Approve | create responder-bound candidate |
|
|
17
|
-
* | pending request | Cancel | settle cancelled and stale candidates |
|
|
16
|
+
* | pending request | Approve or Cancel | create responder-bound candidate |
|
|
18
17
|
* | pending candidate | coordinator pass | run current authorizer |
|
|
19
|
-
* | pending candidate | allowed | settle
|
|
18
|
+
* | pending candidate | allowed | settle with its decision; competitors go stale |
|
|
20
19
|
* | pending candidate | rejected/error/expiry | append terminal history |
|
|
21
20
|
* | pending candidate | authorization required | persist private challenge |
|
|
22
21
|
* | authorization required | matching callback | re-run current authorizer |
|
|
23
22
|
* | settled request | any later response | no state change |
|
|
24
23
|
*
|
|
25
|
-
* Delivery ingestion returns before authorizer work so
|
|
26
|
-
*
|
|
24
|
+
* Delivery ingestion returns before authorizer work so candidate creation
|
|
25
|
+
* commits before long-running policy execution. Candidate results also
|
|
27
26
|
* commit before lifecycle events are projected by the next stack layer.
|
|
28
27
|
*/
|
|
29
28
|
export declare function coordinateApprovalDelivery(input: {
|