eve 0.25.3 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/src/chunks/{use-eve-agent-Cy73lgA6.js → use-eve-agent-BkztZA0v.js} +76 -55
- package/dist/src/chunks/{use-eve-agent-CQIeqmKc.js → use-eve-agent-CruinZmd.js} +76 -55
- package/dist/src/cli/banner.d.ts +5 -0
- package/dist/src/cli/banner.js +1 -1
- package/dist/src/cli/commands/logs-events.d.ts +36 -0
- package/dist/src/cli/commands/logs-events.js +2 -0
- package/dist/src/cli/commands/logs.d.ts +64 -0
- package/dist/src/cli/commands/logs.js +4 -0
- package/dist/src/cli/dev/diagnostic-dump.d.ts +60 -0
- package/dist/src/cli/dev/diagnostic-dump.js +1 -0
- package/dist/src/cli/dev/diagnostic-sink.d.ts +37 -0
- package/dist/src/cli/dev/diagnostic-sink.js +1 -0
- package/dist/src/cli/dev/diagnostics.d.ts +42 -0
- package/dist/src/cli/dev/diagnostics.js +1 -0
- package/dist/src/cli/dev/tui/blocks.d.ts +60 -8
- package/dist/src/cli/dev/tui/blocks.js +8 -8
- package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
- package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +16 -0
- package/dist/src/cli/dev/tui/diagnostic-presentation.js +3 -0
- package/dist/src/cli/dev/tui/errors.d.ts +21 -16
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/file-content-cache.d.ts +35 -0
- package/dist/src/cli/dev/tui/file-content-cache.js +3 -0
- package/dist/src/cli/dev/tui/line-diff.d.ts +24 -0
- package/dist/src/cli/dev/tui/line-diff.js +1 -0
- package/dist/src/cli/dev/tui/line-editor.js +1 -1
- package/dist/src/cli/dev/tui/markdown.d.ts +2 -1
- package/dist/src/cli/dev/tui/markdown.js +7 -3
- package/dist/src/cli/dev/tui/model-editor.d.ts +103 -0
- package/dist/src/cli/dev/tui/model-editor.js +1 -0
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +12 -0
- package/dist/src/cli/dev/tui/prompt-placeholder.js +1 -0
- package/dist/src/cli/dev/tui/question-panel.d.ts +24 -0
- package/dist/src/cli/dev/tui/question-panel.js +1 -0
- package/dist/src/cli/dev/tui/rail.d.ts +15 -0
- package/dist/src/cli/dev/tui/rail.js +1 -0
- package/dist/src/cli/dev/tui/remote-auth-command.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +27 -65
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +1 -1
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/setup-flow.d.ts +3 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +33 -0
- package/dist/src/cli/dev/tui/setup-panel.js +4 -4
- package/dist/src/cli/dev/tui/status-line.d.ts +8 -6
- package/dist/src/cli/dev/tui/status-line.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +16 -3
- package/dist/src/cli/dev/tui/stream-format.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +127 -0
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -0
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +37 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -10
- package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
- package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +7 -0
- package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
- package/dist/src/cli/dev/tui/theme.d.ts +30 -2
- package/dist/src/cli/dev/tui/theme.js +1 -1
- package/dist/src/cli/dev/tui/todo-panel.d.ts +44 -0
- package/dist/src/cli/dev/tui/todo-panel.js +1 -0
- package/dist/src/cli/dev/tui/tool-block-groups.d.ts +40 -0
- package/dist/src/cli/dev/tui/tool-block-groups.js +1 -0
- package/dist/src/cli/dev/tui/tool-format.js +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +67 -0
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -0
- package/dist/src/cli/dev/tui/tool-rows.d.ts +15 -0
- package/dist/src/cli/dev/tui/tool-rows.js +2 -0
- package/dist/src/cli/dev/tui/tui.js +1 -1
- package/dist/src/cli/dev/tui/turn-clock.d.ts +36 -0
- package/dist/src/cli/dev/tui/turn-clock.js +1 -0
- package/dist/src/cli/dev/tui/types.d.ts +2 -2
- package/dist/src/cli/dev/ui-options.js +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/ui/live-row.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +9 -0
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +1 -2
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/open-stream.d.ts +14 -10
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-utils.d.ts +2 -1
- package/dist/src/client/session-utils.js +1 -1
- package/dist/src/client/session.d.ts +3 -5
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +0 -6
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/marked/LICENSE.md +44 -0
- package/dist/src/compiled/marked/index.d.ts +24 -0
- package/dist/src/compiled/marked/index.js +59 -0
- package/dist/src/compiler/extension-compatibility.d.ts +2 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/evals/session.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +4 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +1 -1
- package/dist/src/execution/terminal-session-failure-step.js +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/model-call-error.d.ts +11 -30
- package/dist/src/harness/model-call-error.js +1 -1
- package/dist/src/harness/semantic-errors/index.d.ts +9 -0
- package/dist/src/harness/semantic-errors/index.js +1 -0
- package/dist/src/harness/semantic-errors/rule.d.ts +76 -0
- package/dist/src/harness/semantic-errors/rule.js +1 -0
- package/dist/src/harness/semantic-errors/rules/gateway.d.ts +11 -0
- package/dist/src/harness/semantic-errors/rules/gateway.js +1 -0
- package/dist/src/harness/semantic-errors/rules/model-provider.d.ts +11 -0
- package/dist/src/harness/semantic-errors/rules/model-provider.js +1 -0
- package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +16 -0
- package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -0
- package/dist/src/harness/semantic-errors/rules/system.d.ts +2 -0
- package/dist/src/harness/semantic-errors/rules/system.js +1 -0
- package/dist/src/harness/semantic-errors/rules/workflow.d.ts +9 -0
- package/dist/src/harness/semantic-errors/rules/workflow.js +1 -0
- package/dist/src/harness/semantic-errors/signals.d.ts +28 -0
- package/dist/src/harness/semantic-errors/signals.js +1 -0
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/workflow-sandbox.d.ts +6 -0
- package/dist/src/harness/workflow-sandbox.js +2 -2
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/logging.d.ts +33 -1
- package/dist/src/internal/logging.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +3 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +46 -3
- package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/public/models/openai/chatgpt/model.js +3 -1
- package/dist/src/react/use-eve-agent.d.ts +0 -1
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/setup/boxes/add-channels.js +1 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/model-capabilities.d.ts +24 -0
- package/dist/src/setup/boxes/model-capabilities.js +1 -0
- package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
- package/dist/src/setup/boxes/select-model.d.ts +30 -8
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/option-row.js +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +2 -0
- package/dist/src/setup/cli/prompt-ui.js +2 -2
- package/dist/src/setup/cli/rail-log.d.ts +4 -6
- package/dist/src/setup/cli/rail-log.js +3 -2
- package/dist/src/setup/connection-connector.js +2 -2
- package/dist/src/setup/flows/link.d.ts +13 -3
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/login.js +1 -1
- package/dist/src/setup/flows/model-source-change.d.ts +38 -0
- package/dist/src/setup/flows/model-source-change.js +1 -0
- package/dist/src/setup/flows/model.d.ts +69 -65
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +22 -0
- package/dist/src/setup/flows/provider.js +3 -3
- package/dist/src/setup/prompter.d.ts +2 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/vercel-project.d.ts +6 -0
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/dynamic-tool-definition.d.ts +1 -8
- package/dist/src/shared/errors.d.ts +5 -0
- package/dist/src/shared/errors.js +1 -1
- package/dist/src/shared/gateway-service-tier.d.ts +19 -0
- package/dist/src/shared/gateway-service-tier.js +1 -0
- package/dist/src/shared/model-summary.d.ts +12 -0
- package/dist/src/shared/model-summary.js +1 -0
- package/dist/src/shared/workflow-sandbox.d.ts +2 -0
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/source-change/agent-config-ast.d.ts +54 -0
- package/dist/src/source-change/agent-config-ast.js +2 -0
- package/dist/src/source-change/agent-config-string-path.d.ts +18 -0
- package/dist/src/source-change/agent-config-string-path.js +2 -0
- package/dist/src/source-change/apply-agent-model-settings.d.ts +26 -0
- package/dist/src/source-change/apply-agent-model-settings.js +1 -0
- package/dist/src/source-change/apply-model-name.js +1 -2
- package/dist/src/source-change/static-source-change.d.ts +14 -0
- package/dist/src/source-change/static-source-change.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +0 -6
- 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 +0 -2
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/execution-model-and-durability.md +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +1 -1
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/auth-and-route-protection.md +1 -1
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/client/streaming.mdx +1 -10
- package/docs/guides/deployment/meta.json +4 -0
- package/docs/guides/deployment/overview.md +61 -0
- package/docs/guides/deployment/self-hosting.md +88 -0
- package/docs/guides/deployment/vercel.mdx +90 -0
- package/docs/guides/dev-tui.md +8 -4
- package/docs/guides/dynamic-capabilities.md +2 -0
- package/docs/guides/frontend/nextjs.mdx +1 -1
- package/docs/guides/frontend/nuxt.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +2 -5
- package/docs/guides/frontend/sveltekit.mdx +1 -1
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +1 -4
- package/docs/guides/frontend/use-eve-agent-vue.mdx +1 -4
- package/docs/guides/instrumentation.md +1 -1
- package/docs/reference/cli.md +24 -2
- package/docs/tutorial/ship-it.mdx +1 -1
- package/package.json +2 -1
- package/docs/guides/deployment.md +0 -210
- /package/dist/src/cli/{dev/tui → ui}/live-region.d.ts +0 -0
- /package/dist/src/cli/{dev/tui → ui}/live-region.js +0 -0
- /package/dist/src/cli/{dev/tui → ui}/terminal-text.d.ts +0 -0
- /package/dist/src/cli/{dev/tui → ui}/terminal-text.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The AST plumbing shared by the agent-config source editors: the loose
|
|
3
|
+
* Rolldown node shapes, the parse-and-locate-`defineAgent({ ... })` pipeline,
|
|
4
|
+
* and the string-splicing helpers. Editors own their edit policies; this
|
|
5
|
+
* module owns how an agent config is read.
|
|
6
|
+
*/
|
|
7
|
+
export type Program = {
|
|
8
|
+
readonly body?: readonly AstNode[];
|
|
9
|
+
};
|
|
10
|
+
export type AstNode = {
|
|
11
|
+
readonly arguments?: readonly AstNode[];
|
|
12
|
+
readonly callee?: AstNode;
|
|
13
|
+
readonly computed?: boolean;
|
|
14
|
+
readonly declaration?: AstNode | null;
|
|
15
|
+
readonly end?: number;
|
|
16
|
+
readonly expression?: AstNode | null;
|
|
17
|
+
readonly key?: AstNode;
|
|
18
|
+
readonly name?: string;
|
|
19
|
+
readonly properties?: readonly AstNode[];
|
|
20
|
+
readonly raw?: string;
|
|
21
|
+
readonly start?: number;
|
|
22
|
+
readonly type?: string;
|
|
23
|
+
readonly value?: AstNode | string | number | boolean | null;
|
|
24
|
+
};
|
|
25
|
+
export type ObjectExpression = AstNode & {
|
|
26
|
+
readonly end: number;
|
|
27
|
+
readonly properties: readonly AstNode[];
|
|
28
|
+
readonly start: number;
|
|
29
|
+
readonly type: "ObjectExpression";
|
|
30
|
+
};
|
|
31
|
+
export type ParsedAgentObject = {
|
|
32
|
+
readonly kind: "ok";
|
|
33
|
+
readonly object: ObjectExpression;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: "bail";
|
|
36
|
+
readonly reason: string;
|
|
37
|
+
readonly line: number;
|
|
38
|
+
};
|
|
39
|
+
/** Parses a source and locates the `export default defineAgent({ ... })` object. */
|
|
40
|
+
export declare function parseAgentObject(sourceText: string): Promise<ParsedAgentObject>;
|
|
41
|
+
/**
|
|
42
|
+
* The write-guard invariant: an edited source must still parse and still
|
|
43
|
+
* carry the `defineAgent({ ... })` object. Returns the failure reason, or
|
|
44
|
+
* undefined when the source is sound. Callers bail instead of writing, so an
|
|
45
|
+
* editor bug degrades to a "change it by hand" message rather than a broken
|
|
46
|
+
* agent.ts.
|
|
47
|
+
*/
|
|
48
|
+
export declare function checkAgentConfigSource(sourceText: string): Promise<string | undefined>;
|
|
49
|
+
/** Strips `as`, `satisfies`, and parentheses to reach the underlying expression. */
|
|
50
|
+
export declare function unwrapExpression(expression: AstNode): AstNode;
|
|
51
|
+
export declare function keyMatches(key: AstNode | undefined, name: string): boolean;
|
|
52
|
+
export declare function isAstNode(value: unknown): value is AstNode;
|
|
53
|
+
export declare function escapeForQuote(value: string, quote: '"' | "'"): string;
|
|
54
|
+
export declare function lineAt(source: string, offset: number): number;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{parseWithNitroRolldownAst}from"#internal/bundler/nitro-rolldown.js";async function parseAgentObject(t){let n;try{n=await parseWithNitroRolldownAst(`agent.ts`,t)}catch(e){let n=e;return{kind:`bail`,reason:`agent.ts does not parse: ${n.message??`unknown parse error`}`,line:parseErrorLine(t,n)}}if((n.errors?.length??0)>0){let e=n.errors?.[0];return{kind:`bail`,reason:`agent.ts does not parse: ${e?.message??`unknown parse error`}`,line:parseErrorLine(t,e)}}let r=findDefineAgentObject(n.program??n);return r===void 0?{kind:`bail`,reason:"no `export default defineAgent({ ... })` call found",line:1}:{kind:`ok`,object:r}}async function checkAgentConfigSource(e){let t=await parseAgentObject(e);return t.kind===`bail`?t.reason:void 0}function findDefineAgentObject(e){for(let t of e.body??[]){if(t.type!==`ExportDefaultDeclaration`||t.declaration==null)continue;let e=unwrapExpression(t.declaration);if(e.type!==`CallExpression`||e.callee?.type!==`Identifier`||e.callee.name!==`defineAgent`)continue;let n=e.arguments?.[0];if(n===void 0||n.type===`SpreadElement`)continue;let r=unwrapExpression(n);if(r.type===`ObjectExpression`&&r.start!==void 0&&r.end!==void 0&&r.properties!==void 0)return r}}function unwrapExpression(e){let t=e;for(;t.type===`ParenthesizedExpression`||t.type===`TSAsExpression`||t.type===`TSSatisfiesExpression`;){if(t.expression==null)return t;t=t.expression}return t}function keyMatches(e,t){return e?.type===`Identifier`?e.name===t:e?.type===`Literal`&&typeof e.value==`string`&&e.value===t}function isAstNode(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}function escapeForQuote(e,t){return e.replaceAll(`\\`,`\\\\`).replaceAll(t,`\\${t}`)}function lineAt(e,t){let n=1;for(let r=0;r<t&&r<e.length;r+=1)e[r]===`
|
|
2
|
+
`&&(n+=1);return n}function parseErrorLine(e,t){return typeof t?.loc?.line==`number`?t.loc.line:lineAt(e,t?.labels?.[0]?.start??t?.start??0)}export{checkAgentConfigSource,escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { checkAgentConfigSource } from "./agent-config-ast.js";
|
|
2
|
+
export type AgentConfigStringPathPatch = {
|
|
3
|
+
readonly kind: "set";
|
|
4
|
+
readonly value: string;
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: "remove";
|
|
7
|
+
readonly removable?: (value: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export type AgentConfigStringPathEdit = {
|
|
10
|
+
readonly kind: "applied";
|
|
11
|
+
readonly nextSource: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "bail";
|
|
14
|
+
readonly reason: string;
|
|
15
|
+
readonly line: number;
|
|
16
|
+
};
|
|
17
|
+
/** Safely applies one literal string leaf below `defineAgent({ ... })`. */
|
|
18
|
+
export declare function applyAgentConfigStringPath(sourceText: string, path: readonly [string, ...string[]], patch: AgentConfigStringPathPatch): Promise<AgentConfigStringPathEdit>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{checkAgentConfigSource,escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression}from"./agent-config-ast.js";async function applyAgentConfigStringPath(e,n,r){let o=await parseAgentObject(e);if(o.kind===`bail`)return o;let s=[o.object],c=[],l=o.object;for(let[t,a]of n.slice(0,-1).entries()){let o=findProperty(l,a);if(o.kind===`bail`)return{...o,line:lineAt(e,l.start)};if(o.property===void 0){if(r.kind===`remove`)return{kind:`applied`,nextSource:e};let i=nestedObjectSource(n.slice(t+1),r.value);return{kind:`applied`,nextSource:insertProperty(e,l,a,i)}}let u=propertyObjectValue(o.property);if(u===void 0)return{kind:`bail`,reason:`\`${a}\` is not an object literal that eve can edit safely`,line:lineAt(e,o.property.start)};c.push(o.property),s.push(u),l=u}let u=n.at(-1),d=findProperty(l,u);if(d.kind===`bail`)return{...d,line:lineAt(e,l.start)};if(d.property===void 0)return r.kind===`remove`?{kind:`applied`,nextSource:e}:{kind:`applied`,nextSource:insertProperty(e,l,u,JSON.stringify(r.value))};let f=propertyStringValue(d.property);if(f===void 0)return{kind:`bail`,reason:`\`${n.join(`.`)}\` is not a string literal that eve can edit safely`,line:lineAt(e,d.property.start)};if(r.kind===`set`){if(f.value===r.value)return{kind:`applied`,nextSource:e};let n=f.raw?.[0]===`'`?`'`:`"`,i=`${n}${escapeForQuote(r.value,n)}${n}`;return{kind:`applied`,nextSource:e.slice(0,f.start)+i+e.slice(f.end)}}if(r.removable!==void 0&&!r.removable(f.value))return{kind:`bail`,reason:`\`${n.join(`.`)}\` has the custom value ${JSON.stringify(f.value)}`,line:lineAt(e,d.property.start)};let p=d.property,m=l;for(let e=s.length-1;e>0&&m.properties.length===1;--e)p=c[e-1],m=s[e-1];return{kind:`applied`,nextSource:removeProperty(e,m,p)}}function findProperty(e,t){if(e.properties.some(e=>e.type===`SpreadElement`||e.computed===!0))return{kind:`bail`,reason:`\`${t}\` may be supplied by a spread or computed property`};let n=e.properties.filter(e=>e.type===`Property`&&!e.computed&&keyMatches(e.key,t));if(n.length>1)return{kind:`bail`,reason:`\`${t}\` is defined more than once`};let i=n[0];return i!==void 0&&i.start!==void 0&&i.end!==void 0?{kind:`ok`,property:i}:{kind:`ok`}}function propertyObjectValue(e){let t=e.value;if(!isAstNode(t))return;let r=unwrapExpression(t);return r.type===`ObjectExpression`&&r.start!==void 0&&r.end!==void 0&&r.properties!==void 0?r:void 0}function propertyStringValue(e){let t=e.value;if(!isAstNode(t))return;let r=unwrapExpression(t);if(r.type!==`Literal`||typeof r.value!=`string`||r.start===void 0||r.end===void 0)return;let i={start:r.start,end:r.end,value:r.value};return r.raw===void 0?i:{...i,raw:r.raw}}function nestedObjectSource(e,t){let n=JSON.stringify(t);for(let t of[...e].reverse())n=`{ ${t}: ${n} }`;return n}function insertProperty(e,t,n,r){let i=t.end-1,a=t.properties.at(-1);if(a===void 0||a.end===void 0)return e.slice(0,i)+` ${n}: ${r} `+e.slice(i);let o=e.lastIndexOf(`
|
|
2
|
+
`,i-1)+1;if(o>t.start){let t=`${e.slice(o,i)} `,s=e.slice(a.end,o),c=e;s.includes(`,`)||(c=c.slice(0,a.end)+`,`+c.slice(a.end));let l=o+ +!s.includes(`,`);return c.slice(0,l)+`${t}${n}: ${r},\n`+c.slice(l)}let s=e.slice(a.end,i).includes(`,`)?` `:`, `;return e.slice(0,i)+`${s}${n}: ${r}`+e.slice(i)}function removeProperty(e,t,n){let r=t.properties.indexOf(n),i=r>0?t.properties[r-1]:void 0,a=r>=0?t.properties[r+1]:void 0;return a?.start===void 0?i?.end===void 0?e.slice(0,t.start+1)+e.slice(t.end-1):e.slice(0,i.end)+e.slice(n.end):e.slice(0,n.start)+e.slice(a.start)}export{applyAgentConfigStringPath,checkAgentConfigSource};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentReasoningDefinition } from "#shared/agent-definition.js";
|
|
2
|
+
export type FieldPatch<T> = {
|
|
3
|
+
readonly kind: "keep";
|
|
4
|
+
} | {
|
|
5
|
+
readonly kind: "set";
|
|
6
|
+
readonly value: T;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: "remove";
|
|
9
|
+
};
|
|
10
|
+
export interface AgentModelSettingsPatch {
|
|
11
|
+
readonly model: FieldPatch<string>;
|
|
12
|
+
readonly reasoning: FieldPatch<AgentReasoningDefinition>;
|
|
13
|
+
readonly gatewayServiceTier: FieldPatch<"priority">;
|
|
14
|
+
}
|
|
15
|
+
export type AgentModelSetting = "model" | "reasoning" | "fast-mode";
|
|
16
|
+
export type AgentModelSettingsEdit = {
|
|
17
|
+
readonly kind: "applied";
|
|
18
|
+
readonly changed: readonly AgentModelSetting[];
|
|
19
|
+
readonly nextSource: string;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "bail";
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
readonly line: number;
|
|
24
|
+
};
|
|
25
|
+
/** Applies every model-setting change in memory; callers own the atomic write. */
|
|
26
|
+
export declare function applyAgentModelSettingsToSource(sourceText: string, patch: AgentModelSettingsPatch): Promise<AgentModelSettingsEdit>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{applyAgentConfigStringPath}from"./agent-config-string-path.js";import{applyModelNameToSource}from"./apply-model-name.js";async function applyAgentModelSettingsToSource(n,r){let i=n,a=[];if(r.model.kind===`remove`)return{kind:`bail`,reason:"the required `model` property cannot be removed",line:1};if(r.model.kind===`set`){let e=await applyModelNameToSource(i,r.model.value);if(e.kind===`bail`)return e;e.nextSource!==i&&a.push(`model`),i=e.nextSource}if(r.reasoning.kind!==`keep`){let t=await applyAgentConfigStringPath(i,[`reasoning`],r.reasoning.kind===`set`?{kind:`set`,value:r.reasoning.value}:{kind:`remove`});if(t.kind===`bail`)return t;t.nextSource!==i&&a.push(`reasoning`),i=t.nextSource}if(r.gatewayServiceTier.kind!==`keep`){let t=await applyAgentConfigStringPath(i,[`modelOptions`,`providerOptions`,`gateway`,`serviceTier`],r.gatewayServiceTier.kind===`set`?{kind:`set`,value:r.gatewayServiceTier.value}:{kind:`remove`,removable:e=>e===`priority`});if(t.kind===`bail`)return t;t.nextSource!==i&&a.push(`fast-mode`),i=t.nextSource}return{kind:`applied`,changed:a,nextSource:i}}export{applyAgentModelSettingsToSource};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`&&(n+=1);return n}export{applyModelNameToSource};
|
|
1
|
+
import{escapeForQuote,isAstNode,keyMatches,lineAt,parseAgentObject,unwrapExpression}from"./agent-config-ast.js";async function applyModelNameToSource(t,n){let a=await parseAgentObject(t);if(a.kind===`bail`)return a;let o=a.object,s=findStringLiteralProperty(o,`model`);if(s===void 0)return{kind:`bail`,reason:"`model` is absent or is not a string literal (e.g. an env reference, a template, an inlined SDK model, or a defineDynamic() dynamic model)",line:lineAt(t,o.start)};let c=s.value;if(c===n)return{kind:`applied`,from:c,to:n,nextSource:t};let l=s.raw?.[0]===`'`?`'`:`"`,u=`${l}${escapeForQuote(n,l)}${l}`;return{kind:`applied`,from:c,to:n,nextSource:t.slice(0,s.start)+u+t.slice(s.end)}}function findStringLiteralProperty(e,r){for(let i of e.properties){if(i.type!==`Property`||i.computed||!keyMatches(i.key,r))continue;let e=i.value;if(!isAstNode(e))continue;let o=unwrapExpression(e);return o.type===`Literal`&&typeof o.value==`string`&&o.start!==void 0&&o.end!==void 0?o:void 0}}export{applyModelNameToSource};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentSourceManifest } from "#discover/manifest.js";
|
|
2
|
+
import { type AgentModelSetting, type AgentModelSettingsPatch } from "#source-change/apply-agent-model-settings.js";
|
|
2
3
|
/**
|
|
3
4
|
* Outcome of a static source change, returned to upstream callers (CLI, web
|
|
4
5
|
* setup UI) so they can render success or route the bail to a guided fix.
|
|
@@ -15,6 +16,17 @@ export type ApplyResult = {
|
|
|
15
16
|
readonly line: number;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
19
|
+
export type ApplyModelSettingsResult = {
|
|
20
|
+
readonly kind: "applied";
|
|
21
|
+
readonly changed: readonly AgentModelSetting[];
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: "bail";
|
|
24
|
+
readonly reason: string;
|
|
25
|
+
readonly at: {
|
|
26
|
+
readonly logicalPath: string;
|
|
27
|
+
readonly line: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
18
30
|
/**
|
|
19
31
|
* Central, flat API for applying targeted edits to an agent's authored source.
|
|
20
32
|
*
|
|
@@ -29,6 +41,8 @@ export interface StaticSourceChange {
|
|
|
29
41
|
* the caller can offer a manual fix.
|
|
30
42
|
*/
|
|
31
43
|
updateModelName(modelName: string): Promise<ApplyResult>;
|
|
44
|
+
/** Applies the `/model` draft in one source transform and one atomic rename. */
|
|
45
|
+
updateModelSettings(patch: AgentModelSettingsPatch): Promise<ApplyModelSettingsResult>;
|
|
32
46
|
}
|
|
33
47
|
/**
|
|
34
48
|
* Creates the {@link StaticSourceChange} surface bound to one discovered agent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join}from"node:path";import{readFile,rename,writeFile}from"node:fs/promises";import{applyModelNameToSource}from"#source-change/apply-model-name.js";function createStaticSourceChange(e){return{updateModelName:t=>updateAgentModelName(e,t)}}async function updateAgentModelName(n,r){let i=n.configModule;if(i===void 0)return{kind:`bail`,reason:`agent has no agent.ts config module to edit`,at:{logicalPath:`agent.ts`,line:1}};let a=join(n.agentRoot,i.logicalPath),
|
|
1
|
+
import{join}from"node:path";import{readFile,rename,writeFile}from"node:fs/promises";import{checkAgentConfigSource}from"#source-change/agent-config-string-path.js";import{applyAgentModelSettingsToSource}from"#source-change/apply-agent-model-settings.js";import{applyModelNameToSource}from"#source-change/apply-model-name.js";function createStaticSourceChange(e){return{updateModelName:t=>updateAgentModelName(e,t),updateModelSettings:t=>updateAgentModelSettings(e,t)}}async function updateAgentModelSettings(n,r){let i=n.configModule;if(i===void 0)return{kind:`bail`,reason:`agent has no agent.ts config module to edit`,at:{logicalPath:`agent.ts`,line:1}};let o=join(n.agentRoot,i.logicalPath),s=await readFile(o,`utf8`),c=await applyAgentModelSettingsToSource(s,r);if(c.kind===`bail`)return{kind:`bail`,reason:c.reason,at:{logicalPath:i.logicalPath,line:c.line}};let l=await editedSourceBail(s,c.nextSource,i.logicalPath);return l===void 0?(await writeSourceIfChanged(o,s,c.nextSource),{kind:`applied`,changed:c.changed}):l}async function updateAgentModelName(n,r){let i=n.configModule;if(i===void 0)return{kind:`bail`,reason:`agent has no agent.ts config module to edit`,at:{logicalPath:`agent.ts`,line:1}};let a=join(n.agentRoot,i.logicalPath),s=await readFile(a,`utf8`),c=await applyModelNameToSource(s,r);if(c.kind===`bail`)return{kind:`bail`,reason:c.reason,at:{logicalPath:i.logicalPath,line:c.line}};let l=await editedSourceBail(s,c.nextSource,i.logicalPath);return l===void 0?(await writeSourceIfChanged(a,s,c.nextSource),{kind:`applied`,from:c.from,to:c.to}):l}async function writeSourceIfChanged(e,t,i){if(i===t)return;let a=`${e}.${process.pid}.eve-tmp`;await writeFile(a,i,`utf8`),await rename(a,e)}async function editedSourceBail(e,t,n){if(t===e)return;let r=await checkAgentConfigSource(t);if(r!==void 0)return{kind:`bail`,reason:`the edit produced source eve refuses to write (${r})`,at:{logicalPath:n,line:1}}}export{createStaticSourceChange};
|
package/dist/src/svelte/index.js
CHANGED
|
@@ -80,12 +80,6 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
80
80
|
readonly initialEvents?: readonly HandleMessageStreamEvent[];
|
|
81
81
|
/** Seed session identity and stream cursor for resuming a prior conversation. */
|
|
82
82
|
readonly initialSession?: SessionState;
|
|
83
|
-
/**
|
|
84
|
-
* Maximum number of stream reconnection attempts per turn.
|
|
85
|
-
*
|
|
86
|
-
* @default 3
|
|
87
|
-
*/
|
|
88
|
-
readonly maxReconnectAttempts?: number;
|
|
89
83
|
/**
|
|
90
84
|
* Project submitted user messages before eve confirms them with a
|
|
91
85
|
* `message.received` stream event. Optimistic events are reducer-facing
|
package/dist/src/vue/index.js
CHANGED
|
@@ -79,8 +79,6 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
79
79
|
readonly initialEvents?: readonly HandleMessageStreamEvent[];
|
|
80
80
|
/** Prior session cursor to resume from on mount. */
|
|
81
81
|
readonly initialSession?: SessionState;
|
|
82
|
-
/** Maximum SSE reconnection attempts per turn. @default 3 */
|
|
83
|
-
readonly maxReconnectAttempts?: number;
|
|
84
82
|
/**
|
|
85
83
|
* Project submitted user messages before eve confirms them with a
|
|
86
84
|
* `message.received` stream event.
|
|
@@ -36,7 +36,7 @@ export default defineAgent({
|
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
The world package backs workflow state, queues, hooks, and streams. Keep secrets and deployment-specific options in runtime environment variables read by that package, not in `agent.ts`. Custom worlds must implement the runtime protocol expected by eve's vendored `@workflow/*` packages (currently the `5.0.0-beta` line); the Workflow SDK rejects incompatible protocol versions during initialization. See
|
|
39
|
+
The world package backs workflow state, queues, hooks, and streams. Keep secrets and deployment-specific options in runtime environment variables read by that package, not in `agent.ts`. Custom worlds must implement the runtime protocol expected by eve's vendored `@workflow/*` packages (currently the `5.0.0-beta` line); the Workflow SDK rejects incompatible protocol versions during initialization. See [Self-host eve](../guides/deployment/self-hosting#persist-workflow-state), [agent.ts](../agent-config#workflow-world), and [Workflow Worlds](https://workflow-sdk.dev/worlds).
|
|
40
40
|
|
|
41
41
|
## Resuming after a crash
|
|
42
42
|
|
|
@@ -110,7 +110,7 @@ Custom channel routes request the same cancellation without knowing the session
|
|
|
110
110
|
|
|
111
111
|
## Reconnect and rewind
|
|
112
112
|
|
|
113
|
-
The stream is durable. Every event is recorded before a step completes, so
|
|
113
|
+
The stream is durable. Every event is recorded before a step completes, so consumers can reconnect from their cursor when an HTTP connection ends. 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.
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
116
|
curl "http://127.0.0.1:3000/eve/v1/session/<sessionId>/stream?startIndex=<count>"
|
package/docs/getting-started.mdx
CHANGED
|
@@ -130,7 +130,7 @@ Other commands the eve binary provides (prefix each with `npx`, or add a matchin
|
|
|
130
130
|
|
|
131
131
|
In the dev TUI, type a message and watch it happen in order. First the `get_weather` call, then its result, then the reply.
|
|
132
132
|
|
|
133
|
-
The same CLI can point at a deployment. `npx eve dev https://your-app.vercel.app` drives a deployed app, which is handy for preview and production smoke tests. See [Deployment](./guides/deployment).
|
|
133
|
+
The same CLI can point at a deployment. `npx eve dev https://your-app.vercel.app` drives a deployed app, which is handy for preview and production smoke tests. See [Deployment](./guides/deployment/overview).
|
|
134
134
|
|
|
135
135
|
## Send a message
|
|
136
136
|
|
|
@@ -373,4 +373,4 @@ Inline providers derive a stable tool-qualified auth key from Vercel Connect met
|
|
|
373
373
|
|
|
374
374
|
- [Security model](../concepts/security-model): trust boundaries and the pre-production checklist
|
|
375
375
|
- [Connections](../connections): connection auth shapes (`connect()` vs static token)
|
|
376
|
-
- [Deployment](./deployment): where route-auth secrets live in production
|
|
376
|
+
- [Deployment](./deployment/overview): where route-auth secrets live in production
|
|
@@ -9,7 +9,7 @@ For browser chat UIs, start with [`useEveAgent`](../frontend/overview). For wire
|
|
|
9
9
|
|
|
10
10
|
## Create a client
|
|
11
11
|
|
|
12
|
-
A `Client` binds one host, auth policy, header policy
|
|
12
|
+
A `Client` binds one host, auth policy, and header policy:
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
15
|
import { Client } from "eve/client";
|
|
@@ -103,16 +103,7 @@ If you support refresh while an authorization prompt is pending, keep the sessio
|
|
|
103
103
|
|
|
104
104
|
## Reconnection
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
const client = new Client({
|
|
110
|
-
host: "https://agent.example.com",
|
|
111
|
-
maxReconnectAttempts: 5,
|
|
112
|
-
});
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
`maxReconnectAttempts` is per turn. The default is `3`.
|
|
106
|
+
HTTP connections can end before a run does. The client reconnects from the number of events already consumed, so long turns continue without replaying events. It stops at a turn boundary, when aborted, or when the stream can no longer make progress.
|
|
116
107
|
|
|
117
108
|
## Open a stream manually
|
|
118
109
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Overview"
|
|
3
|
+
description: "Choose a deployment strategy and prepare an eve agent for production."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Deploy eve to Vercel or run it as a Node service on your own infrastructure. Your deployment strategy determines the build output, workflow storage, sandbox backend, and routing. The agent’s filesystem-based configuration remains portable across these strategies.
|
|
7
|
+
|
|
8
|
+
## Choose a deployment strategy
|
|
9
|
+
|
|
10
|
+
Choose where the eve runtime will run:
|
|
11
|
+
|
|
12
|
+
| Strategy | Build output | Workflows | Sandbox | Choose it when |
|
|
13
|
+
| ------------------------------ | ---------------------- | ------------------------------ | ------------------------------- | ----------------------------------------------------- |
|
|
14
|
+
| [Vercel](./vercel) | `.vercel/output` | Vercel Workflow | Vercel Sandbox | You want Vercel to operate the runtime services |
|
|
15
|
+
| [Self-hosting](./self-hosting) | `.output/` Node server | Local or custom Workflow world | Docker, microsandbox, or custom | You operate your own Node or container infrastructure |
|
|
16
|
+
|
|
17
|
+
eve is frontend agnostic and can be deployed within Next.js, Nuxt, or SvelteKit applications. See [Frontend integrations](../frontend/overview) for more details.
|
|
18
|
+
|
|
19
|
+
## Prepare for production
|
|
20
|
+
|
|
21
|
+
Every production deployment must satisfy the same runtime requirements:
|
|
22
|
+
|
|
23
|
+
1. Run `eve build` to compile the agent and create host output.
|
|
24
|
+
2. Provide a model credential and any secrets required by tools, connections, and route authentication.
|
|
25
|
+
3. Replace `placeholderAuth()` with a production route policy before accepting browser traffic.
|
|
26
|
+
4. Select workflow and sandbox implementations that match the host.
|
|
27
|
+
5. Verify the health route and complete a real agent turn.
|
|
28
|
+
|
|
29
|
+
`eve build` always writes compiler artifacts under `.eve/`. A Vercel build also writes `.vercel/output`. A build for another host writes the standard Nitro server under `.output/`.
|
|
30
|
+
|
|
31
|
+
## Configure credentials
|
|
32
|
+
|
|
33
|
+
Keep credentials in your deployment environment or secret manager. Don’t include them in source or compiled artifacts.
|
|
34
|
+
|
|
35
|
+
Your model configuration determines the required credential. A string model ID uses the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) and requires Vercel project OpenID Connect (OIDC) or `AI_GATEWAY_API_KEY`. A provider-authored model uses that provider’s package and API key. See [Agent configuration](../../agent-config#set-the-model) for both forms.
|
|
36
|
+
|
|
37
|
+
Configure production route authentication separately from model access. The default policy rejects browser traffic in production. See [Auth and route protection](../auth-and-route-protection) for the available policies and secret requirements.
|
|
38
|
+
|
|
39
|
+
## Verify the deployment
|
|
40
|
+
|
|
41
|
+
Check the public health route first:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl https://your_agent.example.com/eve/v1/health
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then connect the development terminal user interface (TUI) to the deployment and send a real message:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
eve dev https://your_agent.example.com
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Set `VERCEL_AUTOMATION_BYPASS_SECRET` locally first if a Vercel deployment uses Deployment Protection.
|
|
54
|
+
|
|
55
|
+
## Continue with a platform guide
|
|
56
|
+
|
|
57
|
+
Follow the guide for your deployment platform or application topology:
|
|
58
|
+
|
|
59
|
+
- [Deploy to Vercel](./vercel): use Vercel Build Output, Workflow, Sandbox, Cron, and observability
|
|
60
|
+
- [Self-host eve](./self-hosting): run the Nitro Node server with infrastructure you manage
|
|
61
|
+
- [Frontend integrations](../frontend/overview): mount eve alongside Next.js, Nuxt, or SvelteKit
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Self-host eve"
|
|
3
|
+
description: "Run an eve agent as a Node service with your own workflow storage, sandbox backend, and routing."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Self-host eve when you operate a Node service, container platform, or reverse proxy. You run eve’s Nitro server and choose the infrastructure that stores workflows and executes sandbox sessions.
|
|
7
|
+
|
|
8
|
+
## Build and start the Node service
|
|
9
|
+
|
|
10
|
+
Build the agent, then start the generated server:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
eve build
|
|
14
|
+
PORT=3000 eve start --host 0.0.0.0
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The build writes the Nitro server under `.output/`. `eve start` serves that output and accepts either `PORT` or the `--port` flag.
|
|
18
|
+
|
|
19
|
+
Run this process under the same process manager or container platform you use for other Node web services. Configure Transport Layer Security (TLS), scaling, restarts, and log collection in that platform.
|
|
20
|
+
|
|
21
|
+
## Configure model access and route auth
|
|
22
|
+
|
|
23
|
+
Set `AI_GATEWAY_API_KEY` to use a string model ID through the Vercel AI Gateway from a non-Vercel host. To call a provider directly, install its [AI SDK provider package](https://ai-sdk.dev/docs/foundations/providers-and-models). Then pass its model object in `agent.ts` and set its API key. See [Agent configuration](../../agent-config#set-the-model) for examples.
|
|
24
|
+
|
|
25
|
+
Don’t rely on `vercelOidc()` as the only production authenticator outside Vercel. Configure Basic auth, JSON Web Token (JWT) verification, generic OpenID Connect (OIDC), or a custom verifier that your host can validate. See [Auth and route protection](../auth-and-route-protection).
|
|
26
|
+
|
|
27
|
+
## Persist workflow state
|
|
28
|
+
|
|
29
|
+
The default local Workflow world stores run state under `.eve/.workflow-data`. Mount that directory on persistent storage so runs survive process and container replacement.
|
|
30
|
+
|
|
31
|
+
You can instead select an installed Workflow world package in the root `agent.ts`:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { defineAgent } from "eve";
|
|
35
|
+
|
|
36
|
+
export default defineAgent({
|
|
37
|
+
experimental: {
|
|
38
|
+
workflow: {
|
|
39
|
+
world: "@acme/eve-workflow-world",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The package must export a default factory or `createWorld()` function. Read credentials and host options from runtime environment variables. Install a world built against the same `@workflow/*` line as your eve release. The current line is `5.0.0-beta`, and the runtime rejects incompatible protocol versions.
|
|
46
|
+
|
|
47
|
+
See [Workflow Worlds](https://workflow-sdk.dev/worlds) for the underlying Workflow software development kit (SDK) abstraction.
|
|
48
|
+
|
|
49
|
+
## Select a sandbox backend
|
|
50
|
+
|
|
51
|
+
`defaultBackend()` selects a local sandbox backend in availability order. You can instead select Docker, microsandbox, or a custom `SandboxBackend` adapter for your container, virtual machine, or isolation service.
|
|
52
|
+
|
|
53
|
+
Don’t select `vercel()` unless the self-hosted process should create hosted Vercel sandboxes. See [Sandbox](../../sandbox) for backend configuration and selection order.
|
|
54
|
+
|
|
55
|
+
## Configure proxy routes
|
|
56
|
+
|
|
57
|
+
Forward both runtime route prefixes through your reverse proxy or ingress:
|
|
58
|
+
|
|
59
|
+
- `/eve/` serves health, sessions, streams, channels, tools, and subagents
|
|
60
|
+
- `/.well-known/workflow/` receives workflow callbacks
|
|
61
|
+
|
|
62
|
+
A proxy restricted to `/eve/` lets a session start, but the run stalls when its callback can’t reach eve. Preserve both prefixes without rewriting their paths.
|
|
63
|
+
|
|
64
|
+
## Run schedules
|
|
65
|
+
|
|
66
|
+
The standard `eve build && eve start` path starts Nitro’s schedule runner. If you adapt the output to a custom HTTP-only host or preset, run Nitro scheduled tasks or invoke the same work from your scheduler.
|
|
67
|
+
|
|
68
|
+
## Verify the service
|
|
69
|
+
|
|
70
|
+
Check the health route after your proxy and authentication configuration are active:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
curl https://your_agent.example.com/eve/v1/health
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then connect the development TUI and complete a real turn:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
eve dev https://your_agent.example.com
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Continue configuring production
|
|
83
|
+
|
|
84
|
+
Use these guides to secure and observe the deployed agent:
|
|
85
|
+
|
|
86
|
+
- [Auth and route protection](../auth-and-route-protection): configure the host’s route policy
|
|
87
|
+
- [Observability](../instrumentation): export traces and diagnose runtime failures
|
|
88
|
+
- [Sandbox](../../sandbox): select and secure a sandbox backend
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Deploy to Vercel"
|
|
3
|
+
description: "Deploy an eve agent with Vercel Workflow, Sandbox, Cron, and project credentials."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Deploy eve to Vercel when you want the framework’s managed build and runtime integrations. Vercel runs the web service, workflows, sandboxes, schedules, and deployment observability.
|
|
7
|
+
|
|
8
|
+
## Prepare the Vercel project
|
|
9
|
+
|
|
10
|
+
Link the agent directory to a Vercel project:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
eve link
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The command links an existing project or creates one, then pulls its environment variables. In continuous integration (CI) environments, use the non-interactive Vercel command instead:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
vercel link --project your_project_name --yes --non-interactive
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Configure credentials and auth
|
|
23
|
+
|
|
24
|
+
A string model ID routes requests through the [Vercel AI Gateway](https://vercel.com/docs/ai-gateway). The deployment authenticates through project OpenID Connect (OIDC), so you don’t need a provider API key for that path.
|
|
25
|
+
|
|
26
|
+
Add credentials for direct model providers, tools, and connections to the Vercel project environment. Add any signing keys or passwords required by your [route authentication policy](../auth-and-route-protection). Replace `placeholderAuth()` before a browser sends a production request.
|
|
27
|
+
|
|
28
|
+
## Select the sandbox backend
|
|
29
|
+
|
|
30
|
+
Leave the sandbox `backend` unset to use `defaultBackend()`. On Vercel, it selects Vercel Sandbox. You can also select the backend explicitly:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { defineSandbox } from "eve/sandbox";
|
|
34
|
+
import { vercel } from "eve/sandbox/vercel";
|
|
35
|
+
|
|
36
|
+
export default defineSandbox({
|
|
37
|
+
backend: vercel(),
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
See [Sandbox](../../sandbox) for resource limits, network policy, and lifecycle hooks.
|
|
42
|
+
|
|
43
|
+
<Callout type="info" title="Sandbox prewarming">
|
|
44
|
+
During a Vercel build, eve automatically creates or reuses a sandbox template when your sandbox
|
|
45
|
+
has `bootstrap()` or seed files. The build needs permission to create Vercel Sandbox templates,
|
|
46
|
+
and a prewarm failure stops the deployment. See the [sandbox lifecycle](../../sandbox#lifecycle)
|
|
47
|
+
for template and session setup.
|
|
48
|
+
</Callout>
|
|
49
|
+
|
|
50
|
+
## Deploy the agent
|
|
51
|
+
|
|
52
|
+
Deploy the linked project to production:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
eve deploy
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`eve deploy` installs dependencies, runs `vercel deploy --prod`, and pulls the project environment after deployment. You can also push to a Git-connected Vercel project. Hosted Vercel builds set `VERCEL`, so `eve build` writes the deployment bundle under `.vercel/output`.
|
|
59
|
+
|
|
60
|
+
Vercel uses the generated output to configure these services:
|
|
61
|
+
|
|
62
|
+
- **Web runtime**: serves health, session, stream, channel, callback, and schedule routes
|
|
63
|
+
- **Vercel Workflow**: persists and resumes durable runs
|
|
64
|
+
- **Vercel Cron**: invokes authored schedules
|
|
65
|
+
- **Vercel Sandbox**: runs sandbox sessions selected by `defaultBackend()`
|
|
66
|
+
|
|
67
|
+
## Verify the deployment
|
|
68
|
+
|
|
69
|
+
Check the health route and connect the development TUI:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
curl https://your_agent.vercel.app/eve/v1/health
|
|
73
|
+
eve dev https://your_agent.vercel.app
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Set `VERCEL_AUTOMATION_BYPASS_SECRET` locally before connecting if the deployment uses Deployment Protection.
|
|
77
|
+
|
|
78
|
+
## Inspect agent runs
|
|
79
|
+
|
|
80
|
+
Vercel detects eve and can add an **Agent Runs** tab under the project’s **Observability** view. Use it to browse sessions and inspect each conversation trace.
|
|
81
|
+
|
|
82
|
+
The Agent Runs tab requires enablement for your Vercel team. Contact your Vercel representative if the tab doesn’t appear. For third-party tracing backends, configure [OpenTelemetry instrumentation](../instrumentation).
|
|
83
|
+
|
|
84
|
+
## Continue configuring production
|
|
85
|
+
|
|
86
|
+
Use these guides to secure and observe the deployed agent:
|
|
87
|
+
|
|
88
|
+
- [Auth and route protection](../auth-and-route-protection): configure who can call the deployed agent
|
|
89
|
+
- [Observability](../instrumentation): export traces and diagnose runtime failures
|
|
90
|
+
- [Sandbox](../../sandbox): configure resources, isolation, and network access
|
package/docs/guides/dev-tui.md
CHANGED
|
@@ -24,7 +24,7 @@ The conversation streams straight into your terminal's normal scrollback, so you
|
|
|
24
24
|
|
|
25
25
|
Each turn renders without boxes. A colored gutter glyph marks who is speaking, tool calls collapse to a one-line summary (`✓ get_weather city="SF" → 73°F`), and a subagent's work is indented beneath its `◆` header. When input is ready, the prompt stays bare until you type. A green circle-dot pulses while the agent is waiting to answer and disappears when reasoning or answer content begins.
|
|
26
26
|
|
|
27
|
-
A persistent line beneath the prompt or status shows the model
|
|
27
|
+
A persistent line beneath the prompt or status shows the model — with its authored reasoning level and a `↯` marker when the Gateway priority tier is on (`xai/grok-4.5@xhigh ↯`) — the linked Vercel project, and a yellow `/deploy pending` marker once a channel added this session still needs `/deploy`. The Vercel segment stays hidden until the directory is linked. Local sessions lead with a gray `:port` badge. Remote sessions lead with a padded `↗ project (environment)` badge, or the host when Vercel cannot resolve the deployment. The badge is gray while checking or unavailable, yellow while authentication is required or failed, and blue when connected. Status segments separate with plain whitespace. Remote status lines omit AI Gateway endpoint state.
|
|
28
28
|
|
|
29
29
|
Errors render compactly with docs links highlighted. A code bug escaping your agent's own code shows its stack trace dim beneath the error headline. Dev-server rebuilds condense into one status row that updates in place (`tui/setup-panel.ts changed · rebuilding…`, then `· rebuilt`); only the latest rebuild shows, and paths shrink to their last two components.
|
|
30
30
|
|
|
@@ -49,9 +49,9 @@ Each command echoes as an invocation line, asks through a bordered panel that ta
|
|
|
49
49
|
|
|
50
50
|
### Configure the model and provider
|
|
51
51
|
|
|
52
|
-
Bare `/model` opens the configure menu. When no provider is configured, it opens the provider picker directly and Esc returns to the configure menu. "Change model"
|
|
52
|
+
Bare `/model` opens the configure menu; its Change model row summarizes the draft (`xai/grok-4.5@high ↯`). When no provider is configured, it opens the provider picker directly and Esc returns to the configure menu. "Change model" opens a value menu — **Model**, **Reasoning effort** (a `●─◉─○` track beside the drafted level), **Service tier** (`fast ↯` or `normal`), and **Done**. Reasoning and tier adjust in place: `←`/`→` (Tab acts as `→`) move the highlighted row's value as a ring — past the top wraps to the bottom and vice versa — sliding the reasoning track over the model's supported effort levels or flipping the tier. An unset reasoning draft shows an empty track; the first `→` enters the ring at the lowest level, `←` at the highest. Picking a model snaps a drafted level the new model cannot serve to its closest supported one, clearing it when the model has no adjustable reasoning. Enter on the Model row opens the searchable Vercel AI Gateway catalog as `▏`-railed model ids, pre-selected on the model the runtime is serving; Esc backs out without changing it. A model with no adjustable reasoning says so on a disabled row, and a model the catalog prices no priority tier for shows no tier row at all. The menu's Done hands the draft to the configure menu, whose own Done commits everything through one atomic edit of your agent's authored source, reporting success only after eve confirms the new id. A completed model or provider change closes the menu and returns its result to the transcript; Done without changes or Esc closes it without one, and Esc notes any discarded draft. `/model <provider/model-id>` applies one directly, skipping the menu.
|
|
53
53
|
|
|
54
|
-
The provider row opens one menu: AI Gateway via a project, AI Gateway via `AI_GATEWAY_API_KEY`, or **Other providers**. The key option becomes a masked input when highlighted. Enter validates it without replacing the menu
|
|
54
|
+
The provider row opens one menu: AI Gateway via a project, AI Gateway via `AI_GATEWAY_API_KEY`, or **Other providers**. The currently-active provider renders checked with its status beneath it ("Linked to **my-project** in team **my-team**", or "`AI_GATEWAY_API_KEY` set in `.env.local`"), and the cursor opens on it with a `↵ change` badge. The key option becomes a masked input on an `⎿` rail when highlighted, with a `↵ validate` badge after it. Enter validates it without replacing the menu — a `▪ validating` badge while it checks, a red `⨯ API key is not valid` badge on rejection; retrying or editing clears that result. With a non-empty key, the first Esc or Ctrl-C clears the input and the second dismisses the menu. An accepted key is saved to `.env.local` and reported as one `AI_GATEWAY_API_KEY set.` line. The project option asks for a Vercel team, opens that team's recent projects with the project named after your agent suggested first (searching the team for it when it is not among the recents), and lets you search all projects for older matches. Vercel links the selected project, eve verifies its project ID, then pulls its environment into `.env.local`. The **Other providers** option shows direct-provider wiring instructions and leaves the existing setup untouched. The dev server reloads env files and refreshes the status bar automatically, with no restart needed.
|
|
55
55
|
|
|
56
56
|
The provider row demands attention (a bold yellow "Configure model access" with a yellow "Not configured" hint that dims when unselected and uses the terminal foreground when selected) until a link or gateway credential is detected, then names the connection afterward (for example "AI Gateway (Linked to my-project in my-team)"). Setup menus mark the cursor row with a padded, filled-arrow inverse label that inherits the row's accent: blue normally and yellow for warning rows. In stacked menus, the selected row's description appears directly beneath that option. The completed command's outcome stays in the transcript after the panel closes. When a turn fails because AI Gateway authentication is missing or stale, the error points you at `/model` directly.
|
|
57
57
|
|
|
@@ -100,6 +100,10 @@ By default, `eve dev` shows `stderr` and keeps stdout and sandbox lines buffered
|
|
|
100
100
|
- `--logs <all|stderr|sandbox|none>` sets the starting mode at launch (default `stderr`).
|
|
101
101
|
- `Ctrl+L` at the idle prompt cycles `none → all → stderr → sandbox → none`.
|
|
102
102
|
|
|
103
|
+
Every captured line, tool failure, workflow error, and eve framework log record also lands in a private per-process diagnostic log under `.eve/logs/`, regardless of the display mode. The file is JSON Lines: each line is one JSON record with `at` and `source` fields (framework log records add `level`, `namespace`, `message`, and `fields`), so it parses with any JSONL tool — `jq -c 'select(.source=="tool")'` — even when a payload spans many stack-trace lines. Long stderr output collapses in the transcript to a one-line summary pointing at the file (the raw text stays available in the `all` mode). Read the logs with `eve logs` — see the [CLI reference](../reference/cli#eve-logs).
|
|
104
|
+
|
|
105
|
+
Each log has a same-named `.dump` sibling — one JSON document with environment diagnostics (eve, Node.js, and Vercel CLI versions, the Vercel CLI path, and the size of the local session store) plus running session stats: prompts, token usage, tool calls by name, and subagent dispatches. `eve logs --dump` prints the dump and the log together as one parseable report to attach when filing an issue.
|
|
106
|
+
|
|
103
107
|
## Display flags
|
|
104
108
|
|
|
105
109
|
Density flags control how much of each section renders. They accept `full`, `collapsed`, `auto-collapsed`, or `hidden`.
|
|
@@ -146,7 +150,7 @@ In a remote session, `/vc:login` first resolves the deployment's Vercel project
|
|
|
146
150
|
|
|
147
151
|
The project-scoped token represents the resolved project's Development environment. Vercel already allows a project's Development environment to call its own Preview deployments by default. For a Production or custom-environment target, `/vc:login` shows the exact Development-to-target rule before changing that project's Trusted Sources. Eve preserves existing entries. When it creates an explicit rule, it also carries Vercel's default self-access rows forward because saved rules replace those defaults. See Vercel's [Trusted Sources guide](https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/trusted-sources), [error reference](https://vercel.com/docs/errors/trusted_sources_environment_mismatch), and [OIDC token anatomy](https://vercel.com/docs/oidc/reference#oidc-token-anatomy).
|
|
148
152
|
|
|
149
|
-
`VERCEL_AUTOMATION_BYPASS_SECRET` remains available for a Protection Bypass for Automation token. See [
|
|
153
|
+
`VERCEL_AUTOMATION_BYPASS_SECRET` remains available for a Protection Bypass for Automation token. See [Deploy to Vercel](./deployment/vercel#verify-the-deployment) for the smoke-test flow.
|
|
150
154
|
|
|
151
155
|
## What to read next
|
|
152
156
|
|
|
@@ -25,6 +25,8 @@ their `defineDynamic` export is a build error.
|
|
|
25
25
|
|
|
26
26
|
Pass `defineDynamic` an `events` object whose handlers return either a single `defineTool(...)`, a `Record<string, defineTool(...)>`, or `null` for no tools. Wrap every entry in `defineTool()`. The wrapper stamps them so their `execute` functions survive workflow step boundaries.
|
|
27
27
|
|
|
28
|
+
Dynamic tool executors receive the same `ToolContext` as static authored tools, including inline provider auth through `ctx.getToken(provider)` and `ctx.requireAuth(provider)`.
|
|
29
|
+
|
|
28
30
|
The example below builds one tool per warehouse table. A map return names each tool by its bare key, so the model sees `orders`, `users`, and so on.
|
|
29
31
|
|
|
30
32
|
```ts title="agent/tools/query.ts"
|
|
@@ -124,4 +124,4 @@ For a public demo, use `none()` (also from `eve/channels/auth`) to skip authenti
|
|
|
124
124
|
|
|
125
125
|
- [Frontend overview](./overview): the `useEveAgent` API
|
|
126
126
|
- [Auth & route protection](../auth-and-route-protection)
|
|
127
|
-
- [Deployment](../deployment)
|
|
127
|
+
- [Deployment](../deployment/overview)
|