melchizedek-agents 0.19.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.
- package/.env.example +4 -5
- package/AGENT_SETUP.md +3 -3
- package/CHANGELOG.md +492 -76
- package/DOCUMENTATION.md +153 -132
- package/QUICKSTART.md +14 -10
- package/README.md +12 -15
- package/config/agents/examples/image_production.yaml +2 -2
- package/config/agents/syndicateSchema.yaml +55 -26
- package/dist/lib/a2a/app.d.ts +17 -12
- package/dist/lib/a2a/app.js +16 -6
- package/dist/lib/a2a/executor.d.ts +10 -14
- package/dist/lib/a2a/executor.js +10 -18
- package/dist/lib/a2a/remoteAgent.d.ts +5 -12
- package/dist/lib/a2a/remoteAgent.js +5 -12
- package/dist/lib/adkPeer.d.ts +63 -0
- package/dist/lib/adkPeer.js +240 -0
- package/dist/lib/compile.d.ts +109 -81
- package/dist/lib/compile.js +163 -111
- package/dist/lib/compileAdk.d.ts +7 -4
- package/dist/lib/compileAdk.js +22 -12
- package/dist/lib/compileNative.d.ts +63 -49
- package/dist/lib/compileNative.js +136 -78
- package/dist/lib/config.d.ts +6 -6
- package/dist/lib/config.js +6 -6
- package/dist/lib/doctor.d.ts +22 -1
- package/dist/lib/doctor.js +27 -2
- package/dist/lib/index.d.ts +14 -7
- package/dist/lib/index.js +11 -7
- package/dist/lib/loadSyndicate.d.ts +3 -3
- package/dist/lib/loadSyndicate.js +2 -2
- package/dist/lib/memory/erase.d.ts +1 -1
- package/dist/lib/memory/erase.js +1 -1
- package/dist/lib/memory/namespace.d.ts +12 -14
- package/dist/lib/memory/namespace.js +13 -14
- package/dist/lib/memory/providers.d.ts +4 -5
- package/dist/lib/memory/providers.js +12 -6
- package/dist/lib/memory/supabaseMemoryService.d.ts +9 -30
- package/dist/lib/memory/supabaseMemoryService.js +8 -30
- package/dist/lib/model.d.ts +6 -12
- package/dist/lib/model.js +6 -12
- package/dist/lib/models/adapterResolver.d.ts +21 -38
- package/dist/lib/models/adapterResolver.js +33 -40
- package/dist/lib/models/adkGeminiAdapter.js +2 -0
- package/dist/lib/models/adkShim.d.ts +1 -1
- package/dist/lib/models/adkShim.js +1 -1
- package/dist/lib/models/capabilities.js +13 -10
- package/dist/lib/models/chatCompletionsAdapter.d.ts +12 -33
- package/dist/lib/models/chatCompletionsAdapter.js +13 -18
- package/dist/lib/models/circuitBreaker.d.ts +5 -5
- package/dist/lib/models/circuitBreaker.js +5 -5
- package/dist/lib/models/claudeAdapter.d.ts +9 -26
- package/dist/lib/models/claudeAdapter.js +11 -15
- package/dist/lib/models/claudeLlm.js +2 -2
- package/dist/lib/models/claudeModels.d.ts +4 -4
- package/dist/lib/models/claudeModels.js +4 -4
- package/dist/lib/models/contract.d.ts +11 -11
- package/dist/lib/models/contract.js +6 -6
- package/dist/lib/models/errorResponse.d.ts +13 -20
- package/dist/lib/models/errorResponse.js +0 -12
- package/dist/lib/models/fallback.d.ts +1 -1
- package/dist/lib/models/fallback.js +1 -1
- package/dist/lib/models/fallbackAdapter.d.ts +7 -8
- package/dist/lib/models/gatewayAdapter.d.ts +1 -1
- package/dist/lib/models/gatewayAdapter.js +1 -1
- package/dist/lib/models/gatewayLlm.js +2 -2
- package/dist/lib/models/geminiAdapter.d.ts +11 -10
- package/dist/lib/models/geminiAdapter.js +37 -15
- package/dist/lib/models/geminiState.d.ts +29 -8
- package/dist/lib/models/geminiState.js +34 -8
- package/dist/lib/models/genaiMapping.d.ts +104 -38
- package/dist/lib/models/genaiMapping.js +146 -43
- package/dist/lib/models/gptAdapter.d.ts +11 -11
- package/dist/lib/models/gptAdapter.js +13 -13
- package/dist/lib/models/gptLlm.js +2 -2
- package/dist/lib/models/grokLlm.js +2 -2
- package/dist/lib/models/kimiAdapter.d.ts +6 -7
- package/dist/lib/models/kimiAdapter.js +6 -9
- package/dist/lib/models/kimiLlm.js +2 -2
- package/dist/lib/models/ollamaAdapter.d.ts +3 -3
- package/dist/lib/models/ollamaAdapter.js +3 -3
- package/dist/lib/models/ollamaLlm.js +2 -2
- package/dist/lib/models/providerMap.d.ts +6 -5
- package/dist/lib/models/providerMap.js +6 -5
- package/dist/lib/models/providerState.d.ts +3 -2
- package/dist/lib/models/providerState.js +3 -2
- package/dist/lib/models/reasoning.d.ts +1 -1
- package/dist/lib/models/registry.d.ts +26 -69
- package/dist/lib/models/registry.js +32 -140
- package/dist/lib/models/retry.d.ts +2 -2
- package/dist/lib/models/retry.js +2 -2
- package/dist/lib/models/schemaNormalize.d.ts +25 -55
- package/dist/lib/models/schemaNormalize.js +30 -100
- package/dist/lib/models/tracedGemini.d.ts +1 -1
- package/dist/lib/models/tracedGemini.js +1 -1
- package/dist/lib/observability/lineage.d.ts +3 -3
- package/dist/lib/observability/lineage.js +10 -10
- package/dist/lib/observability/supabaseSpanExporter.js +1 -1
- package/dist/lib/observability/tracer.d.ts +25 -23
- package/dist/lib/observability/tracer.js +26 -63
- package/dist/lib/persistence/supabaseProvider.d.ts +4 -3
- package/dist/lib/runtime/adkSessionBridge.d.ts +1 -1
- package/dist/lib/runtime/adkSessionBridge.js +1 -1
- package/dist/lib/runtime/approvals.d.ts +6 -1
- package/dist/lib/runtime/approvals.js +39 -8
- package/dist/lib/runtime/credentials.d.ts +4 -2
- package/dist/lib/runtime/credentials.js +6 -1
- package/dist/lib/runtime/events.d.ts +3 -4
- package/dist/lib/runtime/events.js +3 -4
- package/dist/lib/runtime/logging.d.ts +3 -8
- package/dist/lib/runtime/logging.js +3 -8
- package/dist/lib/runtime/memoryService.d.ts +4 -6
- package/dist/lib/runtime/memoryService.js +3 -5
- package/dist/lib/runtime/native/agentLoop.d.ts +24 -16
- package/dist/lib/runtime/native/agentLoop.js +67 -37
- package/dist/lib/runtime/native/compaction.d.ts +10 -11
- package/dist/lib/runtime/native/compaction.js +10 -11
- package/dist/lib/runtime/native/delegate.d.ts +64 -12
- package/dist/lib/runtime/native/delegate.js +101 -25
- package/dist/lib/runtime/native/history.d.ts +5 -6
- package/dist/lib/runtime/native/history.js +5 -6
- package/dist/lib/runtime/native/interrupts.d.ts +12 -9
- package/dist/lib/runtime/native/interrupts.js +29 -10
- package/dist/lib/runtime/native/request.d.ts +25 -25
- package/dist/lib/runtime/native/request.js +36 -25
- package/dist/lib/runtime/native/selfCorrection.d.ts +75 -17
- package/dist/lib/runtime/native/selfCorrection.js +93 -19
- package/dist/lib/runtime/native/step.d.ts +34 -26
- package/dist/lib/runtime/native/step.js +78 -32
- package/dist/lib/runtime/native/taskMode.d.ts +8 -8
- package/dist/lib/runtime/native/taskMode.js +8 -8
- package/dist/lib/runtime/native/telemetry.d.ts +11 -11
- package/dist/lib/runtime/native/telemetry.js +11 -11
- package/dist/lib/runtime/native/tempState.d.ts +4 -4
- package/dist/lib/runtime/native/tempState.js +4 -4
- package/dist/lib/runtime/nativeTurn.d.ts +29 -32
- package/dist/lib/runtime/nativeTurn.js +30 -41
- package/dist/lib/runtime/questions.d.ts +8 -9
- package/dist/lib/runtime/questions.js +1 -2
- package/dist/lib/runtime/runtimeFlag.d.ts +35 -13
- package/dist/lib/runtime/runtimeFlag.js +46 -16
- package/dist/lib/runtime/sessions.d.ts +10 -12
- package/dist/lib/runtime/sessions.js +10 -12
- package/dist/lib/runtime/syndicateTurn.d.ts +46 -42
- package/dist/lib/runtime/syndicateTurn.js +182 -150
- package/dist/lib/runtime/turnControl.d.ts +8 -8
- package/dist/lib/runtime/turnControl.js +8 -8
- package/dist/lib/runtime/valueDepth.d.ts +23 -0
- package/dist/lib/runtime/valueDepth.js +41 -0
- package/dist/lib/session/supabaseSessionService.d.ts +7 -21
- package/dist/lib/session/supabaseSessionService.js +7 -43
- package/dist/lib/session/transcript.d.ts +16 -26
- package/dist/lib/session/transcript.js +17 -55
- package/dist/lib/storage/postgres/sessionService.d.ts +6 -20
- package/dist/lib/storage/postgres/sessionService.js +6 -39
- package/dist/lib/syndicateSchema.d.ts +2 -0
- package/dist/lib/syndicateSchema.js +32 -10
- package/dist/lib/toolRegistry.d.ts +20 -14
- package/dist/lib/toolRegistry.js +76 -33
- package/dist/lib/tools/adkTool.d.ts +1 -1
- package/dist/lib/tools/adkTool.js +1 -1
- package/dist/lib/tools/auth.d.ts +1 -1
- package/dist/lib/tools/auth.js +1 -1
- package/dist/lib/tools/collectionsSearchTool.d.ts +1 -1
- package/dist/lib/tools/collectionsSearchTool.js +1 -1
- package/dist/lib/tools/examples.d.ts +2 -4
- package/dist/lib/tools/examples.js +2 -4
- package/dist/lib/tools/generateImageTool.d.ts +3 -3
- package/dist/lib/tools/generateImageTool.js +4 -5
- package/dist/lib/tools/inspectImageTool.d.ts +2 -2
- package/dist/lib/tools/inspectImageTool.js +3 -4
- package/dist/lib/tools/mcpToolFactory.d.ts +4 -24
- package/dist/lib/tools/mcpToolFactory.js +19 -9
- package/dist/lib/tools/memoryTools.d.ts +5 -6
- package/dist/lib/tools/memoryTools.js +5 -6
- package/dist/lib/tools/nativeTools.d.ts +9 -14
- package/dist/lib/tools/nativeTools.js +9 -14
- package/dist/lib/tools/openapiTools.d.ts +5 -7
- package/dist/lib/tools/openapiTools.js +6 -13
- package/dist/lib/tools/scienceTools.d.ts +3 -3
- package/dist/lib/tools/scienceTools.js +8 -10
- package/dist/lib/tools/skillToolset.d.ts +1 -2
- package/dist/lib/tools/skillToolset.js +1 -2
- package/dist/lib/tools/skills/executor.d.ts +1 -1
- package/dist/lib/tools/skills/executor.js +1 -1
- package/dist/lib/tools/skills/frontmatter.d.ts +2 -2
- package/dist/lib/tools/skills/frontmatter.js +2 -2
- package/dist/lib/tools/skills/tools.d.ts +8 -10
- package/dist/lib/tools/skills/tools.js +9 -11
- package/dist/lib/tools/tool.d.ts +24 -40
- package/dist/lib/tools/tool.js +24 -56
- package/dist/lib/tools/toolContract.d.ts +8 -13
- package/dist/lib/tools/toolContract.js +6 -17
- package/dist/lib/tools/urlContextTool.d.ts +1 -1
- package/dist/lib/tools/urlContextTool.js +1 -1
- package/dist/lib/tools/webExtractTool.d.ts +2 -2
- package/dist/lib/tools/webExtractTool.js +3 -4
- package/dist/lib/tools/webSearchTool.d.ts +1 -1
- package/dist/lib/tools/webSearchTool.js +1 -1
- package/dist/lib/tools/wikiTools.d.ts +2 -2
- package/dist/lib/tools/wikiTools.js +5 -6
- package/dist/lib/tools/xApiSearchTool.d.ts +2 -2
- package/dist/lib/tools/xApiSearchTool.js +3 -4
- package/dist/lib/tools/xSearchTool.d.ts +1 -1
- package/dist/lib/tools/xSearchTool.js +1 -1
- package/dist/lib/tools/xaiSearchParams.d.ts +2 -5
- package/dist/lib/tools/xaiSearchParams.js +2 -5
- package/dist/lib/wiki/agentRun.d.ts +10 -11
- package/dist/lib/wiki/agentRun.js +24 -41
- package/dist/lib/workflow/agentNode.d.ts +31 -5
- package/dist/lib/workflow/agentNode.js +101 -8
- package/dist/lib/workflow/graph.d.ts +13 -13
- package/dist/lib/workflow/graph.js +25 -15
- package/dist/lib/workflow/nodeEvents.d.ts +5 -5
- package/dist/lib/workflow/nodeEvents.js +5 -5
- package/dist/lib/workflow/pause.d.ts +5 -4
- package/dist/lib/workflow/pause.js +5 -4
- package/dist/lib/workflow/resume.d.ts +14 -13
- package/dist/lib/workflow/resume.js +17 -16
- package/dist/lib/workflow/route.d.ts +7 -7
- package/dist/lib/workflow/route.js +8 -8
- package/dist/lib/workflow/scheduler.d.ts +54 -9
- package/dist/lib/workflow/scheduler.js +75 -8
- package/dist/lib/workflow/toolNode.d.ts +18 -29
- package/dist/lib/workflow/toolNode.js +29 -35
- package/dist/lib/workflow/turn.d.ts +29 -20
- package/dist/lib/workflow/turn.js +111 -24
- package/dist/lib/workflow.d.ts +38 -42
- package/dist/lib/workflow.js +38 -150
- package/dist/lib/workflowConfig.d.ts +6 -10
- package/dist/lib/workflowConfig.js +2 -27
- package/dist/scripts/a2a_server.js +1 -2
- package/dist/scripts/assistant_worker.d.ts +2 -2
- package/dist/scripts/assistant_worker.js +8 -7
- package/dist/scripts/doctor.d.ts +3 -1
- package/dist/scripts/doctor.js +4 -2
- package/dist/scripts/syndicate_chat.js +14 -24
- package/package.json +3 -6
- package/skills/briefs/_shared.md +2 -2
- package/skills/briefs/melchizedek-author.md +2 -2
- package/skills/briefs/melchizedek-models.md +6 -6
- package/skills/melchizedek-author/SKILL.md +2 -2
- package/skills/melchizedek-models/SKILL.md +5 -5
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* A syndicate with `memory_system: long-term` reaches its memory through
|
|
7
7
|
* two YAML tool names. Both were ADK's own objects (LOAD_MEMORY and
|
|
8
|
-
* PRELOAD_MEMORY), which only ADK's loop
|
|
9
|
-
* engine's,
|
|
10
|
-
* same objects through lib/tools/adkTool.ts:
|
|
8
|
+
* PRELOAD_MEMORY), which only ADK's loop could run. Here they are the
|
|
9
|
+
* engine's, and the native loop runs them:
|
|
11
10
|
*
|
|
12
11
|
* load_memory a Tool the model calls with a query. It returns the
|
|
13
12
|
* facts recalled for it, and while the run has memory it
|
|
@@ -18,8 +17,8 @@
|
|
|
18
17
|
*
|
|
19
18
|
* WORD FOR WORD: the declaration, the note, the result's shape and the
|
|
20
19
|
* recalled block are what ADK's LoadMemoryTool and PreloadMemoryTool
|
|
21
|
-
* produced, so a model reads the
|
|
22
|
-
* (tests/memoryTools.test.ts
|
|
20
|
+
* produced, so a model reads the request it read before 1.0.0
|
|
21
|
+
* (tests/memoryTools.test.ts holds them to ADK's recorded output).
|
|
23
22
|
*
|
|
24
23
|
* WHOSE MEMORY: both search through the context's `searchMemory`, which is
|
|
25
24
|
* bound to the run's own `<appName>/<userId>` silo; a query can choose what
|
|
@@ -38,7 +37,7 @@ import type { InstructionTool } from './tool.ts';
|
|
|
38
37
|
export declare const LOAD_MEMORY_INSTRUCTION = "You have memory. You can use it to answer questions. If any questions need\nyou to look up the memory, you should call load_memory function with a query.";
|
|
39
38
|
/** What load_memory and ADK's LoadMemoryTool say when the run has no memory service. */
|
|
40
39
|
export declare const NO_MEMORY_SERVICE = "Memory service is not initialized.";
|
|
41
|
-
/** A memory's text: its parts' texts joined by a space, a part without text counting as empty, as ADK
|
|
40
|
+
/** A memory's text: its parts' texts joined by a space, a part without text counting as empty, as ADK joined them. */
|
|
42
41
|
export declare function memoryText(memory: MemoryEntry): string;
|
|
43
42
|
/** One recalled memory as load_memory returns it. */
|
|
44
43
|
export interface LoadedMemory {
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* A syndicate with `memory_system: long-term` reaches its memory through
|
|
7
7
|
* two YAML tool names. Both were ADK's own objects (LOAD_MEMORY and
|
|
8
|
-
* PRELOAD_MEMORY), which only ADK's loop
|
|
9
|
-
* engine's,
|
|
10
|
-
* same objects through lib/tools/adkTool.ts:
|
|
8
|
+
* PRELOAD_MEMORY), which only ADK's loop could run. Here they are the
|
|
9
|
+
* engine's, and the native loop runs them:
|
|
11
10
|
*
|
|
12
11
|
* load_memory a Tool the model calls with a query. It returns the
|
|
13
12
|
* facts recalled for it, and while the run has memory it
|
|
@@ -18,8 +17,8 @@
|
|
|
18
17
|
*
|
|
19
18
|
* WORD FOR WORD: the declaration, the note, the result's shape and the
|
|
20
19
|
* recalled block are what ADK's LoadMemoryTool and PreloadMemoryTool
|
|
21
|
-
* produced, so a model reads the
|
|
22
|
-
* (tests/memoryTools.test.ts
|
|
20
|
+
* produced, so a model reads the request it read before 1.0.0
|
|
21
|
+
* (tests/memoryTools.test.ts holds them to ADK's recorded output).
|
|
23
22
|
*
|
|
24
23
|
* WHOSE MEMORY: both search through the context's `searchMemory`, which is
|
|
25
24
|
* bound to the run's own `<appName>/<userId>` silo; a query can choose what
|
|
@@ -38,7 +37,7 @@ export const LOAD_MEMORY_INSTRUCTION = `You have memory. You can use it to answe
|
|
|
38
37
|
you to look up the memory, you should call load_memory function with a query.`;
|
|
39
38
|
/** What load_memory and ADK's LoadMemoryTool say when the run has no memory service. */
|
|
40
39
|
export const NO_MEMORY_SERVICE = 'Memory service is not initialized.';
|
|
41
|
-
/** A memory's text: its parts' texts joined by a space, a part without text counting as empty, as ADK
|
|
40
|
+
/** A memory's text: its parts' texts joined by a space, a part without text counting as empty, as ADK joined them. */
|
|
42
41
|
export function memoryText(memory) {
|
|
43
42
|
return memory.content.parts?.map((p) => p.text ?? '').join(' ') ?? '';
|
|
44
43
|
}
|
|
@@ -5,20 +5,15 @@
|
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* web_search, x_search, url_context and collections_search are run by the
|
|
7
7
|
* provider, not here: the model asks its own vendor to search or read, and
|
|
8
|
-
* the answer arrives inside the model's response.
|
|
9
|
-
* that declared nothing and left itself in the request for the
|
|
10
|
-
* find.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* siblings), which carry the same marker symbol, so every reader
|
|
18
|
-
* (nativeToolOf in lib/models/schemaNormalize.ts) recognises both by
|
|
19
|
-
* marker. lib/tools/adkTool.ts turns a marker into its sentinel
|
|
20
|
-
* (toAdkNativeTool). google_search is ADK's own GOOGLE_SEARCH on that
|
|
21
|
-
* runtime, recognised by ADK's marker.
|
|
8
|
+
* the answer arrives inside the model's response. Under ADK each was a
|
|
9
|
+
* BaseTool that declared nothing and left itself in the request for the
|
|
10
|
+
* adapter to find. Here each is a NativeToolMarker (lib/tools/tool.ts): a
|
|
11
|
+
* name, a description for a reader, and the NativeTool it stands for. A
|
|
12
|
+
* marker declares no function; a request carries it in `nativeTools`, and
|
|
13
|
+
* each adapter adds its provider's tool object or drops it
|
|
14
|
+
* (lib/models/capabilities.ts). Every reader (nativeToolOf in
|
|
15
|
+
* lib/models/schemaNormalize.ts) recognises a marker by its symbol, never
|
|
16
|
+
* by class.
|
|
22
17
|
*
|
|
23
18
|
* Code execution is not here: it is an agent's `code_execution: gemini`,
|
|
24
19
|
* not a tool it lists, and reaches the request as the agent's code
|
|
@@ -5,20 +5,15 @@
|
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* web_search, x_search, url_context and collections_search are run by the
|
|
7
7
|
* provider, not here: the model asks its own vendor to search or read, and
|
|
8
|
-
* the answer arrives inside the model's response.
|
|
9
|
-
* that declared nothing and left itself in the request for the
|
|
10
|
-
* find.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* siblings), which carry the same marker symbol, so every reader
|
|
18
|
-
* (nativeToolOf in lib/models/schemaNormalize.ts) recognises both by
|
|
19
|
-
* marker. lib/tools/adkTool.ts turns a marker into its sentinel
|
|
20
|
-
* (toAdkNativeTool). google_search is ADK's own GOOGLE_SEARCH on that
|
|
21
|
-
* runtime, recognised by ADK's marker.
|
|
8
|
+
* the answer arrives inside the model's response. Under ADK each was a
|
|
9
|
+
* BaseTool that declared nothing and left itself in the request for the
|
|
10
|
+
* adapter to find. Here each is a NativeToolMarker (lib/tools/tool.ts): a
|
|
11
|
+
* name, a description for a reader, and the NativeTool it stands for. A
|
|
12
|
+
* marker declares no function; a request carries it in `nativeTools`, and
|
|
13
|
+
* each adapter adds its provider's tool object or drops it
|
|
14
|
+
* (lib/models/capabilities.ts). Every reader (nativeToolOf in
|
|
15
|
+
* lib/models/schemaNormalize.ts) recognises a marker by its symbol, never
|
|
16
|
+
* by class.
|
|
22
17
|
*
|
|
23
18
|
* Code execution is not here: it is an agent's `code_execution: gemini`,
|
|
24
19
|
* not a tool it lists, and reaches the request as the agent's code
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { FunctionTool } from '@google/adk';
|
|
2
1
|
import type { Tool } from './tool.ts';
|
|
3
2
|
export { namesTool, toSnake } from './openapi/parse.ts';
|
|
4
3
|
export interface OpenApiAuthConfig {
|
|
@@ -43,18 +42,17 @@ export declare function credentialEnvProblem(name: string, env?: NodeJS.ProcessE
|
|
|
43
42
|
*/
|
|
44
43
|
export declare function boundResult(result: unknown): unknown;
|
|
45
44
|
/**
|
|
46
|
-
* The own Tools one `openapi:` entry gives an agent
|
|
45
|
+
* The own Tools one `openapi:` entry gives an agent.
|
|
47
46
|
* Throws (failing the compile) on a missing spec, an unset auth variable,
|
|
48
47
|
* an operation the spec does not have, or a server the guard refuses.
|
|
49
48
|
*/
|
|
50
49
|
export declare function buildOpenApiOwnTools(entry: OpenApiConfig, baseDir?: string): Promise<Tool[]>;
|
|
51
50
|
/**
|
|
52
|
-
* The tools one `openapi:` entry gives an agent
|
|
53
|
-
*
|
|
54
|
-
* its operationId. ADK's RestApiTool and OpenAPIToolset are not used.
|
|
51
|
+
* The tools one `openapi:` entry gives an agent: buildOpenApiOwnTools' own
|
|
52
|
+
* Tools, each marked so require_approval can name it by its operationId.
|
|
55
53
|
*/
|
|
56
|
-
export declare function buildOpenApiTools(entry: OpenApiConfig, baseDir?: string): Promise<
|
|
57
|
-
/** The operationId of a tool built from an `openapi:` entry
|
|
54
|
+
export declare function buildOpenApiTools(entry: OpenApiConfig, baseDir?: string): Promise<Tool[]>;
|
|
55
|
+
/** The operationId of a tool built from an `openapi:` entry, or undefined. */
|
|
58
56
|
export declare function openApiOperationId(tool: unknown): string | undefined;
|
|
59
57
|
/** True for a tool built from an `openapi:` entry. */
|
|
60
58
|
export declare function isOpenApiTool(tool: unknown): boolean;
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* tools and builds their declarations, by the rules ADK's OpenAPIToolset
|
|
11
11
|
* had; the engine's own caller (lib/tools/openapi/call.ts, ADR 0067) sends
|
|
12
12
|
* each call, by the rules ADK's RestApiTool had. Each operation is an own
|
|
13
|
-
* Tool (lib/tools/tool.ts)
|
|
14
|
-
* toFunctionTool. An agent's `openapi:` list hands it a spec file:
|
|
13
|
+
* Tool (lib/tools/tool.ts). An agent's `openapi:` list hands it a spec file:
|
|
15
14
|
*
|
|
16
15
|
* openapi:
|
|
17
16
|
* - spec: "specs/weather.yaml" # beside this YAML file
|
|
@@ -60,7 +59,6 @@
|
|
|
60
59
|
*/
|
|
61
60
|
import { closeSync, openSync, readSync } from 'node:fs';
|
|
62
61
|
import { extname, resolve } from 'node:path';
|
|
63
|
-
import { toFunctionTool } from './adkTool.js';
|
|
64
62
|
import { MAX_RESULT_CHARS as TOOL_RESULT_CHARS, capResult } from './tool.js';
|
|
65
63
|
import { callOperation, hostProblem } from './openapi/call.js';
|
|
66
64
|
import { MAX_SPEC_BYTES, operationNamed, parseOpenApiSpec } from './openapi/parse.js';
|
|
@@ -167,7 +165,7 @@ function operationTool(op, credential) {
|
|
|
167
165
|
return tool;
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
170
|
-
* The own Tools one `openapi:` entry gives an agent
|
|
168
|
+
* The own Tools one `openapi:` entry gives an agent.
|
|
171
169
|
* Throws (failing the compile) on a missing spec, an unset auth variable,
|
|
172
170
|
* an operation the spec does not have, or a server the guard refuses.
|
|
173
171
|
*/
|
|
@@ -204,18 +202,13 @@ export async function buildOpenApiOwnTools(entry, baseDir = process.cwd()) {
|
|
|
204
202
|
return chosen.map((o) => operationTool(o, credential));
|
|
205
203
|
}
|
|
206
204
|
/**
|
|
207
|
-
* The tools one `openapi:` entry gives an agent
|
|
208
|
-
*
|
|
209
|
-
* its operationId. ADK's RestApiTool and OpenAPIToolset are not used.
|
|
205
|
+
* The tools one `openapi:` entry gives an agent: buildOpenApiOwnTools' own
|
|
206
|
+
* Tools, each marked so require_approval can name it by its operationId.
|
|
210
207
|
*/
|
|
211
208
|
export async function buildOpenApiTools(entry, baseDir = process.cwd()) {
|
|
212
|
-
return
|
|
213
|
-
const adkTool = toFunctionTool(own);
|
|
214
|
-
Object.defineProperty(adkTool, OPENAPI_TOOL, { value: openApiOperationId(own) });
|
|
215
|
-
return adkTool;
|
|
216
|
-
});
|
|
209
|
+
return buildOpenApiOwnTools(entry, baseDir);
|
|
217
210
|
}
|
|
218
|
-
/** The operationId of a tool built from an `openapi:` entry
|
|
211
|
+
/** The operationId of a tool built from an `openapi:` entry, or undefined. */
|
|
219
212
|
export function openApiOperationId(tool) {
|
|
220
213
|
if (!tool || typeof tool !== 'object')
|
|
221
214
|
return undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* lib/tools/scienceTools.ts — the clinical-evidence tools, defined as tool
|
|
3
3
|
* CONTRACTS (lib/tools/toolContract.ts): one zod schema per tool is the single
|
|
4
|
-
* source of truth, from which both deployment surfaces derive — the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* source of truth, from which both deployment surfaces derive — the own Tools
|
|
5
|
+
* consumed by lib/toolRegistry.ts, and the MCP tools/list entries served by
|
|
6
|
+
* scripts/science_mcp_server.ts.
|
|
7
7
|
*
|
|
8
8
|
* Ported from the science desk (2026-09-08). The four source clients under
|
|
9
9
|
* lib/tools/science/ are that desk's, verbatim: Europe PMC (literature and
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* lib/tools/scienceTools.ts — the clinical-evidence tools, defined as tool
|
|
3
3
|
* CONTRACTS (lib/tools/toolContract.ts): one zod schema per tool is the single
|
|
4
|
-
* source of truth, from which both deployment surfaces derive — the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* source of truth, from which both deployment surfaces derive — the own Tools
|
|
5
|
+
* consumed by lib/toolRegistry.ts, and the MCP tools/list entries served by
|
|
6
|
+
* scripts/science_mcp_server.ts.
|
|
7
7
|
*
|
|
8
8
|
* Ported from the science desk (2026-09-08). The four source clients under
|
|
9
9
|
* lib/tools/science/ are that desk's, verbatim: Europe PMC (literature and
|
|
@@ -268,10 +268,8 @@ export const SCIENCE_TOOL_CONTRACTS = [
|
|
|
268
268
|
surveyFieldContract,
|
|
269
269
|
checkRetractionContract,
|
|
270
270
|
];
|
|
271
|
-
// No `export const …Tool =
|
|
272
|
-
// lib/toolRegistry.ts derives the
|
|
273
|
-
// SCIENCE_TOOL_CONTRACTS — the same shape lib/tools/wikiTools.ts uses
|
|
274
|
-
//
|
|
275
|
-
//
|
|
276
|
-
// neither of which wants ADK tools at all) paid for seven schema conversions
|
|
277
|
-
// and seven FunctionTool constructions at import time.
|
|
271
|
+
// No `export const …Tool = asTool(…)` line here on purpose.
|
|
272
|
+
// lib/toolRegistry.ts derives the registry's tools itself, straight from
|
|
273
|
+
// SCIENCE_TOOL_CONTRACTS — the same shape lib/tools/wikiTools.ts uses — so a
|
|
274
|
+
// consumer of this module that wants only the contracts (the MCP server,
|
|
275
|
+
// scripts/wiki/build.ts) builds nothing else at import time.
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
* THE PIECES (lib/tools/skills/, no ADK import): frontmatter.ts reads and
|
|
31
31
|
* checks a SKILL.md, loader.ts loads a directory of skills, executor.ts
|
|
32
32
|
* runs a script on this machine, tools.ts holds the tools and the
|
|
33
|
-
* SkillToolset. The
|
|
34
|
-
* lib/tools/adkTool.ts (toAdkToolset), as it runs every own Tool.
|
|
33
|
+
* SkillToolset. The native loop expands the toolset before each request.
|
|
35
34
|
*
|
|
36
35
|
* WHAT RUNS: only scripts shipped in a skill's `scripts/` directory, on
|
|
37
36
|
* the local executor (`skills.scripts: local`), after approval. The
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
* THE PIECES (lib/tools/skills/, no ADK import): frontmatter.ts reads and
|
|
31
31
|
* checks a SKILL.md, loader.ts loads a directory of skills, executor.ts
|
|
32
32
|
* runs a script on this machine, tools.ts holds the tools and the
|
|
33
|
-
* SkillToolset. The
|
|
34
|
-
* lib/tools/adkTool.ts (toAdkToolset), as it runs every own Tool.
|
|
33
|
+
* SkillToolset. The native loop expands the toolset before each request.
|
|
35
34
|
*
|
|
36
35
|
* WHAT RUNS: only scripts shipped in a skill's `scripts/` directory, on
|
|
37
36
|
* the local executor (`skills.scripts: local`), after approval. The
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `skills.scripts: local` (ADR 0029) runs a skill's own scripts after a
|
|
8
8
|
* person approves each run (run_skill_script in ./tools.ts). The harness
|
|
9
9
|
* ran them through ADK's local executor until WS3-3. This module runs
|
|
10
|
-
* them the same way, so a run returns the
|
|
10
|
+
* them the same way, so a run returns the result it returned under ADK.
|
|
11
11
|
*
|
|
12
12
|
* WHAT A RUN IS, AND WHAT A SCRIPT CAN REACH (unchanged from ADK's executor):
|
|
13
13
|
* 1. A fresh private directory under the OS temp directory (mkdtemp,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `skills.scripts: local` (ADR 0029) runs a skill's own scripts after a
|
|
8
8
|
* person approves each run (run_skill_script in ./tools.ts). The harness
|
|
9
9
|
* ran them through ADK's local executor until WS3-3. This module runs
|
|
10
|
-
* them the same way, so a run returns the
|
|
10
|
+
* them the same way, so a run returns the result it returned under ADK.
|
|
11
11
|
*
|
|
12
12
|
* WHAT A RUN IS, AND WHAT A SCRIPT CAN REACH (unchanged from ADK's executor):
|
|
13
13
|
* 1. A fresh private directory under the OS temp directory (mkdtemp,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* frontmatter (the open Agent Skills standard): `name`, `description`,
|
|
8
8
|
* and optionally `license`, `compatibility`, `allowed-tools` and
|
|
9
9
|
* `metadata`. The harness read it through ADK's loader until WS3-3. This
|
|
10
|
-
* module reads it the same way, so a skill loads to the same object
|
|
11
|
-
*
|
|
10
|
+
* module reads it the same way, so a skill loads to the same object it
|
|
11
|
+
* did under ADK and the frontmatter a model sees in load_skill's result
|
|
12
12
|
* does not change:
|
|
13
13
|
* - the frontmatter is the text between the opening `---` and the next
|
|
14
14
|
* `---`, wherever it falls, and the body is everything after that,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* frontmatter (the open Agent Skills standard): `name`, `description`,
|
|
8
8
|
* and optionally `license`, `compatibility`, `allowed-tools` and
|
|
9
9
|
* `metadata`. The harness read it through ADK's loader until WS3-3. This
|
|
10
|
-
* module reads it the same way, so a skill loads to the same object
|
|
11
|
-
*
|
|
10
|
+
* module reads it the same way, so a skill loads to the same object it
|
|
11
|
+
* did under ADK and the frontmatter a model sees in load_skill's result
|
|
12
12
|
* does not change:
|
|
13
13
|
* - the frontmatter is the text between the opening `---` and the next
|
|
14
14
|
* `---`, wherever it falls, and the body is everything after that,
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* The skills harness (ADR 0029) was built on ADK's SkillToolset until
|
|
7
|
-
* WS3-3. These are the same tools as own Tools,
|
|
8
|
-
* them directly
|
|
9
|
-
*
|
|
10
|
-
* names, descriptions and parameters as before, and reads the same
|
|
11
|
-
* results and error texts, on either runtime:
|
|
7
|
+
* WS3-3. These are the same tools as own Tools, and the native loop runs
|
|
8
|
+
* them directly. A model is sent the same names, descriptions and
|
|
9
|
+
* parameters as before, and reads the same results and error texts:
|
|
12
10
|
* - list_skills: the `<available_skills>` index (ADK's ListSkillsTool).
|
|
13
11
|
* The harness leaves it out, since the index is in the instruction.
|
|
14
12
|
* - load_skill: the procedure, the frontmatter and the NAMES of the files
|
|
@@ -21,8 +19,8 @@
|
|
|
21
19
|
* skill ships on the local executor (./executor.ts).
|
|
22
20
|
*
|
|
23
21
|
* ACTIVATION: load_skill appends the skill's name to the session state key
|
|
24
|
-
* `_adk_activated_skill_<agent>` (ADK's key, so a session stored
|
|
25
|
-
*
|
|
22
|
+
* `_adk_activated_skill_<agent>` (ADK's key, so a session ADK stored
|
|
23
|
+
* reads the same). SkillToolset.getTools reads it and adds
|
|
26
24
|
* the tools the activated skills name (`metadata.adk_additional_tools`,
|
|
27
25
|
* filled from `allowed-tools`), but only from the tools the YAML handed
|
|
28
26
|
* it under `skills.tools`: a skill cannot grant itself a tool the YAML
|
|
@@ -66,7 +64,7 @@ export interface SkillToolsetOptions {
|
|
|
66
64
|
* The tools an agent with `skills:` carries: load_skill and
|
|
67
65
|
* load_skill_resource always, run_skill_script with `scripts: local`, and
|
|
68
66
|
* the tools its loaded skills unlock. A toolset by shape (getTools), which
|
|
69
|
-
* the native loop expands
|
|
67
|
+
* the native loop expands.
|
|
70
68
|
*/
|
|
71
69
|
export declare class SkillToolset implements Toolset {
|
|
72
70
|
#private;
|
|
@@ -156,8 +154,8 @@ export declare class LoadSkillResourceTool extends SkillTool {
|
|
|
156
154
|
* run_skill_script behind a person's approval: the first call asks for it
|
|
157
155
|
* (the hint names the skill, the script and the arguments) and returns
|
|
158
156
|
* without running; the call made again with the answer runs only when the
|
|
159
|
-
* answer approved it. The confirmation travels as `adk_request_confirmation
|
|
160
|
-
*
|
|
157
|
+
* answer approved it. The confirmation travels as `adk_request_confirmation`,
|
|
158
|
+
* so the turn pauses `input-required` exactly as for
|
|
161
159
|
* `require_approval` (ADR 0028), with this tool's own texts.
|
|
162
160
|
*/
|
|
163
161
|
export declare class RunSkillScriptTool extends SkillTool {
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* The skills harness (ADR 0029) was built on ADK's SkillToolset until
|
|
7
|
-
* WS3-3. These are the same tools as own Tools,
|
|
8
|
-
* them directly
|
|
9
|
-
*
|
|
10
|
-
* names, descriptions and parameters as before, and reads the same
|
|
11
|
-
* results and error texts, on either runtime:
|
|
7
|
+
* WS3-3. These are the same tools as own Tools, and the native loop runs
|
|
8
|
+
* them directly. A model is sent the same names, descriptions and
|
|
9
|
+
* parameters as before, and reads the same results and error texts:
|
|
12
10
|
* - list_skills: the `<available_skills>` index (ADK's ListSkillsTool).
|
|
13
11
|
* The harness leaves it out, since the index is in the instruction.
|
|
14
12
|
* - load_skill: the procedure, the frontmatter and the NAMES of the files
|
|
@@ -21,8 +19,8 @@
|
|
|
21
19
|
* skill ships on the local executor (./executor.ts).
|
|
22
20
|
*
|
|
23
21
|
* ACTIVATION: load_skill appends the skill's name to the session state key
|
|
24
|
-
* `_adk_activated_skill_<agent>` (ADK's key, so a session stored
|
|
25
|
-
*
|
|
22
|
+
* `_adk_activated_skill_<agent>` (ADK's key, so a session ADK stored
|
|
23
|
+
* reads the same). SkillToolset.getTools reads it and adds
|
|
26
24
|
* the tools the activated skills name (`metadata.adk_additional_tools`,
|
|
27
25
|
* filled from `allowed-tools`), but only from the tools the YAML handed
|
|
28
26
|
* it under `skills.tools`: a skill cannot grant itself a tool the YAML
|
|
@@ -89,7 +87,7 @@ function isToolsetShaped(value) {
|
|
|
89
87
|
* The tools an agent with `skills:` carries: load_skill and
|
|
90
88
|
* load_skill_resource always, run_skill_script with `scripts: local`, and
|
|
91
89
|
* the tools its loaded skills unlock. A toolset by shape (getTools), which
|
|
92
|
-
* the native loop expands
|
|
90
|
+
* the native loop expands.
|
|
93
91
|
*/
|
|
94
92
|
export class SkillToolset {
|
|
95
93
|
name = 'skill_toolset';
|
|
@@ -321,8 +319,8 @@ export class LoadSkillResourceTool extends SkillTool {
|
|
|
321
319
|
* run_skill_script behind a person's approval: the first call asks for it
|
|
322
320
|
* (the hint names the skill, the script and the arguments) and returns
|
|
323
321
|
* without running; the call made again with the answer runs only when the
|
|
324
|
-
* answer approved it. The confirmation travels as `adk_request_confirmation
|
|
325
|
-
*
|
|
322
|
+
* answer approved it. The confirmation travels as `adk_request_confirmation`,
|
|
323
|
+
* so the turn pauses `input-required` exactly as for
|
|
326
324
|
* `require_approval` (ADR 0028), with this tool's own texts.
|
|
327
325
|
*/
|
|
328
326
|
export class RunSkillScriptTool extends SkillTool {
|
|
@@ -351,7 +349,7 @@ export class RunSkillScriptTool extends SkillTool {
|
|
|
351
349
|
return { error: 'This script run was rejected.' };
|
|
352
350
|
return this.#run(args);
|
|
353
351
|
}
|
|
354
|
-
/**
|
|
352
|
+
/** The script run, after the gate, as ADK's RunSkillScriptTool ran it. */
|
|
355
353
|
async #run(args) {
|
|
356
354
|
const skillName = stringArg(args, 'skill_name');
|
|
357
355
|
const scriptPath = stringArg(args, 'script_path');
|
package/dist/lib/tools/tool.d.ts
CHANGED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* call hands it (ADR 0045, ADR 0051).
|
|
4
4
|
*
|
|
5
5
|
* WHY this file exists:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* lib/tools/adkTool.ts (`toFunctionTool`), so a tool is written once and
|
|
13
|
-
* runs on both.
|
|
6
|
+
* The engine owns its loop, so it owns the tool's shape too: a name, the
|
|
7
|
+
* declaration the model receives (the model contract's ToolDeclaration,
|
|
8
|
+
* lib/models/contract.ts), and an `execute(args, ctx)` the loop calls.
|
|
9
|
+
* Nothing here needs ADK's FunctionTool or its `Context`; registerTool
|
|
10
|
+
* refuses an ADK tool (anything with runAsync), naming 1.0.0 and
|
|
11
|
+
* defineTool.
|
|
14
12
|
*
|
|
15
13
|
* A tool is usually built with `defineTool` (lib/tools/toolContract.ts),
|
|
16
14
|
* which derives the declaration from a zod schema and validates arguments
|
|
@@ -75,7 +73,7 @@ export interface ToolActions {
|
|
|
75
73
|
skipSummarization?: boolean;
|
|
76
74
|
}
|
|
77
75
|
export interface ToolContext {
|
|
78
|
-
/** The run (ADK's
|
|
76
|
+
/** The run (an invocation, in ADK's word) this call belongs to. */
|
|
79
77
|
readonly invocationId?: string;
|
|
80
78
|
/** The agent whose model asked for the call. */
|
|
81
79
|
readonly agentName?: string;
|
|
@@ -130,9 +128,8 @@ export interface ToolContext {
|
|
|
130
128
|
* person has granted it their next message runs this call again, when
|
|
131
129
|
* `accessToken(provider)` returns their token. `accessToken` asks by itself
|
|
132
130
|
* when the person has not connected the provider, so most tools never
|
|
133
|
-
* call this. Present only
|
|
134
|
-
*
|
|
135
|
-
* subagent).
|
|
131
|
+
* call this. Present only in a run with a consent step, for a call the
|
|
132
|
+
* turn runs directly (not inside a delegated subagent).
|
|
136
133
|
*/
|
|
137
134
|
readonly requestCredential?: (provider: string) => Promise<void>;
|
|
138
135
|
}
|
|
@@ -184,15 +181,15 @@ export interface ToolsetContext {
|
|
|
184
181
|
* Listed under an agent's tools like a Tool, but yields the tools the agent
|
|
185
182
|
* has for the next request: the skills harness (lib/tools/skills/tools.ts),
|
|
186
183
|
* whose tools grow as skills are loaded. The native loop expands it before
|
|
187
|
-
* every request
|
|
184
|
+
* every request.
|
|
188
185
|
*/
|
|
189
186
|
export interface Toolset {
|
|
190
187
|
readonly name?: string;
|
|
191
188
|
getTools(ctx?: ToolsetContext): Promise<unknown[]>;
|
|
192
189
|
}
|
|
193
|
-
/** True for an own Toolset: getTools, and neither a Tool nor an ADK tool or toolset. */
|
|
190
|
+
/** True for an own Toolset: getTools, and neither a Tool nor an ADK-shaped tool or toolset (runAsync, processLlmRequest). */
|
|
194
191
|
export declare function isOwnToolset(value: unknown): value is Toolset;
|
|
195
|
-
/** The own Toolset
|
|
192
|
+
/** The own Toolset `value` is, else undefined. */
|
|
196
193
|
export declare function toolsetOf(value: unknown): Toolset | undefined;
|
|
197
194
|
/**
|
|
198
195
|
* Listed under an agent's `tools:` like a Tool, but declares no function and
|
|
@@ -205,8 +202,7 @@ export interface InstructionTool {
|
|
|
205
202
|
}
|
|
206
203
|
/**
|
|
207
204
|
* Where a server-side tool names the NativeTool it stands for. A global
|
|
208
|
-
* symbol, so a second copy of this module
|
|
209
|
-
* marker, still matches.
|
|
205
|
+
* symbol, so a second copy of this module still matches.
|
|
210
206
|
*/
|
|
211
207
|
export declare const NATIVE_TOOL: unique symbol;
|
|
212
208
|
/**
|
|
@@ -226,8 +222,8 @@ export interface NativeToolMarker {
|
|
|
226
222
|
export declare function nativeToolMarker(nativeTool: NativeTool, description?: string): NativeToolMarker;
|
|
227
223
|
/**
|
|
228
224
|
* The NativeTool `value` stands for, read from its marker: the marker
|
|
229
|
-
* itself, or anything carrying the marker's symbol
|
|
230
|
-
*
|
|
225
|
+
* itself, or anything carrying the marker's symbol. Undefined for anything
|
|
226
|
+
* else. Never by class
|
|
231
227
|
* or by name: a client-side tool registered as `web_search` carries no
|
|
232
228
|
* marker and stays a client-side tool.
|
|
233
229
|
*/
|
|
@@ -238,8 +234,8 @@ export declare function isNativeToolMarker(value: unknown): value is NativeToolM
|
|
|
238
234
|
export declare function isInstructionTool(value: unknown): value is InstructionTool;
|
|
239
235
|
/**
|
|
240
236
|
* Appended to a long-running tool's description, word for word what ADK's
|
|
241
|
-
* LongRunningFunctionTool
|
|
242
|
-
*
|
|
237
|
+
* LongRunningFunctionTool appended, so a model reads the declaration it
|
|
238
|
+
* read before 1.0.0.
|
|
243
239
|
*/
|
|
244
240
|
export declare const LONG_RUNNING_NOTE = "\n\nNOTE: This is a long-running operation. Do not call this tool again if it has already returned some intermediate or pending status.";
|
|
245
241
|
/** True for a tool whose answer arrives later. */
|
|
@@ -247,8 +243,9 @@ export declare function isLongRunning(tool: Tool): boolean;
|
|
|
247
243
|
/** True for anything shaped like a Tool (and not an ADK tool, which has runAsync). */
|
|
248
244
|
export declare function isTool(value: unknown): value is Tool;
|
|
249
245
|
/**
|
|
250
|
-
* The texts ADK's FunctionTool gate
|
|
251
|
-
* gated
|
|
246
|
+
* The texts ADK's FunctionTool gate wrote, kept word for word so a call
|
|
247
|
+
* gated now stores the interrupt and the response a session written before
|
|
248
|
+
* 1.0.0 holds.
|
|
252
249
|
*/
|
|
253
250
|
export declare const APPROVAL_TEXTS: {
|
|
254
251
|
readonly hint: (name: string) => string;
|
|
@@ -318,7 +315,7 @@ export interface StandaloneToolContext extends ToolContext {
|
|
|
318
315
|
};
|
|
319
316
|
}
|
|
320
317
|
/**
|
|
321
|
-
* A ToolContext over plain data: for the native
|
|
318
|
+
* A ToolContext over plain data: for the native loop, for a call made
|
|
322
319
|
* outside a run (MCP, a test), and for a caller that knows only who the call
|
|
323
320
|
* is for. The runtime reads `stateDelta`, `actions` and `confirmationRequest`
|
|
324
321
|
* back after the call.
|
|
@@ -333,22 +330,9 @@ export declare function isToolContext(value: unknown): value is ToolContext;
|
|
|
333
330
|
*/
|
|
334
331
|
export declare function toToolContext(ctx?: Partial<ToolContext>): ToolContext;
|
|
335
332
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*/
|
|
339
|
-
export declare const OWN_TOOL: unique symbol;
|
|
340
|
-
/**
|
|
341
|
-
* The Tool behind `value`: the value itself when it is a Tool, the Tool an
|
|
342
|
-
* ADK tool was made from by toFunctionTool, else undefined: a server-side
|
|
343
|
-
* tool, an InstructionTool, a local subagent's AgentTool, an OpenAPI or
|
|
344
|
-
* skills tool. An ADK tool that was
|
|
345
|
-
* gated afterwards (lib/compile.ts sets `requireConfirmation`) yields the
|
|
346
|
-
* gated Tool, so the gate survives the trip back.
|
|
333
|
+
* The Tool `value` is, else undefined (a server-side tool and an
|
|
334
|
+
* InstructionTool are not Tools).
|
|
347
335
|
*/
|
|
348
336
|
export declare function toolOf(value: unknown): Tool | undefined;
|
|
349
|
-
/**
|
|
350
|
-
* The InstructionTool behind `value`: the value itself, or the one an ADK
|
|
351
|
-
* tool was made from by toAdkInstructionTool (lib/tools/adkTool.ts), else
|
|
352
|
-
* undefined.
|
|
353
|
-
*/
|
|
337
|
+
/** The InstructionTool `value` is, else undefined. */
|
|
354
338
|
export declare function instructionToolOf(value: unknown): InstructionTool | undefined;
|