eve 0.22.6 → 0.23.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 +9 -0
- package/dist/src/channel/types.d.ts +1 -1
- package/dist/src/compiled/@workflow/world-vercel/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +0 -1
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +0 -1
- package/dist/src/execution/node-step.d.ts +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/run-session-limits.d.ts +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session.d.ts +0 -1
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/harness/advertised-tools.d.ts +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +1 -0
- package/dist/src/harness/subagent-depth.d.ts +2 -5
- package/dist/src/harness/subagent-depth.js +1 -1
- package/dist/src/harness/types.d.ts +1 -7
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/public/channels/index.d.ts +14 -64
- package/dist/src/public/instrumentation/index.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- 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 +0 -1
- package/dist/src/shared/agent-definition.d.ts +0 -12
- package/docs/agent-config.md +8 -8
- package/docs/channels/custom.mdx +1 -3
- package/docs/concepts/default-harness.md +7 -5
- package/docs/extensions.md +1 -3
- package/docs/guides/dynamic-workflows.md +1 -1
- package/docs/guides/instrumentation.md +1 -1
- package/docs/subagents.mdx +13 -26
- package/package.json +1 -1
- package/dist/src/compiler/channel-instrumentation-types.d.ts +0 -8
- package/dist/src/compiler/channel-instrumentation-types.js +0 -2
package/docs/subagents.mdx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Subagents"
|
|
3
|
-
description: "Delegate work to
|
|
3
|
+
description: "Delegate work to root-agent copies or declared specialists with their own tools and sandbox."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
eve supports two ways to delegate work: the root-only built-in `agent` tool, which runs a fresh copy of the root agent, and declared subagents, which are specialists with their own directories. Use a subagent to run independent work in parallel, narrow the available tools, or give a task to a specialist.
|
|
7
7
|
|
|
8
8
|
## The built-in `agent` tool
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
The root session receives `agent` by default. The model calls it to delegate a task to a fresh copy of the root agent:
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
13
|
{
|
|
@@ -16,11 +16,13 @@ Every agent gets an `agent` tool by default. The model calls it to delegate a su
|
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The copy
|
|
19
|
+
The copy uses the root's instructions, connections, auth, and sandbox. It receives the same tools except for the root-only `agent` and `Workflow`, and starts with fresh conversation history and fresh state. Its file writes are immediately visible to the root. To run independent tasks in parallel, emit multiple `agent` calls in one response; eve runs the batch concurrently and returns every result before the root continues. Give parallel children non-overlapping write scopes.
|
|
20
|
+
|
|
21
|
+
`agent` is intentionally root-only. Copies created by it cannot call `agent`, and declared subagents never receive the built-in tool. If a stale or forced recursive call reaches execution, eve rejects it instead of starting another child session.
|
|
20
22
|
|
|
21
23
|
The parent transfers data to the child through the `message` input it gives the subagent. Do not include sensitive data in a subagent request unless that child and its inherited tools, connections, sandbox, and telemetry path are appropriate for that data.
|
|
22
24
|
|
|
23
|
-
An authored tool at `agent/tools/agent.ts` takes priority over the built-in.
|
|
25
|
+
An authored root tool at `agent/tools/agent.ts` takes priority over the built-in.
|
|
24
26
|
|
|
25
27
|
## Declared subagents
|
|
26
28
|
|
|
@@ -55,10 +57,10 @@ agent/subagents/researcher/
|
|
|
55
57
|
|
|
56
58
|
A declared subagent inherits nothing from the root's authored slots. Discovery treats its directory as its own agent root, so it has only the instructions, tools, connections, skills, sandbox, hooks, and nested subagents authored under `agent/subagents/<id>/`. An absent slot falls back to the framework default, not to the root's version.
|
|
57
59
|
|
|
58
|
-
| Slot |
|
|
60
|
+
| Slot | Root built-in `agent` tool | Declared subagent |
|
|
59
61
|
| ------------ | ----------------------------- | -------------------------------------- |
|
|
60
62
|
| Instructions | Inherited (copy of the agent) | Own `instructions.{md,ts}`, optional |
|
|
61
|
-
| Tools | Inherited
|
|
63
|
+
| Tools | Inherited except root-only | Own `tools/` |
|
|
62
64
|
| Connections | Inherited | Own `connections/` |
|
|
63
65
|
| Skills | Inherited | Own `skills/` |
|
|
64
66
|
| Sandbox | Shared with parent | Own `sandbox/`, else framework default |
|
|
@@ -69,32 +71,17 @@ A declared subagent inherits nothing from the root's authored slots. Discovery t
|
|
|
69
71
|
|
|
70
72
|
For a declared subagent this means duplicating anything the child needs. When two subagents need the same procedure, copy the markdown under each `skills/` directory, or share typed helpers via `lib/`. The sandbox does not inherit from the parent; it falls back to the framework default unless the subagent authors `subagents/<id>/sandbox.ts` or seeds files via `subagents/<id>/sandbox/workspace/`.
|
|
71
73
|
|
|
72
|
-
The built-in `agent` tool is the exception. Its children share the
|
|
74
|
+
The root built-in `agent` tool is the exception. Its children share the root's sandbox and tools because they are copies of the same agent working on the same files.
|
|
73
75
|
|
|
74
76
|
`defineState` is never shared, for either kind. Each child starts with fresh durable state.
|
|
75
77
|
|
|
76
78
|
## What the parent sees
|
|
77
79
|
|
|
78
|
-
eve lowers every subagent (built-in copy, declared, or [remote](./guides/remote-agents)) into a model-visible tool with the same `{ message, outputSchema? }` shape. The parent packs `message` with everything the child needs, since the child never sees the parent's history. Set `outputSchema` to run the child in task mode, returning structured output as the tool result.
|
|
79
|
-
|
|
80
|
-
Subagent delegation is capped by default at one child-session level. Increase
|
|
81
|
-
or lower that limit with `limits.maxSubagentDepth`:
|
|
82
|
-
|
|
83
|
-
```ts title="agent/agent.ts"
|
|
84
|
-
export default defineAgent({
|
|
85
|
-
model: "anthropic/claude-sonnet-5",
|
|
86
|
-
limits: {
|
|
87
|
-
maxSubagentDepth: 4,
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
The root session is depth 0. With `maxSubagentDepth: 4`, eve may create child sessions
|
|
93
|
-
at depths 1 through 4; a session already at depth 4 cannot delegate again.
|
|
80
|
+
eve lowers every subagent visible to the current agent (the root built-in copy, declared, or [remote](./guides/remote-agents)) into a model-visible tool with the same `{ message, outputSchema? }` shape. The parent packs `message` with everything the child needs, since the child never sees the parent's history. Set `outputSchema` to run the child in task mode, returning structured output as the tool result.
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
Declared subagents can call nested subagents defined under their own directories. eve does not apply a separate depth limit; nesting ends where the authored directory tree ends. The built-in `agent` follows the stricter root-only rule above, so `limits.maxSubagentDepth` no longer exists.
|
|
96
83
|
|
|
97
|
-
`Workflow` is root-only.
|
|
84
|
+
`Workflow` is also root-only. Child sessions can still call their own declared or remote subagents, but they receive neither `Workflow` nor the built-in `agent`. `limits.maxSubagents` separately caps the number of calls made by one Workflow program (default 100); see [Dynamic workflows](./guides/dynamic-workflows).
|
|
98
85
|
|
|
99
86
|
A declared subagent's tool name is the bare path-derived name, with no prefix. `agent/subagents/researcher/` registers as the tool `researcher`. Unlike connection tools (`<connection>__<tool>`), it carries no namespace, so the model, approvals, logs, and evals all reference it by that name. Its input schema is:
|
|
100
87
|
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CompiledAgentManifest } from "#compiler/manifest.js";
|
|
2
|
-
interface ChannelInstrumentationTypesSourceInput {
|
|
3
|
-
readonly manifest: CompiledAgentManifest;
|
|
4
|
-
readonly typesPath: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const CHANNEL_INSTRUMENTATION_TYPES_FILE_NAME = "channel-instrumentation-types.d.ts";
|
|
7
|
-
export declare function createChannelInstrumentationTypesSource(input: ChannelInstrumentationTypesSourceInput): string;
|
|
8
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dirname,join,relative}from"node:path";const CHANNEL_INSTRUMENTATION_TYPES_FILE_NAME=`channel-instrumentation-types.d.ts`;function createChannelInstrumentationTypesSource(e){let t=collectChannelInstrumentationDeclarations(e);return[`// Generated by eve. Do not edit by hand.`,`import type { InferChannelMetadata } from "eve/channels";`,``,`declare module "eve/channels" {`,...t.length===0?[` interface ChannelMetadataMap {}`,` interface ChannelReferenceMap {}`]:[` interface ChannelMetadataMap {`,...t.map(e=>` readonly ${JSON.stringify(e.kind)}: InferChannelMetadata<${renderImportedChannelType(e)}>;`),` }`,` interface ChannelReferenceMap {`,...t.map(e=>` readonly ${JSON.stringify(e.kind)}: ${renderImportedChannelType(e)};`),` }`],`}`,``].join(`
|
|
2
|
-
`)}function collectChannelInstrumentationDeclarations(t){let n=dirname(t.typesPath),r=new Map;for(let e of[...t.manifest.channels].filter(e=>e.kind===`channel`).sort(compareCompiledChannels)){let i=`channel:${e.name}`;r.has(i)||r.set(i,{exportName:e.exportName,importSpecifier:createChannelImportSpecifier({agentRoot:t.manifest.agentRoot,channel:e,fromDirectory:n}),kind:i})}return[...r.values()]}function compareCompiledChannels(e,t){return e.name.localeCompare(t.name)||e.logicalPath.localeCompare(t.logicalPath)||(e.exportName??``).localeCompare(t.exportName??``)||e.sourceId.localeCompare(t.sourceId)||e.method.localeCompare(t.method)||e.urlPath.localeCompare(t.urlPath)}function createChannelImportSpecifier(e){let r=join(e.agentRoot,toRuntimeImportLogicalPath(e.channel.logicalPath)),i=relative(e.fromDirectory,r).replaceAll(`\\`,`/`);return i.startsWith(`.`)?i:`./${i}`}function toRuntimeImportLogicalPath(e){return e.endsWith(`.mts`)?`${e.slice(0,-4)}.mjs`:e.endsWith(`.cts`)?`${e.slice(0,-4)}.cjs`:e.endsWith(`.ts`)?`${e.slice(0,-3)}.js`:e}function renderImportedChannelType(e){let t=e.exportName??`default`,n=`import(${JSON.stringify(e.importSpecifier)})`;return isIdentifierName(t)?`typeof ${n}.${t}`:`typeof ${n}[${JSON.stringify(t)}]`}function isIdentifierName(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)}export{CHANNEL_INSTRUMENTATION_TYPES_FILE_NAME,createChannelInstrumentationTypesSource};
|