eve 0.24.5 → 0.25.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 (161) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/src/channel/cancel.d.ts +8 -0
  3. package/dist/src/channel/cancel.js +1 -0
  4. package/dist/src/channel/routes.d.ts +25 -4
  5. package/dist/src/channel/session.d.ts +10 -1
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +8 -0
  8. package/dist/src/chunks/{use-eve-agent-8rerxDHY.js → use-eve-agent-CQIeqmKc.js} +73 -66
  9. package/dist/src/chunks/{use-eve-agent-DhgdHzDG.js → use-eve-agent-Cy73lgA6.js} +73 -66
  10. package/dist/src/cli/commands/agent-instructions.js +1 -1
  11. package/dist/src/cli/commands/channels.js +1 -1
  12. package/dist/src/cli/commands/extension-build.d.ts +1 -1
  13. package/dist/src/cli/commands/extension-build.js +1 -1
  14. package/dist/src/client/output-schema.d.ts +0 -7
  15. package/dist/src/client/output-schema.js +1 -1
  16. package/dist/src/client/session.d.ts +6 -2
  17. package/dist/src/client/session.js +1 -1
  18. package/dist/src/compiler/extension-compatibility.d.ts +56 -0
  19. package/dist/src/compiler/extension-compatibility.js +1 -0
  20. package/dist/src/compiler/normalize-agent-config.js +1 -1
  21. package/dist/src/compiler/normalize-subagent.js +1 -1
  22. package/dist/src/context/build-dynamic-tools.js +1 -1
  23. package/dist/src/context/dynamic-tool-lifecycle.d.ts +1 -1
  24. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  25. package/dist/src/discover/discover-agent.d.ts +29 -7
  26. package/dist/src/discover/discover-agent.js +1 -1
  27. package/dist/src/discover/extensions.d.ts +43 -8
  28. package/dist/src/discover/extensions.js +1 -1
  29. package/dist/src/discover/filesystem.d.ts +3 -1
  30. package/dist/src/discover/filesystem.js +1 -1
  31. package/dist/src/discover/named-source-directory.js +1 -1
  32. package/dist/src/discover/skills.js +1 -1
  33. package/dist/src/evals/autoevals-client.js +2 -2
  34. package/dist/src/execution/node-step.js +1 -1
  35. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  36. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +1 -1
  37. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
  38. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
  39. package/dist/src/execution/sandbox/development-cleanup.d.ts +1 -1
  40. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  41. package/dist/src/execution/sandbox/development-run.d.ts +0 -3
  42. package/dist/src/execution/sandbox/development-run.js +1 -1
  43. package/dist/src/execution/sandbox/ensure.js +1 -1
  44. package/dist/src/execution/subagent-tool.js +1 -1
  45. package/dist/src/execution/workflow-runtime.js +1 -1
  46. package/dist/src/harness/emission.js +1 -1
  47. package/dist/src/harness/input-extraction.d.ts +10 -1
  48. package/dist/src/harness/input-extraction.js +1 -1
  49. package/dist/src/harness/input-requests.d.ts +12 -2
  50. package/dist/src/harness/input-requests.js +1 -1
  51. package/dist/src/harness/messages.d.ts +8 -1
  52. package/dist/src/harness/messages.js +1 -1
  53. package/dist/src/harness/stale-input-responses.d.ts +26 -0
  54. package/dist/src/harness/stale-input-responses.js +3 -0
  55. package/dist/src/harness/step-hooks.d.ts +1 -12
  56. package/dist/src/harness/step-hooks.js +1 -1
  57. package/dist/src/harness/tool-call-input-errors.d.ts +11 -0
  58. package/dist/src/harness/tool-call-input-errors.js +1 -1
  59. package/dist/src/harness/tool-loop.js +2 -2
  60. package/dist/src/harness/workflow-sandbox.d.ts +1 -1
  61. package/dist/src/harness/workflow-sandbox.js +1 -1
  62. package/dist/src/internal/application/optional-package-install.d.ts +5 -0
  63. package/dist/src/internal/application/optional-package-install.js +1 -1
  64. package/dist/src/internal/application/package.js +1 -1
  65. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  66. package/dist/src/internal/authored-module-loader.d.ts +17 -0
  67. package/dist/src/internal/authored-module-loader.js +2 -2
  68. package/dist/src/internal/authored-module-map-loader.js +1 -1
  69. package/dist/src/internal/authored-package-boundary.d.ts +8 -0
  70. package/dist/src/internal/authored-package-boundary.js +1 -1
  71. package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +4 -0
  72. package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
  73. package/dist/src/internal/nitro/host/build-extension.d.ts +6 -21
  74. package/dist/src/internal/nitro/host/build-extension.js +2 -4
  75. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  76. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  77. package/dist/src/internal/nitro/host/dev-workspace-extensions.d.ts +18 -0
  78. package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -0
  79. package/dist/src/internal/nitro/host/extension-build-config.d.ts +18 -0
  80. package/dist/src/internal/nitro/host/extension-build-config.js +1 -0
  81. package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +10 -0
  82. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -0
  83. package/dist/src/internal/nitro/host/extension-declarations.d.ts +10 -0
  84. package/dist/src/internal/nitro/host/extension-declarations.js +2 -0
  85. package/dist/src/internal/nitro/host/extension-distribution.d.ts +32 -0
  86. package/dist/src/internal/nitro/host/extension-distribution.js +3 -0
  87. package/dist/src/internal/nitro/host/extension-state-usage.d.ts +7 -0
  88. package/dist/src/internal/nitro/host/extension-state-usage.js +1 -0
  89. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +5 -1
  90. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  91. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  92. package/dist/src/internal/nitro/host/types.d.ts +2 -0
  93. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  94. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  95. package/dist/src/public/channels/index.d.ts +1 -1
  96. package/dist/src/public/definitions/channel.d.ts +1 -1
  97. package/dist/src/public/definitions/tool.d.ts +2 -2
  98. package/dist/src/public/tools/internal.js +1 -1
  99. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  100. package/dist/src/runtime/connections/openapi-client.js +1 -1
  101. package/dist/src/runtime/framework-tools/ask-question.d.ts +23 -9
  102. package/dist/src/runtime/framework-tools/ask-question.js +1 -1
  103. package/dist/src/runtime/framework-tools/bash.d.ts +10 -3
  104. package/dist/src/runtime/framework-tools/bash.js +1 -1
  105. package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
  106. package/dist/src/runtime/framework-tools/final-output.d.ts +1 -1
  107. package/dist/src/runtime/framework-tools/final-output.js +1 -1
  108. package/dist/src/runtime/framework-tools/glob.d.ts +12 -3
  109. package/dist/src/runtime/framework-tools/glob.js +1 -1
  110. package/dist/src/runtime/framework-tools/grep.d.ts +16 -3
  111. package/dist/src/runtime/framework-tools/grep.js +1 -1
  112. package/dist/src/runtime/framework-tools/read-file.d.ts +13 -3
  113. package/dist/src/runtime/framework-tools/read-file.js +1 -1
  114. package/dist/src/runtime/framework-tools/skill.d.ts +5 -2
  115. package/dist/src/runtime/framework-tools/skill.js +1 -1
  116. package/dist/src/runtime/framework-tools/todo.d.ts +57 -10
  117. package/dist/src/runtime/framework-tools/todo.js +3 -3
  118. package/dist/src/runtime/framework-tools/web-fetch.d.ts +16 -3
  119. package/dist/src/runtime/framework-tools/web-fetch.js +1 -1
  120. package/dist/src/runtime/framework-tools/write-file.d.ts +9 -3
  121. package/dist/src/runtime/framework-tools/write-file.js +1 -1
  122. package/dist/src/runtime/loaders/compile-metadata.js +1 -1
  123. package/dist/src/runtime/loaders/manifest.js +1 -1
  124. package/dist/src/runtime/loaders/module-map.js +1 -1
  125. package/dist/src/runtime/resolve-tool.d.ts +4 -5
  126. package/dist/src/runtime/resolve-tool.js +1 -1
  127. package/dist/src/runtime/subagents/registry.d.ts +6 -3
  128. package/dist/src/runtime/subagents/registry.js +1 -1
  129. package/dist/src/runtime/tools/registry.js +1 -1
  130. package/dist/src/runtime/types.d.ts +7 -9
  131. package/dist/src/setup/boxes/deploy-project.d.ts +11 -1
  132. package/dist/src/setup/boxes/deploy-project.js +1 -1
  133. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  134. package/dist/src/setup/scaffold/create/extension.js +2 -2
  135. package/dist/src/setup/scaffold/create/project.js +2 -2
  136. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  137. package/dist/src/setup/scaffold/create/web-template.js +1 -0
  138. package/dist/src/setup/scaffold/update/channels.js +2 -2
  139. package/dist/src/setup/scaffold/update/connections.js +1 -1
  140. package/dist/src/setup/vercel-project-framework.d.ts +4 -2
  141. package/dist/src/shared/extension-package-contract.d.ts +11 -0
  142. package/dist/src/shared/extension-package-contract.js +1 -0
  143. package/dist/src/shared/json.d.ts +4 -0
  144. package/dist/src/shared/json.js +1 -1
  145. package/dist/src/shared/tool-schema.d.ts +52 -0
  146. package/dist/src/shared/tool-schema.js +1 -0
  147. package/dist/src/svelte/index.js +1 -1
  148. package/dist/src/svelte/use-eve-agent.js +1 -1
  149. package/dist/src/vue/index.js +1 -1
  150. package/dist/src/vue/use-eve-agent.js +1 -1
  151. package/docs/channels/custom.mdx +32 -2
  152. package/docs/concepts/sessions-runs-and-streaming.md +8 -0
  153. package/docs/extensions.md +22 -6
  154. package/docs/reference/cli.md +2 -2
  155. package/package.json +2 -2
  156. package/dist/src/internal/json-schema.d.ts +0 -1
  157. package/dist/src/internal/json-schema.js +0 -1
  158. package/dist/src/setup/boxes/reconcile-host-framework-preset.d.ts +0 -26
  159. package/dist/src/setup/boxes/reconcile-host-framework-preset.js +0 -1
  160. package/dist/src/shared/json-schema.d.ts +0 -9
  161. package/dist/src/shared/json-schema.js +0 -1
