eve 0.47.6 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/src/channel/adapter.js +1 -1
- package/dist/src/channel/delivery-metadata.d.ts +1 -0
- package/dist/src/channel/delivery-metadata.js +1 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +10 -8
- package/dist/src/chunks/{use-eve-agent-DkUB0Ok4.js → use-eve-agent-BZnOzAVd.js} +25 -6
- package/dist/src/chunks/{use-eve-agent-DjYwFJF7.js → use-eve-agent-Bgp6INfi.js} +25 -6
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.d.ts +2 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +3 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/registry-declared-setups.js +1 -1
- package/dist/src/cli/commands/registry-install-transaction.d.ts +23 -0
- package/dist/src/cli/commands/registry-install-transaction.js +1 -0
- package/dist/src/cli/commands/registry-package.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/setup-headless.d.ts +6 -0
- package/dist/src/cli/commands/setup-headless.js +1 -1
- package/dist/src/cli/dev/command-options.d.ts +2 -0
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +4 -0
- package/dist/src/cli/dev/tui/line-editor.js +3 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/registry-result-message.d.ts +17 -0
- package/dist/src/cli/dev/tui/registry-result-message.js +3 -0
- package/dist/src/cli/dev/tui/runner.d.ts +13 -4
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +9 -3
- package/dist/src/cli/dev/tui/setup-commands.js +2 -3
- package/dist/src/cli/dev/tui/setup-flow.d.ts +15 -5
- package/dist/src/cli/dev/tui/setup-panel.d.ts +6 -1
- package/dist/src/cli/dev/tui/setup-panel.js +4 -4
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +1 -0
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +8 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +3 -0
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +3 -4
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/client/agent-info-schema.d.ts +1 -1
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/open-stream.d.ts +1 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/@opentelemetry/api/index.d.ts +6 -0
- package/dist/src/compiled/@workflow/builders/LICENSE.md +201 -0
- package/dist/src/compiled/@workflow/builders/index.d.ts +62 -0
- package/dist/src/compiled/@workflow/builders/index.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +2 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +7 -17
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +0 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/context/build-dynamic-tools.d.ts +2 -2
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/container.d.ts +7 -0
- package/dist/src/context/container.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +16 -9
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +44 -0
- package/dist/src/context/dynamic-tool-metadata.js +1 -0
- package/dist/src/context/keys.d.ts +14 -22
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +0 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/eve-channel/types.d.ts +7 -7
- package/dist/src/execution/accepted-delivery-deployment.d.ts +7 -0
- package/dist/src/execution/accepted-delivery-deployment.js +1 -0
- package/dist/src/execution/cancel-descendant-turns-step.d.ts +4 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/delegation-tool.d.ts +1 -2
- package/dist/src/execution/delegation-tool.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +14 -4
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-turn-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +2 -0
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +1 -0
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +25 -3
- package/dist/src/execution/durable-session-migrations/turn-workflow.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/finalize-terminal-session.d.ts +17 -0
- package/dist/src/execution/finalize-terminal-session.js +1 -0
- package/dist/src/execution/inline-turn.d.ts +29 -0
- package/dist/src/execution/inline-turn.js +1 -0
- package/dist/src/execution/next-driver-action.d.ts +4 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/pending-turn-state.d.ts +1 -0
- package/dist/src/execution/pending-turn-state.js +1 -1
- package/dist/src/execution/prepared-agent-action.d.ts +7 -0
- package/dist/src/execution/prepared-agent-action.js +1 -0
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/remote-agent-dispatch.d.ts +2 -0
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/session-command-token.d.ts +2 -0
- package/dist/src/execution/session-command-token.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +12 -0
- package/dist/src/execution/stable-workflow-names.js +1 -0
- package/dist/src/execution/subagent-event-proxy-step.d.ts +3 -0
- package/dist/src/execution/subagent-event-proxy-step.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +2 -1
- package/dist/src/execution/subagent-hitl-proxy.js +1 -1
- package/dist/src/execution/subagent-start-local.d.ts +3 -0
- package/dist/src/execution/subagent-start-local.js +1 -1
- package/dist/src/execution/subagent-start-remote.d.ts +2 -0
- package/dist/src/execution/subagent-start-remote.js +1 -1
- package/dist/src/execution/subagent-tool.d.ts +1 -0
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +2 -0
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/update.d.ts +3 -2
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +5 -4
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +4 -3
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.js +1 -1
- package/dist/src/execution/terminal-session-event.d.ts +13 -0
- package/dist/src/execution/terminal-session-event.js +1 -0
- package/dist/src/execution/terminal-session-failure-step.d.ts +1 -0
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/tool-run/answer.d.ts +3 -0
- package/dist/src/execution/tool-run/answer.js +1 -0
- package/dist/src/execution/tool-run/background.d.ts +14 -0
- package/dist/src/execution/tool-run/background.js +1 -0
- package/dist/src/execution/tool-run/cancel.d.ts +7 -0
- package/dist/src/execution/tool-run/cancel.js +1 -0
- package/dist/src/execution/tool-run/dispatch.d.ts +24 -0
- package/dist/src/execution/tool-run/dispatch.js +1 -0
- package/dist/src/execution/tool-run/emit-run-report-step.d.ts +7 -0
- package/dist/src/execution/tool-run/emit-run-report-step.js +1 -0
- package/dist/src/execution/tool-run/messages.d.ts +70 -0
- package/dist/src/execution/tool-run/messages.js +1 -0
- package/dist/src/execution/tool-run/owner-channels.d.ts +29 -0
- package/dist/src/execution/tool-run/owner-channels.js +1 -0
- package/dist/src/execution/tool-run/owner-inbox.d.ts +11 -0
- package/dist/src/execution/tool-run/owner-inbox.js +1 -0
- package/dist/src/execution/tool-run/owner.d.ts +13 -0
- package/dist/src/execution/tool-run/owner.js +1 -0
- package/dist/src/execution/tool-run/resume-hook-step.d.ts +4 -0
- package/dist/src/execution/tool-run/resume-hook-step.js +1 -0
- package/dist/src/execution/tool-run/run-control.d.ts +18 -0
- package/dist/src/execution/tool-run/run-control.js +1 -0
- package/dist/src/execution/tool-run/start.d.ts +11 -0
- package/dist/src/execution/tool-run/start.js +1 -0
- package/dist/src/execution/tool-run/types.d.ts +21 -0
- package/dist/src/execution/tool-run/types.js +1 -0
- package/dist/src/execution/tool-run/workflow.d.ts +9 -0
- package/dist/src/execution/tool-run/workflow.js +1 -0
- package/dist/src/execution/tools/subagent/local.d.ts +3 -4
- package/dist/src/execution/tools/subagent/local.js +1 -1
- package/dist/src/execution/tools/subagent/remote.d.ts +4 -1
- package/dist/src/execution/tools/subagent/remote.js +1 -1
- package/dist/src/execution/turn-cancellation-control.d.ts +2 -0
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-dispatch.d.ts +4 -2
- package/dist/src/execution/turn-dispatch.js +1 -1
- package/dist/src/execution/turn-execution-cursor.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
- package/dist/src/execution/wire/session-inbox-contract.js +1 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +6 -2
- package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
- package/dist/src/execution/wire/session-inbox-resume.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +480 -0
- package/dist/src/execution/wire/session-inbox-wire.v3.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +1 -0
- package/dist/src/execution/workflow-entry-finalization.d.ts +22 -0
- package/dist/src/execution/workflow-entry-finalization.js +1 -0
- package/dist/src/execution/workflow-entry.d.ts +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-registry.d.ts +5 -0
- package/dist/src/execution/workflow-registry.js +1 -0
- package/dist/src/execution/workflow-runtime.d.ts +9 -11
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-webhook-route.d.ts +4 -0
- package/dist/src/execution/workflow-webhook-route.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +3 -0
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.d.ts +6 -0
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/background-tools.d.ts +2 -0
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +2 -28
- package/dist/src/harness/hitl/pending-input-resolution.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +3 -0
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +10 -0
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/runtime-actions.d.ts +11 -3
- package/dist/src/harness/runtime-actions.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +2 -1
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/subagent-depth.d.ts +3 -4
- package/dist/src/harness/subagent-depth.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-runs.d.ts +21 -0
- package/dist/src/harness/tool-runs.js +1 -0
- package/dist/src/harness/tools.d.ts +0 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +6 -7
- package/dist/src/harness/workflow-runtime-action-state.d.ts +3 -3
- package/dist/src/harness/workflow-runtime-action-state.js +1 -1
- package/dist/src/harness/workflow-sandbox.js +1 -1
- package/dist/src/harness/workflow-subagent-limit.d.ts +4 -4
- package/dist/src/instrumentation/ai-sdk-telemetry.d.ts +1 -0
- package/dist/src/instrumentation/ai-sdk-telemetry.js +1 -1
- package/dist/src/instrumentation/content-policy.d.ts +3 -1
- package/dist/src/instrumentation/content-policy.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +5 -2
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/internal/application/build-output-environment.d.ts +2 -0
- package/dist/src/internal/application/build-output-environment.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.d.ts +1 -2
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/attachments/errors.d.ts +3 -0
- package/dist/src/internal/authored-definition/schema-backed.d.ts +6 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +7 -1
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +2 -0
- package/dist/src/internal/authored-runtime-modules.js +1 -1
- package/dist/src/internal/client-context.d.ts +2 -0
- package/dist/src/internal/client-context.js +1 -0
- package/dist/src/internal/nitro/dev-client-address.d.ts +2 -0
- package/dist/src/internal/nitro/dev-client-address.js +1 -1
- package/dist/src/internal/nitro/development-generation.d.ts +2 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.d.ts +2 -2
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- 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/workflow-bundle/authored-workflow-directives.d.ts +17 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +19 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -0
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +17 -2
- package/dist/src/internal/workflow-bundle/builder-support.js +4 -3
- package/dist/src/internal/workflow-bundle/builder.d.ts +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.d.ts +2 -0
- package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-ast-references.d.ts +3 -0
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +6 -2
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +3 -0
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-directive-ast.d.ts +7 -0
- package/dist/src/internal/workflow-bundle/workflow-directive-ast.js +1 -0
- package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +15 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +4 -4
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/protocol/baggage.d.ts +6 -0
- package/dist/src/protocol/baggage.js +1 -0
- package/dist/src/protocol/routes.d.ts +2 -2
- package/dist/src/public/channels/slack/attachments.js +1 -1
- package/dist/src/public/channels/teams/attachments.d.ts +2 -2
- package/dist/src/public/channels/teams/attachments.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/attachments.js +1 -1
- package/dist/src/public/definitions/remote-agent.d.ts +6 -3
- package/dist/src/public/local-dev.d.ts +9 -0
- package/dist/src/public/local-dev.js +1 -0
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/workflow/index.d.ts +3 -0
- package/dist/src/public/workflow/index.js +1 -0
- package/dist/src/public/workflow-modules.d.js +1 -0
- package/dist/src/public/workflow-modules.d.ts +11 -0
- package/dist/src/runtime/actions/keys.d.ts +3 -0
- package/dist/src/runtime/actions/keys.js +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/local-dev-capability.d.ts +55 -0
- package/dist/src/runtime/local-dev-capability.js +1 -0
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sessions/runtime-session.d.ts +1 -0
- package/dist/src/runtime/sessions/runtime-session.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +3 -0
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.d.ts +1 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +2 -2
- package/dist/src/services/dev-client/client-options.d.ts +1 -0
- package/dist/src/services/dev-client/client-options.js +1 -1
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +2 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
- package/dist/src/setup/connection-connector.d.ts +4 -2
- package/dist/src/setup/connection-connector.js +2 -2
- package/dist/src/setup/flows/login.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +5 -0
- package/dist/src/setup/flows/provider.js +4 -4
- package/dist/src/setup/flows/registry-session.d.ts +24 -7
- package/dist/src/setup/flows/registry-session.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +35 -29
- package/dist/src/setup/flows/registry.js +2 -1
- package/dist/src/setup/integrations/web/setup.d.ts +0 -2
- package/dist/src/setup/integrations/web/setup.js +1 -1
- package/dist/src/setup/prompter.d.ts +24 -4
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/dispatch-action.d.ts +30 -0
- package/dist/src/shared/dispatch-action.js +1 -0
- package/dist/src/shared/forwarded-trace-policy.d.ts +28 -0
- package/dist/src/shared/forwarded-trace-policy.js +1 -0
- package/dist/src/shared/instrumentation-decision.d.ts +3 -0
- package/dist/src/shared/instrumentation-decision.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tools/behavior.d.ts +61 -0
- package/dist/src/tools/behavior.js +1 -0
- package/dist/src/tools/definition.d.ts +39 -3
- package/dist/src/tools/durable-callbacks.d.ts +1 -0
- package/dist/src/tools/framework/agent.d.ts +2 -11
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/ask-question.d.ts +2 -14
- package/dist/src/tools/framework/ask-question.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +2 -7
- package/dist/src/tools/framework/task-cancel.js +1 -1
- package/dist/src/tools/framework/task-contract.d.ts +0 -2
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/framework/task-update.d.ts +2 -7
- package/dist/src/tools/framework/task-update.js +1 -1
- package/dist/src/tools/native-definition.d.ts +6 -0
- package/dist/src/tools/native-definition.js +1 -0
- package/dist/src/tools/provided/load-skill.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-store.d.ts +1 -1
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +5 -3
- package/dist/src/tracing/otel-registration.d.ts +3 -1
- package/dist/src/tracing/otel-registration.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/custom.mdx +2 -0
- package/docs/channels/eve.mdx +5 -1
- package/docs/channels/teams.mdx +6 -1
- package/docs/concepts/sessions-runs-and-streaming.md +4 -2
- package/docs/guides/auth-and-route-protection.md +5 -1
- package/docs/guides/client/messages.mdx +6 -0
- package/docs/guides/dev-tui.md +30 -18
- package/docs/guides/remote-agents.md +25 -0
- package/docs/reference/cli.md +2 -2
- package/docs/reference/typescript-api.md +24 -0
- package/docs/tools/meta.json +1 -1
- package/docs/tools/overview.mdx +7 -0
- package/docs/tools/workflows.mdx +288 -0
- package/package.json +17 -1
- package/dist/src/execution/tools/tasks.d.ts +0 -18
- package/dist/src/execution/tools/tasks.js +0 -1
- package/dist/src/internal/authored-directive-prologue.d.ts +0 -4
- package/dist/src/internal/authored-directive-prologue.js +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { DeliverHookPayload, SessionCommand, SessionTimeoutHookPayload } from "#channel/types.js";
|
|
2
2
|
import { type SessionInboxWireV1 } from "#execution/wire/session-inbox-wire.v1.js";
|
|
3
3
|
import { type SessionInboxWireV2 } from "#execution/wire/session-inbox-wire.v2.js";
|
|
4
|
+
import { type SessionInboxWireV3 } from "#execution/wire/session-inbox-wire.v3.js";
|
|
4
5
|
import { type SessionInboxWireTarget, type SessionInboxWireVersion } from "#execution/wire/session-inbox-contract.js";
|
|
5
6
|
type SessionInboxCommand = DeliverHookPayload | SessionCommand | SessionTimeoutHookPayload;
|
|
6
7
|
/** Current wire type consumed after migration. */
|
|
7
|
-
export type SessionInboxWire =
|
|
8
|
+
export type SessionInboxWire = SessionInboxWireV3;
|
|
8
9
|
type LegacySessionInboxWireTarget = Extract<SessionInboxWireTarget, {
|
|
9
10
|
readonly version: 0;
|
|
10
11
|
}>;
|
|
@@ -15,11 +16,14 @@ declare function encode(command: SessionInboxCommand, target: {
|
|
|
15
16
|
declare function encode(command: SessionInboxCommand, target: {
|
|
16
17
|
readonly version: 2;
|
|
17
18
|
}): SessionInboxWireV2;
|
|
19
|
+
declare function encode(command: SessionInboxCommand, target: {
|
|
20
|
+
readonly version: 3;
|
|
21
|
+
}): SessionInboxWireV3;
|
|
18
22
|
declare function encode(command: SessionInboxCommand, target: {
|
|
19
23
|
readonly version: SessionInboxWireVersion;
|
|
20
24
|
}): unknown;
|
|
21
25
|
declare function encode(command: SessionInboxCommand, target: LegacySessionInboxWireTarget): Record<string, unknown>;
|
|
22
|
-
declare function encode(command: SessionInboxCommand, target: SessionInboxWireTarget): SessionInboxWireV1 | SessionInboxWireV2 | Record<string, unknown>;
|
|
26
|
+
declare function encode(command: SessionInboxCommand, target: SessionInboxWireTarget): SessionInboxWireV1 | SessionInboxWireV2 | SessionInboxWireV3 | Record<string, unknown>;
|
|
23
27
|
/** Server/step-safe producer facade. */
|
|
24
28
|
export declare const sessionInboxWire: {
|
|
25
29
|
readonly encode: typeof encode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SessionInboxWireError,isSessionInboxWireVersion}from"#execution/wire/session-inbox-contract.js";import{encodeSessionCommandV1}from"#execution/wire/session-inbox-wire.v1.js";import{encodeSessionCommandV2}from"#execution/wire/session-inbox-wire.v2.js";import{encodeSessionCommandV0}from"#execution/wire/session-inbox-wire.v0.js";const versionedEncoders={1:e=>encodeSessionCommandV1(
|
|
1
|
+
import{SessionInboxWireError,isSessionInboxWireVersion}from"#execution/wire/session-inbox-contract.js";import{encodeSessionCommandV1}from"#execution/wire/session-inbox-wire.v1.js";import{encodeSessionCommandV2}from"#execution/wire/session-inbox-wire.v2.js";import{encodeSessionCommandV3}from"#execution/wire/session-inbox-wire.v3.js";import{encodeSessionCommandV0}from"#execution/wire/session-inbox-wire.v0.js";const versionedEncoders={1:e=>encodeSessionCommandV1(withoutAcceptedDeployment(e)),2:e=>encodeSessionCommandV2(withoutAcceptedDeployment(e)),3:encodeSessionCommandV3};function encode(r,i){if(i.version===0){let e=encodeSessionCommandV0(encodeSessionCommandV1(withoutAcceptedDeployment(r)),i.variant),t=e,a=t.delivery,o=readAcceptedDeploymentId(r);return i.variant!==`send`||o===void 0||t.kind!==`send`||typeof a!=`object`||!a?e:{...e,delivery:{...a,acceptedDeploymentId:o}}}if(isSessionInboxWireVersion(i.version))return versionedEncoders[i.version](r);throw new SessionInboxWireError(`Cannot encode session inbox payload for unknown wire version ${JSON.stringify(i.version)}.`)}function withoutAcceptedDeployment(e){if(e.kind===`send`&&e.delivery?.acceptedDeploymentId!==void 0){let{acceptedDeploymentId:t,...n}=e.delivery;return{...e,delivery:n}}return e.kind!==`deliver`||e.deliveryMetadata===void 0?e:{...e,deliveryMetadata:e.deliveryMetadata.map(e=>{let{acceptedDeploymentId:t,...n}=e;return n})}}function readAcceptedDeploymentId(e){if(e.kind===`send`)return e.delivery?.acceptedDeploymentId;if(e.kind===`deliver`)return e.deliveryMetadata?.find(e=>e.payloadIndex===0)?.acceptedDeploymentId}const sessionInboxWire={encode};export{sessionInboxWire};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sessionCommandHookToken}from"#execution/session-command-token.js";import{isObject}from"#shared/guards.js";import{getHookByToken,resumeHook}from"#internal/workflow/runtime.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{SESSION_INBOX_WIRE_VERSION_METADATA_KEY,SessionInboxWireError,isSessionInboxWireVersion}from"#execution/wire/session-inbox-contract.js";import{sessionInboxWire}from"#execution/wire/session-inbox-encoder.js";async function resumeSessionInbox(e,t){let
|
|
1
|
+
import{isSessionCommandHookToken,sessionCommandHookToken}from"#execution/session-command-token.js";import{isObject}from"#shared/guards.js";import{getHookByToken,resumeHook}from"#internal/workflow/runtime.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{SESSION_INBOX_WIRE_VERSION_METADATA_KEY,SessionInboxWireError,isSessionInboxWireVersion}from"#execution/wire/session-inbox-contract.js";import{sessionInboxWire}from"#execution/wire/session-inbox-encoder.js";async function resumeSessionInbox(e,t){if(isStableInboxFastPathCompatible(e,t))return await resumeHook(e,sessionInboxWire.encode(t,{variant:`send`,version:0}));let n=await getHookByToken(e),i=await resolveSessionInboxWireTarget(n);return await resumeHook(n,sessionInboxWire.encode(t,i))}function isStableInboxFastPathCompatible(t,n){return isSessionCommandHookToken(t)?!(`caller`in n&&n.caller?.activityObserver!==void 0):!1}async function resolveSessionInboxWireTarget(e){let r=isObject(e.metadata)?e.metadata:void 0;if(r!==void 0&&SESSION_INBOX_WIRE_VERSION_METADATA_KEY in r){let e=r[SESSION_INBOX_WIRE_VERSION_METADATA_KEY];if(isSessionInboxWireVersion(e))return{version:e};throw new SessionInboxWireError(`Session inbox target declares unsupported wire version ${JSON.stringify(e)}.`)}let a=sessionCommandHookToken(e.runId);if(e.token===a)return{variant:`send`,version:0};try{let t=await getHookByToken(a);if(t.runId!==e.runId)throw new SessionInboxWireError(`Stable session inbox ${JSON.stringify(a)} belongs to run ${JSON.stringify(t.runId)}, expected ${JSON.stringify(e.runId)}.`);return{variant:`send`,version:0}}catch(e){if(HookNotFoundError.is(e))return{variant:`deliver`,version:0};throw e}}export{resolveSessionInboxWireTarget,resumeSessionInbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SESSION_INBOX_WIRE_VERSION,SessionInboxWireError,SessionInboxWireError as SessionInboxWireError$1}from"#execution/wire/session-inbox-contract.js";import{sessionInboxWireV0Migration}from"#execution/wire/session-inbox-wire.v0.js";import{runMigrationChain}from"#execution/durable-session-migrations/chain.js";import{normalizeSessionInboxWireV2
|
|
1
|
+
import{SESSION_INBOX_WIRE_VERSION,SessionInboxWireError,SessionInboxWireError as SessionInboxWireError$1}from"#execution/wire/session-inbox-contract.js";import{sessionInboxWireV0Migration}from"#execution/wire/session-inbox-wire.v0.js";import{runMigrationChain}from"#execution/durable-session-migrations/chain.js";import{normalizeSessionInboxWireV2}from"#execution/wire/session-inbox-wire.v2-migration.js";import{sessionInboxWireV1Migration}from"#execution/wire/session-inbox-wire.v2.migration.js";import{sessionInboxWireV2Migration}from"#execution/wire/session-inbox-wire.v3.migration.js";const WIRE_LABEL=`session inbox payload`,sessionInboxMigrations=[sessionInboxWireV0Migration,sessionInboxWireV1Migration,sessionInboxWireV2Migration];function decode(t){let n=typeof t==`object`&&t&&`version`in t?t.version:void 0;if(typeof t==`object`&&t&&`version`in t&&typeof n!=`number`)throw new SessionInboxWireError$1(`${WIRE_LABEL}: value has no numeric "version" field.`);let r=normalizeSessionInboxWireV2(t),i;try{i=runMigrationChain({initialVersion:0,label:WIRE_LABEL,migrations:sessionInboxMigrations,targetVersion:SESSION_INBOX_WIRE_VERSION,value:r})}catch(e){throw new SessionInboxWireError$1(e instanceof Error?e.message:String(e))}let a=normalizeSessionInboxWireV2(i);if(a.version!==SESSION_INBOX_WIRE_VERSION)throw new SessionInboxWireError$1(`${WIRE_LABEL} declares version ${JSON.stringify(a.version)}, expected ${SESSION_INBOX_WIRE_VERSION}.`);if(typeof n==`number`&&n>=2&&a.kind===`deliver`&&!(`payload`in a))throw new SessionInboxWireError$1(`${WIRE_LABEL} does not match wire version ${n}.`);return normalizeWire(a)}const sessionInboxWire={decode};function normalizeWire(e){switch(e.kind){case`deliver`:return{auth:e.auth,caller:e.caller,deliveryMetadata:e.deliveryMetadata,kind:`deliver`,payloads:e.payloads,requestId:e.requestId,taskDeliveryId:e.taskDeliveryId,turnPolicy:e.turnPolicy};case`session-timeout`:return{kind:`session-timeout`};case`clear`:return{kind:`clear`};case`compact`:return{kind:`compact`};case`reset`:return{kind:`reset`,reason:e.reason};case`cancel`:return{kind:`cancel`,taskId:e.taskId,turnId:e.turnId};default:throw new SessionInboxWireError$1(`${WIRE_LABEL} has an unrecognized kind ${JSON.stringify(e.kind)}.`)}}export{SessionInboxWireError,sessionInboxWire};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{inputRequestSchema,inputResponseSchema}from"#shared/input.js";import{formatValidationError}from"#runtime/validation.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{tokenUsageSchema}from"#shared/token-usage.js";import{SessionInboxWireError}from"#execution/wire/session-inbox-contract.js";const providerOptionsSchema=z.record(z.string(),jsonObjectSchema),textPartSchema=z.object({providerOptions:providerOptionsSchema.optional(),text:z.string(),type:z.literal(`text`)}).strict(),binaryDataSchema=z.custom(e=>typeof e==`string`||e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof URL,`Expected a string, URL, Uint8Array, or ArrayBuffer.`),imagePartSchema=z.object({image:binaryDataSchema,mediaType:z.string().optional(),providerOptions:providerOptionsSchema.optional(),type:z.literal(`image`)}).strict(),filePartSchema=z.object({data:binaryDataSchema,filename:z.string().optional(),mediaType:z.string(),providerOptions:providerOptionsSchema.optional(),type:z.literal(`file`)}).strict(),userContentSchema=z.union([z.string(),z.array(z.discriminatedUnion(`type`,[textPartSchema,imagePartSchema,filePartSchema]))]),eventCoordinateSchema=z.number().int().nonnegative(),opaqueObjectSchema=z.custom(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`Expected an object.`),subagentInputRequestHookPayloadSchema=z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:z.object({requests:z.array(inputRequestSchema),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}).strict(),kind:z.literal(`subagent-input-request`),subagentName:z.string()}).strict(),subagentAuthorizationEventHookPayloadSchema=z.object({callId:z.string(),childSessionId:z.string(),event:opaqueObjectSchema,kind:z.literal(`subagent-authorization-event`),subagentName:z.string()}).strict(),taskMetadataSchema=z.union([z.object({agentId:z.string(),kind:z.literal(`subagent`),mode:z.enum([`local`,`remote`]),name:z.string()}).strict(),z.object({kind:z.string(),name:z.string()}).strict()]),taskViewBase={executor:z.object({binding:z.object({data:z.record(z.string(),jsonValueSchema),kind:z.string()}).strict().optional(),childSessionId:z.string().optional(),childTurnId:z.string().optional(),lifecycle:z.enum([`parked`,`terminal`]).optional()}).strict().optional(),metadata:taskMetadataSchema,taskId:z.string(),usage:tokenUsageSchema.optional()},taskViewSchema=z.discriminatedUnion(`status`,[z.object({...taskViewBase,status:z.literal(`working`)}).strict(),z.object({...taskViewBase,inputRequests:z.array(jsonValueSchema),status:z.literal(`input_required`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`result`)}).strict(),status:z.literal(`completed`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`error`)}).strict(),status:z.literal(`failed`)}).strict(),z.object({...taskViewBase,status:z.literal(`cancelled`)}).strict()]),taskPayloadSchema=z.object({authorizationEvents:z.array(z.object({hookPayload:subagentAuthorizationEventHookPayloadSchema,taskId:z.string()}).strict()).optional(),inputRequests:z.array(z.object({hookPayload:subagentInputRequestHookPayloadSchema,taskId:z.string()}).strict()).optional(),views:z.array(taskViewSchema).optional()}).strict(),deliverPayloadSchema=z.object({context:z.array(z.string()).optional(),inputResponses:z.array(inputResponseSchema).optional(),message:userContentSchema.optional(),outputSchema:jsonObjectSchema.optional(),task:taskPayloadSchema.optional()}).loose(),authSchema=z.object({attributes:z.record(z.string(),z.union([z.string(),z.array(z.string())])),authenticator:z.string(),issuer:z.string().optional(),principalId:z.string(),principalType:z.string(),subject:z.string().optional()}).strict(),callerSchema=z.object({callId:z.string(),replyTo:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`hook`),token:z.string()}).strict(),z.object({kind:z.literal(`callback`),token:z.string(),url:z.string()}).strict()]),subagentName:z.string(),taskId:z.string().optional()}).strict(),traceContextSchema=z.object({spanId:z.string(),traceFlags:z.number(),traceId:z.string()}).strict(),deliveryMetadataSchema=z.object({channelKind:z.string(),channelName:z.string(),deliveryId:z.string(),payloadIndex:z.number().int().nonnegative(),requestId:z.string().optional(),requestTraceContext:traceContextSchema.optional()}).strict(),version=z.literal(1),sessionInboxWireV1Schema=z.discriminatedUnion(`kind`,[z.object({auth:authSchema.nullable().optional(),caller:callerSchema.optional(),deliveryMetadata:z.array(deliveryMetadataSchema).optional(),kind:z.literal(`deliver`),payload:deliverPayloadSchema.optional(),payloads:z.array(deliverPayloadSchema),requestId:z.string().optional(),taskDeliveryId:z.string().optional(),turnPolicy:z.enum([`queue`,`steer`]).optional(),version}).strict(),z.object({kind:z.literal(`session-timeout`),version}).strict(),z.object({kind:z.literal(`clear`),version}).strict(),z.object({kind:z.literal(`compact`),version}).strict(),z.object({kind:z.literal(`reset`),reason:z.string().optional(),version}).strict(),z.object({kind:z.literal(`cancel`),taskId:z.string().optional(),turnId:z.string().optional(),version}).strict()]);function encodeSessionCommandV1(e){let t=e.kind===`send`?{auth:
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{inputRequestSchema,inputResponseSchema}from"#shared/input.js";import{formatValidationError}from"#runtime/validation.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{tokenUsageSchema}from"#shared/token-usage.js";import{SessionInboxWireError}from"#execution/wire/session-inbox-contract.js";const providerOptionsSchema=z.record(z.string(),jsonObjectSchema),textPartSchema=z.object({providerOptions:providerOptionsSchema.optional(),text:z.string(),type:z.literal(`text`)}).strict(),binaryDataSchema=z.custom(e=>typeof e==`string`||e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof URL,`Expected a string, URL, Uint8Array, or ArrayBuffer.`),imagePartSchema=z.object({image:binaryDataSchema,mediaType:z.string().optional(),providerOptions:providerOptionsSchema.optional(),type:z.literal(`image`)}).strict(),filePartSchema=z.object({data:binaryDataSchema,filename:z.string().optional(),mediaType:z.string(),providerOptions:providerOptionsSchema.optional(),type:z.literal(`file`)}).strict(),userContentSchema=z.union([z.string(),z.array(z.discriminatedUnion(`type`,[textPartSchema,imagePartSchema,filePartSchema]))]),eventCoordinateSchema=z.number().int().nonnegative(),opaqueObjectSchema=z.custom(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`Expected an object.`),subagentInputRequestHookPayloadSchema=z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:z.object({requests:z.array(inputRequestSchema),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}).strict(),kind:z.literal(`subagent-input-request`),subagentName:z.string()}).strict(),subagentAuthorizationEventHookPayloadSchema=z.object({callId:z.string(),childSessionId:z.string(),event:opaqueObjectSchema,kind:z.literal(`subagent-authorization-event`),subagentName:z.string()}).strict(),taskMetadataSchema=z.union([z.object({agentId:z.string(),kind:z.literal(`subagent`),mode:z.enum([`local`,`remote`]),name:z.string()}).strict(),z.object({kind:z.string(),name:z.string()}).strict()]),taskViewBase={executor:z.object({binding:z.object({data:z.record(z.string(),jsonValueSchema),kind:z.string()}).strict().optional(),childSessionId:z.string().optional(),childTurnId:z.string().optional(),lifecycle:z.enum([`parked`,`terminal`]).optional()}).strict().optional(),metadata:taskMetadataSchema,taskId:z.string(),usage:tokenUsageSchema.optional()},taskViewSchema=z.discriminatedUnion(`status`,[z.object({...taskViewBase,status:z.literal(`working`)}).strict(),z.object({...taskViewBase,inputRequests:z.array(jsonValueSchema),status:z.literal(`input_required`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`result`)}).strict(),status:z.literal(`completed`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`error`)}).strict(),status:z.literal(`failed`)}).strict(),z.object({...taskViewBase,status:z.literal(`cancelled`)}).strict()]),taskPayloadSchema=z.object({authorizationEvents:z.array(z.object({hookPayload:subagentAuthorizationEventHookPayloadSchema,taskId:z.string()}).strict()).optional(),inputRequests:z.array(z.object({hookPayload:subagentInputRequestHookPayloadSchema,taskId:z.string()}).strict()).optional(),views:z.array(taskViewSchema).optional()}).strict(),deliverPayloadSchema=z.object({context:z.array(z.string()).optional(),inputResponses:z.array(inputResponseSchema).optional(),message:userContentSchema.optional(),outputSchema:jsonObjectSchema.optional(),task:taskPayloadSchema.optional()}).loose(),authSchema=z.object({attributes:z.record(z.string(),z.union([z.string(),z.array(z.string())])),authenticator:z.string(),issuer:z.string().optional(),principalId:z.string(),principalType:z.string(),subject:z.string().optional()}).strict(),callerSchema=z.object({callId:z.string(),replyTo:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`hook`),token:z.string()}).strict(),z.object({kind:z.literal(`callback`),token:z.string(),url:z.string()}).strict()]),subagentName:z.string(),taskId:z.string().optional()}).strict(),callerProjectionSchema=callerSchema.strip(),traceContextSchema=z.object({spanId:z.string(),traceFlags:z.number(),traceId:z.string()}).strict(),deliveryMetadataSchema=z.object({channelKind:z.string(),channelName:z.string(),deliveryId:z.string(),payloadIndex:z.number().int().nonnegative(),requestId:z.string().optional(),requestTraceContext:traceContextSchema.optional()}).strict(),version=z.literal(1),sessionInboxWireV1Schema=z.discriminatedUnion(`kind`,[z.object({auth:authSchema.nullable().optional(),caller:callerSchema.optional(),deliveryMetadata:z.array(deliveryMetadataSchema).optional(),kind:z.literal(`deliver`),payload:deliverPayloadSchema.optional(),payloads:z.array(deliverPayloadSchema),requestId:z.string().optional(),taskDeliveryId:z.string().optional(),turnPolicy:z.enum([`queue`,`steer`]).optional(),version}).strict(),z.object({kind:z.literal(`session-timeout`),version}).strict(),z.object({kind:z.literal(`clear`),version}).strict(),z.object({kind:z.literal(`compact`),version}).strict(),z.object({kind:z.literal(`reset`),reason:z.string().optional(),version}).strict(),z.object({kind:z.literal(`cancel`),taskId:z.string().optional(),turnId:z.string().optional(),version}).strict()]);function encodeSessionCommandV1(e){let t=toV1Command(e),n=t.kind===`send`?{auth:t.auth,caller:t.caller,deliveryMetadata:t.delivery===void 0?void 0:[{...t.delivery,payloadIndex:0}],kind:`deliver`,payload:t.payload,payloads:[t.payload],requestId:t.requestId,taskDeliveryId:t.taskDeliveryId,turnPolicy:t.turnPolicy,version:1}:t.kind===`deliver`?{...t,payload:coalesceDeliverPayloads(t.payloads),version:1}:{...t,version:1},r=sessionInboxWireV1Schema.safeParse(n);if(!r.success)throw new SessionInboxWireError(`Produced a session inbox payload that does not match wire version 1: ${formatValidationError(r.error)}`);return r.data}function toV1Command(e){return!(`caller`in e)||e.caller===void 0?e:{...e,caller:toV1Caller(e.caller)}}function toV1Caller(e){let t=callerProjectionSchema.safeParse(e);if(!t.success)throw new SessionInboxWireError(`Produced a session inbox payload that does not match wire version 1: ${formatValidationError(t.error)}`);return t.data}export{encodeSessionCommandV1,sessionInboxWireV1Schema};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type { VersionMigration } from "#execution/durable-session-migrations/chain.js";
|
|
2
|
-
export declare const sessionInboxWireV1Migration: VersionMigration;
|
|
3
1
|
/** Converts Workflow-VM records into this realm before wire consumption. */
|
|
4
2
|
export declare function normalizeSessionInboxWireV2(value: unknown, arrayFallback?: boolean): unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject}from"#shared/guards.js";
|
|
1
|
+
import{isObject}from"#shared/guards.js";function normalizeSessionInboxWireV2(e,t=!1){return e===void 0?t?null:void 0:Array.isArray(e)?e.map(e=>normalizeSessionInboxWireV2(e,!0)):isPlainRecord$1(e)?Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0).map(([e,t])=>[e,normalizeSessionInboxWireV2(t)])):e}function isPlainRecord$1(t){if(!isObject(t))return!1;let n=Object.getPrototypeOf(t);return n===null||n===Object.prototype||Object.getPrototypeOf(n)===null}export{normalizeSessionInboxWireV2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const sessionInboxWireV1Migration={from:1,migrate(e){let t=e,n={...t,version:2};return t.kind===`deliver`&&!(`payload`in t)&&(n.payload={}),n},to:2};export{sessionInboxWireV1Migration};
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
|
+
import type { DeliverHookPayload, SessionCommand, SessionTimeoutHookPayload } from "#channel/types.js";
|
|
3
|
+
/** Version 3 adds the trusted deployment that accepted each channel delivery. */
|
|
4
|
+
export declare const sessionInboxWireV3Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
auth: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
6
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
7
|
+
authenticator: z.ZodString;
|
|
8
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
9
|
+
principalId: z.ZodString;
|
|
10
|
+
principalType: z.ZodString;
|
|
11
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strict>>>;
|
|
13
|
+
kind: z.ZodLiteral<"deliver">;
|
|
14
|
+
payloads: z.ZodArray<z.ZodObject<{
|
|
15
|
+
context: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
17
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
requestId: z.ZodString;
|
|
19
|
+
text: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strict>>>;
|
|
21
|
+
message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
23
|
+
text: z.ZodString;
|
|
24
|
+
type: z.ZodLiteral<"text">;
|
|
25
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
26
|
+
image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
|
|
27
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
28
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
29
|
+
type: z.ZodLiteral<"image">;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
|
|
32
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
33
|
+
mediaType: z.ZodString;
|
|
34
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
35
|
+
type: z.ZodLiteral<"file">;
|
|
36
|
+
}, z.core.$strict>], "type">>]>>;
|
|
37
|
+
outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
|
|
38
|
+
task: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
hookPayload: z.ZodObject<{
|
|
41
|
+
callId: z.ZodString;
|
|
42
|
+
childSessionId: z.ZodString;
|
|
43
|
+
event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
44
|
+
kind: z.ZodLiteral<"subagent-authorization-event">;
|
|
45
|
+
subagentName: z.ZodString;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
taskId: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>>;
|
|
49
|
+
inputRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
hookPayload: z.ZodObject<{
|
|
51
|
+
callId: z.ZodString;
|
|
52
|
+
childContinuationToken: z.ZodString;
|
|
53
|
+
childSessionId: z.ZodString;
|
|
54
|
+
event: z.ZodObject<{
|
|
55
|
+
requests: z.ZodArray<z.ZodObject<{
|
|
56
|
+
action: z.ZodObject<{
|
|
57
|
+
callId: z.ZodString;
|
|
58
|
+
input: z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>;
|
|
59
|
+
kind: z.ZodLiteral<"tool-call">;
|
|
60
|
+
toolName: z.ZodString;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
allowFreeform: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
confirmation: "confirmation";
|
|
65
|
+
select: "select";
|
|
66
|
+
text: "text";
|
|
67
|
+
}>>;
|
|
68
|
+
kind: z.ZodEnum<{
|
|
69
|
+
question: "question";
|
|
70
|
+
"session-limit": "session-limit";
|
|
71
|
+
"tool-approval": "tool-approval";
|
|
72
|
+
}>;
|
|
73
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
description: z.ZodOptional<z.ZodString>;
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
label: z.ZodString;
|
|
77
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
danger: "danger";
|
|
79
|
+
default: "default";
|
|
80
|
+
primary: "primary";
|
|
81
|
+
}>>;
|
|
82
|
+
}, z.core.$strict>>>;
|
|
83
|
+
prompt: z.ZodString;
|
|
84
|
+
requestId: z.ZodString;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
sequence: z.ZodNumber;
|
|
87
|
+
stepIndex: z.ZodNumber;
|
|
88
|
+
turnId: z.ZodString;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
kind: z.ZodLiteral<"subagent-input-request">;
|
|
91
|
+
subagentName: z.ZodString;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
taskId: z.ZodString;
|
|
94
|
+
}, z.core.$strict>>>;
|
|
95
|
+
views: z.ZodOptional<z.ZodArray<z.ZodType<import("../../tasks/types.ts").TaskView, unknown, z.core.$ZodTypeInternals<import("../../tasks/types.ts").TaskView, unknown>>>>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
}, z.core.$loose>>;
|
|
98
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
99
|
+
taskDeliveryId: z.ZodOptional<z.ZodString>;
|
|
100
|
+
turnPolicy: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
queue: "queue";
|
|
102
|
+
steer: "steer";
|
|
103
|
+
}>>;
|
|
104
|
+
caller: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
callId: z.ZodString;
|
|
106
|
+
replyTo: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
kind: z.ZodLiteral<"hook">;
|
|
108
|
+
token: z.ZodString;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"callback">;
|
|
111
|
+
token: z.ZodString;
|
|
112
|
+
url: z.ZodString;
|
|
113
|
+
}, z.core.$strict>], "kind">;
|
|
114
|
+
subagentName: z.ZodString;
|
|
115
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
activityObserver: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
sink: z.ZodObject<{
|
|
118
|
+
url: z.ZodString;
|
|
119
|
+
version: z.ZodLiteral<1>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
workIdentity: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
kind: z.ZodEnum<{
|
|
125
|
+
"remote-agent": "remote-agent";
|
|
126
|
+
"root-turn": "root-turn";
|
|
127
|
+
subagent: "subagent";
|
|
128
|
+
task: "task";
|
|
129
|
+
}>;
|
|
130
|
+
name: z.ZodOptional<z.ZodString>;
|
|
131
|
+
parentId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
rootSessionId: z.ZodString;
|
|
133
|
+
rootTurnId: z.ZodString;
|
|
134
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
payload: z.ZodObject<{
|
|
140
|
+
context: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
optionId: z.ZodOptional<z.ZodString>;
|
|
143
|
+
requestId: z.ZodString;
|
|
144
|
+
text: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strict>>>;
|
|
146
|
+
message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
147
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
148
|
+
text: z.ZodString;
|
|
149
|
+
type: z.ZodLiteral<"text">;
|
|
150
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
151
|
+
image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
|
|
152
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
153
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
154
|
+
type: z.ZodLiteral<"image">;
|
|
155
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
156
|
+
data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
|
|
157
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
158
|
+
mediaType: z.ZodString;
|
|
159
|
+
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
|
|
160
|
+
type: z.ZodLiteral<"file">;
|
|
161
|
+
}, z.core.$strict>], "type">>]>>;
|
|
162
|
+
outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
|
|
163
|
+
task: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
+
hookPayload: z.ZodObject<{
|
|
166
|
+
callId: z.ZodString;
|
|
167
|
+
childSessionId: z.ZodString;
|
|
168
|
+
event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
169
|
+
kind: z.ZodLiteral<"subagent-authorization-event">;
|
|
170
|
+
subagentName: z.ZodString;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
taskId: z.ZodString;
|
|
173
|
+
}, z.core.$strict>>>;
|
|
174
|
+
inputRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
175
|
+
hookPayload: z.ZodObject<{
|
|
176
|
+
callId: z.ZodString;
|
|
177
|
+
childContinuationToken: z.ZodString;
|
|
178
|
+
childSessionId: z.ZodString;
|
|
179
|
+
event: z.ZodObject<{
|
|
180
|
+
requests: z.ZodArray<z.ZodObject<{
|
|
181
|
+
action: z.ZodObject<{
|
|
182
|
+
callId: z.ZodString;
|
|
183
|
+
input: z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>;
|
|
184
|
+
kind: z.ZodLiteral<"tool-call">;
|
|
185
|
+
toolName: z.ZodString;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
allowFreeform: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
display: z.ZodOptional<z.ZodEnum<{
|
|
189
|
+
confirmation: "confirmation";
|
|
190
|
+
select: "select";
|
|
191
|
+
text: "text";
|
|
192
|
+
}>>;
|
|
193
|
+
kind: z.ZodEnum<{
|
|
194
|
+
question: "question";
|
|
195
|
+
"session-limit": "session-limit";
|
|
196
|
+
"tool-approval": "tool-approval";
|
|
197
|
+
}>;
|
|
198
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
199
|
+
description: z.ZodOptional<z.ZodString>;
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
label: z.ZodString;
|
|
202
|
+
style: z.ZodOptional<z.ZodEnum<{
|
|
203
|
+
danger: "danger";
|
|
204
|
+
default: "default";
|
|
205
|
+
primary: "primary";
|
|
206
|
+
}>>;
|
|
207
|
+
}, z.core.$strict>>>;
|
|
208
|
+
prompt: z.ZodString;
|
|
209
|
+
requestId: z.ZodString;
|
|
210
|
+
}, z.core.$strict>>;
|
|
211
|
+
sequence: z.ZodNumber;
|
|
212
|
+
stepIndex: z.ZodNumber;
|
|
213
|
+
turnId: z.ZodString;
|
|
214
|
+
}, z.core.$strict>;
|
|
215
|
+
kind: z.ZodLiteral<"subagent-input-request">;
|
|
216
|
+
subagentName: z.ZodString;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
taskId: z.ZodString;
|
|
219
|
+
}, z.core.$strict>>>;
|
|
220
|
+
views: z.ZodOptional<z.ZodArray<z.ZodType<import("../../tasks/types.ts").TaskView, unknown, z.core.$ZodTypeInternals<import("../../tasks/types.ts").TaskView, unknown>>>>;
|
|
221
|
+
}, z.core.$strict>>;
|
|
222
|
+
}, z.core.$loose>;
|
|
223
|
+
deliveryMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
224
|
+
channelKind: z.ZodString;
|
|
225
|
+
channelName: z.ZodString;
|
|
226
|
+
deliveryId: z.ZodString;
|
|
227
|
+
payloadIndex: z.ZodNumber;
|
|
228
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
229
|
+
requestTraceContext: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
spanId: z.ZodString;
|
|
231
|
+
traceFlags: z.ZodNumber;
|
|
232
|
+
traceId: z.ZodString;
|
|
233
|
+
}, z.core.$strict>>;
|
|
234
|
+
acceptedDeploymentId: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$strict>>>;
|
|
236
|
+
version: z.ZodLiteral<3>;
|
|
237
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
238
|
+
kind: z.ZodLiteral<"session-timeout">;
|
|
239
|
+
version: z.ZodLiteral<3>;
|
|
240
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
241
|
+
kind: z.ZodLiteral<"clear">;
|
|
242
|
+
version: z.ZodLiteral<3>;
|
|
243
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
244
|
+
kind: z.ZodLiteral<"compact">;
|
|
245
|
+
version: z.ZodLiteral<3>;
|
|
246
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
247
|
+
kind: z.ZodLiteral<"reset">;
|
|
248
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
249
|
+
version: z.ZodLiteral<3>;
|
|
250
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
251
|
+
kind: z.ZodLiteral<"cancel">;
|
|
252
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
253
|
+
turnId: z.ZodOptional<z.ZodString>;
|
|
254
|
+
version: z.ZodLiteral<3>;
|
|
255
|
+
}, z.core.$strict>], "kind">;
|
|
256
|
+
export type SessionInboxWireV3 = z.infer<typeof sessionInboxWireV3Schema>;
|
|
257
|
+
export declare function parseSessionInboxWireV3(value: unknown): z.ZodSafeParseResult<{
|
|
258
|
+
auth?: {
|
|
259
|
+
attributes: Record<string, string | string[]>;
|
|
260
|
+
authenticator: string;
|
|
261
|
+
issuer?: string | undefined;
|
|
262
|
+
principalId: string;
|
|
263
|
+
principalType: string;
|
|
264
|
+
subject?: string | undefined;
|
|
265
|
+
} | null | undefined;
|
|
266
|
+
kind: "deliver";
|
|
267
|
+
payloads: {
|
|
268
|
+
[x: string]: unknown;
|
|
269
|
+
context?: string[] | undefined;
|
|
270
|
+
inputResponses?: {
|
|
271
|
+
optionId?: string | undefined;
|
|
272
|
+
requestId: string;
|
|
273
|
+
text?: string | undefined;
|
|
274
|
+
}[] | undefined;
|
|
275
|
+
message?: string | ({
|
|
276
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
277
|
+
text: string;
|
|
278
|
+
type: "text";
|
|
279
|
+
} | {
|
|
280
|
+
image: URL | import("ai").DataContent;
|
|
281
|
+
mediaType?: string | undefined;
|
|
282
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
283
|
+
type: "image";
|
|
284
|
+
} | {
|
|
285
|
+
data: URL | import("ai").DataContent;
|
|
286
|
+
filename?: string | undefined;
|
|
287
|
+
mediaType: string;
|
|
288
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
289
|
+
type: "file";
|
|
290
|
+
})[] | undefined;
|
|
291
|
+
outputSchema?: import("../../shared/json.ts").JsonObject | undefined;
|
|
292
|
+
task?: {
|
|
293
|
+
authorizationEvents?: {
|
|
294
|
+
hookPayload: {
|
|
295
|
+
callId: string;
|
|
296
|
+
childSessionId: string;
|
|
297
|
+
event: Record<string, unknown>;
|
|
298
|
+
kind: "subagent-authorization-event";
|
|
299
|
+
subagentName: string;
|
|
300
|
+
};
|
|
301
|
+
taskId: string;
|
|
302
|
+
}[] | undefined;
|
|
303
|
+
inputRequests?: {
|
|
304
|
+
hookPayload: {
|
|
305
|
+
callId: string;
|
|
306
|
+
childContinuationToken: string;
|
|
307
|
+
childSessionId: string;
|
|
308
|
+
event: {
|
|
309
|
+
requests: {
|
|
310
|
+
action: {
|
|
311
|
+
callId: string;
|
|
312
|
+
input: import("../../shared/json.ts").JsonObject;
|
|
313
|
+
kind: "tool-call";
|
|
314
|
+
toolName: string;
|
|
315
|
+
};
|
|
316
|
+
allowFreeform?: boolean | undefined;
|
|
317
|
+
display?: "confirmation" | "select" | "text" | undefined;
|
|
318
|
+
kind: "question" | "session-limit" | "tool-approval";
|
|
319
|
+
options?: {
|
|
320
|
+
description?: string | undefined;
|
|
321
|
+
id: string;
|
|
322
|
+
label: string;
|
|
323
|
+
style?: "danger" | "default" | "primary" | undefined;
|
|
324
|
+
}[] | undefined;
|
|
325
|
+
prompt: string;
|
|
326
|
+
requestId: string;
|
|
327
|
+
}[];
|
|
328
|
+
sequence: number;
|
|
329
|
+
stepIndex: number;
|
|
330
|
+
turnId: string;
|
|
331
|
+
};
|
|
332
|
+
kind: "subagent-input-request";
|
|
333
|
+
subagentName: string;
|
|
334
|
+
};
|
|
335
|
+
taskId: string;
|
|
336
|
+
}[] | undefined;
|
|
337
|
+
views?: import("../../tasks/types.ts").TaskView[] | undefined;
|
|
338
|
+
} | undefined;
|
|
339
|
+
}[];
|
|
340
|
+
requestId?: string | undefined;
|
|
341
|
+
taskDeliveryId?: string | undefined;
|
|
342
|
+
turnPolicy?: "queue" | "steer" | undefined;
|
|
343
|
+
caller?: {
|
|
344
|
+
callId: string;
|
|
345
|
+
replyTo: {
|
|
346
|
+
kind: "hook";
|
|
347
|
+
token: string;
|
|
348
|
+
} | {
|
|
349
|
+
kind: "callback";
|
|
350
|
+
token: string;
|
|
351
|
+
url: string;
|
|
352
|
+
};
|
|
353
|
+
subagentName: string;
|
|
354
|
+
taskId?: string | undefined;
|
|
355
|
+
activityObserver?: {
|
|
356
|
+
sink: {
|
|
357
|
+
url: string;
|
|
358
|
+
version: 1;
|
|
359
|
+
};
|
|
360
|
+
workIdentity?: {
|
|
361
|
+
callId?: string | undefined;
|
|
362
|
+
id: string;
|
|
363
|
+
kind: "remote-agent" | "root-turn" | "subagent" | "task";
|
|
364
|
+
name?: string | undefined;
|
|
365
|
+
parentId?: string | undefined;
|
|
366
|
+
rootSessionId: string;
|
|
367
|
+
rootTurnId: string;
|
|
368
|
+
sessionId?: string | undefined;
|
|
369
|
+
turnId?: string | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
} | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
payload: {
|
|
374
|
+
[x: string]: unknown;
|
|
375
|
+
context?: string[] | undefined;
|
|
376
|
+
inputResponses?: {
|
|
377
|
+
optionId?: string | undefined;
|
|
378
|
+
requestId: string;
|
|
379
|
+
text?: string | undefined;
|
|
380
|
+
}[] | undefined;
|
|
381
|
+
message?: string | ({
|
|
382
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
383
|
+
text: string;
|
|
384
|
+
type: "text";
|
|
385
|
+
} | {
|
|
386
|
+
image: URL | import("ai").DataContent;
|
|
387
|
+
mediaType?: string | undefined;
|
|
388
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
389
|
+
type: "image";
|
|
390
|
+
} | {
|
|
391
|
+
data: URL | import("ai").DataContent;
|
|
392
|
+
filename?: string | undefined;
|
|
393
|
+
mediaType: string;
|
|
394
|
+
providerOptions?: Record<string, import("../../shared/json.ts").JsonObject> | undefined;
|
|
395
|
+
type: "file";
|
|
396
|
+
})[] | undefined;
|
|
397
|
+
outputSchema?: import("../../shared/json.ts").JsonObject | undefined;
|
|
398
|
+
task?: {
|
|
399
|
+
authorizationEvents?: {
|
|
400
|
+
hookPayload: {
|
|
401
|
+
callId: string;
|
|
402
|
+
childSessionId: string;
|
|
403
|
+
event: Record<string, unknown>;
|
|
404
|
+
kind: "subagent-authorization-event";
|
|
405
|
+
subagentName: string;
|
|
406
|
+
};
|
|
407
|
+
taskId: string;
|
|
408
|
+
}[] | undefined;
|
|
409
|
+
inputRequests?: {
|
|
410
|
+
hookPayload: {
|
|
411
|
+
callId: string;
|
|
412
|
+
childContinuationToken: string;
|
|
413
|
+
childSessionId: string;
|
|
414
|
+
event: {
|
|
415
|
+
requests: {
|
|
416
|
+
action: {
|
|
417
|
+
callId: string;
|
|
418
|
+
input: import("../../shared/json.ts").JsonObject;
|
|
419
|
+
kind: "tool-call";
|
|
420
|
+
toolName: string;
|
|
421
|
+
};
|
|
422
|
+
allowFreeform?: boolean | undefined;
|
|
423
|
+
display?: "confirmation" | "select" | "text" | undefined;
|
|
424
|
+
kind: "question" | "session-limit" | "tool-approval";
|
|
425
|
+
options?: {
|
|
426
|
+
description?: string | undefined;
|
|
427
|
+
id: string;
|
|
428
|
+
label: string;
|
|
429
|
+
style?: "danger" | "default" | "primary" | undefined;
|
|
430
|
+
}[] | undefined;
|
|
431
|
+
prompt: string;
|
|
432
|
+
requestId: string;
|
|
433
|
+
}[];
|
|
434
|
+
sequence: number;
|
|
435
|
+
stepIndex: number;
|
|
436
|
+
turnId: string;
|
|
437
|
+
};
|
|
438
|
+
kind: "subagent-input-request";
|
|
439
|
+
subagentName: string;
|
|
440
|
+
};
|
|
441
|
+
taskId: string;
|
|
442
|
+
}[] | undefined;
|
|
443
|
+
views?: import("../../tasks/types.ts").TaskView[] | undefined;
|
|
444
|
+
} | undefined;
|
|
445
|
+
};
|
|
446
|
+
deliveryMetadata?: {
|
|
447
|
+
channelKind: string;
|
|
448
|
+
channelName: string;
|
|
449
|
+
deliveryId: string;
|
|
450
|
+
payloadIndex: number;
|
|
451
|
+
requestId?: string | undefined;
|
|
452
|
+
requestTraceContext?: {
|
|
453
|
+
spanId: string;
|
|
454
|
+
traceFlags: number;
|
|
455
|
+
traceId: string;
|
|
456
|
+
} | undefined;
|
|
457
|
+
acceptedDeploymentId?: string | undefined;
|
|
458
|
+
}[] | undefined;
|
|
459
|
+
version: 3;
|
|
460
|
+
} | {
|
|
461
|
+
kind: "session-timeout";
|
|
462
|
+
version: 3;
|
|
463
|
+
} | {
|
|
464
|
+
kind: "clear";
|
|
465
|
+
version: 3;
|
|
466
|
+
} | {
|
|
467
|
+
kind: "compact";
|
|
468
|
+
version: 3;
|
|
469
|
+
} | {
|
|
470
|
+
kind: "reset";
|
|
471
|
+
reason?: string | undefined;
|
|
472
|
+
version: 3;
|
|
473
|
+
} | {
|
|
474
|
+
kind: "cancel";
|
|
475
|
+
taskId?: string | undefined;
|
|
476
|
+
turnId?: string | undefined;
|
|
477
|
+
version: 3;
|
|
478
|
+
}>;
|
|
479
|
+
/** Builds and validates one complete version-3 wire value. */
|
|
480
|
+
export declare function encodeSessionCommandV3(command: DeliverHookPayload | SessionCommand | SessionTimeoutHookPayload): SessionInboxWireV3;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{formatValidationError}from"#runtime/validation.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{SessionInboxWireError}from"#execution/wire/session-inbox-contract.js";import{sessionInboxWireV2Schema}from"#execution/wire/session-inbox-wire.v2.js";import{normalizeSessionInboxWireV2}from"#execution/wire/session-inbox-wire.v2-migration.js";const v2=sessionInboxWireV2Schema.options,v2Deliver=v2[0],v2DeliveryMetadata=v2Deliver.shape.deliveryMetadata.unwrap().element,version=z.literal(3),sessionInboxWireV3Schema=z.discriminatedUnion(`kind`,[v2Deliver.extend({deliveryMetadata:z.array(v2DeliveryMetadata.extend({acceptedDeploymentId:z.string().optional()})).optional(),version}),v2[1].extend({version}),v2[2].extend({version}),v2[3].extend({version}),v2[4].extend({version}),v2[5].extend({version})]);function parseSessionInboxWireV3(e){return sessionInboxWireV3Schema.safeParse(normalizeSessionInboxWireV2(e))}function encodeSessionCommandV3(e){let t=parseSessionInboxWireV3(e.kind===`send`?{auth:e.auth,caller:e.caller,deliveryMetadata:e.delivery===void 0?void 0:[{...e.delivery,payloadIndex:0}],kind:`deliver`,payload:e.payload,payloads:[e.payload],requestId:e.requestId,taskDeliveryId:e.taskDeliveryId,turnPolicy:e.turnPolicy,version:3}:e.kind===`deliver`?{...e,payload:coalesceDeliverPayloads(e.payloads),version:3}:{...e,version:3});if(!t.success)throw new SessionInboxWireError(`Produced a session inbox payload that does not match wire version 3: ${formatValidationError(t.error)}`);return t.data}export{encodeSessionCommandV3,parseSessionInboxWireV3,sessionInboxWireV3Schema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const sessionInboxWireV2Migration={from:2,migrate(e){return{...e,version:3}},to:3};export{sessionInboxWireV2Migration};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TurnCaller } from "#channel/types.js";
|
|
2
|
+
import type { DurableSessionState } from "#execution/durable-session-store.js";
|
|
3
|
+
import type { NextDriverAction } from "#execution/next-driver-action.js";
|
|
4
|
+
import type { RunMode } from "#shared/run-mode.js";
|
|
5
|
+
export declare function finalizeExpiredSession(input: {
|
|
6
|
+
readonly caller: TurnCaller | undefined;
|
|
7
|
+
readonly driverWritable: WritableStream<Uint8Array>;
|
|
8
|
+
readonly mode: RunMode;
|
|
9
|
+
readonly serializedContext: Record<string, unknown>;
|
|
10
|
+
readonly sessionState: DurableSessionState;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
readonly output: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function finalizeDone(input: {
|
|
15
|
+
readonly action: NextDriverAction & {
|
|
16
|
+
readonly kind: "done";
|
|
17
|
+
};
|
|
18
|
+
readonly caller: TurnCaller | undefined;
|
|
19
|
+
readonly mode: RunMode;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
readonly output: unknown;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{notifyDelegatedParentStep,notifyTurnCallerStep}from"#execution/delegated-parent-notification.js";import{createDelegatedSubagentErrorResult,createDelegatedSubagentSuccessResult}from"#execution/delegated-parent-result.js";import{fireSessionCallbackStep}from"#execution/session-callback-step.js";import{emitTerminalSessionCompletionStep}from"#execution/terminal-session-completion-step.js";import{terminateChildSessionsStep}from"#execution/terminate-child-sessions-step.js";async function finalizeExpiredSession(t){return await terminateChildSessionsStep({serializedContext:t.serializedContext,sessionState:t.sessionState}),await emitTerminalSessionCompletionStep({parentWritable:t.driverWritable,serializedContext:t.serializedContext}),t.mode===`task`?(await fireSessionCallbackStep({output:``,serializedContext:t.serializedContext,status:`completed`}),await notifyDelegatedParentStep({result:createDelegatedSubagentSuccessResult(t.serializedContext,``),serializedContext:t.serializedContext})):t.caller!==void 0&&await notifyTurnCallerStep({caller:t.caller,lifecycle:`terminal`,sessionId:t.sessionState.sessionId,settled:{output:``}}),{output:``}}async function finalizeDone(n){let{output:r,serializedContext:i}=n.action,a=n.action.isError===!0;if(await terminateChildSessionsStep({serializedContext:i,sessionState:n.action.sessionState}),n.mode===`task`)await fireSessionCallbackStep({error:a?r:void 0,output:a?void 0:r,serializedContext:i,status:a?`failed`:`completed`,usage:n.action.usage}),await notifyDelegatedParentStep({result:a?createDelegatedSubagentErrorResult(i,r):createDelegatedSubagentSuccessResult(i,r),serializedContext:i,usage:n.action.usage});else{let e={output:r,usage:n.action.usageDelta};a&&(e.isError=!0),n.caller!==void 0&&await notifyTurnCallerStep({caller:n.caller,lifecycle:`terminal`,sessionId:n.action.sessionState.sessionId,settled:e})}return{output:r}}export{finalizeDone,finalizeExpiredSession};
|