melchizedek-agents 0.20.0 → 1.0.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.
Files changed (207) hide show
  1. package/.env.example +4 -5
  2. package/AGENT_SETUP.md +3 -3
  3. package/CHANGELOG.md +240 -0
  4. package/DOCUMENTATION.md +142 -150
  5. package/QUICKSTART.md +12 -11
  6. package/README.md +11 -11
  7. package/config/agents/examples/image_production.yaml +2 -2
  8. package/config/agents/syndicateSchema.yaml +52 -26
  9. package/dist/lib/a2a/app.d.ts +17 -12
  10. package/dist/lib/a2a/app.js +16 -6
  11. package/dist/lib/a2a/executor.d.ts +10 -14
  12. package/dist/lib/a2a/executor.js +10 -18
  13. package/dist/lib/a2a/remoteAgent.d.ts +5 -12
  14. package/dist/lib/a2a/remoteAgent.js +5 -12
  15. package/dist/lib/compile.d.ts +76 -86
  16. package/dist/lib/compile.js +100 -116
  17. package/dist/lib/compileNative.d.ts +44 -56
  18. package/dist/lib/compileNative.js +91 -89
  19. package/dist/lib/config.d.ts +6 -6
  20. package/dist/lib/config.js +6 -6
  21. package/dist/lib/doctor.d.ts +8 -14
  22. package/dist/lib/doctor.js +10 -46
  23. package/dist/lib/index.d.ts +12 -9
  24. package/dist/lib/index.js +10 -11
  25. package/dist/lib/loadSyndicate.d.ts +3 -3
  26. package/dist/lib/loadSyndicate.js +2 -2
  27. package/dist/lib/memory/erase.d.ts +1 -1
  28. package/dist/lib/memory/erase.js +1 -1
  29. package/dist/lib/memory/namespace.d.ts +12 -14
  30. package/dist/lib/memory/namespace.js +13 -14
  31. package/dist/lib/memory/providers.d.ts +4 -5
  32. package/dist/lib/memory/providers.js +12 -6
  33. package/dist/lib/memory/supabaseMemoryService.d.ts +9 -30
  34. package/dist/lib/memory/supabaseMemoryService.js +8 -30
  35. package/dist/lib/model.d.ts +6 -12
  36. package/dist/lib/model.js +6 -12
  37. package/dist/lib/models/adapterResolver.d.ts +21 -40
  38. package/dist/lib/models/adapterResolver.js +32 -40
  39. package/dist/lib/models/chatCompletionsAdapter.d.ts +12 -33
  40. package/dist/lib/models/chatCompletionsAdapter.js +13 -18
  41. package/dist/lib/models/circuitBreaker.d.ts +5 -5
  42. package/dist/lib/models/circuitBreaker.js +5 -5
  43. package/dist/lib/models/claudeAdapter.d.ts +9 -26
  44. package/dist/lib/models/claudeAdapter.js +11 -15
  45. package/dist/lib/models/claudeModels.d.ts +4 -4
  46. package/dist/lib/models/claudeModels.js +4 -4
  47. package/dist/lib/models/contract.d.ts +11 -11
  48. package/dist/lib/models/contract.js +6 -6
  49. package/dist/lib/models/errorResponse.d.ts +13 -20
  50. package/dist/lib/models/errorResponse.js +0 -12
  51. package/dist/lib/models/fallbackAdapter.d.ts +7 -8
  52. package/dist/lib/models/gatewayAdapter.d.ts +1 -1
  53. package/dist/lib/models/gatewayAdapter.js +1 -1
  54. package/dist/lib/models/geminiAdapter.d.ts +5 -6
  55. package/dist/lib/models/geminiAdapter.js +9 -10
  56. package/dist/lib/models/geminiState.d.ts +8 -8
  57. package/dist/lib/models/geminiState.js +8 -8
  58. package/dist/lib/models/genaiMapping.d.ts +82 -36
  59. package/dist/lib/models/genaiMapping.js +41 -41
  60. package/dist/lib/models/gptAdapter.d.ts +11 -11
  61. package/dist/lib/models/gptAdapter.js +13 -13
  62. package/dist/lib/models/kimiAdapter.d.ts +6 -7
  63. package/dist/lib/models/kimiAdapter.js +6 -9
  64. package/dist/lib/models/ollamaAdapter.d.ts +3 -3
  65. package/dist/lib/models/ollamaAdapter.js +3 -3
  66. package/dist/lib/models/providerMap.d.ts +6 -5
  67. package/dist/lib/models/providerMap.js +6 -5
  68. package/dist/lib/models/providerState.d.ts +3 -2
  69. package/dist/lib/models/providerState.js +3 -2
  70. package/dist/lib/models/reasoning.d.ts +1 -1
  71. package/dist/lib/models/registry.d.ts +26 -73
  72. package/dist/lib/models/registry.js +31 -144
  73. package/dist/lib/models/retry.d.ts +2 -2
  74. package/dist/lib/models/retry.js +2 -2
  75. package/dist/lib/models/schemaNormalize.d.ts +25 -55
  76. package/dist/lib/models/schemaNormalize.js +30 -100
  77. package/dist/lib/observability/lineage.d.ts +3 -3
  78. package/dist/lib/observability/lineage.js +10 -10
  79. package/dist/lib/observability/supabaseSpanExporter.js +1 -1
  80. package/dist/lib/observability/tracer.d.ts +25 -23
  81. package/dist/lib/observability/tracer.js +26 -63
  82. package/dist/lib/persistence/supabaseProvider.d.ts +4 -3
  83. package/dist/lib/runtime/approvals.d.ts +1 -1
  84. package/dist/lib/runtime/credentials.d.ts +1 -1
  85. package/dist/lib/runtime/events.d.ts +3 -4
  86. package/dist/lib/runtime/events.js +3 -4
  87. package/dist/lib/runtime/logging.d.ts +3 -8
  88. package/dist/lib/runtime/logging.js +3 -8
  89. package/dist/lib/runtime/memoryService.d.ts +4 -6
  90. package/dist/lib/runtime/memoryService.js +3 -5
  91. package/dist/lib/runtime/native/agentLoop.d.ts +18 -16
  92. package/dist/lib/runtime/native/agentLoop.js +38 -26
  93. package/dist/lib/runtime/native/compaction.d.ts +10 -11
  94. package/dist/lib/runtime/native/compaction.js +10 -11
  95. package/dist/lib/runtime/native/delegate.d.ts +13 -14
  96. package/dist/lib/runtime/native/delegate.js +11 -18
  97. package/dist/lib/runtime/native/history.d.ts +5 -6
  98. package/dist/lib/runtime/native/history.js +5 -6
  99. package/dist/lib/runtime/native/interrupts.d.ts +6 -6
  100. package/dist/lib/runtime/native/interrupts.js +6 -6
  101. package/dist/lib/runtime/native/request.d.ts +24 -24
  102. package/dist/lib/runtime/native/request.js +35 -24
  103. package/dist/lib/runtime/native/selfCorrection.d.ts +32 -32
  104. package/dist/lib/runtime/native/selfCorrection.js +34 -34
  105. package/dist/lib/runtime/native/step.d.ts +23 -23
  106. package/dist/lib/runtime/native/step.js +49 -27
  107. package/dist/lib/runtime/native/taskMode.d.ts +8 -8
  108. package/dist/lib/runtime/native/taskMode.js +8 -8
  109. package/dist/lib/runtime/native/telemetry.d.ts +11 -11
  110. package/dist/lib/runtime/native/telemetry.js +11 -11
  111. package/dist/lib/runtime/native/tempState.d.ts +4 -4
  112. package/dist/lib/runtime/native/tempState.js +4 -4
  113. package/dist/lib/runtime/nativeTurn.d.ts +29 -32
  114. package/dist/lib/runtime/nativeTurn.js +30 -41
  115. package/dist/lib/runtime/questions.d.ts +8 -9
  116. package/dist/lib/runtime/questions.js +1 -2
  117. package/dist/lib/runtime/runtimeFlag.d.ts +28 -14
  118. package/dist/lib/runtime/runtimeFlag.js +38 -16
  119. package/dist/lib/runtime/sessions.d.ts +10 -12
  120. package/dist/lib/runtime/sessions.js +10 -12
  121. package/dist/lib/runtime/syndicateTurn.d.ts +44 -45
  122. package/dist/lib/runtime/syndicateTurn.js +163 -158
  123. package/dist/lib/runtime/turnControl.d.ts +8 -8
  124. package/dist/lib/runtime/turnControl.js +8 -8
  125. package/dist/lib/session/supabaseSessionService.d.ts +7 -21
  126. package/dist/lib/session/supabaseSessionService.js +7 -43
  127. package/dist/lib/session/transcript.d.ts +16 -26
  128. package/dist/lib/session/transcript.js +17 -57
  129. package/dist/lib/storage/postgres/sessionService.d.ts +6 -20
  130. package/dist/lib/storage/postgres/sessionService.js +6 -39
  131. package/dist/lib/syndicateSchema.js +7 -6
  132. package/dist/lib/toolRegistry.d.ts +9 -14
  133. package/dist/lib/toolRegistry.js +36 -33
  134. package/dist/lib/tools/auth.d.ts +1 -1
  135. package/dist/lib/tools/auth.js +1 -1
  136. package/dist/lib/tools/examples.d.ts +2 -4
  137. package/dist/lib/tools/examples.js +2 -4
  138. package/dist/lib/tools/generateImageTool.d.ts +3 -3
  139. package/dist/lib/tools/generateImageTool.js +4 -5
  140. package/dist/lib/tools/inspectImageTool.d.ts +2 -2
  141. package/dist/lib/tools/inspectImageTool.js +3 -4
  142. package/dist/lib/tools/mcpToolFactory.d.ts +4 -24
  143. package/dist/lib/tools/mcpToolFactory.js +19 -9
  144. package/dist/lib/tools/memoryTools.d.ts +5 -6
  145. package/dist/lib/tools/memoryTools.js +5 -6
  146. package/dist/lib/tools/nativeTools.d.ts +9 -14
  147. package/dist/lib/tools/nativeTools.js +9 -14
  148. package/dist/lib/tools/openapiTools.d.ts +5 -7
  149. package/dist/lib/tools/openapiTools.js +6 -13
  150. package/dist/lib/tools/scienceTools.d.ts +3 -3
  151. package/dist/lib/tools/scienceTools.js +8 -10
  152. package/dist/lib/tools/skillToolset.d.ts +1 -2
  153. package/dist/lib/tools/skillToolset.js +1 -2
  154. package/dist/lib/tools/skills/executor.d.ts +1 -1
  155. package/dist/lib/tools/skills/executor.js +1 -1
  156. package/dist/lib/tools/skills/frontmatter.d.ts +2 -2
  157. package/dist/lib/tools/skills/frontmatter.js +2 -2
  158. package/dist/lib/tools/skills/tools.d.ts +8 -10
  159. package/dist/lib/tools/skills/tools.js +9 -11
  160. package/dist/lib/tools/tool.d.ts +24 -40
  161. package/dist/lib/tools/tool.js +24 -56
  162. package/dist/lib/tools/toolContract.d.ts +8 -13
  163. package/dist/lib/tools/toolContract.js +6 -17
  164. package/dist/lib/tools/webExtractTool.d.ts +2 -2
  165. package/dist/lib/tools/webExtractTool.js +3 -4
  166. package/dist/lib/tools/wikiTools.d.ts +2 -2
  167. package/dist/lib/tools/wikiTools.js +5 -6
  168. package/dist/lib/tools/xApiSearchTool.d.ts +2 -2
  169. package/dist/lib/tools/xApiSearchTool.js +3 -4
  170. package/dist/lib/tools/xaiSearchParams.d.ts +2 -5
  171. package/dist/lib/tools/xaiSearchParams.js +2 -5
  172. package/dist/lib/wiki/agentRun.d.ts +10 -11
  173. package/dist/lib/wiki/agentRun.js +24 -42
  174. package/dist/lib/workflow/agentNode.d.ts +10 -1
  175. package/dist/lib/workflow/agentNode.js +5 -3
  176. package/dist/lib/workflow/graph.d.ts +8 -9
  177. package/dist/lib/workflow/graph.js +12 -12
  178. package/dist/lib/workflow/nodeEvents.d.ts +5 -5
  179. package/dist/lib/workflow/nodeEvents.js +5 -5
  180. package/dist/lib/workflow/pause.d.ts +5 -4
  181. package/dist/lib/workflow/pause.js +5 -4
  182. package/dist/lib/workflow/resume.d.ts +4 -4
  183. package/dist/lib/workflow/resume.js +4 -4
  184. package/dist/lib/workflow/route.d.ts +7 -7
  185. package/dist/lib/workflow/route.js +8 -8
  186. package/dist/lib/workflow/scheduler.d.ts +44 -2
  187. package/dist/lib/workflow/scheduler.js +60 -6
  188. package/dist/lib/workflow/toolNode.d.ts +18 -29
  189. package/dist/lib/workflow/toolNode.js +29 -35
  190. package/dist/lib/workflow/turn.d.ts +29 -20
  191. package/dist/lib/workflow/turn.js +111 -24
  192. package/dist/lib/workflow.d.ts +34 -60
  193. package/dist/lib/workflow.js +34 -168
  194. package/dist/lib/workflowConfig.d.ts +2 -10
  195. package/dist/lib/workflowConfig.js +2 -31
  196. package/dist/scripts/a2a_server.js +1 -2
  197. package/dist/scripts/assistant_worker.d.ts +2 -2
  198. package/dist/scripts/assistant_worker.js +8 -7
  199. package/dist/scripts/doctor.d.ts +2 -2
  200. package/dist/scripts/doctor.js +2 -2
  201. package/dist/scripts/syndicate_chat.js +14 -24
  202. package/package.json +3 -9
  203. package/skills/briefs/_shared.md +2 -2
  204. package/skills/briefs/melchizedek-author.md +2 -2
  205. package/skills/briefs/melchizedek-models.md +6 -6
  206. package/skills/melchizedek-author/SKILL.md +2 -2
  207. package/skills/melchizedek-models/SKILL.md +5 -5
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # melchizedek-agents
2
2
 
