The Open Framework for Building Agents
feat(dynamic): bare-key naming + rename connection tools (#146)
Casey Gowrie7df41e1674b8
diff --git a/.changeset/dynamic-namespace-option.md b/.changeset/dynamic-namespace-option.mdnew file mode 100644index 000000000..d8f4a0a6a--- /dev/null+++ b/.changeset/dynamic-namespace-option.md@@ -0,0 +1,5 @@+---+"eve": minor+---++Dynamic map resolvers no longer auto-prefix entries with the file slug — the map key is the tool/skill name verbatim (a single `defineTool`/`defineSkill` is still named after the file slug). Namespace keys yourself (e.g. `team__playbook`) when a bare name might collide. A dynamic tool/skill overrides a same-named authored one; two dynamic resolvers emitting the same name now throw, recommending manual namespacing. Connection tools are renamed accordingly: the search tool is `connection_search` and discovered tools are `<connection>__<tool>` (e.g. `linear__list_issues`).diff --git a/docs/concepts/default-harness.md b/docs/concepts/default-harness.mdindex 20f75de3f..b021bf47c 100644--- a/docs/concepts/default-harness.md+++ b/docs/concepts/default-harness.md@@ -43,7 +43,7 @@ Notes:- **`agent`** runs a copy of the current agent on a focused task. It inherits the same tools, connections, and instructions, but starts with fresh conversation history and fresh [state](../guides/state). The child shares the parent's sandbox filesystem, so anything it writes is visible to the parent. See [Subagents](../subagents).- **`load_skill`** only pulls instructions into context. It adds no new execution surface, because behavior still comes from the tools the agent already has.-- **`connection_search`** is the model-facing `connection__search` tool. A search surfaces a connection's tools by their qualified name (e.g. `connection__linear__list_issues`), and the model can then call them directly. It's registered only when the agent has connections.+- **`connection_search`** surfaces a connection's tools by their qualified name (e.g. `linear__list_issues`), which the model can then call directly. It's registered only when the agent has connections.- **`web_search`** has no local executor; the provider runs it. To supply your own implementation, override it with `defineTool()`.Review these built-in tools before production use. Disable, wrap, restrict, or require approval for any tool that can access the filesystem, network, shell, or sensitive data.diff --git a/docs/connections.mdx b/docs/connections.mdxindex 4390b078e..5e8180cc2 100644--- a/docs/connections.mdx+++ b/docs/connections.mdx@@ -5,7 +5,7 @@ description: "Expose external MCP and OpenAPI servers to the model, with connectA connection wires an agent into an external server you don't author, either an MCP server (Linear, GitHub, a warehouse) or any HTTP API with an OpenAPI document. eve handles the parts you'd otherwise hand-roll, discovering the remote tools, surfacing them to the model, and brokering auth.-Connections live under `agent/connections/`. The runtime name comes from the filename, so `agent/connections/linear.ts` registers as `"linear"`. The model never sees a connection's URL or credentials. It discovers tools through the built-in `connection__search` and calls them by their qualified name, `connection__<connection>__<tool>` (e.g. `connection__linear__list_issues`).+Connections live under `agent/connections/`. The runtime name comes from the filename, so `agent/connections/linear.ts` registers as `"linear"`. The model never sees a connection's URL or credentials. It discovers tools through the built-in `connection_search` and calls them by their qualified name, `<connection>__<tool>` (e.g. `linear__list_issues`).## MCP connections@@ -23,7 +23,7 @@ export default defineMcpClientConnection({});```-The `url` must speak Streamable HTTP or SSE. Write the `description` for the model, not for yourself. It shows up in `connection__search`, and the model uses it to decide which connection to query.+The `url` must speak Streamable HTTP or SSE. Write the `description` for the model, not for yourself. It shows up in `connection_search`, and the model uses it to decide which connection to query.### Static-token auth@@ -60,7 +60,7 @@ export default defineMcpClientConnection({### Tool filters-To narrow which remote tools the model sees, set exactly one of `tools.allow` or `tools.block`. Filtered-out tools do not appear in `connection__search`:+To narrow which remote tools the model sees, set exactly one of `tools.allow` or `tools.block`. Filtered-out tools do not appear in `connection_search`:```tsexport default defineMcpClientConnection({@@ -104,7 +104,7 @@ export default defineOpenAPIConnection({});```-Each operation becomes `connection__<connection>__<operationId>` (e.g. `connection__petstore__getInventory`). When an operation has no `operationId`, eve derives a deterministic `<method>_<sanitized-path>` name instead.+Each operation becomes `<connection>__<operationId>` (e.g. `petstore__getInventory`). When an operation has no `operationId`, eve derives a deterministic `<method>_<sanitized-path>` name instead.`auth`, `headers`, and `approval` work exactly as they do for MCP. There are two fields specific to OpenAPI:diff --git a/docs/guides/dynamic-capabilities.md b/docs/guides/dynamic-capabilities.mdindex 9f59eabc2..bf92f19e3 100644--- a/docs/guides/dynamic-capabilities.md+++ b/docs/guides/dynamic-capabilities.md@@ -9,7 +9,7 @@ description: "Resolve tools, skills, and instructions at runtime with defineDynaPass `defineDynamic` an `events` object whose handlers return either a single `defineTool(...)`, a `Record<string, defineTool(...)>`, or `null` for no tools. Wrap every entry in `defineTool()`. The wrapper stamps them so their `execute` functions survive workflow step boundaries.-The example below builds one tool per warehouse table. A map return names tools `slug__key`, so the model sees `query__orders`, `query__users`, and so on.+The example below builds one tool per warehouse table. A map return names each tool by its bare key, so the model sees `orders`, `users`, and so on.```ts title="agent/tools/query.ts"import { defineDynamic, defineTool } from "eve/tools";@@ -39,13 +39,16 @@ Write `execute` as an inline function expression, arrow, or method shorthand pla### Naming-| Return shape | File | Tool name(s) |-| ------------------------- | -------------------------- | --------------------------------- |-| single `defineTool` | `agent/tools/analytics.ts` | `analytics` |-| map `{ export, query }` | `agent/tools/tenant.ts` | `tenant__export`, `tenant__query` |-| map `{ run }` (one entry) | `agent/tools/search.ts` | `search__run` |+| Return shape | File | Tool name(s) |+| ----------------------- | -------------------------- | ----------------- |+| single `defineTool` | `agent/tools/analytics.ts` | `analytics` |+| map `{ export, query }` | `agent/tools/tenant.ts` | `export`, `query` |-A single return produces one tool named after the file slug, identical to a static tool. A map always uses `slug__key`, even when it holds a single entry, so adding a second entry later never renames the first.+A single return produces one tool named after the file slug, identical to a static tool. A map names each entry by its **bare key** — there is no automatic slug prefix. If a bare name might collide, namespace the key yourself by including the prefix in the key (e.g. return `{ "tenant__export": … }` to get `tenant__export`).++### Conflicts++A dynamic tool or skill whose name matches an **authored** one **overrides** it — a per-caller resolver can replace a built-in by name. Two **dynamic** resolvers emitting the same name is a genuine ambiguity and throws; namespace one of the keys manually to resolve it.### Events@@ -116,7 +119,7 @@ export default defineDynamic({The caller's team gets its own playbook advertised as a loadable skill; everyone else gets nothing.-Skills follow the same naming rule as tools: a single `defineSkill(...)` is named after the file slug, while a map return names each entry `slug__key` — even when the map holds one entry, so adding a second skill later never renames the first.+Skills follow the same naming rule as tools: a single `defineSkill(...)` is named after the file slug, while a map names each entry by its bare key (namespace the key yourself if it might collide). A dynamic skill overrides a same-named authored one; two dynamic resolvers emitting the same name throws.## Dynamic instructionsdiff --git a/docs/subagents.mdx b/docs/subagents.mdxindex 8d8ab1e27..20b6ea0e9 100644--- a/docs/subagents.mdx+++ b/docs/subagents.mdx@@ -77,7 +77,7 @@ The built-in `agent` tool is the exception. Its children share the parent's sandeve 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.-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__<connection>__<tool>`), it carries no namespace, so the model, approvals, logs, and evals all reference it by that name. Its input schema is:+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:```ts{diff --git a/docs/tutorial/connect-a-warehouse.mdx b/docs/tutorial/connect-a-warehouse.mdxindex e15784739..6a9ce5553 100644--- a/docs/tutorial/connect-a-warehouse.mdx+++ b/docs/tutorial/connect-a-warehouse.mdx@@ -7,7 +7,7 @@ The sample dataset got the analytics assistant running, but it's a stand-in. NowThis step depends on Vercel Connect, which is in private beta. No Connect access? Keep the Step 3 sample dataset and read this step for the connection model. Steps 5 through 9 work against the sample dataset, so you can complete the tutorial without a warehouse.-The filename sets the runtime name. Put the file at `agent/connections/warehouse.ts` and it registers as `"warehouse"`, with its tools surfaced as `connection__warehouse__<tool>`.+The filename sets the runtime name. Put the file at `agent/connections/warehouse.ts` and it registers as `"warehouse"`, with its tools surfaced as `warehouse__<tool>`.## Declare the connectiondiff --git a/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger-approval.eval.ts b/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger-approval.eval.tsindex 646a079fa..a263f2667 100644--- a/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger-approval.eval.ts+++ b/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger-approval.eval.ts@@ -1,8 +1,8 @@import type { HandleMessageStreamEvent } from "eve/client";import { defineEval } from "eve/evals";-const SEARCH_TOOL = "connection__search";-const TFL_APPROVAL_JOURNEY_MODES_TOOL = "connection__tfl-approval__Journey_Meta";+const SEARCH_TOOL = "connection_search";+const TFL_APPROVAL_JOURNEY_MODES_TOOL = "tfl-approval__Journey_Meta";export default defineEval({description:@@ -11,8 +11,8 @@ export default defineEval({async test(t) {const parked = await t.send([- "Use the `connection__search` tool with connection `tfl-approval` to find the TfL journey modes operation.",- "Then call `connection__tfl-approval__Journey_Meta` exactly once with an empty object.",+ "Use the `connection_search` tool with connection `tfl-approval` to find the TfL journey modes operation.",+ "Then call `tfl-approval__Journey_Meta` exactly once with an empty object.","Wait for approval if requested.","After the tool runs, reply with the exact words `bus` and `tube` if both mode names are present in the tool result.",].join("\n"),diff --git a/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger.eval.ts b/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger.eval.tsindex 011732439..d2fef78be 100644--- a/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger.eval.ts+++ b/e2e/fixtures/agent-openapi-swagger/evals/tfl-swagger.eval.ts@@ -1,8 +1,8 @@import type { EveEvalTurn } from "eve/evals";import { defineEval } from "eve/evals";-const SEARCH_TOOL = "connection__search";-const TFL_JOURNEY_MODES_TOOL = "connection__tfl__Journey_Meta";+const SEARCH_TOOL = "connection_search";+const TFL_JOURNEY_MODES_TOOL = "tfl__Journey_Meta";export default defineEval({description:@@ -11,8 +11,8 @@ export default defineEval({async test(t) {const turn = await t.send([- "Use the `connection__search` tool to find the TfL journey modes operation in the `tfl` connection.",- "Then call `connection__tfl__Journey_Meta` exactly once with an empty object.",+ "Use the `connection_search` tool to find the TfL journey modes operation in the `tfl` connection.",+ "Then call `tfl__Journey_Meta` exactly once with an empty object.","Reply with the exact words `bus` and `tube` if both mode names are present in the tool result.",].join("\n"),);diff --git a/e2e/fixtures/agent-skills/agent/skills/dynamic-single-map.ts b/e2e/fixtures/agent-skills/agent/skills/dynamic-single-map.tsdeleted file mode 100644index 64030bd82..000000000--- a/e2e/fixtures/agent-skills/agent/skills/dynamic-single-map.ts+++ /dev/null@@ -1,26 +0,0 @@-import { defineDynamic, defineSkill } from "eve/skills";--export const DYNAMIC_SINGLE_MAP_TOKEN = "dynamic-single-map-solo-X3R8";--// A map with exactly one entry: its id must still qualify as-// `dynamic-single-map__solo`, never collapse to the bare resolver slug.-export default defineDynamic({- events: {- "session.started": async () => {- return {- solo: defineSkill({- description:- "Smoke-test fixture: the sole skill from a single-entry map resolver. " +- 'Only load when the user explicitly asks for "dynamic single map solo".',- markdown: [- "# Solo Skill",- "",- "When this skill is loaded, reply with exactly:",- "",- DYNAMIC_SINGLE_MAP_TOKEN,- ].join("\n"),- }),- };- },- },-});diff --git a/e2e/fixtures/agent-skills/agent/skills/house-rules-override.ts b/e2e/fixtures/agent-skills/agent/skills/house-rules-override.tsnew file mode 100644index 000000000..b1a6c16da--- /dev/null+++ b/e2e/fixtures/agent-skills/agent/skills/house-rules-override.ts@@ -0,0 +1,28 @@+import { defineDynamic, defineSkill } from "eve/skills";++export const HOUSE_RULES_OVERRIDE_TOKEN = "house-rules-dynamic-ok-M5T8";++// Emits a skill named `house-rules`, the same name as the authored skill+// (house-rules.md). A dynamic skill overrides a same-named authored one — the+// dynamic write overwrites the authored skill's sandbox file — so load_skill+// returns this body, not the authored one.+export default defineDynamic({+ events: {+ "session.started": async () => {+ return {+ "house-rules": defineSkill({+ description:+ "Use ONLY when the user asks for the house rules. " ++ 'Triggered by the literal phrase "house rules".',+ markdown: [+ "# House Rules",+ "",+ "When this skill is loaded, reply with exactly:",+ "",+ HOUSE_RULES_OVERRIDE_TOKEN,+ ].join("\n"),+ }),+ };+ },+ },+});diff --git a/e2e/fixtures/agent-skills/agent/skills/house-rules.md b/e2e/fixtures/agent-skills/agent/skills/house-rules.mdnew file mode 100644index 000000000..0aabdb59e--- /dev/null+++ b/e2e/fixtures/agent-skills/agent/skills/house-rules.md@@ -0,0 +1,10 @@+---+description: Use ONLY when the user asks for the house rules. Triggered by any message containing the literal phrase "house rules".+---++# House Rules (authored)++This authored skill must be overridden by the same-named dynamic skill. If you+ever see this text, the override failed; reply with exactly:++house-rules-authored-SHOULD-NOT-APPEARdiff --git a/e2e/fixtures/agent-skills/evals/skills/dynamic-single-map.eval.ts b/e2e/fixtures/agent-skills/evals/skills/dynamic-single-map.eval.tsdeleted file mode 100644index c3d24c68c..000000000--- a/e2e/fixtures/agent-skills/evals/skills/dynamic-single-map.eval.ts+++ /dev/null@@ -1,27 +0,0 @@-import { defineEval } from "eve/evals";--const DYNAMIC_SINGLE_MAP_TOKEN = "dynamic-single-map-solo-X3R8";--/**- * Skill smoke eval (regression):- * a `defineDynamic` resolver returning a single-entry map- * (skills/dynamic-single-map.ts) must expose that entry under its qualified id- * `dynamic-single-map__solo` — not the bare resolver slug. Asserting the loaded- * skill id is exactly the qualified name guards the single-entry-map naming fix.- */-export default defineEval({- description: "Skills smoke: single-entry dynamic skill-map qualifies as slug__key.",- async test(t) {- const turn = await t.send(- "Please use the dynamic single map solo skill and follow its instructions exactly.",- );- turn.expectOk();-- t.didNotFail();- t.completed();- t.loadedSkill("dynamic-single-map__solo", {- output: new RegExp(DYNAMIC_SINGLE_MAP_TOKEN, "u"),- });- t.messageIncludes(DYNAMIC_SINGLE_MAP_TOKEN);- },-});diff --git a/e2e/fixtures/agent-skills/evals/skills/dynamic-skill-map.eval.ts b/e2e/fixtures/agent-skills/evals/skills/dynamic-skill-map.eval.tsindex b8e360a29..dbbf97545 100644--- a/e2e/fixtures/agent-skills/evals/skills/dynamic-skill-map.eval.ts+++ b/e2e/fixtures/agent-skills/evals/skills/dynamic-skill-map.eval.ts@@ -5,7 +5,7 @@ const DYNAMIC_MULTI_ALPHA_TOKEN = "dynamic-multi-alpha-Q8V3";/*** Skill smoke eval:* a `defineDynamic` multi-skill resolver (skills/dynamic-multi.ts) exposes- * map entries under derived ids (`dynamic-multi__alpha`); the alpha body+ * map entries under derived ids (`alpha`); the alpha body* must land in the load_skill result and the reply.*/export default defineEval({@@ -18,7 +18,7 @@ export default defineEval({t.didNotFail();t.completed();- t.loadedSkill("dynamic-multi__alpha", {+ t.loadedSkill("alpha", {output: new RegExp(DYNAMIC_MULTI_ALPHA_TOKEN, "u"),});t.messageIncludes(DYNAMIC_MULTI_ALPHA_TOKEN);diff --git a/e2e/fixtures/agent-skills/evals/skills/skill-override.eval.ts b/e2e/fixtures/agent-skills/evals/skills/skill-override.eval.tsnew file mode 100644index 000000000..cabf1dfb3--- /dev/null+++ b/e2e/fixtures/agent-skills/evals/skills/skill-override.eval.ts@@ -0,0 +1,25 @@+import { defineEval } from "eve/evals";++const HOUSE_RULES_OVERRIDE_TOKEN = "house-rules-dynamic-ok-M5T8";++/**+ * Skill conflict eval:+ * a dynamic resolver (skills/house-rules-override.ts) emits a skill named+ * `house-rules`, the same name as the authored `house-rules.md`. The dynamic+ * skill must win — loading `house-rules` returns the dynamic body, never the+ * authored one.+ */+export default defineEval({+ description: "Skills smoke: a dynamic skill overrides a same-named authored skill.",+ async test(t) {+ const turn = await t.send(+ "Please use the house rules skill and follow its instructions exactly.",+ );+ turn.expectOk();++ t.didNotFail();+ t.completed();+ t.loadedSkill("house-rules", { output: new RegExp(HOUSE_RULES_OVERRIDE_TOKEN, "u") });+ t.messageIncludes(HOUSE_RULES_OVERRIDE_TOKEN);+ },+});diff --git a/e2e/fixtures/agent-tools/agent/tools/override-provider.ts b/e2e/fixtures/agent-tools/agent/tools/override-provider.tsnew file mode 100644index 000000000..8274d00a1--- /dev/null+++ b/e2e/fixtures/agent-tools/agent/tools/override-provider.ts@@ -0,0 +1,23 @@+import { defineDynamic, defineTool } from "eve/tools";++export const OVERRIDE_TOKEN = "dynamic-override-ok-K2P7";++// The bare map key `override-target` collides with the authored tool of the+// same name. A dynamic tool wins on conflict, so calls to `override-target`+// must execute this version.+export default defineDynamic({+ events: {+ "session.started": async () => {+ return {+ "override-target": defineTool({+ description:+ "Smoke-test fixture: dynamic override of `override-target`. Only call when the user asks to use `override-target`.",+ inputSchema: { type: "object" as const, properties: {} },+ async execute() {+ return { source: "dynamic", token: OVERRIDE_TOKEN };+ },+ }),+ };+ },+ },+});diff --git a/e2e/fixtures/agent-tools/agent/tools/override-target.ts b/e2e/fixtures/agent-tools/agent/tools/override-target.tsnew file mode 100644index 000000000..74a6a8ae3--- /dev/null+++ b/e2e/fixtures/agent-tools/agent/tools/override-target.ts@@ -0,0 +1,13 @@+import { defineTool } from "eve/tools";++// Authored tool whose name a `namespace: false` dynamic resolver+// (override-provider.ts) also emits — the dynamic version must win, so this+// `source: "authored"` result should never reach the model.+export default defineTool({+ description:+ "Smoke-test fixture: authored version of `override-target`. Only call when the user asks to use `override-target`.",+ inputSchema: { type: "object" as const, properties: {} },+ async execute() {+ return { source: "authored" };+ },+});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/authored-override.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/authored-override.eval.tsnew file mode 100644index 000000000..3d088b176--- /dev/null+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/authored-override.eval.ts@@ -0,0 +1,24 @@+import { defineEval } from "eve/evals";++// A dynamic resolver (override-provider.ts) emits a tool named `override-target`,+// the same name as an authored tool. The dynamic tool must win: calling+// `override-target` returns the dynamic result, never the authored+// `source: "authored"`.+const OVERRIDE_TOKEN = "dynamic-override-ok-K2P7";++export default defineEval({+ description: "Dynamic tools smoke: a dynamic tool overrides a same-named authored tool.",+ async test(t) {+ const turn = await t.send(+ "Call the `override-target` tool and report the `source` value it returns.",+ );+ turn.expectOk();++ t.didNotFail();+ t.completed();+ t.calledTool("override-target", {+ isError: false,+ output: { source: "dynamic", token: OVERRIDE_TOKEN },+ });+ },+});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/conditional.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/conditional.eval.tsindex d960c9ddc..c3d831519 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/conditional.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/conditional.eval.ts@@ -9,19 +9,19 @@ export default defineEval({description: "Dynamic tools smoke: the resolver runs once per session, not per turn.",async test(t) {const first = await t.send(- "Use the `dynamic-conditional__check_stability` tool and tell me the branch and invocations values.",+ "Use the `check_stability` tool and tell me the branch and invocations values.",);first.expectOk();- const firstOutput = requireToolOutput(first, "dynamic-conditional__check_stability");+ const firstOutput = requireToolOutput(first, "check_stability");if (firstOutput.branch !== "first") {throw new Error(`Turn 1: expected branch="first", got ${JSON.stringify(firstOutput.branch)}`);}const second = await t.send(- "Use the `dynamic-conditional__check_stability` tool to check stability. Call it now and report the branch and invocations values.",+ "Use the `check_stability` tool to check stability. Call it now and report the branch and invocations values.",);second.expectOk();- const secondOutput = requireToolOutput(second, "dynamic-conditional__check_stability");+ const secondOutput = requireToolOutput(second, "check_stability");if (secondOutput.branch !== "first") {throw new Error(`Turn 2: expected branch="first" (resolver should not re-run conditional logic), ` +@@ -31,7 +31,7 @@ export default defineEval({t.didNotFail();t.completed();- t.calledTool("dynamic-conditional__check_stability", {+ t.calledTool("check_stability", {isError: false,output: { branch: "first" },times: 2,diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/io-once.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/io-once.eval.tsindex b37f5626e..8dee7b708 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/io-once.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/io-once.eval.ts@@ -8,19 +8,19 @@ export default defineEval({description: "Dynamic tools smoke: resolver I/O runs once and replays from the durable cache.",async test(t) {const first = await t.send(- "Use the `dynamic-counted__get_io_count` tool and tell me the ioCallCount number from the result.",+ "Use the `get_io_count` tool and tell me the ioCallCount number from the result.",);first.expectOk();- const firstCount = requireToolOutput(first, "dynamic-counted__get_io_count").ioCallCount;+ const firstCount = requireToolOutput(first, "get_io_count").ioCallCount;if (firstCount !== 1) {throw new Error(`Turn 1: expected ioCallCount=1, got ${JSON.stringify(firstCount)}`);}const second = await t.send(- "Use the `dynamic-counted__get_io_count` tool again right now and tell me the ioCallCount value from the result.",+ "Use the `get_io_count` tool again right now and tell me the ioCallCount value from the result.",);second.expectOk();- const secondCount = requireToolOutput(second, "dynamic-counted__get_io_count").ioCallCount;+ const secondCount = requireToolOutput(second, "get_io_count").ioCallCount;if (secondCount !== 1) {throw new Error(`Turn 2: expected ioCallCount=1 (resolver I/O should not re-run), got ${JSON.stringify(secondCount)}.`,@@ -29,7 +29,7 @@ export default defineEval({t.didNotFail();t.completed();- t.calledTool("dynamic-counted__get_io_count", {+ t.calledTool("get_io_count", {isError: false,output: { ioCallCount: 1 },});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/loop.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/loop.eval.tsindex b327af116..a34988375 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/loop.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/loop.eval.ts@@ -4,14 +4,12 @@ import { defineEval } from "eve/evals";export default defineEval({description: "Dynamic tools smoke: loop-generated tools keep per-iteration closures.",async test(t) {- const turn = await t.send(- "Call the `dynamic-loop__alpha` tool and tell me the name and index it returned.",- );+ const turn = await t.send("Call the `alpha` tool and tell me the name and index it returned.");turn.expectOk();t.didNotFail();t.completed();- t.calledTool("dynamic-loop__alpha", {+ t.calledTool("alpha", {isError: false,output: { name: "alpha", index: 0 },});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/messages.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/messages.eval.tsindex 9031c090b..d2d82ee9d 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/messages.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/messages.eval.ts@@ -8,10 +8,10 @@ export default defineEval({description: "Dynamic tools smoke: step.started resolver sees accumulated message history.",async test(t) {const first = await t.send(- "Use the `dynamic-messages__check_messages` tool with label 'turn1' and tell me the messageCount.",+ "Use the `check_messages` tool with label 'turn1' and tell me the messageCount.",);first.expectOk();- const firstCount = requireToolOutput(first, "dynamic-messages__check_messages").messageCount;+ const firstCount = requireToolOutput(first, "check_messages").messageCount;if (typeof firstCount !== "number" || firstCount < 1) {throw new Error(`Turn 1: expected messageCount >= 1, got ${JSON.stringify(firstCount)}. ` +@@ -20,10 +20,10 @@ export default defineEval({}const second = await t.send(- "Use the `dynamic-messages__check_messages` tool again with label 'turn2' and tell me the messageCount.",+ "Use the `check_messages` tool again with label 'turn2' and tell me the messageCount.",);second.expectOk();- const secondCount = requireToolOutput(second, "dynamic-messages__check_messages").messageCount;+ const secondCount = requireToolOutput(second, "check_messages").messageCount;if (typeof secondCount !== "number" || secondCount <= firstCount) {throw new Error(`Turn 2: expected messageCount > ${firstCount}, got ${JSON.stringify(secondCount)}. ` +@@ -37,6 +37,6 @@ export default defineEval({// (firstCount >= 1, secondCount > firstCount). The model may call the// tool more than once in a turn, so assert it was called without error// rather than pinning an exact count.- t.calledTool("dynamic-messages__check_messages", { isError: false });+ t.calledTool("check_messages", { isError: false });},});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/model-output.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/model-output.eval.tsindex a8518ad88..ad8312c87 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/model-output.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/model-output.eval.ts@@ -6,13 +6,13 @@ export default defineEval({description: "Dynamic tools smoke: action.result carries the raw execute output.",async test(t) {const turn = await t.send(- "Use the `dynamic-model-output__check_model_output` tool with value 'hello' and tell me what the result contains.",+ "Use the `check_model_output` tool with value 'hello' and tell me what the result contains.",);turn.expectOk();t.didNotFail();t.completed();- t.calledTool("dynamic-model-output__check_model_output", {+ t.calledTool("check_model_output", {isError: false,output: { raw: true, secret: "internal-only-data", value: "hello" },});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/nested.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/nested.eval.tsindex 83f869a1d..5e67f2cba 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/nested.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/nested.eval.ts@@ -7,22 +7,22 @@ export default defineEval({"Dynamic tools smoke: helper-built and inline tools from one resolver survive replay.",async test(t) {const first = await t.send(- "Call the `dynamic-nested__nested_query` tool and tell me exactly what it returned.",+ "Call the `nested_query` tool and tell me exactly what it returned.",);first.expectOk();const second = await t.send(- "Now call the `dynamic-nested__nested_status` tool and tell me exactly what it returned.",+ "Now call the `nested_status` tool and tell me exactly what it returned.",);second.expectOk();t.didNotFail();t.completed();- t.calledTool("dynamic-nested__nested_query", {+ t.calledTool("nested_query", {isError: false,output: { action: "query", endpoint: "/v2/query", source: "helper" },});- t.calledTool("dynamic-nested__nested_status", {+ t.calledTool("nested_status", {isError: false,output: { tier: "premium", source: "inline" },});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/overwrite.eval.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/overwrite.eval.tsindex 702740400..694d83867 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/overwrite.eval.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/overwrite.eval.ts@@ -6,23 +6,19 @@ import { defineEval } from "eve/evals";export default defineEval({description: "Dynamic tools smoke: turn-scoped resolver tools win merges over session-scoped.",async test(t) {- const first = await t.send(- "Call the `dynamic-overwrite__shared` tool and report the source and turn values.",- );+ const first = await t.send("Call the `shared` tool and report the source and turn values.");first.expectOk();- const second = await t.send(- "Call the `dynamic-overwrite__session_only` tool and report the source value.",- );+ const second = await t.send("Call the `session_only` tool and report the source value.");second.expectOk();t.didNotFail();t.completed();- t.calledTool("dynamic-overwrite__shared", {+ t.calledTool("shared", {isError: false,output: { source: "turn" },});- t.calledTool("dynamic-overwrite__session_only", {+ t.calledTool("session_only", {isError: false,output: { source: "session" },});diff --git a/e2e/fixtures/agent-tools/evals/dynamic-tools/shared.ts b/e2e/fixtures/agent-tools/evals/dynamic-tools/shared.tsindex 1f95682d4..c66731fd0 100644--- a/e2e/fixtures/agent-tools/evals/dynamic-tools/shared.ts+++ b/e2e/fixtures/agent-tools/evals/dynamic-tools/shared.ts@@ -2,11 +2,11 @@ import type { EveEvalTurn } from "eve/evals";/*** Shared constants and helpers for the dynamic tool (`defineDynamic`) smoke- * evals. Each case names the full registered tool name (`<file>__<key>`) in- * its prompt so the model calls it.+ * evals. A map resolver names each entry by its bare key, so each case names+ * that key in its prompt so the model calls it.*/export const DYNAMIC_ECHO_TOKEN = "dynamic-echo-ok-X7R2";-export const ECHO_TOOL = "dynamic-echo__echo_dynamic";+export const ECHO_TOOL = "echo_dynamic";/*** Finds the named tool call inside one turn and returns its object output.diff --git a/packages/eve/src/context/dynamic-skill-lifecycle.test.ts b/packages/eve/src/context/dynamic-skill-lifecycle.test.tsindex 9f800fb2b..9e0f75992 100644--- a/packages/eve/src/context/dynamic-skill-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-skill-lifecycle.test.ts@@ -13,7 +13,7 @@ import { BundleKey, type CompiledBundle } from "#runtime/sessions/runtime-conteximport type { ResolvedDynamicSkillResolver } from "#runtime/types.js";import type { SkillPackageDefinition } from "#shared/skill-definition.js";-function createMockBundle(): CompiledBundle {+function createMockBundle(authoredSkillNames: readonly string[] = []): CompiledBundle {return {adapterRegistry: undefined as never,compiledArtifactsSource: undefined as never,@@ -23,7 +23,7 @@ function createMockBundle(): CompiledBundle {nodeId: undefined,resolvedAgent: {config: { name: "test-agent" },- skills: [],+ skills: authoredSkillNames.map((name) => ({ name })),} as never,subagentRegistry: undefined as never,toolRegistry: undefined as never,@@ -31,12 +31,12 @@ function createMockBundle(): CompiledBundle {};}-function createCtx() {+function createCtx(authoredSkillNames: readonly string[] = []) {const ctx = new ContextContainer();const sandbox = mockSandbox();ctx.set(SessionIdKey, "test-session");ctx.set(SandboxKey, sandbox.access);- ctx.set(BundleKey, createMockBundle());+ ctx.set(BundleKey, createMockBundle(authoredSkillNames));return { ctx, sandbox };}@@ -132,7 +132,7 @@ describe("dispatchDynamicSkillEvent", () => {expect(announcement).toContain("support: Support policy");});- it("qualifies a single-entry map as slug__key (never collapses to the bare slug)", async () => {+ it("names map entries by their bare key", async () => {const { ctx, sandbox } = createCtx();const resolver = createResolver("custom", () => ({"talk-like-a-dog": makeSkill("Talk like a dog", "Woof."),@@ -146,12 +146,30 @@ describe("dispatchDynamicSkillEvent", () => {});expect(ctx.get(DynamicSkillManifestKey)).toEqual({- custom: [{ description: "Talk like a dog", name: "custom__talk-like-a-dog" }],+ custom: [{ description: "Talk like a dog", name: "talk-like-a-dog" }],});- expect(ctx.get(PendingSkillAnnouncementKey)).toContain(- "custom__talk-like-a-dog: Talk like a dog",- );- expect(sandbox.writes.some((w) => w.path.includes("/skills/custom__talk-like-a-dog/"))).toBe(+ expect(ctx.get(PendingSkillAnnouncementKey)).toContain("talk-like-a-dog: Talk like a dog");+ expect(sandbox.writes.some((w) => w.path.includes("/skills/talk-like-a-dog/"))).toBe(true);+ });++ it("lets a dynamic skill override a same-named authored skill instead of throwing", async () => {+ const { ctx, sandbox } = createCtx(["talk-like-a-dog"]);+ const resolver = createResolver("custom", () => ({+ "talk-like-a-dog": makeSkill("Dynamic override", "Woof."),+ }));++ await dispatchDynamicSkillEvent({+ ctx,+ event: makeEvent(),+ messages: [],+ resolvers: [resolver],+ });++ // No throw; the dynamic skill is written to the authored skill's path.+ expect(ctx.get(DynamicSkillManifestKey)).toEqual({+ custom: [{ description: "Dynamic override", name: "talk-like-a-dog" }],+ });+ expect(sandbox.writes.some((w) => w.path.includes("/skills/talk-like-a-dog/SKILL.md"))).toBe(true,);});@@ -173,22 +191,19 @@ describe("dispatchDynamicSkillEvent", () => {expect(sandbox.writes.some((w) => w.path.includes("/skills/tenant/"))).toBe(true);});- it("rejects duplicate names produced by dynamic skill resolvers before writing", async () => {+ it("throws and recommends manual namespacing when two resolvers emit the same name", async () => {const { ctx, sandbox } = createCtx();- const single = createResolver("foo__bar", () => makeSkill("Single"));- const mapped = createResolver("foo", () => ({- bar: makeSkill("Mapped"),- baz: makeSkill("Other mapped"),- }));+ const alpha = createResolver("alpha", () => ({ shared: makeSkill("From alpha") }));+ const beta = createResolver("beta", () => ({ shared: makeSkill("From beta") }));await expect(dispatchDynamicSkillEvent({ctx,event: makeEvent(),messages: [],- resolvers: [single, mapped],+ resolvers: [alpha, beta],}),- ).rejects.toThrow('Dynamic skill "foo__bar"');+ ).rejects.toThrow(/Dynamic skill "shared".*Namespace the map key manually/u);expect(sandbox.writes).toEqual([]);expect(ctx.get(DynamicSkillManifestKey)).toBeUndefined();diff --git a/packages/eve/src/context/dynamic-skill-lifecycle.ts b/packages/eve/src/context/dynamic-skill-lifecycle.tsindex f90f319da..b451c899e 100644--- a/packages/eve/src/context/dynamic-skill-lifecycle.ts+++ b/packages/eve/src/context/dynamic-skill-lifecycle.ts@@ -21,7 +21,6 @@ import {DynamicSkillManifestKey,SandboxKey,} from "#context/keys.js";-import { BundleKey } from "#runtime/sessions/runtime-context-keys.js";import { buildResolveContext } from "#context/dynamic-resolve-context.js";const log = createLogger("dynamic-skills");@@ -40,14 +39,15 @@ function qualifyDynamicSkillNames(if (keys.length === 0) return result;- // A single-entry map still qualifies as `slug__key`; only isSingle collapses.+ // A single returned defineSkill is named after the file slug; a map names+ // each entry by its bare key (authors namespace keys themselves if needed).if (isSingle) {result.push({ name: slug, entryKey: keys[0]!, entry: entries[keys[0]!]! });return result;}for (const key of keys) {- result.push({ name: `${slug}__${key}`, entryKey: key, entry: entries[key]! });+ result.push({ name: key, entryKey: key, entry: entries[key]! });}return result;}@@ -120,9 +120,6 @@ export async function dispatchDynamicSkillEvent(input: {if (matching.length === 0) return;const resolveCtx = buildResolveContext(ctx, messages);- const authoredSkillNames = new Set(- ctx.require(BundleKey).resolvedAgent.skills.map((s) => s.name),- );const manifest = ctx.get(DynamicSkillManifestKey) ?? {};const updates: DynamicSkillUpdate[] = [];@@ -179,18 +176,17 @@ export async function dispatchDynamicSkillEvent(input: {}}+ // A dynamic skill whose name matches an authored skill overrides it: the+ // dynamic write overwrites the authored file at the same sandbox path, so+ // load_skill returns the dynamic body. Two dynamic resolvers emitting the+ // same name is a genuine ambiguity and still throws.const dynamicSkillOwners = new Map<string, string>();for (const [resolverSlug, skills] of Object.entries(newManifest)) {for (const { name } of skills) {- if (authoredSkillNames.has(name)) {- throw new Error(- `Dynamic skill "${name}" from resolver "${resolverSlug}" conflicts with an authored skill.`,- );- }const previousOwner = dynamicSkillOwners.get(name);if (previousOwner !== undefined) {throw new Error(- `Dynamic skill "${name}" from resolver "${resolverSlug}" conflicts with dynamic resolver "${previousOwner}".`,+ `Dynamic skill "${name}" from resolver "${resolverSlug}" collides with dynamic resolver "${previousOwner}". Namespace the map key manually, e.g. "${resolverSlug}__${name}".`,);}dynamicSkillOwners.set(name, resolverSlug);diff --git a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts b/packages/eve/src/context/dynamic-tool-lifecycle.test.tsindex ee4b22b55..d8910b487 100644--- a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-tool-lifecycle.test.ts@@ -37,14 +37,14 @@ function qualifyDynamicToolNames(if (keys.length === 0) return result;// single entry: one tool, named after the file slug.- // map of entries: always slug__key.+ // map of entries: each named by its bare key.if (isSingle) {result.set(slug, entries[keys[0]!]!);return result;}for (const key of keys) {- result.set(`${slug}__${key}`, entries[key]!);+ result.set(key, entries[key]!);}return result;}@@ -63,19 +63,19 @@ describe("dynamic tool naming", () => {expect([...names.keys()]).toEqual(["analytics"]);});- it("uses slug__key for a map entry", () => {+ it("uses the bare key for a map entry", () => {const names = qualifyDynamicToolNames("search", false, {run: stubEntry,});- expect([...names.keys()]).toEqual(["search__run"]);+ expect([...names.keys()]).toEqual(["run"]);});- it("uses slug__key for multiple map entries", () => {+ it("uses bare keys for multiple map entries", () => {const names = qualifyDynamicToolNames("tenant", false, {export: stubEntry,query: stubEntry,});- expect([...names.keys()]).toEqual(["tenant__export", "tenant__query"]);+ expect([...names.keys()]).toEqual(["export", "query"]);});it("handles empty entries — no tools produced", () => {@@ -490,11 +490,11 @@ describe("dispatchDynamicToolEvent", () => {const metadata = ctx.get(SessionDynamicToolMetadataKey);expect(metadata).toHaveLength(1);- expect(metadata![0]!.name).toBe("weather__forecast");+ expect(metadata![0]!.name).toBe("forecast");const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("weather__forecast");+ expect(tools[0]!.name).toBe("forecast");});it("skips resolvers that do not match the event type", async () => {@@ -557,7 +557,7 @@ describe("dispatchDynamicToolEvent", () => {event: makeEvent("session.started"),});expect(buildDynamicTools(ctx)).toHaveLength(1);- expect(buildDynamicTools(ctx)[0]!.name).toBe("alpha__a_tool");+ expect(buildDynamicTools(ctx)[0]!.name).toBe("a_tool");await dispatchDynamicToolEvent({ctx,@@ -567,7 +567,26 @@ describe("dispatchDynamicToolEvent", () => {});const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(2);- expect(tools.map((t) => t.name).sort()).toEqual(["alpha__a_tool", "beta__b_tool"]);+ expect(tools.map((t) => t.name).sort()).toEqual(["a_tool", "b_tool"]);+ });++ it("throws and recommends manual namespacing when two resolvers emit the same name", async () => {+ const ctx = createCtx();+ const alpha = createResolver("alpha", ["session.started"], () => ({+ shared: createReplayableTool(),+ }));+ const beta = createResolver("beta", ["session.started"], () => ({+ shared: createReplayableTool(),+ }));++ await expect(+ dispatchDynamicToolEvent({+ ctx,+ resolvers: [alpha, beta],+ messages: [],+ event: makeEvent("session.started"),+ }),+ ).rejects.toThrow(/Dynamic tool "shared".*Namespace the map key manually/u);});it("does not clobber session metadata when a different event resolves tools", async () => {@@ -651,7 +670,7 @@ describe("dispatchDynamicToolEvent", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("tenant__query");+ expect(tools[0]!.name).toBe("query");} finally {registry.delete(stepId);}@@ -689,7 +708,7 @@ describe("dispatchDynamicToolEvent", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("good__working");+ expect(tools[0]!.name).toBe("working");});it("uses file slug when handler returns a single entry", async () => {@@ -746,14 +765,14 @@ describe("framework dynamic tools (no bundler transform)", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("fwk__search");+ expect(tools[0]!.name).toBe("search");// Simulate step boundary — virtual context cleared, durable survivesctx.clearVirtualContext();const replayedTools = buildDynamicTools(ctx);expect(replayedTools).toHaveLength(1);- expect(replayedTools[0]!.name).toBe("fwk__search");+ expect(replayedTools[0]!.name).toBe("search");// Execute the replayed tool — the original closure is invokedawait replayedTools[0]!.execute!({ query: "test" });@@ -782,7 +801,7 @@ describe("framework dynamic tools (no bundler transform)", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("helper__assist");+ expect(tools[0]!.name).toBe("assist");await tools[0]!.execute!({ action: "help" });expect(executeFn).toHaveBeenCalledWith({ action: "help" });@@ -811,7 +830,7 @@ describe("framework dynamic tools (no bundler transform)", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(2);- expect(tools.map((t) => t.name).sort()).toEqual(["authored__query", "fwk__search"]);+ expect(tools.map((t) => t.name).sort()).toEqual(["query", "search"]);});it("single-entry framework tool uses slug as name", async () => {@@ -854,13 +873,13 @@ describe("framework dynamic tools (no bundler transform)", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);- expect(tools[0]!.name).toBe("connection__risky");+ expect(tools[0]!.name).toBe("risky");expect(tools[0]!.needsApproval).toBe(approvalFn);expect(tools[0]!.needsApproval!({approvedTools: new Set(),toolInput: undefined,- toolName: "connection__risky",+ toolName: "risky",}),).toBe(true);});diff --git a/packages/eve/src/context/dynamic-tool-lifecycle.ts b/packages/eve/src/context/dynamic-tool-lifecycle.tsindex 76f1bbaf2..4a129849c 100644--- a/packages/eve/src/context/dynamic-tool-lifecycle.ts+++ b/packages/eve/src/context/dynamic-tool-lifecycle.ts@@ -68,13 +68,15 @@ function qualifyDynamicToolNames(if (keys.length === 0) return result;+ // A single returned defineTool is named after the file slug; a map names each+ // entry by its bare key (authors namespace keys themselves if needed).if (isSingle) {result.push({ name: slug, entryKey: keys[0]!, entry: entries[keys[0]!]! });return result;}for (const key of keys) {- result.push({ name: `${slug}__${key}`, entryKey: key, entry: entries[key]! });+ result.push({ name: key, entryKey: key, entry: entries[key]! });}return result;}@@ -228,6 +230,10 @@ async function resolveToolsFromEvent(const metadata: DurableDynamicToolMetadata[] = [];const liveTools: HarnessToolDefinition[] = [];+ // Tracks which resolver claimed each name so two dynamic resolvers can't+ // silently shadow each other (a dynamic tool overriding an authored one is+ // allowed and handled at merge time).+ const dynamicToolOwners = new Map<string, string>();for (const outcome of outcomes) {if (outcome.status === "rejected") {@@ -241,6 +247,14 @@ async function resolveToolsFromEvent(const { resolver, entries, isSingle } = outcome.value;const named = qualifyDynamicToolNames(resolver.slug, isSingle, entries);for (const { name, entryKey, entry } of named) {+ const previousOwner = dynamicToolOwners.get(name);+ if (previousOwner !== undefined && previousOwner !== resolver.slug) {+ throw new Error(+ `Dynamic tool "${name}" from resolver "${resolver.slug}" collides with dynamic resolver "${previousOwner}". Namespace the map key manually, e.g. "${resolver.slug}__${name}".`,+ );+ }+ dynamicToolOwners.set(name, resolver.slug);+liveTools.push(toHarnessToolDefinition(name, entry));const stepFn =diff --git a/packages/eve/src/harness/code-mode.test.ts b/packages/eve/src/harness/code-mode.test.tsindex 21127c672..e7df568a4 100644--- a/packages/eve/src/harness/code-mode.test.ts+++ b/packages/eve/src/harness/code-mode.test.ts@@ -287,7 +287,7 @@ describe("applySandboxToolSet", () => {description: "Requires approval.",execute: async () => "ok",inputSchema: jsonSchema({ type: "object" }),- name: "connection__tfl__getLineStatus",+ name: "tfl__getLineStatus",needsApproval,},]);@@ -295,7 +295,7 @@ describe("applySandboxToolSet", () => {const hostTools = await contextStorage.run(ctx, () =>buildSandboxHostTools({ tools: new Map() }),);- const guardedTool = hostTools.connection__tfl__getLineStatus as {+ const guardedTool = hostTools.tfl__getLineStatus as {needsApproval?: (input: unknown) => Promise<boolean> | boolean;};diff --git a/packages/eve/src/harness/tool-loop.test.ts b/packages/eve/src/harness/tool-loop.test.tsindex 666137995..123592722 100644--- a/packages/eve/src/harness/tool-loop.test.ts+++ b/packages/eve/src/harness/tool-loop.test.ts@@ -568,7 +568,7 @@ describe("createToolLoopHarness", () => {description: "Get TfL line status.",execute: vi.fn().mockResolvedValue({ ok: true }),inputSchema: jsonSchema({ type: "object" }),- name: "connection__tfl__getLineStatus",+ name: "tfl__getLineStatus",needsApproval,},]);@@ -581,13 +581,13 @@ describe("createToolLoopHarness", () => {| { tools: Record<string, { needsApproval?: (toolInput: unknown) => Promise<boolean> }> }| undefined;expect(agentCall).toBeDefined();- const dynamicTool = agentCall!.tools.connection__tfl__getLineStatus!;+ const dynamicTool = agentCall!.tools.tfl__getLineStatus!;await expect(dynamicTool.needsApproval?.({ line: "victoria" })).resolves.toBe(true);expect(needsApproval).toHaveBeenCalledExactlyOnceWith({approvedTools: new Set(),toolInput: { line: "victoria" },- toolName: "connection__tfl__getLineStatus",+ toolName: "tfl__getLineStatus",});});diff --git a/packages/eve/src/harness/tool-loop.ts b/packages/eve/src/harness/tool-loop.tsindex ea56402ea..3731e22e4 100644--- a/packages/eve/src/harness/tool-loop.ts+++ b/packages/eve/src/harness/tool-loop.ts@@ -658,8 +658,9 @@ export function createToolLoopHarness(config: ToolLoopHarnessConfig): StepFn {disabledProviderTools: opts.disabledProviderTools,tools: dynamicTools,});+ // Dynamic tools override a same-named authored tool.for (const [name, toolDefinition] of Object.entries(dynamicToolSet)) {- flatTools[name] ??= toolDefinition;+ flatTools[name] = toolDefinition;}}diff --git a/packages/eve/src/public/definitions/connections/openapi.ts b/packages/eve/src/public/definitions/connections/openapi.tsindex a112779ad..36f59faf9 100644--- a/packages/eve/src/public/definitions/connections/openapi.ts+++ b/packages/eve/src/public/definitions/connections/openapi.ts@@ -26,7 +26,7 @@ export type OpenAPISpecSource = string | Record<string, unknown>;** Each operation in the document becomes a connection tool the model can* discover via `connection_search` and call by its qualified name (e.g.- * `connection__vercel__getProjects`). The tool name is the operation's+ * `vercel__getProjects`). The tool name is the operation's* `operationId`; operations without one get a deterministic synthesized* name (`<method>_<sanitized-path>`).*diff --git a/packages/eve/src/public/definitions/tool.ts b/packages/eve/src/public/definitions/tool.tsindex f0bdf282e..3f716513e 100644--- a/packages/eve/src/public/definitions/tool.ts+++ b/packages/eve/src/public/definitions/tool.ts@@ -264,6 +264,12 @@ export function defineTool<TInput = unknown, TOutput = unknown>(* },* });* ```+ *+ * A single return is named after the file slug. A map names each entry by its+ * bare key — there is no automatic slug prefix, so namespace keys yourself+ * (e.g. `team__playbook`) when a bare name might collide. A dynamic tool/skill+ * whose name matches an authored one overrides it; two dynamic resolvers+ * emitting the same name is an error.*/export function defineDynamic(definition: { readonly events: DynamicEvents }): DynamicSentinel {const sentinel: DynamicSentinel = {diff --git a/packages/eve/src/runtime/framework-tools/connection-search-dynamic.test.ts b/packages/eve/src/runtime/framework-tools/connection-search-dynamic.test.tsindex 2d9711d8d..29dcb3c3f 100644--- a/packages/eve/src/runtime/framework-tools/connection-search-dynamic.test.ts+++ b/packages/eve/src/runtime/framework-tools/connection-search-dynamic.test.ts@@ -15,12 +15,12 @@ describe("extractDiscoveredTools", () => {{type: "tool-result",toolCallId: "call-1",- toolName: "connection__search",+ toolName: "connection_search",output: [{connection: "linear",tool: "list_issues",- qualifiedName: "connection__linear__list_issues",+ qualifiedName: "linear__list_issues",description: "List issues",inputSchema: { type: "object" },outputSchema: { type: "object" },@@ -33,7 +33,7 @@ describe("extractDiscoveredTools", () => {const result = extractDiscoveredTools(messages);expect(result).toHaveLength(1);- expect(result[0]!.qualifiedName).toBe("connection__linear__list_issues");+ expect(result[0]!.qualifiedName).toBe("linear__list_issues");expect(result[0]!.connection).toBe("linear");expect(result[0]!.tool).toBe("list_issues");expect(result[0]!.outputSchema).toEqual({ type: "object" });@@ -47,14 +47,14 @@ describe("extractDiscoveredTools", () => {{type: "tool-result",toolCallId: "call-1",- toolName: "connection__search",+ toolName: "connection_search",output: {type: "json",value: [{connection: "linear",tool: "list_issues",- qualifiedName: "connection__linear__list_issues",+ qualifiedName: "linear__list_issues",description: "List issues",inputSchema: { type: "object" },},@@ -67,7 +67,7 @@ describe("extractDiscoveredTools", () => {const result = extractDiscoveredTools(messages);expect(result).toHaveLength(1);- expect(result[0]!.qualifiedName).toBe("connection__linear__list_issues");+ expect(result[0]!.qualifiedName).toBe("linear__list_issues");});it("returns empty for no tool results", () => {@@ -83,12 +83,12 @@ describe("extractDiscoveredTools", () => {{type: "tool-result",toolCallId: "call-1",- toolName: "connection__search",+ toolName: "connection_search",output: [{connection: "linear",tool: "list_issues",- qualifiedName: "connection__linear__list_issues",+ qualifiedName: "linear__list_issues",description: "Old description",},],@@ -101,12 +101,12 @@ describe("extractDiscoveredTools", () => {{type: "tool-result",toolCallId: "call-2",- toolName: "connection__search",+ toolName: "connection_search",output: [{connection: "linear",tool: "list_issues",- qualifiedName: "connection__linear__list_issues",+ qualifiedName: "linear__list_issues",description: "New description",},],@@ -128,7 +128,7 @@ describe("extractDiscoveredTools", () => {{type: "tool-result",toolCallId: "call-1",- toolName: "connection__search",+ toolName: "connection_search",output: [{connection: "linear",@@ -137,7 +137,7 @@ describe("extractDiscoveredTools", () => {{connection: "linear",tool: "list_issues",- qualifiedName: "connection__linear__list_issues",+ qualifiedName: "linear__list_issues",description: "Valid",},],diff --git a/packages/eve/src/runtime/framework-tools/connection-search-dynamic.ts b/packages/eve/src/runtime/framework-tools/connection-search-dynamic.tsindex cd31077a1..7db90493a 100644--- a/packages/eve/src/runtime/framework-tools/connection-search-dynamic.ts+++ b/packages/eve/src/runtime/framework-tools/connection-search-dynamic.ts@@ -274,7 +274,7 @@ async function executeConnectionSearch(description: tool.description,inputSchema: tool.inputSchema,outputSchema: tool.outputSchema,- qualifiedName: `connection__${qualifiedConnectionToolName(conn.connectionName, tool.name)}`,+ qualifiedName: qualifiedConnectionToolName(conn.connectionName, tool.name),tool: tool.name,},score,@@ -331,7 +331,7 @@ export function extractDiscoveredTools(output?: unknown;}>;for (const part of parts) {- if (part.type !== "tool-result" || part.toolName !== "connection__search") continue;+ if (part.type !== "tool-result" || part.toolName !== "connection_search") continue;const output = part.output;if (output === undefined || output === null) continue;const items = (@@ -381,11 +381,11 @@ export function createConnectionSearchEvents(): DynamicToolEvents {// eslint-disable-next-line @typescript-eslint/no-explicit-anyconst tools: Record<string, DynamicToolEntry<any, any>> = {};- tools["search"] = {+ tools["connection_search"] = {description:"Search for tools across your connections. " +"Discovered tools become directly callable by their qualified name " +- "(e.g. `connection__linear__list_issues`) in your next response. " ++ "(e.g. `linear__list_issues`) in your next response. " +`Available connections: ${connectionNames.join(", ")}.`,inputSchema: {type: "object" as const,diff --git a/packages/eve/src/runtime/prompt/connections.ts b/packages/eve/src/runtime/prompt/connections.tsindex 6ce27f190..1ac0c9528 100644--- a/packages/eve/src/runtime/prompt/connections.ts+++ b/packages/eve/src/runtime/prompt/connections.ts@@ -21,6 +21,6 @@ export function formatConnectionsSection("Available connections:",...connectionList,"",- "Use connection__search to discover specific tools within a connection. Discovered tools become directly callable by their qualified name (e.g. connection__linear__list_issues) in your next response.",+ "Use connection_search to discover specific tools within a connection. Discovered tools become directly callable by their qualified name (e.g. linear__list_issues) in your next response.",].join("\n");}