@@ -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.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.24.5`,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.25.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";
2
2
 
3
3
  export default defineAgent({
4
4
  model: "__EVE_INIT_MODEL__",
@@ -93,4 +93,4 @@ export default defineAgent({
93
93
  },
94
94
  },
95
95
  });
96
- `:BASE_AGENT_TEMPLATE,...SHARED_TEMPLATE_FILES,"package.json":packageJsonTemplate({includeRootOnlyFields:e.includeRootOnlyPackageJsonFields,packageManager:e.packageManager})}}async function assertCanCreateInPlace(e,t){if(!await pathExists(e))return;let r=(await readdir(e)).filter(e=>!ALLOWED_CREATE_IN_PLACE_ENTRIES.has(e));if(r.length>0&&!t){let e=r.slice(0,5).join(`, `),t=r.length>5?`, and ${r.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${e}${t}. Use an empty directory.`)}}async function scaffoldBaseProject(t){let s=resolve(t.targetDirectory??process.cwd(),t.projectName),c=t.projectName===`.`,l=t.overwriteExisting??!1,u=t.byokProvider??!1,d=t.packageManager??`pnpm`,f=resolveEvePackageContract(t.evePackage),p=pinnedNodeEngineMajor(f.nodeEngine),m=resolve(t.workspaceProbeDirectory??s),h=isPackageManagerWorkspaceMember(d,m);if(c)await assertCanCreateInPlace(s,l);else if(await pathExists(s))throw Error(`Cannot create project because "${s}" already exists.`);let g={appName:basename(s),model:t.model,eveVersion:f.version,aiPackageVersion:resolveVersionToken(`aiPackageVersion`,t.aiPackageVersion??`^7.0.26`),connectPackageVersion:resolveVersionToken(`connectPackageVersion`,t.connectPackageVersion??`0.2.2`),zodPackageVersion:resolveVersionToken(`zodPackageVersion`,t.zodPackageVersion??`4.4.3`),typescriptPackageVersion:resolveVersionToken(`typescriptPackageVersion`,t.typescriptPackageVersion??`7.0.2`),nodeTypesVersion:p,nodeEngine:p};await mkdir(s,{recursive:!0});for(let[e,i]of Object.entries(templateFiles({byokProvider:u,includeRootOnlyPackageJsonFields:!h,packageManager:d}))){let a=`${s}/${e}`,o=await pathExists(a);await writeTextFile(a,renderTemplate(i,g),{force:c&&l}),o&&await t.onOverwriteFile?.(a)}return await applyPackageManagerWorkspaceConfiguration({packageManager:d,projectRoot:s,workspaceProbeRoot:m,onWorkspaceRootMutation:t.onWorkspaceRootMutation}),await patchWorkspaceRootPackageJson(d,m,{aiPackageVersion:g.aiPackageVersion,nodeEngineRequirement:f.nodeEngine,onWorkspaceRootMutation:t.onWorkspaceRootMutation}),s}async function isEveProject(e){for(let n of SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS)try{return await stat(join(e,`agent`,`agent${n}`)),!0}catch{}return!1}export{CURRENT_DIRECTORY_PROJECT_NAME,DEFAULT_AI_PACKAGE_VERSION,DEFAULT_CONNECT_PACKAGE_VERSION,DEFAULT_EVE_PACKAGE_CONTRACT,DEFAULT_ZOD_PACKAGE_VERSION,ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX,agentTemplateFiles,byokProviderEnvVar,formatEveDependencySpecifier,isEveProject,modelProviderSlug,resolveEvePackageContract,scaffoldBaseProject};
96
+ `:BASE_AGENT_TEMPLATE,...SHARED_TEMPLATE_FILES,"package.json":packageJsonTemplate({includeRootOnlyFields:e.includeRootOnlyPackageJsonFields,packageManager:e.packageManager})}}async function assertCanCreateInPlace(e,t){if(!await pathExists(e))return;let r=(await readdir(e)).filter(e=>!ALLOWED_CREATE_IN_PLACE_ENTRIES.has(e));if(r.length>0&&!t){let e=r.slice(0,5).join(`, `),t=r.length>5?`, and ${r.length-5} more`:``;throw Error(`Cannot create project in current directory because it is not empty. Found: ${e}${t}. Use an empty directory.`)}}async function scaffoldBaseProject(t){let s=resolve(t.targetDirectory??process.cwd(),t.projectName),c=t.projectName===`.`,l=t.overwriteExisting??!1,u=t.byokProvider??!1,d=t.packageManager??`pnpm`,f=resolveEvePackageContract(t.evePackage),p=pinnedNodeEngineMajor(f.nodeEngine),m=resolve(t.workspaceProbeDirectory??s),h=isPackageManagerWorkspaceMember(d,m);if(c)await assertCanCreateInPlace(s,l);else if(await pathExists(s))throw Error(`Cannot create project because "${s}" already exists.`);let g={appName:basename(s),model:t.model,eveVersion:f.version,aiPackageVersion:resolveVersionToken(`aiPackageVersion`,t.aiPackageVersion??`^7.0.26`),connectPackageVersion:resolveVersionToken(`connectPackageVersion`,t.connectPackageVersion??`0.4.0`),zodPackageVersion:resolveVersionToken(`zodPackageVersion`,t.zodPackageVersion??`4.4.3`),typescriptPackageVersion:resolveVersionToken(`typescriptPackageVersion`,t.typescriptPackageVersion??`7.0.2`),nodeTypesVersion:p,nodeEngine:p};await mkdir(s,{recursive:!0});for(let[e,i]of Object.entries(templateFiles({byokProvider:u,includeRootOnlyPackageJsonFields:!h,packageManager:d}))){let a=`${s}/${e}`,o=await pathExists(a);await writeTextFile(a,renderTemplate(i,g),{force:c&&l}),o&&await t.onOverwriteFile?.(a)}return await applyPackageManagerWorkspaceConfiguration({packageManager:d,projectRoot:s,workspaceProbeRoot:m,onWorkspaceRootMutation:t.onWorkspaceRootMutation}),await patchWorkspaceRootPackageJson(d,m,{aiPackageVersion:g.aiPackageVersion,nodeEngineRequirement:f.nodeEngine,onWorkspaceRootMutation:t.onWorkspaceRootMutation}),s}async function isEveProject(e){for(let n of SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS)try{return await stat(join(e,`agent`,`agent${n}`)),!0}catch{}return!1}export{CURRENT_DIRECTORY_PROJECT_NAME,DEFAULT_AI_PACKAGE_VERSION,DEFAULT_CONNECT_PACKAGE_VERSION,DEFAULT_EVE_PACKAGE_CONTRACT,DEFAULT_ZOD_PACKAGE_VERSION,ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX,agentTemplateFiles,byokProviderEnvVar,formatEveDependencySpecifier,isEveProject,modelProviderSlug,resolveEvePackageContract,scaffoldBaseProject};
@@ -31,7 +31,7 @@ export declare const WEB_APP_TEMPLATE_FILES: {
31
31
  readonly "components.json": '{\n "$schema": "https://ui.shadcn.com/schema.json",\n "style": "new-york",\n "rsc": true,\n "tsx": true,\n "tailwind": {\n "config": "",\n "css": "app/globals.css",\n "baseColor": "neutral",\n "cssVariables": true,\n "prefix": ""\n },\n "iconLibrary": "lucide",\n "aliases": {\n "components": "@/components",\n "utils": "@/lib/utils",\n "ui": "@/components/ui",\n "lib": "@/lib",\n "hooks": "@/hooks"\n },\n "registries": {}\n}\n';
32
32
  readonly "css.d.ts": 'declare module "*.css";\n';
33
33
  readonly "lib/utils.ts": 'import { clsx, type ClassValue } from "clsx";\nimport { twMerge } from "tailwind-merge";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n';
34
- readonly "next-env.d.ts": '/// <reference types="next" />\n/// <reference types="next/image-types/global" />\nimport "./.next/types/routes.d.ts";\n\n// NOTE: This file should not be edited\n// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.\n';
34
+ readonly "next-env.d.ts": '/// <reference types="next" />\n/// <reference types="next/image-types/global" />\nimport "./.next/types/routes.d.ts";\nimport "./.next/types/root-params.d.ts";\n\n// NOTE: This file should not be edited\n// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.\n';
35
35
  readonly "next.config.ts": 'import type { NextConfig } from "next";\nimport { withEve } from "eve/next";\n\nconst nextConfig: NextConfig = {};\n\nexport default withEve(nextConfig__EVE_INIT_WITH_EVE_OPTIONS__);\n';
36
36
  readonly "postcss.config.mjs": 'const config = {\n plugins: {\n "@tailwindcss/postcss": {},\n },\n};\n\nexport default config;\n';
37
37
  readonly "tsconfig.json": '{\n "$schema": "https://json.schemastore.org/tsconfig",\n "compilerOptions": {\n "target": "ES2017",\n "lib": ["dom", "dom.iterable", "esnext"],\n "allowJs": true,\n "skipLibCheck": true,\n "strict": true,\n "noEmit": true,\n "esModuleInterop": true,\n "module": "esnext",\n "moduleResolution": "Bundler",\n "resolveJsonModule": true,\n "isolatedModules": true,\n "jsx": "react-jsx",\n "incremental": true,\n "plugins": [\n {\n "name": "next"\n }\n ],\n "paths": {\n "@/*": ["./*"]\n }\n },\n "include": [\n "next-env.d.ts",\n "**/*.ts",\n "**/*.tsx",\n ".next/types/**/*.ts",\n ".next/dev/types/**/*.ts"\n ],\n "exclude": ["node_modules"]\n}\n';
@@ -4821,6 +4821,7 @@ export function cn(...inputs: ClassValue[]): string {
4821
4821
  `,"next-env.d.ts":`/// <reference types="next" />
4822
4822
  /// <reference types="next/image-types/global" />
4823
4823
  import "./.next/types/routes.d.ts";
4824
+ import "./.next/types/root-params.d.ts";
4824
4825
 
4825
4826
  // NOTE: This file should not be edited
4826
4827
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,7 +1,7 @@
1
- import{pinnedNodeEngineMajor}from"../../node-engine.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON}from"../create/web-template.js";import{DEFAULT_EVE_PACKAGE_CONTRACT,resolveEvePackageContract}from"../create/project.js";import{basename,join,resolve}from"node:path";import{readFile,readdir}from"node:fs/promises";const SLACK_CHANNEL_DEFAULT_ROUTE=`/eve/v1/slack`,DEFAULT_SLACK_CONNECTOR_SLUG=`my-agent`,NEXT_PACKAGE_NAME=`next`,PACKAGE_DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`],WEB_NEXT_CONFIG_PATH=`next.config.ts`,WEB_COMPETING_NEXT_CONFIG_PATHS=[`next.config.js`,`next.config.mjs`,WEB_NEXT_CONFIG_PATH,`next.config.mts`].filter(e=>e!==WEB_NEXT_CONFIG_PATH);function toSlackConnectorSlug(e){return e}function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function readPackageJsonObject(e){if(!await pathExists(e))return;let t=JSON.parse(await readFile(e,`utf8`));return isJsonObject(t)?t:void 0}async function readDependencyVersion(e,t){let n=await readPackageJsonObject(e);if(n===void 0||!isJsonObject(n.dependencies))return;let r=n.dependencies[t];return typeof r==`string`?r:void 0}function packageJsonHasDependency(e,t){for(let n of PACKAGE_DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function hasPackageDependency(e,t){let n=await readPackageJsonObject(e);return n!==void 0&&packageJsonHasDependency(n,t)}async function isNextJsProject(e){return hasPackageDependency(join(e,`package.json`),NEXT_PACKAGE_NAME)}const VERCEL_HOST_FRAMEWORK_PRESETS={"@sveltejs/kit":`sveltekit`,[NEXT_PACKAGE_NAME]:`nextjs`,nuxt:`nuxtjs`,nuxt3:`nuxtjs`,"nuxt-edge":`nuxtjs`,"nuxt-nightly":`nuxtjs`};async function resolveVercelHostFrameworkPreset(e){let t=await readPackageJsonObject(join(e,`package.json`));if(t!==void 0){for(let[e,n]of Object.entries(VERCEL_HOST_FRAMEWORK_PRESETS))if(packageJsonHasDependency(t,e))return n}}async function hasVercelHostFramework(e){return await resolveVercelHostFrameworkPreset(e)!==void 0}async function ensurePackageDependency(e,t,n){return!await pathExists(e)||await readDependencyVersion(e,t)===n?[]:(await patchPackageJson(e,{dependencies:{[t]:n}}),[{path:e,dependencies:[t],devDependencies:[],scripts:[]}])}function resolveWebPackageVersions(e){return{evePackage:e?.evePackage??DEFAULT_EVE_PACKAGE_CONTRACT,aiPackageVersion:e?.aiPackageVersion??`^7.0.26`,nextPackageVersion:e?.nextPackageVersion??`16.2.6`,reactPackageVersion:e?.reactPackageVersion??`19.2.6`,reactDomPackageVersion:e?.reactDomPackageVersion??`19.2.6`,streamdownPackageVersion:e?.streamdownPackageVersion??`2.5.0`,zodPackageVersion:e?.zodPackageVersion??`4.4.3`,typesReactPackageVersion:e?.typesReactPackageVersion??`19.2.15`,typesReactDomPackageVersion:e?.typesReactDomPackageVersion??`19.2.3`}}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}async function patchWebPackageJson(t,n,i,s,u){let f=join(t,`package.json`);if(!await pathExists(f))return{mutations:[]};let m=resolveEvePackageContract(s.evePackage),h=pinnedNodeEngineMajor(m.nodeEngine),g={...WEB_APP_TEMPLATE_PACKAGE_JSON.dependencies,ai:resolveVersionToken(`aiPackageVersion`,s.aiPackageVersion),eve:formatEveDependencySpecifier(m.version),next:resolveVersionToken(`nextPackageVersion`,s.nextPackageVersion),react:resolveVersionToken(`reactPackageVersion`,s.reactPackageVersion),"react-dom":resolveVersionToken(`reactDomPackageVersion`,s.reactDomPackageVersion),streamdown:resolveVersionToken(`streamdownPackageVersion`,s.streamdownPackageVersion),zod:resolveVersionToken(`zodPackageVersion`,s.zodPackageVersion)},_={...WEB_APP_TEMPLATE_PACKAGE_JSON.devDependencies,"@types/node":h,"@types/react":resolveVersionToken(`typesReactPackageVersion`,s.typesReactPackageVersion),"@types/react-dom":resolveVersionToken(`typesReactDomPackageVersion`,s.typesReactDomPackageVersion),typescript:`6.0.3`},v=WEB_APP_TEMPLATE_PACKAGE_JSON.scripts,y=isPackageManagerWorkspaceMember(n,i),b={dependencies:g,devDependencies:_,scripts:v};y||(b.nodeEngineRequirement=m.nodeEngine);let x=await patchPackageJson(f,b),S=(await patchWorkspaceRootPackageJson(n,i,{aiPackageVersion:g.ai,nodeEngineRequirement:m.nodeEngine,onWorkspaceRootMutation:u})).nodeEngineOverride??x.nodeEngineOverride;return{mutations:[{path:f,dependencies:Object.keys(g),devDependencies:Object.keys(_),scripts:Object.keys(v)}],nodeEngineOverride:S}}function normalizeSlackConnectorSlug(e){return toSlackConnectorSlug((e.trim().replace(/^@/,``).split(`/`).at(-1)??``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^[^a-z0-9]+/,``).replace(/[^a-z0-9]+$/,``).slice(0,100).replace(/[^a-z0-9]+$/,``)||`my-agent`)}async function deriveSlackConnectorSlug(e,t){if(t!==void 0&&t.length>0&&t!==`.`)return normalizeSlackConnectorSlug(t);try{let t=await readFile(join(e,`package.json`),`utf8`),n=JSON.parse(t);if(typeof n.name==`string`&&n.name.length>0)return normalizeSlackConnectorSlug(n.name)}catch{}return normalizeSlackConnectorSlug(basename(resolve(e))||`my-agent`)}function buildSlackTemplate(e){if(!e.startsWith(`slack/`)||e.length===6)throw Error(`Invalid Slack connector UID "${e}".`);return`import { connectSlackCredentials } from "@vercel/connect/eve";
1
+ import{pinnedNodeEngineMajor}from"../../node-engine.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON}from"../create/web-template.js";import{DEFAULT_EVE_PACKAGE_CONTRACT,resolveEvePackageContract}from"../create/project.js";import{basename,join,resolve}from"node:path";import{readFile,readdir}from"node:fs/promises";const SLACK_CHANNEL_DEFAULT_ROUTE=`/eve/v1/slack`,DEFAULT_SLACK_CONNECTOR_SLUG=`my-agent`,NEXT_PACKAGE_NAME=`next`,PACKAGE_DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`],WEB_NEXT_CONFIG_PATH=`next.config.ts`,WEB_COMPETING_NEXT_CONFIG_PATHS=[`next.config.js`,`next.config.mjs`,WEB_NEXT_CONFIG_PATH,`next.config.mts`].filter(e=>e!==WEB_NEXT_CONFIG_PATH);function toSlackConnectorSlug(e){return e}function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function readPackageJsonObject(e){if(!await pathExists(e))return;let t=JSON.parse(await readFile(e,`utf8`));return isJsonObject(t)?t:void 0}async function readDependencyVersion(e,t){let n=await readPackageJsonObject(e);if(n===void 0||!isJsonObject(n.dependencies))return;let r=n.dependencies[t];return typeof r==`string`?r:void 0}function packageJsonHasDependency(e,t){for(let n of PACKAGE_DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function hasPackageDependency(e,t){let n=await readPackageJsonObject(e);return n!==void 0&&packageJsonHasDependency(n,t)}async function isNextJsProject(e){return hasPackageDependency(join(e,`package.json`),NEXT_PACKAGE_NAME)}const VERCEL_HOST_FRAMEWORK_PRESETS={"@sveltejs/kit":`sveltekit`,[NEXT_PACKAGE_NAME]:`nextjs`,nuxt:`nuxtjs`,nuxt3:`nuxtjs`,"nuxt-edge":`nuxtjs`,"nuxt-nightly":`nuxtjs`};async function resolveVercelHostFrameworkPreset(e){let t=await readPackageJsonObject(join(e,`package.json`));if(t!==void 0){for(let[e,n]of Object.entries(VERCEL_HOST_FRAMEWORK_PRESETS))if(packageJsonHasDependency(t,e))return n}}async function hasVercelHostFramework(e){return await resolveVercelHostFrameworkPreset(e)!==void 0}async function ensurePackageDependency(e,t,n){return!await pathExists(e)||await readDependencyVersion(e,t)===n?[]:(await patchPackageJson(e,{dependencies:{[t]:n}}),[{path:e,dependencies:[t],devDependencies:[],scripts:[]}])}function resolveWebPackageVersions(e){return{evePackage:e?.evePackage??DEFAULT_EVE_PACKAGE_CONTRACT,aiPackageVersion:e?.aiPackageVersion??`^7.0.26`,nextPackageVersion:e?.nextPackageVersion??`16.3.0-preview.6`,reactPackageVersion:e?.reactPackageVersion??`19.2.6`,reactDomPackageVersion:e?.reactDomPackageVersion??`19.2.6`,streamdownPackageVersion:e?.streamdownPackageVersion??`2.5.0`,zodPackageVersion:e?.zodPackageVersion??`4.4.3`,typesReactPackageVersion:e?.typesReactPackageVersion??`19.2.15`,typesReactDomPackageVersion:e?.typesReactDomPackageVersion??`19.2.3`}}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}async function patchWebPackageJson(t,n,i,s,u){let f=join(t,`package.json`);if(!await pathExists(f))return{mutations:[]};let m=resolveEvePackageContract(s.evePackage),h=pinnedNodeEngineMajor(m.nodeEngine),g={...WEB_APP_TEMPLATE_PACKAGE_JSON.dependencies,ai:resolveVersionToken(`aiPackageVersion`,s.aiPackageVersion),eve:formatEveDependencySpecifier(m.version),next:resolveVersionToken(`nextPackageVersion`,s.nextPackageVersion),react:resolveVersionToken(`reactPackageVersion`,s.reactPackageVersion),"react-dom":resolveVersionToken(`reactDomPackageVersion`,s.reactDomPackageVersion),streamdown:resolveVersionToken(`streamdownPackageVersion`,s.streamdownPackageVersion),zod:resolveVersionToken(`zodPackageVersion`,s.zodPackageVersion)},_={...WEB_APP_TEMPLATE_PACKAGE_JSON.devDependencies,"@types/node":h,"@types/react":resolveVersionToken(`typesReactPackageVersion`,s.typesReactPackageVersion),"@types/react-dom":resolveVersionToken(`typesReactDomPackageVersion`,s.typesReactDomPackageVersion),typescript:`6.0.3`},v=WEB_APP_TEMPLATE_PACKAGE_JSON.scripts,y=isPackageManagerWorkspaceMember(n,i),b={dependencies:g,devDependencies:_,scripts:v};y||(b.nodeEngineRequirement=m.nodeEngine);let x=await patchPackageJson(f,b),S=(await patchWorkspaceRootPackageJson(n,i,{aiPackageVersion:g.ai,nodeEngineRequirement:m.nodeEngine,onWorkspaceRootMutation:u})).nodeEngineOverride??x.nodeEngineOverride;return{mutations:[{path:f,dependencies:Object.keys(g),devDependencies:Object.keys(_),scripts:Object.keys(v)}],nodeEngineOverride:S}}function normalizeSlackConnectorSlug(e){return toSlackConnectorSlug((e.trim().replace(/^@/,``).split(`/`).at(-1)??``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^[^a-z0-9]+/,``).replace(/[^a-z0-9]+$/,``).slice(0,100).replace(/[^a-z0-9]+$/,``)||`my-agent`)}async function deriveSlackConnectorSlug(e,t){if(t!==void 0&&t.length>0&&t!==`.`)return normalizeSlackConnectorSlug(t);try{let t=await readFile(join(e,`package.json`),`utf8`),n=JSON.parse(t);if(typeof n.name==`string`&&n.name.length>0)return normalizeSlackConnectorSlug(n.name)}catch{}return normalizeSlackConnectorSlug(basename(resolve(e))||`my-agent`)}function buildSlackTemplate(e){if(!e.startsWith(`slack/`)||e.length===6)throw Error(`Invalid Slack connector UID "${e}".`);return`import { connectSlackCredentials } from "@vercel/connect/eve";
2
2
  import { slackChannel } from "eve/channels/slack";
3
3
 
4
4
  export default slackChannel({
5
5
  credentials: connectSlackCredentials(${JSON.stringify(e)}),
6
6
  });
7
- `}function renderWebAppTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t).replaceAll(`__EVE_INIT_WITH_EVE_OPTIONS__`,``)}async function ensureWebVercelJson(e){return await pathExists(e)?`skipped`:(await writeTextFile(e,`${JSON.stringify({$schema:`https://openapi.vercel.sh/vercel.json`},null,2)}\n`,{force:!0}),`written`)}async function findCompetingNextConfigFiles(e){let t=[];for(let n of WEB_COMPETING_NEXT_CONFIG_PATHS){let i=join(e,n);await pathExists(i)&&t.push(i)}return t}async function ensureChannel(e){switch(e.kind){case`slack`:return ensureSlackChannel({...e,kind:`slack`});case`web`:return ensureWebChannel({...e,kind:`web`})}}async function ensureWebChannel(e){let t=join(e.projectRoot,`package.json`),n=await pathExists(join(e.projectRoot,`app/page.tsx`));if(!e.force&&await isNextJsProject(e.projectRoot))return{kind:`web`,action:`skipped`,skipReason:`nextjs-project`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let a=resolveWebPackageVersions(e.webPackageVersions),o=e.packageManager??`pnpm`,c=resolve(e.workspaceProbeDirectory??e.projectRoot),l=await patchWebPackageJson(e.projectRoot,o,c,a,e.onWorkspaceRootMutation),d=[],f=[],p=[],g=[],_=basename(resolve(e.projectRoot));if(e.configureVercelServices??!0){let t=join(e.projectRoot,`vercel.json`);await ensureWebVercelJson(t)===`written`?d.push(t):g.push(t)}let v=await applyPackageManagerWorkspaceConfiguration({packageManager:o,projectRoot:e.projectRoot,workspaceProbeRoot:c,onWorkspaceRootMutation:e.onWorkspaceRootMutation});d.push(...v.filesWritten),g.push(...v.filesSkipped);for(let[t,n]of Object.entries(WEB_APP_TEMPLATE_FILES)){let a=join(e.projectRoot,t);if(t===`agent/channels/eve.ts`&&!e.force&&await pathExists(a)){g.push(a);continue}let o=await pathExists(a);await writeTextFile(a,renderWebAppTemplate(n,_),{force:!0}),d.push(a),o&&f.push(a)}p.push(...await findCompetingNextConfigFiles(e.projectRoot));let y=[...new Set(d)],b=[...new Set(g)].filter(e=>!y.includes(e)),x={kind:`web`,action:n?`overwritten`:`created`,filesWritten:y,filesSkipped:b,packageJsonUpdated:l.mutations};return f.length>0&&(x.filesOverwritten=f),p.length>0&&(x.competingNextConfigFiles=p),l.nodeEngineOverride!==void 0&&(x.nodeEngineOverride=l.nodeEngineOverride),x}async function ensureSlackChannel(e){let t=join(e.projectRoot,`agent/channels/slack.ts`),n=await pathExists(t);if(!e.force&&n)return{kind:`slack`,action:`skipped`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let o=resolveVersionToken(`connectPackageVersion`,e.connectPackageVersion??`0.2.2`),s=await ensurePackageDependency(join(e.projectRoot,`package.json`),`@vercel/connect`,o),c=e.slackConnectorSlug??await deriveSlackConnectorSlug(e.projectRoot);await writeTextFile(t,buildSlackTemplate(e.slackConnectorUid??`slack/${c}`),{force:e.force});let l={kind:`slack`,action:n?`overwritten`:`created`,filesWritten:[t],filesSkipped:[],packageJsonUpdated:s,slackConnectorSlug:c};return n&&(l.filesOverwritten=[t]),l}async function listAuthoredChannels(e){let r=join(e,`agent/channels`),i;try{i=await readdir(r,{withFileTypes:!0})}catch(e){if(e.code===`ENOENT`)return[];throw e}let a=[];for(let e of i){if(e.isFile()){let n=getSupportedModuleBaseName(e.name);n!==null&&a.push(n);continue}if(e.isDirectory())try{(await readdir(join(r,e.name))).some(e=>matchesSupportedModuleBaseName(e,`connection`))&&a.push(e.name)}catch{}}return a.sort()}export{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset};
7
+ `}function renderWebAppTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t).replaceAll(`__EVE_INIT_WITH_EVE_OPTIONS__`,``)}async function ensureWebVercelJson(e){return await pathExists(e)?`skipped`:(await writeTextFile(e,`${JSON.stringify({$schema:`https://openapi.vercel.sh/vercel.json`},null,2)}\n`,{force:!0}),`written`)}async function findCompetingNextConfigFiles(e){let t=[];for(let n of WEB_COMPETING_NEXT_CONFIG_PATHS){let i=join(e,n);await pathExists(i)&&t.push(i)}return t}async function ensureChannel(e){switch(e.kind){case`slack`:return ensureSlackChannel({...e,kind:`slack`});case`web`:return ensureWebChannel({...e,kind:`web`})}}async function ensureWebChannel(e){let t=join(e.projectRoot,`package.json`),n=await pathExists(join(e.projectRoot,`app/page.tsx`));if(!e.force&&await isNextJsProject(e.projectRoot))return{kind:`web`,action:`skipped`,skipReason:`nextjs-project`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let a=resolveWebPackageVersions(e.webPackageVersions),o=e.packageManager??`pnpm`,c=resolve(e.workspaceProbeDirectory??e.projectRoot),l=await patchWebPackageJson(e.projectRoot,o,c,a,e.onWorkspaceRootMutation),d=[],f=[],p=[],g=[],_=basename(resolve(e.projectRoot));if(e.configureVercelServices??!0){let t=join(e.projectRoot,`vercel.json`);await ensureWebVercelJson(t)===`written`?d.push(t):g.push(t)}let v=await applyPackageManagerWorkspaceConfiguration({packageManager:o,projectRoot:e.projectRoot,workspaceProbeRoot:c,onWorkspaceRootMutation:e.onWorkspaceRootMutation});d.push(...v.filesWritten),g.push(...v.filesSkipped);for(let[t,n]of Object.entries(WEB_APP_TEMPLATE_FILES)){let a=join(e.projectRoot,t);if(t===`agent/channels/eve.ts`&&!e.force&&await pathExists(a)){g.push(a);continue}let o=await pathExists(a);await writeTextFile(a,renderWebAppTemplate(n,_),{force:!0}),d.push(a),o&&f.push(a)}p.push(...await findCompetingNextConfigFiles(e.projectRoot));let y=[...new Set(d)],b=[...new Set(g)].filter(e=>!y.includes(e)),x={kind:`web`,action:n?`overwritten`:`created`,filesWritten:y,filesSkipped:b,packageJsonUpdated:l.mutations};return f.length>0&&(x.filesOverwritten=f),p.length>0&&(x.competingNextConfigFiles=p),l.nodeEngineOverride!==void 0&&(x.nodeEngineOverride=l.nodeEngineOverride),x}async function ensureSlackChannel(e){let t=join(e.projectRoot,`agent/channels/slack.ts`),n=await pathExists(t);if(!e.force&&n)return{kind:`slack`,action:`skipped`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let o=resolveVersionToken(`connectPackageVersion`,e.connectPackageVersion??`0.4.0`),s=await ensurePackageDependency(join(e.projectRoot,`package.json`),`@vercel/connect`,o),c=e.slackConnectorSlug??await deriveSlackConnectorSlug(e.projectRoot);await writeTextFile(t,buildSlackTemplate(e.slackConnectorUid??`slack/${c}`),{force:e.force});let l={kind:`slack`,action:n?`overwritten`:`created`,filesWritten:[t],filesSkipped:[],packageJsonUpdated:s,slackConnectorSlug:c};return n&&(l.filesOverwritten=[t]),l}async function listAuthoredChannels(e){let r=join(e,`agent/channels`),i;try{i=await readdir(r,{withFileTypes:!0})}catch(e){if(e.code===`ENOENT`)return[];throw e}let a=[];for(let e of i){if(e.isFile()){let n=getSupportedModuleBaseName(e.name);n!==null&&a.push(n);continue}if(e.isDirectory())try{(await readdir(join(r,e.name))).some(e=>matchesSupportedModuleBaseName(e,`connection`))&&a.push(e.name)}catch{}}return a.sort()}export{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset};
@@ -1,4 +1,4 @@
1
- import{endpointForProtocol}from"../connections/catalog.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{join}from"node:path";import{readFile,readdir,writeFile}from"node:fs/promises";const DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,CONNECT_PACKAGE_NAME=`@vercel/connect`,USER_AUTHORED_CONNECTION_DIR=`agent/connections`;function resolveAuth(e){return e.auth??{kind:`none`}}function envKeysForAuth(e){switch(e.kind){case`bearer-env`:return[e.envVar];case`header`:return e.headers.map(e=>e.envVar);case`connect`:case`none`:return[]}}function authBlock(e){switch(e.kind){case`connect`:return` auth: connect("${e.connector}"),\n`;case`bearer-env`:return` auth: { getToken: async () => ({ token: process.env.${e.envVar}! }) },\n`;case`header`:return` headers: () => ({\n${e.headers.map(e=>` "${e.header}": process.env.${e.envVar}!,`).join(`
1
+ import{endpointForProtocol}from"../connections/catalog.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{join}from"node:path";import{readFile,readdir,writeFile}from"node:fs/promises";const DEFAULT_CONNECT_PACKAGE_VERSION=`0.4.0`,CONNECT_PACKAGE_NAME=`@vercel/connect`,USER_AUTHORED_CONNECTION_DIR=`agent/connections`;function resolveAuth(e){return e.auth??{kind:`none`}}function envKeysForAuth(e){switch(e.kind){case`bearer-env`:return[e.envVar];case`header`:return e.headers.map(e=>e.envVar);case`connect`:case`none`:return[]}}function authBlock(e){switch(e.kind){case`connect`:return` auth: connect("${e.connector}"),\n`;case`bearer-env`:return` auth: { getToken: async () => ({ token: process.env.${e.envVar}! }) },\n`;case`header`:return` headers: () => ({\n${e.headers.map(e=>` "${e.header}": process.env.${e.envVar}!,`).join(`
2
2
  `)}\n }),\n`;case`none`:return``}}function renderMcpTemplate(e,t,n){return`${n.kind===`connect`?`import { connect } from "@vercel/connect/eve";
3
3
  import { defineMcpClientConnection } from "eve/connections";
4
4
  `:`import { defineMcpClientConnection } from "eve/connections";
@@ -1,4 +1,4 @@
1
- import { createPromptCommandOutput } from "#setup/cli/index.js";
1
+ import { type ChannelSetupLog, createPromptCommandOutput } from "#setup/cli/index.js";
2
2
  import type { Prompter } from "./prompter.js";
3
3
  import { type VercelProjectOperationOptions } from "./vercel-project-api.js";
4
4
  export interface CreatedProjectFrameworkOptions extends VercelProjectOperationOptions {
@@ -18,5 +18,7 @@ export interface CreatedProjectFrameworkOptions extends VercelProjectOperationOp
18
18
  * change. No host framework, an unlinked directory, or an already-correct preset
19
19
  * is a no-op; a Vercel API failure warns rather than aborting the deploy.
20
20
  */
21
- export declare function syncHostFrameworkPreset(prompter: Prompter, projectRoot: string, onOutput: ReturnType<typeof createPromptCommandOutput>, options: VercelProjectOperationOptions): Promise<void>;
21
+ export declare function syncHostFrameworkPreset(prompter: {
22
+ log: Pick<ChannelSetupLog, "info" | "warning">;
23
+ }, projectRoot: string, onOutput: ReturnType<typeof createPromptCommandOutput>, options: VercelProjectOperationOptions): Promise<void>;
22
24
  export declare function ensureCreatedProjectFramework(prompter: Prompter, projectRoot: string, team: string, projectId: string, onOutput: ReturnType<typeof createPromptCommandOutput>, options: CreatedProjectFrameworkOptions): Promise<void>;
@@ -0,0 +1,11 @@
1
+ /** Authoring and distribution roots declared by an extension package. */
2
+ export interface ExtensionPackageRoots {
3
+ /**
4
+ * Authoring root. Optional so published packages can ship `dist` only;
5
+ * `eve extension build` requires it.
6
+ */
7
+ readonly source?: string;
8
+ readonly dist: string;
9
+ }
10
+ /** Parses the strict `package.json#eve.extension` object contract. */
11
+ export declare function parseExtensionPackageRoots(value: unknown): ExtensionPackageRoots | null;
@@ -0,0 +1 @@
1
+ function parseExtensionPackageRoots(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t=e;return typeof t.dist!=`string`||t.dist.length===0?null:t.source===void 0?{dist:t.dist}:typeof t.source==`string`&&t.source.length>0?{source:t.source,dist:t.dist}:null}export{parseExtensionPackageRoots};
@@ -32,3 +32,7 @@ export declare function parseJsonValue(value: unknown): JsonValue;
32
32
  * value is `undefined` are treated as omitted.
33
33
  */
34
34
  export declare function parseJsonObject(value: unknown): JsonObject;
35
+ /**
36
+ * Narrows an already-normalized {@link JsonValue} to a {@link JsonObject}.
37
+ */
38
+ export declare function isJsonObjectValue(value: JsonValue | undefined): value is JsonObject;
@@ -1 +1 @@
1
- const INVALID_JSON_VALUE_CANDIDATE=Symbol(`invalid-json-value-candidate`);function parseJsonValue(t){let n=normalizeJsonValueCandidate(t);if(n===INVALID_JSON_VALUE_CANDIDATE)throw TypeError(`Expected a JSON-serializable value.`);return n}function parseJsonObject(e){let t=parseJsonValue(e);if(!isJsonObjectValue(t))throw TypeError(`Expected a JSON-serializable object.`);return t}function normalizeJsonValueCandidate(t,n=new WeakSet){if(t===null||typeof t==`boolean`||typeof t==`string`)return t;if(typeof t==`number`)return Number.isFinite(t)?t:INVALID_JSON_VALUE_CANDIDATE;if(Array.isArray(t)){let r=[];for(let i of t){let t=normalizeJsonValueCandidate(i,n);if(t===INVALID_JSON_VALUE_CANDIDATE)return INVALID_JSON_VALUE_CANDIDATE;r.push(t)}return r}if(typeof t!=`object`||t===void 0||!isPlainObject(t)||n.has(t))return INVALID_JSON_VALUE_CANDIDATE;n.add(t);let r={};for(let[i,a]of Object.entries(t)){if(a===void 0)continue;let t=normalizeJsonValueCandidate(a,n);if(t===INVALID_JSON_VALUE_CANDIDATE)return INVALID_JSON_VALUE_CANDIDATE;r[i]=t}return n.delete(t),r}function isJsonObjectValue(e){return e!==null&&!Array.isArray(e)&&typeof e==`object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}export{parseJsonObject,parseJsonValue};
1
+ const INVALID_JSON_VALUE_CANDIDATE=Symbol(`invalid-json-value-candidate`);function parseJsonValue(t){let n=normalizeJsonValueCandidate(t);if(n===INVALID_JSON_VALUE_CANDIDATE)throw TypeError(`Expected a JSON-serializable value.`);return n}function parseJsonObject(e){let t=parseJsonValue(e);if(!isJsonObjectValue(t))throw TypeError(`Expected a JSON-serializable object.`);return t}function normalizeJsonValueCandidate(t,n=new WeakSet){if(t===null||typeof t==`boolean`||typeof t==`string`)return t;if(typeof t==`number`)return Number.isFinite(t)?t:INVALID_JSON_VALUE_CANDIDATE;if(Array.isArray(t)){let r=[];for(let i of t){let t=normalizeJsonValueCandidate(i,n);if(t===INVALID_JSON_VALUE_CANDIDATE)return INVALID_JSON_VALUE_CANDIDATE;r.push(t)}return r}if(typeof t!=`object`||t===void 0||!isPlainObject(t)||n.has(t))return INVALID_JSON_VALUE_CANDIDATE;n.add(t);let r={};for(let[i,a]of Object.entries(t)){if(a===void 0)continue;let t=normalizeJsonValueCandidate(a,n);if(t===INVALID_JSON_VALUE_CANDIDATE)return INVALID_JSON_VALUE_CANDIDATE;r[i]=t}return n.delete(t),r}function isJsonObjectValue(e){return e!==null&&!Array.isArray(e)&&typeof e==`object`}function isPlainObject(e){let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}export{isJsonObjectValue,parseJsonObject,parseJsonValue};
@@ -0,0 +1,52 @@
1
+ import type { StandardJSONSchemaV1, StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
2
+ import { type JsonObject } from "#shared/json.js";
3
+ /**
4
+ * eve-owned schema contract for tool input and output schemas: a Standard
5
+ * Schema validator that can also emit JSON Schema. Zod implements both
6
+ * constituent protocols without exposing Zod through runtime-owned types.
7
+ */
8
+ export type ToolSchema<Input = unknown, Output = Input> = StandardSchemaV1<Input, Output> & StandardJSONSchemaV1<Input, Output>;
9
+ /**
10
+ * Any value accepted at a schema boundary: a live {@link ToolSchema}, a
11
+ * JSON-Schema-capable Standard Schema, or plain JSON Schema data. Plain data
12
+ * is runtime-validated by {@link parseJsonObject} during conversion.
13
+ */
14
+ export type ToolSchemaSource = StandardJSONSchemaV1 | Record<string, unknown>;
15
+ /** `null` and `undefined` pass through every conversion untouched. */
16
+ type SchemaResult<TSource, TResult> = TSource extends null | undefined ? TSource : TResult;
17
+ /**
18
+ * Resolves a source into a live input {@link ToolSchema}. Live schemas pass
19
+ * through unchanged; serialized JSON Schemas are rehydrated into vendored Zod
20
+ * validators. `null` and `undefined` pass through untouched.
21
+ */
22
+ export declare function toInputSchema<T extends ToolSchemaSource | null | undefined>(source: T): SchemaResult<T, ToolSchema>;
23
+ /**
24
+ * Resolves a source into a live output {@link ToolSchema}. Live schemas pass
25
+ * through unchanged; serialized JSON Schemas are rehydrated into vendored Zod
26
+ * validators. `null` and `undefined` pass through untouched.
27
+ */
28
+ export declare function toOutputSchema<T extends ToolSchemaSource | null | undefined>(source: T): SchemaResult<T, ToolSchema>;
29
+ /**
30
+ * Serializes an input schema source into canonical JSON Schema data (no
31
+ * `$schema` key) for compiled artifacts, durable state, and protocol
32
+ * responses. `null` and `undefined` pass through untouched.
33
+ */
34
+ export declare function serializeInputSchema<T extends ToolSchemaSource | null | undefined>(source: T): SchemaResult<T, JsonObject>;
35
+ /**
36
+ * Serializes an output schema source into canonical JSON Schema data (no
37
+ * `$schema` key) for compiled artifacts, durable state, and protocol
38
+ * responses. `null` and `undefined` pass through untouched.
39
+ */
40
+ export declare function serializeOutputSchema<T extends ToolSchemaSource | null | undefined>(source: T): SchemaResult<T, JsonObject>;
41
+ /**
42
+ * Returns whether a value implements the full {@link ToolSchema} contract:
43
+ * Standard Schema validation plus JSON Schema emission.
44
+ */
45
+ export declare function isToolSchema(value: unknown): value is ToolSchema;
46
+ /**
47
+ * Permissive schema lowered onto model-visible tools whose definitions
48
+ * declare no input schema. Accepts any input — an absent schema declares no
49
+ * contract, so rejecting stray properties would only force needless retries.
50
+ */
51
+ export declare const UNSPECIFIED_INPUT_SCHEMA: ToolSchema;
52
+ export {};
@@ -0,0 +1 @@
1
+ import{z}from"#compiled/zod/index.js";import{parseJsonObject}from"#shared/json.js";const rehydratedSchemas={input:new WeakMap,output:new WeakMap};function toInputSchema(e){return toSchema(e,`input`)}function toOutputSchema(e){return toSchema(e,`output`)}function serializeInputSchema(e){return serializeSchema(e,`input`)}function serializeOutputSchema(e){return serializeSchema(e,`output`)}function isToolSchema(e){if(typeof e!=`object`||!e||!(`~standard`in e))return!1;let t=e[`~standard`];if(typeof t!=`object`||!t)return!1;let n=t,r=n.jsonSchema;return typeof n.validate==`function`&&typeof r==`object`&&!!r&&typeof r.input==`function`&&typeof r.output==`function`}const UNSPECIFIED_INPUT_SCHEMA=z.fromJSONSchema({});function toSchema(t,r){if(t==null||isToolSchema(t))return t;let i=rehydratedSchemas[r],a=i.get(t);if(a===void 0){let n=toJsonObject(t,r);a=z.fromJSONSchema(n,{defaultTarget:`draft-7`}),i.set(t,a)}return a}function serializeSchema(e,t){return e==null?e:toJsonObject(e,t)}function toJsonObject(e,n){let{$schema:r,...i}=isStandardJsonSchema(e)?parseJsonObject(e[`~standard`].jsonSchema[n]({target:`draft-07`})):parseJsonObject(e);return i}function isStandardJsonSchema(e){return typeof e==`object`&&!!e&&`~standard`in e}export{UNSPECIFIED_INPUT_SCHEMA,isToolSchema,serializeInputSchema,serializeOutputSchema,toInputSchema,toOutputSchema};
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-8rerxDHY.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-CQIeqmKc.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-8rerxDHY.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-CQIeqmKc.js";
2
2
 
3
3
  export { useEveAgent };
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DhgdHzDG.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-Cy73lgA6.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DhgdHzDG.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-Cy73lgA6.js";
2
2
 
3
3
  export { useEveAgent };
@@ -47,7 +47,8 @@ export default defineChannel({
47
47
  Declare routes with the `POST()` and `GET()` helpers. Each route handler receives the raw `Request` and a helpers object:
48
48
 
49
49
  - `send(message, { auth, continuationToken, state?, title? })` starts or resumes a session. `title` overrides the new workflow session's display title without changing the model message. Returns a `Session`.
50
- - `getSession(sessionId)` looks up an existing session. The returned `Session` exposes `getEventStream({ startIndex? })` for streaming.
50
+ - `cancel({ continuationToken, turnId? })` requests cancellation of the active turn on the session that owns the token. See [Cancel a turn](#cancel-a-turn).
51
+ - `getSession(sessionId)` looks up an existing session. The returned `Session` exposes `getEventStream({ startIndex? })` for streaming and `cancel({ turnId? })` for session-id-addressed cancellation.
51
52
  - `receive(channel, ...)` hands inbound work to a different channel for cross-channel hand-off.
52
53
  - `params` holds route parameters extracted from the path pattern.
53
54
  - `waitUntil(promise)` extends the request lifetime for background work.
@@ -55,6 +56,35 @@ Declare routes with the `POST()` and `GET()` helpers. Each route handler receive
55
56
 
56
57
  Event handlers like `"message.completed"` are declared under the `events` key. They receive `(eventData, channel, ctx)`, where `eventData` is the event payload, `channel` carries platform handles and session continuation operations, and `ctx` is the eve `SessionContext`. Every channel kind shares this signature. The one exception is `session.failed`, which receives only `(eventData, channel)` with no `ctx`.
57
58
 
59
+ ## Cancel a turn
60
+
61
+ A stop route cancels a session's in-flight turn with the `cancel` helper, addressed by the same channel-local continuation token used with `send()`:
62
+
63
+ ```ts
64
+ import { defineChannel, POST } from "eve/channels";
65
+
66
+ export default defineChannel({
67
+ routes: [
68
+ POST("/threads/:threadId/stop", async (_req, { cancel, params }) => {
69
+ const result = await cancel({ continuationToken: params.threadId });
70
+ return Response.json(result);
71
+ }),
72
+ ],
73
+ });
74
+ ```
75
+
76
+ Both result statuses are successful. `"accepted"` means the cancellation request was consumed, not that the observed turn will cancel; confirmation is `turn.cancelled` followed by `session.waiting` on the event stream. `"no_active_turn"` covers an unknown token and a session with nothing to cancel — idle, parked, or already completed.
77
+
78
+ Semantics:
79
+
80
+ - `cancel` never starts a session, sends input, or clears history. The session parks and accepts the next message normally.
81
+ - Pass `turnId` (stamped on every turn-scoped stream event) to guard against stale stop requests. A mismatched guard is consumed as a benign no-op and cannot cancel a newer turn.
82
+ - The helper addresses only this channel's sessions; it cannot cancel a session owned by another channel.
83
+ - Cancellation stops work without replacement input. Partial streamed output and completed side effects remain observable, and active local or remote subagents receive cancellation recursively.
84
+ - The route owns authentication of the inbound stop request, exactly as for `send()`.
85
+
86
+ When you already hold a `Session` — returned by `send()` or `getSession(sessionId)` — call `session.cancel({ turnId? })` to request the same cancellation addressed by session id.
87
+
58
88
  ## CORS
59
89
 
60
90
  Custom HTTP channels leave CORS untouched unless you opt in. Pass `cors: true`
@@ -95,7 +125,7 @@ export default defineChannel({
95
125
  });
96
126
  ```
97
127
 
98
- `WS()` handlers receive the same helpers as HTTP route handlers: `send`, `getSession`, `receive`, `params`, `waitUntil`, and `requestIp`. The returned hooks are eve-owned structural types compatible with Nitro/H3 websocket routing, including `upgrade`, `open`, `message`, `close`, and `error`.
128
+ `WS()` handlers receive the same helpers as HTTP route handlers: `send`, `cancel`, `getSession`, `receive`, `params`, `waitUntil`, and `requestIp`. The returned hooks are eve-owned structural types compatible with Nitro/H3 websocket routing, including `upgrade`, `open`, `message`, `close`, and `error`.
99
129
 
100
130
  ### Node upgrade server escape hatch
101
131
 
@@ -87,6 +87,12 @@ The follow-up reuses the same durable session: same history, same state.
87
87
 
88
88
  If the session is waiting on a human-in-the-loop approval, a matching text reply such as `approve` or `deny` answers the approval. Other follow-up text is held until the approval is answered, so an unrelated message does not implicitly deny the pending tool call.
89
89
 
90
+ If the session is waiting on `ask_question`, a follow-up message clears that pending request before the model continues. An exact option match or permitted freeform response answers the question; any other message marks the question unanswered and starts the follow-up turn.
91
+
92
+ A response is stale when its request is no longer pending: the question or approval was already answered, cleared by a follow-up message, or cancelled. eve delivers a stale response to the model as a new user message, and the model decides whether the old selection still matters. A stale approval never authorizes the earlier tool call; the model must request the action and approval again if they are still needed.
93
+
94
+ Responses match pending requests by request ID, so a response to an older request stays a plain user message even while a different question or approval is pending. Like any follow-up message, a stale response clears a pending question and is held while an approval is pending.
95
+
90
96
  For deterministic ordering, send one follow-up at a time and wait for the next `session.waiting` event before sending another message to the same session. See [message delivery and queueing](./execution-model-and-durability#message-delivery-and-queueing) for the current runtime contract.
91
97
 
92
98
  ## Cancel the in-flight turn
@@ -100,6 +106,8 @@ curl -X POST http://127.0.0.1:3000/eve/v1/session/<sessionId>/cancel
100
106
 
101
107
  `"accepted"` means a cancellation hook accepted the request. Confirm cancellation on the stream as `turn.cancelled` followed by `session.waiting`; the session then accepts the next message normally. If the turn is waiting on active local or remote subagents, eve also requests cancellation of every adopted child, recursively, before settling the parent. Each child reports its own cancellation boundary on its child-session stream; the parent does not emit `subagent.completed` for cancelled work. `"no_active_turn"` means no resumable cancellation target exists, including an unknown session or an already-settled turn. Both statuses are success, so clients can fire and forget. See the [eve channel](../channels/eve) for the full route contract.
102
108
 
109
+ Custom channel routes request the same cancellation without knowing the session id: the `cancel` route helper is addressed by the channel-local continuation token, and `Session.cancel()` by session id. See [custom channels](../channels/custom#cancel-a-turn).
110
+
103
111
  ## Reconnect and rewind
104
112
 
105
113
  The stream is durable. Every event is recorded before a step completes, so the whole stream is replayable. A nonnegative `startIndex` is an absolute event count: use it to pick up where you dropped off or pass `0` to rewind to the start.
@@ -71,15 +71,21 @@ Config is bound once when the consumer mounts the extension and stays constant f
71
71
 
72
72
  ## Publishing
73
73
 
74
- Point `eve.extension` at the source directory and run `eve extension build` (wired to `build`/`prepare`):
74
+ Declare separate authoring and distribution roots and run `eve extension build` (wired to `build`/`prepare`):
75
75
 
76
76
  ```jsonc title="package.json"
77
77
  {
78
78
  "name": "@acme/crm",
79
79
  "type": "module",
80
- "eve": { "extension": "./extension" },
81
- "files": ["extension", "dist"],
82
- "peerDependencies": { "eve": "^x" },
80
+ "eve": {
81
+ "extension": {
82
+ "source": "./extension",
83
+ "dist": "./dist/extension",
84
+ },
85
+ },
86
+ "files": ["dist"],
87
+ "peerDependencies": { "eve": "*" },
88
+ "devDependencies": { "eve": "^x", "typescript": "^x" },
83
89
  "dependencies": { "zod": "^3" },
84
90
  "scripts": { "build": "eve extension build", "prepare": "eve extension build" },
85
91
  }
@@ -100,11 +106,21 @@ Author the source with `moduleResolution: "bundler"` — eve compiles it, so rel
100
106
  }
101
107
  ```
102
108
 
103
- `eve extension build` compiles the package's entry points to plain JavaScript with type declarations the mount factory (`dist/index.mjs`) and the tool re-exports overrides use (`dist/tools`) and fills the `exports` map so you never hand-list it. Compiling is what lets an installed extension load directly; local and workspace packages also work without publishing.
109
+ `eve extension build` transforms every JavaScript or TypeScript module into an agent-shaped `dist/extension` tree, copies skill packages and their assets, emits type declarations, and writes `dist/extension/_manifest.json`. The generated package entrypoints (`dist/index.mjs` and `dist/tools/index.mjs`) re-export those same dist modules, and the build fills the `exports` map so you never hand-list it. The published package therefore needs `dist/`, not the author's original TypeScript. Consumers read only `eve.extension.dist`, so a published package may omit `eve.extension.source`; keep `source` declared wherever `eve extension build` runs.
110
+
111
+ The build uses the package `tsconfig.json` when it emits declarations. Its `include` must cover every JavaScript or TypeScript module in the extension source (and JavaScript modules require `allowJs`); the build fails before publishing if any distributed module would be missing its declaration.
112
+
113
+ The manifest contains only its format, the diagnostic eve build version, and the versions of extension capabilities this package actually uses. It does not contain compiled tools, schemas, names, or executable definitions; the consuming eve still discovers and normalizes the agent-shaped dist tree.
114
+
115
+ ### Workspace development
116
+
117
+ During local development, `eve dev` automatically rebuilds mounted workspace extensions when their source changes.
104
118
 
105
119
  ### Dependencies
106
120
 
107
- `eve` is a **peer** dependency: one eve lives in the consuming app and the extension's `eve/*` imports resolve to it. Declare the eve versions your extension supports as the peer range (`"eve": "^1"`) eve enforces it when the extension is mounted, failing the build with a clear error if the app's eve is out of range, rather than surfacing a confusing compile break. Everything else the extension imports (SDKs, `zod`, …) goes in `dependencies`; each extension resolves its own versions. The consumer recompiles the extension's contributions from source, so `files` must ship both `extension/` (that source) and `dist/` (the compiled entry points).
121
+ `eve` is a required wildcard **peer** dependency: one eve lives in the consuming app and the extension's `eve/*` imports resolve to it. The extension's concrete eve version belongs in `devDependencies` for authoring types and build tooling. npm peer semver does not decide extension compatibility; eve validates the generated per-capability requirements. Do not mark the eve peer optional and do not add eve to regular `dependencies`.
122
+
123
+ Everything else the extension imports at execution time (SDKs, `zod`, …) goes in `dependencies`; each extension resolves its own versions. Build-only and test-only packages go in `devDependencies`.
108
124
 
109
125
  Those deps resolve from `node_modules` under `eve dev`/`eve eval` and are bundled into the deployable by the consuming agent's `eve build`. A dependency that can't be bundled (a native addon) must be listed in the **consuming agent's** `build.externalDependencies` — an extension can't declare build config, so note it in your README.
110
126
 
@@ -47,7 +47,7 @@ After scaffolding, a human terminal usually continues into `eve dev` (or a codin
47
47
 
48
48
  ## `eve extension`
49
49
 
50
- Commands for reusable [extension](/docs/extensions) packages. An extension is identified by `package.json#eve.extension` (for example `"eve": { "extension": "./extension" }`).
50
+ Commands for reusable [extension](/docs/extensions) packages. An extension declares distinct authoring and distribution roots in `package.json#eve.extension` (for example `"eve": { "extension": { "source": "./extension", "dist": "./dist/extension" } }`).
51
51
 
52
52
  ### `eve extension init`
53
53
 
@@ -73,7 +73,7 @@ See [Extensions](/docs/extensions) for authoring and mount details.
73
73
  eve extension build
74
74
  ```
75
75
 
76
- Builds the current package as an extension: compiles the mount factory and tool re-exports into `dist/`, and fills the package `exports` map. Requires `package.json#eve.extension`.
76
+ Builds the complete agent-shaped extension tree into its configured dist root, emits declarations and compatibility metadata, and fills the package `exports` map. The original TypeScript source is not required in the published package.
77
77
 
78
78
  ## `eve info`
79
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.24.5",
3
+ "version": "0.25.0",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [
@@ -324,7 +324,7 @@
324
324
  "jsonc-parser": "3.3.1",
325
325
  "just-bash": "3.0.1",
326
326
  "microsandbox": "0.5.5",
327
- "next": "16.2.6",
327
+ "next": "16.3.0-preview.6",
328
328
  "picocolors": "1.1.1",
329
329
  "react": "19.2.6",
330
330
  "react-test-renderer": "19.2.6",
@@ -1 +0,0 @@
1
- export { normalizeJsonSchemaDefinition } from "#shared/json-schema.js";
@@ -1 +0,0 @@
1
- import{normalizeJsonSchemaDefinition}from"#shared/json-schema.js";export{normalizeJsonSchemaDefinition};
@@ -1,26 +0,0 @@
1
- import type { Prompter } from "../prompter.js";
2
- import { type SetupState } from "../state.js";
3
- import type { SetupBox } from "../step.js";
4
- import { syncHostFrameworkPreset } from "../vercel-project-framework.js";
5
- /** Injected for tests; defaults to the real framework-preset reconciliation. */
6
- export interface ReconcileHostFrameworkPresetDeps {
7
- syncHostFrameworkPreset: typeof syncHostFrameworkPreset;
8
- }
9
- export interface ReconcileHostFrameworkPresetOptions {
10
- /** Streams reconciliation progress and the applied-change note. */
11
- prompter: Prompter;
12
- deps?: ReconcileHostFrameworkPresetDeps;
13
- }
14
- /**
15
- * Aligns an already-linked Vercel project's Framework Preset with a newly-added
16
- * web (Next.js) channel before the deploy box runs. A project created as a
17
- * standalone agent keeps the `eve` preset, which would build the agent instead
18
- * of the host app; the command already deploys on the user's behalf, so this
19
- * corrects the preset directly (no confirmation) and notes the change.
20
- *
21
- * Runs only for an already-linked project — an unlinked directory links later
22
- * inside the deploy box, where a fresh `vercel link` detects the framework. All
23
- * effects live in {@link syncHostFrameworkPreset}, a no-op when the preset
24
- * already matches.
25
- */
26
- export declare function reconcileHostFrameworkPreset(options: ReconcileHostFrameworkPresetOptions): SetupBox<SetupState, null, null>;
@@ -1 +0,0 @@
1
- import{isProjectResolved}from"../project-resolution.js";import{requireProjectPath}from"../state.js";import{syncHostFrameworkPreset}from"../vercel-project-framework.js";import{createPromptCommandOutput}from"#setup/cli/index.js";function reconcileHostFrameworkPreset(r){let i=r.deps??{syncHostFrameworkPreset};return{id:`reconcile-host-framework-preset`,shouldRun(t){return t.deploymentPending&&t.channelSelection.includes(`web`)&&isProjectResolved(t.project)},async gather(){return null},async perform({state:e,signal:n}){let a=requireProjectPath(e),o=createPromptCommandOutput(r.prompter.log);return await i.syncHostFrameworkPreset(r.prompter,a,o,{signal:n}),null},apply(e){return e}}}export{reconcileHostFrameworkPreset};
@@ -1,9 +0,0 @@
1
- import type { StandardJSONSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
2
- import { type JsonObject } from "#shared/json.js";
3
- type JsonSchemaDirection = "input" | "output";
4
- /**
5
- * Normalizes one Standard Schema or JSON Schema definition into plain JSON
6
- * Schema data that can cross eve runtime and client boundaries.
7
- */
8
- export declare function normalizeJsonSchemaDefinition(value: StandardJSONSchemaV1 | Record<string, unknown> | unknown, direction?: JsonSchemaDirection): JsonObject;
9
- export {};
@@ -1 +0,0 @@
1
- import{parseJsonObject}from"#shared/json.js";function normalizeJsonSchemaDefinition(t,n=`input`){return isStandardSchema(t)?parseJsonObject(t[`~standard`].jsonSchema[n]({target:`draft-07`})):parseJsonObject(t)}function isStandardSchema(e){return typeof e==`object`&&!!e&&`~standard`in e}export{normalizeJsonSchemaDefinition};