eve 0.55.0 → 0.57.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 +58 -0
- package/dist/src/channel/adapter-context.d.ts +1 -1
- package/dist/src/channel/adapter.d.ts +2 -2
- package/dist/src/channel/audience.d.ts +3 -3
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/conversation-context.d.ts +4 -2
- package/dist/src/channel/conversation-context.js +1 -1
- package/dist/src/channel/session.d.ts +4 -3
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +7 -4
- package/dist/src/chunks/{use-eve-agent-D-KQzzyW.js → use-eve-agent-C2APNCdP.js} +45 -22
- package/dist/src/chunks/{use-eve-agent-CxPlg0KL.js → use-eve-agent-D0YnDLi_.js} +45 -22
- package/dist/src/cli/commands/init.d.ts +2 -6
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-metadata.d.ts +0 -18
- package/dist/src/cli/commands/registry-metadata.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace-detail.js +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +3 -6
- package/dist/src/cli/dev/tui/blocks.js +3 -3
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/markdown.d.ts +8 -1
- package/dist/src/cli/dev/tui/markdown.js +7 -7
- package/dist/src/cli/dev/tui/message-queue.d.ts +11 -7
- package/dist/src/cli/dev/tui/message-queue.js +1 -1
- package/dist/src/cli/dev/tui/model-editor.d.ts +1 -1
- package/dist/src/cli/dev/tui/model-editor.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +0 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth-result.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth.js +1 -1
- package/dist/src/cli/dev/tui/remote-startup.d.ts +10 -0
- package/dist/src/cli/dev/tui/remote-startup.js +1 -0
- package/dist/src/cli/dev/tui/runner.d.ts +16 -19
- package/dist/src/cli/dev/tui/runner.js +3 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +7 -13
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-issues.d.ts +1 -1
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -17
- package/dist/src/cli/dev/tui/setup-panel.js +5 -6
- package/dist/src/cli/dev/tui/status-line.d.ts +1 -8
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/steering-stream.d.ts +15 -0
- package/dist/src/cli/dev/tui/steering-stream.js +1 -0
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +8 -3
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +2 -2
- package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +0 -2
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +4 -1
- package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -2
- package/dist/src/cli/dev/tui/vercel-status.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/cli/telemetry/index.d.ts +1 -1
- package/dist/src/cli/telemetry/index.js +1 -1
- package/dist/src/cli/ui/terminal-text.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +2 -57
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/eve-agent-store-state.d.ts +19 -0
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/ndjson.d.ts +2 -0
- package/dist/src/client/ndjson.js +3 -3
- package/dist/src/client/open-stream.d.ts +1 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -0
- package/dist/src/compiled/@workflow/core/runtime.js +2 -2
- package/dist/src/compiled/@workflow/core/serialization.js +1 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +2 -2
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DTFAjP0J.js +6 -0
- package/dist/src/compiled/_chunks/workflow/{dist-PLkAQ-U7.js → dist-C5KCXSdI.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{frames-BvATzM2t.js → frames-DJw9L4rO.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/global-DFW-hO6M.js +1 -0
- package/dist/src/compiled/_chunks/workflow/helpers-ClCA9Lmc.js +1 -0
- package/dist/src/compiled/_chunks/workflow/logger-D6vwIEf9.js +13 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-_baK8jaT.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-CRdL17z4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/serialization-CWYPL4Eq.js +3 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-DyIt9lEx.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-CVezyWwZ.js → ws-transport-Dl5FG4Sw.js} +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +27 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +12 -11
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +0 -3
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +5 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/audience.d.ts +2 -2
- package/dist/src/eve-channel/audience.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +4 -3
- package/dist/src/eve-channel/types.d.ts +5 -5
- package/dist/src/execution/activity-cohort.js +1 -1
- package/dist/src/execution/activity-collector.js +1 -1
- package/dist/src/execution/authorization-callback-match.d.ts +2 -1
- package/dist/src/execution/authorization-callback-match.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.d.ts +1 -1
- package/dist/src/execution/connections/callback-route.d.ts +1 -11
- package/dist/src/execution/connections/callback-route.js +1 -1
- package/dist/src/execution/continuation-conflict-step.d.ts +0 -1
- package/dist/src/execution/continuation-conflict-step.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +1 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.d.ts +2 -2
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.d.ts +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +10 -49
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +21 -0
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/schema.d.ts +36 -0
- package/dist/src/execution/dynamic-workflow/schema.js +1 -0
- package/dist/src/execution/dynamic-workflow/security-step.d.ts +3 -0
- package/dist/src/execution/dynamic-workflow/security-step.js +1 -0
- package/dist/src/execution/dynamic-workflow/tool.d.ts +8 -0
- package/dist/src/execution/dynamic-workflow/tool.js +1 -0
- package/dist/src/execution/dynamic-workflow/workflow.d.ts +10 -0
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -0
- package/dist/src/execution/eve-workflow-attributes.d.ts +2 -17
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/hook-ownership.d.ts +2 -4
- package/dist/src/execution/hook-ownership.js +1 -1
- package/dist/src/execution/legacy-session/authorization.d.ts +9 -0
- package/dist/src/execution/legacy-session/authorization.js +1 -0
- package/dist/src/execution/legacy-session/completion-step.d.ts +10 -0
- package/dist/src/execution/legacy-session/completion-step.js +1 -0
- package/dist/src/execution/legacy-session/inbox.d.ts +24 -0
- package/dist/src/execution/legacy-session/inbox.js +1 -0
- package/dist/src/execution/legacy-session/input.d.ts +19 -0
- package/dist/src/execution/legacy-session/input.js +1 -0
- package/dist/src/execution/legacy-session/interrupt-step.d.ts +3 -0
- package/dist/src/execution/legacy-session/interrupt-step.js +1 -0
- package/dist/src/execution/legacy-session/prepare-step.d.ts +24 -0
- package/dist/src/execution/legacy-session/prepare-step.js +1 -0
- package/dist/src/execution/legacy-session/snapshot.d.ts +12 -0
- package/dist/src/execution/legacy-session/snapshot.js +1 -0
- package/dist/src/execution/legacy-session/turn-workflow.d.ts +8 -0
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -0
- package/dist/src/execution/model-call-batching.d.ts +1 -0
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/node-step.d.ts +1 -5
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.d.ts +2 -20
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/reconcile-session-continuation-token.d.ts +1 -1
- package/dist/src/execution/report-dropped-wire-payload-step.d.ts +1 -1
- package/dist/src/execution/route-child-delivery.d.ts +2 -2
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/eve-image.js +1 -1
- package/dist/src/execution/session/accepted-deployment.d.ts +3 -0
- package/dist/src/execution/session/accepted-deployment.js +1 -0
- package/dist/src/execution/session/admission.d.ts +38 -0
- package/dist/src/execution/session/admission.js +1 -0
- package/dist/src/execution/session/entry-input.d.ts +42 -0
- package/dist/src/execution/session/entry-input.js +1 -0
- package/dist/src/execution/session/entry.d.ts +13 -0
- package/dist/src/execution/session/entry.js +1 -0
- package/dist/src/execution/session/event-sink.d.ts +31 -0
- package/dist/src/execution/session/event-sink.js +1 -0
- package/dist/src/execution/session/finalization.d.ts +33 -0
- package/dist/src/execution/session/finalization.js +1 -0
- package/dist/src/execution/session/handoff-steps.d.ts +22 -0
- package/dist/src/execution/session/handoff-steps.js +1 -0
- package/dist/src/execution/session/handoff.d.ts +69 -0
- package/dist/src/execution/session/handoff.js +1 -0
- package/dist/src/execution/session/hook-tokens.d.ts +11 -0
- package/dist/src/execution/session/hook-tokens.js +1 -0
- package/dist/src/execution/session/input-queue.d.ts +72 -0
- package/dist/src/execution/session/input-queue.js +1 -0
- package/dist/src/execution/session/next-input.d.ts +32 -0
- package/dist/src/execution/session/next-input.js +1 -0
- package/dist/src/execution/{pending-turn-state.d.ts → session/pending-turn-state.d.ts} +0 -1
- package/dist/src/execution/{pending-turn-state.js → session/pending-turn-state.js} +1 -1
- package/dist/src/execution/session/program.d.ts +47 -0
- package/dist/src/execution/session/program.js +1 -0
- package/dist/src/execution/session/route-selected-delivery.d.ts +9 -0
- package/dist/src/execution/session/route-selected-delivery.js +1 -0
- package/dist/src/execution/session/state-cursor.d.ts +31 -0
- package/dist/src/execution/session/state-cursor.js +1 -0
- package/dist/src/execution/{session-timeout-control.d.ts → session/timeout-control.d.ts} +1 -1
- package/dist/src/execution/session/timeout-control.js +1 -0
- package/dist/src/execution/{session-timeout-steps.d.ts → session/timeout-steps.d.ts} +3 -2
- package/dist/src/execution/session/timeout-steps.js +1 -0
- package/dist/src/execution/{session-timeout-workflow.d.ts → session/timeout-workflow.d.ts} +3 -1
- package/dist/src/execution/session/timeout-workflow.js +1 -0
- package/dist/src/execution/session/timeout.d.ts +3 -0
- package/dist/src/execution/session/timeout.js +1 -0
- package/dist/src/execution/session/turn-step-result.d.ts +4 -0
- package/dist/src/execution/session/turn-step-result.js +1 -0
- package/dist/src/execution/session/turn-step-types.d.ts +68 -0
- package/dist/src/execution/session/turn-step-types.js +1 -0
- package/dist/src/execution/{workflow-steps.d.ts → session/turn-step.d.ts} +1 -2
- package/dist/src/execution/session/turn-step.js +1 -0
- package/dist/src/execution/session/turn.d.ts +31 -0
- package/dist/src/execution/session/turn.js +1 -0
- package/dist/src/execution/session-inbox/address.d.ts +21 -0
- package/dist/src/execution/session-inbox/address.js +1 -0
- package/dist/src/execution/session-inbox/inbox.d.ts +54 -0
- package/dist/src/execution/session-inbox/inbox.js +1 -0
- package/dist/src/execution/session-inbox/protocol.d.ts +10 -0
- package/dist/src/execution/session-inbox/protocol.js +1 -0
- package/dist/src/execution/session-inbox/release-step.d.ts +5 -0
- package/dist/src/execution/session-inbox/release-step.js +1 -0
- package/dist/src/execution/session-inbox/resume.d.ts +21 -0
- package/dist/src/execution/session-inbox/resume.js +1 -0
- package/dist/src/execution/{turn-workflow-tool-run.d.ts → session-workflow-tool-run.d.ts} +2 -2
- package/dist/src/execution/session-workflow-tool-run.js +1 -0
- package/dist/src/execution/session.d.ts +0 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/skills/instructions.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-input-response-route.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +1 -1
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +7 -0
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.d.ts +1 -1
- package/dist/src/execution/terminal-session-event.d.ts +1 -1
- package/dist/src/execution/terminal-session-event.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.d.ts +1 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +1 -1
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -1
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +6 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +2 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
- package/dist/src/execution/tools/subagent/steer.d.ts +13 -0
- package/dist/src/execution/tools/subagent/steer.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +1 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +0 -9
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +0 -2
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +1 -1
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
- package/dist/src/execution/tools/workflow/messages.d.ts +0 -1
- package/dist/src/execution/tools/workflow/messages.js +1 -1
- package/dist/src/execution/tools/workflow/owner.d.ts +3 -1
- package/dist/src/execution/tools/workflow/owner.js +1 -1
- package/dist/src/execution/tools/workflow/resume-hook-step.d.ts +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +0 -1
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/tools/workflow/workflow.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +15 -18
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -3
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/authorization.d.ts +5 -37
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/emission-state.d.ts +1 -0
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/generation-steering.d.ts +22 -0
- package/dist/src/harness/generation-steering.js +1 -0
- package/dist/src/harness/messages.d.ts +1 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +1 -1
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
- package/dist/src/harness/semantic-errors/signals.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +2 -21
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/channel-delivery.js +1 -1
- package/dist/src/instrumentation/content.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +6 -7
- package/dist/src/instrumentation/native-events.d.ts +2 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/session-context.d.ts +2 -0
- package/dist/src/instrumentation/session-context.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +3 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -4
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/gateway.d.ts +1 -0
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/model-auth/api-key.d.ts +7 -0
- package/dist/src/internal/model-auth/api-key.js +1 -0
- package/dist/src/internal/model-auth/available-models.d.ts +2 -0
- package/dist/src/internal/model-auth/available-models.js +1 -0
- package/dist/src/internal/model-auth/development-broker-client.d.ts +3 -0
- package/dist/src/internal/model-auth/development-broker-client.js +1 -0
- package/dist/src/internal/model-auth/development-broker-protocol.d.ts +12 -0
- package/dist/src/internal/model-auth/development-broker-protocol.js +1 -0
- package/dist/src/internal/model-auth/development-broker-server.d.ts +4 -0
- package/dist/src/internal/model-auth/development-broker-server.js +1 -0
- package/dist/src/internal/model-auth/gateway-credential.d.ts +2 -0
- package/dist/src/internal/model-auth/gateway-credential.js +1 -0
- package/dist/src/internal/model-auth/store.d.ts +16 -0
- package/dist/src/internal/model-auth/store.js +1 -0
- package/dist/src/internal/model-auth/transport.d.ts +6 -0
- package/dist/src/internal/model-auth/transport.js +1 -0
- package/dist/src/internal/model-auth/vercel-cli.d.ts +7 -0
- package/dist/src/internal/model-auth/vercel-cli.js +1 -0
- package/dist/src/internal/model-auth/vercel-team.d.ts +3 -0
- package/dist/src/internal/model-auth/vercel-team.js +1 -0
- package/dist/src/internal/model-auth/vercel.d.ts +13 -0
- package/dist/src/internal/model-auth/vercel.js +1 -0
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -0
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
- package/dist/src/internal/vercel/api-resource.d.ts +4 -0
- package/dist/src/internal/vercel/api-resource.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
- package/dist/src/internal/vercel/vercel-services-config.d.ts +2 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +1 -1
- package/dist/src/internal/workflow/runtime.d.ts +1 -6
- package/dist/src/internal/workflow/runtime.js +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +4 -0
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -0
- package/dist/src/protocol/activity.js +1 -1
- package/dist/src/protocol/message.d.ts +8 -0
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/routes.d.ts +0 -2
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -2
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/audience.d.ts +2 -2
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/connections/index.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +2 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/models/anthropic/index.d.ts +3 -0
- package/dist/src/public/models/anthropic/index.js +1 -0
- package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -1
- package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -1
- package/dist/src/public/models/openai/chatgpt/oauth.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/models/openai/index.d.ts +4 -2
- package/dist/src/public/models/openai/index.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
- package/dist/src/public/tools/workflow.d.ts +1 -4
- package/dist/src/public/tools/workflow.js +1 -1
- package/dist/src/public/vercel/index.d.ts +2 -1
- package/dist/src/public/vercel/index.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +2 -4
- package/dist/src/runtime/connections/principal.d.ts +6 -6
- package/dist/src/runtime/connections/principal.js +1 -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/resolve-tool.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -9
- package/dist/src/self-modification/agent.js +1 -1
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -3
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +1 -7
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -1
- package/dist/src/self-modification/setup.d.ts +9 -3
- package/dist/src/self-modification/setup.js +2 -2
- package/dist/src/setup/cli/option-row.d.ts +2 -1
- package/dist/src/setup/cli/option-row.js +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +2 -0
- package/dist/src/setup/cli/prompt-ui.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +1 -1
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/chatgpt-auth.js +1 -1
- package/dist/src/setup/flows/deploy.d.ts +4 -9
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
- package/dist/src/setup/flows/install-vercel-cli.d.ts +2 -3
- package/dist/src/setup/flows/login.d.ts +3 -1
- package/dist/src/setup/flows/login.js +1 -1
- package/dist/src/setup/flows/model-login-connection.d.ts +36 -0
- package/dist/src/setup/flows/model-login-connection.js +1 -0
- package/dist/src/setup/flows/model-login-progress.d.ts +7 -0
- package/dist/src/setup/flows/model-login-progress.js +1 -0
- package/dist/src/setup/flows/model-login.d.ts +22 -0
- package/dist/src/setup/flows/model-login.js +1 -0
- package/dist/src/setup/flows/model-source-change.d.ts +7 -0
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/model.d.ts +6 -24
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +3 -19
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/flows/vercel-model-login.d.ts +5 -0
- package/dist/src/setup/flows/vercel-model-login.js +1 -0
- package/dist/src/setup/integrations/self-modification/setup.d.ts +2 -0
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/prompter.d.ts +3 -1
- package/dist/src/setup/provider-settings.d.ts +19 -6
- package/dist/src/setup/provider-settings.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +6 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/setup/with-spinner.d.ts +1 -1
- package/dist/src/setup/with-spinner.js +1 -1
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +6 -4
- package/dist/src/shared/channel-definition.d.ts +2 -2
- package/dist/src/shared/chatgpt-model.d.ts +2 -2
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/connection-types.d.ts +20 -7
- package/dist/src/shared/conversation-context.d.ts +15 -0
- package/dist/src/shared/model-connection.d.ts +17 -0
- package/dist/src/shared/model-connection.js +1 -0
- package/dist/src/shared/model-endpoint-status.d.ts +2 -1
- package/dist/src/shared/model-helper.d.ts +26 -0
- package/dist/src/shared/model-helper.js +1 -0
- package/dist/src/shared/package-version.d.ts +2 -0
- package/dist/src/shared/package-version.js +1 -0
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/shared/vercel-services.d.ts +1 -0
- package/dist/src/shared/vercel-services.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +18 -12
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/source-change/agent-config-ast.d.ts +6 -0
- package/dist/src/source-change/agent-config-ast.js +1 -1
- package/dist/src/source-change/apply-model-selection.d.ts +3 -1
- package/dist/src/source-change/apply-model-selection.js +1 -2
- package/dist/src/source-change/static-source-change.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/event-proxy-step.d.ts +3 -3
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/handle-dispatch.d.ts +12 -2
- package/dist/src/subagents/handle-dispatch.js +1 -1
- package/dist/src/subagents/handles/operation-id.d.ts +1 -1
- package/dist/src/subagents/handles/query.d.ts +0 -6
- package/dist/src/subagents/handles/query.js +1 -1
- package/dist/src/subagents/handles/state-key.d.ts +1 -1
- package/dist/src/subagents/handles/store.d.ts +1 -1
- package/dist/src/subagents/handles/store.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +1 -1
- package/dist/src/subagents/parent-notification.d.ts +2 -2
- package/dist/src/subagents/parent-result.d.ts +1 -1
- package/dist/src/subagents/remote-dispatch.d.ts +1 -1
- package/dist/src/subagents/remote-dispatch.js +1 -1
- package/dist/src/subagents/start-local.js +1 -1
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/session-index.d.ts +11 -0
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/types.d.ts +1 -1
- package/dist/src/tools/auth.d.ts +5 -6
- package/dist/src/tools/provided/workflow.d.ts +12 -0
- package/dist/src/tools/provided/workflow.js +1 -0
- package/dist/src/tools/workflow-program-input.d.ts +6 -0
- package/dist/src/tools/workflow-program-input.js +1 -0
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +2 -1
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-otel-usage.js +1 -1
- package/dist/src/tracing/agent-span-contract.d.ts +1 -0
- package/dist/src/tracing/agent-span-contract.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +2 -0
- package/dist/src/tracing/content-attributes.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +23 -23
- package/docs/channels/chat-sdk.mdx +11 -2
- package/docs/channels/custom.mdx +32 -16
- package/docs/channels/eve.mdx +21 -19
- package/docs/channels/linear.mdx +7 -3
- package/docs/channels/linq.mdx +1 -1
- package/docs/channels/overview.mdx +17 -2
- package/docs/channels/photon.mdx +4 -1
- package/docs/channels/slack.mdx +12 -2
- package/docs/concepts/execution-model-and-durability.mdx +62 -13
- package/docs/concepts/sessions-runs-and-streaming.md +14 -5
- package/docs/connections/mcp.mdx +4 -1
- package/docs/connections/openapi.mdx +8 -2
- package/docs/connections/overview.mdx +16 -13
- package/docs/getting-started.mdx +8 -4
- package/docs/guides/deployment/self-hosting.md +1 -1
- package/docs/guides/deployment/vercel.mdx +3 -3
- package/docs/guides/dev-tui.md +58 -31
- package/docs/guides/dynamic-capabilities.md +4 -4
- package/docs/guides/frontend/overview.mdx +3 -1
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation/meta.json +5 -0
- package/docs/guides/instrumentation/otel.mdx +149 -0
- package/docs/guides/instrumentation/overview.md +199 -0
- package/docs/guides/instrumentation/providers.mdx +169 -0
- package/docs/guides/meta.json +0 -1
- package/docs/guides/remote-agents.md +19 -21
- package/docs/install-integrations.mdx +2 -4
- package/docs/memory/custom-provider.md +1 -1
- package/docs/patterns/multi-tenant-auth.md +3 -3
- package/docs/protocols/acp.md +1 -1
- package/docs/reference/cli.md +16 -16
- package/docs/reference/telemetry.md +1 -1
- package/docs/reference/typescript-api.md +21 -14
- package/docs/sandbox.mdx +3 -3
- package/docs/subagents/index.mdx +4 -4
- package/docs/tools/workflows.mdx +57 -2
- package/docs/tutorial/how-it-runs.mdx +1 -1
- package/package.json +6 -1
- package/dist/src/cli/commands/init-repl.d.ts +0 -80
- package/dist/src/cli/commands/init-repl.js +0 -1
- package/dist/src/cli/commands/init-self-modification.d.ts +0 -7
- package/dist/src/cli/commands/init-self-modification.js +0 -1
- package/dist/src/cli/commands/registry-package.d.ts +0 -52
- package/dist/src/cli/commands/registry-package.js +0 -1
- package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +0 -12
- package/dist/src/cli/dev/tui/prompt-placeholder.js +0 -1
- package/dist/src/cli/dev/tui/remote-auth-command.d.ts +0 -11
- package/dist/src/cli/dev/tui/remote-auth-command.js +0 -3
- package/dist/src/compiled/_chunks/workflow/attribute-changes-BAcgmlXp.js +0 -20
- package/dist/src/compiled/_chunks/workflow/private-CFJkQA7R.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BEHe0Uut.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-ChHLjaCt.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-BB2HuVie.js +0 -1
- package/dist/src/execution/accepted-delivery-deployment.d.ts +0 -7
- package/dist/src/execution/accepted-delivery-deployment.js +0 -1
- package/dist/src/execution/dispatch-turn-step.d.ts +0 -5
- package/dist/src/execution/dispatch-turn-step.js +0 -1
- package/dist/src/execution/durable-session-migrations/chain.d.ts +0 -38
- package/dist/src/execution/durable-session-migrations/chain.js +0 -1
- package/dist/src/execution/durable-session-migrations/snapshot.d.ts +0 -6
- package/dist/src/execution/durable-session-migrations/snapshot.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.d.ts +0 -12
- package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +0 -2
- package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +0 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +0 -88
- package/dist/src/execution/durable-session-migrations/turn-workflow.js +0 -1
- package/dist/src/execution/forward-turn-cancellation-step.d.ts +0 -6
- package/dist/src/execution/forward-turn-cancellation-step.js +0 -1
- package/dist/src/execution/forward-turn-delivery-step.d.ts +0 -6
- package/dist/src/execution/forward-turn-delivery-step.js +0 -1
- package/dist/src/execution/inline-turn.d.ts +0 -31
- package/dist/src/execution/inline-turn.js +0 -1
- package/dist/src/execution/next-driver-action.d.ts +0 -93
- package/dist/src/execution/parked-delivery-wait.d.ts +0 -54
- package/dist/src/execution/parked-delivery-wait.js +0 -1
- package/dist/src/execution/session-command-inbox.d.ts +0 -52
- package/dist/src/execution/session-command-inbox.js +0 -1
- package/dist/src/execution/session-command-token.d.ts +0 -6
- package/dist/src/execution/session-command-token.js +0 -1
- package/dist/src/execution/session-state-cursor.d.ts +0 -25
- package/dist/src/execution/session-state-cursor.js +0 -1
- package/dist/src/execution/session-timeout-control.js +0 -1
- package/dist/src/execution/session-timeout-steps.js +0 -1
- package/dist/src/execution/session-timeout-workflow.js +0 -1
- package/dist/src/execution/session-timeout.d.ts +0 -2
- package/dist/src/execution/session-timeout.js +0 -1
- package/dist/src/execution/turn-cancellation-control.d.ts +0 -30
- package/dist/src/execution/turn-cancellation-control.js +0 -1
- package/dist/src/execution/turn-cancellation-token.d.ts +0 -10
- package/dist/src/execution/turn-cancellation-token.js +0 -1
- package/dist/src/execution/turn-control-protocol.d.ts +0 -36
- package/dist/src/execution/turn-control-protocol.js +0 -1
- package/dist/src/execution/turn-control-receiver.d.ts +0 -54
- package/dist/src/execution/turn-control-receiver.js +0 -1
- package/dist/src/execution/turn-dispatch.d.ts +0 -39
- package/dist/src/execution/turn-dispatch.js +0 -1
- package/dist/src/execution/turn-execution-cursor.d.ts +0 -49
- package/dist/src/execution/turn-execution-cursor.js +0 -1
- package/dist/src/execution/turn-workflow-tool-run.js +0 -1
- package/dist/src/execution/turn-workflow.d.ts +0 -13
- package/dist/src/execution/turn-workflow.js +0 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +0 -38
- package/dist/src/execution/wire/session-inbox-contract.js +0 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +0 -47
- package/dist/src/execution/wire/session-inbox-encoder.js +0 -1
- package/dist/src/execution/wire/session-inbox-resume.d.ts +0 -12
- package/dist/src/execution/wire/session-inbox-resume.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.d.ts +0 -29
- package/dist/src/execution/wire/session-inbox-wire.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v0.d.ts +0 -5
- package/dist/src/execution/wire/session-inbox-wire.v0.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.d.ts +0 -237
- package/dist/src/execution/wire/session-inbox-wire.v1.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
- package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2.d.ts +0 -478
- package/dist/src/execution/wire/session-inbox-wire.v2.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +0 -480
- package/dist/src/execution/wire/session-inbox-wire.v3.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +0 -267
- package/dist/src/execution/wire/session-inbox-wire.v4.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +0 -341
- package/dist/src/execution/wire/session-inbox-wire.v5.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +0 -3
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +0 -341
- package/dist/src/execution/wire/session-inbox-wire.v6.js +0 -1
- package/dist/src/execution/wire/session-inbox-wire.v7.d.ts +0 -342
- package/dist/src/execution/wire/session-inbox-wire.v7.js +0 -1
- package/dist/src/execution/workflow-entry-crash.d.ts +0 -39
- package/dist/src/execution/workflow-entry-crash.js +0 -1
- package/dist/src/execution/workflow-entry-finalization.d.ts +0 -28
- package/dist/src/execution/workflow-entry-finalization.js +0 -1
- package/dist/src/execution/workflow-entry.d.ts +0 -37
- package/dist/src/execution/workflow-entry.js +0 -1
- package/dist/src/execution/workflow-steps.js +0 -1
- package/dist/src/harness/workflow-continuation-security.d.ts +0 -5
- package/dist/src/harness/workflow-continuation-security.js +0 -1
- package/dist/src/harness/workflow-interrupt-state.d.ts +0 -20
- package/dist/src/harness/workflow-interrupt-state.js +0 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +0 -32
- package/dist/src/harness/workflow-lifecycle.js +0 -1
- package/dist/src/harness/workflow-sandbox.d.ts +0 -28
- package/dist/src/harness/workflow-sandbox.js +0 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +0 -28
- package/dist/src/harness/workflow-subagent-limit.js +0 -1
- package/dist/src/harness/workflow-task-state.d.ts +0 -9
- package/dist/src/harness/workflow-task-state.js +0 -1
- package/dist/src/harness/workflow-tool-description.d.ts +0 -22
- package/dist/src/harness/workflow-tool-description.js +0 -37
- package/dist/src/subagents/handles/rebase.d.ts +0 -4
- package/dist/src/subagents/handles/rebase.js +0 -1
- package/dist/src/tools/workflow.d.ts +0 -37
- package/dist/src/tools/workflow.js +0 -1
- package/docs/guides/instrumentation-providers.md +0 -249
- package/docs/guides/instrumentation.md +0 -453
- /package/dist/src/{execution/next-driver-action.js → client/eve-agent-store-state.js} +0 -0
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
export type ProviderSelection =
|
|
1
|
+
import { type ModelConnectionSelection } from "#shared/model-connection.js";
|
|
2
|
+
export type ProviderSelection = ModelConnectionSelection;
|
|
3
3
|
export declare function providerSettingsPath(appRoot: string): string;
|
|
4
4
|
export declare function resolveAvailableProviders(appRoot: string, options?: {
|
|
5
5
|
signal?: AbortSignal;
|
|
6
6
|
env?: Record<string, string | undefined>;
|
|
7
7
|
}): Promise<readonly ProviderSelection[]>;
|
|
8
8
|
export declare function readProviderSelection(appRoot: string): Promise<ProviderSelection | undefined>;
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export declare function readProviderSettingsSync(appRoot: string): ProviderSettings | undefined;
|
|
10
|
+
export interface ProviderSettings {
|
|
11
|
+
selected: ProviderSelection;
|
|
12
|
+
teamId?: string;
|
|
13
|
+
teamName?: string;
|
|
14
|
+
keySource?: "environment" | "secret";
|
|
15
|
+
}
|
|
16
|
+
export declare function providerSettingsMatch(appRoot: string, settings: ProviderSettings): Promise<boolean>;
|
|
17
|
+
export declare function writeProviderSelection(appRoot: string, selected: ProviderSelection, team?: {
|
|
18
|
+
teamId: string;
|
|
19
|
+
teamName: string;
|
|
20
|
+
}, keySource?: "environment" | "secret"): Promise<void>;
|
|
21
|
+
export declare function readProviderTeamSync(appRoot: string): {
|
|
22
|
+
teamId: string;
|
|
23
|
+
teamName: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
export declare function readProviderKeySourceSync(appRoot: string): "environment" | "secret" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir,readFile
|
|
1
|
+
import{mkdir,readFile}from"node:fs/promises";import{isObject}from"#shared/guards.js";import{join}from"node:path";import{readFileSync}from"node:fs";import{readProjectLink}from"#setup/project-resolution.js";import{hasEnvValue}from"#internal/resolve-model-endpoint-status.js";import{atomicWriteFile}from"#shared/atomic-write-file.js";import{isModelConnection}from"#shared/model-connection.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"#setup/ai-gateway-api-key.js";import{findEnvFileWithKey}from"#setup/boxes/detect-ai-gateway.js";function providerSettingsPath(e){return join(e,`.eve`,`provider.json`)}async function resolveAvailableProviders(e,t={}){let{signal:n,env:r=process.env}=t;n?.throwIfAborted();let[i,a,o]=await Promise.all([readProjectLink(e),findEnvFileWithKey(e,AI_GATEWAY_API_KEY_ENV_VAR),findEnvFileWithKey(e,`VERCEL_OIDC_TOKEN`)]);n?.throwIfAborted();let s=[`chatgpt`];return(a!==void 0||hasEnvValue(r[AI_GATEWAY_API_KEY_ENV_VAR]))&&s.push(`ai-gateway-key`),(i!==void 0||o!==void 0)&&s.push(`ai-gateway-project`),s}async function readProviderSelection(e){try{return parseProviderSelection(JSON.parse(await readFile(providerSettingsPath(e),`utf8`)))}catch{return}}function readProviderSettingsSync(e){try{let t=JSON.parse(readFileSync(providerSettingsPath(e),`utf8`));return!isObject(t)||!isProviderSelection(t.selected)?void 0:{selected:t.selected,...typeof t.teamId==`string`&&typeof t.teamName==`string`&&{teamId:t.teamId,teamName:t.teamName},...(t.keySource===`environment`||t.keySource===`secret`)&&{keySource:t.keySource}}}catch{return}}async function providerSettingsMatch(e,t){try{let n=JSON.parse(await readFile(providerSettingsPath(e),`utf8`));return isObject(n)&&n.selected===t.selected&&n.teamId===t.teamId&&n.teamName===t.teamName&&n.keySource===t.keySource}catch{return!1}}async function writeProviderSelection(e,t,n,r){await mkdir(join(e,`.eve`),{recursive:!0}),await atomicWriteFile(providerSettingsPath(e),`${JSON.stringify({selected:t,...n,keySource:r},null,2)}\n`)}function parseProviderSelection(e){return isObject(e)&&isProviderSelection(e.selected)?e.selected:void 0}function isProviderSelection(e){return isModelConnection(e)||e===`vercel-cli`||e===`ai-gateway-project`}function readProviderTeamSync(e){let t=readProviderSettingsSync(e);return t?.teamId&&t.teamName?{teamId:t.teamId,teamName:t.teamName}:void 0}function readProviderKeySourceSync(e){return readProviderSettingsSync(e)?.keySource}export{providerSettingsMatch,providerSettingsPath,readProviderKeySourceSync,readProviderSelection,readProviderSettingsSync,readProviderTeamSync,resolveAvailableProviders,writeProviderSelection};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.93`,DEFAULT_CONNECT_PACKAGE_VERSION=`1.0.0`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.93`,DEFAULT_CONNECT_PACKAGE_VERSION=`1.0.0`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.57.0`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e,t){return{"agent/agent.ts":renderAgentTemplate(e,t),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderAgentTemplate(e,t){let n=parseChatGptModelSelection(e);return n===void 0?BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t)):`import { defineAgent } from "eve";\nimport { chatgpt } from "eve/models/openai";\n\nexport default defineAgent({\n model: chatgpt(${JSON.stringify(n)}),\n${reasoningTemplateLine(t)}});\n`}function reasoningTemplateLine(e){return e===void 0||e===`provider-default`?``:` reasoning: "${e}",\n`}function renderTemplate(e,t){return e===BASE_AGENT_TEMPLATE&&parseChatGptModelSelection(t.model)!==void 0?renderAgentTemplate(t.model,t.reasoning):e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t.reasoning)).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -36,7 +36,11 @@ __EVE_INIT_REASONING__});
|
|
|
36
36
|
}
|
|
37
37
|
`,AGENT_INSTRUCTIONS_TEMPLATE=`# Identity
|
|
38
38
|
|
|
39
|
-
You are a
|
|
39
|
+
You are a general-purpose AI agent powered by eve, Vercel's agent framework.
|
|
40
|
+
|
|
41
|
+
# Customization
|
|
42
|
+
|
|
43
|
+
Your behavior and capabilities are defined by this project's code. You can be customized into whatever kind of agent the user wants by updating the project's instructions, tools, skills, connections, channels, subagents, and schedules.
|
|
40
44
|
`,SHARED_TEMPLATE_FILES={"README.md":`# __EVE_INIT_APP_NAME__
|
|
41
45
|
|
|
42
46
|
This is an [eve](https://eve.dev) agent bootstrapped with [\`eve init\`](https://eve.dev/docs/reference/cli#eve-init).
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Prompter } from "./prompter.js";
|
|
2
2
|
/** Runs asynchronous work behind an optional spinner that always stops. */
|
|
3
|
-
export declare function withSpinner<T>(prompter: Prompter, message: string, task: () => Promise<T
|
|
3
|
+
export declare function withSpinner<T>(prompter: Prompter, message: string, task: () => Promise<T>, delayMs?: number): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function withSpinner(e,t,n){let
|
|
1
|
+
async function withSpinner(e,t,n,r=0){let i,start=()=>{i=e.log.spinner?.(t)},a=r>0?setTimeout(start,r):void 0;a===void 0&&start();try{return await n()}finally{clearTimeout(a),i?.stop()}}export{withSpinner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";import{agentTurnOutcomeSchema,agentTurnOutcomeWithCostSchema}from"#shared/agent-turn-outcome.js";import{tokenUsageSchema,tokenUsageWithCostSchema}from"#shared/token-usage.js";const runtimeToolCallActionRequestSchema=z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`tool-call`),toolName:z.string()}).strict(),runtimeSubagentCallActionRequestSchema=z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict(),runtimeRemoteAgentCallActionRequestSchema=z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),runtimeWorkflowToolCallActionRequestSchema=z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`workflow-tool-call`),toolName:z.string(),workflowId:z.string()}).strict();z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict();const runtimeRemoteAgentDispatchRequestSchema=z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),runtimeWorkflowTaskRequestSchema=z.object({callId:z.string(),executeInput:jsonValueSchema.optional(),input:jsonObjectSchema,kind:z.literal(`workflow-task`),nodeId:z.string().optional(),resultKind:z.enum([`subagent`,`tool`]).optional(),toolName:z.string(),workflowId:z.string()}).strict(),runtimeLoadSkillActionRequestSchema=z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`load-skill`)}).strict(),RUNTIME_WORKFLOW_TOOL_ACTION=Symbol.for(`eve:runtime-workflow-tool-action`);function markRuntimeWorkflowToolAction(e){return Object.defineProperty(e,RUNTIME_WORKFLOW_TOOL_ACTION,{value:!0}),e}function isRuntimeWorkflowToolAction(e){return e.kind===`workflow-tool-call`||e.kind===`tool-call`&&Reflect.get(e,RUNTIME_WORKFLOW_TOOL_ACTION)===!0}const runtimeActionRequestSchema=z.discriminatedUnion(`kind`,[runtimeLoadSkillActionRequestSchema,runtimeRemoteAgentCallActionRequestSchema,runtimeSubagentCallActionRequestSchema,runtimeToolCallActionRequestSchema,runtimeWorkflowToolCallActionRequestSchema]);z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`tool-result`),output:jsonValueSchema,toolName:z.string()}).strict();const runtimeSubagentChildResultFields={backgroundTask:z.strictObject({status:z.literal(`working`),taskId:z.string()}).optional(),callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`subagent-result`),origin:z.literal(`child`),output:jsonValueSchema,subagentName:z.string()},runtimeSubagentChildResultSchema=z.object({backgroundTask:z.strictObject({status:z.literal(`working`),taskId:z.string()}).optional(),callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`subagent-result`),origin:z.literal(`child`),outcome:agentTurnOutcomeSchema,output:jsonValueSchema,subagentName:z.string(),usage:tokenUsageSchema.optional()}).strict(),runtimeSubagentChildResultWithCostSchema=z.object({...runtimeSubagentChildResultFields,outcome:agentTurnOutcomeWithCostSchema,usage:tokenUsageWithCostSchema.optional()}).strict();z.object({callId:z.string(),isError:z.literal(!0),kind:z.literal(`subagent-result`),origin:z.literal(`dispatch`),output:jsonValueSchema,subagentName:z.string()}).strict(),z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`load-skill-result`),output:jsonValueSchema,name:z.string().optional()}).strict();export{isRuntimeWorkflowToolAction,markRuntimeWorkflowToolAction,runtimeActionRequestSchema,runtimeRemoteAgentCallActionRequestSchema,runtimeRemoteAgentDispatchRequestSchema,runtimeSubagentChildResultSchema,runtimeSubagentChildResultWithCostSchema,runtimeToolCallActionRequestSchema,runtimeWorkflowTaskRequestSchema};
|
|
@@ -119,10 +119,11 @@ export interface PublicAgentCompactionDefinition {
|
|
|
119
119
|
*/
|
|
120
120
|
export interface AgentLimitsDefinition {
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
122
|
+
* Session lifetime from creation or the latest ownership handoff, in milliseconds.
|
|
123
123
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
124
|
+
* A successful deployment handoff or legacy-session import restarts the
|
|
125
|
+
* original configured duration. Process restarts and failed or skipped
|
|
126
|
+
* handoffs preserve the deadline. If it elapses during an active turn, eve lets
|
|
126
127
|
* that turn settle before completing the session normally.
|
|
127
128
|
*
|
|
128
129
|
* `false` disables the timeout.
|
|
@@ -255,7 +256,8 @@ export interface AgentWorkflowDefinition {
|
|
|
255
256
|
readonly modelCallsPerStep?: number;
|
|
256
257
|
/**
|
|
257
258
|
* How long the agent's run data is kept after the run finishes.
|
|
258
|
-
* Applied to
|
|
259
|
+
* Applied to every run that owns the session, including successors created
|
|
260
|
+
* by deployment handoff.
|
|
259
261
|
*
|
|
260
262
|
* - `"default"`: same as omission. The Workflow SDK World decides.
|
|
261
263
|
* On Vercel this follows your team's plan.
|
|
@@ -5,7 +5,7 @@ import type { RouteDefinition } from "#channel/routes.js";
|
|
|
5
5
|
import type { Session, SessionHandle } from "#channel/session.js";
|
|
6
6
|
import type { DeliverPayload, SessionAuthContext, TurnPolicy } from "#channel/types.js";
|
|
7
7
|
import type { StepInput } from "#harness/types.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type { AudienceContext } from "#shared/conversation-context.js";
|
|
9
9
|
import type { ChannelAudience } from "#shared/channel-audience.js";
|
|
10
10
|
/**
|
|
11
11
|
* Enriched return shape from a channel's {@link ChannelAdapter.fetchFile}
|
|
@@ -95,7 +95,7 @@ export interface GenericChannelDefinition<TEvents, TState = undefined, TCtx = vo
|
|
|
95
95
|
* and deployment environment. Return `"unknown"` when classification is not
|
|
96
96
|
* confident; consumers treat it as non-public.
|
|
97
97
|
*/
|
|
98
|
-
readonly audience?: (input:
|
|
98
|
+
readonly audience?: (input: AudienceContext<TState>) => ChannelAudience;
|
|
99
99
|
/**
|
|
100
100
|
* Identifier of the adapter family this channel belongs to. Set by
|
|
101
101
|
* higher-level wrappers (e.g. `slackChannel` passes `"slack"`) so downstream
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModelRouting } from "./agent-definition.js";
|
|
2
|
-
export declare const DEFAULT_CHATGPT_MODEL_ID = "gpt-5.6-
|
|
2
|
+
export declare const DEFAULT_CHATGPT_MODEL_ID = "gpt-5.6-luna-fast";
|
|
3
3
|
export declare const CHATGPT_MODEL_SELECTION_PREFIX = "chatgpt/";
|
|
4
|
-
export declare const DEFAULT_CHATGPT_MODEL_SELECTION = "chatgpt/gpt-5.6-
|
|
4
|
+
export declare const DEFAULT_CHATGPT_MODEL_SELECTION = "chatgpt/gpt-5.6-luna-fast";
|
|
5
5
|
/** Returns the bare OpenAI model id encoded by a setup-facing ChatGPT selection. */
|
|
6
6
|
export declare function parseChatGptModelSelection(selection: string): string | undefined;
|
|
7
7
|
export declare function isChatGptModelRouting(routing: ModelRouting | null | undefined): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const DEFAULT_CHATGPT_MODEL_ID=`gpt-5.6-
|
|
1
|
+
const DEFAULT_CHATGPT_MODEL_ID=`gpt-5.6-luna-fast`,CHATGPT_MODEL_SELECTION_PREFIX=`chatgpt/`,DEFAULT_CHATGPT_MODEL_SELECTION=`${CHATGPT_MODEL_SELECTION_PREFIX}${DEFAULT_CHATGPT_MODEL_ID}`;function parseChatGptModelSelection(e){if(!e.startsWith(`chatgpt/`))return;let t=e.slice(8);return isBareChatGptModelId(t)?t:void 0}function isChatGptModelRouting(e){return e?.kind===`external`&&e.provider===`codex`}function normalizeChatGptModelId(e){let t=e.trim(),n=t.startsWith(`openai/`)?t.slice(7):t;return isBareChatGptModelId(n)?n:void 0}function isBareChatGptModelId(e){return e.length>0&&e===e.trim()&&!e.includes(`/`)}export{CHATGPT_MODEL_SELECTION_PREFIX,DEFAULT_CHATGPT_MODEL_ID,DEFAULT_CHATGPT_MODEL_SELECTION,isChatGptModelRouting,normalizeChatGptModelId,parseChatGptModelSelection};
|
|
@@ -148,18 +148,31 @@ export interface ConnectionAuthorizationContext {
|
|
|
148
148
|
* guaranteed JSON-serializable.
|
|
149
149
|
*/
|
|
150
150
|
export type AuthorizationDefinition<Resume extends JsonValue = JsonValue> = NonInteractiveAuthorizationDefinition | InteractiveAuthorizationDefinition<Resume>;
|
|
151
|
+
/** Declares whether a connection credential belongs to the agent or end user. */
|
|
152
|
+
export type CredentialOwner = "app" | "user";
|
|
153
|
+
type NonInteractiveCredentialOwner = {
|
|
154
|
+
readonly credentialOwner?: CredentialOwner;
|
|
155
|
+
readonly principalType?: never;
|
|
156
|
+
} | {
|
|
157
|
+
readonly credentialOwner?: never;
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated Use `credentialOwner` for connection credential ownership.
|
|
160
|
+
* Session auth continues to use `principalType`.
|
|
161
|
+
*/
|
|
162
|
+
readonly principalType?: CredentialOwner;
|
|
163
|
+
};
|
|
151
164
|
/**
|
|
152
165
|
* Auth provider returned directly from or resolved by a connection's `auth`
|
|
153
166
|
* field.
|
|
154
167
|
*
|
|
155
168
|
* Identical to {@link AuthorizationDefinition} except the
|
|
156
|
-
* non-interactive form may omit `
|
|
157
|
-
* defaults it to `"app"`.
|
|
169
|
+
* non-interactive form may omit `credentialOwner`; normalization
|
|
170
|
+
* defaults it to `"app"`. Its legacy `principalType` remains supported
|
|
171
|
+
* and deprecated for compatibility. Interactive definitions continue to
|
|
172
|
+
* use `principalType: "user"`. The resolved token is sent as
|
|
158
173
|
* `Authorization: Bearer <token>`.
|
|
159
174
|
*/
|
|
160
|
-
export type ConnectionAuthProvider = (Omit<NonInteractiveAuthorizationDefinition, "principalType"> &
|
|
161
|
-
readonly principalType?: NonInteractiveAuthorizationDefinition["principalType"];
|
|
162
|
-
}) | AuthorizationDefinition;
|
|
175
|
+
export type ConnectionAuthProvider = (Omit<NonInteractiveAuthorizationDefinition, "principalType"> & NonInteractiveCredentialOwner) | AuthorizationDefinition;
|
|
163
176
|
/**
|
|
164
177
|
* Resolves a connection auth provider from the active turn.
|
|
165
178
|
*
|
|
@@ -191,8 +204,8 @@ interface AuthorizationDefinitionBase {
|
|
|
191
204
|
* - `"user"`: the framework projects the active session's user
|
|
192
205
|
* principal into `{ type: "user", id, issuer, ... }` and fails
|
|
193
206
|
* fast with `reason: "principal_required"` when the session has
|
|
194
|
-
* no authenticated user. The token cache keys on
|
|
195
|
-
*
|
|
207
|
+
* no authenticated user. The token cache keys on a JSON tuple of
|
|
208
|
+
* the issuer and id so concurrent users never share tokens.
|
|
196
209
|
*/
|
|
197
210
|
readonly principalType: "app" | "user";
|
|
198
211
|
/**
|
|
@@ -19,13 +19,28 @@ export interface AudiencePrincipal {
|
|
|
19
19
|
readonly authenticator: string;
|
|
20
20
|
readonly attributes: Readonly<Record<string, string | readonly string[]>>;
|
|
21
21
|
}
|
|
22
|
+
export type AudienceCaller = {
|
|
23
|
+
readonly type: "anonymous";
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: "principal";
|
|
26
|
+
readonly principal: {
|
|
27
|
+
readonly kind: string;
|
|
28
|
+
readonly authenticator: string;
|
|
29
|
+
readonly attributes: Readonly<Record<string, string | readonly string[]>>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
22
32
|
export interface AudienceInput<TState> {
|
|
23
33
|
readonly state: TState;
|
|
34
|
+
/** @deprecated Use `caller`; it excludes `principalId`, `issuer`, and `subject`. */
|
|
24
35
|
readonly auth: AudiencePrincipal | null;
|
|
25
36
|
readonly channel: ConversationContext["channel"];
|
|
26
37
|
readonly mode: RunMode;
|
|
27
38
|
readonly environment: ConversationEnvironment;
|
|
28
39
|
}
|
|
40
|
+
/** Preferred input type for new audience callback annotations. */
|
|
41
|
+
export interface AudienceContext<TState> extends AudienceInput<TState> {
|
|
42
|
+
readonly caller: AudienceCaller;
|
|
43
|
+
}
|
|
29
44
|
/** Safe projection for durable sessions created before `eve.conversation` existed. */
|
|
30
45
|
export declare const UNKNOWN_CONVERSATION_CONTEXT: ConversationContext;
|
|
31
46
|
export interface ConversationContextFallback {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ModelRouting } from "./agent-definition.js";
|
|
2
|
+
import type { ModelEndpointStatus } from "./model-endpoint-status.js";
|
|
3
|
+
export declare const CONNECTIONS: readonly ["chatgpt", "vercel", "ai-gateway-key", "openai", "anthropic"];
|
|
4
|
+
export type ModelConnection = (typeof CONNECTIONS)[number];
|
|
5
|
+
export type ModelConnectionSelection = ModelConnection | "ai-gateway-project" | "vercel-cli";
|
|
6
|
+
export declare function isModelConnection(value: unknown): value is ModelConnection;
|
|
7
|
+
export interface ConnectedModel {
|
|
8
|
+
id: string;
|
|
9
|
+
routing: ModelRouting;
|
|
10
|
+
endpoint: ModelEndpointStatus;
|
|
11
|
+
}
|
|
12
|
+
/** Whether a completed connection or model edit still needs runtime activation. */
|
|
13
|
+
export interface ModelAccessChange {
|
|
14
|
+
kind: "model-access-changed";
|
|
15
|
+
reload: boolean;
|
|
16
|
+
model?: ConnectedModel;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const CONNECTIONS=[`chatgpt`,`vercel`,`ai-gateway-key`,`openai`,`anthropic`];function isModelConnection(e){return CONNECTIONS.some(t=>t===e)}export{CONNECTIONS,isModelConnection};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const MODEL_CONNECTION_ENV = "EVE_MODEL_CONNECTION";
|
|
2
|
+
export declare const MODEL_HELPERS: {
|
|
3
|
+
readonly chatgpt: {
|
|
4
|
+
readonly module: "eve/models/openai";
|
|
5
|
+
readonly prefix: "chatgpt/";
|
|
6
|
+
readonly defaultModel: "gpt-5.6-luna-fast";
|
|
7
|
+
readonly provider: "codex";
|
|
8
|
+
};
|
|
9
|
+
readonly openai: {
|
|
10
|
+
readonly module: "eve/models/openai";
|
|
11
|
+
readonly prefix: "openai-api/";
|
|
12
|
+
readonly defaultModel: "gpt-5.6-luna-fast";
|
|
13
|
+
readonly provider: "openai";
|
|
14
|
+
};
|
|
15
|
+
readonly anthropic: {
|
|
16
|
+
readonly module: "eve/models/anthropic";
|
|
17
|
+
readonly prefix: "anthropic-api/";
|
|
18
|
+
readonly defaultModel: "claude-sonnet-5";
|
|
19
|
+
readonly provider: "anthropic";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type ModelHelper = keyof typeof MODEL_HELPERS;
|
|
23
|
+
export declare function parseModelHelper(selection: string): {
|
|
24
|
+
helper: ModelHelper;
|
|
25
|
+
id: string;
|
|
26
|
+
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const MODEL_CONNECTION_ENV=`EVE_MODEL_CONNECTION`,MODEL_HELPERS={chatgpt:{module:`eve/models/openai`,prefix:`chatgpt/`,defaultModel:`gpt-5.6-luna-fast`,provider:`codex`},openai:{module:`eve/models/openai`,prefix:`openai-api/`,defaultModel:`gpt-5.6-luna-fast`,provider:`openai`},anthropic:{module:`eve/models/anthropic`,prefix:`anthropic-api/`,defaultModel:`claude-sonnet-5`,provider:`anthropic`}};function parseModelHelper(e){for(let t of Object.keys(MODEL_HELPERS)){let{prefix:n}=MODEL_HELPERS[t];if(e.startsWith(n)){let r=e.slice(n.length);if(r&&r===r.trim()&&!r.includes(`/`))return{helper:t,id:r}}}}export{MODEL_CONNECTION_ENV,MODEL_HELPERS,parseModelHelper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function stripVersionBuildMetadata(e){return e.split(`+`,1)[0]}export{stripVersionBuildMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function validateAuthorizationSpec(e,t=`auth`){if(typeof e!=`object`||!e)return`The "${t}" field must be an object with a "getToken" method.`;let n=e;if(typeof n.getToken!=`function`)return`The "${t}.getToken" field must be a function returning Promise<{ token }>.`;let r=n.startAuthorization!==void 0,i=n.completeAuthorization!==void 0;if(
|
|
1
|
+
function validateAuthorizationSpec(e,t=`auth`){if(typeof e!=`object`||!e)return`The "${t}" field must be an object with a "getToken" method.`;let n=e;if(typeof n.getToken!=`function`)return`The "${t}.getToken" field must be a function returning Promise<{ token }>.`;let r=n.startAuthorization!==void 0,i=n.completeAuthorization!==void 0,a=n.credentialOwner!==void 0,o=n.principalType!==void 0;if(a&&o)return`The "${t}" field must not provide both "credentialOwner" and "principalType".`;let s=a?`credentialOwner`:`principalType`,c=a?n.credentialOwner:n.principalType;if(c!==void 0&&c!==`app`&&c!==`user`)return`The "${t}.${s}" field must be "app" or "user".`;if(r!==i)return`The "${t}" field must provide either both "startAuthorization" and "completeAuthorization" (interactive OAuth) or neither (getToken-only). Got only "${r?`startAuthorization`:`completeAuthorization`}".`;if(r&&typeof n.startAuthorization!=`function`)return`The "${t}.startAuthorization" field must be a function when provided.`;if(i&&typeof n.completeAuthorization!=`function`)return`The "${t}.completeAuthorization" field must be a function when provided.`;if(r&&a)return`The "${t}.credentialOwner" field is only supported by getToken-only authorization. Interactive authorization is restricted to "principalType": "user" in v1.`;if(r&&n.principalType!==`user`)return`Interactive authorization (startAuthorization + completeAuthorization) is restricted to "principalType": "user" in v1. App-level credentials must use a getToken-only definition.`;if(n.displayName!==void 0&&(typeof n.displayName!=`string`||n.displayName.length===0))return`The "${t}.displayName" field must be a non-empty string when provided.`}function normalizeAuthorizationSpec(e,t,n=`auth`){let r=validateAuthorizationSpec(e,n);if(r!==void 0)throw Error(`${t} ${r}`);let i=e,a=extractVercelConnectMarker(i.vercelConnect),o=i.displayName,s=typeof i.evict==`function`?i.evict:void 0;if(i.startAuthorization!==void 0&&i.completeAuthorization!==void 0){let e={completeAuthorization:i.completeAuthorization,getToken:i.getToken,principalType:`user`,startAuthorization:i.startAuthorization};return a!==void 0&&(e={...e,vercelConnect:a}),o!==void 0&&(e={...e,displayName:o}),s!==void 0&&(e={...e,evict:s}),e}let c={getToken:i.getToken,principalType:i.credentialOwner??i.principalType??`app`};return a!==void 0&&(c={...c,vercelConnect:a}),o!==void 0&&(c={...c,displayName:o}),s!==void 0&&(c={...c,evict:s}),c}function extractVercelConnectMarker(e){if(typeof e!=`object`||!e)return;let t=e.connector;if(typeof t==`string`&&t.length!==0)return{connector:t}}export{normalizeAuthorizationSpec,validateAuthorizationSpec};
|
|
@@ -45,6 +45,7 @@ export type EveVercelServiceRequestPathRoute = {
|
|
|
45
45
|
export type EveVercelGeneratedService = {
|
|
46
46
|
readonly buildCommand: string;
|
|
47
47
|
readonly framework: "eve";
|
|
48
|
+
readonly outputDirectory: ".vercel/output";
|
|
48
49
|
readonly routes: readonly VercelRouteConfig[];
|
|
49
50
|
readonly root: string;
|
|
50
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir,readFile}from"node:fs/promises";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{dirname,join,relative}from"node:path";import{EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV,EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV}from"#internal/application/paths.js";import{shellQuote}from"#shared/shell-quote.js";import{findClosestLinkedVercelDirectory}from"#shared/vercel-output-directory.js";import{resolveEveBinaryPath}from"#shared/resolve-eve-binary.js";const VERCEL_JSON_FILE_NAME=`vercel.json`,EVE_SERVICE_ROUTE_SRC=`^${EVE_ROUTE_PREFIX}/(.*)$`,EVE_SERVICE_ROUTE_PATH=`${EVE_ROUTE_PREFIX}/$1`;function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function toPosixRelative(e,t){let n=relative(e,t);return n.length===0?`.`:n.replaceAll(`\\`,`/`)}function isNamedServiceConfigArray(e){return Array.isArray(e)}function createServiceConfigRecord(e){if(e===void 0)return{};if(isNamedServiceConfigArray(e)){let t={};for(let n of e)if(typeof n.name==`string`&&n.name.trim().length>0){let{name:e,...r}=n;t[e]=r}return t}return e}function normalizeVercelJsonConfig(e){if(!isRecord(e))throw Error(`${VERCEL_JSON_FILE_NAME} must contain a JSON object.`);let t=e.services;if(t!==void 0&&!isRecord(t)&&!(Array.isArray(t)&&t.every(e=>isRecord(e)&&typeof e.name==`string`&&e.name.trim().length>0)))throw Error(`${VERCEL_JSON_FILE_NAME} services must be a JSON object or named service array.`);return e}async function readVercelJsonConfig(e){try{return normalizeVercelJsonConfig(JSON.parse(await readFile(e,`utf8`)))}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return{};throw e}}function findEveService(e){return Object.values(e).find(e=>e.framework===`eve`)}function assertRootServicesIncludeEve(e,t){if(findEveService(e)===void 0)throw Error(`${VERCEL_JSON_FILE_NAME} already defines services, so the eve ${t} integration cannot add a generated eve service. Add an eve service (framework "eve") and a rewrite from ${EVE_ROUTE_PREFIX}/(.*) to it in ${VERCEL_JSON_FILE_NAME}, or remove services from ${VERCEL_JSON_FILE_NAME}.`)}function createEveServiceRoute(e=`eve`){return{destination:{service:e,type:`service`},src:EVE_SERVICE_ROUTE_SRC}}function createEveServiceRequestPathRoute(){return{src:EVE_SERVICE_ROUTE_SRC,transforms:[{args:EVE_SERVICE_ROUTE_PATH,op:`set`,type:`request.path`}]}}function isEveServiceRoute(e,t){let n=e.destination;return e.src===EVE_SERVICE_ROUTE_SRC&&isRecord(n)&&n.type===`service`&&n.service===t}function insertEveServiceRoute(e,t){let n=e.filter(e=>!(isRecord(e)&&isEveServiceRoute(e,t))),r=n.findIndex(e=>isRecord(e)&&e.handle===`filesystem`);return r===-1?[createEveServiceRoute(t),...n]:[...n.slice(0,r),createEveServiceRoute(t),...n.slice(r)]}function insertEveServiceRequestPathRoute(e){let t=(e??[]).filter(e=>e.src!==EVE_SERVICE_ROUTE_SRC);return[createEveServiceRequestPathRoute(),...t]}function createGeneratedServiceBuild(e){let t=join(e.hostRoot,`.eve/vercel-services`,`eve`),n=join(t,`.vercel`,`output`),r=join(e.hostRoot,`.vercel`,`output`),i=toPosixRelative(t,e.appRoot),a=toPosixRelative(e.appRoot,n),o=toPosixRelative(e.appRoot,r),s=e.eveBuildCommand??`node ${shellQuote(toPosixRelative(e.appRoot,resolveEveBinaryPath(e.hostRoot)))} build`;return{buildCommand:`cd ${shellQuote(i)} && export ${EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV}=${shellQuote(a)} && export ${EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV}=${shellQuote(o)} && ${s}`,root:toPosixRelative(e.hostRoot,t),rootDirectory:t}}async function ensureEveVercelServicesConfig(e){let t=await findClosestLinkedVercelDirectory(e.hostRoot),n=t===void 0?e.hostRoot:dirname(t),r=await readVercelJsonConfig(join(e.hostRoot,VERCEL_JSON_FILE_NAME)),i=n===e.hostRoot||Object.keys(createServiceConfigRecord(r.services)).length>0?r:await readVercelJsonConfig(join(n,VERCEL_JSON_FILE_NAME)),a=createServiceConfigRecord(i.services);if(Object.keys(a).length>0)return assertRootServicesIncludeEve(a,e.frameworkName),{mode:`root`};i.experimentalServices!==void 0&&console.warn(`[eve] ${VERCEL_JSON_FILE_NAME} defines experimentalServices, which Vercel no longer routes. The eve ${e.frameworkName} integration now generates the stable services config automatically — remove experimentalServices from ${VERCEL_JSON_FILE_NAME}.`);let o=createGeneratedServiceBuild(e);return await mkdir(o.rootDirectory,{recursive:!0}),{mode:`generated`,services:{eve:{buildCommand:o.buildCommand,framework:`eve`,routes:[createEveServiceRequestPathRoute()],root:o.root}}}}function mergeEveVercelConfig(e,t){let n=e?.services??{},r=Object.entries(n).find(([e,t])=>e===`eve`||t.framework===`eve`),i=r?.[0]??`eve`,a=r?{...n,[i]:{...r[1],routes:insertEveServiceRequestPathRoute(r[1].routes)}}:{...n,...t.services};return{version:3,...e,routes:insertEveServiceRoute(e?.routes??[],i),services:a}}export{createEveServiceRequestPathRoute,createEveServiceRoute,ensureEveVercelServicesConfig,mergeEveVercelConfig};
|
|
1
|
+
import{mkdir,readFile}from"node:fs/promises";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{dirname,join,relative}from"node:path";import{EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV,EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV}from"#internal/application/paths.js";import{shellQuote}from"#shared/shell-quote.js";import{findClosestLinkedVercelDirectory}from"#shared/vercel-output-directory.js";import{resolveEveBinaryPath}from"#shared/resolve-eve-binary.js";const VERCEL_JSON_FILE_NAME=`vercel.json`,EVE_SERVICE_ROUTE_SRC=`^${EVE_ROUTE_PREFIX}/(.*)$`,EVE_SERVICE_ROUTE_PATH=`${EVE_ROUTE_PREFIX}/$1`;function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function toPosixRelative(e,t){let n=relative(e,t);return n.length===0?`.`:n.replaceAll(`\\`,`/`)}function isNamedServiceConfigArray(e){return Array.isArray(e)}function createServiceConfigRecord(e){if(e===void 0)return{};if(isNamedServiceConfigArray(e)){let t={};for(let n of e)if(typeof n.name==`string`&&n.name.trim().length>0){let{name:e,...r}=n;t[e]=r}return t}return e}function normalizeVercelJsonConfig(e){if(!isRecord(e))throw Error(`${VERCEL_JSON_FILE_NAME} must contain a JSON object.`);let t=e.services;if(t!==void 0&&!isRecord(t)&&!(Array.isArray(t)&&t.every(e=>isRecord(e)&&typeof e.name==`string`&&e.name.trim().length>0)))throw Error(`${VERCEL_JSON_FILE_NAME} services must be a JSON object or named service array.`);return e}async function readVercelJsonConfig(e){try{return normalizeVercelJsonConfig(JSON.parse(await readFile(e,`utf8`)))}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return{};throw e}}function findEveService(e){return Object.values(e).find(e=>e.framework===`eve`)}function assertRootServicesIncludeEve(e,t){if(findEveService(e)===void 0)throw Error(`${VERCEL_JSON_FILE_NAME} already defines services, so the eve ${t} integration cannot add a generated eve service. Add an eve service (framework "eve") and a rewrite from ${EVE_ROUTE_PREFIX}/(.*) to it in ${VERCEL_JSON_FILE_NAME}, or remove services from ${VERCEL_JSON_FILE_NAME}.`)}function createEveServiceRoute(e=`eve`){return{destination:{service:e,type:`service`},src:EVE_SERVICE_ROUTE_SRC}}function createEveServiceRequestPathRoute(){return{src:EVE_SERVICE_ROUTE_SRC,transforms:[{args:EVE_SERVICE_ROUTE_PATH,op:`set`,type:`request.path`}]}}function isEveServiceRoute(e,t){let n=e.destination;return e.src===EVE_SERVICE_ROUTE_SRC&&isRecord(n)&&n.type===`service`&&n.service===t}function insertEveServiceRoute(e,t){let n=e.filter(e=>!(isRecord(e)&&isEveServiceRoute(e,t))),r=n.findIndex(e=>isRecord(e)&&e.handle===`filesystem`);return r===-1?[createEveServiceRoute(t),...n]:[...n.slice(0,r),createEveServiceRoute(t),...n.slice(r)]}function insertEveServiceRequestPathRoute(e){let t=(e??[]).filter(e=>e.src!==EVE_SERVICE_ROUTE_SRC);return[createEveServiceRequestPathRoute(),...t]}function createGeneratedServiceBuild(e){let t=join(e.hostRoot,`.eve/vercel-services`,`eve`),n=join(t,`.vercel`,`output`),r=join(e.hostRoot,`.vercel`,`output`),i=toPosixRelative(t,e.appRoot),a=toPosixRelative(e.appRoot,n),o=toPosixRelative(e.appRoot,r),s=e.eveBuildCommand??`node ${shellQuote(toPosixRelative(e.appRoot,resolveEveBinaryPath(e.hostRoot)))} build`;return{buildCommand:`cd ${shellQuote(i)} && export ${EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV}=${shellQuote(a)} && export ${EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV}=${shellQuote(o)} && ${s}`,root:toPosixRelative(e.hostRoot,t),rootDirectory:t}}async function ensureEveVercelServicesConfig(e){let t=await findClosestLinkedVercelDirectory(e.hostRoot),n=t===void 0?e.hostRoot:dirname(t),r=await readVercelJsonConfig(join(e.hostRoot,VERCEL_JSON_FILE_NAME)),i=n===e.hostRoot||Object.keys(createServiceConfigRecord(r.services)).length>0?r:await readVercelJsonConfig(join(n,VERCEL_JSON_FILE_NAME)),a=createServiceConfigRecord(i.services);if(Object.keys(a).length>0)return assertRootServicesIncludeEve(a,e.frameworkName),{mode:`root`};i.experimentalServices!==void 0&&console.warn(`[eve] ${VERCEL_JSON_FILE_NAME} defines experimentalServices, which Vercel no longer routes. The eve ${e.frameworkName} integration now generates the stable services config automatically — remove experimentalServices from ${VERCEL_JSON_FILE_NAME}.`);let o=createGeneratedServiceBuild(e);return await mkdir(o.rootDirectory,{recursive:!0}),{mode:`generated`,services:{eve:{buildCommand:o.buildCommand,framework:`eve`,outputDirectory:`.vercel/output`,routes:[createEveServiceRequestPathRoute()],root:o.root}}}}function mergeEveVercelConfig(e,t){let n=e?.services??{},r=Object.entries(n).find(([e,t])=>e===`eve`||t.framework===`eve`),i=r?.[0]??`eve`,a=r?{...n,[i]:{...r[1],routes:insertEveServiceRequestPathRoute(r[1].routes)}}:{...n,...t.services};return{version:3,...e,routes:insertEveServiceRoute(e?.routes??[],i),services:a}}export{createEveServiceRequestPathRoute,createEveServiceRoute,ensureEveVercelServicesConfig,mergeEveVercelConfig};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { ToolSet } from "ai";
|
|
1
|
+
import type { FlexibleSchema, ToolSet } from "ai";
|
|
2
2
|
import type * as CodeModeModule from "#compiled/@ai-sdk/code-mode/index.js";
|
|
3
|
-
/** Model-facing tool name for eve's dynamic subagent orchestration tool. */
|
|
4
|
-
export declare const WORKFLOW_TOOL_NAME = "Workflow";
|
|
5
3
|
type WorkflowSandboxModule = {
|
|
4
|
+
readonly CodeModeToolError: typeof CodeModeModule.CodeModeToolError;
|
|
6
5
|
readonly continueCodeModeInterrupt: typeof CodeModeModule.experimental_continueCodeModeInterrupt;
|
|
7
6
|
readonly createCodeModeTool: typeof CodeModeModule.experimental_createCodeModeTool;
|
|
8
|
-
readonly getCodeModeInterrupt: typeof CodeModeModule.experimental_getCodeModeInterrupt;
|
|
9
7
|
readonly requestCodeModeInterrupt: typeof CodeModeModule.experimental_requestCodeModeInterrupt;
|
|
10
8
|
readonly unwrapCodeModeResult: typeof CodeModeModule.experimental_unwrapCodeModeResult;
|
|
11
9
|
};
|
|
@@ -17,13 +15,6 @@ export declare function createWorkflowSandboxTool(input: {
|
|
|
17
15
|
readonly continuationSecurity: WorkflowSandboxContinuationSecurity;
|
|
18
16
|
readonly hostTools: ToolSet;
|
|
19
17
|
}): Promise<ToolSet[string]>;
|
|
20
|
-
export declare function requestWorkflowSandboxInterrupt(input: {
|
|
21
|
-
readonly kind: string;
|
|
22
|
-
readonly task: unknown;
|
|
23
|
-
readonly toolInput: unknown;
|
|
24
|
-
readonly toolName: string;
|
|
25
|
-
}): Promise<unknown>;
|
|
26
|
-
export declare function getWorkflowSandboxInterrupt(result: unknown, continuationSecurity: WorkflowSandboxContinuationSecurity): Promise<WorkflowSandboxInterrupt | undefined>;
|
|
27
18
|
export declare function continueWorkflowSandboxInterrupt(input: {
|
|
28
19
|
readonly bridgeRequestLimit: number;
|
|
29
20
|
readonly continuationSecurity: WorkflowSandboxContinuationSecurity;
|
|
@@ -38,7 +29,22 @@ export declare function unwrapWorkflowSandboxResult(value: unknown, continuation
|
|
|
38
29
|
readonly interrupt: WorkflowSandboxInterrupt;
|
|
39
30
|
readonly status: "interrupted";
|
|
40
31
|
}>;
|
|
41
|
-
export
|
|
32
|
+
export type WorkflowSandboxResolution = {
|
|
33
|
+
readonly status: "completed";
|
|
34
|
+
readonly output: unknown;
|
|
35
|
+
} | {
|
|
36
|
+
readonly status: "failed";
|
|
37
|
+
readonly error: string;
|
|
38
|
+
};
|
|
39
|
+
/** A host tool that parks on first call and consumes its resolution on replay. */
|
|
40
|
+
export declare function createParkingHostTool(input: {
|
|
41
|
+
readonly description: string;
|
|
42
|
+
readonly inputSchema: FlexibleSchema;
|
|
43
|
+
readonly outputSchema?: FlexibleSchema | null;
|
|
44
|
+
readonly interrupt: (toolInput: unknown) => {
|
|
45
|
+
readonly kind: string;
|
|
46
|
+
} & Record<string, unknown>;
|
|
47
|
+
}): ToolSet[string];
|
|
42
48
|
/** Reconstructs every unresolved interruption from the authenticated continuation. */
|
|
43
49
|
export declare function getWorkflowSandboxPendingInterrupts(interrupt: WorkflowSandboxInterrupt): WorkflowSandboxInterrupt[];
|
|
44
50
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WORKFLOW_SANDBOX_MODULE_KEY=Symbol.for(`eve.workflowSandbox.module`),WORKFLOW_SANDBOX_MODULE_SPECIFIER=[`#compiled`,`@ai-sdk`,`code-mode`,`index.js`].join(`/`);let workflowSandboxModulePromise;function installWorkflowSandboxModule(e){globalThis[WORKFLOW_SANDBOX_MODULE_KEY]=e}async function createWorkflowSandboxTool(e){let{createCodeModeTool:t}=await loadWorkflowSandboxModule();return t(e.hostTools,createWorkflowSandboxOptions(e.bridgeRequestLimit,e.continuationSecurity))}async function continueWorkflowSandboxInterrupt(e){let{continueCodeModeInterrupt:t}=await loadWorkflowSandboxModule();return t({interrupt:e.interrupt,options:createWorkflowSandboxOptions(e.bridgeRequestLimit,e.continuationSecurity),resolution:e.resolution,tools:e.tools})}async function unwrapWorkflowSandboxResult(e,t){let{unwrapCodeModeResult:n}=await loadWorkflowSandboxModule();return n(e,t)}function createParkingHostTool(e){return{description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema??void 0,execute:async(t,n)=>{let r=await loadWorkflowSandboxModule(),i=readWorkflowProgramResolution(n);if(i?.status===`failed`)throw new r.CodeModeToolError(i.error);return i?.status===`completed`?i.output:r.requestCodeModeInterrupt(e.interrupt(t))}}}function readWorkflowProgramResolution(e){if(typeof e!=`object`||!e)return;let t=e.codeModeInterrupt;if(typeof t!=`object`||!t)return;let n=t.resolution;if(typeof n!=`object`||!n)return;let r=n.status;return r===`completed`||r===`failed`?n:void 0}function getWorkflowSandboxPendingInterrupts(e){let t=e.continuation,n=new Set(t.resolutions.map(e=>e.runInterruptionId));return t.pendingInterruptions.flatMap(e=>n.has(e.runInterruptionId)?[]:[{continuation:t,input:e.input,interruptId:e.interruptId,outerToolCallId:t.outerToolCallId,payload:e.payload,toolCallId:e.toolCallId,toolName:e.toolName,type:`code-mode-interrupt`}])}function createWorkflowSandboxOptions(e,t){return{continuationSecurity:t,executionPolicy:{maxBridgeRequests:e,maxInFlightBridgeRequests:e}}}async function loadWorkflowSandboxModule(){let e=globalThis[WORKFLOW_SANDBOX_MODULE_KEY];return e===void 0?(workflowSandboxModulePromise??=importWorkflowSandboxModule(WORKFLOW_SANDBOX_MODULE_SPECIFIER),await workflowSandboxModulePromise):e}async function importWorkflowSandboxModule(e){let t=await import(e);return{CodeModeToolError:t.CodeModeToolError,continueCodeModeInterrupt:t.experimental_continueCodeModeInterrupt,createCodeModeTool:t.experimental_createCodeModeTool,requestCodeModeInterrupt:t.experimental_requestCodeModeInterrupt,unwrapCodeModeResult:t.experimental_unwrapCodeModeResult}}export{continueWorkflowSandboxInterrupt,createParkingHostTool,createWorkflowSandboxTool,getWorkflowSandboxPendingInterrupts,installWorkflowSandboxModule,unwrapWorkflowSandboxResult};
|
|
@@ -8,6 +8,11 @@ export type Program = {
|
|
|
8
8
|
readonly body?: readonly AstNode[];
|
|
9
9
|
};
|
|
10
10
|
export type AstNode = {
|
|
11
|
+
readonly source?: AstNode;
|
|
12
|
+
readonly specifiers?: readonly AstNode[];
|
|
13
|
+
readonly local?: AstNode;
|
|
14
|
+
readonly imported?: AstNode;
|
|
15
|
+
readonly importKind?: string;
|
|
11
16
|
readonly arguments?: readonly AstNode[];
|
|
12
17
|
readonly callee?: AstNode;
|
|
13
18
|
readonly computed?: boolean;
|
|
@@ -31,6 +36,7 @@ export type ObjectExpression = AstNode & {
|
|
|
31
36
|
export type ParsedAgentObject = {
|
|
32
37
|
readonly kind: "ok";
|
|
33
38
|
readonly object: ObjectExpression;
|
|
39
|
+
readonly program: Program;
|
|
34
40
|
} | {
|
|
35
41
|
readonly kind: "bail";
|
|
36
42
|
readonly reason: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{parseWithNitroRolldownAst}from"#internal/bundler/nitro-rolldown.js";async function parseAgentObject(e){let t;try{t=await parseWithNitroRolldownAst(`agent.ts`,e)}catch(t){let n=t;return{kind:`bail`,reason:`agent.ts does not parse: ${n.message??`unknown parse error`}`,line:parseErrorLine(e,n)}}if((t.errors?.length??0)>0){let n=t.errors?.[0];return{kind:`bail`,reason:`agent.ts does not parse: ${n?.message??`unknown parse error`}`,line:parseErrorLine(e,n)}}let n=findDefineAgentObject(t.program??t);return n===void 0?{kind:`bail`,reason:"no `export default defineAgent({ ... })` call found",line:1}:{kind:`ok`,object:n}}async function checkAgentConfigSource(e){let t=await parseAgentObject(e);return t.kind===`bail`?t.reason:void 0}function findDefineAgentObject(e){for(let t of e.body??[]){if(t.type!==`ExportDefaultDeclaration`||t.declaration==null)continue;let e=unwrapExpression(t.declaration);if(e.type!==`CallExpression`||e.callee?.type!==`Identifier`||e.callee.name!==`defineAgent`)continue;let n=e.arguments?.[0];if(n===void 0||n.type===`SpreadElement`)continue;let r=unwrapExpression(n);if(r.type===`ObjectExpression`&&r.start!==void 0&&r.end!==void 0&&r.properties!==void 0)return r}}function unwrapExpression(e){let t=e;for(;t.type===`ParenthesizedExpression`||t.type===`TSAsExpression`||t.type===`TSSatisfiesExpression`;){if(t.expression==null)return t;t=t.expression}return t}function keyMatches(e,t){return e?.type===`Identifier`?e.name===t:e?.type===`Literal`&&typeof e.value==`string`&&e.value===t}function isAstNode(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}function escapeForQuote(e,t){return e.replaceAll(`\\`,`\\\\`).replaceAll(t,`\\${t}`)}function lineAt(e,t){let n=1;for(let r=0;r<t&&r<e.length;r+=1)e[r]===`
|
|
1
|
+
import{parseWithNitroRolldownAst}from"#internal/bundler/nitro-rolldown.js";async function parseAgentObject(e){let t;try{t=await parseWithNitroRolldownAst(`agent.ts`,e)}catch(t){let n=t;return{kind:`bail`,reason:`agent.ts does not parse: ${n.message??`unknown parse error`}`,line:parseErrorLine(e,n)}}if((t.errors?.length??0)>0){let n=t.errors?.[0];return{kind:`bail`,reason:`agent.ts does not parse: ${n?.message??`unknown parse error`}`,line:parseErrorLine(e,n)}}let n=findDefineAgentObject(t.program??t);return n===void 0?{kind:`bail`,reason:"no `export default defineAgent({ ... })` call found",line:1}:{kind:`ok`,object:n,program:t.program??t}}async function checkAgentConfigSource(e){let t=await parseAgentObject(e);return t.kind===`bail`?t.reason:void 0}function findDefineAgentObject(e){for(let t of e.body??[]){if(t.type!==`ExportDefaultDeclaration`||t.declaration==null)continue;let e=unwrapExpression(t.declaration);if(e.type!==`CallExpression`||e.callee?.type!==`Identifier`||e.callee.name!==`defineAgent`)continue;let n=e.arguments?.[0];if(n===void 0||n.type===`SpreadElement`)continue;let r=unwrapExpression(n);if(r.type===`ObjectExpression`&&r.start!==void 0&&r.end!==void 0&&r.properties!==void 0)return r}}function unwrapExpression(e){let t=e;for(;t.type===`ParenthesizedExpression`||t.type===`TSAsExpression`||t.type===`TSSatisfiesExpression`;){if(t.expression==null)return t;t=t.expression}return t}function keyMatches(e,t){return e?.type===`Identifier`?e.name===t:e?.type===`Literal`&&typeof e.value==`string`&&e.value===t}function isAstNode(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}function escapeForQuote(e,t){return e.replaceAll(`\\`,`\\\\`).replaceAll(t,`\\${t}`)}function lineAt(e,t){let n=1;for(let r=0;r<t&&r<e.length;r+=1)e[r]===`
|
|
2
2
|
`&&(n+=1);return n}function parseErrorLine(e,t){return typeof t?.loc?.line==`number`?t.loc.line:lineAt(e,t?.labels?.[0]?.start??t?.start??0)}export{checkAgentConfigSource,escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression};
|
|
@@ -8,5 +8,7 @@ export type SourceEdit = {
|
|
|
8
8
|
readonly reason: string;
|
|
9
9
|
readonly line: number;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
11
|
+
/** Reads only model expressions the source editor can safely rewrite. */
|
|
12
|
+
export declare function readModelSelectionFromSource(sourceText: string): Promise<string | undefined>;
|
|
13
|
+
/** Rewrites between a Gateway string model and an eve-owned model helper. */
|
|
12
14
|
export declare function applyModelSelectionToSource(sourceText: string, selection: string): Promise<SourceEdit>;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression}from"./agent-config-ast.js";import{
|
|
2
|
-
`;return`${e.slice(0,r)}${i}import { chatgpt } from "eve/models/openai";${e.slice(r)}`}function removeChatGptImport(e){return e.replace(/import\s*\{([^}]*)\}\s*from\s*["']eve\/models\/openai["'];?\n?/u,(e,t)=>{let n=t.split(`,`).map(e=>e.trim()).filter(Boolean),r=n.filter(e=>e!==`chatgpt`);return r.length===n.length?e:r.length===0?``:`import { ${r.join(`, `)} } from "eve/models/openai";\n`})}export{applyModelSelectionToSource};
|
|
1
|
+
import{escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression}from"./agent-config-ast.js";import{MODEL_HELPERS,parseModelHelper}from"#shared/model-helper.js";async function readModelSelectionFromSource(e){let t=await parseAgentObject(e);if(t.kind===`bail`)return;let n=findModelValue(t.object);return n===void 0?void 0:currentSelection(n,t.program)}async function applyModelSelectionToSource(e,t){let n=await parseAgentObject(e);if(n.kind===`bail`)return n;let r=findModelValue(n.object);if(r===void 0||r.start===void 0||r.end===void 0)return{kind:`bail`,reason:"`model` is absent or cannot be edited safely",line:lineAt(e,n.object.start)};let i=currentSelection(r,n.program);if(i===void 0)return{kind:`bail`,reason:"`model` is neither a string literal nor an eve model helper",line:lineAt(e,r.start)};let a=parseModelHelper(t);if(a){let t=a.helper;if(!hasHelperImport(n.program,t)&&hasIdentifier(n.program,t))return{kind:`bail`,reason:`Cannot safely introduce the ${t} import; that name is already used`,line:lineAt(e,r.start)}}let o=a===void 0?`${e[r.start]===`'`?`'`:`"`}${escapeForQuote(t,e[r.start]===`'`?`'`:`"`)}${e[r.start]===`'`?`'`:`"`}`:`${a.helper}(${JSON.stringify(a.id)})`,s=e.slice(0,r.start)+o+e.slice(r.end);a!==void 0&&(s=hasHelperImport(n.program,a.helper)?s:`import { ${a.helper} } from "${MODEL_HELPERS[a.helper].module}";\n${s}`);let c=parseModelHelper(i);if(c&&c.helper!==a?.helper){let e=await parseAgentObject(s),t=e.kind===`ok`?helperImport(e.program,c.helper):void 0,n=t?.start!==void 0&&t.end!==void 0?s.slice(0,t.start)+removeHelperImport(s.slice(t.start,t.end),c.helper)+s.slice(t.end):s,r=await parseAgentObject(n);r.kind===`ok`&&!hasIdentifier(r.program,c.helper)&&(s=n)}return{kind:`applied`,from:i,to:t,nextSource:s}}function findModelValue(e){for(let t of e.properties)if(t.type===`Property`&&!t.computed&&keyMatches(t.key,`model`))return isAstNode(t.value)?unwrapExpression(t.value):void 0}function currentSelection(e,t){if(e.type===`Literal`&&typeof e.value==`string`)return e.value;if(e.type!==`CallExpression`||!isAstNode(e.callee))return;let n=unwrapExpression(e.callee);if(n.type!==`Identifier`||typeof n.name!=`string`||!(n.name in MODEL_HELPERS))return;let r=n.name,i=MODEL_HELPERS[r];if(!hasHelperImport(t,r)||(e.arguments?.length??0)>1)return;let a=e.arguments?.[0];if(a===void 0)return i.prefix+i.defaultModel;if(!isAstNode(a))return;let o=unwrapExpression(a);if(o.type!==`Literal`||typeof o.value!=`string`)return;let s=o.value.trim().replace(RegExp(`^${r===`chatgpt`?`openai`:r}/`,`u`),``);return s&&!s.includes(`/`)?i.prefix+s:void 0}function helperImportPattern(e){return RegExp(`import\\s*\\{([^}]*)\\}\\s*from\\s*["']${MODEL_HELPERS[e].module}["'];?`,`u`)}function removeHelperImport(e,t){return e.replace(helperImportPattern(t),(e,n)=>{let r=n.split(`,`).map(e=>e.trim()).filter(Boolean),i=r.filter(e=>e!==t);return i.length===r.length?e:i.length===0?``:`import { ${i.join(`, `)} } from "${MODEL_HELPERS[t].module}";`})}function hasIdentifier(e,t){return typeof e!=`object`||!e?!1:isAstNode(e)&&e.type===`Identifier`&&e.name===t?!0:Object.values(e).some(e=>hasIdentifier(e,t))}function helperImport(e,t){return e.body?.find(e=>e.type===`ImportDeclaration`&&e.source?.value===MODEL_HELPERS[t].module&&e.importKind!==`type`&&e.specifiers?.some(e=>e.imported?.name===t&&e.local?.name===t&&e.importKind!==`type`))}function hasHelperImport(e,t){return helperImport(e,t)!==void 0}export{applyModelSelectionToSource,readModelSelectionFromSource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile,rename,writeFile}from"node:fs/promises";import{join}from"node:path";import{
|
|
1
|
+
import{readFile,rename,writeFile}from"node:fs/promises";import{join}from"node:path";import{applyModelSelectionToSource}from"#source-change/apply-model-selection.js";import{checkAgentConfigSource}from"#source-change/agent-config-string-path.js";import{applyAgentModelSettingsToSource}from"#source-change/apply-agent-model-settings.js";function createStaticSourceChange(e){return{updateModelName:t=>updateAgentModelName(e,t),updateModelSettings:t=>updateAgentModelSettings(e,t)}}async function updateAgentModelSettings(e,t){let n=e.configModule;if(n===void 0)return{kind:`bail`,reason:`agent has no agent.ts config module to edit`,at:{logicalPath:`agent.ts`,line:1}};let r=join(e.agentRoot,n.logicalPath),i=await readFile(r,`utf8`),a=await applyAgentModelSettingsToSource(i,t);if(a.kind===`bail`)return{kind:`bail`,reason:a.reason,at:{logicalPath:n.logicalPath,line:a.line}};let o=await editedSourceBail(i,a.nextSource,n.logicalPath);return o===void 0?(await writeSourceIfChanged(r,i,a.nextSource),{kind:`applied`,changed:a.changed}):o}async function updateAgentModelName(e,t){let n=e.configModule;if(n===void 0)return{kind:`bail`,reason:`agent has no agent.ts config module to edit`,at:{logicalPath:`agent.ts`,line:1}};let r=join(e.agentRoot,n.logicalPath),i=await readFile(r,`utf8`),a=await applyModelSelectionToSource(i,t);if(a.kind===`bail`)return{kind:`bail`,reason:a.reason,at:{logicalPath:n.logicalPath,line:a.line}};let o=await editedSourceBail(i,a.nextSource,n.logicalPath);return o===void 0?(await writeSourceIfChanged(r,i,a.nextSource),{kind:`applied`,from:a.from,to:a.to}):o}async function writeSourceIfChanged(e,t,n){if(n===t)return;let r=`${e}.${process.pid}.eve-tmp`;await writeFile(r,n,`utf8`),await rename(r,e)}async function editedSourceBail(e,t,n){if(t===e)return;let r=await checkAgentConfigSource(t);if(r!==void 0)return{kind:`bail`,reason:`the edit produced source eve refuses to write (${r})`,at:{logicalPath:n,line:1}}}export{createStaticSourceChange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{isInputRequest}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{resumeHook}from"#internal/workflow/runtime.js";import{REMOTE_AGENT_FAILED}from"#subagents/agent-handle-errors.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{isInputRequest}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{resumeHook}from"#internal/workflow/runtime.js";import{REMOTE_AGENT_FAILED}from"#subagents/agent-handle-errors.js";import{agentTurnOutcomeWithCostSchema}from"#shared/agent-turn-outcome.js";import{tokenUsageWithCostSchema}from"#shared/token-usage.js";import{readTaskIdFromInboxToken}from"#tasks/task-inbox-token.js";const ZERO_TOKEN_USAGE={cacheReadTokens:0,cacheWriteTokens:0,inputTokens:0,outputTokens:0},eventCoordinateSchema=z.number().int().nonnegative(),authorizationChallengeSchema=z.looseObject({displayName:z.string().optional(),expiresAt:z.string().optional(),instructions:z.string().optional(),url:z.string().optional(),userCode:z.string().optional()}),taskInputEventSchema=z.looseObject({requests:z.array(jsonValueSchema.refine(isInputRequest)).min(1),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}),taskAuthorizationEventSchema=z.discriminatedUnion(`type`,[z.looseObject({data:z.looseObject({attemptId:z.string().optional(),authorization:authorizationChallengeSchema.optional(),description:z.string(),name:z.string(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string(),webhookUrl:z.string().optional()}),type:z.literal(`authorization.required`)}),z.looseObject({data:z.looseObject({attemptId:z.string().optional(),authorization:authorizationChallengeSchema.optional(),name:z.string(),outcome:z.enum([`authorized`,`declined`,`failed`,`timed-out`]),reason:z.string().optional(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}),type:z.literal(`authorization.completed`)})]),taskEventCallbackSchema=z.discriminatedUnion(`kind`,[z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:taskInputEventSchema,kind:z.literal(`task.input-requested`),subagentName:z.string(),taskId:z.string()}),z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:taskAuthorizationEventSchema,kind:z.literal(`task.authorization`),subagentName:z.string(),taskId:z.string()})]),taskTurnStartedCallbackSchema=z.object({kind:z.literal(`turn.started`),sessionId:z.string().min(1),taskId:z.string().min(1),turnId:z.string().min(1)}),sessionResultCallbackSchema=z.discriminatedUnion(`kind`,[z.object({callId:z.string().min(1),kind:z.literal(`session.completed`),output:jsonValueSchema.optional(),subagentName:z.string().min(1),usage:z.unknown().optional()}),z.object({callId:z.string().min(1),error:jsonValueSchema.optional(),kind:z.literal(`session.failed`),subagentName:z.string().min(1),usage:z.unknown().optional()}),z.object({callId:z.string().min(1),kind:z.literal(`turn.completed`),outcome:agentTurnOutcomeWithCostSchema,output:jsonValueSchema.optional(),subagentName:z.string().min(1)}),z.object({callId:z.string().min(1),error:jsonValueSchema,kind:z.literal(`turn.failed`),outcome:agentTurnOutcomeWithCostSchema,subagentName:z.string().min(1)})]);async function handleSessionCallbackRequest(e,t){let n=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});let r;try{r=await e.json()}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}let i=projectTaskEvent(r,n);if(i instanceof Response)return i;if(i!==void 0){try{await resumeHook(n,i)}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}let a=rejectDirectTaskTurnStarted(r,n);if(a instanceof Response)return a;if(a!==void 0){try{await resumeHook(n,a)}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}let o=projectSessionCallbackResult(r);if(o instanceof Response)return o;try{await resumeHook(n,{kind:`runtime-action-result`,results:[o]})}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}function callbackKind(e){if(typeof e==`object`&&e)return Reflect.get(e,`kind`)}function projectTaskEvent(e,t){let n=callbackKind(e);if(n!==`task.input-requested`&&n!==`task.authorization`)return;let r=taskEventCallbackSchema.safeParse(e);if(!r.success)return Response.json({error:`Invalid task event callback.`,ok:!1},{status:400});let i=r.data;if(readTaskIdFromInboxToken(t)!==void 0){let e=rejectMismatchedTaskToken(t,i.taskId);return e===void 0?Response.json({error:`Direct subagent task events are no longer accepted.`,ok:!1},{status:410}):e}return i.kind===`task.input-requested`?{callId:i.callId,childContinuationToken:i.childContinuationToken,childSessionId:i.childSessionId,event:i.event,kind:`subagent-input-request`,subagentName:i.subagentName}:{callId:i.callId,childSessionId:i.childSessionId,event:i.event,kind:`subagent-authorization-event`,subagentName:i.subagentName}}function rejectDirectTaskTurnStarted(e,t){if(callbackKind(e)!==`turn.started`)return;let n=taskTurnStartedCallbackSchema.safeParse(e);if(!n.success)return Response.json({error:`Invalid task turn-start callback.`,ok:!1},{status:400});let r=rejectMismatchedTaskToken(t,n.data.taskId);return r===void 0?Response.json({error:`Direct subagent task turn callbacks are no longer accepted.`,ok:!1},{status:410}):r}function rejectMismatchedTaskToken(e,t){return readTaskIdFromInboxToken(e)===t?void 0:Response.json({error:`Task callback token mismatch.`,ok:!1},{status:403})}function projectSessionCallbackResult(e){if(typeof e!=`object`||!e)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let t=callbackKind(e);if(t!==`session.completed`&&t!==`session.failed`&&t!==`turn.completed`&&t!==`turn.failed`)return Response.json({error:`Unsupported callback kind.`,ok:!1},{status:400});let n=sessionResultCallbackSchema.safeParse(e);if(!n.success)return Response.json({error:`Invalid session result callback.`,ok:!1},{status:400});let r=n.data;if(r.kind===`session.completed`){let e=r.output??``,t=parseCallbackUsage(r.usage),n={callId:r.callId,kind:`subagent-result`,origin:`child`,outcome:{kind:`terminal`,result:{kind:`succeeded`,output:e},usageDelta:t??ZERO_TOKEN_USAGE},output:e,subagentName:r.subagentName};return t===void 0?n:{...n,usage:t}}if(r.kind===`session.failed`){let e=r.error===void 0?{code:REMOTE_AGENT_FAILED,message:`Remote agent failed.`}:r.error,t=parseCallbackUsage(r.usage);return{callId:r.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:{kind:`terminal`,result:{error:e,kind:`failed`},usageDelta:t??ZERO_TOKEN_USAGE},output:e,subagentName:r.subagentName}}return r.kind===`turn.completed`?{callId:r.callId,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.output??``,subagentName:r.subagentName,usage:r.outcome.usageDelta}:{callId:r.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.error,subagentName:r.subagentName}}function parseCallbackUsage(e){if(e===void 0)return;let t=tokenUsageWithCostSchema.safeParse(e);return t.success?t.data:void 0}export{handleSessionCallbackRequest};
|
|
@@ -12,14 +12,14 @@ interface ProxySubagentEventResult {
|
|
|
12
12
|
export declare function runProxySubagentEventStep(input: {
|
|
13
13
|
readonly answerHook?: AnswerHookRoute;
|
|
14
14
|
readonly hookPayload: SubagentEventHookPayload;
|
|
15
|
-
readonly
|
|
15
|
+
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
16
16
|
readonly serializedContext: Record<string, unknown>;
|
|
17
17
|
readonly sessionState: DurableSessionState;
|
|
18
18
|
}): Promise<ProxySubagentEventResult>;
|
|
19
19
|
/** Emits a task request whose proxy routes were committed by a prior step. */
|
|
20
20
|
export declare function emitRecordedTaskInputRequestStep(input: {
|
|
21
21
|
readonly request: TaskInputRequestDelivery;
|
|
22
|
-
readonly
|
|
22
|
+
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
23
23
|
readonly serializedContext: Record<string, unknown>;
|
|
24
24
|
readonly sessionState: DurableSessionState;
|
|
25
25
|
}): Promise<ProxySubagentEventResult>;
|
|
@@ -29,7 +29,7 @@ export declare function emitProxiedSubagentEvent(input: {
|
|
|
29
29
|
readonly ctx: ContextContainer;
|
|
30
30
|
readonly durableSession: DurableSession;
|
|
31
31
|
readonly hookPayload: SubagentEventHookPayload;
|
|
32
|
-
readonly
|
|
32
|
+
readonly sessionWritable: WritableStream<Uint8Array>;
|
|
33
33
|
readonly recordProxyInputRequests?: boolean;
|
|
34
34
|
}): Promise<ProxySubagentEventResult>;
|
|
35
35
|
export {};
|