melchizedek-agents 0.18.0 → 0.20.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 +12 -0
- package/CHANGELOG.md +1001 -0
- package/DOCUMENTATION.md +252 -65
- package/QUICKSTART.md +9 -6
- package/README.md +42 -4
- package/config/agents/examples/harness.yaml +3 -1
- package/config/agents/examples/model_zoo.yaml +10 -9
- package/config/agents/syndicateSchema.yaml +53 -16
- package/config/agents/templates/account_memory.yaml +2 -6
- package/config/agents/templates/case_desk.yaml +3 -9
- package/config/agents/templates/draft_review.yaml +3 -9
- package/config/agents/templates/intake_extractor.yaml +1 -3
- package/config/agents/templates/research_brief.yaml +3 -9
- package/config/agents/templates/research_desk.yaml +3 -9
- package/config/agents/templates/review_panel.yaml +4 -12
- package/config/agents/templates/support_triage.yaml +4 -12
- package/config/agents/templates/systems_operator.yaml +2 -6
- package/db/hardening.sql +7 -1
- package/db/migrations/0013_tool_credentials.sql +260 -0
- package/dist/lib/a2a/app.d.ts +70 -6
- package/dist/lib/a2a/app.js +107 -2
- package/dist/lib/a2a/executor.d.ts +20 -3
- package/dist/lib/a2a/executor.js +66 -7
- package/dist/lib/a2a/remoteAgent.d.ts +24 -9
- package/dist/lib/a2a/remoteAgent.js +31 -14
- package/dist/lib/adkPeer.d.ts +63 -0
- package/dist/lib/adkPeer.js +240 -0
- package/dist/lib/compile.d.ts +159 -30
- package/dist/lib/compile.js +215 -134
- package/dist/lib/compileAdk.d.ts +32 -0
- package/dist/lib/compileAdk.js +142 -0
- package/dist/lib/compileNative.d.ts +111 -0
- package/dist/lib/compileNative.js +278 -0
- package/dist/lib/config.d.ts +6 -5
- package/dist/lib/config.js +6 -5
- package/dist/lib/doctor.d.ts +28 -1
- package/dist/lib/doctor.js +64 -2
- package/dist/lib/index.d.ts +6 -1
- package/dist/lib/index.js +7 -1
- package/dist/lib/loadSyndicate.d.ts +18 -0
- package/dist/lib/memory/erase.d.ts +5 -3
- package/dist/lib/memory/erase.js +5 -2
- package/dist/lib/memory/namespace.d.ts +8 -1
- package/dist/lib/memory/namespace.js +12 -6
- package/dist/lib/memory/providers.js +2 -1
- package/dist/lib/memory/supabaseMemoryService.d.ts +37 -3
- package/dist/lib/memory/supabaseMemoryService.js +42 -2
- package/dist/lib/model.d.ts +47 -0
- package/dist/lib/model.js +37 -0
- package/dist/lib/models/adapterResolver.d.ts +115 -0
- package/dist/lib/models/adapterResolver.js +137 -0
- package/dist/lib/models/adkGeminiAdapter.d.ts +90 -0
- package/dist/lib/models/adkGeminiAdapter.js +369 -0
- package/dist/lib/models/adkShim.d.ts +111 -0
- package/dist/lib/models/adkShim.js +136 -0
- package/dist/lib/models/capabilities.d.ts +3 -0
- package/dist/lib/models/capabilities.js +33 -23
- package/dist/lib/models/chatCompletionsAdapter.d.ts +279 -0
- package/dist/lib/models/chatCompletionsAdapter.js +854 -0
- package/dist/lib/models/circuitBreaker.d.ts +42 -0
- package/dist/lib/models/circuitBreaker.js +70 -0
- package/dist/lib/models/claudeAdapter.d.ts +103 -0
- package/dist/lib/models/claudeAdapter.js +669 -0
- package/dist/lib/models/claudeLlm.d.ts +39 -62
- package/dist/lib/models/claudeLlm.js +45 -350
- package/dist/lib/models/claudeModels.d.ts +127 -0
- package/dist/lib/models/claudeModels.js +237 -0
- package/dist/lib/models/contract.d.ts +395 -0
- package/dist/lib/models/contract.js +39 -0
- package/dist/lib/models/endpoints.js +2 -1
- package/dist/lib/models/errorResponse.d.ts +50 -0
- package/dist/lib/models/errorResponse.js +48 -0
- package/dist/lib/models/fallback.d.ts +18 -11
- package/dist/lib/models/fallback.js +54 -43
- package/dist/lib/models/fallbackAdapter.d.ts +55 -0
- package/dist/lib/models/fallbackAdapter.js +62 -0
- package/dist/lib/models/gateway.js +2 -1
- package/dist/lib/models/gatewayAdapter.d.ts +51 -0
- package/dist/lib/models/gatewayAdapter.js +81 -0
- package/dist/lib/models/gatewayLlm.d.ts +12 -33
- package/dist/lib/models/gatewayLlm.js +16 -77
- package/dist/lib/models/geminiAdapter.d.ts +125 -0
- package/dist/lib/models/geminiAdapter.js +854 -0
- package/dist/lib/models/geminiState.d.ts +46 -0
- package/dist/lib/models/geminiState.js +51 -0
- package/dist/lib/models/genaiMapping.d.ts +283 -0
- package/dist/lib/models/genaiMapping.js +965 -0
- package/dist/lib/models/gptAdapter.d.ts +240 -0
- package/dist/lib/models/gptAdapter.js +804 -0
- package/dist/lib/models/gptLlm.d.ts +63 -123
- package/dist/lib/models/gptLlm.js +89 -603
- package/dist/lib/models/grokAdapter.d.ts +86 -0
- package/dist/lib/models/grokAdapter.js +142 -0
- package/dist/lib/models/grokLlm.d.ts +22 -45
- package/dist/lib/models/grokLlm.js +24 -69
- package/dist/lib/models/kimiAdapter.d.ts +157 -0
- package/dist/lib/models/kimiAdapter.js +203 -0
- package/dist/lib/models/kimiLlm.d.ts +15 -107
- package/dist/lib/models/kimiLlm.js +19 -155
- package/dist/lib/models/ollamaAdapter.d.ts +125 -0
- package/dist/lib/models/ollamaAdapter.js +155 -0
- package/dist/lib/models/ollamaLlm.d.ts +11 -107
- package/dist/lib/models/ollamaLlm.js +15 -153
- package/dist/lib/models/openAiCompatibleLlm.d.ts +73 -216
- package/dist/lib/models/openAiCompatibleLlm.js +109 -671
- package/dist/lib/models/providerState.d.ts +63 -0
- package/dist/lib/models/providerState.js +61 -0
- package/dist/lib/models/reasoning.d.ts +26 -0
- package/dist/lib/models/reasoning.js +59 -0
- package/dist/lib/models/registry.d.ts +62 -35
- package/dist/lib/models/registry.js +100 -124
- package/dist/lib/models/retry.d.ts +2 -1
- package/dist/lib/models/retry.js +3 -2
- package/dist/lib/models/schemaNormalize.d.ts +98 -0
- package/dist/lib/models/schemaNormalize.js +321 -1
- package/dist/lib/models/tracedGemini.d.ts +41 -0
- package/dist/lib/models/tracedGemini.js +98 -0
- package/dist/lib/models/urls.d.ts +11 -0
- package/dist/lib/models/urls.js +16 -0
- package/dist/lib/net/redirects.d.ts +21 -2
- package/dist/lib/net/redirects.js +11 -34
- package/dist/lib/observability/audit.d.ts +5 -1
- package/dist/lib/observability/lineage.d.ts +14 -0
- package/dist/lib/observability/lineage.js +33 -0
- package/dist/lib/observability/supabaseSpanExporter.d.ts +10 -4
- package/dist/lib/observability/supabaseSpanExporter.js +17 -9
- package/dist/lib/observability/tracer.d.ts +26 -8
- package/dist/lib/observability/tracer.js +43 -18
- package/dist/lib/runtime/adkMemoryBridge.d.ts +46 -0
- package/dist/lib/runtime/adkMemoryBridge.js +68 -0
- package/dist/lib/runtime/adkSessionBridge.d.ts +78 -0
- package/dist/lib/runtime/adkSessionBridge.js +176 -0
- package/dist/lib/runtime/approvals.d.ts +5 -0
- package/dist/lib/runtime/approvals.js +39 -8
- package/dist/lib/runtime/credentials.d.ts +61 -0
- package/dist/lib/runtime/credentials.js +67 -0
- package/dist/lib/runtime/events.d.ts +229 -0
- package/dist/lib/runtime/events.js +274 -0
- package/dist/lib/runtime/logging.d.ts +32 -0
- package/dist/lib/runtime/logging.js +55 -0
- package/dist/lib/runtime/memoryService.d.ts +72 -0
- package/dist/lib/runtime/memoryService.js +25 -0
- package/dist/lib/runtime/native/agentLoop.d.ts +209 -0
- package/dist/lib/runtime/native/agentLoop.js +705 -0
- package/dist/lib/runtime/native/compaction.d.ts +103 -0
- package/dist/lib/runtime/native/compaction.js +191 -0
- package/dist/lib/runtime/native/delegate.d.ts +151 -0
- package/dist/lib/runtime/native/delegate.js +256 -0
- package/dist/lib/runtime/native/history.d.ts +83 -0
- package/dist/lib/runtime/native/history.js +312 -0
- package/dist/lib/runtime/native/interrupts.d.ts +129 -0
- package/dist/lib/runtime/native/interrupts.js +310 -0
- package/dist/lib/runtime/native/request.d.ts +215 -0
- package/dist/lib/runtime/native/request.js +585 -0
- package/dist/lib/runtime/native/selfCorrection.d.ts +164 -0
- package/dist/lib/runtime/native/selfCorrection.js +327 -0
- package/dist/lib/runtime/native/step.d.ts +156 -0
- package/dist/lib/runtime/native/step.js +263 -0
- package/dist/lib/runtime/native/taskMode.d.ts +64 -0
- package/dist/lib/runtime/native/taskMode.js +126 -0
- package/dist/lib/runtime/native/telemetry.d.ts +75 -0
- package/dist/lib/runtime/native/telemetry.js +299 -0
- package/dist/lib/runtime/native/tempState.d.ts +31 -0
- package/dist/lib/runtime/native/tempState.js +56 -0
- package/dist/lib/runtime/nativeTurn.d.ts +86 -0
- package/dist/lib/runtime/nativeTurn.js +107 -0
- package/dist/lib/runtime/questions.d.ts +29 -7
- package/dist/lib/runtime/questions.js +47 -32
- package/dist/lib/runtime/runtimeFlag.d.ts +38 -0
- package/dist/lib/runtime/runtimeFlag.js +58 -0
- package/dist/lib/runtime/sessions.d.ts +166 -0
- package/dist/lib/runtime/sessions.js +201 -0
- package/dist/lib/runtime/syndicateTurn.d.ts +46 -5
- package/dist/lib/runtime/syndicateTurn.js +233 -36
- package/dist/lib/runtime/valueDepth.d.ts +23 -0
- package/dist/lib/runtime/valueDepth.js +41 -0
- package/dist/lib/session/supabaseSessionService.d.ts +65 -18
- package/dist/lib/session/supabaseSessionService.js +148 -105
- package/dist/lib/session/transcript.d.ts +69 -23
- package/dist/lib/session/transcript.js +105 -29
- package/dist/lib/skills.js +33 -7
- package/dist/lib/storage/postgres/credentialStore.d.ts +20 -0
- package/dist/lib/storage/postgres/credentialStore.js +82 -0
- package/dist/lib/storage/postgres/index.d.ts +12 -0
- package/dist/lib/storage/postgres/index.js +6 -1
- package/dist/lib/storage/postgres/sessionService.d.ts +44 -16
- package/dist/lib/storage/postgres/sessionService.js +128 -66
- package/dist/lib/syndicateSchema.d.ts +49 -0
- package/dist/lib/syndicateSchema.js +99 -9
- package/dist/lib/toolRegistry.d.ts +26 -2
- package/dist/lib/toolRegistry.js +73 -17
- package/dist/lib/tools/adkTool.d.ts +81 -0
- package/dist/lib/tools/adkTool.js +268 -0
- package/dist/lib/tools/auth.d.ts +118 -0
- package/dist/lib/tools/auth.js +89 -0
- package/dist/lib/tools/collectionsSearchTool.d.ts +8 -7
- package/dist/lib/tools/collectionsSearchTool.js +12 -27
- package/dist/lib/tools/credentialCipher.d.ts +58 -0
- package/dist/lib/tools/credentialCipher.js +116 -0
- package/dist/lib/tools/credentialStore.d.ts +77 -0
- package/dist/lib/tools/credentialStore.js +246 -0
- package/dist/lib/tools/examples.d.ts +43 -0
- package/dist/lib/tools/examples.js +62 -0
- package/dist/lib/tools/generateImageTool.d.ts +15 -6
- package/dist/lib/tools/generateImageTool.js +19 -29
- package/dist/lib/tools/inspectImageTool.d.ts +9 -6
- package/dist/lib/tools/inspectImageTool.js +13 -17
- package/dist/lib/tools/mcpToolFactory.d.ts +42 -1
- package/dist/lib/tools/mcpToolFactory.js +46 -47
- package/dist/lib/tools/memoryTools.d.ts +61 -0
- package/dist/lib/tools/memoryTools.js +119 -0
- package/dist/lib/tools/nativeTools.d.ts +38 -0
- package/dist/lib/tools/nativeTools.js +43 -0
- package/dist/lib/tools/oauthConsent.d.ts +181 -0
- package/dist/lib/tools/oauthConsent.js +330 -0
- package/dist/lib/tools/openapi/call.d.ts +108 -0
- package/dist/lib/tools/openapi/call.js +295 -0
- package/dist/lib/tools/openapi/parse.d.ts +147 -0
- package/dist/lib/tools/openapi/parse.js +570 -0
- package/dist/lib/tools/openapiTools.d.ts +25 -17
- package/dist/lib/tools/openapiTools.js +124 -121
- package/dist/lib/tools/scienceTools.d.ts +14 -14
- package/dist/lib/tools/skillToolset.d.ts +58 -87
- package/dist/lib/tools/skillToolset.js +61 -142
- package/dist/lib/tools/skills/env.d.ts +58 -0
- package/dist/lib/tools/skills/env.js +165 -0
- package/dist/lib/tools/skills/executor.d.ts +114 -0
- package/dist/lib/tools/skills/executor.js +331 -0
- package/dist/lib/tools/skills/frontmatter.d.ts +79 -0
- package/dist/lib/tools/skills/frontmatter.js +215 -0
- package/dist/lib/tools/skills/loader.d.ts +91 -0
- package/dist/lib/tools/skills/loader.js +257 -0
- package/dist/lib/tools/skills/tools.d.ts +187 -0
- package/dist/lib/tools/skills/tools.js +386 -0
- package/dist/lib/tools/taskTools.d.ts +15 -15
- package/dist/lib/tools/tool.d.ts +354 -0
- package/dist/lib/tools/tool.js +304 -0
- package/dist/lib/tools/toolContract.d.ts +89 -33
- package/dist/lib/tools/toolContract.js +104 -82
- package/dist/lib/tools/urlContextTool.d.ts +4 -1
- package/dist/lib/tools/urlContextTool.js +6 -2
- package/dist/lib/tools/webExtractTool.d.ts +3 -3
- package/dist/lib/tools/webExtractTool.js +2 -1
- package/dist/lib/tools/webSearchTool.d.ts +7 -10
- package/dist/lib/tools/webSearchTool.js +15 -60
- package/dist/lib/tools/wikiTools.d.ts +19 -19
- package/dist/lib/tools/wikiTools.js +13 -9
- package/dist/lib/tools/xApiSearchTool.d.ts +3 -3
- package/dist/lib/tools/xApiSearchTool.js +2 -1
- package/dist/lib/tools/xSearchTool.d.ts +8 -10
- package/dist/lib/tools/xSearchTool.js +12 -63
- package/dist/lib/tools/xaiSearchParams.d.ts +41 -0
- package/dist/lib/tools/xaiSearchParams.js +126 -0
- package/dist/lib/wiki/agentRun.d.ts +12 -0
- package/dist/lib/wiki/agentRun.js +74 -35
- package/dist/lib/wiki/entities.d.ts +12 -0
- package/dist/lib/wiki/entities.js +45 -3
- package/dist/lib/workflow/agentNode.d.ts +153 -0
- package/dist/lib/workflow/agentNode.js +365 -0
- package/dist/lib/workflow/graph.d.ts +178 -0
- package/dist/lib/workflow/graph.js +468 -0
- package/dist/lib/workflow/nodeEvents.d.ts +50 -0
- package/dist/lib/workflow/nodeEvents.js +101 -0
- package/dist/lib/workflow/pause.d.ts +122 -0
- package/dist/lib/workflow/pause.js +180 -0
- package/dist/lib/workflow/resume.d.ts +166 -0
- package/dist/lib/workflow/resume.js +441 -0
- package/dist/lib/workflow/route.d.ts +58 -0
- package/dist/lib/workflow/route.js +69 -0
- package/dist/lib/workflow/scheduler.d.ts +418 -0
- package/dist/lib/workflow/scheduler.js +756 -0
- package/dist/lib/workflow/toolNode.d.ts +127 -0
- package/dist/lib/workflow/toolNode.js +236 -0
- package/dist/lib/workflow/turn.d.ts +118 -0
- package/dist/lib/workflow/turn.js +216 -0
- package/dist/lib/workflow.d.ts +33 -11
- package/dist/lib/workflow.js +49 -27
- package/dist/lib/workflowConfig.d.ts +7 -2
- package/dist/lib/workflowConfig.js +7 -12
- package/dist/scripts/a2a_server.js +4 -3
- package/dist/scripts/assistant_worker.d.ts +2 -1
- package/dist/scripts/assistant_worker.js +9 -4
- package/dist/scripts/doctor.d.ts +3 -1
- package/dist/scripts/doctor.js +4 -2
- package/dist/scripts/syndicate_chat.js +19 -10
- package/package.json +9 -3
- package/skills/briefs/melchizedek-author.md +3 -2
- package/skills/briefs/melchizedek-models.md +13 -9
- package/skills/briefs/melchizedek.md +3 -3
- package/skills/melchizedek/SKILL.md +2 -1
- package/skills/melchizedek-author/SKILL.md +2 -1
- package/skills/melchizedek-author/assets/minimal.yaml +2 -0
- package/skills/melchizedek-models/SKILL.md +23 -6
package/dist/lib/compile.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* lib/compile.ts — the one YAML →
|
|
2
|
+
* lib/compile.ts — the one YAML → agent compiler: a runtime-neutral
|
|
3
|
+
* AgentSpec, and the ADK agent graph built from it.
|
|
3
4
|
*
|
|
4
5
|
* WHY this file exists:
|
|
5
6
|
* The A2A server carried this logic as two closures inside its executor,
|
|
@@ -26,10 +27,20 @@
|
|
|
26
27
|
* paths build subagents through the same function, so the agent a route
|
|
27
28
|
* dispatches to is identical to the one DELEGATE would have wrapped.
|
|
28
29
|
* Contract and rationale: lib/dispatch.ts.
|
|
30
|
+
*
|
|
31
|
+
* ── One spec, two runtimes (ADR 0073) ─────────────────────────────────────
|
|
32
|
+
* compileSpec and compileSubagentSpec do the work every runtime shares:
|
|
33
|
+
* resolve and gate the tools, append the skills index, resolve the model
|
|
34
|
+
* once, build the generateContentConfig. The result is an AgentSpec.
|
|
35
|
+
* lib/compileAdk.ts builds ADK's LlmAgent from it (compileGraph and
|
|
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.
|
|
29
39
|
*/
|
|
30
|
-
import { BaseLlm, FunctionTool
|
|
31
|
-
import type { BaseTool } from '@google/adk';
|
|
32
|
-
import type { SubagentYamlConfig, SyndicateYamlConfig } from './loadSyndicate.ts';
|
|
40
|
+
import { BaseLlm, FunctionTool } from './adkPeer.ts';
|
|
41
|
+
import type { BaseTool, LlmAgent } from '@google/adk';
|
|
42
|
+
import type { ReasoningSetting, SubagentYamlConfig, SyndicateYamlConfig } from './loadSyndicate.ts';
|
|
43
|
+
import type { ExampleConfig } from './tools/examples.ts';
|
|
33
44
|
import type { SkillsConfig } from './tools/skillToolset.ts';
|
|
34
45
|
export interface CompileOptions {
|
|
35
46
|
/**
|
|
@@ -56,16 +67,22 @@ export interface CompileOptions {
|
|
|
56
67
|
*/
|
|
57
68
|
nodeConfig?: (agentName: string) => Record<string, unknown> | undefined;
|
|
58
69
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
export { REASONING_BUDGETS, reasoningConfig } from './models/reasoning.ts';
|
|
71
|
+
/**
|
|
72
|
+
* An agent's generateContentConfig with its `reasoning:` key mapped in for
|
|
73
|
+
* the model it runs on. Unchanged (the same object) when the agent sets no
|
|
74
|
+
* `reasoning`. The loader refuses `reasoning` next to the older spelling;
|
|
75
|
+
* this refuses it too, for a config built in code.
|
|
76
|
+
*/
|
|
77
|
+
export declare function withReasoning(agent: {
|
|
78
|
+
name?: string;
|
|
79
|
+
reasoning?: ReasoningSetting;
|
|
80
|
+
generateContentConfig?: object;
|
|
81
|
+
}, model: string | undefined): Record<string, unknown> | undefined;
|
|
82
|
+
/** An agent's `context:` block and its default, owned by the native compactor (ADR 0033); compileAdk hands the same values to ADK's. */
|
|
83
|
+
export type { ContextConfig } from './runtime/native/compaction.ts';
|
|
84
|
+
import type { ContextConfig } from './runtime/native/compaction.ts';
|
|
85
|
+
export { DEFAULT_KEEP_RECENT_EVENTS } from './runtime/native/compaction.ts';
|
|
69
86
|
/**
|
|
70
87
|
* A copy of a FunctionTool that runs only after a person approves the call
|
|
71
88
|
* (ADR 0028). ADK's own gate does the work: the call raises an
|
|
@@ -75,21 +92,23 @@ export declare const DEFAULT_KEEP_RECENT_EVENTS = 6;
|
|
|
75
92
|
*/
|
|
76
93
|
export declare function requireApprovalOn(tool: FunctionTool): FunctionTool;
|
|
77
94
|
/**
|
|
78
|
-
* A copy of an
|
|
79
|
-
*
|
|
80
|
-
*
|
|
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).
|
|
81
102
|
*/
|
|
82
103
|
export declare function requireApprovalOnBaseTool<T extends BaseTool>(tool: T): T;
|
|
83
104
|
/** True when any agent of a syndicate may pause for approval: a gated tool, or skill scripts. */
|
|
84
105
|
export declare function declaresApprovals(config: SyndicateYamlConfig): boolean;
|
|
85
|
-
|
|
86
|
-
export interface ExampleConfig {
|
|
87
|
-
input: string;
|
|
88
|
-
output: string;
|
|
89
|
-
}
|
|
106
|
+
export type { ExampleConfig };
|
|
90
107
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
108
|
+
* An agent's `examples:` as the ADK tool for their InstructionTool
|
|
109
|
+
* (lib/tools/examples.ts): never called by the model, it adds the exchanges
|
|
110
|
+
* to every request's instruction as few-shot examples, in the words ADK's
|
|
111
|
+
* ExampleTool used.
|
|
93
112
|
*/
|
|
94
113
|
export declare function examplesTool(examples: ExampleConfig[] | undefined): unknown[];
|
|
95
114
|
/** True when a turn running this agent directly may pause for a person (ADR 0028). */
|
|
@@ -98,15 +117,125 @@ export declare function agentGates(agent: {
|
|
|
98
117
|
skills?: SkillsConfig;
|
|
99
118
|
} | undefined): boolean;
|
|
100
119
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
120
|
+
* 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: during the dual
|
|
122
|
+
* period an ADK object that carries its own Tool or InstructionTool
|
|
123
|
+
* (lib/tools/adkTool.ts), an MCP tool or the skills toolset, gated by
|
|
124
|
+
* require_approval where the YAML says so. `agent` is a delegated subagent
|
|
125
|
+
* (DELEGATE mode), `remote` a subagent served over A2A, `workflow` a
|
|
126
|
+
* `yaml_reference` to a workflow syndicate, whose whole graph is the tool
|
|
127
|
+
* (ADR 0098).
|
|
128
|
+
*/
|
|
129
|
+
export type SpecTool = {
|
|
130
|
+
kind: 'tool';
|
|
131
|
+
tool: unknown;
|
|
132
|
+
} | {
|
|
133
|
+
kind: 'agent';
|
|
134
|
+
agent: AgentSpec;
|
|
135
|
+
} | {
|
|
136
|
+
kind: 'remote';
|
|
137
|
+
name: string;
|
|
138
|
+
description: string;
|
|
139
|
+
url: string;
|
|
140
|
+
} | {
|
|
141
|
+
kind: 'workflow';
|
|
142
|
+
workflow: WorkflowSpec;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* A workflow syndicate, compiled for either runtime: lib/workflow.ts builds
|
|
146
|
+
* ADK's Workflow from it, lib/compileNative.ts the native walk's graph and
|
|
147
|
+
* agents. Nested as a subagent (a `yaml_reference` in DELEGATE mode), the
|
|
148
|
+
* graph runs under the entry's name and description, and that name is the
|
|
149
|
+
* root of every node path, as ADK names a Workflow's nodes after it.
|
|
150
|
+
*/
|
|
151
|
+
export interface WorkflowSpec {
|
|
152
|
+
/** The workflow's name: the syndicate's, or the subagent entry's when nested. */
|
|
153
|
+
name: string;
|
|
154
|
+
/** The tool's description when nested; '' at the root. */
|
|
155
|
+
description: string;
|
|
156
|
+
/** The syndicate, its `syndicate_name` set to `name`. */
|
|
157
|
+
config: SyndicateYamlConfig;
|
|
158
|
+
/** Every agent of the graph, the orchestrator first, as compileSubagentSpec builds it, with its YAML entry. */
|
|
159
|
+
agents: Array<{
|
|
160
|
+
yaml: SubagentYamlConfig;
|
|
161
|
+
spec: AgentSpec;
|
|
162
|
+
}>;
|
|
163
|
+
/** The registry entry for a tool node's tool name, or undefined (CompileOptions.onUnknownTool applies). */
|
|
164
|
+
resolveTool: (name: string) => unknown;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* One YAML agent, compiled, for either runtime: what lib/compileAdk.ts
|
|
168
|
+
* turns into ADK's LlmAgent and lib/compileNative.ts into the native loop's
|
|
169
|
+
* NativeAgent. Built once per agent by compileSpec and compileSubagentSpec:
|
|
170
|
+
* the tools resolved (OpenAPI operations built, MCP tools listed) and
|
|
171
|
+
* gated, the skills index appended to the instruction, the model resolved
|
|
172
|
+
* once through CompileOptions.resolveModel, and the generateContentConfig
|
|
173
|
+
* built for the model the agent runs on.
|
|
174
|
+
*/
|
|
175
|
+
export interface AgentSpec {
|
|
176
|
+
name: string;
|
|
177
|
+
description?: string;
|
|
178
|
+
/** The model id the YAML names; undefined when the agent takes the resolver's default. */
|
|
179
|
+
model?: string;
|
|
180
|
+
/** What CompileOptions.resolveModel returned for `model`: an id, or an adapter instance (a BYOK one on the A2A server). */
|
|
181
|
+
resolvedModel?: unknown;
|
|
182
|
+
/** The id the agent runs on: the YAML's, else the resolved adapter's. */
|
|
183
|
+
modelId?: string;
|
|
184
|
+
/** `fallback_model:`, unresolved: each runtime resolves it where it calls it. */
|
|
185
|
+
fallbackModel?: string;
|
|
186
|
+
/** The YAML instruction, with the skills index appended when the agent has `skills:`. */
|
|
187
|
+
instruction: string;
|
|
188
|
+
globalInstruction?: string;
|
|
189
|
+
tools: SpecTool[];
|
|
190
|
+
outputSchema?: Record<string, unknown>;
|
|
191
|
+
/** The YAML's config with `reasoning:` mapped in and server-side tool invocations on, as both runtimes send it. */
|
|
192
|
+
generateContentConfig: Record<string, unknown>;
|
|
193
|
+
includeContents?: 'default' | 'none';
|
|
194
|
+
outputKey?: string;
|
|
195
|
+
disallowTransferToParent?: boolean;
|
|
196
|
+
disallowTransferToPeers?: boolean;
|
|
197
|
+
/** `code_execution: gemini`. */
|
|
198
|
+
codeExecution?: 'gemini';
|
|
199
|
+
/** `context:`: compaction (ADR 0033). */
|
|
200
|
+
context?: ContextConfig;
|
|
201
|
+
/** `mode: task`. */
|
|
202
|
+
mode?: 'task';
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* The spec of a workflow syndicate: every agent through compileSubagentSpec
|
|
206
|
+
* (the orchestrator first, as a node like any other), and the registry's
|
|
207
|
+
* lookup for its tool nodes. `name` and `description` name a nested one
|
|
208
|
+
* after its subagent entry (ADR 0098); `ref` is the file it came from.
|
|
209
|
+
*
|
|
210
|
+
* A nested workflow runs inside its caller's tool call, so a pause inside it
|
|
211
|
+
* could not reach the caller (ADR 0028, as for any nested syndicate): an
|
|
212
|
+
* `ask_user` node is refused by name here, on both runtimes.
|
|
213
|
+
*/
|
|
214
|
+
export declare function compileWorkflowSpec(config: SyndicateYamlConfig, opts?: CompileOptions, name?: string, description?: string, ref?: string): Promise<WorkflowSpec>;
|
|
215
|
+
/**
|
|
216
|
+
* The spec of ONE agent from a subagent entry. A `yaml_reference` entry is
|
|
217
|
+
* the nested syndicate's whole graph under this entry's name and
|
|
103
218
|
* description, so the parent sees one tool (or one route) either way.
|
|
104
219
|
*/
|
|
220
|
+
export declare function compileSubagentSpec(subCfg: SubagentYamlConfig, opts?: CompileOptions): Promise<AgentSpec>;
|
|
221
|
+
/**
|
|
222
|
+
* The spec of a syndicate's orchestrator. In DELEGATE mode its subagents
|
|
223
|
+
* come first among its tools, as delegations; in PLAN-DISPATCH mode it gets
|
|
224
|
+
* none (ADK refuses outputSchema + AgentTool on one agent — see
|
|
225
|
+
* config/agents/critic.yaml), and the caller dispatches to a route's own
|
|
226
|
+
* spec itself.
|
|
227
|
+
*/
|
|
228
|
+
export declare function compileSpec(config: SyndicateYamlConfig, opts?: CompileOptions, overrideName?: string, overrideDescription?: string): Promise<AgentSpec>;
|
|
229
|
+
/**
|
|
230
|
+
* Builds ONE runnable ADK agent from a subagent entry: its spec, as
|
|
231
|
+
* lib/compileAdk.ts builds it. A workflow node's settings
|
|
232
|
+
* (CompileOptions.nodeConfig) apply to a local agent, not to a nested
|
|
233
|
+
* syndicate's orchestrator.
|
|
234
|
+
*/
|
|
105
235
|
export declare function compileSubagent(subCfg: SubagentYamlConfig, opts?: CompileOptions): Promise<LlmAgent>;
|
|
106
236
|
/**
|
|
107
|
-
* Compiles a syndicate's orchestrator. In DELEGATE mode
|
|
108
|
-
* attached as AgentTools; in PLAN-DISPATCH mode it gets
|
|
109
|
-
*
|
|
110
|
-
* and the caller dispatches to `compileSubagent(route)` itself.
|
|
237
|
+
* Compiles a syndicate's orchestrator for the ADK runtime. In DELEGATE mode
|
|
238
|
+
* its subagents are attached as AgentTools; in PLAN-DISPATCH mode it gets
|
|
239
|
+
* none, and the caller dispatches to `compileSubagent(route)` itself.
|
|
111
240
|
*/
|
|
112
241
|
export declare function compileGraph(config: SyndicateYamlConfig, opts?: CompileOptions, overrideName?: string, overrideDescription?: string): Promise<LlmAgent>;
|