eve 0.29.3 → 0.29.5
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 +31 -0
- package/dist/src/acp/adapter.d.ts +43 -0
- package/dist/src/acp/adapter.js +1 -0
- package/dist/src/acp/line-limit.d.ts +3 -0
- package/dist/src/acp/line-limit.js +1 -0
- package/dist/src/acp/server.d.ts +24 -0
- package/dist/src/acp/server.js +1 -0
- package/dist/src/channel/clear-session.d.ts +4 -0
- package/dist/src/channel/clear-session.js +1 -0
- package/dist/src/channel/compact-session.d.ts +4 -0
- package/dist/src/channel/compact-session.js +1 -0
- package/dist/src/channel/routes.d.ts +34 -6
- package/dist/src/channel/types.d.ts +61 -9
- package/dist/src/chunks/{use-eve-agent-DaH3cf8K.js → use-eve-agent-BXMIf5fR.js} +130 -11
- package/dist/src/chunks/{use-eve-agent-CyDt3Lny.js → use-eve-agent-k-XHfrJT.js} +130 -11
- package/dist/src/cli/acp/command.d.ts +22 -0
- package/dist/src/cli/acp/command.js +4 -0
- package/dist/src/cli/commands/agent-prompt/build-and-verify.md +4 -0
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/logs.js +2 -2
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +1 -1
- package/dist/src/cli/commands/registry-project.js +1 -1
- package/dist/src/cli/commands/registry-setup-command.js +1 -1
- package/dist/src/cli/commands/registry.d.ts +14 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace.d.ts +2 -2
- package/dist/src/cli/dev/command-options.d.ts +22 -0
- package/dist/src/cli/dev/command-options.js +1 -0
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/diagnostic-sink.js +1 -1
- package/dist/src/cli/dev/local-server-cleanup.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/message-queue.d.ts +9 -13
- package/dist/src/cli/dev/tui/message-queue.js +1 -1
- package/dist/src/cli/dev/tui/prompt-commands.d.ts +13 -5
- package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth.d.ts +6 -3
- package/dist/src/cli/dev/tui/remote-connection-probe.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +7 -7
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +14 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +5 -5
- package/dist/src/cli/dev/tui/terminal-background.d.ts +23 -0
- package/dist/src/cli/dev/tui/terminal-background.js +1 -0
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/traces/trace-content.d.ts +7 -0
- package/dist/src/cli/dev/tui/traces/trace-content.js +2 -2
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +10 -5
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-store.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-surfaces.d.ts +40 -0
- package/dist/src/cli/dev/tui/traces/trace-surfaces.js +1 -0
- package/dist/src/cli/dev/tui/traces/trace-view.d.ts +8 -1
- package/dist/src/cli/dev/tui/traces/trace-view.js +2 -2
- package/dist/src/cli/dev/tui/traces/trace-viewer-session.d.ts +13 -0
- package/dist/src/cli/dev/tui/traces/trace-viewer-session.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/invoke/invoke.js +1 -1
- package/dist/src/cli/invoke/result.js +1 -1
- package/dist/src/cli/run.d.ts +3 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/cli/ui/terminal-text.d.ts +0 -3
- package/dist/src/cli/ui/terminal-text.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +2 -2
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/index.d.ts +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session.d.ts +29 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +29 -0
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/@agentclientprotocol/sdk/LICENSE +191 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/index.d.ts +1835 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/index.js +65 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/jsonrpc.d.ts +603 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/schema/guards.gen.d.ts +199 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/schema/index.d.ts +51 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/schema/types.gen.d.ts +6118 -0
- package/dist/src/compiled/@agentclientprotocol/sdk/stream.d.ts +35 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +8 -8
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +11 -22
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/compiler/normalize-agent-config.d.ts +3 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +1 -0
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +3 -0
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.d.ts +22 -0
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -0
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +13 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/run-step.js +1 -1
- package/dist/src/discover/project-source.js +1 -1
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/loaders/json.js +1 -1
- package/dist/src/evals/loaders/yaml.js +1 -1
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/discover.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +1 -1
- package/dist/src/evals/session.js +1 -1
- package/dist/src/execution/create-session-step.d.ts +2 -0
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/delegation-tool.d.ts +3 -0
- package/dist/src/execution/delegation-tool.js +1 -0
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -1
- package/dist/src/execution/effective-agent-config.d.ts +12 -0
- package/dist/src/execution/effective-agent-config.js +1 -0
- package/dist/src/execution/node-step.d.ts +4 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/runtime-context.d.ts +2 -0
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.js +1 -1
- package/dist/src/execution/session-callback-request.d.ts +5 -0
- package/dist/src/execution/session-callback-request.js +1 -0
- package/dist/src/execution/session-delivery-hook.d.ts +1 -0
- package/dist/src/execution/session-delivery-hook.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-event-proxy-step.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +2 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/agent-handles.d.ts +238 -0
- package/dist/src/harness/agent-handles.js +2 -0
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/compaction.d.ts +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +16 -0
- package/dist/src/internal/application/build-profile.js +1 -1
- package/dist/src/internal/application/build-workspace.js +1 -1
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +8 -8
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/output-publication-artifacts.js +1 -1
- package/dist/src/internal/application/output-publication-journal.js +1 -1
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/application/production-compiler-artifacts.js +1 -1
- package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
- package/dist/src/internal/authored-asset-import-plugin.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-package-tsconfig-paths.js +1 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
- package/dist/src/internal/nitro/host/copy-host-middleware.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/cron-handler-route.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.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/dev-host-workspace.js +1 -1
- package/dist/src/internal/nitro/host/dev-server-http.js +1 -1
- package/dist/src/internal/nitro/host/dev-server-state.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/host/extension-build-config.js +1 -1
- package/dist/src/internal/nitro/host/extension-declarations.js +2 -2
- package/dist/src/internal/nitro/host/extension-distribution.js +3 -3
- package/dist/src/internal/nitro/host/extension-state-usage.js +1 -1
- package/dist/src/internal/nitro/host/normalize-vercel-service-crons.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +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/vercel/project-link.js +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.js +6 -6
- package/dist/src/internal/workflow-bundle/builder.js +3 -3
- package/dist/src/internal/workflow-bundle/nitro-step-entry.js +2 -2
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/clear-session.d.ts +14 -0
- package/dist/src/protocol/clear-session.js +1 -0
- package/dist/src/protocol/compact-session.d.ts +14 -0
- package/dist/src/protocol/compact-session.js +1 -0
- package/dist/src/protocol/message.d.ts +19 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/protocol/routes.d.ts +10 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/verify.js +1 -1
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/github/auth.js +2 -2
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/verify.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/linear/inbound.js +2 -2
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/linear/verify.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/verify.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +32 -1
- package/dist/src/public/definitions/agent.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +5 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +1 -0
- package/dist/src/public/definitions/tool.d.ts +4 -1
- package/dist/src/public/index.d.ts +1 -2
- package/dist/src/public/index.js +1 -1
- package/dist/src/public/models/openai/chatgpt/auth.js +1 -1
- package/dist/src/public/next/server.js +2 -2
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/nuxt/vercel-services.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/sveltekit/vercel-json.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +2 -18
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +2 -2
- package/dist/src/runtime/framework-tools/file-state.js +1 -1
- package/dist/src/runtime/framework-tools/index.d.ts +7 -2
- package/dist/src/runtime/framework-tools/index.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-dynamic-subagent.d.ts +12 -0
- package/dist/src/runtime/resolve-dynamic-subagent.js +1 -0
- package/dist/src/runtime/resolve-dynamic-tool.d.ts +15 -0
- package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +22 -0
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -0
- package/dist/src/runtime/subagents/registry.d.ts +10 -2
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -2
- package/dist/src/runtime/workspace/seed-files.js +1 -1
- package/dist/src/setup/boxes/detect-ai-gateway.js +1 -1
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/index.d.ts +1 -0
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/integrations/discord/api.d.ts +15 -0
- package/dist/src/setup/integrations/discord/api.js +1 -0
- package/dist/src/setup/integrations/discord/connect.d.ts +24 -0
- package/dist/src/setup/integrations/discord/connect.js +1 -0
- package/dist/src/setup/integrations/discord/setup.d.ts +19 -0
- package/dist/src/setup/integrations/discord/setup.js +8 -0
- package/dist/src/setup/integrations/registry.js +1 -1
- package/dist/src/setup/package-manager.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +3 -3
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/registry-setup-client.d.ts +6 -2
- package/dist/src/setup/registry-setup-client.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/extension.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -9
- package/dist/src/setup/scaffold/files.js +1 -1
- package/dist/src/setup/scaffold/update/channels.js +2 -2
- package/dist/src/setup/scaffold/update/connections.js +1 -1
- package/dist/src/setup/scaffold/workspace-root.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +7 -0
- package/dist/src/shared/agent-turn-outcome.d.ts +47 -0
- package/dist/src/shared/agent-turn-outcome.js +1 -0
- package/dist/src/shared/dynamic-tool-definition.d.ts +1 -5
- package/dist/src/shared/dynamic-tool-definition.js +1 -1
- package/dist/src/shared/guards.d.ts +2 -0
- package/dist/src/shared/guards.js +1 -1
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +4 -4
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/vercel-output-directory.js +1 -1
- package/dist/src/source-change/static-source-change.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-trace-reader.d.ts +22 -5
- package/dist/src/tracing/local-trace-reader.js +1 -1
- package/dist/src/tracing/local-trace-retention.js +1 -1
- package/dist/src/tracing/local-trace-span-processor.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/custom.mdx +41 -1
- package/docs/channels/discord.mdx +30 -14
- package/docs/channels/eve.mdx +26 -1
- package/docs/concepts/default-harness.md +4 -0
- package/docs/guides/acp.md +91 -0
- package/docs/guides/client/streaming.mdx +38 -0
- package/docs/guides/dev-tui.md +10 -7
- package/docs/guides/dynamic-capabilities.md +49 -6
- package/docs/guides/meta.json +1 -0
- package/docs/reference/cli.md +3 -0
- package/docs/reference/project-layout.md +1 -1
- package/docs/reference/typescript-api.md +48 -48
- package/docs/subagents.mdx +32 -2
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.29.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c0dc572: Rename the TUI `/new` command to `/reset` so session reset uses the same name across the client, HTTP, channel, and TUI APIs.
|
|
8
|
+
- 3dce30a: Add manual session compaction through custom-channel helpers, the eve HTTP client, and the `eve dev` TUI's `/compact` command. Compaction preserves the session, queues behind an active turn, and does not send synthetic model input.
|
|
9
|
+
- 910805e: Make a single `Esc` cancel the running turn in the eve dev TUI when no message is queued. Queued messages still use `Esc` to steer the oldest message into the next turn.
|
|
10
|
+
- 9c51755: Connection search and discovered connection tools now use the same `defineDynamic` and `defineTool` pipeline as authored tools. Dynamic tool maps now reject entries that omit `defineTool` instead of accepting unsupported raw objects.
|
|
11
|
+
- 84aa671: Clarify the dev TUI’s `/add` flow with consistent integration categories and category-specific browsing labels. MCP connections are now named explicitly, and the flow more clearly explains channels, extensions, and observability integrations.
|
|
12
|
+
- 0c28eb7: Allow declared subagents to export `defineDynamic` from `agent.ts`. Session and turn resolvers can now return an agent configuration to expose it or nil to omit it from direct and Workflow delegation.
|
|
13
|
+
- f3bb60d: Add manual session-context clearing through custom-channel helpers, the eve HTTP client, and the `eve dev` TUI's `/clear` command. Clearing removes model-message history while preserving the session, agent configuration, durable state, limits, and sandbox.
|
|
14
|
+
- ac7d3c6: Add `/cancel` to the eve dev TUI. The command cooperatively cancels a running turn from either the live streaming input or the idle prompt while preserving the session and settled context.
|
|
15
|
+
|
|
16
|
+
## 0.29.4
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- e90a8c2: Launch local or deployed eve applications as stable ACP v1 agents with `eve acp [url]`, including streamed messages, tool activity, human input, cancellation, concurrent sessions, and verified Vercel authentication.
|
|
21
|
+
- cec672d: Add guided Discord setup through `eve add channel/discord`, including Vercel Connect provisioning, trigger attachment, interactions endpoint configuration, slash-command registration, and channel scaffolding.
|
|
22
|
+
- ed328e7: Render registry item titles with their exact registry-provided casing by loading manifests for each page of catalog results.
|
|
23
|
+
- c875a67: Update the generated `AGENTS.md` to direct coding agents to the eve registry for discovering and installing integrations.
|
|
24
|
+
- 5153b13: Add JSON output to `eve registry list` and `eve registry search` for scripts that inspect registry catalogs.
|
|
25
|
+
- 155d46a: Connection registry items now configure their Vercel Connect connector during `eve add`, and registry setup commands close their IPC channel after reporting an outcome so `/add` returns instead of remaining stuck.
|
|
26
|
+
- 6f3daca: Add `ClientSession.snapshot()` for reading a finite, cursor-consistent session event prefix that can hydrate server-rendered applications.
|
|
27
|
+
- 67bfc76: Resolve sandbox skill roots and seed-file paths through the same `$HOME` resolver the file tools use, so the skills location is spelled once instead of twice.
|
|
28
|
+
- a5acde8: Ensure exiting the dev TUI shuts down its owned server and any surviving workflow processes before the CLI exits. Persisted workflow messages now reach the ready worker during restart instead of being rejected while the file watcher starts.
|
|
29
|
+
- 731464f: Give the local trace spool's on-disk layout a single owner: the shared trace reader now exposes the listing and segment-read primitives that `eve traces` and the `/traces` viewer both use, and payload formatting is shared between the detail panel and the conversation view.
|
|
30
|
+
- f7ba3b3: Derive the `/traces` conversation viewer's line geometry from one prefix-sum helper so scroll, click, and wheel math cannot disagree, and reset the view through a single factory when the viewed trace changes.
|
|
31
|
+
- 3f4bb9c: The `/traces` viewer now follows your terminal's colors instead of forcing a hardcoded black/grey truecolor palette. It probes the terminal's default background (OSC 11) and derives its card surfaces from your own theme — subtly elevated bands on dark and light backgrounds alike, with red bands for failures, and card titles that invert to black on light backgrounds so they stay legible. Terminals that don't answer the probe get a clean gutter-rail rendering drawn entirely with the shared TUI theme.
|
|
32
|
+
- f5d0533: Derive the dev TUI's slash-command suggestion window from the command registry instead of a hand-maintained constant, and collapse the duplicated cursor step in the terminal line-wrap loop.
|
|
33
|
+
|
|
3
34
|
## 0.29.3
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type AgentContext, type InitializeRequest, type InitializeResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse } from "#compiled/@agentclientprotocol/sdk/index.js";
|
|
2
|
+
import type { ClientOptions, SendTurnInput, SessionState } from "#client/types.js";
|
|
3
|
+
import type { HandleMessageStreamEvent } from "#protocol/message.js";
|
|
4
|
+
interface AdapterClientSession {
|
|
5
|
+
readonly state: SessionState;
|
|
6
|
+
send(input: SendTurnInput): Promise<AsyncIterable<HandleMessageStreamEvent>>;
|
|
7
|
+
cancel(options?: {
|
|
8
|
+
turnId?: string;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
reset(): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface AdapterClient {
|
|
13
|
+
session(): AdapterClientSession;
|
|
14
|
+
}
|
|
15
|
+
/** Configuration for translating one ACP client connection to an eve server. */
|
|
16
|
+
export interface EveAcpAdapterOptions {
|
|
17
|
+
readonly eveVersion: string;
|
|
18
|
+
readonly auth?: ClientOptions["auth"];
|
|
19
|
+
readonly headers?: ClientOptions["headers"];
|
|
20
|
+
readonly serverUrl: string;
|
|
21
|
+
/** Local workspace root to enforce; omit when connecting to a remote deployment. */
|
|
22
|
+
readonly workspaceRoot?: string;
|
|
23
|
+
/** @internal Test seam for the public eve client boundary. */
|
|
24
|
+
readonly client?: AdapterClient;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Translates stable ACP v1 sessions onto the public eve HTTP client.
|
|
28
|
+
*
|
|
29
|
+
* The adapter owns only process-local ACP identities. Conversation durability,
|
|
30
|
+
* event cursors, cancellation, and reset behavior remain owned by
|
|
31
|
+
* {@link ClientSession}.
|
|
32
|
+
*/
|
|
33
|
+
export declare class EveAcpAdapter {
|
|
34
|
+
#private;
|
|
35
|
+
constructor(options: EveAcpAdapterOptions);
|
|
36
|
+
initialize(params: InitializeRequest): InitializeResponse;
|
|
37
|
+
newSession(params: NewSessionRequest): Promise<NewSessionResponse>;
|
|
38
|
+
prompt(params: PromptRequest, client: AgentContext, signal: AbortSignal): Promise<PromptResponse>;
|
|
39
|
+
cancel(sessionId: string): Promise<void>;
|
|
40
|
+
closeSession(sessionId: string): Promise<void>;
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,preserveCompletedSessions:!0,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(t){if(t.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((t.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let e=await normalizedRealpath(t.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(e!==n)throw RequestError.invalidParams({cwd:t.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let n=randomUUID();return this.#i.set(n,{client:this.#e.session(),tools:new Map}),{sessionId:n}}async prompt(e,t,n){let i=this.#s(e.sessionId);if(i.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let a=promptContent(e);i.tools.clear();let o=Promise.withResolvers(),s={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:o.promise,resolveSettled:o.resolve};i.active=s;let onProtocolCancel=()=>{s.protocolCancelled=!0,this.#o(i).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let o={message:a};for(;;){let a=await i.client.send(o);(s.cancelRequested||s.protocolCancelled)&&await this.#o(i);let c=[],l=!1,u,d;for await(let n of a){let r=`data`in n&&`turnId`in n.data?n.data.turnId:void 0;typeof r==`string`&&(s.turnId=r),n.type===`input.requested`&&c.push(...n.data.requests),n.type===`authorization.required`&&(d=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(l=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(u=n),await this.#c(e.sessionId,i,n,t)}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(l||s.cancelRequested)return{stopReason:`cancelled`};if(u!==void 0)throw eveFailure(u);if(d!==void 0)throw d;if(c.length===0)return{stopReason:`end_turn`};let f;try{f=await Promise.all(c.map(r=>this.#l(e.sessionId,i,r,t,n)))}catch(t){if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};throw t}if(s.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(s.cancelRequested)return{stopReason:`cancelled`};o={inputResponses:f}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),i.tools.clear(),s.resolveSettled(),i.active===s&&(i.active=void 0)}}async cancel(e){let t=this.#i.get(e);t===void 0||t.active===void 0||(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client.state.sessionId!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,a,o){let c=AbortSignal.any([o,t.active.outboundController.signal]);if(n.display===`confirmation`){let o=`${n.requestId}:approve`,s=`${n.requestId}:deny`,l=t.tools.get(n.action.callId)??toolCallForAction(n.action),u=await a.request(methods.client.session.requestPermission,{sessionId:e,toolCall:l,options:[{kind:`allow_once`,name:`Approve`,optionId:o},{kind:`reject_once`,name:`Deny`,optionId:s}]},{cancellationSignal:c});if(u.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(u.outcome.optionId===o)return{requestId:n.requestId,optionId:`approve`};if(u.outcome.optionId===s)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:u.outcome.optionId},`Unknown ACP permission option`)}if(!this.#r)throw unsupported(`The ACP client does not support form elicitation required by this eve question.`);let l=elicitationProperty(n),u=await a.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:l},required:[ANSWER_FIELD]}},{cancellationSignal:c});if(u.action!==`accept`)return this.#u(t),{requestId:n.requestId};let d=u.content?.[ANSWER_FIELD];if(typeof d!=`string`)throw RequestError.invalidParams(u.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===d))throw RequestError.invalidParams({answer:d},`Unknown eve question option`);return{requestId:n.requestId,optionId:d}}return{requestId:n.requestId,text:d}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,n){try{return await realpath(e)}catch(t){throw RequestError.invalidParams({path:e},`Could not resolve ${n}: ${errorMessage(t)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const ACP_MAX_LINE_BYTES=10*1024*1024;function limitAcpLineBytes(t=ACP_MAX_LINE_BYTES){let n=0;return new TransformStream({transform(e,r){for(let i of e){if(i===10){n=0;continue}if(n+=1,n>t){r.error(Error(`ACP message exceeds the ${t}-byte line limit.`));return}}r.enqueue(e)}})}export{ACP_MAX_LINE_BYTES,limitAcpLineBytes};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Readable, Writable } from "node:stream";
|
|
2
|
+
import { type EveAcpAdapterOptions } from "#acp/adapter.js";
|
|
3
|
+
import type { ClientOptions } from "#client/types.js";
|
|
4
|
+
/** Configuration for one ACP stdio connection backed by an eve server. */
|
|
5
|
+
export interface RunAcpServerOptions {
|
|
6
|
+
readonly auth?: ClientOptions["auth"];
|
|
7
|
+
readonly eveVersion: string;
|
|
8
|
+
readonly headers?: ClientOptions["headers"];
|
|
9
|
+
readonly serverUrl: string;
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
/** Local workspace root to enforce; omit when connecting to a remote deployment. */
|
|
12
|
+
readonly workspaceRoot?: string;
|
|
13
|
+
/** @internal Test seam for the public eve client boundary. */
|
|
14
|
+
readonly client?: EveAcpAdapterOptions["client"];
|
|
15
|
+
}
|
|
16
|
+
/** Node streams for one ACP stdio connection. */
|
|
17
|
+
export interface AcpServerStreams {
|
|
18
|
+
readonly input: Readable;
|
|
19
|
+
readonly output: Writable;
|
|
20
|
+
}
|
|
21
|
+
/** Serves one stable ACP v1 connection over process stdio until the client disconnects. */
|
|
22
|
+
export declare function runAcpServer(options: RunAcpServerOptions): Promise<void>;
|
|
23
|
+
/** Serves one stable ACP v1 connection over the supplied Node streams. */
|
|
24
|
+
export declare function runAcpServerOnStreams(options: RunAcpServerOptions, streams: AcpServerStreams): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{agent,methods,ndJsonStream}from"#compiled/@agentclientprotocol/sdk/index.js";import{Readable,Writable}from"node:stream";import{EveAcpAdapter}from"#acp/adapter.js";import{limitAcpLineBytes}from"#acp/line-limit.js";async function runAcpServer(e){await runAcpServerOnStreams(e,{input:process.stdin,output:process.stdout})}async function runAcpServerOnStreams(r,i){let a=new EveAcpAdapter(r),o=agent({name:`eve`}).onRequest(methods.agent.initialize,({params:e})=>a.initialize(e)).onRequest(methods.agent.session.new,({params:e})=>a.newSession(e)).onRequest(methods.agent.session.prompt,({params:e,client:t,signal:n})=>a.prompt(e,t,n)).onRequest(methods.agent.session.close,({params:e})=>a.closeSession(e.sessionId)).onNotification(methods.agent.session.cancel,({params:e})=>a.cancel(e.sessionId)),s=Writable.toWeb(i.output),c=Readable.toWeb(i.input).pipeThrough(limitAcpLineBytes()),l=o.connect(ndJsonStream(s,c)),close=()=>l.close();r.signal?.aborted?close():r.signal?.addEventListener(`abort`,close,{once:!0});try{await l.closed}finally{r.signal?.removeEventListener(`abort`,close),await a.close()}}export{runAcpServer,runAcpServerOnStreams};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function createClearFn(e,t){return async n=>await e.clearSession({continuationToken:`${t}:${n.continuationToken}`})}export{createClearFn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function createCompactFn(e,t){return async n=>await e.compactSession({continuationToken:`${t}:${n.continuationToken}`})}export{createCompactFn};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UserContent } from "ai";
|
|
2
2
|
import type { CrossChannelReceiveFn } from "#channel/cross-channel-receive.js";
|
|
3
|
-
import type { CancelTurnResult, SessionAuthContext, SessionCallback } from "#channel/types.js";
|
|
3
|
+
import type { CancelTurnResult, ClearSessionResult, CompactSessionResult, SessionAuthContext, SessionCallback } from "#channel/types.js";
|
|
4
4
|
import type { InputResponse } from "#runtime/input/types.js";
|
|
5
5
|
import type { Session } from "#channel/session.js";
|
|
6
6
|
import type { RunMode } from "#shared/run-mode.js";
|
|
@@ -10,11 +10,13 @@ type WebSocketHeaders = Headers | readonly (readonly [string, string])[] | Recor
|
|
|
10
10
|
/**
|
|
11
11
|
* Second argument passed to every route handler. `send` starts or continues a
|
|
12
12
|
* session on this channel; `cancel` stops the active turn on a session
|
|
13
|
-
* addressed by continuation token; `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* addressed by continuation token; `clear` removes its model-message history;
|
|
14
|
+
* `compact` summarizes its context without sending model input; `reset` retires
|
|
15
|
+
* a session so its token can start a fresh session; `getSession` looks one up by
|
|
16
|
+
* id; `receive` hands inbound work to a different channel; `params` contains
|
|
17
|
+
* the matched path parameters; `waitUntil` keeps background work alive past
|
|
18
|
+
* the response; `requestIp` is the client IP, or `null` when the host cannot
|
|
19
|
+
* provide it.
|
|
18
20
|
*/
|
|
19
21
|
export interface RouteHandlerArgs<TState = undefined> {
|
|
20
22
|
send: SendFn<TState>;
|
|
@@ -24,6 +26,8 @@ export interface RouteHandlerArgs<TState = undefined> {
|
|
|
24
26
|
*/
|
|
25
27
|
resolveActiveSession: ResolveActiveSessionFn;
|
|
26
28
|
cancel: CancelFn;
|
|
29
|
+
clear: ClearFn;
|
|
30
|
+
compact: CompactFn;
|
|
27
31
|
reset: ResetFn;
|
|
28
32
|
getSession: GetSessionFn;
|
|
29
33
|
/**
|
|
@@ -119,6 +123,30 @@ export interface CancelOptions {
|
|
|
119
123
|
* on the event stream.
|
|
120
124
|
*/
|
|
121
125
|
export type CancelFn = (options: CancelOptions) => Promise<CancelTurnResult>;
|
|
126
|
+
/** Options for {@link CompactFn}. */
|
|
127
|
+
export interface CompactOptions {
|
|
128
|
+
/** Channel-local raw token, in the same format accepted by {@link SendFn}. */
|
|
129
|
+
readonly continuationToken: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Queues context compaction for the session owning a continuation token.
|
|
133
|
+
* Never sends model input or starts a new session. An accepted request returns
|
|
134
|
+
* to `session.waiting`; successful compaction emits `compaction.requested`
|
|
135
|
+
* followed by `compaction.completed` on the session stream.
|
|
136
|
+
*/
|
|
137
|
+
export type CompactFn = (options: CompactOptions) => Promise<CompactSessionResult>;
|
|
138
|
+
/** Options for {@link ClearFn}. */
|
|
139
|
+
export interface ClearOptions {
|
|
140
|
+
/** Channel-local raw token, in the same format accepted by {@link SendFn}. */
|
|
141
|
+
readonly continuationToken: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Queues removal of the model-message history for the session owning a
|
|
145
|
+
* continuation token. Preserves the session, agent configuration, durable
|
|
146
|
+
* state, limits, and sandbox. Completion is `context.cleared` followed by
|
|
147
|
+
* `session.waiting` on the session stream.
|
|
148
|
+
*/
|
|
149
|
+
export type ClearFn = (options: ClearOptions) => Promise<ClearSessionResult>;
|
|
122
150
|
/** Options for {@link ResetFn}. */
|
|
123
151
|
export interface ResetOptions {
|
|
124
152
|
/** Channel-local raw token, in the same format accepted by {@link SendFn}. */
|
|
@@ -27,6 +27,28 @@ export interface CancelTurnResult {
|
|
|
27
27
|
*/
|
|
28
28
|
readonly reason?: string;
|
|
29
29
|
}
|
|
30
|
+
/** Identifies the continuation hook whose durable session should compact. */
|
|
31
|
+
export interface CompactSessionInput {
|
|
32
|
+
readonly continuationToken: string;
|
|
33
|
+
}
|
|
34
|
+
/** Result of queueing manual context compaction for a session. */
|
|
35
|
+
export type CompactSessionResult = {
|
|
36
|
+
readonly status: "accepted";
|
|
37
|
+
readonly sessionId: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly status: "no_active_session";
|
|
40
|
+
};
|
|
41
|
+
/** Identifies the continuation hook whose durable session should clear context. */
|
|
42
|
+
export interface ClearSessionInput {
|
|
43
|
+
readonly continuationToken: string;
|
|
44
|
+
}
|
|
45
|
+
/** Result of queueing a manual context clear for a session. */
|
|
46
|
+
export type ClearSessionResult = {
|
|
47
|
+
readonly status: "accepted";
|
|
48
|
+
readonly sessionId: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly status: "no_active_session";
|
|
51
|
+
};
|
|
30
52
|
/** Identifies a session to transition permanently to a terminal state. */
|
|
31
53
|
export interface TerminateSessionInput {
|
|
32
54
|
/** Human-readable reason recorded on the terminal workflow transition. */
|
|
@@ -100,6 +122,18 @@ export interface SessionAuthContext {
|
|
|
100
122
|
* interface: the runtime always writes events itself.
|
|
101
123
|
*/
|
|
102
124
|
export type EventEmitFn = (event: UnstampedMessageStreamEvent) => Promise<void>;
|
|
125
|
+
/** Framework-internal caller waiting for one delegated conversation turn. */
|
|
126
|
+
export interface TurnCaller {
|
|
127
|
+
readonly callId: string;
|
|
128
|
+
readonly subagentName: string;
|
|
129
|
+
readonly replyTo: {
|
|
130
|
+
readonly kind: "hook";
|
|
131
|
+
readonly token: string;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: "callback";
|
|
134
|
+
readonly url: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
103
137
|
/**
|
|
104
138
|
* Base deliver payload crossing the runtime boundary.
|
|
105
139
|
*
|
|
@@ -122,12 +156,13 @@ export interface DeliverPayload {
|
|
|
122
156
|
/**
|
|
123
157
|
* Deliver payload sent through the workflow `resumeHook`.
|
|
124
158
|
*
|
|
125
|
-
* Wraps the raw {@link DeliverPayload} with
|
|
126
|
-
*
|
|
127
|
-
* side-channel.
|
|
159
|
+
* Wraps the raw {@link DeliverPayload} with optional auth and turn-caller
|
|
160
|
+
* metadata so both cross the durable hook boundary outside adapter-owned data.
|
|
128
161
|
*/
|
|
129
162
|
export interface DeliverHookPayload {
|
|
130
163
|
readonly auth?: SessionAuthContext | null;
|
|
164
|
+
/** Delegated caller waiting for this turn's settled result. */
|
|
165
|
+
readonly caller?: TurnCaller;
|
|
131
166
|
/** Inbound channel request id used only for workflow attributes. */
|
|
132
167
|
readonly requestId?: string;
|
|
133
168
|
readonly kind: "deliver";
|
|
@@ -137,6 +172,14 @@ export interface DeliverHookPayload {
|
|
|
137
172
|
export interface SessionTimeoutHookPayload {
|
|
138
173
|
readonly kind: "session-timeout";
|
|
139
174
|
}
|
|
175
|
+
/** Requests a context compaction without delivering model input. */
|
|
176
|
+
export interface CompactSessionHookPayload {
|
|
177
|
+
readonly kind: "compact";
|
|
178
|
+
}
|
|
179
|
+
/** Requests a context clear without delivering model input. */
|
|
180
|
+
export interface ClearSessionHookPayload {
|
|
181
|
+
readonly kind: "clear";
|
|
182
|
+
}
|
|
140
183
|
/**
|
|
141
184
|
* Runtime-action results resumed back into a parked parent workflow.
|
|
142
185
|
*/
|
|
@@ -192,13 +235,15 @@ export interface SubagentAuthorizationEventHookPayload {
|
|
|
192
235
|
/**
|
|
193
236
|
* Serializable payload sent through the workflow `resumeHook`.
|
|
194
237
|
*/
|
|
195
|
-
export type HookPayload = DeliverHookPayload | RuntimeActionResultHookPayload | SessionTimeoutHookPayload | SubagentAuthorizationEventHookPayload | SubagentInputRequestHookPayload;
|
|
238
|
+
export type HookPayload = ClearSessionHookPayload | CompactSessionHookPayload | DeliverHookPayload | RuntimeActionResultHookPayload | SessionTimeoutHookPayload | SubagentAuthorizationEventHookPayload | SubagentInputRequestHookPayload;
|
|
196
239
|
/**
|
|
197
|
-
*
|
|
240
|
+
* Initial caller callback attached to a delegated session at creation.
|
|
198
241
|
*
|
|
199
242
|
* `url` is the absolute callback endpoint. `token` is the capability token
|
|
200
243
|
* embedded in the framework-owned callback route. `callId` and `subagentName`
|
|
201
|
-
* correlate the callee's
|
|
244
|
+
* correlate the callee's result to the pending tool call. Task sessions send a
|
|
245
|
+
* terminal session result. Conversation sessions use this as their first turn's
|
|
246
|
+
* caller; each continuation supplies the caller for that turn.
|
|
202
247
|
*/
|
|
203
248
|
export interface SessionCallback {
|
|
204
249
|
readonly callId: string;
|
|
@@ -265,8 +310,9 @@ export interface RunInput {
|
|
|
265
310
|
*/
|
|
266
311
|
readonly title?: string;
|
|
267
312
|
/**
|
|
268
|
-
* Optional
|
|
269
|
-
*
|
|
313
|
+
* Optional caller callback. Task sessions post when the session completes or
|
|
314
|
+
* fails. Conversation sessions use it for the first turn; continuations carry
|
|
315
|
+
* the caller for their own turn.
|
|
270
316
|
*/
|
|
271
317
|
readonly callback?: SessionCallback;
|
|
272
318
|
/**
|
|
@@ -312,12 +358,14 @@ export interface RunInput {
|
|
|
312
358
|
}
|
|
313
359
|
export interface DeliverInput {
|
|
314
360
|
/**
|
|
315
|
-
* Authenticated
|
|
361
|
+
* Authenticated principal for this follow-up message.
|
|
316
362
|
* May differ from the session initiator when different users send
|
|
317
363
|
* messages to the same session. The runtime updates `AuthKey` from
|
|
318
364
|
* this field before calling the adapter's hooks.
|
|
319
365
|
*/
|
|
320
366
|
readonly auth?: SessionAuthContext | null;
|
|
367
|
+
/** Delegated caller waiting for this turn's settled result. */
|
|
368
|
+
readonly caller?: TurnCaller;
|
|
321
369
|
/** Inbound channel request id used to correlate workflow attributes. */
|
|
322
370
|
readonly requestId?: string;
|
|
323
371
|
readonly continuationToken: string;
|
|
@@ -364,6 +412,10 @@ export interface Runtime {
|
|
|
364
412
|
run(input: RunInput): Promise<RunHandle>;
|
|
365
413
|
/** Requests cancellation of a session's in-flight turn. */
|
|
366
414
|
cancelTurn(input: CancelTurnInput): Promise<CancelTurnResult>;
|
|
415
|
+
/** Queues context compaction on the session owning a continuation token. */
|
|
416
|
+
compactSession(input: CompactSessionInput): Promise<CompactSessionResult>;
|
|
417
|
+
/** Queues a context clear on the session owning a continuation token. */
|
|
418
|
+
clearSession(input: ClearSessionInput): Promise<ClearSessionResult>;
|
|
367
419
|
/** Terminally retires a session and releases its non-retained continuation hooks. */
|
|
368
420
|
terminateSession(input: TerminateSessionInput): Promise<TerminateSessionResult>;
|
|
369
421
|
/**
|
|
@@ -7,6 +7,8 @@ const EVE_HEALTH_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/health`;
|
|
|
7
7
|
const EVE_INFO_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/info`;
|
|
8
8
|
const EVE_CREATE_SESSION_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/session`;
|
|
9
9
|
const EVE_RESET_SESSION_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/session/reset`;
|
|
10
|
+
const EVE_COMPACT_SESSION_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/session/compact`;
|
|
11
|
+
const EVE_CLEAR_SESSION_ROUTE_PATH = `${EVE_ROUTE_PREFIX}/session/clear`;
|
|
10
12
|
const EVE_CONTINUE_SESSION_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId`;
|
|
11
13
|
const EVE_MESSAGE_STREAM_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId/stream`;
|
|
12
14
|
const EVE_CANCEL_TURN_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/session/:sessionId/cancel`;
|
|
@@ -118,7 +120,7 @@ const schedule = entry.extend({
|
|
|
118
120
|
markdown: z.string().optional()
|
|
119
121
|
});
|
|
120
122
|
const subagent = entry.extend({
|
|
121
|
-
description: z.string(),
|
|
123
|
+
description: z.string().optional(),
|
|
122
124
|
entryPath: z.string(),
|
|
123
125
|
nodeId: z.string(),
|
|
124
126
|
rootPath: z.string(),
|
|
@@ -383,6 +385,28 @@ const CancelTurnResponseSchema = z.object({
|
|
|
383
385
|
status: z.enum(["accepted", "no_active_turn"])
|
|
384
386
|
});
|
|
385
387
|
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/protocol/clear-session.ts
|
|
390
|
+
const ClearResponseSchema = z.discriminatedUnion("status", [z.object({
|
|
391
|
+
ok: z.literal(true),
|
|
392
|
+
sessionId: z.string().min(1),
|
|
393
|
+
status: z.literal("accepted")
|
|
394
|
+
}), z.object({
|
|
395
|
+
ok: z.literal(true),
|
|
396
|
+
status: z.literal("no_active_session")
|
|
397
|
+
})]);
|
|
398
|
+
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/protocol/compact-session.ts
|
|
401
|
+
const CompactResponseSchema = z.discriminatedUnion("status", [z.object({
|
|
402
|
+
ok: z.literal(true),
|
|
403
|
+
sessionId: z.string().min(1),
|
|
404
|
+
status: z.literal("accepted")
|
|
405
|
+
}), z.object({
|
|
406
|
+
ok: z.literal(true),
|
|
407
|
+
status: z.literal("no_active_session")
|
|
408
|
+
})]);
|
|
409
|
+
|
|
386
410
|
//#endregion
|
|
387
411
|
//#region src/protocol/reset-session.ts
|
|
388
412
|
const ResetResponseSchema = z.discriminatedUnion("status", [z.object({
|
|
@@ -679,6 +703,7 @@ async function openStreamBody(input) {
|
|
|
679
703
|
let response;
|
|
680
704
|
try {
|
|
681
705
|
response = await fetch(url, {
|
|
706
|
+
cache: "no-store",
|
|
682
707
|
headers,
|
|
683
708
|
redirect: input.redirect,
|
|
684
709
|
signal: input.signal ?? null
|
|
@@ -810,6 +835,33 @@ var ClientSession = class {
|
|
|
810
835
|
get state() {
|
|
811
836
|
return this.#state;
|
|
812
837
|
}
|
|
838
|
+
async snapshot(options) {
|
|
839
|
+
options?.signal?.throwIfAborted();
|
|
840
|
+
const initialState = this.#state;
|
|
841
|
+
const sessionId = initialState.sessionId;
|
|
842
|
+
if (!sessionId) throw new Error("Session has no session ID. Send a message first.");
|
|
843
|
+
const events = [];
|
|
844
|
+
for await (const event of this.#readStream({
|
|
845
|
+
follow: false,
|
|
846
|
+
sessionId,
|
|
847
|
+
signal: options?.signal,
|
|
848
|
+
startIndex: 0
|
|
849
|
+
})) events.push(event);
|
|
850
|
+
options?.signal?.throwIfAborted();
|
|
851
|
+
const lastEvent = events.at(-1);
|
|
852
|
+
const continuationToken = lastEvent?.type === "session.waiting" ? lastEvent.data.continuationToken : lastEvent?.type === "session.completed" && this.#context.preserveCompletedSessions ? initialState.continuationToken : void 0;
|
|
853
|
+
return {
|
|
854
|
+
events,
|
|
855
|
+
session: continuationToken === void 0 ? {
|
|
856
|
+
sessionId,
|
|
857
|
+
streamIndex: events.length
|
|
858
|
+
} : {
|
|
859
|
+
continuationToken,
|
|
860
|
+
sessionId,
|
|
861
|
+
streamIndex: events.length
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
813
865
|
async send(input) {
|
|
814
866
|
const payload = normalizeSendTurnInput(input);
|
|
815
867
|
const state = this.#state;
|
|
@@ -854,6 +906,66 @@ var ClientSession = class {
|
|
|
854
906
|
status: result.data.status
|
|
855
907
|
};
|
|
856
908
|
}
|
|
909
|
+
async clear() {
|
|
910
|
+
const state = this.#state;
|
|
911
|
+
const continuationToken = state.continuationToken;
|
|
912
|
+
if (continuationToken === void 0) {
|
|
913
|
+
if (state.sessionId !== void 0) throw new Error("Session has no continuation token. Consume its event stream before clearing.");
|
|
914
|
+
return { status: "no_active_session" };
|
|
915
|
+
}
|
|
916
|
+
const url = createClientUrl(this.#context.host, EVE_CLEAR_SESSION_ROUTE_PATH);
|
|
917
|
+
const headers = await this.#context.resolveHeaders();
|
|
918
|
+
headers.set("content-type", "application/json");
|
|
919
|
+
const response = await fetch(url, withRedirectPolicy$1({
|
|
920
|
+
body: JSON.stringify({ continuationToken }),
|
|
921
|
+
headers,
|
|
922
|
+
method: "POST"
|
|
923
|
+
}, this.#context.redirect));
|
|
924
|
+
const body = await response.text();
|
|
925
|
+
if (!response.ok) throw new ClientError(response.status, body, response.headers);
|
|
926
|
+
let payload;
|
|
927
|
+
try {
|
|
928
|
+
payload = JSON.parse(body);
|
|
929
|
+
} catch {
|
|
930
|
+
throw new Error(`Clear route returned invalid JSON (${response.status}).`);
|
|
931
|
+
}
|
|
932
|
+
const result = ClearResponseSchema.safeParse(payload);
|
|
933
|
+
if (!result.success || result.data.status === "accepted" && state.sessionId !== void 0 && result.data.sessionId !== state.sessionId) throw new Error(`Clear route returned an invalid response (${response.status}).`);
|
|
934
|
+
return result.data.status === "accepted" ? {
|
|
935
|
+
sessionId: result.data.sessionId,
|
|
936
|
+
status: "accepted"
|
|
937
|
+
} : { status: "no_active_session" };
|
|
938
|
+
}
|
|
939
|
+
async compact() {
|
|
940
|
+
const state = this.#state;
|
|
941
|
+
const continuationToken = state.continuationToken;
|
|
942
|
+
if (continuationToken === void 0) {
|
|
943
|
+
if (state.sessionId !== void 0) throw new Error("Session has no continuation token. Consume its event stream before compacting.");
|
|
944
|
+
return { status: "no_active_session" };
|
|
945
|
+
}
|
|
946
|
+
const url = createClientUrl(this.#context.host, EVE_COMPACT_SESSION_ROUTE_PATH);
|
|
947
|
+
const headers = await this.#context.resolveHeaders();
|
|
948
|
+
headers.set("content-type", "application/json");
|
|
949
|
+
const response = await fetch(url, withRedirectPolicy$1({
|
|
950
|
+
body: JSON.stringify({ continuationToken }),
|
|
951
|
+
headers,
|
|
952
|
+
method: "POST"
|
|
953
|
+
}, this.#context.redirect));
|
|
954
|
+
const body = await response.text();
|
|
955
|
+
if (!response.ok) throw new ClientError(response.status, body, response.headers);
|
|
956
|
+
let payload;
|
|
957
|
+
try {
|
|
958
|
+
payload = JSON.parse(body);
|
|
959
|
+
} catch {
|
|
960
|
+
throw new Error(`Compact route returned invalid JSON (${response.status}).`);
|
|
961
|
+
}
|
|
962
|
+
const result = CompactResponseSchema.safeParse(payload);
|
|
963
|
+
if (!result.success || result.data.status === "accepted" && state.sessionId !== void 0 && result.data.sessionId !== state.sessionId) throw new Error(`Compact route returned an invalid response (${response.status}).`);
|
|
964
|
+
return result.data.status === "accepted" ? {
|
|
965
|
+
sessionId: result.data.sessionId,
|
|
966
|
+
status: "accepted"
|
|
967
|
+
} : { status: "no_active_session" };
|
|
968
|
+
}
|
|
857
969
|
async reset() {
|
|
858
970
|
const state = this.#state;
|
|
859
971
|
const continuationToken = state.continuationToken;
|
|
@@ -923,10 +1035,8 @@ var ClientSession = class {
|
|
|
923
1035
|
async *#createEventStream(sessionId, continuationToken, initialState, input) {
|
|
924
1036
|
const events = [];
|
|
925
1037
|
try {
|
|
926
|
-
for await (const event of
|
|
927
|
-
|
|
928
|
-
resolveHeaders: () => this.#context.resolveHeaders(input.headers),
|
|
929
|
-
redirect: this.#context.redirect,
|
|
1038
|
+
for await (const event of this.#readStream({
|
|
1039
|
+
headers: input.headers,
|
|
930
1040
|
streamReconnectPolicy: input.streamReconnectPolicy,
|
|
931
1041
|
sessionId,
|
|
932
1042
|
signal: input.signal,
|
|
@@ -951,15 +1061,12 @@ var ClientSession = class {
|
|
|
951
1061
|
const streamIndex = options?.startIndex ?? initialState.streamIndex;
|
|
952
1062
|
const events = [];
|
|
953
1063
|
try {
|
|
954
|
-
for await (const event of
|
|
1064
|
+
for await (const event of this.#readStream({
|
|
955
1065
|
follow: options?.follow,
|
|
956
|
-
host: this.#context.host,
|
|
957
|
-
resolveHeaders: () => this.#context.resolveHeaders(),
|
|
958
|
-
redirect: this.#context.redirect,
|
|
959
|
-
streamReconnectPolicy: options?.streamReconnectPolicy,
|
|
960
1066
|
sessionId,
|
|
961
1067
|
signal: options?.signal,
|
|
962
|
-
startIndex: streamIndex
|
|
1068
|
+
startIndex: streamIndex,
|
|
1069
|
+
streamReconnectPolicy: options?.streamReconnectPolicy
|
|
963
1070
|
})) {
|
|
964
1071
|
events.push(event);
|
|
965
1072
|
yield event;
|
|
@@ -978,6 +1085,18 @@ var ClientSession = class {
|
|
|
978
1085
|
});
|
|
979
1086
|
}
|
|
980
1087
|
}
|
|
1088
|
+
#readStream(input) {
|
|
1089
|
+
return followStreamIterable({
|
|
1090
|
+
follow: input.follow,
|
|
1091
|
+
host: this.#context.host,
|
|
1092
|
+
resolveHeaders: () => this.#context.resolveHeaders(input.headers),
|
|
1093
|
+
redirect: this.#context.redirect,
|
|
1094
|
+
streamReconnectPolicy: input.streamReconnectPolicy,
|
|
1095
|
+
sessionId: input.sessionId,
|
|
1096
|
+
signal: input.signal,
|
|
1097
|
+
startIndex: input.startIndex
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
981
1100
|
};
|
|
982
1101
|
async function postTurnWithRetry(input) {
|
|
983
1102
|
const attempts = input.mustDeliver ? DELIVER_RETRY_ATTEMPTS : 1;
|