eve 0.26.0 → 0.26.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/src/cli/banner.d.ts +5 -0
  3. package/dist/src/cli/banner.js +1 -1
  4. package/dist/src/cli/dev/tui/blocks.d.ts +56 -8
  5. package/dist/src/cli/dev/tui/blocks.js +7 -7
  6. package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +2 -0
  7. package/dist/src/cli/dev/tui/diagnostic-presentation.js +3 -2
  8. package/dist/src/cli/dev/tui/file-content-cache.d.ts +35 -0
  9. package/dist/src/cli/dev/tui/file-content-cache.js +3 -0
  10. package/dist/src/cli/dev/tui/line-diff.d.ts +24 -0
  11. package/dist/src/cli/dev/tui/line-diff.js +1 -0
  12. package/dist/src/cli/dev/tui/markdown.d.ts +2 -1
  13. package/dist/src/cli/dev/tui/markdown.js +7 -3
  14. package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +12 -0
  15. package/dist/src/cli/dev/tui/prompt-placeholder.js +1 -0
  16. package/dist/src/cli/dev/tui/question-panel.d.ts +24 -0
  17. package/dist/src/cli/dev/tui/question-panel.js +1 -0
  18. package/dist/src/cli/dev/tui/rail.d.ts +15 -0
  19. package/dist/src/cli/dev/tui/rail.js +1 -0
  20. package/dist/src/cli/dev/tui/runner.d.ts +22 -65
  21. package/dist/src/cli/dev/tui/runner.js +1 -1
  22. package/dist/src/cli/dev/tui/setup-commands.js +1 -1
  23. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  24. package/dist/src/cli/dev/tui/status-line.js +1 -1
  25. package/dist/src/cli/dev/tui/stream-format.d.ts +16 -3
  26. package/dist/src/cli/dev/tui/stream-format.js +1 -1
  27. package/dist/src/cli/dev/tui/subagent-pump.d.ts +127 -0
  28. package/dist/src/cli/dev/tui/subagent-pump.js +1 -0
  29. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +34 -1
  30. package/dist/src/cli/dev/tui/terminal-renderer.js +11 -10
  31. package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +7 -0
  32. package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
  33. package/dist/src/cli/dev/tui/theme.d.ts +16 -2
  34. package/dist/src/cli/dev/tui/theme.js +1 -1
  35. package/dist/src/cli/dev/tui/todo-panel.d.ts +44 -0
  36. package/dist/src/cli/dev/tui/todo-panel.js +1 -0
  37. package/dist/src/cli/dev/tui/tool-block-groups.d.ts +40 -0
  38. package/dist/src/cli/dev/tui/tool-block-groups.js +1 -0
  39. package/dist/src/cli/dev/tui/tool-presentation.d.ts +67 -0
  40. package/dist/src/cli/dev/tui/tool-presentation.js +1 -0
  41. package/dist/src/cli/dev/tui/tool-rows.d.ts +15 -0
  42. package/dist/src/cli/dev/tui/tool-rows.js +2 -0
  43. package/dist/src/cli/dev/tui/turn-clock.d.ts +36 -0
  44. package/dist/src/cli/dev/tui/turn-clock.js +1 -0
  45. package/dist/src/cli/dev/tui/types.d.ts +2 -2
  46. package/dist/src/cli/dev/ui-options.js +1 -1
  47. package/dist/src/client/index.js +1 -1
  48. package/dist/src/client/session.js +1 -1
  49. package/dist/src/compiled/.vendor-stamp.json +2 -1
  50. package/dist/src/compiled/marked/LICENSE.md +44 -0
  51. package/dist/src/compiled/marked/index.d.ts +24 -0
  52. package/dist/src/compiled/marked/index.js +59 -0
  53. package/dist/src/evals/session.js +1 -1
  54. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  55. package/dist/src/harness/tool-loop.js +2 -2
  56. package/dist/src/internal/application/package.js +1 -1
  57. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
  58. package/dist/src/internal/nitro/routes/info.js +1 -1
  59. package/dist/src/internal/resolve-model-endpoint-status.d.ts +46 -3
  60. package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
  61. package/dist/src/setup/flows/link.d.ts +13 -3
  62. package/dist/src/setup/flows/link.js +1 -1
  63. package/dist/src/setup/flows/model.d.ts +4 -3
  64. package/dist/src/setup/flows/model.js +1 -1
  65. package/dist/src/setup/flows/provider.d.ts +3 -1
  66. package/dist/src/setup/flows/provider.js +2 -2
  67. package/dist/src/setup/scaffold/create/project.js +1 -1
  68. package/package.json +2 -1
@@ -11,13 +11,56 @@ export interface GatewayCredentialPresence {
11
11
  /** A Vercel OIDC token is available (`VERCEL_OIDC_TOKEN` or a linked project). */
12
12
  readonly oidc: boolean;
13
13
  }
