eve 0.37.1 → 0.38.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 +23 -0
- package/dist/src/chunks/{use-eve-agent-DbKUBhl-.js → use-eve-agent-BbSsu99c.js} +70 -31
- package/dist/src/chunks/{use-eve-agent-Bi5fRxcZ.js → use-eve-agent-Dt8Y5QtW.js} +69 -30
- package/dist/src/cli/acp/command.d.ts +2 -1
- package/dist/src/cli/acp/command.js +2 -2
- package/dist/src/cli/application-command.d.ts +8 -0
- package/dist/src/cli/application-command.js +1 -0
- package/dist/src/cli/application-root.d.ts +8 -0
- package/dist/src/cli/application-root.js +1 -0
- package/dist/src/cli/commands/build.d.ts +2 -1
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.d.ts +2 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/register-project-commands.d.ts +2 -1
- package/dist/src/cli/commands/register-project-commands.js +1 -1
- package/dist/src/cli/commands/register-registry-commands.d.ts +2 -1
- package/dist/src/cli/commands/register-registry-commands.js +4 -1
- package/dist/src/cli/commands/registry-recovery.d.ts +14 -0
- package/dist/src/cli/commands/registry-recovery.js +1 -0
- package/dist/src/cli/commands/registry.d.ts +2 -5
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +3 -2
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/run.d.ts +3 -2
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/eve-agent-store.d.ts +15 -3
- package/dist/src/client/eve-agent-store.js +2 -2
- package/dist/src/client/message-response.d.ts +10 -2
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +4 -1
- package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
- package/dist/src/compiled/@chat-adapter/slack/index.js +25 -25
- package/dist/src/compiled/@opentelemetry/api/index.js +1 -1
- package/dist/src/compiled/@opentelemetry/otlp-transformer/index.js +1 -1
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +61 -61
- package/dist/src/compiled/@vercel/oidc/index.js +14 -14
- package/dist/src/compiled/@vercel/otel/index.js +1 -1
- package/dist/src/compiled/@vercel/sandbox/index.js +1 -1
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +2 -2
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BoH7JsWp.js → attribute-changes-DZtQkszH.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/chunk-5MU5Z6L3-B_3nkJFi.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{chunk-NWCAEW5Y-Oxw40oRR.js → chunk-NWCAEW5Y-BgbcH0OK.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{dist-DlFv0aHY.js → dist-CPlyFOVo.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{dist-tJoQXAF6.js → dist-DpYyXbJv.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{dist-CRTn4Sg8.js → dist-xQXN70ED.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/esm-seIr7a6j.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{frames-CTpeJYEQ.js → frames-BBs-9k1d.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{functions-CeeNvKsq.js → functions-DAYiHNti.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-bsd-WEBNKY2R-CEYkx6Nv.js → getMachineId-bsd-WEBNKY2R-BTaxrQ52.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-darwin-LT47KAXP-DPwWlhif.js → getMachineId-darwin-LT47KAXP-DhYmwE_R.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-linux-LTVQO6VW-DAFXHwZp.js → getMachineId-linux-LTVQO6VW-Dru_L5ru.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-unsupported-UKWBA27G-BZKOI8mG.js → getMachineId-unsupported-UKWBA27G-DGfoqVW1.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{getMachineId-win-NLJKOPY6-r7_CJB5o.js → getMachineId-win-NLJKOPY6-CLM98q4X.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{private-tvMBynnC.js → private-UQtz8ZcW.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{resume-hook-BPQHjeY5.js → resume-hook-CYtSorp6.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{rolldown-runtime-DaDcL9Zw.js → rolldown-runtime-8V8biNmG.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-DQ5dOyjm.js → run-Cjo0A3NO.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{signal-exit-C8vsI6zj.js → signal-exit-o3IPQwwv.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/sleep-C1P0OWBm.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{token-DHD-q-fS.js → token-DGzfw-Vb.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-DtCUEpJs.js → token-DNbxVpeq.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/token-util-BneBe0g5.js +27 -0
- package/dist/src/compiled/_chunks/workflow/{token-util-Ldar52H7.js → token-util-DjMgNdXS.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{undici-CUIybhQ2.js → undici-BBG5cZTy.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{wait-until-DK2lnH6U.js → wait-until-CT1ve8qB.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/{wrapper-CMGju7QA.js → wrapper-CQNxP9mU.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/{ws-transport-Csi6Cydc.js → ws-transport-beXxD0s_.js} +1 -1
- package/dist/src/compiled/env-runner/node-worker.js +1 -1
- package/dist/src/compiled/jose/index.js +1 -1
- package/dist/src/compiled/shadcn-registry/index.js +403 -403
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/compile-agent.js +2 -2
- package/dist/src/compiler/extension-compatibility.d.ts +15 -0
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/normalize-extension.d.ts +18 -6
- package/dist/src/compiler/normalize-extension.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +1 -0
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.d.ts +0 -6
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/evals/cli/eval.d.ts +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/harness/instrumentation/providers.js +1 -1
- package/dist/src/harness/instrumentation/runtime-context.d.ts +2 -0
- package/dist/src/harness/instrumentation/runtime-context.js +1 -1
- package/dist/src/harness/instrumentation/runtime.d.ts +3 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
- package/dist/src/internal/authored-module-evaluation-error.js +4 -4
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/extension-scope-plugin.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/instrumentation-layout.js +1 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/host/application-route-registry.d.ts +88 -0
- package/dist/src/internal/nitro/host/application-route-registry.js +1 -0
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/channel-routes.d.ts +4 -11
- package/dist/src/internal/nitro/host/channel-routes.js +3 -3
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-runner.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
- package/dist/src/internal/process/pnpm.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +12 -8
- package/dist/src/internal/workflow-bundle/builder-support.js +8 -7
- package/dist/src/internal/workflow-bundle/builder.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +2 -3
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.d.ts +2 -0
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/eve.d.ts +2 -0
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +2 -0
- package/dist/src/public/channels/linear/linearChannel.d.ts +2 -0
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/mcp.d.ts +2 -2
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +2 -0
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +2 -0
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +2 -0
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +2 -0
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +9 -3
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +4 -4
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/services/inspect-application.js +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +2 -2
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/scaffold/create/extension.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +8 -86
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/setup/scaffold/workspace-root.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +3 -3
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +32 -3
- package/dist/src/tracing/otel-declaration.js +1 -1
- package/dist/src/tracing/otel-registration.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +3 -3
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/custom.mdx +1 -1
- package/docs/channels/discord.mdx +1 -1
- package/docs/channels/eve.mdx +1 -2
- package/docs/channels/github.mdx +1 -1
- package/docs/channels/linear.mdx +1 -1
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/photon.mdx +1 -1
- package/docs/channels/slack.mdx +1 -1
- package/docs/channels/teams.mdx +1 -1
- package/docs/channels/telegram.mdx +1 -1
- package/docs/channels/twilio.mdx +1 -1
- package/docs/extensions.md +19 -7
- package/docs/guides/client/streaming.mdx +6 -5
- package/docs/guides/frontend/overview.mdx +10 -8
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +10 -10
- package/docs/guides/frontend/use-eve-agent-vue.mdx +10 -10
- package/docs/install-integrations.mdx +4 -0
- package/docs/reference/cli.md +1 -1
- package/docs/schedules.mdx +2 -2
- package/docs/subagents/index.mdx +3 -1
- package/package.json +1 -1
- package/dist/src/compiled/_chunks/workflow/chunk-5MU5Z6L3-CaJgXkVg.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +0 -1
- package/dist/src/compiled/_chunks/workflow/src-Cj3P1ChQ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/token-util-DNwIAn_u.js +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.38.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d23467d: Allow extensions to contribute namespaced subagents, including their tools, configuration access, nested subagents, and directory-mount overrides.
|
|
8
|
+
- cb2fa2a: Configure MCP channel endpoints with `route`, default them to `/eve/v1/mcp`, and derive OAuth protected-resource metadata paths from the MCP resource identifier.
|
|
9
|
+
|
|
10
|
+
## 0.38.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 48c1105: Replace `stop()` on frontend agent bindings with `cancel()`. Cancellation now targets the exact durable turn through `MessageResponse.cancel()` while the binding stays attached through settlement.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 8904392: Extensions can now contribute channels. Mounted channel IDs receive the extension namespace while their authored route paths remain unchanged.
|
|
19
|
+
- 4c3c475: Built-in inbound hooks can now return `title` to set the workflow run title without changing the message sent to the model.
|
|
20
|
+
- a7d34e5: Make Nitro-backed builds more reliable by preserving per-import conditional exports, keeping authored and vendored OpenTelemetry tracers on one registered provider, and running development worker close hooks during an explicit shutdown handshake. Workflow artifacts are now emitted directly instead of repaired through post-build string rewrites.
|
|
21
|
+
- bdd5a9b: Suggest close registry matches when `eve add` cannot find the requested item.
|
|
22
|
+
- ccc604c: Show `eve add` help and registry search guidance when no item is provided.
|
|
23
|
+
- abcd06d: Resolve project-scoped CLI commands from the nearest enclosing eve application when run from a nested directory.
|
|
24
|
+
- 775c061: Extensions can contribute schedules. Mounted schedule IDs use the extension namespace while cron expressions and handler behavior remain unchanged.
|
|
25
|
+
|
|
3
26
|
## 0.37.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -452,12 +452,27 @@ function isFinalMessageCompleted(event) {
|
|
|
452
452
|
//#region src/client/message-response.ts
|
|
453
453
|
var MessageResponse = class {
|
|
454
454
|
sessionId;
|
|
455
|
+
#cancelTurn;
|
|
456
|
+
#cancellation;
|
|
455
457
|
#consumed = false;
|
|
456
458
|
#createStream;
|
|
459
|
+
#settled = false;
|
|
460
|
+
#turnId = Promise.withResolvers();
|
|
457
461
|
constructor(input) {
|
|
462
|
+
this.#cancelTurn = input.cancelTurn;
|
|
458
463
|
this.sessionId = input.sessionId;
|
|
459
464
|
this.#createStream = input.createStream;
|
|
460
465
|
}
|
|
466
|
+
cancel() {
|
|
467
|
+
if (this.#settled) return Promise.resolve({ status: "no_active_turn" });
|
|
468
|
+
if (this.#cancellation !== void 0) return this.#cancellation;
|
|
469
|
+
const cancellation = this.#turnId.promise.then((turnId) => turnId === void 0 ? { status: "no_active_turn" } : this.#cancelTurn(turnId));
|
|
470
|
+
this.#cancellation = cancellation;
|
|
471
|
+
cancellation.catch(() => {
|
|
472
|
+
if (!this.#settled && this.#cancellation === cancellation) this.#cancellation = void 0;
|
|
473
|
+
});
|
|
474
|
+
return cancellation;
|
|
475
|
+
}
|
|
461
476
|
async result() {
|
|
462
477
|
const events = [];
|
|
463
478
|
for await (const event of this) events.push(event);
|
|
@@ -474,7 +489,21 @@ var MessageResponse = class {
|
|
|
474
489
|
[Symbol.asyncIterator]() {
|
|
475
490
|
if (this.#consumed) throw new Error("MessageResponse has already been consumed.");
|
|
476
491
|
this.#consumed = true;
|
|
477
|
-
return this.#
|
|
492
|
+
return this.#observeStream();
|
|
493
|
+
}
|
|
494
|
+
async *#observeStream() {
|
|
495
|
+
try {
|
|
496
|
+
for await (const event of this.#createStream()) {
|
|
497
|
+
if (event.type === "turn.started") this.#turnId.resolve(event.data.turnId);
|
|
498
|
+
else if (isCurrentTurnBoundaryEvent(event)) {
|
|
499
|
+
this.#settled = true;
|
|
500
|
+
this.#turnId.resolve(void 0);
|
|
501
|
+
}
|
|
502
|
+
yield event;
|
|
503
|
+
}
|
|
504
|
+
} finally {
|
|
505
|
+
this.#turnId.resolve(void 0);
|
|
506
|
+
}
|
|
478
507
|
}
|
|
479
508
|
};
|
|
480
509
|
|
|
@@ -1027,6 +1056,7 @@ var ClientSession = class ClientSession {
|
|
|
1027
1056
|
#messageResponse(response, input, initialStreamIndex) {
|
|
1028
1057
|
response.body?.cancel().catch(() => {});
|
|
1029
1058
|
return new MessageResponse({
|
|
1059
|
+
cancelTurn: async (turnId) => await this.cancel({ turnId }),
|
|
1030
1060
|
createStream: () => this.#createEventStream(initialStreamIndex, input),
|
|
1031
1061
|
sessionId: this.#state.sessionId
|
|
1032
1062
|
});
|
|
@@ -1274,6 +1304,7 @@ function createEventDeduper() {
|
|
|
1274
1304
|
|
|
1275
1305
|
//#endregion
|
|
1276
1306
|
//#region src/client/eve-agent-store.ts
|
|
1307
|
+
const detachStore = Symbol("detachEveAgentStore");
|
|
1277
1308
|
var EveAgentStore = class {
|
|
1278
1309
|
#client;
|
|
1279
1310
|
#externalSession;
|
|
@@ -1281,12 +1312,11 @@ var EveAgentStore = class {
|
|
|
1281
1312
|
#reducer;
|
|
1282
1313
|
#subscribers = /* @__PURE__ */ new Set();
|
|
1283
1314
|
#seenEvents = createEventDeduper();
|
|
1284
|
-
#
|
|
1315
|
+
#activeTurn;
|
|
1285
1316
|
#callbacks = {};
|
|
1286
1317
|
#data;
|
|
1287
1318
|
#error;
|
|
1288
1319
|
#events;
|
|
1289
|
-
#operationId = 0;
|
|
1290
1320
|
#pendingMessageSubmission;
|
|
1291
1321
|
#projectionEvents;
|
|
1292
1322
|
#session;
|
|
@@ -1323,27 +1353,33 @@ var EveAgentStore = class {
|
|
|
1323
1353
|
}
|
|
1324
1354
|
async send(input) {
|
|
1325
1355
|
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("eve session is already processing a turn.");
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1356
|
+
const response = Promise.withResolvers();
|
|
1357
|
+
const turn = {
|
|
1358
|
+
abortController: new AbortController(),
|
|
1359
|
+
response: response.promise,
|
|
1360
|
+
resolveResponse: response.resolve
|
|
1361
|
+
};
|
|
1362
|
+
this.#activeTurn = turn;
|
|
1329
1363
|
this.#error = void 0;
|
|
1330
1364
|
this.#status = "submitted";
|
|
1331
1365
|
this.#publish();
|
|
1332
1366
|
try {
|
|
1333
1367
|
const preparedInput = await this.#callbacks.prepareSend?.(input) ?? input;
|
|
1334
1368
|
assertExclusiveTurnInput(preparedInput);
|
|
1335
|
-
if (!this.#
|
|
1369
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1336
1370
|
this.#projectOptimisticMessage(preparedInput);
|
|
1337
1371
|
this.#projectInputResponses(preparedInput);
|
|
1338
1372
|
this.#publish();
|
|
1339
1373
|
const turnInput = {
|
|
1340
1374
|
...preparedInput,
|
|
1341
|
-
signal: createAbortSignal(preparedInput.signal, abortController.signal)
|
|
1375
|
+
signal: createAbortSignal(preparedInput.signal, turn.abortController.signal)
|
|
1342
1376
|
};
|
|
1343
1377
|
const response = await this.#dispatchTurn(turnInput);
|
|
1378
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1379
|
+
turn.resolveResponse(response);
|
|
1344
1380
|
let sawEvent = false;
|
|
1345
1381
|
for await (const event of response) {
|
|
1346
|
-
if (!this.#
|
|
1382
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1347
1383
|
if (!sawEvent) {
|
|
1348
1384
|
sawEvent = true;
|
|
1349
1385
|
this.#status = "streaming";
|
|
@@ -1355,10 +1391,10 @@ var EveAgentStore = class {
|
|
|
1355
1391
|
this.#applyTerminalStreamFailure(event);
|
|
1356
1392
|
this.#publish();
|
|
1357
1393
|
}
|
|
1358
|
-
if (!this.#
|
|
1394
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1359
1395
|
this.#status = this.#error === void 0 ? "ready" : "error";
|
|
1360
1396
|
} catch (error) {
|
|
1361
|
-
if (!this.#
|
|
1397
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1362
1398
|
if (isAbortError(error)) {
|
|
1363
1399
|
this.#status = "ready";
|
|
1364
1400
|
this.#failPendingMessageSubmission(toError(error));
|
|
@@ -1369,21 +1405,28 @@ var EveAgentStore = class {
|
|
|
1369
1405
|
this.#callbacks.onError?.(this.#error);
|
|
1370
1406
|
}
|
|
1371
1407
|
} finally {
|
|
1372
|
-
if (this.#
|
|
1373
|
-
|
|
1408
|
+
if (this.#isActiveTurn(turn)) {
|
|
1409
|
+
turn.resolveResponse(void 0);
|
|
1410
|
+
this.#activeTurn = void 0;
|
|
1374
1411
|
this.#callbacks.onSessionChange?.(this.#session?.state);
|
|
1375
1412
|
this.#publish();
|
|
1376
1413
|
this.#callbacks.onFinish?.(this.#snapshot);
|
|
1377
1414
|
}
|
|
1378
1415
|
}
|
|
1379
1416
|
}
|
|
1380
|
-
|
|
1381
|
-
this.#
|
|
1417
|
+
cancel() {
|
|
1418
|
+
const turn = this.#activeTurn;
|
|
1419
|
+
if (turn === void 0) return Promise.resolve({ status: "no_active_turn" });
|
|
1420
|
+
return turn.response.then((response) => response === void 0 ? { status: "no_active_turn" } : response.cancel());
|
|
1421
|
+
}
|
|
1422
|
+
[detachStore]() {
|
|
1423
|
+
this.#activeTurn?.abortController.abort();
|
|
1382
1424
|
}
|
|
1383
1425
|
reset() {
|
|
1384
|
-
this.#
|
|
1385
|
-
this
|
|
1386
|
-
|
|
1426
|
+
const turn = this.#activeTurn;
|
|
1427
|
+
this.#activeTurn = void 0;
|
|
1428
|
+
turn?.resolveResponse(void 0);
|
|
1429
|
+
turn?.abortController.abort();
|
|
1387
1430
|
if (!this.#externalSession) this.#session = void 0;
|
|
1388
1431
|
this.#events = [];
|
|
1389
1432
|
this.#seenEvents = createEventDeduper();
|
|
@@ -1416,15 +1459,8 @@ var EveAgentStore = class {
|
|
|
1416
1459
|
const { inputResponses, ...options } = input;
|
|
1417
1460
|
return await this.#session.respond(inputResponses, options);
|
|
1418
1461
|
}
|
|
1419
|
-
#
|
|
1420
|
-
this.#
|
|
1421
|
-
return this.#operationId;
|
|
1422
|
-
}
|
|
1423
|
-
#invalidateOperation() {
|
|
1424
|
-
this.#operationId += 1;
|
|
1425
|
-
}
|
|
1426
|
-
#isCurrentOperation(operationId) {
|
|
1427
|
-
return this.#operationId === operationId;
|
|
1462
|
+
#isActiveTurn(turn) {
|
|
1463
|
+
return this.#activeTurn === turn;
|
|
1428
1464
|
}
|
|
1429
1465
|
#projectOptimisticMessage(input) {
|
|
1430
1466
|
if (!this.#optimistic || input.message === void 0) return;
|
|
@@ -1522,6 +1558,9 @@ var EveAgentStore = class {
|
|
|
1522
1558
|
for (const subscriber of this.#subscribers) subscriber();
|
|
1523
1559
|
}
|
|
1524
1560
|
};
|
|
1561
|
+
function detachEveAgentStore(store) {
|
|
1562
|
+
store[detachStore]();
|
|
1563
|
+
}
|
|
1525
1564
|
function assertExclusiveTurnInput(input) {
|
|
1526
1565
|
if (input.message !== void 0 === (input.inputResponses !== void 0)) throw new Error("A turn requires exactly one of message or inputResponses.");
|
|
1527
1566
|
}
|
|
@@ -2129,7 +2168,7 @@ var SvelteEveAgent = class {
|
|
|
2129
2168
|
});
|
|
2130
2169
|
return () => {
|
|
2131
2170
|
unsubscribe();
|
|
2132
|
-
store
|
|
2171
|
+
detachEveAgentStore(store);
|
|
2133
2172
|
};
|
|
2134
2173
|
});
|
|
2135
2174
|
}
|
|
@@ -2153,6 +2192,9 @@ var SvelteEveAgent = class {
|
|
|
2153
2192
|
this.#subscribe();
|
|
2154
2193
|
return this.#snapshot.status;
|
|
2155
2194
|
}
|
|
2195
|
+
cancel = () => {
|
|
2196
|
+
return this.#store.cancel();
|
|
2197
|
+
};
|
|
2156
2198
|
reset = () => {
|
|
2157
2199
|
this.#store.reset();
|
|
2158
2200
|
};
|
|
@@ -2168,9 +2210,6 @@ var SvelteEveAgent = class {
|
|
|
2168
2210
|
message
|
|
2169
2211
|
});
|
|
2170
2212
|
};
|
|
2171
|
-
stop = () => {
|
|
2172
|
-
this.#store.stop();
|
|
2173
|
-
};
|
|
2174
2213
|
};
|
|
2175
2214
|
function useEveAgent(options = {}) {
|
|
2176
2215
|
const reducer = options.reducer ?? defaultMessageReducer();
|
|
@@ -452,12 +452,27 @@ function isFinalMessageCompleted(event) {
|
|
|
452
452
|
//#region src/client/message-response.ts
|
|
453
453
|
var MessageResponse = class {
|
|
454
454
|
sessionId;
|
|
455
|
+
#cancelTurn;
|
|
456
|
+
#cancellation;
|
|
455
457
|
#consumed = false;
|
|
456
458
|
#createStream;
|
|
459
|
+
#settled = false;
|
|
460
|
+
#turnId = Promise.withResolvers();
|
|
457
461
|
constructor(input) {
|
|
462
|
+
this.#cancelTurn = input.cancelTurn;
|
|
458
463
|
this.sessionId = input.sessionId;
|
|
459
464
|
this.#createStream = input.createStream;
|
|
460
465
|
}
|
|
466
|
+
cancel() {
|
|
467
|
+
if (this.#settled) return Promise.resolve({ status: "no_active_turn" });
|
|
468
|
+
if (this.#cancellation !== void 0) return this.#cancellation;
|
|
469
|
+
const cancellation = this.#turnId.promise.then((turnId) => turnId === void 0 ? { status: "no_active_turn" } : this.#cancelTurn(turnId));
|
|
470
|
+
this.#cancellation = cancellation;
|
|
471
|
+
cancellation.catch(() => {
|
|
472
|
+
if (!this.#settled && this.#cancellation === cancellation) this.#cancellation = void 0;
|
|
473
|
+
});
|
|
474
|
+
return cancellation;
|
|
475
|
+
}
|
|
461
476
|
async result() {
|
|
462
477
|
const events = [];
|
|
463
478
|
for await (const event of this) events.push(event);
|
|
@@ -474,7 +489,21 @@ var MessageResponse = class {
|
|
|
474
489
|
[Symbol.asyncIterator]() {
|
|
475
490
|
if (this.#consumed) throw new Error("MessageResponse has already been consumed.");
|
|
476
491
|
this.#consumed = true;
|
|
477
|
-
return this.#
|
|
492
|
+
return this.#observeStream();
|
|
493
|
+
}
|
|
494
|
+
async *#observeStream() {
|
|
495
|
+
try {
|
|
496
|
+
for await (const event of this.#createStream()) {
|
|
497
|
+
if (event.type === "turn.started") this.#turnId.resolve(event.data.turnId);
|
|
498
|
+
else if (isCurrentTurnBoundaryEvent(event)) {
|
|
499
|
+
this.#settled = true;
|
|
500
|
+
this.#turnId.resolve(void 0);
|
|
501
|
+
}
|
|
502
|
+
yield event;
|
|
503
|
+
}
|
|
504
|
+
} finally {
|
|
505
|
+
this.#turnId.resolve(void 0);
|
|
506
|
+
}
|
|
478
507
|
}
|
|
479
508
|
};
|
|
480
509
|
|
|
@@ -1027,6 +1056,7 @@ var ClientSession = class ClientSession {
|
|
|
1027
1056
|
#messageResponse(response, input, initialStreamIndex) {
|
|
1028
1057
|
response.body?.cancel().catch(() => {});
|
|
1029
1058
|
return new MessageResponse({
|
|
1059
|
+
cancelTurn: async (turnId) => await this.cancel({ turnId }),
|
|
1030
1060
|
createStream: () => this.#createEventStream(initialStreamIndex, input),
|
|
1031
1061
|
sessionId: this.#state.sessionId
|
|
1032
1062
|
});
|
|
@@ -1274,6 +1304,7 @@ function createEventDeduper() {
|
|
|
1274
1304
|
|
|
1275
1305
|
//#endregion
|
|
1276
1306
|
//#region src/client/eve-agent-store.ts
|
|
1307
|
+
const detachStore = Symbol("detachEveAgentStore");
|
|
1277
1308
|
var EveAgentStore = class {
|
|
1278
1309
|
#client;
|
|
1279
1310
|
#externalSession;
|
|
@@ -1281,12 +1312,11 @@ var EveAgentStore = class {
|
|
|
1281
1312
|
#reducer;
|
|
1282
1313
|
#subscribers = /* @__PURE__ */ new Set();
|
|
1283
1314
|
#seenEvents = createEventDeduper();
|
|
1284
|
-
#
|
|
1315
|
+
#activeTurn;
|
|
1285
1316
|
#callbacks = {};
|
|
1286
1317
|
#data;
|
|
1287
1318
|
#error;
|
|
1288
1319
|
#events;
|
|
1289
|
-
#operationId = 0;
|
|
1290
1320
|
#pendingMessageSubmission;
|
|
1291
1321
|
#projectionEvents;
|
|
1292
1322
|
#session;
|
|
@@ -1323,27 +1353,33 @@ var EveAgentStore = class {
|
|
|
1323
1353
|
}
|
|
1324
1354
|
async send(input) {
|
|
1325
1355
|
if (this.#status === "streaming" || this.#status === "submitted") throw new Error("eve session is already processing a turn.");
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1356
|
+
const response = Promise.withResolvers();
|
|
1357
|
+
const turn = {
|
|
1358
|
+
abortController: new AbortController(),
|
|
1359
|
+
response: response.promise,
|
|
1360
|
+
resolveResponse: response.resolve
|
|
1361
|
+
};
|
|
1362
|
+
this.#activeTurn = turn;
|
|
1329
1363
|
this.#error = void 0;
|
|
1330
1364
|
this.#status = "submitted";
|
|
1331
1365
|
this.#publish();
|
|
1332
1366
|
try {
|
|
1333
1367
|
const preparedInput = await this.#callbacks.prepareSend?.(input) ?? input;
|
|
1334
1368
|
assertExclusiveTurnInput(preparedInput);
|
|
1335
|
-
if (!this.#
|
|
1369
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1336
1370
|
this.#projectOptimisticMessage(preparedInput);
|
|
1337
1371
|
this.#projectInputResponses(preparedInput);
|
|
1338
1372
|
this.#publish();
|
|
1339
1373
|
const turnInput = {
|
|
1340
1374
|
...preparedInput,
|
|
1341
|
-
signal: createAbortSignal(preparedInput.signal, abortController.signal)
|
|
1375
|
+
signal: createAbortSignal(preparedInput.signal, turn.abortController.signal)
|
|
1342
1376
|
};
|
|
1343
1377
|
const response = await this.#dispatchTurn(turnInput);
|
|
1378
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1379
|
+
turn.resolveResponse(response);
|
|
1344
1380
|
let sawEvent = false;
|
|
1345
1381
|
for await (const event of response) {
|
|
1346
|
-
if (!this.#
|
|
1382
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1347
1383
|
if (!sawEvent) {
|
|
1348
1384
|
sawEvent = true;
|
|
1349
1385
|
this.#status = "streaming";
|
|
@@ -1355,10 +1391,10 @@ var EveAgentStore = class {
|
|
|
1355
1391
|
this.#applyTerminalStreamFailure(event);
|
|
1356
1392
|
this.#publish();
|
|
1357
1393
|
}
|
|
1358
|
-
if (!this.#
|
|
1394
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1359
1395
|
this.#status = this.#error === void 0 ? "ready" : "error";
|
|
1360
1396
|
} catch (error) {
|
|
1361
|
-
if (!this.#
|
|
1397
|
+
if (!this.#isActiveTurn(turn)) return;
|
|
1362
1398
|
if (isAbortError(error)) {
|
|
1363
1399
|
this.#status = "ready";
|
|
1364
1400
|
this.#failPendingMessageSubmission(toError(error));
|
|
@@ -1369,21 +1405,28 @@ var EveAgentStore = class {
|
|
|
1369
1405
|
this.#callbacks.onError?.(this.#error);
|
|
1370
1406
|
}
|
|
1371
1407
|
} finally {
|
|
1372
|
-
if (this.#
|
|
1373
|
-
|
|
1408
|
+
if (this.#isActiveTurn(turn)) {
|
|
1409
|
+
turn.resolveResponse(void 0);
|
|
1410
|
+
this.#activeTurn = void 0;
|
|
1374
1411
|
this.#callbacks.onSessionChange?.(this.#session?.state);
|
|
1375
1412
|
this.#publish();
|
|
1376
1413
|
this.#callbacks.onFinish?.(this.#snapshot);
|
|
1377
1414
|
}
|
|
1378
1415
|
}
|
|
1379
1416
|
}
|
|
1380
|
-
|
|
1381
|
-
this.#
|
|
1417
|
+
cancel() {
|
|
1418
|
+
const turn = this.#activeTurn;
|
|
1419
|
+
if (turn === void 0) return Promise.resolve({ status: "no_active_turn" });
|
|
1420
|
+
return turn.response.then((response) => response === void 0 ? { status: "no_active_turn" } : response.cancel());
|
|
1421
|
+
}
|
|
1422
|
+
[detachStore]() {
|
|
1423
|
+
this.#activeTurn?.abortController.abort();
|
|
1382
1424
|
}
|
|
1383
1425
|
reset() {
|
|
1384
|
-
this.#
|
|
1385
|
-
this
|
|
1386
|
-
|
|
1426
|
+
const turn = this.#activeTurn;
|
|
1427
|
+
this.#activeTurn = void 0;
|
|
1428
|
+
turn?.resolveResponse(void 0);
|
|
1429
|
+
turn?.abortController.abort();
|
|
1387
1430
|
if (!this.#externalSession) this.#session = void 0;
|
|
1388
1431
|
this.#events = [];
|
|
1389
1432
|
this.#seenEvents = createEventDeduper();
|
|
@@ -1416,15 +1459,8 @@ var EveAgentStore = class {
|
|
|
1416
1459
|
const { inputResponses, ...options } = input;
|
|
1417
1460
|
return await this.#session.respond(inputResponses, options);
|
|
1418
1461
|
}
|
|
1419
|
-
#
|
|
1420
|
-
this.#
|
|
1421
|
-
return this.#operationId;
|
|
1422
|
-
}
|
|
1423
|
-
#invalidateOperation() {
|
|
1424
|
-
this.#operationId += 1;
|
|
1425
|
-
}
|
|
1426
|
-
#isCurrentOperation(operationId) {
|
|
1427
|
-
return this.#operationId === operationId;
|
|
1462
|
+
#isActiveTurn(turn) {
|
|
1463
|
+
return this.#activeTurn === turn;
|
|
1428
1464
|
}
|
|
1429
1465
|
#projectOptimisticMessage(input) {
|
|
1430
1466
|
if (!this.#optimistic || input.message === void 0) return;
|
|
@@ -1522,6 +1558,9 @@ var EveAgentStore = class {
|
|
|
1522
1558
|
for (const subscriber of this.#subscribers) subscriber();
|
|
1523
1559
|
}
|
|
1524
1560
|
};
|
|
1561
|
+
function detachEveAgentStore(store) {
|
|
1562
|
+
store[detachStore]();
|
|
1563
|
+
}
|
|
1525
1564
|
function assertExclusiveTurnInput(input) {
|
|
1526
1565
|
if (input.message !== void 0 === (input.inputResponses !== void 0)) throw new Error("A turn requires exactly one of message or inputResponses.");
|
|
1527
1566
|
}
|
|
@@ -2143,10 +2182,11 @@ function useEveAgent(options = {}) {
|
|
|
2143
2182
|
});
|
|
2144
2183
|
onScopeDispose(() => {
|
|
2145
2184
|
unsubscribe();
|
|
2146
|
-
store
|
|
2185
|
+
detachEveAgentStore(store);
|
|
2147
2186
|
});
|
|
2148
2187
|
}
|
|
2149
2188
|
return {
|
|
2189
|
+
cancel: () => store.cancel(),
|
|
2150
2190
|
data: computed(() => snapshot.value.data),
|
|
2151
2191
|
error: computed(() => snapshot.value.error),
|
|
2152
2192
|
events: computed(() => snapshot.value.events),
|
|
@@ -2160,8 +2200,7 @@ function useEveAgent(options = {}) {
|
|
|
2160
2200
|
message
|
|
2161
2201
|
}),
|
|
2162
2202
|
session: computed(() => snapshot.value.session),
|
|
2163
|
-
status: computed(() => snapshot.value.status)
|
|
2164
|
-
stop: () => store.stop()
|
|
2203
|
+
status: computed(() => snapshot.value.status)
|
|
2165
2204
|
};
|
|
2166
2205
|
}
|
|
2167
2206
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import { type CliApplicationContext } from "#cli/application-command.js";
|
|
2
3
|
import type { ClientOptions } from "#client/types.js";
|
|
3
4
|
import type { DevelopmentServer, DevelopmentServerOptions } from "#internal/nitro/host/types.js";
|
|
4
5
|
export type RunAcpServer = (input: {
|
|
@@ -11,7 +12,7 @@ export type RunAcpServer = (input: {
|
|
|
11
12
|
}) => Promise<void>;
|
|
12
13
|
export type ResolveVerifiedRemoteDevelopmentClient = typeof import("#setup/verified-remote-client.js").resolveVerifiedRemoteDevelopmentClient;
|
|
13
14
|
export interface RegisterAcpCommandOptions {
|
|
14
|
-
readonly
|
|
15
|
+
readonly applicationContext: CliApplicationContext;
|
|
15
16
|
readonly eveVersion: string;
|
|
16
17
|
readonly program: Command;
|
|
17
18
|
readonly resolveVerifiedRemoteDevelopmentClient?: ResolveVerifiedRemoteDevelopmentClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"#compiled/commander/index.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal}from"#cli/shutdown.js";function registerAcpCommand(
|
|
1
|
+
import"#compiled/commander/index.js";import{applicationCommand}from"#cli/application-command.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{parseDevelopmentHeaderOption,resolveDevelopmentUrlTarget}from"#cli/dev/url-target.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{FORCED_EXIT_BACKSTOP_MS,installShutdownSignal}from"#cli/shutdown.js";function registerAcpCommand(s){applicationCommand(s.program.command(`acp`),s.applicationContext,e=>resolveDevelopmentUrlTarget(e.opts(),e.processedArgs[0])===void 0).description(`Serve an eve agent through stable ACP v1 over stdio.`).argument(`[url]`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`-u, --url <url>`,`Connect to an existing server URL`,parseDevelopmentServerUrl).option(`--scope <team>`,`Vercel team that owns the URL target`).option(`-H, --header <header>`,`Request header for a URL target, in "Name: value" form (repeatable)`,parseDevelopmentHeaderOption).addHelpText(`after`,`
|
|
2
2
|
Without a URL, eve supervises a local development server. You can also pass a bare URL, for example: eve acp https://example.com
|
|
3
3
|
ACP does not grant the agent access to the client's workspace or terminal.
|
|
4
|
-
`).action(async(
|
|
4
|
+
`).action(async(e,n)=>{let i=resolveDevelopmentUrlTarget(n,e);loadDevelopmentEnvironmentFiles(s.applicationContext.root);let c=installShutdownSignal({exitAfterMs:FORCED_EXIT_BACKSTOP_MS});if(i!==void 0){try{await runAcp(s,{headers:i.headers,serverUrl:i.serverUrl,signal:c.signal,vercelScope:n.scope??process.env.EVE_VERCEL_SCOPE})}finally{c.dispose()}return}let l,u,closeServer=()=>l===void 0?Promise.resolve():(u??=l.close(),u.catch(()=>void 0),u);c.signal.addEventListener(`abort`,()=>void closeServer(),{once:!0});try{l=(s.startHost??await loadStartHost())(s.applicationContext.root,{existing:`reject`,host:`127.0.0.1`,output:`stderr`,port:0});let e=await Promise.race([l.start(),c.stopped.then(()=>void 0)]);if(e===void 0)return;await runAcp(s,{serverUrl:e.url,signal:c.signal,workspaceRoot:e.appRoot}),c.requestStop()}finally{await closeServer(),c.dispose()}})}async function runAcp(e,t){let n=e.runAcpServer??(await import(`#acp/server.js`)).runAcpServer,{vercelScope:r,...i}=t,a=typeof i.headers==`function`?void 0:i.headers,o=Object.keys(a??{}).some(e=>e.toLowerCase()===`authorization`);if(i.workspaceRoot!==void 0||o){await n({eveVersion:e.eveVersion,...i});return}let{options:s}=await(e.resolveVerifiedRemoteDevelopmentClient??(await import(`#setup/verified-remote-client.js`)).resolveVerifiedRemoteDevelopmentClient)({headers:a,serverUrl:i.serverUrl,signal:i.signal,vercelScope:r,workspaceRoot:e.applicationContext.root});await n({auth:s.auth,eveVersion:e.eveVersion,headers:s.headers,serverUrl:i.serverUrl,signal:i.signal})}async function loadStartHost(){return(await import(`#cli/dev/local-server-process.js`)).createDevelopmentServer}export{registerAcpCommand};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
export interface CliApplicationContext {
|
|
3
|
+
root: string;
|
|
4
|
+
resolve(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export type CliApplicationRootRequirement = (command: Command) => boolean;
|
|
7
|
+
/** Adds application-root resolution to a project-scoped CLI command. */
|
|
8
|
+
export declare function applicationCommand(command: Command, applicationContext: CliApplicationContext, requirement?: CliApplicationRootRequirement): Command;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function applicationCommand(e,t,n=()=>!0){return e.hook(`preAction`,async(e,r)=>{n(r)&&await t.resolve()})}export{applicationCommand};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveDiscoveryProject } from "#discover/project.js";
|
|
2
|
+
export interface ResolveCliApplicationRootDependencies {
|
|
3
|
+
readonly resolveDiscoveryProject: typeof resolveDiscoveryProject;
|
|
4
|
+
}
|
|
5
|
+
/** Finds the nearest enclosing eve application. */
|
|
6
|
+
export declare function findCliApplicationRoot(cwd?: string, dependencies?: ResolveCliApplicationRootDependencies): Promise<string | undefined>;
|
|
7
|
+
/** Uses the nearest enclosing eve application, or preserves cwd when none exists. */
|
|
8
|
+
export declare function resolveCliApplicationRoot(cwd?: string, dependencies?: ResolveCliApplicationRootDependencies): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolve}from"node:path";import{DiscoveryProjectResolutionError,resolveDiscoveryProject}from"#discover/project.js";const defaultDependencies={resolveDiscoveryProject};async function findCliApplicationRoot(e=process.cwd(),n=defaultDependencies){try{return(await n.resolveDiscoveryProject(e)).appRoot}catch(e){if(e instanceof DiscoveryProjectResolutionError)return;throw e}}async function resolveCliApplicationRoot(t=process.cwd(),n=defaultDependencies){return await findCliApplicationRoot(t,n)??resolve(t)}export{findCliApplicationRoot,resolveCliApplicationRoot};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import { type CliApplicationContext } from "#cli/application-command.js";
|
|
2
3
|
import type { ApplicationBuildOptions } from "#internal/nitro/host/types.js";
|
|
3
4
|
export type BuildHost = (appRoot: string, options: ApplicationBuildOptions) => Promise<string>;
|
|
4
5
|
interface BuildCommandLogger {
|
|
@@ -6,7 +7,7 @@ interface BuildCommandLogger {
|
|
|
6
7
|
}
|
|
7
8
|
/** Registers the production application build command. */
|
|
8
9
|
export declare function registerBuildCommand(input: {
|
|
9
|
-
readonly
|
|
10
|
+
readonly applicationContext: CliApplicationContext;
|
|
10
11
|
readonly buildHost?: BuildHost;
|
|
11
12
|
readonly logger: BuildCommandLogger;
|
|
12
13
|
readonly program: Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolve}from"node:path";import{resolveInternalVercelServiceOutput}from"#cli/vercel-service-output.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{EVE_PUBLIC_ROUTE_PREFIX_ENV,normalizePublicRoutePrefix}from"#shared/public-route-prefix.js";function registerBuildCommand(
|
|
1
|
+
import{applicationCommand}from"#cli/application-command.js";import{resolve}from"node:path";import{resolveInternalVercelServiceOutput}from"#cli/vercel-service-output.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{EVE_PUBLIC_ROUTE_PREFIX_ENV,normalizePublicRoutePrefix}from"#shared/public-route-prefix.js";function registerBuildCommand(n){let r=createCliTheme();applicationCommand(n.program.command(`build`),n.applicationContext).description(`Build the current eve application.`).option(`--profile <path>`,`Write best-effort timing and output-size profile JSON to a file`).option(`--skip-sandbox-prewarm`,`Skip sandbox template prewarm for a Vercel build; output may not be deployable`).action(async e=>{let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);t(n.applicationContext.root);let i=n.buildHost??(await import(`#internal/nitro/host.js`)).buildApplication,a=e.profile===void 0?void 0:resolve(n.applicationContext.root,e.profile),o={publicRoutePrefix:normalizePublicRoutePrefix(process.env[EVE_PUBLIC_ROUTE_PREFIX_ENV]),skipVercelSandboxPrewarm:e.skipSandboxPrewarm===!0,vercelServiceOutput:resolveInternalVercelServiceOutput(n.applicationContext.root)};a!==void 0&&(o.profileOutputPath=a);let s=await i(n.applicationContext.root,o);n.logger.log(renderCliTaggedLine(r,{message:`built output at ${s}`,tag:`build`,tone:`success`}))})}export{registerBuildCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasInteractiveTerminal}from"./preconditions.js";import{access,stat}from"node:fs/promises";import{
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{access,stat}from"node:fs/promises";import{delimiter,extname,join}from"node:path";import{constants}from"node:fs";import{createPrompter}from"#setup/prompter.js";import{spawn}from"node:child_process";const positional=e=>[e],CODING_AGENT_REPLS=[{command:`claude`,label:`Claude Code`,promptArgs:positional},{command:`codex`,label:`Codex`,promptArgs:positional},{command:`cursor-agent`,label:`Cursor`,promptArgs:positional},{command:`droid`,label:`Droid`,promptArgs:positional},{command:`gemini`,label:`Gemini CLI`,promptArgs:e=>[`-i`,e]},{command:`opencode`,label:`opencode`,promptArgs:e=>[`--prompt`,e]},{command:`pi`,label:`Pi`,promptArgs:positional}],WINDOWS_EXECUTABLE_EXTENSIONS=[`.COM`,`.EXE`,`.BAT`,`.CMD`],defaultDependencies={createPrompter,hasInteractiveTerminal,isCodingAgentReplAvailable};function executableNames(e){if(process.platform!==`win32`)return[e];let t=process.env.PATHEXT?.split(`;`).filter(Boolean);return(t&&t.length>0?t:WINDOWS_EXECUTABLE_EXTENSIONS).map(t=>`${e}${t}`)}async function isExecutable(e){try{return(await stat(e)).isFile()?(await access(e,constants.X_OK),!0):!1}catch{return!1}}async function resolveCodingAgentRepl(e){let t=process.env.PATH;if(t===void 0||t.length===0)return null;for(let n of t.split(delimiter))if(n.length!==0)for(let t of executableNames(e)){let e=join(n,t);if(await isExecutable(e))return e}return null}async function isCodingAgentReplAvailable(e){return await resolveCodingAgentRepl(e)!==null}function handoffOptions(e,t){return[{value:`eve-dev`,label:`Start eve dev`,focusHint:`talk to '${t}' in your terminal`},...e.map(e=>({value:e.command,label:`Open ${e.label}`,focusHint:`build '${t}' using ${e.label}`})),{value:`exit`,label:`Exit`,focusHint:`return to your terminal`}]}async function selectInitHandoff(e){let t={...defaultDependencies,...e.deps};if(!t.hasInteractiveTerminal())return`eve-dev`;let n=await Promise.all(CODING_AGENT_REPLS.map(({command:e})=>t.isCodingAgentReplAvailable(e))),r=CODING_AGENT_REPLS.filter((e,t)=>n[t]);return r.length===0?`eve-dev`:t.createPrompter().select({message:`How would you like to continue?`,options:handoffOptions(r,e.agentName),initialValue:`eve-dev`})}function codingAgentRepl(e){let t=CODING_AGENT_REPLS.find(t=>t.command===e);if(t===void 0)throw Error(`Unsupported coding-agent REPL "${e}".`);return t}function isDirectlySpawnable(e,t){if(t!==`win32`)return!0;let n=extname(e).toLowerCase();return n===`.exe`||n===`.com`}function replSpawnPlan(e,t,n,r=process.platform){return t!==null&&isDirectlySpawnable(t,r)?{file:t,args:codingAgentRepl(e).promptArgs(n),shell:!1,seeded:!0}:{file:e,args:[],shell:r===`win32`,seeded:!1}}async function spawnCodingAgentRepl(e){let t=e.resolvePath??resolveCodingAgentRepl,n=replSpawnPlan(e.command,await t(e.command),e.prompt);return n.seeded||e.onPromptUnseeded?.(e.prompt),new Promise(t=>{let r=spawn(n.file,n.args,{cwd:e.cwd,shell:n.shell,stdio:`inherit`}),i=!1,settle=e=>{i||(i=!0,t(e))};r.once(`error`,()=>settle(!1)),r.once(`close`,e=>settle(e===0))})}export{isCodingAgentReplAvailable,replSpawnPlan,resolveCodingAgentRepl,selectInitHandoff,spawnCodingAgentRepl};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import { type CliApplicationContext } from "#cli/application-command.js";
|
|
2
3
|
interface IntegrationCommandLogger {
|
|
3
4
|
error(message: string): void;
|
|
4
5
|
log(message: string): void;
|
|
@@ -7,6 +8,6 @@ interface IntegrationCommandLogger {
|
|
|
7
8
|
export declare function registerIntegrationCommands(input: {
|
|
8
9
|
program: Command;
|
|
9
10
|
logger: IntegrationCommandLogger;
|
|
10
|
-
|
|
11
|
+
applicationContext: CliApplicationContext;
|
|
11
12
|
}): void;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseSetupAnswer}from"./setup-answers.js";function registerIntegrationCommands(
|
|
1
|
+
import{parseSetupAnswer}from"./setup-answers.js";import{applicationCommand}from"#cli/application-command.js";function registerIntegrationCommands(n){let{applicationContext:r,logger:i,program:a}=n,o=a.command(`integration`,{hidden:!0});applicationCommand(o.command(`setup <kind>`),r).option(`-y, --yes`).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).option(`--answer <key=value>`,`Answer a setup question; requires --non-interactive.`,parseSetupAnswer,{}).action(async(e,t)=>{let{runIntegrationSetupCommand:n}=await import(`./integration-setup.js`);await n(i,r.root,e,{yes:t.yes,nonInteractive:t.nonInteractive,answers:t.answer})}),applicationCommand(o.command(`connect <slug> <service> [canonical-name]`),r).option(`-y, --yes`).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).action(async(e,t,n,a)=>{let{runIntegrationConnectCommand:o}=await import(`./integration-connect.js`);await o(i,r.root,e,t,n,a)})}export{registerIntegrationCommands};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Command } from "#compiled/commander/index.js";
|
|
2
|
+
import { type CliApplicationContext } from "#cli/application-command.js";
|
|
2
3
|
interface ProjectCommandLogger {
|
|
3
4
|
error(message: string): void;
|
|
4
5
|
log(message: string): void;
|
|
@@ -7,6 +8,6 @@ interface ProjectCommandLogger {
|
|
|
7
8
|
export declare function registerProjectCommands(input: {
|
|
8
9
|
program: Command;
|
|
9
10
|
logger: ProjectCommandLogger;
|
|
10
|
-
|
|
11
|
+
applicationContext: CliApplicationContext;
|
|
11
12
|
}): void;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function registerProjectCommands(
|
|
1
|
+
import{applicationCommand}from"#cli/application-command.js";function registerProjectCommands(t){applicationCommand(t.program.command(`link`),t.applicationContext).description(`Link this directory to a Vercel project and pull AI Gateway credentials.`).action(async()=>{let{runLinkCommand:e}=await import(`./link.js`);await e(t.logger,t.applicationContext.root)}),applicationCommand(t.program.command(`deploy`),t.applicationContext).description(`Deploy the agent to Vercel production (links first if needed).`).action(async()=>{let{runDeployCommand:e}=await import(`./deploy.js`);await e(t.logger,t.applicationContext.root)})}export{registerProjectCommands};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Command } from "#compiled/commander/index.js";
|
|
2
|
+
import { type CliApplicationContext } from "#cli/application-command.js";
|
|
2
3
|
interface RegistryCommandLogger {
|
|
3
4
|
error(message: string): void;
|
|
4
5
|
log(message: string): void;
|
|
@@ -7,6 +8,6 @@ interface RegistryCommandLogger {
|
|
|
7
8
|
export declare function registerRegistryCommands(input: {
|
|
8
9
|
program: Command;
|
|
9
10
|
logger: RegistryCommandLogger;
|
|
10
|
-
|
|
11
|
+
applicationContext: CliApplicationContext;
|
|
11
12
|
}): void;
|
|
12
13
|
export {};
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";function parseSearchLimit(e){if(!/^\d+$/u.test(e))throw new InvalidArgumentError(`Expected a positive integer, received "${e}".`);let n=Number(e);if(n<1||n>100)throw new InvalidArgumentError(`Expected a limit between 1 and 100, received "${e}".`);return n}function registerRegistryCommands(
|
|
1
|
+
import{parseSetupAnswer}from"./setup-answers.js";import{InvalidArgumentError}from"#compiled/commander/index.js";import{applicationCommand}from"#cli/application-command.js";function parseSearchLimit(e){if(!/^\d+$/u.test(e))throw new InvalidArgumentError(`Expected a positive integer, received "${e}".`);let n=Number(e);if(n<1||n>100)throw new InvalidArgumentError(`Expected a limit between 1 and 100, received "${e}".`);return n}function registerRegistryCommands(r){let{applicationContext:i,logger:a,program:o}=r,s=applicationCommand(o.command(`add [item]`),i).description(`Install a registry item; relative paths use the official eve registry.`).option(`-o, --overwrite`,`Overwrite existing files.`).option(`--skip-install`,`Run the item's setup flow without installing it.`).option(`--skip-setup`,`Skip the item's setup flow.`).option(`--non-interactive`,`Run without interactive prompts, instead emit structured NDJSON when further input is required`).option(`--answer <key=value>`,`Answer a setup question with JSON; requires --non-interactive; repeat for multiple answers.`,parseSetupAnswer).option(`-y, --yes`,`Run setup and accept its recommended defaults.`).addHelpText(`after`,`
|
|
2
|
+
Search the registry:
|
|
3
|
+
$ eve registry search <query>
|
|
4
|
+
`).action(async(e,n)=>{if(e===void 0){s.outputHelp();return}if(n.answer!==void 0&&!n.nonInteractive)throw new InvalidArgumentError(`--answer requires --non-interactive.`);let{runAddCommand:r}=await import(`./registry.js`);await r(a,i.root,e,{...n,answers:n.answer})}),c=o.command(`registry`).description(`Configure and browse extension and agent registry catalogs.`);applicationCommand(c.command(`add <registries...>`),i).description(`Add registry namespace mappings to package.json.`).action(async e=>{let{runRegistryAddCommand:t}=await import(`./registry.js`);await t(a,i.root,e)}),applicationCommand(c.command(`list`),i).description(`List items from all registries or one source.`).option(`-r, --registry <source>`,`List items from one registry.`).option(`--json`,`Output as JSON`).action(async e=>{let{runRegistryListCommand:t}=await import(`./registry.js`);await t(a,i.root,e.registry,e)}),applicationCommand(c.command(`search <query>`),i).description(`Search all registries or one source.`).option(`-r, --registry <source>`,`Search one registry.`).option(`--limit <count>`,`Maximum results to return (default: 10).`,parseSearchLimit,10).option(`--json`,`Output as JSON`).action(async(e,t)=>{let{runRegistrySearchCommand:n}=await import(`./registry.js`);await n(a,i.root,e,t.registry,t)}),applicationCommand(c.command(`view <item>`),i).description(`Inspect one registry item.`).option(`--json`,`Output the raw registry item as JSON.`).action(async(e,t)=>{let{runRegistryViewCommand:n}=await import(`./registry.js`);await n(a,i.root,e,t)})}export{registerRegistryCommands};
|