eve 0.24.5 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/src/channel/cancel.d.ts +8 -0
- package/dist/src/channel/cancel.js +1 -0
- package/dist/src/channel/routes.d.ts +25 -4
- package/dist/src/channel/session.d.ts +10 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +8 -0
- package/dist/src/chunks/{use-eve-agent-8rerxDHY.js → use-eve-agent-CQIeqmKc.js} +73 -66
- package/dist/src/chunks/{use-eve-agent-DhgdHzDG.js → use-eve-agent-Cy73lgA6.js} +73 -66
- package/dist/src/cli/commands/agent-instructions.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/extension-build.d.ts +1 -1
- package/dist/src/cli/commands/extension-build.js +1 -1
- package/dist/src/client/output-schema.d.ts +0 -7
- package/dist/src/client/output-schema.js +1 -1
- package/dist/src/client/session.d.ts +6 -2
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +56 -0
- package/dist/src/compiler/extension-compatibility.js +1 -0
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/discover/discover-agent.d.ts +29 -7
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/extensions.d.ts +43 -8
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +3 -1
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/named-source-directory.js +1 -1
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/evals/autoevals-client.js +2 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/development-cleanup.d.ts +1 -1
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-run.d.ts +0 -3
- package/dist/src/execution/sandbox/development-run.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +10 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-requests.d.ts +12 -2
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.d.ts +8 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +26 -0
- package/dist/src/harness/stale-input-responses.js +3 -0
- package/dist/src/harness/step-hooks.d.ts +1 -12
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +11 -0
- package/dist/src/harness/tool-call-input-errors.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/workflow-sandbox.d.ts +1 -1
- package/dist/src/harness/workflow-sandbox.js +1 -1
- package/dist/src/internal/application/optional-package-install.d.ts +5 -0
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +17 -0
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.d.ts +8 -0
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +4 -0
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.d.ts +6 -21
- package/dist/src/internal/nitro/host/build-extension.js +2 -4
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.d.ts +18 -0
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -0
- package/dist/src/internal/nitro/host/extension-build-config.d.ts +18 -0
- package/dist/src/internal/nitro/host/extension-build-config.js +1 -0
- package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +10 -0
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -0
- package/dist/src/internal/nitro/host/extension-declarations.d.ts +10 -0
- package/dist/src/internal/nitro/host/extension-declarations.js +2 -0
- package/dist/src/internal/nitro/host/extension-distribution.d.ts +32 -0
- package/dist/src/internal/nitro/host/extension-distribution.js +3 -0
- package/dist/src/internal/nitro/host/extension-state-usage.d.ts +7 -0
- package/dist/src/internal/nitro/host/extension-state-usage.js +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +5 -1
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +2 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/tool.d.ts +2 -2
- package/dist/src/public/tools/internal.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/framework-tools/ask-question.d.ts +23 -9
- package/dist/src/runtime/framework-tools/ask-question.js +1 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +10 -3
- package/dist/src/runtime/framework-tools/bash.js +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -1
- package/dist/src/runtime/framework-tools/final-output.d.ts +1 -1
- package/dist/src/runtime/framework-tools/final-output.js +1 -1
- package/dist/src/runtime/framework-tools/glob.d.ts +12 -3
- package/dist/src/runtime/framework-tools/glob.js +1 -1
- package/dist/src/runtime/framework-tools/grep.d.ts +16 -3
- package/dist/src/runtime/framework-tools/grep.js +1 -1
- package/dist/src/runtime/framework-tools/read-file.d.ts +13 -3
- package/dist/src/runtime/framework-tools/read-file.js +1 -1
- package/dist/src/runtime/framework-tools/skill.d.ts +5 -2
- package/dist/src/runtime/framework-tools/skill.js +1 -1
- package/dist/src/runtime/framework-tools/todo.d.ts +57 -10
- package/dist/src/runtime/framework-tools/todo.js +3 -3
- package/dist/src/runtime/framework-tools/web-fetch.d.ts +16 -3
- package/dist/src/runtime/framework-tools/web-fetch.js +1 -1
- package/dist/src/runtime/framework-tools/write-file.d.ts +9 -3
- package/dist/src/runtime/framework-tools/write-file.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/resolve-tool.d.ts +4 -5
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +6 -3
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +7 -9
- package/dist/src/setup/boxes/deploy-project.d.ts +11 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/extension.js +2 -2
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +1 -0
- package/dist/src/setup/scaffold/update/channels.js +2 -2
- package/dist/src/setup/scaffold/update/connections.js +1 -1
- package/dist/src/setup/vercel-project-framework.d.ts +4 -2
- package/dist/src/shared/extension-package-contract.d.ts +11 -0
- package/dist/src/shared/extension-package-contract.js +1 -0
- package/dist/src/shared/json.d.ts +4 -0
- package/dist/src/shared/json.js +1 -1
- package/dist/src/shared/tool-schema.d.ts +52 -0
- package/dist/src/shared/tool-schema.js +1 -0
- package/dist/src/svelte/index.js +1 -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.js +1 -1
- package/docs/channels/custom.mdx +32 -2
- package/docs/concepts/sessions-runs-and-streaming.md +8 -0
- package/docs/extensions.md +22 -6
- package/docs/reference/cli.md +2 -2
- package/package.json +2 -2
- package/dist/src/internal/json-schema.d.ts +0 -1
- package/dist/src/internal/json-schema.js +0 -1
- package/dist/src/setup/boxes/reconcile-host-framework-preset.d.ts +0 -26
- package/dist/src/setup/boxes/reconcile-host-framework-preset.js +0 -1
- package/dist/src/shared/json-schema.d.ts +0 -9
- package/dist/src/shared/json-schema.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared input schema used by the framework `glob` tool and any author tool
|
|
@@ -8,10 +8,19 @@ import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
|
8
8
|
* `GLOB_TOOL_DEFINITION` use the exact same schema object — keeping model
|
|
9
9
|
* input contracts in sync without duplication.
|
|
10
10
|
*/
|
|
11
|
-
export declare const GLOB_INPUT_SCHEMA:
|
|
11
|
+
export declare const GLOB_INPUT_SCHEMA: z.ZodObject<{
|
|
12
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
path: z.ZodOptional<z.ZodString>;
|
|
14
|
+
pattern: z.ZodString;
|
|
15
|
+
}, z.core.$strict>;
|
|
12
16
|
/**
|
|
13
17
|
* Shared output schema used by the framework `glob` tool and any author tool
|
|
14
18
|
* constructed via {@link defineGlobTool}.
|
|
15
19
|
*/
|
|
16
|
-
export declare const GLOB_OUTPUT_SCHEMA:
|
|
20
|
+
export declare const GLOB_OUTPUT_SCHEMA: z.ZodObject<{
|
|
21
|
+
content: z.ZodString;
|
|
22
|
+
count: z.ZodNumber;
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
truncated: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strict>;
|
|
17
26
|
export declare const GLOB_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeGlobOnSandbox}from"#execution/sandbox/glob-tool.js";const GLOB_INPUT_SCHEMA={
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeGlobOnSandbox}from"#execution/sandbox/glob-tool.js";const GLOB_INPUT_SCHEMA=z.strictObject({limit:z.number().int().min(1).max(1e3).describe(`Maximum number of results to return. Defaults to 100.`).optional(),path:z.string().describe(`The directory to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`).optional(),pattern:z.string().describe(`The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`)}),GLOB_OUTPUT_SCHEMA=z.strictObject({content:z.string(),count:z.number().int(),path:z.string(),truncated:z.boolean()});async function executeGlob(e,t){return executeGlobOnSandbox(await requireSandboxSession(t?.abortSignal),e)}const GLOB_TOOL_DEFINITION={description:[`Fast file pattern matching tool that works with any codebase size.`,``,`Usage:`,`- Supports glob patterns like "**/*.js" or "src/**/*.ts".`,`- Returns matching file paths.`,`- Use this tool when you need to find files by name patterns.`,`- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`,`- Use the grep tool instead if you need to search file contents.`,`- Call this tool in parallel when you know there are multiple patterns to search for.`].join(`
|
|
2
2
|
`),execute:executeGlob,inputSchema:GLOB_INPUT_SCHEMA,logicalPath:`eve:framework/glob`,name:`glob`,outputSchema:GLOB_OUTPUT_SCHEMA,sourceId:`eve:glob-tool`,sourceKind:`module`};export{GLOB_INPUT_SCHEMA,GLOB_OUTPUT_SCHEMA,GLOB_TOOL_DEFINITION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared input schema used by the framework `grep` tool and any author tool
|
|
@@ -8,10 +8,23 @@ import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
|
8
8
|
* `GREP_TOOL_DEFINITION` use the exact same schema object — keeping model
|
|
9
9
|
* input contracts in sync without duplication.
|
|
10
10
|
*/
|
|
11
|
-
export declare const GREP_INPUT_SCHEMA:
|
|
11
|
+
export declare const GREP_INPUT_SCHEMA: z.ZodObject<{
|
|
12
|
+
context: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
glob: z.ZodOptional<z.ZodString>;
|
|
14
|
+
ignoreCase: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
literal: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
path: z.ZodOptional<z.ZodString>;
|
|
18
|
+
pattern: z.ZodString;
|
|
19
|
+
}, z.core.$strict>;
|
|
12
20
|
/**
|
|
13
21
|
* Shared output schema used by the framework `grep` tool and any author tool
|
|
14
22
|
* constructed via {@link defineGrepTool}.
|
|
15
23
|
*/
|
|
16
|
-
export declare const GREP_OUTPUT_SCHEMA:
|
|
24
|
+
export declare const GREP_OUTPUT_SCHEMA: z.ZodObject<{
|
|
25
|
+
content: z.ZodString;
|
|
26
|
+
matchCount: z.ZodNumber;
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
truncated: z.ZodBoolean;
|
|
29
|
+
}, z.core.$strict>;
|
|
17
30
|
export declare const GREP_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeGrepOnSandbox}from"#execution/sandbox/grep-tool.js";const GREP_INPUT_SCHEMA={
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeGrepOnSandbox}from"#execution/sandbox/grep-tool.js";const GREP_INPUT_SCHEMA=z.strictObject({context:z.number().int().min(0).describe(`Number of surrounding context lines to include before and after each match. Defaults to 0.`).optional(),glob:z.string().describe(`Filter files by glob pattern (e.g. "*.ts", "*.{ts,tsx}").`).optional(),ignoreCase:z.boolean().describe(`Perform case-insensitive search. Defaults to false.`).optional(),limit:z.number().int().min(1).max(1e3).describe(`Maximum number of matches to return per file. Defaults to 100.`).optional(),literal:z.boolean().describe(`Treat the pattern as a literal string instead of a regular expression. Defaults to false.`).optional(),path:z.string().describe(`The directory or file to search in. Defaults to /workspace. Must be an absolute path. Omit to use the default.`).optional(),pattern:z.string().describe(`The regex pattern to search for in file contents (e.g. "log.*Error", "function\\s+\\w+").`)}),GREP_OUTPUT_SCHEMA=z.strictObject({content:z.string(),matchCount:z.number().int(),path:z.string(),truncated:z.boolean()});async function executeGrep(e,t){return executeGrepOnSandbox(await requireSandboxSession(t?.abortSignal),e)}const GREP_TOOL_DEFINITION={description:[`Fast content search tool that works with any codebase size.`,``,`Usage:`,`- Searches file contents using regular expressions.`,`- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").`,`- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").`,`- Returns matching lines with file paths and line numbers.`,`- Use this tool when you need to find files containing specific patterns.`,`- Use the glob tool instead if you only need to find files by name.`,`- Call this tool in parallel when you have multiple independent searches.`,`- Any line longer than 2000 characters is truncated.`].join(`
|
|
2
2
|
`),execute:executeGrep,inputSchema:GREP_INPUT_SCHEMA,logicalPath:`eve:framework/grep`,name:`grep`,outputSchema:GREP_OUTPUT_SCHEMA,sourceId:`eve:grep-tool`,sourceKind:`module`};export{GREP_INPUT_SCHEMA,GREP_OUTPUT_SCHEMA,GREP_TOOL_DEFINITION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared input schema used by the framework `read_file` tool and any author
|
|
@@ -8,10 +8,20 @@ import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
|
8
8
|
* `READ_FILE_TOOL_DEFINITION` use the exact same schema object — keeping
|
|
9
9
|
* model input contracts in sync without duplication.
|
|
10
10
|
*/
|
|
11
|
-
export declare const READ_FILE_INPUT_SCHEMA:
|
|
11
|
+
export declare const READ_FILE_INPUT_SCHEMA: z.ZodObject<{
|
|
12
|
+
filePath: z.ZodString;
|
|
13
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strict>;
|
|
12
16
|
/**
|
|
13
17
|
* Shared output schema used by the framework `read_file` tool and any author
|
|
14
18
|
* tool constructed via {@link defineReadFileTool}.
|
|
15
19
|
*/
|
|
16
|
-
export declare const READ_FILE_OUTPUT_SCHEMA:
|
|
20
|
+
export declare const READ_FILE_OUTPUT_SCHEMA: z.ZodObject<{
|
|
21
|
+
content: z.ZodString;
|
|
22
|
+
nextOffset: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
totalLines: z.ZodNumber;
|
|
25
|
+
truncated: z.ZodBoolean;
|
|
26
|
+
}, z.core.$strict>;
|
|
17
27
|
export declare const READ_FILE_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeReadFileOnSandbox}from"#execution/sandbox/read-file-tool.js";const READ_FILE_INPUT_SCHEMA={
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeReadFileOnSandbox}from"#execution/sandbox/read-file-tool.js";const READ_FILE_INPUT_SCHEMA=z.strictObject({filePath:z.string().describe(`The absolute path to the file to read.`),limit:z.number().int().min(1).describe(`Maximum number of lines to return. Defaults to 2000.`).optional(),offset:z.number().int().min(1).describe(`1-based line number to start from. Defaults to 1.`).optional()}),READ_FILE_OUTPUT_SCHEMA=z.strictObject({content:z.string(),nextOffset:z.number().int().min(1).optional(),path:z.string(),totalLines:z.number().int().min(0),truncated:z.boolean()});async function executeReadFile(e,t){return executeReadFileOnSandbox(await requireSandboxSession(t?.abortSignal),e)}const READ_FILE_TOOL_DEFINITION={description:[`Read a file from the local filesystem. If the path does not exist, an error is returned.`,``,`Usage:`,`- The filePath parameter should be an absolute path.`,`- By default, this tool returns up to 2000 lines from the start of the file.`,`- The offset parameter is the line number to start from (1-indexed).`,`- To read later sections, call this tool again with a larger offset.`,`- Use the grep tool to find specific content in large files or files with long lines.`,`- If you are unsure of the correct file path, use the glob tool to look up filenames by glob pattern.`,'- Contents are returned with each line prefixed by its line number as `<line>: <content>`. For example, if a file has contents "foo\\n", you will receive "1: foo\\n".',`- Any line longer than 2000 characters is truncated.`,`- Call this tool in parallel when you know there are multiple files you want to read.`,`- Avoid tiny repeated slices (30 line chunks). If you need more context, read a larger window.`].join(`
|
|
2
2
|
`),execute:executeReadFile,inputSchema:READ_FILE_INPUT_SCHEMA,logicalPath:`eve:framework/read-file`,name:`read_file`,outputSchema:READ_FILE_OUTPUT_SCHEMA,sourceId:`eve:read-file-tool`,sourceKind:`module`};export{READ_FILE_INPUT_SCHEMA,READ_FILE_OUTPUT_SCHEMA,READ_FILE_TOOL_DEFINITION};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
1
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const SKILL_INPUT_SCHEMA: z.ZodObject<{
|
|
4
|
+
skill: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const SKILL_OUTPUT_SCHEMA: z.ZodString;
|
|
4
7
|
export declare const SKILL_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DynamicSkillManifestKey,SandboxKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{loadSkillFromSandbox}from"#runtime/skills/sandbox-access.js";import{ConnectionRegistryKey}from"#context/providers/connection-key.js";async function executeLoadSkillTool(e){let
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{DynamicSkillManifestKey,SandboxKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{loadSkillFromSandbox}from"#runtime/skills/sandbox-access.js";import{ConnectionRegistryKey}from"#context/providers/connection-key.js";async function executeLoadSkillTool(e){let t=loadContext(),i=t.get(SandboxKey);if(i===void 0)throw Error(`The load_skill tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`);let{skill:a}=e,o=availableSkillNames(t);try{return await loadSkillFromSandbox(i,a,o)}catch(e){let n=t.get(ConnectionRegistryKey)?.getConnectionNames().find(e=>e.toLowerCase()===a.toLowerCase());if(n===void 0||o.includes(a))throw e;let r=e instanceof Error?e.message:String(e);throw Error(`${r} "${n}" is an installed connection, not a skill. Use connection_search with connection "${n}" to find its tools.`,{cause:e})}}function availableSkillNames(e){let n=Object.values(e.get(DynamicSkillManifestKey)??{}).flat().map(e=>e.name);return[...new Set(n)].sort()}const SKILL_INPUT_SCHEMA=z.strictObject({skill:z.string().describe(`Available skill name or id.`)}),SKILL_OUTPUT_SCHEMA=z.string(),SKILL_TOOL_DEFINITION={description:[`Load the full instructions for one available skill by name or id.`,`Use this tool when the request clearly matches a listed skill description or when the user explicitly asks for that skill.`,`This is not for MCP connections; use connection_search to access an installed connection.`,`Loading adds the skill instructions to the current turn.`,`Choose the "skill" value from the Available skills block.`].join(` `),execute:e=>executeLoadSkillTool(e),inputSchema:SKILL_INPUT_SCHEMA,logicalPath:`eve:framework/load-skill`,name:`load_skill`,outputSchema:SKILL_OUTPUT_SCHEMA,sourceId:`eve:load-skill-tool`,sourceKind:`module`};export{SKILL_INPUT_SCHEMA,SKILL_OUTPUT_SCHEMA,SKILL_TOOL_DEFINITION};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { ModelMessage } from "ai";
|
|
2
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
3
|
import { ContextKey } from "#context/key.js";
|
|
3
4
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
4
|
-
import type { JsonObject } from "#shared/json.js";
|
|
5
5
|
/**
|
|
6
6
|
* Single item in the todo list.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
readonly content: string;
|
|
10
|
-
readonly priority: "high" | "medium" | "low";
|
|
11
|
-
readonly status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
12
|
-
}
|
|
8
|
+
export type TodoItem = z.infer<typeof TODO_ITEM_SCHEMA>;
|
|
13
9
|
/**
|
|
14
10
|
* Durable state for the framework todo tool.
|
|
15
11
|
*/
|
|
@@ -23,9 +19,7 @@ export declare const TodoStateKey: ContextKey<TodoState>;
|
|
|
23
19
|
* When `todos` is provided, the list is replaced (full replacement write).
|
|
24
20
|
* When `todos` is omitted, the current list is returned without modification.
|
|
25
21
|
*/
|
|
26
|
-
export
|
|
27
|
-
readonly todos?: readonly TodoItem[];
|
|
28
|
-
}
|
|
22
|
+
export type TodoToolInput = z.infer<typeof TODO_INPUT_SCHEMA>;
|
|
29
23
|
/**
|
|
30
24
|
* Builds the message that re-injects the current todo list after the harness
|
|
31
25
|
* compacts message history, so the agent keeps its task list across
|
|
@@ -42,5 +36,58 @@ export declare function getTodoCompactionMessage(): ModelMessage | undefined;
|
|
|
42
36
|
* the full current state.
|
|
43
37
|
*/
|
|
44
38
|
export declare function executeTodoTool(input: TodoToolInput): unknown;
|
|
45
|
-
|
|
39
|
+
declare const TODO_ITEM_SCHEMA: z.ZodObject<{
|
|
40
|
+
content: z.ZodString;
|
|
41
|
+
priority: z.ZodEnum<{
|
|
42
|
+
high: "high";
|
|
43
|
+
low: "low";
|
|
44
|
+
medium: "medium";
|
|
45
|
+
}>;
|
|
46
|
+
status: z.ZodEnum<{
|
|
47
|
+
cancelled: "cancelled";
|
|
48
|
+
completed: "completed";
|
|
49
|
+
in_progress: "in_progress";
|
|
50
|
+
pending: "pending";
|
|
51
|
+
}>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export declare const TODO_INPUT_SCHEMA: z.ZodObject<{
|
|
54
|
+
todos: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
content: z.ZodString;
|
|
56
|
+
priority: z.ZodEnum<{
|
|
57
|
+
high: "high";
|
|
58
|
+
low: "low";
|
|
59
|
+
medium: "medium";
|
|
60
|
+
}>;
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
cancelled: "cancelled";
|
|
63
|
+
completed: "completed";
|
|
64
|
+
in_progress: "in_progress";
|
|
65
|
+
pending: "pending";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strict>>>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export declare const TODO_OUTPUT_SCHEMA: z.ZodObject<{
|
|
70
|
+
counts: z.ZodObject<{
|
|
71
|
+
cancelled: z.ZodNumber;
|
|
72
|
+
completed: z.ZodNumber;
|
|
73
|
+
in_progress: z.ZodNumber;
|
|
74
|
+
pending: z.ZodNumber;
|
|
75
|
+
total: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
todos: z.ZodArray<z.ZodObject<{
|
|
78
|
+
content: z.ZodString;
|
|
79
|
+
priority: z.ZodEnum<{
|
|
80
|
+
high: "high";
|
|
81
|
+
low: "low";
|
|
82
|
+
medium: "medium";
|
|
83
|
+
}>;
|
|
84
|
+
status: z.ZodEnum<{
|
|
85
|
+
cancelled: "cancelled";
|
|
86
|
+
completed: "completed";
|
|
87
|
+
in_progress: "in_progress";
|
|
88
|
+
pending: "pending";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
}, z.core.$strict>;
|
|
46
92
|
export declare const TODO_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
93
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const TodoStateKey=new ContextKey(`eve.todo`);function formatTodoSummary(e){return e.items.length===0?void 0:`[Your task list was preserved across context compaction]\n${e.items.map(e=>`- [${e.status===`completed`?`x`:e.status===`cancelled`?`-`:` `}] [${e.priority}] ${e.content}`).join(`
|
|
2
|
-
`)}`}function getTodoCompactionMessage(){let
|
|
3
|
-
`),execute:async e=>executeTodoTool(e??{}),inputSchema:
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const TodoStateKey=new ContextKey(`eve.todo`);function formatTodoSummary(e){return e.items.length===0?void 0:`[Your task list was preserved across context compaction]\n${e.items.map(e=>`- [${e.status===`completed`?`x`:e.status===`cancelled`?`-`:` `}] [${e.priority}] ${e.content}`).join(`
|
|
2
|
+
`)}`}function getTodoCompactionMessage(){let e=loadContext().get(TodoStateKey);if(e===void 0||e.items.length===0)return;let n=formatTodoSummary(e);if(n!==void 0)return{content:n,role:`user`}}function formatTodoResult(e){let{items:t}=e,n={cancelled:0,completed:0,in_progress:0,pending:0,total:t.length};for(let e of t)n[e.status]++;return{counts:n,todos:t}}function executeTodoTool(e){let n=loadContext(),{todos:r}=e??{};if(r!==void 0){let e={items:[...r]};return n.set(TodoStateKey,e),formatTodoResult(e)}return formatTodoResult(n.ensure(TodoStateKey,()=>({items:[]})))}const TODO_ITEM_SCHEMA=z.strictObject({content:z.string().describe(`Brief description of the task.`),priority:z.enum([`high`,`medium`,`low`]).describe(`Priority level of the task.`),status:z.enum([`pending`,`in_progress`,`completed`,`cancelled`]).describe(`Current status of the task.`)}),TODO_INPUT_SCHEMA=z.strictObject({todos:z.array(TODO_ITEM_SCHEMA).describe(`The updated todo list. Omit to read the current list without modifying it.`).optional()}),countSchema=z.number().int().min(0),TODO_OUTPUT_SCHEMA=z.strictObject({counts:z.strictObject({cancelled:countSchema,completed:countSchema,in_progress:countSchema,pending:countSchema,total:countSchema}),todos:z.array(TODO_ITEM_SCHEMA)}),TODO_TOOL_DEFINITION={description:[`Use this tool to create and manage a structured task list for the current session.`,`This helps you track progress, organize complex tasks, and demonstrate thoroughness.`,``,`When to use:`,`- Complex multistep tasks requiring 3 or more distinct steps`,`- When the user provides multiple tasks or a numbered list`,`- After receiving new instructions, to capture requirements`,`- After completing a task, to mark it complete and add follow-ups`,``,`When NOT to use:`,`- Single, straightforward tasks that need no tracking`,`- Purely conversational or informational requests`,``,`Usage:`,"- Call with `todos` to replace the entire list (full replacement write)","- Call without `todos` to read the current list",`- Both return the full current list with status counts`,`- Mark tasks in_progress when you start, completed when done`,`- Only have ONE task in_progress at a time`].join(`
|
|
3
|
+
`),execute:async e=>executeTodoTool(e??{}),inputSchema:TODO_INPUT_SCHEMA,logicalPath:`eve:framework/todo`,name:`todo`,outputSchema:TODO_OUTPUT_SCHEMA,sourceId:`eve:todo-tool`,sourceKind:`module`};export{TODO_INPUT_SCHEMA,TODO_OUTPUT_SCHEMA,TODO_TOOL_DEFINITION,TodoStateKey,executeTodoTool,getTodoCompactionMessage};
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
1
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export declare const WEB_FETCH_INPUT_SCHEMA: z.ZodObject<{
|
|
4
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
html: "html";
|
|
6
|
+
markdown: "markdown";
|
|
7
|
+
text: "text";
|
|
8
|
+
}>>;
|
|
9
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
url: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const WEB_FETCH_OUTPUT_SCHEMA: z.ZodObject<{
|
|
13
|
+
content: z.ZodString;
|
|
14
|
+
contentType: z.ZodString;
|
|
15
|
+
truncated: z.ZodBoolean;
|
|
16
|
+
url: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
5
18
|
export declare const WEB_FETCH_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{executeWebFetchTool}from"#execution/web-fetch/tool.js";async function executeWebFetch(e,t){return executeWebFetchTool(e,{abortSignal:t?.abortSignal})}const WEB_FETCH_INPUT_SCHEMA={
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{executeWebFetchTool}from"#execution/web-fetch/tool.js";async function executeWebFetch(e,t){return executeWebFetchTool(e,{abortSignal:t?.abortSignal})}const WEB_FETCH_INPUT_SCHEMA=z.strictObject({format:z.enum([`markdown`,`text`,`html`]).describe(`The format to return the content in (text, markdown, or html). HTML responses are automatically converted to the requested format. Defaults to "markdown".`).optional(),timeout:z.number().describe(`Optional timeout in seconds. Defaults to 30, max 120.`).optional(),url:z.string().describe(`The fully-formed URL to fetch content from. Must start with http:// or https://.`)}),WEB_FETCH_OUTPUT_SCHEMA=z.strictObject({content:z.string(),contentType:z.string(),truncated:z.boolean(),url:z.string()}),WEB_FETCH_TOOL_DEFINITION={description:[`Fetch a webpage and return its content in the requested format. Use this to retrieve and analyze content from URLs.`,``,`Usage notes:`,`- The URL must be a fully-formed valid URL starting with http:// or https://`,`- HTML responses are automatically converted to markdown or plain text based on the requested format`,`- Format options: "markdown" (default), "text", or "html"`,`- Default timeout is 30 seconds (max 120 seconds)`,`- Maximum response size is 5 MB; content is further capped at the shared tool-output budget (50 KB / 2000 lines)`,`- This tool is read-only and does not modify any files`].join(`
|
|
2
2
|
`),execute:executeWebFetch,inputSchema:WEB_FETCH_INPUT_SCHEMA,logicalPath:`eve:framework/web-fetch`,name:`web_fetch`,outputSchema:WEB_FETCH_OUTPUT_SCHEMA,sourceId:`eve:web-fetch-tool`,sourceKind:`module`};export{WEB_FETCH_INPUT_SCHEMA,WEB_FETCH_OUTPUT_SCHEMA,WEB_FETCH_TOOL_DEFINITION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Shared input schema used by the framework `write_file` tool and any author
|
|
@@ -8,10 +8,16 @@ import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
|
8
8
|
* `WRITE_FILE_TOOL_DEFINITION` use the exact same schema object — keeping
|
|
9
9
|
* model input contracts in sync without duplication.
|
|
10
10
|
*/
|
|
11
|
-
export declare const WRITE_FILE_INPUT_SCHEMA:
|
|
11
|
+
export declare const WRITE_FILE_INPUT_SCHEMA: z.ZodObject<{
|
|
12
|
+
content: z.ZodString;
|
|
13
|
+
filePath: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
12
15
|
/**
|
|
13
16
|
* Shared output schema used by the framework `write_file` tool and any author
|
|
14
17
|
* tool constructed via {@link defineWriteFileTool}.
|
|
15
18
|
*/
|
|
16
|
-
export declare const WRITE_FILE_OUTPUT_SCHEMA:
|
|
19
|
+
export declare const WRITE_FILE_OUTPUT_SCHEMA: z.ZodObject<{
|
|
20
|
+
existed: z.ZodBoolean;
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
}, z.core.$strict>;
|
|
17
23
|
export declare const WRITE_FILE_TOOL_DEFINITION: ResolvedToolDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeWriteFileOnSandbox}from"#execution/sandbox/write-file-tool.js";const WRITE_FILE_INPUT_SCHEMA={
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{requireSandboxSession}from"#execution/sandbox/require-sandbox.js";import{executeWriteFileOnSandbox}from"#execution/sandbox/write-file-tool.js";const WRITE_FILE_INPUT_SCHEMA=z.strictObject({content:z.string().describe(`Complete replacement file contents.`),filePath:z.string().describe(`The absolute path to the file to write (must be absolute, not relative).`)}),WRITE_FILE_OUTPUT_SCHEMA=z.strictObject({existed:z.boolean(),path:z.string()});async function executeWriteFile(e,t){return executeWriteFileOnSandbox(await requireSandboxSession(t?.abortSignal),e)}const WRITE_FILE_TOOL_DEFINITION={description:[`Writes a file to the local filesystem.`,``,`Usage:`,`- This tool will overwrite the existing file if there is one at the provided path.`,`- If this is an existing file, you MUST use the read_file tool first to read the file's contents. This tool will fail if you did not read the file first.`,`- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.`,`- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.`,`- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`].join(`
|
|
2
2
|
`),execute:executeWriteFile,inputSchema:WRITE_FILE_INPUT_SCHEMA,logicalPath:`eve:framework/write-file`,name:`write_file`,outputSchema:WRITE_FILE_OUTPUT_SCHEMA,sourceId:`eve:write-file-tool`,sourceKind:`module`};export{WRITE_FILE_INPUT_SCHEMA,WRITE_FILE_OUTPUT_SCHEMA,WRITE_FILE_TOOL_DEFINITION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{formatValidationError}from"#runtime/validation.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}export{loadCompileMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{
|
|
1
|
+
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{formatValidationError}from"#runtime/validation.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),t)}return parseCompiledManifest(n,t)}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledManifest(a.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(n,r){let i=compiledAgentManifestSchema.safeParse(n);if(!i.success)throw new LoadCompiledManifestError(`Expected "${r}" to contain a valid compiled eve agent manifest. ${formatValidationError(i.error)}`,r);return i.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}export{LoadCompiledManifestError,loadCompiledManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{
|
|
1
|
+
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{formatValidationError}from"#runtime/validation.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(t!==void 0){let e=createFileImportSpecifier(t);try{let n=await import(e);return parseCompiledModuleMap(n.moduleMap??n.default,t)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),t)}}let a=readBundledCompiledArtifacts();if(a!==null)return parseCompiledModuleMap(a.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(n,r){let i=compiledModuleMapSchema.safeParse(n);if(!i.success)throw new LoadCompiledModuleMapError(`Expected "${r}" to export a valid compiled eve module map. ${formatValidationError(i.error)}`,r);return i.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}export{LoadCompiledModuleMapError,loadCompiledModuleMap};
|
|
@@ -5,10 +5,9 @@ import type { ResolvedToolDefinition } from "#runtime/types.js";
|
|
|
5
5
|
* Resolves one compiled authored tool into a runtime-owned definition
|
|
6
6
|
* with live callbacks reattached from the authored module.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* instead of at first tool call.
|
|
8
|
+
* Schema-bearing module exports are retained when they implement the validated
|
|
9
|
+
* runtime contract; serialized schemas from the compiled manifest are
|
|
10
|
+
* otherwise rehydrated into live validators. Optional hooks are reattached
|
|
11
|
+
* from the live module export.
|
|
13
12
|
*/
|
|
14
13
|
export declare function resolveToolDefinition(definition: CompiledToolDefinition, moduleMap: CompiledModuleMap, nodeId: string | undefined): Promise<ResolvedToolDefinition>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectFunction,expectObjectRecord}from"#internal/authored-module.js";import{toErrorMessage}from"#shared/errors.js";import{ResolveAgentError,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{registerDefinitionSource,stampDefinitionKey}from"#public/tool-result-narrowing.js";async function resolveToolDefinition(
|
|
1
|
+
import{expectFunction,expectObjectRecord}from"#internal/authored-module.js";import{toErrorMessage}from"#shared/errors.js";import{isToolSchema,toInputSchema,toOutputSchema}from"#shared/tool-schema.js";import{ResolveAgentError,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{registerDefinitionSource,stampDefinitionKey}from"#public/tool-result-narrowing.js";async function resolveToolDefinition(a,o,s){try{let n=expectObjectRecord(await loadResolvedModuleExport({definition:a,kindLabel:`tool`,moduleMap:o,nodeId:s}),describe(a,`to return an object`)),i={kind:`tool`,logicalPath:a.logicalPath,name:a.name},c=`tool-source:${a.sourceId}`;stampDefinitionKey(n,c),registerDefinitionSource(c,i),registerDefinitionSource(`tool:${n.description}`,i);let l=expectFunction(n.execute,describe(a,`to provide an execute function`)),u=isToolSchema(n.inputSchema)?n.inputSchema:toInputSchema(a.inputSchema),d=isToolSchema(n.outputSchema)?n.outputSchema:toOutputSchema(a.outputSchema);return{description:a.description,execute:l,exportName:a.exportName,inputSchema:u,logicalPath:a.logicalPath,name:a.name,outputSchema:d,sourceId:a.sourceId,sourceKind:`module`,...extractOptionalHooks(n,a)}}catch(e){throw e instanceof ResolveAgentError?e:new ResolveAgentError(`Failed to attach the tool execute function from "${a.logicalPath}": ${toErrorMessage(e)}`,{logicalPath:a.logicalPath,sourceId:a.sourceId})}}function extractOptionalHooks(t,n){let r={};return t.approval!==void 0&&(r.approval=expectFunction(t.approval,describe(n,`to provide an approval function`))),t.toModelOutput!==void 0&&(r.toModelOutput=expectFunction(t.toModelOutput,describe(n,`to provide a toModelOutput function`))),r}function describe(e,t){return`Expected the tool export "${e.exportName??`default`}" from "${e.logicalPath}" ${t}.`}export{resolveToolDefinition};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "#compiled/zod/index.js";
|
|
2
2
|
import type { PreparedRuntimeDelegationTool } from "#runtime/sessions/turn.js";
|
|
3
3
|
import type { ResolvedRuntimeDelegationNode } from "#runtime/types.js";
|
|
4
4
|
/**
|
|
@@ -17,10 +17,13 @@ export interface RuntimeSubagentRegistry {
|
|
|
17
17
|
readonly subagentsByNodeId: ReadonlyMap<string, RuntimeRegisteredSubagent>;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Stable
|
|
20
|
+
* Stable input schema lowered onto every subagent tool. Subagents always
|
|
21
21
|
* accept one free-form `message` string from the parent agent.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SUBAGENT_TOOL_INPUT_SCHEMA:
|
|
23
|
+
export declare const SUBAGENT_TOOL_INPUT_SCHEMA: z.ZodObject<{
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
outputSchema: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
26
|
+
}, z.core.$strict>;
|
|
24
27
|
/**
|
|
25
28
|
* Builds the runtime-owned registry for the resolved subagents visible from one
|
|
26
29
|
* runtime agent node.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RuntimeRegistry,RuntimeRegistryError}from"#internal/runtime-registry.js";const SUBAGENT_TOOL_INPUT_SCHEMA=
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{serializeInputSchema}from"#shared/tool-schema.js";import{RuntimeRegistry,RuntimeRegistryError}from"#internal/runtime-registry.js";const SUBAGENT_TOOL_INPUT_SCHEMA=z.strictObject({message:z.string().describe(`The message to send to the subagent. Provide all context the subagent needs to complete the task; the subagent does not see the parent's history.`),outputSchema:z.looseObject({}).describe(`Only provide a non-empty JSON Schema when the caller explicitly requests structured output; otherwise omit this field. The subagent must match a provided schema, and that structured output becomes the tool result.`).optional()}),SUBAGENT_TOOL_INPUT_JSON_SCHEMA=serializeInputSchema(SUBAGENT_TOOL_INPUT_SCHEMA);function createRuntimeSubagentRegistry(e){let t=[],r=new RuntimeRegistry(`subagent`,e.reservedToolNames??[]),i=new Map;for(let n of e.subagents){let e={logicalPath:n.logicalPath,sourceId:n.sourceId};if(i.has(n.nodeId))throw new RuntimeRegistryError(`subagent`,`Found multiple runtime subagents mapped to node id "${n.nodeId}".`,{...e,entryName:n.name});let a=createPreparedRuntimeSubagentTool(n),o={definition:n,prepared:a};r.register(n.name,o,{location:e,duplicateMessage:`Found multiple subagents named "${n.name}". Subagent names must be unique at runtime.`,reservedMessage:`Subagent "${n.name}" collides with another runtime-visible tool name.`}),t.push(a),i.set(n.nodeId,o)}return{preparedTools:t,subagentsByName:r.asMap(),subagentsByNodeId:i}}function createPreparedRuntimeSubagentTool(e){return{description:e.description,inputSchema:SUBAGENT_TOOL_INPUT_JSON_SCHEMA,kind:e.kind,logicalPath:e.logicalPath,name:e.name,nodeId:e.nodeId,outputSchema:e.kind===`remote`?e.outputSchema:void 0,sourceId:e.sourceId}}export{SUBAGENT_TOOL_INPUT_SCHEMA,createRuntimeSubagentRegistry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RuntimeRegistry}from"#internal/runtime-registry.js";async function createRuntimeToolRegistry(t
|
|
1
|
+
import{serializeInputSchema,serializeOutputSchema}from"#shared/tool-schema.js";import{RuntimeRegistry}from"#internal/runtime-registry.js";async function createRuntimeToolRegistry(e,t={}){let r=[],i=new RuntimeRegistry(`tool`,t.reservedToolNames??[]);for(let t of e.tools){let e=await createPreparedRuntimeTool(t);i.register(t.name,{definition:t,prepared:e},{location:{logicalPath:t.logicalPath,sourceId:t.sourceId},duplicateMessage:`Found multiple authored tools named "${t.name}". Tool names must be unique at runtime.`,reservedMessage:`Tool "${t.name}" collides with another runtime-visible tool name.`}),r.push(e)}return{preparedTools:r,toolsByName:i.asMap()}}function findRegisteredRuntimeTool(e,t){return e.toolsByName.get(t)??null}async function createPreparedRuntimeTool(n){return{description:n.description,inputSchema:serializeInputSchema(n.inputSchema),kind:`authored-tool`,logicalPath:n.logicalPath,name:n.name,outputSchema:serializeOutputSchema(n.outputSchema),sourceId:n.sourceId}}export{createRuntimeToolRegistry,findRegisteredRuntimeTool};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { FlexibleSchema } from "ai";
|
|
2
1
|
import type { ChannelAdapter } from "#channel/adapter.js";
|
|
3
2
|
import type { CompiledChannel } from "#channel/compiled-channel.js";
|
|
4
3
|
import type { NormalizedChannelCorsOptions } from "#channel/cors.js";
|
|
@@ -25,6 +24,7 @@ import type { RuntimeDynamicModelReference } from "#runtime/agent/bootstrap.js";
|
|
|
25
24
|
import type { InternalToolDefinitionWithExecuteFn } from "#shared/tool-definition.js";
|
|
26
25
|
import type { SandboxBackend } from "#shared/sandbox-backend.js";
|
|
27
26
|
import type { SandboxBootstrapContext, SandboxSessionContext } from "#shared/sandbox-definition.js";
|
|
27
|
+
import type { ToolSchema } from "#shared/tool-schema.js";
|
|
28
28
|
/**
|
|
29
29
|
* Runtime-owned source ref describing one additive config module import.
|
|
30
30
|
*/
|
|
@@ -124,18 +124,16 @@ export type ResolvedSandboxDefinition = ResolvedModuleSourceRef & {
|
|
|
124
124
|
* declared by the framework catalog.
|
|
125
125
|
* A tool without `execute` is surfaced to the client and never executed by eve.
|
|
126
126
|
*/
|
|
127
|
-
export type ResolvedToolDefinition = Readonly<Optional<InternalToolDefinitionWithExecuteFn<unknown, unknown>, "execute">> & ResolvedModuleSourceRef & {
|
|
127
|
+
export type ResolvedToolDefinition = Readonly<Omit<Optional<InternalToolDefinitionWithExecuteFn<unknown, unknown>, "execute">, "inputSchema" | "outputSchema">> & ResolvedModuleSourceRef & {
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* extraction and runtime validation with transforms/defaults.
|
|
129
|
+
* Validated runtime input schema. Compiled and durable JSON Schemas are
|
|
130
|
+
* rehydrated before entering this runtime-owned definition.
|
|
132
131
|
*/
|
|
133
|
-
readonly
|
|
132
|
+
readonly inputSchema: ToolSchema | null;
|
|
134
133
|
/**
|
|
135
|
-
* Optional
|
|
136
|
-
* resolve time for tool output typing/validation.
|
|
134
|
+
* Optional validated runtime output schema.
|
|
137
135
|
*/
|
|
138
|
-
readonly
|
|
136
|
+
readonly outputSchema?: ToolSchema;
|
|
139
137
|
/**
|
|
140
138
|
* Optional per-tool approval gate. When set, determines whether user
|
|
141
139
|
* approval is required before executing this tool. See
|
|
@@ -5,12 +5,14 @@ import { runVercel } from "#setup/primitives/run-vercel.js";
|
|
|
5
5
|
import { detectDeployment, type ProjectResolution } from "../project-resolution.js";
|
|
6
6
|
import { type SetupState } from "../state.js";
|
|
7
7
|
import type { SetupBox } from "../step.js";
|
|
8
|
+
import { syncHostFrameworkPreset } from "../vercel-project-framework.js";
|
|
8
9
|
/** Injected for tests; defaults to the real subprocess primitives. */
|
|
9
10
|
export interface DeployProjectDeps {
|
|
10
11
|
runVercel: typeof runVercel;
|
|
11
12
|
detectPackageManager: typeof detectPackageManager;
|
|
12
13
|
runPackageManagerInstall: typeof runPackageManagerInstall;
|
|
13
14
|
detectDeployment: typeof detectDeployment;
|
|
15
|
+
syncHostFrameworkPreset: typeof syncHostFrameworkPreset;
|
|
14
16
|
}
|
|
15
17
|
export interface DeployProjectOptions {
|
|
16
18
|
/** Deploy progress and command output stream through this log (rail styling preserved). */
|
|
@@ -51,12 +53,20 @@ export interface DeployProjectPayload {
|
|
|
51
53
|
/**
|
|
52
54
|
* THE DEPLOY BOX. Owns the post-channel `vercel deploy --prod` once channel
|
|
53
55
|
* setup has marked deployment work pending: dependency install (once per
|
|
54
|
-
* state), the
|
|
56
|
+
* state), aligning the Vercel Framework Preset with the host framework on disk,
|
|
57
|
+
* the production deploy, the env pull, and the deployment probe.
|
|
55
58
|
*
|
|
56
59
|
* The project was linked up front by the link box, so `perform` reuses
|
|
57
60
|
* `state.project` and never triggers a second interactive `vercel link` (the
|
|
58
61
|
* #1020 deadlock). When no resolution exists (no link box ran, e.g. the
|
|
59
62
|
* `eve channels add` composition), it falls back to the interactive bare
|
|
60
63
|
* `vercel link`, or throws {@link HumanActionRequiredError} headlessly.
|
|
64
|
+
*
|
|
65
|
+
* Once the project is linked, {@link syncHostFrameworkPreset} runs before the
|
|
66
|
+
* deploy so a project that gained a host framework (e.g. a web channel) builds
|
|
67
|
+
* the host app instead of the stale `eve` agent preset. It is a no-op for a
|
|
68
|
+
* plain agent (no host framework on disk) or an already-correct preset, so
|
|
69
|
+
* every deploy surface — `eve channels add`, the dev TUI `/deploy`, onboarding —
|
|
70
|
+
* gets the reconcile without composing a separate box.
|
|
61
71
|
*/
|
|
62
72
|
export declare function deployProject(options: DeployProjectOptions): SetupBox<SetupState, DeployProjectInput, DeployProjectPayload>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployResult,projectResolutionFromDeployment}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const VERCEL_DEPLOY_ENV={VERCEL_USE_EXPERIMENTAL_FRAMEWORKS:`1`};function deployProject(
|
|
1
|
+
import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployResult,projectResolutionFromDeployment}from"../project-resolution.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{syncHostFrameworkPreset}from"../vercel-project-framework.js";import{detectPackageManager}from"#setup/package-manager.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";import{runVercel}from"#setup/primitives/run-vercel.js";const VERCEL_DEPLOY_ENV={VERCEL_USE_EXPERIMENTAL_FRAMEWORKS:`1`};function deployProject(s){let c=s.deps??{runVercel,detectPackageManager,runPackageManagerInstall,detectDeployment,syncHostFrameworkPreset};return{id:`deploy-project`,shouldRun(e){return s.skip||!e.deploymentPending?!1:hasVercelProject(e)||s.ensureLinkedProject===`interactive-vercel-link`},async gather(){return{headless:s.headless??!1}},async perform({state:e,input:n,signal:r}){let i=requireProjectPath(e),{log:a}=s.prompter,o=createPromptCommandOutput(a),l=e.project;if(!isProjectResolved(l)){if(n.headless)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Deployment needs this directory linked to a Vercel project.`});if(a.message(`Linking this directory to a Vercel project before deployment...`),!await c.runVercel([`link`],{cwd:i,signal:r}))throw r?.throwIfAborted(),Error(`Vercel project linking failed. Deployment did not start.`);if(l=mergeProjectResolution(l,projectResolutionFromDeployment(await c.detectDeployment(i,{signal:r}))),!isProjectResolved(l))throw Error(`Vercel project linking failed. Deployment did not start.`)}if(await c.syncHostFrameworkPreset(s.prompter,i,o,r?{signal:r}:{}),!e.deploymentDependenciesInstalled){let e=await c.detectPackageManager(i);if(!await withPhase(a,`Installing project dependencies before deployment (${e.kind} install)...`,()=>c.runPackageManagerInstall(e.kind,i,{onOutput:o,signal:r})))throw r?.throwIfAborted(),Error(`Dependency installation failed. Deployment did not start.`)}let u=n.headless?[`deploy`,`--prod`,`--yes`,`--non-interactive`]:[`deploy`,`--prod`,`--yes`],d=await withPhase(a,`Deploying the agent to Vercel production...`,()=>c.runVercel(u,{cwd:i,extraEnv:VERCEL_DEPLOY_ENV,nonInteractive:n.headless,onOutput:o,signal:r}));if(r?.throwIfAborted(),!d)throw a.error("`vercel deploy --prod` failed. The deploy output above shows the cause; fix it, then run `vercel deploy --prod` to retry."),Error(`Deployment failed after channel setup.`);let f=await withPhase(a,`Pulling Vercel environment variables into .env.local...`,()=>c.runVercel([`env`,`pull`,`--yes`],{cwd:i,nonInteractive:n.headless,onOutput:o,signal:r}));r?.throwIfAborted(),f||a.warning(`Deployment succeeded, but pulling Vercel environment variables did not complete.`);let p=await c.detectDeployment(i,{signal:r}),m=p.state===`deployed`?p.productionUrl:void 0;return m===void 0?a.warning(`Deployment succeeded, but eve could not verify its production URL.`):a.info(`Production URL: ${m}`),{project:projectResolutionFromDeployResult(l,{deployed:!0,productionUrl:m}),deploymentPending:!1,deploymentDependenciesInstalled:!0}},apply(e,t){return{...e,project:t.project,deploymentPending:t.deploymentPending,deploymentDependenciesInstalled:t.deploymentDependenciesInstalled}}}}export{deployProject};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"../update/package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{agentTemplateFiles,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hasDeclaredDependency(e,t){if(!isJsonObject(e))return!1;for(let n of DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function addAgentToProject(i){let a=i.packageManager??`pnpm`,o=join(i.projectRoot,`package.json`);if(!await pathExists(o))throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it has no package.json. Run \`eve init <name>\` to create a new project instead.`);let s=agentTemplateFiles(i.model),c=[];for(let t of Object.keys(s))await pathExists(join(i.projectRoot,t))&&c.push(t);if(c.length===0&&await pathExists(join(i.projectRoot,`agent`))&&c.push(`agent/`),c.length>0)throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it already has: ${c.join(`, `)}.`);let l=resolveEvePackageContract(i.evePackage),u=resolveVersionToken(`aiPackageVersion`,i.aiPackageVersion??`^7.0.26`),d=resolveVersionToken(`connectPackageVersion`,i.connectPackageVersion??`0.
|
|
1
|
+
import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"../update/package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{agentTemplateFiles,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{join}from"node:path";import{readFile}from"node:fs/promises";const DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`];function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hasDeclaredDependency(e,t){if(!isJsonObject(e))return!1;for(let n of DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function addAgentToProject(i){let a=i.packageManager??`pnpm`,o=join(i.projectRoot,`package.json`);if(!await pathExists(o))throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it has no package.json. Run \`eve init <name>\` to create a new project instead.`);let s=agentTemplateFiles(i.model),c=[];for(let t of Object.keys(s))await pathExists(join(i.projectRoot,t))&&c.push(t);if(c.length===0&&await pathExists(join(i.projectRoot,`agent`))&&c.push(`agent/`),c.length>0)throw Error(`Cannot add an eve agent to "${i.projectRoot}" because it already has: ${c.join(`, `)}.`);let l=resolveEvePackageContract(i.evePackage),u=resolveVersionToken(`aiPackageVersion`,i.aiPackageVersion??`^7.0.26`),d=resolveVersionToken(`connectPackageVersion`,i.connectPackageVersion??`0.4.0`),f=resolveVersionToken(`zodPackageVersion`,i.zodPackageVersion??`4.4.3`),p=[];for(let[e,n]of Object.entries(s)){let r=join(i.projectRoot,e);await writeTextFile(r,n),p.push(r)}let m=JSON.parse(await readFile(o,`utf8`)),h={"@vercel/connect":d,ai:u,eve:formatEveDependencySpecifier(l.version),zod:f},g={};for(let[e,t]of Object.entries(h))hasDeclaredDependency(m,e)||(g[e]=t);let _={};Object.keys(g).length>0&&(_.dependencies=g),isPackageManagerWorkspaceMember(a,i.projectRoot)||(_.nodeEngineRequirement=l.nodeEngine);let v=await patchPackageJson(o,_),y=(await patchWorkspaceRootPackageJson(a,i.projectRoot,{aiPackageVersion:u,nodeEngineRequirement:l.nodeEngine})).nodeEngineOverride??v.nodeEngineOverride;return await applyPackageManagerWorkspaceConfiguration({packageManager:a,projectRoot:i.projectRoot}),{filesWritten:p,dependenciesAdded:Object.keys(g).sort(),nodeEngineOverride:y}}export{addAgentToProject};
|
|
@@ -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{DEFAULT_EVE_PACKAGE_CONTRACT,ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{basename,resolve}from"node:path";import{mkdir,readdir}from"node:fs/promises";const ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]);function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).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 packageJsonTemplate(e){return`${JSON.stringify({name:`__EVE_INIT_APP_NAME__`,version:`0.0.0`,type:`module`,eve:{extension:`./extension`},files:[`
|
|
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{DEFAULT_EVE_PACKAGE_CONTRACT,ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX,formatEveDependencySpecifier,resolveEvePackageContract}from"./project.js";import{basename,resolve}from"node:path";import{mkdir,readdir}from"node:fs/promises";const ALLOWED_CREATE_IN_PLACE_ENTRIES=new Set([`.DS_Store`,`.git`,`.gitkeep`,`.hg`]);function renderTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).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 packageJsonTemplate(e){return`${JSON.stringify({name:`__EVE_INIT_APP_NAME__`,version:`0.0.0`,type:`module`,eve:{extension:{source:`./extension`,dist:`./dist/extension`}},files:[`dist`],exports:{".":{types:`./dist/index.d.ts`,default:`./dist/index.mjs`},"./tools":{types:`./dist/tools/index.d.ts`,default:`./dist/tools/index.mjs`}},scripts:{build:`eve extension build`,prepare:`eve extension build`,typecheck:`tsc`},dependencies:{zod:`__EVE_INIT_ZOD_VERSION__`},devDependencies:{"@types/node":`__EVE_INIT_TYPES_NODE_VERSION__`,eve:`__EVE_INIT_PACKAGE_VERSION__`,typescript:`__EVE_INIT_TYPESCRIPT_VERSION__`},peerDependencies:{eve:`*`}},null,2).slice(0,-1)}${e?ROOT_ONLY_PACKAGE_JSON_TEMPLATE_SUFFIX:``}}\n`}function templateFiles(e){return{"extension/extension.ts":`import { defineExtension } from "eve/extension";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export default defineExtension({
|
|
@@ -29,5 +29,5 @@ export default defineExtension({
|
|
|
29
29
|
dist
|
|
30
30
|
.DS_Store
|
|
31
31
|
*.tsbuildinfo
|
|
32
|
-
`,"AGENTS.md":"# eve Extension Package\n\nThis package is an eve extension — a reusable package of tools, connections,\nskills, hooks, and instruction fragments that a consuming agent mounts under\n`agent/extensions/`.\n\nBefore writing code, read the Extensions guide from the installed eve package\ndocs. In most installs, those docs are at `node_modules/eve/docs/extensions.md`.\nIn workspaces or local package installs, resolve the installed `eve` package\nlocation first and read its `docs/extensions.md`. If package docs are\nunavailable, use https://eve.dev/docs/extensions as a fallback.\n\n## Authoring\n\n- Declare the extension in `extension/extension.ts` with `defineExtension` from\n `eve/extension`. Config is optional; read bound values via the handle's\n `.config` in tools and hooks.\n- Add contributions under `extension/` the same way as in an agent:\n `tools/`, `connections/`, `skills/`, `hooks/`, and optional instruction\n fragments. Names come from file paths; the mount supplies the namespace, so\n name tools for what they do (`search`, not `crm_search`).\n- An extension cannot declare `agent.ts`, `sandbox`, `schedules`, or nested\n `extensions/` — those belong to the consuming agent.\n\n## Build and publish\n\n`eve extension build` (wired to `build`/`prepare`)
|
|
32
|
+
`,"AGENTS.md":"# eve Extension Package\n\nThis package is an eve extension — a reusable package of tools, connections,\nskills, hooks, and instruction fragments that a consuming agent mounts under\n`agent/extensions/`.\n\nBefore writing code, read the Extensions guide from the installed eve package\ndocs. In most installs, those docs are at `node_modules/eve/docs/extensions.md`.\nIn workspaces or local package installs, resolve the installed `eve` package\nlocation first and read its `docs/extensions.md`. If package docs are\nunavailable, use https://eve.dev/docs/extensions as a fallback.\n\n## Authoring\n\n- Declare the extension in `extension/extension.ts` with `defineExtension` from\n `eve/extension`. Config is optional; read bound values via the handle's\n `.config` in tools and hooks.\n- Add contributions under `extension/` the same way as in an agent:\n `tools/`, `connections/`, `skills/`, `hooks/`, and optional instruction\n fragments. Names come from file paths; the mount supplies the namespace, so\n name tools for what they do (`search`, not `crm_search`).\n- An extension cannot declare `agent.ts`, `sandbox`, `schedules`, or nested\n `extensions/` — those belong to the consuming agent.\n\n## Build and publish\n\n`eve extension build` (wired to `build`/`prepare`) transforms the complete\nagent-shaped source tree into `dist/extension/`, emits type declarations and a\ncompatibility manifest, and fills the package `exports` map. Ship `dist/` only.\nKeep `eve` as a required wildcard peer so the consumer's eve is the one that runs;\neve validates extension compatibility from the generated manifest.\n","CLAUDE.md":`@AGENTS.md
|
|
33
33
|
`,"package.json":packageJsonTemplate(e)}}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 scaffoldExtensionProject(o){let s=resolve(o.targetDirectory??process.cwd(),o.projectName),c=o.projectName===`.`,l=o.overwriteExisting??!1,u=o.packageManager??`pnpm`,d=resolveEvePackageContract(o.evePackage??DEFAULT_EVE_PACKAGE_CONTRACT),f=pinnedNodeEngineMajor(d.nodeEngine),p=resolve(o.workspaceProbeDirectory??s),m=isPackageManagerWorkspaceMember(u,p);if(c)await assertCanCreateInPlace(s,l);else if(await pathExists(s))throw Error(`Cannot create project because "${s}" already exists.`);let h={appName:basename(s),eveVersion:d.version,zodPackageVersion:resolveVersionToken(`zodPackageVersion`,o.zodPackageVersion??`4.4.3`),typescriptPackageVersion:resolveVersionToken(`typescriptPackageVersion`,o.typescriptPackageVersion??`7.0.2`),nodeTypesVersion:f,nodeEngine:f};await mkdir(s,{recursive:!0});for(let[e,r]of Object.entries(templateFiles(!m))){let i=`${s}/${e}`,a=await pathExists(i);await writeTextFile(i,renderTemplate(r,h),{force:c&&l}),a&&await o.onOverwriteFile?.(i)}return await applyPackageManagerWorkspaceConfiguration({packageManager:u,projectRoot:s,workspaceProbeRoot:p,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),await patchWorkspaceRootPackageJson(u,p,{nodeEngineRequirement:d.nodeEngine,onWorkspaceRootMutation:o.onWorkspaceRootMutation}),s}export{scaffoldExtensionProject};
|