eve 0.85.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +7 -4
  2. package/dist/CHANGELOG.md +38 -0
  3. package/dist/src/cli/commands/agent-prompt/collect-intent.md +2 -1
  4. package/dist/src/cli/commands/agent-prompt/scaffold.md +1 -2
  5. package/dist/src/cli/dev/tui/runner.d.ts +1 -1
  6. package/dist/src/cli/dev/tui/runner.js +1 -1
  7. package/dist/src/cli/run.js +1 -1
  8. package/dist/src/compiled/.vendor-stamp.json +4 -4
  9. package/dist/src/compiled/@vercel/schedules/index.d.ts +45 -6
  10. package/dist/src/compiled/@vercel/schedules/index.js +2 -2
  11. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  12. package/dist/src/execution/proxied-deliver-step.js +1 -1
  13. package/dist/src/execution/session/active-turn.js +1 -1
  14. package/dist/src/execution/session/answer-caller.d.ts +9 -5
  15. package/dist/src/execution/session/answer-caller.js +1 -1
  16. package/dist/src/execution/session/principal.d.ts +8 -0
  17. package/dist/src/execution/session/principal.js +1 -1
  18. package/dist/src/execution/session/program.js +1 -1
  19. package/dist/src/execution/session/turn-step.js +1 -1
  20. package/dist/src/execution/session/turn.js +1 -1
  21. package/dist/src/execution/session-callback-request.js +1 -1
  22. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  23. package/dist/src/harness/attachment-staging.d.ts +2 -2
  24. package/dist/src/harness/attachment-staging.js +1 -1
  25. package/dist/src/internal/application/stamped-package-version.js +1 -1
  26. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  27. package/dist/src/public/schedules/providers/vercel.d.ts +2 -0
  28. package/dist/src/public/schedules/providers/vercel.js +1 -1
  29. package/dist/src/runtime/subagents/workflow.js +1 -1
  30. package/dist/src/setup/scaffold/create/project.js +1 -1
  31. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  32. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  33. package/docs/channels/eve.mdx +1 -5
  34. package/docs/concepts/project-structure.mdx +1 -1
  35. package/docs/concepts/security-model.md +4 -0
  36. package/docs/concepts/upgrade-to-v27-events.md +68 -0
  37. package/docs/getting-started.mdx +2 -0
  38. package/docs/guides/auth-and-route-protection.md +1 -0
  39. package/docs/guides/client/streaming.mdx +1 -1
  40. package/docs/guides/deployment/self-hosting.md +1 -1
  41. package/docs/guides/frontend/meta.json +1 -0
  42. package/docs/guides/frontend/nextjs.mdx +329 -121
  43. package/docs/guides/frontend/overview.mdx +115 -335
  44. package/docs/guides/frontend/tanstack.mdx +1 -1
  45. package/docs/guides/frontend/use-eve-agent-svelte.mdx +5 -5
  46. package/docs/guides/frontend/use-eve-agent-vue.mdx +5 -5
  47. package/docs/guides/frontend/use-eve-agent.mdx +385 -0
  48. package/docs/guides/hooks.md +1 -1
  49. package/docs/guides/remote-agents.md +4 -2
  50. package/docs/guides/self-modification.md +6 -0
  51. package/docs/reference/cli.md +1 -2
  52. package/docs/sandbox/index.mdx +1 -1
  53. package/package.json +13 -21
  54. package/CHANGELOG.md +0 -3106
  55. package/dist/src/self-modification/agent.d.ts +0 -12
  56. package/dist/src/self-modification/agent.js +0 -1
package/README.md CHANGED
@@ -6,6 +6,10 @@ You author an agent as a directory on disk. The directory is the contract — ma
6
6
 
7
7
  The framework is called eve. The published npm package is `eve`. The CLI binary is `eve`.
8
8
 
9
+ ## Release notes
10
+
11
+ The installed package contains its release notes in `dist/CHANGELOG.md`, with a link to the full changelog through that version. For an upgrade across releases, review the target version's history at `https://raw.githubusercontent.com/vercel/eve/refs/tags/eve%40<version>/packages/eve/CHANGELOG.md`.
12
+
9
13
  ## Preview Terms and Safeguards
10
14
 
11
15
  eve is currently a preview and subject to the Vercel beta terms; the framework, APIs, documentation, and behavior may change before general availability.
@@ -119,9 +123,8 @@ npx eve@latest init my-agent
119
123
  ```
120
124
 
121
125
  `eve init` writes a new agent with eve's default model. Pass `--model
122
- openai/gpt-5.5` to choose another AI Gateway model, `--reasoning high` to set a
123
- reasoning effort, or `--channel-web-nextjs` to add the Web Chat application. It
124
- installs dependencies, initializes Git, and opens the terminal UI in an interactive
126
+ openai/gpt-5.5` to choose another AI Gateway model, or `--reasoning high` to set a
127
+ reasoning effort. It installs dependencies, initializes Git, and opens the terminal UI in an interactive
125
128
  human terminal. Coding-agent invocations return setup instructions instead.
126
129
  Targeting an existing project directory (`eve init .`) adds the agent files and
127
130
  missing dependencies instead. Initialization does not create a Vercel project,
@@ -191,4 +194,4 @@ and inspection. Channel-local addresses remain behind authored channel APIs.
191
194
 
192
195
  ## Changelog
193
196
 
