eve 0.22.3 → 0.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +2 -0
- package/dist/src/chunks/{use-eve-agent-Cojyfr4X.js → use-eve-agent-CFBTHlPx.js} +18 -1
- package/dist/src/chunks/{use-eve-agent-D-S1TPCW.js → use-eve-agent-dEGV09g_.js} +18 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +15 -0
- package/dist/src/cli/commands/agent-instructions.js +3 -1
- package/dist/src/cli/commands/agent-prompt/scaffold.md +3 -0
- package/dist/src/cli/commands/extension-build.d.ts +9 -0
- package/dist/src/cli/commands/extension-build.js +1 -0
- package/dist/src/cli/commands/extension-init.d.ts +25 -0
- package/dist/src/cli/commands/extension-init.js +1 -0
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.d.ts +2 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/agent-host.d.ts +4 -0
- package/dist/src/client/agent-host.js +1 -0
- package/dist/src/compiled/.vendor-stamp.json +4 -4
- package/dist/src/compiled/@workflow/core/global.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +54 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +11 -3
- package/dist/src/compiled/@workflow/core/runtime/run.d.ts +6 -2
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +36 -2
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +28 -0
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +23 -0
- package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +131 -0
- package/dist/src/compiled/@workflow/core/runtime/step-ownership.d.ts +72 -0
- package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +12 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +7 -0
- package/dist/src/compiled/@workflow/core/runtime.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization-format.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +40 -0
- package/dist/src/compiled/@workflow/core/telemetry.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +4 -4
- package/dist/src/compiled/@workflow/world/events.d.ts +142 -21
- package/dist/src/compiled/@workflow/world/hooks.d.ts +1 -24
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -2
- package/dist/src/compiled/@workflow/world/queue.d.ts +10 -0
- package/dist/src/compiled/@workflow/world/ulid.d.ts +9 -0
- package/dist/src/compiled/@workflow/world-local/index.js +4 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/workflow/attribute-changes-ubiPfqvY.js +20 -0
- package/dist/src/compiled/_chunks/workflow/{dist-DJU_7R9s.js → dist-DnBjuNAZ.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{functions-CnVBREsg.js → functions-BCMO8vbf.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BkVkWg2r.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-B3N1kN9q.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{sleep-phozDCW8.js → sleep-C2Bn-UUg.js} +1 -1
- package/dist/src/compiler/manifest.d.ts +4 -4
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +1 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/discover/filesystem.d.ts +2 -2
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -4
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/inline-tool-authorization.d.ts +3 -0
- package/dist/src/harness/inline-tool-authorization.js +1 -0
- package/dist/src/harness/interruptible-stream.d.ts +5 -0
- package/dist/src/harness/interruptible-stream.js +1 -0
- package/dist/src/harness/model-call-error.js +1 -1
- package/dist/src/harness/ordered-stream-emitter.d.ts +17 -0
- package/dist/src/harness/ordered-stream-emitter.js +1 -0
- package/dist/src/harness/stream-actions.d.ts +1 -0
- package/dist/src/harness/stream-actions.js +1 -1
- package/dist/src/harness/subagent-depth.d.ts +1 -1
- package/dist/src/harness/subagent-depth.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/workflow-bundle/eve-service-route-output.d.ts +1 -2
- package/dist/src/internal/workflow-bundle/eve-service-route-output.js +1 -54
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/public/definitions/extension.d.ts +4 -4
- package/dist/src/public/definitions/remote-agent.d.ts +11 -2
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/public/models/openai/chatgpt/auth.d.ts +69 -0
- package/dist/src/public/models/openai/chatgpt/auth.js +1 -0
- package/dist/src/public/models/openai/chatgpt/model.d.ts +8 -0
- package/dist/src/public/models/openai/chatgpt/model.js +1 -0
- package/dist/src/public/models/openai/chatgpt/transport.d.ts +24 -0
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -0
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.d.ts +5 -0
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.js +1 -0
- package/dist/src/public/models/openai/index.d.ts +30 -0
- package/dist/src/public/models/openai/index.js +1 -0
- package/dist/src/public/next/index.d.ts +38 -3
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/server.d.ts +1 -0
- package/dist/src/public/next/server.js +2 -1
- package/dist/src/public/next/vercel-output-config.d.ts +12 -3
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +8 -1
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/extension.d.ts +30 -0
- package/dist/src/setup/scaffold/create/extension.js +34 -0
- package/dist/src/setup/scaffold/create/project.d.ts +2 -0
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/index.d.ts +1 -0
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +8 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +8 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +1 -1
- package/docs/channels/slack.mdx +6 -0
- package/docs/concepts/sessions-runs-and-streaming.md +1 -1
- package/docs/extensions.md +42 -13
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/frontend/nextjs.mdx +32 -7
- package/docs/guides/frontend/overview.mdx +7 -1
- package/docs/guides/hooks.md +9 -0
- package/docs/guides/remote-agents.md +23 -8
- package/docs/meta.json +0 -1
- package/docs/reference/cli.md +56 -22
- package/docs/reference/typescript-api.md +17 -0
- package/docs/subagents.mdx +1 -1
- package/package.json +10 -5
- package/dist/src/compiled/_chunks/workflow/attribute-changes-BnKD8Y3m.js +0 -20
- package/dist/src/compiled/_chunks/workflow/resume-hook-DjPY9VGg.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-BSANnUPR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.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.0`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.22.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.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.0`,DEFAULT_CONNECT_PACKAGE_VERSION=`0.2.2`,DEFAULT_ZOD_PACKAGE_VERSION=`4.4.3`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.22.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";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -95,4 +95,4 @@ export default defineAgent({
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
|
-
`:BASE_AGENT_TEMPLATE,...SHARED_TEMPLATE_FILES,"package.json":packageJsonTemplate({includeRootOnlyFields:e.includeRootOnlyPackageJsonFields,packageManager:e.packageManager})}}async function assertCanCreateInPlace(e,n){if(!await pathExists(e))return;let r=(await readdir(e)).filter(e=>!ALLOWED_CREATE_IN_PLACE_ENTRIES.has(e));if(r.length>0&&!n){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(o){let s=resolve(o.targetDirectory??process.cwd(),o.projectName),c=o.projectName===`.`,l=o.overwriteExisting??!1,u=o.byokProvider??!1,d=o.packageManager??`pnpm`,f=resolveEvePackageContract(o.evePackage),p=pinnedNodeEngineMajor(f.nodeEngine),m=resolve(o.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:o.model,eveVersion:f.version,aiPackageVersion:resolveVersionToken(`aiPackageVersion`,o.aiPackageVersion??`^7.0.0`),connectPackageVersion:resolveVersionToken(`connectPackageVersion`,o.connectPackageVersion??`0.2.2`),zodPackageVersion:resolveVersionToken(`zodPackageVersion`,o.zodPackageVersion??`4.4.3`),typescriptPackageVersion:resolveVersionToken(`typescriptPackageVersion`,o.typescriptPackageVersion??`7.0.2`),nodeTypesVersion:p,nodeEngine:p};await mkdir(s,{recursive:!0});for(let[e,r]of Object.entries(templateFiles({byokProvider:u,includeRootOnlyPackageJsonFields:!h,packageManager:d}))){let i=`${s}/${e}`,a=await pathExists(i);await writeTextFile(i,renderTemplate(r,g),{force:c&&l}),a&&await o.onOverwriteFile?.(i)}return await applyPackageManagerWorkspaceConfiguration({packageManager:d,projectRoot:s,workspaceProbeRoot:m,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),await patchWorkspaceRootPackageJson(d,m,{aiPackageVersion:g.aiPackageVersion,nodeEngineRequirement:f.nodeEngine,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),s}async function isEveProject(e){for(let t of SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS)try{return await stat(join(e,`agent`,`agent${t}`)),!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,agentTemplateFiles,byokProviderEnvVar,formatEveDependencySpecifier,isEveProject,modelProviderSlug,resolveEvePackageContract,scaffoldBaseProject};
|
|
98
|
+
`:BASE_AGENT_TEMPLATE,...SHARED_TEMPLATE_FILES,"package.json":packageJsonTemplate({includeRootOnlyFields:e.includeRootOnlyPackageJsonFields,packageManager:e.packageManager})}}async function assertCanCreateInPlace(e,n){if(!await pathExists(e))return;let r=(await readdir(e)).filter(e=>!ALLOWED_CREATE_IN_PLACE_ENTRIES.has(e));if(r.length>0&&!n){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(o){let s=resolve(o.targetDirectory??process.cwd(),o.projectName),c=o.projectName===`.`,l=o.overwriteExisting??!1,u=o.byokProvider??!1,d=o.packageManager??`pnpm`,f=resolveEvePackageContract(o.evePackage),p=pinnedNodeEngineMajor(f.nodeEngine),m=resolve(o.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:o.model,eveVersion:f.version,aiPackageVersion:resolveVersionToken(`aiPackageVersion`,o.aiPackageVersion??`^7.0.0`),connectPackageVersion:resolveVersionToken(`connectPackageVersion`,o.connectPackageVersion??`0.2.2`),zodPackageVersion:resolveVersionToken(`zodPackageVersion`,o.zodPackageVersion??`4.4.3`),typescriptPackageVersion:resolveVersionToken(`typescriptPackageVersion`,o.typescriptPackageVersion??`7.0.2`),nodeTypesVersion:p,nodeEngine:p};await mkdir(s,{recursive:!0});for(let[e,r]of Object.entries(templateFiles({byokProvider:u,includeRootOnlyPackageJsonFields:!h,packageManager:d}))){let i=`${s}/${e}`,a=await pathExists(i);await writeTextFile(i,renderTemplate(r,g),{force:c&&l}),a&&await o.onOverwriteFile?.(i)}return await applyPackageManagerWorkspaceConfiguration({packageManager:d,projectRoot:s,workspaceProbeRoot:m,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),await patchWorkspaceRootPackageJson(d,m,{aiPackageVersion:g.aiPackageVersion,nodeEngineRequirement:f.nodeEngine,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),s}async function isEveProject(e){for(let t of SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS)try{return await stat(join(e,`agent`,`agent${t}`)),!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};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { byokProviderEnvVar, CURRENT_DIRECTORY_PROJECT_NAME, isEveProject, scaffoldBaseProject, type EvePackageContract, type ScaffoldBaseProjectOptions, } from "./create/project.js";
|
|
2
|
+
export { scaffoldExtensionProject, type ScaffoldExtensionProjectOptions, } from "./create/extension.js";
|
|
2
3
|
export { DEFAULT_SLACK_CONNECTOR_SLUG, SLACK_CHANNEL_DEFAULT_ROUTE, deriveSlackConnectorSlug, ensureChannel, hasVercelHostFramework, isNextJsProject, listAuthoredChannels, normalizeSlackConnectorSlug, type ChannelKind, type ChannelMutationResult, type EnsureChannelOptions, type SlackConnectorSlug, type WebPackageVersions, } from "./update/channels.js";
|
|
3
4
|
export { SCAFFOLDABLE_CHANNELS, type ScaffoldableChannel } from "./channels-catalog.js";
|
|
4
5
|
export { ensureConnection, ensureConnectionDependencies, listAuthoredConnections, type ConnectionInput, type ConnectionMutationAction, type ConnectionMutationResult, type EnsureConnectionOptions, type EnsureConnectionDependenciesOptions, } from "./update/connections.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{HumanActionRequiredError}from"../human-action.js";import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,byokProviderEnvVar,isEveProject,scaffoldBaseProject}from"./create/project.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug}from"./update/channels.js";import{ensureConnection,ensureConnectionDependencies,listAuthoredConnections}from"./update/connections.js";export{CONNECTION_CATALOG,CURRENT_DIRECTORY_PROJECT_NAME,CUSTOM_CONNECTION_SLUG,DEFAULT_SLACK_CONNECTOR_SLUG,HumanActionRequiredError,SCAFFOLDABLE_CHANNELS,SLACK_CHANNEL_DEFAULT_ROUTE,SUPPORTED_PROTOCOLS,WriteFileExistsError,byokProviderEnvVar,catalogSlugs,deriveSlackConnectorSlug,effectiveProtocols,endpointForProtocol,ensureChannel,ensureConnection,ensureConnectionDependencies,getCatalogEntry,hasVercelHostFramework,isEveProject,isNextJsProject,isValidConnectionSlug,listAuthoredChannels,listAuthoredConnections,normalizeSlackConnectorSlug,scaffoldBaseProject};
|
|
1
|
+
import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{HumanActionRequiredError}from"../human-action.js";import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,byokProviderEnvVar,isEveProject,scaffoldBaseProject}from"./create/project.js";import{scaffoldExtensionProject}from"./create/extension.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug}from"./update/channels.js";import{ensureConnection,ensureConnectionDependencies,listAuthoredConnections}from"./update/connections.js";export{CONNECTION_CATALOG,CURRENT_DIRECTORY_PROJECT_NAME,CUSTOM_CONNECTION_SLUG,DEFAULT_SLACK_CONNECTOR_SLUG,HumanActionRequiredError,SCAFFOLDABLE_CHANNELS,SLACK_CHANNEL_DEFAULT_ROUTE,SUPPORTED_PROTOCOLS,WriteFileExistsError,byokProviderEnvVar,catalogSlugs,deriveSlackConnectorSlug,effectiveProtocols,endpointForProtocol,ensureChannel,ensureConnection,ensureConnectionDependencies,getCatalogEntry,hasVercelHostFramework,isEveProject,isNextJsProject,isValidConnectionSlug,listAuthoredChannels,listAuthoredConnections,normalizeSlackConnectorSlug,scaffoldBaseProject,scaffoldExtensionProject};
|
|
@@ -128,7 +128,7 @@ export interface AgentLimitsDefinition {
|
|
|
128
128
|
* Delegated subagent sessions resolve this against the cap inherited from
|
|
129
129
|
* the delegating parent; the tighter value wins.
|
|
130
130
|
*
|
|
131
|
-
* @default
|
|
131
|
+
* @default 1
|
|
132
132
|
*/
|
|
133
133
|
readonly maxSubagentDepth?: number;
|
|
134
134
|
/**
|
package/dist/src/svelte/index.js
CHANGED
|
@@ -51,6 +51,13 @@ export interface UseEveAgentReturn<TData> {
|
|
|
51
51
|
* the client resolves before each HTTP request.
|
|
52
52
|
*/
|
|
53
53
|
export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData> {
|
|
54
|
+
/**
|
|
55
|
+
* Named agent mounted by a framework integration such as `withEve({ agents })`.
|
|
56
|
+
*
|
|
57
|
+
* `agent: "support"` targets same-origin routes under
|
|
58
|
+
* `/eve/agents/support/eve/v1/...`. Do not combine with `host`.
|
|
59
|
+
*/
|
|
60
|
+
readonly agent?: string;
|
|
54
61
|
/**
|
|
55
62
|
* Credentials for the auto-created session. Pass function values to refresh
|
|
56
63
|
* per request. Ignored when `session` is supplied.
|
|
@@ -62,7 +69,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
62
69
|
*/
|
|
63
70
|
readonly headers?: HeadersValue;
|
|
64
71
|
/**
|
|
65
|
-
* Base URL for eve client requests. Empty targets same-origin eve routes
|
|
72
|
+
* Base URL for eve client requests. Do not combine with `agent`. Empty targets same-origin eve routes
|
|
66
73
|
* such as `/eve/v1/...`; a same-origin prefix like `/api` routes through an
|
|
67
74
|
* app-owned proxy; an absolute origin hits an eve server directly.
|
|
68
75
|
*
|
package/dist/src/vue/index.js
CHANGED
|
@@ -54,12 +54,19 @@ export interface UseEveAgentReturn<TData> {
|
|
|
54
54
|
* every render.
|
|
55
55
|
*/
|
|
56
56
|
export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData> {
|
|
57
|
+
/**
|
|
58
|
+
* Named agent mounted by a framework integration such as `withEve({ agents })`.
|
|
59
|
+
*
|
|
60
|
+
* `agent: "support"` targets same-origin routes under
|
|
61
|
+
* `/eve/agents/support/eve/v1/...`. Do not combine with `host`.
|
|
62
|
+
*/
|
|
63
|
+
readonly agent?: string;
|
|
57
64
|
/** Authentication configuration; a function value is resolved per request. */
|
|
58
65
|
readonly auth?: ClientAuth;
|
|
59
66
|
/** Custom headers; a function value is resolved per request. */
|
|
60
67
|
readonly headers?: HeadersValue;
|
|
61
68
|
/**
|
|
62
|
-
* Base URL used for eve client requests.
|
|
69
|
+
* Base URL used for eve client requests. Do not combine with `agent`.
|
|
63
70
|
*
|
|
64
71
|
* By default, requests target same-origin eve routes such as `/eve/v1/...`.
|
|
65
72
|
* Pass a same-origin prefix such as `/api` to use an app-owned proxy, or an
|
package/docs/agent-config.md
CHANGED
|
@@ -207,7 +207,7 @@ installed package must stay external in hosted output, list it in
|
|
|
207
207
|
| -------------- | --------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
208
208
|
| `reasoning` | `AgentReasoningDefinition` | provider default | Provider-agnostic reasoning effort forwarded to the agent's turn model calls. |
|
|
209
209
|
| `modelOptions` | `AgentModelOptionsDefinition` | none | Provider option overrides forwarded to the model call. |
|
|
210
|
-
| `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. `maxSubagentDepth` defaults to `
|
|
210
|
+
| `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. `maxSubagentDepth` defaults to `1`; `maxInputTokensPerSession` defaults to `40_000_000` for root sessions, and delegated subagent sessions inherit the parent's remaining quota; `maxOutputTokensPerSession` is unset unless configured; `false` uncaps a session token limit. |
|
|
211
211
|
| `experimental` | `{ workflow?: { world?: string } }` | unset | Opt-in settings that can change or disappear in any release. Treat them as unstable. `workflow.world` selects the Workflow world package backing session state, queues, hooks, and streams on the root agent. |
|
|
212
212
|
| `outputSchema` | Standard Schema or a JSON Schema object | none | Structured return type for task-mode runs (a subagent, schedule, or remote job). Interactive conversation turns ignore it unless the client supplies a per-message schema. |
|
|
213
213
|
| `build` | `{ externalDependencies?: string[] }` | none | Hosted-build packaging controls. `externalDependencies` keeps listed packages external while eve compiles authored modules such as tools and channels, and traces those packages into the hosted output. |
|
package/docs/channels/slack.mdx
CHANGED
|
@@ -68,6 +68,12 @@ export default slackChannel({
|
|
|
68
68
|
});
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
`since` sets the boundary for what each mention injects and accepts three values:
|
|
72
|
+
|
|
73
|
+
- `"thread-root"` (the default): every prior message in the thread, on every mention. `threadContext: {}` behaves the same.
|
|
74
|
+
- `"last-agent-reply"`: only messages after the agent's last reply, keeping repeated mentions incremental.
|
|
75
|
+
- A predicate `(message: SlackThreadMessage) => boolean`: only messages after the last one it matches, such as "since the last message that mentioned a particular user".
|
|
76
|
+
|
|
71
77
|
`threadContext` performs one `conversations.replies` request for each triggering thread reply and requires the matching Slack history scope. Omit it when the agent should see only direct mentions. `loadThreadContextMessages` remains available when you need custom filtering or non-model processing of the raw thread messages.
|
|
72
78
|
|
|
73
79
|
### Slack API calls outside a handler
|
|
@@ -62,7 +62,7 @@ The stream is newline-delimited JSON (NDJSON), one event per line:
|
|
|
62
62
|
| `session.failed` | The session failed. |
|
|
63
63
|
| `session.completed` | The session reached a terminal end. |
|
|
64
64
|
|
|
65
|
-
`reasoning.appended` and `message.appended` stream
|
|
65
|
+
`reasoning.appended` and `message.appended` stream incremental output as it arrives. When the durable stream writer is busy, eve may coalesce adjacent deltas of the same type; the text remains in source order, and any other event forms an ordering barrier. Each append carries both the new delta and the cumulative text for the current block. The finalized block shows up on `message.completed` and `reasoning.completed`, which is the compatibility path for clients that don't render incremental streaming.
|
|
66
66
|
|
|
67
67
|
Note: consider the privacy, confidentiality, and user-experience implications for displaying, storing, or transmitting reasoning events in your application.
|
|
68
68
|
|
package/docs/extensions.md
CHANGED
|
@@ -7,12 +7,20 @@ An extension packages eve capabilities — tools, connections, skills, instructi
|
|
|
7
7
|
|
|
8
8
|
## Authoring
|
|
9
9
|
|
|
10
|
+
Start from a scaffold:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx eve@latest extension init my-crm
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This creates the package, installs dependencies, and initializes Git. You get `extension/extension.ts`, TypeScript config, and a `package.json` ready to publish or mount. Add tools, skills, hooks, and connections under `extension/` yourself.
|
|
17
|
+
|
|
10
18
|
An extension is an agent-shaped directory without `agent.ts` or `sandbox` (those belong to the consuming agent). Every slot works as it does in an agent, with names derived from paths.
|
|
11
19
|
|
|
12
20
|
```
|
|
13
21
|
@acme/crm/
|
|
14
22
|
package.json
|
|
15
|
-
|
|
23
|
+
extension/
|
|
16
24
|
extension.ts # the extension declaration — see Configuration
|
|
17
25
|
tools/search.ts
|
|
18
26
|
connections/api.ts
|
|
@@ -21,13 +29,13 @@ An extension is an agent-shaped directory without `agent.ts` or `sandbox` (those
|
|
|
21
29
|
lib/http.ts # shared helpers, imported as ../lib/http
|
|
22
30
|
```
|
|
23
31
|
|
|
24
|
-
Name tools and connections for what they do (`search`, not `crm_search`) — the mount supplies the namespace. Shared code goes in `
|
|
32
|
+
Name tools and connections for what they do (`search`, not `crm_search`) — the mount supplies the namespace. Shared code goes in `extension/lib/`, imported by relative path — eve compiles the source, so relative imports need no `.js` extension.
|
|
25
33
|
|
|
26
34
|
### Configuration
|
|
27
35
|
|
|
28
|
-
Declare the extension in `
|
|
36
|
+
Declare the extension in `extension/extension.ts` with `defineExtension`; its default export is the mount factory a consumer calls. Pass `config` — any [Standard Schema](https://standardschema.dev) (a Zod object here), like a tool's `inputSchema` — to accept consumer settings:
|
|
29
37
|
|
|
30
|
-
```ts title="
|
|
38
|
+
```ts title="extension/extension.ts"
|
|
31
39
|
import { defineExtension } from "eve/extension";
|
|
32
40
|
import { z } from "zod";
|
|
33
41
|
|
|
@@ -41,7 +49,7 @@ export default defineExtension({
|
|
|
41
49
|
|
|
42
50
|
Config is optional — `defineExtension()` with no schema. Read it off the handle, imported from the declaration; it's typed from the schema:
|
|
43
51
|
|
|
44
|
-
```ts title="
|
|
52
|
+
```ts title="extension/tools/search.ts"
|
|
45
53
|
import { defineTool } from "eve/tools";
|
|
46
54
|
|
|
47
55
|
import extension from "../extension";
|
|
@@ -65,17 +73,17 @@ Config is bound once when the consumer mounts the extension and stays constant f
|
|
|
65
73
|
|
|
66
74
|
## Publishing
|
|
67
75
|
|
|
68
|
-
Point `eve.extension` at the source directory and run `eve build` (wired to `build`/`prepare`):
|
|
76
|
+
Point `eve.extension` at the source directory and run `eve extension build` (wired to `build`/`prepare`):
|
|
69
77
|
|
|
70
78
|
```jsonc title="package.json"
|
|
71
79
|
{
|
|
72
80
|
"name": "@acme/crm",
|
|
73
81
|
"type": "module",
|
|
74
|
-
"eve": { "extension": "./
|
|
75
|
-
"files": ["
|
|
82
|
+
"eve": { "extension": "./extension" },
|
|
83
|
+
"files": ["extension", "dist"],
|
|
76
84
|
"peerDependencies": { "eve": "^x" },
|
|
77
85
|
"dependencies": { "zod": "^3" },
|
|
78
|
-
"scripts": { "build": "eve build", "prepare": "eve build" },
|
|
86
|
+
"scripts": { "build": "eve extension build", "prepare": "eve extension build" },
|
|
79
87
|
}
|
|
80
88
|
```
|
|
81
89
|
|
|
@@ -90,17 +98,17 @@ Author the source with `moduleResolution: "bundler"` — eve compiles it, so rel
|
|
|
90
98
|
"noEmit": true,
|
|
91
99
|
"types": ["node"],
|
|
92
100
|
},
|
|
93
|
-
"include": ["
|
|
101
|
+
"include": ["extension/**/*.ts"],
|
|
94
102
|
}
|
|
95
103
|
```
|
|
96
104
|
|
|
97
|
-
`eve 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.
|
|
105
|
+
`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.
|
|
98
106
|
|
|
99
107
|
### Dependencies
|
|
100
108
|
|
|
101
|
-
`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 `
|
|
109
|
+
`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).
|
|
102
110
|
|
|
103
|
-
Those deps resolve from `node_modules` under `eve dev`/`eve eval` and are bundled into the deployable by `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.
|
|
111
|
+
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.
|
|
104
112
|
|
|
105
113
|
## Mounting
|
|
106
114
|
|
|
@@ -150,6 +158,27 @@ An override targets one slot, matched by name and kind: a static file replaces t
|
|
|
150
158
|
|
|
151
159
|
Overrides only work here — the `<namespace>__` prefix is reserved, so an agent-root contribution named `crm__…` is a build error and an extension can't be shadowed from outside its mount.
|
|
152
160
|
|
|
161
|
+
### Typed tool results
|
|
162
|
+
|
|
163
|
+
A consuming agent can narrow a mounted extension's tool result in a hook: import the tool from the extension's `./tools` export and pass it to [`toolResultFrom`](/guides/hooks#narrowing-tool-results). It matches the namespaced result (`crm__search`) because identity keys off the tool definition, not its name.
|
|
164
|
+
|
|
165
|
+
```ts title="agent/hooks/narrow-crm.ts"
|
|
166
|
+
import { defineHook } from "eve/hooks";
|
|
167
|
+
import { toolResultFrom } from "eve/tools";
|
|
168
|
+
import { search } from "@acme/crm/tools";
|
|
169
|
+
|
|
170
|
+
export default defineHook({
|
|
171
|
+
events: {
|
|
172
|
+
"action.result"(event) {
|
|
173
|
+
const match = toolResultFrom(event.data.result, search);
|
|
174
|
+
if (match) console.log(match.output); // typed as search's output
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Matching keys off the tool's description, so keep extension tool descriptions distinct — one shared with another tool makes the identity ambiguous and `toolResultFrom` stops matching.
|
|
181
|
+
|
|
153
182
|
## Limits
|
|
154
183
|
|
|
155
184
|
An extension cannot declare a `sandbox`, agent config, schedules, or limits, and cannot mount other extensions — those are the consuming agent's to own (background scheduling, for instance, runs on the agent's deployment under its limits). An extension's tools run within the consuming agent's per-session limits.
|
|
@@ -42,7 +42,7 @@ for await (const event of response) {
|
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
`message.appended` and `reasoning.appended` are incremental delta events. Their completed forms, `message.completed` and `reasoning.completed`, are the compatibility path for clients that don't render deltas.
|
|
45
|
+
`message.appended` and `reasoning.appended` are incremental delta events. eve may combine adjacent deltas of the same type while a durable stream write is in flight, but preserves their text and event ordering; any different event is a barrier. Their completed forms, `message.completed` and `reasoning.completed`, are the compatibility path for clients that don't render deltas.
|
|
46
46
|
|
|
47
47
|
## Handle event types
|
|
48
48
|
|
|
@@ -30,16 +30,41 @@ export default withEve(nextConfig, {
|
|
|
30
30
|
});
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
For multiple agents, use `agents`. String values are agent roots; object values can override the build command or private production service prefix for that agent:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export default withEve(nextConfig, {
|
|
37
|
+
agents: {
|
|
38
|
+
support: "./agents/support",
|
|
39
|
+
billing: {
|
|
40
|
+
root: "./agents/billing",
|
|
41
|
+
buildCommand: "pnpm build:billing-agent",
|
|
42
|
+
servicePrefix: "/_eve_internal/billing",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Named agents mount under `/eve/agents/<name>/eve/v1/*`. Call the matching agent from React with `agent`:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
const support = useEveAgent({ agent: "support" });
|
|
52
|
+
const billing = useEveAgent({ agent: "billing" });
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use either `eveRoot` or `agents`, not both. `eveRoot` remains the shorthand for a single unnamed agent mounted at `/eve/v1/*`.
|
|
56
|
+
|
|
33
57
|
### `withEve` options
|
|
34
58
|
|
|
35
59
|
All fields are optional.
|
|
36
60
|
|
|
37
|
-
| Option | Type
|
|
38
|
-
| -------------------- |
|
|
39
|
-
| `eveRoot` | `string`
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
61
|
+
| Option | Type | Default | Purpose |
|
|
62
|
+
| -------------------- | --------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| `eveRoot` | `string` | Next.js app root | Path to one unnamed eve app root, relative to `process.cwd()` unless absolute. Do not combine with `agents`. |
|
|
64
|
+
| `agents` | `Record<string, ...>` | unset | Named eve agents to mount under `/eve/agents/<name>/eve/v1/*`. Each value is a root string or `{ root, buildCommand?, servicePrefix? }`. |
|
|
65
|
+
| `eveBuildCommand` | `string` | generated | Build command for generated eve Vercel services. In multi-agent mode this is the default for agents without their own `buildCommand`. |
|
|
66
|
+
| `servicePrefix` | `string` | `"/_eve_internal/eve"` | Private route namespace for legacy manual Vercel service configs and non-Vercel production proxying. Named agents derive unique defaults from this prefix. |
|
|
67
|
+
| `devServerTimeoutMs` | `number` | `180000` | Maximum time to wait for each eve development server to become available. |
|
|
43
68
|
|
|
44
69
|
For slow cold starts, increase the development timeout:
|
|
45
70
|
|
|
@@ -75,7 +100,7 @@ For a public demo, use `none()` (also from `eve/channels/auth`) to skip authenti
|
|
|
75
100
|
## Dev vs deploy topology
|
|
76
101
|
|
|
77
102
|
- **Local dev.** `npm run dev` boots the eve dev server next to `next dev` and rewrites the eve routes over to it. The browser only ever talks to the Next.js origin.
|
|
78
|
-
- **Vercel.** The web app and the eve runtime deploy as a single project. `withEve()` writes Build Output `services` for eve and `routes` that send `/eve/v1/**` to that service before filesystem routing; the Next.js app itself remains the default app. When the agent needs its own build step, set `eveBuildCommand`:
|
|
103
|
+
- **Vercel.** The web app and the eve runtime deploy as a single project. `withEve()` writes Build Output `services` for eve and `routes` that send `/eve/v1/**` to that service before filesystem routing; the Next.js app itself remains the default app. By default, generated services run the installed eve binary from the agent root, so the agent directory does not need its own `package.json`. When the agent needs its own build step, set `eveBuildCommand`:
|
|
79
104
|
|
|
80
105
|
```ts
|
|
81
106
|
export default withEve(nextConfig, {
|
|
@@ -254,7 +254,7 @@ const agent = useEveAgent({
|
|
|
254
254
|
|
|
255
255
|
Store the full `session` object (`sessionId`, `continuationToken`, `streamIndex`), not a single field. The session cursor lets eve continue the durable conversation; the event log lets your UI render historical messages without replaying the whole stream. A database-backed chat app should usually persist stream events as they arrive with `onEvent` and then save a final snapshot in `onFinish`.
|
|
256
256
|
|
|
257
|
-
For multiple chat threads, keep one saved event log and session cursor per thread. `host`, `reducer`, `session`, `initialEvents`, `initialSession`, `auth`, `headers`, `maxReconnectAttempts`, and `optimistic` are read when the hook creates its store, so remount the chat component when switching threads, for example with `key={chat.id}`.
|
|
257
|
+
For multiple chat threads, keep one saved event log and session cursor per thread. `agent`, `host`, `reducer`, `session`, `initialEvents`, `initialSession`, `auth`, `headers`, `maxReconnectAttempts`, and `optimistic` are read when the hook creates its store, so remount the chat component when switching threads, for example with `key={chat.id}`.
|
|
258
258
|
|
|
259
259
|
If the user can refresh or navigate immediately after pressing send, create your app-level chat row and store the pending user message before calling `send()`. After the request starts, persist the session state as soon as it contains a `sessionId`, then reconnect an interrupted in-flight turn with `session.stream({ startIndex: savedEvents.length })` from the lower-level client.
|
|
260
260
|
|
|
@@ -271,6 +271,12 @@ const agent = useEveAgent({
|
|
|
271
271
|
});
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
+
When a framework integration mounts multiple named agents, pass `agent` instead of `host`:
|
|
275
|
+
|
|
276
|
+
```tsx
|
|
277
|
+
const support = useEveAgent({ agent: "support" });
|
|
278
|
+
```
|
|
279
|
+
|
|
274
280
|
## Per-framework integration
|
|
275
281
|
|
|
276
282
|
| Framework | Integration | Hook |
|
package/docs/guides/hooks.md
CHANGED
|
@@ -71,6 +71,15 @@ export default defineHook({
|
|
|
71
71
|
|
|
72
72
|
Returns `undefined` when the result doesn't match, or when `isError` is `true`. For authored tools the return includes `{ output, toolName, callId }` with `output` typed as the tool's `TOutput`. For connections it includes `{ output, toolName, connectionToolName, callId }` with `output` as `unknown`.
|
|
73
73
|
|
|
74
|
+
This works for a mounted extension's tools too — import the tool from the extension's `./tools` export and pass it. `toolResultFrom` matches the namespaced result (`crm__search`) because it keys off the tool definition, not the name:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { search } from "@acme/crm/tools";
|
|
78
|
+
|
|
79
|
+
// inside "action.result":
|
|
80
|
+
const crmSearch = toolResultFrom(event.data.result, search); // typed; matches crm__search
|
|
81
|
+
```
|
|
82
|
+
|
|
74
83
|
## Execution order
|
|
75
84
|
|
|
76
85
|
When a stream event fires, three things happen in order:
|
|
@@ -20,14 +20,29 @@ export default defineRemoteAgent({
|
|
|
20
20
|
|
|
21
21
|
`defineRemoteAgent` accepts:
|
|
22
22
|
|
|
23
|
-
| Parameter | Type
|
|
24
|
-
| -------------- |
|
|
25
|
-
| `url` | `string`
|
|
26
|
-
| `description` | `string`
|
|
27
|
-
| `auth` | `OutboundAuthFn`
|
|
28
|
-
| `headers` | `HeadersValue`
|
|
29
|
-
| `path` | `string`
|
|
30
|
-
| `outputSchema` | `StandardSchema \| JSON Schema`
|
|
23
|
+
| Parameter | Type | Required | Default | Description |
|
|
24
|
+
| -------------- | --------------------------------------------- | -------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| `url` | `string \| (() => string \| Promise<string>)` | Yes | n/a | Base URL of the remote eve deployment to call. A string is baked at compile time; a function is resolved at runtime (see [Runtime URLs](#runtime-urls)). |
|
|
26
|
+
| `description` | `string` | Yes | n/a | Model-visible delegation description. |
|
|
27
|
+
| `auth` | `OutboundAuthFn` | No | none | Outbound auth hook from `eve/agents/auth`. |
|
|
28
|
+
| `headers` | `HeadersValue` | No | none | Static or lazily resolved request headers. |
|
|
29
|
+
| `path` | `string` | No | `/eve/v1/session` | Route appended to `url` for the create-session request. |
|
|
30
|
+
| `outputSchema` | `StandardSchema \| JSON Schema` | No | none | Structured return type the caller requires. Lowered to JSON Schema at compile time and enforced by the remote like any task-mode output schema. |
|
|
31
|
+
|
|
32
|
+
## Runtime URLs
|
|
33
|
+
|
|
34
|
+
A string `url` is read at compile time and frozen into the build. When the target comes from a runtime env var — known only once the deployment runs — pass a function instead. eve calls it when it resolves the agent graph at runtime, so it can read `process.env`:
|
|
35
|
+
|
|
36
|
+
```ts title="agent/subagents/weather.ts"
|
|
37
|
+
import { defineRemoteAgent } from "eve";
|
|
38
|
+
|
|
39
|
+
export default defineRemoteAgent({
|
|
40
|
+
url: () => process.env.WEATHER_AGENT_URL ?? "https://weather-agent.example.com",
|
|
41
|
+
description: "Answers weather, temperature, forecast, wind, rain, and snow questions.",
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The function may be async and must return a non-empty string. `auth` and `headers` are resolved at runtime the same way.
|
|
31
46
|
|
|
32
47
|
## The lowered tool
|
|
33
48
|
|
package/docs/meta.json
CHANGED
package/docs/reference/cli.md
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "CLI"
|
|
3
|
-
description: "Reference for every eve CLI command: init, info, build, start, dev, link, deploy, eval, and
|
|
3
|
+
description: "Reference for every eve CLI command: init, info, build, start, dev, link, deploy, eval, channels, and extension."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
The `eve` binary (`bin: eve`) runs from your app root, and every command first loads `.env`/`.env.local` from that root. Running `eve` with no command runs `eve dev`.
|
|
7
7
|
|
|
8
8
|
## Commands
|
|
9
9
|
|
|
10
|
-
| Command
|
|
11
|
-
|
|
|
12
|
-
| `eve init [target]`
|
|
13
|
-
| `eve info`
|
|
14
|
-
| `eve build`
|
|
15
|
-
| `eve start`
|
|
16
|
-
| `eve dev`
|
|
17
|
-
| `eve dev <url>`
|
|
18
|
-
| `eve link`
|
|
19
|
-
| `eve deploy`
|
|
20
|
-
| `eve eval`
|
|
21
|
-
| `eve channels add [kind]`
|
|
22
|
-
| `eve channels list`
|
|
10
|
+
| Command | Description |
|
|
11
|
+
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
12
|
+
| `eve init [target]` | Create a new agent, or add an agent to an existing project |
|
|
13
|
+
| `eve info` | Print the resolved application, including discovered tools, skills, subagents, schedules, channels, routes, artifact paths, and discovery diagnostics |
|
|
14
|
+
| `eve build` | Compile `.eve/` artifacts and build the host output; prints the output directory |
|
|
15
|
+
| `eve start` | Serve the built `.output/` app; prints the listening URL |
|
|
16
|
+
| `eve dev` | Start the local dev server and open the terminal UI |
|
|
17
|
+
| `eve dev <url>` | Connect the UI to an existing server URL (e.g. a remote deployment) instead of booting a local server |
|
|
18
|
+
| `eve link` | Link the directory to a Vercel project and pull AI Gateway credentials |
|
|
19
|
+
| `eve deploy` | Deploy the agent to Vercel production (links first if needed) |
|
|
20
|
+
| `eve eval` | Run evals against the local app or a remote target |
|
|
21
|
+
| `eve channels add [kind]` | Scaffold a channel interactively, or by kind (`slack` \| `web`) |
|
|
22
|
+
| `eve channels list` | List user-authored channels |
|
|
23
|
+
| `eve extension init [target]` | Create a new extension package |
|
|
24
|
+
| `eve extension build` | Build the current package as an extension |
|
|
23
25
|
|
|
24
26
|
When `eve build` fails on discovery errors, it prints the full diagnostics report (severity, message, source path) and the diagnostics artifact path.
|
|
25
27
|
|
|
@@ -29,17 +31,49 @@ When `eve build` fails on discovery errors, it prints the full diagnostics repor
|
|
|
29
31
|
eve init [target] [--channel-web-nextjs]
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
Creates a new agent app or adds an agent to an existing app. Always installs dependencies. New directories also initialize Git.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
| Target | What happens |
|
|
37
|
+
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| `eve init my-agent` | New agent project in `my-agent/` |
|
|
39
|
+
| `eve init .` (or an existing project dir) | Adds `agent/` plus missing `eve`, `ai`, and `zod` deps. Needs a `package.json` and no `agent/` files yet |
|
|
40
|
+
| `eve init` with no target | Same as `eve init .`, except coding agents (Claude Code, Cursor, and similar) get a setup guide instead of scaffolding — they have not chosen a name yet |
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
After scaffolding, a human terminal usually continues into `eve dev` (or a coding-agent REPL if one is on `PATH` and you pick it). Coding-agent launches print the next steps instead of opening the TUI, so the session does not get stuck. Fresh projects use the parent workspace's package manager when there is one; otherwise they use the manager that launched `eve init`.
|
|
39
43
|
|
|
40
|
-
| Flag | Type | Default | Description
|
|
41
|
-
| ---------------------- | ---- | ------- |
|
|
42
|
-
| `--channel-web-nextjs` | flag | off | Add the Web Chat
|
|
44
|
+
| Flag | Type | Default | Description |
|
|
45
|
+
| ---------------------- | ---- | ------- | ----------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| `--channel-web-nextjs` | flag | off | Add the Web Chat app (Next.js). Not for existing projects — run `eve channels add web` there instead. |
|
|
47
|
+
|
|
48
|
+
## `eve extension`
|
|
49
|
+
|
|
50
|
+
Commands for reusable [extension](/docs/extensions) packages. An extension is identified by `package.json#eve.extension` (for example `"eve": { "extension": "./extension" }`).
|
|
51
|
+
|
|
52
|
+
### `eve extension init`
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
eve extension init [target]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Creates a new extension package, installs dependencies, and initializes Git. Prints next steps instead of starting `eve dev`.
|
|
59
|
+
|
|
60
|
+
| Target | What happens |
|
|
61
|
+
| --------------------------- | ------------------------------------------------------------- |
|
|
62
|
+
| `eve extension init my-crm` | New extension package in `my-crm/` |
|
|
63
|
+
| `eve extension init .` | Scaffold in the current empty directory |
|
|
64
|
+
| No target | Same as `.` for humans; coding agents get a short setup guide |
|
|
65
|
+
|
|
66
|
+
Create-only: cannot target an existing project that already has a `package.json`.
|
|
67
|
+
|
|
68
|
+
See [Extensions](/docs/extensions) for authoring and mount details.
|
|
69
|
+
|
|
70
|
+
### `eve extension build`
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
eve extension build
|
|
74
|
+
```
|
|
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`.
|
|
43
77
|
|
|
44
78
|
## `eve info`
|
|
45
79
|
|
|
@@ -86,6 +86,7 @@ A few non-`define*` helpers round out the set: `disableTool` and `ExperimentalWo
|
|
|
86
86
|
| `eve/context` | `defineState`, session and state types |
|
|
87
87
|
| `eve/sandbox` | `defineSandbox`, backends |
|
|
88
88
|
| `eve/instrumentation` | `defineInstrumentation`, `isChannel` |
|
|
89
|
+
| `eve/models/openai` | `experimental_chatgpt` |
|
|
89
90
|
| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types |
|
|
90
91
|
| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity` |
|
|
91
92
|
| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter` |
|
|
@@ -96,6 +97,22 @@ A few non-`define*` helpers round out the set: `disableTool` and `ExperimentalWo
|
|
|
96
97
|
|
|
97
98
|
Exported types ship from the same entrypoint as the helper they describe (for example `ToolDefinition` and `ToolContext` from `eve/tools`). For the exhaustive list, read `packages/eve/src/public/index.ts`.
|
|
98
99
|
|
|
100
|
+
## ChatGPT subscription models
|
|
101
|
+
|
|
102
|
+
`experimental_chatgpt()` from `eve/models/openai` serves an OpenAI model through the local Codex login and bills the ChatGPT subscription. With no argument, it selects `gpt-5.6-sol`:
|
|
103
|
+
|
|
104
|
+
```ts title="agent/agent.ts"
|
|
105
|
+
import { defineAgent } from "eve";
|
|
106
|
+
import { experimental_chatgpt } from "eve/models/openai";
|
|
107
|
+
|
|
108
|
+
export default defineAgent({
|
|
109
|
+
model: experimental_chatgpt(),
|
|
110
|
+
modelContextWindowTokens: 200_000,
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Pass another bare OpenAI model slug to override the default. The helper reads credentials from `codex login`, so use it only where that local login exists.
|
|
115
|
+
|
|
99
116
|
## What to read next
|
|
100
117
|
|
|
101
118
|
- [`agent.ts`](../agent-config): the agent config these helpers configure
|