eve 0.71.3 → 0.72.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 +30 -0
- package/README.md +22 -6
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/ai/decide.d.ts +7 -0
- package/dist/src/ai/decide.js +1 -0
- package/dist/src/chunks/{use-eve-agent-CFCaYnrI.js → use-eve-agent-C1GYGCtb.js} +698 -388
- package/dist/src/chunks/{use-eve-agent-DcDhXNv1.js → use-eve-agent-hZJ7CB8t.js} +698 -388
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/trace-detail.d.ts +1 -1
- package/dist/src/cli/commands/trace-detail.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-flow.d.ts +1 -0
- package/dist/src/cli/dev/tui/setup-panel.d.ts +1 -0
- package/dist/src/cli/dev/tui/setup-panel.js +2 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +2 -2
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +2 -2
- package/dist/src/cli/dev/tui/transcript-parts.d.ts +2 -1
- package/dist/src/cli/dev/tui/transcript-parts.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
- package/dist/src/client/conversation-projection.d.ts +4 -0
- package/dist/src/client/conversation-projection.js +1 -0
- package/dist/src/client/conversation-reducer.js +1 -1
- package/dist/src/client/conversation-state.d.ts +5 -26
- package/dist/src/client/conversation-state.js +1 -1
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +1 -11
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer.d.ts +3 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/tool-call-state.d.ts +23 -0
- package/dist/src/client/tool-call-state.js +1 -0
- package/dist/src/client/tool-part-state.d.ts +7 -0
- package/dist/src/client/tool-part-state.js +1 -0
- package/dist/src/compiled/.vendor-stamp.json +10 -10
- package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1453 -1358
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +1 -2
- package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +172 -163
- package/dist/src/compiled/@ai-sdk/code-mode/index.js +15 -20
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +772 -733
- package/dist/src/compiled/@ai-sdk/google/index.js +6 -8
- package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +887 -790
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1722 -1691
- package/dist/src/compiled/@ai-sdk/openai/index.js +3 -14
- package/dist/src/compiled/@ai-sdk/otel/index.d.ts +216 -159
- package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
- package/dist/src/compiled/@ai-sdk/provider/index.d.ts +7542 -7271
- package/dist/src/compiled/@ai-sdk/provider/index.js +1 -3
- package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +1799 -1600
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-DXLdlucM.js +15 -0
- package/dist/src/compiled/_chunks/workflow/experimental-decision-BrfWf6-n.js +3 -0
- package/dist/src/compiler/extension-compatibility.d.ts +36 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/providers/session.js +1 -1
- package/dist/src/evals/define-eval.d.ts +1 -1
- package/dist/src/evals/judge.d.ts +1 -1
- package/dist/src/evals/judge.js +2 -2
- package/dist/src/evals/types.d.ts +8 -8
- package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -0
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/durable-session-read.d.ts +5 -0
- package/dist/src/execution/durable-session-read.js +1 -0
- package/dist/src/execution/durable-session-store.d.ts +4 -10
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/dynamic-connections.d.ts +3 -3
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
- package/dist/src/execution/legacy-session/snapshot.d.ts +3 -0
- package/dist/src/execution/legacy-session/snapshot.js +1 -1
- package/dist/src/execution/model-call-batching.js +1 -1
- package/dist/src/execution/node-step.d.ts +2 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/publish-session-events.d.ts +7 -2
- package/dist/src/execution/publish-session-events.js +1 -1
- package/dist/src/execution/session/active-turn.js +1 -1
- package/dist/src/execution/session/answer-caller.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +3 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/pending-turn-state.d.ts +8 -3
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/task-tool-tracing-step.d.ts +5 -0
- package/dist/src/execution/session/task-tool-tracing-step.js +1 -0
- package/dist/src/execution/session/turn-step-result.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn-waiting-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +1 -0
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +4 -6
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/start.d.ts +3 -3
- package/dist/src/execution/tasks/start.js +1 -1
- package/dist/src/execution/tasks/steps.d.ts +1 -1
- package/dist/src/execution/tasks/steps.js +1 -1
- package/dist/src/execution/terminal-session-completion-step.d.ts +5 -1
- package/dist/src/execution/terminal-session-completion-step.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/connection-tools.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/tools/workflow/withdraw-step.d.ts +7 -9
- package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
- package/dist/src/execution/workflow-trace-context.d.ts +2 -2
- package/dist/src/harness/authorization.d.ts +4 -2
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/{compaction.js → compaction/engine.js} +1 -1
- package/dist/src/harness/compaction/step.d.ts +46 -0
- package/dist/src/harness/compaction/step.js +1 -0
- package/dist/src/harness/coordination.d.ts +32 -68
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +1 -3
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +4 -52
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +1 -0
- package/dist/src/harness/final-output.d.ts +5 -0
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approvals.d.ts +115 -0
- package/dist/src/harness/hitl/approvals.js +1 -0
- package/dist/src/harness/hitl/approved-call-callers.d.ts +14 -0
- package/dist/src/harness/hitl/approved-call-callers.js +1 -0
- package/dist/src/harness/hitl/approved-calls.d.ts +37 -0
- package/dist/src/harness/hitl/approved-calls.js +1 -0
- package/dist/src/harness/hitl/budget.d.ts +21 -0
- package/dist/src/harness/hitl/budget.js +1 -0
- package/dist/src/harness/{approval-candidates.d.ts → hitl/candidates.d.ts} +9 -18
- package/dist/src/harness/hitl/candidates.js +1 -0
- package/dist/src/harness/hitl/coordinator.js +1 -0
- package/dist/src/harness/hitl/delivery.d.ts +37 -0
- package/dist/src/harness/hitl/delivery.js +1 -0
- package/dist/src/harness/hitl/index.d.ts +49 -0
- package/dist/src/harness/hitl/index.js +1 -0
- package/dist/src/harness/hitl/intake.d.ts +67 -0
- package/dist/src/harness/hitl/intake.js +1 -0
- package/dist/src/harness/{stale-input-responses.d.ts → hitl/stale-responses.d.ts} +5 -3
- package/dist/src/harness/hitl/stale-responses.js +3 -0
- package/dist/src/harness/inline-tool-authorization.d.ts +4 -0
- package/dist/src/harness/inline-tool-authorization.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +1 -10
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +1 -5
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +78 -0
- package/dist/src/harness/model-call/call.js +1 -0
- package/dist/src/harness/{model-call-error.d.ts → model-call/errors.d.ts} +1 -1
- package/dist/src/harness/model-call/failure.d.ts +52 -0
- package/dist/src/harness/model-call/failure.js +1 -0
- package/dist/src/harness/model-call/model.d.ts +18 -0
- package/dist/src/harness/model-call/model.js +1 -0
- package/dist/src/harness/model-call/recovery.d.ts +52 -0
- package/dist/src/harness/model-call/recovery.js +1 -0
- package/dist/src/harness/model-call/request.d.ts +30 -0
- package/dist/src/harness/model-call/request.js +3 -0
- package/dist/src/harness/model-call/response.d.ts +39 -0
- package/dist/src/harness/model-call/response.js +1 -0
- package/dist/src/harness/model-call/retry.d.ts +11 -0
- package/dist/src/harness/model-call/retry.js +1 -0
- package/dist/src/harness/model-call/run.d.ts +38 -0
- package/dist/src/harness/model-call/run.js +1 -0
- package/dist/src/harness/model-call/tools.d.ts +48 -0
- package/dist/src/harness/model-call/tools.js +1 -0
- package/dist/src/harness/model-call/usage.d.ts +23 -0
- package/dist/src/harness/model-call/usage.js +1 -0
- package/dist/src/harness/nested-actions.d.ts +2 -2
- package/dist/src/harness/provider-tools.d.ts +2 -2
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +4 -12
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-machine/commit.d.ts +28 -0
- package/dist/src/harness/session-machine/commit.js +1 -0
- package/dist/src/harness/session-machine/current.d.ts +29 -0
- package/dist/src/harness/session-machine/current.js +1 -0
- package/dist/src/harness/session-machine/events.d.ts +6 -0
- package/dist/src/harness/session-machine/events.js +1 -0
- package/dist/src/harness/session-machine/resolver-events.d.ts +12 -0
- package/dist/src/harness/session-machine/resolver-events.js +1 -0
- package/dist/src/harness/session-machine/state.d.ts +47 -0
- package/dist/src/harness/session-machine/state.js +1 -0
- package/dist/src/harness/session-machine/transitions.d.ts +188 -0
- package/dist/src/harness/session-machine/transitions.js +1 -0
- package/dist/src/harness/session-machine/view.d.ts +58 -0
- package/dist/src/harness/session-machine/view.js +1 -0
- package/dist/src/harness/step/after-model.d.ts +7 -0
- package/dist/src/harness/step/after-model.js +1 -0
- package/dist/src/harness/step/context.d.ts +59 -0
- package/dist/src/harness/step/context.js +1 -0
- package/dist/src/harness/step/intake.d.ts +34 -0
- package/dist/src/harness/step/intake.js +1 -0
- package/dist/src/harness/step/prompt.d.ts +37 -0
- package/dist/src/harness/step/prompt.js +1 -0
- package/dist/src/harness/step-hooks.d.ts +8 -13
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.d.ts +7 -22
- package/dist/src/harness/tool-loop.js +1 -3
- package/dist/src/harness/tools.d.ts +13 -0
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +1 -1
- package/dist/src/harness/types.d.ts +6 -0
- package/dist/src/instrumentation/ai-sdk-hook-bridge.d.ts +1 -1
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/content.js +1 -1
- package/dist/src/instrumentation/dispatch.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +28 -56
- package/dist/src/instrumentation/native-events.d.ts +2 -1
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/provider.d.ts +1 -1
- package/dist/src/instrumentation/runtime-context.d.ts +2 -3
- package/dist/src/instrumentation/runtime-context.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +11 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/state.d.ts +6 -1
- package/dist/src/instrumentation/state.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/attachments/limited-read.d.ts +16 -0
- package/dist/src/internal/attachments/limited-read.js +1 -0
- package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/mcp/published-tools.d.ts +13 -0
- package/dist/src/internal/mcp/published-tools.js +1 -0
- package/dist/src/internal/mcp/request-trace-context.d.ts +12 -0
- package/dist/src/internal/mcp/request-trace-context.js +1 -0
- package/dist/src/internal/mcp/streamable-http-server.d.ts +7 -3
- package/dist/src/internal/mcp/streamable-http-server.js +1 -1
- package/dist/src/internal/model-auth/transport.d.ts +3 -3
- package/dist/src/internal/model-auth/transport.js +1 -1
- package/dist/src/models/auto.d.ts +5 -5
- package/dist/src/models/auto.js +2 -2
- package/dist/src/protocol/message.d.ts +7 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/protocol/session-projection.d.ts +159 -0
- package/dist/src/protocol/session-projection.js +1 -0
- package/dist/src/public/ai/index.d.ts +1 -1
- package/dist/src/public/ai/index.js +1 -1
- package/dist/src/public/channels/chat-sdk/attachment-refs.d.ts +15 -0
- package/dist/src/public/channels/chat-sdk/attachment-refs.js +1 -0
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/chat-sdk/messageToUserContent.d.ts +11 -5
- package/dist/src/public/channels/chat-sdk/messageToUserContent.js +1 -1
- package/dist/src/public/channels/discord/attachments.d.ts +15 -0
- package/dist/src/public/channels/discord/attachments.js +1 -0
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/inbound.d.ts +13 -0
- package/dist/src/public/channels/discord/inbound.js +1 -1
- package/dist/src/public/channels/linear/inbound-uploads.d.ts +21 -0
- package/dist/src/public/channels/linear/inbound-uploads.js +1 -0
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/linq/inboundContent.d.ts +7 -1
- package/dist/src/public/channels/linq/inboundContent.js +1 -1
- package/dist/src/public/channels/linq/linqChannel.js +1 -1
- package/dist/src/public/channels/mcp.d.ts +17 -2
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/photon/attachments.d.ts +21 -0
- package/dist/src/public/channels/photon/attachments.js +1 -0
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/slack/attachments.d.ts +3 -1
- package/dist/src/public/channels/slack/attachments.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/attachments.d.ts +4 -4
- package/dist/src/public/channels/teams/attachments.js +1 -1
- package/dist/src/public/channels/telegram/attachments.js +1 -1
- package/dist/src/public/channels/twilio/api.d.ts +7 -0
- package/dist/src/public/channels/twilio/api.js +1 -1
- package/dist/src/public/channels/twilio/inbound.d.ts +7 -0
- package/dist/src/public/channels/twilio/inbound.js +2 -2
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/react/index.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -0
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +3 -0
- package/dist/src/setup/cli/prompt-ui.js +3 -1
- package/dist/src/setup/cli/select-component.d.ts +1 -0
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.d.ts +2 -0
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
- package/dist/src/setup/integrations/discord/api.js +1 -1
- package/dist/src/setup/integrations/web/auth-options.d.ts +4 -0
- package/dist/src/setup/integrations/web/auth-options.js +1 -0
- package/dist/src/setup/integrations/web/auth-scaffold.d.ts +7 -0
- package/dist/src/setup/integrations/web/auth-scaffold.js +1 -0
- package/dist/src/setup/integrations/web/provision-auth.d.ts +3 -0
- package/dist/src/setup/integrations/web/provision-auth.js +1 -0
- package/dist/src/setup/integrations/web/setup.d.ts +11 -6
- package/dist/src/setup/integrations/web/setup.js +3 -3
- package/dist/src/setup/prompter.d.ts +2 -0
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +1 -0
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/setup/vercel-project-api.d.ts +9 -0
- package/dist/src/setup/vercel-project-api.js +1 -1
- package/dist/src/setup/vercel-project.d.ts +4 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/web-search.d.ts +1 -1
- package/dist/src/subagents/adapter.js +1 -1
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +4 -28
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/svelte/index.d.ts +2 -0
- package/dist/src/svelte/index.js +39 -2
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/approval/policies.d.ts +5 -5
- package/dist/src/tools/approval/policies.js +1 -1
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/provided/agent-router.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/ask-question.js +2 -2
- package/dist/src/tools/provided/bash.js +1 -1
- package/dist/src/tools/provided/framework-tool.d.ts +3 -0
- package/dist/src/tools/provided/framework-tool.js +1 -0
- package/dist/src/tools/provided/glob.js +2 -2
- package/dist/src/tools/provided/grep.js +2 -2
- package/dist/src/tools/provided/load-skill.js +1 -1
- package/dist/src/tools/provided/no-reply.js +1 -1
- package/dist/src/tools/provided/read-file.js +2 -2
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/sleep.js +1 -1
- package/dist/src/tools/provided/task-cancel.js +1 -1
- package/dist/src/tools/provided/task-wait.js +1 -1
- package/dist/src/tools/provided/web-fetch.js +2 -2
- package/dist/src/tools/provided/web-search.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/provided/write-file.js +2 -2
- package/dist/src/tracing/agent-approval-instrumentation.d.ts +2 -2
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
- package/dist/src/tracing/agent-otel-usage.js +1 -1
- package/dist/src/tracing/agent-span-contract.d.ts +0 -1
- package/dist/src/tracing/agent-span-contract.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.d.ts +16 -6
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +7 -3
- package/dist/src/tracing/invoke-tool-span.js +1 -1
- package/dist/src/tracing/local-trace-analysis.js +1 -1
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/src/vue/index.js +39 -2
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +2 -2
- package/docs/channels/chat-sdk.mdx +3 -1
- package/docs/channels/custom.mdx +2 -0
- package/docs/channels/discord.mdx +5 -4
- package/docs/channels/eve.mdx +65 -0
- package/docs/channels/linear.mdx +1 -1
- package/docs/channels/linq.mdx +2 -0
- package/docs/channels/mcp.mdx +39 -1
- package/docs/channels/photon.mdx +5 -0
- package/docs/channels/teams.mdx +4 -7
- package/docs/channels/twilio.mdx +1 -1
- package/docs/concepts/built-in-tools.md +12 -0
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/connections/overview.mdx +1 -1
- package/docs/dynamic-configuration/meta.json +1 -1
- package/docs/evals/judge.mdx +16 -16
- package/docs/evals/overview.mdx +1 -1
- package/docs/guides/{evaluate.md → decide.md} +35 -35
- package/docs/guides/dynamic-capabilities.md +1 -1
- package/docs/guides/frontend/overview.mdx +3 -1
- package/docs/guides/hooks.md +1 -1
- package/docs/guides/instrumentation/instrumentation.mdx +23 -22
- package/docs/guides/instrumentation/otel.mdx +13 -2
- package/docs/reference/cli.md +3 -3
- package/docs/reference/typescript-api.md +4 -2
- package/docs/tools/human-in-the-loop.md +6 -4
- package/docs/tools/workflows.mdx +4 -4
- package/package.json +11 -11
- package/dist/src/ai/evaluate.d.ts +0 -7
- package/dist/src/ai/evaluate.js +0 -1
- package/dist/src/client/message-task-parts.d.ts +0 -8
- package/dist/src/client/message-task-parts.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-C3ZE62yI.js +0 -25
- package/dist/src/compiled/_chunks/workflow/experimental-evaluation-Dm32egEG.js +0 -5
- package/dist/src/harness/active-turn-id.d.ts +0 -11
- package/dist/src/harness/active-turn-id.js +0 -1
- package/dist/src/harness/approval-candidates.js +0 -1
- package/dist/src/harness/approval-delivery-coordinator.js +0 -1
- package/dist/src/harness/approved-call-callers.d.ts +0 -11
- package/dist/src/harness/approved-call-callers.js +0 -1
- package/dist/src/harness/cancelled-turn-emission.d.ts +0 -12
- package/dist/src/harness/cancelled-turn-emission.js +0 -1
- package/dist/src/harness/emission-state.d.ts +0 -36
- package/dist/src/harness/emission-state.js +0 -1
- package/dist/src/harness/held-requests.d.ts +0 -18
- package/dist/src/harness/held-requests.js +0 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -27
- package/dist/src/harness/hitl/approval-input-requests.js +0 -1
- package/dist/src/harness/hitl/pending-input-resolution.d.ts +0 -54
- package/dist/src/harness/hitl/pending-input-resolution.js +0 -1
- package/dist/src/harness/hitl/session-limit-input-requests.d.ts +0 -12
- package/dist/src/harness/hitl/session-limit-input-requests.js +0 -1
- package/dist/src/harness/input-requests.d.ts +0 -37
- package/dist/src/harness/input-requests.js +0 -1
- package/dist/src/harness/pending-input-batches.d.ts +0 -81
- package/dist/src/harness/pending-input-batches.js +0 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +0 -45
- package/dist/src/harness/session-limit-enforcement.js +0 -1
- package/dist/src/harness/stale-input-responses.js +0 -3
- package/dist/src/harness/workflow-dispatch.d.ts +0 -30
- package/dist/src/harness/workflow-dispatch.js +0 -1
- package/dist/src/public/channels/linear/inbound-images.d.ts +0 -19
- package/dist/src/public/channels/linear/inbound-images.js +0 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +0 -26
- package/dist/src/tracing/agent-action-instrumentation.js +0 -1
- /package/dist/src/harness/{compaction.d.ts → compaction/engine.d.ts} +0 -0
- /package/dist/src/harness/{compaction-prompt.d.ts → compaction/prompt.d.ts} +0 -0
- /package/dist/src/harness/{compaction-prompt.js → compaction/prompt.js} +0 -0
- /package/dist/src/harness/{session-limit-continuation.d.ts → hitl/budget-request.d.ts} +0 -0
- /package/dist/src/harness/{session-limit-continuation.js → hitl/budget-request.js} +0 -0
- /package/dist/src/harness/{approval-delivery-coordinator.d.ts → hitl/coordinator.d.ts} +0 -0
- /package/dist/src/harness/{model-call-error.js → model-call/errors.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.72.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 198d6f5: Breaking: follows the AI SDK rename from evaluation to decisions and updates to `ai@7.0.128`. `evaluate` from `eve/ai` is now `decide`, and `auto` and `t.judge(...)` accept `Experimental_DecisionModel` instances such as `provider.decisionModel(...)`. Replace `evaluate` imports with `decide` and `evaluationModel(...)` calls with `decisionModel(...)`. Extensions built against the previous `tool` or `dynamicTool` capability must be rebuilt against this release.
|
|
8
|
+
- 28136be: Tool calls now export one `execute_tool` span instead of an `agent.action` wrapper and a tool child. Durable outcomes, approvals, execution metadata, and subagent trace correlation stay on the tool span; the trace schema remains version 4.
|
|
9
|
+
|
|
10
|
+
`defineInstrumentation` no longer supports `action.*` handlers or `InstrumentationAction*` types; use `tool.call.*`, `InstrumentationToolCall*`, and `InstrumentationToolOutput` instead. Tool events now describe one durable call lifecycle, and start handlers read `event.toolName` instead of `event.name`.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 9d42f05: Approvals without a `response` policy can now be approved or cancelled only by the principal whose turn requested the call, so a shared thread no longer lets another person run a tool under the requester's turn. Calls requested by unauthenticated or anonymous callers are unchanged. Tools that need other approvers define `approval.response`, which replaces the default.
|
|
15
|
+
- 8f7001b: Add Browserbase web search through AI Gateway, using existing Gateway credentials.
|
|
16
|
+
- 1921221: Files people send now reach the agent on more channels. Telegram keeps a file's real type instead of `application/octet-stream`, Linear reads uploaded files linked in a prompt (not only images) and leaves a note for one it can't download, and Twilio passes MMS media to the agent. Slack, Telegram, Twilio, and Linear stop a file download at the upload limit instead of reading the whole file into memory.
|
|
17
|
+
- bc45ddf: Files people send over Chat SDK adapters that download attachments, such as Slack, Google Chat, WhatsApp, and Twilio, now reach the agent instead of a URL the model provider can't open. eve downloads each one in the step with the adapter's credentials, rebuilt through the adapter's `rehydrateAttachment`; a failed download, or a file over 25 MB, reaches the agent as a short note.
|
|
18
|
+
- cebbc9b: Discord and Teams now pass files people send to the agent. Discord reads files from slash-command attachment options, and guided setup registers an optional `file` option. Teams accepts files by default from Bot Connector and SharePoint hosts; set `files: { enabled: false }` to opt out, and `allowedHosts` now adds hosts instead of replacing them. Downloads on both stop at the upload limit.
|
|
19
|
+
- dfdb685: Fix a TypeScript build error caused by a duplicate duration field in direct tool-call tracing. Direct tool spans now include the same non-framework classification as conversation tool spans.
|
|
20
|
+
- dd902e2: Mark eve-provided tools on tool execution spans, and emit tool execution spans for task controls and deferred workflow calls. Local and remote agent tool calls retain their dispatch kind, including background tasks.
|
|
21
|
+
- 4bef05e: The harness step is now a short pipeline over focused modules: the model call, its recovery, and the human-in-the-loop lifecycle each live in their own module. Behavior is unchanged.
|
|
22
|
+
- 4bef05e: Restoring a session no longer loads the workflow runtime up front. It now loads when a subagent forwards an approval, sign-in, or question to its parent.
|
|
23
|
+
- a2c2687: `mcpChannel` can now publish the agent's own tools next to the `agent_*` tools. Set `tools: true` to list every tool the agent can run outside a conversation, with its JSON schemas, and run each `tools/call` as the route-authenticated caller. Set `agent: false` to stop serving the `agent_*` tools. Both default to what the channel served before, so existing channels do not change.
|
|
24
|
+
- bc45ddf: Photon iMessage now passes files people send to the agent. eve downloads each attachment from Photon by its id, since the webhook carries no bytes; a failed download reaches the agent as a short note instead of being dropped.
|
|
25
|
+
- 4bef05e: Approved local tools execute through eve's tool wrappers instead of AI SDK approval-history replay. Execution retains schema and authorization rechecks, concurrent siblings, the originating tool bindings, and the AI SDK's tool telemetry in the step's first attempt; approval markers are replaced by ordinary tool results before the next model call.
|
|
26
|
+
- 4bef05e: Pending input is withdrawn when cancellation, context clearing, or a finished workflow removes its owner. Messages behind a session-limit prompt enter a held turn once and resume after a grant without duplicate receipt, and a typed approval or budget answer no longer passes the channel context of its consumed message to the model.
|
|
27
|
+
- 4bef05e: The `input.requested` stream event type gains an optional `callId`. On a request relayed from a subagent or workflow tool run, it names the call in the receiving session that the request serves; the request keeps its original turn and step coordinates, and the stream stays on version 26.
|
|
28
|
+
- 2359e23: Remove duplicate tool call IDs, error codes, and model provider attributes from agent traces. Runtime context no longer repeats structural channel, session, step, turn, and framework identifiers; trace schema remains version 4.
|
|
29
|
+
Model and activation spans now emit token counts only under `gen_ai.usage.*`; step and tool usage and cost values remain unchanged.
|
|
30
|
+
- 4bef05e: Added `toolCallState(conversation, callId, { streaming })` to the client and frontend bindings. Tool parts and ACP tool calls follow task outcomes rather than start receipts (an ACP task call still running when its turn fails ends as failed), withdrawn approvals render as denied, and results marked `isError` render as errors; public conversation fields and eval policy remain unchanged.
|
|
31
|
+
- ed98150: Add a Sign in with Vercel option to `eve add channel/web` and the terminal UI's channel picker. Setup offers eligible teams, provisions team-only authentication with production and preview credentials, and explains app limits and name conflicts.
|
|
32
|
+
|
|
3
33
|
## 0.71.3
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -125,11 +125,26 @@ npx eve@latest init my-agent
|
|
|
125
125
|
`eve init` writes a new agent with eve's default model. Pass `--model
|
|
126
126
|
openai/gpt-5.5` to choose another AI Gateway model, `--reasoning high` to set a
|
|
127
127
|
reasoning effort, or `--channel-web-nextjs` to add the Web Chat application. It
|
|
128
|
-
installs dependencies, initializes Git, and
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
installs dependencies, initializes Git, and opens the terminal UI in an interactive
|
|
129
|
+
human terminal. Coding-agent invocations return setup instructions instead.
|
|
130
|
+
Targeting an existing project directory (`eve init .`) adds the agent files and
|
|
131
|
+
missing dependencies instead. Initialization does not create a Vercel project,
|
|
132
|
+
configure browser sign-in, or deploy the agent.
|
|
133
|
+
|
|
134
|
+
To add Web Chat with **Sign in with Vercel**, run these commands from the agent's directory:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npx eve link
|
|
138
|
+
npx eve add channel/web
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Choose a hosting layout, then **Sign in with Vercel**. The terminal UI's `/add`
|
|
142
|
+
channel picker offers the same setup. A team owner or a custom role with App and
|
|
143
|
+
environment permissions can provision access for members of the project's team.
|
|
144
|
+
Setup configures production and preview credentials; run `npx eve deploy` to publish.
|
|
145
|
+
Local development works without browser sign-in. See the
|
|
146
|
+
[Web Chat setup guide](https://eve.dev/docs/channels/eve#web-chat-with-sign-in-with-vercel)
|
|
147
|
+
for recovery steps.
|
|
133
148
|
|
|
134
149
|
CLI commands:
|
|
135
150
|
|
|
@@ -139,6 +154,7 @@ CLI commands:
|
|
|
139
154
|
- `eve build` — compile `.eve/` and build the host output
|
|
140
155
|
- `eve start` — serve the built `.output/` app
|
|
141
156
|
- `eve dev` — start the local runtime and REPL
|
|
157
|
+
- `eve add channel/web` — add Web Chat and configure browser authentication
|
|
142
158
|
- `eve set [--model <model-id>] [--reasoning <effort>]` — change root model settings
|
|
143
159
|
- `eve extension init <name>` — create a new extension package
|
|
144
160
|
- `eve extension build` — build an extension package
|
|
@@ -155,7 +171,7 @@ These files ship inside the installed package at `node_modules/eve/docs/`:
|
|
|
155
171
|
- [Getting Started](https://eve.dev/docs/getting-started) — install, scaffold, and run locally
|
|
156
172
|
- [Project Layout](https://eve.dev/docs/getting-started#project-layout) — every authored directory in depth
|
|
157
173
|
- [`agent.ts`](https://eve.dev/docs/agent-config) — agent config reference
|
|
158
|
-
- [Automatic Model Selection](https://eve.dev/docs/guides/
|
|
174
|
+
- [Automatic Model Selection](https://eve.dev/docs/guides/decide) — choose an agent model for each request
|
|
159
175
|
- [TypeScript API Reference](https://eve.dev/docs/reference/typescript-api) — complete `define*` and runtime helper reference
|
|
160
176
|
- [Vercel Deployment](https://eve.dev/docs/guides/deployment/overview) — deploy to production
|
|
161
177
|
|
package/dist/src/acp/adapter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{realpath}from"node:fs/promises";import{PROTOCOL_VERSION,RequestError,methods}from"#compiled/@agentclientprotocol/sdk/index.js";import{Client,ClientError}from"#client/index.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002;var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(e){if(e.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((e.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let t=await normalizedRealpath(e.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(t!==n)throw RequestError.invalidParams({cwd:e.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let t=randomUUID();return this.#i.set(t,{tools:new Map}),{sessionId:t}}async prompt(e,t,n){let r=this.#s(e.sessionId);if(r.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let i=promptContent(e);r.tools.clear();let a=Promise.withResolvers(),o={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:a.promise,resolveSettled:a.resolve};r.active=o;let onProtocolCancel=()=>{o.protocolCancelled=!0,this.#o(r).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let a={message:i};for(;;){let i;if(r.client===void 0){if(a.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...a,message:a.message});r.client=e.session,i=e.response}else i=a.inputResponses===void 0?await r.client.send(a.message):await r.client.respond(a.inputResponses);(o.cancelRequested||o.protocolCancelled)&&await this.#o(r);let s=[],c=!1,l,u;for await(let n of i){let i=`data`in n?n.data:void 0,a=i!==void 0&&`turnId`in i?i.turnId:void 0;typeof a==`string`&&(o.turnId=a),n.type===`input.requested`&&s.push(...n.data.requests),n.type===`authorization.required`&&(u=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(c=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(l=n),await this.#c(e.sessionId,r,n,t)}if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(c||o.cancelRequested)return{stopReason:`cancelled`};if(l!==void 0)throw eveFailure(l);if(u!==void 0)throw u;if(s.length===0)return{stopReason:`end_turn`};let d;try{d=await Promise.all(s.map(i=>this.#l(e.sessionId,r,i,t,n)))}catch(t){if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(o.cancelRequested)return{stopReason:`cancelled`};throw t}if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(o.cancelRequested)return{stopReason:`cancelled`};a={inputResponses:d}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),r.tools.clear(),o.resolveSettled(),r.active===o&&(r.active=void 0)}}async cancel(e){let t=this.#i.get(e);t!==void 0&&t.active!==void 0&&(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){switch(n.type){case`message.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:n.data.messageDelta},messageId:`${n.data.turnId}:message:${n.data.stepIndex}`});return;case`reasoning.appended`:await notifyUpdate(r,e,{sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:n.data.reasoningDelta},messageId:`${n.data.turnId}:thought:${n.data.stepIndex}`});return;case`actions.requested`:for(let i of n.data.actions){let n=toolCallForAction(i);t.tools.set(i.callId,n),await notifyUpdate(r,e,{sessionUpdate:`tool_call`,...n})}return;case`action.result`:{let t=n.data.result,i=n.data.status!==`completed`||t.isError?`failed`:`completed`;await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:t.callId,status:i,content:[{type:`content`,content:{type:`text`,text:stringifyOutput(t.output)}}],rawOutput:t.output});return}default:return}}async#l(e,t,n,r,i){let a=AbortSignal.any([i,t.active.outboundController.signal]);if(n.display===`confirmation`){let i=`${n.requestId}:approve`,o=`${n.requestId}:deny`,s=t.tools.get(n.action.callId)??toolCallForAction(n.action),c=await r.request(methods.client.session.requestPermission,{sessionId:e,toolCall:s,options:[{kind:`allow_once`,name:`Approve`,optionId:i},{kind:`reject_once`,name:`Deny`,optionId:o}]},{cancellationSignal:a});if(c.outcome.outcome===`cancelled`)return this.#u(t),{requestId:n.requestId};if(c.outcome.optionId===i)return{requestId:n.requestId,optionId:`approve`};if(c.outcome.optionId===o)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:c.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 o=elicitationProperty(n),s=await r.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:o},required:[ANSWER_FIELD]}},{cancellationSignal:a});if(s.action!==`accept`)return this.#u(t),{requestId:n.requestId};let c=s.content?.[ANSWER_FIELD];if(typeof c!=`string`)throw RequestError.invalidParams(s.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===c))throw RequestError.invalidParams({answer:c},`Unknown eve question option`);return{requestId:n.requestId,optionId:c}}return{requestId:n.requestId,text:c}}#u(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,t){try{return await realpath(e)}catch(n){throw RequestError.invalidParams({path:e},`Could not resolve ${t}: ${errorMessage(n)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`||e.kind===`workflow-tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}export{EveAcpAdapter};
|
|
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";import{callStatus,foldSession,initialSessionProjection}from"#protocol/session-projection.js";const ANSWER_FIELD=`answer`,ERROR_CODE_EVE=-32002,ACP_TOOL_STATUS={running:`in_progress`,"awaiting-input":`pending`,completed:`completed`,failed:`failed`,rejected:`failed`,cancelled:`failed`,interrupted:`failed`};var EveAcpAdapter=class{#e;#t;#n;#r=!1;#i=new Map;constructor(e){this.#t=e.eveVersion,this.#n=e.workspaceRoot,this.#e=e.client??new Client({auth:e.auth,headers:e.headers,host:e.serverUrl,redirect:`manual`})}initialize(e){return this.#r=e.clientCapabilities?.elicitation?.form!==void 0,{protocolVersion:PROTOCOL_VERSION,agentCapabilities:{loadSession:!1,promptCapabilities:{},sessionCapabilities:{close:{}}},agentInfo:{name:`eve`,title:`eve`,version:this.#t},authMethods:[]}}async newSession(e){if(e.mcpServers.length>0)throw unsupported(`Client-provided MCP servers are not supported by eve ACP mode.`);if((e.additionalDirectories?.length??0)>0)throw unsupported(`Additional workspace directories are not supported by eve ACP mode.`);if(this.#n!==void 0){let t=await normalizedRealpath(e.cwd,`session/new.cwd`),n=await normalizedRealpath(this.#n,`the eve application root`);if(t!==n)throw RequestError.invalidParams({cwd:e.cwd,workspaceRoot:n},`ACP cwd must be the eve application root`)}let t=randomUUID();return this.#i.set(t,{projection:initialSessionProjection(),tools:new Map}),{sessionId:t}}async prompt(e,t,n){let r=this.#s(e.sessionId);if(r.active!==void 0)throw new RequestError(-32001,`ACP session ${e.sessionId} already has an active prompt.`);let i=promptContent(e);r.tools.clear();let a=Promise.withResolvers(),o={cancelRequested:!1,protocolCancelled:!1,outboundController:new AbortController,settled:a.promise,resolveSettled:a.resolve};r.active=o;let onProtocolCancel=()=>{o.protocolCancelled=!0,this.#o(r).catch(()=>void 0)};n.aborted?onProtocolCancel():n.addEventListener(`abort`,onProtocolCancel,{once:!0});try{if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});let a={message:i};for(;;){let i;if(r.client===void 0){if(a.message===void 0)throw Error(`ACP session has not started.`);let e=await this.#e.sessions.create({...a,message:a.message});r.client=e.session,i=e.response}else i=a.inputResponses===void 0?await r.client.send(a.message):await r.client.respond(a.inputResponses);(o.cancelRequested||o.protocolCancelled)&&await this.#o(r);let s=[],c=!1,l,u;for await(let n of i){let i=`data`in n?n.data:void 0,a=i!==void 0&&`turnId`in i?i.turnId:void 0;typeof a==`string`&&(o.turnId=a),n.type===`input.requested`&&s.push(...n.data.requests),n.type===`authorization.required`&&(u=unsupported(`Connection authorization cannot be completed through eve ACP mode.`)),n.type===`turn.cancelled`&&(c=!0),(n.type===`turn.failed`||n.type===`session.failed`)&&(l=n),await this.#c(e.sessionId,r,n,t)}if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(c||o.cancelRequested)return{stopReason:`cancelled`};if(l!==void 0)throw await this.#l(e.sessionId,r,t),eveFailure(l);if(u!==void 0)throw u;if(s.length===0)return{stopReason:`end_turn`};let d;try{d=await Promise.all(s.map(i=>this.#d(e.sessionId,r,i,t,n)))}catch(t){if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(o.cancelRequested)return{stopReason:`cancelled`};throw t}if(o.protocolCancelled)throw RequestError.requestCancelled({sessionId:e.sessionId});if(o.cancelRequested)return{stopReason:`cancelled`};a={inputResponses:d}}}catch(e){throw acpRequestError(e)}finally{n.removeEventListener(`abort`,onProtocolCancel),r.tools.clear(),o.resolveSettled(),r.active===o&&(r.active=void 0)}}async cancel(e){let t=this.#i.get(e);t!==void 0&&t.active!==void 0&&(t.active.cancelRequested=!0,await this.#o(t))}async closeSession(e){let t=this.#s(e);this.#i.delete(e),await this.#a(t)}async close(){let e=[...this.#i.values()];this.#i.clear(),await Promise.allSettled(e.map(e=>this.#a(e)))}async#a(e){let t;if(e.active!==void 0){let n=e.active;n.cancelRequested=!0;try{await this.#o(e)}catch(e){t=e}await n.settled}try{await e.client?.reset()}catch(e){throw t===void 0?e:AggregateError([t,e],`Could not cancel or reset the eve session`)}if(t!==void 0)throw t}async#o(e){e.active?.outboundController.abort(),e.client!==void 0&&await e.client.cancel(e.active?.turnId===void 0?void 0:{turnId:e.active.turnId})}#s(e){let t=this.#i.get(e);if(t===void 0)throw RequestError.invalidParams({sessionId:e},`Unknown or closed ACP session`);return t}async#c(e,t,n,r){let i=t.projection;if(t.projection=foldSession(i,n),await this.#u(e,t,n,r),n.type===`actions.requested`)return;let a=new Set,{calls:o,tasks:s,turns:c}=t.projection;if(o!==i.calls||s!==i.tasks||c!==i.turns)for(let s of Object.keys(o)){if(!t.tools.has(s))continue;let o=callStatus(t.projection,s);o!==void 0&&o!==callStatus(i,s)&&(a.add(s),await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:s,status:ACP_TOOL_STATUS[o],...callOutput(n,s)}))}let l=n.type===`action.result`?n.data.result.callId:n.type===`task.settled`?n.data.callId:void 0;if(l===void 0||a.has(l)||!t.tools.has(l))return;let u=callOutput(n,l),d=callStatus(t.projection,l);`content`in u&&d!==void 0&&await notifyUpdate(r,e,{sessionUpdate:`tool_call_update`,toolCallId:l,status:ACP_TOOL_STATUS[d],...u})}async#l(e,t,n){for(let r of t.tools.keys())callStatus(t.projection,r)===`running`&&await notifyUpdate(n,e,{sessionUpdate:`tool_call_update`,toolCallId:r,status:ACP_TOOL_STATUS.failed})}async#u(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;default:return}}async#d(e,t,n,r,i){let a=AbortSignal.any([i,t.active.outboundController.signal]);if(n.display===`confirmation`){let i=`${n.requestId}:approve`,o=`${n.requestId}:deny`,s=t.tools.get(n.action.callId)??toolCallForAction(n.action),c=await r.request(methods.client.session.requestPermission,{sessionId:e,toolCall:s,options:[{kind:`allow_once`,name:`Approve`,optionId:i},{kind:`reject_once`,name:`Deny`,optionId:o}]},{cancellationSignal:a});if(c.outcome.outcome===`cancelled`)return this.#f(t),{requestId:n.requestId};if(c.outcome.optionId===i)return{requestId:n.requestId,optionId:`approve`};if(c.outcome.optionId===o)return{requestId:n.requestId,optionId:`deny`};throw RequestError.invalidParams({optionId:c.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 o=elicitationProperty(n),s=await r.request(methods.client.elicitation.create,{mode:`form`,sessionId:e,message:n.prompt,requestedSchema:{type:`object`,properties:{[ANSWER_FIELD]:o},required:[ANSWER_FIELD]}},{cancellationSignal:a});if(s.action!==`accept`)return this.#f(t),{requestId:n.requestId};let c=s.content?.[ANSWER_FIELD];if(typeof c!=`string`)throw RequestError.invalidParams(s.content,`ACP elicitation response must contain a string answer`);if(n.display===`select`){if(!n.options?.some(e=>e.id===c))throw RequestError.invalidParams({answer:c},`Unknown eve question option`);return{requestId:n.requestId,optionId:c}}return{requestId:n.requestId,text:c}}#f(e){let t=e.active;t.cancelRequested=!0,t.outboundController.abort()}};async function normalizedRealpath(e,t){try{return await realpath(e)}catch(n){throw RequestError.invalidParams({path:e},`Could not resolve ${t}: ${errorMessage(n)}`)}}function promptContent(e){let t=e.prompt.map(e=>{if(e.type!==`text`)throw unsupported(`ACP prompt content type ${JSON.stringify(e.type)} is not supported.`);return{type:`text`,text:e.text}});if(t.every(e=>e.text.length===0))throw RequestError.invalidParams(e.prompt,`ACP prompt must contain at least one non-empty text block`);return t}function toolCallForAction(e){let t=e.kind===`tool-call`||e.kind===`workflow-tool-call`?e.toolName:e.kind===`load-skill`?`Load skill`:e.name;return{toolCallId:e.callId,title:t,kind:`other`,status:`pending`,rawInput:e.input}}function elicitationProperty(e){if(e.display===`select`&&e.allowFreeform!==!0&&e.options?.length)return{type:`string`,title:e.prompt,oneOf:e.options.map(e=>({const:e.id,title:e.label,description:e.description}))};if(e.display===`text`&&e.allowFreeform!==!1)return{type:`string`,title:e.prompt,minLength:1};throw unsupported(`This eve question shape cannot be represented by ACP form elicitation.`)}async function notifyUpdate(e,t,n){await e.notify(methods.client.session.update,{sessionId:t,update:n})}function stringifyOutput(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function unsupported(e){return new RequestError(-32003,e)}function eveFailure(e){return new RequestError(ERROR_CODE_EVE,e.data.message,{code:e.data.code,details:e.data.details})}function acpRequestError(e){return e instanceof RequestError?e:e instanceof ClientError?new RequestError(ERROR_CODE_EVE,e.message,{httpStatus:e.status}):new RequestError(ERROR_CODE_EVE,errorMessage(e))}function errorMessage(e){return e instanceof Error?e.message:String(e)}function callOutput(e,t){let n=e.type===`action.result`&&e.data.result.callId===t?e.data.result.output:e.type===`task.settled`&&e.data.callId===t?e.data.output===void 0?e.data.error?.message:e.data.output:void 0;return n===void 0?{}:{content:[{type:`content`,content:{type:`text`,text:stringifyOutput(n)}}],rawOutput:n}}export{EveAcpAdapter};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { experimental_decide as decideWithAiSdk, type Experimental_DecisionModel as DecisionModel, type Experimental_DecisionQuestion as DecisionQuestion } from "ai";
|
|
2
|
+
export declare const DEFAULT_DECISION_MODEL = "typesafe-ai/jev";
|
|
3
|
+
/** Decide typed questions about the state you pass to it using eve's model authentication. */
|
|
4
|
+
export declare function decide<const Questions extends Record<string, DecisionQuestion>>({ model, ...options }: Omit<Parameters<typeof decideWithAiSdk<Questions>>[0], "model"> & {
|
|
5
|
+
/** Decision model instance or ID. Defaults to TypeSafe Jev. */
|
|
6
|
+
model?: DecisionModel;
|
|
7
|
+
}): Promise<import("ai").Experimental_DecisionResult<Questions>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{experimental_decide}from"ai";import{ensureAiSdkWarningLogger}from"#instrumentation/ai-sdk-warnings.js";import{localGatewayDecisionModel}from"#internal/model-auth/transport.js";const DEFAULT_DECISION_MODEL=`typesafe-ai/jev`;function decide({model:e=DEFAULT_DECISION_MODEL,...t}){return ensureAiSdkWarningLogger(),experimental_decide({...t,model:typeof e==`string`&&Reflect.get(globalThis,`AI_SDK_DEFAULT_PROVIDER`)==null?localGatewayDecisionModel(e)??e:e})}export{DEFAULT_DECISION_MODEL,decide};
|