3
- A multi-model, multi-agent orchestration framework built on the Google Agent Development Kit (ADK). Agent hierarchies, prompts, models, tools, and delegation rules are declared in YAML files called **Syndicates**; the engine in `lib/` runs whatever you put in `config/agents/`.
3
+ A multi-model, multi-agent orchestration framework with its own agent loop, model contract, tools, sessions and workflow engine. Agent hierarchies, prompts, models, tools, and delegation rules are declared in YAML files called **Syndicates**; the engine in `lib/` runs whatever you put in `config/agents/`.
4
4
 
5
- Gemini runs natively, Claude runs via a bundled adapter, GPT, Grok, and Kimi route to their providers, and open-weight models run locally through Ollama with no API key. A subagent can also pick up tools at runtime from a Model Context Protocol (MCP) server.
5
+ Gemini, Claude, GPT, Grok, and Kimi each run on the engine's own adapter for their provider's API, and open-weight models run locally through Ollama with no API key. A subagent can also pick up tools at runtime from a Model Context Protocol (MCP) server.
6
6
 
7
7
  > Companion repository for the curriculum at [lyceumagents.com/curriculum](https://lyceumagents.com/curriculum/). The framework works standalone or alongside the course.
8
8
 
@@ -60,7 +60,7 @@ Test the providers you have keys for:
60
60
 
61
61
  ```bash
62
62
  npm run demo:models # one prompt to every available provider, with token/latency traces
63
- npm run demo:direct # a single ADK call without syndicate orchestration
63
+ npm run demo:direct # a single model call without syndicate orchestration
64
64
  ```
65
65
 
66
66
  ---
@@ -73,15 +73,15 @@ Install into your existing project:
73
73
  npm install melchizedek-agents
74
74
  ```
75
75
 
76
- `@google/adk` is an optional peer since 0.20.0: install it beside the package (`npm install @google/adk@~2.2.0`) only to run on the `adk` runtime.
76
+ The package has no Google ADK dependency: 1.0.0 removed ADK, and every turn runs on the engine's own agent loop. Upgrading from 0.x: read the 1.0.0 "Breaking — read before upgrading" section of [`CHANGELOG.md`](./CHANGELOG.md).
77
77
 
78
78
  Define your agents in `./config/agents/mine.yaml`, then run turns programmatically:
79
79
 
80
80
  ```typescript
81
- import { InProcessSessionService, asAdkSessionService, loadSyndicate, registerAvailableProviders, runSyndicateTurn } from 'melchizedek-agents';
81
+ import { InProcessSessionService, loadSyndicate, logProviderStatuses, runSyndicateTurn } from 'melchizedek-agents';
82
82
 
83
- // 1. Register a provider for every key that is set
84
- registerAvailableProviders();
83
+ // 1. Report which providers have a key set
84
+ logProviderStatuses(console.log);
85
85
 
86
86
  // 2. Load and validate syndicate YAML from ./config/agents/
87
87
  const config = loadSyndicate('mine.yaml');
@@ -93,7 +93,7 @@ const result = await runSyndicateTurn({
93
93
  appName: 'my-app',
94
94
  userId: 'user-42',
95
95
  sessionId: 'conversation-7', // same id, same conversation
96
- sessionService: asAdkSessionService(new InProcessSessionService()),
96
+ sessionService: new InProcessSessionService(),
97
97
  events: {
98
98
  onProgress: (line) => console.log('…', line)
99
99
  },
@@ -102,7 +102,7 @@ const result = await runSyndicateTurn({
102
102
  console.log(result.status, result.text);
103
103
  ```
104
104
 
105
- `runSyndicateTurn` is the same runtime the server, CLI, and eval harness use. Since 0.20.0 it runs every syndicate on the engine's own loop and scheduler (the `native` runtime) by default. `MELCHIZEDEK_RUNTIME=adk` (or `runtime: 'adk'`) runs it on Google ADK instead, with `@google/adk` installed, until 1.0.0 removes that runtime; `npx melchizedek-doctor` prints the runtime in use and whether ADK is installed ([ADR 0102](./wiki/decisions/0102-native-default-and-optional-adk-peer.md)). To read syndicates from somewhere else, pass `loadSyndicate(file, { agentsDir })` or set `MELCHIZEDEK_AGENTS_DIR`. To serve inside your own Express app, mount `(await createA2AApp({ defaultSyndicate: 'mine.yaml', serverSecret })).app`.
105
+ `runSyndicateTurn` is the same runtime the server, CLI, and eval harness use. It runs every syndicate on the engine's own agent loop and, for a workflow, its own scheduler (the `native` runtime, the only one). `MELCHIZEDEK_RUNTIME=adk` is an error that names 1.0.0; `npx melchizedek-doctor` prints the runtime in use (ADR 0107). To read syndicates from somewhere else, pass `loadSyndicate(file, { agentsDir })` or set `MELCHIZEDEK_AGENTS_DIR`. To serve inside your own Express app, mount `(await createA2AApp({ defaultSyndicate: 'mine.yaml', serverSecret })).app`.
106
106
 
107
107
  The example syndicates ship inside the package at `node_modules/melchizedek-agents/config/agents/examples/`; copy one out as a starting point.
108
108
 
@@ -119,7 +119,7 @@ registerGuard(myGuardInstance);
119
119
 
120
120
  ### The Model Adapters Alone
121
121
 
122
- `melchizedek-agents/model` is the engine's model layer on its own: one message format for every provider, an adapter per provider, `resolveAdapter` over the same model-id prefixes the YAML uses, and `FallbackAdapter`. It loads no `@google/adk`. Since 0.20.0 ADK is an optional peer, so `npm install melchizedek-agents` leaves it out; the other peers (redis, the cloud SDKs) are optional too.
122
+ `melchizedek-agents/model` is the engine's model layer on its own: one message format for every provider, an adapter per provider, `resolveAdapter` over the same model-id prefixes the YAML uses, and `FallbackAdapter`. The peers (redis, the cloud SDKs) are optional.
123
123
 
124
124
  ```typescript
125
125
  import { ClaudeAdapter, OllamaAdapter, resolveAdapter } from 'melchizedek-agents/model';
@@ -149,7 +149,7 @@ console.log(await ask(new OllamaAdapter({ model: 'ollama/qwen3:8b' }), 'What is
149
149
  const adapter = resolveAdapter('ollama/qwen3:8b');
150
150
  ```
151
151
 
152
- A Gemini id resolves to the engine's `GeminiAdapter` here. The ADK-backed Gemini adapter, the ADK shims and `resolveModel` stay under `melchizedek-agents/models/*`, which need ADK.
152
+ A Gemini id resolves to the engine's `GeminiAdapter` here, on `@google/genai`.
153
153
 
154
154
  ### CLI & Server Utilities
155
155
 
@@ -2,8 +2,8 @@
2
2
  syndicate_name: "Multi-Modal Image Production Workflow"
3
3
  memory_system: "session-only"
4
4
 
5
- # WHY generate_image and inspect_image are FunctionTools, not subagents:
6
- # AgentTool converts all subagent traffic to plain text, so binary inlineData
5
+ # WHY generate_image and inspect_image are tools, not subagents:
6
+ # A subagent call carries only text, so binary inlineData
7
7
  # (image bytes) is silently dropped in either direction. generateImageTool
8
8
  # calls @google/genai directly, captures inlineData, writes the file to disk,
9
9
  # and returns the saved path; inspectImageTool reads that file back and runs
@@ -4,8 +4,14 @@
4
4
  # ============================================================
5
5
  #
6
6
  # This file documents ALL available properties for a syndicate
7
- # YAML definition. Every property name maps 1:1 to its ADK
8
- # counterpart so there is zero translation confusion.
7
+ # YAML definition. The agent fields keep the spelling of their
8
+ # Google ADK counterparts (LlmAgent, GenerateContentConfig), so a file
9
+ # written for ADK reads unchanged.
10
+ #
11
+ # Runtime (ADR 0107): the engine's own agent loop (the NATIVE runtime)
12
+ # runs every key below; 1.0.0 removed Google ADK, and nothing here
13
+ # needs it. A "Maps to:" line names the ADK field a key is spelled
14
+ # after: a spelling, not something ADK builds.
9
15
  #
10
16
  # It is an annotated EXAMPLE. The enforced contract is
11
17
  # lib/syndicateSchema.ts: every load validates against it and a
@@ -14,15 +20,16 @@
14
20
  # syndicate.schema.json (npm run schema:gen), is what the modeline
15
21
  # above points an editor at — add the same line to your own file.
16
22
  #
17
- # ADK source references:
18
- # LlmAgentConfig → @google/adk :: agents/llm_agent.d.ts
19
- # BaseAgentConfig → @google/adk :: agents/base_agent.d.ts
23
+ # Where the spellings come from (a reference, not a dependency):
24
+ # LlmAgentConfig → Google ADK 2.2 :: agents/llm_agent.d.ts
25
+ # BaseAgentConfig → Google ADK 2.2 :: agents/base_agent.d.ts
20
26
  # GenerateContentConfig → @google/genai :: GenerateContentConfig
21
27
  #
22
28
  # Legend:
23
29
  # [required] Must be provided
24
30
  # [optional] Can be omitted
25
- # ⚠ Note or constraint from ADK internals
31
+ # ⚠ Note or constraint the engine enforces (most were
32
+ # ADK's first)
26
33
  # ============================================================
27
34
 
28
35
  # ── Syndicate metadata ──────────────────────────────────────
@@ -46,9 +53,9 @@ syndicate_name: "My Syndicate"
46
53
  variables:
47
54
  my_variable: "default_value"
48
55
 
49
- # [optional] Self-correction, ON by default (ADK's reflect-and-retry
50
- # plugins, ADR 0034). model_errors: retries of a model reply ADK marks
51
- # malformed (default 2). tool_errors: retries of a tool that threw, with
56
+ # [optional] Self-correction, ON by default: ADK's reflect-and-retry
57
+ # behaviour, which the native loop ports (ADR 0034, ADR 0075). model_errors: retries of a model
58
+ # reply the runtime marks malformed (default 2). tool_errors: retries of a tool that threw, with
52
59
  # reflection guidance to the model (default 3). 0 turns either off. Every
53
60
  # retry is a model call under max_steps.
54
61
  # retries:
@@ -93,12 +100,13 @@ memory_extraction_model: "gemini-3.8-flash"
93
100
  # so it can be logged, traced, and streamed to a waiting user as
94
101
  # "[STATUS] Routed to <Name> — <reason>".
95
102
  #
96
- # ⚠ The orchestrator MUST be a leaf when using this: ADK refuses to combine
97
- # outputSchema with AgentTool delegation on one agent (see critic.yaml).
103
+ # ⚠ The orchestrator is a leaf in this mode: it gets no subagent tools on
104
+ # any provider, because outputSchema and subagent delegation do not
105
+ # combine on one agent (ADK refused it too; see examples/critic.yaml).
98
106
  # Pair the schema with generateContentConfig.responseMimeType:
99
107
  # "application/json".
100
- # ⚠ A2A-only — scripts/syndicate_chat.ts compiles every syndicate in
101
- # DELEGATE mode (same limitation as yaml_reference).
108
+ # Every surface runs it the same way: the A2A server and
109
+ # scripts/syndicate_chat.ts both run turns through runSyndicateTurn.
102
110
  #
103
111
  # Contract and fail-static rules: lib/dispatch.ts. Worked examples:
104
112
  # examples/research.yaml, templates/support_triage.yaml.
@@ -129,8 +137,10 @@ dispatch:
129
137
  # [optional] Switches this syndicate to a WORKFLOW: the agents below are
130
138
  # the nodes of a graph, and `edges` says what runs after what. Nothing
131
139
  # delegates, nothing classifies; the orchestrator is a node like any
132
- # other. Cannot be combined with `dispatch`. Contract: lib/workflow.ts;
133
- # worked example: examples/pipeline.yaml (ADR 0030).
140
+ # other. Cannot be combined with `dispatch`. Contract: lib/workflow.ts
141
+ # (the block's types and checks) and lib/workflow/ (the engine's own
142
+ # scheduler, which walks the graph); worked example:
143
+ # examples/pipeline.yaml (ADR 0030).
134
144
  #
135
145
  # - A chain is a list. `START` opens at least one chain. A name is an
136
146
  # agent or a declared node; a list of names fans out (after one
@@ -142,8 +152,17 @@ dispatch:
142
152
  # unless its YAML sets includeContents, sees nothing else.
143
153
  # - `ask_user` pauses the turn (input-required); the next message is
144
154
  # the answer, and the node outputs { reply, input }.
145
- # - require_approval, skills.scripts: local and a2a_agent_url are not
146
- # supported inside a workflow yet.
155
+ # - require_approval, and skills.scripts: local (each script run), on a
156
+ # node's agent pause that node, and the walk, until a person decides
157
+ # (ADR 0098, ADR 0106); neither is allowed on an agent a map runs. a2a_agent_url is
158
+ # not supported inside a workflow yet.
159
+ # - A yaml_reference to a workflow syndicate runs its whole graph as the
160
+ # node, on its own session (ADR 0106).
161
+ # - A route may lead back to an earlier node (a loop). max_steps bounds
162
+ # the model calls in it; a turn also starts at
163
+ # most 20 × max_steps node runs (at least 100), so a loop of tool nodes
164
+ # that never stops routing back fails the turn NODE_RUN_LIMIT
165
+ # (ADR 0105). Raise max_steps to raise it.
147
166
  # workflow:
148
167
  # edges:
149
168
  # - [START, OrchestratorName, { article: [MySubagent, Other], default: Other }]
@@ -161,7 +180,8 @@ dispatch:
161
180
  # max_concurrency: 4
162
181
 
163
182
  # ── Orchestrator ────────────────────────────────────────────
164
- # Maps to: new LlmAgent({ ... }) — the root agent passed to InMemoryRunner.
183
+ # The turn's root agent: the native loop runs it. Maps to: new
184
+ # LlmAgent({ ... }), the root agent of ADK's Runner.
165
185
 
166
186
  orchestrator:
167
187
 
@@ -179,7 +199,7 @@ orchestrator:
179
199
 
180
200
  # [required] The model to use. The id's prefix names the provider and the
181
201
  # framework routes accordingly (lib/models/registry.ts):
182
- # gemini-* → Google Gemini (ADK-native)
202
+ # gemini-* → Google Gemini (GEMINI_API_KEY; the engine's adapter)
183
203
  # claude-* → Anthropic (ANTHROPIC_API_KEY)
184
204
  # gpt-* /o* → OpenAI (OPENAI_API_KEY)
185
205
  # grok-* → xAI (XAI_API_KEY)
@@ -243,8 +263,9 @@ orchestrator:
243
263
  # stderr are each cut at 20,000 characters, with a line saying so.
244
264
  # Maps to: tools[] (a toolset) and instruction (the appended index)
245
265
 
246
- # [optional] Few-shot exchanges added to every request's instruction
247
- # (ADK's ExampleTool; the model never calls it). Up to 20.
266
+ # [optional] Few-shot exchanges added to every request's instruction,
267
+ # as ADK's ExampleTool added them (the model never calls it).
268
+ # Up to 20.
248
269
  # examples:
249
270
  # - input: "Is it going to rain in Lyon tomorrow?"
250
271
  # output: "Yes: 4 mm expected between 14:00 and 18:00."
@@ -333,9 +354,12 @@ orchestrator:
333
354
  reasoning: medium
334
355
 
335
356
  # ── generateContentConfig ─────────────────────────────────
336
- # Maps to: generateContentConfig on LlmAgent (→ GenerateContentConfig)
357
+ # The model request's settings, in @google/genai's GenerateContentConfig
358
+ # spelling; every provider adapter reads the fields it supports.
359
+ # Maps to: generateContentConfig on LlmAgent
337
360
  # ⚠ Do NOT set tools here — use the top-level `tools:` field. Set
338
- # reasoning with the `reasoning:` key above, not thinkingConfig.
361
+ # reasoning with the `reasoning:` key above (the preferred spelling,
362
+ # read the same way by every provider), not thinkingConfig.
339
363
 
340
364
  generateContentConfig:
341
365
 
@@ -387,7 +411,7 @@ orchestrator:
387
411
  threshold: "BLOCK_MEDIUM_AND_ABOVE"
388
412
 
389
413
  # ── Thinking config: the older spelling of `reasoning:` ─
390
- # Provider-specific: Gemini and Claude read thinkingConfig, the
414
+ # Prefer `reasoning:` in a new file. Provider-specific: Gemini and Claude read thinkingConfig, the
391
415
  # chat-completions and Responses providers read reasoningEffort, and
392
416
  # later Claude models read reasoningEffort first (ADR 0049).
393
417
  # Still accepted, but not together with `reasoning:` (a load error).
@@ -399,8 +423,10 @@ orchestrator:
399
423
  # reasoningEffort: "medium"
400
424
 
401
425
  # ── Subagents ───────────────────────────────────────────────
402
- # Each entry maps to: new LlmAgent({ ... }) wrapped in AgentTool
403
- # and passed to the orchestrator's tools[].
426
+ # Each entry is an agent the orchestrator calls as a tool (DELEGATE),
427
+ # a route (dispatch) or a node (workflow); the native loop runs it.
428
+ # Maps to: new LlmAgent({ ... }) wrapped in AgentTool and passed to the
429
+ # orchestrator's tools[].
404
430
 
405
431
  subagents:
406
432
 
@@ -27,18 +27,23 @@
27
27
  * durable when Supabase is configured. Run one replica, or put sticky
28
28
  * routing in front, until the task store is durable.
29
29
  *
30
- * Stores (ADR 0080): `storage` takes a session store and a memory service
31
- * with either face, the engine's or ADK's. In-process sessions are the
32
- * engine's InProcessSessionService. A `resolveModel` may still return an ADK
33
- * model instance: its type is CompileOptions'.
30
+ * Stores (ADR 0080, ADR 0107): `storage` takes the engine's SessionService
31
+ * and MemoryService. In-process sessions are the engine's
32
+ * InProcessSessionService. A `resolveModel` returns a model id or a
33
+ * ModelAdapter: its type is CompileOptions'.
34
+ *
35
+ * MELCHIZEDEK_RUNTIME and GEMINI_ADAPTER are read before anything else:
36
+ * `adk`, the runtime 1.0.0 removed, stops the server at startup
37
+ * (RuntimeRemovedError), and so does GEMINI_ADAPTER=adk, the removed ADK
38
+ * Gemini adapter (geminiAdapterSetting, lib/models/adapterResolver.ts).
34
39
  */
35
40
  import type { Express, Request, RequestHandler } from 'express';
36
41
  import type { Store } from 'express-rate-limit';
37
42
  import type { AgentCard } from '@a2a-js/sdk';
38
43
  import type { TaskStore } from '@a2a-js/sdk/server';
39
44
  import type { CompileOptions } from '../compile.ts';
40
- import type { EitherSessionService } from '../runtime/adkSessionBridge.ts';
41
- import type { EitherMemoryService } from '../runtime/adkMemoryBridge.ts';
45
+ import type { SessionService } from '../runtime/sessions.ts';
46
+ import type { MemoryService } from '../runtime/memoryService.ts';
42
47
  import type { SyndicateYamlConfig } from '../loadSyndicate.ts';
43
48
  import type { ProviderEndpoint, ProviderId } from '../models/registry.ts';
44
49
  import type { TurnLock } from './turnLock.ts';
@@ -88,10 +93,10 @@ export interface A2AAppOptions {
88
93
  * agent id (default: in-process).
89
94
  */
90
95
  storage?: {
91
- /** The engine's SessionService or ADK's BaseSessionService (ADR 0080). */
92
- sessionService: EitherSessionService;
93
- /** The engine's MemoryService or ADK's BaseMemoryService. */
94
- memoryService?: EitherMemoryService;
96
+ /** The engine's SessionService (ADR 0080, ADR 0107). */
97
+ sessionService: SessionService;
98
+ /** The engine's MemoryService. */
99
+ memoryService?: MemoryService;
95
100
  taskStore?: (agentId: string) => TaskStore;
96
101
  /** Erase everything stored for a scope (DELETE /memory). Without it the route answers 501. */
97
102
  erase?: (scopeKey: string, options: {
@@ -268,8 +273,8 @@ export interface A2AAppOptions {
268
273
  * Model resolution per request. Default: lib/models/registry.ts with the
269
274
  * caller's X-API-Key scoped to its X-Provider. Override to route through
270
275
  * your own gateway or credential store. Returns what
271
- * CompileOptions.resolveModel returns: a model id, or a model instance
272
- * (an ADK BaseLlm while the ADK runtime ships).
276
+ * CompileOptions.resolveModel returns: a model id, or a ModelAdapter
277
+ * (lib/models/contract.ts).
273
278
  */
274
279
  resolveModel?: (modelName: string | undefined, ctx: A2AContext) => ResolvedModel;
275
280
  /** Bindings applied at every config load (e.g. current_date). */
@@ -27,10 +27,15 @@
27
27
  * durable when Supabase is configured. Run one replica, or put sticky
28
28
  * routing in front, until the task store is durable.
29
29
  *
30
- * Stores (ADR 0080): `storage` takes a session store and a memory service
31
- * with either face, the engine's or ADK's. In-process sessions are the
32
- * engine's InProcessSessionService. A `resolveModel` may still return an ADK
33
- * model instance: its type is CompileOptions'.
30
+ * Stores (ADR 0080, ADR 0107): `storage` takes the engine's SessionService
31
+ * and MemoryService. In-process sessions are the engine's
32
+ * InProcessSessionService. A `resolveModel` returns a model id or a
33
+ * ModelAdapter: its type is CompileOptions'.
34
+ *
35
+ * MELCHIZEDEK_RUNTIME and GEMINI_ADAPTER are read before anything else:
36
+ * `adk`, the runtime 1.0.0 removed, stops the server at startup
37
+ * (RuntimeRemovedError), and so does GEMINI_ADAPTER=adk, the removed ADK
38
+ * Gemini adapter (geminiAdapterSetting, lib/models/adapterResolver.ts).
34
39
  */
35
40
  import express from 'express';
36
41
  import rateLimit, { ipKeyGenerator } from 'express-rate-limit';
@@ -40,6 +45,8 @@ import { DefaultRequestHandler, InMemoryTaskStore } from '@a2a-js/sdk/server';
40
45
  import { duplicateInterfacesForLegacy } from '@a2a-js/sdk/compat/v0_3';
41
46
  import { agentCardHandler, jsonRpcHandler, restHandler } from '@a2a-js/sdk/server/express';
42
47
  import { InProcessSessionService } from '../runtime/sessions.js';
48
+ import { runtimeSetting } from '../runtime/runtimeFlag.js';
49
+ import { geminiAdapterSetting } from '../models/adapterResolver.js';
43
50
  import { loadSyndicate, loadSyndicateFromRegistry } from '../loadSyndicate.js';
44
51
  import { providerForModel, resolveModel } from '../models/registry.js';
45
52
  import { createSupabaseServices, hasSupabaseCredentials } from '../persistence/supabaseProvider.js';
@@ -250,6 +257,9 @@ export function memoryAppName(cfg) {
250
257
  return cfg.memory_namespace || A2A_APP_NAME;
251
258
  }
252
259
  export async function createA2AApp(options) {
260
+ // A deployment still configured for the removed adk runtime fails here, naming 1.0.0 (ADR 0107).
261
+ runtimeSetting();
262
+ geminiAdapterSetting();
253
263
  const log = options.log ?? ((m) => console.log(`[A2A] ${m}`));
254
264
  const warn = options.warn ?? ((m) => console.warn(`[A2A] ⚠ ${m}`));
255
265
  const bindings = options.bindings ?? (() => ({
@@ -393,8 +403,8 @@ export async function createA2AApp(options) {
393
403
  const mode = cfg.memory_system;
394
404
  const sessionService = mode === 'internal-only' || !durableSessions ? internalSessions : durableSessions;
395
405
  // Pinned to the syndicate's namespace (ADR 0020), so every agent the
396
- // turn reaches — including AgentTool children, which run under their own
397
- // ADK app name — recalls and stores in the root syndicate's memory.
406
+ // turn reaches — including subagents, which run under their own app
407
+ // name — recalls and stores in the root syndicate's memory.
398
408
  const memory = mode === 'long-term' && memoryService ? namespacedMemoryService(memoryService, memoryAppName(cfg)) : undefined;
399
409
  if (memory)
400
410
  warnMemoryFlow(cfg);
@@ -9,19 +9,16 @@
9
9
  * the reply. Every turn semantic — dispatch, delegation, relay fallback,
10
10
  * guards, the step cap — is the runtime's.
11
11
  *
12
- * Its stores are the engine's (ADR 0080): it takes a session store and a
13
- * memory service with either face, the engine's or ADK's, reads a session
14
- * through the engine's SessionService, and hands the turn runner the faces
15
- * its fixed signature names through the bridges
16
- * (lib/runtime/adkSessionBridge.ts, lib/runtime/adkMemoryBridge.ts).
12
+ * Its stores are the engine's (ADR 0080, ADR 0107): a SessionService and a
13
+ * MemoryService, which it reads and hands the turn runner as they are.
17
14
  */
18
15
  import { AsyncLocalStorage } from 'node:async_hooks';
19
16
  import type { AgentExecutor, ExecutionEventBus, RequestContext } from '@a2a-js/sdk/server';
20
17
  import type { CompileOptions } from '../compile.ts';
21
18
  import type { SyndicateYamlConfig } from '../loadSyndicate.ts';
22
19
  import type { TurnLock } from './turnLock.ts';
23
- import type { EitherSessionService } from '../runtime/adkSessionBridge.ts';
24
- import type { EitherMemoryService } from '../runtime/adkMemoryBridge.ts';
20
+ import type { MemoryService } from '../runtime/memoryService.ts';
21
+ import type { SessionService } from '../runtime/sessions.ts';
25
22
  import type { PendingApproval } from '../runtime/approvals.ts';
26
23
  import type { MessagePart, SyndicateTurnResult } from '../runtime/syndicateTurn.ts';
27
24
  import type { ToolCredentials } from '../tools/oauthConsent.ts';
@@ -102,10 +99,10 @@ export declare function a2aPartsToMessage(rawParts: unknown[]): {
102
99
  };
103
100
  export interface ExecutorOptions {
104
101
  config: SyndicateYamlConfig;
105
- /** The conversation store: the engine's SessionService or ADK's BaseSessionService. */
106
- sessionService: EitherSessionService;
107
- /** Long-term memory: the engine's MemoryService or ADK's BaseMemoryService. */
108
- memoryService?: EitherMemoryService;
102
+ /** The conversation store: the engine's SessionService. */
103
+ sessionService: SessionService;
104
+ /** Long-term memory: the engine's MemoryService. */
105
+ memoryService?: MemoryService;
109
106
  /** Builds the per-request model resolver from the caller's context (BYOK). */
110
107
  compileFor: (ctx: A2AContext) => CompileOptions;
111
108
  /** Wall-clock budget per task in ms; 0 or undefined = none. */
@@ -200,10 +197,9 @@ export declare function answerStream(eventBus: ExecutionEventBus, taskId: string
200
197
  export declare class SyndicateExecutor implements AgentExecutor {
201
198
  private readonly opts;
202
199
  private configHash;
203
- /** The store as the engine reads it. */
200
+ /** The conversation store. */
204
201
  private readonly sessions;
205
- /** The faces the turn runner's fixed signature names (ADR 0045 item 4). */
206
- private readonly turnSessions;
202
+ /** Long-term memory, when the syndicate has it. */
207
203
  private readonly turnMemory;
208
204
  constructor(opts: ExecutorOptions);
209
205
  /** Provenance stamp for every turn this executor serves (lineage.ts). */
@@ -9,11 +9,8 @@
9
9
  * the reply. Every turn semantic — dispatch, delegation, relay fallback,
10
10
  * guards, the step cap — is the runtime's.
11
11
  *
12
- * Its stores are the engine's (ADR 0080): it takes a session store and a
13
- * memory service with either face, the engine's or ADK's, reads a session
14
- * through the engine's SessionService, and hands the turn runner the faces
15
- * its fixed signature names through the bridges
16
- * (lib/runtime/adkSessionBridge.ts, lib/runtime/adkMemoryBridge.ts).
12
+ * Its stores are the engine's (ADR 0080, ADR 0107): a SessionService and a
13
+ * MemoryService, which it reads and hands the turn runner as they are.
17
14
  */
18
15
  import { createHash, randomUUID } from 'node:crypto';
19
16
  import { AsyncLocalStorage } from 'node:async_hooks';
@@ -23,8 +20,6 @@ import { nestedLoader } from '../loadSyndicate.js';
23
20
  import { configDigest } from '../observability/lineage.js';
24
21
  import { turnLockKey } from './turnLock.js';
25
22
  import { ingestTurnMemory, runSyndicateTurn } from '../runtime/syndicateTurn.js';
26
- import { asAdkSessionService, asSessionService } from '../runtime/adkSessionBridge.js';
27
- import { asAdkMemoryService } from '../runtime/adkMemoryBridge.js';
28
23
  import { approvalResponsePart, describeApproval, pendingApproval } from '../runtime/approvals.js';
29
24
  import { declaresApprovals } from '../compile.js';
30
25
  import { describeInput } from '../runtime/syndicateTurn.js';
@@ -417,16 +412,14 @@ export function answerStream(eventBus, taskId, contextId) {
417
412
  export class SyndicateExecutor {
418
413
  opts;
419
414
  configHash;
420
- /** The store as the engine reads it. */
415
+ /** The conversation store. */
421
416
  sessions;
422
- /** The faces the turn runner's fixed signature names (ADR 0045 item 4). */
423
- turnSessions;
417
+ /** Long-term memory, when the syndicate has it. */
424
418
  turnMemory;
425
419
  constructor(opts) {
426
420
  this.opts = opts;
427
- this.sessions = asSessionService(opts.sessionService);
428
- this.turnSessions = asAdkSessionService(opts.sessionService);
429
- this.turnMemory = opts.memoryService ? asAdkMemoryService(opts.memoryService) : undefined;
421
+ this.sessions = opts.sessionService;
422
+ this.turnMemory = opts.memoryService;
430
423
  }
431
424
  /** Provenance stamp for every turn this executor serves (lineage.ts). */
432
425
  configHashFor() {
@@ -582,9 +575,8 @@ export class SyndicateExecutor {
582
575
  // answer, or the request is repeated without spending a model call.
583
576
  if (declaresApprovals(config)) {
584
577
  const session = await this.sessions.get({ appName, userId, sessionId: contextId });
585
- // The stored Event JSON either way (ADR 0052): pendingApproval still
586
- // names ADK's Event, which a TurnEvent reaches only through a cast.
587
- const pending = pendingApproval((session?.events ?? []));
578
+ // The stored Event JSON (ADR 0052), read as TurnEvents.
579
+ const pending = pendingApproval(session?.events ?? []);
588
580
  if (pending) {
589
581
  const answer = approvalAnswer(rawParts, pending);
590
582
  if (!answer) {
@@ -603,7 +595,7 @@ export class SyndicateExecutor {
603
595
  appName,
604
596
  userId,
605
597
  sessionId: contextId,
606
- sessionService: this.turnSessions,
598
+ sessionService: this.sessions,
607
599
  memoryService: this.turnMemory,
608
600
  compile: this.opts.compileFor(ctx),
609
601
  signal: slot.signal,
@@ -672,7 +664,7 @@ export class SyndicateExecutor {
672
664
  try {
673
665
  await ingestTurnMemory({
674
666
  memoryService: this.turnMemory,
675
- sessionService: this.turnSessions,
667
+ sessionService: this.sessions,
676
668
  appName,
677
669
  userId,
678
670
  sessionId: contextId,
@@ -12,9 +12,8 @@
12
12
  *
13
13
  * Built on the official A2A SDK client with its v0.3 compatibility layer on,
14
14
  * so a remote agent may speak A2A 1.0 (e.g. Microsoft Foundry) or 0.3 (most
15
- * other platforms today); the card decides. The client does not depend on
16
- * ADK, and the tool is the engine's own (remoteAgentOwnTool); the ADK
17
- * runtime receives it through toFunctionTool (remoteAgentTool).
15
+ * other platforms today); the card decides. The tool is the engine's own
16
+ * (remoteAgentOwnTool, also exported as remoteAgentTool).
18
17
  *
19
18
  * Security:
20
19
  * - Every URL — the card and the endpoint the card names — passes the
@@ -29,7 +28,6 @@
29
28
  */
30
29
  import type { AgentCard, Message, Task } from '@a2a-js/sdk';
31
30
  import type { Client } from '@a2a-js/sdk/client';
32
- import type { FunctionTool } from '@google/adk';
33
31
  import type { Tool } from '../tools/tool.ts';
34
32
  export interface RemoteAnswer {
35
33
  state: string;
@@ -91,16 +89,11 @@ export interface RemoteAgentToolParams {
91
89
  /**
92
90
  * The subagent as an own Tool (lib/tools/tool.ts, ADR 0062) with AgentTool's
93
91
  * contract (one `request` string), so an orchestrator delegates to it
94
- * exactly as to a local subagent, on either runtime. The remote
92
+ * exactly as to a local subagent. The remote
95
93
  * conversation is keyed by the local session (`ctx.sessionId`), and the call
96
94
  * aborts with the turn (`ctx.signal`). Failures come back as readable text,
97
95
  * never as a throw into the runner.
98
96
  */
99
97
  export declare function remoteAgentOwnTool(params: RemoteAgentToolParams): Tool;
100
- /**
101
- * The remote agent tool as the ADK runtime runs it: the FunctionTool
102
- * toFunctionTool (lib/tools/adkTool.ts) makes of remoteAgentOwnTool, which
103
- * declares the same parameters the hand-built FunctionTool declared and
104
- * carries the own Tool for toolOf().
105
- */
106
- export declare function remoteAgentTool(params: RemoteAgentToolParams): FunctionTool;
98
+ /** The remote agent tool, as registerTool and an agent's tools take it: remoteAgentOwnTool's own Tool. */
99
+ export declare function remoteAgentTool(params: RemoteAgentToolParams): Tool;
@@ -12,9 +12,8 @@
12
12
  *
13
13
  * Built on the official A2A SDK client with its v0.3 compatibility layer on,
14
14
  * so a remote agent may speak A2A 1.0 (e.g. Microsoft Foundry) or 0.3 (most
15
- * other platforms today); the card decides. The client does not depend on
16
- * ADK, and the tool is the engine's own (remoteAgentOwnTool); the ADK
17
- * runtime receives it through toFunctionTool (remoteAgentTool).
15
+ * other platforms today); the card decides. The tool is the engine's own
16
+ * (remoteAgentOwnTool, also exported as remoteAgentTool).
18
17
  *
19
18
  * Security:
20
19
  * - Every URL — the card and the endpoint the card names — passes the
@@ -32,7 +31,6 @@ import { Role, TaskState } from '@a2a-js/sdk';
32
31
  import { ClientFactory, DefaultAgentCardResolver, JsonRpcTransportFactory, RestTransportFactory } from '@a2a-js/sdk/client';
33
32
  import { checkHost } from '../net/addressGuard.js';
34
33
  import { currentTurnSignal } from '../runtime/turnControl.js';
35
- import { toFunctionTool } from '../tools/adkTool.js';
36
34
  const FETCH_TIMEOUT_MS = 30_000;
37
35
  const POLL_INTERVAL_MS = 1_500;
38
36
  const DEFAULT_TASK_TIMEOUT_MS = 10 * 60 * 1000;
@@ -238,7 +236,7 @@ export function remoteToolOutput(name, answer) {
238
236
  /**
239
237
  * The subagent as an own Tool (lib/tools/tool.ts, ADR 0062) with AgentTool's
240
238
  * contract (one `request` string), so an orchestrator delegates to it
241
- * exactly as to a local subagent, on either runtime. The remote
239
+ * exactly as to a local subagent. The remote
242
240
  * conversation is keyed by the local session (`ctx.sessionId`), and the call
243
241
  * aborts with the turn (`ctx.signal`). Failures come back as readable text,
244
242
  * never as a throw into the runner.
@@ -274,12 +272,7 @@ export function remoteAgentOwnTool(params) {
274
272
  },
275
273
  };
276
274
  }
277
- /**
278
- * The remote agent tool as the ADK runtime runs it: the FunctionTool
279
- * toFunctionTool (lib/tools/adkTool.ts) makes of remoteAgentOwnTool, which
280
- * declares the same parameters the hand-built FunctionTool declared and
281
- * carries the own Tool for toolOf().
282
- */
275
+ /** The remote agent tool, as registerTool and an agent's tools take it: remoteAgentOwnTool's own Tool. */
283
276
  export function remoteAgentTool(params) {
284
- return toFunctionTool(remoteAgentOwnTool(params));
277
+ return remoteAgentOwnTool(params);
285
278
  }