14
+ /** True when an environment value is present and non-blank. */
15
+ export declare function hasEnvValue(value: string | undefined): boolean;
16
+ /** Where a winning gateway API key was observed. */
17
+ export type GatewayCredentialSource = {
18
+ kind: "env-file";
19
+ path: string;
20
+ } | {
21
+ kind: "shell";
22
+ };
23
+ /**
24
+ * Everywhere the two gateway credentials can be observed. Callers fill in
25
+ * whatever their vantage point can see — env files on disk, the process
26
+ * environment, an SDK token lookup — and the resolver ranks it.
27
+ */
28
+ export interface GatewayCredentialEvidence {
29
+ /** `AI_GATEWAY_API_KEY` found in an app env file (the file's name). */
30
+ readonly apiKeyFile?: string;
31
+ /** `AI_GATEWAY_API_KEY` present in the process environment. */
32
+ readonly apiKeyInEnv?: boolean;
33
+ /** `VERCEL_OIDC_TOKEN` found in an app env file (the file's name). */
34
+ readonly oidcFile?: string;
35
+ /** An OIDC token is otherwise available (env or linked-project lookup). */
36
+ readonly oidcAvailable?: boolean;
37
+ }
38
+ export type GatewayCredentialResolution = {
39
+ credential: "api-key";
40
+ /** Where the winning key lives; a shell export is not eve's to remove. */
41
+ source: GatewayCredentialSource;
42
+ /** Present when an OIDC token exists that the key shadows. */
43
+ shadowedOidc?: {
44
+ file?: string;
45
+ };
46
+ } | {
47
+ credential: "oidc";
48
+ file?: string;
49
+ };
50
+ /**
51
+ * THE one encoding of gateway credential precedence: `AI_GATEWAY_API_KEY`
52
+ * (env file first for attribution, then the shell) outranks the OIDC token,
53
+ * exactly as the AI SDK gateway provider resolves them. Every surface that
54
+ * reports or ranks gateway credentials — the endpoint status, the /model
55
+ * provider row, the link outcome, boot detection — must route through this
56
+ * function so they can never disagree.
57
+ */
58
+ export declare function resolveGatewayCredential(evidence: GatewayCredentialEvidence): GatewayCredentialResolution | undefined;
14
59
  /**
15
60
  * Composes the build-time {@link ModelRouting} with runtime credential presence
16
61
  * into the consumer-facing {@link ModelEndpointStatus}.
17
62
  *
18
63
  * Credentials matter only for gateway routing; an external endpoint makes no
19
- * connectedness claim. `api-key` outranks `oidc` to match the AI SDK gateway
20
- * provider, which uses `AI_GATEWAY_API_KEY` when present and otherwise the OIDC
21
- * token.
64
+ * connectedness claim. Ranking delegates to {@link resolveGatewayCredential}.
22
65
  */
23
66
  export declare function resolveModelEndpointStatus(routing: ModelRouting, credentials: GatewayCredentialPresence): ModelEndpointStatus;
@@ -1 +1 @@
1
- function resolveModelEndpointStatus(e,t){return e.kind===`external`?{kind:`external`,provider:e.provider}:t.apiKey?{kind:`gateway`,connected:!0,credential:`api-key`}:t.oidc?{kind:`gateway`,connected:!0,credential:`oidc`}:{kind:`gateway`,connected:!1}}export{resolveModelEndpointStatus};
1
+ function hasEnvValue(e){return e!==void 0&&e.trim().length>0}function resolveGatewayCredential(e){let t=e.apiKeyFile===void 0?e.apiKeyInEnv===!0?{kind:`shell`}:void 0:{kind:`env-file`,path:e.apiKeyFile},n=e.oidcFile!==void 0||e.oidcAvailable===!0;if(t!==void 0){let r={credential:`api-key`,source:t};return n&&(r.shadowedOidc=e.oidcFile===void 0?{}:{file:e.oidcFile}),r}if(n)return e.oidcFile===void 0?{credential:`oidc`}:{credential:`oidc`,file:e.oidcFile}}function resolveModelEndpointStatus(e,t){if(e.kind===`external`)return{kind:`external`,provider:e.provider};let n=resolveGatewayCredential({apiKeyInEnv:t.apiKey,oidcAvailable:t.oidc});return n===void 0?{kind:`gateway`,connected:!1}:{kind:`gateway`,connected:!0,credential:n.credential}}export{hasEnvValue,resolveGatewayCredential,resolveModelEndpointStatus};
@@ -1,4 +1,4 @@
1
- import { AI_GATEWAY_API_KEY_ENV_VAR } from "../ai-gateway-api-key.js";
1
+ import { type GatewayCredentialResolution } from "#internal/resolve-model-endpoint-status.js";
2
2
  import { type ApplyAiGatewayCredentialDeps } from "../boxes/apply-ai-gateway-credential.js";
3
3
  import { findEnvFileWithKey } from "../boxes/detect-ai-gateway.js";
4
4
  import { type LinkProjectDeps } from "../boxes/link-project.js";
@@ -9,14 +9,20 @@ import type { Prompter } from "../prompter.js";
9
9
  export interface LinkFlowDeps {
10
10
  detectProjectIdentity: typeof detectProjectIdentity;
11
11
  findEnvFileWithKey: typeof findEnvFileWithKey;
12
+ /** Shell environment probed for a gateway key that would shadow OIDC. */
13
+ env: Record<string, string | undefined>;
12
14
  resolveProvisioning?: ResolveProvisioningDeps;
13
15
  linkProject?: LinkProjectDeps;
14
16
  applyAiGatewayCredential?: ApplyAiGatewayCredentialDeps;
15
17
  }
16
18
  export type LinkFlowResult = {
17
19
  kind: "done";
18
- /** The model credential verified in an env file, when one landed. */
19
- credential?: "VERCEL_OIDC_TOKEN" | typeof AI_GATEWAY_API_KEY_ENV_VAR;
20
+ /**
21
+ * The credential the runtime will actually resolve, from the one
22
+ * precedence authority ({@link resolveGatewayCredential}): a gateway
23
+ * API key — env file or shell — outranks the pulled OIDC token.
24
+ */
25
+ resolution?: GatewayCredentialResolution;
20
26
  } | {
21
27
  kind: "cancelled";
22
28
  };