194
- See [`./CHANGELOG.md`](./CHANGELOG.md) for the release history. The changelog ships inside the published package so agents can read it directly from `node_modules/eve/CHANGELOG.md` to evaluate upgrades.
197
+ The repository's `CHANGELOG.md` contains the full release history. For the installed package, see [Release notes](#release-notes).
@@ -0,0 +1,38 @@
1
+ # Release eve@0.86.0 | 2026-10-28 | minor
2
+
3
+ ## 🚀 Features
4
+
5
+ - `EVE_CALLBACK_TRUSTED_ORIGINS` now accepts a leading `*.` label, such as `https://*.preview.example.com`, so a remote agent can trust preview parents whose deployment URLs change on every deploy. [#5539](https://github.com/vercel/eve/pull/5539)
6
+
7
+ The wildcard matches exactly one subdomain label, and `*.vercel.app` and trailing dots are rejected.
8
+
9
+ - Hide `eve init --channel-web-nextjs` from `eve init --help` in favor of `eve add channel/web`. [#5474](https://github.com/vercel/eve/pull/5474)
10
+
11
+ The flag still works. The README and coding-agent setup instructions now point to `eve add channel/web`, which also sets up sign-in.
12
+
13
+ - Ship current release notes at `dist/CHANGELOG.md` with a version-pinned link to the full changelog. [#5446](https://github.com/vercel/eve/pull/5446)
14
+
15
+ ## 🐛 Bug Fixes
16
+
17
+ - The experimental Vercel schedule provider bundles Schedules SDK alpha.19 and identifies eve to the Schedules API with an `x-vss-framework: eve` header. [#5528](https://github.com/vercel/eve/pull/5528)
18
+
19
+ - A file returned by a tool now becomes a "could not be stored" note when the session's sandbox rejects the write, instead of failing the step and replaying its model call and tools. [#4843](https://github.com/vercel/eve/pull/4843)
20
+
21
+ - A turn's principal no longer changes while it runs. [#4925](https://github.com/vercel/eve/pull/4925)
22
+
23
+ Only the turn's own principal can answer a pending `ctx.ask()` or `ask_question` by typing, whether a workflow tool, a subagent or a remote agent asked; another person's text waits and runs as their own turn instead of answering the question under the asker's auth. A typed answer updates the claims on `ctx.session.auth.current`, so its `delivery.consumed` hook and the rest of the turn see the request that sent it. Someone else's button answer still settles the request as its responder.
24
+
25
+ ## Other Changes
26
+
27
+ See the [full list of changes](https://github.com/vercel/eve/compare/eve%400.85.0...eve%400.86.0).
28
+
29
+ ## Contributors
30
+
31
+ - [@benpankow](https://github.com/benpankow)
32
+ - [@chadhietala](https://github.com/chadhietala)
33
+ - [@cmpadden](https://github.com/cmpadden)
34
+ - [@elliotdauber](https://github.com/elliotdauber)
35
+ - [@OwenKephart](https://github.com/OwenKephart)
36
+ - [@ruiconti](https://github.com/ruiconti)
37
+
38
+ For an upgrade across multiple releases, review each version between the installed and target versions in the [target version's changelog](https://raw.githubusercontent.com/vercel/eve/refs/tags/eve%400.86.0/packages/eve/CHANGELOG.md).
@@ -6,7 +6,8 @@ the coding harness's prompt tools when available, and do not guess.
6
6
  1. What should the agent do? This becomes its always-on purpose.
7
7
  2. Where should it be reachable? Every agent ships the built-in HTTP channel. On
8
8
  top of that:
9
- - **Web Chat** (a Next.js app): add it at init with `--channel-web-nextjs`.
9
+ - **Web Chat** (a Next.js or TanStack Start app): add it after init with
10
+ `eve add channel/web`.
10
11
  - **Slack** and other platforms: add after deploy with `eve add channel/slack`.
11
12
  Credentials run through **Vercel Connect**, which provisions the bot token
12
13
  and verifies inbound webhooks, so there is no `SLACK_BOT_TOKEN` or signing
@@ -4,8 +4,7 @@ First settle the target: a new project, or the agent added to an existing
4
4
  directory? For a new project, propose a name and ask the user to confirm it; for
5
5
  an existing one, ask for the directory.
6
6
 
7
- For a new project, run (`--channel-web-nextjs` is only for users who want Web
8
- Chat):
7
+ For a new project, run:
9
8
 
10
9
  npx eve@latest init <name>
11
10
 
@@ -316,5 +316,5 @@ export declare class EveTUIRunner {
316
316
  run(): Promise<void>;
317
317
  }
318
318
  /** Returns the registry address carried by a packaged self-modification terminal handoff. */
319
- export declare function registryHandoffAddress(subagentName: string | undefined, toolName: string | undefined, output: unknown): string | undefined;
319
+ export declare function registryHandoffAddress(subagentName: string, toolName: string | undefined, output: unknown): string | undefined;
320
320
  export {};
@@ -1,4 +1,4 @@
1
1
  import{PROMPT_COMMANDS,formatPromptCommandHelp,parsePromptCommand}from"./prompt-commands.js";import{formatFailureDetail,formatFailureMessage,interruptedError,isInterruptedError,localFailureHint}from"./errors.js";import{conversationView,isWorking,tuiSessionData}from"./conversation-view.js";import{parseLogDisplayMode}from"./log-display-mode.js";import{createMcpConnectionStatusTracker}from"./mcp-connection-status.js";import{describeRemoteAuthCompletedMutations}from"./remote-auth-result.js";import{createRemoteConnectionController}from"./remote-connection.js";import{prepareRemoteTuiAccess}from"./remote-startup.js";import{formatStrandedSessionNotice}from"./stranded-session.js";import{isTerminalToolCallPart}from"./terminal-tool-part.js";import{BOOT_DETECTIONS,CLI_MISSING_SETUP_ISSUE,LOGIN_SETUP_ISSUE,detectSetupIssues,formatSetupIssuesLine,normalizeLocalModelEndpoint,orderedSetupIssues}from"./setup-issues.js";import{TerminalRenderer}from"./terminal-renderer.js";import{createVercelStatusTracker}from"./vercel-status.js";import{optionStyle}from"#channel/interaction-prompts.js";import{activeTurn,delivery,failure,openInteractions,task,turn}from"#protocol/session-projection/public-view.js";import{loadDevelopmentEnvironmentFiles}from"#cli/dev/environment.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{inspectApplication}from"#services/inspect-application.js";import{devBootPhase}from"#internal/dev-boot-progress.js";import{toErrorMessage}from"#shared/errors.js";import{isTaskAdmissionRefused}from"#protocol/task-tools.js";import{probeAgentInfo}from"#services/dev-client/agent-info-probe.js";import{APPROVE_OPTION_ID,DENY_OPTION_ID}from"#protocol/interaction-options.js";import"#client/conversation-state.js";import{SessionStore,attachSessionStore,detachSessionStore}from"#client/session-store.js";import{isAbortError}from"#client/session-store-helpers.js";import{renderApplicationInfo}from"#cli/commands/info.js";import{createDevelopmentRuntimeArtifactRefresher}from"#services/dev-client.js";function authIssueForStatus(e){if(e===`logged-out`)return LOGIN_SETUP_ISSUE;if(e===`cli-missing`)return CLI_MISSING_SETUP_ISSUE}function hasOpenTurn(e){return activeTurn(e.view)!==void 0}var EveTUIRunner=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=!1;#m;#h;#g=!0;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E=!1;#D;#O=!1;#k=new AbortController;#A=!1;#j=0;#M=0;#N=[];#P;#F;#I;#L;#R;#z=new Set;#B=new Set;#V=[];#H;#U=new Set;#W;#G=0;#K=new Set;#q=new Map;#J;constructor(e){if(this.#e=e.client,e.lifecycle!==void 0&&(this.#J=e.lifecycle),e.diagnostics!==void 0&&(this.#r=e.diagnostics),this.#n=createRenderer(e),this.#t=new SessionStore({client:e.client,followAgents:!0}),this.#t.setCallbacks({onEvent:e=>this.#Ue(e),onSessionChange:e=>{e!==void 0&&this.#n.setSessionId?.(e.sessionId)},prepareSend:e=>this.#ne(e)}),this.#i=e.name??`eve`,this.#y=e.withExclusiveTerminal,this.#a=e.formatTransportError??toErrorMessage,e.initialInput!==void 0&&(this.#l=e.initialInput),e.startup!==void 0&&(this.#u=e.startup),this.#f=e.onboard===!0,this.#m=e.onOnboardingStep,this.#h=e.onOnboardingTerminal,e.appRoot!==void 0){this.#c=e.appRoot;let t={appRoot:e.appRoot,onChange:e=>this.#n.setVercelStatus?.(e)};e.detectProjectIdentity!==void 0&&(t.detectIdentity=e.detectProjectIdentity),this.#F=createVercelStatusTracker(t),e.probeMcpConnection!==void 0&&(this.#I=createMcpConnectionStatusTracker({onChange:()=>{},probe:e.probeMcpConnection}))}e.promptCommandHandler!==void 0&&(this.#_=e.promptCommandHandler),this.#v=e.availablePromptCommands??PROMPT_COMMANDS,e.remote!==void 0&&(this.#x=e.remote.runAuthFlow,this.#b=createRemoteConnectionController({client:this.#e,credentials:e.remote.credentials,target:e.remote.target,onChange:e=>this.#n.setRemoteConnectionStatus?.(e),resolveOidcToken:e.remote.resolveOidcToken,resolveDeployment:e.remote.resolveDeployment})),this.#S=e.bootDetections??BOOT_DETECTIONS,this.#C=e.getVercelAuthStatus??getVercelAuthStatus,this.#w=e.inspectApplication??inspectApplication,e.onBootProgress!==void 0&&(this.#T=e.onBootProgress),e.serverUrl!==void 0&&(this.#s=e.serverUrl),e.serverUrl!==void 0&&e.remote===void 0&&(this.#o=createDevelopmentRuntimeArtifactRefresher({serverUrl:e.serverUrl}))}async#Y(){if(this.#s===void 0){this.#Q(),this.#f||await this.#we(void 0);return}let e;if(this.#b!==void 0){let t=await this.#b.check();t.state===`ready`&&(e=t.info)}else{let t=this.#e;if(t!==void 0)try{let n=await devBootPhase(`connecting to agent`,()=>probeAgentInfo({client:t,timeoutMs:2e3}),this.#T);n.kind===`ready`&&(e=n.info)}catch{e=void 0}}this.#Q();let t=this.#Z(e);this.#f||await this.#we(t)}#X(){let e=this.#u?.finish();return this.#d=e?.queuedPrompt,e?.draft??this.#l}#Z(e){let t=this.#c===void 0?e:normalizeLocalModelEndpoint(e,process.env);this.#L=t;let n=this.#s;if(n===void 0||this.#g)return t;let r={name:this.#i,serverUrl:n,localDevelopment:this.#c!==void 0};return t!==void 0&&(r.info=t),this.#n.renderAgentHeader?.(r),t}#Q(){let e=this.#T;this.#T=void 0,e?.({type:`before-first-paint`})}async run(){let onStop=()=>this.#n.requestInterrupt?.();this.#J?.signal.aborted===!0?onStop():this.#J?.signal.addEventListener(`abort`,onStop,{once:!0});let e=this.#t.subscribe(()=>this.#re());attachSessionStore(this.#t);try{await this.#$()}catch(e){if(!isInterruptedError(e))throw e}finally{this.#J?.signal.removeEventListener(`abort`,onStop),this.#E=!0,this.#k.abort(),this.#R?.abort(),e(),detachSessionStore(this.#t),this.#n.shutdown?.(),this.#F?.dispose(),this.#I?.dispose(),this.#b?.dispose()}}async#$(){let e=this.#i,t;this.#n.setStartupPhase?.(`starting`),await this.#Y(),this.#F?.refreshIdentity(),this.#I?.refresh();let n=(this.#f||this.#L?.agent.model.endpoint?.kind===`gateway`&&!this.#L.agent.model.endpoint.connected)&&this.#c!==void 0&&this.#_!==void 0&&this.#n.setupFlow!==void 0,r;if(this.#b!==void 0&&this.#n.setupFlow!==void 0){let e=await prepareRemoteTuiAccess({connection:this.#b,renderer:this.#n.setupFlow,signal:this.#J?.signal,runAuthFlow:this.#x});if(e?.kind===`authenticated`){let e=this.#b.current().connection;e.state===`ready`&&this.#Z(e.info)}else e?.kind===`failed`||e?.kind===`unavailable`?r={failed:!0,message:e.kind===`failed`?e.message:e.failure.message}:e?.kind===`cancelled`&&(r={cancelled:!0},e.completedMutations.length>0&&(r.message=`Completed before cancellation: ${describeRemoteAuthCompletedMutations(e.completedMutations).join(`, `)}.`))}n&&(this.#n.setStartupPhase?.(`connecting`),r=await this.#Ne(e));let i=this.#X();for(r?.cancelled||r?.failed?i=[this.#d,i].filter(Boolean).join(`
2
2
 
3
3
  `)||void 0:t=this.#d,this.#g=!1,this.#Z(this.#L),this.#Te(),this.#n.setStartupPhase?.(void 0),(!n||r?.cancelled||r?.failed)&&r?.message!==void 0&&this.#Oe({kind:`result`,message:r.message});this.#J?.signal.aborted!==!0&&this.#n.exitRequested?.()!==!0;){if(this.#ie()){this.#me();continue}if(this.#de().length>0){await this.#fe(e);continue}let n=isWorking(this.#t.snapshot.status)?void 0:this.#V.shift();if(n!==void 0){this.#H=n;try{await this.#Ce(n)}finally{this.#H=void 0}continue}if(t===void 0){let n=await this.#be({title:e,initialDraft:i});if(i=void 0,n===void 0)continue;if(n.type===`cancel`){this.#_e();continue}if(n.type===`interrupt`){this.#me(`Stopped following the turn and started a new session. Earlier context was cleared; the interrupted turn may still be running on the server.`);continue}t=n.text}let r=t;t=void 0;let a=parsePromptCommand(r);if(a===null){this.#te(r);continue}let o=await this.#ee(a,e);if(o===`exit`)return;o!==void 0&&(i=o.draft)}}async#ee(e,t){switch(e.type){case`exit`:return this.#Oe({kind:`dismiss`}),this.#J?.requestStop(),`exit`;case`cancel`:{let e=hasOpenTurn(this.#t.snapshot);e&&this.#_e(),this.#Oe({kind:`result`,summary:e?`Cancellation requested`:`No active turn to cancel`});return}case`new`:await this.#ye();return;case`compact`:await this.#ve({absent:`No active session to compact`,accepted:`Compaction requested`,failed:`Couldn't compact the session`,invoke:()=>this.#t.compact()});return;case`clear`:await this.#ve({absent:`No active session to clear`,accepted:`Session context cleared`,failed:`Couldn't clear the session`,invoke:()=>this.#t.clear()});return;case`help`:{if(this.#n.choosePromptCommand===void 0){this.#Oe({kind:`result`,message:formatPromptCommandHelp(this.#v)});return}let e=await this.#n.choosePromptCommand(this.#v);return e===void 0?void 0:{draft:e}}case`info`:await this.#Ie();return;case`loglevel`:{let t=this.#Le(e.argument),n=t.startsWith(`/loglevel is not available`)||t.startsWith(`Unknown log level`);this.#Oe(n?{kind:`result`,message:t}:{kind:`result`,summary:t});return}case`traces`:await this.#Fe(e.argument);return;case`extension`:await this.#Me(e,t,{trigger:`command`});return}}#te(e){let t=this.#t.snapshot,n=hasOpenTurn(t),r={text:e};this.#D=r,n||(this.#O=!1);let i=n?{message:e,turnPolicy:`steer`}:t.session===void 0?{message:e}:{message:e,turnPolicy:`queue`};this.#t.send(i).then(({deliveryId:e})=>{r.deliveryId=e,this.#E||this.#ae(this.#t.snapshot)}).catch(e=>{this.#E||isAbortError(e)||this.#se(n?`Steering failed`:`Error`,e)})}async#ne(e){return e.turnPolicy===`steer`?e:(this.#o!==void 0&&await this.#o.refresh({answers:e.answers,message:typeof e.message==`string`?e.message:void 0,onRuntimeArtifactsChanged:()=>this.#Ve()}),e.message!==void 0&&this.#n.flushDelayedDevBuildErrors?.(),e)}#re(){let e=this.#t.snapshot,t=tuiSessionData(e);this.#n.renderConversation?.(conversationView(e,t,this.#c===void 0?void 0:localFailureHint)),this.#oe(e.error,t.sessionFailed),this.#We(t.failures),this.#He(e),this.#ue(e),this.#Se(e),this.#ae(e),(t.sessionFailed||this.#de().length>0||!isWorking(e.status)&&this.#V.length>0)&&this.#R?.abort()}#ie(){return tuiSessionData(this.#t.snapshot).sessionFailed}#ae(e){let t=this.#D;if(t?.deliveryId===void 0)return;let n=delivery(e.view,t.deliveryId)?.turnId;if(n===void 0)return;let r=turn(e.view,n);if(r===void 0||r.status===`running`)return;let i=r.outcome;this.#D=void 0,i===`cancelled`&&!this.#O&&failure(e.view,n)===void 0&&this.#n.restoreDraft?.(t.text)}#oe(e,t){e!==void 0&&e!==this.#W&&(this.#W=e,!t&&(this.#le(e)||(this.#b?.reportFailure(e),this.#n.renderError?.(`Error`,this.#a(e)))))}#se(e,t){this.#le(t)||this.#n.renderError?.(e,this.#a(t))}#ce(e){return formatStrandedSessionNotice(e,{localServer:this.#c!==void 0,sessionId:this.#t.snapshot.session?.sessionId})}#le(e){let t=this.#ce(e);return t!==void 0&&(this.#n.renderError?.(`Session stranded`,t),!0)}#ue(e){!this.#f||this.#p||!e.messages.some(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`text`&&e.text.length>0))||(this.#p=!0,this.#m?.({flow:`onboarding`,step:`first_response`}))}#de(){return openInteractions(this.#t.snapshot.view).filter(e=>e.request.kind!==`sign-in`&&!this.#z.has(e.interactionId)&&!this.#B.has(e.interactionId))}async#fe(e){for(let t=0;;t+=1){let n=this.#de(),r=n[0];if(r===void 0)return;let i=inputContext(r,t+1,t+n.length),a=await this.#pe(r,i,e);if(a===void 0){this.#z.add(r.interactionId);continue}this.#B.add(r.interactionId),this.#t.send({answers:[a]}).catch(e=>{this.#B.delete(r.interactionId),!(this.#E||isAbortError(e))&&this.#se(`Error`,e)})}}async#pe(e,t,n){if(e.request.kind===`approval`){if(!this.#n.readToolApproval)throw Error(`Tool approval was requested, but the renderer does not support tool approval input.`);let r=await this.#n.readToolApproval(toAgentTUIToolApprovalRequest(e,t),{title:n});return{interactionId:e.interactionId,optionId:r.approved?APPROVE_OPTION_ID:DENY_OPTION_ID}}if(!this.#n.readInputQuestion)throw Error(`An interactive question was requested, but the renderer does not support input questions.`);let r=await this.#n.readInputQuestion(toAgentTUIInputQuestion(e,t),{title:n});if(r!==void 0)return{interactionId:e.interactionId,...r.optionId!==void 0&&{optionId:r.optionId},...r.text!==void 0&&{text:r.text}}}#me(e){this.#n.renderSessionBoundary===void 0?e===void 0&&this.#n.renderNotice?.(`Session ended — started a new session. Earlier context was cleared.`):this.#n.renderSessionBoundary(),e!==void 0&&this.#n.renderNotice?.(e),this.#he()}#he(){this.#t.newSession(),this.#ge()}#ge(){this.#z.clear(),this.#B.clear(),this.#U.clear(),this.#q.clear(),this.#G=0,this.#o?.clear()}#_e(){this.#O=!0,this.#t.cancel().catch(e=>{this.#n.renderNotice?.(`Couldn't cancel the turn: ${toErrorMessage(e)}`)})}async#ve(e){if(this.#t.snapshot.session===void 0){this.#Oe({kind:`result`,summary:e.absent});return}try{let t=await(await e.invoke()).result();if(t.status!==`completed`)throw Error(`The command settled ${t.status}.`);this.#Oe({kind:`result`,summary:e.accepted})}catch(t){this.#Oe({kind:`result`,message:this.#ce(t)??toErrorMessage(t),summary:e.failed})}}async#ye(){try{this.#t.snapshot.session!==void 0&&await(await this.#t.reset()).result(),this.#t.newSession()}catch(e){this.#Oe({kind:`result`,message:`Couldn't reset the session: ${toErrorMessage(e)}`});return}this.#ge(),this.#n.reset?.(),this.#Oe({kind:`dismiss`})}async#be(e){if(!this.#n.readInput)throw Error(`The renderer does not support prompt input.`);let t=new AbortController;this.#R=t;try{let n=await this.#xe(this.#n.readInput({...e,signal:t.signal}));if(n===void 0&&!t.signal.aborted)throw interruptedError();return n}finally{this.#R===t&&(this.#R=void 0)}}async#xe(e){let t=this.#o;if(t===void 0)return await e;let n=!1,r=!1,i,a=!1,o=0,refresh=async()=>{if(!(n||r)){r=!0;try{await t.refreshIdle({onRuntimeArtifactsChanged:()=>this.#Ve()}),this.#c!==void 0&&this.#L===void 0&&!a&&(a=!0,this.#ze().finally(()=>{a=!1}));let e=this.#L?.agent.model.endpoint,n=e?.kind===`chatgpt`&&(e.state===`signed-out`||e.state===`reauth-required`),r=Date.now();n&&r-o>=5e3&&(o=r,this.#ze())}finally{r=!1}}},startRefresh=()=>{if(n||r)return;let e=refresh().finally(()=>{i===e&&(i=void 0)});i=e};startRefresh();let s=setInterval(()=>{startRefresh()},500);s.unref?.();try{return await e}finally{n=!0,clearInterval(s),await i}}#Se(e){if(this.#c!==void 0)for(let{callId:t,address:n}of registryHandoffs(e))this.#U.has(t)||(this.#U.add(t),!(this.#H===n||this.#V.includes(n))&&this.#V.push(n))}async#Ce(e){this.#n.renderCommandInvocation?.(`/add ${e}`),await this.#Me({type:`extension`,name:`add`,argument:e},`Add to your agent`,{trigger:`command`})}async#we(e){if(this.#c===void 0)return;let t={appRoot:this.#c,env:process.env};e!==void 0&&(t.info=e),this.#N=await detectSetupIssues(t,this.#S),this.#n.renderSetupWarning!==void 0&&(this.#Te(),this.#Ee())}#Te(){if(this.#g)return;let e=orderedSetupIssues(this.#N,this.#P);e.length>0?this.#n.renderSetupWarning?.(formatSetupIssuesLine(e)):this.#n.clearSetupWarning?.()}async#Ee(){let e=this.#c;if(e===void 0||process.env.EVE_MODEL_CONNECTION!==`ai-gateway-project`)return;let t;try{t=await this.#C(e,{signal:this.#k.signal})}catch{return}this.#E||this.#A||(this.#P=authIssueForStatus(t),this.#Te())}async#De(e){let t=this.#c;if(t===void 0||this.#n.renderSetupWarning===void 0)return;let n=++this.#j,r={appRoot:t,env:process.env};e!==void 0&&(r.info=e);try{let[e,i]=await Promise.all([detectSetupIssues(r,this.#S),process.env.EVE_MODEL_CONNECTION===`ai-gateway-project`?this.#C(t,{signal:this.#k.signal}):void 0]);if(this.#E||n!==this.#j)return;this.#N=e,this.#P=i===void 0?void 0:authIssueForStatus(i),this.#Te()}catch{return}}#Oe(e){if(this.#n.finishCommand!==void 0){this.#n.finishCommand(e);return}if(e.kind===`result`){let t=[e.summary,e.message].filter(Boolean).join(`
4
- `);t!==``&&this.#n.renderNotice?.(t)}}async#ke(e,t){let n=this.#_;if(n===void 0)return{message:`/${e.name} is not available in this session.`};let r=this.#L?.agent.model.endpoint,i={...t,renderer:this.#n,settleOutcome:e=>this.#je(e),chatGptAccountLabel:r?.kind===`chatgpt`&&r.state===`ready`?r.accountLabel:void 0,withExclusiveTerminal:this.#y},a=this.#I?.current(),o=a!==void 0&&Object.keys(a).length>0?{...i,disabledConnectionReasons:a}:i;return await n.handle(e,o)}async#Ae(e){if(e?.kind===`model-access-changed`){this.#F?.applyEffect({kind:`refresh-identity`}),this.#A=!0,await this.#Re(e);return}e!==void 0&&(this.#F?.applyEffect(e),this.#A=!0,this.#De(this.#L))}async#je(e){if(e.effect===void 0)return e;let t=e.effect.kind===`model-access-changed`&&e.effect.reload?setTimeout(()=>{this.#g&&this.#n.setStartupPhase?.(`updating`),this.#n.setupFlow?.setStatus(`Loading selected model…`)},150):void 0;try{await this.#Ae(e.effect);let{effect:t,...n}=e;return n}catch{return{failed:!0,message:`Settings were saved, but the agent could not reload. Retry the command or restart eve dev.`}}finally{clearTimeout(t)}}async#Me(e,t,n){let r=await this.#ke(e,{...n,title:t}),i=r===void 0?void 0:await this.#je(r);return!(n.suppressSuccessfulTranscript===!0&&i?.failed!==!0||n.suppressCancelledTranscript===!0&&i?.cancelled===!0)&&n.trigger!==`startup`&&(i===void 0?this.#Oe({kind:`result`}):this.#Oe({kind:`result`,message:i.message,summary:i.summary})),this.#Pe(),i}async#Ne(e){this.#m?.({flow:`onboarding`,step:`model_provider`});let t=await this.#Me({type:`extension`,name:`login`,argument:``},e,{trigger:`startup`,initialModelStep:`provider`});return!t?.cancelled&&t?.failed!==!0&&this.#m?.({flow:`onboarding`,step:`connection_ready`}),this.#h?.({flow:`onboarding`,step:`model_provider`,result:t?.cancelled?`cancelled`:t?.failed===!0?`error`:`completed`}),t}#Pe(){if(this.#g)return;let e=this.#b?.current().connection;e?.state===`ready`&&e.info!==this.#L&&(this.#L=e.info,this.#s!==void 0&&this.#n.renderAgentHeader?.({info:e.info,name:this.#i,serverUrl:this.#s}))}async#Fe(e){if(this.#c===void 0||this.#n.traceViewer===void 0){this.#Oe({kind:`result`,message:`/traces is only available in local dev sessions.`});return}try{await this.#n.traceViewer.open({appRoot:this.#c,sessionId:this.#t.snapshot.session?.sessionId,reference:e===``?void 0:e})}catch(e){if(isInterruptedError(e))return;throw e}finally{this.#Oe({kind:`dismiss`})}}async#Ie(){let e=this.#c;if(e===void 0){this.#Oe({kind:`result`,message:`/info is only available in local dev sessions.`});return}try{let t=renderApplicationInfo(await this.#w(e));this.#n.showInfoPanel===void 0?this.#Oe({kind:`result`,message:t}):await this.#n.showInfoPanel(t)}catch(e){this.#Oe({kind:`result`,message:`Couldn't inspect the application: ${toErrorMessage(e)}`})}}#Le(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel none|error|warn|debug|all — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use none, error, warn, debug, or all.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`error`:return`Showing errors.`;case`warn`:return`Showing warnings and errors.`;case`debug`:return`Showing all severity-tagged logs.`;case`all`:return`Showing all logs.`}}async#Re(e){let t=this.#c;t!==void 0&&(++this.#M,++this.#j,await loadDevelopmentEnvironmentFiles(t),e.reload&&await this.#o?.refreshAfterSourceChange({}),e.model&&this.#L?this.#Z({...this.#L,agent:{...this.#L.agent,model:{...this.#L.agent.model,...e.model}}}):this.#Z(this.#L),this.#N=[],this.#P=void 0,this.#Te(),this.#ze())}async#ze(e=!1){let t=this.#L,n=++this.#M,r=await this.#Be();this.#E||n!==this.#M||r===void 0||(this.#Z(r),e&&!this.#n.renderAgentHeader&&this.#n.renderNotice?.(formatAgentUpdateNotice(t,r)),this.#De(this.#L))}async#Be(){let e=this.#e;if(e===void 0)return;let t=await probeAgentInfo({client:e});return t.kind===`ready`?t.info:void 0}#Ve(){this.#ze(!0)}#He(e){let t=this.#r;if(t!==void 0){for(let n of Object.values(e.agents))if(n.observation.status!==`not-followed`)for(let e of n.observation.conversation?.messages??[])for(let r of e.parts)r.type===`tool`&&r.state===`failed`&&(this.#K.has(r.callId)||(this.#K.add(r.callId),t.append({source:`tool`,summary:`${r.name} failed (subagent ${n.name})`,detail:r.error?.message??`Failed.`})))}}#Ue(e){let t=this.#r;if(t!==void 0)switch(e.type){case`call.requested`:this.#q.set(e.data.callId,e.data.capability.name),e.data.capability.kind===`tool`&&t.recordToolCall(e.data.capability.name);break;case`call.settled`:{let n=this.#q.get(e.data.callId)??e.data.callId;isTaskAdmissionRefused(e.data)?t.append({source:`tool`,summary:`${n} was refused for the model to retry`,detail:e.data.error?.message??`Refused.`}):e.data.outcome===`failed`&&t.append({source:`tool`,summary:`${n} failed`,detail:e.data.error?.message??`Tool failed.`});break}case`task.ended`:e.data.outcome===`failed`&&t.append({source:`tool`,summary:`${task(this.#t.snapshot.view,e.data.taskId)?.name??`A task`} ended with an error`,detail:e.data.error?.message??`Task failed.`});break;case`child.opened`:`callId`in e.data.owner&&t.recordSubagentDispatch(e.data.owner.callId);break;case`usage.recorded`:t.recordStepUsage(e.data.usage)}}#We(e){e.length<this.#G&&(this.#G=0);for(let{error:t}of e.slice(this.#G)){let e=formatFailureMessage(t),n={detail:formatFailureDetail(t)??e,source:`workflow`,summary:`Error: ${e}`};this.#r?.append(t.hint===void 0?n:{...n,hint:t.hint})}this.#G=e.length}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,availablePromptCommands:e.availablePromptCommands,argumentSuggestions:e.argumentSuggestions,input:e.userInput,output:e.screen,diagnostics:e.diagnostics,onExitRequest:e.lifecycle?.requestStop})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}function registryHandoffs(e){let t=[],collect=(e,n)=>{for(let r of e.messages)for(let e of r.parts){if(!isTerminalToolCallPart(e)||e.state!==`completed`)continue;let r=registryHandoffAddress(n,e.name,e.output);r!==void 0&&t.push({callId:e.callId,address:r})}};collect(e,void 0);for(let t of Object.values(e.agents)){if(t.observation.status===`not-followed`)continue;let e=t.observation.conversation;e!==void 0&&collect(e,t.name)}return t}function registryHandoffAddress(e,t,n){if((e!==`self-modification__agent`||t!==`registry_add`)&&(e!==void 0||t!==`selfmod__registry_add`)||typeof n!=`object`||!n)return;let r=n;return r.status===`needs-terminal`&&typeof r.address==`string`?r.address:void 0}function inputContext(e,t,n){let r={};return n>1&&(r.position={index:t,total:n}),e.taskId!==void 0&&(r.taskId=e.taskId),r.position===void 0&&r.taskId===void 0?void 0:r}function toAgentTUIToolApprovalRequest(e,t){let n={approvalId:e.interactionId,toolCallId:e.call?.callId??e.interactionId,toolName:e.call?.name??e.request.kind,prompt:e.request.prompt,input:e.call?.input??{}};return t!==void 0&&(n.context=t),n}function toAgentTUIInputQuestion(e,t){let n=e.request.display===`text`?`text`:e.request.display===`select`||e.request.options!==void 0&&e.request.options.length>0?`select`:`text`,r={requestId:e.interactionId,prompt:e.request.prompt,display:n};return e.request.options!==void 0&&(r.options=e.request.options.map(e=>{let t={id:e.id,label:e.label};e.description!==void 0&&(t.description=e.description);let n=optionStyle(e);return n!==void 0&&(t.style=n),t})),e.request.allowFreeform!==void 0&&(r.allowFreeform=e.request.allowFreeform),t!==void 0&&(r.context=t),r}export{EveTUIRunner,registryHandoffAddress};
4
+ `);t!==``&&this.#n.renderNotice?.(t)}}async#ke(e,t){let n=this.#_;if(n===void 0)return{message:`/${e.name} is not available in this session.`};let r=this.#L?.agent.model.endpoint,i={...t,renderer:this.#n,settleOutcome:e=>this.#je(e),chatGptAccountLabel:r?.kind===`chatgpt`&&r.state===`ready`?r.accountLabel:void 0,withExclusiveTerminal:this.#y},a=this.#I?.current(),o=a!==void 0&&Object.keys(a).length>0?{...i,disabledConnectionReasons:a}:i;return await n.handle(e,o)}async#Ae(e){if(e?.kind===`model-access-changed`){this.#F?.applyEffect({kind:`refresh-identity`}),this.#A=!0,await this.#Re(e);return}e!==void 0&&(this.#F?.applyEffect(e),this.#A=!0,this.#De(this.#L))}async#je(e){if(e.effect===void 0)return e;let t=e.effect.kind===`model-access-changed`&&e.effect.reload?setTimeout(()=>{this.#g&&this.#n.setStartupPhase?.(`updating`),this.#n.setupFlow?.setStatus(`Loading selected model…`)},150):void 0;try{await this.#Ae(e.effect);let{effect:t,...n}=e;return n}catch{return{failed:!0,message:`Settings were saved, but the agent could not reload. Retry the command or restart eve dev.`}}finally{clearTimeout(t)}}async#Me(e,t,n){let r=await this.#ke(e,{...n,title:t}),i=r===void 0?void 0:await this.#je(r);return!(n.suppressSuccessfulTranscript===!0&&i?.failed!==!0||n.suppressCancelledTranscript===!0&&i?.cancelled===!0)&&n.trigger!==`startup`&&(i===void 0?this.#Oe({kind:`result`}):this.#Oe({kind:`result`,message:i.message,summary:i.summary})),this.#Pe(),i}async#Ne(e){this.#m?.({flow:`onboarding`,step:`model_provider`});let t=await this.#Me({type:`extension`,name:`login`,argument:``},e,{trigger:`startup`,initialModelStep:`provider`});return!t?.cancelled&&t?.failed!==!0&&this.#m?.({flow:`onboarding`,step:`connection_ready`}),this.#h?.({flow:`onboarding`,step:`model_provider`,result:t?.cancelled?`cancelled`:t?.failed===!0?`error`:`completed`}),t}#Pe(){if(this.#g)return;let e=this.#b?.current().connection;e?.state===`ready`&&e.info!==this.#L&&(this.#L=e.info,this.#s!==void 0&&this.#n.renderAgentHeader?.({info:e.info,name:this.#i,serverUrl:this.#s}))}async#Fe(e){if(this.#c===void 0||this.#n.traceViewer===void 0){this.#Oe({kind:`result`,message:`/traces is only available in local dev sessions.`});return}try{await this.#n.traceViewer.open({appRoot:this.#c,sessionId:this.#t.snapshot.session?.sessionId,reference:e===``?void 0:e})}catch(e){if(isInterruptedError(e))return;throw e}finally{this.#Oe({kind:`dismiss`})}}async#Ie(){let e=this.#c;if(e===void 0){this.#Oe({kind:`result`,message:`/info is only available in local dev sessions.`});return}try{let t=renderApplicationInfo(await this.#w(e));this.#n.showInfoPanel===void 0?this.#Oe({kind:`result`,message:t}):await this.#n.showInfoPanel(t)}catch(e){this.#Oe({kind:`result`,message:`Couldn't inspect the application: ${toErrorMessage(e)}`})}}#Le(e){let t=this.#n;if(t.logDisplayMode===void 0||t.setLogDisplayMode===void 0)return`/loglevel is not available in this session.`;if(e===``)return`Logs: ${t.logDisplayMode()}. Use /loglevel none|error|warn|debug|all — logs stay buffered, so switching also hides or restores past lines.`;let n=parseLogDisplayMode(e);if(n===void 0)return`Unknown log level "${e}". Use none, error, warn, debug, or all.`;if(n===t.logDisplayMode())return`Logs already set to ${n}.`;switch(t.setLogDisplayMode(n),n){case`none`:return`Logs hidden. Output stays buffered — /loglevel all restores it.`;case`error`:return`Showing errors.`;case`warn`:return`Showing warnings and errors.`;case`debug`:return`Showing all severity-tagged logs.`;case`all`:return`Showing all logs.`}}async#Re(e){let t=this.#c;t!==void 0&&(++this.#M,++this.#j,await loadDevelopmentEnvironmentFiles(t),e.reload&&await this.#o?.refreshAfterSourceChange({}),e.model&&this.#L?this.#Z({...this.#L,agent:{...this.#L.agent,model:{...this.#L.agent.model,...e.model}}}):this.#Z(this.#L),this.#N=[],this.#P=void 0,this.#Te(),this.#ze())}async#ze(e=!1){let t=this.#L,n=++this.#M,r=await this.#Be();this.#E||n!==this.#M||r===void 0||(this.#Z(r),e&&!this.#n.renderAgentHeader&&this.#n.renderNotice?.(formatAgentUpdateNotice(t,r)),this.#De(this.#L))}async#Be(){let e=this.#e;if(e===void 0)return;let t=await probeAgentInfo({client:e});return t.kind===`ready`?t.info:void 0}#Ve(){this.#ze(!0)}#He(e){let t=this.#r;if(t!==void 0){for(let n of Object.values(e.agents))if(n.observation.status!==`not-followed`)for(let e of n.observation.conversation?.messages??[])for(let r of e.parts)r.type===`tool`&&r.state===`failed`&&(this.#K.has(r.callId)||(this.#K.add(r.callId),t.append({source:`tool`,summary:`${r.name} failed (subagent ${n.name})`,detail:r.error?.message??`Failed.`})))}}#Ue(e){let t=this.#r;if(t!==void 0)switch(e.type){case`call.requested`:this.#q.set(e.data.callId,e.data.capability.name),e.data.capability.kind===`tool`&&t.recordToolCall(e.data.capability.name);break;case`call.settled`:{let n=this.#q.get(e.data.callId)??e.data.callId;isTaskAdmissionRefused(e.data)?t.append({source:`tool`,summary:`${n} was refused for the model to retry`,detail:e.data.error?.message??`Refused.`}):e.data.outcome===`failed`&&t.append({source:`tool`,summary:`${n} failed`,detail:e.data.error?.message??`Tool failed.`});break}case`task.ended`:e.data.outcome===`failed`&&t.append({source:`tool`,summary:`${task(this.#t.snapshot.view,e.data.taskId)?.name??`A task`} ended with an error`,detail:e.data.error?.message??`Task failed.`});break;case`child.opened`:`callId`in e.data.owner&&t.recordSubagentDispatch(e.data.owner.callId);break;case`usage.recorded`:t.recordStepUsage(e.data.usage)}}#We(e){e.length<this.#G&&(this.#G=0);for(let{error:t}of e.slice(this.#G)){let e=formatFailureMessage(t),n={detail:formatFailureDetail(t)??e,source:`workflow`,summary:`Error: ${e}`};this.#r?.append(t.hint===void 0?n:{...n,hint:t.hint})}this.#G=e.length}};function createRenderer(e){return e.renderer?e.renderer:new TerminalRenderer({tools:e.tools,reasoning:e.reasoning,subagents:e.subagents,connectionAuth:e.connectionAuth,assistantResponseStats:e.assistantResponseStats,contextSize:e.contextSize,logs:e.logs,availablePromptCommands:e.availablePromptCommands,argumentSuggestions:e.argumentSuggestions,input:e.userInput,output:e.screen,diagnostics:e.diagnostics,onExitRequest:e.lifecycle?.requestStop})}function formatAgentUpdateNotice(e,t){let n=e?.agent.model.id,r=t?.agent.model.id;return n!==void 0&&r!==void 0&&n!==r?`Agent updated: Model ${n} -> ${r}`:`Agent updated.`}function registryHandoffs(e){let t=[],collect=(e,n)=>{for(let r of e.messages)for(let e of r.parts){if(!isTerminalToolCallPart(e)||e.state!==`completed`)continue;let r=registryHandoffAddress(n,e.name,e.output);r!==void 0&&t.push({callId:e.callId,address:r})}};for(let t of Object.values(e.agents)){if(t.observation.status===`not-followed`)continue;let e=t.observation.conversation;e!==void 0&&collect(e,t.name)}return t}function registryHandoffAddress(e,t,n){if(e!==`self-modification__agent`||t!==`registry_add`||typeof n!=`object`||!n)return;let r=n;return r.status===`needs-terminal`&&typeof r.address==`string`?r.address:void 0}function inputContext(e,t,n){let r={};return n>1&&(r.position={index:t,total:n}),e.taskId!==void 0&&(r.taskId=e.taskId),r.position===void 0&&r.taskId===void 0?void 0:r}function toAgentTUIToolApprovalRequest(e,t){let n={approvalId:e.interactionId,toolCallId:e.call?.callId??e.interactionId,toolName:e.call?.name??e.request.kind,prompt:e.request.prompt,input:e.call?.input??{}};return t!==void 0&&(n.context=t),n}function toAgentTUIInputQuestion(e,t){let n=e.request.display===`text`?`text`:e.request.display===`select`||e.request.options!==void 0&&e.request.options.length>0?`select`:`text`,r={requestId:e.interactionId,prompt:e.request.prompt,display:n};return e.request.options!==void 0&&(r.options=e.request.options.map(e=>{let t={id:e.id,label:e.label};e.description!==void 0&&(t.description=e.description);let n=optionStyle(e);return n!==void 0&&(t.style=n),t})),e.request.allowFreeform!==void 0&&(r.allowFreeform=e.request.allowFreeform),t!==void 0&&(r.context=t),r}export{EveTUIRunner,registryHandoffAddress};
@@ -1,2 +1,2 @@
1
- import{Command,CommanderError}from"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{waitForShutdownSignal}from"#cli/shutdown.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{findEveProjectContext,resolveEveProjectContext}from"#internal/project-context.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{areSchedulesDisabled}from"#internal/schedules/disabled.js";import{findCliApplicationRoot,resolveCliApplicationProject}from"#cli/application-root.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{registerDevelopmentCommand,registerRemoteCommands}from"#cli/dev/command.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{registerAcpCommand}from"#cli/acp/command.js";import{parseAgentNamesOption,parsePortOption,parseReasoningOption}from"#cli/option-parsers.js";import{registerEveTelemetryCommands}from"#cli/telemetry/command.js";import{canonicalCommand,createEveCliTelemetry}from"#cli/telemetry/index.js";async function loadPrintApplicationInfo(){return(await import(`#cli/commands/info.js`)).printApplicationInfo}async function loadRunEvalCommand(){return(await import(`#evals/cli/eval.js`)).runEvalCommand}async function loadStartProductionHost(){return(await import(`#internal/nitro/host.js`)).startProductionServer}function createCliProgram(e,t,n,r){let i=resolveInstalledPackageInfo().version,a=new Command,o=createCliTheme();a.name(`eve`).description(`Build and run an eve application.`).version(i).showHelpAfterError().exitOverride().hook(`preAction`,(t,n)=>{let{json:r}=n.opts();!r&&(n.name()===`info`||n.name()===`init`&&n.parent!==a)&&e.log(eveCliBanner())}).configureOutput({writeErr:t=>{e.error(t.trimEnd())},writeOut:t=>{e.log(t.trimEnd())}}),registerEveTelemetryCommands(a,e),registerIntegrationCommands({program:a,logger:e,applicationContext:n});let s=a.command(`extension`).description(`Create and build reusable eve extension packages.`);s.command(`init [target]`).description(`Create a new eve extension package.`).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,i)=>{i.yes&&e.error(`warning: --yes has no effect for eve extension init.`);let{runExtensionInitCommand:a}=await import(`#cli/commands/extension-init.js`);await a(e,n.root,t,void 0,e=>{r.trackSetupStep({flow:`extension_init`,step:e})})}),s.command(`build`).description(`Build the current package as an eve extension.`).action(async()=>{let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);await t(n.root);let{runExtensionBuildCommand:r}=await import(`#cli/commands/extension-build.js`);await r(e,n.root)}),registerRegistryCommands({program:a,logger:e,applicationContext:n}),a.command(`init [target]`).description(`Create a new eve agent, or add one to an existing project directory.`).option(`--channel-web-nextjs`,`Add the Web Chat application (Next.js)`).option(`--agents <names>`,`Create an agents/ workspace with comma-separated agent names`,parseAgentNamesOption).option(`--model <model>`,`Set the agent model (provider/model-id)`).option(`-n, --non-interactive`,`Scaffold the agent without starting development`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,i)=>{i.yes&&e.error(`warning: --yes has no effect for eve init.`);let{runInitCommand:a}=await import(`#cli/commands/init.js`);await a(e,n.root,t,{agents:i.agents,channelWebNextjs:i.channelWebNextjs,model:i.model,reasoning:i.reasoning,nonInteractive:i.nonInteractive},void 0,e=>{r.trackSetupStep({flow:`init`,step:e})},(e,t,n)=>{r.trackSetupTerminal({flow:`init`,step:e,result:t,failureCode:n})})});let c=a.command(`set`).description(`Change root agent model settings.`);agentCommand(c.command(`model [model]`),n).description(`Set the agent model and reasoning effort.`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).action(async(t,r)=>{let{runSetCommand:i}=await import(`#cli/commands/set.js`);await i(e,n.root,{model:t,reasoning:r.reasoning})}),registerProjectCommands({program:a,logger:e,applicationContext:n}),registerBuildCommand({applicationContext:n,buildHost:t.buildHost,logger:e,program:a}),agentCommand(a.command(`start`),n).description(`Start a built eve application.`).option(`--no-schedules`,`Start without running authored cron schedules`).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 3000)`,parsePortOption).action(async r=>{let{loadDevelopmentEnvironmentFiles:i}=await import(`#cli/dev/environment.js`);await i(n.root);let a=await(t.startProductionHost??await loadStartProductionHost())(n.root,{host:r.host,port:r.port,schedules:r.schedules});e.log(renderCliTaggedLine(o,{message:`server listening at ${a.url}`,tag:`start`,tone:`success`})),(r.schedules===!1||areSchedulesDisabled())&&e.log(renderCliTaggedLine(o,{message:`schedules disabled`,tag:`start`,tone:`info`})),await waitForShutdownSignal({close:()=>a.close(),wait:()=>a.wait()})});let l=a.command(`remote`).description(`Connect to an existing eve agent.`);registerRemoteCommands({applicationContext:n,logger:e,program:l,runtime:t,telemetry:r}),registerAcpCommand({applicationContext:n,eveVersion:i,program:a,resolveVerifiedRemoteDevelopmentClient:t.resolveVerifiedRemoteDevelopmentClient,runAcpServer:t.runAcpServer,startHost:t.startHost}),registerDevelopmentCommand({applicationContext:n,logger:e,program:a,runtime:t,telemetry:r});let u=a.command(`logs`).description("Inspect local `eve dev` diagnostic logs (.eve/logs).");agentCommand(u.command(`show [logid]`,{isDefault:!0}),n).description(`Print a diagnostic log (the most recent when logid is omitted).`).option(`--dump`,`Prepend the log's environment dump (.dump sibling)`).option(`--events`,`Interleave session events from the local workflow store`).action(async(t,r)=>{let{runLogsShowCommand:i}=await import(`#cli/commands/logs.js`);await i(e,n.root,t,r)}),agentCommand(u.command(`list`).alias(`ls`),n).description(`List diagnostic logs, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runLogsListCommand:r}=await import(`#cli/commands/logs.js`);await r(e,n.root,t)});let d=a.command(`traces`).usage(`[options] [trace]
1
+ import{Command,CommanderError,Option}from"#compiled/commander/index.js";import{agentCommand}from"#cli/agent-command.js";import{parseDevelopmentServerUrl}from"#cli/dev/url.js";import{waitForShutdownSignal}from"#cli/shutdown.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createCliTheme,renderCliTaggedLine}from"#cli/ui/output.js";import{findEveProjectContext,resolveEveProjectContext}from"#internal/project-context.js";import{isCodingAgentLaunch}from"#cli/agent-detection.js";import{eveCliBanner}from"#cli/banner.js";import{registerBuildCommand}from"#cli/commands/build.js";import{resolveApplicationRoot}from"#internal/application/paths.js";import{areSchedulesDisabled}from"#internal/schedules/disabled.js";import{findCliApplicationRoot,resolveCliApplicationProject}from"#cli/application-root.js";import{registerIntegrationCommands}from"#cli/commands/register-integration-commands.js";import{registerProjectCommands}from"#cli/commands/register-project-commands.js";import{registerRegistryCommands}from"#cli/commands/register-registry-commands.js";import{registerDevelopmentCommand,registerRemoteCommands}from"#cli/dev/command.js";import{resolveDevUiMode,resolveTuiDisplayOptions}from"#cli/dev/ui-options.js";import{registerAcpCommand}from"#cli/acp/command.js";import{parseAgentNamesOption,parsePortOption,parseReasoningOption}from"#cli/option-parsers.js";import{registerEveTelemetryCommands}from"#cli/telemetry/command.js";import{canonicalCommand,createEveCliTelemetry}from"#cli/telemetry/index.js";async function loadPrintApplicationInfo(){return(await import(`#cli/commands/info.js`)).printApplicationInfo}async function loadRunEvalCommand(){return(await import(`#evals/cli/eval.js`)).runEvalCommand}async function loadStartProductionHost(){return(await import(`#internal/nitro/host.js`)).startProductionServer}function createCliProgram(e,t,n,r){let i=resolveInstalledPackageInfo().version,a=new Command,o=createCliTheme();a.name(`eve`).description(`Build and run an eve application.`).version(i).showHelpAfterError().exitOverride().hook(`preAction`,(t,n)=>{let{json:r}=n.opts();!r&&(n.name()===`info`||n.name()===`init`&&n.parent!==a)&&e.log(eveCliBanner())}).configureOutput({writeErr:t=>{e.error(t.trimEnd())},writeOut:t=>{e.log(t.trimEnd())}}),registerEveTelemetryCommands(a,e),registerIntegrationCommands({program:a,logger:e,applicationContext:n});let s=a.command(`extension`).description(`Create and build reusable eve extension packages.`);s.command(`init [target]`).description(`Create a new eve extension package.`).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,i)=>{i.yes&&e.error(`warning: --yes has no effect for eve extension init.`);let{runExtensionInitCommand:a}=await import(`#cli/commands/extension-init.js`);await a(e,n.root,t,void 0,e=>{r.trackSetupStep({flow:`extension_init`,step:e})})}),s.command(`build`).description(`Build the current package as an eve extension.`).action(async()=>{let{loadDevelopmentEnvironmentFiles:t}=await import(`#cli/dev/environment.js`);await t(n.root);let{runExtensionBuildCommand:r}=await import(`#cli/commands/extension-build.js`);await r(e,n.root)}),registerRegistryCommands({program:a,logger:e,applicationContext:n}),a.command(`init [target]`).description(`Create a new eve agent, or add one to an existing project directory.`).addOption(new Option(`--channel-web-nextjs`,`Add the Web Chat application (Next.js)`).hideHelp()).option(`--agents <names>`,`Create an agents/ workspace with comma-separated agent names`,parseAgentNamesOption).option(`--model <model>`,`Set the agent model (provider/model-id)`).option(`-n, --non-interactive`,`Scaffold the agent without starting development`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).option(`-y, --yes`,`Accepted for compatibility; has no effect`).action(async(t,i)=>{i.yes&&e.error(`warning: --yes has no effect for eve init.`);let{runInitCommand:a}=await import(`#cli/commands/init.js`);await a(e,n.root,t,{agents:i.agents,channelWebNextjs:i.channelWebNextjs,model:i.model,reasoning:i.reasoning,nonInteractive:i.nonInteractive},void 0,e=>{r.trackSetupStep({flow:`init`,step:e})},(e,t,n)=>{r.trackSetupTerminal({flow:`init`,step:e,result:t,failureCode:n})})});let c=a.command(`set`).description(`Change root agent model settings.`);agentCommand(c.command(`model [model]`),n).description(`Set the agent model and reasoning effort.`).option(`--reasoning <effort>`,`Set reasoning (provider-default|none|minimal|low|medium|high|xhigh)`,parseReasoningOption).action(async(t,r)=>{let{runSetCommand:i}=await import(`#cli/commands/set.js`);await i(e,n.root,{model:t,reasoning:r.reasoning})}),registerProjectCommands({program:a,logger:e,applicationContext:n}),registerBuildCommand({applicationContext:n,buildHost:t.buildHost,logger:e,program:a}),agentCommand(a.command(`start`),n).description(`Start a built eve application.`).option(`--no-schedules`,`Start without running authored cron schedules`).option(`--host <host>`,`Host interface to bind`).option(`--port <port>`,`Port to listen on (defaults to $PORT, then 3000)`,parsePortOption).action(async r=>{let{loadDevelopmentEnvironmentFiles:i}=await import(`#cli/dev/environment.js`);await i(n.root);let a=await(t.startProductionHost??await loadStartProductionHost())(n.root,{host:r.host,port:r.port,schedules:r.schedules});e.log(renderCliTaggedLine(o,{message:`server listening at ${a.url}`,tag:`start`,tone:`success`})),(r.schedules===!1||areSchedulesDisabled())&&e.log(renderCliTaggedLine(o,{message:`schedules disabled`,tag:`start`,tone:`info`})),await waitForShutdownSignal({close:()=>a.close(),wait:()=>a.wait()})});let l=a.command(`remote`).description(`Connect to an existing eve agent.`);registerRemoteCommands({applicationContext:n,logger:e,program:l,runtime:t,telemetry:r}),registerAcpCommand({applicationContext:n,eveVersion:i,program:a,resolveVerifiedRemoteDevelopmentClient:t.resolveVerifiedRemoteDevelopmentClient,runAcpServer:t.runAcpServer,startHost:t.startHost}),registerDevelopmentCommand({applicationContext:n,logger:e,program:a,runtime:t,telemetry:r});let u=a.command(`logs`).description("Inspect local `eve dev` diagnostic logs (.eve/logs).");agentCommand(u.command(`show [logid]`,{isDefault:!0}),n).description(`Print a diagnostic log (the most recent when logid is omitted).`).option(`--dump`,`Prepend the log's environment dump (.dump sibling)`).option(`--events`,`Interleave session events from the local workflow store`).action(async(t,r)=>{let{runLogsShowCommand:i}=await import(`#cli/commands/logs.js`);await i(e,n.root,t,r)}),agentCommand(u.command(`list`).alias(`ls`),n).description(`List diagnostic logs, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runLogsListCommand:r}=await import(`#cli/commands/logs.js`);await r(e,n.root,t)});let d=a.command(`traces`).usage(`[options] [trace]
2
2
  eve traces list [options]`).description("Inspect local `eve dev` traces.");return agentCommand(d.command(`show [trace]`,{isDefault:!0}),n).description(`Show a local trace (the most recent when trace is omitted).`).option(`--verbose`,`Expand every span with all attributes and events`).option(`--json`,`Output as JSON`).action(async(t,r)=>{let{runTraceShowCommand:i}=await import(`#cli/commands/trace.js`);await i(e,n.root,t,r)}),agentCommand(d.command(`list`).alias(`ls`),n).description(`List local traces, most recent first.`).option(`--json`,`Output as JSON`).action(async t=>{let{runTraceListCommand:r}=await import(`#cli/commands/trace.js`);await r(e,n.root,t)}),agentCommand(a.command(`info`),n).description(`Print resolved application information.`).option(`--json`,`Output as JSON`).action(async r=>{await(t.printApplicationInfo??await loadPrintApplicationInfo())(e,n.root,r)}),agentCommand(a.command(`eval`),n,e=>e.opts().url===void 0).description(`Run evals against an eve agent.`).argument(`[evalIds...]`,`Eval ids (or directory prefixes) to run (all discovered evals when omitted)`).option(`--url <url>`,`Remote agent URL (skip local host startup)`,parseDevelopmentServerUrl).option(`--tag <tag...>`,`Run only evals carrying a tag`).option(`--exclude-tag <tag...>`,`Skip evals carrying a tag`).option(`--strict`,`Fail the exit code when any score falls below its threshold`).option(`--list`,`Print discovered evals without running them`).option(`--timeout <ms>`,`Per-eval timeout in milliseconds`).option(`--max-concurrency <n>`,`Max concurrent eval executions`).option(`--repeat <n>`,`Run every eval n times to measure repeatability`).option(`--json`,`Output results as JSON`).option(`--junit <path>`,`Write JUnit XML results to a file`).option(`--skip-report`,`Skip eval-defined reporters (e.g. Braintrust)`).option(`--keep-state`,`Keep the local eval server's state, including its Workflow data, after the run`).option(`--verbose`,`Stream per-eval logs and workflow run IDs to stdout`).action(async(r,i)=>{await(t.runEvalCommand??await loadRunEvalCommand())(r,i,e,n.root)}),a}async function runCli(e=process.argv.slice(2),t=console,n={}){let r={root:resolveApplicationRoot(),async resolve(){let e=await(n.resolveApplicationProject??resolveCliApplicationProject)(r.root);r.project=e,r.root=e.appRoot},async resolveAgent(){return resolveEveProjectContext(r.root)}},i=createEveCliTelemetry(resolveInstalledPackageInfo().version),a=createCliProgram(t,n,r,i),o=e;if(o.length===0){let e=await(n.findApplicationRoot??findCliApplicationRoot)(r.root);e===void 0?o=(await findEveProjectContext(r.root))?.kind===`workspace`?[`dev`]:[`init`]:(r.root=e,o=[`dev`])}let s=canonicalCommand(o);i.trackCommand(s),s!==`telemetry`&&await i.notify(t);try{await a.parseAsync(o,{from:`user`}),i.trackOutcome(`success`)}catch(e){if(e instanceof CommanderError&&e.exitCode===0){i.trackOutcome(`success`);return}if(i.trackOutcome(e instanceof CommanderError?`usage_error`:`error`),e instanceof CommanderError){let r=await(n.isCodingAgentLaunch??isCodingAgentLaunch)();if(o[0]===`init`&&r){let{initAgentInstructions:e}=await import(`#cli/commands/agent-instructions.js`);t.log(e())}throw Error(e.message)}throw e}finally{await i.flush()}}export{createCliProgram,resolveDevUiMode,resolveTuiDisplayOptions,runCli};
@@ -2,7 +2,7 @@
2
2
  "moduleFingerprints": {
3
3
  "@eve/catalog": "29b7529f6044427c750e4c27fe91da792014c60c660db31b7ca1fff0afe7f603",
4
4
  "just-secrets": "1ce67d437d0bb06df02e4e99180a3c5f5edf0010314010226e97b96d462bba5d",
5
- "@vercel/agent-runs": "94231f05d03adf6e62c1c56a941d763e7ed8a25a7c2f3c17a920f68225319325",
5
+ "@vercel/agent-runs": "bd9dbd157bb034dc10d3949b621b6d9d80e028dd4735df3b4819256067577d0a",
6
6
  "@workflow/world-local": "a10e78551f65fc607cf75261a569d852c40bc9cfac13a7fb6e15c88bf1ccf429"
7
7
  },
8
8
  "moduleVersions": {
@@ -42,7 +42,7 @@
42
42
  "@shadcn/registry": "0.1.3",
43
43
  "@standard-schema/spec": "1.1.0",
44
44
  "turndown": "7.2.4",
45
- "@vercel/agent-runs": "0.0.1",
45
+ "@vercel/agent-runs": "0.0.2",
46
46
  "@vercel/blob": "2.8.0",
47
47
  "@vercel/connect": "2.5.2",
48
48
  "@vercel/detect-agent": "1.2.3",
@@ -51,7 +51,7 @@
51
51
  "@vercel/queue": "0.5.1",
52
52
  "@vercel/sandbox": "3.9.0",
53
53
  "@vercel/sdk": "1.28.8",
54
- "@vercel/schedules": "0.0.0-alpha.11",
54
+ "@vercel/schedules": "0.0.0-alpha.19",
55
55
  "@workflow/core": "5.2.3",
56
56
  "@workflow/errors": "5.0.5",
57
57
  "@workflow/serde": "5.0.0",
@@ -61,7 +61,7 @@
61
61
  "zod": "4.5.4",
62
62
  "zod-validation-error": "5.0.0"
63
63
  },
64
- "scriptHash": "e131224ddb21683920afcfceb11b26db2c7ea6ff4b1295b53fb273dbb14234ae",
64
+ "scriptHash": "90a2d0a60853ca975229f547260bd2d13c40547d53274021ce81688db2ebae9c",
65
65
  "toolVersions": {
66
66
  "rolldown": "1.2.9",
67
67
  "typescript": "7.0.2"
@@ -2,15 +2,29 @@ interface SchedulesApiClientOptions {
2
2
  baseUrl?: string;
3
3
  token?: string;
4
4
  fetch?: typeof fetch;
5
+ /**
6
+ * Headers sent with every request. They cannot replace the headers the
7
+ * client sets itself: `Authorization`, `Content-Type`, and `x-vss-client`.
8
+ */
9
+ headers?: HeadersInit;
10
+ }
11
+ interface SchedulesApiErrorOptions {
12
+ /** Machine-readable error code from the API, such as `not_found`. */
13
+ code?: string;
14
+ /** Seconds to wait before retrying, from the `Retry-After` header. */
15
+ retryAfter?: number;
5
16
  }
6
17
  declare class SchedulesApiError extends Error {
7
18
  readonly status: number;
8
- constructor(status: number, message: string);
19
+ readonly code?: string;
20
+ readonly retryAfter?: number;
21
+ constructor(status: number, message: string, options?: SchedulesApiErrorOptions);
9
22
  }
10
23
  declare class SchedulesApiClient {
11
24
  private readonly baseUrl?;
12
25
  private readonly token?;
13
26
  private readonly fetchImpl;
27
+ private readonly headers;
14
28
  private readonly configurationError?;
15
29
  constructor(options?: SchedulesApiClientOptions);
16
30
  protected getToken(): Promise<string>;
@@ -33,6 +47,13 @@ type ScheduleTarget = {
33
47
  } | {
34
48
  type: 'function';
35
49
  function: string;
50
+ /** Service the function belongs to; `function` is the path within it. */
51
+ service?: string;
52
+ } | {
53
+ type: 'path';
54
+ path: string;
55
+ /** HTTP method used to invoke the path. Dispatch defaults to `POST`. */
56
+ requestMethod?: 'GET' | 'POST';
36
57
  };
37
58
  type CreateScheduleTarget = {
38
59
  topic: string;
@@ -43,7 +64,6 @@ interface Schedule {
43
64
  scheduleId: string;
44
65
  ownerId: string;
45
66
  projectId: string;
46
- trackId: string;
47
67
  name: string;
48
68
  namespace: string;
49
69
  expression: ScheduleExpression;
@@ -52,6 +72,12 @@ interface Schedule {
52
72
  jitter?: number;
53
73
  target: ScheduleTarget;
54
74
  state: ScheduleState;
75
+ /**
76
+ * Unix ms when this schedule is disabled again, if it was enabled with
77
+ * `until`. Present only while `state` is `active` and the time is in the
78
+ * future.
79
+ */
80
+ activeUntil?: number;
55
81
  source: ScheduleSource;
56
82
  createdAt: number;
57
83
  updatedAt: number;
@@ -83,6 +109,16 @@ interface UpdateScheduleParams extends ScheduleIdentifier {
83
109
  payload?: unknown;
84
110
  }
85
111
  type UpdateScheduleResponse = Schedule;
112
+ interface EnableScheduleParams extends ScheduleIdentifier {
113
+ /**
114
+ * Enable the schedule only until this time (a `Date` or Unix ms), after
115
+ * which it is disabled again. Replaces the time on a schedule already
116
+ * enabled until one. Must be in the future, and a schedule already enabled
117
+ * without one is rejected with `schedule_already_active`. Omit to enable
118
+ * the schedule indefinitely, which also clears any existing time.
119
+ */
120
+ until?: Date | number;
121
+ }
86
122
  type InvokeScheduleParams = ScheduleIdentifier;
87
123
  interface ListSchedulesParams {
88
124
  namespace?: string;
@@ -100,7 +136,7 @@ declare class SchedulesClient extends SchedulesApiClient {
100
136
  get({ name, namespace }: ScheduleIdentifier): Promise<Schedule>;
101
137
  update({ name, namespace, target, ...params }: UpdateScheduleParams): Promise<UpdateScheduleResponse>;
102
138
  delete({ name, namespace }: ScheduleIdentifier): Promise<void>;
103
- enable({ name, namespace }: ScheduleIdentifier): Promise<Schedule>;
139
+ enable({ name, namespace, until }: EnableScheduleParams): Promise<Schedule>;
104
140
  disable({ name, namespace }: ScheduleIdentifier): Promise<Schedule>;
105
141
  invoke({ name, namespace }: InvokeScheduleParams): Promise<void>;
106
142
  }
@@ -118,6 +154,7 @@ declare const SCHEDULE_ID_HEADER = "ce-vssscheduleid";
118
154
  declare const SCHEDULE_NAME_HEADER = "ce-vssschedulename";
119
155
  declare const SCHEDULE_NAMESPACE_HEADER = "ce-vssnamespace";
120
156
  declare const SCHEDULE_SOURCE_HEADER = "ce-vssschedulesource";
157
+ declare const SCHEDULE_EXPRESSION_HEADER = "ce-vssexpression";
121
158
  interface ScheduleMetadata {
122
159
  /** Unique identifier of the schedule. */
123
160
  scheduleId: string;
@@ -134,8 +171,10 @@ interface ScheduleMetadata {
134
171
  scheduledAt: Date;
135
172
  /** How the schedule was defined, such as `static`. */
136
173
  source: string;
174
+ /** The schedule's cron expression, or the local datetime of a one-time schedule. */
175
+ expression: string;
137
176
  }
138
- type ScheduleHandler = (metadata: ScheduleMetadata) => void | Promise<void>;
177
+ type ScheduleHandler = (metadata: ScheduleMetadata, request: Request) => void | Promise<void>;
139
178
  declare class ScheduleEventParseError extends Error {
140
179
  cause?: unknown;
141
180
  constructor(message: string, options?: {
@@ -148,11 +187,11 @@ declare function parseScheduleEvent(request: Request): Promise<ScheduleMetadata>
148
187
  * Creates a web-standard route handler for schedule dispatches.
149
188
  *
150
189
  * ```ts
151
- * export const POST = handleSchedule(async (metadata) => {
190
+ * export const POST = handleSchedule(async (metadata, request) => {
152
191
  * console.log(metadata.name, metadata.scheduledAt);
153
192
  * });
154
193
  * ```
155
194
  */
156
195
  declare function handleSchedule(handler: ScheduleHandler): (request: Request) => Promise<Response>;
157
196
 
158
- export { CLOUD_EVENT_ID_HEADER, CLOUD_EVENT_SOURCE_HEADER, CLOUD_EVENT_SPEC_VERSION_HEADER, CLOUD_EVENT_TYPE_HEADER, type CreateScheduleParams, type CreateScheduleResponse, type CreateScheduleTarget, DEFAULT_SCHEDULES_BASE_URL, type InvokeScheduleParams, type ListSchedulesParams, type ListSchedulesResponse, SCHEDULE_CLOUD_EVENT_TYPE, SCHEDULE_ID_HEADER, SCHEDULE_NAMESPACE_HEADER, SCHEDULE_NAME_HEADER, SCHEDULE_SCHEDULED_AT_HEADER, SCHEDULE_SOURCE_HEADER, type Schedule, ScheduleEventParseError, type ScheduleExpression, type ScheduleHandler, type ScheduleIdentifier, type ScheduleMetadata, type ScheduleSource, type ScheduleState, type ScheduleTarget, schedules as Schedules, type SchedulesApiClientOptions, SchedulesApiError, SchedulesClient, type UpdateScheduleParams, type UpdateScheduleResponse, handleSchedule, parseScheduleEvent };
197
+ export { CLOUD_EVENT_ID_HEADER, CLOUD_EVENT_SOURCE_HEADER, CLOUD_EVENT_SPEC_VERSION_HEADER, CLOUD_EVENT_TYPE_HEADER, type CreateScheduleParams, type CreateScheduleResponse, type CreateScheduleTarget, DEFAULT_SCHEDULES_BASE_URL, type EnableScheduleParams, type InvokeScheduleParams, type ListSchedulesParams, type ListSchedulesResponse, SCHEDULE_CLOUD_EVENT_TYPE, SCHEDULE_EXPRESSION_HEADER, SCHEDULE_ID_HEADER, SCHEDULE_NAMESPACE_HEADER, SCHEDULE_NAME_HEADER, SCHEDULE_SCHEDULED_AT_HEADER, SCHEDULE_SOURCE_HEADER, type Schedule, ScheduleEventParseError, type ScheduleExpression, type ScheduleHandler, type ScheduleIdentifier, type ScheduleMetadata, type ScheduleSource, type ScheduleState, type ScheduleTarget, schedules as Schedules, type SchedulesApiClientOptions, SchedulesApiError, type SchedulesApiErrorOptions, SchedulesClient, type UpdateScheduleParams, type UpdateScheduleResponse, handleSchedule, parseScheduleEvent };