eve 0.83.3 → 0.84.1
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 +57 -0
- package/README.md +1 -5
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/acp/adapter.d.ts +8 -5
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/ai/decide.d.ts +3 -7
- package/dist/src/ai/decide.js +1 -1
- package/dist/src/ai/decision-adapter.d.ts +7 -0
- package/dist/src/ai/decision-adapter.js +1 -0
- package/dist/src/ai/decision-types.d.ts +86 -0
- package/dist/src/approval/definition.d.ts +5 -12
- package/dist/src/approval/evaluation.d.ts +48 -0
- package/dist/src/approval/evaluation.js +1 -0
- package/dist/src/approval/status.d.ts +14 -0
- package/dist/src/approval/status.js +1 -0
- package/dist/src/channel/adapter-context.d.ts +1 -3
- package/dist/src/channel/adapter-context.js +1 -1
- package/dist/src/channel/adapter.d.ts +34 -26
- package/dist/src/channel/adapter.js +1 -1
- package/dist/src/channel/audience.d.ts +0 -3
- package/dist/src/channel/audience.js +1 -1
- package/dist/src/channel/auth/definitions.d.ts +532 -0
- package/dist/src/channel/auth/definitions.js +1 -0
- package/dist/src/channel/auth/jwt-ecdsa.js +1 -1
- package/dist/src/channel/auth/jwt-hmac.js +1 -1
- package/dist/src/channel/auth/oidc.js +1 -1
- package/dist/src/channel/channel-address.d.ts +12 -10
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +21 -22
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/compiled-channel.d.ts +4 -4
- package/dist/src/channel/conversation-context.js +1 -1
- package/dist/src/channel/cors.d.ts +2 -2
- package/dist/src/channel/cors.js +1 -1
- package/dist/src/channel/cross-channel-receive.d.ts +7 -4
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/delivery-idempotency.d.ts +6 -0
- package/dist/src/channel/delivery-idempotency.js +1 -1
- package/dist/src/channel/delivery-metadata.d.ts +2 -2
- package/dist/src/channel/delivery.d.ts +8 -0
- package/dist/src/channel/delivery.js +1 -0
- package/dist/src/channel/interaction-prompts.d.ts +54 -0
- package/dist/src/channel/interaction-prompts.js +1 -0
- package/dist/src/channel/invoke-tool.d.ts +11 -18
- package/dist/src/channel/pending-authorization.d.ts +3 -14
- package/dist/src/channel/pending-authorization.js +1 -1
- package/dist/src/channel/prompt-queue.d.ts +11 -19
- package/dist/src/channel/prompt-queue.js +1 -1
- package/dist/src/channel/resolve-text.d.ts +11 -18
- package/dist/src/channel/resolve-text.js +2 -2
- package/dist/src/channel/resolved-prompt.d.ts +7 -5
- package/dist/src/channel/resolved-prompt.js +1 -1
- package/dist/src/channel/routes.d.ts +4 -4
- package/dist/src/channel/schedule.d.ts +2 -2
- package/dist/src/channel/schedule.js +1 -1
- package/dist/src/channel/send-input.d.ts +3 -3
- package/dist/src/channel/send-input.js +1 -1
- package/dist/src/channel/session-callback.js +1 -1
- package/dist/src/channel/session-not-active-error.d.ts +8 -12
- package/dist/src/channel/session-not-active-error.js +1 -1
- package/dist/src/channel/session.d.ts +33 -59
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/sign-in.d.ts +61 -0
- package/dist/src/channel/sign-in.js +3 -0
- package/dist/src/channel/surface.d.ts +44 -0
- package/dist/src/channel/surface.js +1 -0
- package/dist/src/channel/task-card.d.ts +24 -114
- package/dist/src/channel/task-card.js +1 -1
- package/dist/src/channel/types.d.ts +118 -110
- package/dist/src/channel/types.js +1 -1
- package/dist/src/chunks/use-eve-agent-DMeP0JOF.js +5046 -0
- package/dist/src/chunks/use-eve-agent-DP5Rso9C.js +5093 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/logs-events.d.ts +2 -0
- package/dist/src/cli/commands/logs-events.js +2 -2
- package/dist/src/cli/dev/command.js +1 -1
- package/dist/src/cli/dev/remote-print.d.ts +8 -0
- package/dist/src/cli/dev/remote-print.js +1 -0
- package/dist/src/cli/dev/tui/conversation-view.d.ts +24 -19
- package/dist/src/cli/dev/tui/conversation-view.js +1 -1
- package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +0 -10
- package/dist/src/cli/dev/tui/diagnostic-presentation.js +2 -3
- package/dist/src/cli/dev/tui/errors.d.ts +9 -65
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +3 -3
- package/dist/src/cli/dev/tui/task-records.d.ts +3 -3
- package/dist/src/cli/dev/tui/task-records.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +10 -10
- package/dist/src/cli/dev/tui/terminal-tool-part.d.ts +2 -2
- package/dist/src/cli/dev/tui/terminal-tool-part.js +1 -1
- package/dist/src/cli/dev/tui/test/fake-eve-server.d.ts +3 -3
- package/dist/src/cli/dev/tui/test/fake-eve-server.js +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/transcript-parts.d.ts +16 -16
- package/dist/src/cli/dev/tui/transcript-parts.js +3 -3
- package/dist/src/cli/dev/tui/transcript.d.ts +0 -4
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/run.d.ts +0 -2
- package/dist/src/cli/run.js +1 -1
- package/dist/src/cli/telemetry/index.js +1 -1
- package/dist/src/client/agent-base-url.d.ts +4 -0
- package/dist/src/client/agent-base-url.js +1 -0
- package/dist/src/client/agent-info-schema.d.ts +1 -923
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/agent-info-types.d.ts +281 -0
- package/dist/src/client/agent-session.d.ts +19 -22
- package/dist/src/client/agent-session.js +1 -1
- package/dist/src/client/agent-stream-follower.d.ts +11 -20
- package/dist/src/client/agent-stream-follower.js +1 -1
- package/dist/src/client/client-error.d.ts +2 -1
- package/dist/src/client/client-error.js +1 -1
- package/dist/src/client/client.d.ts +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/conversation-client.d.ts +37 -28
- package/dist/src/client/conversation-client.js +1 -1
- package/dist/src/client/conversation-state.d.ts +70 -73
- package/dist/src/client/conversation-state.js +1 -1
- package/dist/src/client/conversation.d.ts +51 -0
- package/dist/src/client/conversation.js +1 -0
- package/dist/src/client/delivery-events.d.ts +3 -0
- package/dist/src/client/delivery-events.js +1 -0
- package/dist/src/client/delivery.d.ts +38 -0
- package/dist/src/client/delivery.js +1 -0
- package/dist/src/client/file-parts.d.ts +9 -4
- package/dist/src/client/file-parts.js +1 -1
- package/dist/src/client/health-schema.d.ts +1 -1
- package/dist/src/client/health-types.d.ts +6 -0
- package/dist/src/client/index.d.ts +17 -23
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-types.d.ts +92 -0
- package/dist/src/client/message-types.js +1 -0
- package/dist/src/client/messages.d.ts +30 -0
- package/dist/src/client/messages.js +1 -0
- package/dist/src/client/ndjson.d.ts +6 -11
- package/dist/src/client/ndjson.js +3 -3
- package/dist/src/client/open-stream.d.ts +47 -20
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/optimistic-message-submissions.d.ts +10 -18
- package/dist/src/client/optimistic-message-submissions.js +1 -1
- package/dist/src/client/session-controls.d.ts +23 -26
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session-event-stream.d.ts +5 -16
- package/dist/src/client/session-event-stream.js +1 -1
- package/dist/src/client/session-store-helpers.d.ts +8 -0
- package/dist/src/client/session-store-helpers.js +2 -0
- package/dist/src/client/session-store-state.d.ts +80 -0
- package/dist/src/client/session-store-state.js +1 -0
- package/dist/src/client/session-store.d.ts +48 -0
- package/dist/src/client/session-store.js +1 -0
- package/dist/src/client/session-utils.d.ts +45 -41
- package/dist/src/client/session-utils.js +2 -1
- package/dist/src/client/session.d.ts +32 -23
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/sessions.d.ts +3 -2
- package/dist/src/client/sessions.js +1 -1
- package/dist/src/client/stream-version.d.ts +3 -1
- package/dist/src/client/stream-version.js +1 -1
- package/dist/src/client/transcript.d.ts +43 -0
- package/dist/src/client/transcript.js +2 -0
- package/dist/src/client/types.d.ts +23 -82
- package/dist/src/client/url.d.ts +3 -3
- package/dist/src/compiled/.vendor-stamp.json +2 -2
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +34 -34
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +15 -15
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +38 -38
- package/dist/src/compiled/@chat-adapter/slack/fetch-QqNM_Ef3.d.ts +4 -0
- package/dist/src/compiled/@chat-adapter/slack/index.js +13 -13
- package/dist/src/compiled/@chat-adapter/twilio/types-BaIqtt65.d.ts +100 -0
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/adapter.d.ts +129 -0
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/message-parser.d.ts +14 -0
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/text-decorations.d.ts +28 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +75 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +4 -0
- package/dist/src/compiled/@vercel/sandbox/command.d.ts +78 -0
- package/dist/src/compiled/@vercel/sandbox/drive.d.ts +41 -1
- package/dist/src/compiled/@vercel/sandbox/index.js +13 -13
- package/dist/src/compiled/@vercel/sandbox/network-policy.d.ts +35 -4
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +18 -4
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +29 -3
- package/dist/src/compiled/@vercel/sandbox/utils/pipe-stdin.d.ts +19 -0
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization.d.ts +2 -2
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +2 -2
- package/dist/src/compiled/_chunks/client/{core-CspsxXR-.js → core-BsvaaMUJ.js} +1 -1
- package/dist/src/compiled/_chunks/node/{auth-Dztlx9pE.js → auth-v5pS3mLo.js} +1 -1
- package/dist/src/compiled/_chunks/node/is-stream-DsuQX_bd.js +1 -0
- package/dist/src/compiled/_chunks/node/token-DHGH-jVc.js +1 -0
- package/dist/src/compiled/_chunks/node/token-util-BH2pw9Qm.js +25 -0
- package/dist/src/compiled/_chunks/node/token-util-CcvxNv76.js +1 -0
- package/dist/src/compiled/_chunks/node/version-C2PfNyEv.js +1 -0
- package/dist/src/compiled/semver/index.d.ts +2 -0
- package/dist/src/compiled/zod/index.js +1 -1
- package/dist/src/compiled/zod/v4/core.js +1 -1
- package/dist/src/compiled/zod-validation-error/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +1 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/development-extensions.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +19 -290
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +3 -11
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +8 -18
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-hook.js +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +3 -0
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-memory.js +1 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +0 -5
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +1 -6
- package/dist/src/compiler/source-graph.d.ts +0 -1
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/computer-use/extension/lib/computer-use-sandbox.js +1 -1
- package/dist/src/computer-use/extension/lib/sandbox.d.ts +1 -1
- package/dist/src/computer-use/extension/lib/sandbox.js +1 -1
- package/dist/src/computer-use/extension/tools/computer_use.js +1 -1
- package/dist/src/connections/errors.d.ts +3 -3
- package/dist/src/context/accessors.d.ts +0 -13
- package/dist/src/context/accessors.js +1 -1
- package/dist/src/context/container.d.ts +8 -11
- package/dist/src/context/container.js +1 -1
- package/dist/src/context/key-names.d.ts +1 -0
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +20 -112
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-tools.d.ts +4 -2
- package/dist/src/context/memory-tools.js +1 -1
- package/dist/src/context/providers/connection.js +1 -1
- package/dist/src/context/providers/session.js +1 -1
- package/dist/src/context/schedule-collection-tools.d.ts +2 -2
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/context/session-context.d.ts +4 -2
- package/dist/src/discover/extensions.d.ts +2 -3
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/dynamic/definition.d.ts +98 -108
- package/dist/src/dynamic/definition.js +1 -1
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +12 -11
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.js +1 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/expect/index.d.ts +0 -1
- package/dist/src/evals/index.d.ts +2 -5
- package/dist/src/evals/judge.js +1 -1
- package/dist/src/evals/match.d.ts +20 -17
- package/dist/src/evals/match.js +1 -1
- package/dist/src/evals/mock-model.d.ts +5 -1
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/evals/output.d.ts +3 -0
- package/dist/src/evals/output.js +1 -0
- package/dist/src/evals/reported-tool-name.js +1 -1
- package/dist/src/evals/reporters/index.d.ts +4 -4
- package/dist/src/evals/reporters/index.js +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/derive-run-facts.d.ts +8 -40
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +3 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.d.ts +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +2 -2
- package/dist/src/evals/runner/reporters/console.d.ts +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/datadog.d.ts +1 -1
- package/dist/src/evals/runner/reporters/datadog.js +2 -2
- package/dist/src/evals/runner/reporters/junit.d.ts +1 -1
- package/dist/src/evals/runner/reporters/junit.js +2 -2
- package/dist/src/evals/runner/reporters/types.d.ts +2 -2
- package/dist/src/evals/runner/run-evals.d.ts +1 -1
- package/dist/src/evals/session-cleanup.d.ts +1 -1
- package/dist/src/evals/session-cleanup.js +1 -1
- package/dist/src/evals/session-content.d.ts +2 -2
- package/dist/src/evals/session-content.js +2 -1
- package/dist/src/evals/session-manager.d.ts +3 -6
- package/dist/src/evals/session-manager.js +1 -1
- package/dist/src/evals/session.d.ts +33 -24
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +115 -94
- package/dist/src/eve-channel/create-request.d.ts +3 -5
- package/dist/src/eve-channel/descendant-stream.d.ts +9 -0
- package/dist/src/eve-channel/descendant-stream.js +1 -0
- package/dist/src/eve-channel/index.d.ts +2 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +8 -6
- package/dist/src/eve-channel/request.js +1 -3
- package/dist/src/eve-channel/stream-headers.d.ts +1 -1
- package/dist/src/eve-channel/stream-headers.js +1 -1
- package/dist/src/eve-channel/support.d.ts +25 -13
- package/dist/src/eve-channel/support.js +2 -2
- package/dist/src/eve-channel/types.d.ts +7 -30
- package/dist/src/execution/agent-sessions/message.d.ts +4 -0
- package/dist/src/execution/agent-sessions/message.js +1 -0
- package/dist/src/execution/agent-sessions/metadata.js +1 -1
- package/dist/src/execution/agent-sessions/remote-credentials.d.ts +19 -0
- package/dist/src/execution/agent-sessions/remote-credentials.js +1 -0
- package/dist/src/execution/agent-sessions/remote.d.ts +35 -13
- package/dist/src/execution/agent-sessions/remote.js +1 -1
- package/dist/src/execution/agent-sessions/requests.d.ts +6 -6
- package/dist/src/execution/agent-sessions/requests.js +1 -1
- package/dist/src/execution/agent-sessions/session.js +1 -1
- package/dist/src/execution/agent-sessions/steps.d.ts +26 -4
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/agent-sessions/target.d.ts +2 -1
- package/dist/src/execution/agent-sessions/target.js +1 -1
- package/dist/src/execution/agent-sessions/usage.d.ts +0 -8
- package/dist/src/execution/agent-sessions/usage.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.d.ts +4 -2
- package/dist/src/execution/cancelled-model-call-batch.js +1 -1
- package/dist/src/execution/cancelled-turn-message.d.ts +2 -2
- package/dist/src/execution/cancelled-turn-message.js +1 -1
- package/dist/src/execution/catalog/connection-entry.js +1 -1
- package/dist/src/execution/catalog/search.js +1 -1
- package/dist/src/execution/catalog/skills.js +1 -1
- package/dist/src/execution/catalog/step-catalog.js +1 -1
- package/dist/src/execution/child-binding.d.ts +19 -0
- package/dist/src/execution/child-binding.js +1 -0
- package/dist/src/execution/close-session-stream-step.d.ts +9 -0
- package/dist/src/execution/close-session-stream-step.js +1 -0
- package/dist/src/execution/coordination-dispatch-shared.d.ts +13 -3
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.d.ts +9 -13
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +2 -5
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
- package/dist/src/execution/failure-summary.d.ts +11 -0
- package/dist/src/execution/failure-summary.js +1 -0
- package/dist/src/execution/forward-session-input.d.ts +2 -2
- package/dist/src/execution/forward-session-input.js +1 -1
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/legacy-session/snapshot.d.ts +4 -1
- package/dist/src/execution/legacy-session/snapshot.js +1 -1
- package/dist/src/execution/model-call-batching.d.ts +3 -3
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/ndjson-stream.d.ts +1 -1
- package/dist/src/execution/node-step.d.ts +2 -8
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.d.ts +8 -3
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/public-destination.d.ts +34 -0
- package/dist/src/execution/public-destination.js +1 -0
- package/dist/src/execution/publish-session-events.d.ts +98 -36
- package/dist/src/execution/publish-session-events.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
- package/dist/src/execution/sandbox/bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-connection.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/eve-image.d.ts +0 -2
- package/dist/src/execution/sandbox/bindings/eve-image.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/{extensions/code/extension/lib → execution/sandbox}/grep-search.d.ts +3 -2
- package/dist/src/execution/sandbox/grep-search.js +6 -0
- package/dist/src/execution/sandbox/multiplexed-command.d.ts +11 -1
- package/dist/src/execution/sandbox/multiplexed-command.js +1 -1
- package/dist/src/execution/sandbox/read-file.d.ts +1 -1
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/sandbox/workspace-root.d.ts +31 -0
- package/dist/src/execution/sandbox/workspace-root.js +1 -0
- package/dist/src/execution/session/active-turn.d.ts +12 -6
- package/dist/src/execution/session/active-turn.js +1 -1
- package/dist/src/execution/session/admission.d.ts +7 -2
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/answer-caller.d.ts +4 -4
- package/dist/src/execution/session/answer-caller.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.d.ts +4 -6
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/control-delivery.d.ts +4 -0
- package/dist/src/execution/session/control-delivery.js +1 -0
- package/dist/src/execution/session/delivery-facts.d.ts +27 -0
- package/dist/src/execution/session/delivery-facts.js +1 -0
- package/dist/src/execution/session/end-sandbox-step.js +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/finalization.d.ts +4 -0
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff-state.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +0 -8
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +4 -3
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +8 -2
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/interrupted-step.d.ts +64 -0
- package/dist/src/execution/session/interrupted-step.js +3 -0
- package/dist/src/execution/session/next-input.d.ts +7 -1
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/pending-turn-state.d.ts +32 -12
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/prewarm-step.d.ts +1 -1
- package/dist/src/execution/session/prewarm-step.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/settle-control-delivery-step.d.ts +8 -0
- package/dist/src/execution/session/settle-control-delivery-step.js +1 -0
- package/dist/src/execution/session/settle-duplicate-delivery-step.d.ts +8 -0
- package/dist/src/execution/session/settle-duplicate-delivery-step.js +1 -0
- package/dist/src/execution/session/state-delta.d.ts +2 -12
- package/dist/src/execution/session/state-delta.js +1 -1
- package/dist/src/execution/session/step-decision-check.d.ts +9 -0
- package/dist/src/execution/session/step-decision-check.js +1 -0
- package/dist/src/execution/session/step-state-delta.d.ts +16 -0
- package/dist/src/execution/session/step-state-delta.js +1 -0
- package/dist/src/execution/session/task-tool-tracing-step.d.ts +0 -3
- package/dist/src/execution/session/task-tool-tracing-step.js +1 -1
- package/dist/src/execution/session/turn-event-handler.d.ts +6 -16
- package/dist/src/execution/session/turn-event-handler.js +1 -1
- package/dist/src/execution/session/turn-step-result.d.ts +7 -2
- package/dist/src/execution/session/turn-step-result.js +1 -1
- package/dist/src/execution/session/turn-step-types.d.ts +35 -33
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +19 -32
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-callback-request.d.ts +7 -1
- package/dist/src/execution/session-callback-request.js +1 -1
- package/dist/src/execution/session-event-stream.d.ts +37 -16
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/session-inbox/address.d.ts +1 -0
- package/dist/src/execution/session-inbox/end-stranded-session.d.ts +7 -1
- package/dist/src/execution/session-inbox/end-stranded-session.js +1 -1
- package/dist/src/execution/session-inbox/handle.d.ts +7 -0
- package/dist/src/execution/session-inbox/handle.js +1 -0
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/owner.d.ts +9 -6
- package/dist/src/execution/session-inbox/owner.js +1 -1
- package/dist/src/execution/session-inbox/pre-v27.d.ts +5 -0
- package/dist/src/execution/session-inbox/pre-v27.js +1 -0
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +1 -0
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-inbox/stranded-replay-guard.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/session.d.ts +3 -14
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +3 -0
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stop-runs.d.ts +35 -0
- package/dist/src/execution/stop-runs.js +1 -0
- package/dist/src/execution/tasks/model-step.d.ts +5 -9
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/render.d.ts +5 -2
- package/dist/src/execution/tasks/render.js +1 -1
- package/dist/src/execution/tasks/session.d.ts +6 -3
- package/dist/src/execution/tasks/session.js +1 -1
- package/dist/src/execution/tasks/start.d.ts +9 -6
- package/dist/src/execution/tasks/start.js +1 -1
- package/dist/src/execution/tasks/steps.d.ts +11 -6
- package/dist/src/execution/tasks/steps.js +1 -1
- package/dist/src/execution/tasks/table.d.ts +18 -5
- package/dist/src/execution/tasks/table.js +1 -1
- package/dist/src/execution/tasks/task-id-input.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.d.ts +11 -1
- package/dist/src/execution/terminal-session-completion-step.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.d.ts +6 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.d.ts +5 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/answer.d.ts +4 -5
- package/dist/src/execution/tools/workflow/answer.js +1 -1
- package/dist/src/execution/tools/workflow/apply-run-messages-step.d.ts +1 -1
- package/dist/src/execution/tools/workflow/apply-run-messages-step.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +3 -3
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/execution/tools/workflow/messages.d.ts +25 -33
- package/dist/src/execution/tools/workflow/messages.js +1 -1
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +9 -5
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
- package/dist/src/execution/tools/workflow/owner.d.ts +3 -3
- package/dist/src/execution/tools/workflow/owner.js +1 -1
- package/dist/src/execution/tools/workflow/serve.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/tools/workflow/withdraw-step.d.ts +2 -2
- package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
- package/dist/src/execution/v26-history.d.ts +28 -0
- package/dist/src/execution/v26-history.fixtures.d.ts +4 -0
- package/dist/src/execution/v26-history.fixtures.js +2 -0
- package/dist/src/execution/v26-history.js +1 -0
- package/dist/src/execution/web-fetch/request.js +1 -1
- package/dist/src/execution/workflow-errors.d.ts +5 -0
- package/dist/src/execution/workflow-errors.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +1 -11
- package/dist/src/extensions/code/extension/extension.js +1 -1
- package/dist/src/extensions/code/extension/lib/prwatch-github.d.ts +5 -1
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +0 -4
- package/dist/src/extensions/code/extension/lib/sandbox.js +2 -2
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.js +1 -1
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +1 -31
- package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -1
- package/dist/src/extensions/code/extension/subagents/worker/agent.d.ts +1 -1
- package/dist/src/extensions/code/extension/subagents/worker/agent.js +1 -1
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
- package/dist/src/extensions/code/extension/tools/grep.d.ts +1 -28
- package/dist/src/extensions/code/extension/tools/grep.js +1 -1
- package/dist/src/extensions/code/sandbox.d.ts +1 -0
- package/dist/src/extensions/code/sandbox.js +1 -0
- package/dist/src/extensions/code/tools.d.ts +1 -5
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +3 -3
- package/dist/src/extensions/git/extension/instructions/github.d.ts +1 -1
- package/dist/src/extensions/git/extension/instructions/github.js +1 -1
- package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +2 -11
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.d.ts +13 -3
- package/dist/src/extensions/git/extension/lib/sandbox.d.ts +0 -4
- package/dist/src/extensions/git/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/git/extension/skills/pr.d.ts +1 -4
- package/dist/src/extensions/git/extension/skills/pr.js +1 -1
- package/dist/src/extensions/git/extension/tools/gh.d.ts +1 -26
- package/dist/src/extensions/git/extension/tools/gh.js +1 -1
- package/dist/src/framework/sources/modules/schedule-collection-wrapper.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +3 -5
- package/dist/src/harness/action-presentation.js +1 -1
- package/dist/src/harness/action-result-helpers.d.ts +2 -8
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/approval-outcome.d.ts +32 -0
- package/dist/src/harness/approval-outcome.js +1 -0
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/authorization.d.ts +2 -3
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/call-executor.d.ts +118 -0
- package/dist/src/harness/call-executor.js +1 -0
- package/dist/src/harness/call-facts.d.ts +31 -0
- package/dist/src/harness/call-facts.js +1 -0
- package/dist/src/harness/call-outcome.d.ts +6 -0
- package/dist/src/harness/call-outcome.js +1 -0
- package/dist/src/harness/compaction/engine.d.ts +11 -0
- package/dist/src/harness/compaction/engine.js +2 -2
- package/dist/src/harness/compaction/step.d.ts +25 -5
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +10 -0
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +9 -20
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-call.d.ts +6 -23
- package/dist/src/harness/execute-call.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +7 -3
- package/dist/src/harness/facts.d.ts +82 -0
- package/dist/src/harness/facts.js +1 -0
- package/dist/src/harness/finish-reason.d.ts +6 -1
- package/dist/src/harness/generation-steering.d.ts +4 -2
- package/dist/src/harness/generation-steering.js +1 -1
- package/dist/src/harness/hitl/approval-prompt.d.ts +3 -3
- package/dist/src/harness/hitl/approval-prompt.js +3 -3
- package/dist/src/harness/hitl/approvals.d.ts +66 -78
- package/dist/src/harness/hitl/approvals.js +2 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +14 -36
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/budget-request.d.ts +8 -46
- package/dist/src/harness/hitl/budget-request.js +1 -1
- package/dist/src/harness/hitl/budget.d.ts +9 -8
- package/dist/src/harness/hitl/budget.js +1 -1
- package/dist/src/harness/hitl/delivery.d.ts +16 -17
- package/dist/src/harness/hitl/delivery.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +14 -19
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +32 -43
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/hitl/relays.d.ts +7 -51
- package/dist/src/harness/hitl/relays.js +1 -1
- package/dist/src/harness/hitl/requests.d.ts +11 -53
- package/dist/src/harness/hitl/requests.js +1 -1
- package/dist/src/harness/hitl/responders.d.ts +50 -0
- package/dist/src/harness/hitl/responders.js +1 -0
- package/dist/src/harness/hitl/sign-ins.d.ts +7 -3
- package/dist/src/harness/hitl/sign-ins.js +1 -1
- package/dist/src/harness/hitl/stale-responses.d.ts +11 -11
- package/dist/src/harness/hitl/stale-responses.js +3 -3
- package/dist/src/harness/inline-tool-authorization.d.ts +8 -9
- package/dist/src/harness/inline-tool-authorization.js +1 -1
- package/dist/src/harness/interaction-facts.d.ts +36 -0
- package/dist/src/harness/interaction-facts.js +1 -0
- package/dist/src/harness/interaction-relay.d.ts +10 -0
- package/dist/src/harness/interaction-relay.js +1 -0
- package/dist/src/harness/interrupted-attempt.d.ts +19 -0
- package/dist/src/harness/interrupted-attempt.js +2 -0
- package/dist/src/harness/messages.d.ts +28 -15
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +28 -12
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.js +1 -1
- package/dist/src/harness/model-call/failure.d.ts +4 -49
- package/dist/src/harness/model-call/failure.js +1 -1
- package/dist/src/harness/model-call/model.js +1 -1
- package/dist/src/harness/model-call/recovery.d.ts +4 -32
- package/dist/src/harness/model-call/recovery.js +1 -1
- package/dist/src/harness/model-call/request.d.ts +0 -1
- package/dist/src/harness/model-call/request.js +1 -1
- package/dist/src/harness/model-call/response.d.ts +22 -12
- package/dist/src/harness/model-call/response.js +1 -1
- package/dist/src/harness/model-call/retry.d.ts +23 -6
- package/dist/src/harness/model-call/retry.js +1 -1
- package/dist/src/harness/model-call/run.d.ts +4 -12
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/model-call/tools.d.ts +0 -19
- package/dist/src/harness/model-call/tools.js +1 -1
- package/dist/src/harness/model-call/unique-call-ids.d.ts +13 -0
- package/dist/src/harness/model-call/unique-call-ids.js +1 -0
- package/dist/src/harness/model-call/usage.d.ts +7 -5
- package/dist/src/harness/model-call/usage.js +1 -1
- package/dist/src/harness/ordered-stream-emitter.d.ts +1 -0
- package/dist/src/harness/ordered-stream-emitter.js +1 -1
- package/dist/src/harness/provider-tool-history.js +1 -1
- package/dist/src/harness/publication.d.ts +4 -0
- package/dist/src/harness/publication.js +1 -0
- package/dist/src/harness/request-envelope.d.ts +0 -3
- package/dist/src/harness/request-envelope.js +1 -1
- package/dist/src/harness/running-work.d.ts +10 -0
- package/dist/src/harness/running-work.js +1 -0
- package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
- package/dist/src/harness/session-machine/cascade.d.ts +17 -0
- package/dist/src/harness/session-machine/cascade.js +1 -0
- package/dist/src/harness/session-machine/commit.d.ts +16 -16
- package/dist/src/harness/session-machine/commit.js +1 -1
- package/dist/src/harness/session-machine/current.d.ts +25 -17
- package/dist/src/harness/session-machine/current.js +1 -1
- package/dist/src/harness/session-machine/state.d.ts +43 -16
- package/dist/src/harness/session-machine/state.js +1 -1
- package/dist/src/harness/session-machine/suspended-steps.d.ts +22 -0
- package/dist/src/harness/session-machine/suspended-steps.js +1 -0
- package/dist/src/harness/session-machine/transitions.d.ts +144 -120
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/session-machine/view.d.ts +12 -8
- package/dist/src/harness/session-machine/view.js +1 -1
- package/dist/src/harness/session-machine/waiting.d.ts +16 -0
- package/dist/src/harness/session-machine/waiting.js +1 -0
- package/dist/src/harness/session-usage.d.ts +22 -0
- package/dist/src/harness/session-usage.js +1 -0
- package/dist/src/harness/step/after-model.d.ts +1 -4
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step/context.d.ts +21 -21
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/step/intake.d.ts +7 -8
- package/dist/src/harness/step/intake.js +1 -1
- package/dist/src/harness/step/park.d.ts +19 -0
- package/dist/src/harness/step/park.js +1 -0
- package/dist/src/harness/step/prompt.d.ts +4 -5
- package/dist/src/harness/step/prompt.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +24 -24
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/stream-actions.d.ts +3 -9
- package/dist/src/harness/stream-actions.js +1 -1
- package/dist/src/harness/token-estimate.js +1 -1
- package/dist/src/harness/tool-history-repair.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.d.ts +22 -38
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +69 -67
- package/dist/src/harness/user-parts.d.ts +4 -0
- package/dist/src/harness/user-parts.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +0 -1
- package/dist/src/harness/workflow-tool-runs.js +1 -1
- package/dist/src/instrumentation/ai-sdk-hook-bridge.d.ts +2 -2
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/channel-delivery.d.ts +4 -23
- package/dist/src/instrumentation/channel-delivery.js +1 -1
- package/dist/src/instrumentation/content.d.ts +1 -7
- package/dist/src/instrumentation/content.js +1 -1
- package/dist/src/instrumentation/dispatch.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +135 -198
- package/dist/src/instrumentation/lifecycle.js +1 -1
- package/dist/src/instrumentation/memory.d.ts +4 -2
- package/dist/src/instrumentation/memory.js +1 -1
- package/dist/src/instrumentation/native-events.d.ts +17 -10
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/prepare-trace-context.d.ts +3 -3
- package/dist/src/instrumentation/provider.d.ts +20 -28
- package/dist/src/instrumentation/providers.js +1 -1
- package/dist/src/instrumentation/runtime-context.d.ts +1 -0
- package/dist/src/instrumentation/runtime-context.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +9 -30
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/scope.d.ts +6 -0
- package/dist/src/instrumentation/scope.js +1 -0
- package/dist/src/instrumentation/session-context.d.ts +1 -1
- package/dist/src/instrumentation/session-context.js +1 -1
- package/dist/src/instrumentation/session-init.js +1 -1
- package/dist/src/instrumentation/setup-context.d.ts +2 -2
- package/dist/src/instrumentation/setup-context.js +1 -1
- package/dist/src/instrumentation/state.d.ts +0 -21
- package/dist/src/instrumentation/state.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/dev-environment.d.ts +8 -2
- package/dist/src/internal/application/dev-environment.js +1 -1
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/authored-definition/approval.d.ts +2 -4
- package/dist/src/internal/authored-definition/approval.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/core.d.ts +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/memory.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +0 -3
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +0 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/git.d.ts +2 -0
- package/dist/src/internal/git.js +1 -0
- package/dist/src/internal/grep.d.ts +1 -0
- package/dist/src/internal/grep.js +1 -0
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/invocation/agent-invocation.d.ts +16 -19
- package/dist/src/internal/invocation/metadata.d.ts +0 -2
- package/dist/src/internal/invocation/metadata.js +1 -1
- package/dist/src/internal/invocation/workflow-execution.d.ts +4 -4
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/legacy-events.d.ts +5 -0
- package/dist/src/internal/legacy-events.js +1 -0
- package/dist/src/internal/logging.d.ts +0 -12
- package/dist/src/internal/logging.js +1 -1
- package/dist/src/internal/mcp/protected-resource.js +1 -1
- package/dist/src/internal/mcp/published-tools.js +1 -1
- package/dist/src/internal/model-auth/api-key.js +1 -1
- package/dist/src/internal/model-auth/development-broker-client.js +1 -1
- package/dist/src/internal/model-auth/development-broker-server.js +1 -1
- package/dist/src/internal/model-auth/transport.js +1 -1
- package/dist/src/internal/model-catalog.d.ts +39 -16
- package/dist/src/internal/model-catalog.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-build-host.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/dev-server-state.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 +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/channel-route-context.d.ts +8 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.js +1 -1
- package/dist/src/internal/scaffold.d.ts +5 -0
- package/dist/src/internal/scaffold.js +1 -0
- package/dist/src/internal/workflow/cancel-expired-development-run.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-data-directory.js +1 -1
- package/dist/src/internal/workspace.d.ts +1 -0
- package/dist/src/internal/workspace.js +1 -0
- package/dist/src/models/auto.d.ts +27 -14
- package/dist/src/models/auto.js +2 -2
- package/dist/src/protocol/delivery.d.ts +12 -0
- package/dist/src/protocol/delivery.js +1 -0
- package/dist/src/protocol/descendant-observation.d.ts +12 -0
- package/dist/src/protocol/descendant-observation.js +1 -0
- package/dist/src/protocol/interaction-json.d.ts +66 -0
- package/dist/src/protocol/interaction-json.js +1 -0
- package/dist/src/protocol/interaction-options.d.ts +4 -0
- package/dist/src/protocol/interaction-options.js +1 -0
- package/dist/src/protocol/remote-agent-protocol.d.ts +28 -1
- package/dist/src/protocol/remote-agent-protocol.js +1 -1
- package/dist/src/protocol/routes.d.ts +3 -2
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/protocol/session-event.d.ts +22 -0
- package/dist/src/protocol/session-event.js +1 -0
- package/dist/src/protocol/session-events/authoring.d.ts +2 -0
- package/dist/src/protocol/session-events/authoring.js +1 -0
- package/dist/src/protocol/session-events/catalog.d.ts +50 -0
- package/dist/src/protocol/session-events/catalog.js +1 -0
- package/dist/src/protocol/session-events/checker.d.ts +23 -0
- package/dist/src/protocol/session-events/checker.js +1 -0
- package/dist/src/protocol/session-events/common.d.ts +105 -0
- package/dist/src/protocol/session-events/common.js +1 -0
- package/dist/src/protocol/session-events/envelope.d.ts +174 -0
- package/dist/src/protocol/session-events/envelope.js +1 -0
- package/dist/src/protocol/session-events/facts.d.ts +24 -0
- package/dist/src/protocol/session-events/facts.js +1 -0
- package/dist/src/protocol/session-events/families/call.d.ts +142 -0
- package/dist/src/protocol/session-events/families/call.js +1 -0
- package/dist/src/protocol/session-events/families/child.d.ts +51 -0
- package/dist/src/protocol/session-events/families/child.js +1 -0
- package/dist/src/protocol/session-events/families/content.d.ts +56 -0
- package/dist/src/protocol/session-events/families/content.js +1 -0
- package/dist/src/protocol/session-events/families/context.d.ts +55 -0
- package/dist/src/protocol/session-events/families/context.js +1 -0
- package/dist/src/protocol/session-events/families/delivery.d.ts +86 -0
- package/dist/src/protocol/session-events/families/delivery.js +1 -0
- package/dist/src/protocol/session-events/families/interaction.d.ts +163 -0
- package/dist/src/protocol/session-events/families/interaction.js +1 -0
- package/dist/src/protocol/session-events/families/model.d.ts +88 -0
- package/dist/src/protocol/session-events/families/model.js +1 -0
- package/dist/src/protocol/session-events/families/response.d.ts +66 -0
- package/dist/src/protocol/session-events/families/response.js +1 -0
- package/dist/src/protocol/session-events/families/session.d.ts +73 -0
- package/dist/src/protocol/session-events/families/session.js +1 -0
- package/dist/src/protocol/session-events/families/task.d.ts +46 -0
- package/dist/src/protocol/session-events/families/task.js +1 -0
- package/dist/src/protocol/session-events/families/turn.d.ts +68 -0
- package/dist/src/protocol/session-events/families/turn.js +1 -0
- package/dist/src/protocol/session-events/families/usage.d.ts +30 -0
- package/dist/src/protocol/session-events/families/usage.js +1 -0
- package/dist/src/protocol/session-events/guards.d.ts +11 -0
- package/dist/src/protocol/session-events/guards.js +1 -0
- package/dist/src/protocol/session-events/index.d.ts +16 -0
- package/dist/src/protocol/session-events/index.js +1 -0
- package/dist/src/protocol/session-events/json.d.ts +20 -0
- package/dist/src/protocol/session-events/json.js +1 -0
- package/dist/src/protocol/session-events/schemas.d.ts +320 -0
- package/dist/src/protocol/session-events/schemas.js +1 -0
- package/dist/src/protocol/session-http.d.ts +7 -0
- package/dist/src/protocol/session-http.js +1 -0
- package/dist/src/protocol/session-lines.d.ts +19 -0
- package/dist/src/protocol/session-lines.js +1 -0
- package/dist/src/protocol/session-projection/fold.d.ts +75 -0
- package/dist/src/protocol/session-projection/fold.js +1 -0
- package/dist/src/protocol/session-projection/index.d.ts +4 -0
- package/dist/src/protocol/session-projection/index.js +1 -0
- package/dist/src/protocol/session-projection/observations.d.ts +150 -0
- package/dist/src/protocol/session-projection/observations.js +1 -0
- package/dist/src/protocol/session-projection/public-view.d.ts +74 -0
- package/dist/src/protocol/session-projection/public-view.js +1 -0
- package/dist/src/protocol/session-projection/reader.d.ts +62 -0
- package/dist/src/protocol/session-projection/reader.js +1 -0
- package/dist/src/protocol/session-projection/request-status.d.ts +7 -0
- package/dist/src/protocol/session-projection/request-status.js +1 -0
- package/dist/src/protocol/session-projection/selectors.d.ts +169 -0
- package/dist/src/protocol/session-projection/selectors.js +2 -0
- package/dist/src/protocol/session-projection/session-view.d.ts +18 -0
- package/dist/src/protocol/session-projection/session-view.js +1 -0
- package/dist/src/protocol/session-projection/tables.d.ts +237 -0
- package/dist/src/protocol/session-projection/tables.js +1 -0
- package/dist/src/protocol/session-projection/tree.d.ts +72 -0
- package/dist/src/protocol/session-projection/tree.js +1 -0
- package/dist/src/protocol/session-projection.d.ts +38 -157
- package/dist/src/protocol/session-projection.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +8 -6
- package/dist/src/protocol/task-tools.js +1 -1
- package/dist/src/protocol/v26-interactions.d.ts +11 -0
- package/dist/src/protocol/v26-interactions.js +1 -0
- package/dist/src/protocol/v26-lines.d.ts +5 -0
- package/dist/src/protocol/v26-lines.js +1 -0
- package/dist/src/public/agents/auth.d.ts +2 -2
- package/dist/src/public/agents/auth.js +1 -1
- package/dist/src/public/ai/index.d.ts +1 -0
- package/dist/src/public/channels/auth.d.ts +2 -532
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/chat-sdk/authorization.d.ts +5 -2
- package/dist/src/public/channels/chat-sdk/authorization.js +1 -3
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +10 -10
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -3
- package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
- package/dist/src/public/channels/chat-sdk/index.js +1 -1
- package/dist/src/public/channels/chat-sdk/input-actions.d.ts +4 -4
- package/dist/src/public/channels/chat-sdk/input-actions.js +3 -3
- package/dist/src/public/channels/chat-sdk/{messageToUserContent.d.ts → message-content.d.ts} +3 -3
- package/dist/src/public/channels/chat-sdk/message-content.js +1 -0
- package/dist/src/public/channels/discord/api.d.ts +8 -11
- package/dist/src/public/channels/discord/api.js +1 -1
- package/dist/src/public/channels/discord/attachments.d.ts +2 -2
- package/dist/src/public/channels/discord/authorization.d.ts +3 -13
- package/dist/src/public/channels/discord/authorization.js +2 -2
- package/dist/src/public/channels/discord/credentials.d.ts +11 -0
- package/dist/src/public/channels/discord/credentials.js +1 -0
- package/dist/src/public/channels/discord/defaults.d.ts +7 -1
- package/dist/src/public/channels/discord/defaults.js +1 -3
- package/dist/src/public/channels/discord/discordChannel.d.ts +36 -48
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/hitl.d.ts +5 -4
- package/dist/src/public/channels/discord/hitl.js +1 -1
- package/dist/src/public/channels/discord/index.d.ts +4 -12
- package/dist/src/public/channels/discord/index.js +1 -1
- package/dist/src/public/channels/discord/messages.js +1 -1
- package/dist/src/public/channels/github/defaults.js +2 -4
- package/dist/src/public/channels/github/githubChannel.d.ts +23 -36
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/index.d.ts +3 -2
- package/dist/src/public/channels/github/index.js +1 -1
- package/dist/src/public/channels/github/state.d.ts +2 -0
- package/dist/src/public/channels/imessage-tapbacks.d.ts +1 -1
- package/dist/src/public/channels/index.d.ts +16 -37
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/defaults.js +2 -4
- package/dist/src/public/channels/linear/hitl.d.ts +3 -3
- package/dist/src/public/channels/linear/hitl.js +2 -2
- package/dist/src/public/channels/linear/inbound-uploads.d.ts +3 -3
- package/dist/src/public/channels/linear/inbound-uploads.js +1 -1
- package/dist/src/public/channels/linear/inbound.d.ts +5 -3
- package/dist/src/public/channels/linear/inbound.js +1 -1
- package/dist/src/public/channels/linear/index.d.ts +4 -6
- package/dist/src/public/channels/linear/index.js +1 -1
- package/dist/src/public/channels/linear/linearChannel.d.ts +19 -30
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/linq/inboundContent.d.ts +2 -2
- package/dist/src/public/channels/linq/inboundContent.js +1 -1
- package/dist/src/public/channels/linq/index.d.ts +1 -1
- package/dist/src/public/channels/linq/linqChannel.d.ts +1 -2
- package/dist/src/public/channels/mcp.d.ts +2 -2
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/photon/inboundContent.d.ts +2 -2
- package/dist/src/public/channels/photon/inboundContent.js +1 -1
- package/dist/src/public/channels/photon/index.d.ts +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +1 -2
- package/dist/src/public/channels/reply.d.ts +22 -0
- package/dist/src/public/channels/reply.js +3 -0
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/{input-response.d.ts → answers.d.ts} +5 -5
- package/dist/src/public/channels/slack/answers.js +1 -0
- package/dist/src/public/channels/slack/api.d.ts +5 -2
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/approval-cards.d.ts +15 -5
- package/dist/src/public/channels/slack/approval-cards.js +2 -2
- package/dist/src/public/channels/slack/attachments.d.ts +6 -6
- package/dist/src/public/channels/slack/attachments.js +1 -1
- package/dist/src/public/channels/slack/blocks.d.ts +1 -1
- package/dist/src/public/channels/slack/blocks.js +1 -1
- package/dist/src/public/channels/slack/cards.d.ts +576 -0
- package/dist/src/public/channels/slack/cards.js +1 -0
- package/dist/src/public/channels/slack/connections.d.ts +4 -22
- package/dist/src/public/channels/slack/connections.js +1 -1
- package/dist/src/public/channels/slack/defaults.d.ts +13 -2
- package/dist/src/public/channels/slack/defaults.js +5 -5
- package/dist/src/public/channels/slack/hitl.d.ts +20 -19
- package/dist/src/public/channels/slack/hitl.js +3 -3
- package/dist/src/public/channels/slack/index.d.ts +7 -16
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/interaction-cards.js +1 -1
- package/dist/src/public/channels/slack/interactions.d.ts +2 -2
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/limits.js +1 -1
- package/dist/src/public/channels/slack/private-approval-delivery.d.ts +3 -3
- package/dist/src/public/channels/slack/private-approval-delivery.js +1 -1
- package/dist/src/public/channels/slack/renderers.d.ts +21 -27
- package/dist/src/public/channels/slack/renderers.js +1 -1
- package/dist/src/public/channels/slack/reply-delivery.d.ts +4 -4
- package/dist/src/public/channels/slack/reply-delivery.js +1 -1
- package/dist/src/public/channels/slack/session-operations.d.ts +4 -4
- package/dist/src/public/channels/slack/sign-in-cancel.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +30 -37
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/slack/task-card.d.ts +9 -9
- package/dist/src/public/channels/slack/task-card.js +1 -1
- package/dist/src/public/channels/teams/api.d.ts +3 -7
- package/dist/src/public/channels/teams/attachments.d.ts +4 -4
- package/dist/src/public/channels/teams/authorization.d.ts +5 -9
- package/dist/src/public/channels/teams/authorization.js +1 -1
- package/dist/src/public/channels/teams/credentials.d.ts +13 -0
- package/dist/src/public/channels/teams/credentials.js +1 -0
- package/dist/src/public/channels/teams/defaults.d.ts +2 -6
- package/dist/src/public/channels/teams/defaults.js +1 -3
- package/dist/src/public/channels/teams/hitl.d.ts +8 -7
- package/dist/src/public/channels/teams/hitl.js +1 -1
- package/dist/src/public/channels/teams/index.d.ts +6 -8
- package/dist/src/public/channels/teams/index.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +25 -44
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/api.d.ts +3 -4
- package/dist/src/public/channels/telegram/attachments.d.ts +5 -5
- package/dist/src/public/channels/telegram/authorization-callback.js +1 -1
- package/dist/src/public/channels/telegram/authorization.d.ts +4 -8
- package/dist/src/public/channels/telegram/authorization.js +2 -2
- package/dist/src/public/channels/telegram/credentials.d.ts +9 -0
- package/dist/src/public/channels/telegram/credentials.js +1 -0
- package/dist/src/public/channels/telegram/defaults.js +1 -3
- package/dist/src/public/channels/telegram/hitl.d.ts +22 -20
- package/dist/src/public/channels/telegram/hitl.js +2 -2
- package/dist/src/public/channels/telegram/index.d.ts +5 -7
- package/dist/src/public/channels/telegram/index.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +23 -36
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/text.d.ts +4 -0
- package/dist/src/public/channels/text.js +1 -0
- package/dist/src/public/channels/twilio/api.d.ts +8 -8
- package/dist/src/public/channels/twilio/api.js +1 -1
- package/dist/src/public/channels/twilio/credentials.d.ts +7 -0
- package/dist/src/public/channels/twilio/credentials.js +1 -0
- package/dist/src/public/channels/twilio/defaults.d.ts +0 -1
- package/dist/src/public/channels/twilio/defaults.js +1 -5
- package/dist/src/public/channels/twilio/inbound.d.ts +2 -2
- package/dist/src/public/channels/twilio/index.d.ts +4 -4
- package/dist/src/public/channels/twilio/index.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +24 -37
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/channels/twilio/verify.d.ts +6 -4
- package/dist/src/public/channels/undelivered-reply.d.ts +2 -2
- package/dist/src/public/channels/upload-policy.d.ts +7 -7
- package/dist/src/public/connections/index.d.ts +3 -5
- package/dist/src/public/context/index.d.ts +3 -2
- package/dist/src/public/definitions/agent.d.ts +18 -18
- package/dist/src/public/definitions/agent.js +1 -1
- package/dist/src/public/definitions/approval.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +57 -60
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/dynamic.d.ts +3 -15
- package/dist/src/public/definitions/connections/dynamic.js +1 -1
- package/dist/src/public/definitions/connections/events.d.ts +9 -9
- package/dist/src/public/definitions/connections/mcp.d.ts +5 -3
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/definitions/extension.d.ts +2 -4
- package/dist/src/public/definitions/extension.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +63 -85
- package/dist/src/public/definitions/hook.js +1 -1
- package/dist/src/public/definitions/instructions.d.ts +3 -10
- package/dist/src/public/definitions/instructions.js +1 -1
- package/dist/src/public/definitions/model.d.ts +21 -0
- package/dist/src/public/definitions/model.js +1 -0
- package/dist/src/public/definitions/removed-event-keys.d.ts +2 -0
- package/dist/src/public/definitions/removed-event-keys.js +1 -0
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/definitions/schedule.d.ts +4 -4
- package/dist/src/public/definitions/skill.d.ts +5 -0
- package/dist/src/public/definitions/skill.js +1 -1
- package/dist/src/public/events/index.d.ts +27 -0
- package/dist/src/public/events/index.js +1 -0
- package/dist/src/public/experimental/connections/index.d.ts +1 -0
- package/dist/src/public/experimental/connections/index.js +1 -0
- package/dist/src/public/experimental/schedules/client.js +1 -1
- package/dist/src/public/hooks/index.d.ts +4 -3
- package/dist/src/public/index.d.ts +3 -2
- package/dist/src/public/instructions/index.d.ts +2 -2
- package/dist/src/public/instrumentation/index.d.ts +9 -28
- package/dist/src/public/instrumentation/index.js +1 -1
- package/dist/src/public/instrumentation/otel.d.ts +1 -1
- package/dist/src/public/instrumentation/otel.js +1 -1
- package/dist/src/public/instrumentation/provider.d.ts +1 -1
- package/dist/src/public/instrumentation/provider.js +1 -1
- package/dist/src/public/local-dev.d.ts +3 -1
- package/dist/src/public/memory/file/backend.d.ts +1 -1
- package/dist/src/public/memory/file/backends/in-memory.js +1 -1
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/memory/file/provider.js +1 -1
- package/dist/src/public/memory/index.d.ts +14 -20
- package/dist/src/public/models/index.d.ts +3 -0
- package/dist/src/public/models/index.js +1 -1
- package/dist/src/public/models/openai/index.d.ts +0 -2
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/next/index.d.ts +5 -36
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/nuxt/index.d.ts +1 -1
- package/dist/src/public/nuxt/module.d.ts +5 -2
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/sandbox/index.d.ts +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +52 -12
- package/dist/src/public/sandbox/vercel.d.ts +1 -1
- package/dist/src/public/schedules/subscription.d.ts +5 -8
- package/dist/src/public/server/index.d.ts +2 -14
- package/dist/src/public/server/index.js +1 -1
- package/dist/src/public/sessions/index.d.ts +6 -0
- package/dist/src/public/sessions/index.js +1 -0
- package/dist/src/public/skills/index.d.ts +2 -2
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/sveltekit/routing.d.ts +0 -4
- package/dist/src/public/sveltekit/routing.js +1 -1
- package/dist/src/public/tools/approval/index.d.ts +1 -1
- package/dist/src/public/tools/bash.d.ts +1 -1
- package/dist/src/public/tools/bash.js +1 -1
- package/dist/src/public/tools/glob.d.ts +1 -1
- package/dist/src/public/tools/glob.js +1 -1
- package/dist/src/public/tools/grep.d.ts +1 -1
- package/dist/src/public/tools/grep.js +1 -1
- package/dist/src/public/tools/index.d.ts +5 -9
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/read-file.d.ts +1 -1
- package/dist/src/public/tools/read-file.js +1 -1
- package/dist/src/public/tools/result.d.ts +17 -9
- package/dist/src/public/tools/result.js +1 -1
- package/dist/src/public/tools/web-fetch.d.ts +1 -1
- package/dist/src/public/tools/web-fetch.js +1 -1
- package/dist/src/public/tools/web-search.d.ts +1 -3
- package/dist/src/public/tools/web-search.js +1 -1
- package/dist/src/public/tools/write-file.d.ts +1 -1
- package/dist/src/public/tools/write-file.js +1 -1
- package/dist/src/public/workflow-modules.d.ts +8 -2
- package/dist/src/react/index.d.ts +4 -7
- package/dist/src/react/index.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +68 -50
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/reactions/bundle.d.ts +4 -0
- package/dist/src/reactions/bundle.js +1 -0
- package/dist/src/reactions/frame.d.ts +13 -0
- package/dist/src/reactions/frame.js +1 -0
- package/dist/src/reactions/intents.d.ts +22 -0
- package/dist/src/reactions/intents.js +1 -0
- package/dist/src/reactions/kinds/connection.d.ts +18 -0
- package/dist/src/reactions/kinds/connection.js +1 -0
- package/dist/src/reactions/kinds/hook.d.ts +8 -0
- package/dist/src/reactions/kinds/hook.js +1 -0
- package/dist/src/reactions/kinds/instructions.d.ts +21 -0
- package/dist/src/reactions/kinds/instructions.js +1 -0
- package/dist/src/reactions/kinds/memory.d.ts +72 -0
- package/dist/src/reactions/kinds/memory.js +1 -0
- package/dist/src/reactions/kinds/model.d.ts +21 -0
- package/dist/src/reactions/kinds/model.js +1 -0
- package/dist/src/reactions/kinds/skill.d.ts +27 -0
- package/dist/src/reactions/kinds/skill.js +1 -0
- package/dist/src/reactions/kinds/subagent.d.ts +16 -0
- package/dist/src/reactions/kinds/subagent.js +1 -0
- package/dist/src/reactions/kinds/tool.d.ts +16 -0
- package/dist/src/reactions/kinds/tool.js +1 -0
- package/dist/src/reactions/policy.d.ts +13 -0
- package/dist/src/reactions/policy.js +1 -0
- package/dist/src/reactions/reaction.d.ts +83 -0
- package/dist/src/reactions/reaction.js +1 -0
- package/dist/src/reactions/records.d.ts +40 -0
- package/dist/src/reactions/records.js +1 -0
- package/dist/src/reactions/remote.d.ts +25 -0
- package/dist/src/reactions/remote.js +1 -0
- package/dist/src/reactions/runner.d.ts +45 -0
- package/dist/src/reactions/runner.js +1 -0
- package/dist/src/reactions/state.d.ts +102 -0
- package/dist/src/reactions/state.js +1 -0
- package/dist/src/reactions/turn.d.ts +12 -0
- package/dist/src/reactions/turn.js +2 -0
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -3
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/resolve-model.d.ts +3 -4
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/principal.d.ts +2 -0
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/connections/registry.d.ts +2 -2
- package/dist/src/runtime/connections/registry.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +8 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/graph.d.ts +0 -6
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
- package/dist/src/runtime/loaders/artifact-paths.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +2 -0
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/loaders/model-metadata.d.ts +4 -0
- package/dist/src/runtime/loaders/model-metadata.js +1 -0
- package/dist/src/runtime/local-dev-capability.d.ts +2 -3
- package/dist/src/runtime/local-dev-capability.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-connection.js +1 -1
- package/dist/src/runtime/resolve-dynamic.d.ts +9 -0
- package/dist/src/runtime/resolve-dynamic.js +1 -0
- package/dist/src/runtime/resolve-hook.js +1 -1
- package/dist/src/runtime/resolve-memory.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/schedules/dispatch-occurrence.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +3 -2
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +16 -3
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/runtime/types.d.ts +22 -39
- package/dist/src/sandbox/provider.d.ts +5 -3
- package/dist/src/sandbox/providers/default.d.ts +4 -2
- package/dist/src/sandbox/providers/default.js +1 -1
- package/dist/src/self-modification/agent.d.ts +3 -3
- package/dist/src/self-modification/agent.js +1 -1
- package/dist/src/self-modification/config.d.ts +1 -1
- package/dist/src/self-modification/config.js +1 -1
- package/dist/src/self-modification/deployed-sandbox.js +1 -1
- package/dist/src/self-modification/extension/extension.d.ts +1 -0
- package/dist/src/self-modification/extension/local-only.d.ts +1 -1
- package/dist/src/self-modification/extension/local-only.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +15 -4
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/instructions.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +2 -2
- package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +2 -2
- package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/skills/trace_analysis.d.ts +3 -3
- package/dist/src/self-modification/extension/subagents/agent/skills/trace_analysis.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/inspect_trace.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/inspect_trace_spans.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.d.ts +1 -1
- package/dist/src/self-modification/mode.d.ts +8 -0
- package/dist/src/self-modification/mode.js +1 -1
- package/dist/src/self-modification/remote/config.d.ts +3 -6
- package/dist/src/self-modification/remote/extension.d.ts +1 -0
- package/dist/src/self-modification/remote/production-registry-add.js +1 -1
- package/dist/src/self-modification/remote/subagents/agent/agent.d.ts +6 -3
- package/dist/src/self-modification/remote/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/remote/subagents/agent/instructions.d.ts +1 -1
- package/dist/src/self-modification/remote/subagents/agent/instructions.js +2 -2
- package/dist/src/self-modification/remote/subagents/agent/tools/publish.d.ts +1 -3
- package/dist/src/self-modification/remote/subagents/agent/tools/publish.js +1 -1
- package/dist/src/self-modification/remote/subagents/agent/tools/registry_add.d.ts +1 -3
- package/dist/src/self-modification/remote/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/scaffold.js +1 -1
- package/dist/src/self-modification/setup.js +3 -6
- package/dist/src/services/dev-client/client-options.js +1 -1
- package/dist/src/services/dev-client.d.ts +4 -4
- package/dist/src/services/dev-client.js +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/integrations/self-modification/setup.d.ts +1 -4
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +9 -18
- package/dist/src/setup/scaffold/create/web-template.js +1015 -2537
- package/dist/src/setup/verified-remote-agent.js +1 -1
- package/dist/src/shared/action-label.d.ts +5 -3
- package/dist/src/shared/action-label.js +1 -1
- package/dist/src/shared/action-types.d.ts +5 -0
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +14 -10
- package/dist/src/shared/answers-delivery-id.d.ts +1 -0
- package/dist/src/shared/answers-delivery-id.js +1 -0
- package/dist/src/shared/channel-context.d.ts +12 -0
- package/dist/src/shared/channel-context.js +1 -0
- package/dist/src/shared/channel-definition.d.ts +19 -26
- package/dist/src/shared/channel-delivery.d.ts +16 -0
- package/dist/src/shared/channel-delivery.js +1 -0
- package/dist/src/shared/connection-events.d.ts +2 -2
- package/dist/src/shared/connection-types.d.ts +7 -32
- package/dist/src/shared/conversation-context.d.ts +4 -13
- package/dist/src/shared/delivery.d.ts +38 -0
- package/dist/src/shared/delivery.js +1 -0
- package/dist/src/shared/history-message.d.ts +190 -0
- package/dist/src/shared/history-message.js +1 -0
- package/dist/src/shared/input.d.ts +23 -97
- package/dist/src/shared/input.js +1 -1
- package/dist/src/shared/instructions-definition.d.ts +2 -8
- package/dist/src/shared/instrumentation-channel-kind.d.ts +1 -1
- package/dist/src/shared/instrumentation-channel.d.ts +12 -0
- package/dist/src/shared/instrumentation-channel.js +1 -0
- package/dist/src/shared/json.d.ts +2 -18
- package/dist/src/shared/memory-state.d.ts +4 -40
- package/dist/src/shared/memory-state.js +1 -1
- package/dist/src/shared/message-content.d.ts +19 -0
- package/dist/src/shared/message-content.js +1 -0
- package/dist/src/shared/network-address.d.ts +9 -0
- package/dist/src/shared/network-address.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +2 -2
- package/dist/src/shared/sandbox-provider.d.ts +1 -1
- package/dist/src/shared/sandbox-session.d.ts +64 -85
- package/dist/src/shared/schedule-definition.d.ts +5 -5
- package/dist/src/shared/serialized-observability-state.d.ts +0 -2
- package/dist/src/shared/serialized-observability-state.js +1 -1
- package/dist/src/shared/session-history.d.ts +2 -2
- package/dist/src/shared/session.d.ts +22 -0
- package/dist/src/shared/session.js +1 -0
- package/dist/src/shared/skill-definition.d.ts +1 -1
- package/dist/src/shared/skill-package.d.ts +2 -2
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/token-usage-math.d.ts +5 -0
- package/dist/src/shared/token-usage-math.js +1 -0
- package/dist/src/shared/token-usage.d.ts +0 -2
- package/dist/src/shared/token-usage.js +1 -1
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/shared/wait-with-signal.d.ts +2 -0
- package/dist/src/shared/wait-with-signal.js +1 -0
- package/dist/src/subagents/adapter.d.ts +3 -5
- package/dist/src/subagents/adapter.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/event-proxy-step.d.ts +6 -9
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +11 -23
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/subagents/invocation.d.ts +8 -8
- package/dist/src/subagents/invocation.js +2 -2
- package/dist/src/subagents/parent-notification.d.ts +5 -0
- package/dist/src/subagents/parent-notification.js +1 -1
- package/dist/src/subagents/protocol-two-callback.d.ts +27 -0
- package/dist/src/subagents/protocol-two-callback.js +1 -0
- package/dist/src/svelte/index.d.ts +3 -6
- package/dist/src/svelte/index.js +2 -39
- package/dist/src/svelte/use-eve-agent.d.ts +67 -56
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/rules.js +1 -1
- package/dist/src/tools/approval/policies.d.ts +4 -16
- package/dist/src/tools/approval/policies.js +1 -1
- package/dist/src/tools/auth.d.ts +3 -3
- package/dist/src/tools/definition.d.ts +13 -35
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/dynamic.d.ts +13 -72
- package/dist/src/tools/dynamic.js +1 -1
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.d.ts +3 -3
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/ask-question.d.ts +2 -2
- package/dist/src/tools/provided/ask-question.js +1 -1
- package/dist/src/tools/provided/grep.d.ts +2 -15
- package/dist/src/tools/provided/grep.js +1 -2
- package/dist/src/tools/provided/no-reply.d.ts +2 -2
- package/dist/src/tools/provided/no-reply.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/sleep.d.ts +2 -2
- package/dist/src/tools/provided/sleep.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +17 -15
- package/dist/src/tracing/eve/agent-approval-instrumentation.d.ts +1 -1
- package/dist/src/tracing/eve/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/eve/agent-channel-delivery-instrumentation.d.ts +2 -2
- package/dist/src/tracing/eve/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/eve/agent-invocation-coordinator.d.ts +2 -2
- package/dist/src/tracing/eve/agent-otel-provider.js +1 -1
- package/dist/src/tracing/eve/agent-tool-instrumentation.d.ts +6 -7
- package/dist/src/tracing/eve/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/eve/agent-trace-context-store.d.ts +3 -3
- package/dist/src/tracing/eve/agent-trace-state.d.ts +1 -6
- package/dist/src/tracing/eve/delegation.d.ts +4 -4
- package/dist/src/tracing/eve/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/eve/invoke-tool-span.d.ts +3 -2
- package/dist/src/tracing/eve/invoke-tool-span.js +1 -1
- package/dist/src/tracing/eve/otel-declaration.d.ts +9 -10
- package/dist/src/tracing/eve/otel-declaration.js +1 -1
- package/dist/src/tracing/eve/policy.d.ts +2 -2
- package/dist/src/tracing/eve/policy.js +1 -1
- package/dist/src/tracing/eve/session.d.ts +4 -3
- package/dist/src/tracing/eve/session.js +1 -1
- package/dist/src/vue/index.d.ts +3 -6
- package/dist/src/vue/index.js +2 -39
- package/dist/src/vue/use-eve-agent.d.ts +70 -59
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +41 -44
- package/docs/channels/chat-sdk.mdx +19 -13
- package/docs/channels/custom.mdx +106 -85
- package/docs/channels/discord.mdx +12 -12
- package/docs/channels/eve.mdx +48 -15
- package/docs/channels/github.mdx +2 -2
- package/docs/channels/linear.mdx +8 -8
- package/docs/channels/linq.mdx +1 -1
- package/docs/channels/mcp.mdx +2 -2
- package/docs/channels/overview.mdx +11 -1
- package/docs/channels/photon.mdx +1 -1
- package/docs/channels/slack.mdx +64 -57
- package/docs/channels/teams.mdx +4 -4
- package/docs/channels/telegram.mdx +1 -1
- package/docs/channels/twilio.mdx +2 -2
- package/docs/code-extension.mdx +19 -7
- package/docs/concepts/built-in-tools.md +21 -9
- package/docs/concepts/context-control.md +5 -8
- package/docs/concepts/default-harness.md +13 -8
- package/docs/concepts/execution-model-and-durability.mdx +119 -12
- package/docs/concepts/meta.json +1 -0
- package/docs/concepts/sessions-runs-and-streaming.md +244 -138
- package/docs/concepts/state.md +1 -1
- package/docs/concepts/upgrade-to-v27-events.md +128 -0
- package/docs/connections/mcp.mdx +38 -34
- package/docs/connections/openapi.mdx +23 -2
- package/docs/connections/overview.mdx +66 -57
- package/docs/evals/assertions.mdx +30 -24
- package/docs/evals/cases.mdx +19 -24
- package/docs/evals/judge.mdx +15 -2
- package/docs/evals/overview.mdx +7 -7
- package/docs/evals/reporters.mdx +15 -11
- package/docs/evals/targets.mdx +5 -3
- package/docs/evals/tool-stubs.mdx +2 -2
- package/docs/extensions.md +6 -3
- package/docs/guides/client/continuations.mdx +10 -10
- package/docs/guides/client/messages.mdx +50 -48
- package/docs/guides/client/output-schema.mdx +13 -13
- package/docs/guides/client/overview.mdx +35 -13
- package/docs/guides/client/streaming.mdx +160 -123
- package/docs/guides/decide.md +15 -9
- package/docs/guides/deployment/self-hosting.md +5 -40
- package/docs/guides/dynamic-capabilities.md +151 -406
- package/docs/guides/frontend/nextjs.mdx +1 -1
- package/docs/guides/frontend/nuxt.mdx +2 -2
- package/docs/guides/frontend/overview.mdx +257 -181
- package/docs/guides/frontend/sveltekit.mdx +4 -4
- package/docs/guides/frontend/tanstack.mdx +5 -5
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +30 -38
- package/docs/guides/frontend/use-eve-agent-vue.mdx +35 -36
- package/docs/guides/hooks.md +67 -55
- package/docs/guides/instrumentation/instrumentation.mdx +33 -27
- package/docs/guides/instrumentation/otel.mdx +4 -2
- package/docs/guides/remote-agents.md +116 -50
- package/docs/guides/self-modification.md +11 -7
- package/docs/instructions.mdx +4 -6
- package/docs/memory/custom-provider.md +63 -56
- package/docs/memory/file.md +1 -1
- package/docs/memory/overview.mdx +10 -18
- package/docs/patterns/durable-cross-channel-notifications.md +4 -3
- package/docs/patterns/multi-tenant-approvals.md +3 -3
- package/docs/patterns/multi-tenant-auth.md +3 -3
- package/docs/patterns/multi-tenant-memory.md +6 -7
- package/docs/patterns/voice-notes.md +1 -1
- package/docs/reference/cli.md +9 -25
- package/docs/reference/typescript-api.md +85 -60
- package/docs/sandbox/custom-providers.mdx +13 -14
- package/docs/sandbox/default.mdx +1 -1
- package/docs/sandbox/docker.mdx +10 -0
- package/docs/sandbox/index.mdx +5 -1
- package/docs/sandbox/vercel.mdx +6 -6
- package/docs/schedules.mdx +4 -4
- package/docs/skills.mdx +6 -6
- package/docs/subagents/index.mdx +25 -34
- package/docs/tools/human-in-the-loop.md +42 -34
- package/docs/tools/overview.mdx +14 -12
- package/docs/tools/tasks-upgrade.md +13 -1
- package/docs/tools/tasks.md +58 -89
- package/docs/tools/workflows.mdx +48 -33
- package/docs/tutorial/guard-the-spend.mdx +1 -1
- package/docs/tutorial/run-analysis.mdx +15 -12
- package/docs/tutorial/team-playbooks.mdx +19 -23
- package/package.json +147 -96
- package/dist/src/chunks/use-eve-agent-BE2_zd5q.js +0 -4968
- package/dist/src/chunks/use-eve-agent-e8a5vcFO.js +0 -4926
- package/dist/src/cli/invoke/command.d.ts +0 -19
- package/dist/src/cli/invoke/command.js +0 -1
- package/dist/src/cli/invoke/invoke.d.ts +0 -27
- package/dist/src/cli/invoke/invoke.js +0 -1
- package/dist/src/cli/invoke/result.d.ts +0 -137
- package/dist/src/cli/invoke/result.js +0 -1
- package/dist/src/client/agent-host.d.ts +0 -4
- package/dist/src/client/agent-host.js +0 -1
- package/dist/src/client/authorization-message-parts.d.ts +0 -4
- package/dist/src/client/authorization-message-parts.js +0 -1
- package/dist/src/client/conversation-projection.d.ts +0 -4
- package/dist/src/client/conversation-projection.js +0 -1
- package/dist/src/client/conversation-reducer.d.ts +0 -29
- package/dist/src/client/conversation-reducer.js +0 -1
- package/dist/src/client/eve-agent-projection.d.ts +0 -28
- package/dist/src/client/eve-agent-projection.js +0 -1
- package/dist/src/client/eve-agent-store-helpers.d.ts +0 -34
- package/dist/src/client/eve-agent-store-helpers.js +0 -2
- package/dist/src/client/eve-agent-store-state.d.ts +0 -96
- package/dist/src/client/eve-agent-store.d.ts +0 -45
- package/dist/src/client/eve-agent-store.js +0 -1
- package/dist/src/client/message-action-parts.d.ts +0 -37
- package/dist/src/client/message-action-parts.js +0 -1
- package/dist/src/client/message-reducer-primitives.d.ts +0 -6
- package/dist/src/client/message-reducer-primitives.js +0 -1
- package/dist/src/client/message-reducer-types.d.ts +0 -244
- package/dist/src/client/message-reducer.d.ts +0 -14
- package/dist/src/client/message-reducer.js +0 -1
- package/dist/src/client/message-response.d.ts +0 -74
- package/dist/src/client/message-response.js +0 -1
- package/dist/src/client/message-run-parts.d.ts +0 -22
- package/dist/src/client/message-run-parts.js +0 -1
- package/dist/src/client/output-schema.d.ts +0 -5
- package/dist/src/client/output-schema.js +0 -1
- package/dist/src/client/reducer.d.ts +0 -67
- package/dist/src/client/session-turn-dispatch.d.ts +0 -15
- package/dist/src/client/session-turn-dispatch.js +0 -1
- package/dist/src/client/tool-call-state.d.ts +0 -23
- package/dist/src/client/tool-call-state.js +0 -1
- package/dist/src/client/tool-part-state.d.ts +0 -7
- package/dist/src/client/tool-part-state.js +0 -1
- package/dist/src/client/transcript-reducer.d.ts +0 -49
- package/dist/src/client/transcript-reducer.js +0 -2
- package/dist/src/compiled/_chunks/node/token-Bedbhv5z.js +0 -1
- package/dist/src/compiled/_chunks/node/token-util-DpJNusVS.js +0 -1
- package/dist/src/compiled/_chunks/node/token-util-DwHQ2a3c.js +0 -1
- package/dist/src/compiled/_chunks/node/version-C__MqbLM.js +0 -1
- package/dist/src/context/build-dynamic-tools.d.ts +0 -10
- package/dist/src/context/build-dynamic-tools.js +0 -1
- package/dist/src/context/dynamic-connection-lifecycle.d.ts +0 -15
- package/dist/src/context/dynamic-connection-lifecycle.js +0 -1
- package/dist/src/context/dynamic-instruction-lifecycle.d.ts +0 -31
- package/dist/src/context/dynamic-instruction-lifecycle.js +0 -1
- package/dist/src/context/dynamic-model-lifecycle.d.ts +0 -19
- package/dist/src/context/dynamic-model-lifecycle.js +0 -1
- package/dist/src/context/dynamic-resolve-context.d.ts +0 -12
- package/dist/src/context/dynamic-resolve-context.js +0 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +0 -15
- package/dist/src/context/dynamic-skill-lifecycle.js +0 -1
- package/dist/src/context/dynamic-subagent-lifecycle.d.ts +0 -27
- package/dist/src/context/dynamic-subagent-lifecycle.js +0 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +0 -46
- package/dist/src/context/dynamic-tool-lifecycle.js +0 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +0 -47
- package/dist/src/context/dynamic-tool-metadata.js +0 -1
- package/dist/src/context/effective-model.d.ts +0 -5
- package/dist/src/context/effective-model.js +0 -1
- package/dist/src/context/hook-lifecycle.d.ts +0 -15
- package/dist/src/context/hook-lifecycle.js +0 -1
- package/dist/src/context/memory-event-lifecycle.d.ts +0 -15
- package/dist/src/context/memory-event-lifecycle.js +0 -1
- package/dist/src/context/memory-lifecycle.d.ts +0 -47
- package/dist/src/context/memory-lifecycle.js +0 -1
- package/dist/src/context/serialized-dynamic-model-selection.d.ts +0 -2
- package/dist/src/context/serialized-dynamic-model-selection.js +0 -1
- package/dist/src/execution/cancel-descendant-turns-step.d.ts +0 -6
- package/dist/src/execution/cancel-descendant-turns-step.js +0 -1
- package/dist/src/execution/dynamic-connection-recovery.d.ts +0 -14
- package/dist/src/execution/dynamic-connection-recovery.js +0 -1
- package/dist/src/execution/dynamic-connections.d.ts +0 -12
- package/dist/src/execution/dynamic-connections.js +0 -1
- package/dist/src/execution/history-view.d.ts +0 -10
- package/dist/src/execution/history-view.js +0 -1
- package/dist/src/execution/legacy-remote-agent/protocol.d.ts +0 -49
- package/dist/src/execution/legacy-remote-agent/protocol.js +0 -1
- package/dist/src/execution/runtime-errors.d.ts +0 -13
- package/dist/src/execution/runtime-errors.js +0 -1
- package/dist/src/execution/sandbox/grep-tool.d.ts +0 -26
- package/dist/src/execution/sandbox/grep-tool.js +0 -3
- package/dist/src/execution/session/turn-waiting-step.d.ts +0 -4
- package/dist/src/execution/session/turn-waiting-step.js +0 -1
- package/dist/src/execution/tools/workflow/cancel.d.ts +0 -13
- package/dist/src/execution/tools/workflow/cancel.js +0 -1
- package/dist/src/execution/workflow-trace-context.d.ts +0 -8
- package/dist/src/execution/workflow-trace-context.js +0 -1
- package/dist/src/extensions/code/extension/instructions/github.d.ts +0 -3
- package/dist/src/extensions/code/extension/instructions/github.js +0 -1
- package/dist/src/extensions/code/extension/lib/github-compat.d.ts +0 -28
- package/dist/src/extensions/code/extension/lib/github-compat.js +0 -1
- package/dist/src/extensions/code/extension/lib/grep-search.js +0 -6
- package/dist/src/extensions/code/extension/skills/pr.d.ts +0 -6
- package/dist/src/extensions/code/extension/skills/pr.js +0 -1
- package/dist/src/extensions/code/extension/tools/gh.d.ts +0 -28
- package/dist/src/extensions/code/extension/tools/gh.js +0 -1
- package/dist/src/harness/approval-recheck.d.ts +0 -7
- package/dist/src/harness/approval-recheck.js +0 -1
- package/dist/src/harness/authorization-event-fields.d.ts +0 -16
- package/dist/src/harness/authorization-event-fields.js +0 -1
- package/dist/src/harness/hitl/candidates.d.ts +0 -139
- package/dist/src/harness/hitl/candidates.js +0 -1
- package/dist/src/harness/hitl/coordinator.d.ts +0 -35
- package/dist/src/harness/hitl/coordinator.js +0 -1
- package/dist/src/harness/input-extraction.d.ts +0 -13
- package/dist/src/harness/input-extraction.js +0 -1
- package/dist/src/harness/input-request-class.d.ts +0 -3
- package/dist/src/harness/input-request-class.js +0 -1
- package/dist/src/harness/input-request-resolution.d.ts +0 -39
- package/dist/src/harness/input-request-resolution.js +0 -1
- package/dist/src/harness/open-input-request.d.ts +0 -8
- package/dist/src/harness/open-input-request.js +0 -1
- package/dist/src/harness/session-machine/events.d.ts +0 -6
- package/dist/src/harness/session-machine/events.js +0 -1
- package/dist/src/harness/session-machine/resolver-events.d.ts +0 -12
- package/dist/src/harness/session-machine/resolver-events.js +0 -1
- package/dist/src/harness/tool-call-action.d.ts +0 -9
- package/dist/src/harness/tool-call-action.js +0 -1
- package/dist/src/harness/tool-interrupts.d.ts +0 -22
- package/dist/src/harness/tool-interrupts.js +0 -1
- package/dist/src/harness/tool-presentation.d.ts +0 -5
- package/dist/src/harness/tool-presentation.js +0 -1
- package/dist/src/harness/turn-tag-state.d.ts +0 -115
- package/dist/src/harness/turn-tag-state.js +0 -1
- package/dist/src/internal/dynamic-tool-rebind.d.ts +0 -3
- package/dist/src/internal/dynamic-tool-rebind.js +0 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +0 -14
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +0 -1
- package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.d.ts +0 -12
- package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +0 -1
- package/dist/src/internal/workflow-bundle/dynamic-remote-agent-transform.d.ts +0 -7
- package/dist/src/internal/workflow-bundle/dynamic-remote-agent-transform.js +0 -3
- package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.d.ts +0 -79
- package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.js +0 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +0 -14
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +0 -3
- package/dist/src/protocol/event-dedupe.d.ts +0 -26
- package/dist/src/protocol/event-dedupe.js +0 -1
- package/dist/src/protocol/event-id.d.ts +0 -10
- package/dist/src/protocol/event-id.js +0 -1
- package/dist/src/protocol/message-version.d.ts +0 -53
- package/dist/src/protocol/message-version.js +0 -1
- package/dist/src/protocol/message.d.ts +0 -1198
- package/dist/src/protocol/message.js +0 -2
- package/dist/src/public/channels/chat-sdk/messageToUserContent.js +0 -1
- package/dist/src/public/channels/slack/input-response.js +0 -1
- package/dist/src/runtime/agent/model-catalog.d.ts +0 -10
- package/dist/src/runtime/agent/model-catalog.js +0 -1
- package/dist/src/runtime/hooks/registry.d.ts +0 -34
- package/dist/src/runtime/hooks/registry.js +0 -1
- package/dist/src/runtime/resolve-dynamic-connection.d.ts +0 -5
- package/dist/src/runtime/resolve-dynamic-connection.js +0 -1
- package/dist/src/runtime/resolve-dynamic-instructions.d.ts +0 -4
- package/dist/src/runtime/resolve-dynamic-instructions.js +0 -1
- package/dist/src/runtime/resolve-dynamic-skill.d.ts +0 -8
- package/dist/src/runtime/resolve-dynamic-skill.js +0 -1
- package/dist/src/runtime/resolve-dynamic-subagent.d.ts +0 -9
- package/dist/src/runtime/resolve-dynamic-subagent.js +0 -1
- package/dist/src/runtime/resolve-dynamic-tool.d.ts +0 -12
- package/dist/src/runtime/resolve-dynamic-tool.js +0 -1
- package/dist/src/self-modification/migration.d.ts +0 -9
- package/dist/src/self-modification/migration.js +0 -28
- package/dist/src/shared/history-view.d.ts +0 -22
- package/dist/src/shared/history-view.js +0 -1
- package/dist/src/shared/package-version.d.ts +0 -2
- package/dist/src/shared/package-version.js +0 -1
- package/dist/src/tools/durable-callbacks.d.ts +0 -118
- package/dist/src/tools/durable-callbacks.js +0 -1
- package/dist/src/tools/durable-schema.d.ts +0 -16
- package/dist/src/tools/durable-schema.js +0 -1
- /package/dist/src/{client/eve-agent-store-state.js → ai/decision-types.js} +0 -0
- /package/dist/src/client/{message-reducer-types.js → agent-info-types.js} +0 -0
- /package/dist/src/client/{reducer.js → health-types.js} +0 -0
- /package/dist/src/{shared → protocol/session-projection}/display-name.d.ts +0 -0
- /package/dist/src/{shared → protocol/session-projection}/display-name.js +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SessionStepState } from "#execution/publish-session-events.js";
|
|
2
|
+
import { type ControlSettlement } from "#harness/facts.js";
|
|
3
|
+
/** Records a control that finishes without a step of its own, at an owner's committed boundary. */
|
|
4
|
+
export declare function settleControlDeliveryStep(input: SessionStepState & {
|
|
5
|
+
readonly settlement: ControlSettlement;
|
|
6
|
+
}): Promise<Omit<import("#execution/publish-session-events.js").PublishedSessionEvents & {
|
|
7
|
+
readonly cancelled: boolean;
|
|
8
|
+
}, keyof import("./state-delta.ts").SessionStateValues> & import("./state-delta.ts").SessionStateTransition>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{publishSessionEvents}from"#execution/publish-session-events.js";import{withSessionStateDelta}from"#execution/session/step-state-delta.js";import{controlSettled}from"#harness/facts.js";async function settleControlDeliveryStep(e){"use step";return await withSessionStateDelta(e,t=>publishSessionEvents(t,controlSettled(e.settlement)))}export{settleControlDeliveryStep};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DeliverHookPayload } from "#channel/types.js";
|
|
2
|
+
import { type SessionStepState } from "#execution/publish-session-events.js";
|
|
3
|
+
/** A duplicate starts no work, but its distinct receipt must still settle. */
|
|
4
|
+
export declare function settleDuplicateDeliveryStep(input: SessionStepState & {
|
|
5
|
+
readonly delivery: DeliverHookPayload;
|
|
6
|
+
}): Promise<Omit<import("#execution/publish-session-events.js").PublishedSessionEvents & {
|
|
7
|
+
readonly cancelled: boolean;
|
|
8
|
+
}, keyof import("./state-delta.ts").SessionStateValues> & import("./state-delta.ts").SessionStateTransition>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{storedProjection}from"#harness/session-machine/view.js";import{readDurableSession}from"#execution/durable-session-store.js";import{publishSessionEvents}from"#execution/publish-session-events.js";import{withSessionStateDelta}from"#execution/session/step-state-delta.js";import{admitDeliveries}from"#execution/session/delivery-facts.js";async function settleDuplicateDeliveryStep(e){"use step";return await withSessionStateDelta(e,t=>{let n=storedProjection(readDurableSession(t.sessionState).state).view,{facts:r}=admitDeliveries({channelKind:`http`,delivery:e.delivery,payloads:e.delivery.payloads.flatMap((t,r)=>{let i=e.delivery.deliveryMetadata?.find(e=>e.payloadIndex===r);return i!==void 0&&n.deliveries[i.deliveryId]!==void 0?[]:[{payload:t,input:void 0}]})});return publishSessionEvents(t,r.map(e=>e.type===`delivery.settled`?{...e,data:{...e.data,reason:`duplicate idempotency key`}}:e))})}export{settleDuplicateDeliveryStep};
|
|
@@ -24,17 +24,7 @@ export interface SessionStateTransition {
|
|
|
24
24
|
/** `T` with its session values replaced by the delta that produces them. */
|
|
25
25
|
export type WithSessionStateDelta<T> = T extends unknown ? Omit<T, keyof SessionStateValues> & SessionStateTransition : never;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Workflow replay reads every step's output but no step's input, so a step
|
|
31
|
-
* that returns only what changed keeps both replay and storage from carrying
|
|
32
|
-
* the whole session once per step. The workflow body applies the delta to the
|
|
33
|
-
* values it passed in; see {@link applySessionStateDelta}.
|
|
34
|
-
*
|
|
35
|
-
* The input is snapshotted before `work` runs because step code may edit it
|
|
36
|
-
* in place, as a channel adapter does with its state.
|
|
27
|
+
* Applies a step's delta to the values that step was given. The workflow body runs this; steps
|
|
28
|
+
* produce the delta with `withSessionStateDelta` (`step-state-delta.ts`).
|
|
37
29
|
*/
|
|
38
|
-
export declare function withSessionStateDelta<I extends Partial<SessionStateValues>, R extends Partial<SessionStateValues>>(input: I, work: (input: I) => Promise<R>): Promise<WithSessionStateDelta<R>>;
|
|
39
|
-
/** Applies a step's delta to the values that step was given. */
|
|
40
30
|
export declare function applySessionStateDelta(values: SessionStateValues, delta: SessionStateDelta): SessionStateValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyValueDelta
|
|
1
|
+
import{applyValueDelta}from"#shared/value-delta.js";function applySessionStateDelta(e,t){return{serializedContext:applyValueDelta(e.serializedContext,t.serializedContext),sessionState:applyValueDelta(e.sessionState,t.sessionState),history:applyValueDelta(e.history,t.history)}}export{applySessionStateDelta};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DurableStepResult } from "#execution/session/turn-step-types.js";
|
|
2
|
+
import type { SessionView } from "#protocol/session-projection/tables.js";
|
|
3
|
+
/**
|
|
4
|
+
* How a turn step's decision disagrees with what the tables say the turn waits on, if it does. A
|
|
5
|
+
* step that pauses on calls only requested, which the next durable step dispatches or, for task
|
|
6
|
+
* tool calls, answers, is the one known disagreement, `dispatch-deferred`: the tables say the
|
|
7
|
+
* session has work, and it does.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stepDisagreement(result: DurableStepResult, view: SessionView): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{activeTurn,waiting}from"#protocol/session-projection/selectors.js";function stepDisagreement(e,t){if(e.action===`done`||e.action===`cancelled`)return;let n=activeTurn(t)?.turnId,r=n===void 0?`no-turn`:waiting(t,n)?.on??`session`,i=e.action===`paused`?e.on===`interaction`?`interaction`:`work`:e.action;if(!(i===`interaction`&&r===`interaction`||i===`work`&&r===`work`||i===`continue`&&r===`session`||i===`parked`&&(r===`no-turn`||r===`interaction`)))return e.action===`paused`&&e.on===`calls`&&(e.dispatch||e.taskToolCalls.length>0)&&r===`session`?`dispatch-deferred`:`${i}-but-${r}`}export{stepDisagreement};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SessionStateValues, WithSessionStateDelta } from "#execution/session/state-delta.js";
|
|
2
|
+
/**
|
|
3
|
+
* Runs a session step's work and returns its result with the session values
|
|
4
|
+
* it produced replaced by their delta from the values the step was given.
|
|
5
|
+
*
|
|
6
|
+
* Workflow replay reads every step's output but no step's input, so a step
|
|
7
|
+
* that returns only what changed keeps both replay and storage from carrying
|
|
8
|
+
* the whole session once per step. The workflow body applies the delta to the
|
|
9
|
+
* values it passed in; see `applySessionStateDelta`.
|
|
10
|
+
*
|
|
11
|
+
* The input is snapshotted before `work` runs because step code may edit it
|
|
12
|
+
* in place, as a channel adapter does with its state. A retried step's state
|
|
13
|
+
* follows every line its interrupted attempt wrote; see
|
|
14
|
+
* {@link followInterruptedAttempt}.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withSessionStateDelta<I extends Partial<SessionStateValues>, R extends Partial<SessionStateValues>>(input: I, work: (input: I) => Promise<R>): Promise<WithSessionStateDelta<R>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{storedProjection}from"#harness/session-machine/view.js";import{readDurableSession}from"#execution/durable-session-store.js";import{followInterruptedAttempt,readOrphanedLines}from"#execution/publish-session-events.js";import{diffValue,snapshotValue}from"#shared/value-delta.js";const SESSION_VALUE_KEYS=[`serializedContext`,`sessionState`,`history`];async function withSessionStateDelta(e,t){let n=Object.fromEntries(SESSION_VALUE_KEYS.map(t=>[t,snapshotValue(e[t])])),{sessionWritable:r}=e;if(r!==void 0&&n.sessionState!==void 0){let e=n.sessionState,t=readDurableSession(e);await readOrphanedLines({sessionId:e.sessionId,position:storedProjection(t.state).view.position,sessionWritable:r})}let{serializedContext:i,sessionState:a,history:o,...s}=await t(e),c=a??n.sessionState,l={serializedContext:i,sessionState:c===void 0||r===void 0?a:followInterruptedAttempt(r,c),history:o},u={};for(let e of SESSION_VALUE_KEYS){let t=l[e]===void 0?void 0:diffValue(n[e],l[e]);t!==void 0&&(u[e]=t)}return{...s,stateDelta:u}}export{withSessionStateDelta};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { type SessionStepState } from "#execution/publish-session-events.js";
|
|
2
|
-
import { type ExecutionInstrumentation } from "#instrumentation/runtime.js";
|
|
3
1
|
/** The step output preserves the start time when the workflow resumes in another worker. */
|
|
4
2
|
export declare function startTaskToolCallsStep(): Promise<number>;
|
|
5
|
-
export declare function traceTaskToolCallStep(target: SessionStepState, call: Parameters<ExecutionInstrumentation["instrumentTaskToolCall"]>[0]): Promise<Omit<import("#execution/publish-session-events.js").PublishedSessionEvents, keyof import("#execution/session/state-delta.js").SessionStateValues> & import("#execution/session/state-delta.js").SessionStateTransition>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
async function startTaskToolCallsStep(){"use step";return Date.now()}export{startTaskToolCallsStep};
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { bindDynamicConnections } from "#execution/dynamic-connections.js";
|
|
3
|
-
import type { resolveEffectiveAgentRuntime } from "#execution/effective-agent-config.js";
|
|
1
|
+
import type { ModelMessage } from "ai";
|
|
4
2
|
import type { SessionEventPublisher } from "#execution/publish-session-events.js";
|
|
5
3
|
import type { HandleEventFn } from "#harness/types.js";
|
|
6
|
-
import type { ExecutionInstrumentation } from "#instrumentation/runtime.js";
|
|
7
|
-
import type { CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";
|
|
8
|
-
/** True when a hook on this event type may cancel the running turn. */
|
|
9
|
-
export declare function isHookCancellableEvent(type: string): boolean;
|
|
10
4
|
/**
|
|
11
|
-
* Publishes one turn event, then runs
|
|
12
|
-
* A hook's `
|
|
13
|
-
*
|
|
5
|
+
* Publishes one turn event or commit, then runs the session's reactions with the conversation as
|
|
6
|
+
* of the commit. A hook's `cancel()` aborts the turn signal; the commit's remaining reactions still
|
|
7
|
+
* run, then the turn stops before its next model call.
|
|
14
8
|
*/
|
|
15
9
|
export declare function createTurnEventHandler(input: {
|
|
16
10
|
readonly abortSignal: AbortSignal;
|
|
17
|
-
readonly bundle: CompiledBundle;
|
|
18
11
|
/** False for clear and compact requests, which run outside any turn. */
|
|
19
12
|
readonly canCancelTurn: boolean;
|
|
13
|
+
/** The conversation the step starts from, until a commit hands a newer one. */
|
|
14
|
+
readonly conversation: readonly ModelMessage[];
|
|
20
15
|
readonly hookCancellation: AbortController;
|
|
21
|
-
readonly ctx: ContextContainer;
|
|
22
|
-
readonly dynamicConnections: ReturnType<typeof bindDynamicConnections>;
|
|
23
|
-
readonly effectiveAgent: ReturnType<typeof resolveEffectiveAgentRuntime>;
|
|
24
|
-
readonly effectiveNode: CompiledBundle["graph"]["root"];
|
|
25
|
-
readonly instrumentation: ExecutionInstrumentation | undefined;
|
|
26
16
|
readonly publisher: SessionEventPublisher;
|
|
27
17
|
}): HandleEventFn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{TurnCancelledError,throwIfTurnAborted}from"#harness/turn-cancellation.js";function createTurnEventHandler(e){let{publisher:t}=e,n=e.conversation;return async(r,i)=>{i!==void 0&&(n=i);let a=await t.emit(r),o=a.some(({event:e})=>e.type===`turn.settled`||e.type===`session.ended`),s=e.canCancelTurn&&!o?({reason:t})=>e.hookCancellation.abort(new TurnCancelledError(t)):void 0;await t.dispatcher.react(a,{abortSignal:e.abortSignal,conversation:n,cancelTurn:s,cancelBeforeTurn:s}),throwIfTurnAborted(e.hookCancellation.signal)}}export{createTurnEventHandler};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import type { DurableStepResult } from "#execution/session/turn-step-types.js";
|
|
2
|
-
import type { StepResult } from "#harness/types.js";
|
|
1
|
+
import type { DurableStepResult, DurableStepResultFields } from "#execution/session/turn-step-types.js";
|
|
2
|
+
import type { HarnessSession, SettledTurn, StepResult } from "#harness/types.js";
|
|
3
3
|
export declare function resolveSessionStepResult(stepResult: StepResult, nextSerializedContext: Record<string, unknown>): DurableStepResult;
|
|
4
|
+
/**
|
|
5
|
+
* The turn pauses on the calls the runtime runs for it, or, with none, parks the session.
|
|
6
|
+
* `settled` is a settled turn's answer to its delegated caller.
|
|
7
|
+
*/
|
|
8
|
+
export declare function pausedOrParked(session: HarnessSession, fields: DurableStepResultFields, settled?: SettledTurn): DurableStepResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{storedProjection}from"#harness/session-machine/view.js";import{
|
|
1
|
+
import{storedProjection}from"#harness/session-machine/view.js";import{createDurableSessionValues}from"#execution/durable-session-store.js";import{sessionUsage,takeSessionUsageDelta}from"#harness/session-usage.js";import{pausedOnCalls,pausedOnInteraction,pausedOnTasks}from"#execution/session/pending-turn-state.js";function resolveSessionStepResult(e,t){let n={serializedContext:t,...createDurableSessionValues(e.session)};if(e.steered)return{action:`continue`,...n};if(e.next!==null&&typeof e.next==`object`&&`done`in e.next)return{action:`done`,output:e.next.output,isError:e.next.isError,...n,usage:sessionUsage(e.session),usageDelta:takeSessionUsageDelta(e.session).delta};if(e.held?.kind===`tasks`)return{action:`paused`,...pausedOnTasks(e.held.taskIds),...n};if(e.held?.kind===`request`){let t=storedProjection(e.session.state);return{action:`paused`,...pausedOnInteraction(e.session,t),...n}}if(e.next!==null)return{action:`continue`,...n};let r=e.settledTurn===void 0?void 0:takeSessionUsageDelta(e.session),i=r===void 0?n:{serializedContext:t,...createDurableSessionValues(r.session)};return pausedOrParked(e.session,i,e.settledTurn===void 0?void 0:{output:e.settledTurn.output,isError:e.settledTurn.isError,usage:r?.delta})}function pausedOrParked(e,t,n){let r=pausedOnCalls(e);return r===void 0?{action:`parked`,...n!==void 0&&{settled:n},...t}:{action:`paused`,...r,...t}}export{pausedOrParked,resolveSessionStepResult};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ControlDelivery } from "#harness/types.js";
|
|
1
2
|
import type { DeliverHookPayload, TurnCaller } from "#channel/types.js";
|
|
2
3
|
import type { DurableSessionState } from "#execution/durable-session-store.js";
|
|
3
4
|
import type { WithSessionStateDelta } from "#execution/session/state-delta.js";
|
|
4
|
-
import type {
|
|
5
|
+
import type { TurnPause } from "#execution/session/pending-turn-state.js";
|
|
5
6
|
import type { HarnessModelMessage } from "#harness/messages.js";
|
|
6
7
|
import type { SettledTurn } from "#harness/types.js";
|
|
7
8
|
import type { RuntimeActionResult } from "#shared/action-types.js";
|
|
@@ -10,8 +11,8 @@ import type { SessionHandoverObservation } from "#execution/session-inbox/inbox.
|
|
|
10
11
|
/** Trusted runtime-action results collected by the session owner. */
|
|
11
12
|
export interface RuntimeActionResultStepInput {
|
|
12
13
|
readonly acceptedAtMsByCallId?: Readonly<Record<string, number>>;
|
|
13
|
-
/** What the `ctx.agent` sessions of the `execute` runs behind these results spent. */
|
|
14
|
-
readonly delegatedUsage?:
|
|
14
|
+
/** What the `ctx.agent` sessions of the `execute` runs behind these results spent, by call. */
|
|
15
|
+
readonly delegatedUsage?: Readonly<Record<string, TokenUsage>>;
|
|
15
16
|
readonly results: readonly RuntimeActionResult[];
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
@@ -21,6 +22,8 @@ export interface RuntimeActionResultStepInput {
|
|
|
21
22
|
*/
|
|
22
23
|
export interface TurnStepPayload {
|
|
23
24
|
readonly control?: "clear" | "compact";
|
|
25
|
+
/** The delivery the control arrived as. */
|
|
26
|
+
readonly controlDelivery?: ControlDelivery;
|
|
24
27
|
readonly delivery?: DeliverHookPayload;
|
|
25
28
|
readonly runtimeResults?: RuntimeActionResultStepInput;
|
|
26
29
|
}
|
|
@@ -36,46 +39,44 @@ export interface TurnStepInput {
|
|
|
36
39
|
readonly serializedContext: Record<string, unknown>;
|
|
37
40
|
readonly sessionState: DurableSessionState;
|
|
38
41
|
readonly history: HarnessModelMessage[];
|
|
42
|
+
/**
|
|
43
|
+
* Every attempt of this step failed, the last with `error`: recover what they published and
|
|
44
|
+
* fail the turn with that error.
|
|
45
|
+
*/
|
|
46
|
+
readonly recover?: {
|
|
47
|
+
readonly error: unknown;
|
|
48
|
+
};
|
|
39
49
|
}
|
|
40
|
-
|
|
50
|
+
/** The session state every step result carries. */
|
|
51
|
+
export interface DurableStepResultFields {
|
|
41
52
|
readonly serializedContext: Record<string, unknown>;
|
|
42
53
|
readonly sessionState: DurableSessionState;
|
|
43
54
|
readonly history: HarnessModelMessage[];
|
|
44
55
|
}
|
|
45
56
|
/** What one turn step's work produces, with the session state it leaves. */
|
|
46
|
-
export type DurableStepResult =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
readonly
|
|
50
|
-
readonly usage?: TokenUsage;
|
|
51
|
-
readonly usageDelta?: TokenUsage;
|
|
52
|
-
} | {
|
|
53
|
-
readonly action: "cancelled" | "steered";
|
|
57
|
+
export type DurableStepResult =
|
|
58
|
+
/** The turn goes on with its next step. */
|
|
59
|
+
({
|
|
60
|
+
readonly action: "continue";
|
|
54
61
|
}
|
|
55
|
-
/** The
|
|
62
|
+
/** The turn waits on what it paused on, then goes on. */
|
|
63
|
+
| ({
|
|
64
|
+
readonly action: "paused";
|
|
65
|
+
} & TurnPause)
|
|
66
|
+
/** The turn ended and the session parks. `settled` is its answer to a delegated caller. */
|
|
56
67
|
| {
|
|
57
|
-
readonly action: "
|
|
58
|
-
readonly
|
|
59
|
-
readonly taskIds: readonly string[];
|
|
68
|
+
readonly action: "parked";
|
|
69
|
+
readonly settled?: SettledTurn;
|
|
60
70
|
}
|
|
61
|
-
/** The
|
|
71
|
+
/** The session ended. */
|
|
62
72
|
| {
|
|
63
|
-
readonly action: "
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
66
|
-
readonly
|
|
67
|
-
|
|
68
|
-
readonly inputRequestIds: readonly string[];
|
|
73
|
+
readonly action: "done";
|
|
74
|
+
readonly output?: unknown;
|
|
75
|
+
readonly isError?: boolean;
|
|
76
|
+
readonly usage?: TokenUsage;
|
|
77
|
+
readonly usageDelta?: TokenUsage;
|
|
69
78
|
} | {
|
|
70
|
-
readonly action: "
|
|
71
|
-
/**
|
|
72
|
-
* `false` when every pending call is a task tool call the session answers
|
|
73
|
-
* itself, so the dispatch step can be skipped. Absent, the step runs.
|
|
74
|
-
*/
|
|
75
|
-
readonly hasRunsToDispatch?: boolean;
|
|
76
|
-
readonly pendingCoordinationCallIds?: readonly string[];
|
|
77
|
-
readonly pendingTaskToolCalls?: readonly TaskToolCall[];
|
|
78
|
-
readonly settled?: SettledTurn;
|
|
79
|
+
readonly action: "cancelled";
|
|
79
80
|
}) & DurableStepResultFields & {
|
|
80
81
|
/** The step compacted the history. */
|
|
81
82
|
readonly compacted?: true;
|
|
@@ -99,7 +100,8 @@ export type TurnOutcome = {
|
|
|
99
100
|
readonly usageDelta?: TokenUsage;
|
|
100
101
|
} | {
|
|
101
102
|
readonly cancelled?: true;
|
|
103
|
+
/** The cancel control that stopped the turn, when it named its delivery. */
|
|
104
|
+
readonly cancelledBy?: ControlDelivery;
|
|
102
105
|
readonly kind: "park";
|
|
103
106
|
readonly settled?: SettledTurn;
|
|
104
107
|
});
|
|
105
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{defaultDeliverResult}from"#channel/adapter.js";import{contextStorage}from"#context/container.js";import{currentProjection,enterSessionProjection,recordAppliedSession,saveSessionProjection}from"#harness/session-machine/current.js";import{AuthKey,CapabilitiesKey,ChannelDeliveryKey,HandleEventKey,InitiatorAuthKey,OccurrenceIdKey,ParentSessionKey,ScheduleIdKey,ScheduleInstanceKey,SessionDynamicSubagentRuntimeRevisionKey,SessionDynamicToolRuntimeRevisionKey,SessionTitleKey,StaticModelReferenceKey,TurnDeliveryIdsKey}from"#context/keys.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{coalesceTurnInputs,validateHarnessModelMessages}from"#harness/messages.js";import{activeTurnId,isBetweenTurns,storedProjection,turnPosition}from"#harness/session-machine/view.js";import{createWorkflowRuntime}from"#execution/workflow-runtime.js";import{resolveWorkflowCallbackBaseUrl}from"#execution/workflow-callback-url.js";import{createDurableSessionValues,readDurableSession}from"#execution/durable-session-store.js";import{runStep}from"#context/run-step.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{readHitlState}from"#harness/hitl/index.js";import*as agentTraceState from"#tracing/eve/agent-trace-context-store.js";import{CallbackBaseUrlKey,PendingAuthorizationResultKey}from"#harness/authorization.js";import{refreshDynamicSessionSubagentsForRuntimeRevision}from"#context/dynamic-subagent-lifecycle.js";import{hydrateDurableSession,refreshSessionFromTurnAgent}from"#execution/session.js";import{resolveEffectiveAgentRuntime,resolveSessionUsageLimit}from"#execution/effective-agent-config.js";import{openSessionEventPublisher}from"#execution/publish-session-events.js";import{withSessionStateDelta}from"#execution/session/state-delta.js";import{matchSignIns}from"#harness/session-machine/transitions.js";import{readPendingHistory,withoutPendingHistory}from"#execution/session/pending-history.js";import{dropClosedRecords,saveTransition,sessionView}from"#harness/session-machine/commit.js";import{sessionStartedForResolvers,turnStartedForResolvers}from"#harness/session-machine/resolver-events.js";import{derivePendingState}from"#execution/session/pending-turn-state.js";import{rebindMissingCompiledDynamicToolCallbacks,refreshDynamicSessionToolsForRuntimeRevision}from"#context/dynamic-tool-lifecycle.js";import{hasDelegatedSessionContext}from"#execution/delegated-session-context.js";import{setChannelContext}from"#execution/channel-context.js";import{reconcileSessionContinuationToken}from"#execution/reconcile-session-continuation-token.js";import{createTurnEventHandler}from"#execution/session/turn-event-handler.js";import{isTurnCancellation,throwIfTurnAborted}from"#harness/turn-cancellation.js";import{bindSessionInstrumentation}from"#instrumentation/runtime.js";import{deriveSessionTitle}from"#execution/eve-workflow-attributes.js";import{bindTurnCallerContext}from"#subagents/parent-notification.js";import{traceSessionHandover}from"#execution/session/handover-tracing.js";import{startSessionPrewarmers}from"#context/prewarm.js";import{bindDynamicConnections}from"#execution/dynamic-connections.js";import{recoverDynamicConnectionRehydration}from"#execution/dynamic-connection-recovery.js";import{setEveAttributes}from"#runtime/attributes/emit.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{matchAuthorizationCallbacks}from"#execution/authorization-callback-match.js";import{attributeAnswers}from"#execution/session/answer-caller.js";import{resolveSessionStepResult}from"#execution/session/turn-step-result.js";import{countRunUsage}from"#execution/agent-sessions/usage.js";import{buildRuntimeIdentity,createExecutionNodeStep}from"#execution/node-step.js";import{createExecutionHistoryView}from"#execution/history-view.js";import{runModelCallBatch}from"#execution/model-call-batching.js";import{createCancelledModelCallBatchResult}from"#execution/cancelled-model-call-batch.js";function channelDeliveryErrorCode(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`&&t.length>0)return t}return`CHANNEL_DELIVERY_FAILED`}async function turnStep(e){"use step";return e.handover!==void 0&&traceSessionHandover(`inbox_unblocked`,e.sessionState.sessionId,e.handover.attemptKey,{"eve.handoff.buffered_payload_count":e.handover.payloadCount,"eve.handoff.applied_at_ms":e.handover.appliedAtMs,"eve.handoff.applied_at_clock":`workflow`}),await withSessionStateDelta(e,e=>runSessionStep({...e,serializedContext:bindTurnCallerContext(e.caller,e.serializedContext)}))}async function runSessionStep(e){let t={};try{return await runSessionStepBody(e,t)}finally{await t.title}}async function runSessionStepBody(e,t){let n=e.input?.delivery,r=n,i=e.input?.runtimeResults,a=readDurableSession(e.sessionState);for(let e of i?.delegatedUsage??[])a=countRunUsage(a,e);let o=await deserializeContext(e.serializedContext);enterSessionProjection(o,a.state);let s=o.require(ChannelKey),c=o.require(BundleKey),l=resolveEffectiveAgentRuntime(c,o);try{let{getWorkflowMetadata:e}=await import(`#compiled/@workflow/core/index.js`),t=e();typeof t.url==`string`&&o.set(CallbackBaseUrlKey,resolveWorkflowCallbackBaseUrl(t.url))}catch{}let{signIns:u}=readHitlState(a.state),d;if(u.length>0&&r!==void 0){let{matches:e,remainingPayloads:t}=matchAuthorizationCallbacks(u,r.payloads);if(r={...r,payloads:t},e.length>0){let n=e.map(e=>e.result.attemptId),i=e.map(e=>e.result);o.set(PendingAuthorizationResultKey,i);let s=sessionView(storedProjection(a.state),a.state),c=matchSignIns(s,{attemptIds:n});if(c.events.length!==0)throw Error(`matchSignIns must not emit events.`);a=saveTransition(a,c),d=e,t.length===0&&(r=void 0)}}r?.payloads.some(e=>e.message!==void 0)&&(o.delete(ScheduleIdKey),o.delete(ScheduleInstanceKey),o.delete(OccurrenceIdKey),r.schedule!==void 0&&(o.set(ScheduleIdKey,r.schedule.definition),r.schedule.instance!==void 0&&o.set(ScheduleInstanceKey,r.schedule.instance),r.schedule.occurrenceId!==void 0&&o.set(OccurrenceIdKey,r.schedule.occurrenceId)));let f=o.get(AuthKey),p=o.has(InitiatorAuthKey);r?.auth!==void 0&&(o.set(AuthKey,r.auth??null),o.has(InitiatorAuthKey)||o.set(InitiatorAuthKey,r.auth??null));let m=r===void 0?d?.find(({challenge:e})=>e.candidateId===void 0)?.challenge.requester:void 0;m!==void 0&&o.set(AuthKey,m);let h=r?.payloads.some(e=>e.message!==void 0)===!0?readPendingHistory(a.state):[],g={...hydrateDurableSession({compactionOverrides:{thresholdPercent:l.thresholdPercent},durable:a,turnAgent:l.turnAgent}),history:validateHarnessModelMessages(e.history)},_=createExecutionHistoryView(g),v=bindSessionInstrumentation({agentName:l.turnAgent.id,ctx:o,rootSessionId:g.rootSessionId??g.sessionId,sessionId:g.sessionId}),y=turnPosition(currentProjection(o)),b=isBetweenTurns(currentProjection(o));if(!y.sessionStarted&&!o.has(SessionTitleKey)&&!o.has(ParentSessionKey)){let e=n?.payloads.find(e=>e.message!==void 0)?.message,r=deriveSessionTitle(n?.title??e);r!==void 0&&(o.set(SessionTitleKey,r),t.title=setEveAttributes({"$eve.title":r}))}n!==void 0&&(await contextStorage.run(o,()=>v?.preparePreamble({sequence:y.sequence,sessionStarted:y.sessionStarted})),await contextStorage.run(o,()=>v?.instrumentChannelDelivery({agentName:c.turnAgent.id,ctx:o,delivery:n,rootSessionId:g.rootSessionId??g.sessionId,sequence:y.sequence,sessionId:g.sessionId,turnId:activeTurnId(y)})));let failChannelDeliveries=async e=>{await contextStorage.run(o,()=>v?.instrumentChannelDelivery({ctx:o,error:e,errorCode:channelDeliveryErrorCode(e),includeTurn:!1,outcome:`failed`})),await v?.flush()},x=openSessionEventPublisher({ctx:o,origin:`own`,sessionWritable:e.sessionWritable}),{adapterCtx:S}=x.dispatcher,C=new AbortController,w=e.abortSignal===void 0?C.signal:AbortSignal.any([e.abortSignal,C.signal]);try{let u=bindDynamicConnections(o,c.resolvedAgent),m={...c.graph.root,turnAgent:l.turnAgent},T=resolveSessionUsageLimit(c),E=!1,D=createTurnEventHandler({abortSignal:w,bundle:c,canCancelTurn:e.input?.control===void 0,hookCancellation:C,ctx:o,dynamicConnections:u,effectiveAgent:l,effectiveNode:m,instrumentation:v,publisher:x}),handleEvent=async(e,t)=>{e.type===`compaction.completed`&&(E=!0),await D(e,t)},O=r!==void 0&&!b?structuredClone(S.state):void 0,k;if(r!==void 0){let e=[];try{for(let t of r.payloads){let n=s.deliver?await s.deliver(t,S):defaultDeliverResult(t);if(n!=null){let r=[...e.length===0?h:[],...t.history??[]];e.push(r.length===0?n:{...n,history:r})}}}catch(e){throw await failChannelDeliveries(e),e}e.length>0&&h.length>0&&(g={...g,state:withoutPendingHistory(g.state)}),k=e.length===0?void 0:e.reduce(coalesceTurnInputs)}let A=r?.auth===void 0?void 0:attributeAnswers({responder:r.auth,state:a.state,stepInput:k});if(A!==void 0&&(k=A,f===void 0?o.delete(AuthKey):o.set(AuthKey,f),p||o.delete(InitiatorAuthKey)),r!==void 0&&k===void 0&&!b)f===void 0?o.delete(AuthKey):o.set(AuthKey,f),S.state=O;else if(n?.payloads.some(e=>e.message!==void 0)){let e=n.deliveryMetadata?.map(e=>e.deliveryId)??[];o.set(TurnDeliveryIdsKey,y.turnId?[...new Set([...o.get(TurnDeliveryIdsKey)??[],...e])]:e)}else!y.sessionStarted&&o.get(ChannelDeliveryKey)!==void 0&&o.set(TurnDeliveryIdsKey,[o.require(ChannelDeliveryKey).deliveryId]);if(i!==void 0&&(i.acceptedAtMsByCallId!==void 0&&o.set(RuntimeActionSettlementTimesKey,i.acceptedAtMsByCallId),k={...k,runtimeActionResults:i.results}),n!==void 0){let e={...s,state:{...S.state}};setChannelContext(o,e)}if(r!==void 0&&k===void 0&&b){await contextStorage.run(o,()=>v?.instrumentChannelDelivery({ctx:o,includeTurn:!1,outcome:`completed`})),await v?.flush();let t=saveSessionProjection(reconcileSessionContinuationToken(o,g),o),n=serializeContext(o),r=t===g?{history:e.history,sessionState:e.sessionState}:createDurableSessionValues(t);return{action:`park`,...derivePendingState(t,currentProjection(o)),serializedContext:n,...r}}let j=c.subagentRegistry.dynamicResolvers??[],M=c.resolvedAgent.dynamicToolResolvers??[],N=buildRuntimeIdentity(m);try{let e=process.env.VERCEL_DEPLOYMENT_ID?.trim(),t=e?`deployment:${e}`:await resolveRuntimeCompiledArtifactsVersionedCacheKey(c.compiledArtifactsSource),n=y.sessionStarted;if(o.setVirtualContext(StaticModelReferenceKey,l.turnAgent.model??null),!n)o.set(SessionDynamicSubagentRuntimeRevisionKey,t),o.set(SessionDynamicToolRuntimeRevisionKey,t);else{let e=sessionStartedForResolvers(N);await Promise.all([refreshDynamicSessionSubagentsForRuntimeRevision({ctx:o,resolvers:j,event:e,messages:_.initial.messages,runtimeRevision:t}),contextStorage.run(o,async()=>await refreshDynamicSessionToolsForRuntimeRevision({ctx:o,resolvers:M,event:e,messages:_.initial.messages,runtimeRevision:t}))]),b||await rebindMissingCompiledDynamicToolCallbacks({ctx:o,event:turnStartedForResolvers({sequence:y.sequence,turnId:activeTurnId(y)}),messages:_.initial.messages,resolvers:M})}}catch(e){throw await failChannelDeliveries(e),e}let P=c.resolvedAgent.config?.experimental?.workflow?.modelCallsPerStep??1,F=o.get(CapabilitiesKey),runHarnessStep=async(n,r,i)=>{let a=refreshSessionFromTurnAgent({compactionOverrides:{thresholdPercent:l.thresholdPercent},session:n,turnAgent:l.turnAgent});return createExecutionNodeStep({steeringSignal:e.steeringSignal,abortSignal:w,capabilities:F,clearOnly:e.input?.control===`clear`,compactOnly:e.input?.control===`compact`,createRuntime:createWorkflowRuntime,handleEvent,prepareApprovalTurn:e=>u.dispatch(turnStartedForResolvers(e)),signInCompletions:i,typedAnswers:!hasDelegatedSessionContext(e.serializedContext),historyProjector:_.projector,historyView:_.prepare(a),instrumentation:v,modelResolutionScope:{moduleMap:c.moduleMap,nodeId:c.nodeId},node:m,sessionUsageLimit:T,titleAttributeWrite:t.title})(a,r)},I,L;try{throwIfTurnAborted(w),L=await runModelCallBatch({steeringSignal:e.steeringSignal,initialInput:k,initialSession:g,modelCallsPerStep:P,runStep:async({firstCall:t,session:n,stepInput:r})=>{let i=await runStep(o,n,async n=>{t&&e.input?.control===void 0&&startSessionPrewarmers(o,`turn`),o.setVirtualContext(HandleEventKey,handleEvent),o.setVirtualContext(StaticModelReferenceKey,l.turnAgent.model??null);let i=t&&k?.outputSchema!==void 0?{...n,outputSchema:k.outputSchema}:n,a=turnPosition(currentProjection(o));try{await u.rehydrate(a,N,isBetweenTurns(currentProjection(o))?void 0:{sequence:a.sequence,turnId:activeTurnId(a)})}catch(e){let t=await recoverDynamicConnectionRehydration({emit:handleEvent,error:e,projection:currentProjection(o),session:i});if(t!==void 0)return t;throw e}let s=t&&d!==void 0?d.map(({challenge:e})=>e):void 0;return runHarnessStep(i,r,s)});i.settledTurn===void 0&&throwIfTurnAborted(w);let a={...i,session:saveSessionProjection(i.session,o)};return recordAppliedSession(o,a.session),I={result:a,serializedContext:serializeContext(o)},a}})}catch(t){if(!isTurnCancellation(t)&&!w.aborted)throw await failChannelDeliveries(t),t;return createCancelledModelCallBatchResult({beforeBatchContext:e.serializedContext,checkpoint:I,ctx:o,initialSession:g,stepInput:k})}let R=saveSessionProjection(dropClosedRecords(reconcileSessionContinuationToken(o,L.session),currentProjection(o)),o);agentTraceState.pruneAgentTraceState(o,R.sessionId,R.state);let z=serializeContext(o);L={...L,session:R};let B=resolveSessionStepResult(L,z);return B.action===`done`&&await x.writer.close(),E?{...B,compacted:!0}:B}finally{x.writer.release()}}export{turnStep};
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{defaultDeliverResult,getAdapterKind}from"#channel/adapter.js";import{contextStorage}from"#context/container.js";import{AuthKey,CapabilitiesKey,ChannelDeliveryKey,ChannelInstrumentationKey,HandleEventKey,InitiatorAuthKey,OccurrenceIdKey,ParentSessionKey,SandboxKey,ScheduleIdKey,ScheduleInstanceKey,SessionKey,SessionPredecessorKey,SessionTitleKey,StaticModelReferenceKey,TurnDeliveryIdsKey}from"#context/keys.js";import{bindMemoryInstrumentation}from"#reactions/kinds/memory.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{sandboxProvider}from"#context/providers/sandbox.js";import{isBetweenTurns,storedProjection,turnPosition}from"#harness/session-machine/view.js";import{currentProjection,enterSessionProjection,enterSessionProjectionAt,nextLinePosition,recordAppliedSession,saveSessionProjection}from"#harness/session-machine/current.js";import{ConnectionRegistryKey,connectionProvider}from"#context/providers/connection.js";import{sessionProvider}from"#context/providers/session.js";import{createWorkflowRuntime}from"#execution/workflow-runtime.js";import{resolveWorkflowCallbackBaseUrl}from"#execution/workflow-callback-url.js";import{runStep,withContextScope}from"#context/run-step.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{createDurableSessionValues,readDurableSession}from"#execution/durable-session-store.js";import{readHitlState}from"#harness/hitl/index.js";import*as agentTraceState from"#tracing/eve/agent-trace-context-store.js";import{coalesceTurnInputs,validateHarnessModelMessages}from"#harness/messages.js";import{CallbackBaseUrlKey,PendingAuthorizationResultKey}from"#harness/authorization.js";import{hydrateDurableSession,refreshSessionFromTurnAgent}from"#execution/session.js";import{resolveEffectiveAgentRuntime,resolveSessionUsageLimit}from"#execution/effective-agent-config.js";import{checksSessionEvents,foldOrphanedLines,openSessionEventPublisher,readOrphanedLines}from"#execution/publish-session-events.js";import{withSessionStateDelta}from"#execution/session/step-state-delta.js";import{dropClosedRecords,saveTransition,sessionView}from"#harness/session-machine/commit.js";import{matchSignIns,receive}from"#harness/session-machine/transitions.js";import{readPendingHistory,withoutPendingHistory}from"#execution/session/pending-history.js";import{fact}from"#harness/facts.js";import{admitDeliveries}from"#execution/session/delivery-facts.js";import{hasDelegatedSessionContext}from"#execution/delegated-session-context.js";import{setChannelContext}from"#execution/channel-context.js";import{applyReactionEffects,restoreReactions}from"#reactions/runner.js";import{reconcileSessionContinuationToken}from"#execution/reconcile-session-continuation-token.js";import{eventsOf}from"#harness/publication.js";import{bindSessionInstrumentation}from"#instrumentation/runtime.js";import{deriveSessionTitle}from"#execution/eve-workflow-attributes.js";import{isTurnCancellation,throwIfTurnAborted}from"#harness/turn-cancellation.js";import{bindTurnCallerContext}from"#subagents/parent-notification.js";import{traceSessionHandover}from"#execution/session/handover-tracing.js";import{createCancelledModelCallBatchResult}from"#execution/cancelled-model-call-batch.js";import{pausedOrParked,resolveSessionStepResult}from"#execution/session/turn-step-result.js";import{startSessionPrewarmers}from"#context/prewarm.js";import{setEveAttributes}from"#runtime/attributes/emit.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{matchAuthorizationCallbacks}from"#execution/authorization-callback-match.js";import{attributeAnswers}from"#execution/session/answer-caller.js";import{readInterruptedAttempt,recoverInterruptedStep}from"#execution/session/interrupted-step.js";import{stepDisagreement}from"#execution/session/step-decision-check.js";import{createTurnEventHandler}from"#execution/session/turn-event-handler.js";import{buildRuntimeIdentity,createExecutionNodeStep}from"#execution/node-step.js";import{runModelCallBatch}from"#execution/model-call-batching.js";const log=createLogger(`execution.turn-step`);async function turnStep(e){"use step";return e.handover!==void 0&&traceSessionHandover(`inbox_unblocked`,e.sessionState.sessionId,e.handover.attemptKey,{"eve.handoff.buffered_payload_count":e.handover.payloadCount,"eve.handoff.applied_at_ms":e.handover.appliedAtMs,"eve.handoff.applied_at_clock":`workflow`}),await withSessionStateDelta(e,e=>runSessionStep({...e,serializedContext:bindTurnCallerContext(e.caller,e.serializedContext)}))}async function runSessionStep(e){let t={};try{return await runSessionStepBody(e,t)}finally{await t.title}}async function runSessionStepBody(e,t){let n=e.input?.delivery,r=n,i=e.input?.runtimeResults,a=readDurableSession(e.sessionState),o=await deserializeContext(e.serializedContext);enterSessionProjection(o,a.state);let s=await readOrphanedLines({sessionId:a.sessionId,position:nextLinePosition(o),sessionWritable:e.sessionWritable,always:e.recover!==void 0}),c=s.length>0||e.recover!==void 0?readInterruptedAttempt(nextLinePosition(o),s):void 0;s.length>0&&enterSessionProjectionAt(o,foldOrphanedLines(currentProjection(o),s));let l=o.require(ChannelKey),u=o.require(BundleKey),d=resolveEffectiveAgentRuntime(u,o);try{let{getWorkflowMetadata:e}=await import(`#compiled/@workflow/core/index.js`),t=e();typeof t.url==`string`&&o.set(CallbackBaseUrlKey,resolveWorkflowCallbackBaseUrl(t.url))}catch{}let{signIns:f}=readHitlState(a.state),p;if(f.length>0&&r!==void 0){let{matches:e,remainingPayloads:t}=matchAuthorizationCallbacks(f,r.payloads);if(r={...r,payloads:t},e.length>0){let n=e.map(e=>e.result.attemptId),i=e.map(e=>e.result);o.set(PendingAuthorizationResultKey,i);let s=sessionView(storedProjection(a.state),a.state),c=matchSignIns(s,{attemptIds:n});if(c.events.length!==0)throw Error(`matchSignIns must not emit events.`);a=saveTransition(a,c),p=e,t.length===0&&(r=void 0)}}r?.payloads.some(e=>e.message!==void 0)&&(o.delete(ScheduleIdKey),o.delete(ScheduleInstanceKey),o.delete(OccurrenceIdKey),r.schedule!==void 0&&(o.set(ScheduleIdKey,r.schedule.definition),r.schedule.instance!==void 0&&o.set(ScheduleInstanceKey,r.schedule.instance),r.schedule.occurrenceId!==void 0&&o.set(OccurrenceIdKey,r.schedule.occurrenceId)));let m=o.get(AuthKey),h=o.has(InitiatorAuthKey);r?.auth!==void 0&&(o.set(AuthKey,r.auth??null),o.has(InitiatorAuthKey)||o.set(InitiatorAuthKey,r.auth??null));let g=r===void 0?p?.find(({challenge:e})=>e.candidateId===void 0)?.challenge.requester:void 0;g!==void 0&&o.set(AuthKey,g);let _={...hydrateDurableSession({compactionOverrides:{thresholdPercent:d.thresholdPercent},durable:a,turnAgent:d.turnAgent}),history:validateHarnessModelMessages(e.history)},v=bindSessionInstrumentation({agentName:d.turnAgent.id,ctx:o,rootSessionId:_.rootSessionId??_.sessionId,sessionId:_.sessionId});bindMemoryInstrumentation(o,v?.memory);let y=turnPosition(currentProjection(o)),b=isBetweenTurns(currentProjection(o));if(!y.sessionStarted&&!o.has(SessionTitleKey)&&!o.has(ParentSessionKey)){let e=n?.payloads.find(e=>e.message!==void 0)?.message,r=deriveSessionTitle(n?.title??e);r!==void 0&&(o.set(SessionTitleKey,r),t.title=setEveAttributes({"$eve.title":r}))}n!==void 0&&(await contextStorage.run(o,()=>v?.preparePreamble({sequence:y.sequence,sessionStarted:y.sessionStarted})),v?.prepareDelivery(n));let x=openSessionEventPublisher({ctx:o,origin:`own`,sessionWritable:e.sessionWritable}),{adapterCtx:S}=x.dispatcher,C=new AbortController,w=e.abortSignal===void 0?C.signal:AbortSignal.any([e.abortSignal,C.signal]);try{let s={...u.graph.root,turnAgent:d.turnAgent},f=resolveSessionUsageLimit(u),g=!1,T=createTurnEventHandler({abortSignal:w,canCancelTurn:e.input?.control===void 0,conversation:_.history,hookCancellation:C,publisher:x}),handleEvent=async(e,t)=>{eventsOf(e).some(e=>e.type===`context.settled`&&e.data.kind===`compaction`&&e.data.outcome===`completed`)&&(g=!0),await T(e,t)},E=r!==void 0&&!b?structuredClone(S.state):void 0,D,O;if(r!==void 0){let e=[],t=r.payloads.some(e=>e.message!==void 0)?readPendingHistory(a.state):[],i=0;try{for(let n of r.payloads){let r=l.deliver?await l.deliver(n,S):defaultDeliverResult(n);if(r==null){e.push({input:void 0,payload:n});continue}let a=[...i===0?t:[],...n.history??[]];i+=1,e.push({input:a.length===0?r:{...r,history:a},payload:n})}}catch(e){throw await v?.flush(),e}O=admitDeliveries({channelKind:o.get(ChannelInstrumentationKey)?.kind??getAdapterKind(l),delivery:n??r,status:e=>currentProjection(o).view.deliveries[e]?.status,payloads:e}),i>0&&t.length>0&&(_={..._,state:withoutPendingHistory(_.state)}),D=O.inputs.length===0?void 0:O.inputs.reduce(coalesceTurnInputs)}let k=r?.auth===void 0?void 0:attributeAnswers({responder:r.auth,state:a.state,stepInput:D});if(k!==void 0&&(D=k,m===void 0?o.delete(AuthKey):o.set(AuthKey,m),h||o.delete(InitiatorAuthKey)),r!==void 0&&D===void 0&&!b)m===void 0?o.delete(AuthKey):o.set(AuthKey,m),S.state=E;else if(n?.payloads.some(e=>e.message!==void 0)){let e=n.deliveryMetadata?.map(e=>e.deliveryId)??[];o.set(TurnDeliveryIdsKey,y.turnId?[...new Set([...o.get(TurnDeliveryIdsKey)??[],...e])]:e)}else!y.sessionStarted&&o.get(ChannelDeliveryKey)!==void 0&&o.set(TurnDeliveryIdsKey,[o.require(ChannelDeliveryKey).deliveryId]);if(i!==void 0&&(i.acceptedAtMsByCallId!==void 0&&o.set(RuntimeActionSettlementTimesKey,i.acceptedAtMsByCallId),D={...D,delegatedUsage:i.delegatedUsage,runtimeActionResults:i.results}),n!==void 0){let e={...l,state:{...S.state}};setChannelContext(o,e)}let A=!1,admissionFacts=e=>{if(O===void 0||O.facts.length===0)return[];let t=[];if(!turnPosition(currentProjection(o)).sessionStarted){let n=o.get(ParentSessionKey),r=o.get(SessionPredecessorKey);t.push(fact(`session.started`,{parent:n===void 0?void 0:{callId:n.callId,sessionId:n.sessionId},predecessor:r,runtime:e}))}return[...t,...O.facts]},publishAdmission=async e=>{let t=admissionFacts(e);if(t.length===0)return;let n=sessionProvider.create(o,_);o.setVirtualContext(SessionKey,n.value);let r=await connectionProvider.create(o,_);r!==void 0&&o.setVirtualContext(ConnectionRegistryKey,r.value);let i=await sandboxProvider.create(o,_);i!==void 0&&o.setVirtualContext(SandboxKey,i.value);let a=v?.createHandleEvent({handleEvent})??handleEvent;try{await contextStorage.run(o,()=>a(t))}finally{if(i!==void 0){let e=await i.value.captureState();JSON.stringify(e)!==JSON.stringify(_.sandboxState??null)&&(A=!0,_={..._,sandboxState:e})}}},consumeCancelledInput=async()=>{let e=currentProjection(o),t=(D?.deliveries??[]).filter(({deliveryId:t})=>e.view.deliveries[t]?.status===`admitted`);if(t.length===0)return;let{events:n}=receive(sessionView(e,_.state),{deliveries:t}),r=createTurnEventHandler({abortSignal:w,canCancelTurn:!1,conversation:_.history,hookCancellation:new AbortController,publisher:x}),i=v?.createHandleEvent({handleEvent:r})??r;await contextStorage.run(o,()=>i(n))};if(r!==void 0&&D===void 0&&b){await publishAdmission(buildRuntimeIdentity(s)).catch(ignoreTurnCancellation),await v?.flush();let t=saveSessionProjection(reconcileSessionContinuationToken(o,_),o),n=serializeContext(o),r=t===_&&!A?{history:e.history,sessionState:e.sessionState}:createDurableSessionValues(t);return pausedOrParked(t,{serializedContext:n,...r})}let j=buildRuntimeIdentity(s),M,prepareReactions=e=>(o.setVirtualContext(StaticModelReferenceKey,d.turnAgent.model??null),M??=(async()=>{try{let t=process.env.VERCEL_DEPLOYMENT_ID?.trim(),n=t?`deployment:${t}`:await resolveRuntimeCompiledArtifactsVersionedCacheKey(u.compiledArtifactsSource);await contextStorage.run(o,()=>restoreReactions(o,{abortSignal:w,conversation:e.history,revision:n}))}catch(e){throw await v?.flush(),e}})());if(c!==void 0){let t=await recoverInterruptedStep({admission:admissionFacts(j),attempt:c,control:e.input?.control===void 0?void 0:{delivery:e.input.controlDelivery,kind:e.input.control},ctx:o,failed:e.recover,publish:async(e,t)=>(await withContextScope(o,t,async t=>{await prepareReactions(t);let n=createTurnEventHandler({abortSignal:w,canCancelTurn:!1,conversation:t.history,hookCancellation:new AbortController,publisher:x});return await(v?.createHandleEvent({handleEvent:n})??n)(e),{result:void 0,session:t}})).session,session:_,stepInput:D}).catch(async e=>{throw await v?.flush(),e});if(`result`in t)return await v?.flush(),t.result.action===`done`&&await x.writer.close().catch(()=>{}),t.result;_=t.session,D=t.stepInput}await prepareReactions(_);try{await publishAdmission(j)}catch(e){if(!isTurnCancellation(e))throw await v?.flush(),e}let N=u.resolvedAgent.config?.experimental?.workflow?.modelCallsPerStep??1,P=o.get(CapabilitiesKey),runHarnessStep=async(n,r,i)=>{let a=refreshSessionFromTurnAgent({compactionOverrides:{thresholdPercent:d.thresholdPercent},session:n,turnAgent:d.turnAgent});return createExecutionNodeStep({steeringSignal:e.steeringSignal,abortSignal:w,capabilities:P,clearOnly:e.input?.control===`clear`,compactOnly:e.input?.control===`compact`,controlDelivery:e.input?.controlDelivery,createRuntime:createWorkflowRuntime,handleEvent,signInCompletions:i,typedAnswers:!hasDelegatedSessionContext(e.serializedContext),instrumentation:v,modelResolutionScope:{moduleMap:u.moduleMap,nodeId:u.nodeId},node:s,sessionUsageLimit:f,titleAttributeWrite:t.title})(a,r)},F,I;try{throwIfTurnAborted(w),I=await runModelCallBatch({steeringSignal:e.steeringSignal,initialInput:D,initialSession:_,modelCallsPerStep:N,runStep:async({firstCall:t,session:n,stepInput:r})=>{let i=await runStep(o,n,async n=>{t&&e.input?.control===void 0&&startSessionPrewarmers(o,`turn`),o.setVirtualContext(HandleEventKey,handleEvent),o.setVirtualContext(StaticModelReferenceKey,d.turnAgent.model??null);let i=t&&D?.outputSchema!==void 0?{...n,outputSchema:D.outputSchema}:n;await applyReactionEffects(o);let a=t&&p!==void 0?p.map(({challenge:e})=>e):void 0,s=await runHarnessStep(i,r,a);return await x.finish({announce:stoppedForPerson(s)}),s});i.settledTurn===void 0&&throwIfTurnAborted(w);let a={...i,session:saveSessionProjection(i.session,o)};return recordAppliedSession(o,a.session),F={result:a,serializedContext:serializeContext(o)},a}})}catch(t){if(!isTurnCancellation(t)&&!w.aborted)throw await v?.flush(),t;return F===void 0&&await consumeCancelledInput(),createCancelledModelCallBatchResult({beforeBatchContext:e.serializedContext,checkpoint:F,ctx:o,initialSession:_,stepInput:D})}let L=saveSessionProjection(dropClosedRecords(reconcileSessionContinuationToken(o,I.session),currentProjection(o)),o);agentTraceState.pruneAgentTraceState(o,L.sessionId,L.state);let R=serializeContext(o);I={...I,session:L};let z=resolveSessionStepResult(I,R);if(checksSessionEvents()){let e=stepDisagreement(z,currentProjection(o).view);e!==void 0&&e!==`dispatch-deferred`&&log.warn(`a turn step's decision disagrees with the session's tables`,{disagreement:e})}return z.action===`done`&&await x.writer.close(),g?{...z,compacted:!0}:z}finally{x.writer.release()}}function stoppedForPerson(e){return e.held===void 0?e.next===null&&e.settledTurn===void 0:e.held.kind===`request`}function ignoreTurnCancellation(e){if(!isTurnCancellation(e))throw e}export{turnStep};
|
|
@@ -2,7 +2,7 @@ import type { SessionCapabilities, TurnCaller } from "#channel/types.js";
|
|
|
2
2
|
import type { SessionInputQueue } from "#execution/session/input-queue.js";
|
|
3
3
|
import type { SessionInboxReader } from "#execution/session-inbox/inbox.js";
|
|
4
4
|
import type { SessionStateCursor } from "#execution/session/state-cursor.js";
|
|
5
|
-
import type
|
|
5
|
+
import { type WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js";
|
|
6
6
|
import type { TurnOutcome, TurnStepPayload } from "#execution/session/turn-step-types.js";
|
|
7
7
|
import { ActiveTurn } from "#execution/session/active-turn.js";
|
|
8
8
|
import type { TurnControl } from "#execution/session/turn-control.js";
|
|
@@ -37,13 +37,29 @@ export declare class SessionExecution {
|
|
|
37
37
|
/**
|
|
38
38
|
* Applies what runs reported while the model step ran, so the next step sees
|
|
39
39
|
* it. Consecutive messages the session applies as it reads them, such as a
|
|
40
|
-
* fan-out's, share one step. An ending session drops
|
|
41
|
-
* stream is closed, and finalizing the session terminates the
|
|
40
|
+
* fan-out's, share one step. An ending session drops its runs' agent session
|
|
41
|
+
* messages: its stream is closed, and finalizing the session terminates the
|
|
42
|
+
* children.
|
|
42
43
|
*/
|
|
43
44
|
private handleBoundaryMessages;
|
|
44
45
|
/** Hooks on the messages' events may cancel `turn`, the turn that is running. */
|
|
45
46
|
private applyRunMessages;
|
|
46
47
|
private runTurnSteps;
|
|
48
|
+
/** The next step's input: what resumed the turn, behind any steering admitted meanwhile. */
|
|
49
|
+
private withSteering;
|
|
50
|
+
/**
|
|
51
|
+
* Waits for what a paused turn awaits, and returns the input its next step reads:
|
|
52
|
+
*
|
|
53
|
+
* - an interaction's answer, a sign-in callback, or the turn's own requester steering it, for the
|
|
54
|
+
* requests and sign-ins it raised. Anyone else's message queues behind the turn, as does a
|
|
55
|
+
* message admitted before the step that raised the request (`heldSince`): it was sent
|
|
56
|
+
* before the request existed;
|
|
57
|
+
* - one of its tasks settling. Steering interrupts that wait;
|
|
58
|
+
* - every call's result. Steering interrupts the workflow tool calls, which still report.
|
|
59
|
+
*/
|
|
60
|
+
private resume;
|
|
61
|
+
/** Starts the runs a paused step asked for, answers its task tool calls, and tracks the rest. */
|
|
62
|
+
private startCallWait;
|
|
47
63
|
/**
|
|
48
64
|
* Starts the workflow tool runs a parked step requested, and returns the
|
|
49
65
|
* results of any that settled at once. Task tool calls need no dispatch: the
|
|
@@ -64,33 +80,4 @@ export declare class SessionExecution {
|
|
|
64
80
|
cancelTurnWork(): Promise<void>;
|
|
65
81
|
/** `session.cancel()` stops the turn, the calls it waits on, and every working task. */
|
|
66
82
|
private finishCancelledTurn;
|
|
67
|
-
/**
|
|
68
|
-
* The model tried to end the turn while its tasks work. The turn parks as
|
|
69
|
-
* `eve__task_wait` would, until one of them settles or the turn is steered.
|
|
70
|
-
*/
|
|
71
|
-
private waitForHeldTurn;
|
|
72
|
-
/**
|
|
73
|
-
* The turn waits on a sign-in or tool approval it raised. It wakes with the
|
|
74
|
-
* delivery its next step reads: the sign-in callback, an approval answer
|
|
75
|
-
* from any responder, or a message from the turn's own person, which steers
|
|
76
|
-
* the turn and cancels the request. Anyone else's message queues behind it,
|
|
77
|
-
* as does a queued message admitted before the step that raised the request
|
|
78
|
-
* (`heldSince`): it was sent before the request existed, so it must not
|
|
79
|
-
* answer it.
|
|
80
|
-
*/
|
|
81
|
-
private waitForHeldRequest;
|
|
82
|
-
private waitForRuntimeActionResults;
|
|
83
|
-
/** Answers every `eve__task_wait` that can return now; returns the ones still waiting. */
|
|
84
|
-
private resolveTaskWaits;
|
|
85
|
-
/**
|
|
86
|
-
* `eve__task_cancel` is answered at once, and so is each `eve__task_wait` that can
|
|
87
|
-
* return now: a timeout of 0, a result already waiting, or nothing working.
|
|
88
|
-
* Any other `eve__task_wait` parks the open turn, reported once as
|
|
89
|
-
* `turn.waiting`, and the turn resolves it alongside the step's other
|
|
90
|
-
* workflow tool calls.
|
|
91
|
-
*/
|
|
92
|
-
private answerTaskToolCalls;
|
|
93
|
-
private traceTaskWait;
|
|
94
|
-
/** Aborts the `abortSignal` of every workflow tool call the wait has no result for yet. */
|
|
95
|
-
private interruptWaitedWorkflowCalls;
|
|
96
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{TASK_WAIT_TOOL_NAME}from"#protocol/task-tools.js";import{renderTaskWaitResult}from"#execution/tasks/render.js";import{sleep}from"#compiled/@workflow/core/index.js";import{findBlockingWorkflowToolRun,getBlockingWorkflowToolRuns,isInboxToolResultFromRecordedWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{taskWaitResult}from"#execution/tasks/table.js";import{handleWorkflowToolRunMessage,isAppliedRunMessage,takeLeadingAppliedRunMessages}from"#execution/session-workflow-tool-run.js";import{resolveTurnPrincipal}from"#execution/session/principal.js";import{answerTaskCancel,cancelWorkingTasks,sessionTaskTable}from"#execution/tasks/session.js";import{cancelDescendantTurnsStep}from"#execution/cancel-descendant-turns-step.js";import{dispatchCoordinationStep,publishTaskStartedStep}from"#execution/coordination-dispatch-step.js";import{taskToolResult}from"#execution/tasks/calls.js";import{publishTurnWaitingStep}from"#execution/session/turn-waiting-step.js";import{applyRunMessagesStep}from"#execution/tools/workflow/apply-run-messages-step.js";import{interruptWorkflowToolRun}from"#execution/tools/workflow/interrupt.js";import{turnStep}from"#execution/session/turn-step.js";import{ActiveTurn}from"#execution/session/active-turn.js";import{resolveRuntimeActionResultsForCallIds}from"#runtime/actions/results.js";import{startTaskToolCallsStep,traceTaskToolCallStep}from"#execution/session/task-tool-tracing-step.js";function hasDelegatedCallerContext(e){if(e[`eve.sessionCallback`]!==void 0)return!0;let t=e[`eve.channel`];return typeof t==`object`&&!!t&&Reflect.get(t,`kind`)===`subagent`}var SessionExecution=class{input;observedHandoverAttemptKey;constructor(e){this.input=e}get cursor(){return this.input.cursor}async runTurn(e,t={}){let n=new ActiveTurn(this.input,{caller:t.caller,principal:resolveTurnPrincipal(e,this.input.cursor.serializedContext)},t.control);try{let t=await this.runTurnSteps(n,e);return await this.handleBoundaryMessages(n.takeBoundaryMessages(),t.kind===`done`),t.kind===`park`&&t.settled!==void 0&&await cancelWorkingTasks(this.input.cursor,`turn_ended`),{...t,...n.caller!==void 0&&{caller:n.caller},...n.compacted&&{compacted:!0}}}finally{n.dispose()}}async handleBoundaryMessages(e,t=!1,n){let r=[];for(let i of e)isAppliedRunMessage(i)?(!t||i.kind!==`agent-started`)&&r.push(i):(await this.applyRunMessages(r,n),r=[],await handleWorkflowToolRunMessage({cursor:this.input.cursor,message:i}));await this.applyRunMessages(r,n)}async applyRunMessages(e,t){if(e.length===0)return;let{cancelled:n}=await this.input.cursor.advance(n=>applyRunMessagesStep({...n,canCancelTurn:t!==void 0,messages:e}));n&&t?.abort()}async runTurnSteps(e,t){let n=t,r=e.caller;for(;;){let{cursor:t}=this.input,i=r;r=void 0;let a=this.input.inbox.handoverObservation,o=a?.attemptKey===this.observedHandoverAttemptKey?void 0:a,s=await t.advanceWithHistory(t=>turnStep({...t,handover:o,abortSignal:e.signal,caller:i,input:n,steeringSignal:e.steeringSignal}));o!==void 0&&(this.observedHandoverAttemptKey=o.attemptKey),s.compacted===!0&&(e.compacted=!0);let c=s.action===`park`?s.pendingCoordinationCallIds:void 0,l=s.action===`park`&&s.settled!==void 0,u=this.input.queue.nextAdmission;await e.admitBoundary();let d=s.action===`done`;if(await this.handleBoundaryMessages(e.takeBoundaryMessages(),d,d?void 0:e),s.action===`cancelled`||!l&&e.signal.aborted&&c===void 0)return await this.finishCancelledTurn(e);if(s.action===`done`)return{isError:s.isError,kind:`done`,output:s.output??``,usage:s.usage,usageDelta:s.usageDelta};if(s.action===`held`&&s.hold===`request`){if(s.hasPendingInputBatch&&this.input.capabilities?.requestInput!==!0&&!hasDelegatedCallerContext(this.input.cursor.serializedContext))throw Error(`This session cannot request human input, so it cannot wait for a tool approval or question. Configure unattended tools with an approval policy that does not require human input.`);let t=await this.waitForHeldRequest(e,s,u);if(t===`cancelled`)return await this.finishCancelledTurn(e);n={delivery:t};continue}if(s.action===`held`){if(await this.waitForHeldTurn(e)===`cancelled`)return await this.finishCancelledTurn(e);let t=await e.takeSteering();n=t===void 0?void 0:{delivery:t};continue}if(c!==void 0&&s.action===`park`){let t=s.hasRunsToDispatch===!1?[]:await this.dispatchRuns(),r=t.length===0?void 0:Date.now(),i=await this.waitForRuntimeActionResults({initialAcceptedAtMs:r,initialResults:t,taskToolCalls:s.pendingTaskToolCalls??[],pendingCallIds:c,turn:e});if(i===`cancelled`)return await this.finishCancelledTurn(e);n={delivery:await e.takeSteering(),runtimeResults:i};continue}if(s.action===`park`)return{kind:`park`,settled:s.settled};let f=await e.takeSteering();n=f===void 0?void 0:{delivery:f}}}async dispatchRuns(){let{cursor:e}=this.input,t=await e.advance(({serializedContext:e,sessionState:t})=>dispatchCoordinationStep({action:`park`,serializedContext:e,sessionState:t,workflowToolRunOwner:{inbox:sessionInboxHookToken(sessionCommandHookToken(this.input.sessionId))}}));return t.started.length>0&&await e.advance(e=>publishTaskStartedStep({...e,started:t.started})),t.results}async handleWorkflowMessage(e,t){if(isAppliedRunMessage(e)){let n=t?.takeAppliedRunMessages()??takeLeadingAppliedRunMessages(this.input.inbox);await this.applyRunMessages([e,...n],t);return}return await handleWorkflowToolRunMessage({cursor:this.input.cursor,message:e})}async cancelTurnWork(){let{cursor:e}=this.input;mayWaitOnWorkflowToolRuns(e.sessionState)&&await cancelDescendantTurnsStep({serializedContext:e.serializedContext,sessionState:e.sessionState}),await cancelWorkingTasks(e,`turn_cancelled`)}async finishCancelledTurn(e){return await this.handleBoundaryMessages(e.takeBoundaryMessages(`agent-started`)),await this.cancelTurnWork(),{cancelled:!0,kind:`park`}}async waitForHeldTurn(e){let t=!1;for(;;){let n={interrupted:t,timedOut:!1};if(taskWaitResult(sessionTaskTable(this.input.cursor),n)!==void 0)return`woke`;let r=await e.nextRuntimeEvent([]);if(r===`cancelled`)return r;switch(r.kind){case`steering`:t=!0;continue;case`workflow`:await this.handleWorkflowMessage(r.message,e);continue;case`input`:case`runtime-action-result`:case`timeout`:continue}}}async waitForHeldRequest(e,t,n){let r=new Set(t.authorizationAttemptIds),i=new Set(t.inputRequestIds);for(;;){let t=this.input.queue.takeAuthorizations(r);if(t!==void 0)return{kind:`deliver`,payloads:t};let a=await e.takeInputResponses(i);if(a!==void 0)return a;let o=await e.takeSteering({heldSince:n});if(o!==void 0)return o;let s=await e.nextRuntimeEvent([]);if(s===`cancelled`)return s;s.kind===`workflow`&&await this.handleWorkflowMessage(s.message,e)}}async waitForRuntimeActionResults(e){let t=[...e.initialResults],n=!1,r=new Map,i=new Map;if(e.initialAcceptedAtMs!==void 0)for(let n of t)r.set(n.callId,e.initialAcceptedAtMs);let accept=e=>{t.push(e),r.set(e.callId,Date.now())},a=await this.answerTaskToolCalls(e.taskToolCalls,accept);try{for(;;){a=await this.resolveTaskWaits(a,n,accept);let o=resolveRuntimeActionResultsForCallIds({pendingCallIds:e.pendingCallIds,results:t});if(o!==void 0){let e=o.flatMap(e=>{let t=i.get(e.callId);return t===void 0?[]:[t]});return{acceptedAtMsByCallId:Object.fromEntries(o.map(e=>[e.callId,r.get(e.callId)])),...e.length>0&&{delegatedUsage:e},results:o}}let s=a.flatMap(e=>e.timer===void 0?[]:[e.timer]),c=await e.turn.nextRuntimeEvent(s);if(c===`cancelled`)return c;if(c.kind===`timeout`){for(let e of a)e.callId===c.callId&&(e.timedOut=!0);continue}if(c.kind===`input`)continue;if(c.kind===`steering`){n||await this.interruptWaitedWorkflowCalls(e.pendingCallIds,t),n=!0;continue}if(c.kind===`runtime-action-result`){let e=this.input.cursor.sessionState.snapshot.session.state,n=c.results.filter(t=>t.kind===`tool-result`&&isInboxToolResultFromRecordedWorkflowToolRun(e,t));if(n.length>0){let e=Date.now();t.push(...n);for(let t of n)r.set(t.callId,e)}continue}let l=await this.handleWorkflowMessage(c.message,e.turn);l!==void 0&&(accept(l),c.message.kind===`outcome`&&c.message.usage!==void 0&&i.set(l.callId,c.message.usage))}}finally{for(let e of a)await this.traceTaskWait(e,void 0,!0)}}async resolveTaskWaits(e,t,n){let r=sessionTaskTable(this.input.cursor),i=[];for(let a of e){let e=taskWaitResult(r,{interrupted:t,timedOut:a.timedOut});if(e===void 0){i.push(a);continue}let o=renderTaskWaitResult(e,Date.now()-a.startedAtMs);await this.traceTaskWait(a,o,t),n(taskToolResult(a.callId,TASK_WAIT_TOOL_NAME,o))}return i}async answerTaskToolCalls(e,t){let n=[],r=e.length===0?0:await startTaskToolCallsStep();for(let i of e)if(i.kind===TASK_WAIT_TOOL_NAME)n.push(startTaskWait(i,r));else{let e;try{e=await answerTaskCancel(this.input.cursor,i)}catch(e){throw await this.input.cursor.advance(e=>traceTaskToolCallStep(e,{callId:i.callId,toolName:i.kind,startedAtMs:r,completedAtMs:Date.now(),input:{taskId:i.taskId},failed:!0})),e}await this.input.cursor.advance(t=>traceTaskToolCallStep(t,{callId:i.callId,toolName:i.kind,startedAtMs:r,completedAtMs:Date.now(),input:{taskId:i.taskId},output:e.output})),t(e)}let i=await this.resolveTaskWaits(n,!1,t);return i.length>0&&await this.input.cursor.advance(publishTurnWaitingStep),i}async traceTaskWait(e,t,n=!1){await this.input.cursor.advance(r=>traceTaskToolCallStep(r,{callId:e.callId,toolName:TASK_WAIT_TOOL_NAME,startedAtMs:e.startedAtMs,completedAtMs:Date.now(),input:e.input,output:t,failed:n}))}async interruptWaitedWorkflowCalls(e,t){let n=this.input.cursor.sessionState.snapshot.session.state,r=new Set(t.map(e=>e.callId)),i=e.filter(e=>!r.has(e)).flatMap(e=>{let t=findBlockingWorkflowToolRun(n,e);return t===void 0?[]:[t.address]});await Promise.all(i.map(e=>interruptWorkflowToolRun(e)))}};function startTaskWait(e,t){let{callId:n,timeoutMs:r}=e,i=r===void 0?void 0:sleep(r).then(()=>n);return{callId:n,startedAtMs:t,input:r===void 0?{}:{timeoutSeconds:r/1e3},timedOut:r===0,timer:i}}function mayWaitOnWorkflowToolRuns(e){try{return getBlockingWorkflowToolRuns(e.snapshot?.session?.state).length>0}catch{return!0}}export{SessionExecution,hasDelegatedCallerContext};
|
|
1
|
+
import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{TASK_WAIT_TOOL_NAME}from"#protocol/task-tools.js";import{EARLIER_REMOTE_CALLER_CONTEXT_KEY_NAME}from"#context/key-names.js";import{renderTaskWaitResult}from"#execution/tasks/render.js";import{formatEarlierRemoteCallerInputError}from"#protocol/remote-agent-protocol.js";import{sleep}from"#compiled/@workflow/core/index.js";import{taskWaitResult}from"#execution/tasks/table.js";import{controlDeliveryOf}from"#execution/session/control-delivery.js";import{isAgentSessionMessage}from"#execution/tools/workflow/messages.js";import{handleWorkflowToolRunMessage,isAppliedRunMessage,takeLeadingAppliedRunMessages}from"#execution/session-workflow-tool-run.js";import{exhaustedStepError,normalizeSerializableError}from"#execution/workflow-errors.js";import{findBlockingWorkflowToolRun,isInboxToolResultFromRecordedWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{resolveTurnPrincipal}from"#execution/session/principal.js";import{answerTaskCancel,cancelWorkingTasks,sessionTaskTable}from"#execution/tasks/session.js";import{dispatchCoordinationStep,publishDispatchedCallsStep}from"#execution/coordination-dispatch-step.js";import{taskToolResult}from"#execution/tasks/calls.js";import{applyRunMessagesStep}from"#execution/tools/workflow/apply-run-messages-step.js";import{interruptWorkflowToolRun}from"#execution/tools/workflow/interrupt.js";import{turnStep}from"#execution/session/turn-step.js";import{ActiveTurn}from"#execution/session/active-turn.js";import{resolveRuntimeActionResultsForCallIds}from"#runtime/actions/results.js";import{startTaskToolCallsStep}from"#execution/session/task-tool-tracing-step.js";function hasDelegatedCallerContext(e){if(earlierRemoteCaller(e)!==void 0)return!1;if(e[`eve.sessionCallback`]!==void 0)return!0;let t=e[`eve.channel`];return typeof t==`object`&&!!t&&Reflect.get(t,`kind`)===`subagent`}function earlierRemoteCaller(e){let t=e[EARLIER_REMOTE_CALLER_CONTEXT_KEY_NAME];return typeof t==`number`?t:void 0}var SessionExecution=class{input;observedHandoverAttemptKey;constructor(e){this.input=e}get cursor(){return this.input.cursor}async runTurn(e,t={}){let n=new ActiveTurn(this.input,{caller:t.caller,control:e?.control!==void 0,principal:resolveTurnPrincipal(e,this.input.cursor.serializedContext)},t.control);try{let t=await this.runTurnSteps(n,e);return await this.handleBoundaryMessages(n.takeBoundaryMessages(),t.kind===`done`),t.kind===`park`&&t.settled!==void 0&&await cancelWorkingTasks(this.input.cursor,`turn-ended`),{...t,...n.caller!==void 0&&{caller:n.caller},...n.compacted&&{compacted:!0}}}finally{n.dispose()}}async handleBoundaryMessages(e,t=!1,n){let r=[];for(let i of e)isAppliedRunMessage(i)?(!t||!isAgentSessionMessage(i))&&r.push(i):(await this.applyRunMessages(r,n),r=[],await handleWorkflowToolRunMessage({cursor:this.input.cursor,message:i}));await this.applyRunMessages(r,n)}async applyRunMessages(e,t){if(e.length===0)return;let{cancelled:n}=await this.input.cursor.advance(n=>applyRunMessagesStep({...n,canCancelTurn:t!==void 0,messages:e}));n&&t?.abort()}async runTurnSteps(e,t){let n=t,r=e.caller;for(;;){let{cursor:t}=this.input,i=r;r=void 0;let a=this.input.inbox.handoverObservation,o=a?.attemptKey===this.observedHandoverAttemptKey?void 0:a,s=await t.advanceWithHistory(t=>{let run=r=>turnStep({...t,handover:o,abortSignal:e.signal,caller:i,input:n,recover:r,steeringSignal:e.steeringSignal});return run().catch(e=>run({error:normalizeSerializableError(exhaustedStepError(e))}))});o!==void 0&&(this.observedHandoverAttemptKey=o.attemptKey),s.compacted===!0&&(e.compacted=!0);let c=this.input.queue.nextAdmission,l=s.action===`parked`&&s.settled!==void 0;await e.admitBoundary(l);let u=s.action===`done`;if(await this.handleBoundaryMessages(e.takeBoundaryMessages(),u,u?void 0:e),s.action===`cancelled`)return await this.finishCancelledTurn(e);let d=s.action===`paused`&&s.on===`calls`;if(!l&&!d&&e.signal.aborted)return await this.finishCancelledTurn(e);switch(s.action){case`done`:return{isError:s.isError,kind:`done`,output:s.output??``,usage:s.usage,usageDelta:s.usageDelta};case`parked`:return{kind:`park`,settled:s.settled};case`paused`:{let t=await this.resume(e,s,c);if(t===`cancelled`)return await this.finishCancelledTurn(e);n=t;continue}case`continue`:n=await this.withSteering(e,{});continue}}}async withSteering(e,t){let n=await e.takeSteering();if(n!==void 0||t.runtimeResults!==void 0)return{...t,...n!==void 0&&{delivery:n}}}async resume(e,t,n){let r=earlierRemoteCaller(this.input.cursor.serializedContext);if(t.on===`interaction`&&r!==void 0)throw Error(formatEarlierRemoteCallerInputError(r));if(t.on===`interaction`&&t.requestIds.length>0&&this.input.capabilities?.requestInput!==!0&&!hasDelegatedCallerContext(this.input.cursor.serializedContext))throw Error(`This session cannot request human input, so it cannot wait for a tool approval or question. Configure unattended tools with an approval policy that does not require human input.`);let i=t.on===`interaction`?{attemptIds:new Set(t.attemptIds),requestIds:new Set(t.requestIds)}:void 0,a=t.on===`calls`?await this.startCallWait(t):void 0,o=!1;for(;;){if(i!==void 0){let t=this.input.queue.takeAuthorizations(i.attemptIds);if(t!==void 0)return{delivery:{kind:`deliver`,payloads:t}};let r=await e.takeAnswers(i.requestIds);if(r!==void 0)return{delivery:r};let a=await e.takeSteering({heldSince:n});if(a!==void 0)return{delivery:a}}if(t.on===`tasks`&&taskWaitResult(sessionTaskTable(this.input.cursor),{interrupted:o,timedOut:!1})!==void 0)return await this.withSteering(e,{});let r=await a?.ready(o);if(r!==void 0)return await this.withSteering(e,{runtimeResults:r});let s=await e.nextRuntimeEvent(a?.timers()??[]);if(s===`cancelled`)return s;switch(s.kind){case`steering`:o||await a?.interrupt(),o=!0;continue;case`timeout`:a?.timedOut(s.callId);continue;case`runtime-action-result`:a?.acceptInbox(s.results);continue;case`workflow`:{let t=await this.handleWorkflowMessage(s.message,e);t!==void 0&&a?.acceptRun(t,s.message);continue}case`input`:continue}}}async startCallWait(e){let t=e.dispatch?await this.dispatchRuns():[],n=new CallWait(this.input.cursor,e.callIds,t);return await n.answerTaskToolCalls(e.taskToolCalls),n}async dispatchRuns(){let{cursor:e}=this.input,t=await e.advance(({serializedContext:e,sessionState:t})=>dispatchCoordinationStep({serializedContext:e,sessionState:t,workflowToolRunOwner:{inbox:sessionInboxHookToken(sessionCommandHookToken(this.input.sessionId))}})),{executing:n,refused:r,started:i}=t.pending;return(n.length>0||i.length>0||r.length>0)&&await e.advance(e=>publishDispatchedCallsStep({...e,pending:t.pending})),t.results}async handleWorkflowMessage(e,t){if(isAppliedRunMessage(e)){let n=t?.takeAppliedRunMessages()??takeLeadingAppliedRunMessages(this.input.inbox);await this.applyRunMessages([e,...n],t);return}return await handleWorkflowToolRunMessage({cursor:this.input.cursor,message:e})}async cancelTurnWork(){await cancelWorkingTasks(this.input.cursor,`turn-cancelled`,{turnCalls:!0})}async finishCancelledTurn(e){await this.handleBoundaryMessages(e.takeBoundaryMessages(isAgentSessionMessage)),await this.cancelTurnWork();let t=e.cancelledBy;return t===void 0?{cancelled:!0,kind:`park`}:{cancelled:!0,cancelledBy:controlDeliveryOf(t),kind:`park`}}},CallWait=class{cursor;callIds;results=[];acceptedAtMs=new Map;delegatedUsage=new Map;taskWaits=[];constructor(e,t,n){this.cursor=e,this.callIds=t;let r=Date.now();for(let e of n)this.accept(e,r)}async ready(e){this.taskWaits=await this.resolveTaskWaits(e);let t=resolveRuntimeActionResultsForCallIds({pendingCallIds:this.callIds,results:this.results});if(t===void 0)return;let n=t.flatMap(e=>{let t=this.delegatedUsage.get(e.callId);return t===void 0?[]:[[e.callId,t]]});return{acceptedAtMsByCallId:Object.fromEntries(t.map(e=>[e.callId,this.acceptedAtMs.get(e.callId)])),...n.length>0&&{delegatedUsage:Object.fromEntries(n)},results:t}}timers(){return this.taskWaits.flatMap(e=>e.timer===void 0?[]:[e.timer])}timedOut(e){for(let t of this.taskWaits)t.callId===e&&(t.timedOut=!0)}acceptInbox(e){let t=this.cursor.sessionState.snapshot.session.state,n=Date.now();for(let r of e)r.kind===`tool-result`&&isInboxToolResultFromRecordedWorkflowToolRun(t,r)&&this.accept(r,n)}acceptRun(e,t){this.accept(e),t.kind===`outcome`&&t.usage!==void 0&&this.delegatedUsage.set(e.callId,t.usage)}async interrupt(){let e=this.cursor.sessionState.snapshot.session.state,t=this.callIds.flatMap(t=>{if(this.acceptedAtMs.has(t))return[];let n=findBlockingWorkflowToolRun(e,t);return n===void 0?[]:[n.address]});await Promise.all(t.map(e=>interruptWorkflowToolRun(e)))}async answerTaskToolCalls(e){let t=[],n=e.length===0?0:await startTaskToolCallsStep();for(let r of e){if(r.kind===TASK_WAIT_TOOL_NAME){t.push(startTaskWait(r,n));continue}this.accept(await answerTaskCancel(this.cursor,r))}this.taskWaits=t,this.taskWaits=await this.resolveTaskWaits(!1)}accept(e,t=Date.now()){this.results.push(e),this.acceptedAtMs.set(e.callId,t)}async resolveTaskWaits(e){let t=sessionTaskTable(this.cursor),n=[];for(let r of this.taskWaits){let i=taskWaitResult(t,{interrupted:e,timedOut:r.timedOut});if(i===void 0){n.push(r);continue}let a=renderTaskWaitResult(i,Date.now()-r.startedAtMs);this.accept(taskToolResult(r.callId,TASK_WAIT_TOOL_NAME,a))}return n}};function startTaskWait(e,t){let{callId:n,timeoutMs:r}=e,i=r===void 0?void 0:sleep(r).then(()=>n);return{callId:n,startedAtMs:t,timedOut:r===0,timer:i}}export{SessionExecution,hasDelegatedCallerContext};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Posts one framework callback payload with the shared callback transport policy.
|
|
3
|
+
*
|
|
4
|
+
* Callback URLs are caller-supplied, so delivery only connects to public
|
|
5
|
+
* addresses (loopback is also allowed on local development servers), checked
|
|
6
|
+
* against every resolved address at connect time.
|
|
7
|
+
*/
|
|
2
8
|
export declare function postSessionCallbackRequest(input: {
|
|
3
9
|
readonly body: unknown;
|
|
4
10
|
/** Set false when the caller owns failure logging, such as best-effort activity. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";const log=createLogger(`execution.session-callback`),VERCEL_CALLBACK_HOST_ENVS=[`VERCEL_URL`,`VERCEL_BRANCH_URL`,`VERCEL_PROJECT_PRODUCTION_URL`],VERCEL_REQUEST_CONTEXT=Symbol.for(`@vercel/request-context`);async function postSessionCallbackRequest(e){let t=e.timeoutMs??3e4,n=AbortSignal.timeout(t),r;try{r=await
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{isLocalDevelopmentServer}from"#internal/application/dev-environment.js";import{FatalError}from"#compiled/@workflow/core/index.js";import{UnsafeDestinationError,assertPublicHostname,createPublicDispatcher,fetchWithDispatcher,findUnsafeDestinationError,readBoundedResponse}from"#execution/public-destination.js";const log=createLogger(`execution.session-callback`),VERCEL_CALLBACK_HOST_ENVS=[`VERCEL_URL`,`VERCEL_BRANCH_URL`,`VERCEL_PROJECT_PRODUCTION_URL`],VERCEL_REQUEST_CONTEXT=Symbol.for(`@vercel/request-context`);async function postSessionCallbackRequest(e){let t=e.timeoutMs??3e4,n=AbortSignal.timeout(t),r;try{r=await requestCallback(e.url,{body:JSON.stringify(e.body),headers:await resolveSessionCallbackHeaders(e.url),signal:n})}catch(r){let i=findUnsafeDestinationError(r);throw i===void 0?(e.logFailures!==!1&&log.error(`callback delivery failed`,{...callbackLogFields(e),failure:n.aborted?`timeout`:`transport`,timeoutMs:t,error:Error(`Callback request failed before receiving a response.`)}),r):(e.logFailures!==!1&&log.error(`callback delivery failed`,{...callbackLogFields(e),failure:`blocked-destination`,error:Error(i.message)}),new FatalError(`Callback delivery refused: ${i.message}`))}return!r.ok&&e.logFailures!==!1&&log.error(`callback delivery failed`,{...callbackLogFields(e),failure:`http`,statusCode:r.status,error:Error(`Callback request failed with HTTP ${r.status}.`)}),r}async function requestCallback(e,t){let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`)throw new UnsafeDestinationError(`Callback URL must use http or https.`);let r={allowLoopback:isLocalDevelopmentServer()};assertPublicHostname(n.hostname,r);let i=await createPublicDispatcher(r);try{let n=await fetchWithDispatcher(e,{...t,dispatcher:i,method:`POST`,redirect:`error`});return await readBoundedResponse(n,65536)}finally{await i.close()}}function callbackLogFields(e){let t=URL.parse(e.url),n=t?.pathname.match(/^(.*?\/(?:callback|activity))\//)?.[1],r={callbackOrigin:t?.origin,callbackPath:n===void 0?`[redacted]`:`${n}/[redacted]`};if(isObject(e.body)){for(let t of[`kind`,`callId`,`sessionId`,`childSessionId`,`subagentName`,`updateEpoch`])typeof e.body[t]==`string`&&(r[t]=e.body[t]);typeof e.body.updateIndex==`number`&&(r.updateIndex=e.body.updateIndex)}return r}async function resolveSessionCallbackHeaders(e){let t={"content-type":`application/json`};if(process.env.VERCEL!==`1`)return t;let n;try{n=new URL(e)}catch{return t}let r=VERCEL_CALLBACK_HOST_ENVS.some(e=>process.env[e]?.trim().toLowerCase()===n.hostname.toLowerCase());if(n.protocol!==`https:`||!r)return t;let i=readAmbientVercelOidcToken();return i!==void 0&&(t[`x-vercel-trusted-oidc-idp-token`]=i),t}function readAmbientVercelOidcToken(){let e=(globalThis[VERCEL_REQUEST_CONTEXT]?.get?.().headers?.[`x-vercel-oidc-token`]??process.env.VERCEL_OIDC_TOKEN)?.trim();return e===``?void 0:e}export{postSessionCallbackRequest};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SessionStreamEvent } from "#protocol/session-event.js";
|
|
2
|
+
import { type StoredLine } from "#protocol/session-events/envelope.js";
|
|
2
3
|
/** Options for {@link streamSessionEvents}. */
|
|
3
4
|
export interface SessionEventStreamOptions {
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* Position of the first line to read. Negative values count back from the
|
|
7
|
+
* durable tail (`-1` is the latest line). Defaults to `0`.
|
|
7
8
|
*/
|
|
8
9
|
readonly startIndex?: number;
|
|
9
10
|
/**
|
|
10
|
-
* Whether to keep following
|
|
11
|
+
* Whether to keep following lines recorded after the read opens. When
|
|
11
12
|
* `false`, the read ends at the durable tail observed when it opens.
|
|
12
13
|
* Defaults to `true`.
|
|
13
14
|
*/
|
|
@@ -15,18 +16,35 @@ export interface SessionEventStreamOptions {
|
|
|
15
16
|
/** Stops the read and releases the underlying stream reader. */
|
|
16
17
|
readonly signal?: AbortSignal;
|
|
17
18
|
}
|
|
19
|
+
/** One stored line and its position. A line this version can't read has `line: undefined`. */
|
|
20
|
+
export interface PositionedLine {
|
|
21
|
+
readonly position: number;
|
|
22
|
+
readonly line: StoredLine | undefined;
|
|
23
|
+
/** The line as stored, parsed. */
|
|
24
|
+
readonly record: unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Reads one session's stored records from `startIndex`, one per line, as parsed JSON. Negative
|
|
28
|
+
* `startIndex` values count back from the tail. Callers count positions: one per record.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readSessionRecords(sessionId: string, startIndex?: number): ReadableStream<unknown>;
|
|
18
31
|
/**
|
|
19
|
-
* Reads one session's
|
|
20
|
-
*
|
|
32
|
+
* Reads one session's events, following new lines as they're written. Records of types this
|
|
33
|
+
* version doesn't know, including a pre-v27 session's, are skipped.
|
|
21
34
|
*/
|
|
22
|
-
export declare function readSessionEventStream(sessionId: string, startIndex?: number): ReadableStream<
|
|
35
|
+
export declare function readSessionEventStream(sessionId: string, startIndex?: number, signal?: AbortSignal): ReadableStream<SessionStreamEvent>;
|
|
23
36
|
/**
|
|
24
37
|
* Reads one session's recorded events up to the durable tail observed when
|
|
25
38
|
* the read opens, then ends. Negative `startIndex` values count back from
|
|
26
39
|
* that tail.
|
|
27
40
|
*/
|
|
28
|
-
export declare function readSessionEventHistory(sessionId: string, startIndex?: number): ReadableStream<
|
|
29
|
-
/**
|
|
41
|
+
export declare function readSessionEventHistory(sessionId: string, startIndex?: number, signal?: AbortSignal): ReadableStream<SessionStreamEvent>;
|
|
42
|
+
/**
|
|
43
|
+
* Reads one session's stored records up to the durable tail observed when the read opens, then
|
|
44
|
+
* ends. Negative `startIndex` values count back from that tail.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readSessionRecordHistory(sessionId: string, startIndex?: number): ReadableStream<unknown>;
|
|
47
|
+
/** Returns the position of the last durably recorded line, or `-1` before the first. */
|
|
30
48
|
export declare function readSessionStreamTailIndex(sessionId: string): Promise<number>;
|
|
31
49
|
/**
|
|
32
50
|
* Throws when the session's run does not exist or its recorded history has
|
|
@@ -35,11 +53,14 @@ export declare function readSessionStreamTailIndex(sessionId: string): Promise<n
|
|
|
35
53
|
*/
|
|
36
54
|
export declare function assertSessionHistoryReadable(sessionId: string): Promise<void>;
|
|
37
55
|
/**
|
|
38
|
-
* Iterates one session's
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
* Iterates one session's stored lines in process, without the HTTP stream route, with each
|
|
57
|
+
* line's position. A bounded read stops at the tail it observed when it opened: the writer
|
|
58
|
+
* stores one chunk per line, so positions are chunk indexes.
|
|
59
|
+
*/
|
|
60
|
+
export declare function streamSessionLines(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator<PositionedLine, void, undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Iterates one session's events in process, from the lines {@link streamSessionLines} reads.
|
|
63
|
+
* A session an eve before v27 recorded reads as the v27 commits its v26 lines record; see
|
|
64
|
+
* `#execution/v26-history.js`.
|
|
44
65
|
*/
|
|
45
|
-
export declare function streamSessionEvents(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator<
|
|
66
|
+
export declare function streamSessionEvents(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator<SessionStreamEvent, void, undefined>;
|