@@ -36,6 +42,10 @@ export type LinkFlowResult = {
36
42
  * Ends by verifying a model credential actually landed (`VERCEL_OIDC_TOKEN`
37
43
  * or `AI_GATEWAY_API_KEY` in an env file) — an env pull can succeed without
38
44
  * granting gateway access, and the difference is what the user acts on next.
45
+ * The reported credential mirrors runtime resolution — `AI_GATEWAY_API_KEY`
46
+ * (env file or shell) outranks the OIDC token, exactly as the AI SDK gateway
47
+ * provider resolves it — so the outcome message, the status bar, and the
48
+ * actual authentication can never disagree.
39
49
  */
40
50
  export declare function runLinkFlow(input: {
41
51
  appRoot: string;
@@ -1 +1 @@
1
- import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{interactiveAsker,withAnswers}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{detectAiGateway,findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{applyAiGatewayCredential}from"../boxes/apply-ai-gateway-credential.js";import{linkVercelProject}from"../boxes/link-project.js";import{resolveProvisioning}from"../boxes/resolve-provisioning.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";var import_picocolors=__toESM(require_picocolors(),1);async function runLinkFlow(e){let{appRoot:t,prompter:a,signal:o,projectSelection:s=`existing-only`}=e,c={detectProjectIdentity,findEnvFileWithKey,...e.deps},l=await withSpinner(a,`Checking the current Vercel link...`,async()=>{let e=await c.detectProjectIdentity(t,{signal:o});return o?.throwIfAborted(),e});if(l===void 0){let[n,r]=await Promise.all([c.findEnvFileWithKey(t,AI_GATEWAY_API_KEY_ENV_VAR),c.findEnvFileWithKey(t,`VERCEL_OIDC_TOKEN`)]),i=n??r;i!==void 0&&e.teamSelectMessage===void 0&&a.log.message(`This directory is not linked to a Vercel project yet — the model currently runs on credentials from ${i}.`)}else{let e=l.teamName===void 0?import_picocolors.default.bold(l.projectName):`${import_picocolors.default.bold(l.projectName)} in ${import_picocolors.default.bold(l.teamName)}`;try{if(await a.select({message:`This directory is already linked to\n${e}`,options:[{value:`relink`,label:`Link to another project`},{value:`dismiss`,label:`Dismiss`}]})===`dismiss`)return{kind:`cancelled`}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}let u=inProjectSetupState(t,{kind:`unresolved`});if((await runInteractive([resolveProvisioning({asker:withAnswers({deploy:`vercel`})(interactiveAsker(a)),prompter:a,targetDirectory:t,mode:{headless:!1},adoptExistingLink:!1,projectSelection:s,teamSelectMessage:e.teamSelectMessage,deps:c.resolveProvisioning}),linkVercelProject({prompter:a,deps:c.linkProject}),detectAiGateway(),applyAiGatewayCredential({prompter:a,deps:c.applyAiGatewayCredential})],u,prompterSink(a),{snapshot:snapshotSetupState,signal:o})).kind===`cancelled`)return{kind:`cancelled`};let[d,f]=await Promise.all([c.findEnvFileWithKey(t,`VERCEL_OIDC_TOKEN`),c.findEnvFileWithKey(t,AI_GATEWAY_API_KEY_ENV_VAR)]);o?.throwIfAborted(),d===void 0&&f===void 0&&a.log.warning("Linked, but no model credential landed in an env file (VERCEL_OIDC_TOKEN or AI_GATEWAY_API_KEY). Run `vercel env pull` once the project has AI Gateway access.");let p={kind:`done`};return d===void 0?f!==void 0&&(p.credential=AI_GATEWAY_API_KEY_ENV_VAR):p.credential=`VERCEL_OIDC_TOKEN`,p}export{runLinkFlow};
1
+ import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{interactiveAsker,withAnswers}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{detectAiGateway,findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{applyAiGatewayCredential}from"../boxes/apply-ai-gateway-credential.js";import{linkVercelProject}from"../boxes/link-project.js";import{resolveProvisioning}from"../boxes/resolve-provisioning.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import{hasEnvValue,resolveGatewayCredential}from"#internal/resolve-model-endpoint-status.js";var import_picocolors=__toESM(require_picocolors(),1);async function runLinkFlow(e){let{appRoot:t,prompter:a,signal:o,projectSelection:s=`existing-only`}=e,c={detectProjectIdentity,findEnvFileWithKey,env:process.env,...e.deps},l=await withSpinner(a,`Checking the current Vercel link...`,async()=>{let e=await c.detectProjectIdentity(t,{signal:o});return o?.throwIfAborted(),e});if(l===void 0){let[n,r]=await Promise.all([c.findEnvFileWithKey(t,AI_GATEWAY_API_KEY_ENV_VAR),c.findEnvFileWithKey(t,`VERCEL_OIDC_TOKEN`)]),i=n??r;i!==void 0&&e.teamSelectMessage===void 0&&a.log.message(`This directory is not linked to a Vercel project yet — the model currently runs on credentials from ${i}.`)}else{let e=l.teamName===void 0?import_picocolors.default.bold(l.projectName):`${import_picocolors.default.bold(l.projectName)} in ${import_picocolors.default.bold(l.teamName)}`;try{if(await a.select({message:`This directory is already linked to\n${e}`,options:[{value:`relink`,label:`Link to another project`},{value:`dismiss`,label:`Dismiss`}]})===`dismiss`)return{kind:`cancelled`}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}let u=inProjectSetupState(t,{kind:`unresolved`});if((await runInteractive([resolveProvisioning({asker:withAnswers({deploy:`vercel`})(interactiveAsker(a)),prompter:a,targetDirectory:t,mode:{headless:!1},adoptExistingLink:!1,projectSelection:s,teamSelectMessage:e.teamSelectMessage,deps:c.resolveProvisioning}),linkVercelProject({prompter:a,deps:c.linkProject}),detectAiGateway(),applyAiGatewayCredential({prompter:a,deps:c.applyAiGatewayCredential})],u,prompterSink(a),{snapshot:snapshotSetupState,signal:o})).kind===`cancelled`)return{kind:`cancelled`};let[d,f]=await Promise.all([c.findEnvFileWithKey(t,`VERCEL_OIDC_TOKEN`),c.findEnvFileWithKey(t,AI_GATEWAY_API_KEY_ENV_VAR)]);o?.throwIfAborted(),d===void 0&&f===void 0&&a.log.warning("Linked, but no model credential landed in an env file (VERCEL_OIDC_TOKEN or AI_GATEWAY_API_KEY). Run `vercel env pull` once the project has AI Gateway access.");let p={kind:`done`},m={apiKeyInEnv:hasEnvValue(c.env[AI_GATEWAY_API_KEY_ENV_VAR])};f!==void 0&&(m.apiKeyFile=f),d!==void 0&&(m.oidcFile=d);let h=resolveGatewayCredential(m);return h!==void 0&&(p.resolution=h),p}export{runLinkFlow};
@@ -1,5 +1,5 @@
1
+ import { type GatewayCredentialResolution } from "#internal/resolve-model-endpoint-status.js";
1
2
  import type { AgentModelSettingsPatch } from "#source-change/apply-agent-model-settings.js";
2
- import { AI_GATEWAY_API_KEY_ENV_VAR } from "../ai-gateway-api-key.js";
3
3
  import { type SelectModelDeps } from "../boxes/select-model.js";
4
4
  import { type GatewayModelCapabilities, type ReasoningLevel } from "../boxes/model-capabilities.js";
5
5
  import { type VercelProjectOperationOptions } from "../project-resolution.js";
@@ -92,7 +92,8 @@ export type { ModelProviderStatus };
92
92
  * disk — so it never surfaces as an outcome.
93
93
  */
94
94
  export interface ModelProviderOutcome {
95
- credential?: "VERCEL_OIDC_TOKEN" | typeof AI_GATEWAY_API_KEY_ENV_VAR;
95
+ /** The credential resolution the runtime will honor; see {@link LinkFlowResult}. */
96
+ resolution?: GatewayCredentialResolution;
96
97
  status: ModelProviderStatus;
97
98
  }
98
99
  export type ModelFlowResult = {
@@ -113,7 +114,7 @@ export declare const MODEL_MENU_MESSAGE = "";
113
114
  * and `AI_GATEWAY_API_KEY` outranks `VERCEL_OIDC_TOKEN` because it is the one
114
115
  * the provider sub-flow's own-key branch writes.
115
116
  */
116
- export declare function detectModelProviderStatus(appRoot: string, options?: VercelProjectOperationOptions): Promise<ModelProviderStatus>;
117
+ export declare function detectModelProviderStatus(appRoot: string, options?: VercelProjectOperationOptions, env?: Record<string, string | undefined>): Promise<ModelProviderStatus>;
117
118
  /**
118
119
  * THE MODEL FLOW for the dev TUI's `/model`: a root menu whose Change model
119
120
  * row opens the composite model screen (catalog pick, reasoning-effort slider,
@@ -1 +1 @@
1
- import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{detectProjectIdentity}from"../project-resolution.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{gatewayModelCapabilities}from"../boxes/model-capabilities.js";import{fetchGatewayCatalog,modelOptionsFromCatalog}from"../boxes/select-model.js";import{changeAgentModelSettings,formatApplyModelSettingsOutcome}from"./model-source-change.js";import{runProviderFlow}from"./provider.js";import{inspectApplication}from"#services/inspect-application.js";import{formatModelSummary}from"#shared/model-summary.js";import{readGatewayServiceTier}from"#shared/gateway-service-tier.js";var import_picocolors=__toESM(require_picocolors(),1);const MODEL_MENU_MESSAGE=``;function providerStatusHint(e,t=e=>e){return e.kind===`gateway-project`?`AI Gateway (Linked to ${e.teamName===void 0?t(e.projectName):`${t(e.projectName)} in ${t(e.teamName)}`})`:`AI Gateway (${e.envKey} in ${e.envFile})`}function modelListRows(e){return modelOptionsFromCatalog(e).map(e=>{let t={value:e.value,label:e.value};return e.featured===!0&&(t.featured=!0),t})}function formatModelDraftHint(e,t,n){let r={model:e};return t!==null&&(r.reasoning=t),n.kind===`priority`&&(r.fastGlyph=`↯`),formatModelSummary(r)}function modelMenuRows(e,t,n,r,i,a,o){let s;a||o?(s={value:`model`,label:`Change model`,description:a?`The model, its reasoning effort, and the Gateway service tier`:`Reasoning and service tier; the model itself is an SDK model call in agent.ts`},e!==null&&(s.hint=formatModelDraftHint(e,t,n))):s={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let c;return c=i?.kind===`external`?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:r.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(`Configure model access`),hint:import_picocolors.default.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(r,import_picocolors.default.bold),description:`How your agent reaches the model provider`},[s,c,{value:`done`,label:`Done`}]}async function detectModelProviderStatus(e,t={}){let[i,a,s]=await Promise.all([detectProjectIdentity(e,t),findEnvFileWithKey(e,AI_GATEWAY_API_KEY_ENV_VAR),findEnvFileWithKey(e,`VERCEL_OIDC_TOKEN`)]);if(i!==void 0){let e={kind:`gateway-project`,projectName:i.projectName};return i.teamName!==void 0&&(e.teamName=i.teamName),e}return a===void 0?s===void 0?{kind:`unset`}:{kind:`gateway-key`,envKey:`VERCEL_OIDC_TOKEN`,envFile:s}:{kind:`gateway-key`,envKey:AI_GATEWAY_API_KEY_ENV_VAR,envFile:a}}async function runModelFlow(e){let{appRoot:t,prompter:n,signal:r}=e,o={readCurrentModel:readCurrentAgentModel,applySettings:changeAgentModelSettings,detectProviderStatus:detectModelProviderStatus,runProviderFlow,...e.deps},detectProvider=(e=!0)=>o.detectProviderStatus(t,e&&r!==void 0?{signal:r}:{}),l=o.selectModel?.fetchModels??fetchGatewayCatalog,[u,d,f]=await withSpinner(n,`Checking the project…`,()=>Promise.all([o.readCurrentModel(t),detectProvider(),l(r).catch(()=>void 0)]));r?.throwIfAborted();let{id:p,routing:m,serviceTier:h,editable:g,settingsEditable:_}=u,v=u.reasoning===`provider-default`?null:u.reasoning,y=d,b={model:{kind:`keep`},reasoning:{kind:`keep`},gatewayServiceTier:{kind:`keep`}},x,S,C=!1,w=m?.kind===`external`?{tone:`warning`,text:"`agent.ts` specifies the model provider directly. Model, provider, and service-tier changes stay source-owned; reasoning remains configurable here."}:void 0,T=y.kind===`unset`&&m?.kind!==`external`?`provider`:g||_?`model`:`provider`,E=m?.kind!==`external`&&(e.initialStep===`provider`||y.kind===`unset`);for(;;){let e;if(E)E=!1,e=`provider`;else try{e=await n.select({message:``,options:modelMenuRows(p,v,h,y,m,g,_),hintLayout:`stacked`,initialValue:T,notices:w===void 0?[]:[w]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;if(hasModelSettingsChanges(b))return{kind:`cancelled`,discardedDraft:!0};break}if(e===`done`){C=!0;break}if(e===`model`){let e=o.pickModelSettings;if(e===void 0)throw Error(`runModelFlow requires a pickModelSettings dep to open the model screen.`);let t=await e({model:g?{kind:`pick`,options:modelListRows(f),current:p}:{kind:`fixed`,current:p,reason:`Set via an SDK model call in agent.ts; edit the source to change it`},reasoning:v,serviceTier:h,settingsEditable:_,externalRouting:m?.kind===`external`,capabilitiesFor:e=>gatewayModelCapabilities(f,e)});if(r?.throwIfAborted(),t===void 0){T=`model`;continue}t.model!==void 0&&(p=t.model,m={kind:`gateway`,target:t.model.split(`/`)[0]??``},b.model={kind:`set`,value:t.model}),t.reasoning!==void 0&&(v=t.reasoning==="default"?null:t.reasoning,b.reasoning=v===null?{kind:`remove`}:{kind:`set`,value:v}),t.serviceTier!==void 0&&(h=t.serviceTier===`priority`?{kind:`priority`}:{kind:`standard`},b.gatewayServiceTier=t.serviceTier===`priority`?{kind:`set`,value:`priority`}:{kind:`remove`}),T=`done`;continue}let c=await o.runProviderFlow({appRoot:t,prompter:n,signal:r,currentProvider:y});if(c.kind===`cancelled`){if(r?.aborted)return{kind:`cancelled`};T=`provider`;continue}if(c.kind===`external-provider`){if(r?.aborted)return{kind:`cancelled`};T=`done`;continue}y=await withSpinner(n,`Checking the project…`,()=>detectProvider(!1)),S={status:y},c.credential!==void 0&&(S.credential=c.credential),C=!0;break}if(C&&hasModelSettingsChanges(b)&&(x=await o.applySettings({appRoot:t,patch:b}),r?.throwIfAborted()),x===void 0&&S===void 0)return{kind:`cancelled`};let D={kind:`done`};return x!==void 0&&(D.modelMessage=formatApplyModelSettingsOutcome(x)),S!==void 0&&(D.providerOutcome=S),D}function hasModelSettingsChanges(e){return e.model.kind!==`keep`||e.reasoning.kind!==`keep`||e.gatewayServiceTier.kind!==`keep`}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config,r=n?.model;return{id:r?.id??null,routing:r?.routing??null,reasoning:n?.reasoning??null,serviceTier:readGatewayServiceTier(r?.providerOptions),editable:r!==void 0&&r.source===void 0,settingsEditable:n?.source!==void 0}}catch{return{id:null,routing:null,reasoning:null,serviceTier:{kind:`standard`},editable:!1,settingsEditable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,detectModelProviderStatus,modelChangeRefusalForUneditableModel,runModelFlow};
1
+ import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{detectProjectIdentity}from"../project-resolution.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{gatewayModelCapabilities}from"../boxes/model-capabilities.js";import{fetchGatewayCatalog,modelOptionsFromCatalog}from"../boxes/select-model.js";import{changeAgentModelSettings,formatApplyModelSettingsOutcome}from"./model-source-change.js";import{runProviderFlow}from"./provider.js";import{inspectApplication}from"#services/inspect-application.js";import{hasEnvValue,resolveGatewayCredential}from"#internal/resolve-model-endpoint-status.js";import{formatModelSummary}from"#shared/model-summary.js";import{readGatewayServiceTier}from"#shared/gateway-service-tier.js";var import_picocolors=__toESM(require_picocolors(),1);const MODEL_MENU_MESSAGE=``;function providerStatusHint(e,t=e=>e){if(e.kind===`gateway-project`)return`AI Gateway (Linked to ${e.teamName===void 0?t(e.projectName):`${t(e.projectName)} in ${t(e.teamName)}`})`;let n=e.source.kind===`shell`?`your shell`:e.source.path;return`AI Gateway (${e.envKey} in ${n})`}function modelListRows(e){return modelOptionsFromCatalog(e).map(e=>{let t={value:e.value,label:e.value};return e.featured===!0&&(t.featured=!0),t})}function formatModelDraftHint(e,t,n){let r={model:e};return t!==null&&(r.reasoning=t),n.kind===`priority`&&(r.fastGlyph=`↯`),formatModelSummary(r)}function modelMenuRows(e,t,n,r,i,a,o){let s;a||o?(s={value:`model`,label:`Change model`,description:a?`The model, its reasoning effort, and the Gateway service tier`:`Reasoning and service tier; the model itself is an SDK model call in agent.ts`},e!==null&&(s.hint=formatModelDraftHint(e,t,n))):s={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let c;return c=i?.kind===`external`?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:r.kind===`unset`?{value:`provider`,label:import_picocolors.default.bold(`Configure model access`),hint:import_picocolors.default.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`}:{value:`provider`,label:`Change provider`,hint:providerStatusHint(r,import_picocolors.default.bold),description:`How your agent reaches the model provider`},[s,c,{value:`done`,label:`Done`}]}async function detectModelProviderStatus(e,t={},i=process.env){let[a,s,c]=await Promise.all([detectProjectIdentity(e,t),findEnvFileWithKey(e,AI_GATEWAY_API_KEY_ENV_VAR),findEnvFileWithKey(e,`VERCEL_OIDC_TOKEN`)]);if(a!==void 0){let e={kind:`gateway-project`,projectName:a.projectName};return a.teamName!==void 0&&(e.teamName=a.teamName),e}let l={apiKeyInEnv:hasEnvValue(i[AI_GATEWAY_API_KEY_ENV_VAR])};s!==void 0&&(l.apiKeyFile=s),c!==void 0&&(l.oidcFile=c);let u=resolveGatewayCredential(l);return u===void 0?{kind:`unset`}:u.credential===`api-key`?{kind:`gateway-key`,envKey:AI_GATEWAY_API_KEY_ENV_VAR,source:u.source}:{kind:`gateway-key`,envKey:`VERCEL_OIDC_TOKEN`,source:{kind:`env-file`,path:u.file}}}async function runModelFlow(e){let{appRoot:t,prompter:n,signal:r}=e,o={readCurrentModel:readCurrentAgentModel,applySettings:changeAgentModelSettings,detectProviderStatus:detectModelProviderStatus,runProviderFlow,...e.deps},detectProvider=(e=!0)=>o.detectProviderStatus(t,e&&r!==void 0?{signal:r}:{}),l=o.selectModel?.fetchModels??fetchGatewayCatalog,[d,f,p]=await withSpinner(n,`Checking the project…`,()=>Promise.all([o.readCurrentModel(t),detectProvider(),l(r).catch(()=>void 0)]));r?.throwIfAborted();let{id:m,routing:h,serviceTier:g,editable:_,settingsEditable:v}=d,y=d.reasoning===`provider-default`?null:d.reasoning,b=f,x={model:{kind:`keep`},reasoning:{kind:`keep`},gatewayServiceTier:{kind:`keep`}},S,C,w=!1,T=h?.kind===`external`?{tone:`warning`,text:"`agent.ts` specifies the model provider directly. Model, provider, and service-tier changes stay source-owned; reasoning remains configurable here."}:void 0,E=b.kind===`unset`&&h?.kind!==`external`?`provider`:_||v?`model`:`provider`,D=h?.kind!==`external`&&(e.initialStep===`provider`||b.kind===`unset`);for(;;){let e;if(D)D=!1,e=`provider`;else try{e=await n.select({message:``,options:modelMenuRows(m,y,g,b,h,_,v),hintLayout:`stacked`,initialValue:E,notices:T===void 0?[]:[T]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;if(hasModelSettingsChanges(x))return{kind:`cancelled`,discardedDraft:!0};break}if(e===`done`){w=!0;break}if(e===`model`){let e=o.pickModelSettings;if(e===void 0)throw Error(`runModelFlow requires a pickModelSettings dep to open the model screen.`);let t=await e({model:_?{kind:`pick`,options:modelListRows(p),current:m}:{kind:`fixed`,current:m,reason:`Set via an SDK model call in agent.ts; edit the source to change it`},reasoning:y,serviceTier:g,settingsEditable:v,externalRouting:h?.kind===`external`,capabilitiesFor:e=>gatewayModelCapabilities(p,e)});if(r?.throwIfAborted(),t===void 0){E=`model`;continue}t.model!==void 0&&(m=t.model,h={kind:`gateway`,target:t.model.split(`/`)[0]??``},x.model={kind:`set`,value:t.model}),t.reasoning!==void 0&&(y=t.reasoning==="default"?null:t.reasoning,x.reasoning=y===null?{kind:`remove`}:{kind:`set`,value:y}),t.serviceTier!==void 0&&(g=t.serviceTier===`priority`?{kind:`priority`}:{kind:`standard`},x.gatewayServiceTier=t.serviceTier===`priority`?{kind:`set`,value:`priority`}:{kind:`remove`}),E=`done`;continue}let c=await o.runProviderFlow({appRoot:t,prompter:n,signal:r,currentProvider:b});if(c.kind===`cancelled`){if(r?.aborted)return{kind:`cancelled`};E=`provider`;continue}if(c.kind===`external-provider`){if(r?.aborted)return{kind:`cancelled`};E=`done`;continue}b=await withSpinner(n,`Checking the project…`,()=>detectProvider(!1)),C={status:b},c.kind===`done`&&c.resolution!==void 0&&(C.resolution=c.resolution),w=!0;break}if(w&&hasModelSettingsChanges(x)&&(S=await o.applySettings({appRoot:t,patch:x}),r?.throwIfAborted()),S===void 0&&C===void 0)return{kind:`cancelled`};let O={kind:`done`};return S!==void 0&&(O.modelMessage=formatApplyModelSettingsOutcome(S)),C!==void 0&&(O.providerOutcome=C),O}function hasModelSettingsChanges(e){return e.model.kind!==`keep`||e.reasoning.kind!==`keep`||e.gatewayServiceTier.kind!==`keep`}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config,r=n?.model;return{id:r?.id??null,routing:r?.routing??null,reasoning:n?.reasoning??null,serviceTier:readGatewayServiceTier(r?.providerOptions),editable:r!==void 0&&r.source===void 0,settingsEditable:n?.source!==void 0}}catch{return{id:null,routing:null,reasoning:null,serviceTier:{kind:`standard`},editable:!1,settingsEditable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,detectModelProviderStatus,modelChangeRefusalForUneditableModel,runModelFlow};
@@ -3,6 +3,7 @@ import { AI_GATEWAY_API_KEY_ENV_VAR } from "../ai-gateway-api-key.js";
3
3
  import type { Prompter, SelectOption } from "../prompter.js";
4
4
  import { validateGatewayApiKey, type GatewayKeyValidation } from "../validate-gateway-key.js";
5
5
  import { getVercelAuthStatus } from "../vercel-project.js";
6
+ import type { GatewayCredentialSource } from "#internal/resolve-model-endpoint-status.js";
6
7
  import { runLinkFlow, type LinkFlowResult } from "./link.js";
7
8
  export type ProviderConnection = "project" | "own-key" | "external";
8
9
  /**
@@ -20,7 +21,8 @@ export type ModelProviderStatus = {
20
21
  } | {
21
22
  kind: "gateway-key";
22
23
  envKey: typeof AI_GATEWAY_API_KEY_ENV_VAR | "VERCEL_OIDC_TOKEN";
23
- envFile: string;
24
+ /** Where the credential lives — an env file, or the shell for a key. */
25
+ source: GatewayCredentialSource;
24
26
  };
25
27
  export declare const PROVIDER_QUESTION = "Which model provider do you want to use?";
26
28
  export declare const EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE = "Using another model provider";
@@ -1,4 +1,4 @@
1
1
  import{__toESM}from"../../_virtual/_rolldown/runtime.js";import{require_picocolors}from"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js";import{appendEnv}from"../append-env.js";import{AI_GATEWAY_API_KEY_ENV_FILE,AI_GATEWAY_API_KEY_ENV_VAR,writeAiGatewayApiKey}from"../ai-gateway-api-key.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus,vercelAuthBlockerReason}from"../vercel-project.js";import{runLinkFlow}from"./link.js";import{validateGatewayApiKey}from"../validate-gateway-key.js";var import_picocolors=__toESM(require_picocolors(),1);const PROVIDER_QUESTION=`Which model provider do you want to use?`,EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE=`Using another model provider`,EXTERNAL_PROVIDER_INSTRUCTIONS=[`Set your provider's API key in ${AI_GATEWAY_API_KEY_ENV_FILE} — e.g. ANTHROPIC_API_KEY or OPENAI_API_KEY.`,'In agent/agent.ts, set `model` to a provider-authored model — e.g. `anthropic("claude-opus-4.8")` from `@ai-sdk/anthropic`.',`See https://eve.dev/docs/agent-config for details.`,"A running `eve dev` reloads env files automatically — no restart needed."];function projectConnectionOption(e){let t={value:`project`,label:`AI Gateway via Project`,hint:`Authenticates with AI Gateway automatically
2
- in a new or existing project. No keys to manage.`},n=e===void 0?void 0:vercelAuthBlockerReason(e);return n===void 0?t:{...t,disabled:!0,disabledReason:n,disabledReasonTone:`warning`}}function providerOptions(e,t){let n=projectConnectionOption(e);if(t?.kind===`gateway-project`){let e=t.teamName===void 0?import_picocolors.default.bold(t.projectName):`${import_picocolors.default.bold(t.projectName)} in team ${import_picocolors.default.bold(t.teamName)}`;n={...n,checked:!0,hint:`Linked to ${e}`}}let r={value:`own-key`,label:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`,hint:`⎿ type your key`};return t?.kind===`gateway-key`&&(r={...r,checked:!0,hint:`${t.envKey} set in ${t.envFile}`}),[n,r,{value:`external`,label:`Other providers`,hint:`Connect directly to a model provider
2
+ in a new or existing project. No keys to manage.`},n=e===void 0?void 0:vercelAuthBlockerReason(e);return n===void 0?t:{...t,disabled:!0,disabledReason:n,disabledReasonTone:`warning`}}function providerOptions(e,t){let n=projectConnectionOption(e);if(t?.kind===`gateway-project`){let e=t.teamName===void 0?import_picocolors.default.bold(t.projectName):`${import_picocolors.default.bold(t.projectName)} in team ${import_picocolors.default.bold(t.teamName)}`;n={...n,checked:!0,hint:`Linked to ${e}`}}let r={value:`own-key`,label:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`,hint:`⎿ type your key`};if(t?.kind===`gateway-key`){let e=t.source.kind===`shell`?`your shell`:t.source.path;r={...r,checked:!0,hint:`${t.envKey} set in ${e}`}}return[n,r,{value:`external`,label:`Other providers`,hint:`Connect directly to a model provider
3
3
  via OPENAI_API_KEY or ANTHROPIC_API_KEY.`}]}async function selectProvider(e){let t={message:PROVIDER_QUESTION,options:e.options,initialValue:e.initialValue,validateInlineKey:e.validateInlineKey};if(e.picker===void 0)throw Error(`The provider flow requires the Dev TUI provider picker.`);let n=await e.picker(t);if(n===void 0)throw new WizardCancelledError;return n}async function runProviderFlow(e){let{appRoot:t,prompter:r,signal:i}=e,o={getVercelAuthStatus,runLinkFlow,appendEnv,validateGatewayApiKey,...e.deps},s,c=e.currentProvider?.kind===`gateway-key`?`own-key`:`project`,l;try{for(;;){let n=await selectProvider({picker:e.picker,options:providerOptions(s,e.currentProvider),initialValue:c,validateInlineKey:(e,t)=>o.validateGatewayApiKey(e,i===void 0?t:AbortSignal.any([i,t]))});if(n.kind===`external`)return r.acknowledge?await r.acknowledge({message:EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE,lines:EXTERNAL_PROVIDER_INSTRUCTIONS}):r.note(EXTERNAL_PROVIDER_INSTRUCTIONS.join(`
4
- `),EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE),{kind:`external-provider`};if(n.kind===`inline-key`){l=n;break}let a=await withSpinner(r,`Checking your Vercel login…`,()=>o.getVercelAuthStatus(t,{signal:i}));if(i?.throwIfAborted(),s=a,vercelAuthBlockerReason(s)!==void 0){c=`own-key`;continue}return await o.runLinkFlow({appRoot:t,prompter:r,signal:i,projectSelection:`create-or-link`})}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}let u=l.key.trim(),d=l.validation;i?.throwIfAborted(),d.kind===`inconclusive`&&r.log.warning(`Couldn't reach the gateway to validate (${d.message}). Saving the key anyway.`);let f=await writeAiGatewayApiKey({projectRoot:t,apiKey:u,appendEnv:o.appendEnv});return r.log.success(`${f.envKey} set.`),{kind:`done`,credential:f.envKey}}export{EXTERNAL_PROVIDER_INSTRUCTIONS,EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE,PROVIDER_QUESTION,runProviderFlow};
4
+ `),EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE),{kind:`external-provider`};if(n.kind===`inline-key`){l=n;break}let a=await withSpinner(r,`Checking your Vercel login…`,()=>o.getVercelAuthStatus(t,{signal:i}));if(i?.throwIfAborted(),s=a,vercelAuthBlockerReason(s)!==void 0){c=`own-key`;continue}return await o.runLinkFlow({appRoot:t,prompter:r,signal:i,projectSelection:`create-or-link`})}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}let u=l.key.trim(),d=l.validation;i?.throwIfAborted(),d.kind===`inconclusive`&&r.log.warning(`Couldn't reach the gateway to validate (${d.message}). Saving the key anyway.`);let f=await writeAiGatewayApiKey({projectRoot:t,apiKey:u,appendEnv:o.appendEnv});return r.log.success(`${f.envKey} set.`),{kind:`done`,resolution:{credential:`api-key`,source:{kind:`env-file`,path:f.envFile}}}}export{EXTERNAL_PROVIDER_INSTRUCTIONS,EXTERNAL_PROVIDER_INSTRUCTIONS_TITLE,PROVIDER_QUESTION,runProviderFlow};
@@ -1,4 +1,4 @@
1
- import{pinnedNodeEngineMajor}from"../../node-engine.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`^7.0.26`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.4.0`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.26.0`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
1
+ import{pinnedNodeEngineMajor}from"../../node-engine.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{basename,join,resolve}from"node:path";import{mkdir,readdir,stat}from"node:fs/promises";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]),DEFAULT_AI_PACKAGE_VERSION=`^7.0.26`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.4.0`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.26.1`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e){return{"agent/agent.ts":BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
2
2
 
3
3
  export default defineAgent({
4
4
  model: "__EVE_INIT_MODEL__",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [
@@ -323,6 +323,7 @@
323
323
  "jose": "6.2.3",
324
324
  "jsonc-parser": "3.3.1",
325
325
  "just-bash": "3.0.1",
326
+ "marked": "17.0.6",
326
327
  "microsandbox": "0.5.5",
327
328
  "next": "16.3.0-preview.6",
328
329
  "picocolors": "1.1.1",