eve 0.50.0 → 0.51.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 +18 -0
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/types.d.ts +12 -19
- package/dist/src/chunks/{use-eve-agent-DUMU6dap.js → use-eve-agent-B4xN7-fK.js} +4 -4
- package/dist/src/chunks/{use-eve-agent-B5I-k6Ek.js → use-eve-agent-C3vUG5g2.js} +4 -4
- package/dist/src/cli/acp/command.d.ts +1 -1
- package/dist/src/cli/acp/command.js +2 -2
- package/dist/src/cli/agent-command.d.ts +5 -0
- package/dist/src/cli/agent-command.js +1 -0
- package/dist/src/cli/application-command.d.ts +2 -0
- package/dist/src/cli/commands/build.d.ts +1 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +2 -0
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +14 -0
- package/dist/src/cli/commands/init-agent-workspace.js +1 -0
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -13
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/link.d.ts +2 -0
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +15 -0
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +1 -1
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +1 -0
- package/dist/src/cli/option-parsers.js +1 -1
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/agent-info-schema.d.ts +0 -1
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +18 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +0 -3
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/execution/activity-work-id.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/channel-context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +103 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -0
- package/dist/src/execution/coordination-dispatch-step.d.ts +7 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -0
- package/dist/src/execution/create-session-step.d.ts +1 -2
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +5 -5
- package/dist/src/execution/dispatch-action-failures.js +1 -1
- package/dist/src/execution/dispatch-start-operation.d.ts +1 -1
- package/dist/src/execution/dispatch-start-operation.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +7 -10
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/pending-turn-state.d.ts +1 -2
- package/dist/src/execution/pending-turn-state.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +2 -3
- package/dist/src/execution/session.d.ts +1 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +1 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/task-event-callback.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +18 -18
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/update-step.d.ts +6 -0
- package/dist/src/execution/tasks/child/update-step.js +1 -0
- package/dist/src/execution/tasks/child/update.d.ts +7 -10
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/child/workflow.d.ts +21 -29
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +6 -17
- package/dist/src/execution/tasks/parent/control-shared.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +15 -50
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +19 -34
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +5 -15
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/run-parent.d.ts +2 -2
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +11 -0
- package/dist/src/execution/tasks/parent/task-cancel.js +1 -0
- package/dist/src/execution/tasks/parent/tool-execution.d.ts +2 -3
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.d.ts +7 -0
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -0
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +9 -0
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +51 -0
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +37 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +55 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -0
- package/dist/src/execution/tools/subagent/receipt-identity.d.ts +11 -0
- package/dist/src/execution/tools/subagent/receipt-identity.js +1 -0
- package/dist/src/execution/{dispatch-runtime-actions-start.d.ts → tools/subagent/start.d.ts} +17 -5
- package/dist/src/execution/tools/subagent/start.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +24 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -0
- package/dist/src/execution/tools/subagent/task-cancel.d.ts +10 -0
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +10 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/execution/{tool-run → tools/workflow}/answer.d.ts +1 -1
- package/dist/src/execution/tools/workflow/answer.js +1 -0
- package/dist/src/execution/tools/workflow/ask.d.ts +22 -0
- package/dist/src/execution/tools/workflow/ask.js +1 -0
- package/dist/src/execution/tools/workflow/background.d.ts +18 -0
- package/dist/src/execution/tools/workflow/background.js +1 -0
- package/dist/src/execution/tools/workflow/body.d.ts +25 -0
- package/dist/src/execution/tools/workflow/body.js +1 -0
- package/dist/src/execution/tools/workflow/cancel.d.ts +11 -0
- package/dist/src/execution/tools/workflow/cancel.js +1 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +7 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -0
- package/dist/src/execution/tools/workflow/messages.d.ts +88 -0
- package/dist/src/execution/tools/workflow/messages.js +1 -0
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -0
- package/dist/src/execution/tools/workflow/owner.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner.js +1 -0
- package/dist/src/execution/tools/workflow/run-control.d.ts +18 -0
- package/dist/src/execution/tools/workflow/run-control.js +1 -0
- package/dist/src/execution/tools/workflow/start.d.ts +33 -0
- package/dist/src/execution/tools/workflow/start.js +1 -0
- package/dist/src/execution/tools/workflow/types.d.ts +26 -0
- package/dist/src/execution/tools/workflow/types.js +1 -0
- package/dist/src/execution/tools/workflow/workflow.d.ts +3 -0
- package/dist/src/execution/tools/workflow/workflow.js +1 -0
- package/dist/src/execution/turn-workflow-tool-run.d.ts +16 -0
- package/dist/src/execution/turn-workflow-tool-run.js +1 -0
- 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-wire.d.ts +3 -3
- 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.v4.d.ts +267 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +1 -0
- package/dist/src/execution/workflow-entry-finalization.d.ts +6 -0
- package/dist/src/execution/workflow-entry-finalization.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +2 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -7
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/background-tools.d.ts +8 -2
- package/dist/src/harness/{runtime-actions.d.ts → coordination.d.ts} +40 -27
- package/dist/src/harness/coordination.js +1 -0
- package/dist/src/harness/emission.d.ts +9 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +52 -0
- package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +6 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +1 -2
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-action.js +1 -1
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +3 -1
- package/dist/src/harness/types.d.ts +4 -7
- package/dist/src/harness/workflow-interrupt-state.js +1 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +10 -0
- package/dist/src/harness/workflow-lifecycle.js +1 -1
- package/dist/src/harness/workflow-sandbox.d.ts +1 -1
- package/dist/src/harness/workflow-sandbox.js +2 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +7 -7
- package/dist/src/harness/workflow-subagent-limit.js +1 -1
- package/dist/src/harness/workflow-task-state.d.ts +9 -0
- package/dist/src/harness/workflow-task-state.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +27 -0
- package/dist/src/harness/workflow-tool-runs.js +1 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/parent-lineage.js +1 -1
- package/dist/src/internal/agent-name.d.ts +4 -0
- package/dist/src/internal/agent-name.js +1 -0
- package/dist/src/internal/agent-workspace.d.ts +15 -0
- package/dist/src/internal/agent-workspace.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/project-context.d.ts +26 -0
- package/dist/src/internal/project-context.js +1 -0
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +17 -0
- package/dist/src/internal/vercel/assemble-eve-services.js +1 -0
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -0
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -0
- package/dist/src/internal/vercel/build-command.d.ts +4 -0
- package/dist/src/internal/vercel/build-command.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +27 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.d.ts +18 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.js +1 -0
- package/dist/src/internal/vercel/vercel-service-name.d.ts +6 -0
- package/dist/src/internal/vercel/vercel-service-name.js +1 -0
- package/dist/src/internal/vercel/vercel-services-config.d.ts +53 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -0
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/workflow/index.d.ts +3 -1
- package/dist/src/public/workflow/index.js +1 -1
- package/dist/src/runtime/actions/results.d.ts +3 -3
- package/dist/src/runtime/actions/results.js +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/channels/registry.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +16 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow-reference.d.ts +5 -0
- package/dist/src/runtime/subagents/workflow-reference.js +1 -0
- package/dist/src/runtime/subagents/workflow.d.ts +8 -0
- package/dist/src/runtime/subagents/workflow.js +1 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/setup/integrations/discord/setup.js +1 -1
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
- package/dist/src/setup/integrations/linear/setup.js +1 -1
- package/dist/src/setup/integrations/linq/setup.js +3 -3
- package/dist/src/setup/integrations/shopify/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +4 -12
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/shared/action-types.d.ts +74 -14
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +1 -1
- package/dist/src/{execution/subagent-adapter-state.d.ts → subagents/adapter-state.d.ts} +2 -0
- package/dist/src/{execution/subagent-adapter-state.js → subagents/adapter-state.js} +1 -1
- package/dist/src/subagents/adapter.js +1 -0
- package/dist/src/{harness → subagents}/agent-handle-errors.d.ts +6 -0
- package/dist/src/subagents/agent-handle-errors.js +1 -0
- package/dist/src/subagents/callback-route.js +1 -0
- package/dist/src/subagents/callback-step.js +1 -0
- package/dist/src/{execution/agent-continuation-bundle.d.ts → subagents/continuation-bundle.d.ts} +1 -1
- package/dist/src/subagents/continuation-bundle.js +1 -0
- package/dist/src/{execution/subagent-event-proxy-step.d.ts → subagents/event-proxy-step.d.ts} +2 -8
- package/dist/src/subagents/event-proxy-step.js +1 -0
- package/dist/src/subagents/handle-dispatch.d.ts +54 -0
- package/dist/src/subagents/handle-dispatch.js +1 -0
- package/dist/src/{harness → subagents}/handles/prompt.d.ts +4 -4
- package/dist/src/{harness → subagents}/handles/prompt.js +1 -1
- package/dist/src/{harness → subagents}/handles/query.d.ts +8 -2
- package/dist/src/subagents/handles/query.js +1 -0
- package/dist/src/subagents/handles/rebase.d.ts +4 -0
- package/dist/src/subagents/handles/rebase.js +1 -0
- package/dist/src/{harness → subagents}/handles/store.d.ts +90 -15
- package/dist/src/subagents/handles/store.js +1 -0
- package/dist/src/subagents/handles/transitions.d.ts +103 -0
- package/dist/src/subagents/handles/transitions.js +1 -0
- package/dist/src/{execution/delegated-parent-notification.d.ts → subagents/parent-notification.d.ts} +1 -7
- package/dist/src/subagents/parent-notification.js +1 -0
- package/dist/src/subagents/parent-result.js +1 -0
- package/dist/src/{execution/remote-agent-dispatch.d.ts → subagents/remote-dispatch.d.ts} +3 -2
- package/dist/src/subagents/remote-dispatch.js +1 -0
- package/dist/src/{execution/subagent-start-local.d.ts → subagents/start-local.d.ts} +5 -6
- package/dist/src/subagents/start-local.js +1 -0
- package/dist/src/{execution/subagent-start-remote.d.ts → subagents/start-remote.d.ts} +5 -5
- package/dist/src/subagents/start-remote.js +1 -0
- package/dist/src/{execution/subagent-tool.d.ts → subagents/tool.d.ts} +5 -3
- package/dist/src/subagents/tool.js +1 -0
- 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/tasks/session-index.d.ts +2 -3
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/task-id.d.ts +3 -4
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/transitions.d.ts +3 -47
- package/dist/src/tasks/transitions.js +1 -1
- package/dist/src/tasks/types.d.ts +69 -247
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -1
- package/dist/src/tools/framework/agent.d.ts +18 -2
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +2 -6
- package/dist/src/tools/framework/task-contract.d.ts +44 -65
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/framework/task-update.d.ts +1 -0
- package/dist/src/tools/framework/task-update.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/built-in-tools.md +9 -90
- package/docs/concepts/context-control.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/guides/deployment/vercel.mdx +20 -2
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/instrumentation-providers.md +242 -0
- package/docs/guides/instrumentation.md +2 -0
- package/docs/guides/meta.json +1 -0
- package/docs/guides/remote-agents.md +8 -9
- package/docs/reference/cli.md +5 -2
- package/docs/sandbox.mdx +2 -0
- package/docs/subagents/index.mdx +9 -8
- package/docs/tools/overview.mdx +11 -10
- package/docs/tools/workflows.mdx +52 -18
- package/package.json +1 -1
- package/dist/src/execution/agent-continuation-bundle.js +0 -1
- package/dist/src/execution/agent-handle-dispatch.d.ts +0 -79
- package/dist/src/execution/agent-handle-dispatch.js +0 -1
- package/dist/src/execution/delegated-parent-notification.js +0 -1
- package/dist/src/execution/delegated-parent-result.js +0 -1
- package/dist/src/execution/delegation-tool.d.ts +0 -10
- package/dist/src/execution/delegation-tool.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +0 -165
- package/dist/src/execution/dispatch-runtime-actions-shared.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-start.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-runtime-actions-step.js +0 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +0 -1
- package/dist/src/execution/finalize-terminal-session.d.ts +0 -17
- package/dist/src/execution/finalize-terminal-session.js +0 -1
- package/dist/src/execution/prepared-agent-action.d.ts +0 -7
- package/dist/src/execution/prepared-agent-action.js +0 -1
- package/dist/src/execution/remote-agent-dispatch.js +0 -1
- package/dist/src/execution/session-callback-route.js +0 -1
- package/dist/src/execution/session-callback-step.js +0 -1
- package/dist/src/execution/subagent-adapter.js +0 -1
- package/dist/src/execution/subagent-event-proxy-step.js +0 -1
- package/dist/src/execution/subagent-start-local.js +0 -1
- package/dist/src/execution/subagent-start-remote.js +0 -1
- package/dist/src/execution/subagent-tool.js +0 -1
- package/dist/src/execution/tasks/child/instructions.d.ts +0 -3
- package/dist/src/execution/tasks/child/instructions.js +0 -1
- package/dist/src/execution/tasks/parent/agent-identity.d.ts +0 -13
- package/dist/src/execution/tasks/parent/agent-identity.js +0 -1
- package/dist/src/execution/tasks/parent/agent-views.d.ts +0 -7
- package/dist/src/execution/tasks/parent/agent-views.js +0 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +0 -43
- package/dist/src/execution/tasks/parent/continuation-dispatch.js +0 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +0 -19
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +0 -1
- package/dist/src/execution/tool-run/answer.js +0 -1
- package/dist/src/execution/tool-run/background.d.ts +0 -14
- package/dist/src/execution/tool-run/background.js +0 -1
- package/dist/src/execution/tool-run/cancel.d.ts +0 -7
- package/dist/src/execution/tool-run/cancel.js +0 -1
- package/dist/src/execution/tool-run/dispatch.d.ts +0 -24
- package/dist/src/execution/tool-run/dispatch.js +0 -1
- package/dist/src/execution/tool-run/emit-run-report-step.d.ts +0 -7
- package/dist/src/execution/tool-run/emit-run-report-step.js +0 -1
- package/dist/src/execution/tool-run/messages.d.ts +0 -70
- package/dist/src/execution/tool-run/messages.js +0 -1
- package/dist/src/execution/tool-run/owner-inbox.d.ts +0 -11
- package/dist/src/execution/tool-run/owner-inbox.js +0 -1
- package/dist/src/execution/tool-run/owner.d.ts +0 -13
- package/dist/src/execution/tool-run/owner.js +0 -1
- package/dist/src/execution/tool-run/run-control.d.ts +0 -18
- package/dist/src/execution/tool-run/run-control.js +0 -1
- package/dist/src/execution/tool-run/start.d.ts +0 -11
- package/dist/src/execution/tool-run/start.js +0 -1
- package/dist/src/execution/tool-run/types.d.ts +0 -21
- package/dist/src/execution/tool-run/types.js +0 -1
- package/dist/src/execution/tool-run/workflow.d.ts +0 -9
- package/dist/src/execution/tool-run/workflow.js +0 -1
- package/dist/src/execution/tools/subagent/local.d.ts +0 -40
- package/dist/src/execution/tools/subagent/local.js +0 -1
- package/dist/src/execution/tools/subagent/remote.d.ts +0 -26
- package/dist/src/execution/tools/subagent/remote.js +0 -1
- package/dist/src/harness/agent-handle-errors.js +0 -1
- package/dist/src/harness/handles/query.js +0 -1
- package/dist/src/harness/handles/store.js +0 -1
- package/dist/src/harness/handles/transitions.d.ts +0 -167
- package/dist/src/harness/handles/transitions.js +0 -1
- package/dist/src/harness/runtime-actions.js +0 -1
- package/dist/src/harness/subagent-depth.d.ts +0 -10
- package/dist/src/harness/subagent-depth.js +0 -1
- package/dist/src/harness/tool-runs.d.ts +0 -21
- package/dist/src/harness/tool-runs.js +0 -1
- package/dist/src/harness/workflow-runtime-action-state.d.ts +0 -9
- package/dist/src/harness/workflow-runtime-action-state.js +0 -1
- package/dist/src/runtime/actions/keys.d.ts +0 -14
- package/dist/src/runtime/actions/keys.js +0 -1
- package/dist/src/tasks/wire.d.ts +0 -25
- package/dist/src/tasks/wire.js +0 -1
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.js +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.js +0 -0
- /package/dist/src/{execution/subagent-adapter.d.ts → subagents/adapter.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-route.d.ts → subagents/callback-route.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-step.d.ts → subagents/callback-step.d.ts} +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.js +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.js +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.d.ts → subagents/hitl-proxy.d.ts} +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.js → subagents/hitl-proxy.js} +0 -0
- /package/dist/src/{execution/subagent-invocation.d.ts → subagents/invocation.d.ts} +0 -0
- /package/dist/src/{execution/subagent-invocation.js → subagents/invocation.js} +0 -0
- /package/dist/src/{execution/delegated-parent-result.d.ts → subagents/parent-result.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.d.ts → subagents/remote-route-url.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.js → subagents/remote-route-url.js} +0 -0
- /package/dist/src/{harness/subagent-token-budget.d.ts → subagents/token-budget.d.ts} +0 -0
- /package/dist/src/{harness/subagent-token-budget.js → subagents/token-budget.js} +0 -0
|
@@ -1,87 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SubagentAuthorizationEvent, SubagentAuthorizationEventHookPayload } from "#channel/types.js";
|
|
2
|
+
import type { WorkflowToolAgentRequest } from "#execution/tools/workflow/messages.js";
|
|
2
3
|
import { type JsonValue } from "#shared/json.js";
|
|
3
4
|
import type { TaskExecutorBinding } from "#tools/task.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Task lifecycle contract for `experimental.tasks`.
|
|
7
|
-
*
|
|
8
|
-
* A task is one durable unit of delegated work owned by a parent session.
|
|
9
|
-
* The durable task run is the single writer for lifecycle transitions
|
|
10
|
-
* (see `#execution/tasks/child/workflow.js`); every other path submits
|
|
11
|
-
* commands and reads views. This module is dependency-free on
|
|
12
|
-
* purpose: it is bundled into workflow bodies, which reject Node.js
|
|
13
|
-
* builtins and heavyweight validators.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Task lifecycle status.
|
|
17
|
-
*
|
|
18
|
-
* `completed`, `failed`, and `cancelled` are terminal and final.
|
|
19
|
-
* `input_required` is not terminal but is ready for parent action; the
|
|
20
|
-
* child must wake its parent rather than deadlock while waiting for input.
|
|
21
|
-
*/
|
|
5
|
+
/** Durable lifecycle status for one unit of background work. */
|
|
22
6
|
export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled";
|
|
23
|
-
/**
|
|
24
|
-
* Immutable identity of the delegated work behind a task.
|
|
25
|
-
*
|
|
26
|
-
* `agentId` is parent-controlled and exists before the child acknowledges its
|
|
27
|
-
* private address, so the durable task can bind to persistent identity before
|
|
28
|
-
* the dispatch side effect runs.
|
|
29
|
-
*/
|
|
7
|
+
/** Executor-neutral identity shown for one task. */
|
|
30
8
|
export interface TaskMetadata {
|
|
31
|
-
/** Stable model-visible identity of the persistent child session. */
|
|
32
|
-
readonly agentId: string;
|
|
33
|
-
readonly kind: "subagent";
|
|
34
|
-
readonly mode: "local" | "remote";
|
|
35
|
-
/** Authored subagent name the parent dispatched. */
|
|
36
|
-
readonly name: string;
|
|
37
|
-
}
|
|
38
|
-
export type SubagentTaskMetadata = TaskMetadata;
|
|
39
|
-
/** Executor-neutral metadata retained by a non-subagent durable task. */
|
|
40
|
-
export interface BackgroundTaskMetadata {
|
|
41
9
|
readonly kind: string;
|
|
42
10
|
readonly name: string;
|
|
11
|
+
readonly [key: string]: JsonValue | undefined;
|
|
43
12
|
}
|
|
44
|
-
export
|
|
45
|
-
export declare function createSubagentTaskMetadata(metadata: Omit<SubagentTaskMetadata, "kind" | "name"> & {
|
|
46
|
-
readonly name: string;
|
|
47
|
-
}): SubagentTaskMetadata;
|
|
48
|
-
export declare function readSubagentTaskMetadata(task: {
|
|
49
|
-
readonly executor?: TaskExecutorBinding | TaskExecutorState;
|
|
50
|
-
readonly metadata: DurableTaskMetadata;
|
|
51
|
-
}): SubagentTaskMetadata | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Durable subagent executor binding payload: the child's stable identity and
|
|
54
|
-
* private delivery address, copied from the parent's agent handle store at
|
|
55
|
-
* delegation time. Every field derives deterministically from the
|
|
56
|
-
* originating call (operation-hashed id, dispatch-chosen continuation
|
|
57
|
-
* token), so a replayed delegation produces a deep-equal binding — the
|
|
58
|
-
* equality the task run's `bind` replay check compares.
|
|
59
|
-
*/
|
|
60
|
-
export interface SubagentExecutorData {
|
|
61
|
-
readonly address: AgentAddress;
|
|
62
|
-
readonly identity: AgentIdentity;
|
|
63
|
-
}
|
|
64
|
-
export declare function createSubagentExecutorBinding(executor: SubagentExecutorData): TaskExecutorBinding;
|
|
65
|
-
export declare function readSubagentExecutor(executor: TaskExecutorBinding | TaskExecutorState | undefined): SubagentExecutorData | undefined;
|
|
66
|
-
export declare function sameTaskMetadata(left: DurableTaskMetadata, right: DurableTaskMetadata): boolean;
|
|
67
|
-
/** Private executor state retained for cancellation and address reconciliation. */
|
|
68
|
-
export interface TaskExecutorState {
|
|
69
|
-
/** Write-once executor address recorded by the `bind` command. */
|
|
70
|
-
readonly binding?: TaskExecutorBinding;
|
|
71
|
-
readonly childSessionId?: string;
|
|
72
|
-
readonly childTurnId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Child-session verdict from the last settled turn: `parked` survived
|
|
75
|
-
* and can take another delivery, `terminal` ended with the turn.
|
|
76
|
-
*/
|
|
77
|
-
readonly lifecycle?: "parked" | "terminal";
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Terminal task output. Failure is the state (`failed`); the `error`
|
|
81
|
-
* output is its consequence — a `failed` task always carries one.
|
|
82
|
-
* This intentionally diverges from MCP, which reserves `failed` for
|
|
83
|
-
* protocol-level errors.
|
|
84
|
-
*/
|
|
13
|
+
export declare function sameTaskMetadata(left: TaskMetadata, right: TaskMetadata): boolean;
|
|
85
14
|
export type TaskOutput = {
|
|
86
15
|
readonly type: "result";
|
|
87
16
|
readonly data: JsonValue;
|
|
@@ -89,67 +18,28 @@ export type TaskOutput = {
|
|
|
89
18
|
readonly type: "error";
|
|
90
19
|
readonly data: JsonValue;
|
|
91
20
|
};
|
|
92
|
-
/**
|
|
93
|
-
* One outstanding request forwarded from a blocked child. Carried
|
|
94
|
-
* opaquely: the task layer routes the batch, the input contract owns
|
|
95
|
-
* its shape.
|
|
96
|
-
*/
|
|
21
|
+
/** An outstanding request carried opaquely by the task lifecycle. */
|
|
97
22
|
export type TaskInputRequest = JsonValue;
|
|
98
|
-
/**
|
|
99
|
-
* Provider token usage a child turn reported. Structural on purpose: it
|
|
100
|
-
* mirrors `TokenUsage` (#shared/token-usage.js) without importing its
|
|
101
|
-
* zod-backed module into a workflow-bundled file.
|
|
102
|
-
*/
|
|
103
23
|
export interface TaskUsage {
|
|
104
24
|
readonly cacheReadTokens: number;
|
|
105
25
|
readonly cacheWriteTokens: number;
|
|
106
26
|
readonly inputTokens: number;
|
|
107
27
|
readonly outputTokens: number;
|
|
108
28
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Validates one wire-carried usage value into {@link TaskUsage}.
|
|
111
|
-
* Anything malformed is dropped rather than rejected: retention is
|
|
112
|
-
* best-effort and must never fail a lifecycle transition.
|
|
113
|
-
*/
|
|
29
|
+
/** Reads valid provider usage without making task settlement depend on it. */
|
|
114
30
|
export declare function readTaskUsage(value: unknown): TaskUsage | undefined;
|
|
115
|
-
/**
|
|
116
|
-
* One human answer to an outstanding request. Structural on purpose: it
|
|
117
|
-
* mirrors the input contract's `InputResponse` without importing its
|
|
118
|
-
* zod-backed module into a workflow-bundled file.
|
|
119
|
-
*/
|
|
120
|
-
export interface TaskInputResponse {
|
|
121
|
-
readonly optionId?: string;
|
|
122
|
-
readonly requestId: string;
|
|
123
|
-
readonly text?: string;
|
|
124
|
-
}
|
|
125
|
-
/** Stable task blocker id shared by one authorization attempt's events. */
|
|
126
|
-
export declare function taskAuthorizationRequestId(event: SubagentAuthorizationEvent): string;
|
|
127
|
-
/** Reads the `requestId` of one opaque outstanding request. */
|
|
31
|
+
/** Reads the request identity from one opaque request. */
|
|
128
32
|
export declare function readTaskInputRequestId(request: TaskInputRequest): string | undefined;
|
|
129
|
-
/** Fields shared by every durable task view. */
|
|
130
33
|
interface TaskViewBase {
|
|
131
34
|
readonly taskId: string;
|
|
132
|
-
readonly metadata:
|
|
133
|
-
/** Private executor state
|
|
134
|
-
readonly executor?:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
* budgets stay best-effort until a reservation model lands — and
|
|
139
|
-
* deliberately excluded from model-visible task views (tasks/json.ts).
|
|
140
|
-
*/
|
|
35
|
+
readonly metadata: TaskMetadata;
|
|
36
|
+
/** Private executor state, excluded from model-visible JSON. */
|
|
37
|
+
readonly executor?: {
|
|
38
|
+
readonly binding?: TaskExecutorBinding;
|
|
39
|
+
};
|
|
40
|
+
/** Retained for accounting, excluded from model-visible JSON. */
|
|
141
41
|
readonly usage?: TaskUsage;
|
|
142
42
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Full durable task view discriminated by lifecycle status.
|
|
145
|
-
*
|
|
146
|
-
* The task run appends one per accepted command; readers always observe a
|
|
147
|
-
* complete view, never a delta. A view never contains routing credentials,
|
|
148
|
-
* continuation tokens, or authorization capabilities.
|
|
149
|
-
*
|
|
150
|
-
* Completed and failed tasks carry their corresponding output, cancelled
|
|
151
|
-
* tasks carry no output, and only input-required tasks carry requests.
|
|
152
|
-
*/
|
|
153
43
|
export type TaskView = TaskViewBase & ({
|
|
154
44
|
readonly status: "working";
|
|
155
45
|
readonly inputRequests?: never;
|
|
@@ -175,171 +65,103 @@ export type TaskView = TaskViewBase & ({
|
|
|
175
65
|
readonly inputRequests?: never;
|
|
176
66
|
readonly lastOutput?: never;
|
|
177
67
|
});
|
|
178
|
-
/**
|
|
68
|
+
/** Executor-neutral commands accepted by the durable task run. */
|
|
179
69
|
export type TaskCommand = {
|
|
180
70
|
readonly executor: TaskExecutorBinding;
|
|
181
71
|
readonly kind: "bind";
|
|
182
72
|
} | {
|
|
183
73
|
readonly kind: "complete";
|
|
184
74
|
readonly data: JsonValue;
|
|
185
|
-
readonly lifecycle?: "parked" | "terminal";
|
|
186
75
|
readonly usage?: TaskUsage;
|
|
187
76
|
} | {
|
|
188
77
|
readonly kind: "fail";
|
|
189
78
|
readonly data: JsonValue;
|
|
190
|
-
readonly lifecycle?: "parked" | "terminal";
|
|
191
79
|
readonly usage?: TaskUsage;
|
|
192
|
-
}
|
|
193
|
-
/** Terminal dispatch rejection for a task that was never indexed by its parent. */
|
|
194
|
-
| {
|
|
80
|
+
} | {
|
|
195
81
|
readonly kind: "reject-dispatch";
|
|
196
82
|
readonly data: JsonValue;
|
|
197
|
-
readonly lifecycle?: never;
|
|
198
|
-
readonly usage?: never;
|
|
199
83
|
} | {
|
|
200
84
|
readonly kind: "cancel";
|
|
201
|
-
readonly lifecycle?: "parked" | "terminal";
|
|
202
|
-
readonly usage?: TaskUsage;
|
|
203
|
-
}
|
|
204
|
-
/** Retains a late executor settlement without changing task terminal status. */
|
|
205
|
-
| {
|
|
206
|
-
readonly kind: "settle-executor";
|
|
207
85
|
readonly usage?: TaskUsage;
|
|
208
|
-
} | {
|
|
209
|
-
readonly kind: "require-authorization";
|
|
210
|
-
readonly requestId: string;
|
|
211
86
|
} | {
|
|
212
87
|
readonly kind: "require-input";
|
|
213
88
|
readonly inputRequests: readonly TaskInputRequest[];
|
|
214
89
|
} | {
|
|
215
90
|
readonly kind: "ready";
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Clears the listed requests from the outstanding batch. Bound to
|
|
219
|
-
* ids rather than unbound like the former `resume`, so an answer can
|
|
220
|
-
* only ever release the batch it was written against.
|
|
221
|
-
*/
|
|
222
|
-
| {
|
|
91
|
+
} | {
|
|
223
92
|
readonly kind: "answered";
|
|
224
93
|
readonly requestIds: readonly string[];
|
|
225
|
-
} | {
|
|
226
|
-
readonly kind: "start-turn";
|
|
227
|
-
readonly childSessionId: string;
|
|
228
|
-
readonly childTurnId: string;
|
|
229
|
-
readonly taskId: string;
|
|
230
94
|
};
|
|
231
|
-
/** Hook payload envelope commanding a durable task run. */
|
|
232
95
|
export interface TaskCommandHookPayload {
|
|
233
96
|
readonly kind: "task-command";
|
|
234
97
|
readonly command: TaskCommand;
|
|
235
98
|
}
|
|
236
|
-
/**
|
|
237
|
-
* Structural shapes of the child wire payloads a task run consumes.
|
|
238
|
-
*
|
|
239
|
-
* These mirror the existing parent-notification contracts (the local
|
|
240
|
-
* `notifyDelegatedParentStep`, the subagent adapter's HITL forwarding,
|
|
241
|
-
* and the remote callback route) without importing their zod-backed
|
|
242
|
-
* modules: this file is bundled into workflow bodies. The wire itself
|
|
243
|
-
* is unchanged — delegated dispatch only points it at the task run's
|
|
244
|
-
* hook instead of the parent turn's inbox.
|
|
245
|
-
*/
|
|
246
|
-
export interface TaskInboundChildResult {
|
|
247
|
-
readonly kind: "runtime-action-result";
|
|
248
|
-
readonly results: readonly {
|
|
249
|
-
readonly isError?: boolean;
|
|
250
|
-
readonly outcome?: {
|
|
251
|
-
readonly kind: "parked" | "terminal";
|
|
252
|
-
readonly result: {
|
|
253
|
-
readonly kind: "succeeded";
|
|
254
|
-
readonly output: JsonValue;
|
|
255
|
-
} | {
|
|
256
|
-
readonly error: JsonValue;
|
|
257
|
-
readonly kind: "failed";
|
|
258
|
-
} | {
|
|
259
|
-
readonly kind: "cancelled";
|
|
260
|
-
};
|
|
261
|
-
/**
|
|
262
|
-
* Provider usage this turn added. Retained on the terminal task
|
|
263
|
-
* view ({@link TaskView.usage}); folding it into parent
|
|
264
|
-
* budgets is deferred until a reservation model lands.
|
|
265
|
-
*/
|
|
266
|
-
readonly usageDelta?: unknown;
|
|
267
|
-
};
|
|
268
|
-
readonly output: JsonValue;
|
|
269
|
-
}[];
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Arrives when the delegated child emits `input.requested`. After dispatch is
|
|
273
|
-
* acknowledged, the task run exposes the batch in an `input_required`
|
|
274
|
-
* view and forwards the request to the parent session.
|
|
275
|
-
*/
|
|
276
|
-
export interface TaskInboundInputRequest {
|
|
277
|
-
readonly callId: string;
|
|
278
|
-
readonly childContinuationToken: string;
|
|
279
|
-
readonly childSessionId: string;
|
|
280
|
-
readonly kind: "subagent-input-request";
|
|
281
|
-
readonly event: {
|
|
282
|
-
readonly requests: readonly TaskInputRequest[];
|
|
283
|
-
readonly sequence: number;
|
|
284
|
-
readonly stepIndex: number;
|
|
285
|
-
readonly turnId: string;
|
|
286
|
-
};
|
|
287
|
-
readonly subagentName: string;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Arrives when a delegated child turn starts and its session and turn ids are
|
|
291
|
-
* known. The task run records those ids for executor addressing; this payload
|
|
292
|
-
* does not itself make the task ready or wake the parent.
|
|
293
|
-
*/
|
|
294
|
-
export interface TaskInboundTurnStarted {
|
|
295
|
-
readonly childSessionId: string;
|
|
296
|
-
readonly childTurnId: string;
|
|
297
|
-
readonly kind: "turn-started";
|
|
298
|
-
readonly taskId: string;
|
|
299
|
-
}
|
|
300
|
-
/** Intermediate progress sent by a running child to its parent agent. */
|
|
99
|
+
/** Intermediate progress reported by an executor. */
|
|
301
100
|
export interface TaskInboundUpdate {
|
|
302
101
|
readonly callId: string;
|
|
303
|
-
/** Executor-neutral monotonic index within {@link updateEpoch}. */
|
|
304
102
|
readonly updateIndex: number;
|
|
305
|
-
/** Executor-neutral epoch id used with {@link updateIndex} for update dedupe. */
|
|
306
103
|
readonly updateEpoch: string;
|
|
307
104
|
readonly kind: "task-update";
|
|
308
105
|
readonly message: string;
|
|
309
106
|
}
|
|
310
|
-
/**
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
readonly
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
readonly event: SubagentAuthorizationEvent;
|
|
321
|
-
readonly subagentName: string;
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Human answers routed to the task run rather than straight to the
|
|
325
|
-
* child. The run owns both the delivery and the state change, so the
|
|
326
|
-
* batch it clears is exactly the batch it forwarded — the parent can no
|
|
327
|
-
* longer unblock the child while the run still believes it is blocked.
|
|
328
|
-
*/
|
|
107
|
+
/** One workflow-executor request bound to its private answer hook. */
|
|
108
|
+
export interface TaskInboundInputRequest {
|
|
109
|
+
readonly kind: "task-input-request";
|
|
110
|
+
readonly replyTo: string;
|
|
111
|
+
readonly requests: readonly TaskInputRequest[];
|
|
112
|
+
readonly sequence: number;
|
|
113
|
+
readonly stepIndex: number;
|
|
114
|
+
readonly turnId: string;
|
|
115
|
+
}
|
|
116
|
+
/** One human answer routed through the task that owns the blocked executor. */
|
|
329
117
|
export interface TaskInboundAnswerInput {
|
|
330
118
|
readonly auth?: unknown;
|
|
331
119
|
readonly childContinuationToken: string;
|
|
332
120
|
readonly childResponseUrl?: string;
|
|
333
|
-
readonly inputResponses: readonly
|
|
121
|
+
readonly inputResponses: readonly {
|
|
122
|
+
readonly optionId?: string;
|
|
123
|
+
readonly requestId: string;
|
|
124
|
+
readonly text?: string;
|
|
125
|
+
}[];
|
|
334
126
|
readonly kind: "input-response";
|
|
335
127
|
readonly taskId: string;
|
|
336
128
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
129
|
+
export type TaskRunInboundPayload = TaskCommandHookPayload | TaskInboundAnswerInput | TaskInboundUpdate;
|
|
130
|
+
/** Generic task-owned request sent through the parent session payload. */
|
|
131
|
+
interface TaskInputRequestDeliveryBase {
|
|
132
|
+
readonly replyTo: string;
|
|
133
|
+
readonly sequence: number;
|
|
134
|
+
readonly stepIndex: number;
|
|
135
|
+
readonly taskId: string;
|
|
136
|
+
readonly turnId: string;
|
|
137
|
+
}
|
|
138
|
+
export type TaskInputRequestDelivery = TaskInputRequestDeliveryBase & ({
|
|
139
|
+
readonly request: TaskInputRequest;
|
|
140
|
+
readonly requests?: never;
|
|
141
|
+
} | {
|
|
142
|
+
readonly request?: never;
|
|
143
|
+
readonly requests: readonly TaskInputRequest[];
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Child authorization event projected through the parent channel. Display
|
|
147
|
+
* only: the authorization callback completes against the child directly.
|
|
148
|
+
*/
|
|
149
|
+
export interface TaskAuthorizationEventDelivery {
|
|
150
|
+
readonly hookPayload: SubagentAuthorizationEventHookPayload;
|
|
151
|
+
readonly taskId: string;
|
|
152
|
+
}
|
|
153
|
+
/** Stable id shared by one authorization attempt's events, used to dedupe deliveries. */
|
|
154
|
+
export declare function taskAuthorizationRequestId(event: SubagentAuthorizationEvent): string;
|
|
155
|
+
/**
|
|
156
|
+
* Agent spawn or settlement a task-owned workflow tool run asks its parent to
|
|
157
|
+
* apply, forwarded after task admission. `replyTo` is the run's reply hook.
|
|
158
|
+
*/
|
|
159
|
+
export interface TaskAgentRequestDelivery {
|
|
160
|
+
readonly replyTo: string;
|
|
161
|
+
readonly request: WorkflowToolAgentRequest;
|
|
162
|
+
readonly taskId: string;
|
|
163
|
+
}
|
|
340
164
|
export declare const TASK_VIEW_STREAM_NAMESPACE = "eve.task";
|
|
341
|
-
/** True when the status can never change again. */
|
|
342
165
|
export declare function isTerminalTaskStatus(status: TaskStatus): boolean;
|
|
343
|
-
/** True when a transition into this status should wake the parent. */
|
|
344
166
|
export declare function isReadyTaskStatus(status: TaskStatus): boolean;
|
|
345
167
|
export {};
|
package/dist/src/tasks/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsonValuesEqual}from"#shared/json.js";function sameTaskMetadata(t,n){return jsonValuesEqual(t,n)}function readTaskUsage(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=readUsageAxis(e,`cacheReadTokens`),n=readUsageAxis(e,`cacheWriteTokens`),r=readUsageAxis(e,`inputTokens`),i=readUsageAxis(e,`outputTokens`);if(!(t===void 0||n===void 0||r===void 0||i===void 0))return{cacheReadTokens:t,cacheWriteTokens:n,inputTokens:r,outputTokens:i}}function readUsageAxis(e,t){let n=Reflect.get(e,t);return typeof n==`number`&&Number.isFinite(n)&&n>=0?n:void 0}function readTaskInputRequestId(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Reflect.get(e,`requestId`);return typeof t==`string`?t:void 0}const TASK_AUTHORIZATION_REQUEST_ID_PREFIX=`task:authorization`;function taskAuthorizationRequestId(e){return e.type===`approval.candidate`||e.type===`approval.settled`?`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.requestId}`:`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.attemptId??e.data.name}`}const TASK_VIEW_STREAM_NAMESPACE=`eve.task`;function isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}function isReadyTaskStatus(e){return e===`input_required`||isTerminalTaskStatus(e)}export{TASK_VIEW_STREAM_NAMESPACE,isReadyTaskStatus,isTerminalTaskStatus,readTaskInputRequestId,readTaskUsage,sameTaskMetadata,taskAuthorizationRequestId};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Approval } from "#approval/definition.js";
|
|
2
2
|
import type { DynamicResolveContext, DynamicToolEventName } from "#dynamic/definition.js";
|
|
3
3
|
import type { PublicToolInputSchema, PublicToolOutputSchema, ToolContext } from "#tools/definition.js";
|
|
4
|
+
import type { TaskDelegated, TaskExec } from "#tools/task.js";
|
|
4
5
|
import type { ToolModelOutput } from "#tools/model-output.js";
|
|
5
6
|
/**
|
|
6
7
|
* A single tool entry within a resolved dynamic tool set.
|
|
@@ -18,7 +19,8 @@ export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = an
|
|
|
18
19
|
readonly description: string;
|
|
19
20
|
readonly inputSchema: PublicToolInputSchema<TInput>;
|
|
20
21
|
readonly outputSchema?: PublicToolOutputSchema<TOutput>;
|
|
21
|
-
|
|
22
|
+
readonly execution?: "background";
|
|
23
|
+
execute(input: TInput, ctx: ToolContext, task?: TaskExec): TOutput | TaskDelegated | Promise<TOutput | TaskDelegated>;
|
|
22
24
|
readonly toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
|
|
23
25
|
/**
|
|
24
26
|
* Optional per-call approval gate, mirroring the authored-tool
|
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
export declare const agent: import("#tools/
|
|
1
|
+
export declare const agent: import("#tools/definition.js").BackgroundToolDefinition<{
|
|
2
2
|
agentId?: string | null | undefined;
|
|
3
3
|
message: string;
|
|
4
4
|
outputSchema?: {
|
|
5
5
|
[x: string]: unknown;
|
|
6
6
|
} | undefined;
|
|
7
|
-
},
|
|
7
|
+
}, {
|
|
8
|
+
agentId: string;
|
|
9
|
+
status: "working";
|
|
10
|
+
taskId: string;
|
|
11
|
+
}> & {
|
|
12
|
+
execute(input: {
|
|
13
|
+
agentId?: string | null | undefined;
|
|
14
|
+
message: string;
|
|
15
|
+
outputSchema?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
}, ctx: import("#tools/definition.js").ToolContext, task: import("#tools/definition.js").TaskExec): {
|
|
19
|
+
agentId: string;
|
|
20
|
+
status: "working";
|
|
21
|
+
taskId: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
8
24
|
export default agent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_TOOL_DESCRIPTION,SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{
|
|
1
|
+
import{defineTool}from"#tools/definition.js";import{SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA}from"#tools/framework/task-contract.js";import{AGENT_TOOL_DESCRIPTION,SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{attachToolBehavior}from"#tools/behavior.js";const agent=attachToolBehavior(defineTool({description:`${AGENT_TOOL_DESCRIPTION} This call starts a background task and returns a task receipt immediately.`,execution:`background`,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA,outputSchema:SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA,execute(){"use workflow";throw Error(`The framework "agent" tool was executed directly. It must be resolved through the runtime tool registry, which dispatches it to the shared subagent workflow.`)}}),{availability:[`root-session`],handling:{action:`self-agent`,kind:`dispatch`}});export{agent,agent as default};
|
|
@@ -8,13 +8,9 @@ export declare const taskCancel: import("#tools/native-definition.js").NativeToo
|
|
|
8
8
|
type: "error" | "result";
|
|
9
9
|
} | undefined;
|
|
10
10
|
metadata: {
|
|
11
|
-
agentId
|
|
12
|
-
kind: "subagent";
|
|
13
|
-
mode: "local" | "remote";
|
|
14
|
-
name: string;
|
|
15
|
-
} | {
|
|
16
|
-
data?: Record<string, unknown> | undefined;
|
|
11
|
+
agentId?: string | undefined;
|
|
17
12
|
kind: string;
|
|
13
|
+
mode?: "local" | "remote" | undefined;
|
|
18
14
|
name: string;
|
|
19
15
|
};
|
|
20
16
|
status: "cancelled" | "completed" | "failed" | "input_required" | "working";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
export declare const TASK_CANCEL_TOOL_NAME = "task_cancel";
|
|
3
3
|
export declare const TASK_UPDATE_TOOL_NAME = "task_update";
|
|
4
|
+
/** Framework task-control tool names lowered by the runtime. */
|
|
5
|
+
export declare const TASK_TOOL_NAMES: ReadonlySet<string>;
|
|
4
6
|
export declare const TASK_CANCEL_INPUT_SCHEMA: z.ZodObject<{
|
|
5
7
|
taskIds: z.ZodArray<z.ZodString>;
|
|
6
8
|
}, z.core.$strict>;
|
|
@@ -9,49 +11,40 @@ export declare const TASK_UPDATE_INPUT_SCHEMA: z.ZodObject<{
|
|
|
9
11
|
}, z.core.$strict>;
|
|
10
12
|
/** Strict model-visible task projection. */
|
|
11
13
|
export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
-
metadata: z.
|
|
13
|
-
agentId: z.ZodString
|
|
14
|
-
kind: z.
|
|
15
|
-
mode: z.ZodEnum<{
|
|
14
|
+
metadata: z.ZodObject<{
|
|
15
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
kind: z.ZodString;
|
|
17
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
16
18
|
local: "local";
|
|
17
19
|
remote: "remote";
|
|
18
|
-
}
|
|
20
|
+
}>>;
|
|
19
21
|
name: z.ZodString;
|
|
20
|
-
}, z.core.$strip
|
|
21
|
-
kind: z.ZodString;
|
|
22
|
-
name: z.ZodString;
|
|
23
|
-
}, z.core.$strip>]>;
|
|
22
|
+
}, z.core.$strip>;
|
|
24
23
|
taskId: z.ZodString;
|
|
25
24
|
status: z.ZodLiteral<"working">;
|
|
26
25
|
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
-
metadata: z.
|
|
28
|
-
agentId: z.ZodString
|
|
29
|
-
kind: z.
|
|
30
|
-
mode: z.ZodEnum<{
|
|
26
|
+
metadata: z.ZodObject<{
|
|
27
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
kind: z.ZodString;
|
|
29
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
31
30
|
local: "local";
|
|
32
31
|
remote: "remote";
|
|
33
|
-
}
|
|
34
|
-
name: z.ZodString;
|
|
35
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
36
|
-
kind: z.ZodString;
|
|
32
|
+
}>>;
|
|
37
33
|
name: z.ZodString;
|
|
38
|
-
}, z.core.$strip
|
|
34
|
+
}, z.core.$strip>;
|
|
39
35
|
taskId: z.ZodString;
|
|
40
36
|
inputRequests: z.ZodReadonly<z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
|
|
41
37
|
status: z.ZodLiteral<"input_required">;
|
|
42
38
|
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
-
metadata: z.
|
|
44
|
-
agentId: z.ZodString
|
|
45
|
-
kind: z.
|
|
46
|
-
mode: z.ZodEnum<{
|
|
39
|
+
metadata: z.ZodObject<{
|
|
40
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
kind: z.ZodString;
|
|
42
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
47
43
|
local: "local";
|
|
48
44
|
remote: "remote";
|
|
49
|
-
}
|
|
50
|
-
name: z.ZodString;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
kind: z.ZodString;
|
|
45
|
+
}>>;
|
|
53
46
|
name: z.ZodString;
|
|
54
|
-
}, z.core.$strip
|
|
47
|
+
}, z.core.$strip>;
|
|
55
48
|
taskId: z.ZodString;
|
|
56
49
|
lastOutput: z.ZodObject<{
|
|
57
50
|
data: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
|
|
@@ -59,18 +52,15 @@ export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
59
52
|
}, z.core.$strip>;
|
|
60
53
|
status: z.ZodLiteral<"completed">;
|
|
61
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
-
metadata: z.
|
|
63
|
-
agentId: z.ZodString
|
|
64
|
-
kind: z.
|
|
65
|
-
mode: z.ZodEnum<{
|
|
55
|
+
metadata: z.ZodObject<{
|
|
56
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
kind: z.ZodString;
|
|
58
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
66
59
|
local: "local";
|
|
67
60
|
remote: "remote";
|
|
68
|
-
}
|
|
61
|
+
}>>;
|
|
69
62
|
name: z.ZodString;
|
|
70
|
-
}, z.core.$strip
|
|
71
|
-
kind: z.ZodString;
|
|
72
|
-
name: z.ZodString;
|
|
73
|
-
}, z.core.$strip>]>;
|
|
63
|
+
}, z.core.$strip>;
|
|
74
64
|
taskId: z.ZodString;
|
|
75
65
|
lastOutput: z.ZodObject<{
|
|
76
66
|
data: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
|
|
@@ -78,18 +68,15 @@ export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
78
68
|
}, z.core.$strip>;
|
|
79
69
|
status: z.ZodLiteral<"failed">;
|
|
80
70
|
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
-
metadata: z.
|
|
82
|
-
agentId: z.ZodString
|
|
83
|
-
kind: z.
|
|
84
|
-
mode: z.ZodEnum<{
|
|
71
|
+
metadata: z.ZodObject<{
|
|
72
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
kind: z.ZodString;
|
|
74
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
85
75
|
local: "local";
|
|
86
76
|
remote: "remote";
|
|
87
|
-
}
|
|
77
|
+
}>>;
|
|
88
78
|
name: z.ZodString;
|
|
89
|
-
}, z.core.$strip
|
|
90
|
-
kind: z.ZodString;
|
|
91
|
-
name: z.ZodString;
|
|
92
|
-
}, z.core.$strip>]>;
|
|
79
|
+
}, z.core.$strip>;
|
|
93
80
|
taskId: z.ZodString;
|
|
94
81
|
status: z.ZodLiteral<"cancelled">;
|
|
95
82
|
}, z.core.$strip>], "status">;
|
|
@@ -103,19 +90,15 @@ export declare const TASK_VIEW_OUTPUT_SCHEMA: z.ZodObject<{
|
|
|
103
90
|
result: "result";
|
|
104
91
|
}>;
|
|
105
92
|
}, z.core.$strip>>;
|
|
106
|
-
metadata: z.
|
|
107
|
-
agentId: z.ZodString
|
|
108
|
-
kind: z.
|
|
109
|
-
mode: z.ZodEnum<{
|
|
93
|
+
metadata: z.ZodObject<{
|
|
94
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
kind: z.ZodString;
|
|
96
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
110
97
|
local: "local";
|
|
111
98
|
remote: "remote";
|
|
112
|
-
}
|
|
113
|
-
name: z.ZodString;
|
|
114
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
116
|
-
kind: z.ZodString;
|
|
99
|
+
}>>;
|
|
117
100
|
name: z.ZodString;
|
|
118
|
-
}, z.core.$strip
|
|
101
|
+
}, z.core.$strip>;
|
|
119
102
|
status: z.ZodEnum<{
|
|
120
103
|
cancelled: "cancelled";
|
|
121
104
|
completed: "completed";
|
|
@@ -135,19 +118,15 @@ export declare const TASK_VIEWS_OUTPUT_SCHEMA: z.ZodObject<{
|
|
|
135
118
|
result: "result";
|
|
136
119
|
}>;
|
|
137
120
|
}, z.core.$strip>>;
|
|
138
|
-
metadata: z.
|
|
139
|
-
agentId: z.ZodString
|
|
140
|
-
kind: z.
|
|
141
|
-
mode: z.ZodEnum<{
|
|
121
|
+
metadata: z.ZodObject<{
|
|
122
|
+
agentId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
kind: z.ZodString;
|
|
124
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
142
125
|
local: "local";
|
|
143
126
|
remote: "remote";
|
|
144
|
-
}
|
|
145
|
-
name: z.ZodString;
|
|
146
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
148
|
-
kind: z.ZodString;
|
|
127
|
+
}>>;
|
|
149
128
|
name: z.ZodString;
|
|
150
|
-
}, z.core.$strip
|
|
129
|
+
}, z.core.$strip>;
|
|
151
130
|
status: z.ZodEnum<{
|
|
152
131
|
cancelled: "cancelled";
|
|
153
132
|
completed: "completed";
|