eve 0.49.1 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/types.d.ts +12 -19
- package/dist/src/chunks/{use-eve-agent-Bgp6INfi.js → use-eve-agent-B4xN7-fK.js} +177 -45
- package/dist/src/chunks/{use-eve-agent-BZnOzAVd.js → use-eve-agent-C3vUG5g2.js} +177 -45
- package/dist/src/cli/acp/command.d.ts +1 -1
- package/dist/src/cli/acp/command.js +2 -2
- package/dist/src/cli/agent-command.d.ts +5 -0
- package/dist/src/cli/agent-command.js +1 -0
- package/dist/src/cli/application-command.d.ts +2 -0
- package/dist/src/cli/commands/build.d.ts +1 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +2 -0
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +14 -0
- package/dist/src/cli/commands/init-agent-workspace.js +1 -0
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -13
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/link.d.ts +2 -0
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +15 -0
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.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/message-reducer-primitives.d.ts +0 -1
- package/dist/src/client/message-reducer-primitives.js +1 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/message-run-parts.d.ts +18 -0
- package/dist/src/client/message-run-parts.js +1 -0
- package/dist/src/client/ndjson.d.ts +4 -2
- package/dist/src/client/ndjson.js +3 -3
- package/dist/src/client/open-stream.d.ts +2 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/stream-version.d.ts +3 -0
- package/dist/src/client/stream-version.js +1 -0
- package/dist/src/compiled/.vendor-stamp.json +7 -2
- package/dist/src/compiled/@eve/catalog/index.d.ts +87 -0
- package/dist/src/compiled/@eve/catalog/index.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +36 -23
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +0 -3
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/execution/activity-work-id.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/channel-context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +103 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -0
- package/dist/src/execution/coordination-dispatch-step.d.ts +7 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -0
- package/dist/src/execution/create-session-step.d.ts +1 -2
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +5 -5
- package/dist/src/execution/dispatch-action-failures.js +1 -1
- package/dist/src/execution/dispatch-start-operation.d.ts +1 -1
- package/dist/src/execution/dispatch-start-operation.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/ndjson-stream.d.ts +1 -1
- package/dist/src/execution/ndjson-stream.js +3 -3
- package/dist/src/execution/next-driver-action.d.ts +7 -10
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/pending-turn-state.d.ts +1 -2
- package/dist/src/execution/pending-turn-state.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +2 -3
- package/dist/src/execution/session.d.ts +1 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +1 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/task-event-callback.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +18 -18
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/update-step.d.ts +6 -0
- package/dist/src/execution/tasks/child/update-step.js +1 -0
- package/dist/src/execution/tasks/child/update.d.ts +7 -10
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/child/workflow.d.ts +21 -29
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +6 -17
- package/dist/src/execution/tasks/parent/control-shared.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +15 -50
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +19 -34
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +5 -15
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/run-parent.d.ts +2 -2
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +11 -0
- package/dist/src/execution/tasks/parent/task-cancel.js +1 -0
- package/dist/src/execution/tasks/parent/tool-execution.d.ts +2 -3
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.d.ts +7 -0
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -0
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +9 -0
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +51 -0
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +37 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +55 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -0
- package/dist/src/execution/tools/subagent/receipt-identity.d.ts +11 -0
- package/dist/src/execution/tools/subagent/receipt-identity.js +1 -0
- package/dist/src/execution/{dispatch-runtime-actions-start.d.ts → tools/subagent/start.d.ts} +17 -5
- package/dist/src/execution/tools/subagent/start.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +24 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -0
- package/dist/src/execution/tools/subagent/task-cancel.d.ts +10 -0
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +10 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/execution/{tool-run → tools/workflow}/answer.d.ts +1 -1
- package/dist/src/execution/tools/workflow/answer.js +1 -0
- package/dist/src/execution/tools/workflow/ask.d.ts +22 -0
- package/dist/src/execution/tools/workflow/ask.js +1 -0
- package/dist/src/execution/tools/workflow/background.d.ts +18 -0
- package/dist/src/execution/tools/workflow/background.js +1 -0
- package/dist/src/execution/tools/workflow/body.d.ts +25 -0
- package/dist/src/execution/tools/workflow/body.js +1 -0
- package/dist/src/execution/tools/workflow/cancel.d.ts +11 -0
- package/dist/src/execution/tools/workflow/cancel.js +1 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +7 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -0
- package/dist/src/execution/tools/workflow/messages.d.ts +88 -0
- package/dist/src/execution/tools/workflow/messages.js +1 -0
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -0
- package/dist/src/execution/tools/workflow/owner.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner.js +1 -0
- package/dist/src/execution/tools/workflow/run-control.d.ts +18 -0
- package/dist/src/execution/tools/workflow/run-control.js +1 -0
- package/dist/src/execution/tools/workflow/start.d.ts +33 -0
- package/dist/src/execution/tools/workflow/start.js +1 -0
- package/dist/src/execution/tools/workflow/types.d.ts +26 -0
- package/dist/src/execution/tools/workflow/types.js +1 -0
- package/dist/src/execution/tools/workflow/workflow.d.ts +3 -0
- package/dist/src/execution/tools/workflow/workflow.js +1 -0
- package/dist/src/execution/turn-workflow-tool-run.d.ts +16 -0
- package/dist/src/execution/turn-workflow-tool-run.js +1 -0
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
- package/dist/src/execution/wire/session-inbox-contract.js +1 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +6 -2
- package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.d.ts +3 -3
- package/dist/src/execution/wire/session-inbox-wire.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +267 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +1 -0
- package/dist/src/execution/workflow-entry-finalization.d.ts +6 -0
- package/dist/src/execution/workflow-entry-finalization.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +2 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -7
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/background-tools.d.ts +8 -2
- package/dist/src/harness/{runtime-actions.d.ts → coordination.d.ts} +40 -27
- package/dist/src/harness/coordination.js +1 -0
- package/dist/src/harness/current-messages.d.ts +2 -0
- package/dist/src/harness/current-messages.js +1 -1
- 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/approval-input-requests.d.ts +2 -2
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- 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/ordered-stream-emitter.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +6 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +1 -2
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-action.js +1 -1
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +3 -1
- package/dist/src/harness/types.d.ts +4 -7
- package/dist/src/harness/workflow-interrupt-state.js +1 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +10 -0
- package/dist/src/harness/workflow-lifecycle.js +1 -1
- package/dist/src/harness/workflow-sandbox.d.ts +1 -1
- package/dist/src/harness/workflow-sandbox.js +2 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +7 -7
- package/dist/src/harness/workflow-subagent-limit.js +1 -1
- package/dist/src/harness/workflow-task-state.d.ts +9 -0
- package/dist/src/harness/workflow-task-state.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +27 -0
- package/dist/src/harness/workflow-tool-runs.js +1 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/parent-lineage.js +1 -1
- package/dist/src/internal/agent-name.d.ts +4 -0
- package/dist/src/internal/agent-name.js +1 -0
- package/dist/src/internal/agent-workspace.d.ts +15 -0
- package/dist/src/internal/agent-workspace.js +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/project-context.d.ts +26 -0
- package/dist/src/internal/project-context.js +1 -0
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +17 -0
- package/dist/src/internal/vercel/assemble-eve-services.js +1 -0
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -0
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -0
- package/dist/src/internal/vercel/build-command.d.ts +4 -0
- package/dist/src/internal/vercel/build-command.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +27 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.d.ts +18 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.js +1 -0
- package/dist/src/internal/vercel/vercel-service-name.d.ts +6 -0
- package/dist/src/internal/vercel/vercel-service-name.js +1 -0
- package/dist/src/internal/vercel/vercel-services-config.d.ts +53 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -0
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/message-version.d.ts +52 -0
- package/dist/src/protocol/message-version.js +1 -0
- package/dist/src/protocol/message.d.ts +3 -8
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +0 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/workflow/index.d.ts +3 -1
- package/dist/src/public/workflow/index.js +1 -1
- package/dist/src/runtime/actions/results.d.ts +3 -3
- package/dist/src/runtime/actions/results.js +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/channels/registry.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +16 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow-reference.d.ts +5 -0
- package/dist/src/runtime/subagents/workflow-reference.js +1 -0
- package/dist/src/runtime/subagents/workflow.d.ts +8 -0
- package/dist/src/runtime/subagents/workflow.js +1 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/setup/integrations/discord/setup.js +1 -1
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
- package/dist/src/setup/integrations/linear/setup.js +1 -1
- package/dist/src/setup/integrations/linq/setup.js +3 -3
- package/dist/src/setup/integrations/shopify/setup.js +1 -1
- package/dist/src/setup/scaffold/channels-catalog.js +1 -1
- package/dist/src/setup/scaffold/connections/catalog.d.ts +1 -1
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +4 -12
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/shared/action-types.d.ts +74 -14
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +1 -1
- package/dist/src/{execution/subagent-adapter-state.d.ts → subagents/adapter-state.d.ts} +2 -0
- package/dist/src/{execution/subagent-adapter-state.js → subagents/adapter-state.js} +1 -1
- package/dist/src/subagents/adapter.js +1 -0
- package/dist/src/{harness → subagents}/agent-handle-errors.d.ts +6 -0
- package/dist/src/subagents/agent-handle-errors.js +1 -0
- package/dist/src/subagents/callback-route.js +1 -0
- package/dist/src/subagents/callback-step.js +1 -0
- package/dist/src/{execution/agent-continuation-bundle.d.ts → subagents/continuation-bundle.d.ts} +1 -1
- package/dist/src/subagents/continuation-bundle.js +1 -0
- package/dist/src/{execution/subagent-event-proxy-step.d.ts → subagents/event-proxy-step.d.ts} +2 -8
- package/dist/src/subagents/event-proxy-step.js +1 -0
- package/dist/src/subagents/handle-dispatch.d.ts +54 -0
- package/dist/src/subagents/handle-dispatch.js +1 -0
- package/dist/src/{harness → subagents}/handles/prompt.d.ts +4 -4
- package/dist/src/{harness → subagents}/handles/prompt.js +1 -1
- package/dist/src/{harness → subagents}/handles/query.d.ts +8 -2
- package/dist/src/subagents/handles/query.js +1 -0
- package/dist/src/subagents/handles/rebase.d.ts +4 -0
- package/dist/src/subagents/handles/rebase.js +1 -0
- package/dist/src/{harness → subagents}/handles/store.d.ts +90 -15
- package/dist/src/subagents/handles/store.js +1 -0
- package/dist/src/subagents/handles/transitions.d.ts +103 -0
- package/dist/src/subagents/handles/transitions.js +1 -0
- package/dist/src/{execution/delegated-parent-notification.d.ts → subagents/parent-notification.d.ts} +1 -7
- package/dist/src/subagents/parent-notification.js +1 -0
- package/dist/src/subagents/parent-result.js +1 -0
- package/dist/src/{execution/remote-agent-dispatch.d.ts → subagents/remote-dispatch.d.ts} +3 -2
- package/dist/src/subagents/remote-dispatch.js +1 -0
- package/dist/src/{execution/subagent-start-local.d.ts → subagents/start-local.d.ts} +5 -6
- package/dist/src/subagents/start-local.js +1 -0
- package/dist/src/{execution/subagent-start-remote.d.ts → subagents/start-remote.d.ts} +5 -5
- package/dist/src/subagents/start-remote.js +1 -0
- package/dist/src/{execution/subagent-tool.d.ts → subagents/tool.d.ts} +5 -3
- package/dist/src/subagents/tool.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tasks/session-index.d.ts +2 -3
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/task-id.d.ts +3 -4
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/transitions.d.ts +3 -47
- package/dist/src/tasks/transitions.js +1 -1
- package/dist/src/tasks/types.d.ts +69 -247
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -1
- package/dist/src/tools/framework/agent.d.ts +18 -2
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +2 -6
- package/dist/src/tools/framework/task-contract.d.ts +44 -65
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/framework/task-update.d.ts +1 -0
- package/dist/src/tools/framework/task-update.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/built-in-tools.md +9 -90
- package/docs/concepts/context-control.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +15 -9
- package/docs/guides/client/streaming.mdx +18 -2
- package/docs/guides/deployment/vercel.mdx +20 -2
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/instrumentation-providers.md +242 -0
- package/docs/guides/instrumentation.md +2 -0
- package/docs/guides/meta.json +1 -0
- package/docs/guides/remote-agents.md +8 -9
- package/docs/reference/cli.md +5 -2
- package/docs/sandbox.mdx +2 -0
- package/docs/subagents/index.mdx +9 -8
- package/docs/tools/human-in-the-loop.md +2 -0
- package/docs/tools/overview.mdx +11 -10
- package/docs/tools/workflows.mdx +52 -18
- package/package.json +1 -1
- package/dist/src/execution/agent-continuation-bundle.js +0 -1
- package/dist/src/execution/agent-handle-dispatch.d.ts +0 -79
- package/dist/src/execution/agent-handle-dispatch.js +0 -1
- package/dist/src/execution/delegated-parent-notification.js +0 -1
- package/dist/src/execution/delegated-parent-result.js +0 -1
- package/dist/src/execution/delegation-tool.d.ts +0 -10
- package/dist/src/execution/delegation-tool.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +0 -165
- package/dist/src/execution/dispatch-runtime-actions-shared.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-start.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-runtime-actions-step.js +0 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +0 -1
- package/dist/src/execution/finalize-terminal-session.d.ts +0 -17
- package/dist/src/execution/finalize-terminal-session.js +0 -1
- package/dist/src/execution/prepared-agent-action.d.ts +0 -7
- package/dist/src/execution/prepared-agent-action.js +0 -1
- package/dist/src/execution/remote-agent-dispatch.js +0 -1
- package/dist/src/execution/session-callback-route.js +0 -1
- package/dist/src/execution/session-callback-step.js +0 -1
- package/dist/src/execution/subagent-adapter.js +0 -1
- package/dist/src/execution/subagent-event-proxy-step.js +0 -1
- package/dist/src/execution/subagent-start-local.js +0 -1
- package/dist/src/execution/subagent-start-remote.js +0 -1
- package/dist/src/execution/subagent-tool.js +0 -1
- package/dist/src/execution/tasks/child/instructions.d.ts +0 -3
- package/dist/src/execution/tasks/child/instructions.js +0 -1
- package/dist/src/execution/tasks/parent/agent-identity.d.ts +0 -13
- package/dist/src/execution/tasks/parent/agent-identity.js +0 -1
- package/dist/src/execution/tasks/parent/agent-views.d.ts +0 -7
- package/dist/src/execution/tasks/parent/agent-views.js +0 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +0 -43
- package/dist/src/execution/tasks/parent/continuation-dispatch.js +0 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +0 -19
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +0 -1
- package/dist/src/execution/tool-run/answer.js +0 -1
- package/dist/src/execution/tool-run/background.d.ts +0 -14
- package/dist/src/execution/tool-run/background.js +0 -1
- package/dist/src/execution/tool-run/cancel.d.ts +0 -7
- package/dist/src/execution/tool-run/cancel.js +0 -1
- package/dist/src/execution/tool-run/dispatch.d.ts +0 -24
- package/dist/src/execution/tool-run/dispatch.js +0 -1
- package/dist/src/execution/tool-run/emit-run-report-step.d.ts +0 -7
- package/dist/src/execution/tool-run/emit-run-report-step.js +0 -1
- package/dist/src/execution/tool-run/messages.d.ts +0 -70
- package/dist/src/execution/tool-run/messages.js +0 -1
- package/dist/src/execution/tool-run/owner-inbox.d.ts +0 -11
- package/dist/src/execution/tool-run/owner-inbox.js +0 -1
- package/dist/src/execution/tool-run/owner.d.ts +0 -13
- package/dist/src/execution/tool-run/owner.js +0 -1
- package/dist/src/execution/tool-run/run-control.d.ts +0 -18
- package/dist/src/execution/tool-run/run-control.js +0 -1
- package/dist/src/execution/tool-run/start.d.ts +0 -11
- package/dist/src/execution/tool-run/start.js +0 -1
- package/dist/src/execution/tool-run/types.d.ts +0 -21
- package/dist/src/execution/tool-run/types.js +0 -1
- package/dist/src/execution/tool-run/workflow.d.ts +0 -9
- package/dist/src/execution/tool-run/workflow.js +0 -1
- package/dist/src/execution/tools/subagent/local.d.ts +0 -40
- package/dist/src/execution/tools/subagent/local.js +0 -1
- package/dist/src/execution/tools/subagent/remote.d.ts +0 -26
- package/dist/src/execution/tools/subagent/remote.js +0 -1
- package/dist/src/harness/agent-handle-errors.js +0 -1
- package/dist/src/harness/handles/query.js +0 -1
- package/dist/src/harness/handles/store.js +0 -1
- package/dist/src/harness/handles/transitions.d.ts +0 -167
- package/dist/src/harness/handles/transitions.js +0 -1
- package/dist/src/harness/runtime-actions.js +0 -1
- package/dist/src/harness/subagent-depth.d.ts +0 -10
- package/dist/src/harness/subagent-depth.js +0 -1
- package/dist/src/harness/tool-runs.d.ts +0 -21
- package/dist/src/harness/tool-runs.js +0 -1
- package/dist/src/harness/workflow-runtime-action-state.d.ts +0 -9
- package/dist/src/harness/workflow-runtime-action-state.js +0 -1
- package/dist/src/packages/eve-catalog/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/execution/{tool-run → tools/workflow}/owner-channels.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.js +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.js +0 -0
- /package/dist/src/{execution/subagent-adapter.d.ts → subagents/adapter.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-route.d.ts → subagents/callback-route.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-step.d.ts → subagents/callback-step.d.ts} +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.js +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.js +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.d.ts → subagents/hitl-proxy.d.ts} +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.js → subagents/hitl-proxy.js} +0 -0
- /package/dist/src/{execution/subagent-invocation.d.ts → subagents/invocation.d.ts} +0 -0
- /package/dist/src/{execution/subagent-invocation.js → subagents/invocation.js} +0 -0
- /package/dist/src/{execution/delegated-parent-result.d.ts → subagents/parent-result.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.d.ts → subagents/remote-route-url.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.js → subagents/remote-route-url.js} +0 -0
- /package/dist/src/{harness/subagent-token-budget.d.ts → subagents/token-budget.d.ts} +0 -0
- /package/dist/src/{harness/subagent-token-budget.js → subagents/token-budget.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.51.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aae2631: Background workflow tools now execute as their task's durable workflow run, subagents can be invoked directly from waiting workflow tools and workflow sandboxes, and workflow `agent()` calls require a replay-stable `key`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- fc123f4: Discover multi-agent projects from their `agents/` directory, add consistent `--agent` selection to agent-scoped CLI commands, and let `eve init --agents <name,...>` create or extend an agent workspace.
|
|
12
|
+
- b03290a: Preserve background execution for durable dynamic tools so replayed callbacks receive their task runtime.
|
|
13
|
+
- 6e630b4: Deploy conventional `agents/<name>/agent/` workspaces as inferred peer Vercel services at `/<name>/eve/v1/*`, with no generated `vercel.json` step.
|
|
14
|
+
- ecf0b6a: Prevent Vercel Blob file memory from receiving compressed responses with weak ETags that cannot be used for conditional writes. Blob reads now request identity encoding so memory documents continue saving as they grow.
|
|
15
|
+
- 4c45d2f: Fix file-memory setup failing after it creates a Vercel Blob store when the project uses Vercel CLI 57. Setup now connects the store without passing that release an unsupported output flag, so retrying repairs the partial setup normally.
|
|
16
|
+
- bad0813: Fix the sandbox base image so a non-interactive `bash -lc` login shell exits cleanly as `vercel-sandbox`. Ubuntu's default `.bash_logout` ran `clear_console` on exit, which wrote `TERM environment variable not set.` to stderr and, under `set -e`, turned a successful `exit 0` into exit 1 on Vercel Sandbox. `sudo` no longer warns about unresolvable sandbox hostnames, `$HOME/.local/bin` exists on `PATH` for user-scoped installs, and Node is root-owned on every architecture.
|
|
17
|
+
- f9b760a: Ignore unrelated ancestor `agents/` directories when resolving standalone projects so local CLI commands do not misclassify neighboring repositories as agent workspaces.
|
|
18
|
+
- 3cccd71: Preserve inherited channel audience metadata when local subagents persist adapter state. Public parent traces now continue capturing local child inputs and outputs while destination-specific redaction remains independent.
|
|
19
|
+
- 29b9056: Run approved background tool calls even when the AI SDK skips its input callback during resume.
|
|
20
|
+
|
|
21
|
+
## 0.50.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 70c8a2e: Store message and reasoning appends as plain deltas instead of repeating cumulative text. Streamed tool-input appends now use the same delta-only shape.
|
|
26
|
+
|
|
27
|
+
Empty tool-input start markers no longer emit an append event; the first append contains actual input text.
|
|
28
|
+
|
|
29
|
+
Extensions built against the previous dynamic-tool, channel, schedule, subagent, connection, hook, dynamic-skill, or dynamic-instructions capability contracts must be rebuilt and republished with this release.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 5b90f3d: Fix approved tool calls silently not executing when task state or a dynamic skill announcement was injected on the resume step. The runtime context was appended after the approval response, so the AI SDK skipped the approved tool and providers rejected the prompt with errors like `No tool output found for function call`.
|
|
34
|
+
- 884cba8: Prevent approving one tool call from auto-authorizing other already-pending calls with the same approval key. Existing approval prompts now remain independent, while `once()` still auto-allows calls proposed after the pending requests are resolved.
|
|
35
|
+
- 2b52714: Reduce the published sandbox image by avoiding a duplicate ownership-only layer while preserving global npm and pnpm installs for sandbox users.
|
|
36
|
+
- ffcd817: Bundle eve's private integration catalog into the published package so setup runtime code and TypeScript declarations no longer reference an unavailable workspace dependency.
|
|
37
|
+
|
|
3
38
|
## 0.49.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/dist/src/acp/adapter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(t){if(t.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((t.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let e=await normalizedRealpath(t.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(e!==n)throw RequestError.invalidParams({cwd:t.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let n=randomUUID();return this.#i.set(n,{tools:new Map}),{sessionId:n}}async prompt(e,t,n){let i=this.#s(e.sessionId);if(i.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let a=promptContent(e);i.tools.clear();let o=Promise.withResolvers(),s={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:o.promise,resolveSettled:o.resolve};i.active=s;let onProtocolCancel=()=>{s.protocolCancelled=!0,this.#o(i).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let o={message:a};for(;;){let a;if(i.client===void 0){if(o.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...o,message:o.message});i.client=e.session,a=e.response}else a=o.inputResponses===void 0?await i.client.send(o.message):await i.client.respond(o.inputResponses);(s.cancelRequested||s.protocolCancelled)&&await this.#o(i);let c=[],l=!1,u,d;for await(let n of a){let r=`data`in n&&`turnId`in n.data?n.data.turnId:void 0;typeof r==`string`&&(s.turnId=r),n.type===`input.requested`&&c.push(...n.data.requests),n.type===`authorization.required`&&(d=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(l=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(u=n),await this.#c(e.sessionId,i,n,t)}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(l||s.cancelRequested)return{stopReason:`cancelled`};if(u!==void 0)throw eveFailure(u);if(d!==void 0)throw d;if(c.length===0)return{stopReason:`end_turn`};let f;try{f=await Promise.all(c.map(r=>this.#l(e.sessionId,i,r,t,n)))}catch(t){if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};throw t}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};o={inputResponses:f}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),i.tools.clear(),s.resolveSettled(),i.active===s&&(i.active=void 0)}}async cancel(e){let t=this.#i.get(e);t===void 0||t.active===void 0||(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,a,o){let c=AbortSignal.any([o,t.active.outboundController.signal]);if(n.display===`confirmation`){let o=`${n.requestId}:approve`,s=`${n.requestId}:deny`,l=t.tools.get(n.action.callId)??toolCallForAction(n.action),u=await a.request(methods.client.session.requestPermission,{sessionId:e,toolCall:l,options:[{kind:`allow_once`,name:`Approve`,optionId:o},{kind:`reject_once`,name:`Deny`,optionId:s}]},{cancellationSignal:c});if(u.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(u.outcome.optionId===o)return{requestId:n.requestId,optionId:`approve`};if(u.outcome.optionId===s)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:u.outcome.optionId},`Unknown ACP permission option`)}if(!this.#r)throw unsupported(`The ACP client does not support form elicitation required by this eve question.`);let l=elicitationProperty(n),u=await a.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:l},required:[ANSWER_FIELD]}},{cancellationSignal:c});if(u.action!==`accept`)return this.#u(t),{requestId:n.requestId};let d=u.content?.[ANSWER_FIELD];if(typeof d!=`string`)throw RequestError.invalidParams(u.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===d))throw RequestError.invalidParams({answer:d},`Unknown eve question option`);return{requestId:n.requestId,optionId:d}}return{requestId:n.requestId,text:d}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,n){try{return await realpath(e)}catch(t){throw RequestError.invalidParams({path:e},`Could not resolve ${n}: ${errorMessage(t)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
1
|
+
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(t){if(t.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((t.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let e=await normalizedRealpath(t.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(e!==n)throw RequestError.invalidParams({cwd:t.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let n=randomUUID();return this.#i.set(n,{tools:new Map}),{sessionId:n}}async prompt(e,t,n){let i=this.#s(e.sessionId);if(i.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let a=promptContent(e);i.tools.clear();let o=Promise.withResolvers(),s={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:o.promise,resolveSettled:o.resolve};i.active=s;let onProtocolCancel=()=>{s.protocolCancelled=!0,this.#o(i).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let o={message:a};for(;;){let a;if(i.client===void 0){if(o.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...o,message:o.message});i.client=e.session,a=e.response}else a=o.inputResponses===void 0?await i.client.send(o.message):await i.client.respond(o.inputResponses);(s.cancelRequested||s.protocolCancelled)&&await this.#o(i);let c=[],l=!1,u,d;for await(let n of a){let r=`data`in n&&`turnId`in n.data?n.data.turnId:void 0;typeof r==`string`&&(s.turnId=r),n.type===`input.requested`&&c.push(...n.data.requests),n.type===`authorization.required`&&(d=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(l=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(u=n),await this.#c(e.sessionId,i,n,t)}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(l||s.cancelRequested)return{stopReason:`cancelled`};if(u!==void 0)throw eveFailure(u);if(d!==void 0)throw d;if(c.length===0)return{stopReason:`end_turn`};let f;try{f=await Promise.all(c.map(r=>this.#l(e.sessionId,i,r,t,n)))}catch(t){if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};throw t}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};o={inputResponses:f}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),i.tools.clear(),s.resolveSettled(),i.active===s&&(i.active=void 0)}}async cancel(e){let t=this.#i.get(e);t===void 0||t.active===void 0||(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,a,o){let c=AbortSignal.any([o,t.active.outboundController.signal]);if(n.display===`confirmation`){let o=`${n.requestId}:approve`,s=`${n.requestId}:deny`,l=t.tools.get(n.action.callId)??toolCallForAction(n.action),u=await a.request(methods.client.session.requestPermission,{sessionId:e,toolCall:l,options:[{kind:`allow_once`,name:`Approve`,optionId:o},{kind:`reject_once`,name:`Deny`,optionId:s}]},{cancellationSignal:c});if(u.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(u.outcome.optionId===o)return{requestId:n.requestId,optionId:`approve`};if(u.outcome.optionId===s)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:u.outcome.optionId},`Unknown ACP permission option`)}if(!this.#r)throw unsupported(`The ACP client does not support form elicitation required by this eve question.`);let l=elicitationProperty(n),u=await a.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:l},required:[ANSWER_FIELD]}},{cancellationSignal:c});if(u.action!==`accept`)return this.#u(t),{requestId:n.requestId};let d=u.content?.[ANSWER_FIELD];if(typeof d!=`string`)throw RequestError.invalidParams(u.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===d))throw RequestError.invalidParams({answer:d},`Unknown eve question option`);return{requestId:n.requestId,optionId:d}}return{requestId:n.requestId,text:d}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,n){try{return await realpath(e)}catch(t){throw RequestError.invalidParams({path:e},`Could not resolve ${n}: ${errorMessage(t)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`||e.kind===`workflow-tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
@@ -2,14 +2,14 @@ import type { UserContent } from "ai";
|
|
|
2
2
|
import type { MessageStreamEvent, UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
3
3
|
import type { CancelTurnResult as ProtocolCancelTurnResult } from "#protocol/cancel-turn.js";
|
|
4
4
|
import type { RunMode } from "#shared/run-mode.js";
|
|
5
|
-
import type { RuntimeSubagentChildResult, RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
5
|
+
import type { RuntimeSubagentChildResult, RuntimeSubagentDispatchFailure, RuntimeToolResultActionResult } from "#shared/action-types.js";
|
|
6
6
|
import type { InputRequest, InputResponse } from "#shared/input.js";
|
|
7
7
|
import type { ChannelAdapter } from "#channel/adapter.js";
|
|
8
8
|
import type { AgentLimitsDefinition } from "#shared/agent-definition.js";
|
|
9
9
|
import type { JsonObject } from "#shared/json.js";
|
|
10
10
|
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
11
11
|
import type { ForwardedTraceAssertion } from "#shared/forwarded-trace-policy.js";
|
|
12
|
-
import type { TaskView } from "#tasks/types.js";
|
|
12
|
+
import type { TaskAgentRequestDelivery, TaskAuthorizationEventDelivery, TaskInputRequestDelivery, TaskView } from "#tasks/types.js";
|
|
13
13
|
export type { ContextAccessor } from "#context/key.js";
|
|
14
14
|
export type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
15
15
|
import type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
@@ -150,15 +150,11 @@ export interface DeliverPayload {
|
|
|
150
150
|
/** Framework-only task envelopes consumed before adapter/model delivery. */
|
|
151
151
|
readonly task?: {
|
|
152
152
|
/** Task HITL input-request batches for the parent's pre-model router. */
|
|
153
|
-
readonly inputRequests?: readonly
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
readonly authorizationEvents?: readonly {
|
|
159
|
-
readonly hookPayload: SubagentAuthorizationEventHookPayload;
|
|
160
|
-
readonly taskId: string;
|
|
161
|
-
}[];
|
|
153
|
+
readonly inputRequests?: readonly TaskInputRequestDelivery[];
|
|
154
|
+
/** Agent spawn/settlement requests a task-owned workflow run needs the parent to apply. */
|
|
155
|
+
readonly agentRequests?: readonly TaskAgentRequestDelivery[];
|
|
156
|
+
/** Task child authorization events re-emitted through the parent channel. */
|
|
157
|
+
readonly authorizationEvents?: readonly TaskAuthorizationEventDelivery[];
|
|
162
158
|
/** Terminal views cached before task-run retention expires. */
|
|
163
159
|
readonly views?: readonly TaskView[];
|
|
164
160
|
};
|
|
@@ -265,11 +261,12 @@ export interface ClearSessionHookPayload {
|
|
|
265
261
|
/**
|
|
266
262
|
* Results resumed back into a parked parent workflow by the work it
|
|
267
263
|
* dispatched: child-produced subagent results and authored workflow tool
|
|
268
|
-
* results.
|
|
264
|
+
* results. Workflow-owner dispatch failures use the same private reply hook so
|
|
265
|
+
* `agent()` can settle instead of waiting forever.
|
|
269
266
|
*/
|
|
270
267
|
export interface RuntimeActionResultHookPayload {
|
|
271
268
|
readonly kind: "runtime-action-result";
|
|
272
|
-
readonly results: readonly (RuntimeSubagentChildResult | RuntimeToolResultActionResult)[];
|
|
269
|
+
readonly results: readonly (RuntimeSubagentChildResult | RuntimeSubagentDispatchFailure | RuntimeToolResultActionResult)[];
|
|
273
270
|
}
|
|
274
271
|
/**
|
|
275
272
|
* Event coordinates attached to a proxied `input.requested` batch.
|
|
@@ -376,6 +373,8 @@ export interface SessionCapabilities {
|
|
|
376
373
|
*/
|
|
377
374
|
export interface RunInput {
|
|
378
375
|
readonly adapter: ChannelAdapter<any>;
|
|
376
|
+
/** Framework task that owns this run, when the run is a task executor. */
|
|
377
|
+
readonly taskId?: string;
|
|
379
378
|
/**
|
|
380
379
|
* Registered channel name for root sessions started from an authored
|
|
381
380
|
* channel route. Framework runs omit this and use their framework
|
|
@@ -457,12 +456,6 @@ export interface RunInput {
|
|
|
457
456
|
* for that axis.
|
|
458
457
|
*/
|
|
459
458
|
readonly limits?: RunSessionLimits;
|
|
460
|
-
/**
|
|
461
|
-
* Framework-owned depth of delegated local subagent sessions. Root sessions
|
|
462
|
-
* omit this and are treated as depth 0; each local child receives
|
|
463
|
-
* parent depth + 1.
|
|
464
|
-
*/
|
|
465
|
-
readonly subagentDepth?: number;
|
|
466
459
|
/** Framework-owned metadata for a protocol-neutral external invocation. */
|
|
467
460
|
readonly externalInvocation?: {
|
|
468
461
|
readonly continuationToken: string;
|
|
@@ -322,8 +322,7 @@ const kernelEffect = z.object({
|
|
|
322
322
|
audience: z.array(z.enum([
|
|
323
323
|
"root-session",
|
|
324
324
|
"delegated-task-child",
|
|
325
|
-
"requires-request-input"
|
|
326
|
-
"below-subagent-depth"
|
|
325
|
+
"requires-request-input"
|
|
327
326
|
])),
|
|
328
327
|
kind: z.enum([
|
|
329
328
|
"request-input",
|
|
@@ -680,6 +679,7 @@ function incrementRandom(bytes) {
|
|
|
680
679
|
//#region src/protocol/message.ts
|
|
681
680
|
const EVE_SESSION_ID_HEADER = "x-eve-session-id";
|
|
682
681
|
const EVE_STREAM_TAIL_INDEX_HEADER = "x-eve-stream-tail-index";
|
|
682
|
+
const EVE_STREAM_VERSION_HEADER = "x-eve-stream-version";
|
|
683
683
|
const textEncoder = new TextEncoder();
|
|
684
684
|
function isCurrentTurnBoundaryEvent(event) {
|
|
685
685
|
return event.type === "session.completed" || event.type === "session.failed" || event.type === "session.waiting";
|
|
@@ -787,6 +787,101 @@ var MessageResponse = class {
|
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
+
//#endregion
|
|
791
|
+
//#region src/protocol/message-version.ts
|
|
792
|
+
function normalizeMessageStreamEvent(version, event) {
|
|
793
|
+
switch (version) {
|
|
794
|
+
case "21":
|
|
795
|
+
case "22":
|
|
796
|
+
case "23":
|
|
797
|
+
case "24": return normalizeLegacyMessageStreamEvent(version, event);
|
|
798
|
+
case "25": return validateCurrentMessageStreamEvent(event);
|
|
799
|
+
default: return assertNever(version);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
function normalizeLegacyMessageStreamEvent(version, event) {
|
|
803
|
+
if (event.type === "message.appended") {
|
|
804
|
+
assertLegacyAppendSnapshot(event.data.messageSoFar, event.data.messageDelta, "message", version);
|
|
805
|
+
return {
|
|
806
|
+
data: {
|
|
807
|
+
messageDelta: event.data.messageDelta,
|
|
808
|
+
sequence: event.data.sequence,
|
|
809
|
+
stepIndex: event.data.stepIndex,
|
|
810
|
+
turnId: event.data.turnId
|
|
811
|
+
},
|
|
812
|
+
meta: event.meta,
|
|
813
|
+
type: "message.appended"
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
if (event.type === "reasoning.appended") {
|
|
817
|
+
assertLegacyAppendSnapshot(event.data.reasoningSoFar, event.data.reasoningDelta, "reasoning", version);
|
|
818
|
+
return {
|
|
819
|
+
data: {
|
|
820
|
+
reasoningDelta: event.data.reasoningDelta,
|
|
821
|
+
sequence: event.data.sequence,
|
|
822
|
+
stepIndex: event.data.stepIndex,
|
|
823
|
+
turnId: event.data.turnId
|
|
824
|
+
},
|
|
825
|
+
meta: event.meta,
|
|
826
|
+
type: "reasoning.appended"
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
if (event.type === "action.input.appended") {
|
|
830
|
+
if (version !== void 0 && version !== "24") throw new TypeError(`Invalid action input append for stream version ${version}.`);
|
|
831
|
+
assertLegacyActionInputOffset(event.data.inputTextOffset, version);
|
|
832
|
+
return {
|
|
833
|
+
data: {
|
|
834
|
+
callId: event.data.callId,
|
|
835
|
+
inputTextDelta: event.data.inputTextDelta,
|
|
836
|
+
sequence: event.data.sequence,
|
|
837
|
+
stepIndex: event.data.stepIndex,
|
|
838
|
+
toolName: event.data.toolName,
|
|
839
|
+
turnId: event.data.turnId
|
|
840
|
+
},
|
|
841
|
+
meta: event.meta,
|
|
842
|
+
type: "action.input.appended"
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
return event;
|
|
846
|
+
}
|
|
847
|
+
function validateCurrentMessageStreamEvent(event) {
|
|
848
|
+
if (event.type === "message.appended") {
|
|
849
|
+
assertCurrentAppendDelta(event.data.messageDelta, "message");
|
|
850
|
+
assertUnsupportedAppendField(event.data, "messageOffset", "message");
|
|
851
|
+
assertUnsupportedAppendField(event.data, "messageSoFar", "message");
|
|
852
|
+
} else if (event.type === "reasoning.appended") {
|
|
853
|
+
assertCurrentAppendDelta(event.data.reasoningDelta, "reasoning");
|
|
854
|
+
assertUnsupportedAppendField(event.data, "reasoningOffset", "reasoning");
|
|
855
|
+
assertUnsupportedAppendField(event.data, "reasoningSoFar", "reasoning");
|
|
856
|
+
} else if (event.type === "action.input.appended") {
|
|
857
|
+
assertCurrentAppendDelta(event.data.inputTextDelta, "action input");
|
|
858
|
+
assertUnsupportedAppendField(event.data, "inputTextOffset", "action input");
|
|
859
|
+
}
|
|
860
|
+
return event;
|
|
861
|
+
}
|
|
862
|
+
function assertCurrentAppendDelta(delta, stream) {
|
|
863
|
+
if (typeof delta !== "string") throw new TypeError(`Invalid ${stream} append delta for stream version 25.`);
|
|
864
|
+
}
|
|
865
|
+
function assertUnsupportedAppendField(data, field, stream) {
|
|
866
|
+
if (field in data) throw new TypeError(`Invalid ${stream} append shape for stream version 25.`);
|
|
867
|
+
}
|
|
868
|
+
function assertNever(value) {
|
|
869
|
+
throw new TypeError(`Unsupported message stream version: ${String(value)}.`);
|
|
870
|
+
}
|
|
871
|
+
function assertLegacyActionInputOffset(offset, version) {
|
|
872
|
+
if (!Number.isSafeInteger(offset) || offset < 0) {
|
|
873
|
+
const source = version === void 0 ? "persisted stream" : `stream version ${version}`;
|
|
874
|
+
throw new TypeError(`Invalid action input append offset for ${source}.`);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function assertLegacyAppendSnapshot(snapshot, delta, stream, version) {
|
|
878
|
+
const offset = snapshot.length - delta.length;
|
|
879
|
+
if (offset < 0 || snapshot.slice(offset) !== delta) {
|
|
880
|
+
const source = version === void 0 ? "persisted stream" : `stream version ${version}`;
|
|
881
|
+
throw new TypeError(`Invalid cumulative ${stream} append for ${source}.`);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
790
885
|
//#endregion
|
|
791
886
|
//#region src/client/ndjson.ts
|
|
792
887
|
function isStreamDisconnectError(error) {
|
|
@@ -813,17 +908,20 @@ async function* readNdjsonStream(body, options) {
|
|
|
813
908
|
while (newlineIndex !== -1) {
|
|
814
909
|
const line = buffer.slice(0, newlineIndex).trim();
|
|
815
910
|
buffer = buffer.slice(newlineIndex + 1);
|
|
816
|
-
if (line.length > 0) yield
|
|
911
|
+
if (line.length > 0) yield parseMessageStreamEvent(line, options.streamVersion);
|
|
817
912
|
newlineIndex = buffer.indexOf("\n");
|
|
818
913
|
}
|
|
819
914
|
}
|
|
820
915
|
const trailing = buffer.trim();
|
|
821
|
-
if (trailing.length > 0) yield
|
|
916
|
+
if (trailing.length > 0) yield parseMessageStreamEvent(trailing, options.streamVersion);
|
|
822
917
|
} finally {
|
|
823
918
|
if (!reachedEof) await reader.cancel().catch(() => {});
|
|
824
919
|
reader.releaseLock();
|
|
825
920
|
}
|
|
826
921
|
}
|
|
922
|
+
function parseMessageStreamEvent(line, version) {
|
|
923
|
+
return normalizeMessageStreamEvent(version, JSON.parse(line));
|
|
924
|
+
}
|
|
827
925
|
async function readWithIdleTimeout(reader, idleTimeoutMs) {
|
|
828
926
|
if (idleTimeoutMs === void 0) return await reader.read();
|
|
829
927
|
let timeout;
|
|
@@ -836,6 +934,22 @@ async function readWithIdleTimeout(reader, idleTimeoutMs) {
|
|
|
836
934
|
}
|
|
837
935
|
}
|
|
838
936
|
|
|
937
|
+
//#endregion
|
|
938
|
+
//#region src/client/stream-version.ts
|
|
939
|
+
const supportedMessageStreamVersions = {
|
|
940
|
+
"21": true,
|
|
941
|
+
"22": true,
|
|
942
|
+
"23": true,
|
|
943
|
+
"24": true,
|
|
944
|
+
"25": true
|
|
945
|
+
};
|
|
946
|
+
function readMessageStreamVersion(headers) {
|
|
947
|
+
const version = headers.get(EVE_STREAM_VERSION_HEADER);
|
|
948
|
+
if (version !== null && Object.hasOwn(supportedMessageStreamVersions, version)) return version;
|
|
949
|
+
if (version === null) throw new TypeError(`Missing ${EVE_STREAM_VERSION_HEADER} response header.`);
|
|
950
|
+
throw new TypeError(`Unsupported message stream version: ${version}.`);
|
|
951
|
+
}
|
|
952
|
+
|
|
839
953
|
//#endregion
|
|
840
954
|
//#region src/client/url.ts
|
|
841
955
|
function createClientUrl(host, routePath, searchParams) {
|
|
@@ -962,7 +1076,10 @@ async function* followStreamIterable(input) {
|
|
|
962
1076
|
}
|
|
963
1077
|
let deliveredEvent = false;
|
|
964
1078
|
try {
|
|
965
|
-
for await (const event of readNdjsonStream(connection.body, {
|
|
1079
|
+
for await (const event of readNdjsonStream(connection.body, {
|
|
1080
|
+
idleTimeoutMs: input.streamReadIdleTimeoutMs ?? DEFAULT_STREAM_READ_IDLE_TIMEOUT_MS,
|
|
1081
|
+
streamVersion: connection.streamVersion
|
|
1082
|
+
})) {
|
|
966
1083
|
startIndex += 1;
|
|
967
1084
|
deliveredEvent = true;
|
|
968
1085
|
reconnectDelayMs = idleRetryPolicy.baseDelayMs;
|
|
@@ -1017,6 +1134,7 @@ async function openStreamBody(input) {
|
|
|
1017
1134
|
return {
|
|
1018
1135
|
body: response.body,
|
|
1019
1136
|
close: () => connectionController.abort(),
|
|
1137
|
+
streamVersion: readMessageStreamVersion(response.headers),
|
|
1020
1138
|
tailIndex: parseTailIndexHeader(response.headers)
|
|
1021
1139
|
};
|
|
1022
1140
|
}
|
|
@@ -1224,7 +1342,7 @@ function isJsonObjectValue(value) {
|
|
|
1224
1342
|
}
|
|
1225
1343
|
function isPlainObject(value) {
|
|
1226
1344
|
const prototype = Object.getPrototypeOf(value);
|
|
1227
|
-
return prototype === null || prototype ===
|
|
1345
|
+
return prototype === null || Object.getPrototypeOf(prototype) === null;
|
|
1228
1346
|
}
|
|
1229
1347
|
|
|
1230
1348
|
//#endregion
|
|
@@ -2190,7 +2308,8 @@ function normalizeActionRequest(action) {
|
|
|
2190
2308
|
name: "load_skill",
|
|
2191
2309
|
toolName: "eve:load-skill"
|
|
2192
2310
|
};
|
|
2193
|
-
case "tool-call":
|
|
2311
|
+
case "tool-call":
|
|
2312
|
+
case "workflow-tool-call": return {
|
|
2194
2313
|
kind: "tool-call",
|
|
2195
2314
|
name: action.toolName,
|
|
2196
2315
|
toolName: action.toolName
|
|
@@ -2285,11 +2404,51 @@ function removeStreamingToolPartsForTurn(data, turnId) {
|
|
|
2285
2404
|
function optimisticUserMessageId(submissionId) {
|
|
2286
2405
|
return `optimistic:${submissionId}:user`;
|
|
2287
2406
|
}
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2407
|
+
|
|
2408
|
+
//#endregion
|
|
2409
|
+
//#region src/client/message-run-parts.ts
|
|
2410
|
+
function append(message, append) {
|
|
2411
|
+
const current = latestStreamingRun(message, append.type, append.stepIndex);
|
|
2412
|
+
return upsert(message, {
|
|
2413
|
+
state: "streaming",
|
|
2414
|
+
stepIndex: append.stepIndex,
|
|
2415
|
+
text: (current?.text ?? "") + append.delta,
|
|
2416
|
+
type: append.type
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
function latestStreamingRun(message, type, stepIndex) {
|
|
2420
|
+
for (let index = message.parts.length - 1; index >= 0; index -= 1) {
|
|
2421
|
+
const part = message.parts[index];
|
|
2422
|
+
if (part?.type === type && part.stepIndex === stepIndex) return part.state === "streaming" ? part : void 0;
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
function upsert(message, next) {
|
|
2426
|
+
let lastIndex = -1;
|
|
2427
|
+
for (let index = message.parts.length - 1; index >= 0; index -= 1) {
|
|
2428
|
+
const part = message.parts[index];
|
|
2429
|
+
if (part?.type === next.type && part.stepIndex === next.stepIndex) {
|
|
2430
|
+
lastIndex = index;
|
|
2431
|
+
break;
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
const parts = lastIndex !== -1 && message.parts[lastIndex].state === "streaming" ? [
|
|
2435
|
+
...message.parts.slice(0, lastIndex),
|
|
2436
|
+
next,
|
|
2437
|
+
...message.parts.slice(lastIndex + 1)
|
|
2438
|
+
] : [...message.parts, next];
|
|
2439
|
+
return {
|
|
2440
|
+
...message,
|
|
2441
|
+
metadata: {
|
|
2442
|
+
...message.metadata,
|
|
2443
|
+
status: next.type === "text" && next.state === "done" ? "complete" : "streaming"
|
|
2444
|
+
},
|
|
2445
|
+
parts
|
|
2446
|
+
};
|
|
2292
2447
|
}
|
|
2448
|
+
const messageRun = {
|
|
2449
|
+
append,
|
|
2450
|
+
upsert
|
|
2451
|
+
};
|
|
2293
2452
|
|
|
2294
2453
|
//#endregion
|
|
2295
2454
|
//#region src/client/message-reducer.ts
|
|
@@ -2349,13 +2508,12 @@ function reduceMessageData(data, event) {
|
|
|
2349
2508
|
role: "user"
|
|
2350
2509
|
});
|
|
2351
2510
|
case "step.started": return updateAssistantMessage(data, event.data.turnId, (message) => ensureStepStartPart(message, event.data.stepIndex));
|
|
2352
|
-
case "reasoning.appended": return updateAssistantMessage(data, event.data.turnId, (message) =>
|
|
2353
|
-
|
|
2511
|
+
case "reasoning.appended": return updateAssistantMessage(data, event.data.turnId, (message) => messageRun.append(ensureStepStartPart(message, event.data.stepIndex), {
|
|
2512
|
+
delta: event.data.reasoningDelta,
|
|
2354
2513
|
stepIndex: event.data.stepIndex,
|
|
2355
|
-
text: event.data.reasoningSoFar,
|
|
2356
2514
|
type: "reasoning"
|
|
2357
2515
|
}));
|
|
2358
|
-
case "reasoning.completed": return updateAssistantMessage(data, event.data.turnId, (message) =>
|
|
2516
|
+
case "reasoning.completed": return updateAssistantMessage(data, event.data.turnId, (message) => messageRun.upsert(ensureStepStartPart(message, event.data.stepIndex), {
|
|
2359
2517
|
state: "done",
|
|
2360
2518
|
stepIndex: event.data.stepIndex,
|
|
2361
2519
|
text: event.data.reasoning,
|
|
@@ -2364,11 +2522,9 @@ function reduceMessageData(data, event) {
|
|
|
2364
2522
|
case "action.input.appended": {
|
|
2365
2523
|
const existing = findToolPart(data, event.data.callId);
|
|
2366
2524
|
if (existing !== void 0 && existing.state !== "input-streaming") return data;
|
|
2367
|
-
const inputText = appendToolInputDelta(existing?.state === "input-streaming" ? existing.inputText : void 0, event.data.inputTextOffset, event.data.inputTextDelta);
|
|
2368
|
-
if (inputText === void 0) return data;
|
|
2369
2525
|
const nextPart = {
|
|
2370
2526
|
input: void 0,
|
|
2371
|
-
inputText,
|
|
2527
|
+
inputText: (existing?.state === "input-streaming" ? existing.inputText : "") + event.data.inputTextDelta,
|
|
2372
2528
|
state: "input-streaming",
|
|
2373
2529
|
stepIndex: event.data.stepIndex,
|
|
2374
2530
|
toolCallId: event.data.callId,
|
|
@@ -2509,15 +2665,14 @@ function reduceMessageData(data, event) {
|
|
|
2509
2665
|
}
|
|
2510
2666
|
case "authorization.required": return updateAssistantMessage(data, event.data.turnId, (message) => upsertPart(ensureStepStartPart(message, event.data.stepIndex), createAuthorizationRequiredPart(event)));
|
|
2511
2667
|
case "authorization.completed": return completeAuthorization(data, event);
|
|
2512
|
-
case "message.appended": return updateAssistantMessage(data, event.data.turnId, (message) =>
|
|
2513
|
-
|
|
2668
|
+
case "message.appended": return updateAssistantMessage(data, event.data.turnId, (message) => messageRun.append(ensureStepStartPart(message, event.data.stepIndex), {
|
|
2669
|
+
delta: event.data.messageDelta,
|
|
2514
2670
|
stepIndex: event.data.stepIndex,
|
|
2515
|
-
text: event.data.messageSoFar,
|
|
2516
2671
|
type: "text"
|
|
2517
2672
|
}));
|
|
2518
2673
|
case "message.completed": return updateAssistantMessage(data, event.data.turnId, (message) => {
|
|
2519
2674
|
if (event.data.message === null) return removeTextPart(message, event.data.stepIndex);
|
|
2520
|
-
return
|
|
2675
|
+
return messageRun.upsert(ensureStepStartPart(message, event.data.stepIndex), {
|
|
2521
2676
|
state: "done",
|
|
2522
2677
|
stepIndex: event.data.stepIndex,
|
|
2523
2678
|
text: event.data.message,
|
|
@@ -2635,29 +2790,6 @@ function upsertPart(message, next) {
|
|
|
2635
2790
|
parts
|
|
2636
2791
|
};
|
|
2637
2792
|
}
|
|
2638
|
-
function upsertRun(message, next) {
|
|
2639
|
-
let lastIndex = -1;
|
|
2640
|
-
for (let index = message.parts.length - 1; index >= 0; index -= 1) {
|
|
2641
|
-
const part = message.parts[index];
|
|
2642
|
-
if (part?.type === next.type && part.stepIndex === next.stepIndex) {
|
|
2643
|
-
lastIndex = index;
|
|
2644
|
-
break;
|
|
2645
|
-
}
|
|
2646
|
-
}
|
|
2647
|
-
const parts = lastIndex !== -1 && message.parts[lastIndex].state === "streaming" ? [
|
|
2648
|
-
...message.parts.slice(0, lastIndex),
|
|
2649
|
-
next,
|
|
2650
|
-
...message.parts.slice(lastIndex + 1)
|
|
2651
|
-
] : [...message.parts, next];
|
|
2652
|
-
return {
|
|
2653
|
-
...message,
|
|
2654
|
-
metadata: {
|
|
2655
|
-
...message.metadata,
|
|
2656
|
-
status: next.type === "text" && next.state === "done" ? "complete" : "streaming"
|
|
2657
|
-
},
|
|
2658
|
-
parts
|
|
2659
|
-
};
|
|
2660
|
-
}
|
|
2661
2793
|
function removeTextPart(message, stepIndex) {
|
|
2662
2794
|
const parts = message.parts.filter((part) => part.type !== "text" || part.stepIndex !== stepIndex);
|
|
2663
2795
|
if (parts.length === message.parts.length) return message;
|