eve 0.75.1 → 0.76.2
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 +63 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/channel-address.d.ts +3 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/session-stranded-error.d.ts +25 -0
- package/dist/src/channel/session-stranded-error.js +1 -0
- package/dist/src/channel/session.d.ts +13 -6
- package/dist/src/channel/task-card.js +1 -1
- package/dist/src/channel/tool-eligibility.d.ts +1 -2
- package/dist/src/channel/types.d.ts +29 -1
- package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-BtKWTEpm.js} +99 -24
- package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-jI6EsYAu.js} +99 -24
- package/dist/src/cli/commands/registry-project.d.ts +10 -3
- package/dist/src/cli/commands/registry-project.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +0 -6
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/conversation-view.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +3 -3
- package/dist/src/cli/dev/tui/stranded-session.d.ts +9 -0
- package/dist/src/cli/dev/tui/stranded-session.js +1 -0
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/client/client-error.d.ts +16 -0
- package/dist/src/client/client-error.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +3 -0
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +6 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/open-stream.d.ts +5 -3
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/transcript-reducer.d.ts +46 -0
- package/dist/src/client/transcript-reducer.js +2 -0
- package/dist/src/compiled/.vendor-stamp.json +3 -2
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
- package/dist/src/compiled/@vercel/queue/index.js +47 -0
- package/dist/src/compiler/connection-ownership.d.ts +6 -0
- package/dist/src/compiler/connection-ownership.js +1 -0
- package/dist/src/compiler/default-tool-policy.d.ts +0 -3
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -22
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +9 -6
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +5 -0
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +2 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +2 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/connections/ownership.d.ts +18 -0
- package/dist/src/connections/ownership.js +1 -0
- package/dist/src/context/accessors.d.ts +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/build-dynamic-tools.d.ts +3 -9
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +10 -4
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-tools.js +1 -1
- package/dist/src/context/providers/session.d.ts +1 -0
- package/dist/src/context/providers/session.js +1 -1
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/context/session-context.d.ts +8 -2
- package/dist/src/discover/grammar.d.ts +11 -0
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -0
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/skills.d.ts +1 -0
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/dynamic/definition.d.ts +14 -6
- package/dist/src/evals/assertions/collector.d.ts +4 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +2 -3
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +9 -6
- package/dist/src/evals/reported-tool-name.d.ts +9 -0
- package/dist/src/evals/reported-tool-name.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
- package/dist/src/evals/runner/reporters/datadog.js +2 -2
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/target.d.ts +7 -0
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +19 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/eve-channel/support.d.ts +2 -0
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/agent-sessions/remote.js +1 -1
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
- package/dist/src/execution/catalog/connection-auth.js +1 -0
- package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
- package/dist/src/execution/catalog/connection-entry.js +1 -0
- package/dist/src/execution/catalog/listing.d.ts +9 -0
- package/dist/src/execution/catalog/listing.js +3 -0
- package/dist/src/execution/catalog/rank.d.ts +44 -0
- package/dist/src/execution/catalog/rank.js +1 -0
- package/dist/src/execution/catalog/search.d.ts +28 -0
- package/dist/src/execution/catalog/search.js +1 -0
- package/dist/src/execution/catalog/signatures.d.ts +11 -0
- package/dist/src/execution/catalog/signatures.js +1 -0
- package/dist/src/execution/catalog/skills.d.ts +24 -0
- package/dist/src/execution/catalog/skills.js +1 -0
- package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
- package/dist/src/execution/catalog/step-catalog.js +1 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +15 -0
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/install-workflow-world.d.ts +7 -0
- package/dist/src/execution/install-workflow-world.js +1 -0
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/legacy-session/authorization.js +1 -1
- package/dist/src/execution/legacy-session/inbox.js +1 -1
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session/active-turn.d.ts +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +11 -0
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/timeout-steps.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +5 -5
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-event-stream.d.ts +6 -0
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/session-inbox/address.d.ts +4 -0
- package/dist/src/execution/session-inbox/address.js +1 -1
- package/dist/src/execution/session-inbox/end-stranded-session.d.ts +22 -0
- package/dist/src/execution/session-inbox/end-stranded-session.js +1 -0
- package/dist/src/execution/session-inbox/hook-release.d.ts +4 -0
- package/dist/src/execution/session-inbox/hook-release.js +1 -0
- package/dist/src/execution/session-inbox/owner.d.ts +48 -0
- package/dist/src/execution/session-inbox/owner.js +1 -0
- package/dist/src/execution/session-inbox/resume.d.ts +12 -0
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-inbox/runnable-owner.d.ts +13 -0
- package/dist/src/execution/session-inbox/runnable-owner.js +1 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.d.ts +16 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.js +1 -0
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +20 -10
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/tasks/calls.d.ts +6 -5
- package/dist/src/execution/tasks/calls.js +1 -1
- package/dist/src/execution/tasks/model-step.d.ts +10 -10
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/render.d.ts +3 -3
- package/dist/src/execution/tasks/render.js +3 -3
- package/dist/src/execution/tasks/session.d.ts +2 -1
- package/dist/src/execution/tasks/table.d.ts +1 -1
- package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +5 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +4 -18
- package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
- package/dist/src/extensions/code/extension/instructions/github.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +1 -13
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
- package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
- package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
- package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
- package/dist/src/extensions/code/extension/lib/patch.js +4 -4
- package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
- package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
- package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
- package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
- package/dist/src/extensions/code/extension/skills/pr.js +1 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
- package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
- package/dist/src/extensions/code/extension/tools/gh.js +1 -1
- package/dist/src/extensions/code/extension/tools/grep.js +1 -1
- package/dist/src/extensions/code/tools.d.ts +2 -1
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +12 -0
- package/dist/src/extensions/git/extension/extension.js +1 -0
- package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
- package/dist/src/extensions/git/extension/instructions/github.js +1 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
- package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
- package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
- package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
- package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
- package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
- package/dist/src/extensions/git/extension/lib/shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
- package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
- package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
- package/dist/src/extensions/git/extension/skills/pr.js +1 -0
- package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
- package/dist/src/extensions/git/extension/tools/gh.js +1 -0
- package/dist/src/extensions/git/tools.d.ts +27 -0
- package/dist/src/extensions/git/tools.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +2 -2
- package/dist/src/harness/action-result-helpers.d.ts +10 -2
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/announcements.d.ts +2 -8
- package/dist/src/harness/announcements.js +1 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.d.ts +11 -11
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +1 -5
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-call.d.ts +48 -0
- package/dist/src/harness/execute-call.js +1 -0
- package/dist/src/harness/execute-tool.d.ts +3 -1
- package/dist/src/harness/final-output.d.ts +2 -6
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approvals.d.ts +5 -0
- package/dist/src/harness/hitl/approvals.js +1 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/candidates.d.ts +13 -2
- package/dist/src/harness/hitl/candidates.js +1 -1
- package/dist/src/harness/hitl/coordinator.d.ts +3 -3
- package/dist/src/harness/hitl/coordinator.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +6 -4
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +3 -3
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +15 -0
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +4 -6
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.d.ts +5 -6
- package/dist/src/harness/model-call/errors.js +1 -1
- package/dist/src/harness/model-call/recovery.d.ts +4 -3
- package/dist/src/harness/model-call/request.d.ts +5 -3
- package/dist/src/harness/model-call/request.js +1 -1
- package/dist/src/harness/model-call/response.d.ts +2 -1
- package/dist/src/harness/model-call/response.js +1 -1
- package/dist/src/harness/model-call/run.d.ts +5 -3
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/model-call/tools.d.ts +12 -21
- package/dist/src/harness/model-call/tools.js +1 -1
- package/dist/src/harness/model-profile.d.ts +15 -3
- package/dist/src/harness/model-profile.js +1 -1
- package/dist/src/harness/prompt-cache.d.ts +6 -3
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +2 -1
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +7 -6
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/session-machine/commit.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +8 -3
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +4 -6
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
- package/dist/src/harness/tool-call-io.d.ts +3 -0
- package/dist/src/harness/tool-call-io.js +1 -1
- package/dist/src/harness/tools.d.ts +22 -19
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +14 -0
- package/dist/src/instrumentation/lifecycle.d.ts +0 -1
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +2 -1
- package/dist/src/internal/application/compiled-artifacts.js +4 -4
- package/dist/src/internal/application/package.d.ts +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/stamped-package-version.d.ts +5 -0
- package/dist/src/internal/application/stamped-package-version.js +1 -0
- package/dist/src/internal/authored-definition/core.d.ts +3 -0
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module.d.ts +2 -1
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/mcp/skills.js +1 -1
- package/dist/src/internal/model-auth/available-models.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
- package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
- package/dist/src/internal/schedules/consumer-route.js +1 -1
- package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
- package/dist/src/internal/schedules/dev-environment.js +1 -0
- package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
- package/dist/src/internal/workflow/development-run-unavailable-error.d.ts +15 -0
- package/dist/src/internal/workflow/development-run-unavailable-error.js +1 -0
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/catalog-tools.d.ts +12 -0
- package/dist/src/protocol/catalog-tools.js +1 -0
- package/dist/src/protocol/message-version.js +1 -1
- package/dist/src/protocol/message.d.ts +15 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
- package/dist/src/protocol/remote-agent-protocol.js +1 -1
- package/dist/src/protocol/reply-tool.d.ts +2 -0
- package/dist/src/protocol/reply-tool.js +1 -0
- package/dist/src/protocol/runtime-tools.d.ts +6 -0
- package/dist/src/protocol/runtime-tools.js +1 -0
- package/dist/src/protocol/session-projection.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +4 -4
- package/dist/src/protocol/task-tools.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/defaults.js +2 -2
- package/dist/src/public/channels/slack/action-status.d.ts +0 -9
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/task-card.d.ts +1 -1
- package/dist/src/public/context/index.d.ts +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
- package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
- package/dist/src/public/definitions/remote-agent.d.ts +6 -3
- package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
- package/dist/src/public/experimental/schedules/index.d.ts +1 -1
- package/dist/src/public/models/openai/chatgpt/model.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/schedules/providers/in-memory.js +1 -1
- package/dist/src/public/schedules/providers/vercel.js +1 -1
- package/dist/src/public/schedules/subscription.d.ts +36 -16
- package/dist/src/public/tanstack/index.d.ts +40 -0
- package/dist/src/public/tanstack/index.js +1 -0
- package/dist/src/public/tools/web-search.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
- package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
- package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/registry.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/tool-result.d.ts +2 -2
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +2 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.d.ts +2 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -3
- package/dist/src/setup/connection-connector.js +1 -2
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/setup/index.d.ts +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
- package/dist/src/setup/integrations/slack/setup.js +1 -1
- package/dist/src/setup/integrations/web/framework.d.ts +8 -0
- package/dist/src/setup/integrations/web/framework.js +1 -0
- package/dist/src/setup/integrations/web/hosting.d.ts +43 -0
- package/dist/src/setup/integrations/web/hosting.js +15 -0
- package/dist/src/setup/integrations/web/setup.d.ts +6 -10
- package/dist/src/setup/integrations/web/setup.js +23 -17
- package/dist/src/setup/primitives/process-output.d.ts +5 -0
- package/dist/src/setup/primitives/process-output.js +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +7 -3
- package/dist/src/setup/scaffold/create/web-template.js +40 -3
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
- package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +10 -2
- package/dist/src/setup/slack-connect-create.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slack-connect.d.ts +30 -11
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slack-setup-plan.d.ts +72 -0
- package/dist/src/setup/slack-setup-plan.js +1 -0
- package/dist/src/setup/slackbot.d.ts +75 -35
- package/dist/src/setup/slackbot.js +2 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/shared/action-label.d.ts +10 -0
- package/dist/src/shared/action-label.js +1 -0
- package/dist/src/shared/action-request-name.d.ts +3 -1
- package/dist/src/shared/action-request-name.js +1 -1
- package/dist/src/shared/action-types.d.ts +7 -8
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +36 -3
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +8 -0
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/development-env-files.d.ts +4 -0
- package/dist/src/shared/development-env-files.js +1 -0
- package/dist/src/shared/input.d.ts +0 -1
- package/dist/src/shared/map-with-concurrency.d.ts +2 -0
- package/dist/src/shared/map-with-concurrency.js +1 -0
- package/dist/src/shared/skill-definition.d.ts +6 -0
- package/dist/src/shared/skill-package.d.ts +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/web-search.d.ts +15 -2
- package/dist/src/shared/web-search.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/execute.d.ts +0 -3
- package/dist/src/tool-stubs/execute.js +1 -1
- package/dist/src/tool-stubs/rules.js +1 -1
- package/dist/src/tool-stubs/validate-targets.js +1 -1
- package/dist/src/tools/behavior.d.ts +3 -6
- package/dist/src/tools/definition.d.ts +5 -0
- package/dist/src/tools/dynamic.d.ts +5 -2
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/task-cancel.d.ts +1 -1
- package/dist/src/tools/provided/task-wait.d.ts +1 -1
- package/dist/src/tools/provided/web-search.d.ts +20 -7
- package/dist/src/tools/provided/web-search.js +1 -1
- package/dist/src/tools/schema.d.ts +5 -0
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
- package/dist/src/tools/workflow-definition.d.ts +1 -1
- 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-runtime-context.d.ts +1 -0
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
- package/dist/src/tracing/agent-otel-turn-state.js +1 -0
- 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 +4 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +39 -8
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/custom.mdx +26 -0
- package/docs/channels/eve.mdx +8 -5
- package/docs/channels/slack.mdx +32 -82
- package/docs/code-extension.mdx +28 -7
- package/docs/concepts/built-in-tools.md +60 -43
- package/docs/concepts/context-control.md +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +101 -1
- package/docs/concepts/project-structure.mdx +2 -2
- package/docs/concepts/sessions-runs-and-streaming.md +40 -38
- package/docs/connections/mcp.mdx +5 -5
- package/docs/connections/openapi.mdx +1 -1
- package/docs/connections/overview.mdx +4 -2
- package/docs/evals/assertions.mdx +5 -3
- package/docs/evals/reporters.mdx +3 -1
- package/docs/evals/tool-stubs.mdx +3 -1
- package/docs/extensions.md +2 -0
- package/docs/guides/client/messages.mdx +10 -1
- package/docs/guides/deployment/overview.md +2 -2
- package/docs/guides/dev-tui.md +4 -2
- package/docs/guides/dynamic-capabilities.md +14 -4
- package/docs/guides/frontend/meta.json +9 -1
- package/docs/guides/frontend/nextjs.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +10 -9
- package/docs/guides/frontend/tanstack.mdx +201 -0
- package/docs/guides/remote-agents.md +10 -3
- package/docs/guides/session-context.md +1 -0
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +6 -6
- package/docs/reference/cli.md +2 -2
- package/docs/reference/typescript-api.md +4 -4
- package/docs/skills.mdx +19 -4
- package/docs/subagents/index.mdx +5 -3
- package/docs/tools/human-in-the-loop.md +2 -0
- package/docs/tools/overview.mdx +22 -1
- package/docs/tools/tasks-upgrade.md +1 -1
- package/docs/tools/tasks.md +32 -32
- package/docs/tools/workflows.mdx +6 -6
- package/docs/tutorial/ship-it.mdx +1 -1
- package/docs/tutorial/team-playbooks.mdx +2 -2
- package/package.json +28 -6
- package/dist/src/execution/connection-announcement.d.ts +0 -7
- package/dist/src/execution/connection-announcement.js +0 -4
- package/dist/src/execution/tools/connection-approval.d.ts +0 -25
- package/dist/src/execution/tools/connection-approval.js +0 -1
- package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
- package/dist/src/execution/tools/connection-search-rank.js +0 -1
- package/dist/src/execution/tools/connection-target.d.ts +0 -18
- package/dist/src/execution/tools/connection-target.js +0 -1
- package/dist/src/execution/tools/connection-tools.d.ts +0 -4
- package/dist/src/execution/tools/connection-tools.js +0 -2
- package/dist/src/execution/tools/load-skill.d.ts +0 -10
- package/dist/src/execution/tools/load-skill.js +0 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
- package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -26
- package/dist/src/harness/advertised-tools.js +0 -1
- package/dist/src/harness/nested-actions.d.ts +0 -23
- package/dist/src/harness/nested-actions.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
- package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
- package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
- package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
- package/dist/src/public/tools/load-skill.d.ts +0 -3
- package/dist/src/public/tools/load-skill.js +0 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
- package/dist/src/runtime/skills/fragment-context.js +0 -1
- package/dist/src/tools/framework/connection-tools.d.ts +0 -3
- package/dist/src/tools/framework/connection-tools.js +0 -1
- package/dist/src/tools/provided/load-skill.d.ts +0 -2
- package/dist/src/tools/provided/load-skill.js +0 -1
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
- /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
|
@@ -551,25 +551,39 @@ var ClientError = class extends Error {
|
|
|
551
551
|
constructor(status, body, headers) {
|
|
552
552
|
const normalizedHeaders = Object.freeze(Object.fromEntries(new Headers(headers).entries()));
|
|
553
553
|
const contentType = normalizedHeaders["content-type"]?.toLowerCase();
|
|
554
|
+
const parsed = parseJsonObject$1(body);
|
|
554
555
|
let message = body || `Server returned ${status}.`;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
const parsed = JSON.parse(body);
|
|
558
|
-
if (isObject(parsed)) {
|
|
559
|
-
if (typeof parsed.error === "string") message = parsed.error;
|
|
560
|
-
if (typeof parsed.code === "string") code = parsed.code;
|
|
561
|
-
}
|
|
562
|
-
} catch {
|
|
563
|
-
if (contentType?.includes("text/html")) message = `Server returned ${status} with an HTML response. Check the eve route and development server configuration.`;
|
|
564
|
-
}
|
|
556
|
+
if (typeof parsed?.error === "string") message = parsed.error;
|
|
557
|
+
else if (parsed === void 0 && contentType?.includes("text/html")) message = `Server returned ${status} with an HTML response. Check the eve route and development server configuration.`;
|
|
565
558
|
super(message);
|
|
566
559
|
this.name = "ClientError";
|
|
567
|
-
this.code = code;
|
|
560
|
+
this.code = typeof parsed?.code === "string" ? parsed.code : void 0;
|
|
568
561
|
this.status = status;
|
|
569
562
|
this.body = body;
|
|
570
563
|
this.headers = normalizedHeaders;
|
|
571
564
|
}
|
|
572
565
|
};
|
|
566
|
+
var ClientSessionStrandedError = class extends ClientError {
|
|
567
|
+
eveVersion;
|
|
568
|
+
constructor(status, body, headers, details) {
|
|
569
|
+
super(status, body, headers);
|
|
570
|
+
this.name = "ClientSessionStrandedError";
|
|
571
|
+
this.eveVersion = details.eveVersion;
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
function createClientError(status, body, headers) {
|
|
575
|
+
const parsed = status === 409 ? parseJsonObject$1(body) : void 0;
|
|
576
|
+
if (parsed?.code !== "session_stranded") return new ClientError(status, body, headers);
|
|
577
|
+
return new ClientSessionStrandedError(status, body, headers, { eveVersion: typeof parsed.eveVersion === "string" ? parsed.eveVersion : void 0 });
|
|
578
|
+
}
|
|
579
|
+
function parseJsonObject$1(body) {
|
|
580
|
+
try {
|
|
581
|
+
const parsed = JSON.parse(body);
|
|
582
|
+
return isObject(parsed) ? parsed : void 0;
|
|
583
|
+
} catch {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
573
587
|
|
|
574
588
|
//#endregion
|
|
575
589
|
//#region src/shared/errors.ts
|
|
@@ -767,7 +781,7 @@ function settleCall(call, status, error) {
|
|
|
767
781
|
}
|
|
768
782
|
function actionName(action) {
|
|
769
783
|
switch (action.kind) {
|
|
770
|
-
case "load-skill": return
|
|
784
|
+
case "load-skill": return action.name;
|
|
771
785
|
case "subagent-call":
|
|
772
786
|
case "remote-agent-call": return action.name;
|
|
773
787
|
case "tool-call":
|
|
@@ -776,7 +790,7 @@ function actionName(action) {
|
|
|
776
790
|
}
|
|
777
791
|
function resultName(result) {
|
|
778
792
|
switch (result.kind) {
|
|
779
|
-
case "load-skill-result": return
|
|
793
|
+
case "load-skill-result": return result.name;
|
|
780
794
|
case "subagent-result": return result.subagentName;
|
|
781
795
|
default: return result.toolName;
|
|
782
796
|
}
|
|
@@ -1201,6 +1215,9 @@ function isFinalMessageCompleted(event) {
|
|
|
1201
1215
|
//#endregion
|
|
1202
1216
|
//#region src/protocol/message-version.ts
|
|
1203
1217
|
function normalizeMessageStreamEvent(version, event) {
|
|
1218
|
+
return nameSkillLoads(normalizeAppendEvent(version, event));
|
|
1219
|
+
}
|
|
1220
|
+
function normalizeAppendEvent(version, event) {
|
|
1204
1221
|
switch (version) {
|
|
1205
1222
|
case "21":
|
|
1206
1223
|
case "22":
|
|
@@ -1256,6 +1273,26 @@ function normalizeLegacyMessageStreamEvent(version, event) {
|
|
|
1256
1273
|
}
|
|
1257
1274
|
return event;
|
|
1258
1275
|
}
|
|
1276
|
+
function nameSkillLoads(event) {
|
|
1277
|
+
if (event.type !== "actions.requested" || !event.data.actions.some(isUnnamedSkillLoad)) return event;
|
|
1278
|
+
return {
|
|
1279
|
+
...event,
|
|
1280
|
+
data: {
|
|
1281
|
+
...event.data,
|
|
1282
|
+
actions: event.data.actions.map((action) => isUnnamedSkillLoad(action) ? {
|
|
1283
|
+
...action,
|
|
1284
|
+
name: releasedSkillName(action)
|
|
1285
|
+
} : action)
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
function isUnnamedSkillLoad(action) {
|
|
1290
|
+
return action.kind === "load-skill" && typeof Reflect.get(action, "name") !== "string";
|
|
1291
|
+
}
|
|
1292
|
+
function releasedSkillName(action) {
|
|
1293
|
+
const skill = action.input.skill;
|
|
1294
|
+
return typeof skill === "string" ? skill : "load_skill";
|
|
1295
|
+
}
|
|
1259
1296
|
function validateDeltaMessageStreamEvent(version, event) {
|
|
1260
1297
|
if (event.type === "message.appended") {
|
|
1261
1298
|
assertAppendDelta(event.data.messageDelta, "message", version);
|
|
@@ -1561,6 +1598,7 @@ async function* followStreamIterable(input) {
|
|
|
1561
1598
|
caughtUp = true;
|
|
1562
1599
|
input.onCaughtUp?.();
|
|
1563
1600
|
}
|
|
1601
|
+
if (event.type === "session.failed" || event.type === "session.completed") return;
|
|
1564
1602
|
if (input.follow === false && tailIndex !== void 0 && startIndex > tailIndex) return;
|
|
1565
1603
|
}
|
|
1566
1604
|
} catch (error) {
|
|
@@ -1590,6 +1628,7 @@ async function openStreamBody(input) {
|
|
|
1590
1628
|
if (controlVersion !== void 0) searchParams[EVE_STREAM_CONTROL_VERSION_QUERY] = controlVersion;
|
|
1591
1629
|
if (input.startIndex !== 0) searchParams.startIndex = String(input.startIndex);
|
|
1592
1630
|
if (input.requestTailIndex === true) searchParams.includeTailIndex = "1";
|
|
1631
|
+
if (input.follow === false) searchParams.follow = "false";
|
|
1593
1632
|
for (let attempt = 0; attempt < openRetryPolicy.maxAttempts; attempt += 1) {
|
|
1594
1633
|
input.signal?.throwIfAborted();
|
|
1595
1634
|
const url = createClientUrl(input.host, input.path, Object.keys(searchParams).length > 0 ? searchParams : void 0);
|
|
@@ -1630,7 +1669,8 @@ async function openStreamBody(input) {
|
|
|
1630
1669
|
lastStatus = response.status;
|
|
1631
1670
|
lastBody = await response.text();
|
|
1632
1671
|
lastHeaders = response.headers;
|
|
1633
|
-
|
|
1672
|
+
const error = createClientError(response.status, lastBody, response.headers);
|
|
1673
|
+
if (error instanceof ClientSessionStrandedError || !retryPolicy.retryableErrorStatuses.has(response.status)) throw error;
|
|
1634
1674
|
if (attempt < openRetryPolicy.maxAttempts - 1) {
|
|
1635
1675
|
await sleep(retryDelayMs, input.signal);
|
|
1636
1676
|
retryDelayMs = Math.min(retryDelayMs * 2, openRetryPolicy.maxDelayMs);
|
|
@@ -1887,7 +1927,7 @@ async function postJson(input) {
|
|
|
1887
1927
|
signal: input.signal
|
|
1888
1928
|
}, input.context.redirect));
|
|
1889
1929
|
const text = await response.text();
|
|
1890
|
-
if (!response.ok) throw
|
|
1930
|
+
if (!response.ok) throw createClientError(response.status, text, response.headers);
|
|
1891
1931
|
try {
|
|
1892
1932
|
return {
|
|
1893
1933
|
payload: JSON.parse(text),
|
|
@@ -2481,7 +2521,7 @@ async function postTurn(context, path, input, requireMessage, stubs) {
|
|
|
2481
2521
|
});
|
|
2482
2522
|
if (!response.ok) {
|
|
2483
2523
|
const responseBody = await response.text();
|
|
2484
|
-
throw
|
|
2524
|
+
throw createClientError(response.status, responseBody, response.headers);
|
|
2485
2525
|
}
|
|
2486
2526
|
return response;
|
|
2487
2527
|
}
|
|
@@ -3069,11 +3109,15 @@ function formatAuthorizationDisplayName(name) {
|
|
|
3069
3109
|
return `${name.charAt(0).toUpperCase()}${name.slice(1)}`;
|
|
3070
3110
|
}
|
|
3071
3111
|
|
|
3112
|
+
//#endregion
|
|
3113
|
+
//#region src/protocol/catalog-tools.ts
|
|
3114
|
+
const SKILL_TOOL_NAME = "eve__skill";
|
|
3115
|
+
|
|
3072
3116
|
//#endregion
|
|
3073
3117
|
//#region src/shared/action-request-name.ts
|
|
3074
3118
|
function actionRequestName(action) {
|
|
3075
3119
|
switch (action.kind) {
|
|
3076
|
-
case "load-skill": return
|
|
3120
|
+
case "load-skill": return action.name;
|
|
3077
3121
|
case "subagent-call": return action.subagentName;
|
|
3078
3122
|
case "remote-agent-call": return action.remoteAgentName;
|
|
3079
3123
|
case "tool-call":
|
|
@@ -3081,6 +3125,23 @@ function actionRequestName(action) {
|
|
|
3081
3125
|
}
|
|
3082
3126
|
}
|
|
3083
3127
|
|
|
3128
|
+
//#endregion
|
|
3129
|
+
//#region src/shared/display-name.ts
|
|
3130
|
+
function displayName(identifier) {
|
|
3131
|
+
const words = lastSegment(identifier).replace(/([a-z0-9])([A-Z])/gu, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/gu, "$1 $2").split(SEPARATORS).filter((word) => word !== "").map((word) => word.length > 1 && word === word.toUpperCase() ? word : word.toLowerCase());
|
|
3132
|
+
return words.length === 0 ? identifier : words.join(" ");
|
|
3133
|
+
}
|
|
3134
|
+
function displayTitle(identifier) {
|
|
3135
|
+
return capitalize(displayName(identifier));
|
|
3136
|
+
}
|
|
3137
|
+
const SEPARATORS = /[\s_-]+/u;
|
|
3138
|
+
function lastSegment(identifier) {
|
|
3139
|
+
return identifier.split("__").findLast((segment) => segment !== "") ?? identifier;
|
|
3140
|
+
}
|
|
3141
|
+
function capitalize(text) {
|
|
3142
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3084
3145
|
//#endregion
|
|
3085
3146
|
//#region src/client/message-action-parts.ts
|
|
3086
3147
|
function toMessageInputRequest(request) {
|
|
@@ -3097,6 +3158,7 @@ function createToolMetadata(descriptor, extra) {
|
|
|
3097
3158
|
return { eve: {
|
|
3098
3159
|
inputRequest: extra?.inputRequest,
|
|
3099
3160
|
kind: descriptor.kind,
|
|
3161
|
+
label: extra?.label,
|
|
3100
3162
|
name: descriptor.name
|
|
3101
3163
|
} };
|
|
3102
3164
|
}
|
|
@@ -3109,6 +3171,7 @@ function mergeToolMetadata(current, next) {
|
|
|
3109
3171
|
inputRequest: next.eve?.inputRequest ?? current?.eve?.inputRequest,
|
|
3110
3172
|
inputResponse: next.eve?.inputResponse ?? current?.eve?.inputResponse,
|
|
3111
3173
|
kind,
|
|
3174
|
+
label: next.eve?.label ?? current?.eve?.label,
|
|
3112
3175
|
name
|
|
3113
3176
|
} };
|
|
3114
3177
|
}
|
|
@@ -3118,7 +3181,7 @@ function normalizeActionRequest(action) {
|
|
|
3118
3181
|
case "load-skill": return {
|
|
3119
3182
|
kind: "load-skill",
|
|
3120
3183
|
name,
|
|
3121
|
-
toolName:
|
|
3184
|
+
toolName: SKILL_TOOL_NAME
|
|
3122
3185
|
};
|
|
3123
3186
|
case "tool-call":
|
|
3124
3187
|
case "workflow-tool-call": return {
|
|
@@ -3138,8 +3201,8 @@ function normalizeActionResult(result) {
|
|
|
3138
3201
|
switch (result.kind) {
|
|
3139
3202
|
case "load-skill-result": return {
|
|
3140
3203
|
kind: "load-skill",
|
|
3141
|
-
name: result.name
|
|
3142
|
-
toolName:
|
|
3204
|
+
name: result.name,
|
|
3205
|
+
toolName: SKILL_TOOL_NAME
|
|
3143
3206
|
};
|
|
3144
3207
|
case "tool-result": return {
|
|
3145
3208
|
kind: "tool-call",
|
|
@@ -3153,6 +3216,9 @@ function normalizeActionResult(result) {
|
|
|
3153
3216
|
};
|
|
3154
3217
|
}
|
|
3155
3218
|
}
|
|
3219
|
+
function settledLabel(current, label, descriptor) {
|
|
3220
|
+
return label ?? current?.eve?.label ?? displayTitle(descriptor.name);
|
|
3221
|
+
}
|
|
3156
3222
|
function stringifyUnknown(value) {
|
|
3157
3223
|
if (typeof value === "string") return value;
|
|
3158
3224
|
try {
|
|
@@ -3249,6 +3315,12 @@ function transition(message, input) {
|
|
|
3249
3315
|
}
|
|
3250
3316
|
const messageRun = { transition };
|
|
3251
3317
|
|
|
3318
|
+
//#endregion
|
|
3319
|
+
//#region src/shared/action-label.ts
|
|
3320
|
+
function actionLabel(action, presentation) {
|
|
3321
|
+
return presentation?.[action.callId]?.label ?? displayTitle(actionRequestName(action));
|
|
3322
|
+
}
|
|
3323
|
+
|
|
3252
3324
|
//#endregion
|
|
3253
3325
|
//#region src/client/tool-part-state.ts
|
|
3254
3326
|
function toolPartState(data, part) {
|
|
@@ -3446,7 +3518,7 @@ function reduceContent(data, event) {
|
|
|
3446
3518
|
state: "input-available",
|
|
3447
3519
|
stepIndex: event.data.stepIndex,
|
|
3448
3520
|
toolCallId: action.callId,
|
|
3449
|
-
toolMetadata: createToolMetadata(descriptor),
|
|
3521
|
+
toolMetadata: createToolMetadata(descriptor, { label: actionLabel(action, event.data.presentation) }),
|
|
3450
3522
|
toolName: descriptor.toolName,
|
|
3451
3523
|
type: "dynamic-tool"
|
|
3452
3524
|
}));
|
|
@@ -3466,7 +3538,10 @@ function reduceContent(data, event) {
|
|
|
3466
3538
|
state: "approval-requested",
|
|
3467
3539
|
stepIndex: existing?.stepIndex ?? event.data.stepIndex,
|
|
3468
3540
|
toolCallId: request.action.callId,
|
|
3469
|
-
toolMetadata: createToolMetadata(descriptor, {
|
|
3541
|
+
toolMetadata: createToolMetadata(descriptor, {
|
|
3542
|
+
inputRequest: toMessageInputRequest(request),
|
|
3543
|
+
label: existing?.toolMetadata?.eve?.label ?? actionLabel(request.action, void 0)
|
|
3544
|
+
}),
|
|
3470
3545
|
toolName: descriptor.toolName,
|
|
3471
3546
|
type: "dynamic-tool"
|
|
3472
3547
|
}));
|
|
@@ -3487,7 +3562,7 @@ function reduceContent(data, event) {
|
|
|
3487
3562
|
input: existing?.input,
|
|
3488
3563
|
stepIndex: existing?.stepIndex ?? event.data.stepIndex,
|
|
3489
3564
|
toolCallId: event.data.result.callId,
|
|
3490
|
-
toolMetadata: mergeToolMetadata(existing?.toolMetadata, createToolMetadata(descriptor)),
|
|
3565
|
+
toolMetadata: mergeToolMetadata(existing?.toolMetadata, createToolMetadata(descriptor, { label: settledLabel(existing?.toolMetadata, event.data.presentation?.[event.data.result.callId]?.label, descriptor) })),
|
|
3491
3566
|
toolName: existing?.toolName ?? descriptor.toolName,
|
|
3492
3567
|
type: "dynamic-tool"
|
|
3493
3568
|
};
|
|
@@ -3516,7 +3591,7 @@ function reduceContent(data, event) {
|
|
|
3516
3591
|
state: "output-available",
|
|
3517
3592
|
stepIndex: existing?.stepIndex ?? event.data.stepIndex,
|
|
3518
3593
|
toolCallId: event.data.result.callId,
|
|
3519
|
-
toolMetadata: mergeToolMetadata(existing?.toolMetadata, createToolMetadata(descriptor)),
|
|
3594
|
+
toolMetadata: mergeToolMetadata(existing?.toolMetadata, createToolMetadata(descriptor, { label: settledLabel(existing?.toolMetadata, event.data.presentation?.[event.data.result.callId]?.label, descriptor) })),
|
|
3520
3595
|
toolName: existing?.toolName ?? descriptor.toolName,
|
|
3521
3596
|
type: "dynamic-tool"
|
|
3522
3597
|
});
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { RegistryConfig } from "#compiled/shadcn-registry/index.js";
|
|
2
|
+
import type { Asker } from "#setup/ask.js";
|
|
3
|
+
import { type WebChatFramework } from "#setup/integrations/web/framework.js";
|
|
2
4
|
interface AddRegistryMappingsResult {
|
|
3
5
|
added: string[];
|
|
4
6
|
skippedBuiltIn: string[];
|
|
5
7
|
skippedExisting: string[];
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Picks the framework `eve add channel/web` installs, before it writes any file.
|
|
11
|
+
* An app already in `apps/web` decides; an explicit answer that conflicts fails.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveWebChatFramework(appRoot: string, asker: Asker, answers?: Readonly<Record<string, unknown>>): Promise<WebChatFramework>;
|
|
7
14
|
/** Resolves and prepares the root package that owns Web Chat. */
|
|
8
|
-
export declare function prepareWebChatProjectRoot(appRoot: string): Promise<string>;
|
|
15
|
+
export declare function prepareWebChatProjectRoot(appRoot: string, framework?: WebChatFramework): Promise<string>;
|
|
9
16
|
/** Reads registry namespace mappings from package.json. */
|
|
10
17
|
export declare function readRegistryConfig(appRoot: string): Promise<RegistryConfig>;
|
|
11
|
-
export declare function addWebRegistryTsconfig(source: string, path: string): string;
|
|
18
|
+
export declare function addWebRegistryTsconfig(source: string, path: string, framework?: WebChatFramework): string;
|
|
12
19
|
/** Prepares the TypeScript host configuration shadcn registry items expect. */
|
|
13
|
-
export declare function prepareWebRegistryProject(appRoot: string): Promise<void>;
|
|
20
|
+
export declare function prepareWebRegistryProject(appRoot: string, framework?: WebChatFramework): Promise<void>;
|
|
14
21
|
/** Adds explicit registry namespace mappings to package.json. */
|
|
15
22
|
export declare function addRegistryMappings(appRoot: string, arguments_: readonly string[]): Promise<AddRegistryMappingsResult>;
|
|
16
23
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFile,writeFile}from"node:fs/promises";import{join}from"node:path";import{resolveEveProjectContext}from"#internal/project-context.js";import{applyEdits,modify,parse}from"#compiled/jsonc-parser/index.js";import{WEB_APP_TEMPLATE_FILES}from"#setup/scaffold/create/web-template.js";function errorMessage(e){return e instanceof Error?e.message:String(e)}function isRegistrySource(e){return typeof e==`string`?!0:typeof e!=`object`||!e||!(`url`in e)?!1:typeof e.url==`string`}function parseRegistries(e,t){if(t===void 0)return{};if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`${e} has an invalid registries field.`);let n={};for(let[r,i]of Object.entries(t)){if(!r.startsWith(`@`)||!isRegistrySource(i))throw Error(`${e} has an invalid registry entry for ${r}.`);n[r]=i}return n}async function readRegistryPackage(e){let t=await resolveEveProjectContext(e),n=join(t.environmentRoot,`package.json`),r;try{r=JSON.parse(await readFile(n,`utf8`))}catch(e){throw Error(`Could not read ${n}: ${errorMessage(e)}`)}if(typeof r!=`object`||!r||Array.isArray(r))throw Error(`${n} must contain a JSON object.`);let i=r;return{path:n,document:i,config:{registries:parseRegistries(n,i.registries)}}}function parseRegistryMapping(e){let t=e.indexOf(`=`),n=t===-1?e:e.slice(0,t),r=t===-1?``:e.slice(t+1);if(!n.startsWith(`@`))throw Error(`Registry namespaces must start with @: ${n}`);if(!r.includes(`{name}`))throw Error(`Pass a registry URL containing {name}, for example ${n}=https://example.com/r/{name}.json.`);return{namespace:n,url:r}}async function
|
|
2
|
-
`};function setJsoncValue(e,t,n){return applyEdits(e,modify(e,t,n,{formattingOptions:JSONC_FORMATTING}))}function addWebRegistryTsconfig(e,t){let
|
|
1
|
+
import{readFile,writeFile}from"node:fs/promises";import{join}from"node:path";import{resolveEveProjectContext}from"#internal/project-context.js";import{applyEdits,modify,parse}from"#compiled/jsonc-parser/index.js";import{WEB_CHAT_FRAMEWORK_LABELS,WEB_FRAMEWORK_QUESTION,detectWebChatFramework}from"#setup/integrations/web/framework.js";import{WEB_APP_TANSTACK_TEMPLATE_FILES,WEB_APP_TEMPLATE_FILES}from"#setup/scaffold/create/web-template.js";function errorMessage(e){return e instanceof Error?e.message:String(e)}function isRegistrySource(e){return typeof e==`string`?!0:typeof e!=`object`||!e||!(`url`in e)?!1:typeof e.url==`string`}function parseRegistries(e,t){if(t===void 0)return{};if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`${e} has an invalid registries field.`);let n={};for(let[r,i]of Object.entries(t)){if(!r.startsWith(`@`)||!isRegistrySource(i))throw Error(`${e} has an invalid registry entry for ${r}.`);n[r]=i}return n}async function readRegistryPackage(e){let t=await resolveEveProjectContext(e),n=join(t.environmentRoot,`package.json`),r;try{r=JSON.parse(await readFile(n,`utf8`))}catch(e){throw Error(`Could not read ${n}: ${errorMessage(e)}`)}if(typeof r!=`object`||!r||Array.isArray(r))throw Error(`${n} must contain a JSON object.`);let i=r;return{path:n,document:i,config:{registries:parseRegistries(n,i.registries)}}}function parseRegistryMapping(e){let t=e.indexOf(`=`),n=t===-1?e:e.slice(0,t),r=t===-1?``:e.slice(t+1);if(!n.startsWith(`@`))throw Error(`Registry namespaces must start with @: ${n}`);if(!r.includes(`{name}`))throw Error(`Pass a registry URL containing {name}, for example ${n}=https://example.com/r/{name}.json.`);return{namespace:n,url:r}}const WEB_CHAT_SCRIPTS={next:{"dev:web":`next dev apps/web`,"build:web":`next build apps/web`},tanstack:{"dev:web":`vite dev apps/web`,"build:web":`vite build apps/web`}};function isWebChatScriptDefault(e,t){return Object.values(WEB_CHAT_SCRIPTS).some(n=>n[e]===t)}async function resolveWebChatFramework(e,t,n={}){let r=await resolveEveProjectContext(e);if(r.kind===`workspace`)throw Error(`Web Chat setup requires a selected workspace agent.`);let i=await detectWebChatFramework(join(r.environmentRoot,`apps`,`web`));if(i!==void 0&&!(WEB_FRAMEWORK_QUESTION.key in n))return i;let a=await t.ask(WEB_FRAMEWORK_QUESTION);if(i!==void 0&&a!==i)throw Error(`apps/web already contains a ${WEB_CHAT_FRAMEWORK_LABELS[i]} app. Remove apps/web to switch Web Chat to ${WEB_CHAT_FRAMEWORK_LABELS[a]}, or answer ${WEB_FRAMEWORK_QUESTION.key}="${i}".`);return a}async function prepareWebChatProjectRoot(e,t=`next`){let n=await resolveEveProjectContext(e);if(n.kind===`workspace`)throw Error(`Web Chat setup requires a selected workspace agent.`);let r=n.environmentRoot,i=join(r,`package.json`),a=await readFile(i,`utf8`),o=JSON.parse(a),s={...o.scripts};for(let[e,n]of Object.entries(WEB_CHAT_SCRIPTS[t])){let t=s[e];(t===void 0||isWebChatScriptDefault(e,t))&&(s[e]=n)}return await writeFile(i,`${JSON.stringify({...o,scripts:s},null,2)}\n`,`utf8`),r}async function readRegistryConfig(e){return(await readRegistryPackage(e)).config}const JSONC_FORMATTING={insertSpaces:!0,tabSize:2,eol:`
|
|
2
|
+
`};function setJsoncValue(e,t,n){return applyEdits(e,modify(e,t,n,{formattingOptions:JSONC_FORMATTING}))}const WEB_REGISTRY_TSCONFIG_SOURCES={next:WEB_APP_TEMPLATE_FILES[`tsconfig.json`],tanstack:WEB_APP_TANSTACK_TEMPLATE_FILES[`tsconfig.json`]};function addWebRegistryTsconfig(e,t,n=`next`){let r=[],i=parse(e,r,{allowTrailingComma:!0});if(r.length>0||typeof i!=`object`||!i||Array.isArray(i))throw Error(`Could not add Web Chat because ${t} is not a valid JSON object.`);let a=i,o=JSON.parse(WEB_REGISTRY_TSCONFIG_SOURCES[n]),s=a.compilerOptions?.paths?.[`@/*`];if(s!==void 0&&(!Array.isArray(s)||!s.includes(`./*`)))throw Error(`Could not add Web Chat because ${t} already defines @/* without mapping it to ./*.`);let c=e;for(let[e,t]of Object.entries(o.compilerOptions)){if(e===`paths`||e===`plugins`)continue;let n=a.compilerOptions?.[e];if(n===void 0)c=setJsoncValue(c,[`compilerOptions`,e],t);else if(e===`types`&&Array.isArray(n)&&Array.isArray(t)){let e=[...new Set([...n,...t])];e.length>n.length&&(c=setJsoncValue(c,[`compilerOptions`,`types`],e))}}s===void 0&&(c=setJsoncValue(c,[`compilerOptions`,`paths`,`@/*`],[`./*`]));let l=a.compilerOptions?.plugins??[],u=l.some(e=>typeof e==`object`&&!!e&&`name`in e&&e.name===`next`);return n===`next`&&!u&&(c=setJsoncValue(c,[`compilerOptions`,`plugins`],[...l,{name:`next`}])),c=setJsoncValue(c,[`include`],[...new Set([...a.include??[],...o.include])]),c=setJsoncValue(c,[`exclude`],[...new Set([...a.exclude??[],...o.exclude])]),c}async function prepareWebRegistryProject(e,t=`next`){let n=join(e,`apps`,`web`,`tsconfig.json`),r;try{r=await readFile(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return;throw Error(`Could not add Web Chat because ${n} could not be read: ${errorMessage(e)}`)}let i=addWebRegistryTsconfig(r,n,t);i!==r&&await writeFile(n,i,`utf8`)}async function addRegistryMappings(e,t){if(t.length===0)throw Error(`Pass at least one registry to add.`);let n=await readRegistryPackage(e),r=t.map(parseRegistryMapping),i={...n.config.registries},a={added:[],skippedBuiltIn:[],skippedExisting:[]};for(let e of r)e.namespace===`@shadcn`||e.namespace===`@skills`?a.skippedBuiltIn.push(e.namespace):i[e.namespace]===void 0?(i[e.namespace]=e.url,a.added.push(e.namespace)):a.skippedExisting.push(e.namespace);return a.added.length>0&&await writeFile(n.path,`${JSON.stringify({...n.document,registries:i},null,2)}\n`,`utf8`),a}export{addRegistryMappings,addWebRegistryTsconfig,prepareWebChatProjectRoot,prepareWebRegistryProject,readRegistryConfig,resolveWebChatFramework};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasInteractiveTerminal}from"./preconditions.js";import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{prepareWebChatProjectRoot,prepareWebRegistryProject,readRegistryConfig}from"./registry-project.js";import{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand}from"./registry-recovery.js";import{runRegistryAddCommand}from"./registry-add-command.js";import{RegistrySetupFailedError,runDeclaredSetups}from"./registry-declared-setups.js";import{installRegistryItemTransaction}from"./registry-install-transaction.js";import{eveMetadataFromRegistryItem,parseOfficialRegistrySearchMetadata}from"./registry-metadata.js";import{prepareDeclaredPnpmBuildPolicy}from"./registry-pnpm-build-policy-flow.js";import{printRegistrySearchResults,registryViewText}from"./registry-presentation.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{addRegistryItems,getRegistryItems,searchRegistries}from"#compiled/shadcn-registry/index.js";import semver from"#compiled/semver/index.js";const defaultAddCommandDependencies={createPrompter,hasInteractiveTerminal,loadSetupCommandRunner:async()=>(await import(`./registry-setup-command.js`)).runRegistrySetupCommand,prepareWebRegistryProject};function resolveOfficialRegistryUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return`https://eve.dev/r`;let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=t.pathname.replace(/\/+$/,``),t.toString().replace(/\/$/,``)}const OFFICIAL_REGISTRY=resolveOfficialRegistryUrl(),OFFICIAL_CATALOG=`${OFFICIAL_REGISTRY}/registry.json`,SKILLS_REGISTRY=`@skills`;function itemAddress(e){return e.startsWith(`@`)||/^https?:\/\//.test(e)?e:`${OFFICIAL_REGISTRY}/${e}.json`}function assertCompatibleEveVersion(e){if(e===void 0)return;let t=resolveInstalledPackageInfo().version;if(semver.validRange(e)===null)throw Error(`Registry item has an invalid eve version requirement: ${e}.`);if(!semver.subset(t,e))throw Error(`This registry item requires eve ${e}, but this project is using eve ${t}. Upgrade eve and run the command again.`)}function isOfficialItemAddress(e){return e.startsWith(`${OFFICIAL_REGISTRY}/`)}function withBuiltInRegistries(e){return{...e,registries:{[SKILLS_REGISTRY]:`https://www.skills.sh/r/{name}?agent=eve`,...e.registries}}}async function readEveRegistryConfig(e){return withBuiltInRegistries(await readRegistryConfig(e))}function configuredRegistrySources(e){return Object.keys(e.registries??{})}function validateRegistrySource(e){if(e!==void 0&&!e.startsWith(`@`)&&!/^https?:\/\//.test(e))throw Error(`Registry sources must be a namespace or URL: ${e}`)}async function loadOfficialSearchMetadata(){let e=await fetch(OFFICIAL_CATALOG);if(!e.ok)throw Error(`Could not read the eve registry (${e.status}).`);return parseOfficialRegistrySearchMetadata(await e.json())}function searchItemAddress(e){return e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument}function enrichSearchItem(e,t){let n=searchItemAddress(e);return{item:e,address:n,...t.get(n)}}function registrySourceLabel(e){return e===OFFICIAL_CATALOG?`eve`:e===SKILLS_REGISTRY?`skills.sh`:e}function searchPresentationSections(e,t,n){return e.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{label:registrySourceLabel(e),items:r.items.map(e=>enrichSearchItem(e,n)),total:r.pagination.total}]})}async function printAddSuggestions(e,t,n){try{let r=n.split(`/`).at(-1)||n,{resultsBySource:i,sources:a,metadataByAddress:o}=await searchRegistryCatalog(t,{limit:5,query:r}),s=searchPresentationSections(a,i,o);if(s.every(e=>e.items.length===0))return;e.log(`Did you mean?`),printRegistrySearchResults(e,{query:r,sections:s})}catch{}}async function searchRegistryCatalog(e,t){validateRegistrySource(t.source);let n=await readEveRegistryConfig(e),r=t.source?[t.source]:[OFFICIAL_CATALOG,...configuredRegistrySources(n).filter(e=>t.query!==void 0||e!==SKILLS_REGISTRY)],i=await Promise.all(r.map(async e=>{try{return{result:await searchRegistries([e],{config:n,limit:t.limit??500,query:t.query}),source:e}}catch(t){return{error:t,source:e}}})),a=[],o=new Map;for(let e of i)if(`error`in e)a.push({message:errorMessage(e.error),registry:e.source});else{let t=e.result.errors??[];if(a.push(...t),t.length===0){let t=e.result.items.filter(t=>t.registry===e.source);o.set(e.source,{...e.result,items:t,pagination:{...e.result.pagination,total:e.result.items.length===t.length?e.result.pagination.total:0}})}}let s=new Map(a.map(e=>[`${e.registry}\0${e.message}`,e])),c=o.has(OFFICIAL_CATALOG)?await loadOfficialSearchMetadata():new Map,l=o.get(OFFICIAL_CATALOG);if(l!==void 0){let e=l.items.filter(e=>c.get(searchItemAddress(e))?.hidden!==!0);l.items=e,l.pagination={...l.pagination,total:e.length},l.items.sort((e,t)=>{let rank=e=>c.get(searchItemAddress(e))?.implementation===`native`?0:1;return rank(e)-rank(t)})}let u=[...o.values()];return{config:n,result:{items:u.flatMap(e=>e.items),pagination:{hasMore:u.some(e=>e.pagination.hasMore),limit:t.limit??500,offset:0,total:u.reduce((e,t)=>e+t.pagination.total,0)},...s.size>0?{errors:[...s.values()]}:{}},resultsBySource:o,sources:r,metadataByAddress:c}}async function browseRegistryCatalog(e,t={}){let{result:n}=await searchRegistryCatalog(e,t);return{items:n.items.map(e=>{let t={address:e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument,name:e.name,source:e.registry===OFFICIAL_CATALOG?`Vercel`:e.registry};return e.title!==void 0&&(t.title=e.title),e.type!==void 0&&(t.type=e.type),e.description!==void 0&&(t.description=e.description),t}),total:n.pagination.total,errors:n.errors??[]}}async function browseRegistryItems(e,t,n,r,i={}){let{result:a,resultsBySource:o,sources:s,metadataByAddress:c}=await searchRegistryCatalog(t,{limit:i.limit,query:n,source:r}),l=a.errors??[];if(i.json||o.size>0){let t=a.items.map(e=>({...e,...c.get(searchItemAddress(e))})),r={query:n,sections:searchPresentationSections(s,o,c)};i.json&&(r.json={...a,items:t}),printRegistrySearchResults(e,r)}for(let t of l)e.error(`${t.registry}: ${t.message}`);l.length>0&&(process.exitCode=1)}async function installRegistryItem(e,t,n={},r=defaultAddCommandDependencies){let i,a=[],o={error:e=>{i=e},log:e=>a.push(e)},s=process.exitCode,c;try{c=await runAddCommand(o,e,t,{...n,yes:n.prompter===void 0||n.yes,setupAuthorized:n.prompter!==void 0,throwSetupFailures:!0},r)}catch(e){if(process.exitCode=s,!(e instanceof RegistrySetupFailedError))throw e;let t={resumeCommand:e.resumeCommand,reason:e.reason};return e.prerequisite!==void 0&&(t.prerequisite=e.prerequisite),{output:a,setupIncomplete:t}}if(process.exitCode=s,i!==void 0)throw Error(i);if(c===!1)throw new WizardCancelledError;if(c===`setup-incomplete`)return{output:a,setupIncomplete:{resumeCommand:setupResumeCommand(t)}};let l={output:a};return c!==void 0&&(l.setup=c),l}async function runAddCommand(e,t,n,r,i=defaultAddCommandDependencies){let setupIncomplete=t=>(r.silent!==!0&&e.log(setupReminder(n,t)),`setup-incomplete`);return runRegistryAction(e,t,async()=>{let a=itemAddress(n),o=a===itemAddress(`channel/web`)&&r.skipInstall!==!0?await prepareWebChatProjectRoot(t):t,s=await readEveRegistryConfig(t);if(r.skipInstall===!0){if(r.overwrite===!0)throw Error(`--overwrite cannot be used with --skip-install.`);if(r.skipSetup===!0)throw Error(`--skip-install cannot be used with --skip-setup.`);if(!isOfficialItemAddress(a))throw Error(`Setup flows are currently supported only for official eve registry items.`)}let c=await resolveRegistryItemForAdd(e,async()=>(await getRegistryItems([a],{config:s}))[0],()=>printAddSuggestions(e,t,n));if(!c.found)return;let l=c.item,u=isOfficialItemAddress(a)?eveMetadataFromRegistryItem(l):void 0;if(assertCompatibleEveVersion(u?.requires),r.skipInstall===!0){if(u?.setup===void 0)throw Error(`Registry item "${n}" does not declare a setup flow.`);let a=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:r,dependencies:i,resumeCommand:setupResumeCommand(n)});return a===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,a,r)}if(!await prepareDeclaredPnpmBuildPolicy({logger:e,appRoot:o,item:n,policies:u?.install?.pnpm?.buildScripts,options:r}))return!1;if(a===itemAddress(`channel/web`)&&await(i.prepareWebRegistryProject??prepareWebRegistryProject)(o),await installRegistryItemTransaction({appRoot:o,item:n,registryItem:l,nonInteractive:r.nonInteractive,logger:e,install:async()=>{await addRegistryItems([a],{config:s,cwd:o,overwrite:r.overwrite,silent:r.silent})}}),u?.setup===void 0)return reportRegistryCompletion(e,n,{facts:[]},r);let d=i.hasInteractiveTerminal?.()??defaultAddCommandDependencies.hasInteractiveTerminal();if(r.nonInteractive&&e.log(serializeHeadlessSetupEvent({version:1,type:`progress`,message:r.skipInstall?`Setup ${n}`:`Installed ${n}`})),r.skipSetup===!0)return r.nonInteractive?reportRegistryCompletion(e,n,{facts:[]},r):setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&!d&&r.setupAuthorized!==!0)return setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&r.setupAuthorized!==!0)try{if(await(r.prompter??i.createPrompter?.()??defaultAddCommandDependencies.createPrompter()).select({message:`Set up ${n} now?`,initialValue:`yes`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]})===`no`)return setupIncomplete(`skipped`)}catch(e){if(!(e instanceof WizardCancelledError))throw e;return setupIncomplete(`cancelled`)}let f=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:{...r,force:r.overwrite},dependencies:i,resumeCommand:setupResumeCommand(n)});return f===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,f,r)},{rethrow:e=>r.throwSetupFailures===!0&&e instanceof RegistrySetupFailedError})}async function runRegistryListCommand(e,t,n,r={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,void 0,n,r))}async function runRegistrySearchCommand(e,t,n,r,i={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,n,r,{...i,limit:i.limit??10}))}async function runRegistryViewCommand(e,t,n,r={}){await runRegistryAction(e,t,async()=>{let i=await readEveRegistryConfig(t),a=await getRegistryItems([itemAddress(n)],{config:i}),o=a.length===1?a[0]:a;e.log(r.json?JSON.stringify(o,null,2):registryViewText(n,o))})}export{browseRegistryCatalog,installRegistryItem,resolveOfficialRegistryUrl,runAddCommand,runRegistryAddCommand,runRegistryListCommand,runRegistrySearchCommand,runRegistryViewCommand};
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{headlessSetupContinuation,serializeHeadlessSetupEvent}from"./setup-headless.js";import{prepareWebChatProjectRoot,prepareWebRegistryProject,readRegistryConfig,resolveWebChatFramework}from"./registry-project.js";import{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand}from"./registry-recovery.js";import{runRegistryAddCommand}from"./registry-add-command.js";import{RegistrySetupFailedError,runDeclaredSetups}from"./registry-declared-setups.js";import{installRegistryItemTransaction}from"./registry-install-transaction.js";import{eveMetadataFromRegistryItem,parseOfficialRegistrySearchMetadata}from"./registry-metadata.js";import{prepareDeclaredPnpmBuildPolicy}from"./registry-pnpm-build-policy-flow.js";import{printRegistrySearchResults,registryViewText}from"./registry-presentation.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{InvalidAnswerError,headlessAsker,interactiveAsker,withAnswers,withPolicy}from"#setup/ask.js";import{setupQuestionToWire}from"#setup/setup-question-wire.js";import{addRegistryItems,getRegistryItems,searchRegistries}from"#compiled/shadcn-registry/index.js";import semver from"#compiled/semver/index.js";const defaultAddCommandDependencies={createPrompter,hasInteractiveTerminal,loadSetupCommandRunner:async()=>(await import(`./registry-setup-command.js`)).runRegistrySetupCommand,prepareWebRegistryProject};function resolveOfficialRegistryUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return`https://eve.dev/r`;let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=t.pathname.replace(/\/+$/,``),t.toString().replace(/\/$/,``)}const OFFICIAL_REGISTRY=resolveOfficialRegistryUrl(),OFFICIAL_CATALOG=`${OFFICIAL_REGISTRY}/registry.json`,SKILLS_REGISTRY=`@skills`;function itemAddress(e){return e.startsWith(`@`)||/^https?:\/\//.test(e)?e:`${OFFICIAL_REGISTRY}/${e}.json`}const WEB_CHAT_ITEMS={next:`channel/web`,tanstack:`channel/web-tanstack`};async function askWebChatFramework(e,t,n,r,i){let a=r.nonInteractive===!0,o=r.setupAuthorized===!0||(i.hasInteractiveTerminal??defaultAddCommandDependencies.hasInteractiveTerminal)(),s=withAnswers(r.answers??{})(r.yes===!0||a||!o?withPolicy(`assume`)(headlessAsker()):interactiveAsker(r.prompter??i.createPrompter?.()??defaultAddCommandDependencies.createPrompter()));try{return await resolveWebChatFramework(t,s,r.answers)}catch(t){if(t instanceof WizardCancelledError)return!1;if(!a||!(t instanceof InvalidAnswerError))throw t;let i=setupQuestionToWire(t.question);e.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,item:n,installed:!1,completedItems:[],status:`input_required`,question:i,issue:{code:`invalid_answer`,message:t.message},next:headlessSetupContinuation({item:n,installed:!1,answers:r.answers,question:i})})),process.exitCode=2;return}}function assertCompatibleEveVersion(e){if(e===void 0)return;let t=resolveInstalledPackageInfo().version;if(semver.validRange(e)===null)throw Error(`Registry item has an invalid eve version requirement: ${e}.`);if(!semver.subset(t,e))throw Error(`This registry item requires eve ${e}, but this project is using eve ${t}. Upgrade eve and run the command again.`)}function isOfficialItemAddress(e){return e.startsWith(`${OFFICIAL_REGISTRY}/`)}function withBuiltInRegistries(e){return{...e,registries:{[SKILLS_REGISTRY]:`https://www.skills.sh/r/{name}?agent=eve`,...e.registries}}}async function readEveRegistryConfig(e){return withBuiltInRegistries(await readRegistryConfig(e))}function configuredRegistrySources(e){return Object.keys(e.registries??{})}function validateRegistrySource(e){if(e!==void 0&&!e.startsWith(`@`)&&!/^https?:\/\//.test(e))throw Error(`Registry sources must be a namespace or URL: ${e}`)}async function loadOfficialSearchMetadata(){let e=await fetch(OFFICIAL_CATALOG);if(!e.ok)throw Error(`Could not read the eve registry (${e.status}).`);return parseOfficialRegistrySearchMetadata(await e.json())}function searchItemAddress(e){return e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument}function enrichSearchItem(e,t){let n=searchItemAddress(e);return{item:e,address:n,...t.get(n)}}function registrySourceLabel(e){return e===OFFICIAL_CATALOG?`eve`:e===SKILLS_REGISTRY?`skills.sh`:e}function searchPresentationSections(e,t,n){return e.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{label:registrySourceLabel(e),items:r.items.map(e=>enrichSearchItem(e,n)),total:r.pagination.total}]})}async function printAddSuggestions(e,t,n){try{let r=n.split(`/`).at(-1)||n,{resultsBySource:i,sources:a,metadataByAddress:o}=await searchRegistryCatalog(t,{limit:5,query:r}),s=searchPresentationSections(a,i,o);if(s.every(e=>e.items.length===0))return;e.log(`Did you mean?`),printRegistrySearchResults(e,{query:r,sections:s})}catch{}}async function searchRegistryCatalog(e,t){validateRegistrySource(t.source);let n=await readEveRegistryConfig(e),r=t.source?[t.source]:[OFFICIAL_CATALOG,...configuredRegistrySources(n).filter(e=>t.query!==void 0||e!==SKILLS_REGISTRY)],i=await Promise.all(r.map(async e=>{try{return{result:await searchRegistries([e],{config:n,limit:t.limit??500,query:t.query}),source:e}}catch(t){return{error:t,source:e}}})),a=[],o=new Map;for(let e of i)if(`error`in e)a.push({message:errorMessage(e.error),registry:e.source});else{let t=e.result.errors??[];if(a.push(...t),t.length===0){let t=e.result.items.filter(t=>t.registry===e.source);o.set(e.source,{...e.result,items:t,pagination:{...e.result.pagination,total:e.result.items.length===t.length?e.result.pagination.total:0}})}}let s=new Map(a.map(e=>[`${e.registry}\0${e.message}`,e])),c=o.has(OFFICIAL_CATALOG)?await loadOfficialSearchMetadata():new Map,l=o.get(OFFICIAL_CATALOG);if(l!==void 0){let e=l.items.filter(e=>c.get(searchItemAddress(e))?.hidden!==!0);l.items=e,l.pagination={...l.pagination,total:e.length},l.items.sort((e,t)=>{let rank=e=>c.get(searchItemAddress(e))?.implementation===`native`?0:1;return rank(e)-rank(t)})}let u=[...o.values()];return{config:n,result:{items:u.flatMap(e=>e.items),pagination:{hasMore:u.some(e=>e.pagination.hasMore),limit:t.limit??500,offset:0,total:u.reduce((e,t)=>e+t.pagination.total,0)},...s.size>0?{errors:[...s.values()]}:{}},resultsBySource:o,sources:r,metadataByAddress:c}}async function browseRegistryCatalog(e,t={}){let{result:n}=await searchRegistryCatalog(e,t);return{items:n.items.map(e=>{let t={address:e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument,name:e.name,source:e.registry===OFFICIAL_CATALOG?`Vercel`:e.registry};return e.title!==void 0&&(t.title=e.title),e.type!==void 0&&(t.type=e.type),e.description!==void 0&&(t.description=e.description),t}),total:n.pagination.total,errors:n.errors??[]}}async function browseRegistryItems(e,t,n,r,i={}){let{result:a,resultsBySource:o,sources:s,metadataByAddress:c}=await searchRegistryCatalog(t,{limit:i.limit,query:n,source:r}),l=a.errors??[];if(i.json||o.size>0){let t=a.items.map(e=>({...e,...c.get(searchItemAddress(e))})),r={query:n,sections:searchPresentationSections(s,o,c)};i.json&&(r.json={...a,items:t}),printRegistrySearchResults(e,r)}for(let t of l)e.error(`${t.registry}: ${t.message}`);l.length>0&&(process.exitCode=1)}async function installRegistryItem(e,t,n={},r=defaultAddCommandDependencies){let i,a=[],o={error:e=>{i=e},log:e=>a.push(e)},s=process.exitCode,c;try{c=await runAddCommand(o,e,t,{...n,yes:n.prompter===void 0||n.yes,setupAuthorized:n.prompter!==void 0,throwSetupFailures:!0},r)}catch(e){if(process.exitCode=s,!(e instanceof RegistrySetupFailedError))throw e;let t={resumeCommand:e.resumeCommand,reason:e.reason};return e.prerequisite!==void 0&&(t.prerequisite=e.prerequisite),{output:a,setupIncomplete:t}}if(process.exitCode=s,i!==void 0)throw Error(i);if(c===!1)throw new WizardCancelledError;if(c===`setup-incomplete`)return{output:a,setupIncomplete:{resumeCommand:setupResumeCommand(t)}};let l={output:a};return c!==void 0&&(l.setup=c),l}async function runAddCommand(e,t,n,r,i=defaultAddCommandDependencies){let setupIncomplete=t=>(r.silent!==!0&&e.log(setupReminder(n,t)),`setup-incomplete`);return runRegistryAction(e,t,async()=>{let a=itemAddress(n),o;if(a===itemAddress(WEB_CHAT_ITEMS.next)&&r.skipInstall!==!0){let a=await askWebChatFramework(e,t,n,r,i);if(a===!1||a===void 0)return a;o=a}let s=o===void 0?a:itemAddress(WEB_CHAT_ITEMS[o]),c=o===void 0?t:await prepareWebChatProjectRoot(t,o),l=await readEveRegistryConfig(t);if(r.skipInstall===!0){if(r.overwrite===!0)throw Error(`--overwrite cannot be used with --skip-install.`);if(r.skipSetup===!0)throw Error(`--skip-install cannot be used with --skip-setup.`);if(!isOfficialItemAddress(a))throw Error(`Setup flows are currently supported only for official eve registry items.`)}let u=await resolveRegistryItemForAdd(e,async()=>(await getRegistryItems([s],{config:l}))[0],()=>printAddSuggestions(e,t,n));if(!u.found)return;let d=u.item,f=isOfficialItemAddress(a)?eveMetadataFromRegistryItem(d):void 0;if(assertCompatibleEveVersion(f?.requires),r.skipInstall===!0){if(f?.setup===void 0)throw Error(`Registry item "${n}" does not declare a setup flow.`);let a=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:f.setup,options:r,dependencies:i,resumeCommand:setupResumeCommand(n)});return a===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,a,r)}if(!await prepareDeclaredPnpmBuildPolicy({logger:e,appRoot:c,item:n,policies:f?.install?.pnpm?.buildScripts,options:r}))return!1;if(o!==void 0&&await(i.prepareWebRegistryProject??prepareWebRegistryProject)(c,o),await installRegistryItemTransaction({appRoot:c,item:n,registryItem:d,nonInteractive:r.nonInteractive,logger:e,install:async()=>{await addRegistryItems([s],{config:l,cwd:c,overwrite:r.overwrite,silent:r.silent})}}),f?.setup===void 0)return reportRegistryCompletion(e,n,{facts:[]},r);let p=i.hasInteractiveTerminal?.()??defaultAddCommandDependencies.hasInteractiveTerminal();if(r.nonInteractive&&e.log(serializeHeadlessSetupEvent({version:1,type:`progress`,message:r.skipInstall?`Setup ${n}`:`Installed ${n}`})),r.skipSetup===!0)return r.nonInteractive?reportRegistryCompletion(e,n,{facts:[]},r):setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&!p&&r.setupAuthorized!==!0)return setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&r.setupAuthorized!==!0)try{if(await(r.prompter??i.createPrompter?.()??defaultAddCommandDependencies.createPrompter()).select({message:`Set up ${n} now?`,initialValue:`yes`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]})===`no`)return setupIncomplete(`skipped`)}catch(e){if(!(e instanceof WizardCancelledError))throw e;return setupIncomplete(`cancelled`)}let m=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:f.setup,options:{...r,force:r.overwrite},dependencies:i,resumeCommand:setupResumeCommand(n)});return m===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,m,r)},{rethrow:e=>r.throwSetupFailures===!0&&e instanceof RegistrySetupFailedError})}async function runRegistryListCommand(e,t,n,r={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,void 0,n,r))}async function runRegistrySearchCommand(e,t,n,r,i={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,n,r,{...i,limit:i.limit??10}))}async function runRegistryViewCommand(e,t,n,r={}){await runRegistryAction(e,t,async()=>{let i=await readEveRegistryConfig(t),a=await getRegistryItems([itemAddress(n)],{config:i}),o=a.length===1?a[0]:a;e.log(r.json?JSON.stringify(o,null,2):registryViewText(n,o))})}export{browseRegistryCatalog,installRegistryItem,resolveOfficialRegistryUrl,runAddCommand,runRegistryAddCommand,runRegistryListCommand,runRegistrySearchCommand,runRegistryViewCommand};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Development environment files loaded by local CLI commands such as
|
|
3
|
-
* `eve dev`, `eve build`, and `eve eval`, ordered from highest to lowest
|
|
4
|
-
* precedence.
|
|
5
|
-
*/
|
|
6
|
-
export declare const DEVELOPMENT_ENV_FILE_NAMES: readonly [".env.development.local", ".env.local", ".env.development", ".env"];
|
|
7
1
|
export interface DevelopmentEnvironmentReload {
|
|
8
2
|
commit(): void;
|
|
9
3
|
rollback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{join,resolve}from"node:path";import{findEveProjectRoot}from"#internal/eve-project-root.js";import{DEVELOPMENT_ENV_FILE_NAMES,readDevelopmentEnvironmentValues}from"#shared/development-env-files.js";import{MODEL_CONNECTION_ENV}from"#shared/model-helper.js";import{readProviderSettingsSync}from"#setup/provider-settings.js";const developmentEnvironmentLoaders=new Map;function getDevelopmentEnvironmentFilePaths(e){return DEVELOPMENT_ENV_FILE_NAMES.map(t=>join(getDevelopmentEnvironmentLoader(e).environmentRoot,t))}async function loadDevelopmentEnvironmentFiles(e){let t=resolve(e);getDevelopmentEnvironmentLoader(t,await findEveProjectRoot(t)).reload()}function stageDevelopmentEnvironmentFiles(e){return getDevelopmentEnvironmentLoader(e).stageReload()}function readDevelopmentEnvironmentHostValues(e){let t={},n=readDevelopmentEnvironmentValues(getDevelopmentEnvironmentLoader(e).environmentRoot),r=new Set(n.keys());for(let e of[...r].sort((e,t)=>e.localeCompare(t)))t[e]=process.env[e]??null;return t}function getDevelopmentEnvironmentLoader(e,t){let n=resolve(e),r=developmentEnvironmentLoaders.get(n);if(r!==void 0&&t===void 0)return r;let i=resolve(t??n);if(r?.environmentRoot===i)return r;let a=createDevelopmentEnvironmentLoader(n,i);return developmentEnvironmentLoaders.set(n,a),a}function createDevelopmentEnvironmentLoader(e,t){let n=new Set(Object.keys(process.env)),r=new Map,stageReload=()=>{let i=new Map(r),a=readDevelopmentEnvironmentValues(t),o=readProviderSettingsSync(e),s=new Set([...r.keys(),...a.keys(),MODEL_CONNECTION_ENV,`EVE_MODEL_TEAM`,`EVE_MODEL_TEAM_NAME`,`EVE_MODEL_KEY_SOURCE`]),c=new Map([...s].map(e=>[e,process.env[e]])),l=!1;o?process.env[MODEL_CONNECTION_ENV]=o.selected:delete process.env[MODEL_CONNECTION_ENV];let u=o?.keySource;return u?process.env.EVE_MODEL_KEY_SOURCE=u:delete process.env.EVE_MODEL_KEY_SOURCE,o?.teamId&&o.teamName?(process.env.EVE_MODEL_TEAM=o.teamId,process.env.EVE_MODEL_TEAM_NAME=o.teamName):(delete process.env.EVE_MODEL_TEAM,delete process.env.EVE_MODEL_TEAM_NAME),applyDevelopmentEnvironmentValues({managedValues:r,nextValues:a,protectedKeys:n}),{commit(){l=!0},rollback(){if(!l){l=!0,r.clear();for(let[e,t]of i)r.set(e,t);for(let[e,t]of c)t===void 0?delete process.env[e]:process.env[e]=t}}}};return{environmentRoot:t,reload(){stageReload().commit()},stageReload}}function applyDevelopmentEnvironmentValues(e){for(let[t,n]of e.managedValues)e.nextValues.has(t)||e.protectedKeys.has(t)||(process.env[t]===n&&delete process.env[t],e.managedValues.delete(t));for(let[t,n]of e.nextValues)e.protectedKeys.has(t)||(process.env[t]=n,e.managedValues.set(t,n))}export{getDevelopmentEnvironmentFilePaths,loadDevelopmentEnvironmentFiles,readDevelopmentEnvironmentHostValues,stageDevelopmentEnvironmentFiles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{failureKey,formatFailureDetail,formatFailureHint,formatFailureMessage}from"./errors.js";import{
|
|
1
|
+
import{failureKey,formatFailureDetail,formatFailureHint,formatFailureMessage}from"./errors.js";import{stripAnsi}from"#cli/ui/terminal-text.js";import{isTaskRetryRefusal}from"#protocol/task-tools.js";const tuiSessionReducer={initial:()=>({usage:{inputTokens:0,outputTokens:0},failures:[],sessionFailed:!1,turnFailureKeys:[],toolLabels:{},withdrawnCallIds:[]}),reduce(e,t){switch(t.type){case`actions.requested`:{let n=t.data.presentation;if(n===void 0)return e;let r={...e.toolLabels};for(let e of t.data.actions){let t=n[e.callId]?.label;t!==void 0&&(r[e.callId]={start:t})}return{...e,toolLabels:r}}case`action.result`:{let{callId:n}=t.data.result;if(isTaskRetryRefusal(t))return{...e,withdrawnCallIds:[...e.withdrawnCallIds,n]};let r=t.data.presentation?.[n]?.label;if(r===void 0)return e;let i={...e.toolLabels,[n]:{...e.toolLabels[n],complete:r}};return{...e,toolLabels:i}}case`turn.started`:{let{turnId:n}=t.data;if(e.turnFailureKeys.length===0&&n===e.modelTurnId)return e;let{modelId:r,...i}=e;return n===e.modelTurnId?{...e,turnFailureKeys:[]}:{...i,modelTurnId:n,turnFailureKeys:[]}}case`step.started`:{let n=stripAnsi(t.data.modelId.slice(0,256)).replace(/\s+/gu,` `).trim()||void 0;if(n===e.modelId)return e;let{modelId:r,...i}=e,a=t.data.turnId;return n===void 0?{...i,modelTurnId:a}:{...i,modelId:n,modelTurnId:a}}case`step.completed`:{let n=t.data.usage;return n===void 0?e:{...e,lastStepUsage:n,usage:{inputTokens:e.usage.inputTokens+(n.inputTokens??0),outputTokens:e.usage.outputTokens+(n.outputTokens??0)}}}case`step.failed`:case`turn.failed`:case`session.failed`:{let n=failureKey(t),r=e.sessionFailed||t.type===`session.failed`;return e.turnFailureKeys.includes(n)?{...e,sessionFailed:r}:{...e,failures:[...e.failures,t],sessionFailed:r,turnFailureKeys:[...e.turnFailureKeys,n]}}default:return e}}};function conversationView(e,t){return{conversation:e.conversation,working:isWorking(e.status),data:e.data,failures:e.data.failures.map(e=>{let n={message:formatFailureMessage(e)},r=t?.(e)??formatFailureHint(e);r!==void 0&&(n.hint=r);let i=formatFailureDetail(e);return i!==void 0&&(n.detail=i),n})}}function isWorking(e){return e===`submitted`||e===`streaming`||e===`resuming`}export{conversationView,isWorking,tuiSessionReducer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PROMPT_COMMANDS,formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{failureKey,formatFailureDetail,formatFailureHint,formatFailureMessage,interruptedError,isInterruptedError,localFailureHint}from"./errors.js";import{conversationView,isWorking,tuiSessionReducer}from"./conversation-view.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{createMcpConnectionStatusTracker}from"./mcp-connection-status.js";import{describeRemoteAuthCompletedMutations}from"./remote-auth-result.js";import{createRemoteConnectionController}from"./remote-connection.js";import{prepareRemoteTuiAccess}from"./remote-startup.js";import{isTerminalToolCallPart}from"./terminal-tool-part.js";import{userText}from"./transcript-parts.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,normalizeLocalModelEndpoint,orderedSetupIssues}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import{
|
|
1
|
+
import{PROMPT_COMMANDS,formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{failureKey,formatFailureDetail,formatFailureHint,formatFailureMessage,interruptedError,isInterruptedError,localFailureHint}from"./errors.js";import{conversationView,isWorking,tuiSessionReducer}from"./conversation-view.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{createMcpConnectionStatusTracker}from"./mcp-connection-status.js";import{describeRemoteAuthCompletedMutations}from"./remote-auth-result.js";import{createRemoteConnectionController}from"./remote-connection.js";import{prepareRemoteTuiAccess}from"./remote-startup.js";import{formatStrandedSessionNotice}from"./stranded-session.js";import{isTerminalToolCallPart}from"./terminal-tool-part.js";import{userText}from"./transcript-parts.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,normalizeLocalModelEndpoint,orderedSetupIssues}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{inspectApplication}from"#services/inspect-application.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{isTaskRetryRefusal}from"#protocol/task-tools.js";import{toErrorMessage}from"#shared/errors.js";import{probeAgentInfo}from"#services/dev-client/agent-info-probe.js";import{openConversationInputs}from"#client/conversation-state.js";import{EveAgentStore,attachEveAgentStore,detachEveAgentStore}from"#client/eve-agent-store.js";import{isAbortError}from"#client/eve-agent-store-helpers.js";import{normalizeActionRequest,normalizeActionResult}from"#client/message-action-parts.js";import{renderApplicationInfo}from"#cli/commands/info.js";import{createDevelopmentRuntimeArtifactRefresher}from"#services/dev-client.js";function authIssueForStatus(e){if(e===`logged-out`)return LOGIN_SETUP_ISSUE;if(e===`cli-missing`)return CLI_MISSING_SETUP_ISSUE}var EveTUIRunner=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=!1;#m;#h;#g=!0;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E=!1;#D;#O=!1;#k=new AbortController;#A=!1;#j=0;#M=0;#N=[];#P;#F;#I;#L;#R;#z=new Set;#B=[];#V;#H=new Set;#U;#W=new Set;#G=new Set;#K;constructor(e){if(this.#e=e.client,e.lifecycle!==void 0&&(this.#K=e.lifecycle),e.diagnostics!==void 0&&(this.#r=e.diagnostics),this.#n=createRenderer(e),this.#t=new EveAgentStore({client:e.client,followSubagents:!0,reducer:tuiSessionReducer}),this.#t.setCallbacks({onEvent:e=>this.#Be(e),onSessionChange:e=>{e!==void 0&&this.#n.setSessionId?.(e.sessionId)},prepareSend:e=>this.#ee(e)}),this.#i=e.name??`eve`,this.#y=e.withExclusiveTerminal,this.#a=e.formatTransportError??toErrorMessage,e.initialInput!==void 0&&(this.#l=e.initialInput),e.startup!==void 0&&(this.#u=e.startup),this.#f=e.onboard===!0,this.#m=e.onOnboardingStep,this.#h=e.onOnboardingTerminal,e.appRoot!==void 0){this.#c=e.appRoot;let t={appRoot:e.appRoot,onChange:e=>this.#n.setVercelStatus?.(e)};e.detectProjectIdentity!==void 0&&(t.detectIdentity=e.detectProjectIdentity),this.#F=createVercelStatusTracker(t),e.probeMcpConnection!==void 0&&(this.#I=createMcpConnectionStatusTracker({onChange:()=>{},probe:e.probeMcpConnection}))}e.promptCommandHandler!==void 0&&(this.#_=e.promptCommandHandler),this.#v=e.availablePromptCommands??PROMPT_COMMANDS,e.remote!==void 0&&(this.#x=e.remote.runAuthFlow,this.#b=createRemoteConnectionController({client:this.#e,credentials:e.remote.credentials,target:e.remote.target,onChange:e=>this.#n.setRemoteConnectionStatus?.(e),resolveOidcToken:e.remote.resolveOidcToken,resolveDeployment:e.remote.resolveDeployment})),this.#S=e.bootDetections??BOOT_DETECTIONS,this.#C=e.getVercelAuthStatus??getVercelAuthStatus,this.#w=e.inspectApplication??inspectApplication,e.onBootProgress!==void 0&&(this.#T=e.onBootProgress),e.serverUrl!==void 0&&(this.#s=e.serverUrl),e.serverUrl!==void 0&&e.remote===void 0&&(this.#o=createDevelopmentRuntimeArtifactRefresher({serverUrl:e.serverUrl}))}async#q(){if(this.#s===void 0){this.#X(),this.#f||await this.#xe(void 0);return}let e;if(this.#b!==void 0){let t=await this.#b.check();t.state===`ready`&&(e=t.info)}else{let t=this.#e;if(t!==void 0)try{let n=await devBootPhase(`connecting to agent`,()=>probeAgentInfo({client:t,timeoutMs:2e3}),this.#T);n.kind===`ready`&&(e=n.info)}catch{e=void 0}}this.#X();let t=this.#Y(e);this.#f||await this.#xe(t)}#J(){let e=this.#u?.finish();return this.#d=e?.queuedPrompt,e?.draft??this.#l}#Y(e){let t=this.#c===void 0?e:normalizeLocalModelEndpoint(e,process.env);this.#L=t;let n=this.#s;if(n===void 0||this.#g)return t;let r={name:this.#i,serverUrl:n,localDevelopment:this.#c!==void 0};return t!==void 0&&(r.info=t),this.#n.renderAgentHeader?.(r),t}#X(){let e=this.#T;this.#T=void 0,e?.({type:`before-first-paint`})}async run(){let onStop=()=>this.#n.requestInterrupt?.();this.#K?.signal.aborted===!0?onStop():this.#K?.signal.addEventListener(`abort`,onStop,{once:!0});let e=this.#t.subscribe(()=>this.#te());attachEveAgentStore(this.#t);try{await this.#Z()}catch(e){if(!isInterruptedError(e))throw e}finally{this.#K?.signal.removeEventListener(`abort`,onStop),this.#E=!0,this.#k.abort(),this.#R?.abort(),e(),detachEveAgentStore(this.#t),this.#n.shutdown?.(),this.#F?.dispose(),this.#I?.dispose(),this.#b?.dispose()}}async#Z(){let e=this.#i,t;this.#n.setStartupPhase?.(`starting`),await this.#q(),this.#F?.refreshIdentity(),this.#I?.refresh();let n=(this.#f||this.#L?.agent.model.endpoint?.kind===`gateway`&&!this.#L.agent.model.endpoint.connected)&&this.#c!==void 0&&this.#_!==void 0&&this.#n.setupFlow!==void 0,r;if(this.#b!==void 0&&this.#n.setupFlow!==void 0){let e=await prepareRemoteTuiAccess({connection:this.#b,renderer:this.#n.setupFlow,signal:this.#K?.signal,runAuthFlow:this.#x});if(e?.kind===`authenticated`){let e=this.#b.current().connection;e.state===`ready`&&this.#Y(e.info)}else e?.kind===`failed`||e?.kind===`unavailable`?r={failed:!0,message:e.kind===`failed`?e.message:e.failure.message}:e?.kind===`cancelled`&&(r={cancelled:!0},e.completedMutations.length>0&&(r.message=`Completed before cancellation: ${describeRemoteAuthCompletedMutations(e.completedMutations).join(`, `)}.`))}n&&(this.#n.setStartupPhase?.(`connecting`),r=await this.#Ae(e));let i=this.#J();for(r?.cancelled||r?.failed?i=[this.#d,i].filter(Boolean).join(`
|
|
2
2
|
|
|
3
|
-
`)||void 0:t=this.#d,this.#g=!1,this.#Y(this.#L),this.#
|
|
4
|
-
`);t!==``&&this.#n.renderNotice?.(t)}}async#
|
|
3
|
+
`)||void 0:t=this.#d,this.#g=!1,this.#Y(this.#L),this.#Se(),this.#n.setStartupPhase?.(void 0),(!n||r?.cancelled||r?.failed)&&r?.message!==void 0&&this.#Te({kind:`result`,message:r.message});this.#K?.signal.aborted!==!0&&this.#n.exitRequested?.()!==!0;){if(this.#t.snapshot.data.sessionFailed){this.#de();continue}if(this.#ce().length>0){await this.#le(e);continue}let n=isWorking(this.#t.snapshot.status)?void 0:this.#B.shift();if(n!==void 0){this.#V=n;try{await this.#be(n)}finally{this.#V=void 0}continue}if(t===void 0){let n=await this.#_e({title:e,initialDraft:i});if(i=void 0,n===void 0)continue;if(n.type===`cancel`){this.#me();continue}if(n.type===`interrupt`){this.#de(`Stopped following the turn and started a new session. Earlier context was cleared; the interrupted turn may still be running on the server.`);continue}t=n.text}let r=t;t=void 0;let a=parsePromptCommand(r);if(a===null){this.#$(r);continue}let o=await this.#Q(a,e);if(o===`exit`)return;o!==void 0&&(i=o.draft)}}async#Q(e,t){switch(e.type){case`exit`:return this.#Te({kind:`dismiss`}),this.#K?.requestStop(),`exit`;case`cancel`:{let e=isWorking(this.#t.snapshot.status);e&&this.#me(),this.#Te({kind:`result`,summary:e?`Cancellation requested`:`No active turn to cancel`});return}case`new`:await this.#ge();return;case`compact`:await this.#he({absent:`No active session to compact`,accepted:`Compaction requested`,failed:`Couldn't compact the session`,invoke:()=>this.#t.compact()});return;case`clear`:await this.#he({absent:`No active session to clear`,accepted:`Session context cleared`,failed:`Couldn't clear the session`,invoke:()=>this.#t.clear()});return;case`help`:{if(this.#n.choosePromptCommand===void 0){this.#Te({kind:`result`,message:formatPromptCommandHelp(this.#v)});return}let e=await this.#n.choosePromptCommand(this.#v);return e===void 0?void 0:{draft:e}}case`info`:await this.#Ne();return;case`loglevel`:{let t=this.#Pe(e.argument),n=t.startsWith(`/loglevel is not available`)||t.startsWith(`Unknown log level`);this.#Te(n?{kind:`result`,message:t}:{kind:`result`,summary:t});return}case`traces`:await this.#Me(e.argument);return;case`extension`:await this.#ke(e,t,{trigger:`command`});return}}#$(e){let t=this.#t.snapshot,n=isWorking(t.status);this.#D=e,n||(this.#O=!1);let r=n?{message:e,turnPolicy:`steer`}:t.session===void 0?{message:e}:{message:e,turnPolicy:`queue`};this.#t.send(r).catch(e=>{this.#E||isAbortError(e)||this.#ie(n?`Steering failed`:`Error`,e)})}async#ee(e){return e.turnPolicy===`steer`?e:(this.#o!==void 0&&await this.#o.refresh({inputResponses:e.inputResponses,message:typeof e.message==`string`?e.message:void 0,onRuntimeArtifactsChanged:()=>this.#Re()}),e.message!==void 0&&this.#n.flushDelayedDevBuildErrors?.(),e)}#te(){let e=this.#t.snapshot;this.#n.renderConversation?.(conversationView(e,this.#c===void 0?void 0:localFailureHint)),this.#re(e.error,e.data.sessionFailed),this.#ze(e.conversation),this.#se(e.conversation),this.#ye(e.conversation),this.#ne(e.conversation),(e.data.sessionFailed||this.#ce().length>0||!isWorking(e.status)&&this.#B.length>0)&&this.#R?.abort()}#ne(e){let t=this.#D;if(t===void 0)return;let n=e.messages.findLast(e=>e.role===`user`),r=n?.metadata?.turnId;if(n===void 0||r===void 0||userText(n)!==t)return;let i=e.turns[r]?.status;i!==void 0&&i!==`active`&&(this.#D=void 0,i===`cancelled`&&!this.#O&&this.#n.restoreDraft?.(t))}#re(e,t){e!==void 0&&e!==this.#U&&(this.#U=e,!t&&(this.#oe(e)||(this.#b?.reportFailure(e),this.#n.renderError?.(`Error`,this.#a(e)))))}#ie(e,t){this.#oe(t)||this.#n.renderError?.(e,this.#a(t))}#ae(e){return formatStrandedSessionNotice(e,{localServer:this.#c!==void 0,sessionId:this.#t.snapshot.session?.sessionId})}#oe(e){let t=this.#ae(e);return t!==void 0&&(this.#n.renderError?.(`Session stranded`,t),!0)}#se(e){!this.#f||this.#p||!e.messages.some(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`text`&&e.text.length>0))||(this.#p=!0,this.#m?.({flow:`onboarding`,step:`first_response`}))}#ce(){return openConversationInputs(this.#t.snapshot.conversation).filter(e=>!this.#z.has(e.request.requestId))}async#le(e){for(let t=0;;t+=1){let n=this.#ce(),r=n[0];if(r===void 0)return;let i=inputContext(r,t+1,t+n.length),a=await this.#ue(r.request,i,e);if(a===void 0){this.#z.add(r.request.requestId);continue}this.#t.send({inputResponses:[a]}).catch(e=>{this.#E||isAbortError(e)||this.#ie(`Error`,e)})}}async#ue(e,t,n){if(e.kind===`tool-approval`){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);let r=await this.#n.readToolApproval(toAgentTUIToolApprovalRequest(e,t),{title:n});return{requestId:e.requestId,optionId:r.approved?`approve`:`cancel`}}if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);let r=await this.#n.readInputQuestion(toAgentTUIInputQuestion(e,t),{title:n});if(r===void 0)return;let i={requestId:e.requestId};return r.optionId!==void 0&&(i.optionId=r.optionId),r.text!==void 0&&(i.text=r.text),i}#de(e){this.#n.renderSessionBoundary===void 0?e===void 0&&this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`):this.#n.renderSessionBoundary(),e!==void 0&&this.#n.renderNotice?.(e),this.#fe()}#fe(){this.#t.reset(),this.#pe()}#pe(){this.#z.clear(),this.#H.clear(),this.#W.clear(),this.#o?.clear()}#me(){this.#O=!0,this.#t.cancel().catch(e=>{this.#n.renderNotice?.(`Couldn't cancel the turn: ${toErrorMessage(e)}`)})}async#he(e){if(this.#t.snapshot.session===void 0){this.#Te({kind:`result`,summary:e.absent});return}try{if((await e.invoke()).status!==`accepted`){this.#Te({kind:`result`,summary:e.absent});return}this.#Te({kind:`result`,summary:e.accepted})}catch(t){this.#Te({kind:`result`,message:this.#ae(t)??toErrorMessage(t),summary:e.failed})}}async#ge(){try{await this.#t.retire()}catch(e){this.#Te({kind:`result`,message:`Couldn't reset the session: ${toErrorMessage(e)}`});return}this.#pe(),this.#n.reset?.(),this.#Te({kind:`dismiss`})}async#_e(e){if(!this.#n.readInput)throw Error(`The renderer does not support prompt input.`);let t=new AbortController;this.#R=t;try{let n=await this.#ve(this.#n.readInput({...e,signal:t.signal}));if(n===void 0&&!t.signal.aborted)throw interruptedError();return n}finally{this.#R===t&&(this.#R=void 0)}}async#ve(e){let t=this.#o;if(t===void 0)return await e;let n=!1,r=!1,i,a=!1,o=0,refresh=async()=>{if(!(n||r)){r=!0;try{await t.refreshIdle({onRuntimeArtifactsChanged:()=>this.#Re()}),this.#c!==void 0&&this.#L===void 0&&!a&&(a=!0,this.#Ie().finally(()=>{a=!1}));let e=this.#L?.agent.model.endpoint,n=e?.kind===`chatgpt`&&(e.state===`signed-out`||e.state===`reauth-required`),r=Date.now();n&&r-o>=5e3&&(o=r,this.#Ie())}finally{r=!1}}},startRefresh=()=>{if(n||r)return;let e=refresh().finally(()=>{i===e&&(i=void 0)});i=e};startRefresh();let s=setInterval(()=>{startRefresh()},500);s.unref?.();try{return await e}finally{n=!0,clearInterval(s),await i}}#ye(e){if(this.#c!==void 0)for(let{callId:t,address:n}of registryHandoffs(e))this.#H.has(t)||(this.#H.add(t),!(this.#V===n||this.#B.includes(n))&&this.#B.push(n))}async#be(e){this.#n.renderCommandInvocation?.(`/add ${e}`),await this.#ke({type:`extension`,name:`add`,argument:e},`Add to your agent`,{trigger:`command`})}async#xe(e){if(this.#c===void 0)return;let t={appRoot:this.#c,env:process.env};e!==void 0&&(t.info=e),this.#N=await detectSetupIssues(t,this.#S),this.#n.renderSetupWarning!==void 0&&(this.#Se(),this.#Ce())}#Se(){if(this.#g)return;let e=orderedSetupIssues(this.#N,this.#P);e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#Ce(){let e=this.#c;if(e===void 0||process.env.EVE_MODEL_CONNECTION!==`ai-gateway-project`)return;let t;try{t=await this.#C(e,{signal:this.#k.signal})}catch{return}this.#E||this.#A||(this.#P=authIssueForStatus(t),this.#Se())}async#we(e){let t=this.#c;if(t===void 0||this.#n.renderSetupWarning===void 0)return;let n=++this.#j,r={appRoot:t,env:process.env};e!==void 0&&(r.info=e);try{let[e,i]=await Promise.all([detectSetupIssues(r,this.#S),process.env.EVE_MODEL_CONNECTION===`ai-gateway-project`?this.#C(t,{signal:this.#k.signal}):void 0]);if(this.#E||n!==this.#j)return;this.#N=e,this.#P=i===void 0?void 0:authIssueForStatus(i),this.#Se()}catch{return}}#Te(e){if(this.#n.finishCommand!==void 0){this.#n.finishCommand(e);return}if(e.kind===`result`){let t=[e.summary,e.message].filter(Boolean).join(`
|
|
4
|
+
`);t!==``&&this.#n.renderNotice?.(t)}}async#Ee(e,t){let n=this.#_;if(n===void 0)return{message:`/${e.name} is not available in this session.`};let r=this.#L?.agent.model.endpoint,i={...t,renderer:this.#n,settleOutcome:e=>this.#Oe(e),chatGptAccountLabel:r?.kind===`chatgpt`&&r.state===`ready`?r.accountLabel:void 0,withExclusiveTerminal:this.#y},a=this.#I?.current(),o=a!==void 0&&Object.keys(a).length>0?{...i,disabledConnectionReasons:a}:i;return await n.handle(e,o)}async#De(e){if(e?.kind===`model-access-changed`){this.#F?.applyEffect({kind:`refresh-identity`}),this.#A=!0,await this.#Fe(e);return}e!==void 0&&(this.#F?.applyEffect(e),this.#A=!0,this.#we(this.#L))}async#Oe(e){if(e.effect===void 0)return e;let t=e.effect.kind===`model-access-changed`&&e.effect.reload?setTimeout(()=>{this.#g&&this.#n.setStartupPhase?.(`updating`),this.#n.setupFlow?.setStatus(`Loading selected model…`)},150):void 0;try{await this.#De(e.effect);let{effect:t,...n}=e;return n}catch{return{failed:!0,message:`Settings were saved, but the agent could not reload. Retry the command or restart eve dev.`}}finally{clearTimeout(t)}}async#ke(e,t,n){let r=await this.#Ee(e,{...n,title:t}),i=r===void 0?void 0:await this.#Oe(r);return!(n.suppressSuccessfulTranscript===!0&&i?.failed!==!0||n.suppressCancelledTranscript===!0&&i?.cancelled===!0)&&n.trigger!==`startup`&&(i===void 0?this.#Te({kind:`result`}):this.#Te({kind:`result`,message:i.message,summary:i.summary})),this.#je(),i}async#Ae(e){this.#m?.({flow:`onboarding`,step:`model_provider`});let t=await this.#ke({type:`extension`,name:`login`,argument:``},e,{trigger:`startup`,initialModelStep:`provider`});return!t?.cancelled&&t?.failed!==!0&&this.#m?.({flow:`onboarding`,step:`connection_ready`}),this.#h?.({flow:`onboarding`,step:`model_provider`,result:t?.cancelled?`cancelled`:t?.failed===!0?`error`:`completed`}),t}#je(){if(this.#g)return;let e=this.#b?.current().connection;e?.state===`ready`&&e.info!==this.#L&&(this.#L=e.info,this.#s!==void 0&&this.#n.renderAgentHeader?.({info:e.info,name:this.#i,serverUrl:this.#s}))}async#Me(e){if(this.#c===void 0||this.#n.traceViewer===void 0){this.#Te({kind:`result`,message:`/traces is only available in local dev sessions.`});return}try{await this.#n.traceViewer.open({appRoot:this.#c,sessionId:this.#t.snapshot.session?.sessionId,reference:e===``?void 0:e})}catch(e){if(isInterruptedError(e))return;throw e}finally{this.#Te({kind:`dismiss`})}}async#Ne(){let e=this.#c;if(e===void 0){this.#Te({kind:`result`,message:`/info is only available in local dev sessions.`});return}try{let t=renderApplicationInfo(await this.#w(e));this.#n.showInfoPanel===void 0?this.#Te({kind:`result`,message:t}):await this.#n.showInfoPanel(t)}catch(e){this.#Te({kind:`result`,message:`Couldn't inspect the application: ${toErrorMessage(e)}`})}}#Pe(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel none|error|warn|debug|all — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use none, error, warn, debug, or all.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`error`:return`Showing errors.`;case`warn`:return`Showing warnings and errors.`;case`debug`:return`Showing all severity-tagged logs.`;case`all`:return`Showing all logs.`}}async#Fe(e){let t=this.#c;t!==void 0&&(++this.#M,++this.#j,await loadDevelopmentEnvironmentFiles(t),e.reload&&await this.#o?.refreshAfterSourceChange({}),e.model&&this.#L?this.#Y({...this.#L,agent:{...this.#L.agent,model:{...this.#L.agent.model,...e.model}}}):this.#Y(this.#L),this.#N=[],this.#P=void 0,this.#Se(),this.#Ie())}async#Ie(e=!1){let t=this.#L,n=++this.#M,r=await this.#Le();this.#E||n!==this.#M||r===void 0||(this.#Y(r),e&&!this.#n.renderAgentHeader&&this.#n.renderNotice?.(formatAgentUpdateNotice(t,r)),this.#we(this.#L))}async#Le(){let e=this.#e;if(e===void 0)return;let t=await probeAgentInfo({client:e});return t.kind===`ready`?t.info:void 0}#Re(){this.#Ie(!0)}#ze(e){let t=this.#r;if(t!==void 0){for(let n of Object.values(e.agents))if(n.observation.status!==`not-followed`)for(let e of n.observation.conversation?.messages??[])for(let r of e.parts)r.type===`dynamic-tool`&&r.state===`output-error`&&(this.#G.has(r.toolCallId)||(this.#G.add(r.toolCallId),t.append({source:`tool`,summary:`${r.toolName} failed (subagent ${n.name})`,detail:r.errorText})))}}#Be(e){let t=this.#r;if(t!==void 0)switch(e.type){case`turn.started`:this.#W.clear();break;case`actions.requested`:for(let n of e.data.actions){let e=normalizeActionRequest(n);e.kind===`tool-call`&&t.recordToolCall(e.toolName)}break;case`action.result`:isTaskRetryRefusal(e)?t.append({source:`tool`,summary:`${normalizeActionResult(e.data.result).toolName} was refused for the model to retry`,detail:e.data.error?.message??`Refused.`}):e.data.status===`failed`&&t.append({source:`tool`,summary:`${normalizeActionResult(e.data.result).toolName} failed`,detail:e.data.error?.message??`Tool failed.`});break;case`task.settled`:e.data.status===`failed`&&t.append({source:`tool`,summary:`${this.#t.snapshot.conversation.tasks[e.data.taskId]?.name??`A task`} failed`,detail:e.data.error?.message??`Task failed.`});break;case`agent.started`:t.recordSubagentDispatch(e.data.callId);break;case`step.completed`:t.recordStepUsage(e.data.usage);break;case`step.failed`:case`turn.failed`:case`session.failed`:{let n=failureKey(e);if(this.#W.has(n))break;this.#W.add(n);let r=formatFailureMessage(e),i=formatFailureDetail(e)??r,a=formatFailureHint(e);t.append(a===void 0?{source:`workflow`,summary:`Error: ${r}`,detail:i}:{source:`workflow`,summary:`Error: ${r}`,detail:i,hint:a});break}}}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,availablePromptCommands:e.availablePromptCommands,argumentSuggestions:e.argumentSuggestions,input:e.userInput,output:e.screen,diagnostics:e.diagnostics,onExitRequest:e.lifecycle?.requestStop})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}function registryHandoffs(e){let t=[],collect=(e,n)=>{for(let r of e.messages)for(let e of r.parts){if(!isTerminalToolCallPart(e)||e.state!==`output-available`||e.partial)continue;let r=registryHandoffAddress(n,e.toolName,e.output);r!==void 0&&t.push({callId:e.toolCallId,address:r})}};collect(e,void 0);for(let t of Object.values(e.agents)){if(t.observation.status===`not-followed`)continue;let e=t.observation.conversation;e!==void 0&&collect(e,t.name)}return t}function registryHandoffAddress(e,t,n){if((e!==`self-modification__agent`||t!==`registry_add`)&&(e!==void 0||t!==`selfmod__registry_add`)||typeof n!=`object`||!n)return;let r=n;return r.status===`needs-terminal`&&typeof r.address==`string`?r.address:void 0}function inputContext(e,t,n){let r={};return n>1&&(r.position={index:t,total:n}),e.taskId!==void 0&&(r.taskId=e.taskId),r.position===void 0&&r.taskId===void 0?void 0:r}function toAgentTUIToolApprovalRequest(e,t){let n={approvalId:e.requestId,toolCallId:e.action.callId,toolName:e.action.toolName,prompt:e.prompt,input:e.action.input};return t!==void 0&&(n.context=t),n}function toAgentTUIInputQuestion(e,t){let n=e.display===`text`?`text`:e.display===`select`||e.options!==void 0&&e.options.length>0?`select`:`text`,r={requestId:e.requestId,prompt:e.prompt,display:n};return e.options!==void 0&&(r.options=e.options.map(e=>{let t={id:e.id,label:e.label};return e.description!==void 0&&(t.description=e.description),e.style!==void 0&&(t.style=e.style),t})),e.allowFreeform!==void 0&&(r.allowFreeform=e.allowFreeform),t!==void 0&&(r.context=t),r}export{EveTUIRunner,registryHandoffAddress};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One notice naming the session, the cause, the version pair, and the
|
|
3
|
+
* command that gets the user unstuck; `undefined` for any other error. The
|
|
4
|
+
* server's eve version is known only when the TUI runs its own dev server.
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatStrandedSessionNotice(error: unknown, input: {
|
|
7
|
+
readonly localServer: boolean;
|
|
8
|
+
readonly sessionId: string | undefined;
|
|
9
|
+
}): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{ClientSessionStrandedError}from"#client/client-error.js";function formatStrandedSessionNotice(e,t){if(!(e instanceof ClientSessionStrandedError))return;let n=[e.eveVersion===void 0?void 0:`built by eve ${e.eveVersion}`,t.localServer?`this dev server runs eve ${resolveInstalledPackageInfo().version}`:void 0].filter(e=>e!==void 0),r=n.length===0?``:` (${n.join(`; `)})`;return`${`Session ${t.sessionId??`unknown`}`} is stranded${r}: the deployment that ran it is no longer available. The session cannot continue. Run /new to end it and start a fresh session.`}export{formatStrandedSessionNotice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{summarizeToolArgs,summarizeToolResult}from"./tool-format.js";import{diffWriteDetail}from"./line-diff.js";import{displayName,displayTitle}from"#shared/display-name.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";const WRITE_FILE_VERB=`Write`,DELEGATE_VERB=`Delegate`,
|
|
1
|
+
import{summarizeToolArgs,summarizeToolResult}from"./tool-format.js";import{diffWriteDetail}from"./line-diff.js";import{displayName,displayTitle}from"#shared/display-name.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";import{REPLY_TOOL_NAME}from"#protocol/reply-tool.js";const WRITE_FILE_VERB=`Write`,DELEGATE_VERB=`Delegate`,REPLY_TITLE=`Reply`,BUILTIN_TOOL_COPY={agent:{verb:`Delegate`,pastVerb:`Delegated`,argKey:`message`,singularNoun:`task`,pluralNoun:`tasks`},ask_question:{verb:`Ask`,pastVerb:`Asked`,argKey:`question`,singularNoun:`question`,pluralNoun:`questions`},bash:{verb:`Run`,pastVerb:`Ran`,argKey:`command`,singularNoun:`command`,pluralNoun:`commands`},glob:{verb:`Glob`,pastVerb:`Globbed`,argKey:`pattern`,singularNoun:`pattern`,pluralNoun:`patterns`},grep:{verb:`Grep`,pastVerb:`Grepped`,argKey:`pattern`,singularNoun:`pattern`,pluralNoun:`patterns`},read_file:{verb:`Read`,pastVerb:`Read`,argKey:`filePath`,singularNoun:`file`,pluralNoun:`files`},web_fetch:{verb:`Fetch`,pastVerb:`Fetched`,argKey:`url`,singularNoun:`URL`,pluralNoun:`URLs`},web_search:{verb:`Search`,pastVerb:`Searched`,argKey:`query`,extractItem:e=>salientArg(e,`objective`)??salientArg(e,`search_query`)??salientArg(e,`searchQuery`)??webSearchActionArg(e),singularNoun:`query`,pluralNoun:`queries`}};function presentWriteFileTool(e,t,n){let r=readWriteFileInput(e,t);if(r===void 0)return{title:toolDisplayTitle(e),subtitle:summarizeToolArgs(t),summarizeResult:summarizeToolResult};let i=diffWriteDetail(n?.previousContent,r.content,n?.existed).map(e=>e.kind===`gap`?e:{...e,text:stripTerminalControls(e.text)});return{title:`${WRITE_FILE_VERB} ${salientLine(r.path)??r.path}`,doneTitle:`Wrote ${salientLine(r.path)??r.path}`,subtitle:``,summarizeResult:()=>void 0,detail:i,keepDetailWhenDone:!0}}function readWriteFileInput(e,t){if(toolBaseName(e)!==`write_file`||typeof t!=`object`||!t||Array.isArray(t))return;let n=t,r=n.filePath,i=n.content;if(typeof r==`string`&&r.trim().length!==0&&typeof i==`string`)return{path:r,content:i}}function presentTool(e,t,n){let r=toolBaseName(e);if(r===`write_file`)return presentWriteFileTool(e,t,n);if(n?.isSubagent===!0){let n=isSelfModificationAgent(e)?agentDisplayName(e):agentTaskLabel(agentDisplayName(e));return{title:`${DELEGATE_VERB} ${n}`,doneTitle:`Delegated ${n}`,subtitle:salientArg(t,`message`)??``,summarizeResult:()=>void 0}}if(r===REPLY_TOOL_NAME)return{title:REPLY_TITLE,subtitle:``,summarizeResult:()=>void 0};let i=BUILTIN_TOOL_COPY[r];if(i!==void 0){let e=salientArg(t,i.argKey)??i.extractItem?.(t);if(e!==void 0)return{title:`${i.verb} ${e}`,doneTitle:`${i.pastVerb} ${e}`,subtitle:``,summarizeResult:()=>void 0,group:{verb:i.verb,pastVerb:i.pastVerb,singularNoun:i.singularNoun,pluralNoun:i.pluralNoun,item:e}}}if(n?.label!==void 0){let e={title:n.label,subtitle:``,summarizeResult:summarizeToolResult};return n.completeLabel===void 0?e:{...e,doneTitle:n.completeLabel}}return{title:toolDisplayTitle(e),subtitle:summarizeToolArgs(t),summarizeResult:summarizeToolResult}}function toolDisplayTitle(e){return displayTitle(toolBaseName(e))}const SELF_MODIFICATION_AGENT_NAME=`self-modification__agent`,AGENT_DISPLAY_NAMES=new Map([[`agent`,`subagent`],[SELF_MODIFICATION_AGENT_NAME,`agent editor`]]);function isSelfModificationAgent(e){return toolBaseName(e)===SELF_MODIFICATION_AGENT_NAME}function agentTaskLabel(e){return/^subagent(?::\d+)?$/u.test(e)||e.startsWith(`agent editor`)?e:`subagent(${e})`}function agentDisplayName(e){let t=toolBaseName(e);return AGENT_DISPLAY_NAMES.get(t)??displayName(t.replace(/(?<=.)__agent$/u,``))}function presentPreparingTool(e,t){let n=toolBaseName(e);return n===REPLY_TOOL_NAME?{title:REPLY_TITLE,subtitle:``,summarizeResult:()=>void 0}:t?.isSubagent===!0?{title:`${DELEGATE_VERB} ${agentTaskLabel(agentDisplayName(e))} …`,subtitle:``,summarizeResult:()=>void 0}:{title:`${(n===`write_file`?WRITE_FILE_VERB:BUILTIN_TOOL_COPY[n]?.verb)??toolDisplayTitle(e)} …`,subtitle:``,summarizeResult:()=>void 0}}function isPanelRoutedTool(e){return toolBaseName(e)===`ask_question`}function toolBaseName(e){return e.split(/[.:/]/u).at(-1)??e}function webSearchActionArg(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.action;if(typeof t!=`object`||!t||Array.isArray(t))return;let n=t,r=n.queries;if(Array.isArray(r)){let e=r.filter(e=>typeof e==`string`).map(salientLine).filter(e=>e!==void 0).join(`, `);if(e.length>0)return e}for(let e of[`query`,`url`,`pattern`]){let t=n[e];if(typeof t==`string`){let e=salientLine(t);if(e!==void 0)return e}}}function salientArg(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return;let n=e[t];if(typeof n==`string`)return salientLine(n)}function salientLine(e){let t=stripTerminalControls(e).split(/\r?\n/u).find(e=>e.trim().length>0)?.trim()??``;return t.length>0?t:void 0}export{SELF_MODIFICATION_AGENT_NAME,agentDisplayName,agentTaskLabel,isPanelRoutedTool,isSelfModificationAgent,presentPreparingTool,presentTool,readWriteFileInput,toolBaseName,toolDisplayTitle};
|