eve 0.56.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 +40 -0
- package/dist/src/channel/adapter-context.d.ts +1 -1
- package/dist/src/channel/adapter.d.ts +2 -2
- package/dist/src/channel/channel-address.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-RUGSwq8b.js → use-eve-agent-C2APNCdP.js} +45 -12
- package/dist/src/chunks/{use-eve-agent-CMdMlS7Y.js → use-eve-agent-D0YnDLi_.js} +45 -12
- package/dist/src/cli/commands/init.d.ts +2 -6
- package/dist/src/cli/commands/init.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 +1 -6
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- 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 +12 -18
- 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 +3 -2
- 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/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/client/agent-info-schema.d.ts +2 -0
- 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 +15 -6
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +3 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +4 -3
- 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/create-session-step.d.ts +1 -1
- package/dist/src/execution/durable-session-store.d.ts +10 -48
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +0 -16
- 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 -0
- 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/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.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.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/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 -0
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/channel-delivery.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +1 -0
- package/dist/src/instrumentation/native-events.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/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/dev-authored-source-watcher.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/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/discord/discordChannel.js +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/telegramChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/channel.js +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/vercel/index.d.ts +2 -1
- package/dist/src/public/vercel/index.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/self-modification/agent.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 +1 -1
- 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/chatgpt-model.d.ts +2 -2
- package/dist/src/shared/chatgpt-model.js +1 -1
- 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/vercel-services.d.ts +1 -0
- package/dist/src/shared/vercel-services.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.js +1 -1
- package/dist/src/tasks/types.d.ts +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- 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/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +22 -22
- package/docs/channels/chat-sdk.mdx +4 -2
- package/docs/channels/custom.mdx +16 -10
- package/docs/channels/eve.mdx +3 -1
- package/docs/channels/linq.mdx +1 -1
- package/docs/channels/overview.mdx +4 -2
- package/docs/channels/photon.mdx +4 -1
- package/docs/channels/slack.mdx +3 -1
- package/docs/concepts/execution-model-and-durability.mdx +62 -13
- package/docs/concepts/sessions-runs-and-streaming.md +14 -5
- package/docs/getting-started.mdx +7 -3
- package/docs/guides/deployment/vercel.mdx +1 -1
- package/docs/guides/dev-tui.md +54 -27
- package/docs/guides/frontend/overview.mdx +3 -1
- package/docs/guides/instrumentation/meta.json +1 -0
- package/docs/memory/custom-provider.md +1 -1
- package/docs/protocols/acp.md +1 -1
- package/docs/reference/cli.md +2 -2
- package/docs/reference/telemetry.md +1 -1
- package/docs/reference/typescript-api.md +12 -5
- package/docs/sandbox.mdx +3 -3
- package/docs/subagents/index.mdx +2 -2
- package/docs/tools/workflows.mdx +1 -1
- 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/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 -85
- 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/subagents/handles/rebase.d.ts +0 -4
- package/dist/src/subagents/handles/rebase.js +0 -1
- /package/dist/src/{execution/next-driver-action.js → client/eve-agent-store-state.js} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MessageResponse } from "#client/message-response.js";
|
|
2
|
+
import type { CancelSessionResult } from "#client/types.js";
|
|
3
|
+
export interface PendingMessageSubmission {
|
|
4
|
+
readonly createdAt: number;
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ActiveTurn {
|
|
9
|
+
readonly abortController: AbortController;
|
|
10
|
+
acceptedFollowUps: number;
|
|
11
|
+
readonly cancel: () => Promise<CancelSessionResult>;
|
|
12
|
+
readonly completion: Promise<void>;
|
|
13
|
+
readonly followUpDispatches: Set<Promise<void>>;
|
|
14
|
+
receivedFollowUps: number;
|
|
15
|
+
readonly followUpSubmissionIds: Set<string>;
|
|
16
|
+
readonly resolveCompletion: () => void;
|
|
17
|
+
readonly response: Promise<MessageResponse | undefined>;
|
|
18
|
+
readonly resolveResponse: (response: MessageResponse | undefined) => void;
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toError}from"#shared/errors.js";import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{Client}from"#client/client.js";import{assertExclusiveTurnInput,collectPendingAuthorizations,createAbortSignal,createSubmissionId,isAbortError,isSettledSessionTail,summarizeUserContent,toTerminalStreamFailureError,updatePendingAuthorizations}from"#client/eve-agent-store-helpers.js";const detachStore=Symbol(`detachEveAgentStore`);var EveAgentStore=class{#e;#t;#n;#r;#i=new Set;#a=createEventDeduper();#o;#s={};#c;#l;#u;#d=[];#f;#p;#m;#h;#g=`ready`;constructor(e){this.#t=e.session!==void 0,this.#e=this.#t?void 0:new Client({auth:e.auth,headers:e.headers,host:e.host??``});let t=[];for(let n of e.initialEvents??[])this.#a.admit(n)&&t.push(n);this.#u=t,this.#f=[...this.#u],this.#n=e.optimistic??!0,this.#r=e.reducer,this.#m=e.session??(e.initialSession===void 0?void 0:this.#e?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex})),this.#c=this.#j(this.#f),this.#h=this.#M()}get snapshot(){return this.#h}setCallbacks(e){this.#s=e}subscribe(e){return this.#i.add(e),()=>{this.#i.delete(e)}}async send(e){if(this.#o!==void 0){if(this.#g===`resuming`)throw Error(`eve session is resuming.`);return await this.#v(this.#o,e)}let t=Promise.withResolvers(),n=Promise.withResolvers(),r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>r.acceptedFollowUps>0&&this.#m!==void 0?this.#m.cancel():t.promise.then(e=>e===void 0?{status:`no_active_turn`}:e.cancel()),completion:n.promise,followUpDispatches:new Set,receivedFollowUps:0,resolveCompletion:n.resolve,response:t.promise,resolveResponse:t.resolve};this.#o=r,this.#l=void 0,this.#g=`submitted`,this.#N();try{let t=await this.#s.prepareSend?.(e)??e;if(assertExclusiveTurnInput(t),!this.#S(r))return;this.#C(t),this.#w(t),this.#N();let n={...t,signal:createAbortSignal(t.signal,r.abortController.signal)},i=await this.#x(n);if(!this.#S(r))return;r.resolveResponse(i);for await(let e of i){if(!this.#S(r))return;this.#T(e)}if(!this.#S(r)||(await this.#y(r),!this.#S(r)))return;this.#g=this.#l===void 0?`ready`:`error`}catch(e){if(!this.#S(r))return;isAbortError(e)?(this.#g=`ready`,this.#O(toError(e))):(this.#l=toError(e),this.#g=`error`,this.#O(this.#l),this.#s.onError?.(this.#l))}finally{this.#S(r)&&(r.resolveResponse(void 0),this.#o=void 0,this.#s.onSessionChange?.(this.#m?.state),this.#N(),this.#s.onFinish?.(this.#h),r.resolveCompletion())}}resume(){if(this.#p!==void 0)return this.#p;let e=this.#_();this.#p=e;let clear=()=>{this.#p===e&&(this.#p=void 0)};return e.then(clear,clear),e}async#_(){if(this.#g===`resuming`||this.#g===`streaming`||this.#g===`submitted`)throw Error(`eve session is already processing a turn.`);if(this.#m===void 0)throw Error(`An eve session is required before resuming.`);let e=Promise.withResolvers(),t=Promise.withResolvers(),n=this.#m,r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>n.cancel(),completion:t.promise,followUpDispatches:new Set,receivedFollowUps:0,resolveCompletion:t.resolve,response:e.promise,resolveResponse:e.resolve};this.#o=r,r.resolveResponse(void 0),this.#l=void 0,this.#g=`resuming`,this.#N();try{let e=this.#u.length===n.state.streamIndex,t=e?[...this.#u]:[];for await(let i of n.stream({follow:!1,signal:r.abortController.signal,startIndex:e?n.state.streamIndex:0})){if(!this.#S(r))return;t.push(i),this.#T(i,{publish:!1,transitionToStreaming:!1})}if(!this.#S(r))return;let i=t.at(-1);i!==void 0&&this.#D(i);let a=isSettledSessionTail(t);if(this.#l===void 0&&(!a||i?.type===`session.waiting`)){let e=collectPendingAuthorizations(t);a||(this.#g=`streaming`),this.#N();let i=!a;for(;;){for await(let a of n.stream({follow:i?void 0:!1,signal:r.abortController.signal})){if(!this.#S(r))return;if(t.push(a),this.#T(a),updatePendingAuthorizations(e,a),i&&isCurrentTurnBoundaryEvent(a)&&(a.type!==`session.waiting`||e.size===0))break}if(!this.#S(r))return;if(i||isSettledSessionTail(t))break;i=!0}}else this.#g=this.#l===void 0?`ready`:`error`,this.#N();await this.#y(r),this.#S(r)&&(this.#g=this.#l===void 0?`ready`:`error`)}catch(e){if(!this.#S(r))return;isAbortError(e)?this.#g=`ready`:(this.#l=toError(e),this.#g=`error`,this.#s.onError?.(this.#l))}finally{this.#S(r)&&(r.resolveResponse(void 0),this.#o=void 0,this.#s.onSessionChange?.(n.state),this.#N(),this.#s.onFinish?.(this.#h),r.resolveCompletion())}}cancel(){let e=this.#o;return e===void 0?Promise.resolve({status:`no_active_turn`}):e.cancel()}[detachStore](){this.#o?.abortController.abort()}reset(){let e=this.#o;this.#o=void 0,e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),this.#t||(this.#m=void 0),this.#u=[],this.#a=createEventDeduper(),this.#d=[],this.#f=[],this.#c=this.#r.initial(),this.#l=void 0,this.#g=`ready`,this.#s.onSessionChange?.(this.#m?.state),this.#N()}async#v(e,t){if(t.message===void 0||t.turnPolicy!==`steer`)throw Error(`eve session is already processing a turn. Send a message with turnPolicy: "steer" to
|
|
1
|
+
import{toError}from"#shared/errors.js";import{createEventDeduper}from"#protocol/event-dedupe.js";import{isCurrentTurnBoundaryEvent}from"#protocol/message.js";import{Client}from"#client/client.js";import{assertExclusiveTurnInput,collectPendingAuthorizations,createAbortSignal,createSubmissionId,isAbortError,isSettledSessionTail,summarizeUserContent,toTerminalStreamFailureError,updatePendingAuthorizations}from"#client/eve-agent-store-helpers.js";const detachStore=Symbol(`detachEveAgentStore`);var EveAgentStore=class{#e;#t;#n;#r;#i=new Set;#a=createEventDeduper();#o;#s={};#c;#l;#u;#d=[];#f;#p;#m;#h;#g=`ready`;constructor(e){this.#t=e.session!==void 0,this.#e=this.#t?void 0:new Client({auth:e.auth,headers:e.headers,host:e.host??``});let t=[];for(let n of e.initialEvents??[])this.#a.admit(n)&&t.push(n);this.#u=t,this.#f=[...this.#u],this.#n=e.optimistic??!0,this.#r=e.reducer,this.#m=e.session??(e.initialSession===void 0?void 0:this.#e?.sessions.attach(e.initialSession.sessionId,{streamIndex:e.initialSession.streamIndex})),this.#c=this.#j(this.#f),this.#h=this.#M()}get snapshot(){return this.#h}setCallbacks(e){this.#s=e}subscribe(e){return this.#i.add(e),()=>{this.#i.delete(e)}}async send(e){if(this.#o!==void 0){if(this.#g===`resuming`)throw Error(`eve session is resuming.`);return await this.#v(this.#o,e)}let t=Promise.withResolvers(),n=Promise.withResolvers(),r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>r.acceptedFollowUps>0&&this.#m!==void 0?this.#m.cancel():t.promise.then(e=>e===void 0?{status:`no_active_turn`}:e.cancel()),completion:n.promise,followUpDispatches:new Set,receivedFollowUps:0,followUpSubmissionIds:new Set,resolveCompletion:n.resolve,response:t.promise,resolveResponse:t.resolve};this.#o=r,this.#l=void 0,this.#g=`submitted`,this.#N();try{let t=await this.#s.prepareSend?.(e)??e;if(assertExclusiveTurnInput(t),!this.#S(r))return;this.#C(t),this.#w(t),this.#N();let n={...t,signal:createAbortSignal(t.signal,r.abortController.signal)},i=await this.#x(n);if(!this.#S(r))return;r.resolveResponse(i);for await(let e of i){if(!this.#S(r))return;this.#T(e)}if(!this.#S(r)||(await this.#y(r),!this.#S(r)))return;this.#g=this.#l===void 0?`ready`:`error`}catch(e){if(!this.#S(r))return;isAbortError(e)?(this.#g=`ready`,this.#O(toError(e))):(this.#l=toError(e),this.#g=`error`,this.#O(this.#l),this.#s.onError?.(this.#l))}finally{this.#S(r)&&(r.resolveResponse(void 0),this.#o=void 0,this.#s.onSessionChange?.(this.#m?.state),this.#N(),this.#s.onFinish?.(this.#h),r.resolveCompletion())}}resume(){if(this.#p!==void 0)return this.#p;let e=this.#_();this.#p=e;let clear=()=>{this.#p===e&&(this.#p=void 0)};return e.then(clear,clear),e}async#_(){if(this.#g===`resuming`||this.#g===`streaming`||this.#g===`submitted`)throw Error(`eve session is already processing a turn.`);if(this.#m===void 0)throw Error(`An eve session is required before resuming.`);let e=Promise.withResolvers(),t=Promise.withResolvers(),n=this.#m,r={abortController:new AbortController,acceptedFollowUps:0,cancel:()=>n.cancel(),completion:t.promise,followUpDispatches:new Set,receivedFollowUps:0,followUpSubmissionIds:new Set,resolveCompletion:t.resolve,response:e.promise,resolveResponse:e.resolve};this.#o=r,r.resolveResponse(void 0),this.#l=void 0,this.#g=`resuming`,this.#N();try{let e=this.#u.length===n.state.streamIndex,t=e?[...this.#u]:[];for await(let i of n.stream({follow:!1,signal:r.abortController.signal,startIndex:e?n.state.streamIndex:0})){if(!this.#S(r))return;t.push(i),this.#T(i,{publish:!1,transitionToStreaming:!1})}if(!this.#S(r))return;let i=t.at(-1);i!==void 0&&this.#D(i);let a=isSettledSessionTail(t);if(this.#l===void 0&&(!a||i?.type===`session.waiting`)){let e=collectPendingAuthorizations(t);a||(this.#g=`streaming`),this.#N();let i=!a;for(;;){for await(let a of n.stream({follow:i?void 0:!1,signal:r.abortController.signal})){if(!this.#S(r))return;if(t.push(a),this.#T(a),updatePendingAuthorizations(e,a),i&&isCurrentTurnBoundaryEvent(a)&&(a.type!==`session.waiting`||e.size===0))break}if(!this.#S(r))return;if(i||isSettledSessionTail(t))break;i=!0}}else this.#g=this.#l===void 0?`ready`:`error`,this.#N();await this.#y(r),this.#S(r)&&(this.#g=this.#l===void 0?`ready`:`error`)}catch(e){if(!this.#S(r))return;isAbortError(e)?this.#g=`ready`:(this.#l=toError(e),this.#g=`error`,this.#s.onError?.(this.#l))}finally{this.#S(r)&&(r.resolveResponse(void 0),this.#o=void 0,this.#s.onSessionChange?.(n.state),this.#N(),this.#s.onFinish?.(this.#h),r.resolveCompletion())}}cancel(){let e=this.#o;return e===void 0?Promise.resolve({status:`no_active_turn`}):e.cancel()}[detachStore](){this.#o?.abortController.abort()}reset(){let e=this.#o;this.#o=void 0,e?.resolveResponse(void 0),e?.resolveCompletion(),e?.abortController.abort(),this.#t||(this.#m=void 0),this.#u=[],this.#a=createEventDeduper(),this.#d=[],this.#f=[],this.#c=this.#r.initial(),this.#l=void 0,this.#g=`ready`,this.#s.onSessionChange?.(this.#m?.state),this.#N()}async#v(e,t){if(t.message===void 0||t.turnPolicy!==`steer`)throw Error(`eve session is already processing a turn. Send a message with turnPolicy: "steer" to guide it at the next boundary.`);let n=await this.#s.prepareSend?.(t)??t;if(assertExclusiveTurnInput(n),n.message===void 0||n.turnPolicy!==`steer`)throw Error(`An in-flight follow-up requires a message with turnPolicy: "steer".`);if(!this.#S(e))return await this.send(n);let r=this.#C(n);r!==void 0&&e.followUpSubmissionIds.add(r),this.#N();let i;i=(async()=>{try{if(await e.response,!this.#S(e)||this.#m===void 0)throw Error(`The active eve turn ended before the follow-up could be sent.`);let{message:t,...r}=n;await this.#m.send(t,r),e.acceptedFollowUps+=1}catch(e){throw this.#O(toError(e),r),this.#N(),e}finally{e.followUpDispatches.delete(i)}})(),e.followUpDispatches.add(i),await i,await e.completion}async#y(e){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(!(e.receivedFollowUps>=e.acceptedFollowUps||this.#m===void 0))for await(let t of this.#m.stream({signal:e.abortController.signal})){if(!this.#S(e))return;if(this.#T(t),isCurrentTurnBoundaryEvent(t)){for(;e.followUpDispatches.size>0;)await Promise.allSettled(e.followUpDispatches);if(e.receivedFollowUps>=e.acceptedFollowUps)return}}}async#b(e){if(this.#e===void 0)throw Error(`An external eve session is required before sending.`);if(e.message===void 0)throw Error(`Cannot answer an input request before the session starts.`);let t=await this.#e.sessions.create({...e,message:e.message});return this.#m=t.session,this.#s.onSessionChange?.(t.session.state),this.#N(),t.response}async#x(e){if(this.#m===void 0)return await this.#b(e);if(e.inputResponses===void 0){let{message:t,...n}=e;return await this.#m.send(t,n)}let{inputResponses:t,...n}=e;return await this.#m.respond(t,n)}#S(e){return this.#o===e}#C(e){if(e.message===void 0)return;let t=createSubmissionId(),n={createdAt:Date.now(),id:t,message:summarizeUserContent(e.message)};return this.#d=[...this.#d,n],this.#n&&this.#k({data:{createdAt:n.createdAt,message:n.message,submissionId:n.id},type:`client.message.submitted`}),t}#w(e){e.inputResponses!==void 0&&e.inputResponses.length!==0&&this.#k({data:{createdAt:Date.now(),responses:e.inputResponses},type:`client.input.responded`})}#T(e,t={}){this.#a.admit(e)&&(this.#u=[...this.#u,e],this.#E(e),this.#s.onEvent?.(e),(t.transitionToStreaming??!0)&&(this.#g=`streaming`),this.#D(e),(t.publish??!0)&&this.#N())}#E(e){let t=this.#d[0];if(e.type===`message.received`&&t!==void 0){let n=t.id;this.#o?.followUpSubmissionIds.delete(n)&&(this.#o.receivedFollowUps+=1),this.#d=this.#d.slice(1),this.#A(e=>e.type===`client.message.submitted`&&e.data.submissionId===n,e);return}this.#k(e)}#D(e){let t=toTerminalStreamFailureError(e);t!==void 0&&(this.#g=`error`,this.#O(t),this.#l===void 0&&(this.#l=t,this.#s.onError?.(t)))}#O(e,t){let n=t===void 0?this.#d[0]:this.#d.find(e=>e.id===t);n!==void 0&&(this.#d=this.#d.filter(e=>e.id!==n.id),this.#A(e=>e.type===`client.message.submitted`&&e.data.submissionId===n.id,{data:{createdAt:n.createdAt,error:{message:e.message},message:n.message,submissionId:n.id},type:`client.message.failed`}))}#k(e){this.#f=[...this.#f,e],this.#c=this.#r.reduce(this.#c,e)}#A(e,t){let n=!1;this.#f=this.#f.map(r=>!n&&e(r)?(n=!0,t):r),n||(this.#f=[...this.#f,t]),this.#c=this.#j(this.#f)}#j(e){let t=this.#r.initial();for(let n of e)t=this.#r.reduce(t,n);return t}#M(){return{data:this.#c,error:this.#l,events:this.#u,session:this.#m?.state,status:this.#g}}#N(){this.#h=this.#M();for(let e of this.#i)e()}};function detachEveAgentStore(e){e[detachStore]()}export{EveAgentStore,detachEveAgentStore};
|
|
@@ -15,6 +15,8 @@ export declare function isStreamDisconnectError(error: unknown): boolean;
|
|
|
15
15
|
* Use {@link isStreamDisconnectError} to classify them.
|
|
16
16
|
*/
|
|
17
17
|
export declare function readNdjsonStream(body: ReadableStream<Uint8Array>, options: {
|
|
18
|
+
readonly controlVersion?: "1";
|
|
18
19
|
readonly idleTimeoutMs?: number;
|
|
20
|
+
readonly onLeaseEnded?: () => void;
|
|
19
21
|
readonly streamVersion: MessageStreamVersion;
|
|
20
22
|
}): AsyncGenerator<MessageStreamEvent>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"#protocol/message.js";import{normalizeMessageStreamEvent}from"#protocol/message-version.js";function isStreamDisconnectError(e){if(e instanceof DOMException)return e.name===`AbortError`;if(!(e instanceof Error))return!1;let t=`code`in e&&typeof e.code==`string`?e.code:void 0;return e.name===`AbortError`||e.message===`terminated`||t===`UND_ERR_SOCKET`||e instanceof TypeError&&/^(?:failed to fetch|fetch failed)$/i.test(e.message)||/abort|cancel|disconnect|premature close|socket|terminated/i.test(e.message)}async function*readNdjsonStream(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=!1;try{for(;;){let e=await readWithIdleTimeout(n,t?.idleTimeoutMs);if(e.done){a=!0,i+=r.decode();break}e.value&&(i+=r.decode(e.value,{stream:!0}));let o=i.indexOf(`
|
|
2
|
-
`);for(;o!==-1;){let e=i.slice(0,o).trim();i=i.slice(o+1),e.length>0
|
|
3
|
-
`)}}let e=i.trim();e.length>0
|
|
1
|
+
import{EVE_STREAM_LEASE_ENDED_CONTROL}from"#protocol/message.js";import{normalizeMessageStreamEvent}from"#protocol/message-version.js";function isStreamDisconnectError(e){if(e instanceof DOMException)return e.name===`AbortError`;if(!(e instanceof Error))return!1;let t=`code`in e&&typeof e.code==`string`?e.code:void 0;return e.name===`AbortError`||e.message===`terminated`||t===`UND_ERR_SOCKET`||e instanceof TypeError&&/^(?:failed to fetch|fetch failed)$/i.test(e.message)||/abort|cancel|disconnect|premature close|socket|terminated/i.test(e.message)}async function*readNdjsonStream(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=!1;try{for(;;){let e=await readWithIdleTimeout(n,t?.idleTimeoutMs);if(e.done){a=!0,i+=r.decode();break}e.value&&(i+=r.decode(e.value,{stream:!0}));let o=i.indexOf(`
|
|
2
|
+
`);for(;o!==-1;){let e=i.slice(0,o).trim();if(i=i.slice(o+1),e.length>0){let n=JSON.parse(e);t.controlVersion===`1`&&isLeaseEndedControl(n)?t.onLeaseEnded?.():yield parseMessageStreamEvent(n,t.streamVersion)}o=i.indexOf(`
|
|
3
|
+
`)}}let e=i.trim();if(e.length>0){let n=JSON.parse(e);t.controlVersion===`1`&&isLeaseEndedControl(n)?t.onLeaseEnded?.():yield parseMessageStreamEvent(n,t.streamVersion)}}finally{a||n.cancel().catch(()=>{}),n.releaseLock()}}function isLeaseEndedControl(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.$eve===EVE_STREAM_LEASE_ENDED_CONTROL.$eve&&t.version===EVE_STREAM_LEASE_ENDED_CONTROL.version}function parseMessageStreamEvent(e,t){return normalizeMessageStreamEvent(t,e)}async function readWithIdleTimeout(e,t){let n;try{return t===void 0?await e.read():await Promise.race([e.read(),new Promise((e,r)=>{n=setTimeout(()=>r(new DOMException(`Session stream was idle.`,`AbortError`)),t)})])}catch(e){throw e instanceof TypeError?Error(`Session stream disconnected.`,{cause:e}):e}finally{n!==void 0&&clearTimeout(n)}}export{isStreamDisconnectError,readNdjsonStream};
|
|
@@ -51,6 +51,7 @@ export declare function followStreamIterable(input: FollowStreamInput): AsyncGen
|
|
|
51
51
|
interface OpenedStream {
|
|
52
52
|
readonly body: ReadableStream<Uint8Array>;
|
|
53
53
|
close(): void;
|
|
54
|
+
readonly controlVersion: "1" | undefined;
|
|
54
55
|
readonly streamVersion: MessageStreamVersion;
|
|
55
56
|
readonly tailIndex: number | undefined;
|
|
56
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createEveSessionStreamRoutePath}from"#protocol/routes.js";import{EVE_STREAM_TAIL_INDEX_HEADER}from"#protocol/message.js";import{isStreamDisconnectError,readNdjsonStream}from"#client/ndjson.js";import{readMessageStreamVersion}from"#client/stream-version.js";import{ClientError}from"#client/client-error.js";import{createClientUrl}from"#client/url.js";const DEFAULT_STREAM_RECONNECT_POLICY={retryableErrorStatuses:new Set([404,409,425,500,502,503,504]),streamIdleReconnectPolicy:{baseDelayMs:250,maxAttempts:5,maxDelayMs:4e3},streamOpenReconnectPolicy:{baseDelayMs:250,maxAttempts:12,maxDelayMs:5e3}},NO_STREAM_RECONNECT_POLICY={...DEFAULT_STREAM_RECONNECT_POLICY,streamIdleReconnectPolicy:{...DEFAULT_STREAM_RECONNECT_POLICY.streamIdleReconnectPolicy,maxAttempts:0},streamOpenReconnectPolicy:{...DEFAULT_STREAM_RECONNECT_POLICY.streamOpenReconnectPolicy,maxAttempts:1}};function resolveRetryPolicy(e,t){return{...t,...e}}function resolveStreamReconnectPolicy(e){if(e&&`reconnect`in e&&e.reconnect===!1)return NO_STREAM_RECONNECT_POLICY;let t=e;return{retryableErrorStatuses:t?.retryableErrorStatuses?new Set(t.retryableErrorStatuses):DEFAULT_STREAM_RECONNECT_POLICY.retryableErrorStatuses,streamIdleReconnectPolicy:resolveRetryPolicy(t?.streamIdleReconnectPolicy,DEFAULT_STREAM_RECONNECT_POLICY.streamIdleReconnectPolicy),streamOpenReconnectPolicy:resolveRetryPolicy(t?.streamOpenReconnectPolicy,DEFAULT_STREAM_RECONNECT_POLICY.streamOpenReconnectPolicy)}}async function*followStreamIterable(e){if(e.follow===!1&&e.startIndex<0)throw Error(`stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.`);let t=resolveStreamReconnectPolicy(e.streamReconnectPolicy),n=t.streamIdleReconnectPolicy,r=e.startIndex,i=n.baseDelayMs,a=0,o=!0,s;for(;;){let c;try{c=await openStreamBody({...e,retryPolicy:t,startIndex:r,requestTailIndex:e.follow===!1&&s===void 0})}catch(t){if(e.signal?.aborted)return;throw t}if(e.follow===!1&&s===void 0&&(s=c.tailIndex,s===void 0))throw c.close(),Error(`stream({ follow: false }) requires the server to report the ${EVE_STREAM_TAIL_INDEX_HEADER} header. The agent may be running an older eve version.`);if(s!==void 0&&r>s){c.close();return}let l=!1;try{for await(let t of readNdjsonStream(c.body,{idleTimeoutMs:e.streamReadIdleTimeoutMs??15e3,streamVersion:c.streamVersion}))if(r+=1,l=!0,i=n.baseDelayMs,a=0,yield t,s!==void 0&&r>s)return}catch(e){if(!isStreamDisconnectError(e))throw e}finally{c.close()}if(e.signal?.aborted||e.startIndex<0||n.maxAttempts===0
|
|
1
|
+
import{createEveSessionStreamRoutePath}from"#protocol/routes.js";import{EVE_STREAM_CONTROL_VERSION,EVE_STREAM_CONTROL_VERSION_QUERY,EVE_STREAM_TAIL_INDEX_HEADER}from"#protocol/message.js";import{isStreamDisconnectError,readNdjsonStream}from"#client/ndjson.js";import{readMessageStreamVersion}from"#client/stream-version.js";import{ClientError}from"#client/client-error.js";import{createClientUrl}from"#client/url.js";const DEFAULT_STREAM_RECONNECT_POLICY={retryableErrorStatuses:new Set([404,409,425,500,502,503,504]),streamIdleReconnectPolicy:{baseDelayMs:250,maxAttempts:5,maxDelayMs:4e3},streamOpenReconnectPolicy:{baseDelayMs:250,maxAttempts:12,maxDelayMs:5e3}},NO_STREAM_RECONNECT_POLICY={...DEFAULT_STREAM_RECONNECT_POLICY,streamIdleReconnectPolicy:{...DEFAULT_STREAM_RECONNECT_POLICY.streamIdleReconnectPolicy,maxAttempts:0},streamOpenReconnectPolicy:{...DEFAULT_STREAM_RECONNECT_POLICY.streamOpenReconnectPolicy,maxAttempts:1}};function resolveRetryPolicy(e,t){return{...t,...e}}function resolveStreamReconnectPolicy(e){if(e&&`reconnect`in e&&e.reconnect===!1)return NO_STREAM_RECONNECT_POLICY;let t=e;return{retryableErrorStatuses:t?.retryableErrorStatuses?new Set(t.retryableErrorStatuses):DEFAULT_STREAM_RECONNECT_POLICY.retryableErrorStatuses,streamIdleReconnectPolicy:resolveRetryPolicy(t?.streamIdleReconnectPolicy,DEFAULT_STREAM_RECONNECT_POLICY.streamIdleReconnectPolicy),streamOpenReconnectPolicy:resolveRetryPolicy(t?.streamOpenReconnectPolicy,DEFAULT_STREAM_RECONNECT_POLICY.streamOpenReconnectPolicy)}}async function*followStreamIterable(e){if(e.follow===!1&&e.startIndex<0)throw Error(`stream({ follow: false }) requires a nonnegative startIndex; a tail-relative cursor cannot be bounded.`);let t=resolveStreamReconnectPolicy(e.streamReconnectPolicy),n=t.streamIdleReconnectPolicy,r=e.startIndex,i=n.baseDelayMs,a=0,o=!0,s;for(;;){let c;try{c=await openStreamBody({...e,retryPolicy:t,startIndex:r,requestTailIndex:e.follow===!1&&s===void 0})}catch(t){if(e.signal?.aborted)return;throw t}if(e.follow===!1&&s===void 0&&(s=c.tailIndex,s===void 0))throw c.close(),Error(`stream({ follow: false }) requires the server to report the ${EVE_STREAM_TAIL_INDEX_HEADER} header. The agent may be running an older eve version.`);if(s!==void 0&&r>s){c.close();return}let l=!1,u=!1;try{for await(let t of readNdjsonStream(c.body,{controlVersion:c.controlVersion,idleTimeoutMs:e.streamReadIdleTimeoutMs??15e3,onLeaseEnded:()=>{u=!0},streamVersion:c.streamVersion}))if(r+=1,l=!0,i=n.baseDelayMs,a=0,yield t,s!==void 0&&r>s)return}catch(e){if(!isStreamDisconnectError(e))throw e}finally{c.close()}if(e.signal?.aborted||e.startIndex<0||n.maxAttempts===0)return;if(!u){if(e.keepAlive!==!0&&!l&&!o&&(a+=1)>=n.maxAttempts||(o=!1,await sleep(i,e.signal),e.signal?.aborted))return;i=Math.min(i*2,n.maxDelayMs)}}}async function openStreamBody(e){let t=e.retryPolicy??resolveStreamReconnectPolicy(e.streamReconnectPolicy),n=t.streamOpenReconnectPolicy,r,i,a,o=n.baseDelayMs,s=e.startIndex>=0&&t.streamIdleReconnectPolicy.maxAttempts>0?EVE_STREAM_CONTROL_VERSION:void 0,c={};s!==void 0&&(c[EVE_STREAM_CONTROL_VERSION_QUERY]=s),e.startIndex!==0&&(c.startIndex=String(e.startIndex)),e.requestTailIndex===!0&&(c.includeTailIndex=`1`);for(let l=0;l<n.maxAttempts;l+=1){let u=createClientUrl(e.host,createEveSessionStreamRoutePath(e.sessionId),Object.keys(c).length>0?c:void 0),d=await e.resolveHeaders(),f=new AbortController,p=e.signal?AbortSignal.any([e.signal,f.signal]):f.signal,m;try{m=await fetch(u,{cache:`no-store`,headers:d,redirect:e.redirect,signal:p})}catch(t){if(e.signal?.aborted||!isStreamDisconnectError(t)||l===n.maxAttempts-1)throw t;await sleep(o,e.signal),o=Math.min(o*2,n.maxDelayMs);continue}if(m.ok){if(!m.body)throw new ClientError(m.status,`Response body is null.`,m.headers);let e=!1;return{body:m.body,close:()=>{e||(e=!0,m.body?.cancel().catch(()=>{}),f.abort())},controlVersion:s,streamVersion:readMessageStreamVersion(m.headers),tailIndex:parseTailIndexHeader(m.headers)}}if(r=m.status,i=await m.text(),a=m.headers,!t.retryableErrorStatuses.has(m.status))throw new ClientError(m.status,i,m.headers);l<n.maxAttempts-1&&(await sleep(o,e.signal),o=Math.min(o*2,n.maxDelayMs))}throw new ClientError(r??0,i??`Failed to open message stream.`,a)}function parseTailIndexHeader(e){let t=e.get(EVE_STREAM_TAIL_INDEX_HEADER);if(t===null||!/^-?\d+$/.test(t))return;let n=Number(t);return Number.isSafeInteger(n)?n:void 0}async function sleep(e,t){t?.aborted||await new Promise(n=>{let onAbort=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t?.removeEventListener(`abort`,onAbort),n()},e);t?.addEventListener(`abort`,onAbort,{once:!0})})}export{followStreamIterable,openStreamBody,sleep};
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"zod": "4.5.4",
|
|
57
57
|
"zod-validation-error": "5.0.0"
|
|
58
58
|
},
|
|
59
|
-
"scriptHash": "
|
|
59
|
+
"scriptHash": "5d6335909bc0133eefa3695ae65755fea81b00f09ee87bad56bb05f7d055ee38",
|
|
60
60
|
"toolVersions": {
|
|
61
61
|
"rolldown": "1.2.7",
|
|
62
62
|
"typescript": "7.0.2"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_chunks/workflow/dist-
|
|
2
|
-
`)}`)}return await S(t,r.value)}}}async function D(e,
|
|
1
|
+
import"../../_chunks/workflow/dist-C5KCXSdI.js";import{An as e,Kn as t,Vn as n}from"../../_chunks/workflow/logger-D6vwIEf9.js";import{i as r,u as i}from"../../_chunks/workflow/dist-xTushGCp.js";import{G as a,W as o,b as s,ct as c,i as l,it as u,lt as d,nt as f,rt as p,st as m,tt as h,ut as g,w as _}from"../../_chunks/workflow/serialization-CWYPL4Eq.js";import{a as v,i as y,r as b,t as x}from"../../_chunks/workflow/attribute-changes-DTFAjP0J.js";import{n as S}from"../../_chunks/workflow/resume-hook-_baK8jaT.js";import{t as C}from"../../_chunks/workflow/sleep-BL0kgJnT.js";function w(e){y(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,w)}function T(e){y(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,T)}function E({schema:e}={}){function t(e){y(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await S(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
|
|
2
|
+
`)}`)}return await S(t,r.value)}}}async function D(e,n={}){let i=a.getStore(),o=i?.workflowMetadata?.workflowRunId;if(!o)throw new r(`setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let s=x(e,n);if(s.length!==0){if(i.runReadyBarrier)try{await i.runReadyBarrier}catch{}await(await t()).events.create(o,{eventType:`attr_set`,specVersion:7,eventData:{changes:s,writer:{type:`step`,stepId:i.stepMetadata.stepId,attempt:i.stepMetadata.attempt},...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}}function O(){let e=a.getStore();return e||b(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,O),e.stepMetadata}function k(){let e=a.getStore();return e||v(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,k),e.workflowMetadata}function A(t={}){let r=a.getStore();r||v(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,A);let{namespace:i}=t,y=r.workflowMetadata.workflowRunId,b=o(y,i);r.writables??=new Map;let x=r.writables,S=x.get(b);if(S)return S.writable;let C=h();C.deferReleaseSettlement=r.streamStates!==void 0;let w=_(s(globalThis,r.ops,y,r.encryptionKey,!0,r.runReadyBarrier),r.encryptionKey),T=new l(y,b,r.runReadyBarrier);r.streamStates??=[],r.streamStates.push(C),r.ops.push(C.promise),f(w.readable,T,C).catch(()=>{});let E=u(w.writable,C);return p(E,C),Object.defineProperty(E,m,{value:b,writable:!1}),Object.defineProperty(E,g,{value:y,writable:!1}),r.workflowDeploymentId&&Object.defineProperty(E,c,{value:r.workflowDeploymentId,writable:!1}),e(r.encryptionKey)&&Object.defineProperty(E,d,{value:n(r.encryptionKey.keyPair.publicKey),writable:!1}),x.set(b,{writable:E,state:C}),E}export{r as FatalError,i as RetryableError,w as createHook,T as createWebhook,E as defineHook,O as getStepMetadata,k as getWorkflowMetadata,A as getWritable,D as setAttributes,C as sleep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{k as e}from"../../_chunks/workflow/dist-xTushGCp.js";import{i as t,n}from"../../_chunks/workflow/global-DFW-hO6M.js";const r=Symbol.for(`@workflow/core//registeredSteps`),i=globalThis,a=i[r]??=new Map,o=new Set([`__builtin_response_array_buffer`,`__builtin_response_json`,`__builtin_response_text`]);function s(e){let t=e.split(`//`);if(t.length!==3||t[0]!==`step`)return[];let n=t[1],r=t[2],i=new Set,a=e=>{e!==n&&i.add(e)};if(n.startsWith(`./workflows/`)){let e=n.slice(2);a(`./example/${e}`),a(`./src/${e}`)}else if(n.startsWith(`./example/workflows/`)){let e=n.slice(10);a(`./${e}`),a(`./src/${e}`)}else if(n.startsWith(`./src/workflows/`)){let e=n.slice(6);a(`./${e}`),a(`./example/${e}`)}return Array.from(i,e=>`step//${e}//${r}`)}function c(e){if(o.has(e)){for(let[t,n]of a.entries())if(t.endsWith(`//${e}`))return n}}function l(e,t){a.set(e,t),t.stepId=e}function u(e){let t=a.get(e);if(t)return t;for(let t of s(e)){let e=a.get(t);if(e)return e}let n=c(e);if(n)return n}const d={hook:[`hook`,`wait`,`step`],wait:[`hook`,`step`],step:[`wait`,`hook`,`step`]};function f(e,t,n,r){return n>=t||!d[e].includes(r.kind)?!1:!(e===`step`&&!r.armed)}function p(e,t,n,r){let i=r.get(t);if(i!==void 0)return i;let a=m(e,t,n,r);return r.set(t,a),a}function m(e,t,n,r){if(!n.armed)return!1;for(let[i,a]of e)if(f(n.kind,t,i,a)&&!p(e,i,a,r))return!1;return!0}function h(){return process.env.WORKFLOW_LOG_ORDER_DRAWS!==`0`}function g(e){return e===0&&typeof setImmediate==`function`?new Promise(e=>setImmediate(e)):new Promise(t=>setTimeout(t,e))}async function _(e,t){for(;;){let n=e.mintCount??0,r=e.pendingDeliveries;if(await g(await e.promiseQueue.then(()=>!1,()=>!0)?50:0),(e.mintCount??0)!==n||r!==0||e.pendingDeliveries!==0)continue;let i=!1;for(let[n,r]of e.pendingDeliveryBarriers??[])if(n<t&&r.armed){i=!0;break}if(!i)return}}async function v(e,t,n){if(t===void 0||!e.pendingDeliveryBarriers)return;let r=e.pendingDeliveryBarriers,i=[];for(let[e,a]of r)f(n,t,e,a)&&i.push(a.released);if(i.length>0&&await Promise.all(i),h()){await _(e,t);return}i.length>0&&await new Promise(e=>setTimeout(e,0))}function y(n,r,i,a={}){let o=n.pendingDeliveryBarriers;if(!o||r===void 0)return{markDelivered:()=>{},arm:()=>{}};let s=a=>{if(o.has(r))throw new e(`Delivery barrier already registered at event index ${r}`);let{promise:s,resolve:c}=t(),l={kind:i,released:s,armed:a,retired:!1,retire:()=>{l.retired||(l.retired=!0,o.get(r)===l&&o.delete(r),c())}};return o.set(r,l),x(n),l},c=s(a.armed??!0),l=!1;return{markDelivered:()=>{l||(l=!0,c.retire())},arm:()=>{if(!l){if(c.retired){c=s(!0);return}if(o.get(r)!==c)throw new e(`Delivery barrier lost ownership of event index ${r}`);c.armed=!0}}}}const b=new WeakSet;function x(e){let t=e.pendingDeliveryBarriers;if(!t||b.has(e))return;b.add(e);let n=()=>{setTimeout(i,0)},r=()=>{setTimeout(i,50)},i=()=>{if(t.size===0){b.delete(e);return}if(!S(e)){e.promiseQueue.then(n,r);return}for(;t.size>0&&S(e);){let e,n;for(let[r,i]of t)(e===void 0||r<e)&&(e=r,n=i);n?.retire()}setTimeout(i,0)};setTimeout(i,0)}function S(e){return e.pendingDeliveries===0&&!C(e)}function C(e){let t=e.pendingDeliveryBarriers;if(!t||t.size===0)return!1;let n=new Map;for(let[e,r]of t)if(p(t,e,r,n))return!0;return!1}function w(e){return e.pendingDeliveries===0&&(!e.pendingDeliveryBarriers||e.pendingDeliveryBarriers.size===0)}function T(e,t){let n=()=>{w(e)?t():e.promiseQueue.then(()=>{setTimeout(n,0)})};setTimeout(n,0)}function E(e){let t=e.suspensionGeneration;T(e,()=>{t===e.suspensionGeneration&&e.onWorkflowError(new n(e.invocationsQueue,e.globalThis))})}export{v as awaitEarlierDeliveries,u as getStepFunction,C as hasParkedCommittedDelivery,w as isDeliveryIdle,y as registerDeliveryBarrier,l as registerStepFunction,T as scheduleWhenIdle,E as scheduleWorkflowSuspension};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S,w as C,x as w,y as T}from"../../../_chunks/workflow/helpers-ClCA9Lmc.js";export{b as SLOT_GAP_RECHECK_ATTEMPTS,h as absorbSkippedSlotReport,v as appendEventLog,f as appendUniqueEvents,a as findEventSlotGap,g as getQueueOverhead,y as getWorkflowQueueName,s as handleHealthCheckMessage,p as healthCheck,x as insertEventByEventId,c as isSlotGapCheckEnabled,l as loadWorkflowRunEvents,_ as maxEventSlot,m as memoizeEncryptionKey,d as mergeReportedEvents,u as parseHealthCheckPayload,i as preconditionEventDelta,S as queueMessage,T as queueMessages,o as resolveRunEncryptionKey,w as rootRunIdFrom,n as runDispatchContext,e as settleEventSlotGap,C as slotSnapshotParams,r as stepDispatchIdempotencyKey,t as withHealthCheck};
|