eve 0.50.0 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/session.d.ts +2 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +16 -20
- package/dist/src/chunks/{use-eve-agent-B5I-k6Ek.js → use-eve-agent-3DZuvuWE.js} +21 -10
- package/dist/src/chunks/{use-eve-agent-DUMU6dap.js → use-eve-agent-D7apPojZ.js} +21 -10
- 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/agent-instructions.d.ts +3 -1
- package/dist/src/cli/commands/agent-instructions.js +1 -1
- 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.d.ts +2 -13
- package/dist/src/cli/commands/init.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-project-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-project-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +2 -2
- 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/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +3 -1
- package/dist/src/cli/dev/tui/setup-commands.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/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.d.ts +3 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -1
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@clack/core/LICENSE +9 -0
- package/dist/src/compiled/@clack/core/index.d.ts +363 -0
- package/dist/src/compiled/@clack/core/index.js +20 -0
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +34 -92
- package/dist/src/compiled/@vercel/sandbox/api-client/base-client.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +13 -29
- package/dist/src/compiled/@vercel/sandbox/constants.d.ts +11 -1
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -3
- package/dist/src/compiled/@vercel/sandbox/index.js +9 -9
- package/dist/src/compiled/@vercel/sandbox/sandbox-user.d.ts +5 -6
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +79 -67
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +5 -3
- package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-client.d.ts +86 -1
- package/dist/src/compiled/@vercel/sandbox-drives/api-client/index.d.ts +2 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/validators.d.ts +26 -1
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/constants.d.ts +2 -2
- package/dist/src/compiled/@vercel/{sandbox → sandbox-drives}/drive.d.ts +10 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/index.d.ts +3 -2
- package/dist/src/compiled/@vercel/sandbox-drives/index.js +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox.d.ts +35 -6
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +2 -4
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +9 -7
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +13 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +54 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +24 -2
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
- package/dist/src/compiled/@workflow/errors/index.d.ts +19 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +46 -2
- package/dist/src/compiled/@workflow/world/events.d.ts +26 -1
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -2
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
- package/dist/src/compiled/_chunks/node/{auth-BSKyPAEP.js → auth-Bx1Aoyfo.js} +1 -1
- package/dist/src/compiled/_chunks/node/{auth-YpKlwhP1.js → auth-CA8ZMfB8.js} +1 -1
- package/dist/src/compiled/_chunks/node/esm-CE0tAvRh.js +7 -0
- package/dist/src/compiled/_chunks/node/version-BC6t2Txc.js +1 -0
- package/dist/src/compiled/_chunks/node/version-DSQqVZ5T.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BwAadFfB.js → attribute-changes-03lzo29R.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-BIdMK5N8.js +40 -0
- package/dist/src/compiled/_chunks/workflow/dist-DMQ3CtWt.js +3 -0
- package/dist/src/compiled/_chunks/workflow/frames-Boesh7kU.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{private-CZFMABEf.js → private-CKx3PkSS.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-BToMtPbH.js → resume-hook-C6eL-S_T.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/run-BV0S6Zc2.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-Bh3jP9ii.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-l-cwfJvm.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-PnVVxT0R.js → ws-transport-BagXNxCE.js} +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +20 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- 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/compiler/normalize-tool.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/extensions.d.ts +2 -0
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +1 -0
- package/dist/src/discover/filesystem.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/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/session-cleanup.d.ts +7 -0
- package/dist/src/evals/session-cleanup.js +1 -0
- package/dist/src/evals/session.d.ts +4 -0
- package/dist/src/evals/session.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +1 -0
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/activity-collector.js +1 -1
- package/dist/src/execution/activity-work-id.js +1 -1
- package/dist/src/execution/activity-work.d.ts +8 -0
- package/dist/src/execution/activity-work.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +6 -0
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -0
- 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.d.ts +2 -0
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +7 -13
- package/dist/src/execution/node-step.d.ts +1 -2
- 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 -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/run-session-limits.d.ts +5 -5
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-create-sdk.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +4 -4
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/session-activity-projection.js +1 -1
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +2 -3
- package/dist/src/execution/session-timeout-workflow.js +1 -1
- package/dist/src/execution/session.d.ts +2 -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 +19 -11
- 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 -27
- 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 -48
- 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/subagent-task-projection.d.ts +26 -0
- package/dist/src/execution/tasks/parent/subagent-task-projection.js +1 -0
- 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/sleep-workflow.d.ts +3 -0
- package/dist/src/execution/tools/sleep-workflow.js +1 -0
- package/dist/src/execution/tools/sleep.d.ts +1 -5
- package/dist/src/execution/tools/sleep.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-cancellation-control.d.ts +1 -0
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-cancellation-token.d.ts +1 -0
- package/dist/src/execution/turn-control-receiver.d.ts +3 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-dispatch.d.ts +2 -0
- package/dist/src/execution/turn-dispatch.js +1 -1
- 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 +14 -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.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/wire/session-inbox-wire.v5.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.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/session-limit-continuation.d.ts +5 -5
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +4 -4
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/session-usage-limits.d.ts +48 -0
- package/dist/src/harness/session-usage-limits.js +1 -0
- 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 +20 -21
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +9 -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/application/build-output-environment.d.ts +1 -0
- package/dist/src/internal/application/build-output-environment.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/eve-project-root.d.ts +8 -0
- package/dist/src/internal/eve-project-root.js +1 -0
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -0
- package/dist/src/internal/nitro/host/create-application-nitro.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/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +1 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/project-context.d.ts +31 -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 +28 -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/reference.d.ts +2 -0
- package/dist/src/internal/workflow/reference.js +1 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +0 -9
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.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/channels/slack/activity-plan.d.ts +4 -0
- package/dist/src/public/channels/slack/activity-plan.js +1 -0
- package/dist/src/public/channels/slack/activity.d.ts +45 -2
- package/dist/src/public/channels/slack/activity.js +2 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/memory/index.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/nuxt/index.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +3 -2
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +9 -5
- package/dist/src/public/sandbox/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/vercel.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/self-modification/agent.d.ts +22 -0
- package/dist/src/self-modification/agent.js +1 -0
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +19 -0
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -0
- package/dist/src/self-modification/extension/eve-add.d.ts +56 -0
- package/dist/src/self-modification/extension/eve-add.js +2 -0
- package/dist/src/self-modification/extension/extension.d.ts +2 -0
- package/dist/src/self-modification/extension/extension.js +1 -0
- package/dist/src/self-modification/extension/instructions.d.ts +4 -0
- package/dist/src/self-modification/extension/instructions.js +23 -0
- package/dist/src/self-modification/extension/source-lock.d.ts +2 -0
- package/dist/src/self-modification/extension/source-lock.js +1 -0
- package/dist/src/self-modification/extension/tools/edit_file.d.ts +16 -0
- package/dist/src/self-modification/extension/tools/edit_file.js +1 -0
- package/dist/src/self-modification/extension/tools/registry_add.d.ts +52 -0
- package/dist/src/self-modification/extension/tools/registry_add.js +1 -0
- package/dist/src/self-modification/extension/tools/search_models.d.ts +22 -0
- package/dist/src/self-modification/extension/tools/search_models.js +1 -0
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +103 -0
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -0
- package/dist/src/self-modification/filesystem.d.ts +6 -0
- package/dist/src/self-modification/filesystem.js +1 -0
- package/dist/src/self-modification/sandbox.d.ts +2 -0
- package/dist/src/self-modification/sandbox.js +1 -0
- package/dist/src/services/dev-client/target.d.ts +3 -1
- package/dist/src/setup/boxes/select-model.d.ts +3 -21
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/prompt-ui.js +4 -4
- package/dist/src/setup/cli/select-component.d.ts +1 -1
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -0
- package/dist/src/setup/flows/model.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/prompter.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/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/shared/action-types.d.ts +103 -30
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +13 -0
- package/dist/src/shared/agent-turn-outcome.d.ts +2 -0
- package/dist/src/shared/agent-turn-outcome.js +1 -1
- package/dist/src/shared/extension-package-contract.d.ts +2 -0
- package/dist/src/shared/extension-package-contract.js +1 -1
- package/dist/src/shared/gateway-model-catalog.d.ts +21 -0
- package/dist/src/shared/gateway-model-catalog.js +1 -0
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/shared/token-usage.d.ts +11 -15
- package/dist/src/shared/token-usage.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/subagents/token-budget.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 +70 -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/tools/provided/sleep.d.ts +2 -2
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +24 -19
- package/docs/channels/eve.mdx +1 -1
- package/docs/concepts/built-in-tools.md +10 -91
- 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 +11 -3
- package/docs/guides/client/streaming.mdx +1 -1
- 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/memory/overview.mdx +1 -1
- package/docs/reference/cli.md +5 -2
- package/docs/sandbox.mdx +3 -1
- package/docs/subagents/index.mdx +9 -8
- package/docs/tools/overview.mdx +11 -10
- package/docs/tools/workflows.mdx +52 -18
- package/package.json +38 -13
- package/dist/src/compiled/@vercel/sandbox-delete/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-delete/index.js +0 -9
- package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +0 -201
- package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +0 -8
- package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +0 -1456
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +0 -29
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +0 -39
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +0 -66
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +0 -899
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +0 -10
- package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +0 -18
- package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +0 -6
- package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +0 -111
- package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +0 -28
- package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +0 -40
- package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +0 -292
- package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +0 -116
- package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +0 -258
- package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +0 -12
- package/dist/src/compiled/@vercel/sandbox-stable/index.js +0 -1
- package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +0 -169
- package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +0 -55
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +0 -212
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +0 -1216
- package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +0 -433
- package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +0 -229
- package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +0 -21
- package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +0 -16
- package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +0 -11
- package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +0 -11
- package/dist/src/compiled/_chunks/node/decode_jwt-Col8JOnf.js +0 -7
- package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +0 -1
- package/dist/src/compiled/_chunks/node/version-DH6yRy-M.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +0 -40
- package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +0 -3
- package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +0 -3
- package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +0 -15
- 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/session-token-limits.d.ts +0 -41
- package/dist/src/harness/session-token-limits.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/subagent-token-budget.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/turn-sleep.d.ts +0 -12
- package/dist/src/harness/turn-sleep.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/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +0 -16
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js +0 -5
- package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.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/compiled/@vercel/{sandbox-delete → sandbox-drives}/LICENSE +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_async-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_workflow-serde.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/base-client.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/file-writer.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/with-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/file.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/index.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/oauth.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/poll-for-token.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/project.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/command.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/execution-context.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/filesystem.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/network-policy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/proxy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox-user.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/session.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/get-credentials.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/paginator.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/resolveSignal.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/sandbox-snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/types.d.ts +0 -0
- /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
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { PreparedRuntimeActionDispatch } from "#execution/dispatch-runtime-actions-shared.js";
|
|
2
|
-
import type { RuntimeSession } from "#execution/agent-handle-dispatch.js";
|
|
3
|
-
import type { RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
4
|
-
import type { PendingDispatchAction, PendingWorkflowToolAction } from "#shared/dispatch-action.js";
|
|
5
|
-
export declare function isWorkflowToolAction(action: PendingDispatchAction): action is PendingWorkflowToolAction;
|
|
6
|
-
/**
|
|
7
|
-
* Starts the run and records it on the session so the turn can bind its
|
|
8
|
-
* result, route its requests, and cancel it. A start failure settles the call
|
|
9
|
-
* with an error and records nothing, so nothing is left to cancel.
|
|
10
|
-
*/
|
|
11
|
-
export declare function startWorkflowTool(input: {
|
|
12
|
-
readonly action: PendingWorkflowToolAction;
|
|
13
|
-
readonly batchEvent: {
|
|
14
|
-
readonly sequence: number;
|
|
15
|
-
readonly stepIndex: number;
|
|
16
|
-
readonly turnId: string;
|
|
17
|
-
};
|
|
18
|
-
readonly ownerInboxToken: string | undefined;
|
|
19
|
-
readonly prepared: Pick<PreparedRuntimeActionDispatch, "auth" | "initiatorAuth" | "parentSession">;
|
|
20
|
-
readonly session: RuntimeSession;
|
|
21
|
-
}): Promise<{
|
|
22
|
-
readonly result?: RuntimeToolResultActionResult;
|
|
23
|
-
readonly session: RuntimeSession;
|
|
24
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createLogger,logError}from"#internal/logging.js";import{toError}from"#shared/errors.js";import{recordToolRun}from"#harness/tool-runs.js";import{deriveRunOwner}from"#execution/tool-run/messages.js";import{startToolRun}from"#execution/tool-run/start.js";import{createRuntimeToolResultFromValue}from"#harness/action-result-helpers.js";const log=createLogger(`execution.tool-run`);function isWorkflowToolAction(e){return e.target.kind===`workflow-tool-call`}async function startWorkflowTool(e){let{action:n,batchEvent:r,prepared:i,session:a}=e;if(e.ownerInboxToken===void 0)throw Error(`Workflow tool "${n.toolName}" was dispatched without the turn inbox its run reports to.`);try{let t=await startToolRun({callId:n.callId,input:n.input,owner:deriveRunOwner(e.ownerInboxToken),session:{auth:{current:i.auth,initiator:i.initiatorAuth},id:a.sessionId,parent:i.parentSession,turn:{id:r.turnId,sequence:r.sequence}},stepIndex:r.stepIndex,toolName:n.toolName,workflowId:n.target.workflowId});return{session:recordToolRun(a,{callId:n.callId,hookToken:t.hookToken,runId:t.runId,toolName:n.toolName})}}catch(e){return logError(log,`workflow tool run failed to start`,e,{callId:n.callId,toolName:n.toolName}),{result:createRuntimeToolResultFromValue({callId:n.callId,isError:!0,output:toError(e),toolName:n.toolName}),session:a}}}export{isWorkflowToolAction,startWorkflowTool};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RunRef } from "#execution/tool-run/messages.js";
|
|
2
|
-
import type { JsonValue } from "#shared/json.js";
|
|
3
|
-
export declare function emitRunReportStep(input: {
|
|
4
|
-
readonly from: RunRef;
|
|
5
|
-
readonly parentWritable: WritableStream<Uint8Array>;
|
|
6
|
-
readonly update: JsonValue;
|
|
7
|
-
}): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createActionPartialEvent,encodeMessageStreamEvent,stampMessageStreamEvent}from"#protocol/message.js";import{createRuntimeToolResultFromValue}from"#harness/action-result-helpers.js";async function emitRunReportStep(e){"use step";let t=createActionPartialEvent({result:createRuntimeToolResultFromValue({callId:e.from.callId,output:e.update,toolName:e.from.toolName}),sequence:e.from.sequence,stepIndex:e.from.stepIndex,turnId:e.from.turnId}),n=e.parentWritable.getWriter();try{await n.write(encodeMessageStreamEvent(stampMessageStreamEvent(t)))}finally{n.releaseLock()}}export{emitRunReportStep};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { type Hook } from "#compiled/@workflow/core/index.js";
|
|
2
|
-
import type { ToolContext, ToolInputRequest, ToolInputResponse } from "#tools/definition.js";
|
|
3
|
-
import type { JsonObject, JsonValue } from "#shared/json.js";
|
|
4
|
-
export interface ToolRunOwner {
|
|
5
|
-
readonly outcome: string;
|
|
6
|
-
readonly report: string;
|
|
7
|
-
readonly request: string;
|
|
8
|
-
}
|
|
9
|
-
/** Identifies the sending run to an owner that shares its channels across many runs. */
|
|
10
|
-
export interface RunRef {
|
|
11
|
-
readonly callId: string;
|
|
12
|
-
/** The tool's parsed input, shown as the request's action when the run asks. */
|
|
13
|
-
readonly input: JsonObject;
|
|
14
|
-
readonly runId: string;
|
|
15
|
-
/** Stream coordinates of the model call that made the tool call. */
|
|
16
|
-
readonly sequence: number;
|
|
17
|
-
readonly stepIndex: number;
|
|
18
|
-
readonly toolName: string;
|
|
19
|
-
readonly turnId: string;
|
|
20
|
-
}
|
|
21
|
-
export type RunOutcome = {
|
|
22
|
-
readonly status: "completed";
|
|
23
|
-
readonly output: JsonValue;
|
|
24
|
-
} | {
|
|
25
|
-
readonly status: "failed";
|
|
26
|
-
readonly error: unknown;
|
|
27
|
-
} | {
|
|
28
|
-
readonly status: "cancelled";
|
|
29
|
-
readonly reason?: string;
|
|
30
|
-
};
|
|
31
|
-
/** Progress sent up from a run; the owner streams it as a turn partial or a task update. */
|
|
32
|
-
export interface RunReport {
|
|
33
|
-
readonly from: RunRef;
|
|
34
|
-
readonly update: JsonValue;
|
|
35
|
-
}
|
|
36
|
-
/** A question sent up from a run; the owner puts it to the human and resumes `answerToken` with the reply. */
|
|
37
|
-
export interface RunRequestMessage {
|
|
38
|
-
readonly answerToken: string;
|
|
39
|
-
readonly from: RunRef;
|
|
40
|
-
readonly request: ToolInputRequest;
|
|
41
|
-
}
|
|
42
|
-
/** The end of a run, sent up once; the owner settles the tool call or the task with it. */
|
|
43
|
-
export interface RunOutcomeMessage {
|
|
44
|
-
readonly from: RunRef;
|
|
45
|
-
readonly result: RunOutcome;
|
|
46
|
-
}
|
|
47
|
-
export declare const reportHook: import("#compiled/@workflow/core/index.js").TypedHook<RunReport, RunReport>;
|
|
48
|
-
export declare const requestHook: import("#compiled/@workflow/core/index.js").TypedHook<RunRequestMessage, RunRequestMessage>;
|
|
49
|
-
export declare const outcomeHook: import("#compiled/@workflow/core/index.js").TypedHook<RunOutcomeMessage, RunOutcomeMessage>;
|
|
50
|
-
/** Derived from the owner's inbox token so owner and run agree without exchanging tokens. */
|
|
51
|
-
export declare function deriveRunOwner(inboxToken: string): ToolRunOwner;
|
|
52
|
-
export type RunControlMessage = {
|
|
53
|
-
readonly kind: "cancel";
|
|
54
|
-
readonly reason: string;
|
|
55
|
-
};
|
|
56
|
-
export declare function isRunControlMessage(value: unknown): value is RunControlMessage;
|
|
57
|
-
interface RunContext {
|
|
58
|
-
answerSeq: number;
|
|
59
|
-
readonly from: RunRef;
|
|
60
|
-
readonly owner: ToolRunOwner;
|
|
61
|
-
}
|
|
62
|
-
export declare function attachRunContext(ctx: ToolContext, context: Omit<RunContext, "answerSeq">): void;
|
|
63
|
-
/**
|
|
64
|
-
* Asks the human on the session's channel and returns the hook the answer
|
|
65
|
-
* resumes, as `createHook` would: await it for the answer, or race it against
|
|
66
|
-
* a `sleep` for a deadline. Synchronous because a `Hook` is thenable: an async
|
|
67
|
-
* `ask` would resolve to the answer, never the hook.
|
|
68
|
-
*/
|
|
69
|
-
export declare function ask(ctx: ToolContext, request: ToolInputRequest): Hook<ToolInputResponse>;
|
|
70
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createHook,defineHook}from"#compiled/@workflow/core/index.js";import{toolRunAnswerToken}from"#harness/tool-runs.js";import{resumeHookStep}from"#execution/tool-run/resume-hook-step.js";const reportHook=defineHook(),requestHook=defineHook(),outcomeHook=defineHook();function deriveRunOwner(e){return{outcome:`${e}:outcome`,report:`${e}:report`,request:`${e}:request`}}function isRunControlMessage(e){if(typeof e!=`object`||!e)return!1;let{kind:t,reason:n}=e;return t===`cancel`&&typeof n==`string`}const RUN_CONTEXT=Symbol.for(`eve.tool-run.context`);function attachRunContext(e,t){Object.defineProperty(e,RUN_CONTEXT,{enumerable:!1,value:{...t,answerSeq:0}})}function readRunContext(e){let t=e[RUN_CONTEXT];if(t===void 0)throw Error(`ask() must be called with the context of a workflow tool body ("use workflow").`);return t}function ask(t,r){let i=readRunContext(t),a=createHook({token:toolRunAnswerToken(i.from.runId,i.answerSeq++)}),o={answerToken:a.token,from:i.from,request:r};return resumeHookStep(i.owner.request,o),a}export{ask,attachRunContext,deriveRunOwner,isRunControlMessage,outcomeHook,reportHook,requestHook};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SubagentInputRequestHookPayload } from "#channel/types.js";
|
|
2
|
-
import type { RunOutcomeMessage, RunReport, RunRequestMessage } from "#execution/tool-run/messages.js";
|
|
3
|
-
import type { RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
4
|
-
import type { TaskCommand, TaskInboundUpdate } from "#tasks/types.js";
|
|
5
|
-
/** A cancelled run settles the call as an error so the owner never waits on it. */
|
|
6
|
-
export declare function runOutcomeToToolResult(message: RunOutcomeMessage): RuntimeToolResultActionResult;
|
|
7
|
-
/** The answer hook token is both the request id and the route, so one resume reaches the body. */
|
|
8
|
-
export declare function runRequestToInputRequestPayload(message: RunRequestMessage): SubagentInputRequestHookPayload;
|
|
9
|
-
export declare function runReportToTaskUpdate(message: RunReport, taskId: string, updateIndex: number): TaskInboundUpdate;
|
|
10
|
-
/** A cancelled run only settles the executor: the task itself was already cancelled. */
|
|
11
|
-
export declare function runOutcomeToTaskCommand(message: RunOutcomeMessage): TaskCommand;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function runOutcomeToToolResult(e){let{from:t,result:n}=e;if(n.status===`completed`)return{callId:t.callId,kind:`tool-result`,output:n.output,toolName:t.toolName};let r=n.status===`failed`?errorMessage(n.error):n.reason??`The tool run was cancelled.`;return{callId:t.callId,isError:!0,kind:`tool-result`,output:r,toolName:t.toolName}}function errorMessage(e){if(typeof e==`object`&&e&&`message`in e){let t=e.message;if(typeof t==`string`)return t}return String(e)}function runRequestToInputRequestPayload(e){let{answerToken:t,from:n,request:r}=e;return{callId:n.callId,childContinuationToken:t,childSessionId:n.runId,event:{requests:[toInputRequest(r,n,t)],sequence:n.sequence,stepIndex:n.stepIndex,turnId:n.turnId},kind:`subagent-input-request`,subagentName:n.toolName}}function toInputRequest(e,t,n){if(typeof e.prompt!=`string`||e.prompt.length===0)throw TypeError("A tool run request needs a non-empty `prompt`.");let r={action:{callId:t.callId,input:t.input,kind:`tool-call`,toolName:t.toolName},kind:`question`,prompt:e.prompt,requestId:n};return e.allowFreeform!==void 0&&(r.allowFreeform=e.allowFreeform),e.display!==void 0&&(r.display=e.display),e.options!==void 0&&(r.options=[...e.options]),r}function runReportToTaskUpdate(e,t,n){return{callId:e.from.callId,kind:`task-update`,message:typeof e.update==`string`?e.update:JSON.stringify(e.update),updateEpoch:t,updateIndex:n}}function runOutcomeToTaskCommand(e){let{result:t}=e;return t.status===`completed`?{data:t.output,kind:`complete`,lifecycle:`terminal`}:t.status===`failed`?{data:errorMessage(t.error),kind:`fail`,lifecycle:`terminal`}:{kind:`settle-executor`}}export{runOutcomeToTaskCommand,runOutcomeToToolResult,runReportToTaskUpdate,runRequestToInputRequestPayload};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type RunOutcomeMessage, type RunReport, type RunRequestMessage } from "#execution/tool-run/messages.js";
|
|
2
|
-
import { type ChannelReader } from "#execution/tool-run/owner-channels.js";
|
|
3
|
-
/** In read priority: what a run said before its outcome lands first. */
|
|
4
|
-
export type RunOwnerReaders = readonly [
|
|
5
|
-
ChannelReader<"report", RunReport>,
|
|
6
|
-
ChannelReader<"request", RunRequestMessage>,
|
|
7
|
-
ChannelReader<"outcome", RunOutcomeMessage>
|
|
8
|
-
];
|
|
9
|
-
export interface RunOwnerChannels {
|
|
10
|
-
readonly readers: RunOwnerReaders;
|
|
11
|
-
dispose(): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export declare function openRunOwnerChannels(inboxToken: string): RunOwnerChannels;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{disposeHook}from"#execution/hook-ownership.js";import{createChannelReader}from"#execution/tool-run/owner-channels.js";import{deriveRunOwner,outcomeHook,reportHook,requestHook}from"#execution/tool-run/messages.js";function openRunOwnerChannels(e){let t=deriveRunOwner(e),n=reportHook.create({token:t.report}),r=requestHook.create({token:t.request}),i=outcomeHook.create({token:t.outcome});return{readers:[createChannelReader(`report`,n),createChannelReader(`request`,r),createChannelReader(`outcome`,i)],async dispose(){await Promise.all([disposeHook(n),disposeHook(r),disposeHook(i)])}}}export{openRunOwnerChannels};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Hook } from "#compiled/@workflow/core/index.js";
|
|
2
|
-
import { type RunControlMessage } from "#execution/tool-run/messages.js";
|
|
3
|
-
/**
|
|
4
|
-
* The run's control inbox. An unawaited hook read is not scheduled under
|
|
5
|
-
* replay, so `cancelled` must be raced for a cancel to be observed at all.
|
|
6
|
-
*/
|
|
7
|
-
export interface RunControlInbox {
|
|
8
|
-
readonly hook: Hook<RunControlMessage>;
|
|
9
|
-
readonly signal: AbortSignal;
|
|
10
|
-
/** Rejects with {@link RunCancelledError} when a cancel message arrives; never resolves. */
|
|
11
|
-
readonly cancelled: Promise<never>;
|
|
12
|
-
reason(): string | undefined;
|
|
13
|
-
}
|
|
14
|
-
/** Opens without claiming, so a losing duplicate start never trips the signal. */
|
|
15
|
-
export declare function openRunControlInbox(hookToken: string): RunControlInbox;
|
|
16
|
-
export declare class RunCancelledError extends Error {
|
|
17
|
-
constructor(reason: string);
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createHook}from"#compiled/@workflow/core/index.js";import{isRunControlMessage}from"#execution/tool-run/messages.js";function openRunControlInbox(t){let n=createHook({token:t}),r=n[Symbol.asyncIterator](),i=new AbortController,a,o=consumeCancel(r,e=>{a=e,i.abort(new RunCancelledError(e))});return o.catch(()=>{}),{cancelled:o,hook:n,reason:()=>a,signal:i.signal}}async function consumeCancel(e,n){for(;;){let r;try{r=await e.next()}catch{return await new Promise(()=>{})}if(r.done===!0)return await new Promise(()=>{});if(isRunControlMessage(r.value))throw n(r.value.reason),new RunCancelledError(r.value.reason)}}var RunCancelledError=class extends Error{constructor(e){super(e),this.name=`RunCancelledError`}};export{RunCancelledError,openRunControlInbox};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ToolRunWorkflowInput } from "#execution/tool-run/types.js";
|
|
2
|
-
export declare function deriveToolRunHookToken(input: {
|
|
3
|
-
readonly callId: string;
|
|
4
|
-
readonly parentSessionId: string;
|
|
5
|
-
readonly parentTurnId: string;
|
|
6
|
-
}): string;
|
|
7
|
-
/** Resolves once the run owns its hook. Call from inside a `"use step"` body. */
|
|
8
|
-
export declare function startToolRun(input: Omit<ToolRunWorkflowInput, "hookToken">): Promise<{
|
|
9
|
-
readonly hookToken: string;
|
|
10
|
-
readonly runId: string;
|
|
11
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{startWorkflowOnCurrentDeployment,toolRunWorkflowReference,waitForCommandHookOwner}from"#execution/workflow-runtime.js";import{deriveAgentOperationId}from"#harness/handles/operation-id.js";function deriveToolRunHookToken(e){return`eve:tool-run:${deriveAgentOperationId(e)}`}async function startToolRun(t){let n=deriveToolRunHookToken({callId:t.callId,parentSessionId:t.session.id,parentTurnId:t.session.turn.id});return await startWorkflowOnCurrentDeployment(toolRunWorkflowReference,[{...t,hookToken:n}]),{hookToken:n,runId:(await waitForCommandHookOwner(n)).runId}}export{deriveToolRunHookToken,startToolRun};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { SessionContext } from "#context/session-context.js";
|
|
2
|
-
import type { ToolRunOwner } from "#execution/tool-run/messages.js";
|
|
3
|
-
import type { JsonObject } from "#shared/json.js";
|
|
4
|
-
export type ToolRunSessionContext = SessionContext["session"];
|
|
5
|
-
export interface ToolRunWorkflowInput {
|
|
6
|
-
readonly callId: string;
|
|
7
|
-
/** Deterministic per call: a replayed start re-derives it, loses the claim, and exits. */
|
|
8
|
-
readonly hookToken: string;
|
|
9
|
-
readonly input: JsonObject;
|
|
10
|
-
readonly owner: ToolRunOwner;
|
|
11
|
-
readonly session: ToolRunSessionContext;
|
|
12
|
-
/** Harness step index of the model call that made this tool call. */
|
|
13
|
-
readonly stepIndex: number;
|
|
14
|
-
readonly toolName: string;
|
|
15
|
-
readonly workflowId: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ToolRunAddress {
|
|
18
|
-
readonly hookToken: string;
|
|
19
|
-
readonly runId: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const WORKFLOW_TOOL_EXECUTOR_KIND = "workflow-tool";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const WORKFLOW_TOOL_EXECUTOR_KIND=`workflow-tool`;export{WORKFLOW_TOOL_EXECUTOR_KIND};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ToolRunWorkflowInput } from "#execution/tool-run/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Runs one authored workflow tool call. The run's own hook is its identity
|
|
4
|
-
* claim and its control inbox: a duplicate start loses the claim and exits; a
|
|
5
|
-
* `cancel` message aborts `ctx.abortSignal`, and the run waits up to
|
|
6
|
-
* {@link CANCEL_GRACE} for the body to unwind before ending as cancelled, so a
|
|
7
|
-
* body parked on a hook or sleep cannot keep a cancelled run alive.
|
|
8
|
-
*/
|
|
9
|
-
export declare function toolRunWorkflow(input: ToolRunWorkflowInput): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getWorkflowMetadata,sleep}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,disposeHook,isHookConflictError}from"#execution/hook-ownership.js";import{attachRunContext}from"#execution/tool-run/messages.js";import{resumeHookStep}from"#execution/tool-run/resume-hook-step.js";import{openRunControlInbox}from"#execution/tool-run/run-control.js";import{normalizeSerializableError}from"#execution/workflow-errors.js";import{readRegisteredWorkflow}from"#execution/workflow-registry.js";function noop(){}async function toolRunWorkflow(e){"use workflow";let s=openRunControlInbox(e.hookToken),c=!1;try{try{await claimHookOwnership(s.hook),c=!0}catch(e){if(isHookConflictError(e))return;throw e}let r=readRunId(),o={callId:e.callId,input:e.input,runId:r,sequence:e.session.turn.sequence,stepIndex:e.stepIndex,toolName:e.toolName,turnId:e.session.turn.id},l=createWorkflowToolContext(e,s.signal);attachRunContext(l,{from:o,owner:e.owner});let u=runBody(e,l,o),d=u.catch(noop),f;try{f={output:await Promise.race([u,s.cancelled]),status:`completed`}}catch(e){s.signal.aborted?(await Promise.race([d,sleep(`30s`)]),f={reason:s.reason(),status:`cancelled`}):f={error:normalizeSerializableError(e),status:`failed`}}let p={from:o,result:f};await resumeHookStep(e.owner.outcome,p,{ifPresent:f.status===`cancelled`})}finally{c&&await disposeHook(s.hook)}}async function runBody(e,t,n){let r=resolveWorkflowToolExecute(e)(e.input,t);if(!isAsyncIterable(r))return await r;let i=r[Symbol.asyncIterator](),a,o=await i.next();for(;o.done!==!0;){a=o.value;let t={from:n,update:o.value};await resumeHookStep(e.owner.report,t),o=await i.next()}return o.value??a??null}function isAsyncIterable(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}function readRunId(){let t=getWorkflowMetadata().workflowRunId;if(typeof t!=`string`)throw Error(`The tool run has no workflow run id.`);return t}function resolveWorkflowToolExecute(e){let t=readRegisteredWorkflow(e.workflowId);if(typeof t!=`function`)throw Error(`Tool "${e.toolName}" is not registered as a workflow in this deployment (${e.workflowId}). The tool was renamed or removed after this run started.`);return t}function createWorkflowToolContext(e,t){let{callId:n,session:r,toolName:i}=e,unavailable=(e,t)=>{throw Error(`ctx.${e} is not available inside a workflow tool; ${t}. Tool "${i}" runs as a durable workflow body, which only replays deterministic code.`)};return{abortSignal:t,callId:n,getSandbox:()=>unavailable(`getSandbox()`,`the session sandbox belongs to the turn`),getSkill:()=>unavailable(`getSkill()`,`skills are read through the session sandbox`),getToken:()=>unavailable(`getToken()`,`read credentials from the environment inside a "use step" helper`),requireAuth:()=>unavailable(`requireAuth()`,`a workflow body cannot park on authorization`),session:r,toolName:i}}export{toolRunWorkflow};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type TaskExec, type ToolContext } from "#tools/definition.js";
|
|
2
|
-
import type { PendingAgentDispatchAction } from "#shared/dispatch-action.js";
|
|
3
|
-
interface SubagentDefinitionInput {
|
|
4
|
-
readonly description: string;
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly target: PendingAgentDispatchAction["target"];
|
|
7
|
-
}
|
|
8
|
-
export declare function defineSubagent(input: SubagentDefinitionInput): import("#tools/definition.js").BackgroundToolDefinition<{
|
|
9
|
-
agentId?: string | null | undefined;
|
|
10
|
-
message: string;
|
|
11
|
-
outputSchema?: {
|
|
12
|
-
[x: string]: unknown;
|
|
13
|
-
} | undefined;
|
|
14
|
-
}, import("#tools/definition.js").TaskReceipt<{
|
|
15
|
-
agentId: string;
|
|
16
|
-
}>> & {
|
|
17
|
-
execute(input: {
|
|
18
|
-
agentId?: string | null | undefined;
|
|
19
|
-
message: string;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
} | undefined;
|
|
23
|
-
}, ctx: ToolContext, task: TaskExec): Promise<import("#tools/definition.js").TaskDelegated<{
|
|
24
|
-
agentId: string;
|
|
25
|
-
}>>;
|
|
26
|
-
};
|
|
27
|
-
export declare function countLocalSubagentCalls(calls: readonly {
|
|
28
|
-
readonly definition: {
|
|
29
|
-
readonly behavior?: import("#tools/behavior.js").PreparedToolBehavior;
|
|
30
|
-
};
|
|
31
|
-
}[]): number;
|
|
32
|
-
export declare function executeSubagentTool(input: {
|
|
33
|
-
readonly definition: SubagentDefinitionInput;
|
|
34
|
-
readonly task: TaskExec;
|
|
35
|
-
readonly toolContext: ToolContext;
|
|
36
|
-
readonly toolInput: unknown;
|
|
37
|
-
}): Promise<import("#tools/definition.js").TaskDelegated<{
|
|
38
|
-
agentId: string;
|
|
39
|
-
}>>;
|
|
40
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createLogger,logError}from"#internal/logging.js";import{loadContext}from"#context/container.js";import{HandleEventKey}from"#context/keys.js";import{createSubagentCalledEvent}from"#protocol/message.js";import{defineTool}from"#tools/definition.js";import{parseJsonObject}from"#shared/json.js";import{getHarnessEmissionState}from"#harness/emission.js";import{workflowEntryReference}from"#execution/workflow-runtime.js";import{serializeContext}from"#context/serialize.js";import{createDurableSessionState}from"#execution/durable-session-store.js";import{dispatchToTaskAgentAddress}from"#execution/agent-handle-dispatch.js";import{activeTurnId}from"#harness/active-turn-id.js";import{resolvePreparedAgentAction}from"#execution/prepared-agent-action.js";import{createAgentContinuationBundle}from"#execution/agent-continuation-bundle.js";import{prepareAgentActionDispatch}from"#execution/dispatch-runtime-actions-shared.js";import{startSubagent}from"#execution/dispatch-runtime-actions-start.js";import{deriveChildActivityObserverConfig}from"#execution/activity-work.js";import{CallbackBaseUrlKey}from"#harness/authorization.js";import{createSubagentExecutorBinding}from"#tasks/types.js";import{findTaskAgentAddress}from"#execution/tasks/parent/control-shared.js";import{checkTaskContinuationAvailability,createTaskContinuationBusyResult,describeTaskDispatch}from"#execution/tasks/parent/continuation-dispatch.js";import{SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA}from"#tools/framework/task-contract.js";import{SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";const batchAgentClaims=new WeakMap,log=createLogger(`runtime.framework-tools.subagent`);function defineSubagent(e){return defineTool({description:e.description,execution:`background`,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA,outputSchema:SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA,execute:(t,n,r)=>executeSubagentTool({definition:e,task:r,toolContext:n,toolInput:t})})}function countLocalSubagentCalls(e){return e.filter(e=>{let t=e.definition.behavior?.handling;return t?.kind===`dispatch`&&(t.target.kind===`self-agent-call`||t.target.kind===`subagent-call`)}).length}async function executeSubagentTool(e){let t=loadContext(),{batch:r,session:i,task:a}=e.task,o=getHarnessEmissionState(i.state),s={callId:e.toolContext.callId,description:e.definition.description,input:parseJsonObject(SUBAGENT_TOOL_INPUT_SCHEMA.parse(e.toolInput)),target:e.definition.target,toolName:e.definition.name},c=resolvePreparedAgentAction(s).action,l=await dispatchSubagent({action:c,batch:r,callbackBaseUrl:t.get(CallbackBaseUrlKey),ctx:t,dispatchAction:s,event:{...o,turnId:activeTurnId(o)},localFanoutSize:countLocalSubagentCalls(r),serializedContext:serializeContext(t),sessionState:createDurableSessionState({session:i}),task:a}),u=findTaskAgentAddress(l.session,l.agentId);if(u===void 0)throw Error(`Subagent dispatch for "${l.agentId}" recorded no task agent address.`);let d=createSubagentExecutorBinding({address:u.address,identity:u.identity});await emitSubagentCalled$1({callId:e.toolContext.callId,childSessionId:l.address.sessionId,event:{...o,turnId:activeTurnId(o)},name:l.name,remote:l.remote,sessionId:i.sessionId,toolName:e.definition.name});let f=e.task.delegated({executor:d,receipt:{agentId:l.agentId}});return await emitSubagentCompleted({callId:e.toolContext.callId,output:JSON.stringify(f.receipt),subagentName:l.name,taskId:f.receipt.taskId}),f}async function dispatchSubagent(e){let t=await prepareAgentActionDispatch({action:e.dispatchAction,ctx:e.ctx,event:e.event,localFanoutSize:e.localFanoutSize,serializedContext:e.serializedContext,sessionState:e.sessionState}),n=t.plan[0];if(n===void 0||n.kind===`task-control`||n.kind===`workflow-tool`)throw Error(`Subagent tool dispatch produced no executable plan entry.`);if(n.kind===`reject`)throw Error(JSON.stringify(n.result.output));if(n.kind===`resume`){let r=await checkTaskContinuationAvailability({action:n.action,agentId:n.agentId,parentStepIndex:e.event.stepIndex,parentTurnId:e.event.turnId,session:t.session});if(r!==void 0)throw Error(JSON.stringify(r.output));let i=claimBatchAgent(e.batch,n.agentId,e.task.taskId);if(i!==void 0){let e=createTaskContinuationBusyResult({action:n.action,agentId:n.agentId,status:`working`,taskId:i});throw Error(JSON.stringify(e.output))}}let r=n.kind===`resume`?await dispatchToTaskAgentAddress({action:n.action,activityObserver:t.activityObserver===void 0?void 0:deriveChildActivityObserverConfig({activityObserver:t.activityObserver,callId:n.action.callId,kind:`task`,name:n.action.name,parentSessionId:t.session.sessionId,parentTurnId:e.event.turnId}),agentId:n.agentId,auth:t.auth,bundle:createAgentContinuationBundle({action:n.action,bundle:t.bundle,dynamicRemoteAgent:n.dynamicRemoteAgent}),currentSession:t.session,parentToken:e.task.taskInboxToken}):await startSubagent({auth:t.auth,batchEvent:e.event,bundle:t.bundle,callbackBaseUrl:e.callbackBaseUrl,capabilities:t.capabilities,channelMetadata:t.channelMetadata,currentSession:t.session,fanoutSize:t.fanoutSize,initiatorAuth:t.initiatorAuth,localDevRequest:t.localDevRequest,parentContinuationToken:e.task.taskInboxToken,parentTraceContext:t.parentTraceContext,activityObserver:t.activityObserver,sandboxSessionId:t.sandboxSessionId,serializedContext:t.serializedContext,session:t.session,taskOwned:!0,target:n.target});if(r.kind===`error`)throw Error(JSON.stringify(r.result.output));let i=describeTaskDispatch({action:e.action,agentId:n.kind===`resume`?n.agentId:void 0,parentSessionId:t.session.sessionId,parentTurnId:e.event.turnId,session:r.session}),a=n.kind===`resume`?n.dynamicRemoteAgent:n.target.kind===`remote`?n.target.dynamicRemoteAgent:void 0;return{address:r.address,agentId:i.agentId,mode:i.mode,name:i.name,...r.address.kind===`agent/remote`?{remote:{resolverId:a?.credentialsStepId??e.action.nodeId,url:r.address.url}}:{},session:r.session}}function claimBatchAgent(e,t,n){let r=batchAgentClaims.get(e);r===void 0&&(r=new Map,batchAgentClaims.set(e,r));let i=r.get(t);if(i!==void 0)return i;r.set(t,n)}async function emitSubagentCalled$1(e){let a=loadContext().get(HandleEventKey);if(a!==void 0)try{await a(createSubagentCalledEvent({callId:e.callId,childSessionId:e.childSessionId,name:e.name,remote:e.remote,sequence:e.event.sequence,sessionId:e.sessionId,toolName:e.toolName,turnId:e.event.turnId,workflowId:workflowEntryReference.workflowId}))}catch(n){logError(log,`subagent.called emission failed`,n,{callId:e.callId,childSessionId:e.childSessionId,toolName:e.toolName})}}async function emitSubagentCompleted(e){let i=loadContext().get(HandleEventKey);if(i!==void 0)try{await i({data:{backgroundTask:{status:`working`,taskId:e.taskId},callId:e.callId,output:e.output,subagentName:e.subagentName},type:`subagent.completed`})}catch(n){logError(log,`subagent.completed emission failed`,n,{callId:e.callId,taskId:e.taskId})}}export{countLocalSubagentCalls,defineSubagent,executeSubagentTool};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { PendingAgentDispatchAction } from "#shared/dispatch-action.js";
|
|
2
|
-
export declare function defineRemoteSubagent(input: {
|
|
3
|
-
readonly description: string;
|
|
4
|
-
readonly name: string;
|
|
5
|
-
readonly target: Extract<PendingAgentDispatchAction["target"], {
|
|
6
|
-
readonly kind: "remote-agent-call";
|
|
7
|
-
}>;
|
|
8
|
-
}): import("#tools/definition.js").BackgroundToolDefinition<{
|
|
9
|
-
agentId?: string | null | undefined;
|
|
10
|
-
message: string;
|
|
11
|
-
outputSchema?: {
|
|
12
|
-
[x: string]: unknown;
|
|
13
|
-
} | undefined;
|
|
14
|
-
}, import("#tools/definition.js").TaskReceipt<{
|
|
15
|
-
agentId: string;
|
|
16
|
-
}>> & {
|
|
17
|
-
execute(input: {
|
|
18
|
-
agentId?: string | null | undefined;
|
|
19
|
-
message: string;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
} | undefined;
|
|
23
|
-
}, ctx: import("#tools/definition.js").ToolContext, task: import("#tools/definition.js").TaskExec): Promise<import("#tools/definition.js").TaskDelegated<{
|
|
24
|
-
agentId: string;
|
|
25
|
-
}>>;
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineTool}from"#tools/definition.js";import{executeSubagentTool}from"#execution/tools/subagent/local.js";import{SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA}from"#tools/framework/task-contract.js";import{SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";function defineRemoteSubagent(r){return defineTool({description:r.description,execution:`background`,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA,outputSchema:SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA,execute:(e,t,n)=>executeSubagentTool({definition:r,task:n,toolContext:t,toolInput:e})})}export{defineRemoteSubagent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const AGENT_MISMATCH=`AGENT_MISMATCH`,AGENT_UNREACHABLE=`AGENT_UNREACHABLE`,AGENT_BUSY=`AGENT_BUSY`,SUBAGENT_START_FAILED=`SUBAGENT_START_FAILED`,SUBAGENT_EXECUTION_FAILED=`SUBAGENT_EXECUTION_FAILED`,REMOTE_AGENT_START_FAILED=`REMOTE_AGENT_START_FAILED`,REMOTE_AGENT_FAILED=`REMOTE_AGENT_FAILED`,SESSION_FAILED=`SESSION_FAILED`;export{AGENT_BUSY,AGENT_MISMATCH,AGENT_UNREACHABLE,REMOTE_AGENT_FAILED,REMOTE_AGENT_START_FAILED,SESSION_FAILED,SUBAGENT_EXECUTION_FAILED,SUBAGENT_START_FAILED};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{AGENT_HANDLES_STATE_KEY}from"#harness/handles/state-key.js";function readAgentHandles(t){let n=t?.[AGENT_HANDLES_STATE_KEY];if(n===void 0)return[];let r=n.handles;return Array.isArray(r)?r:[]}function findRunningAgentHandle(e,t){return readAgentHandles(e).find(e=>e.phase===`running`&&e.operation.callId===t.callId)}function isResultBoundToRunningHandle(e,t){return t.kind!==`subagent-result`||t.origin===`dispatch`||t.backgroundTask!==void 0||findRunningAgentHandle(e,{callId:t.callId})!==void 0}function isInboxSubagentResultFromRunningHandle(e,t){return findRunningAgentHandle(e,{callId:t.callId})!==void 0}export{findRunningAgentHandle,isInboxSubagentResultFromRunningHandle,isResultBoundToRunningHandle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{AGENT_HANDLES_STATE_KEY}from"./state-key.js";import{z}from"#compiled/zod/index.js";const nonEmptyString=z.string().min(1),identitySchema=z.strictObject({id:nonEmptyString,name:nonEmptyString,nodeId:nonEmptyString}),startOperationSchema=z.strictObject({callId:nonEmptyString,id:nonEmptyString,kind:z.literal(`start`),parentTurnId:nonEmptyString}),continueOperationSchema=z.strictObject({callId:nonEmptyString,id:nonEmptyString,kind:z.literal(`continue`),parentTurnId:nonEmptyString,previousStatus:z.string().max(120)}),startTargetSchema=z.discriminatedUnion(`kind`,[z.strictObject({continuationToken:nonEmptyString,kind:z.literal(`agent/local`)}),z.strictObject({continuationToken:nonEmptyString,kind:z.literal(`agent/self`)}),z.strictObject({callbackBaseUrl:z.url(),credentialResolver:z.strictObject({resolverId:nonEmptyString.optional()}).optional(),kind:z.literal(`agent/remote`),url:z.url()})]),addressSchema=z.discriminatedUnion(`kind`,[z.strictObject({continuationToken:nonEmptyString,kind:z.literal(`agent/local`),sessionId:nonEmptyString}),z.strictObject({continuationToken:nonEmptyString,kind:z.literal(`agent/self`),sessionId:nonEmptyString}),z.strictObject({callbackBaseUrl:z.url(),credentialResolver:z.strictObject({resolverId:nonEmptyString.optional()}).optional(),kind:z.literal(`agent/remote`),sessionId:nonEmptyString,url:z.url()})]),agentHandleSchema=z.discriminatedUnion(`phase`,[z.strictObject({identity:identitySchema,operation:startOperationSchema,phase:z.literal(`starting`),target:startTargetSchema}),z.strictObject({address:addressSchema,identity:identitySchema,operation:z.discriminatedUnion(`kind`,[startOperationSchema,continueOperationSchema]),phase:z.literal(`running`)}),z.strictObject({address:addressSchema,identity:identitySchema,lastStatus:z.string().max(120),phase:z.literal(`parked`)}),z.strictObject({address:addressSchema,identity:identitySchema,phase:z.literal(`addressed`)})]),agentHandleStoreSchema=z.strictObject({handles:z.array(agentHandleSchema)}).refine(e=>new Set(e.handles.map(e=>e.identity.id)).size===e.handles.length,{message:`Agent handle ids must be unique.`});function deriveAgentId(e,t){return`ag_${e}:${t.slice(0,12)}`}function formatAgentStatus(e){return(typeof e==`string`?e:JSON.stringify(e)??``).replaceAll(/\s+/g,` `).trim().slice(0,120)}function assertPersistableAgentHandleStore(e){let t=agentHandleStoreSchema.safeParse(e);if(!t.success)throw Error(`Refusing to persist a corrupt agent handle store: ${t.error.message}`);return t.data}function getAgentHandleStore(t){let n=t?.[AGENT_HANDLES_STATE_KEY];if(n===void 0)return;let r=agentHandleStoreSchema.safeParse(n);if(!r.success)throw Error(`Corrupt agent handle store under session state key "${AGENT_HANDLES_STATE_KEY}": ${r.error.message}`);return r.data}export{AGENT_HANDLES_STATE_KEY,assertPersistableAgentHandleStore,deriveAgentId,formatAgentStatus,getAgentHandleStore};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { type AgentAddress, type AgentHandle, type AgentIdentity, type ContinueOperation, type StartOperation } from "#harness/handles/store.js";
|
|
2
|
-
import type { HarnessSession, SessionStateMap } from "#harness/types.js";
|
|
3
|
-
import type { AgentTurnOutcome } from "#shared/agent-turn-outcome.js";
|
|
4
|
-
/**
|
|
5
|
-
* Records intent to start a fresh child. Must be applied to the step's
|
|
6
|
-
* working snapshot before the start side effect runs, so the returned state
|
|
7
|
-
* owns any child the step may have created.
|
|
8
|
-
*
|
|
9
|
-
* The guarantee is intra-step, not exactly-once: the prepared handle
|
|
10
|
-
* durably commits only when the enclosing dispatch step's result commits.
|
|
11
|
-
* A crash between an accepted start and that commit replays the step from
|
|
12
|
-
* the pre-step snapshot and re-runs the side effect.
|
|
13
|
-
*
|
|
14
|
-
* Throws when the identity or operation already exists: fresh starts mint
|
|
15
|
-
* a new identity, so a collision means corrupted derivation, not a replay.
|
|
16
|
-
*/
|
|
17
|
-
export declare function prepareAgentStart(session: HarnessSession, input: {
|
|
18
|
-
readonly identity: AgentIdentity;
|
|
19
|
-
readonly operation: StartOperation;
|
|
20
|
-
readonly target: AgentStartTargetInput;
|
|
21
|
-
}): HarnessSession;
|
|
22
|
-
type AgentStartTargetInput = Extract<AgentHandle, {
|
|
23
|
-
phase: "starting";
|
|
24
|
-
}>["target"];
|
|
25
|
-
/** Result of preparing a continuation against an existing handle. */
|
|
26
|
-
export type PrepareAgentContinuationResult = {
|
|
27
|
-
readonly kind: "ready";
|
|
28
|
-
readonly session: HarnessSession;
|
|
29
|
-
readonly handle: Extract<AgentHandle, {
|
|
30
|
-
phase: "running";
|
|
31
|
-
}>;
|
|
32
|
-
} | {
|
|
33
|
-
readonly kind: "unknown";
|
|
34
|
-
} | {
|
|
35
|
-
readonly kind: "mismatch";
|
|
36
|
-
} | {
|
|
37
|
-
readonly kind: "busy";
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Records intent to deliver a follow-up turn to a parked child. Must be
|
|
41
|
-
* applied to the step's working snapshot before the delivery side effect
|
|
42
|
-
* runs.
|
|
43
|
-
*
|
|
44
|
-
* Delivery is at-least-once, not exactly-once: the `running` handle durably
|
|
45
|
-
* commits only when the enclosing dispatch step's result commits. If the
|
|
46
|
-
* step dies after a successful delivery, replay starts from `parked` and
|
|
47
|
-
* delivers the same operation again — which is why replaying the operation
|
|
48
|
-
* already recorded on a running handle returns `ready` with the unchanged
|
|
49
|
-
* session instead of a busy conflict.
|
|
50
|
-
*
|
|
51
|
-
* `unknown`, `mismatch`, and `busy` do not change the session; the caller
|
|
52
|
-
* maps them onto `AGENT_UNREACHABLE`, `AGENT_MISMATCH`, and `AGENT_BUSY`
|
|
53
|
-
* results.
|
|
54
|
-
*/
|
|
55
|
-
export declare function prepareAgentContinuation(session: HarnessSession, input: {
|
|
56
|
-
readonly agentId: string;
|
|
57
|
-
readonly invokedName: string;
|
|
58
|
-
readonly operation: ContinueOperation;
|
|
59
|
-
}): PrepareAgentContinuationResult;
|
|
60
|
-
/**
|
|
61
|
-
* Confirms a started child: `starting` becomes `running` with the child's
|
|
62
|
-
* confirmed address. Throws when no starting handle carries the operation,
|
|
63
|
-
* because confirming an unprepared start means ownership was never
|
|
64
|
-
* committed. Re-confirming an already-running handle with the same
|
|
65
|
-
* operation and address is a replay no-op.
|
|
66
|
-
*/
|
|
67
|
-
export declare function confirmAgentStarted(session: HarnessSession, input: {
|
|
68
|
-
readonly operationId: string;
|
|
69
|
-
readonly address: AgentAddress;
|
|
70
|
-
}): HarnessSession;
|
|
71
|
-
/** Confirms a task-mode child as a persistent identity/address record. */
|
|
72
|
-
export declare function confirmTaskAgentAddress(session: HarnessSession, input: {
|
|
73
|
-
readonly operationId: string;
|
|
74
|
-
readonly address: AgentAddress;
|
|
75
|
-
}): HarnessSession;
|
|
76
|
-
/**
|
|
77
|
-
* Records a task-mode child's persistent address from its durable executor
|
|
78
|
-
* binding, applied when the parent step that delegated the task commits.
|
|
79
|
-
*
|
|
80
|
-
* Replay-idempotent: a record identical to the stored handle is a no-op
|
|
81
|
-
* (a resumed child, or a replayed commit). A different record under the
|
|
82
|
-
* same id throws — ids derive from unique operations, so a collision
|
|
83
|
-
* means corrupted derivation, not a replay.
|
|
84
|
-
*/
|
|
85
|
-
export declare function recordTaskAgentAddress(session: HarnessSession, input: {
|
|
86
|
-
readonly address: AgentAddress;
|
|
87
|
-
readonly identity: AgentIdentity;
|
|
88
|
-
}): HarnessSession;
|
|
89
|
-
/** Removes a task-mode address after permanent delivery failure. */
|
|
90
|
-
export declare function removeTaskAgentAddress(session: HarnessSession, agentId: string): HarnessSession;
|
|
91
|
-
/** State-only variant used while consuming a terminal task wake. */
|
|
92
|
-
export declare function removeTaskAgentAddressFromState(state: SessionStateMap | undefined, agentId: string): SessionStateMap;
|
|
93
|
-
/**
|
|
94
|
-
* Resolves a dispatch that definitively failed.
|
|
95
|
-
*
|
|
96
|
-
* - A dead start or dead continuation deletes the handle: there is no
|
|
97
|
-
* child left to own.
|
|
98
|
-
* - A retryable continuation failure restores `parked` with the status the
|
|
99
|
-
* handle showed before the delivery, so the model may retry the same
|
|
100
|
-
* `agentId` later.
|
|
101
|
-
*
|
|
102
|
-
* Unknown operations are a no-op: the failure raced a settlement that
|
|
103
|
-
* already resolved the handle.
|
|
104
|
-
*/
|
|
105
|
-
export declare function rejectAgentEffect(session: HarnessSession, input: {
|
|
106
|
-
readonly operationId: string;
|
|
107
|
-
readonly disposition: "dead" | "retryable";
|
|
108
|
-
}): HarnessSession;
|
|
109
|
-
/**
|
|
110
|
-
* Parks every running child when the parent abandons a cancelled turn.
|
|
111
|
-
*
|
|
112
|
-
* Cancellation requests each running descendant's cancellation and then
|
|
113
|
-
* tears down the turn inbox — the only hook a child settlement can
|
|
114
|
-
* resume — so no later settlement can move these handles. Without this
|
|
115
|
-
* transition they would stay `running` forever: invisible to the model,
|
|
116
|
-
* unresumable, and retried by every future cancellation.
|
|
117
|
-
*
|
|
118
|
-
* A cancelled child settles its own turn as a park, so `parked` with
|
|
119
|
-
* `"(cancelled)"` mirrors {@link settleAgentTurn}'s cancelled outcome. If
|
|
120
|
-
* the child instead died, a later continuation attempt discovers the dead
|
|
121
|
-
* session and {@link rejectAgentEffect} deletes the handle.
|
|
122
|
-
*/
|
|
123
|
-
export declare function abandonRunningAgentTurns(session: HarnessSession): HarnessSession;
|
|
124
|
-
/** Result of applying a settled child turn to the store. */
|
|
125
|
-
export type SettleAgentTurnResult = {
|
|
126
|
-
readonly kind: "settled";
|
|
127
|
-
readonly session: HarnessSession;
|
|
128
|
-
} | {
|
|
129
|
-
readonly kind: "ignored";
|
|
130
|
-
readonly reason: "unknown-operation";
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* Applies one settled child turn: `running` becomes `parked` for a parked
|
|
134
|
-
* outcome or is deleted for a terminal outcome.
|
|
135
|
-
*
|
|
136
|
-
* The settlement must carry the operation currently recorded on the
|
|
137
|
-
* running handle; anything else is ignored so a stale delivery can never
|
|
138
|
-
* move a newer turn.
|
|
139
|
-
*/
|
|
140
|
-
export declare function settleAgentTurn(session: HarnessSession, input: {
|
|
141
|
-
readonly operationId: string;
|
|
142
|
-
readonly outcome: AgentTurnOutcome;
|
|
143
|
-
}): SettleAgentTurnResult;
|
|
144
|
-
/**
|
|
145
|
-
* Rebases the handle delta one dispatch produced (`base` → `next`) onto a
|
|
146
|
-
* working session that other concurrently staged effects may have advanced
|
|
147
|
-
* past `base`.
|
|
148
|
-
*
|
|
149
|
-
* Per handle id:
|
|
150
|
-
*
|
|
151
|
-
* - deleted by the dispatch → deleted from the working session.
|
|
152
|
-
* - added by the dispatch → appended. If the working session already holds
|
|
153
|
-
* the id with different content, throws: ids derive from unique
|
|
154
|
-
* operations, so a collision means corrupted derivation.
|
|
155
|
-
* - changed in place by the dispatch → the dispatched copy replaces the
|
|
156
|
-
* working copy while that copy still matches `base`. A working copy that
|
|
157
|
-
* diverged from both throws instead of silently dropping either change.
|
|
158
|
-
* - untouched by the dispatch → the working copy is kept.
|
|
159
|
-
*
|
|
160
|
-
* A delta the working session already contains is a no-op, so replaying an
|
|
161
|
-
* effect is safe.
|
|
162
|
-
*/
|
|
163
|
-
export declare function rebaseAgentHandles(session: HarnessSession, input: {
|
|
164
|
-
readonly base: SessionStateMap | undefined;
|
|
165
|
-
readonly next: SessionStateMap | undefined;
|
|
166
|
-
}): HarnessSession;
|
|
167
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsonValuesEqual}from"#shared/json.js";import{AGENT_HANDLES_STATE_KEY,assertPersistableAgentHandleStore,formatAgentStatus,getAgentHandleStore}from"#harness/handles/store.js";function prepareAgentStart(e,t){let n=getAgentHandleStore(e.state)?.handles??[];if(n.some(e=>e.identity.id===t.identity.id))throw Error(`Agent handle "${t.identity.id}" already exists.`);return writeHandles(e,[...n,{identity:t.identity,operation:t.operation,phase:`starting`,target:t.target}])}function prepareAgentContinuation(e,t){let n=getAgentHandleStore(e.state)?.handles??[],r=n.find(e=>e.identity.id===t.agentId);if(r===void 0)return{kind:`unknown`};if(r.identity.name!==t.invokedName)return{kind:`mismatch`};if(r.phase===`running`&&r.operation.id===t.operation.id)return{handle:r,kind:`ready`,session:e};if(r.phase!==`parked`)return{kind:`busy`};let a={address:r.address,identity:r.identity,operation:{...t.operation,previousStatus:r.lastStatus},phase:`running`};return{handle:a,kind:`ready`,session:writeHandles(e,n.map(e=>e.identity.id===t.agentId?a:e))}}function findActiveHandle(e,t){return e.find(e=>(e.phase===`starting`||e.phase===`running`)&&e.operation.id===t)}function confirmAgentStarted(e,t){let n=getAgentHandleStore(e.state)?.handles??[],r=findActiveHandle(n,t.operationId);if(r===void 0)throw Error(`No prepared agent handle for operation "${t.operationId}".`);return r.phase===`running`?e:writeHandles(e,n.map(e=>e===r?{address:t.address,identity:r.identity,operation:r.operation,phase:`running`}:e))}function confirmTaskAgentAddress(e,t){let n=getAgentHandleStore(e.state)?.handles??[],r=findActiveHandle(n,t.operationId);if(r===void 0)throw Error(`No prepared agent handle for operation "${t.operationId}".`);if(r.phase===`running`)throw Error(`Task agent operation "${t.operationId}" was confirmed as a running handle.`);return writeHandles(e,n.map(e=>e===r?{address:t.address,identity:r.identity,phase:`addressed`}:e))}function recordTaskAgentAddress(t,n){let r=getAgentHandleStore(t.state)?.handles??[],a={address:n.address,identity:n.identity,phase:`addressed`},o=r.find(e=>e.identity.id===n.identity.id);if(o!==void 0){if(jsonValuesEqual(o,a))return t;throw Error(`Agent handle "${n.identity.id}" already exists with different content.`)}return writeHandles(t,[...r,a])}function removeTaskAgentAddress(e,t){return{...e,state:removeTaskAgentAddressFromState(e.state,t)}}function removeTaskAgentAddressFromState(e,r){let a=getAgentHandleStore(e)?.handles??[];return{...e,[AGENT_HANDLES_STATE_KEY]:assertPersistableAgentHandleStore({handles:a.filter(e=>!(e.phase===`addressed`&&e.identity.id===r))})}}function rejectAgentEffect(e,t){let n=getAgentHandleStore(e.state)?.handles??[],r=findActiveHandle(n,t.operationId);if(r===void 0)return e;if(t.disposition===`retryable`&&r.phase===`running`){let{operation:t}=r;if(t.kind===`continue`)return writeHandles(e,n.map(e=>e===r?{address:r.address,identity:r.identity,lastStatus:t.previousStatus,phase:`parked`}:e))}return writeHandles(e,n.filter(e=>e!==r))}function abandonRunningAgentTurns(e){let t=getAgentHandleStore(e.state)?.handles??[];return t.some(e=>e.phase===`running`)?writeHandles(e,t.map(e=>e.phase===`running`?{address:e.address,identity:e.identity,lastStatus:`(cancelled)`,phase:`parked`}:e)):e}function settleAgentTurn(e,t){let n=getAgentHandleStore(e.state)?.handles??[],a=n.find(e=>e.phase===`running`&&e.operation.id===t.operationId);if(a===void 0||a.phase!==`running`)return{kind:`ignored`,reason:`unknown-operation`};if(t.outcome.kind===`terminal`)return{kind:`settled`,session:writeHandles(e,n.filter(e=>e!==a))};let{result:o}=t.outcome,s=o.kind===`succeeded`?formatAgentStatus(o.output):o.kind===`failed`?formatAgentStatus(o.error):`(cancelled)`;return{kind:`settled`,session:writeHandles(e,n.map(e=>e===a?{address:a.address,identity:a.identity,lastStatus:s,phase:`parked`}:e))}}function rebaseAgentHandles(t,n){let r=handlesById(n.base),a=handlesById(n.next),o=getAgentHandleStore(t.state)?.handles??[],s=new Set(o.map(e=>e.identity.id)),c=!1,l=[];for(let t of o){let n=t.identity.id,i=r.get(n),o=a.get(n);if(i!==void 0&&o===void 0){c=!0;continue}if(i===void 0&&o!==void 0&&!jsonValuesEqual(t,o))throw Error(`Agent handle "${n}" added by a dispatch already exists with different content.`);if(i!==void 0&&o!==void 0&&!jsonValuesEqual(i,o)){if(jsonValuesEqual(t,i)){l.push(o),c=!0;continue}if(!jsonValuesEqual(t,o))throw Error(`Agent handle "${n}" was changed by a dispatch and concurrently by another effect.`)}l.push(t)}let u=[...a.values()].filter(e=>!r.has(e.identity.id)&&!s.has(e.identity.id));return!c&&u.length===0?t:writeHandles(t,[...l,...u])}function handlesById(e){let t=getAgentHandleStore(e)?.handles??[];return new Map(t.map(e=>[e.identity.id,e]))}function writeHandles(e,r){return{...e,state:{...e.state,[AGENT_HANDLES_STATE_KEY]:assertPersistableAgentHandleStore({handles:r})}}}export{abandonRunningAgentTurns,confirmAgentStarted,confirmTaskAgentAddress,prepareAgentContinuation,prepareAgentStart,rebaseAgentHandles,recordTaskAgentAddress,rejectAgentEffect,removeTaskAgentAddress,removeTaskAgentAddressFromState,settleAgentTurn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createActionResultEvent}from"#protocol/message.js";import{parseJsonObject}from"#shared/json.js";import{settleAgentTurn}from"#harness/handles/transitions.js";import{findToolRun,removeToolRun}from"#harness/tool-runs.js";import{clearProxyInputRequestsForChild,clearProxyInputRequestsWhere}from"#harness/proxy-input-requests.js";import{getPendingDispatchActionKey}from"#runtime/actions/keys.js";import{accumulateSessionUsage,getTurnUsageState,setTurnUsageState}from"#harness/turn-tag-state.js";import{findRunningAgentHandle,isResultBoundToRunningHandle}from"#harness/handles/query.js";import{resolveRuntimeActionResultsForKeys}from"#runtime/actions/results.js";import{normalizeToolModelOutput}from"#harness/tool-model-output.js";const PENDING_RUNTIME_ACTION_BATCH_KEY=`eve.runtime.pendingActionBatch`;function readSubagentResultOutcome(e){return e.origin===`child`?e.outcome:void 0}function getPendingRuntimeActionBatch(e){let t=e?.[PENDING_RUNTIME_ACTION_BATCH_KEY];if(typeof t!=`object`||!t)return;let n=t;if(!(!Array.isArray(n.actions)||!Array.isArray(n.responseMessages)||typeof n.event!=`object`||n.event===null))return n}function hasPendingRuntimeActionBatch(e){return getPendingRuntimeActionBatch(e)!==void 0}function clearPendingRuntimeActionBatch(e){if(e.state?.[PENDING_RUNTIME_ACTION_BATCH_KEY]===void 0)return e;let t={...e.state};return delete t[PENDING_RUNTIME_ACTION_BATCH_KEY],{...e,state:Object.keys(t).length>0?t:void 0}}function setPendingRuntimeActionBatch(e){assertUniqueRuntimeActionCallIds(e.actions);let t={...e.session.state};return t[PENDING_RUNTIME_ACTION_BATCH_KEY]={actions:[...e.actions],event:e.event,responseMessages:[...e.responseMessages]},{...e.session,state:t}}function assertUniqueRuntimeActionCallIds(e){let t=new Set;for(let n of e){if(t.has(n.callId))throw Error(`Runtime action batch contains duplicate callId "${n.callId}".`);t.add(n.callId)}}function resolveReadyRuntimeActionResults(e){let t=getPendingRuntimeActionBatch(e.session.state);if(t!==void 0)return resolveRuntimeActionResultsForBatch({batch:t,results:e.results,state:e.session.state})}function resolveRuntimeActionResultsForBatch(e){return resolveRuntimeActionResultsForKeys({pendingKeys:e.batch.actions.map(e=>getPendingDispatchActionKey(e)),results:e.results.filter(t=>isResultBoundToRunningHandle(e.state,t))})}async function resolvePendingRuntimeActions(t){let a=getPendingRuntimeActionBatch(t.session.state);if(a===void 0)return{messages:[...t.session.history],outcome:`continue`,session:t.session};let o=resolveReadyRuntimeActionResults({results:t.stepInput?.runtimeActionResults??[],session:t.session});if(o===void 0)return{messages:[...t.session.history],outcome:`unresolved`,session:t.session};if(t.emit!==void 0)for(let n of o){if(n.kind===`subagent-result`&&n.isError!==!0){let e=readBackgroundTaskReceipt(n),r={callId:n.callId,output:typeof n.output==`string`?n.output:JSON.stringify(n.output),subagentName:n.subagentName};await t.emit({data:e===void 0?r:{...r,backgroundTask:e},type:`subagent.completed`})}await t.emit(createActionResultEvent({result:n,sequence:a.event.sequence,stepIndex:a.event.stepIndex,turnId:a.event.turnId}))}let s=t.session;for(let e of o){if(e.kind!==`subagent-result`||e.origin!==`child`||readBackgroundTaskReceipt(e)!==void 0)continue;let t=findRunningAgentHandle(s.state,{callId:e.callId});if(t===void 0)continue;let r=readSubagentResultOutcome(e);if(r===void 0)continue;r.kind===`terminal`&&`continuationToken`in t.address&&(s=clearProxyInputRequestsForChild(s,t.address.continuationToken));let i=settleAgentTurn(s,{operationId:t.operation.id,outcome:r});i.kind===`settled`&&(s=i.session)}for(let e of o){if(e.kind!==`tool-result`)continue;let t=findToolRun(s.state,e.callId);t!==void 0&&(s=removeToolRun(clearProxyInputRequestsWhere(s,e=>e.answerHook?.runId===t.runId),t.callId))}let c={...s.state};delete c[PENDING_RUNTIME_ACTION_BATCH_KEY],s={...s,state:Object.keys(c).length>0?c:void 0};for(let e of o){if(e.kind!==`subagent-result`)continue;let t=readSubagentResultOutcome(e);t!==void 0&&(s=setTurnUsageState(s,accumulateSessionUsage({previous:getTurnUsageState(s.state),usage:t.usageDelta})))}let l=[];for(let e of o){switch(e.kind){case`load-skill-result`:l.push({output:toToolResultOutput(e),toolCallId:e.callId,toolName:`load_skill`,type:`tool-result`});continue;case`subagent-result`:l.push({output:toToolResultOutput(e),toolCallId:e.callId,toolName:e.subagentName,type:`tool-result`});continue;case`tool-result`:l.push({output:await projectToolResultOutput(e,t.tools?.get(e.toolName)),toolCallId:e.callId,toolName:e.toolName,type:`tool-result`});continue}throw Error(`Unsupported runtime action result kind "${String(e)}".`)}let u=[...s.history,...a.responseMessages];return l.length>0&&u.push({content:l,role:`tool`}),{messages:u,outcome:`resolved`,session:s}}function readBackgroundTaskReceipt(e){return`backgroundTask`in e?e.backgroundTask:void 0}function createRuntimeActionRequestFromToolCall(e){let t=e.tools.get(e.toolCall.toolName),n=resolveToolCallInputObject(e.toolCall.input,{callId:e.toolCall.toolCallId,toolName:e.toolCall.toolName});if(t?.behavior?.presentation===`load-skill`)return{callId:e.toolCall.toolCallId,input:n,kind:`load-skill`};let r=t?.execution===`background`||t?.behavior?.handling?.kind!==`dispatch`?void 0:t.behavior.handling.target;return t!==void 0&&(r?.kind===`self-agent-call`||r?.kind===`subagent-call`)?{callId:e.toolCall.toolCallId,description:t.description,input:n,kind:`subagent-call`,name:t.name,nodeId:r.nodeId,subagentName:r.subagentName}:t!==void 0&&r?.kind===`remote-agent-call`?{callId:e.toolCall.toolCallId,description:t.description,input:n,kind:`remote-agent-call`,name:t.name,nodeId:r.nodeId,remoteAgentName:r.remoteAgentName}:{callId:e.toolCall.toolCallId,input:n,kind:`tool-call`,toolName:e.toolCall.toolName}}function createPendingDispatchActionFromToolCall(e){let t=e.tools.get(e.toolCall.toolName);if(t===void 0)throw Error(`Unknown tool "${e.toolCall.toolName}" in dispatch projection.`);let n=t.behavior?.handling;if(n?.kind!==`dispatch`||t.execution===`background`)throw Error(`Tool "${e.toolCall.toolName}" is not a durable dispatch tool.`);return{callId:e.toolCall.toolCallId,description:t.description,input:resolveToolCallInputObject(e.toolCall.input,{callId:e.toolCall.toolCallId,toolName:e.toolCall.toolName}),target:n.target,toolName:t.name}}function resolveToolCallInputObject(e,n){if(e==null||typeof e==`string`&&e.trim()===``)return{};try{return parseJsonObject(typeof e==`string`?parseJsonStringInput(e):e)}catch(e){let t=e instanceof Error?e.message:String(e);throw TypeError(`Failed to parse tool-call arguments for "${n.toolName}" (${n.callId}): ${t}`,{cause:e})}}function parseJsonStringInput(e){return JSON.parse(e)}async function projectToolResultOutput(e,t){return e.isError===!0||t?.toModelOutput===void 0?toToolResultOutput(e):normalizeToolModelOutput({output:await t.toModelOutput(e.output),toolCallId:e.callId,toolName:e.toolName})}function toToolResultOutput(e){return typeof e.output==`string`?e.isError===!0?{type:`error-text`,value:e.output}:{type:`text`,value:e.output}:e.isError===!0?{type:`error-json`,value:toMutableJsonValue(e.output)}:{type:`json`,value:toMutableJsonValue(e.output)}}function toMutableJsonValue(e){if(e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e;if(Array.isArray(e))return e.map(e=>toMutableJsonValue(e));let t={};for(let[n,r]of Object.entries(e))t[n]=toMutableJsonValue(r);return t}export{assertUniqueRuntimeActionCallIds,clearPendingRuntimeActionBatch,createPendingDispatchActionFromToolCall,createRuntimeActionRequestFromToolCall,getPendingRuntimeActionBatch,hasPendingRuntimeActionBatch,resolvePendingRuntimeActions,resolveToolCallInputObject,setPendingRuntimeActionBatch};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface SessionTokenAmounts {
|
|
2
|
-
readonly inputTokens: number;
|
|
3
|
-
readonly outputTokens: number;
|
|
4
|
-
}
|
|
5
|
-
export interface SessionRuntimeTokenLimits {
|
|
6
|
-
readonly inputTokens?: number;
|
|
7
|
-
readonly outputTokens?: number;
|
|
8
|
-
}
|
|
9
|
-
export type SessionTokenLimitViolation = {
|
|
10
|
-
readonly kind: "input";
|
|
11
|
-
readonly limit: number;
|
|
12
|
-
readonly usedTokens: number;
|
|
13
|
-
} | {
|
|
14
|
-
readonly kind: "output";
|
|
15
|
-
readonly limit: number;
|
|
16
|
-
readonly usedTokens: number;
|
|
17
|
-
};
|
|
18
|
-
/** Resolves per-axis lifetime ceilings, preferring a previously granted ceiling. */
|
|
19
|
-
export declare function resolveRuntimeTokenLimits(input: {
|
|
20
|
-
readonly configured: SessionRuntimeTokenLimits;
|
|
21
|
-
readonly stored?: SessionRuntimeTokenLimits;
|
|
22
|
-
}): SessionRuntimeTokenLimits;
|
|
23
|
-
/** Grants one full configured window from the current lifetime usage. */
|
|
24
|
-
export declare function grantRuntimeTokenLimits(input: {
|
|
25
|
-
readonly configured: SessionRuntimeTokenLimits;
|
|
26
|
-
readonly usage: SessionTokenAmounts;
|
|
27
|
-
}): SessionRuntimeTokenLimits;
|
|
28
|
-
/** Returns the unspent quota for each capped axis. */
|
|
29
|
-
export declare function remainingRuntimeTokenQuota(input: {
|
|
30
|
-
readonly runtime: SessionRuntimeTokenLimits;
|
|
31
|
-
readonly usage: SessionTokenAmounts;
|
|
32
|
-
}): {
|
|
33
|
-
readonly inputTokens: number | false;
|
|
34
|
-
readonly outputTokens: number | false;
|
|
35
|
-
};
|
|
36
|
-
/** Returns the first exhausted axis, with input taking precedence. */
|
|
37
|
-
export declare function findRuntimeTokenLimitViolation(input: {
|
|
38
|
-
readonly configured: SessionRuntimeTokenLimits;
|
|
39
|
-
readonly runtime: SessionRuntimeTokenLimits;
|
|
40
|
-
readonly usage: SessionTokenAmounts;
|
|
41
|
-
}): SessionTokenLimitViolation | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function resolveRuntimeTokenLimits(e){let t={},n=e.stored?.inputTokens??e.configured.inputTokens;n!==void 0&&(t.inputTokens=n);let r=e.stored?.outputTokens??e.configured.outputTokens;return r!==void 0&&(t.outputTokens=r),t}function grantRuntimeTokenLimits(e){let t={};return e.configured.inputTokens!==void 0&&(t.inputTokens=e.usage.inputTokens+e.configured.inputTokens),e.configured.outputTokens!==void 0&&(t.outputTokens=e.usage.outputTokens+e.configured.outputTokens),t}function remainingRuntimeTokenQuota(e){return{inputTokens:e.runtime.inputTokens!==void 0&&Math.max(0,e.runtime.inputTokens-e.usage.inputTokens),outputTokens:e.runtime.outputTokens!==void 0&&Math.max(0,e.runtime.outputTokens-e.usage.outputTokens)}}function findRuntimeTokenLimitViolation(e){return e.runtime.inputTokens!==void 0&&e.configured.inputTokens!==void 0&&e.usage.inputTokens>=e.runtime.inputTokens?{kind:`input`,limit:e.configured.inputTokens,usedTokens:e.usage.inputTokens}:e.runtime.outputTokens!==void 0&&e.configured.outputTokens!==void 0&&e.usage.outputTokens>=e.runtime.outputTokens?{kind:`output`,limit:e.configured.outputTokens,usedTokens:e.usage.outputTokens}:null}export{findRuntimeTokenLimitViolation,grantRuntimeTokenLimits,remainingRuntimeTokenQuota,resolveRuntimeTokenLimits};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HarnessSession } from "#harness/types.js";
|
|
2
|
-
import type { PendingAgentDispatchAction, PendingDispatchAction } from "#shared/dispatch-action.js";
|
|
3
|
-
export type ResolvedSubagentDepth = {
|
|
4
|
-
readonly currentDepth: number;
|
|
5
|
-
readonly nextChildDepth: number;
|
|
6
|
-
};
|
|
7
|
-
export declare function resolveSubagentDepth(session: Pick<HarnessSession, "subagentDepth">): ResolvedSubagentDepth;
|
|
8
|
-
export declare function readSerializedSubagentDepth(serializedContext: Readonly<Record<string, unknown>>): number | undefined;
|
|
9
|
-
export declare function isSubagentDelegationAction(action: PendingDispatchAction): action is PendingAgentDispatchAction;
|
|
10
|
-
export declare function getSubagentDelegationName(action: PendingAgentDispatchAction): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SubagentDepthKey}from"#context/keys.js";function resolveSubagentDepth(e){let t=parseSubagentDepth(e.subagentDepth);return{currentDepth:t,nextChildDepth:t+1}}function readSerializedSubagentDepth(t){let n=parseSubagentDepth(t[SubagentDepthKey.name]);return n===0?void 0:n}function isSubagentDelegationAction(e){return e.target.kind===`self-agent-call`||e.target.kind===`subagent-call`||e.target.kind===`remote-agent-call`}function getSubagentDelegationName(e){switch(e.target.kind){case`remote-agent-call`:return e.target.remoteAgentName;case`self-agent-call`:case`subagent-call`:return e.target.subagentName;default:return e.target}}function parseSubagentDepth(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:0}export{getSubagentDelegationName,isSubagentDelegationAction,readSerializedSubagentDepth,resolveSubagentDepth};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getSessionRemainingTokenQuota}from"#harness/turn-tag-state.js";function resolveRemainingSessionTokenLimits(t,n=1){let r=Math.max(1,Math.floor(n)),i=getSessionRemainingTokenQuota(t);return{maxInputTokensPerSession:grantShare(i.inputTokens,r),maxOutputTokensPerSession:grantShare(i.outputTokens,r)}}function grantShare(e,t){return e!==!1&&Math.floor(e/t)}export{resolveRemainingSessionTokenLimits};
|