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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/adkPeer.ts — @google/adk as an optional peer (ADR 0102).
|
|
3
|
+
*
|
|
4
|
+
* WHY this file exists:
|
|
5
|
+
* From 0.20.0 the native runtime is the default, and @google/adk is needed
|
|
6
|
+
* only for MELCHIZEDEK_RUNTIME=adk and the features only ADK runs. Until
|
|
7
|
+
* 1.0.0 removes ADK (ADR 0045), the engine's objects still carry an ADK
|
|
8
|
+
* face: the tool registry holds FunctionTools that carry their own Tool,
|
|
9
|
+
* the model shims are BaseLlm classes that carry their contract adapter,
|
|
10
|
+
* and the durable session stores are ADK BaseSessionServices as well as
|
|
11
|
+
* the engine's SessionService. Those classes extend ADK's at load time.
|
|
12
|
+
*
|
|
13
|
+
* This module is the one place the package loads ADK. It tries once, when
|
|
14
|
+
* it is first imported, and every other module takes ADK's values from
|
|
15
|
+
* here, never from '@google/adk' directly (a type-only import is fine):
|
|
16
|
+
* - When ADK is installed, each export below IS ADK's own value, so the
|
|
17
|
+
* ADK runtime, `instanceof` and ADK's registry behave exactly as before.
|
|
18
|
+
* - When it is not, the base classes are stand-ins: they construct as
|
|
19
|
+
* ADK's do (a tool's name, a model's id, a toolset's filter) and carry
|
|
20
|
+
* ADK's own Symbol.for marks, so the engine reads them as it reads ADK's,
|
|
21
|
+
* and every method only ADK calls throws AdkNotInstalledError, which
|
|
22
|
+
* names the package. Everything else (`Runner`, `LlmAgent`, the plugins)
|
|
23
|
+
* is reached through requireAdk(feature), which throws the same error.
|
|
24
|
+
*
|
|
25
|
+
* A package that is installed but fails to load for another reason (a
|
|
26
|
+
* missing dependency of its own, a syntax error) is not "absent": that
|
|
27
|
+
* error is rethrown, so nothing hides a broken install.
|
|
28
|
+
*
|
|
29
|
+
* The load is a top-level await of a dynamic import: an ES module cannot
|
|
30
|
+
* load another synchronously, and the exported classes must exist before
|
|
31
|
+
* any subclass is defined.
|
|
32
|
+
*/
|
|
33
|
+
import type * as AdkModule from '@google/adk';
|
|
34
|
+
/** The package this module loads. */
|
|
35
|
+
export declare const ADK_PACKAGE = "@google/adk";
|
|
36
|
+
/** @google/adk's module namespace, as its types describe it. */
|
|
37
|
+
export type Adk = typeof AdkModule;
|
|
38
|
+
/** ADK's module when it is installed, else undefined. */
|
|
39
|
+
export declare const adk: Adk | undefined;
|
|
40
|
+
/** Whether @google/adk is installed and loaded. */
|
|
41
|
+
export declare function adkInstalled(): boolean;
|
|
42
|
+
/** The installed @google/adk version, read from its package.json, or undefined when it is not installed. */
|
|
43
|
+
export declare function adkVersion(): Promise<string | undefined>;
|
|
44
|
+
/** A feature only ADK runs was used without @google/adk installed. */
|
|
45
|
+
export declare class AdkNotInstalledError extends Error {
|
|
46
|
+
readonly feature: string;
|
|
47
|
+
constructor(feature: string);
|
|
48
|
+
}
|
|
49
|
+
/** ADK's module, or AdkNotInstalledError naming `feature` when it is not installed. */
|
|
50
|
+
export declare function requireAdk(feature: string): Adk;
|
|
51
|
+
export declare const BaseTool: Adk['BaseTool'];
|
|
52
|
+
export type BaseTool = AdkModule.BaseTool;
|
|
53
|
+
export declare const FunctionTool: Adk['FunctionTool'];
|
|
54
|
+
export type FunctionTool<TParameters extends AdkModule.ToolInputParameters = undefined> = AdkModule.FunctionTool<TParameters>;
|
|
55
|
+
export declare const BaseToolset: Adk['BaseToolset'];
|
|
56
|
+
export type BaseToolset = AdkModule.BaseToolset;
|
|
57
|
+
export declare const BaseLlm: Adk['BaseLlm'];
|
|
58
|
+
export type BaseLlm = AdkModule.BaseLlm;
|
|
59
|
+
export declare const Gemini: Adk['Gemini'];
|
|
60
|
+
export type Gemini = AdkModule.Gemini;
|
|
61
|
+
export declare const BaseSessionService: Adk['BaseSessionService'];
|
|
62
|
+
export type BaseSessionService = AdkModule.BaseSessionService;
|
|
63
|
+
export declare const GOOGLE_SEARCH: Adk['GOOGLE_SEARCH'];
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/adkPeer.ts — @google/adk as an optional peer (ADR 0102).
|
|
3
|
+
*
|
|
4
|
+
* WHY this file exists:
|
|
5
|
+
* From 0.20.0 the native runtime is the default, and @google/adk is needed
|
|
6
|
+
* only for MELCHIZEDEK_RUNTIME=adk and the features only ADK runs. Until
|
|
7
|
+
* 1.0.0 removes ADK (ADR 0045), the engine's objects still carry an ADK
|
|
8
|
+
* face: the tool registry holds FunctionTools that carry their own Tool,
|
|
9
|
+
* the model shims are BaseLlm classes that carry their contract adapter,
|
|
10
|
+
* and the durable session stores are ADK BaseSessionServices as well as
|
|
11
|
+
* the engine's SessionService. Those classes extend ADK's at load time.
|
|
12
|
+
*
|
|
13
|
+
* This module is the one place the package loads ADK. It tries once, when
|
|
14
|
+
* it is first imported, and every other module takes ADK's values from
|
|
15
|
+
* here, never from '@google/adk' directly (a type-only import is fine):
|
|
16
|
+
* - When ADK is installed, each export below IS ADK's own value, so the
|
|
17
|
+
* ADK runtime, `instanceof` and ADK's registry behave exactly as before.
|
|
18
|
+
* - When it is not, the base classes are stand-ins: they construct as
|
|
19
|
+
* ADK's do (a tool's name, a model's id, a toolset's filter) and carry
|
|
20
|
+
* ADK's own Symbol.for marks, so the engine reads them as it reads ADK's,
|
|
21
|
+
* and every method only ADK calls throws AdkNotInstalledError, which
|
|
22
|
+
* names the package. Everything else (`Runner`, `LlmAgent`, the plugins)
|
|
23
|
+
* is reached through requireAdk(feature), which throws the same error.
|
|
24
|
+
*
|
|
25
|
+
* A package that is installed but fails to load for another reason (a
|
|
26
|
+
* missing dependency of its own, a syntax error) is not "absent": that
|
|
27
|
+
* error is rethrown, so nothing hides a broken install.
|
|
28
|
+
*
|
|
29
|
+
* The load is a top-level await of a dynamic import: an ES module cannot
|
|
30
|
+
* load another synchronously, and the exported classes must exist before
|
|
31
|
+
* any subclass is defined.
|
|
32
|
+
*/
|
|
33
|
+
/** The package this module loads. */
|
|
34
|
+
export const ADK_PACKAGE = '@google/adk';
|
|
35
|
+
/** Whether `err` says the package itself could not be found (and not a module it imports). */
|
|
36
|
+
function isMissingPackage(err) {
|
|
37
|
+
const e = err;
|
|
38
|
+
if (!e || typeof e !== 'object')
|
|
39
|
+
return false;
|
|
40
|
+
if (e.code !== 'ERR_MODULE_NOT_FOUND' && e.code !== 'MODULE_NOT_FOUND')
|
|
41
|
+
return false;
|
|
42
|
+
return typeof e.message === 'string' && e.message.includes(`'${ADK_PACKAGE}'`);
|
|
43
|
+
}
|
|
44
|
+
let loaded;
|
|
45
|
+
try {
|
|
46
|
+
loaded = await import('@google/adk');
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
if (!isMissingPackage(err))
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
/** ADK's module when it is installed, else undefined. */
|
|
53
|
+
export const adk = loaded;
|
|
54
|
+
/** Whether @google/adk is installed and loaded. */
|
|
55
|
+
export function adkInstalled() {
|
|
56
|
+
return loaded !== undefined;
|
|
57
|
+
}
|
|
58
|
+
/** The installed @google/adk version, read from its package.json, or undefined when it is not installed. */
|
|
59
|
+
export async function adkVersion() {
|
|
60
|
+
if (!loaded)
|
|
61
|
+
return undefined;
|
|
62
|
+
try {
|
|
63
|
+
const { createRequire } = await import('node:module');
|
|
64
|
+
const require = createRequire(import.meta.url);
|
|
65
|
+
const fs = await import('node:fs');
|
|
66
|
+
const path = await import('node:path');
|
|
67
|
+
// The package's exports map hides package.json, so walk up from its entry.
|
|
68
|
+
let dir = path.dirname(require.resolve(ADK_PACKAGE));
|
|
69
|
+
for (let i = 0; i < 6; i++) {
|
|
70
|
+
const file = path.join(dir, 'package.json');
|
|
71
|
+
if (fs.existsSync(file)) {
|
|
72
|
+
const pkg = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
73
|
+
if (pkg.name === ADK_PACKAGE)
|
|
74
|
+
return pkg.version;
|
|
75
|
+
}
|
|
76
|
+
dir = path.dirname(dir);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// Unreadable: the version is unknown, not the package absent.
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
/** A feature only ADK runs was used without @google/adk installed. */
|
|
85
|
+
export class AdkNotInstalledError extends Error {
|
|
86
|
+
feature;
|
|
87
|
+
constructor(feature) {
|
|
88
|
+
super(`${feature} needs ${ADK_PACKAGE}, which is not installed. ` +
|
|
89
|
+
`Install it beside melchizedek-agents (npm install ${ADK_PACKAGE}@~2.2.0), ` +
|
|
90
|
+
`or run on the native runtime (the default; unset MELCHIZEDEK_RUNTIME or set it to native).`);
|
|
91
|
+
this.name = 'AdkNotInstalledError';
|
|
92
|
+
this.feature = feature;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** ADK's module, or AdkNotInstalledError naming `feature` when it is not installed. */
|
|
96
|
+
export function requireAdk(feature) {
|
|
97
|
+
if (!loaded)
|
|
98
|
+
throw new AdkNotInstalledError(feature);
|
|
99
|
+
return loaded;
|
|
100
|
+
}
|
|
101
|
+
// ── Stand-ins for ADK's base classes ─────────────────────────────────────────
|
|
102
|
+
//
|
|
103
|
+
// Each matches the ADK constructor's effect on the instance and ADK's
|
|
104
|
+
// Symbol.for mark, nothing more. They exist only when ADK is not installed.
|
|
105
|
+
const BASE_TOOL = Symbol.for('google.adk.baseTool');
|
|
106
|
+
const IN_MODEL_TOOL = Symbol.for('google.adk.inModelTool');
|
|
107
|
+
const FUNCTION_TOOL = Symbol.for('google.adk.functionTool');
|
|
108
|
+
const BASE_TOOLSET = Symbol.for('google.adk.baseToolset');
|
|
109
|
+
const BASE_MODEL = Symbol.for('google.adk.baseModel');
|
|
110
|
+
const GEMINI_MODEL = Symbol.for('google.adk.geminiModel');
|
|
111
|
+
function adkOnly(what) {
|
|
112
|
+
throw new AdkNotInstalledError(what);
|
|
113
|
+
}
|
|
114
|
+
class MissingBaseTool {
|
|
115
|
+
[BASE_TOOL] = true;
|
|
116
|
+
name;
|
|
117
|
+
description;
|
|
118
|
+
isLongRunning;
|
|
119
|
+
constructor(params) {
|
|
120
|
+
this.name = params.name;
|
|
121
|
+
this.description = params.description;
|
|
122
|
+
this.isLongRunning = params.isLongRunning ?? false;
|
|
123
|
+
}
|
|
124
|
+
_getDeclaration() {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
async checkRequireConfirmation() {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
async processLlmRequest(_request) {
|
|
131
|
+
adkOnly(`The ADK face of the tool '${this.name}'`);
|
|
132
|
+
}
|
|
133
|
+
async runAsync(_request) {
|
|
134
|
+
return adkOnly(`The ADK face of the tool '${this.name}'`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
class MissingFunctionTool extends MissingBaseTool {
|
|
138
|
+
[FUNCTION_TOOL] = true;
|
|
139
|
+
execute;
|
|
140
|
+
parameters;
|
|
141
|
+
requireConfirmation;
|
|
142
|
+
constructor(options) {
|
|
143
|
+
const name = options.name ?? options.execute.name;
|
|
144
|
+
if (!name)
|
|
145
|
+
throw new Error('Tool name cannot be empty. Either name the `execute` function or provide a `name`.');
|
|
146
|
+
super({ name, description: options.description, isLongRunning: options.isLongRunning });
|
|
147
|
+
this.execute = options.execute;
|
|
148
|
+
this.parameters = options.parameters;
|
|
149
|
+
this.requireConfirmation = options.requireConfirmation ?? false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
class MissingBaseToolset {
|
|
153
|
+
[BASE_TOOLSET] = true;
|
|
154
|
+
toolFilter;
|
|
155
|
+
prefix;
|
|
156
|
+
constructor(toolFilter, prefix) {
|
|
157
|
+
this.toolFilter = toolFilter;
|
|
158
|
+
this.prefix = prefix;
|
|
159
|
+
}
|
|
160
|
+
async getTools() {
|
|
161
|
+
return adkOnly('An ADK toolset');
|
|
162
|
+
}
|
|
163
|
+
async close() { }
|
|
164
|
+
}
|
|
165
|
+
class MissingBaseLlm {
|
|
166
|
+
[BASE_MODEL] = true;
|
|
167
|
+
model;
|
|
168
|
+
static supportedModels = [];
|
|
169
|
+
constructor({ model }) {
|
|
170
|
+
this.model = model;
|
|
171
|
+
}
|
|
172
|
+
generateContentAsync() {
|
|
173
|
+
return adkOnly(`The ADK face of the model '${this.model}'`);
|
|
174
|
+
}
|
|
175
|
+
async connect() {
|
|
176
|
+
return adkOnly(`The ADK face of the model '${this.model}'`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* ADK's Gemini, absent: it holds what a caller gave it (the model, a key,
|
|
181
|
+
* Vertex AI's settings), as ADK's does, so the native runtime reads it as it
|
|
182
|
+
* reads TracedGemini (lib/compileNative.ts). Calling it throws.
|
|
183
|
+
*/
|
|
184
|
+
class MissingGemini extends MissingBaseLlm {
|
|
185
|
+
[GEMINI_MODEL] = true;
|
|
186
|
+
apiKey;
|
|
187
|
+
vertexai;
|
|
188
|
+
project;
|
|
189
|
+
location;
|
|
190
|
+
headers;
|
|
191
|
+
constructor(params) {
|
|
192
|
+
super({ model: params.model ?? 'gemini-2.5-flash' });
|
|
193
|
+
if (params.apiKey !== undefined)
|
|
194
|
+
this.apiKey = params.apiKey;
|
|
195
|
+
if (params.vertexai !== undefined)
|
|
196
|
+
this.vertexai = params.vertexai;
|
|
197
|
+
if (params.project !== undefined)
|
|
198
|
+
this.project = params.project;
|
|
199
|
+
if (params.location !== undefined)
|
|
200
|
+
this.location = params.location;
|
|
201
|
+
if (params.headers !== undefined)
|
|
202
|
+
this.headers = params.headers;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* ADK's session service base, absent. A store that extends it is still the
|
|
207
|
+
* engine's SessionService; only the ADK face (the base's appendEvent, which
|
|
208
|
+
* ADK's Runner reaches) needs ADK.
|
|
209
|
+
*/
|
|
210
|
+
class MissingBaseSessionService {
|
|
211
|
+
async appendEvent(_request) {
|
|
212
|
+
return adkOnly('The ADK face of a session store');
|
|
213
|
+
}
|
|
214
|
+
/** ADK's own: the session when it exists, else a new one, through the store's methods. */
|
|
215
|
+
async getOrCreateSession(request) {
|
|
216
|
+
const self = this;
|
|
217
|
+
if (!request.sessionId)
|
|
218
|
+
return self.createSession(request);
|
|
219
|
+
const session = await self.getSession({ appName: request.appName, userId: request.userId, sessionId: request.sessionId });
|
|
220
|
+
return session ?? self.createSession(request);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** ADK's GOOGLE_SEARCH, absent: an in-model tool named google_search, which the engine reads by ADK's mark. */
|
|
224
|
+
class MissingGoogleSearchTool extends MissingBaseTool {
|
|
225
|
+
[IN_MODEL_TOOL] = true;
|
|
226
|
+
constructor() {
|
|
227
|
+
super({ name: 'google_search', description: 'Google Search Tool' });
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// ── The values every other module imports ────────────────────────────────────
|
|
231
|
+
//
|
|
232
|
+
// A type of the same name sits beside each value, so `import { BaseTool }`
|
|
233
|
+
// from here serves as both, as it did from '@google/adk'.
|
|
234
|
+
export const BaseTool = loaded?.BaseTool ?? MissingBaseTool;
|
|
235
|
+
export const FunctionTool = loaded?.FunctionTool ?? MissingFunctionTool;
|
|
236
|
+
export const BaseToolset = loaded?.BaseToolset ?? MissingBaseToolset;
|
|
237
|
+
export const BaseLlm = loaded?.BaseLlm ?? MissingBaseLlm;
|
|
238
|
+
export const Gemini = loaded?.Gemini ?? MissingGemini;
|
|
239
|
+
export const BaseSessionService = loaded?.BaseSessionService ?? MissingBaseSessionService;
|
|
240
|
+
export const GOOGLE_SEARCH = loaded?.GOOGLE_SEARCH ?? new MissingGoogleSearchTool();
|
package/dist/lib/compile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/compile.ts — the one YAML → agent compiler:
|
|
3
|
-
*
|
|
2
|
+
* lib/compile.ts — the one YAML → agent compiler: an AgentSpec per agent,
|
|
3
|
+
* which lib/compileNative.ts turns into what the runtime runs.
|
|
4
4
|
*
|
|
5
5
|
* WHY this file exists:
|
|
6
6
|
* The A2A server carried this logic as two closures inside its executor,
|
|
@@ -12,44 +12,40 @@
|
|
|
12
12
|
* So the compiler moved here and both callers import it.
|
|
13
13
|
*
|
|
14
14
|
* What it does NOT own: model resolution and nested-config loading. Both are
|
|
15
|
-
* injected, because the
|
|
16
|
-
* - the A2A server resolves `model` to a
|
|
15
|
+
* injected, because the callers differ precisely there:
|
|
16
|
+
* - the A2A server resolves `model` to a ModelAdapter carrying the
|
|
17
17
|
* caller's BYOK key (lib/models/registry.ts resolveModel);
|
|
18
|
-
* - the observatory passes the model id through as a string (the
|
|
19
|
-
*
|
|
20
|
-
* per-variant overrides already applied.
|
|
18
|
+
* - the observatory passes the model id through as a string (the loop
|
|
19
|
+
* resolves it, lib/models/registry.ts resolveAdapter) and loads nested
|
|
20
|
+
* syndicates with its per-variant overrides already applied.
|
|
21
21
|
*
|
|
22
22
|
* ── Two orchestration methods, one compiler ───────────────────────────────
|
|
23
|
-
* DELEGATE (no `dispatch:` block): every subagent becomes
|
|
24
|
-
* the orchestrator. PLAN-DISPATCH (`dispatch:` present): the orchestrator
|
|
23
|
+
* DELEGATE (no `dispatch:` block): every subagent becomes a delegation tool
|
|
24
|
+
* on the orchestrator. PLAN-DISPATCH (`dispatch:` present): the orchestrator
|
|
25
25
|
* is compiled WITHOUT subagent tools — it is a pure classifier — and the
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* turn runner compiles the chosen route's own spec. Both paths build
|
|
27
|
+
* subagents through the same function, so the agent a route dispatches to
|
|
28
|
+
* is identical to the one DELEGATE would have delegated to.
|
|
29
29
|
* Contract and rationale: lib/dispatch.ts.
|
|
30
30
|
*
|
|
31
|
-
* ──
|
|
32
|
-
* compileSpec and compileSubagentSpec
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* compileSubagent are spec + compileAdk), and lib/compileNative.ts builds
|
|
37
|
-
* the native loop's NativeAgent (ADR 0045). runSyndicateTurn picks one by
|
|
38
|
-
* MELCHIZEDEK_RUNTIME or its `runtime` option.
|
|
31
|
+
* ── The spec (ADR 0073, ADR 0107) ─────────────────────────────────────────
|
|
32
|
+
* compileSpec and compileSubagentSpec resolve and gate the tools, append the
|
|
33
|
+
* skills index, resolve the model once and build the generateContentConfig.
|
|
34
|
+
* The result is an AgentSpec; lib/compileNative.ts builds the loop's
|
|
35
|
+
* NativeAgent from it.
|
|
39
36
|
*/
|
|
40
|
-
import { BaseLlm, FunctionTool } from '@google/adk';
|
|
41
|
-
import type { BaseTool, LlmAgent } from '@google/adk';
|
|
42
37
|
import type { ReasoningSetting, SubagentYamlConfig, SyndicateYamlConfig } from './loadSyndicate.ts';
|
|
38
|
+
import type { ModelAdapter } from './models/contract.ts';
|
|
43
39
|
import type { ExampleConfig } from './tools/examples.ts';
|
|
44
40
|
import type { SkillsConfig } from './tools/skillToolset.ts';
|
|
45
41
|
export interface CompileOptions {
|
|
46
42
|
/**
|
|
47
|
-
* Turns the YAML `model` string into what
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* The A2A server substitutes a BYOK
|
|
43
|
+
* Turns the YAML `model` string into what the agent runs on: a model id,
|
|
44
|
+
* or a ModelAdapter (lib/models/contract.ts). Default: identity — the id
|
|
45
|
+
* resolves through lib/models/registry.ts resolveAdapter when the agent
|
|
46
|
+
* first calls it. The A2A server substitutes a BYOK adapter factory here.
|
|
51
47
|
*/
|
|
52
|
-
resolveModel?: (model: string | undefined) => string |
|
|
48
|
+
resolveModel?: (model: string | undefined) => string | ModelAdapter | undefined;
|
|
53
49
|
/**
|
|
54
50
|
* Loads a nested `yaml_reference:` syndicate. Default: `loadSyndicate(ref)`
|
|
55
51
|
* with no bindings — the same call the server makes. The observatory wraps
|
|
@@ -60,12 +56,6 @@ export interface CompileOptions {
|
|
|
60
56
|
onUnknownTool?: (name: string) => void;
|
|
61
57
|
/** Progress/diagnostic line sink (nested loads, MCP discovery). */
|
|
62
58
|
log?: (message: string) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Node settings for an agent compiled as a workflow node (lib/workflow.ts):
|
|
65
|
-
* ADK's `retryConfig` and `timeout`, which an LlmAgent takes only at
|
|
66
|
-
* construction. Called with the agent's name; undefined means none.
|
|
67
|
-
*/
|
|
68
|
-
nodeConfig?: (agentName: string) => Record<string, unknown> | undefined;
|
|
69
59
|
}
|
|
70
60
|
export { REASONING_BUDGETS, reasoningConfig } from './models/reasoning.ts';
|
|
71
61
|
/**
|
|
@@ -79,36 +69,17 @@ export declare function withReasoning(agent: {
|
|
|
79
69
|
reasoning?: ReasoningSetting;
|
|
80
70
|
generateContentConfig?: object;
|
|
81
71
|
}, model: string | undefined): Record<string, unknown> | undefined;
|
|
82
|
-
/** An agent's `context:` block and its default, owned by the
|
|
72
|
+
/** An agent's `context:` block and its default, owned by the compactor (ADR 0033). */
|
|
83
73
|
export type { ContextConfig } from './runtime/native/compaction.ts';
|
|
84
74
|
import type { ContextConfig } from './runtime/native/compaction.ts';
|
|
85
75
|
export { DEFAULT_KEEP_RECENT_EVENTS } from './runtime/native/compaction.ts';
|
|
86
|
-
/**
|
|
87
|
-
* A copy of a FunctionTool that runs only after a person approves the call
|
|
88
|
-
* (ADR 0028). ADK's own gate does the work: the call raises an
|
|
89
|
-
* `adk_request_confirmation` interrupt pinning the call and its arguments,
|
|
90
|
-
* and only an approval bound to that exact call runs it. The original stays
|
|
91
|
-
* ungated for every other agent that lists the same tool.
|
|
92
|
-
*/
|
|
93
|
-
export declare function requireApprovalOn(tool: FunctionTool): FunctionTool;
|
|
94
|
-
/**
|
|
95
|
-
* A copy of an ADK BaseTool that runs only after a person approves the
|
|
96
|
-
* call: the same confirmation interrupt FunctionTool's own gate raises, so
|
|
97
|
-
* the turn pauses and resumes exactly as ADR 0028 says. The engine no
|
|
98
|
-
* longer uses it: an OpenAPI operation is a FunctionTool over an own Tool
|
|
99
|
-
* (ADR 0067) and takes requireApprovalOn like every registry tool.
|
|
100
|
-
* @deprecated Gate a FunctionTool with requireApprovalOn, or an own Tool
|
|
101
|
-
* with requireApproval (lib/tools/tool.ts).
|
|
102
|
-
*/
|
|
103
|
-
export declare function requireApprovalOnBaseTool<T extends BaseTool>(tool: T): T;
|
|
104
76
|
/** True when any agent of a syndicate may pause for approval: a gated tool, or skill scripts. */
|
|
105
77
|
export declare function declaresApprovals(config: SyndicateYamlConfig): boolean;
|
|
106
78
|
export type { ExampleConfig };
|
|
107
79
|
/**
|
|
108
|
-
* An agent's `examples:` as
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* ExampleTool used.
|
|
80
|
+
* An agent's `examples:` as their InstructionTool (lib/tools/examples.ts):
|
|
81
|
+
* never called by the model, it adds the exchanges to every request's
|
|
82
|
+
* instruction as few-shot examples, in the words ADK's ExampleTool used.
|
|
112
83
|
*/
|
|
113
84
|
export declare function examplesTool(examples: ExampleConfig[] | undefined): unknown[];
|
|
114
85
|
/** True when a turn running this agent directly may pause for a person (ADR 0028). */
|
|
@@ -118,11 +89,12 @@ export declare function agentGates(agent: {
|
|
|
118
89
|
} | undefined): boolean;
|
|
119
90
|
/**
|
|
120
91
|
* One entry of an agent's tool list, in the order the model sees it.
|
|
121
|
-
* `tool` is a resolved tool as the registry gives it:
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
92
|
+
* `tool` is a resolved tool as the registry gives it: an own Tool,
|
|
93
|
+
* InstructionTool, NativeToolMarker or Toolset (lib/tools/tool.ts), gated
|
|
94
|
+
* by require_approval where the YAML says so. `agent` is a delegated subagent
|
|
95
|
+
* (DELEGATE mode), `remote` a subagent served over A2A, `workflow` a
|
|
96
|
+
* `yaml_reference` to a workflow syndicate, whose whole graph is the tool
|
|
97
|
+
* (ADR 0098).
|
|
126
98
|
*/
|
|
127
99
|
export type SpecTool = {
|
|
128
100
|
kind: 'tool';
|
|
@@ -135,10 +107,42 @@ export type SpecTool = {
|
|
|
135
107
|
name: string;
|
|
136
108
|
description: string;
|
|
137
109
|
url: string;
|
|
110
|
+
} | {
|
|
111
|
+
kind: 'workflow';
|
|
112
|
+
workflow: WorkflowSpec;
|
|
138
113
|
};
|
|
139
114
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
115
|
+
* A workflow syndicate, compiled: lib/compileNative.ts builds the walk's
|
|
116
|
+
* graph and agents from it. Nested as a subagent (a `yaml_reference` in
|
|
117
|
+
* DELEGATE mode), the graph runs under the entry's name and description,
|
|
118
|
+
* and that name is the root of every node path.
|
|
119
|
+
*/
|
|
120
|
+
export interface WorkflowSpec {
|
|
121
|
+
/** The workflow's name: the syndicate's, or the subagent entry's when nested. */
|
|
122
|
+
name: string;
|
|
123
|
+
/** The tool's description when nested; '' at the root. */
|
|
124
|
+
description: string;
|
|
125
|
+
/** The syndicate, its `syndicate_name` set to `name`. */
|
|
126
|
+
config: SyndicateYamlConfig;
|
|
127
|
+
/** Every agent of the graph, the orchestrator first, as compileSubagentSpec builds it, with its YAML entry. */
|
|
128
|
+
agents: Array<{
|
|
129
|
+
yaml: SubagentYamlConfig;
|
|
130
|
+
spec: AgentSpec;
|
|
131
|
+
}>;
|
|
132
|
+
/**
|
|
133
|
+
* Every node that is a `yaml_reference` to a workflow syndicate, with its
|
|
134
|
+
* YAML entry: the nested graph under the entry's name (ADR 0106). The
|
|
135
|
+
* walk runs it as the node, on its own child session.
|
|
136
|
+
*/
|
|
137
|
+
workflows: Array<{
|
|
138
|
+
yaml: SubagentYamlConfig;
|
|
139
|
+
workflow: WorkflowSpec;
|
|
140
|
+
}>;
|
|
141
|
+
/** The registry entry for a tool node's tool name, or undefined (CompileOptions.onUnknownTool applies). */
|
|
142
|
+
resolveTool: (name: string) => unknown;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* One YAML agent, compiled: what lib/compileNative.ts turns into the loop's
|
|
142
146
|
* NativeAgent. Built once per agent by compileSpec and compileSubagentSpec:
|
|
143
147
|
* the tools resolved (OpenAPI operations built, MCP tools listed) and
|
|
144
148
|
* gated, the skills index appended to the instruction, the model resolved
|
|
@@ -154,14 +158,14 @@ export interface AgentSpec {
|
|
|
154
158
|
resolvedModel?: unknown;
|
|
155
159
|
/** The id the agent runs on: the YAML's, else the resolved adapter's. */
|
|
156
160
|
modelId?: string;
|
|
157
|
-
/** `fallback_model:`, unresolved:
|
|
161
|
+
/** `fallback_model:`, unresolved: the loop resolves it where it calls it. */
|
|
158
162
|
fallbackModel?: string;
|
|
159
163
|
/** The YAML instruction, with the skills index appended when the agent has `skills:`. */
|
|
160
164
|
instruction: string;
|
|
161
165
|
globalInstruction?: string;
|
|
162
166
|
tools: SpecTool[];
|
|
163
167
|
outputSchema?: Record<string, unknown>;
|
|
164
|
-
/** The YAML's config with `reasoning:` mapped in and server-side tool invocations on
|
|
168
|
+
/** The YAML's config with `reasoning:` mapped in and server-side tool invocations on. */
|
|
165
169
|
generateContentConfig: Record<string, unknown>;
|
|
166
170
|
includeContents?: 'default' | 'none';
|
|
167
171
|
outputKey?: string;
|
|
@@ -174,30 +178,54 @@ export interface AgentSpec {
|
|
|
174
178
|
/** `mode: task`. */
|
|
175
179
|
mode?: 'task';
|
|
176
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* The spec of a workflow syndicate: every agent through compileSubagentSpec
|
|
183
|
+
* (the orchestrator first, as a node like any other), and the registry's
|
|
184
|
+
* lookup for its tool nodes. `name` and `description` name a nested one
|
|
185
|
+
* after its subagent entry (ADR 0098); `ref` is the file it came from.
|
|
186
|
+
*
|
|
187
|
+
* A nested workflow runs inside its caller's tool call, so a pause inside it
|
|
188
|
+
* could not reach the caller (ADR 0028, as for any nested syndicate): an
|
|
189
|
+
* `ask_user` node is refused by name here.
|
|
190
|
+
*/
|
|
191
|
+
export declare function compileWorkflowSpec(config: SyndicateYamlConfig, opts?: CompileOptions, name?: string, description?: string, ref?: string): Promise<WorkflowSpec>;
|
|
192
|
+
/** Every agent spec a workflow runs, its nested workflow nodes' agents included, for one adapter lookup (nativeAdapterFor). */
|
|
193
|
+
export declare function workflowAgentSpecs(spec: WorkflowSpec): AgentSpec[];
|
|
194
|
+
/** A subagent entry, compiled: one agent, or a nested workflow syndicate's whole graph (ADR 0098, ADR 0106). */
|
|
195
|
+
export type EntrySpec = {
|
|
196
|
+
kind: 'agent';
|
|
197
|
+
spec: AgentSpec;
|
|
198
|
+
} | {
|
|
199
|
+
kind: 'workflow';
|
|
200
|
+
workflow: WorkflowSpec;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* A subagent entry as what it runs: an inline agent or a nested syndicate's
|
|
204
|
+
* orchestrator as one agent, or a `yaml_reference` to a workflow syndicate
|
|
205
|
+
* as its whole graph under the entry's name and description. A delegated
|
|
206
|
+
* subagent, a dispatch route and a workflow node all compile through here,
|
|
207
|
+
* so the graph a file describes is the graph that runs (ADR 0106).
|
|
208
|
+
*/
|
|
209
|
+
export declare function compileEntrySpec(subCfg: SubagentYamlConfig, opts?: CompileOptions): Promise<EntrySpec>;
|
|
210
|
+
/**
|
|
211
|
+
* The names of a syndicate's subagent entries that are `yaml_reference`s to
|
|
212
|
+
* a workflow syndicate. Loads each reference once and compiles nothing, so a
|
|
213
|
+
* runtime can refuse what it cannot run before the session is touched.
|
|
214
|
+
*/
|
|
215
|
+
export declare function workflowEntryNames(config: SyndicateYamlConfig, opts?: CompileOptions): string[];
|
|
177
216
|
/**
|
|
178
217
|
* The spec of ONE agent from a subagent entry. A `yaml_reference` entry is
|
|
179
|
-
* the nested syndicate's
|
|
180
|
-
* description,
|
|
218
|
+
* the nested syndicate's orchestrator under this entry's name and
|
|
219
|
+
* description, its own subagents delegated to as in any DELEGATE graph. A
|
|
220
|
+
* `yaml_reference` to a workflow syndicate has no one agent to build: it
|
|
221
|
+
* runs as its whole graph (compileEntrySpec), and is refused here by name.
|
|
181
222
|
*/
|
|
182
223
|
export declare function compileSubagentSpec(subCfg: SubagentYamlConfig, opts?: CompileOptions): Promise<AgentSpec>;
|
|
183
224
|
/**
|
|
184
225
|
* The spec of a syndicate's orchestrator. In DELEGATE mode its subagents
|
|
185
226
|
* come first among its tools, as delegations; in PLAN-DISPATCH mode it gets
|
|
186
|
-
* none (
|
|
227
|
+
* none (a classifier answers with its outputSchema — see
|
|
187
228
|
* config/agents/critic.yaml), and the caller dispatches to a route's own
|
|
188
229
|
* spec itself.
|
|
189
230
|
*/
|
|
190
231
|
export declare function compileSpec(config: SyndicateYamlConfig, opts?: CompileOptions, overrideName?: string, overrideDescription?: string): Promise<AgentSpec>;
|
|
191
|
-
/**
|
|
192
|
-
* Builds ONE runnable ADK agent from a subagent entry: its spec, as
|
|
193
|
-
* lib/compileAdk.ts builds it. A workflow node's settings
|
|
194
|
-
* (CompileOptions.nodeConfig) apply to a local agent, not to a nested
|
|
195
|
-
* syndicate's orchestrator.
|
|
196
|
-
*/
|
|
197
|
-
export declare function compileSubagent(subCfg: SubagentYamlConfig, opts?: CompileOptions): Promise<LlmAgent>;
|
|
198
|
-
/**
|
|
199
|
-
* Compiles a syndicate's orchestrator for the ADK runtime. In DELEGATE mode
|
|
200
|
-
* its subagents are attached as AgentTools; in PLAN-DISPATCH mode it gets
|
|
201
|
-
* none, and the caller dispatches to `compileSubagent(route)` itself.
|
|
202
|
-
*/
|
|
203
|
-
export declare function compileGraph(config: SyndicateYamlConfig, opts?: CompileOptions, overrideName?: string, overrideDescription?: string): Promise<LlmAgent>;
|