eve 0.55.0 → 0.57.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 +58 -0
- package/dist/src/channel/adapter-context.d.ts +1 -1
- package/dist/src/channel/adapter.d.ts +2 -2
- package/dist/src/channel/audience.d.ts +3 -3
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/conversation-context.d.ts +4 -2
- package/dist/src/channel/conversation-context.js +1 -1
- package/dist/src/channel/session.d.ts +4 -3
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +7 -4
- package/dist/src/chunks/{use-eve-agent-D-KQzzyW.js → use-eve-agent-C2APNCdP.js} +45 -22
- package/dist/src/chunks/{use-eve-agent-CxPlg0KL.js → use-eve-agent-D0YnDLi_.js} +45 -22
- package/dist/src/cli/commands/init.d.ts +2 -6
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-metadata.d.ts +0 -18
- package/dist/src/cli/commands/registry-metadata.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace-detail.js +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +3 -6
- package/dist/src/cli/dev/tui/blocks.js +3 -3
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/markdown.d.ts +8 -1
- package/dist/src/cli/dev/tui/markdown.js +7 -7
- package/dist/src/cli/dev/tui/message-queue.d.ts +11 -7
- package/dist/src/cli/dev/tui/message-queue.js +1 -1
- package/dist/src/cli/dev/tui/model-editor.d.ts +1 -1
- package/dist/src/cli/dev/tui/model-editor.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +0 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth-result.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth.js +1 -1
- package/dist/src/cli/dev/tui/remote-startup.d.ts +10 -0
- package/dist/src/cli/dev/tui/remote-startup.js +1 -0
- package/dist/src/cli/dev/tui/runner.d.ts +16 -19
- package/dist/src/cli/dev/tui/runner.js +3 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +7 -13
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-issues.d.ts +1 -1
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -17
- package/dist/src/cli/dev/tui/setup-panel.js +5 -6
- package/dist/src/cli/dev/tui/status-line.d.ts +1 -8
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/steering-stream.d.ts +15 -0
- package/dist/src/cli/dev/tui/steering-stream.js +1 -0
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +8 -3
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +2 -2
- package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +0 -2
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +4 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -2
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/cli/telemetry/index.d.ts +1 -1
- package/dist/src/cli/telemetry/index.js +1 -1
- package/dist/src/cli/ui/terminal-text.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +2 -57
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/eve-agent-store-state.d.ts +19 -0
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/ndjson.d.ts +2 -0
- package/dist/src/client/ndjson.js +3 -3
- package/dist/src/client/open-stream.d.ts +1 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -0
- package/dist/src/compiled/@workflow/core/runtime.js +2 -2
- package/dist/src/compiled/@workflow/core/serialization.js +1 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +2 -2
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DTFAjP0J.js +6 -0
- package/dist/src/compiled/_chunks/workflow/{dist-PLkAQ-U7.js → dist-C5KCXSdI.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{frames-BvATzM2t.js → frames-DJw9L4rO.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/global-DFW-hO6M.js +1 -0
- package/dist/src/compiled/_chunks/workflow/helpers-ClCA9Lmc.js +1 -0
- package/dist/src/compiled/_chunks/workflow/logger-D6vwIEf9.js +13 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-_baK8jaT.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-CRdL17z4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/serialization-CWYPL4Eq.js +3 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-DyIt9lEx.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-CVezyWwZ.js → ws-transport-Dl5FG4Sw.js} +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +27 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +12 -11
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +0 -3
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +5 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/audience.d.ts +2 -2
- package/dist/src/eve-channel/audience.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +4 -3
- package/dist/src/eve-channel/types.d.ts +5 -5
- package/dist/src/execution/activity-cohort.js +1 -1
- package/dist/src/execution/activity-collector.js +1 -1
- package/dist/src/execution/authorization-callback-match.d.ts +2 -1
- package/dist/src/execution/authorization-callback-match.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.d.ts +1 -1
- package/dist/src/execution/connections/callback-route.d.ts +1 -11
- package/dist/src/execution/connections/callback-route.js +1 -1
- package/dist/src/execution/continuation-conflict-step.d.ts +0 -1
- package/dist/src/execution/continuation-conflict-step.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +1 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.d.ts +2 -2
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.d.ts +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +10 -49
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +21 -0
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/schema.d.ts +36 -0
- package/dist/src/execution/dynamic-workflow/schema.js +1 -0
- package/dist/src/execution/dynamic-workflow/security-step.d.ts +3 -0
- package/dist/src/execution/dynamic-workflow/security-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/tool.d.ts +8 -0
- package/dist/src/execution/dynamic-workflow/tool.js +1 -0
- package/dist/src/execution/dynamic-workflow/workflow.d.ts +10 -0
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -0
- package/dist/src/execution/eve-workflow-attributes.d.ts +2 -17
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/hook-ownership.d.ts +2 -4
- package/dist/src/execution/hook-ownership.js +1 -1
- package/dist/src/execution/legacy-session/authorization.d.ts +9 -0
- package/dist/src/execution/legacy-session/authorization.js +1 -0
- package/dist/src/execution/legacy-session/completion-step.d.ts +10 -0
- package/dist/src/execution/legacy-session/completion-step.js +1 -0
- package/dist/src/execution/legacy-session/inbox.d.ts +24 -0
- package/dist/src/execution/legacy-session/inbox.js +1 -0
- package/dist/src/execution/legacy-session/input.d.ts +19 -0
- package/dist/src/execution/legacy-session/input.js +1 -0
- package/dist/src/execution/legacy-session/interrupt-step.d.ts +3 -0
- package/dist/src/execution/legacy-session/interrupt-step.js +1 -0
- package/dist/src/execution/legacy-session/prepare-step.d.ts +24 -0
- package/dist/src/execution/legacy-session/prepare-step.js +1 -0
- package/dist/src/execution/legacy-session/snapshot.d.ts +12 -0
- package/dist/src/execution/legacy-session/snapshot.js +1 -0
- package/dist/src/execution/legacy-session/turn-workflow.d.ts +8 -0
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -0
- package/dist/src/execution/model-call-batching.d.ts +1 -0
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/node-step.d.ts +1 -5
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.d.ts +2 -20
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/reconcile-session-continuation-token.d.ts +1 -1
- package/dist/src/execution/report-dropped-wire-payload-step.d.ts +1 -1
- package/dist/src/execution/route-child-delivery.d.ts +2 -2
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/eve-image.js +1 -1
- package/dist/src/execution/session/accepted-deployment.d.ts +3 -0
- package/dist/src/execution/session/accepted-deployment.js +1 -0
- package/dist/src/execution/session/admission.d.ts +38 -0
- package/dist/src/execution/session/admission.js +1 -0
- package/dist/src/execution/session/entry-input.d.ts +42 -0
- package/dist/src/execution/session/entry-input.js +1 -0
- package/dist/src/execution/session/entry.d.ts +13 -0
- package/dist/src/execution/session/entry.js +1 -0
- package/dist/src/execution/session/event-sink.d.ts +31 -0
- package/dist/src/execution/session/event-sink.js +1 -0
- package/dist/src/execution/session/finalization.d.ts +33 -0
- package/dist/src/execution/session/finalization.js +1 -0
- package/dist/src/execution/session/handoff-steps.d.ts +22 -0
- package/dist/src/execution/session/handoff-steps.js +1 -0
- package/dist/src/execution/session/handoff.d.ts +69 -0
- package/dist/src/execution/session/handoff.js +1 -0
- package/dist/src/execution/session/hook-tokens.d.ts +11 -0
- package/dist/src/execution/session/hook-tokens.js +1 -0
- package/dist/src/execution/session/input-queue.d.ts +72 -0
- package/dist/src/execution/session/input-queue.js +1 -0
- package/dist/src/execution/session/next-input.d.ts +32 -0
- package/dist/src/execution/session/next-input.js +1 -0
- package/dist/src/execution/{pending-turn-state.d.ts → session/pending-turn-state.d.ts} +0 -1
- package/dist/src/execution/{pending-turn-state.js → session/pending-turn-state.js} +1 -1
- package/dist/src/execution/session/program.d.ts +47 -0
- package/dist/src/execution/session/program.js +1 -0
- package/dist/src/execution/session/route-selected-delivery.d.ts +9 -0
- package/dist/src/execution/session/route-selected-delivery.js +1 -0
- package/dist/src/execution/session/state-cursor.d.ts +31 -0
- package/dist/src/execution/session/state-cursor.js +1 -0
- package/dist/src/execution/{session-timeout-control.d.ts → session/timeout-control.d.ts} +1 -1
- package/dist/src/execution/session/timeout-control.js +1 -0
- package/dist/src/execution/{session-timeout-steps.d.ts → session/timeout-steps.d.ts} +3 -2
- package/dist/src/execution/session/timeout-steps.js +1 -0
- package/dist/src/execution/{session-timeout-workflow.d.ts → session/timeout-workflow.d.ts} +3 -1
- package/dist/src/execution/session/timeout-workflow.js +1 -0
- package/dist/src/execution/session/timeout.d.ts +3 -0
- package/dist/src/execution/session/timeout.js +1 -0
- package/dist/src/execution/session/turn-step-result.d.ts +4 -0
- package/dist/src/execution/session/turn-step-result.js +1 -0
- package/dist/src/execution/session/turn-step-types.d.ts +68 -0
- package/dist/src/execution/session/turn-step-types.js +1 -0
- package/dist/src/execution/{workflow-steps.d.ts → session/turn-step.d.ts} +1 -2
- package/dist/src/execution/session/turn-step.js +1 -0
- package/dist/src/execution/session/turn.d.ts +31 -0
- package/dist/src/execution/session/turn.js +1 -0
- package/dist/src/execution/session-inbox/address.d.ts +21 -0
- package/dist/src/execution/session-inbox/address.js +1 -0
- package/dist/src/execution/session-inbox/inbox.d.ts +54 -0
- package/dist/src/execution/session-inbox/inbox.js +1 -0
- package/dist/src/execution/session-inbox/protocol.d.ts +10 -0
- package/dist/src/execution/session-inbox/protocol.js +1 -0
- package/dist/src/execution/session-inbox/release-step.d.ts +5 -0
- package/dist/src/execution/session-inbox/release-step.js +1 -0
- package/dist/src/execution/session-inbox/resume.d.ts +21 -0
- package/dist/src/execution/session-inbox/resume.js +1 -0
- package/dist/src/execution/{turn-workflow-tool-run.d.ts → session-workflow-tool-run.d.ts} +2 -2
- package/dist/src/execution/session-workflow-tool-run.js +1 -0
- 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 +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/skills/instructions.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +1 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/task-input-response-route.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +1 -1
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +7 -0
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.d.ts +1 -1
- package/dist/src/execution/terminal-session-event.d.ts +1 -1
- package/dist/src/execution/terminal-session-event.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.d.ts +1 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +1 -1
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +6 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +2 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
- package/dist/src/execution/tools/subagent/steer.d.ts +13 -0
- package/dist/src/execution/tools/subagent/steer.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +1 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +0 -9
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +0 -2
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +1 -1
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
- package/dist/src/execution/tools/workflow/messages.d.ts +0 -1
- package/dist/src/execution/tools/workflow/messages.js +1 -1
- package/dist/src/execution/tools/workflow/owner.d.ts +3 -1
- package/dist/src/execution/tools/workflow/owner.js +1 -1
- package/dist/src/execution/tools/workflow/resume-hook-step.d.ts +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +0 -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/workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +15 -18
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -3
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/authorization.d.ts +5 -37
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/emission-state.d.ts +1 -0
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/generation-steering.d.ts +22 -0
- package/dist/src/harness/generation-steering.js +1 -0
- package/dist/src/harness/messages.d.ts +1 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +1 -1
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
- package/dist/src/harness/semantic-errors/signals.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +2 -21
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/channel-delivery.js +1 -1
- package/dist/src/instrumentation/content.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +6 -7
- package/dist/src/instrumentation/native-events.d.ts +2 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/session-context.d.ts +2 -0
- package/dist/src/instrumentation/session-context.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +3 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -4
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/gateway.d.ts +1 -0
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/model-auth/api-key.d.ts +7 -0
- package/dist/src/internal/model-auth/api-key.js +1 -0
- package/dist/src/internal/model-auth/available-models.d.ts +2 -0
- package/dist/src/internal/model-auth/available-models.js +1 -0
- package/dist/src/internal/model-auth/development-broker-client.d.ts +3 -0
- package/dist/src/internal/model-auth/development-broker-client.js +1 -0
- package/dist/src/internal/model-auth/development-broker-protocol.d.ts +12 -0
- package/dist/src/internal/model-auth/development-broker-protocol.js +1 -0
- package/dist/src/internal/model-auth/development-broker-server.d.ts +4 -0
- package/dist/src/internal/model-auth/development-broker-server.js +1 -0
- package/dist/src/internal/model-auth/gateway-credential.d.ts +2 -0
- package/dist/src/internal/model-auth/gateway-credential.js +1 -0
- package/dist/src/internal/model-auth/store.d.ts +16 -0
- package/dist/src/internal/model-auth/store.js +1 -0
- package/dist/src/internal/model-auth/transport.d.ts +6 -0
- package/dist/src/internal/model-auth/transport.js +1 -0
- package/dist/src/internal/model-auth/vercel-cli.d.ts +7 -0
- package/dist/src/internal/model-auth/vercel-cli.js +1 -0
- package/dist/src/internal/model-auth/vercel-team.d.ts +3 -0
- package/dist/src/internal/model-auth/vercel-team.js +1 -0
- package/dist/src/internal/model-auth/vercel.d.ts +13 -0
- package/dist/src/internal/model-auth/vercel.js +1 -0
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -0
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
- package/dist/src/internal/vercel/api-resource.d.ts +4 -0
- package/dist/src/internal/vercel/api-resource.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
- package/dist/src/internal/vercel/vercel-services-config.d.ts +2 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +1 -1
- package/dist/src/internal/workflow/runtime.d.ts +1 -6
- package/dist/src/internal/workflow/runtime.js +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +4 -0
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -0
- package/dist/src/protocol/activity.js +1 -1
- package/dist/src/protocol/message.d.ts +8 -0
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/routes.d.ts +0 -2
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -2
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/audience.d.ts +2 -2
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/connections/index.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +2 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/models/anthropic/index.d.ts +3 -0
- package/dist/src/public/models/anthropic/index.js +1 -0
- package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -1
- package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -1
- package/dist/src/public/models/openai/chatgpt/oauth.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/models/openai/index.d.ts +4 -2
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
- package/dist/src/public/tools/workflow.d.ts +1 -4
- package/dist/src/public/tools/workflow.js +1 -1
- package/dist/src/public/vercel/index.d.ts +2 -1
- package/dist/src/public/vercel/index.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +2 -4
- package/dist/src/runtime/connections/principal.d.ts +6 -6
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -9
- package/dist/src/self-modification/agent.js +1 -1
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -3
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +1 -7
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -1
- package/dist/src/self-modification/setup.d.ts +9 -3
- package/dist/src/self-modification/setup.js +2 -2
- package/dist/src/setup/cli/option-row.d.ts +2 -1
- package/dist/src/setup/cli/option-row.js +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +2 -0
- package/dist/src/setup/cli/prompt-ui.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +1 -1
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/chatgpt-auth.js +1 -1
- package/dist/src/setup/flows/deploy.d.ts +4 -9
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
- package/dist/src/setup/flows/install-vercel-cli.d.ts +2 -3
- package/dist/src/setup/flows/login.d.ts +3 -1
- package/dist/src/setup/flows/login.js +1 -1
- package/dist/src/setup/flows/model-login-connection.d.ts +36 -0
- package/dist/src/setup/flows/model-login-connection.js +1 -0
- package/dist/src/setup/flows/model-login-progress.d.ts +7 -0
- package/dist/src/setup/flows/model-login-progress.js +1 -0
- package/dist/src/setup/flows/model-login.d.ts +22 -0
- package/dist/src/setup/flows/model-login.js +1 -0
- package/dist/src/setup/flows/model-source-change.d.ts +7 -0
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/model.d.ts +6 -24
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +3 -19
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/flows/vercel-model-login.d.ts +5 -0
- package/dist/src/setup/flows/vercel-model-login.js +1 -0
- package/dist/src/setup/integrations/self-modification/setup.d.ts +2 -0
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/prompter.d.ts +3 -1
- package/dist/src/setup/provider-settings.d.ts +19 -6
- package/dist/src/setup/provider-settings.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +6 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/setup/with-spinner.d.ts +1 -1
- package/dist/src/setup/with-spinner.js +1 -1
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +6 -4
- package/dist/src/shared/channel-definition.d.ts +2 -2
- package/dist/src/shared/chatgpt-model.d.ts +2 -2
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/connection-types.d.ts +20 -7
- package/dist/src/shared/conversation-context.d.ts +15 -0
- package/dist/src/shared/model-connection.d.ts +17 -0
- package/dist/src/shared/model-connection.js +1 -0
- package/dist/src/shared/model-endpoint-status.d.ts +2 -1
- package/dist/src/shared/model-helper.d.ts +26 -0
- package/dist/src/shared/model-helper.js +1 -0
- package/dist/src/shared/package-version.d.ts +2 -0
- package/dist/src/shared/package-version.js +1 -0
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/shared/vercel-services.d.ts +1 -0
- package/dist/src/shared/vercel-services.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +18 -12
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/source-change/agent-config-ast.d.ts +6 -0
- package/dist/src/source-change/agent-config-ast.js +1 -1
- package/dist/src/source-change/apply-model-selection.d.ts +3 -1
- package/dist/src/source-change/apply-model-selection.js +1 -2
- package/dist/src/source-change/static-source-change.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/event-proxy-step.d.ts +3 -3
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/handle-dispatch.d.ts +12 -2
- package/dist/src/subagents/handle-dispatch.js +1 -1
- package/dist/src/subagents/handles/operation-id.d.ts +1 -1
- package/dist/src/subagents/handles/query.d.ts +0 -6
- package/dist/src/subagents/handles/query.js +1 -1
- package/dist/src/subagents/handles/state-key.d.ts +1 -1
- package/dist/src/subagents/handles/store.d.ts +1 -1
- package/dist/src/subagents/handles/store.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +1 -1
- package/dist/src/subagents/parent-notification.d.ts +2 -2
- package/dist/src/subagents/parent-result.d.ts +1 -1
- package/dist/src/subagents/remote-dispatch.d.ts +1 -1
- package/dist/src/subagents/remote-dispatch.js +1 -1
- package/dist/src/subagents/start-local.js +1 -1
- 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/tasks/session-index.d.ts +11 -0
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/types.d.ts +1 -1
- package/dist/src/tools/auth.d.ts +5 -6
- package/dist/src/tools/provided/workflow.d.ts +12 -0
- package/dist/src/tools/provided/workflow.js +1 -0
- package/dist/src/tools/workflow-program-input.d.ts +6 -0
- package/dist/src/tools/workflow-program-input.js +1 -0
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +2 -1
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-otel-usage.js +1 -1
- package/dist/src/tracing/agent-span-contract.d.ts +1 -0
- package/dist/src/tracing/agent-span-contract.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +2 -0
- package/dist/src/tracing/content-attributes.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
- package/dist/src/tracing/local-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 +23 -23
- package/docs/channels/chat-sdk.mdx +11 -2
- package/docs/channels/custom.mdx +32 -16
- package/docs/channels/eve.mdx +21 -19
- package/docs/channels/linear.mdx +7 -3
- package/docs/channels/linq.mdx +1 -1
- package/docs/channels/overview.mdx +17 -2
- package/docs/channels/photon.mdx +4 -1
- package/docs/channels/slack.mdx +12 -2
- package/docs/concepts/execution-model-and-durability.mdx +62 -13
- package/docs/concepts/sessions-runs-and-streaming.md +14 -5
- package/docs/connections/mcp.mdx +4 -1
- package/docs/connections/openapi.mdx +8 -2
- package/docs/connections/overview.mdx +16 -13
- package/docs/getting-started.mdx +8 -4
- package/docs/guides/deployment/self-hosting.md +1 -1
- package/docs/guides/deployment/vercel.mdx +3 -3
- package/docs/guides/dev-tui.md +58 -31
- package/docs/guides/dynamic-capabilities.md +4 -4
- package/docs/guides/frontend/overview.mdx +3 -1
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation/meta.json +5 -0
- package/docs/guides/instrumentation/otel.mdx +149 -0
- package/docs/guides/instrumentation/overview.md +199 -0
- package/docs/guides/instrumentation/providers.mdx +169 -0
- package/docs/guides/meta.json +0 -1
- package/docs/guides/remote-agents.md +19 -21
- package/docs/install-integrations.mdx +2 -4
- package/docs/memory/custom-provider.md +1 -1
- package/docs/patterns/multi-tenant-auth.md +3 -3
- package/docs/protocols/acp.md +1 -1
- package/docs/reference/cli.md +16 -16
- package/docs/reference/telemetry.md +1 -1
- package/docs/reference/typescript-api.md +21 -14
- package/docs/sandbox.mdx +3 -3
- package/docs/subagents/index.mdx +4 -4
- package/docs/tools/workflows.mdx +57 -2
- package/docs/tutorial/how-it-runs.mdx +1 -1
- package/package.json +6 -1
- package/dist/src/cli/commands/init-repl.d.ts +0 -80
- package/dist/src/cli/commands/init-repl.js +0 -1
- package/dist/src/cli/commands/init-self-modification.d.ts +0 -7
- package/dist/src/cli/commands/init-self-modification.js +0 -1
- package/dist/src/cli/commands/registry-package.d.ts +0 -52
- package/dist/src/cli/commands/registry-package.js +0 -1
- package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +0 -12
- package/dist/src/cli/dev/tui/prompt-placeholder.js +0 -1
- package/dist/src/cli/dev/tui/remote-auth-command.d.ts +0 -11
- package/dist/src/cli/dev/tui/remote-auth-command.js +0 -3
- package/dist/src/compiled/_chunks/workflow/attribute-changes-BAcgmlXp.js +0 -20
- package/dist/src/compiled/_chunks/workflow/private-CFJkQA7R.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BEHe0Uut.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-ChHLjaCt.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-BB2HuVie.js +0 -1
- package/dist/src/execution/accepted-delivery-deployment.d.ts +0 -7
- package/dist/src/execution/accepted-delivery-deployment.js +0 -1
- package/dist/src/execution/dispatch-turn-step.d.ts +0 -5
- package/dist/src/execution/dispatch-turn-step.js +0 -1
- package/dist/src/execution/durable-session-migrations/chain.d.ts +0 -38
- package/dist/src/execution/durable-session-migrations/chain.js +0 -1
- package/dist/src/execution/durable-session-migrations/snapshot.d.ts +0 -6
- package/dist/src/execution/durable-session-migrations/snapshot.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.d.ts +0 -12
- package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +0 -2
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +0 -88
- package/dist/src/execution/durable-session-migrations/turn-workflow.js +0 -1
- package/dist/src/execution/forward-turn-cancellation-step.d.ts +0 -6
- package/dist/src/execution/forward-turn-cancellation-step.js +0 -1
- package/dist/src/execution/forward-turn-delivery-step.d.ts +0 -6
- package/dist/src/execution/forward-turn-delivery-step.js +0 -1
- package/dist/src/execution/inline-turn.d.ts +0 -31
- package/dist/src/execution/inline-turn.js +0 -1
- package/dist/src/execution/next-driver-action.d.ts +0 -93
- package/dist/src/execution/parked-delivery-wait.d.ts +0 -54
- package/dist/src/execution/parked-delivery-wait.js +0 -1
- package/dist/src/execution/session-command-inbox.d.ts +0 -52
- package/dist/src/execution/session-command-inbox.js +0 -1
- package/dist/src/execution/session-command-token.d.ts +0 -6
- package/dist/src/execution/session-command-token.js +0 -1
- package/dist/src/execution/session-state-cursor.d.ts +0 -25
- package/dist/src/execution/session-state-cursor.js +0 -1
- package/dist/src/execution/session-timeout-control.js +0 -1
- package/dist/src/execution/session-timeout-steps.js +0 -1
- package/dist/src/execution/session-timeout-workflow.js +0 -1
- package/dist/src/execution/session-timeout.d.ts +0 -2
- package/dist/src/execution/session-timeout.js +0 -1
- package/dist/src/execution/turn-cancellation-control.d.ts +0 -30
- package/dist/src/execution/turn-cancellation-control.js +0 -1
- package/dist/src/execution/turn-cancellation-token.d.ts +0 -10
- package/dist/src/execution/turn-cancellation-token.js +0 -1
- package/dist/src/execution/turn-control-protocol.d.ts +0 -36
- package/dist/src/execution/turn-control-protocol.js +0 -1
- package/dist/src/execution/turn-control-receiver.d.ts +0 -54
- package/dist/src/execution/turn-control-receiver.js +0 -1
- package/dist/src/execution/turn-dispatch.d.ts +0 -39
- package/dist/src/execution/turn-dispatch.js +0 -1
- package/dist/src/execution/turn-execution-cursor.d.ts +0 -49
- package/dist/src/execution/turn-execution-cursor.js +0 -1
- package/dist/src/execution/turn-workflow-tool-run.js +0 -1
- package/dist/src/execution/turn-workflow.d.ts +0 -13
- package/dist/src/execution/turn-workflow.js +0 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +0 -38
- package/dist/src/execution/wire/session-inbox-contract.js +0 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +0 -47
- package/dist/src/execution/wire/session-inbox-encoder.js +0 -1
- package/dist/src/execution/wire/session-inbox-resume.d.ts +0 -12
- package/dist/src/execution/wire/session-inbox-resume.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.d.ts +0 -29
- package/dist/src/execution/wire/session-inbox-wire.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v0.d.ts +0 -5
- package/dist/src/execution/wire/session-inbox-wire.v0.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.d.ts +0 -237
- package/dist/src/execution/wire/session-inbox-wire.v1.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2.d.ts +0 -478
- package/dist/src/execution/wire/session-inbox-wire.v2.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +0 -480
- package/dist/src/execution/wire/session-inbox-wire.v3.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +0 -267
- package/dist/src/execution/wire/session-inbox-wire.v4.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +0 -341
- package/dist/src/execution/wire/session-inbox-wire.v5.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +0 -341
- package/dist/src/execution/wire/session-inbox-wire.v6.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v7.d.ts +0 -342
- package/dist/src/execution/wire/session-inbox-wire.v7.js +0 -1
- package/dist/src/execution/workflow-entry-crash.d.ts +0 -39
- package/dist/src/execution/workflow-entry-crash.js +0 -1
- package/dist/src/execution/workflow-entry-finalization.d.ts +0 -28
- package/dist/src/execution/workflow-entry-finalization.js +0 -1
- package/dist/src/execution/workflow-entry.d.ts +0 -37
- package/dist/src/execution/workflow-entry.js +0 -1
- package/dist/src/execution/workflow-steps.js +0 -1
- package/dist/src/harness/workflow-continuation-security.d.ts +0 -5
- package/dist/src/harness/workflow-continuation-security.js +0 -1
- package/dist/src/harness/workflow-interrupt-state.d.ts +0 -20
- package/dist/src/harness/workflow-interrupt-state.js +0 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +0 -32
- package/dist/src/harness/workflow-lifecycle.js +0 -1
- package/dist/src/harness/workflow-sandbox.d.ts +0 -28
- package/dist/src/harness/workflow-sandbox.js +0 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +0 -28
- package/dist/src/harness/workflow-subagent-limit.js +0 -1
- package/dist/src/harness/workflow-task-state.d.ts +0 -9
- package/dist/src/harness/workflow-task-state.js +0 -1
- package/dist/src/harness/workflow-tool-description.d.ts +0 -22
- package/dist/src/harness/workflow-tool-description.js +0 -37
- package/dist/src/subagents/handles/rebase.d.ts +0 -4
- package/dist/src/subagents/handles/rebase.js +0 -1
- package/dist/src/tools/workflow.d.ts +0 -37
- package/dist/src/tools/workflow.js +0 -1
- package/docs/guides/instrumentation-providers.md +0 -249
- package/docs/guides/instrumentation.md +0 -453
- /package/dist/src/{execution/next-driver-action.js → client/eve-agent-store-state.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHook,sleep}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,isHookConflictError}from"#execution/hook-ownership.js";import{createActivitySnapshot,reduceActivityBatch}from"#execution/session-activity.js";import{disposeSessionActivityStep,renderSessionActivityStep}from"#execution/session-activity-renderer-step.js";async function activityCollectorWorkflow(e){"use workflow";let t=createHook({token:e.token}),n=t[Symbol.asyncIterator](),r,i=sleep(new Date(e.expiresAt)).then(()=>({kind:`expired`})),a=createActivitySnapshot(),o={};try{await claimHookOwnership(t)}catch(e){if(isHookConflictError(e))return;throw e}try{for(;;){r??=n.next();let t=await Promise.race([r.then(e=>({kind:`batch`,value:e})),i]);if(t.kind===`expired`||t.value.done===!0)break;r=void 0;let s=reduceCollectorActivity(a,t.value.value);if(a=s.snapshot,!s.presentationChanged)continue;let c=sleep(350).then(()=>({kind:`render`}));for(;;){r??=n.next();let e=await Promise.race([r.then(e=>({kind:`batch`,value:e})),c,i]);if(e.kind===`expired`)return;if(e.kind===`render
|
|
1
|
+
import{createHook,sleep}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,isHookConflictError}from"#execution/hook-ownership.js";import{createActivitySnapshot,reduceActivityBatch}from"#execution/session-activity.js";import{disposeSessionActivityStep,renderSessionActivityStep}from"#execution/session-activity-renderer-step.js";async function activityCollectorWorkflow(e){"use workflow";let t=createHook({token:e.token}),n=t[Symbol.asyncIterator](),r,i=sleep(new Date(e.expiresAt)).then(()=>({kind:`expired`})),a=createActivitySnapshot(),o={};try{await claimHookOwnership(t)}catch(e){if(isHookConflictError(e))return;throw e}try{for(;;){r??=n.next();let t=await Promise.race([r.then(e=>({kind:`batch`,value:e})),i]);if(t.kind===`expired`||t.value.done===!0)break;r=void 0;let s=reduceCollectorActivity(a,t.value.value);if(a=s.snapshot,!s.presentationChanged)continue;let c=sleep(350).then(()=>({kind:`render`}));for(;;){r??=n.next();let e=await Promise.race([r.then(e=>({kind:`batch`,value:e})),c,i]);if(e.kind===`expired`)return;if(e.kind===`render`||e.value.done===!0)break;r=void 0,a=reduceActivityBatch(a,e.value.value)}o=(await renderSessionActivityStep({rendererStates:o,serializedContext:e.serializedContext,snapshot:a})).rendererStates}}finally{await disposeSessionActivityStep({rendererStates:o,serializedContext:e.serializedContext}).catch(()=>{})}}function reduceCollectorActivity(e,t){let n=e.revision,r=reduceActivityBatch(e,t);return{presentationChanged:r.revision!==n,snapshot:r}}activityCollectorWorkflow.workflowId=`workflow//eve//activityCollectorWorkflow`;export{activityCollectorWorkflow,reduceCollectorActivity};
|
|
@@ -6,9 +6,10 @@ export interface MatchedAuthorizationCallback {
|
|
|
6
6
|
readonly candidateId?: string;
|
|
7
7
|
readonly result: {
|
|
8
8
|
readonly name: string;
|
|
9
|
+
readonly attemptId: string;
|
|
9
10
|
} & AuthorizationResult;
|
|
10
11
|
}
|
|
11
|
-
/** Matches
|
|
12
|
+
/** Matches each callback to exactly one pending authorization attempt. */
|
|
12
13
|
export declare function matchAuthorizationCallbacks(pending: PendingAuthorizationState, payloads: readonly DeliverPayload[]): {
|
|
13
14
|
readonly matches: readonly MatchedAuthorizationCallback[];
|
|
14
15
|
readonly remainingPayloads: readonly DeliverPayload[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function matchAuthorizationCallbacks(e,t){let n=[],r=[],i=new Set;for(let a of t){let t=a.authorizationCallback;if(t===void 0){r.push(a);continue}let o=e.challenges.find(e=>e.name===t.connectionName
|
|
1
|
+
function matchAuthorizationCallbacks(e,t){let n=[],r=[],i=new Set;for(let a of t){let t=a.authorizationCallback;if(t===void 0){r.push(a);continue}let o=e.challenges.find(e=>e.name===t.connectionName&&typeof t.attemptId==`string`&&e.attemptId===t.attemptId),s=o?.attemptId;o===void 0||s===void 0||o.principal===void 0||i.has(s)||(i.add(s),n.push({authorization:o.challenge,candidateId:o.candidateId,result:{attemptId:s,callback:t.callback,hookUrl:o.hookUrl,instanceId:o.instanceId,name:o.name,principal:o.principal,resume:o.resume}}))}return{matches:n,remainingPayloads:r}}export{matchAuthorizationCallbacks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger,logError}from"#internal/logging.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{requestWorkflowTurnCancellation}from"#execution/workflow-runtime.js";import{deserializeContext}from"#context/serialize.js";import{readDurableSession}from"#execution/durable-session-store.js";import{cancelRemoteAgentTurn,isRetryableRemoteAgentCancelError,resolveRemoteAgentForAction}from"#subagents/remote-dispatch.js";import{cancelWorkflowToolRun}from"#execution/tools/workflow/cancel.js";import{getWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";const log=createLogger(`execution.cancel-descendant-turns`);async function cancelDescendantTurnsStep(e){"use step";let t,n;try{let r=
|
|
1
|
+
import{createLogger,logError}from"#internal/logging.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{requestWorkflowTurnCancellation}from"#execution/workflow-runtime.js";import{deserializeContext}from"#context/serialize.js";import{readDurableSession}from"#execution/durable-session-store.js";import{cancelRemoteAgentTurn,isRetryableRemoteAgentCancelError,resolveRemoteAgentForAction}from"#subagents/remote-dispatch.js";import{cancelWorkflowToolRun}from"#execution/tools/workflow/cancel.js";import{getWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{getDynamicSubagentSelection}from"#context/dynamic-subagent-lifecycle.js";const log=createLogger(`execution.cancel-descendant-turns`);async function cancelDescendantTurnsStep(e){"use step";let t,n;try{let r=readDurableSession(e.sessionState);n=getWorkflowToolRuns(r.state);let i=new Set(n.map(e=>e.runId));t=(getAgentHandleStore(r.state)?.handles??[]).filter(e=>e.phase===`running`||e.phase===`claimed`&&i.has(e.ownerId))}catch(t){logError(log,`failed to read pending descendants during cancellation`,t,{sessionId:e.sessionState.sessionId});return}if(await Promise.all(n.map(e=>cancelWorkflowToolRun(e,`The turn that called the tool was cancelled.`))),t.length===0)return;let r,getRemoteContext=()=>r??=deserializeContext(e.serializedContext).then(e=>({ctx:e,registry:e.require(BundleKey).subagentRegistry.subagentsByNodeId}));await Promise.all(t.map(e=>e.address.kind===`agent/remote`?cancelRemoteDescendant({handle:e,remoteContext:getRemoteContext()}):cancelLocalDescendant({handle:e})))}async function cancelLocalDescendant(e){let{handle:t}=e;try{let e=await requestCancellationWithRetry({request:()=>requestWorkflowTurnCancellation({sessionId:t.address.sessionId}),shouldRetryError:()=>!1});e.status!==`accepted`&&log.warn(`descendant cancel was never accepted; the child may run to completion`,{callId:readHandleCallId(t),childSessionId:t.address.sessionId,finalStatus:e.status,subagentName:t.identity.name})}catch(e){logError(log,`failed to cancel local descendant turn`,e,{callId:readHandleCallId(t),childSessionId:t.address.sessionId,subagentName:t.identity.name})}}async function cancelRemoteDescendant(e){let{handle:t}=e;if(t.address.kind!==`agent/remote`)return;let n=t.address.url;try{let{ctx:r,registry:i}=await e.remoteContext,a=getDynamicSubagentSelection(r,t.identity.nodeId),o={...await resolveRemoteAgentForAction({dynamicRemoteAgent:a?.kind===`remote`?a.remoteAgent:void 0,nodeId:t.identity.nodeId,remoteAgentName:t.identity.name,registry:i}),url:n},s=await requestCancellationWithRetry({request:()=>cancelRemoteAgentTurn({remote:o,sessionId:t.address.sessionId}),shouldRetryError:isRetryableRemoteAgentCancelError});s.status!==`accepted`&&log.warn(`remote descendant cancel was never accepted; the child may run to completion`,{callId:readHandleCallId(t),childSessionId:t.address.sessionId,finalStatus:s.status,remoteAgentName:t.identity.name})}catch(e){logError(log,`failed to cancel remote descendant turn`,e,{callId:readHandleCallId(t),childSessionId:t.address.sessionId,remoteAgentName:t.identity.name})}}function readHandleCallId(e){return e.phase===`running`?e.operation.callId:e.callId}async function requestCancellationWithRetry(e){let t=250,n={status:`no_active_turn`};for(let r=1;r<=8;r+=1){try{if(n=await e.request(),n.status===`accepted`||r===8)return n}catch(t){if(!e.shouldRetryError(t)||r===8)throw t}await new Promise(e=>setTimeout(e,t)),t=Math.min(t*2,1500)}return n}export{cancelDescendantTurnsStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger,logError}from"#internal/logging.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{deserializeContext}from"#context/serialize.js";import{readDurableSession}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{cancelOwnedTask}from"#execution/tasks/parent/dispatch.js";import{cancelBackgroundAgentTask}from"#execution/tools/subagent/task-cancel.js";import{getSessionTaskIndex}from"#tasks/session-index.js";const log=createLogger(`execution.cancel-indexed-session-tasks`);async function cancelAllIndexedSessionTasksStep(e){"use step";let t;try{t=
|
|
1
|
+
import{createLogger,logError}from"#internal/logging.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{deserializeContext}from"#context/serialize.js";import{readDurableSession}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{cancelOwnedTask}from"#execution/tasks/parent/dispatch.js";import{cancelBackgroundAgentTask}from"#execution/tools/subagent/task-cancel.js";import{getSessionTaskIndex}from"#tasks/session-index.js";const log=createLogger(`execution.cancel-indexed-session-tasks`);async function cancelAllIndexedSessionTasksStep(e){"use step";let t;try{t=readDurableSession(e.sessionState)}catch(t){logError(log,`failed to read the session for indexed task cancellation`,t,{parentSessionId:e.sessionState.sessionId});return}let n;try{n=getSessionTaskIndex(t.state)}catch(e){logError(log,`failed to read the task index`,e,{parentSessionId:t.sessionId});return}if(n.length===0)return;if(e.serializedContext===void 0)throw Error(`Indexed task cancellation requires serialized runtime context.`);let r=await deserializeContext(e.serializedContext),i=r.require(BundleKey),a=resolveEffectiveAgentRuntime(i,r),o=hydrateDurableSession({durable:t,turnAgent:a.turnAgent});for(let r of n)try{await cancelOwnedTask({cancelOwnedWork:cancelBackgroundAgentTask,entry:r,serializedContext:e.serializedContext,session:o})}catch(e){logError(log,`failed to cancel indexed task`,e,{parentSessionId:t.sessionId,taskId:r.taskId})}}export{cancelAllIndexedSessionTasksStep};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ContextContainer } from "#context/container.js";
|
|
2
|
-
import type { DurableStepResult } from "#execution/
|
|
2
|
+
import type { DurableStepResult } from "#execution/session/turn-step-types.js";
|
|
3
3
|
import type { HarnessSession, StepInput, StepResult } from "#harness/types.js";
|
|
4
4
|
export interface CompletedModelCallCheckpoint {
|
|
5
5
|
readonly result: StepResult;
|
|
@@ -22,15 +22,5 @@
|
|
|
22
22
|
* internet.
|
|
23
23
|
*/
|
|
24
24
|
import type { RouteContext } from "#public/definitions/channel.js";
|
|
25
|
-
/**
|
|
26
|
-
* Logical name prefix of the framework-shipped connection callback
|
|
27
|
-
* channel. The trailing method segment (`get` or `post`) keeps each
|
|
28
|
-
* `(method, urlPath)` pair distinct in the channel registry.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Inbound handler for the connection callback route. Exported for test
|
|
32
|
-
* coverage; the framework channel resolver wires it into Nitro via
|
|
33
|
-
* {@link getConnectionCallbackChannelDefinitions}.
|
|
34
|
-
*/
|
|
25
|
+
/** Resumes the exact authorization attempt through the session inbox. */
|
|
35
26
|
export declare function handleConnectionCallbackRequest(request: Request, ctx: RouteContext): Promise<Response>;
|
|
36
|
-
export declare function handleLegacyConnectionCallbackRequest(request: Request, ctx: RouteContext): Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resumeAuthorizationCallback}from"#execution/legacy-session/authorization.js";import{buildAuthorizationCompletePage}from"#runtime/connections/authorization-complete-page.js";async function handleConnectionCallbackRequest(e,t){let n=t.params.name,r=t.params.attemptId,i=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing connection name.`,ok:!1},{status:400});if(typeof i!=`string`||i.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});if(typeof r!=`string`||r.length===0)return Response.json({error:`Missing authorization attempt ID.`,ok:!1},{status:400});let a=await projectAuthorizationCallback(e);try{await resumeAuthorizationCallback(i,{kind:`authorization-callback`,payloads:[{authorizationCallback:{attemptId:r,callback:a,connectionName:n}}]})}catch{return Response.json({error:`Connection callback not pending.`,ok:!1},{status:404})}return buildAuthorizationCompletePage()}async function projectAuthorizationCallback(e){let t={};for(let[n,r]of new URL(e.url).searchParams)t[n]=r;let n;if(e.method!==`GET`&&e.method!==`HEAD`){try{n=await e.text()}catch{n=void 0}let r=e.headers.get(`content-type`)??``;if(n&&r.includes(`application/x-www-form-urlencoded`))for(let[e,r]of new URLSearchParams(n))t[e]=r}return n===void 0?{params:t,method:e.method}:{params:t,method:e.method,body:n}}export{handleConnectionCallbackRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{walkCauseChain}from"#shared/errors.js";import{cancelRun,getWorld}from"#internal/workflow/runtime.js";import{EntityConflictError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{resumeSessionInbox}from"#execution/session-inbox/resume.js";async function settleContinuationConflictStep(e){"use step";try{e.command!==void 0&&await resumeSessionInbox(e.continuationToken,e.command)}finally{e.activityCollectorRunId!==void 0&&await cancelCollector(e.activityCollectorRunId)}}async function cancelCollector(e){try{await cancelRun(await getWorld(),e,{cancelReason:`Session candidate did not acquire continuation ownership`})}catch(e){if(!isInactiveRun(e))throw e}}function isInactiveRun(e){for(let t of walkCauseChain(e))if(WorkflowRunNotFoundError.is(t)||RunExpiredError.is(t)||EntityConflictError.is(t))return!0;return!1}export{settleContinuationConflictStep};
|
|
@@ -22,7 +22,7 @@ export type DispatchPlanEntry = {
|
|
|
22
22
|
export interface CoordinationDispatchInput {
|
|
23
23
|
readonly callbackBaseUrl?: string;
|
|
24
24
|
readonly workflowToolRunOwner: WorkflowToolRunOwner;
|
|
25
|
-
readonly
|
|
25
|
+
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
26
26
|
readonly serializedContext: Record<string, unknown>;
|
|
27
27
|
readonly sessionState: DurableSessionState;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ConversationContextKey}from"#shared/conversation-context.js";import"#channel/adapter.js";import"#context/container.js";import{ActivityObserverKey,AuthKey,CapabilitiesKey,ChannelInstrumentationKey,InitiatorAuthKey,LocalDevRequestKey,ParentSessionKey,SandboxKey}from"#context/keys.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{deriveRootTurnActivityWorkId}from"#execution/activity-work-id.js";import{deserializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{isTaskControlAction}from"#execution/tasks/parent/dispatch.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{withContextScope}from"#context/run-step.js";import{assertUniqueCoordinationCallIds,getPendingCoordinationBatch,setPendingCoordinationBatch}from"#harness/coordination.js";import{activeTurnId}from"#harness/active-turn-id.js";import"#subagents/tool.js";async function prepareCoordinationDispatch(e){let t=
|
|
1
|
+
import{ConversationContextKey}from"#shared/conversation-context.js";import"#channel/adapter.js";import"#context/container.js";import{ActivityObserverKey,AuthKey,CapabilitiesKey,ChannelInstrumentationKey,InitiatorAuthKey,LocalDevRequestKey,ParentSessionKey,SandboxKey}from"#context/keys.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{deriveRootTurnActivityWorkId}from"#execution/activity-work-id.js";import{deserializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{getAgentHandleStore}from"#subagents/handles/store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{isTaskControlAction}from"#execution/tasks/parent/dispatch.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{withContextScope}from"#context/run-step.js";import{assertUniqueCoordinationCallIds,getPendingCoordinationBatch,setPendingCoordinationBatch}from"#harness/coordination.js";import{activeTurnId}from"#harness/active-turn-id.js";import"#subagents/tool.js";async function prepareCoordinationDispatch(e){let t=readDurableSession(e.sessionState),n=getPendingCoordinationBatch(t.state);if(n===void 0)return;let r=[...n.runtimeActions,...n.tasks];if(r.length===0)return;let i=n.event.turnId||activeTurnId(e.sessionState.emissionState),a=n.event.turnId===i?n.event:{...n.event,turnId:i},o=await deserializeContext(e.serializedContext),s=await prepareActionDispatch({batch:{event:a,localFanoutSize:n.localFanoutSize,requests:r},ctx:o,durableSession:t,plan:()=>planDispatch({requests:r}),serializedContext:e.serializedContext});if(a===n.event)return{...s,sessionState:e.sessionState};let c=setPendingCoordinationBatch({...n,event:a,session:s.session});return{...s,session:c,sessionState:createDurableSessionState({session:c})}}async function prepareActionDispatch(e){let{batch:t,durableSession:n}=e;assertUniqueCoordinationCallIds(t.requests);let r=e.ctx,i=r.require(BundleKey),a=resolveEffectiveAgentRuntime(i,r),o=hydrateDurableSession({compactionOverrides:{thresholdPercent:a.thresholdPercent},durable:n,turnAgent:a.turnAgent}),s=r.require(ChannelKey);getAgentHandleStore(n.state);let c=e.plan({bundle:i,ctx:r,requests:t.requests,session:o}),l=resolveActiveSandboxSessionId(s.state,o.sessionId);if(e.planSharesSandbox?.({bundle:i,plan:c})===!0)try{o=(await withContextScope(r,o,async e=>(await r.require(SandboxKey).get(),{result:void 0,session:e}))).session}finally{r.clearVirtualContext()}return{adapter:s,adapterCtx:buildAdapterContext(s,r),auth:r.get(AuthKey)??null,batch:t,bundle:i,capabilities:r.get(CapabilitiesKey),channelMetadata:r.get(ChannelInstrumentationKey),inheritedConversation:r.get(ConversationContextKey),fanoutSize:e.fanoutSize??t.localFanoutSize??0,initiatorAuth:r.get(InitiatorAuthKey)??null,localDevRequest:r.get(LocalDevRequestKey),parentSession:r.get(ParentSessionKey),plan:c,activityObserver:resolvePreparedActivity(r.get(ActivityObserverKey),o,t.event.turnId),sandboxSessionId:l,serializedContext:e.serializedContext,session:o}}function resolvePreparedActivity(e,t,n){if(e!==void 0)return{sink:e.sink,workIdentity:e.workIdentity??{id:deriveRootTurnActivityWorkId({sessionId:t.sessionId,turnId:n}),kind:`root-turn`,rootSessionId:t.rootSessionId??t.sessionId,rootTurnId:n,sessionId:t.sessionId,turnId:n}}}function resolveActiveSandboxSessionId(e,t){if(typeof e!=`object`||!e)return t;let n=e.sandboxSessionId;return typeof n==`string`&&n.length>0?n:t}function planDispatch(e){return e.requests.map(e=>{if(e.kind===`tool-call`){if(!isTaskControlAction(e))throw Error(`Unsupported task control "${e.toolName}".`);return{action:e,kind:`task-control`}}if(e.kind===`workflow-task`)return{kind:`workflow-task`,task:e};throw Error(`Unsupported coordination request "${String(e.kind)}".`)})}export{prepareActionDispatch,prepareCoordinationDispatch};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** Starts workflow-tool runs
|
|
1
|
+
/** Starts workflow-tool runs and framework controls for pending coordination. */
|
|
2
2
|
import { type CoordinationDispatchInput, type CoordinationDispatchResult } from "#execution/coordination-dispatch-shared.js";
|
|
3
3
|
type CoordinationDispatchStepInput = CoordinationDispatchInput & {
|
|
4
|
-
readonly action: "park"
|
|
4
|
+
readonly action: "park";
|
|
5
5
|
};
|
|
6
6
|
export declare function dispatchCoordinationStep(input: CoordinationDispatchStepInput): Promise<CoordinationDispatchResult>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createDurableSessionState}from"#execution/durable-session-store.js";import{executeTaskControlAction}from"#execution/tasks/parent/dispatch.js";import{cancelBackgroundAgentTask}from"#execution/tools/subagent/task-cancel.js";import{prepareCoordinationDispatch}from"#execution/coordination-dispatch-shared.js";import{startWorkflowTask}from"#execution/tools/workflow/start.js";async function dispatchCoordinationStep(e){"use step";let t=await prepareCoordinationDispatch({serializedContext:e.serializedContext,sessionState:e.sessionState});if(t===void 0)return{results:[],sessionState:e.sessionState,pendingTasks:[]};let{batch:n,session:r}=t,i=r,a=[],o=[];for(let r of t.plan){if(r.kind===`workflow-task`){let o=await startWorkflowTask({auth:t.auth,batchEvent:n.event,initiatorAuth:t.initiatorAuth,owner:e.workflowToolRunOwner,parentSession:t.parentSession,session:i,task:r.task});i=o.session,o.result!==void 0&&a.push(o.result);continue}if(r.kind===`task-control`){let e=await executeTaskControlAction({action:r.action,cancelOwnedWork:cancelBackgroundAgentTask,serializedContext:t.serializedContext,session:i});i=e.session,e.pendingTask!==void 0&&o.push(e.pendingTask),a.push(e.result)}}return{results:a,sessionState:i===r?t.sessionState:createDurableSessionState({session:i}),pendingTasks:o}}export{dispatchCoordinationStep};
|
|
@@ -6,7 +6,7 @@ import type { DynamicSubagentAgentConfig } from "#runtime/subagents/dynamic-agen
|
|
|
6
6
|
/**
|
|
7
7
|
* Result returned by {@link createSessionStep}.
|
|
8
8
|
*
|
|
9
|
-
* Exposes the projected {@link DurableSessionState} the
|
|
9
|
+
* Exposes the projected {@link DurableSessionState} the owner needs to
|
|
10
10
|
* drive the turn loop.
|
|
11
11
|
*/
|
|
12
12
|
export interface CreateSessionStepResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createDurableSessionState}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntimeFromConfig}from"#execution/effective-agent-config.js";import{createSession}from"#execution/session.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{resolveDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{resolveInheritedTokenLimit}from"#execution/run-session-limits.js";async function createSessionStep(e){"use step";let t=await getCompiledRuntimeAgentBundle({compiledArtifactsSource:resolveDurableCompiledArtifactsSource(e.compiledArtifactsSource),nodeId:e.nodeId}),n=resolveEffectiveAgentRuntimeFromConfig(t,e.dynamicSubagentAgentConfig),r=createSession({compactionOverrides:{thresholdPercent:n.thresholdPercent},continuationToken:e.continuationToken,limits:{maxInputTokensPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxInputTokensPerSession,inherited:e.inheritedLimits?.maxInputTokensPerSession}),maxOutputTokensPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxOutputTokensPerSession,inherited:e.inheritedLimits?.maxOutputTokensPerSession}),maxTokenCostUsdPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxTokenCostUsdPerSession,inherited:e.inheritedLimits?.maxTokenCostUsdPerSession})},outputSchema:e.outputSchema,rootSessionId:e.rootSessionId,sessionId:e.sessionId,taskId:e.taskId,turnAgent:n.turnAgent
|
|
1
|
+
import{createDurableSessionState}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntimeFromConfig}from"#execution/effective-agent-config.js";import{createSession}from"#execution/session.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{resolveDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{resolveInheritedTokenLimit}from"#execution/run-session-limits.js";async function createSessionStep(e){"use step";let t=await getCompiledRuntimeAgentBundle({compiledArtifactsSource:resolveDurableCompiledArtifactsSource(e.compiledArtifactsSource),nodeId:e.nodeId}),n=resolveEffectiveAgentRuntimeFromConfig(t,e.dynamicSubagentAgentConfig),r=createSession({compactionOverrides:{thresholdPercent:n.thresholdPercent},continuationToken:e.continuationToken,limits:{maxInputTokensPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxInputTokensPerSession,inherited:e.inheritedLimits?.maxInputTokensPerSession}),maxOutputTokensPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxOutputTokensPerSession,inherited:e.inheritedLimits?.maxOutputTokensPerSession}),maxTokenCostUsdPerSession:resolveInheritedTokenLimit({configured:n.limits?.maxTokenCostUsdPerSession,inherited:e.inheritedLimits?.maxTokenCostUsdPerSession})},outputSchema:e.outputSchema,rootSessionId:e.rootSessionId,sessionId:e.sessionId,taskId:e.taskId,turnAgent:n.turnAgent});return{state:createDurableSessionState({session:r})}}export{createSessionStep};
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Durable session storage.
|
|
3
|
-
*
|
|
4
|
-
* Session-mutating steps return the current snapshot inside
|
|
5
|
-
* {@link DurableSessionState}; Workflow step results are the atomic
|
|
6
|
-
* persistence boundary for session program memory. The legacy
|
|
7
|
-
* `"eve.session"` stream remains as a fallback for old in-flight
|
|
8
|
-
* sessions that only carry a small state handle.
|
|
9
|
-
*
|
|
10
|
-
* The driver workflow run is pinned to the deployment that called
|
|
11
|
-
* `start()`; child turn workflows run on latest. Both
|
|
12
|
-
* {@link DurableSessionState} and {@link DurableSessionSnapshot} carry
|
|
13
|
-
* a `version` so a pinned driver can ferry shapes written by newer
|
|
14
|
-
* steps. Adding optional fields is forward-compatible (devalue
|
|
15
|
-
* preserves unknown POJO fields); shape-breaking changes bump
|
|
16
|
-
* `version` and add a migrator.
|
|
17
|
-
*/
|
|
18
1
|
import { type HarnessEmissionState } from "#harness/emission.js";
|
|
19
2
|
import type { HarnessModelMessage } from "#harness/messages.js";
|
|
20
3
|
import type { HarnessSession, SessionStateMap } from "#harness/types.js";
|
|
21
4
|
import type { SandboxState } from "#sandbox/state.js";
|
|
22
5
|
import type { JsonObject } from "#shared/json.js";
|
|
23
|
-
/**
|
|
6
|
+
/** Explicit checkpoint contract shared by deployment handoffs. */
|
|
24
7
|
export declare const DURABLE_SESSION_VERSION = 1;
|
|
25
8
|
/**
|
|
26
9
|
* Serializable handle to a durable session.
|
|
@@ -29,14 +12,12 @@ export declare const DURABLE_SESSION_VERSION = 1;
|
|
|
29
12
|
* workflow body needs without taking a step boundary: identity, the
|
|
30
13
|
* hook continuation token,
|
|
31
14
|
* `hasProxyInputRequests` (a closed-contract short-circuit that lets
|
|
32
|
-
* the
|
|
15
|
+
* the owner skip a per-delivery proxy-routing step when no
|
|
33
16
|
* descendant subagent is active), and `emissionState` (so workflow-body
|
|
34
17
|
* framework steps can stamp protocol events
|
|
35
18
|
* with `{ turnId, sequence, stepIndex }` without reading the full
|
|
36
|
-
* durable session).
|
|
37
|
-
*
|
|
38
|
-
* `snapshot` is optional so old stream-backed states can still read
|
|
39
|
-
* from the legacy `eve.session` fallback.
|
|
19
|
+
* durable session). Turn steps return state transitions to the owning
|
|
20
|
+
* `SessionStateCursor`; policy-only turn outcomes never carry snapshots.
|
|
40
21
|
*/
|
|
41
22
|
export interface DurableSessionState {
|
|
42
23
|
readonly version: typeof DURABLE_SESSION_VERSION;
|
|
@@ -44,11 +25,11 @@ export interface DurableSessionState {
|
|
|
44
25
|
readonly continuationToken: string;
|
|
45
26
|
readonly hasProxyInputRequests: boolean;
|
|
46
27
|
readonly emissionState: HarnessEmissionState;
|
|
47
|
-
readonly snapshot
|
|
28
|
+
readonly snapshot: DurableSessionSnapshot;
|
|
48
29
|
}
|
|
49
30
|
/**
|
|
50
31
|
* Durable projection of {@link HarnessSession} embedded in state
|
|
51
|
-
* snapshots
|
|
32
|
+
* snapshots.
|
|
52
33
|
*
|
|
53
34
|
* Omits `agent.modelReference`, `agent.tools`,
|
|
54
35
|
* `agent.compactionModelReference`, and the `compaction` thresholds —
|
|
@@ -74,7 +55,6 @@ export interface DurableSession {
|
|
|
74
55
|
readonly state?: SessionStateMap;
|
|
75
56
|
readonly sandboxState?: SandboxState;
|
|
76
57
|
readonly taskId?: string;
|
|
77
|
-
readonly workflowMaxSubagents?: number;
|
|
78
58
|
readonly agent: {
|
|
79
59
|
readonly system: string;
|
|
80
60
|
};
|
|
@@ -83,31 +63,12 @@ export interface DurableSession {
|
|
|
83
63
|
readonly lastKnownPromptMessageCount?: number;
|
|
84
64
|
};
|
|
85
65
|
}
|
|
86
|
-
/**
|
|
66
|
+
/** Session program memory persisted atomically with Workflow step results. */
|
|
87
67
|
export interface DurableSessionSnapshot {
|
|
88
|
-
readonly version: typeof DURABLE_SESSION_VERSION;
|
|
89
68
|
readonly session: DurableSession;
|
|
90
69
|
}
|
|
91
|
-
/**
|
|
92
|
-
export declare function
|
|
93
|
-
readonly session: HarnessSession;
|
|
94
|
-
}): DurableSessionState;
|
|
95
|
-
/**
|
|
96
|
-
* Reads the latest durable session snapshot and returns the
|
|
97
|
-
* {@link DurableSession} inside.
|
|
98
|
-
*
|
|
99
|
-
* New states carry the snapshot directly through Workflow step
|
|
100
|
-
* results. States without `snapshot` fall back to the legacy
|
|
101
|
-
* `eve.session` stream tail (`startIndex: -1`). The snapshot is
|
|
102
|
-
* migrated to {@link DURABLE_SESSION_VERSION} before return; unknown
|
|
103
|
-
* versions throw.
|
|
104
|
-
*
|
|
105
|
-
* Devalue handles encode/decode so rich types in the session (URL
|
|
106
|
-
* `FilePart.data`, Buffer, Date, Map, Set) round-trip structurally.
|
|
107
|
-
*
|
|
108
|
-
* MUST be called from inside a `"use step"` body.
|
|
109
|
-
*/
|
|
110
|
-
export declare function readDurableSession(state: DurableSessionState): Promise<DurableSession>;
|
|
70
|
+
/** Reads only the embedded checkpoint; no stream or migration fallback exists. */
|
|
71
|
+
export declare function readDurableSession(state: DurableSessionState): DurableSession;
|
|
111
72
|
/**
|
|
112
73
|
* Creates the projected {@link DurableSessionState} with the current
|
|
113
74
|
* snapshot embedded in the Workflow step result.
|
|
@@ -115,7 +76,7 @@ export declare function readDurableSession(state: DurableSessionState): Promise<
|
|
|
115
76
|
export declare function createDurableSessionState(input: {
|
|
116
77
|
readonly session: HarnessSession;
|
|
117
78
|
}): DurableSessionState;
|
|
118
|
-
/** Replaces
|
|
79
|
+
/** Replaces session program memory and refreshes its workflow projections. */
|
|
119
80
|
export declare function replaceDurableSessionSnapshot(input: {
|
|
120
81
|
readonly session: DurableSession;
|
|
121
82
|
readonly state: DurableSessionState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getHarnessEmissionState}from"#harness/emission.js";import{
|
|
1
|
+
import{getHarnessEmissionState}from"#harness/emission.js";import{projectToDurableSession}from"#execution/session.js";import{hasProxyInputRequests}from"#harness/proxy-input-requests.js";const DURABLE_SESSION_VERSION=1;function readDurableSession(e){if(e.version!==1||e.snapshot?.session===void 0)throw Error(`Unsupported session checkpoint. Start a new session on this deployment.`);return e.snapshot.session}function createDurableSessionState(e){return projectDurableSessionState(projectToDurableSession(e.session))}function replaceDurableSessionSnapshot(e){return{...e.state,...projectDurableSessionState(e.session)}}function projectDurableSessionState(e){return{continuationToken:e.continuationToken,emissionState:getHarnessEmissionState(e.state),hasProxyInputRequests:hasProxyInputRequests(e.state),sessionId:e.sessionId,version:1,snapshot:{session:e}}}export{DURABLE_SESSION_VERSION,createDurableSessionState,readDurableSession,replaceDurableSessionSnapshot};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { parseWorkflowProgramOutput, type WorkflowProgramInput } from "#execution/dynamic-workflow/schema.js";
|
|
2
|
+
import { type WorkflowSandboxInterrupt } from "#shared/workflow-sandbox.js";
|
|
3
|
+
export type WorkflowProgramStepOutcome = {
|
|
4
|
+
readonly output: ReturnType<typeof parseWorkflowProgramOutput>;
|
|
5
|
+
readonly status: "completed";
|
|
6
|
+
} | {
|
|
7
|
+
readonly interrupt: WorkflowSandboxInterrupt;
|
|
8
|
+
readonly pending: readonly WorkflowSandboxInterrupt[];
|
|
9
|
+
readonly status: "interrupted";
|
|
10
|
+
};
|
|
11
|
+
interface WorkflowProgramStepInput {
|
|
12
|
+
readonly callId: string;
|
|
13
|
+
readonly program: WorkflowProgramInput;
|
|
14
|
+
readonly resume?: {
|
|
15
|
+
readonly interrupt: WorkflowSandboxInterrupt;
|
|
16
|
+
readonly resolutions: readonly unknown[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Runs or resumes the side-effect-free JavaScript sandbox for one durable workflow. */
|
|
20
|
+
export declare function runWorkflowProgramStep(input: WorkflowProgramStepInput): Promise<WorkflowProgramStepOutcome>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsonSchema}from"ai";import{WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT,WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND,parseWorkflowProgramOutput,readWorkflowProgramCallInterrupt}from"#execution/dynamic-workflow/schema.js";import{continueWorkflowSandboxInterrupt,createParkingHostTool,createWorkflowSandboxTool,getWorkflowSandboxPendingInterrupts,unwrapWorkflowSandboxResult}from"#shared/workflow-sandbox.js";const agentBridgeSchema=jsonSchema({additionalProperties:!1,properties:{input:{additionalProperties:!1,properties:{agentId:{type:`string`},message:{type:`string`},outputSchema:{type:`object`}},required:[`message`],type:`object`},target:{type:`string`}},required:[`target`,`input`],type:`object`});async function runWorkflowProgramStep(e){"use step";let t=buildWorkflowProgramTools(),n=e.program.continuationSecurity,r;if(e.resume===void 0){let i=await createWorkflowSandboxTool({bridgeRequestLimit:WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT,continuationSecurity:n,hostTools:t});if(i.execute===void 0)throw Error(`Workflow program has no sandbox executor.`);r=await i.execute({js:wrapWorkflowProgram(e.program.js)},{toolCallId:e.callId})}else{let i=e.resume.interrupt;r=i;for(let a of e.resume.resolutions){r=await continueWorkflowSandboxInterrupt({bridgeRequestLimit:WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT,continuationSecurity:n,interrupt:i,resolution:a,tools:t});let e=await unwrapWorkflowSandboxResult(r,n);if(e.status===`completed`)break;let o=getWorkflowSandboxPendingInterrupts(e.interrupt)[0];if(o===void 0)throw Error(`Workflow program continuation contains no pending agent call.`);i=o}}let i=await unwrapWorkflowSandboxResult(r,n);if(i.status===`completed`)return{output:parseWorkflowProgramOutput(i.output),status:`completed`};let a=getWorkflowSandboxPendingInterrupts(i.interrupt);if(a.length===0)throw Error(`Workflow program continuation contains no pending agent call.`);for(let e of a)readWorkflowProgramCallInterrupt(e);return{interrupt:a[0],pending:a,status:`interrupted`}}function buildWorkflowProgramTools(){return{agent:createParkingHostTool({description:`Invoke one allowlisted child agent.`,inputSchema:agentBridgeSchema,interrupt:e=>({kind:WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND,task:void 0,toolInput:e,toolName:`agent`})})}}function wrapWorkflowProgram(e){return`return await (async (ctx) => {\n${e}\n})(Object.freeze({\n agent: (target, input) => tools.agent({ target, input }),\n}));`}export{runWorkflowProgramStep};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type JsonObject, type JsonValue } from "#shared/json.js";
|
|
2
|
+
export declare const DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS = 100;
|
|
3
|
+
export declare const MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS = 128;
|
|
4
|
+
export declare const WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT = 256;
|
|
5
|
+
export declare const WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND = "eve.workflow-program-agent-call";
|
|
6
|
+
export interface WorkflowProgramCallInterrupt {
|
|
7
|
+
readonly kind: typeof WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND;
|
|
8
|
+
readonly task: undefined;
|
|
9
|
+
readonly toolInput: unknown;
|
|
10
|
+
readonly toolName: "agent";
|
|
11
|
+
}
|
|
12
|
+
export interface WorkflowProgramContinuationSecurity {
|
|
13
|
+
readonly maxAgeMs?: number;
|
|
14
|
+
readonly signingKey: string;
|
|
15
|
+
}
|
|
16
|
+
/** Internal durable input pinned for one generated program run. */
|
|
17
|
+
export interface WorkflowProgramInput {
|
|
18
|
+
readonly continuationSecurity: WorkflowProgramContinuationSecurity;
|
|
19
|
+
readonly js: string;
|
|
20
|
+
readonly maxSubagents: number;
|
|
21
|
+
}
|
|
22
|
+
export type WorkflowProgramOptions = Pick<WorkflowProgramInput, "maxSubagents">;
|
|
23
|
+
export interface WorkflowProgramAgentCall {
|
|
24
|
+
readonly input: {
|
|
25
|
+
readonly agentId?: string;
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly outputSchema?: JsonObject;
|
|
28
|
+
};
|
|
29
|
+
readonly target: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function parseWorkflowProgramOptions(value: unknown): WorkflowProgramOptions;
|
|
32
|
+
export declare function readWorkflowProgramCallInterrupt(input: {
|
|
33
|
+
readonly payload: unknown;
|
|
34
|
+
}): WorkflowProgramCallInterrupt;
|
|
35
|
+
export declare function readWorkflowProgramAgentCall(value: unknown): WorkflowProgramAgentCall;
|
|
36
|
+
export declare function parseWorkflowProgramOutput(value: unknown): JsonValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseJsonObject,parseJsonValue}from"#shared/json.js";const DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS=100,MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS=128,WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT=256,WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND=`eve.workflow-program-agent-call`;function parseWorkflowProgramOptions(e){let t=parseJsonObject(e);if(!isPositiveInteger(t.maxSubagents)||t.maxSubagents>128)throw TypeError(`workflow maxSubagents must be an integer between 1 and 128.`);return{maxSubagents:t.maxSubagents}}function readWorkflowProgramCallInterrupt(e){let t=e.payload;if(t.kind!==`eve.workflow-program-agent-call`||t.toolName!==`agent`)throw Error(`Unsupported workflow program interrupt kind "${String(t.kind)}".`);return{kind:WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND,task:void 0,toolInput:t.toolInput,toolName:`agent`}}function readWorkflowProgramAgentCall(e){let t=parseJsonObject(e);if(typeof t.target!=`string`||t.target.trim()===``)throw TypeError(`Workflow program ctx.agent() requires a non-empty agent name.`);let n=parseJsonObject(t.input);if(typeof n.message!=`string`)throw TypeError(`Workflow program ctx.agent() requires a "message" string.`);if(n.agentId!==void 0&&typeof n.agentId!=`string`)throw TypeError(`Workflow program ctx.agent() "agentId" must be a string.`);let r={message:n.message};return n.agentId!==void 0&&(r.agentId=n.agentId),n.outputSchema!==void 0&&(r.outputSchema=parseJsonObject(n.outputSchema)),{input:r,target:t.target}}function parseWorkflowProgramOutput(e){return parseJsonValue(e??null)}function isPositiveInteger(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}export{DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS,MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS,WORKFLOW_PROGRAM_BRIDGE_REQUEST_LIMIT,WORKFLOW_PROGRAM_CALL_INTERRUPT_KIND,parseWorkflowProgramOptions,parseWorkflowProgramOutput,readWorkflowProgramAgentCall,readWorkflowProgramCallInterrupt};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { WorkflowProgramContinuationSecurity } from "#execution/dynamic-workflow/schema.js";
|
|
2
|
+
/** Creates replay-stable signing material without exposing it to generated code. */
|
|
3
|
+
export declare function createWorkflowProgramContinuationSecurityStep(): Promise<WorkflowProgramContinuationSecurity>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{randomBytes}from"node:crypto";async function createWorkflowProgramContinuationSecurityStep(){"use step";return{maxAgeMs:31536e6,signingKey:randomBytes(32).toString(`base64url`)}}export{createWorkflowProgramContinuationSecurityStep};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonValue } from "#shared/json.js";
|
|
2
|
+
import type { WorkflowToolContext } from "#tools/workflow-definition.js";
|
|
3
|
+
export interface WorkflowProgramToolInput {
|
|
4
|
+
readonly js: string;
|
|
5
|
+
readonly maxSubagents?: number;
|
|
6
|
+
}
|
|
7
|
+
/** Static workflow executor used by the provided `workflow` tool. */
|
|
8
|
+
export declare function executeWorkflowProgram(input: WorkflowProgramToolInput, ctx: WorkflowToolContext): Promise<JsonValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{runJsProgram}from"#execution/dynamic-workflow/workflow.js";async function executeWorkflowProgram(e,t){"use workflow";return runJsProgram(e.js,t,{maxSubagents:e.maxSubagents??0})}executeWorkflowProgram.workflowId=`workflow//eve@0.57.0//executeWorkflowProgram`;export{executeWorkflowProgram};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS } from "#execution/dynamic-workflow/schema.js";
|
|
2
|
+
import type { JsonValue } from "#shared/json.js";
|
|
3
|
+
import type { WorkflowToolContext } from "#tools/workflow-definition.js";
|
|
4
|
+
export interface JsProgramOptions {
|
|
5
|
+
/** Maximum child-agent calls, from 1 to 128. Defaults to 100. */
|
|
6
|
+
readonly maxSubagents?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Runs a model-generated JavaScript function body inside an isolated workflow sandbox. */
|
|
9
|
+
export declare function runJsProgram(js: string, ctx: WorkflowToolContext, options: JsProgramOptions): Promise<JsonValue>;
|
|
10
|
+
export { MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toErrorMessage}from"#shared/errors.js";import{DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS,MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS,parseWorkflowProgramOptions,readWorkflowProgramAgentCall,readWorkflowProgramCallInterrupt}from"#execution/dynamic-workflow/schema.js";import{runWorkflowProgramStep}from"#execution/dynamic-workflow/program-step.js";import{createWorkflowProgramContinuationSecurityStep}from"#execution/dynamic-workflow/security-step.js";async function runJsProgram(e,t,n){if(typeof e!=`string`)throw TypeError(`workflow requires a "js" string.`);let r={...parseWorkflowProgramOptions({maxSubagents:n.maxSubagents??DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS}),continuationSecurity:await createWorkflowProgramContinuationSecurityStep(),js:e},i={callId:t.callId,program:r},a=await runWorkflowProgramStep(i),o=0;for(;a.status===`interrupted`;){t.abortSignal.throwIfAborted();let e=await Promise.all(a.pending.map(async e=>{let n=readWorkflowProgramCallInterrupt(e),i=readWorkflowProgramAgentCall(n.toolInput);if(o++>=r.maxSubagents)return{status:`failed`,error:`WORKFLOW_PROGRAM_SUBAGENT_LIMIT_REACHED: workflow may invoke at most ${String(r.maxSubagents)} agents; "${i.target}" was not called.`};try{return{status:`completed`,output:await t.agent(i.target,i.input)}}catch(e){return t.abortSignal.throwIfAborted(),{status:`failed`,error:toErrorMessage(e)}}}));a=await runWorkflowProgramStep({...i,resume:{interrupt:a.interrupt,resolutions:e}})}return a.output}export{MAX_WORKFLOW_PROGRAM_MAX_SUBAGENTS,runJsProgram};
|
|
@@ -90,6 +90,8 @@ export declare function readRootSessionId(serializedContext: Record<string, unkn
|
|
|
90
90
|
export declare function readChannelRequestId(serializedContext: Record<string, unknown>): string | undefined;
|
|
91
91
|
/** Reads the schedule name inherited from a schedule dispatch scope. */
|
|
92
92
|
export declare function readScheduleId(serializedContext: Record<string, unknown>): string | undefined;
|
|
93
|
+
/** Reads the bounded title stored for a top-level session. */
|
|
94
|
+
export declare function readSessionTitle(serializedContext: Record<string, unknown>): string | undefined;
|
|
93
95
|
/**
|
|
94
96
|
* Maximum visible length (in code points) of a derived `$eve.title`.
|
|
95
97
|
*
|
|
@@ -121,7 +123,6 @@ export declare function deriveSessionTitle(message: unknown): string | undefined
|
|
|
121
123
|
* so its own `workflowRunId` already identifies the chain root.
|
|
122
124
|
*/
|
|
123
125
|
export declare function buildSessionAttributes(input: {
|
|
124
|
-
readonly inputMessage: unknown;
|
|
125
126
|
readonly serializedContext: Record<string, unknown>;
|
|
126
127
|
}): Record<string, EveAttributeValue>;
|
|
127
128
|
/**
|
|
@@ -141,19 +142,3 @@ export declare function buildSubagentRootAttributes(input: {
|
|
|
141
142
|
readonly rootSessionId: string;
|
|
142
143
|
readonly serializedContext: Record<string, unknown>;
|
|
143
144
|
}): Record<string, EveAttributeValue>;
|
|
144
|
-
/**
|
|
145
|
-
* Builds the `$eve.*` attribute payload for one turn workflow run.
|
|
146
|
-
*
|
|
147
|
-
* Turns live one level below their session: `$eve.parent` always points
|
|
148
|
-
* to the parent's sessionId (which is the session-row's
|
|
149
|
-
* `workflowRunId`), and `$eve.root` denormalizes the chain root (equal
|
|
150
|
-
* to `$eve.parent` for turns of top-level sessions). Turn ordering is
|
|
151
|
-
* recovered from each run's `createdAt`, so no explicit sequence tag is
|
|
152
|
-
* emitted.
|
|
153
|
-
*/
|
|
154
|
-
export declare function buildTurnAttributes(input: {
|
|
155
|
-
readonly parentSessionId: string;
|
|
156
|
-
readonly requestId?: string;
|
|
157
|
-
readonly rootSessionId: string;
|
|
158
|
-
readonly serializedContext: Record<string, unknown>;
|
|
159
|
-
}): Record<string, EveAttributeValue>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNonEmptyString}from"#shared/guards.js";import{ConversationContextKey,normalizeConversationContext}from"#shared/conversation-context.js";import{resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{ChannelRequestIdKey,OtelTraceEnabledKey,ScheduleIdKey,SessionTraceSeedKey}from"#context/keys.js";import{CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{shouldCaptureInstrumentationContent}from"#shared/instrumentation-content.js";import{isSampledTrace}from"#tracing/sampled-trace.js";function readChannelKind(e){let t=e[CHANNEL_CONTEXT_KEY_NAME]?.kind;return isNonEmptyString(t)?t:void 0}function isWorkflowTraceContentVisible(e){let t=e[SessionTraceSeedKey.name];if(t!==void 0){let n=resolveForwardedTraceSeed(t);if(n.forwardedTracePolicy!==void 0||readParentSessionId(e)!==void 0){let e=n.decision;return e?.action===`record`&&e.recordInputs&&e.recordOutputs}}let n=normalizeConversationContext(e[ConversationContextKey.name]);return shouldCaptureInstrumentationContent({audience:n?.audience??`unknown`,environment:n?.environment??`production`})}function isWorkflowOtelTraceEnabled(e){return e[OtelTraceEnabledKey.name]===!0}function readSessionTraceId(e){let t=e[SessionTraceSeedKey.name];if(t===void 0)return;let n=resolveForwardedTraceSeed(t);if(isSampledTrace(n))return isNonEmptyString(t.traceId)?t.traceId:void 0}function readParentLineage(e){let t=e[`eve.parentSession`],n=t?.callId,r=t?.rootSessionId,i=t?.sessionId,a=t?.turn?.id;return{callId:isNonEmptyString(n)?n:void 0,rootSessionId:isNonEmptyString(r)?r:void 0,sessionId:isNonEmptyString(i)?i:void 0,turnId:isNonEmptyString(a)?a:void 0}}function readParentSessionId(e){return readParentLineage(e).sessionId}function readRootSessionId(e){return readParentLineage(e).rootSessionId}function readChannelRequestId(e){let t=e[ChannelRequestIdKey.name];return isNonEmptyString(t)?t:void 0}function readScheduleId(e){let t=e[ScheduleIdKey.name];return isNonEmptyString(t)?t:void 0}const EVE_SESSION_TITLE_MAX_CHARS=125;function deriveSessionTitle(e){let t=collectMessageText(e);if(t===void 0||t.length===0)return;let n=t.replace(/\s+/gu,` `).trim();if(n.length===0)return;let r=Array.from(n);return r.length<=125?n:`${r.slice(0,124).join(``)}…`}function collectMessageText(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=[];for(let n of e)n&&typeof n==`object`&&n.type===`text`&&typeof n.text==`string`&&t.push(n.text);return t.length>0?t.join(` `):void 0}function buildSessionAttributes(e){let t=isWorkflowTraceContentVisible(e.serializedContext),n=isWorkflowOtelTraceEnabled(e.serializedContext);return{"$eve.channel_request_id":readChannelRequestId(e.serializedContext),"$eve.schedule":readScheduleId(e.serializedContext),"$eve.is_otel_trace_enabled":n,"$eve.is_trace_content_visible":t,"$eve.trace_id":readSessionTraceId(e.serializedContext),"$eve.type":`session`,"$eve.trigger":readChannelKind(e.serializedContext),"$eve.title":
|
|
1
|
+
import{isNonEmptyString}from"#shared/guards.js";import{ConversationContextKey,normalizeConversationContext}from"#shared/conversation-context.js";import{resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{ChannelRequestIdKey,OtelTraceEnabledKey,ScheduleIdKey,SessionTitleKey,SessionTraceSeedKey}from"#context/keys.js";import{CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{shouldCaptureInstrumentationContent}from"#shared/instrumentation-content.js";import{isSampledTrace}from"#tracing/sampled-trace.js";function readChannelKind(e){let t=e[CHANNEL_CONTEXT_KEY_NAME]?.kind;return isNonEmptyString(t)?t:void 0}function isWorkflowTraceContentVisible(e){let t=e[SessionTraceSeedKey.name];if(t!==void 0){let n=resolveForwardedTraceSeed(t);if(n.forwardedTracePolicy!==void 0||readParentSessionId(e)!==void 0){let e=n.decision;return e?.action===`record`&&e.recordInputs&&e.recordOutputs}}let n=normalizeConversationContext(e[ConversationContextKey.name]);return shouldCaptureInstrumentationContent({audience:n?.audience??`unknown`,environment:n?.environment??`production`})}function isWorkflowOtelTraceEnabled(e){return e[OtelTraceEnabledKey.name]===!0}function readSessionTraceId(e){let t=e[SessionTraceSeedKey.name];if(t===void 0)return;let n=resolveForwardedTraceSeed(t);if(isSampledTrace(n))return isNonEmptyString(t.traceId)?t.traceId:void 0}function readParentLineage(e){let t=e[`eve.parentSession`],n=t?.callId,r=t?.rootSessionId,i=t?.sessionId,a=t?.turn?.id;return{callId:isNonEmptyString(n)?n:void 0,rootSessionId:isNonEmptyString(r)?r:void 0,sessionId:isNonEmptyString(i)?i:void 0,turnId:isNonEmptyString(a)?a:void 0}}function readParentSessionId(e){return readParentLineage(e).sessionId}function readRootSessionId(e){return readParentLineage(e).rootSessionId}function readChannelRequestId(e){let t=e[ChannelRequestIdKey.name];return isNonEmptyString(t)?t:void 0}function readScheduleId(e){let t=e[ScheduleIdKey.name];return isNonEmptyString(t)?t:void 0}function readSessionTitle(e){let t=e[SessionTitleKey.name];return isNonEmptyString(t)?t:void 0}const EVE_SESSION_TITLE_MAX_CHARS=125;function deriveSessionTitle(e){let t=collectMessageText(e);if(t===void 0||t.length===0)return;let n=t.replace(/\s+/gu,` `).trim();if(n.length===0)return;let r=Array.from(n);return r.length<=125?n:`${r.slice(0,124).join(``)}…`}function collectMessageText(e){if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=[];for(let n of e)n&&typeof n==`object`&&n.type===`text`&&typeof n.text==`string`&&t.push(n.text);return t.length>0?t.join(` `):void 0}function buildSessionAttributes(e){let t=isWorkflowTraceContentVisible(e.serializedContext),n=isWorkflowOtelTraceEnabled(e.serializedContext);return{"$eve.channel_request_id":readChannelRequestId(e.serializedContext),"$eve.schedule":readScheduleId(e.serializedContext),"$eve.is_otel_trace_enabled":n,"$eve.is_trace_content_visible":t,"$eve.trace_id":readSessionTraceId(e.serializedContext),"$eve.type":`session`,"$eve.trigger":readChannelKind(e.serializedContext),"$eve.title":readSessionTitle(e.serializedContext)}}function buildSubagentRootAttributes(e){return{"$eve.channel_request_id":readChannelRequestId(e.serializedContext),"$eve.is_otel_trace_enabled":isWorkflowOtelTraceEnabled(e.serializedContext),"$eve.is_trace_content_visible":isWorkflowTraceContentVisible(e.serializedContext),"$eve.trace_id":readSessionTraceId(e.serializedContext),"$eve.type":`subagent`,"$eve.parent":e.parentSessionId,"$eve.parent_call":e.parentCallId,"$eve.parent_turn":e.parentTurnId,"$eve.root":e.rootSessionId,"$eve.subagent":e.identity.nodeId,"$eve.trigger":readChannelKind(e.serializedContext)}}export{EVE_SESSION_TITLE_MAX_CHARS,buildSessionAttributes,buildSubagentRootAttributes,deriveSessionTitle,isWorkflowOtelTraceEnabled,isWorkflowTraceContentVisible,readChannelKind,readChannelRequestId,readParentLineage,readParentSessionId,readRootSessionId,readScheduleId,readSessionTitle,readSessionTraceId};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Hook } from "#compiled/@workflow/core/index.js";
|
|
2
2
|
export declare function claimHookOwnership<T>(hook: Hook<T>): Promise<void>;
|
|
3
|
-
export declare function closeHookIterator<T>(iterator: AsyncIterator<T>): Promise<void>;
|
|
4
3
|
export declare function disposeHook(hook: {
|
|
5
|
-
dispose
|
|
6
|
-
[Symbol.dispose]?: () => unknown;
|
|
4
|
+
dispose: () => unknown;
|
|
7
5
|
}): Promise<void>;
|
|
8
|
-
/**
|
|
6
|
+
/** Error names survive Workflow serialization across runtime boundaries. */
|
|
9
7
|
export declare function isHookConflictError(error: unknown): error is {
|
|
10
8
|
readonly conflictingRunId?: unknown;
|
|
11
9
|
readonly name: "HookConflictError";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function claimHookOwnership(e){let t;try{t=await e.getConflict()}catch(t){return await disposeAndThrow(e,
|
|
1
|
+
async function claimHookOwnership(e){let t;try{t=await e.getConflict()}catch(t){return await disposeAndThrow(e,t)}if(t!==null)return await disposeAndThrow(e,createHookConflictError(e.token,t.runId))}async function disposeHook(e){await e.dispose()}async function disposeAndThrow(e,t){try{await disposeHook(e)}catch{}throw t}function isHookConflictError(e){return typeof e==`object`&&!!e&&`name`in e&&e.name===`HookConflictError`}function createHookConflictError(e,t){let n=` (run "${t}")`;return Object.assign(Error(`Hook token "${e}" is already in use${n}`),{conflictingRunId:t,name:`HookConflictError`,token:e})}export{claimHookOwnership,disposeHook,isHookConflictError};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AuthorizationCallbackPayload } from "#execution/session-inbox/inbox.js";
|
|
2
|
+
/**
|
|
3
|
+
* Delivers an authorization callback to the hook named in its URL. Current
|
|
4
|
+
* URLs carry a physical hook token (a session inbox or a workflow-tool
|
|
5
|
+
* callback); URLs minted by a pre-cutover driver carry that driver's own
|
|
6
|
+
* logical token, which is re-encoded for it or rejected once imported.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resumeAuthorizationCallback(token: string, payload: AuthorizationCallbackPayload): Promise<void>;
|
|
9
|
+
export declare function handleExpiredLegacyAuthorization(): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{encodeLegacyCommand,resolveLegacyInbox}from"./inbox.js";import{isObject}from"#shared/guards.js";import{resumeHook}from"#internal/workflow/runtime.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";async function resumeAuthorizationCallback(e,t){try{await resumeHook(e,t);return}catch(e){if(!HookNotFoundError.is(e))throw e}let n=await resolveLegacyInbox(e);if(n.current)throw Error(`Authorization was interrupted by the session upgrade. Request authorization again.`);let r=await n.hook.metadata;await resumeHook(n.hook.token,encodeLegacyCommand({kind:`deliver`,payloads:t.payloads},isObject(r)?r.sessionInboxWireVersion:void 0))}async function handleExpiredLegacyAuthorization(){return Response.json({ok:!1,error:`This authorization link predates the session upgrade. Request authorization again.`},{status:410})}export{handleExpiredLegacyAuthorization,resumeAuthorizationCallback};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DurableSessionState } from "#execution/durable-session-store.js";
|
|
2
|
+
import type { WorkflowEntryResult } from "#execution/session/entry-input.js";
|
|
3
|
+
/** The old driver owns final notifications for the dispatch that became this session. */
|
|
4
|
+
export declare function completeLegacyDriverStep(input: {
|
|
5
|
+
readonly completionToken: string;
|
|
6
|
+
readonly result: WorkflowEntryResult;
|
|
7
|
+
readonly serializedContext: Record<string, unknown>;
|
|
8
|
+
readonly sessionState: DurableSessionState;
|
|
9
|
+
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
10
|
+
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resumeHook}from"#internal/workflow/runtime.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";async function completeLegacyDriverStep(e){"use step";let t=e.sessionWritable.getWriter();try{await t.close()}finally{t.releaseLock()}try{await resumeHook(e.completionToken,{kind:`turn-result`,action:{kind:`done`,...e.result,serializedContext:e.serializedContext,sessionState:{...e.sessionState,snapshot:{version:1,session:e.sessionState.snapshot.session}}}})}catch(e){if(!HookNotFoundError.is(e))throw e}}export{completeLegacyDriverStep};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DeliverHookPayload, SessionCommand, SessionTimeoutHookPayload } from "#channel/types.js";
|
|
2
|
+
import { getHookByToken } from "#internal/workflow/runtime.js";
|
|
3
|
+
type Command = DeliverHookPayload | SessionCommand | SessionTimeoutHookPayload;
|
|
4
|
+
type Hook = Awaited<ReturnType<typeof getHookByToken>>;
|
|
5
|
+
/** Reported as an inactive session so the channel starts a fresh one. */
|
|
6
|
+
export declare class UnsupportedLegacySessionError extends Error {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Finds the pre-cutover hook for a logical token. Once that session has been
|
|
11
|
+
* imported, its current-generation inbox owns delivery and `current` is true.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveLegacyInbox(token: string): Promise<{
|
|
14
|
+
hook: Hook;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
current: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function resumeLegacyInbox(token: string, command: Command): Promise<{
|
|
19
|
+
ownerRunId: string;
|
|
20
|
+
sessionId: Promise<string>;
|
|
21
|
+
}>;
|
|
22
|
+
/** Frozen producer projection for driver wire versions 1–7; old consumers validate for themselves. */
|
|
23
|
+
export declare function encodeLegacyCommand(command: Command, declaredVersion: unknown): unknown;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject}from"#shared/guards.js";import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{getHookByToken,resumeHook}from"#internal/workflow/runtime.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";var UnsupportedLegacySessionError=class extends Error{constructor(){super(`This session predates eve 0.45 and cannot be continued. Start a new session.`),this.name=`UnsupportedLegacySessionError`}};async function resolveLegacyInbox(e){let t=await getHookByToken(e),n=await t.metadata,r=isObject(n)&&typeof n.sessionId==`string`?n.sessionId:t.runId;try{return{hook:await getHookByToken(sessionInboxHookToken(sessionCommandHookToken(r))),sessionId:r,current:!0}}catch(e){if(!HookNotFoundError.is(e))throw e;return{hook:t,sessionId:r,current:!1}}}async function resumeLegacyInbox(e,t){let n=await resolveLegacyInbox(e),r=t;if(!n.current){let e=await n.hook.metadata;r=encodeLegacyCommand(t,isObject(e)?e.sessionInboxWireVersion:void 0)}return{ownerRunId:(await resumeHook(n.hook.token,r)).runId,sessionId:Promise.resolve(n.sessionId)}}function encodeLegacyCommand(e,t){let n=t;if(typeof n!=`number`||!Number.isInteger(n)||n<1||n>7)throw new UnsupportedLegacySessionError;if(e.kind!==`send`&&e.kind!==`deliver`){let t={...e,version:n};if(e.kind===`cancel`&&n<6){if(e.tasks===!0)throw Error(`This session cannot cancel owned tasks before import.`);delete t.tasks}return t}let r=(e.kind===`send`?[e.payload]:e.payloads).map(e=>{if(e.task===void 0||n>=5)return e;let{agentRequests:t,inputRequests:r,...i}=e.task;return{...e,task:i}}),i=e.caller;if(i?.activityObserver!==void 0&&n<7){let{activityObserver:e,...t}=i;if(n<2)i=t;else{let n=e.workIdentity===void 0?void 0:{...e.workIdentity};n!==void 0&&delete n.label,i={...t,activityObserver:{...e,workIdentity:n}}}}let a=e.kind===`send`?e.delivery===void 0?void 0:[{...e.delivery,payloadIndex:0}]:e.deliveryMetadata;return n<3&&a!==void 0&&(a=a.map(({acceptedDeploymentId:e,...t})=>t)),{auth:e.auth,caller:i,deliveryMetadata:a,kind:`deliver`,payload:coalesceDeliverPayloads(r),payloads:r,requestId:e.requestId,taskDeliveryId:e.taskDeliveryId,turnPolicy:e.turnPolicy,version:n}}export{UnsupportedLegacySessionError,encodeLegacyCommand,resolveLegacyInbox,resumeLegacyInbox};
|