eve 0.50.0 → 0.51.1
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 +41 -0
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/session.d.ts +2 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +16 -20
- package/dist/src/chunks/{use-eve-agent-B5I-k6Ek.js → use-eve-agent-3DZuvuWE.js} +21 -10
- package/dist/src/chunks/{use-eve-agent-DUMU6dap.js → use-eve-agent-D7apPojZ.js} +21 -10
- package/dist/src/cli/acp/command.d.ts +1 -1
- package/dist/src/cli/acp/command.js +2 -2
- package/dist/src/cli/agent-command.d.ts +5 -0
- package/dist/src/cli/agent-command.js +1 -0
- package/dist/src/cli/application-command.d.ts +2 -0
- package/dist/src/cli/commands/agent-instructions.d.ts +3 -1
- package/dist/src/cli/commands/agent-instructions.js +1 -1
- package/dist/src/cli/commands/build.d.ts +1 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/deploy.d.ts +2 -0
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +14 -0
- package/dist/src/cli/commands/init-agent-workspace.js +1 -0
- package/dist/src/cli/commands/init.d.ts +2 -13
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/link.d.ts +2 -0
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +15 -0
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-project-commands.d.ts +1 -1
- package/dist/src/cli/commands/register-project-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.js +2 -2
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +3 -1
- package/dist/src/cli/dev/tui/setup-commands.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +1 -1
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +1 -0
- package/dist/src/cli/option-parsers.js +1 -1
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/agent-info-schema.d.ts +0 -1
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.d.ts +3 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -1
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@clack/core/LICENSE +9 -0
- package/dist/src/compiled/@clack/core/index.d.ts +363 -0
- package/dist/src/compiled/@clack/core/index.js +20 -0
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +34 -92
- package/dist/src/compiled/@vercel/sandbox/api-client/base-client.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +13 -29
- package/dist/src/compiled/@vercel/sandbox/constants.d.ts +11 -1
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -3
- package/dist/src/compiled/@vercel/sandbox/index.js +9 -9
- package/dist/src/compiled/@vercel/sandbox/sandbox-user.d.ts +5 -6
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +79 -67
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +5 -3
- package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-client.d.ts +86 -1
- package/dist/src/compiled/@vercel/sandbox-drives/api-client/index.d.ts +2 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/validators.d.ts +26 -1
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/constants.d.ts +2 -2
- package/dist/src/compiled/@vercel/{sandbox → sandbox-drives}/drive.d.ts +10 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/index.d.ts +3 -2
- package/dist/src/compiled/@vercel/sandbox-drives/index.js +9 -0
- package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox.d.ts +35 -6
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.d.ts +2 -4
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +9 -7
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +13 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +54 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization/types.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/serialization.d.ts +24 -2
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
- package/dist/src/compiled/@workflow/errors/index.d.ts +19 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +46 -2
- package/dist/src/compiled/@workflow/world/events.d.ts +26 -1
- package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/runs.d.ts +2 -2
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
- package/dist/src/compiled/_chunks/node/{auth-BSKyPAEP.js → auth-Bx1Aoyfo.js} +1 -1
- package/dist/src/compiled/_chunks/node/{auth-YpKlwhP1.js → auth-CA8ZMfB8.js} +1 -1
- package/dist/src/compiled/_chunks/node/esm-CE0tAvRh.js +7 -0
- package/dist/src/compiled/_chunks/node/version-BC6t2Txc.js +1 -0
- package/dist/src/compiled/_chunks/node/version-DSQqVZ5T.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BwAadFfB.js → attribute-changes-03lzo29R.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-BIdMK5N8.js +40 -0
- package/dist/src/compiled/_chunks/workflow/dist-DMQ3CtWt.js +3 -0
- package/dist/src/compiled/_chunks/workflow/frames-Boesh7kU.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{private-CZFMABEf.js → private-CKx3PkSS.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-BToMtPbH.js → resume-hook-C6eL-S_T.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/run-BV0S6Zc2.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-Bh3jP9ii.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-l-cwfJvm.js +15 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-PnVVxT0R.js → ws-transport-BagXNxCE.js} +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +20 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/context/build-dynamic-tools.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 +0 -3
- package/dist/src/context/keys.js +1 -1
- package/dist/src/discover/extensions.d.ts +2 -0
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +1 -0
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/mock-model.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/session-cleanup.d.ts +7 -0
- package/dist/src/evals/session-cleanup.js +1 -0
- package/dist/src/evals/session.d.ts +4 -0
- package/dist/src/evals/session.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +1 -0
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/activity-collector.js +1 -1
- package/dist/src/execution/activity-work-id.js +1 -1
- package/dist/src/execution/activity-work.d.ts +8 -0
- package/dist/src/execution/activity-work.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +6 -0
- package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -0
- package/dist/src/execution/channel-context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +103 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -0
- package/dist/src/execution/coordination-dispatch-step.d.ts +7 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -0
- package/dist/src/execution/create-session-step.d.ts +1 -2
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +5 -5
- package/dist/src/execution/dispatch-action-failures.js +1 -1
- package/dist/src/execution/dispatch-start-operation.d.ts +1 -1
- package/dist/src/execution/dispatch-start-operation.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
- package/dist/src/execution/inline-turn.d.ts +2 -0
- package/dist/src/execution/inline-turn.js +1 -1
- package/dist/src/execution/next-driver-action.d.ts +7 -13
- package/dist/src/execution/node-step.d.ts +1 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/pending-turn-state.d.ts +1 -2
- package/dist/src/execution/pending-turn-state.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/run-session-limits.d.ts +5 -5
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-create-sdk.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +4 -4
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/session-activity-projection.js +1 -1
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/session-command-inbox.d.ts +2 -3
- package/dist/src/execution/session-timeout-workflow.js +1 -1
- package/dist/src/execution/session.d.ts +2 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/stable-workflow-names.d.ts +1 -1
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/task-event-callback.js +1 -1
- package/dist/src/execution/tasks/child/steps.d.ts +19 -11
- package/dist/src/execution/tasks/child/steps.js +1 -1
- package/dist/src/execution/tasks/child/update-step.d.ts +6 -0
- package/dist/src/execution/tasks/child/update-step.js +1 -0
- package/dist/src/execution/tasks/child/update.d.ts +7 -10
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/child/workflow.d.ts +21 -27
- package/dist/src/execution/tasks/child/workflow.js +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +6 -17
- package/dist/src/execution/tasks/parent/control-shared.js +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +15 -48
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +19 -34
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +5 -15
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/run-parent.d.ts +2 -2
- package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +26 -0
- package/dist/src/execution/tasks/parent/subagent-task-projection.js +1 -0
- package/dist/src/execution/tasks/parent/task-cancel.d.ts +11 -0
- package/dist/src/execution/tasks/parent/task-cancel.js +1 -0
- package/dist/src/execution/tasks/parent/tool-execution.d.ts +2 -3
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.d.ts +3 -0
- package/dist/src/execution/tools/sleep-workflow.js +1 -0
- package/dist/src/execution/tools/sleep.d.ts +1 -5
- package/dist/src/execution/tools/sleep.js +1 -1
- package/dist/src/execution/tools/subagent/accept-event-step.d.ts +7 -0
- package/dist/src/execution/tools/subagent/accept-event-step.js +1 -0
- package/dist/src/execution/tools/subagent/emit-called-step.d.ts +9 -0
- package/dist/src/execution/tools/subagent/emit-called-step.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-agent.d.ts +51 -0
- package/dist/src/execution/tools/subagent/invoke-agent.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +37 -0
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -0
- package/dist/src/execution/tools/subagent/invoke-step.d.ts +55 -0
- package/dist/src/execution/tools/subagent/invoke-step.js +1 -0
- package/dist/src/execution/tools/subagent/receipt-identity.d.ts +11 -0
- package/dist/src/execution/tools/subagent/receipt-identity.js +1 -0
- package/dist/src/execution/{dispatch-runtime-actions-start.d.ts → tools/subagent/start.d.ts} +17 -5
- package/dist/src/execution/tools/subagent/start.js +1 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +24 -0
- package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -0
- package/dist/src/execution/tools/subagent/task-cancel.d.ts +10 -0
- package/dist/src/execution/tools/subagent/task-cancel.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +10 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/execution/{tool-run → tools/workflow}/answer.d.ts +1 -1
- package/dist/src/execution/tools/workflow/answer.js +1 -0
- package/dist/src/execution/tools/workflow/ask.d.ts +22 -0
- package/dist/src/execution/tools/workflow/ask.js +1 -0
- package/dist/src/execution/tools/workflow/background.d.ts +18 -0
- package/dist/src/execution/tools/workflow/background.js +1 -0
- package/dist/src/execution/tools/workflow/body.d.ts +25 -0
- package/dist/src/execution/tools/workflow/body.js +1 -0
- package/dist/src/execution/tools/workflow/cancel.d.ts +11 -0
- package/dist/src/execution/tools/workflow/cancel.js +1 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +7 -0
- package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -0
- package/dist/src/execution/tools/workflow/messages.d.ts +88 -0
- package/dist/src/execution/tools/workflow/messages.js +1 -0
- package/dist/src/execution/tools/workflow/owner-inbox.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner-inbox.js +1 -0
- package/dist/src/execution/tools/workflow/owner.d.ts +13 -0
- package/dist/src/execution/tools/workflow/owner.js +1 -0
- package/dist/src/execution/tools/workflow/run-control.d.ts +18 -0
- package/dist/src/execution/tools/workflow/run-control.js +1 -0
- package/dist/src/execution/tools/workflow/start.d.ts +33 -0
- package/dist/src/execution/tools/workflow/start.js +1 -0
- package/dist/src/execution/tools/workflow/types.d.ts +26 -0
- package/dist/src/execution/tools/workflow/types.js +1 -0
- package/dist/src/execution/tools/workflow/workflow.d.ts +3 -0
- package/dist/src/execution/tools/workflow/workflow.js +1 -0
- package/dist/src/execution/turn-cancellation-control.d.ts +1 -0
- package/dist/src/execution/turn-cancellation-control.js +1 -1
- package/dist/src/execution/turn-cancellation-token.d.ts +1 -0
- package/dist/src/execution/turn-control-receiver.d.ts +3 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-dispatch.d.ts +2 -0
- package/dist/src/execution/turn-dispatch.js +1 -1
- package/dist/src/execution/turn-workflow-tool-run.d.ts +16 -0
- package/dist/src/execution/turn-workflow-tool-run.js +1 -0
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
- package/dist/src/execution/wire/session-inbox-contract.js +1 -1
- package/dist/src/execution/wire/session-inbox-encoder.d.ts +14 -2
- package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
- package/dist/src/execution/wire/session-inbox-resume.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.d.ts +3 -3
- package/dist/src/execution/wire/session-inbox-wire.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +267 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +3 -0
- package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +1 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +341 -0
- package/dist/src/execution/wire/session-inbox-wire.v6.js +1 -0
- package/dist/src/execution/workflow-entry-finalization.d.ts +6 -0
- package/dist/src/execution/workflow-entry-finalization.js +1 -1
- package/dist/src/execution/workflow-entry.d.ts +2 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -7
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/background-tools.d.ts +8 -2
- package/dist/src/harness/{runtime-actions.d.ts → coordination.d.ts} +40 -27
- package/dist/src/harness/coordination.js +1 -0
- package/dist/src/harness/emission.d.ts +9 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +52 -0
- package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +6 -2
- package/dist/src/harness/session-limit-continuation.d.ts +5 -5
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +4 -4
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/session-usage-limits.d.ts +48 -0
- package/dist/src/harness/session-usage-limits.js +1 -0
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +1 -2
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-action.js +1 -1
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +20 -21
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +9 -7
- package/dist/src/harness/workflow-interrupt-state.js +1 -1
- package/dist/src/harness/workflow-lifecycle.d.ts +10 -0
- package/dist/src/harness/workflow-lifecycle.js +1 -1
- package/dist/src/harness/workflow-sandbox.d.ts +1 -1
- package/dist/src/harness/workflow-sandbox.js +2 -2
- package/dist/src/harness/workflow-subagent-limit.d.ts +7 -7
- package/dist/src/harness/workflow-subagent-limit.js +1 -1
- package/dist/src/harness/workflow-task-state.d.ts +9 -0
- package/dist/src/harness/workflow-task-state.js +1 -0
- package/dist/src/harness/workflow-tool-runs.d.ts +27 -0
- package/dist/src/harness/workflow-tool-runs.js +1 -0
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/parent-lineage.js +1 -1
- package/dist/src/internal/agent-name.d.ts +4 -0
- package/dist/src/internal/agent-name.js +1 -0
- package/dist/src/internal/application/build-output-environment.d.ts +1 -0
- package/dist/src/internal/application/build-output-environment.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/eve-project-root.d.ts +8 -0
- package/dist/src/internal/eve-project-root.js +1 -0
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -0
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +1 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/project-context.d.ts +31 -0
- package/dist/src/internal/project-context.js +1 -0
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +17 -0
- package/dist/src/internal/vercel/assemble-eve-services.js +1 -0
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -0
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -0
- package/dist/src/internal/vercel/build-command.d.ts +4 -0
- package/dist/src/internal/vercel/build-command.js +1 -0
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +28 -0
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.d.ts +18 -0
- package/dist/src/internal/vercel/vercel-service-config-operations.js +1 -0
- package/dist/src/internal/vercel/vercel-service-name.d.ts +6 -0
- package/dist/src/internal/vercel/vercel-service-name.js +1 -0
- package/dist/src/internal/vercel/vercel-services-config.d.ts +53 -0
- package/dist/src/internal/vercel/vercel-services-config.js +1 -0
- package/dist/src/internal/workflow/reference.d.ts +2 -0
- package/dist/src/internal/workflow/reference.js +1 -0
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +0 -9
- package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/workflow-transformer.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/activity-plan.d.ts +4 -0
- package/dist/src/public/channels/slack/activity-plan.js +1 -0
- package/dist/src/public/channels/slack/activity.d.ts +45 -2
- package/dist/src/public/channels/slack/activity.js +2 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -1
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
- package/dist/src/public/memory/index.js +1 -1
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/nuxt/index.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +3 -2
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +9 -5
- package/dist/src/public/sandbox/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/public/workflow/index.d.ts +3 -1
- package/dist/src/public/workflow/index.js +1 -1
- package/dist/src/runtime/actions/results.d.ts +3 -3
- package/dist/src/runtime/actions/results.js +1 -1
- package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/channels/registry.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +16 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow-reference.d.ts +5 -0
- package/dist/src/runtime/subagents/workflow-reference.js +1 -0
- package/dist/src/runtime/subagents/workflow.d.ts +8 -0
- package/dist/src/runtime/subagents/workflow.js +1 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/self-modification/agent.d.ts +22 -0
- package/dist/src/self-modification/agent.js +1 -0
- package/dist/src/self-modification/extension/classify-registry-item.d.ts +19 -0
- package/dist/src/self-modification/extension/classify-registry-item.js +1 -0
- package/dist/src/self-modification/extension/eve-add.d.ts +56 -0
- package/dist/src/self-modification/extension/eve-add.js +2 -0
- package/dist/src/self-modification/extension/extension.d.ts +2 -0
- package/dist/src/self-modification/extension/extension.js +1 -0
- package/dist/src/self-modification/extension/instructions.d.ts +4 -0
- package/dist/src/self-modification/extension/instructions.js +23 -0
- package/dist/src/self-modification/extension/source-lock.d.ts +2 -0
- package/dist/src/self-modification/extension/source-lock.js +1 -0
- package/dist/src/self-modification/extension/tools/edit_file.d.ts +16 -0
- package/dist/src/self-modification/extension/tools/edit_file.js +1 -0
- package/dist/src/self-modification/extension/tools/registry_add.d.ts +52 -0
- package/dist/src/self-modification/extension/tools/registry_add.js +1 -0
- package/dist/src/self-modification/extension/tools/search_models.d.ts +22 -0
- package/dist/src/self-modification/extension/tools/search_models.js +1 -0
- package/dist/src/self-modification/extension/tools/search_registry.d.ts +103 -0
- package/dist/src/self-modification/extension/tools/search_registry.js +1 -0
- package/dist/src/self-modification/filesystem.d.ts +6 -0
- package/dist/src/self-modification/filesystem.js +1 -0
- package/dist/src/self-modification/sandbox.d.ts +2 -0
- package/dist/src/self-modification/sandbox.js +1 -0
- package/dist/src/services/dev-client/target.d.ts +3 -1
- package/dist/src/setup/boxes/select-model.d.ts +3 -21
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/prompt-ui.js +4 -4
- package/dist/src/setup/cli/select-component.d.ts +1 -1
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -0
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/integrations/discord/setup.js +1 -1
- package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
- package/dist/src/setup/integrations/linear/setup.js +1 -1
- package/dist/src/setup/integrations/linq/setup.js +3 -3
- package/dist/src/setup/integrations/shopify/setup.js +1 -1
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +4 -12
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/shared/action-types.d.ts +103 -30
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +13 -0
- package/dist/src/shared/agent-turn-outcome.d.ts +2 -0
- package/dist/src/shared/agent-turn-outcome.js +1 -1
- package/dist/src/shared/extension-package-contract.d.ts +2 -0
- package/dist/src/shared/extension-package-contract.js +1 -1
- package/dist/src/shared/gateway-model-catalog.d.ts +21 -0
- package/dist/src/shared/gateway-model-catalog.js +1 -0
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/shared/token-usage.d.ts +11 -15
- package/dist/src/shared/token-usage.js +1 -1
- package/dist/src/shared/workflow-sandbox.d.ts +1 -1
- package/dist/src/{execution/subagent-adapter-state.d.ts → subagents/adapter-state.d.ts} +2 -0
- package/dist/src/{execution/subagent-adapter-state.js → subagents/adapter-state.js} +1 -1
- package/dist/src/subagents/adapter.js +1 -0
- package/dist/src/{harness → subagents}/agent-handle-errors.d.ts +6 -0
- package/dist/src/subagents/agent-handle-errors.js +1 -0
- package/dist/src/subagents/callback-route.js +1 -0
- package/dist/src/subagents/callback-step.js +1 -0
- package/dist/src/{execution/agent-continuation-bundle.d.ts → subagents/continuation-bundle.d.ts} +1 -1
- package/dist/src/subagents/continuation-bundle.js +1 -0
- package/dist/src/{execution/subagent-event-proxy-step.d.ts → subagents/event-proxy-step.d.ts} +2 -8
- package/dist/src/subagents/event-proxy-step.js +1 -0
- package/dist/src/subagents/handle-dispatch.d.ts +54 -0
- package/dist/src/subagents/handle-dispatch.js +1 -0
- package/dist/src/{harness → subagents}/handles/prompt.d.ts +4 -4
- package/dist/src/{harness → subagents}/handles/prompt.js +1 -1
- package/dist/src/{harness → subagents}/handles/query.d.ts +8 -2
- package/dist/src/subagents/handles/query.js +1 -0
- package/dist/src/subagents/handles/rebase.d.ts +4 -0
- package/dist/src/subagents/handles/rebase.js +1 -0
- package/dist/src/{harness → subagents}/handles/store.d.ts +90 -15
- package/dist/src/subagents/handles/store.js +1 -0
- package/dist/src/subagents/handles/transitions.d.ts +103 -0
- package/dist/src/subagents/handles/transitions.js +1 -0
- package/dist/src/{execution/delegated-parent-notification.d.ts → subagents/parent-notification.d.ts} +1 -7
- package/dist/src/subagents/parent-notification.js +1 -0
- package/dist/src/subagents/parent-result.js +1 -0
- package/dist/src/{execution/remote-agent-dispatch.d.ts → subagents/remote-dispatch.d.ts} +3 -2
- package/dist/src/subagents/remote-dispatch.js +1 -0
- package/dist/src/{execution/subagent-start-local.d.ts → subagents/start-local.d.ts} +5 -6
- package/dist/src/subagents/start-local.js +1 -0
- package/dist/src/{execution/subagent-start-remote.d.ts → subagents/start-remote.d.ts} +5 -5
- package/dist/src/subagents/start-remote.js +1 -0
- package/dist/src/subagents/token-budget.js +1 -0
- package/dist/src/{execution/subagent-tool.d.ts → subagents/tool.d.ts} +5 -3
- package/dist/src/subagents/tool.js +1 -0
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tasks/session-index.d.ts +2 -3
- package/dist/src/tasks/session-index.js +1 -1
- package/dist/src/tasks/task-id.d.ts +3 -4
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/transitions.d.ts +3 -47
- package/dist/src/tasks/transitions.js +1 -1
- package/dist/src/tasks/types.d.ts +70 -247
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -1
- package/dist/src/tools/framework/agent.d.ts +18 -2
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +2 -6
- package/dist/src/tools/framework/task-contract.d.ts +44 -65
- package/dist/src/tools/framework/task-contract.js +1 -1
- package/dist/src/tools/framework/task-update.d.ts +1 -0
- package/dist/src/tools/framework/task-update.js +1 -1
- package/dist/src/tools/provided/sleep.d.ts +2 -2
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +24 -19
- package/docs/channels/eve.mdx +1 -1
- package/docs/concepts/built-in-tools.md +10 -91
- package/docs/concepts/context-control.md +2 -2
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +11 -3
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment/vercel.mdx +20 -2
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/guides/instrumentation-providers.md +242 -0
- package/docs/guides/instrumentation.md +2 -0
- package/docs/guides/meta.json +1 -0
- package/docs/guides/remote-agents.md +8 -9
- package/docs/memory/overview.mdx +1 -1
- package/docs/reference/cli.md +5 -2
- package/docs/sandbox.mdx +3 -1
- package/docs/subagents/index.mdx +9 -8
- package/docs/tools/overview.mdx +11 -10
- package/docs/tools/workflows.mdx +52 -18
- package/package.json +38 -13
- package/dist/src/compiled/@vercel/sandbox-delete/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-delete/index.js +0 -9
- package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +0 -201
- package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +0 -8
- package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +0 -1456
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +0 -29
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +0 -39
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +0 -66
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +0 -2
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +0 -899
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +0 -10
- package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +0 -18
- package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +0 -6
- package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +0 -111
- package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +0 -28
- package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +0 -40
- package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +0 -292
- package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +0 -5
- package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +0 -116
- package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +0 -258
- package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +0 -12
- package/dist/src/compiled/@vercel/sandbox-stable/index.js +0 -1
- package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +0 -169
- package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +0 -55
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +0 -212
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +0 -1216
- package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +0 -433
- package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +0 -229
- package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +0 -21
- package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +0 -16
- package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +0 -15
- package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +0 -11
- package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +0 -11
- package/dist/src/compiled/_chunks/node/decode_jwt-Col8JOnf.js +0 -7
- package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +0 -1
- package/dist/src/compiled/_chunks/node/version-DH6yRy-M.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +0 -40
- package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +0 -3
- package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +0 -3
- package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +0 -15
- package/dist/src/execution/agent-continuation-bundle.js +0 -1
- package/dist/src/execution/agent-handle-dispatch.d.ts +0 -79
- package/dist/src/execution/agent-handle-dispatch.js +0 -1
- package/dist/src/execution/delegated-parent-notification.js +0 -1
- package/dist/src/execution/delegated-parent-result.js +0 -1
- package/dist/src/execution/delegation-tool.d.ts +0 -10
- package/dist/src/execution/delegation-tool.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +0 -165
- package/dist/src/execution/dispatch-runtime-actions-shared.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-start.js +0 -1
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-runtime-actions-step.js +0 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +0 -18
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +0 -1
- package/dist/src/execution/finalize-terminal-session.d.ts +0 -17
- package/dist/src/execution/finalize-terminal-session.js +0 -1
- package/dist/src/execution/prepared-agent-action.d.ts +0 -7
- package/dist/src/execution/prepared-agent-action.js +0 -1
- package/dist/src/execution/remote-agent-dispatch.js +0 -1
- package/dist/src/execution/session-callback-route.js +0 -1
- package/dist/src/execution/session-callback-step.js +0 -1
- package/dist/src/execution/subagent-adapter.js +0 -1
- package/dist/src/execution/subagent-event-proxy-step.js +0 -1
- package/dist/src/execution/subagent-start-local.js +0 -1
- package/dist/src/execution/subagent-start-remote.js +0 -1
- package/dist/src/execution/subagent-tool.js +0 -1
- package/dist/src/execution/tasks/child/instructions.d.ts +0 -3
- package/dist/src/execution/tasks/child/instructions.js +0 -1
- package/dist/src/execution/tasks/parent/agent-identity.d.ts +0 -13
- package/dist/src/execution/tasks/parent/agent-identity.js +0 -1
- package/dist/src/execution/tasks/parent/agent-views.d.ts +0 -7
- package/dist/src/execution/tasks/parent/agent-views.js +0 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +0 -43
- package/dist/src/execution/tasks/parent/continuation-dispatch.js +0 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +0 -19
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +0 -1
- package/dist/src/execution/tool-run/answer.js +0 -1
- package/dist/src/execution/tool-run/background.d.ts +0 -14
- package/dist/src/execution/tool-run/background.js +0 -1
- package/dist/src/execution/tool-run/cancel.d.ts +0 -7
- package/dist/src/execution/tool-run/cancel.js +0 -1
- package/dist/src/execution/tool-run/dispatch.d.ts +0 -24
- package/dist/src/execution/tool-run/dispatch.js +0 -1
- package/dist/src/execution/tool-run/emit-run-report-step.d.ts +0 -7
- package/dist/src/execution/tool-run/emit-run-report-step.js +0 -1
- package/dist/src/execution/tool-run/messages.d.ts +0 -70
- package/dist/src/execution/tool-run/messages.js +0 -1
- package/dist/src/execution/tool-run/owner-inbox.d.ts +0 -11
- package/dist/src/execution/tool-run/owner-inbox.js +0 -1
- package/dist/src/execution/tool-run/owner.d.ts +0 -13
- package/dist/src/execution/tool-run/owner.js +0 -1
- package/dist/src/execution/tool-run/run-control.d.ts +0 -18
- package/dist/src/execution/tool-run/run-control.js +0 -1
- package/dist/src/execution/tool-run/start.d.ts +0 -11
- package/dist/src/execution/tool-run/start.js +0 -1
- package/dist/src/execution/tool-run/types.d.ts +0 -21
- package/dist/src/execution/tool-run/types.js +0 -1
- package/dist/src/execution/tool-run/workflow.d.ts +0 -9
- package/dist/src/execution/tool-run/workflow.js +0 -1
- package/dist/src/execution/tools/subagent/local.d.ts +0 -40
- package/dist/src/execution/tools/subagent/local.js +0 -1
- package/dist/src/execution/tools/subagent/remote.d.ts +0 -26
- package/dist/src/execution/tools/subagent/remote.js +0 -1
- package/dist/src/harness/agent-handle-errors.js +0 -1
- package/dist/src/harness/handles/query.js +0 -1
- package/dist/src/harness/handles/store.js +0 -1
- package/dist/src/harness/handles/transitions.d.ts +0 -167
- package/dist/src/harness/handles/transitions.js +0 -1
- package/dist/src/harness/runtime-actions.js +0 -1
- package/dist/src/harness/session-token-limits.d.ts +0 -41
- package/dist/src/harness/session-token-limits.js +0 -1
- package/dist/src/harness/subagent-depth.d.ts +0 -10
- package/dist/src/harness/subagent-depth.js +0 -1
- package/dist/src/harness/subagent-token-budget.js +0 -1
- package/dist/src/harness/tool-runs.d.ts +0 -21
- package/dist/src/harness/tool-runs.js +0 -1
- package/dist/src/harness/turn-sleep.d.ts +0 -12
- package/dist/src/harness/turn-sleep.js +0 -1
- package/dist/src/harness/workflow-runtime-action-state.d.ts +0 -9
- package/dist/src/harness/workflow-runtime-action-state.js +0 -1
- package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +0 -16
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js +0 -5
- package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js +0 -1
- package/dist/src/runtime/actions/keys.d.ts +0 -14
- package/dist/src/runtime/actions/keys.js +0 -1
- package/dist/src/tasks/wire.d.ts +0 -25
- package/dist/src/tasks/wire.js +0 -1
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/LICENSE +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_async-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_workflow-serde.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/base-client.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/file-writer.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/with-retry.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/error.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/file.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/index.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/oauth.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/poll-for-token.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/project.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/command.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/execution-context.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/filesystem.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/network-policy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/proxy.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox-user.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/session.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/get-credentials.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/paginator.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/resolveSignal.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/sandbox-snapshot.d.ts +0 -0
- /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/types.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.js +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.d.ts +0 -0
- /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.js +0 -0
- /package/dist/src/{execution/subagent-adapter.d.ts → subagents/adapter.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-route.d.ts → subagents/callback-route.d.ts} +0 -0
- /package/dist/src/{execution/session-callback-step.d.ts → subagents/callback-step.d.ts} +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/operation-id.js +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.d.ts +0 -0
- /package/dist/src/{harness → subagents}/handles/state-key.js +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.d.ts → subagents/hitl-proxy.d.ts} +0 -0
- /package/dist/src/{execution/subagent-hitl-proxy.js → subagents/hitl-proxy.js} +0 -0
- /package/dist/src/{execution/subagent-invocation.d.ts → subagents/invocation.d.ts} +0 -0
- /package/dist/src/{execution/subagent-invocation.js → subagents/invocation.js} +0 -0
- /package/dist/src/{execution/delegated-parent-result.d.ts → subagents/parent-result.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.d.ts → subagents/remote-route-url.d.ts} +0 -0
- /package/dist/src/{execution/remote-agent-route-url.js → subagents/remote-route-url.js} +0 -0
- /package/dist/src/{harness/subagent-token-budget.d.ts → subagents/token-budget.d.ts} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface ExactEdit {
|
|
2
|
+
readonly oldText: string;
|
|
3
|
+
readonly newText: string;
|
|
4
|
+
}
|
|
5
|
+
/** Applies unique, non-overlapping replacements matched against the original content. */
|
|
6
|
+
export declare function applyExactEdits(content: string, edits: readonly ExactEdit[]): string;
|
|
7
|
+
declare const _default: import("eve/tools").ToolDefinition<Record<string, unknown>, {
|
|
8
|
+
path: string;
|
|
9
|
+
replacements: number;
|
|
10
|
+
}> & {
|
|
11
|
+
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<{
|
|
12
|
+
path: string;
|
|
13
|
+
replacements: number;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withAuthoredSourceLock}from"../source-lock.js";import{defineTool}from"eve/tools";const inputSchema={type:`object`,additionalProperties:!1,properties:{path:{type:`string`,minLength:1,description:`Path to the file to edit (relative or absolute).`},edits:{type:`array`,minItems:1,items:{type:`object`,additionalProperties:!1,properties:{oldText:{type:`string`,minLength:1,description:`Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.`},newText:{type:`string`,description:`Replacement text for this targeted edit.`}},required:[`oldText`,`newText`]},description:`One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.`}},required:[`path`,`edits`]},outputSchema={type:`object`,additionalProperties:!1,properties:{path:{type:`string`},replacements:{type:`integer`,minimum:1}},required:[`path`,`replacements`]};function applyExactEdits(e,t){if(t.length===0)throw Error(`edits must contain at least one replacement.`);let n=[...t.map((t,n)=>{if(t.oldText.length===0)throw Error(`edits[${n}].oldText must not be empty.`);let r=e.indexOf(t.oldText);if(r===-1)throw Error(`edits[${n}].oldText was not found in the current file. Read the file and try again.`);if(e.indexOf(t.oldText,r+1)!==-1)throw Error(`edits[${n}].oldText occurs more than once. Include more surrounding text to make it unique.`);return{...t,end:r+t.oldText.length,index:n,start:r}})].sort((e,t)=>e.start-t.start);for(let e=1;e<n.length;e+=1){let t=n[e-1],r=n[e];if(t!==void 0&&r!==void 0&&r.start<t.end)throw Error(`edits[${t.index}] and edits[${r.index}] overlap. Merge them into one edit.`)}return n.toReversed().reduce((e,t)=>e.slice(0,t.start)+t.newText+e.slice(t.end),e)}var edit_file_default=defineTool({description:`Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.`,inputSchema,outputSchema,async execute(t,n){let{edits:r,path:i}=t;if(typeof i!=`string`||!Array.isArray(r)||r.some(e=>typeof e!=`object`||!e||typeof e.oldText!=`string`||typeof e.newText!=`string`))throw Error(`path must be a string and edits must contain oldText and newText strings.`);let a=await n.getSandbox();return await withAuthoredSourceLock(async()=>{let e=await a.readTextFile({path:i});if(e===null)throw Error(`File not found: ${i}.`);if(e.includes(`\0`))throw Error(`File "${i}" contains NUL bytes and appears to be binary.`);return await a.writeTextFile({content:applyExactEdits(e,r),path:i}),{path:a.resolvePath(i),replacements:r.length}})}});export{applyExactEdits,edit_file_default as default};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type LocalDevCapability } from "eve/local-dev";
|
|
2
|
+
import { type SpawnLike } from "../eve-add.js";
|
|
3
|
+
import { type CatalogEntry } from "./search_registry.js";
|
|
4
|
+
interface RegistryAddDependencies {
|
|
5
|
+
readonly getCapability?: () => LocalDevCapability | undefined;
|
|
6
|
+
readonly spawn?: SpawnLike;
|
|
7
|
+
}
|
|
8
|
+
/** What the tool reports back. Mirrors {@link outputSchema}. */
|
|
9
|
+
export interface RegistryAddResult {
|
|
10
|
+
readonly address: string;
|
|
11
|
+
/** `failed` carries an explicit mutation outcome instead of implying nothing changed. */
|
|
12
|
+
readonly status: "installed" | "needs-terminal" | "failed";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly title?: string;
|
|
15
|
+
readonly envVars?: readonly string[];
|
|
16
|
+
readonly reason?: string;
|
|
17
|
+
readonly nextCommand?: string;
|
|
18
|
+
readonly changed?: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Names the item's declared environment variables that are not set.
|
|
22
|
+
*
|
|
23
|
+
* Naming a required variable is not a secret, and an installed item can still
|
|
24
|
+
* be non-functional through unset variables, so this is the difference between
|
|
25
|
+
* reporting outstanding work and reporting bare success. Values are never read.
|
|
26
|
+
*/
|
|
27
|
+
export declare function unsetEnvVars(entry: CatalogEntry, environment?: Readonly<Record<string, string | undefined>>): readonly string[];
|
|
28
|
+
/**
|
|
29
|
+
* Builds the handoff a `needs-terminal` item carries.
|
|
30
|
+
*
|
|
31
|
+
* The interactive TUI consumes `status` and `address` to open the existing
|
|
32
|
+
* address-specific setup flow itself, so its model-facing result deliberately
|
|
33
|
+
* carries no command for the model to repeat. Headless `eve dev` has no TUI to
|
|
34
|
+
* dispatch into, so the shell command is the only honest answer there.
|
|
35
|
+
*/
|
|
36
|
+
export declare function handoffMessage(input: {
|
|
37
|
+
readonly address: string;
|
|
38
|
+
readonly interactiveClient: boolean;
|
|
39
|
+
readonly reason: string;
|
|
40
|
+
readonly title: string;
|
|
41
|
+
}): {
|
|
42
|
+
readonly message: string;
|
|
43
|
+
readonly nextCommand?: string;
|
|
44
|
+
};
|
|
45
|
+
/** Exported for tests; the tool's `execute` delegates here. */
|
|
46
|
+
export declare function addRegistryItem(address: string, options?: RegistryAddDependencies & {
|
|
47
|
+
readonly signal?: AbortSignal;
|
|
48
|
+
}): Promise<RegistryAddResult>;
|
|
49
|
+
declare const _default: import("eve/tools").ToolDefinition<Record<string, unknown>, RegistryAddResult> & {
|
|
50
|
+
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<RegistryAddResult>;
|
|
51
|
+
};
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{classifyCatalogEntry}from"../classify-registry-item.js";import{runEveAdd}from"../eve-add.js";import{withAuthoredSourceLock}from"../source-lock.js";import{loadRegistryIndex,resolveRegistryIndexUrl}from"./search_registry.js";import{defineTool}from"eve/tools";import{getLocalDevCapability}from"eve/local-dev";import{once}from"eve/tools/approval";const inputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},outputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`],description:"`installed` means the item is present. `needs-terminal` means nothing was installed. `failed` means installation stopped; read `message` and `changed` before retrying."},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title} was not installed by this tool. ${e.reason} Continue in the setup panel that opens here; do not ask the developer to run another command.`};let t=`eve add ${e.address}`;return{message:`${e.title} was not installed. ${e.reason} Run \`${t}\` in a terminal to finish it.`,nextCommand:t}}async function addRegistryItem(r,i={}){let a=(i.getCapability??getLocalDevCapability)();if(a===void 0)throw Error("Registry items can only be installed while `eve dev` is running. Report the item address to the developer instead of installing it.");let o=(await loadRegistryIndex({nowMs:Date.now(),signal:i.signal,url:resolveRegistryIndexUrl()})).find(e=>e.address===r);if(o===void 0)throw Error(`No item in the configured eve registry is published at "${r}". Check the address before trying again.`);let s=classifyCatalogEntry(o);if(s.kind===`needs-terminal`){let e=handoffMessage({address:r,interactiveClient:a.interactiveClient,reason:s.reason,title:o.title});return{address:r,reason:s.reason,status:`needs-terminal`,title:o.title,...e}}let c=await withAuthoredSourceLock(()=>a.withSuspendedSource(()=>runEveAdd({address:r,appRoot:a.appRoot,signal:i.signal,spawn:i.spawn})));if(c.kind===`blocked`){let e=handoffMessage({address:r,interactiveClient:a.interactiveClient,reason:c.message,title:o.title});return{address:r,reason:c.message,status:`needs-terminal`,title:o.title,...e}}if(c.kind===`failed`)return c.changed===void 0?{address:r,status:`failed`,title:o.title,reason:c.message,message:c.message}:{address:r,status:`failed`,title:o.title,reason:c.message,message:c.message,changed:c.changed};let l=unsetEnvVars(o);return{address:r,envVars:[...l],message:l.length===0?`Installed ${o.title}.`:`Installed ${o.title}. It will not work until ${l.join(`, `)} ${l.length===1?`is`:`are`} set.`,status:`installed`,title:o.title}}var registry_add_default=defineTool({approval:once(),description:"Install an item from the configured eve registry into this project, for example `channel/slack` or `extension/browserbase`. Only items that need no setup are installed here; an item with a setup flow or multiple components is reported back with the command that completes it, and nothing is installed. Development only. Search first, then call this with the exact item address.",inputSchema,outputSchema,async execute(e,t){let{address:n}=e;if(typeof n!=`string`||n.length===0)throw Error(`address must be an exact item address from the configured eve registry.`);return await addRegistryItem(n,{signal:t.abortSignal})}});export{addRegistryItem,registry_add_default as default,handoffMessage,unsetEnvVars};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type GatewayCatalogModel } from "#shared/gateway-model-catalog.js";
|
|
2
|
+
export declare function searchGatewayModels(models: readonly GatewayCatalogModel[], query: string): {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
provider: string;
|
|
6
|
+
}[];
|
|
7
|
+
declare const _default: import("eve/tools").ToolDefinition<Record<string, unknown>, {
|
|
8
|
+
models: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
}[];
|
|
13
|
+
}> & {
|
|
14
|
+
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<{
|
|
15
|
+
models: {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
provider: string;
|
|
19
|
+
}[];
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{AI_GATEWAY_MODELS_URL}from"#internal/gateway.js";import{defineTool}from"eve/tools";import{parseGatewayModelCatalog}from"#shared/gateway-model-catalog.js";const inputSchema={type:`object`,additionalProperties:!1,properties:{query:{type:`string`,minLength:1,maxLength:100,description:`A full model ID, model name, or short name such as 'luna'.`}},required:[`query`]},outputSchema={type:`object`,additionalProperties:!1,properties:{models:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{id:{type:`string`},name:{type:`string`},provider:{type:`string`}},required:[`id`,`name`,`provider`]}}},required:[`models`]};function searchGatewayModels(t,n){let r=n.trim().toLowerCase();return t.filter(t=>t.type===`language`&&(t.id===DEFAULT_AGENT_MODEL_ID||t.tags?.includes(`web-search`))&&(t.id.toLowerCase().includes(r)||t.name.toLowerCase().includes(r))).slice(0,20).map(e=>({id:e.id,name:e.name,provider:e.id.split(`/`)[0]??``}))}var search_models_default=defineTool({description:`Search the Vercel AI Gateway model catalog. Call this to list available AI Gateway models or resolve a model to its exact ID.`,inputSchema,outputSchema,async execute(e,n){if(typeof e.query!=`string`)throw Error(`Expected a model search query.`);let i=new AbortController,a=setTimeout(()=>i.abort(),5e3);try{let a=AbortSignal.any([n.abortSignal,i.signal]),o=await fetch(AI_GATEWAY_MODELS_URL,{signal:a});if(!o.ok)throw Error(`AI Gateway model catalog request failed (${o.status}).`);return{models:searchGatewayModels(parseGatewayModelCatalog(await o.json()),e.query)}}finally{clearTimeout(a)}}});export{search_models_default as default,searchGatewayModels};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type ToolContext } from "eve/tools";
|
|
2
|
+
/** Registry categories an integration search can be narrowed to. */
|
|
3
|
+
declare const CATEGORIES: readonly ["channel", "connection", "extension", "instrumentation"];
|
|
4
|
+
type Category = (typeof CATEGORIES)[number];
|
|
5
|
+
/** One catalog entry, narrowed from the published registry index. */
|
|
6
|
+
export interface CatalogEntry {
|
|
7
|
+
readonly address: string;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
readonly category?: Category;
|
|
11
|
+
readonly components?: readonly string[];
|
|
12
|
+
/** Component addresses, labels, and descriptions used to search bundles. */
|
|
13
|
+
readonly componentSearchTerms?: readonly string[];
|
|
14
|
+
readonly requires?: string;
|
|
15
|
+
/** Authored path this item installs, used to detect an existing install. */
|
|
16
|
+
readonly authoredTarget?: string;
|
|
17
|
+
/** Whether `meta.eve.setup` declares one or more setup commands. */
|
|
18
|
+
readonly declaresSetup?: boolean;
|
|
19
|
+
/** Names of environment variables the item declares. */
|
|
20
|
+
readonly envVars?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/** One row returned to the model. */
|
|
23
|
+
export interface FoundIntegration {
|
|
24
|
+
readonly address: string;
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly description?: string;
|
|
27
|
+
readonly category?: Category;
|
|
28
|
+
readonly components?: readonly string[];
|
|
29
|
+
readonly requires?: string;
|
|
30
|
+
readonly installed?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Narrows the published registry index into catalog entries.
|
|
34
|
+
*
|
|
35
|
+
* Unreadable entries are skipped rather than failing the whole search: the
|
|
36
|
+
* index is owned by the registry and may carry fields this version predates.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseRegistryIndex(value: unknown): readonly CatalogEntry[];
|
|
39
|
+
/**
|
|
40
|
+
* Filters and bounds catalog entries for one search.
|
|
41
|
+
*
|
|
42
|
+
* A bundle matches when one of its components matches the requested category,
|
|
43
|
+
* so asking for channels still surfaces `linear` (which installs a channel)
|
|
44
|
+
* instead of hiding it behind its uncategorized address.
|
|
45
|
+
*/
|
|
46
|
+
export declare function selectIntegrations(input: {
|
|
47
|
+
readonly category?: Category;
|
|
48
|
+
readonly entries: readonly CatalogEntry[];
|
|
49
|
+
readonly limit?: number;
|
|
50
|
+
readonly query?: string;
|
|
51
|
+
}): readonly FoundIntegration[];
|
|
52
|
+
export declare function selectIntegrationPage(input: {
|
|
53
|
+
readonly category?: Category;
|
|
54
|
+
readonly entries: readonly CatalogEntry[];
|
|
55
|
+
readonly limit?: number;
|
|
56
|
+
readonly offset?: number;
|
|
57
|
+
readonly query?: string;
|
|
58
|
+
}): {
|
|
59
|
+
readonly hasMore: boolean;
|
|
60
|
+
readonly items: readonly FoundIntegration[];
|
|
61
|
+
readonly nextOffset?: number;
|
|
62
|
+
readonly total: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Resolves the registry index URL, honoring the same development override the
|
|
66
|
+
* eve CLI reads.
|
|
67
|
+
*
|
|
68
|
+
* The override decides which registry the agent trusts, so it enforces the same
|
|
69
|
+
* rules as `resolveOfficialRegistryUrl` in eve's registry command: HTTP(S) only,
|
|
70
|
+
* no embedded credentials, no query or fragment. The rules are restated here
|
|
71
|
+
* rather than imported because that module reaches the registry client, which
|
|
72
|
+
* has no place in an agent runtime.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveRegistryIndexUrl(configured?: string | undefined): string;
|
|
75
|
+
/** Clears the module-level index cache. Test seam. */
|
|
76
|
+
export declare function clearRegistryIndexCache(): void;
|
|
77
|
+
export declare function loadRegistryIndex(input: {
|
|
78
|
+
readonly nowMs: number;
|
|
79
|
+
readonly signal?: AbortSignal;
|
|
80
|
+
readonly url: string;
|
|
81
|
+
}): Promise<readonly CatalogEntry[]>;
|
|
82
|
+
declare const _default: import("eve/tools").ToolDefinition<Record<string, unknown>, {
|
|
83
|
+
errors: {
|
|
84
|
+
message: string;
|
|
85
|
+
registry: string;
|
|
86
|
+
}[];
|
|
87
|
+
hasMore: boolean;
|
|
88
|
+
items: readonly FoundIntegration[];
|
|
89
|
+
nextOffset?: number;
|
|
90
|
+
total: number;
|
|
91
|
+
}> & {
|
|
92
|
+
execute(input: Record<string, unknown>, ctx: ToolContext): Promise<{
|
|
93
|
+
errors: {
|
|
94
|
+
message: string;
|
|
95
|
+
registry: string;
|
|
96
|
+
}[];
|
|
97
|
+
hasMore: boolean;
|
|
98
|
+
items: readonly FoundIntegration[];
|
|
99
|
+
nextOffset?: number;
|
|
100
|
+
total: number;
|
|
101
|
+
}>;
|
|
102
|
+
};
|
|
103
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineTool}from"eve/tools";const CATEGORIES=[`channel`,`connection`,`extension`,`instrumentation`],INDEX_PATH=`/registry.json`,FETCH_TIMEOUT_MS=1e4,inputSchema={type:`object`,additionalProperties:!1,properties:{query:{type:`string`,maxLength:200,description:`Free-text match against integration names, titles, and descriptions.`},category:{type:`string`,enum:[...CATEGORIES],description:`Restrict results to one registry category.`},limit:{type:`integer`,minimum:1,maximum:25,description:`Maximum number of items to return (default 10, maximum 25).`},offset:{type:`integer`,minimum:0,description:`Number of matching items to skip. Use nextOffset from a prior result to retrieve the next page.`}}},outputSchema={type:`object`,additionalProperties:!1,properties:{items:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{address:{type:`string`},title:{type:`string`},description:{type:`string`},category:{type:`string`},components:{type:`array`,items:{type:`string`}},requires:{type:`string`},installed:{type:`boolean`}},required:[`address`,`title`]}},errors:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{registry:{type:`string`},message:{type:`string`}},required:[`registry`,`message`]}},total:{type:`integer`},hasMore:{type:`boolean`},nextOffset:{type:`integer`}},required:[`items`,`errors`,`total`,`hasMore`]};function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function optionalString(e){return typeof e==`string`&&e.length>0?e:void 0}function isCategory(e){return CATEGORIES.includes(e)}function categoryOf(e){let t=e.split(`/`)[0];return t!==void 0&&e.includes(`/`)&&isCategory(t)?t:void 0}function titleFromAddress(e){return(e.split(`/`).at(-1)??e).split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function eveMetadata(e){let t=e.meta;if(!isRecord(t))return{};let n=t.eve;return isRecord(n)?n:{}}function componentMetadata(e){let t=e.components;if(!Array.isArray(t))return;let n=[],r=[];for(let e of t){if(!isRecord(e))continue;let t=optionalString(e.item);if(t===void 0)continue;n.push(t),r.push(t);let i=optionalString(e.label);i!==void 0&&r.push(i);let a=optionalString(e.description);a!==void 0&&r.push(a)}return n.length>0?{addresses:n,searchTerms:r}:void 0}function authoredTargetOf(e){let t=e.files;if(Array.isArray(t))for(let e of t){if(!isRecord(e))continue;let t=optionalString(e.target);if(t?.startsWith(`agent/`)===!0)return t}}function declaredEnvVars(e){let t=e.envVars;return isRecord(t)?Object.keys(t):[]}function parseRegistryIndex(e){if(!isRecord(e)||!Array.isArray(e.items))return[];let t=[];for(let n of e.items){if(!isRecord(n))continue;let e=optionalString(n.name);if(e===void 0)continue;let r=eveMetadata(n),i={address:e,title:optionalString(n.title)??titleFromAddress(e)},a=categoryOf(e);a!==void 0&&(i.category=a);let o=optionalString(n.description);o!==void 0&&(i.description=o);let s=componentMetadata(r);s!==void 0&&(i.components=s.addresses,i.componentSearchTerms=s.searchTerms);let c=optionalString(r.requires);c!==void 0&&(i.requires=c);let l=authoredTargetOf(n);l!==void 0&&(i.authoredTarget=l),r.setup!==void 0&&r.setup!==null&&(i.declaresSetup=!0);let u=declaredEnvVars(n);u.length>0&&(i.envVars=u),t.push(i)}return t}function selectIntegrations(e){return selectIntegrationPage(e).items}function selectIntegrationPage(e){let t=Math.min(Math.max(e.limit??10,1),25),n=Math.max(e.offset??0,0),r=(e.query??``).toLowerCase().split(/\s+/u).filter(e=>e.length>0),i=e.entries.map((e,t)=>{let n=`${e.address} ${e.title}`.toLowerCase();return{entry:e,haystack:[n,e.description??``,...e.componentSearchTerms??e.components??[]].join(` `).toLowerCase(),index:t,primaryTerms:n}}),a=new Map(r.map(e=>{let t=i.filter(({haystack:t})=>t.includes(e)).length;return[e,Math.log((i.length+1)/(t+1))+1]})),o=i.map(({entry:t,haystack:n,index:i,primaryTerms:o})=>{if(e.category!==void 0&&!matchesCategory(t,e.category))return;if(r.length===0)return{entry:t,index:i,score:0};let s=r.reduce((e,t)=>{let r=a.get(t)??0;return o.includes(t)?e+2*r:n.includes(t)?e+r:e},0);return s>0?{entry:t,index:i,score:s}:void 0}).filter(e=>e!==void 0).sort((e,t)=>t.score-e.score||e.index-t.index),s=(o[0]?.score??0)*.4,c=o.filter(({score:e})=>e>=s),l=c.slice(n,n+t).map(({entry:e})=>{let t={address:e.address,title:e.title};return e.category!==void 0&&(t.category=e.category),e.components!==void 0&&(t.components=e.components),e.description!==void 0&&(t.description=e.description),e.requires!==void 0&&(t.requires=e.requires),t}),u=n+l.length,d={hasMore:u<c.length,items:l,total:c.length};return u<c.length&&(d.nextOffset=u),d}function matchesCategory(e,t){return e.category===t||e.components?.some(e=>categoryOf(e)===t)===!0}function resolveRegistryIndexUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return`https://eve.dev/r${INDEX_PATH}`;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(/\/+$/u,``)}${INDEX_PATH}`,t.toString()}let cache;function clearRegistryIndexCache(){cache=void 0}async function loadRegistryIndex(e){if(cache!==void 0&&cache.url===e.url&&e.nowMs-cache.fetchedAtMs<3e5)return cache.entries;let t=await fetch(e.url,{headers:{accept:`application/json`},signal:AbortSignal.any(e.signal===void 0?[AbortSignal.timeout(FETCH_TIMEOUT_MS)]:[e.signal,AbortSignal.timeout(FETCH_TIMEOUT_MS)])});if(!t.ok)throw Error(`Could not read the eve registry (${t.status}).`);let n=parseRegistryIndex(await t.json());return cache={entries:n,fetchedAtMs:e.nowMs,url:e.url},n}async function annotateInstalled(e){let t=new Map(e.entries.flatMap(e=>e.authoredTarget===void 0?[]:[[e.address,e.authoredTarget]]));if(e.rows.every(e=>t.get(e.address)===void 0))return e.rows;let n;try{n=await e.ctx.getSandbox()}catch{return e.rows}return await Promise.all(e.rows.map(async e=>{let r=t.get(e.address);if(r===void 0)return e;let i=`/source/${r.slice(6)}`;try{let t=await n.readTextFile({path:i});return{...e,installed:t!==null}}catch{return e}}))}var search_registry_default=defineTool({description:"Search the eve registry for integrations this project can add: channels, MCP connections, extensions, and observability. Read-only — it installs nothing. Call it before writing an integration by hand, then pass an exact item address (for example `channel/slack`) to selfmod__registry_add.",inputSchema,outputSchema,async execute(e,t){let n=[],r;try{r=resolveRegistryIndexUrl()}catch(e){return{errors:[{message:errorMessage(e),registry:`eve`}],hasMore:!1,items:[],total:0}}let i=[];try{i=await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:r})}catch(e){n.push({message:errorMessage(e),registry:r})}let a={entries:i},o=typeof e.category==`string`?e.category:void 0;o!==void 0&&isCategory(o)&&(a.category=o),typeof e.limit==`number`&&(a.limit=e.limit),typeof e.offset==`number`&&(a.offset=e.offset),typeof e.query==`string`&&(a.query=e.query);let s=selectIntegrationPage(a),c={errors:n,hasMore:s.hasMore,items:await annotateInstalled({ctx:t,entries:i,rows:s.items}),total:s.total};return s.nextOffset!==void 0&&(c.nextOffset=s.nextOffset),c}});function errorMessage(e){return e instanceof Error?e.message:String(e)}export{clearRegistryIndexCache,search_registry_default as default,loadRegistryIndex,parseRegistryIndex,resolveRegistryIndexUrl,selectIntegrationPage,selectIntegrations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolve}from"node:path";async function createSelfModificationFilesystem(e){let{MountableFs:t,OverlayFs:n,ReadWriteFs:r}=e.justBash;return await e.defaultFilesystem.mkdir(`/source`,{recursive:!0}),new t({base:e.defaultFilesystem,mounts:[{filesystem:new r({allowSymlinks:!1,maxFileReadSize:2**53-1,root:resolve(e.appRoot,`agent`)}),mountPoint:`/source`},{filesystem:new n({mountPoint:`/`,readOnly:!0,root:resolve(e.appRoot,`node_modules/eve/docs`)}),mountPoint:`/eve-docs`}]})}export{createSelfModificationFilesystem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createSelfModificationFilesystem}from"./filesystem.js";import{defineSandbox}from"#public/sandbox/index.js";import{justbash}from"#public/sandbox/just-bash.js";var sandbox_default=defineSandbox({backend:justbash({filesystem:createSelfModificationFilesystem})});export{sandbox_default as default};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/** Server target used by development clients. */
|
|
2
2
|
interface DevelopmentTargetBase {
|
|
3
3
|
readonly serverUrl: string;
|
|
4
|
-
/**
|
|
4
|
+
/** Project root for shared dependencies, Vercel links, and environment files. */
|
|
5
5
|
readonly workspaceRoot: string;
|
|
6
|
+
/** The selected agent's root when it is a member of a multi-agent project. */
|
|
7
|
+
readonly agentRoot?: string;
|
|
6
8
|
}
|
|
7
9
|
/** A development client backed by a local `eve dev` server. */
|
|
8
10
|
export interface LocalDevelopmentTarget extends DevelopmentTargetBase {
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type GatewayCatalogModel } from "#shared/gateway-model-catalog.js";
|
|
2
2
|
import { type Asker, type SelectOption } from "../ask.js";
|
|
3
3
|
import type { SetupState } from "../state.js";
|
|
4
4
|
import type { SetupBox } from "../step.js";
|
|
5
|
-
|
|
6
|
-
id: z.ZodString;
|
|
7
|
-
name: z.ZodString;
|
|
8
|
-
type: z.ZodString;
|
|
9
|
-
owned_by: z.ZodString;
|
|
10
|
-
released: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
-
tags: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
12
|
-
pricing: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
13
|
-
service_tiers: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
14
|
-
}, z.core.$strip>>>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
/** One model entry from the AI Gateway catalog response. */
|
|
17
|
-
export type GatewayCatalogModel = z.infer<typeof gatewayCatalogModelSchema>;
|
|
5
|
+
export type { GatewayCatalogModel } from "#shared/gateway-model-catalog.js";
|
|
18
6
|
/** Fetches the raw AI Gateway catalog. The default for {@link SelectModelDeps}. */
|
|
19
7
|
export declare function fetchGatewayCatalog(signal?: AbortSignal): Promise<GatewayCatalogModel[]>;
|
|
20
|
-
|
|
21
|
-
* Validates a Gateway catalog response. A malformed payload throws (the
|
|
22
|
-
* picker then falls back to the static shortlist), but a malformed entry is
|
|
23
|
-
* skipped: one experimental entry shape must not take down the whole catalog.
|
|
24
|
-
*/
|
|
25
|
-
export declare function parseGatewayCatalog(input: unknown): GatewayCatalogModel[];
|
|
8
|
+
export { parseGatewayModelCatalog as parseGatewayCatalog } from "#shared/gateway-model-catalog.js";
|
|
26
9
|
/**
|
|
27
10
|
* Builds picker options from a fetched catalog, keeping the default model and
|
|
28
11
|
* filtering the rest to language models with the `web-search` tag. The curated
|
|
@@ -64,4 +47,3 @@ export interface SelectModelOptions {
|
|
|
64
47
|
* provider block from whatever model was picked here.
|
|
65
48
|
*/
|
|
66
49
|
export declare function selectModel(options: SelectModelOptions): SetupBox<SetupState, string, string>;
|
|
67
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{select}from"../ask.js";import{
|
|
1
|
+
import{select}from"../ask.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{AI_GATEWAY_MODELS_URL,vercelGatewayFetch}from"#internal/gateway.js";import{parseGatewayModelCatalog,parseGatewayModelCatalog as parseGatewayCatalog}from"#shared/gateway-model-catalog.js";function modelOption(e,t,n,r=!0){return{id:e,label:t,value:e,hint:n,featured:r||void 0}}const FEATURED_MODEL_IDS=[DEFAULT_AGENT_MODEL_ID,`anthropic/claude-opus-4.8`,`openai/gpt-5.5`],FALLBACK_MODELS=[modelOption(DEFAULT_AGENT_MODEL_ID,`GPT-5.6 Luna Fast`,`OpenAI`),modelOption(`anthropic/claude-opus-4.8`,`Claude Opus 4.8`,`Anthropic`),modelOption(`openai/gpt-5.5`,`GPT-5.5`,`OpenAI`),modelOption(`google/gemini-3.5`,`Gemini 3.5`,`Google`,!1)],PROVIDER_BRANDS={openai:`OpenAI`,zai:`Z.AI`,xai:`xAI`,deepseek:`DeepSeek`,moonshotai:`Moonshot AI`};function providerLabel(e){return e.length===0?``:PROVIDER_BRANDS[e]??e.charAt(0).toUpperCase()+e.slice(1)}async function fetchGatewayCatalog(e){let t=new AbortController,a=setTimeout(()=>t.abort(),5e3);try{let a=await vercelGatewayFetch(AI_GATEWAY_MODELS_URL,{signal:e===void 0?t.signal:AbortSignal.any([e,t.signal])});if(!a.ok)throw Error(`AI Gateway model catalog request failed (${a.status}).`);return parseGatewayModelCatalog(await a.json())}finally{clearTimeout(a)}}function featuredPriority(e){let t=FEATURED_MODEL_IDS.indexOf(e);return t===-1?FEATURED_MODEL_IDS.length:t}function modelOptionsFromCatalog(e){if(e===void 0)return FALLBACK_MODELS;let n=e.filter(e=>e.type===`language`&&(e.id===DEFAULT_AGENT_MODEL_ID||(e.tags??[]).includes(`web-search`))).map(e=>{let t=e.id.split(`/`)[0]??``;return{value:e.id,label:e.name,hint:providerLabel(t),provider:t,released:e.released}}).sort((e,t)=>{let n=featuredPriority(e.value)-featuredPriority(t.value);if(n!==0)return n;let r=(t.released??-1/0)-(e.released??-1/0);if(r!==0)return r;let i=e.label.localeCompare(t.label);return i===0?e.value.localeCompare(t.value):i});return n.length===0?FALLBACK_MODELS:n.map(({value:e,label:t,hint:n})=>({id:e,label:t,value:e,hint:n,featured:FEATURED_MODEL_IDS.includes(e)||void 0}))}async function buildModelOptions(e,t){try{return modelOptionsFromCatalog(await e(t))}catch{return t?.throwIfAborted(),FALLBACK_MODELS}}function selectModel(n){let r=n.deps??{fetchModels:fetchGatewayCatalog};return{id:`select-model`,async gather({signal:i}){let a=n.presetModel;if(a!==void 0&&a.length>0)return a;let o=await buildModelOptions(r.fetchModels,i),s=n.defaultModel!==void 0&&o.some(e=>e.value===n.defaultModel)?n.defaultModel:o.some(e=>e.value===DEFAULT_AGENT_MODEL_ID)?DEFAULT_AGENT_MODEL_ID:o[0]?.value;return n.asker.ask(select({key:`model`,message:`Which model should your agent use?`,options:o,recommended:s,required:!0,search:!0,placeholder:`type to search`}))},async perform({input:e}){return e},apply(e,t){return{...e,modelId:t}}}}export{fetchGatewayCatalog,modelOptionsFromCatalog,parseGatewayCatalog,selectModel};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{UNICODE_ROW_GLYPHS,renderCursorRow,renderOptionRow,renderOptionRowContinuation,resolveOptionRowState}from"./option-row.js";import{wrapTextWithPrefix}from"#compiled/@clack/core/index.js";const RAIL=`│`,CORNER=`└`;function bulletFor(e,t){switch(e){case`initial`:case`active`:return t.green(`△`);case`submit`:return t.green(`▲`);case`cancel`:return t.gray(`▲`);case`error`:return t.red(`▲`)}}function railFor(e,t){switch(e){case`initial`:case`active`:return t.white(`│`);case`submit`:return t.green(`│`);case`cancel`:return t.gray(`│`);case`error`:return t.red(`│`)}}function cornerFor(e,t){switch(e){case`initial`:case`active`:return t.white(`└`);case`submit`:return t.green(`└`);case`cancel`:return t.gray(`└`);case`error`:return t.red(`└`)}}function formatPromptHeader(e,t,n){return`${n.leadingRail===`green`?n.colors.green(`│`):n.colors.white(`│`)}\n${bulletFor(e,n.colors)} ${t}\n`}function formatPromptSubmission(e,t,n,r){let i=r.leadingRail===`green`?r.colors.green(`│`):r.colors.white(`│`),a=n===``?``:` ${n}`;return`${i}\n${bulletFor(e,r.colors)} ${r.colors.dim(t)}${a}`}function formatPromptOpener(e,t,n){return`\n${n.bold(n.white(`▲`))} ${n.bold(e)}\n ${n.dim(t)}\n${n.white(`│`)}\n`}function formatPromptOutro(e,t){let n=e.replace(/\n/g,`
|
|
2
2
|
`);return`${t.green(`│`)}\n${t.green(`●`)} ${n}\n`}function formatPromptCancellation(e,t){let n=e.replace(/\n/g,`
|
|
3
|
-
`);return`${t.red(`│`)}\n${t.red(`●`)} ${t.red(n)}\n`}function formatRailLine(t,n
|
|
4
|
-
`).map(
|
|
5
|
-
`)}\n`}function renderMultiselectPrompt(e){let t=railFor(e.state,e.colors),n=formatPromptHeader(e.state,e.message,{colors:e.colors,leadingRail:e.leadingRail}),r=new Set(e.selectedValues),i=e.options.some(e=>!e.disabled)?``:`\n${t}\n${t} ${e.colors.dim(`(no channels available to add)`)}`;switch(e.state){case`submit`:{let t=r.size===0?e.colors.dim(`(none selected)`):e.options.filter(e=>r.has(e.value)).map(e=>e.label).join(`, `);return formatPromptSubmission(e.state,e.message,t,{colors:e.colors,leadingRail:e.leadingRail})}case`cancel`:return`${n}${t} ${e.colors.strikethrough(e.colors.dim(`cancelled`))}\n${t}`;case`error`:{let r=renderMultiselectRows({...e,rail:t});return`${n.trim()}\n${t} ${r}${i}\n${cornerFor(e.state,e.colors)} ${e.colors.red(e.error??``)}\n`}case`initial`:case`active`:return`${n}${t} ${renderMultiselectRows({...e,rail:t})}${i}\n${cornerWithNote(cornerFor(e.state,e.colors),e.footerNote)}\n`}}function cornerWithNote(e,t){return t?`${e} ${t}`:e}function renderSelectPrompt(e){let t=railFor(e.state,e.colors),n=formatPromptHeader(e.state,e.message,{colors:e.colors,leadingRail:e.leadingRail}),r=e.options[e.cursor];switch(e.state){case`submit`:{let t=r?r.label:``;return formatPromptSubmission(e.state,e.message,t,{colors:e.colors,leadingRail:e.leadingRail})}case`cancel`:return`${n}${t} ${r?e.colors.strikethrough(e.colors.dim(r.label)):``}\n${t}`;case`initial`:case`active`:case`error`:{let r=labelColumnWidth(e.options);return`${n}${t} ${e.options.map((n,i)=>{let a=i===e.cursor;return`${optionRow(n,{colors:e.colors,isCursor:a,isChecked:!1,placeholder:!1,hintPadding:r-n.label.length})}${descriptionLine(n,a,t,e.colors)}`}).join(`\n${t} `)}\n${cornerWithNote(cornerFor(e.state,e.colors),e.footerNote)}\n`}}}function labelColumnWidth(e){return e.reduce((e,t)=>Math.max(e,t.label.length),0)}function optionRow(
|
|
3
|
+
`);return`${t.red(`│`)}\n${t.red(`●`)} ${t.red(n)}\n`}function formatRailLine(e,t,n){if(e===``)return`${t.green(`│`)}\n`;let r=`${t.green(`│`)} `;return`${e.split(`
|
|
4
|
+
`).map(e=>e===``?t.green(`│`):wrapTextWithPrefix(n,e,r)).join(`
|
|
5
|
+
`)}\n`}function renderMultiselectPrompt(e){let t=railFor(e.state,e.colors),n=formatPromptHeader(e.state,e.message,{colors:e.colors,leadingRail:e.leadingRail}),r=new Set(e.selectedValues),i=e.options.some(e=>!e.disabled)?``:`\n${t}\n${t} ${e.colors.dim(`(no channels available to add)`)}`;switch(e.state){case`submit`:{let t=r.size===0?e.colors.dim(`(none selected)`):e.options.filter(e=>r.has(e.value)).map(e=>e.label).join(`, `);return formatPromptSubmission(e.state,e.message,t,{colors:e.colors,leadingRail:e.leadingRail})}case`cancel`:return`${n}${t} ${e.colors.strikethrough(e.colors.dim(`cancelled`))}\n${t}`;case`error`:{let r=renderMultiselectRows({...e,rail:t});return`${n.trim()}\n${t} ${r}${i}\n${cornerFor(e.state,e.colors)} ${e.colors.red(e.error??``)}\n`}case`initial`:case`active`:return`${n}${t} ${renderMultiselectRows({...e,rail:t})}${i}\n${cornerWithNote(cornerFor(e.state,e.colors),e.footerNote)}\n`}}function cornerWithNote(e,t){return t?`${e} ${t}`:e}function renderSelectPrompt(e){let t=railFor(e.state,e.colors),n=formatPromptHeader(e.state,e.message,{colors:e.colors,leadingRail:e.leadingRail}),r=e.options[e.cursor];switch(e.state){case`submit`:{let t=r?r.label:``;return formatPromptSubmission(e.state,e.message,t,{colors:e.colors,leadingRail:e.leadingRail})}case`cancel`:return`${n}${t} ${r?e.colors.strikethrough(e.colors.dim(r.label)):``}\n${t}`;case`initial`:case`active`:case`error`:{let r=labelColumnWidth(e.options);return`${n}${t} ${e.options.map((n,i)=>{let a=i===e.cursor;return`${optionRow(n,{colors:e.colors,isCursor:a,isChecked:!1,placeholder:!1,hintPadding:r-n.label.length})}${descriptionLine(n,a,t,e.colors)}`}).join(`\n${t} `)}\n${cornerWithNote(cornerFor(e.state,e.colors),e.footerNote)}\n`}}}function labelColumnWidth(e){return e.reduce((e,t)=>Math.max(e,t.label.length),0)}function optionRow(t,r){return renderOptionRow({colors:r.colors,glyphs:UNICODE_ROW_GLYPHS,label:t.label,hint:t.hint,focusHint:t.focusHint,accent:t.accent,isCursor:r.isCursor,state:resolveOptionRowState(t,r.isChecked),placeholder:r.placeholder,hintPadding:r.hintPadding})}function descriptionLine(e,t,n,i){return t&&e.description&&!e.disabled?`\n${n} ${renderOptionRowContinuation(i.dim(e.description))}`:``}function renderSubmitRow(n,r,i=`Submit`){let a=r.bold(i),o=n?`${UNICODE_ROW_GLYPHS.selectedPointer} ${a}`:` ${r.dim(a)}`,s=n?``:` `;return`${renderCursorRow(o,n,r)}${s}${r.green(UNICODE_ROW_GLYPHS.success)}`}function renderMultiselectRows(e){let t=new Set(e.selectedValues),n=labelColumnWidth(e.options),r=e.options.map((r,i)=>{let a=i===e.cursor;return`${optionRow(r,{colors:e.colors,isCursor:a,isChecked:t.has(r.value),placeholder:!0,hintPadding:n-r.label.length})}${descriptionLine(r,a,e.rail,e.colors)}`}).join(`\n${e.rail} `),i=renderSubmitRow(e.cursor===e.options.length,e.colors,e.submitLabel);return`${r}\n${e.rail}\n${e.rail} ${i}`}function searchableHelpLine(e,t,n){let r=(n?[[t.cyan(`type`),`to filter`]]:[[t.cyan(`type`),`to filter`],[t.cyan(`enter`),`to select`]]).map(([e,n])=>`${e}${t.dim(` ${n}`)}`).join(t.dim(` · `));return`\n${e} ${t.dim(`(`)}${r}${t.dim(`)`)}`}function renderSearchableSelect(e){let{colors:t}=e,n=railFor(e.state,t),r=formatPromptHeader(e.state,e.message,{colors:t,leadingRail:e.leadingRail});if(e.state===`submit`)return formatPromptSubmission(e.state,e.message,e.submitDisplay,{colors:t,leadingRail:e.leadingRail});if(e.state===`cancel`)return`${r}${n} ${t.strikethrough(t.dim(e.filter))}${e.filter.trim()?`\n${n}`:``}`;let i=new Set(e.selectedValues),a=0;for(;e.options[a]?.featured;)a+=1;let o=e.viewSize??8,s=e.filter===``&&a>0?Math.min(a,o):o,c=e.multiple&&e.cursor>=e.options.length,l=!c&&e.cursor>=e.options.length?0:e.cursor,u=t.inverse(` `);e.filter.length>0?u=e.filter+t.inverse(` `):e.placeholder&&(u=t.dim(e.placeholder));let d=Math.max(0,Math.min(l-Math.floor(s/2),Math.max(0,e.options.length-s))),f=Math.min(d+s,e.options.length),p=e.options.slice(d,f),m=labelColumnWidth(p),h=p.length===0?t.dim(`(no matches)`):p.map((r,a)=>{let o=!c&&a+d===l;return`${optionRow(r,{colors:t,isCursor:o,isChecked:e.multiple&&i.has(r.value),placeholder:!1,hintPadding:m-r.label.length})}${descriptionLine(r,o,n,t)}`}).join(`\n${n} `),g=e.multiple?`\n${n}\n${n} ${renderSubmitRow(c,t,e.submitLabel)}`:``,_=e.options.length>p.length?`\n${n} ${t.dim(`↑↓ ${e.options.length} options, showing ${d+1}–${f}`)}`:``,v=searchableHelpLine(n,t,e.multiple),y=`${n} ${t.dim(` `)} ${u}\n${n} ${h}${g}${_}${v}`;return e.state===`error`?`${r.trim()}\n${y}\n${cornerFor(e.state,t)} ${t.red(e.error??``)}\n`:`${r}${y}\n${cornerWithNote(cornerFor(e.state,t),e.footerNote)}\n`}export{CORNER,RAIL,bulletFor,cornerFor,formatPromptCancellation,formatPromptHeader,formatPromptOpener,formatPromptOutro,formatPromptSubmission,formatRailLine,railFor,renderMultiselectPrompt,renderSearchableSelect,renderSelectPrompt,renderSubmitRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{renderMultiselectPrompt,renderSearchableSelect,renderSelectPrompt}from"./prompt-ui.js";import{createSelectOptionCodec}from"./select-option-codec.js";import{filterOptions,initialSelectState,orderedSelection,reduceSelect,searchActionQuery,selectValueAtCursor,submitRowIndex}from"./select-state.js";import pc from"#compiled/picocolors/index.js";import{Prompt,isCancel}from"#compiled/@clack/core/index.js";function toPromptState(e){return e}var SelectComponent=class extends Prompt{options;multiple;search;searchAction;required;filter=``;optionCursor=0;selectedSet=new Set;constructor(e){super({render:e.render,validate:()=>this.submitError()},!1),this.options=e.options,this.multiple=e.multiple,this.search=e.search,this.searchAction=e.searchAction,this.required=e.required,this.filter=e.initial.filter,this.optionCursor=e.initial.cursor,this.selectedSet=e.initial.selected,this.refreshValue(),this.on(`key`,(e,t)=>{if(this.multiple&&t?.name===`space`){this.apply({type:`toggle`});return}if(this.search){if(t?.name===`backspace`||e===``||e===`\b`){this.apply({type:`backspace`});return}e!==void 0&&e.length===1&&e>=` `&&e!==``&&this.apply({type:`char`,char:e})}}),this.on(`cursor`,e=>{e===`up`||e===`left`?this.apply({type:`up`}):(e===`down`||e===`right`)&&this.apply({type:`down`})})}visibleOptions(){return filterOptions(this.options,this.filter,this.searchAction)}onSubmitRow(){return this.multiple&&this.optionCursor===submitRowIndex(this.visibleOptions())}submitLabel(){if(this.required)return`Submit`;let e=new Set(this.options.filter(e=>e.locked).map(e=>e.value));return[...this.selectedSet].some(t=>!e.has(t))?`Submit`:`Skip`}_shouldSubmit(){return this.multiple?this.onSubmitRow()?!0:(this.apply({type:`toggle`}),!1):this.visibleOptions()[this.optionCursor]?.completed!==!0}selectedValues(){if(this.multiple)return orderedSelection(this.options,this.selectedSet);let e=selectValueAtCursor(this.visibleOptions(),this.optionCursor);return e===void 0?[]:[e]}submitDisplay(){if(this.multiple){let e=this.options.filter(e=>this.selectedSet.has(e.value)).map(e=>e.label);return e.length>0?e.join(`, `):pc.dim(`(none selected)`)}let e=selectValueAtCursor(this.visibleOptions(),this.optionCursor);return e===void 0?``:this.labelForValue(e)}labelForValue(e){let t=searchActionQuery(e);return t!==void 0&&this.searchAction!==void 0?this.searchAction.label(t):this.options.find(t=>t.value===e)?.label??e}submitError(){return this.multiple?this.required&&this.selectedSet.size===0?`Select at least one option, then press enter.`:void 0:selectValueAtCursor(this.visibleOptions(),this.optionCursor)===void 0?`Type to match an option, then press enter.`:void 0}apply(e){let t=reduceSelect({filter:this.filter,cursor:this.optionCursor,selected:this.selectedSet},e,{options:this.options,searchAction:this.searchAction,submitRow:this.multiple});this.filter=t.filter,this.optionCursor=t.cursor,this.selectedSet=t.selected,this.refreshValue()}refreshValue(){this.value=this.multiple?orderedSelection(this.options,this.selectedSet):selectValueAtCursor(this.visibleOptions(),this.optionCursor)}};function renderSelectComponent(r,i,a,o){let s=toPromptState(r.state);return r.search?renderSearchableSelect({colors:pc,state:s,leadingRail:a,message:i.message,multiple:r.multiple,filter:r.filter,placeholder:i.placeholder,options:r.visibleOptions(),cursor:r.optionCursor,selectedValues:r.selectedValues(),submitDisplay:r.submitDisplay(),footerNote:o,error:r.error,submitLabel:r.submitLabel()}):r.multiple?renderMultiselectPrompt({colors:pc,cursor:r.optionCursor,error:r.error,footerNote:o,leadingRail:a,message:i.message,options:r.options,selectedValues:r.selectedValues(),state:s,submitLabel:r.submitLabel()}):renderSelectPrompt({colors:pc,cursor:r.optionCursor,footerNote:o,leadingRail:a,message:i.message,options:r.options,state:s})}async function runSelectComponent(e){let t=createSelectOptionCodec(e.options),n=initialSelectState({options:t.options,defaultValue:e.defaultValue===void 0?void 0:t.encode(e.defaultValue),initialValues:e.initialValues?.map(e=>t.encode(e)),submitRow:e.multiple}),i,o,s=new SelectComponent({options:t.options,multiple:e.multiple,search:e.search,searchAction:e.searchAction===void 0?void 0:{label:e.searchAction.label},required:e.required,initial:n,render(){return i?renderSelectComponent(i,{message:e.message,placeholder:e.placeholder},e.leadingRail,o?.note()):``}});i=s,o=e.attachGuard?.(s);let c=await s.prompt();if(isCancel(c))return c;if(c===void 0)throw Error(`Select prompt returned no value.`);if(Array.isArray(c))return c.map(e=>t.decode(e));let l=searchActionQuery(c);return l!==void 0&&e.searchAction!==void 0?e.searchAction.value(l):t.decode(c)}export{SelectComponent,runSelectComponent};
|
|
@@ -111,7 +111,10 @@ export declare const MODEL_MENU_MESSAGE = "";
|
|
|
111
111
|
* external-provider instructions return to the menu.
|
|
112
112
|
*/
|
|
113
113
|
export declare function runModelFlow(input: {
|
|
114
|
+
/** Selected agent root whose authored model settings are edited. */
|
|
114
115
|
appRoot: string;
|
|
116
|
+
/** Project root for shared provider configuration and Vercel credentials. */
|
|
117
|
+
environmentRoot?: string;
|
|
115
118
|
prompter: Prompter;
|
|
116
119
|
/** Opens provider setup before the root menu when runtime evidence requires it. */
|
|
117
120
|
initialStep?: "provider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{withSpinner}from"../with-spinner.js";import{gatewayModelCapabilities}from"../boxes/model-capabilities.js";import{fetchGatewayCatalog,modelOptionsFromCatalog}from"../boxes/select-model.js";import{ensureChatGptAuth}from"./chatgpt-auth.js";import{WizardCancelledError}from"../step.js";import{changeAgentModelSettings,formatApplyModelSettingsOutcome}from"./model-source-change.js";import{runProviderFlow}from"./provider.js";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{inspectApplication}from"#services/inspect-application.js";import{readProviderSelection,resolveAvailableProviders,writeProviderSelection}from"#setup/provider-settings.js";import{formatModelSummary}from"#shared/model-summary.js";import{readGatewayServiceTier}from"#shared/gateway-service-tier.js";import{DEFAULT_CHATGPT_MODEL_SELECTION,isChatGptModelRouting,parseChatGptModelSelection}from"#shared/chatgpt-model.js";const MODEL_MENU_MESSAGE=``;function providerSelectionHint(t,n){return t===`chatgpt`?n===void 0?`ChatGPT subscription`:`ChatGPT subscription (${n})`:t===`ai-gateway-project`?`AI Gateway via Project`:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`}function modelListRows(e){return modelOptionsFromCatalog(e).map(e=>{let t={value:e.value,label:e.value};return e.featured===!0&&(t.featured=!0),t})}function formatModelDraftHint(e,t,n){let r={model:e};return t!==null&&(r.reasoning=t),n.kind===`priority`&&(r.fastGlyph=`↯`),formatModelSummary(r)}function modelMenuRows(e,t,n,r,i,a,o,s,c){let l;s||c?(l={value:`model`,label:`Change model`,description:s?`The model, its reasoning effort, and the Gateway service tier`:`Reasoning and service tier; the model itself is an SDK model call in agent.ts`},e!==null&&(l.hint=formatModelDraftHint(e,t,n))):l={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let d;return d=o?.kind===`external`&&!isChatGptModelRouting(o)?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:i?{value:`provider`,label:`Change provider`,hint:providerSelectionHint(r,a),description:`How your agent reaches the model provider`}:{value:`provider`,label:pc.bold(`Configure model access`),hint:pc.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`},[l,d,{value:`done`,label:`Done`}]}async function runModelFlow(e){let{appRoot:i,prompter:u,signal:f}=e,p={readCurrentModel:readCurrentAgentModel,applySettings:changeAgentModelSettings,resolveAvailableProviders,readProviderSelection,runProviderFlow,ensureChatGptAuth,writeProviderSelection,...e.deps},m
|
|
1
|
+
import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{withSpinner}from"../with-spinner.js";import{gatewayModelCapabilities}from"../boxes/model-capabilities.js";import{fetchGatewayCatalog,modelOptionsFromCatalog}from"../boxes/select-model.js";import{ensureChatGptAuth}from"./chatgpt-auth.js";import{WizardCancelledError}from"../step.js";import{changeAgentModelSettings,formatApplyModelSettingsOutcome}from"./model-source-change.js";import{runProviderFlow}from"./provider.js";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{inspectApplication}from"#services/inspect-application.js";import{readProviderSelection,resolveAvailableProviders,writeProviderSelection}from"#setup/provider-settings.js";import{formatModelSummary}from"#shared/model-summary.js";import{readGatewayServiceTier}from"#shared/gateway-service-tier.js";import{DEFAULT_CHATGPT_MODEL_SELECTION,isChatGptModelRouting,parseChatGptModelSelection}from"#shared/chatgpt-model.js";const MODEL_MENU_MESSAGE=``;function providerSelectionHint(t,n){return t===`chatgpt`?n===void 0?`ChatGPT subscription`:`ChatGPT subscription (${n})`:t===`ai-gateway-project`?`AI Gateway via Project`:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`}function modelListRows(e){return modelOptionsFromCatalog(e).map(e=>{let t={value:e.value,label:e.value};return e.featured===!0&&(t.featured=!0),t})}function formatModelDraftHint(e,t,n){let r={model:e};return t!==null&&(r.reasoning=t),n.kind===`priority`&&(r.fastGlyph=`↯`),formatModelSummary(r)}function modelMenuRows(e,t,n,r,i,a,o,s,c){let l;s||c?(l={value:`model`,label:`Change model`,description:s?`The model, its reasoning effort, and the Gateway service tier`:`Reasoning and service tier; the model itself is an SDK model call in agent.ts`},e!==null&&(l.hint=formatModelDraftHint(e,t,n))):l={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let d;return d=o?.kind===`external`&&!isChatGptModelRouting(o)?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:i?{value:`provider`,label:`Change provider`,hint:providerSelectionHint(r,a),description:`How your agent reaches the model provider`}:{value:`provider`,label:pc.bold(`Configure model access`),hint:pc.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`},[l,d,{value:`done`,label:`Done`}]}async function runModelFlow(e){let{appRoot:i,prompter:u,signal:f}=e,p=e.environmentRoot??i,m={readCurrentModel:readCurrentAgentModel,applySettings:changeAgentModelSettings,resolveAvailableProviders,readProviderSelection,runProviderFlow,ensureChatGptAuth,writeProviderSelection,...e.deps},h=m.selectModel?.fetchModels??fetchGatewayCatalog,[g,_,v,y]=await withSpinner(u,`Checking the project…`,()=>Promise.all([m.readCurrentModel(i),m.resolveAvailableProviders(p,f===void 0?{env:process.env}:{signal:f,env:process.env}),m.readProviderSelection(p),h(f).catch(()=>void 0)]));f?.throwIfAborted();let{id:b,routing:x,serviceTier:S,editable:C,settingsEditable:w}=g,T=g.reasoning===`provider-default`?null:g.reasoning,E=v??(_.includes(`ai-gateway-key`)?`ai-gateway-key`:`ai-gateway-project`),D=_.includes(E),O,k={model:{kind:`keep`},reasoning:{kind:`keep`},gatewayServiceTier:{kind:`keep`}},A,j,M=!1,N=!1,P=!1,F=x?.kind===`external`&&!isChatGptModelRouting(x),I=F?{tone:`warning`,text:"`agent.ts` specifies the model provider directly. Model, provider, and service-tier changes stay source-owned; reasoning remains configurable here."}:void 0,L=!D&&x?.kind!==`external`?`provider`:C||w?`model`:`provider`,R=x?.kind!==`external`&&(e.initialStep===`provider`||!D);for(;;){let t;if(R)R=!1,t=`provider`;else try{t=await u.select({message:``,options:modelMenuRows(b,T,isChatGptModelRouting(x)?{kind:`standard`}:S,E,D,e.chatGptAccountLabel,x,C,w),hintLayout:`stacked`,initialValue:L,notices:I===void 0?[]:[I]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;if(hasModelSettingsChanges(k))return{kind:`cancelled`,discardedDraft:!0};break}if(t===`done`){N=!0,P=!0;break}if(t===`model`){let e=m.pickModelSettings;if(e===void 0)throw Error(`runModelFlow requires a pickModelSettings dep to open the model screen.`);let t=await e({model:C?{kind:`pick`,options:modelListRows(y),current:b}:{kind:`fixed`,current:b,reason:`Set via an SDK model call in agent.ts; edit the source to change it`},reasoning:T,serviceTier:isChatGptModelRouting(x)?{kind:`standard`}:S,settingsEditable:w,externalRouting:F,capabilitiesFor:e=>gatewayModelCapabilities(y,e)});if(f?.throwIfAborted(),t===void 0){L=`model`;continue}t.model!==void 0&&(b=t.model,x=routingForModelSelection(t.model),k.model={kind:`set`,value:t.model}),t.reasoning!==void 0&&(T=t.reasoning==="default"?null:t.reasoning,k.reasoning=T===null?{kind:`remove`}:{kind:`set`,value:T}),t.serviceTier!==void 0&&!isChatGptModelRouting(x)&&(S=t.serviceTier===`priority`?{kind:`priority`}:{kind:`standard`},k.gatewayServiceTier=t.serviceTier===`priority`?{kind:`set`,value:`priority`}:{kind:`remove`}),L=`done`;continue}let r=await m.runProviderFlow({appRoot:p,prompter:u,signal:f,availableProviders:_,selectedProvider:E});if(r.kind===`cancelled`){if(f?.aborted)return{kind:`cancelled`};L=`provider`;continue}if(r.kind===`external-provider`){if(f?.aborted)return{kind:`cancelled`};L=`done`;continue}O=r.kind,O===`chatgpt`?(M=!0,isChatGptModelRouting(x)||(k.model={kind:`set`,value:DEFAULT_CHATGPT_MODEL_SELECTION},k.gatewayServiceTier={kind:`remove`})):isChatGptModelRouting(x)&&(k.model={kind:`set`,value:DEFAULT_AGENT_MODEL_ID}),P=!0;break}let z=k.model.kind===`set`&&parseChatGptModelSelection(k.model.value)!==void 0;if(P&&z&&(k.gatewayServiceTier={kind:`remove`},M=!0),P&&M&&await authenticateChatGpt(m,e.withExclusiveTerminal),P&&hasModelSettingsChanges(k)&&(A=await m.applySettings({appRoot:i,patch:k})),P&&O!==void 0&&A?.kind!==`rejected`&&(await m.writeProviderSelection(p,O),j=O),A!==void 0&&j===void 0&&f?.throwIfAborted(),A===void 0&&j===void 0&&!M)return N?{kind:`done`,accessChanged:!1}:{kind:`cancelled`};let B={kind:`done`,accessChanged:A?.kind===`changed`||j!==void 0||M};return A===void 0?M&&(B.modelMessage=`ChatGPT login ready.`):B.modelMessage=formatApplyModelSettingsOutcome(A),j!==void 0&&(B.providerSelection=j),B}function routingForModelSelection(e){return parseChatGptModelSelection(e)===void 0?{kind:`gateway`,target:e.split(`/`)[0]??``}:{kind:`external`,provider:`codex`}}async function authenticateChatGpt(e,t){let authenticate=()=>e.ensureChatGptAuth();await(t===void 0?authenticate():t(authenticate))}function hasModelSettingsChanges(e){return e.model.kind!==`keep`||e.reasoning.kind!==`keep`||e.gatewayServiceTier.kind!==`keep`}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config,r=n?.model,i=isChatGptModelRouting(r?.routing);return{id:i&&r!==void 0?`chatgpt/${r.id}`:r?.id??null,routing:r?.routing??null,reasoning:n?.reasoning??null,serviceTier:readGatewayServiceTier(r?.providerOptions),editable:r!==void 0&&(r.source===void 0||i),settingsEditable:n?.source!==void 0}}catch{return{id:null,routing:null,reasoning:null,serviceTier:{kind:`standard`},editable:!1,settingsEditable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,modelChangeRefusalForUneditableModel,runModelFlow};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{configureDiscordInteractionsEndpoint,registerDiscordCommand,resolveDiscordApplication}from"./api.js";import{provisionDiscordConnector}from"./connect.js";import{defineSetupIntegration}from"../types.js";import{join}from"node:path";import{deriveSlackConnectorSlug}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{configureDiscordInteractionsEndpoint,registerDiscordCommand,resolveDiscordApplication}from"./api.js";import{provisionDiscordConnector}from"./connect.js";import{defineSetupIntegration}from"../types.js";import{join}from"node:path";import{deriveSlackConnectorSlug}from"#setup/scaffold/index.js";import{writeTextFile}from"#setup/scaffold/files.js";import{text}from"#setup/ask.js";const defaultDeps={configureEndpoint:configureDiscordInteractionsEndpoint,deriveConnectorSlug:deriveSlackConnectorSlug,provisionConnector:provisionDiscordConnector,registerCommand:registerDiscordCommand,resolveApplication:resolveDiscordApplication,writeTextFile};function validateCommandName(e){let t=e.trim();return t?t.length>32?`Command name must be 32 characters or fewer.`:/^[a-z0-9_-]+$/.test(t)?null:`Use lowercase letters, numbers, hyphens, or underscores.`:`Command name is required.`}function connectTemplate(e){return`import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
2
2
|
import { discordChannel } from "eve/channels/discord";
|
|
3
3
|
|
|
4
4
|
export default discordChannel({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{captureVercel}from"#setup/primitives/run-vercel.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";const FILE_MEMORY_BLOB_PREFIX=`EVE_MEMORY_`,FILE_MEMORY_BLOB_ENVIRONMENTS=[`production`,`preview`,`development`],ProjectSchema=z.object({id:z.string().min(1),name:z.string().min(1),resourceConfig:z.object({functionDefaultRegions:z.array(z.string().min(1)).optional()}).optional(),defaultResourceConfig:z.object({functionDefaultRegions:z.array(z.string().min(1)).optional()}).optional()}).passthrough(),StoreReferenceSchema=z.object({id:z.string().min(1),name:z.string().min(1),projects:z.array(z.object({id:z.string().min(1),name:z.string().min(1)}).passthrough()).default([]),region:z.string().min(1).optional()}).passthrough(),StoreSchema=z.object({access:z.enum([`private`,`public`]),id:z.string().min(1),name:z.string().min(1),region:z.string().min(1),type:z.string().optional()}).passthrough(),StoreConnectionSchema=z.object({envVarEnvironments:z.array(z.string()).default([]),envVarPrefix:z.string().nullish(),id:z.string().optional(),projectId:z.string().min(1)}).passthrough();function parseJson(e,t,n){try{return t.parse(JSON.parse(e))}catch{throw Error(`Vercel returned invalid ${n} data. Upgrade the Vercel CLI and try again.`)}}function commandFailure(e,t){let n=[t.failure.stderr,t.failure.stdout,t.failure.message].find(e=>e.trim().length>0);return Error(n===void 0?`${e} failed.`:`${e} failed: ${n.trim()}`)}function createFileMemoryVercelClient(e){let n={cwd:e.appRoot,nonInteractive:!0,onOutput:e.onOutput,signal:e.signal},i=[`--scope`,e.project.orgId];async function captureJson(t,i,a,o){let s=await captureVercel(t,{...n,stdin:o});if(e.signal?.throwIfAborted(),!s.ok)throw commandFailure(a,s);return parseJson(s.stdout,i,a.toLowerCase())}async function captureMutation(t,i){let a=await captureVercel(t,n);if(e.signal?.throwIfAborted(),!a.ok)throw commandFailure(i,a)}return{async createStore({name:e,region:n}){return(await captureJson([`api`,`/v1/storage/stores/blob`,`-X`,`POST`,`--input`,`-`,`--raw`,...i],z.object({store:StoreSchema}),`Vercel Blob store creation`,JSON.stringify({access:`private`,name:e,region:n}))).store},async connectStore({environments:e,prefix:t,projectId:n,storeName:r}){await captureMutation([`integration-resource`,`connect`,r,n,`--prefix`,t,...e.flatMap(e=>[`--environment`,e]),`--yes`,`--json`,...i],`Vercel Blob project connection`)},async getConnections(e){return(await captureJson([`api`,`/v1/storage/stores/${encodeURIComponent(e)}/connections`,`--raw`,...i],z.object({connections:z.array(StoreConnectionSchema)}),`Vercel Blob connections lookup`)).connections},async getProject(){return await captureJson([`api`,`/v9/projects/${encodeURIComponent(e.project.projectId)}?teamId=${encodeURIComponent(e.project.orgId)}`,`--raw`,...i],ProjectSchema,`Vercel project lookup`)},async getStore(e){return(await captureJson([`api`,`/v1/storage/stores/${encodeURIComponent(e)}`,`--raw`,...i],z.object({store:StoreSchema}),`Vercel Blob store lookup`)).store},async listStores(){return(await captureJson([`blob`,`list-stores`,`--all`,`--json`,...i],z.object({stores:z.array(StoreReferenceSchema)}),`Vercel Blob stores lookup`)).stores},async pullEnvironment(){await captureMutation([`env`,`pull`,`.env.local`,`--yes`,`--project`,e.project.projectId,...i],`Vercel environment pull`)}}}function resolveFileMemoryRegion(e){return e.localRegions?.[0]??e.project.resourceConfig?.functionDefaultRegions?.[0]??e.project.defaultResourceConfig?.functionDefaultRegions?.[0]??`iad1`}function fileMemoryStoreName(e,t){let n=e.toLowerCase().replace(/[^a-z0-9]+/gu,`-`).replace(/^-+|-+$/gu,``)||`project`,r=t.toLowerCase().replace(/[^a-z0-9]+/gu,``).slice(-8)||`memory`,i=12+r.length;return`eve-memory-${n.slice(0,64-i).replace(/-+$/gu,``)}-${r}`}async function readLocalRegions(r){try{let i=await readFile(join(r,`vercel.json`),`utf8`),a=z.object({regions:z.array(z.string().min(1)).optional()}).safeParse(JSON.parse(i));if(!a.success)throw Error("vercel.json has an invalid `regions` value.");return a.data.regions}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e instanceof SyntaxError?Error(`vercel.json contains invalid JSON.`):e}}function hasProject(e,t){return e.projects.some(e=>e.id===t)}function exactConnection(e,t){return e.projectId===t&&e.envVarPrefix===`EVE_MEMORY_`}function isEveMemoryConnection(e,t){return e.projectId===t&&e.envVarPrefix?.startsWith(`EVE_MEMORY_`)===!0}function assertPrivateBlobStore(e){if(e.type!==void 0&&e.type!==`blob`)throw Error(`Vercel resource "${e.name}" uses the eve file-memory prefix but is not a Blob store. Disconnect that binding before retrying.`);if(e.access!==`private`)throw Error(`Vercel Blob store "${e.name}" is public. Disconnect an eve-prefixed binding or choose a private store before retrying; eve will not replace it automatically.`)}function assertCompleteConnection(e,t){if(FILE_MEMORY_BLOB_ENVIRONMENTS.filter(t=>!e.envVarEnvironments.includes(t)).length>0)throw Error(`Vercel Blob store "${t}" has an incomplete ${FILE_MEMORY_BLOB_PREFIX} connection. Reconnect it for production, preview, and development before retrying; eve will not disconnect or replace it automatically.`)}async function inspectStore(e,t){let[n,r]=await Promise.all([t.getStore(e.id),t.getConnections(e.id)]);return{connections:r,store:n}}async function prepareFileMemoryBlob(e){let t=e.client??createFileMemoryVercelClient({appRoot:e.appRoot,project:e.project,signal:e.signal}),[n,r,i]=await Promise.all([t.getProject(),e.localRegions?.()??readLocalRegions(e.appRoot),t.listStores()]);if(e.signal?.throwIfAborted(),n.id!==e.project.projectId)throw Error(`Vercel returned project "${n.id}" while file-memory setup expected "${e.project.projectId}". Relink the project and retry.`);let a=resolveFileMemoryRegion({localRegions:r,project:n}),s=fileMemoryStoreName(n.name,n.id),c=i.filter(t=>t.name===s||hasProject(t,e.project.projectId)),l=await Promise.all(c.map(async e=>await inspectStore(e,t))),u=l.flatMap(t=>t.connections.filter(t=>exactConnection(t,e.project.projectId)).map(e=>({candidate:t,connection:e})));if(u.length>1)throw Error(`Multiple Vercel Blob connections target project "${n.name}" with prefix ${FILE_MEMORY_BLOB_PREFIX}. Disconnect the extra binding before retrying.`);if(u.length===1){let t=u[0];if(t===void 0)throw Error(`Expected an eve file-memory Blob store.`);let{candidate:r,connection:i}=t;assertPrivateBlobStore(r.store),assertCompleteConnection(i,r.store.name);let o=r.store.region===a?void 0:`The existing file-memory store remains in ${r.store.region}; the project now prefers ${a}. eve preserved the store to avoid memory loss.`;return{action:`reuse`,project:e.project,projectName:n.name,region:r.store.region,regionWarning:o,storeId:r.store.id,storeName:r.store.name}}let d=l.find(({connections:t})=>t.some(t=>isEveMemoryConnection(t,e.project.projectId)));if(d!==void 0)throw Error(`Vercel resource "${d.store.name}" has an incompatible eve file-memory prefix. Disconnect it before retrying; eve will not change an ambiguous binding automatically.`);let f=l.filter(({store:e})=>e.name===s);if(f.length>1)throw Error(`Multiple Vercel Blob stores match the expected file-memory name "${s}". Rename or remove the duplicate before retrying.`);if(f.length===1){let t=f[0];if(t===void 0)throw Error(`Expected a file-memory Blob store candidate.`);if(assertPrivateBlobStore(t.store),t.store.region!==a)throw Error(`Unconnected Vercel Blob store "${s}" is in ${t.store.region}, but project "${n.name}" uses ${a}. Rename that store or connect it manually; eve will not replace it automatically.`);if(t.connections.length>0)throw Error(`Vercel Blob store "${s}" already has a project connection, so eve cannot safely adopt it. Disconnect it or choose a different store before retrying.`);return{action:`repair`,project:e.project,projectName:n.name,region:a,storeId:t.store.id,storeName:s}}return{action:`create`,project:e.project,projectName:n.name,region:a,storeName:s}}async function verifyFileMemoryBlob(e,t,n){let[r,i]=await Promise.all([n.getStore(t),n.getConnections(t)]);if(assertPrivateBlobStore(r),r.name!==e.storeName)throw Error(`Vercel connected an unexpected Blob store named "${r.name}".`);if(r.region!==e.region)throw Error(`Vercel Blob store "${r.name}" is in ${r.region}, but setup expected ${e.region}.`);let a=i.filter(t=>exactConnection(t,e.project.projectId));if(a.length!==1)throw Error(`Vercel Blob store "${r.name}" does not have exactly one ${FILE_MEMORY_BLOB_PREFIX} connection to project "${e.projectName}".`);let s=a[0];if(s===void 0)throw Error(`Expected a verified eve file-memory connection.`);return assertCompleteConnection(s,r.name),r}async function applyFileMemoryBlob(e){let t=createPromptCommandOutput(e.log),n=e.client??createFileMemoryVercelClient({appRoot:e.appRoot,onOutput:t,project:e.plan.project,signal:e.signal}),r=e.plan.storeId;if(e.plan.action===`create`){let t=await withPhase(e.log,`Creating private Vercel Blob store...`,async()=>await n.createStore({name:e.plan.storeName,region:e.plan.region}));if(assertPrivateBlobStore(t),t.name!==e.plan.storeName||t.region!==e.plan.region)throw Error(`Vercel created Blob store "${t.name}" in ${t.region}, but setup expected "${e.plan.storeName}" in ${e.plan.region}.`);r=t.id}if(r===void 0)throw Error(`File-memory Blob setup did not resolve a store ID.`);e.plan.action!==`reuse`&&await withPhase(e.log,`Connecting file memory to the Vercel project...`,async()=>await n.connectStore({environments:FILE_MEMORY_BLOB_ENVIRONMENTS,prefix:FILE_MEMORY_BLOB_PREFIX,projectId:e.plan.project.projectId,storeName:e.plan.storeName})),await withPhase(e.log,`Pulling Vercel environment variables...`,async()=>await n.pullEnvironment());let c=await withPhase(e.log,`Verifying file-memory storage...`,async()=>await verifyFileMemoryBlob(e.plan,r,n));return{action:e.plan.action,store:c}}export{FILE_MEMORY_BLOB_ENVIRONMENTS,FILE_MEMORY_BLOB_PREFIX,applyFileMemoryBlob,createFileMemoryVercelClient,fileMemoryStoreName,prepareFileMemoryBlob,resolveFileMemoryRegion};
|
|
1
|
+
import{readFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{captureVercel}from"#setup/primitives/run-vercel.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";const FILE_MEMORY_BLOB_PREFIX=`EVE_MEMORY_`,FILE_MEMORY_BLOB_ENVIRONMENTS=[`production`,`preview`,`development`],ProjectSchema=z.object({id:z.string().min(1),name:z.string().min(1),resourceConfig:z.object({functionDefaultRegions:z.array(z.string().min(1)).optional()}).optional(),defaultResourceConfig:z.object({functionDefaultRegions:z.array(z.string().min(1)).optional()}).optional()}).passthrough(),StoreReferenceSchema=z.object({id:z.string().min(1),name:z.string().min(1),projects:z.array(z.object({id:z.string().min(1),name:z.string().min(1)}).passthrough()).default([]),region:z.string().min(1).optional()}).passthrough(),StoreSchema=z.object({access:z.enum([`private`,`public`]),id:z.string().min(1),name:z.string().min(1),region:z.string().min(1),type:z.string().optional()}).passthrough(),StoreConnectionSchema=z.object({envVarEnvironments:z.array(z.string()).default([]),envVarPrefix:z.string().nullish(),id:z.string().optional(),projectId:z.string().min(1)}).passthrough();function parseJson(e,t,n){try{return t.parse(JSON.parse(e))}catch{throw Error(`Vercel returned invalid ${n} data. Upgrade the Vercel CLI and try again.`)}}function commandFailure(e,t){let n=[t.failure.stderr,t.failure.stdout,t.failure.message].find(e=>e.trim().length>0);return Error(n===void 0?`${e} failed.`:`${e} failed: ${n.trim()}`)}function createFileMemoryVercelClient(e){let n={cwd:e.appRoot,nonInteractive:!0,onOutput:e.onOutput,signal:e.signal},i=[`--scope`,e.project.orgId];async function captureJson(t,i,a,o){let s=await captureVercel(t,{...n,stdin:o});if(e.signal?.throwIfAborted(),!s.ok)throw commandFailure(a,s);return parseJson(s.stdout,i,a.toLowerCase())}async function captureMutation(t,i){let a=await captureVercel(t,n);if(e.signal?.throwIfAborted(),!a.ok)throw commandFailure(i,a)}return{async createStore({name:e,region:n}){return(await captureJson([`api`,`/v1/storage/stores/blob`,`-X`,`POST`,`--input`,`-`,`--raw`,...i],z.object({store:StoreSchema}),`Vercel Blob store creation`,JSON.stringify({access:`private`,name:e,region:n}))).store},async connectStore({environments:e,prefix:t,projectId:n,storeName:r}){await captureMutation([`integration-resource`,`connect`,r,n,`--prefix`,t,...e.flatMap(e=>[`--environment`,e]),`--yes`,...i],`Vercel Blob project connection`)},async getConnections(e){return(await captureJson([`api`,`/v1/storage/stores/${encodeURIComponent(e)}/connections`,`--raw`,...i],z.object({connections:z.array(StoreConnectionSchema)}),`Vercel Blob connections lookup`)).connections},async getProject(){return await captureJson([`api`,`/v9/projects/${encodeURIComponent(e.project.projectId)}?teamId=${encodeURIComponent(e.project.orgId)}`,`--raw`,...i],ProjectSchema,`Vercel project lookup`)},async getStore(e){return(await captureJson([`api`,`/v1/storage/stores/${encodeURIComponent(e)}`,`--raw`,...i],z.object({store:StoreSchema}),`Vercel Blob store lookup`)).store},async listStores(){return(await captureJson([`blob`,`list-stores`,`--all`,`--json`,...i],z.object({stores:z.array(StoreReferenceSchema)}),`Vercel Blob stores lookup`)).stores},async pullEnvironment(){await captureMutation([`env`,`pull`,`.env.local`,`--yes`,`--project`,e.project.projectId,...i],`Vercel environment pull`)}}}function resolveFileMemoryRegion(e){return e.localRegions?.[0]??e.project.resourceConfig?.functionDefaultRegions?.[0]??e.project.defaultResourceConfig?.functionDefaultRegions?.[0]??`iad1`}function fileMemoryStoreName(e,t){let n=e.toLowerCase().replace(/[^a-z0-9]+/gu,`-`).replace(/^-+|-+$/gu,``)||`project`,r=t.toLowerCase().replace(/[^a-z0-9]+/gu,``).slice(-8)||`memory`,i=12+r.length;return`eve-memory-${n.slice(0,64-i).replace(/-+$/gu,``)}-${r}`}async function readLocalRegions(r){try{let i=await readFile(join(r,`vercel.json`),`utf8`),a=z.object({regions:z.array(z.string().min(1)).optional()}).safeParse(JSON.parse(i));if(!a.success)throw Error("vercel.json has an invalid `regions` value.");return a.data.regions}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e instanceof SyntaxError?Error(`vercel.json contains invalid JSON.`):e}}function hasProject(e,t){return e.projects.some(e=>e.id===t)}function exactConnection(e,t){return e.projectId===t&&e.envVarPrefix===`EVE_MEMORY_`}function isEveMemoryConnection(e,t){return e.projectId===t&&e.envVarPrefix?.startsWith(`EVE_MEMORY_`)===!0}function assertPrivateBlobStore(e){if(e.type!==void 0&&e.type!==`blob`)throw Error(`Vercel resource "${e.name}" uses the eve file-memory prefix but is not a Blob store. Disconnect that binding before retrying.`);if(e.access!==`private`)throw Error(`Vercel Blob store "${e.name}" is public. Disconnect an eve-prefixed binding or choose a private store before retrying; eve will not replace it automatically.`)}function assertCompleteConnection(e,t){if(FILE_MEMORY_BLOB_ENVIRONMENTS.filter(t=>!e.envVarEnvironments.includes(t)).length>0)throw Error(`Vercel Blob store "${t}" has an incomplete ${FILE_MEMORY_BLOB_PREFIX} connection. Reconnect it for production, preview, and development before retrying; eve will not disconnect or replace it automatically.`)}async function inspectStore(e,t){let[n,r]=await Promise.all([t.getStore(e.id),t.getConnections(e.id)]);return{connections:r,store:n}}async function prepareFileMemoryBlob(e){let t=e.client??createFileMemoryVercelClient({appRoot:e.appRoot,project:e.project,signal:e.signal}),[n,r,i]=await Promise.all([t.getProject(),e.localRegions?.()??readLocalRegions(e.appRoot),t.listStores()]);if(e.signal?.throwIfAborted(),n.id!==e.project.projectId)throw Error(`Vercel returned project "${n.id}" while file-memory setup expected "${e.project.projectId}". Relink the project and retry.`);let a=resolveFileMemoryRegion({localRegions:r,project:n}),s=fileMemoryStoreName(n.name,n.id),c=i.filter(t=>t.name===s||hasProject(t,e.project.projectId)),l=await Promise.all(c.map(async e=>await inspectStore(e,t))),u=l.flatMap(t=>t.connections.filter(t=>exactConnection(t,e.project.projectId)).map(e=>({candidate:t,connection:e})));if(u.length>1)throw Error(`Multiple Vercel Blob connections target project "${n.name}" with prefix ${FILE_MEMORY_BLOB_PREFIX}. Disconnect the extra binding before retrying.`);if(u.length===1){let t=u[0];if(t===void 0)throw Error(`Expected an eve file-memory Blob store.`);let{candidate:r,connection:i}=t;assertPrivateBlobStore(r.store),assertCompleteConnection(i,r.store.name);let o=r.store.region===a?void 0:`The existing file-memory store remains in ${r.store.region}; the project now prefers ${a}. eve preserved the store to avoid memory loss.`;return{action:`reuse`,project:e.project,projectName:n.name,region:r.store.region,regionWarning:o,storeId:r.store.id,storeName:r.store.name}}let d=l.find(({connections:t})=>t.some(t=>isEveMemoryConnection(t,e.project.projectId)));if(d!==void 0)throw Error(`Vercel resource "${d.store.name}" has an incompatible eve file-memory prefix. Disconnect it before retrying; eve will not change an ambiguous binding automatically.`);let f=l.filter(({store:e})=>e.name===s);if(f.length>1)throw Error(`Multiple Vercel Blob stores match the expected file-memory name "${s}". Rename or remove the duplicate before retrying.`);if(f.length===1){let t=f[0];if(t===void 0)throw Error(`Expected a file-memory Blob store candidate.`);if(assertPrivateBlobStore(t.store),t.store.region!==a)throw Error(`Unconnected Vercel Blob store "${s}" is in ${t.store.region}, but project "${n.name}" uses ${a}. Rename that store or connect it manually; eve will not replace it automatically.`);if(t.connections.length>0)throw Error(`Vercel Blob store "${s}" already has a project connection, so eve cannot safely adopt it. Disconnect it or choose a different store before retrying.`);return{action:`repair`,project:e.project,projectName:n.name,region:a,storeId:t.store.id,storeName:s}}return{action:`create`,project:e.project,projectName:n.name,region:a,storeName:s}}async function verifyFileMemoryBlob(e,t,n){let[r,i]=await Promise.all([n.getStore(t),n.getConnections(t)]);if(assertPrivateBlobStore(r),r.name!==e.storeName)throw Error(`Vercel connected an unexpected Blob store named "${r.name}".`);if(r.region!==e.region)throw Error(`Vercel Blob store "${r.name}" is in ${r.region}, but setup expected ${e.region}.`);let a=i.filter(t=>exactConnection(t,e.project.projectId));if(a.length!==1)throw Error(`Vercel Blob store "${r.name}" does not have exactly one ${FILE_MEMORY_BLOB_PREFIX} connection to project "${e.projectName}".`);let s=a[0];if(s===void 0)throw Error(`Expected a verified eve file-memory connection.`);return assertCompleteConnection(s,r.name),r}async function applyFileMemoryBlob(e){let t=createPromptCommandOutput(e.log),n=e.client??createFileMemoryVercelClient({appRoot:e.appRoot,onOutput:t,project:e.plan.project,signal:e.signal}),r=e.plan.storeId;if(e.plan.action===`create`){let t=await withPhase(e.log,`Creating private Vercel Blob store...`,async()=>await n.createStore({name:e.plan.storeName,region:e.plan.region}));if(assertPrivateBlobStore(t),t.name!==e.plan.storeName||t.region!==e.plan.region)throw Error(`Vercel created Blob store "${t.name}" in ${t.region}, but setup expected "${e.plan.storeName}" in ${e.plan.region}.`);r=t.id}if(r===void 0)throw Error(`File-memory Blob setup did not resolve a store ID.`);e.plan.action!==`reuse`&&await withPhase(e.log,`Connecting file memory to the Vercel project...`,async()=>await n.connectStore({environments:FILE_MEMORY_BLOB_ENVIRONMENTS,prefix:FILE_MEMORY_BLOB_PREFIX,projectId:e.plan.project.projectId,storeName:e.plan.storeName})),await withPhase(e.log,`Pulling Vercel environment variables...`,async()=>await n.pullEnvironment());let c=await withPhase(e.log,`Verifying file-memory storage...`,async()=>await verifyFileMemoryBlob(e.plan,r,n));return{action:e.plan.action,store:c}}export{FILE_MEMORY_BLOB_ENVIRONMENTS,FILE_MEMORY_BLOB_PREFIX,applyFileMemoryBlob,createFileMemoryVercelClient,fileMemoryStoreName,prepareFileMemoryBlob,resolveFileMemoryRegion};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{defineSetupIntegration}from"../types.js";import{attachLinearConnector,findLinearConnector,provisionLinearConnector}from"./connect.js";import{join}from"node:path";import{deriveSlackConnectorSlug,normalizeSlackConnectorSlug}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{defineSetupIntegration}from"../types.js";import{attachLinearConnector,findLinearConnector,provisionLinearConnector}from"./connect.js";import{join}from"node:path";import{deriveSlackConnectorSlug,normalizeSlackConnectorSlug}from"#setup/scaffold/index.js";import{writeTextFile}from"#setup/scaffold/files.js";import{WizardCancelledError}from"#setup/step.js";import{select,text}from"#setup/ask.js";const defaultDeps={attachConnector:attachLinearConnector,deriveConnectorSlug:deriveSlackConnectorSlug,findConnector:findLinearConnector,provisionConnector:provisionLinearConnector,writeTextFile};function linearSafeConnectorSlug(e){return normalizeSlackConnectorSlug(e.replaceAll(/linear/gi,``).replace(/[-_]{2,}/g,`-`)||`agent`)}function connectTemplate(e){return`import { connectLinearCredentials } from "@vercel/connect/eve";
|
|
2
2
|
import { linearChannel } from "eve/channels/linear";
|
|
3
3
|
|
|
4
4
|
export default linearChannel({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{defineSetupIntegration}from"../types.js";import{provisionLinqConnector}from"./connect.js";import{listLinqPhoneNumbers}from"./management.js";import{join}from"node:path";import{deriveSlackConnectorSlug}from"#setup/scaffold/index.js";import{
|
|
1
|
+
import{defineSetupIntegration}from"../types.js";import{provisionLinqConnector}from"./connect.js";import{listLinqPhoneNumbers}from"./management.js";import{join}from"node:path";import{deriveSlackConnectorSlug}from"#setup/scaffold/index.js";import{writeTextFile}from"#setup/scaffold/files.js";import{select,text}from"#setup/ask.js";import{appendEnv}from"#setup/append-env.js";const defaultDeps={listPhoneNumbers:listLinqPhoneNumbers};function connectTemplate(e){return`import { connectLinqCredentials } from "@vercel/connect/eve";
|
|
2
2
|
import { linqChannel } from "eve/channels/linq";
|
|
3
3
|
|
|
4
4
|
export default linqChannel({
|
|
5
5
|
credentials: connectLinqCredentials(${JSON.stringify(e)}),
|
|
6
6
|
});
|
|
7
|
-
`}async function prepareLinqSetup(e,t=defaultDeps){let n=await e.asker.ask(select({key:`linq-credentials`,message:`How would you like to configure Linq?`,options:[{id:`connect`,value:`connect`,label:`Set up Vercel Connect`,hint:`Provision a managed Linq line`},{id:`portable`,value:`portable`,label:`Use portable credentials`,hint:`Register the webhook in Linq`}],recommended:e.environment.vercel.kind===`available`?`connect`:`portable`,required:!0}));if(n===`connect`){if(e.environment.vercel.kind===`unavailable`)throw Error("Vercel Connect requires an authenticated Vercel CLI. Run `vercel login`, then retry Linq setup.");let r=await e.resolveVercelProject(`Linq`),
|
|
7
|
+
`}async function prepareLinqSetup(e,t=defaultDeps){let n=await e.asker.ask(select({key:`linq-credentials`,message:`How would you like to configure Linq?`,options:[{id:`connect`,value:`connect`,label:`Set up Vercel Connect`,hint:`Provision a managed Linq line`},{id:`portable`,value:`portable`,label:`Use portable credentials`,hint:`Register the webhook in Linq`}],recommended:e.environment.vercel.kind===`available`?`connect`:`portable`,required:!0}));if(n===`connect`){if(e.environment.vercel.kind===`unavailable`)throw Error("Vercel Connect requires an authenticated Vercel CLI. Run `vercel login`, then retry Linq setup.");let r=await e.resolveVercelProject(`Linq`),a=await e.asker.ask(text({key:`linq-connector-name`,message:`Name your Linq agent`,recommended:await deriveSlackConnectorSlug(e.appRoot),required:!0}));if(await e.asker.ask(select({key:`linq-account`,message:`Which Linq account would you like to use?`,options:[{id:`new`,value:`new`,label:`Create a new Linq account`,hint:`Provision a new managed Linq line`},{id:`existing`,value:`existing`,label:`Use an existing Linq account`,hint:`Connect a Linq partner API token and select agent phone numbers`}],recommended:`new`,required:!0}))===`new`)return{credentials:n,connectorSlug:a.trim(),project:r};let c=await e.asker.ask(text({key:`linq-existing-api-token`,message:`Linq partner API token`,required:!0,sensitive:!0,environment:`LINQ_API_KEY`})),l=await t.listPhoneNumbers(c.trim(),e.signal),u=await e.asker.askMany({key:`linq-existing-phone-numbers`,message:`Choose your agent's phone numbers`,options:l.map(e=>({id:e,value:e,label:e})),detected:l,requireSelection:!0,required:!0});return{credentials:n,connectorSlug:a.trim(),existingAccount:{apiToken:c.trim(),phoneNumbers:u},project:r}}let r=await e.asker.ask(text({key:`linq-api-key`,message:`Linq API key`,required:!0,sensitive:!0,environment:`LINQ_API_KEY`})),a=await e.asker.ask(text({key:`linq-signing-secret`,message:`Linq webhook signing secret`,required:!0,sensitive:!0,environment:`LINQ_WEBHOOK_SECRET`}));return{credentials:n,apiKey:r.trim(),signingSecret:a.trim()}}async function applyLinqSetup(e,n){let i=join(n.appRoot,`agent/channels/linq.ts`),o;if(e.credentials===`connect`){let r={log:n.presenter.log,project:e.project,projectRoot:n.appRoot,slug:e.connectorSlug,signal:n.signal};e.existingAccount!==void 0&&(r.existingAccount=e.existingAccount);let s=await provisionLinqConnector(r);o=s.phoneNumber,await writeTextFile(i,connectTemplate(s.uid),{force:n.force}),o!==void 0&&n.presenter.note(o,`Text your agent`,{tone:`success`})}else await appendEnv(join(n.appRoot,`.env.local`),{LINQ_API_KEY:e.apiKey,LINQ_WEBHOOK_SECRET:e.signingSecret}),await writeTextFile(i,`import { linqChannel } from "eve/channels/linq";
|
|
8
8
|
|
|
9
9
|
export default linqChannel({
|
|
10
10
|
credentials: {
|
|
@@ -12,4 +12,4 @@ export default linqChannel({
|
|
|
12
12
|
signingSecret: process.env.LINQ_WEBHOOK_SECRET!,
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
`,{force:n.force}),n.presenter.nextSteps([`Deploy the agent, then create a Linq webhook subscription for https://<your-host>/eve/v1/linq with message.received, reaction.added, and reaction.removed events.`]);return n.presenter.log.success(`Scaffolded channel: linq`),{facts:
|
|
15
|
+
`,{force:n.force}),n.presenter.nextSteps([`Deploy the agent, then create a Linq webhook subscription for https://<your-host>/eve/v1/linq with message.received, reaction.added, and reaction.removed events.`]);return n.presenter.log.success(`Scaffolded channel: linq`),{facts:o===void 0?[]:[{label:`Agent phone number`,value:o,kind:`phone`}],deploymentRequired:!0}}const LINQ_SETUP=defineSetupIntegration({kind:`linq`,label:`Linq`,hint:`iMessage and SMS through Linq`,prepare:prepareLinqSetup,apply:applyLinqSetup});export{LINQ_SETUP,applyLinqSetup,prepareLinqSetup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineSetupIntegration}from"../types.js";import{SHOPIFY_UCP_CHANNEL_TEMPLATE}from"./templates.js";import{join}from"node:path";import{
|
|
1
|
+
import{defineSetupIntegration}from"../types.js";import{SHOPIFY_UCP_CHANNEL_TEMPLATE}from"./templates.js";import{join}from"node:path";import{writeTextFile}from"#setup/scaffold/files.js";import{text}from"#setup/ask.js";import{appendEnv}from"#setup/append-env.js";const defaultDeps={appendEnv,writeTextFile};function normalizeStoreDomain(e){return e.trim().replace(/^https?:\/\//i,``).replace(/[/?#].*$/,``)}function validateStoreDomain(e){let t=normalizeStoreDomain(e);try{let e=new URL(`https://${t}`);return t.length>0&&e.hostname.includes(`.`)&&!e.username&&!e.password&&!e.port?null:`Enter a valid Shopify storefront domain.`}catch{return`Enter a valid Shopify storefront domain.`}}async function prepareShopifySetup(e){return{storeDomain:normalizeStoreDomain(await e.asker.ask(text({key:`shopify.store-domain`,message:`Shopify storefront domain`,placeholder:`your-store.myshopify.com`,required:!0,validate:validateStoreDomain})))}}async function applyShopifySetup(e,n,r=defaultDeps){return n.presenter.log.message(`Scaffolding Shopify UCP channel and storefront environment...`),await r.appendEnv(join(n.appRoot,`.env.local`),{SHOPIFY_STORE_DOMAIN:e.storeDomain}),await r.writeTextFile(join(n.appRoot,`agent/channels/ucp.ts`),SHOPIFY_UCP_CHANNEL_TEMPLATE,{force:n.force}),n.presenter.log.success(`Scaffolded channel: ucp`),n.presenter.nextSteps([`Set SHOPIFY_STORE_DOMAIN in .env.local.`,"Shopify cannot reach localhost, so `eve dev` uses Shopify's example agent profile automatically. To test your own profile locally, expose the /.well-known/ucp route with a tool like ngrok."]),{deploymentRequired:!0,facts:[{label:`Store domain`,value:e.storeDomain,kind:`text`}]}}const SHOPIFY_SETUP=defineSetupIntegration({kind:`shopify`,label:`Shopify`,prepare:prepareShopifySetup,apply:applyShopifySetup});export{SHOPIFY_SETUP,applyShopifySetup,prepareShopifySetup};
|