eve 0.22.6 → 0.24.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/types.d.ts +1 -1
- package/dist/src/cli/run.d.ts +2 -2
- package/dist/src/cli/run.js +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.d.ts +12 -6
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-extension.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -2
- package/dist/src/compiler/normalize-tool.d.ts +2 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/context/build-base-tool-context.d.ts +5 -1
- package/dist/src/context/build-base-tool-context.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/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 +3 -4
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/run-session-limits.d.ts +0 -9
- package/dist/src/execution/run-session-limits.js +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/execution/tool-auth.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 +6 -14
- package/dist/src/harness/workflow-subagent-limit.d.ts +2 -2
- package/dist/src/internal/application/compiled-artifacts.d.ts +7 -1
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module.d.ts +4 -0
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/nitro/host/build-application.d.ts +2 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dispatch-schedule-in-dev.d.ts +6 -1
- package/dist/src/internal/nitro/host/dispatch-schedule-in-dev.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/types.d.ts +4 -0
- package/dist/src/internal/nitro/host/vercel-build-prewarm.d.ts +2 -9
- package/dist/src/internal/nitro/host/vercel-build-prewarm.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.js +1 -1
- package/dist/src/internal/nitro/routes/dev-schedule-dispatch.d.ts +2 -3
- package/dist/src/internal/nitro/routes/dev-schedule-dispatch.js +1 -1
- package/dist/src/public/channels/index.d.ts +14 -64
- package/dist/src/public/channels/teams/api.d.ts +8 -0
- package/dist/src/public/channels/teams/api.js +2 -2
- package/dist/src/public/channels/teams/defaults.d.ts +2 -2
- package/dist/src/public/channels/teams/defaults.js +1 -1
- package/dist/src/public/channels/teams/hitl.d.ts +4 -0
- package/dist/src/public/channels/teams/hitl.js +1 -1
- package/dist/src/public/channels/teams/index.d.ts +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +6 -0
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +40 -24
- package/dist/src/public/definitions/tool.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/tools/index.d.ts +1 -1
- package/dist/src/public/tools/index.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/runtime/types.d.ts +6 -6
- 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 -28
- package/dist/src/shared/dynamic-tool-definition.d.ts +2 -0
- package/docs/agent-config.md +8 -8
- package/docs/channels/custom.mdx +1 -3
- package/docs/channels/teams.mdx +5 -1
- package/docs/concepts/default-harness.md +12 -8
- package/docs/extensions.md +1 -3
- package/docs/guides/deployment.md +3 -3
- package/docs/guides/dynamic-workflows.md +10 -11
- package/docs/guides/instrumentation.md +1 -1
- package/docs/reference/cli.md +1 -1
- package/docs/reference/typescript-api.md +27 -27
- package/docs/subagents.mdx +13 -26
- package/docs/tools/overview.mdx +1 -0
- 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
|
@@ -9,10 +9,12 @@ A single turn can already call several subagents, and parallel tool calls dispat
|
|
|
9
9
|
|
|
10
10
|
## Enable the Workflow tool
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Export the experimental Workflow definition from `agent/tools/workflow.ts`. The helper name carries the "experimental" warning, but the tool the model actually sees is named `Workflow`.
|
|
13
13
|
|
|
14
14
|
```ts title="agent/tools/workflow.ts"
|
|
15
|
-
|
|
15
|
+
import { experimental_workflow } from "eve/tools";
|
|
16
|
+
|
|
17
|
+
export default experimental_workflow();
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
Without that file, the `Workflow` tool stays off. It earns its keep only when the agent has subagents (or the built-in `agent`) worth coordinating:
|
|
@@ -55,18 +57,15 @@ A workflow reaches only this agent's own agents: the built-in `agent` (a copy of
|
|
|
55
57
|
|
|
56
58
|
Workflow orchestration is capped in two independent ways.
|
|
57
59
|
|
|
58
|
-
**Per-program call budget.** One Workflow program may dispatch at most `
|
|
60
|
+
**Per-program call budget.** One Workflow program may dispatch at most `maxSubagents` subagent calls in total, counted across the whole program — sequential and parallel calls alike. Configure it on `experimental_workflow`; the default is 100. Calls beyond the budget do not start a child session; they resolve inside the program with a `WORKFLOW_SUBAGENT_LIMIT_REACHED` error result, and the budget is stated in the tool's description so the model sizes its fan-out to fit.
|
|
59
61
|
|
|
60
|
-
```ts title="agent/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
maxSubagents: 4,
|
|
65
|
-
},
|
|
66
|
-
});
|
|
62
|
+
```ts title="agent/tools/workflow.ts"
|
|
63
|
+
import { experimental_workflow } from "eve/tools";
|
|
64
|
+
|
|
65
|
+
export default experimental_workflow({ maxSubagents: 4 });
|
|
67
66
|
```
|
|
68
67
|
|
|
69
|
-
**Root-only
|
|
68
|
+
**Root-only orchestration.** Only the root session receives `Workflow`. Children started by a workflow receive neither `Workflow` nor the built-in `agent`, so Workflow programs cannot recurse. A declared child can still call subagents defined in its own directory (see [Subagents](../subagents)).
|
|
70
69
|
|
|
71
70
|
## Where the JavaScript runs
|
|
72
71
|
|
|
@@ -94,7 +94,7 @@ The callback receives:
|
|
|
94
94
|
- `channel`: the channel's `kind` and the metadata projected by the active channel
|
|
95
95
|
- `modelInput`: the final instructions and messages passed to the model call
|
|
96
96
|
|
|
97
|
-
A channel exposes its identity through `kind
|
|
97
|
+
A channel exposes its identity through `kind`. For authored channels it is `channel:<name>`, where `<name>` is the channel's filename under `agent/channels/`, so `agent/channels/support.ts` is `channel:support`. Framework channels use `http`, `schedule`, or `subagent`, and an unrecognized or absent kind normalizes to `unknown`. The kind is also emitted as the `eve.channel.kind` span attribute. To access an authored channel's metadata with its precise type, import the channel definition and narrow with `isChannel(input.channel, supportChannel)`.
|
|
98
98
|
|
|
99
99
|
Channel metadata is channel-owned. Built-in channels expose only the fields they choose to make observable; Slack, for example, projects `channelId`, `teamId`, `threadTs`, and `triggeringUserId` from its durable channel state. User-authored channels expose their own projection by returning `metadata(state)` from `defineChannel`. Runtime instrumentation never falls back to raw channel state.
|
|
100
100
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -93,7 +93,7 @@ Run this first when something behaves unexpectedly. It confirms a file was disco
|
|
|
93
93
|
eve build
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
Compiles to `.eve/` and builds the host output, then prints the built output path.
|
|
97
97
|
|
|
98
98
|
Useful artifacts written under `.eve/` (preserved even on partial failure):
|
|
99
99
|
|
|
@@ -52,7 +52,7 @@ export default defineTool({
|
|
|
52
52
|
| `mockModel` | `eve/evals` | Deterministic fixture agent models | [Evals](../evals/overview) |
|
|
53
53
|
| `useEveAgent` | `eve/react`, `eve/vue`, `eve/svelte` | frontend | [Frontend](../guides/frontend/overview) |
|
|
54
54
|
|
|
55
|
-
A few non-`define*` helpers round out the set: `disableTool` and `
|
|
55
|
+
A few non-`define*` helpers round out the set: `disableTool` and `experimental_workflow` from `eve/tools` (see [Default harness](../concepts/default-harness)), the route verbs `GET`/`POST`/`PUT`/`PATCH`/`DELETE`/`WS` from `eve/channels`, the approval policies `always`/`once`/`never` from `eve/tools/approval`, and the channel auth helpers `localDev`/`vercelOidc`/`placeholderAuth` from `eve/channels/auth`. To wrap a built-in tool, import its default value from `eve/tools/defaults` (`bash`, `readFile`, `writeFile`, `glob`, `grep`, `webFetch`, `webSearch`, `todo`, `loadSkill`). `AgentReasoningDefinition` is exported from `eve` for the top-level `defineAgent({ reasoning })` setting. `AgentLimitsDefinition` is exported for `defineAgent({ limits })`. `AgentWorkflowDefinition` and `AgentWorkflowWorldDefinition` are exported from `eve` for the `defineAgent({ experimental: { workflow } })` config shape. `ExperimentalWorkflowToolInput` is exported from `eve/tools` for the `experimental_workflow(...)` config shape.
|
|
56
56
|
|
|
57
57
|
## Runtime context (`ctx`)
|
|
58
58
|
|
|
@@ -68,32 +68,32 @@ A few non-`define*` helpers round out the set: `disableTool` and `ExperimentalWo
|
|
|
68
68
|
|
|
69
69
|
## Imports at a glance
|
|
70
70
|
|
|
71
|
-
| Import | Holds
|
|
72
|
-
| ----------------------------------------------------------- |
|
|
73
|
-
| `eve` | `defineAgent`, `defineRemoteAgent`, agent config types
|
|
74
|
-
| `eve/tools` | `defineTool`, `defineDynamic`, `disableTool`, `
|
|
75
|
-
| `eve/tools/defaults` | the built-in tools as plain values
|
|
76
|
-
| `eve/tools/approval` | `always`, `once`, `never`
|
|
77
|
-
| `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection`
|
|
78
|
-
| `eve/channels` | `defineChannel`, route verbs
|
|
79
|
-
| `eve/channels/eve` | `eveChannel`
|
|
80
|
-
| `eve/channels/auth` | `localDev`, `vercelOidc`, `placeholderAuth`
|
|
81
|
-
| `eve/channels/{slack,discord,teams,telegram,twilio,github}` | platform channel factories
|
|
82
|
-
| `eve/hooks` | `defineHook`
|
|
83
|
-
| `eve/schedules` | `defineSchedule`
|
|
84
|
-
| `eve/skills` | `defineSkill`, `defineDynamic`
|
|
85
|
-
| `eve/instructions` | `defineInstructions`, `defineDynamic`
|
|
86
|
-
| `eve/context` | `defineState`, session and state types
|
|
87
|
-
| `eve/sandbox` | `defineSandbox`, backends
|
|
88
|
-
| `eve/instrumentation` | `defineInstrumentation`, `isChannel`
|
|
89
|
-
| `eve/models/openai` | `experimental_chatgpt`
|
|
90
|
-
| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types
|
|
91
|
-
| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity`
|
|
92
|
-
| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter`
|
|
93
|
-
| `eve/evals/loaders` | `loadJson`, `loadYaml`
|
|
94
|
-
| `eve/react`, `eve/vue`, `eve/svelte` | `useEveAgent`
|
|
95
|
-
| `eve/next`, `eve/nuxt`, `eve/sveltekit` | framework bundler plugins
|
|
96
|
-
| [`eve/client`](../guides/client/overview) | `Client`, `ClientSession`
|
|
71
|
+
| Import | Holds |
|
|
72
|
+
| ----------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
73
|
+
| `eve` | `defineAgent`, `defineRemoteAgent`, agent config types |
|
|
74
|
+
| `eve/tools` | `defineTool`, `defineDynamic`, `disableTool`, `experimental_workflow` |
|
|
75
|
+
| `eve/tools/defaults` | the built-in tools as plain values |
|
|
76
|
+
| `eve/tools/approval` | `always`, `once`, `never` |
|
|
77
|
+
| `eve/connections` | `defineMcpClientConnection`, `defineOpenAPIConnection` |
|
|
78
|
+
| `eve/channels` | `defineChannel`, route verbs |
|
|
79
|
+
| `eve/channels/eve` | `eveChannel` |
|
|
80
|
+
| `eve/channels/auth` | `localDev`, `vercelOidc`, `placeholderAuth` |
|
|
81
|
+
| `eve/channels/{slack,discord,teams,telegram,twilio,github}` | platform channel factories |
|
|
82
|
+
| `eve/hooks` | `defineHook` |
|
|
83
|
+
| `eve/schedules` | `defineSchedule` |
|
|
84
|
+
| `eve/skills` | `defineSkill`, `defineDynamic` |
|
|
85
|
+
| `eve/instructions` | `defineInstructions`, `defineDynamic` |
|
|
86
|
+
| `eve/context` | `defineState`, session and state types |
|
|
87
|
+
| `eve/sandbox` | `defineSandbox`, backends |
|
|
88
|
+
| `eve/instrumentation` | `defineInstrumentation`, `isChannel` |
|
|
89
|
+
| `eve/models/openai` | `experimental_chatgpt` |
|
|
90
|
+
| `eve/evals` | `defineEval`, `defineEvalConfig`, `mockModel`, eval types |
|
|
91
|
+
| `eve/evals/expect` | `includes`, `equals`, `matches`, `similarity` |
|
|
92
|
+
| `eve/evals/reporters` | `Braintrust`, `JUnit`, `EvalReporter` |
|
|
93
|
+
| `eve/evals/loaders` | `loadJson`, `loadYaml` |
|
|
94
|
+
| `eve/react`, `eve/vue`, `eve/svelte` | `useEveAgent` |
|
|
95
|
+
| `eve/next`, `eve/nuxt`, `eve/sveltekit` | framework bundler plugins |
|
|
96
|
+
| [`eve/client`](../guides/client/overview) | `Client`, `ClientSession` |
|
|
97
97
|
|
|
98
98
|
Exported types ship from the same entrypoint as the helper they describe (for example `ToolDefinition` and `ToolContext` from `eve/tools`). For the exhaustive list, read `packages/eve/src/public/index.ts`.
|
|
99
99
|
|
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`. The Workflow tool's `maxSubagents` option caps the number of calls made by one 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/docs/tools/overview.mdx
CHANGED
|
@@ -38,6 +38,7 @@ When a tool returns structured data, add an optional `outputSchema`. With Zod or
|
|
|
38
38
|
|
|
39
39
|
- `ctx.session`: session metadata, turn, auth, parent lineage.
|
|
40
40
|
- `ctx.callId`: the id of the current tool call, carried by the call's [stream events](/docs/concepts/sessions-runs-and-streaming) and approval context.
|
|
41
|
+
- `ctx.toolName`: the final runtime name the model called, including any namespace qualification.
|
|
41
42
|
- `ctx.abortSignal`: aborts when the active turn is cancelled. Pass it to cancellation-aware work; sandbox sessions from `ctx.getSandbox()` are already bound to it.
|
|
42
43
|
- `ctx.getSandbox()`: the live [sandbox](/docs/sandbox) handle.
|
|
43
44
|
- `ctx.getSkill(id)`: read a packaged [skill](/docs/skills)'s metadata and files.
|
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};
|