agentfootprint 2.3.0 → 2.5.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/README.md +293 -247
- package/dist/adapters/llm/AnthropicProvider.js +2 -2
- package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/BedrockProvider.js +2 -2
- package/dist/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/adapters/llm/BrowserAnthropicProvider.js +96 -28
- package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/OpenAIProvider.js +2 -2
- package/dist/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/adapters/memory/agentcore.js +9 -3
- package/dist/adapters/memory/agentcore.js.map +1 -1
- package/dist/adapters/memory/redis.js +9 -3
- package/dist/adapters/memory/redis.js.map +1 -1
- package/dist/core/Agent.js +493 -79
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/flowchartAsTool.js +188 -0
- package/dist/core/flowchartAsTool.js.map +1 -0
- package/dist/core/outputSchema.js +119 -0
- package/dist/core/outputSchema.js.map +1 -0
- package/dist/core/slots/buildSystemPromptSlot.js +8 -0
- package/dist/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +56 -5
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/adapters/llm/AnthropicProvider.js +2 -2
- package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BedrockProvider.js +2 -2
- package/dist/esm/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +96 -28
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/OpenAIProvider.js +2 -2
- package/dist/esm/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/esm/adapters/memory/agentcore.js +9 -3
- package/dist/esm/adapters/memory/agentcore.js.map +1 -1
- package/dist/esm/adapters/memory/redis.js +9 -3
- package/dist/esm/adapters/memory/redis.js.map +1 -1
- package/dist/esm/core/Agent.js +492 -78
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/flowchartAsTool.js +184 -0
- package/dist/esm/core/flowchartAsTool.js.map +1 -0
- package/dist/esm/core/outputSchema.js +113 -0
- package/dist/esm/core/outputSchema.js.map +1 -0
- package/dist/esm/core/slots/buildSystemPromptSlot.js +8 -0
- package/dist/esm/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.js +56 -5
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/index.js +34 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/SkillRegistry.js +181 -0
- package/dist/esm/lib/injection-engine/SkillRegistry.js.map +1 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.js +35 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/esm/lib/injection-engine/index.js +9 -1
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillTools.js +125 -0
- package/dist/esm/lib/injection-engine/skillTools.js.map +1 -0
- package/dist/esm/lib/injection-engine/types.js +8 -0
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/esm/lib/lazyRequire.js +33 -0
- package/dist/esm/lib/lazyRequire.js.map +1 -0
- package/dist/esm/lib/mcp/mcpClient.js +4 -6
- package/dist/esm/lib/mcp/mcpClient.js.map +1 -1
- package/dist/esm/llm-providers.js +31 -0
- package/dist/esm/llm-providers.js.map +1 -0
- package/dist/esm/locales/index.js +144 -0
- package/dist/esm/locales/index.js.map +1 -0
- package/dist/esm/memory-providers.js +44 -0
- package/dist/esm/memory-providers.js.map +1 -0
- package/dist/esm/providers.js +11 -0
- package/dist/esm/providers.js.map +1 -1
- package/dist/esm/recorders/core/contextEngineering.js +155 -0
- package/dist/esm/recorders/core/contextEngineering.js.map +1 -0
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js +6 -1
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/esm/security/PermissionPolicy.js +135 -0
- package/dist/esm/security/PermissionPolicy.js.map +1 -0
- package/dist/esm/security/index.js +38 -0
- package/dist/esm/security/index.js.map +1 -0
- package/dist/esm/tool-providers/gatedTools.js +52 -0
- package/dist/esm/tool-providers/gatedTools.js.map +1 -0
- package/dist/esm/tool-providers/index.js +43 -0
- package/dist/esm/tool-providers/index.js.map +1 -0
- package/dist/esm/tool-providers/skillScopedTools.js +63 -0
- package/dist/esm/tool-providers/skillScopedTools.js.map +1 -0
- package/dist/esm/tool-providers/staticTools.js +33 -0
- package/dist/esm/tool-providers/staticTools.js.map +1 -0
- package/dist/esm/tool-providers/types.js +53 -0
- package/dist/esm/tool-providers/types.js.map +1 -0
- package/dist/index.js +57 -12
- package/dist/index.js.map +1 -1
- package/dist/lib/injection-engine/SkillRegistry.js +185 -0
- package/dist/lib/injection-engine/SkillRegistry.js.map +1 -0
- package/dist/lib/injection-engine/factories/defineSkill.js +37 -1
- package/dist/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/lib/injection-engine/index.js +14 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillTools.js +130 -0
- package/dist/lib/injection-engine/skillTools.js.map +1 -0
- package/dist/lib/injection-engine/types.js +8 -0
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/lib/lazyRequire.js +37 -0
- package/dist/lib/lazyRequire.js.map +1 -0
- package/dist/lib/mcp/mcpClient.js +4 -6
- package/dist/lib/mcp/mcpClient.js.map +1 -1
- package/dist/llm-providers.js +47 -0
- package/dist/llm-providers.js.map +1 -0
- package/dist/locales/index.js +149 -0
- package/dist/locales/index.js.map +1 -0
- package/dist/memory-providers.js +49 -0
- package/dist/memory-providers.js.map +1 -0
- package/dist/providers.js +11 -0
- package/dist/providers.js.map +1 -1
- package/dist/recorders/core/contextEngineering.js +161 -0
- package/dist/recorders/core/contextEngineering.js.map +1 -0
- package/dist/recorders/observability/commentary/commentaryTemplates.js +6 -1
- package/dist/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/security/PermissionPolicy.js +139 -0
- package/dist/security/PermissionPolicy.js.map +1 -0
- package/dist/security/index.js +42 -0
- package/dist/security/index.js.map +1 -0
- package/dist/tool-providers/gatedTools.js +56 -0
- package/dist/tool-providers/gatedTools.js.map +1 -0
- package/dist/tool-providers/index.js +51 -0
- package/dist/tool-providers/index.js.map +1 -0
- package/dist/tool-providers/skillScopedTools.js +67 -0
- package/dist/tool-providers/skillScopedTools.js.map +1 -0
- package/dist/tool-providers/staticTools.js +37 -0
- package/dist/tool-providers/staticTools.js.map +1 -0
- package/dist/tool-providers/types.js +54 -0
- package/dist/tool-providers/types.js.map +1 -0
- package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BedrockProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/OpenAIProvider.d.ts.map +1 -1
- package/dist/types/adapters/memory/agentcore.d.ts +7 -1
- package/dist/types/adapters/memory/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/memory/redis.d.ts +7 -1
- package/dist/types/adapters/memory/redis.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +216 -2
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/flowchartAsTool.d.ts +161 -0
- package/dist/types/core/flowchartAsTool.d.ts.map +1 -0
- package/dist/types/core/outputSchema.d.ts +128 -0
- package/dist/types/core/outputSchema.d.ts.map +1 -0
- package/dist/types/core/slots/buildSystemPromptSlot.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts +10 -0
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/SkillRegistry.d.ts +148 -0
- package/dist/types/lib/injection-engine/SkillRegistry.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts +99 -0
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/index.d.ts +5 -2
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillTools.d.ts +73 -0
- package/dist/types/lib/injection-engine/skillTools.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/types.d.ts +28 -0
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/dist/types/lib/lazyRequire.d.ts +30 -0
- package/dist/types/lib/lazyRequire.d.ts.map +1 -0
- package/dist/types/lib/mcp/mcpClient.d.ts.map +1 -1
- package/dist/types/llm-providers.d.ts +31 -0
- package/dist/types/llm-providers.d.ts.map +1 -0
- package/dist/types/locales/index.d.ts +133 -0
- package/dist/types/locales/index.d.ts.map +1 -0
- package/dist/types/memory-providers.d.ts +41 -0
- package/dist/types/memory-providers.d.ts.map +1 -0
- package/dist/types/providers.d.ts +11 -0
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/recorders/core/contextEngineering.d.ts +137 -0
- package/dist/types/recorders/core/contextEngineering.d.ts.map +1 -0
- package/dist/types/recorders/observability/commentary/commentaryTemplates.d.ts.map +1 -1
- package/dist/types/security/PermissionPolicy.d.ts +125 -0
- package/dist/types/security/PermissionPolicy.d.ts.map +1 -0
- package/dist/types/security/index.d.ts +40 -0
- package/dist/types/security/index.d.ts.map +1 -0
- package/dist/types/tool-providers/gatedTools.d.ts +37 -0
- package/dist/types/tool-providers/gatedTools.d.ts.map +1 -0
- package/dist/types/tool-providers/index.d.ts +42 -0
- package/dist/types/tool-providers/index.d.ts.map +1 -0
- package/dist/types/tool-providers/skillScopedTools.d.ts +46 -0
- package/dist/types/tool-providers/skillScopedTools.d.ts.map +1 -0
- package/dist/types/tool-providers/staticTools.d.ts +22 -0
- package/dist/types/tool-providers/staticTools.d.ts.map +1 -0
- package/dist/types/tool-providers/types.d.ts +103 -0
- package/dist/types/tool-providers/types.d.ts.map +1 -0
- package/package.json +62 -9
- package/README.proposed.md +0 -258
- package/dist/instructions.js +0 -21
- package/dist/instructions.js.map +0 -1
- package/dist/lib/instructions/defineInstruction.js +0 -35
- package/dist/lib/instructions/defineInstruction.js.map +0 -1
- package/dist/lib/instructions/evaluator.js +0 -38
- package/dist/lib/instructions/evaluator.js.map +0 -1
- package/dist/lib/instructions/index.js +0 -48
- package/dist/lib/instructions/index.js.map +0 -1
- package/dist/lib/instructions/types.js +0 -22
- package/dist/lib/instructions/types.js.map +0 -1
- package/dist/memory/conversationHelpers.js +0 -39
- package/dist/memory/conversationHelpers.js.map +0 -1
- package/dist/types/instructions.d.ts +0 -5
- package/dist/types/instructions.d.ts.map +0 -1
- package/dist/types/lib/instructions/defineInstruction.d.ts +0 -22
- package/dist/types/lib/instructions/defineInstruction.d.ts.map +0 -1
- package/dist/types/lib/instructions/evaluator.d.ts +0 -11
- package/dist/types/lib/instructions/evaluator.d.ts.map +0 -1
- package/dist/types/lib/instructions/index.d.ts +0 -44
- package/dist/types/lib/instructions/index.d.ts.map +0 -1
- package/dist/types/lib/instructions/types.d.ts +0 -100
- package/dist/types/lib/instructions/types.d.ts.map +0 -1
- package/dist/types/memory/conversationHelpers.d.ts +0 -19
- package/dist/types/memory/conversationHelpers.d.ts.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ToolProvider — abstraction over tool dispatch.
|
|
4
|
+
*
|
|
5
|
+
* v2.4 shipped tools as a flat array on the agent (registered via
|
|
6
|
+
* `agent.tool(t)` / `agent.tools(arr)`). That model breaks down once
|
|
7
|
+
* production agents need:
|
|
8
|
+
* 1. Permission gating per-tool, per-caller (read-only roles, etc.)
|
|
9
|
+
* 2. Per-skill tool gating (only show the active skill's tools to
|
|
10
|
+
* the LLM each turn)
|
|
11
|
+
* 3. Composable filters (a `withReadonly` decorator over a `withSkill`
|
|
12
|
+
* decorator over the base tool list)
|
|
13
|
+
*
|
|
14
|
+
* `ToolProvider` is the answer: a chainable abstraction over "what
|
|
15
|
+
* tools does the LLM see right now?". The agent asks the provider
|
|
16
|
+
* each iteration; the provider returns the visible tool set computed
|
|
17
|
+
* from whatever predicates / role gates / skill filters the consumer
|
|
18
|
+
* composed.
|
|
19
|
+
*
|
|
20
|
+
* Pattern: Strategy (GoF) — each ToolProvider is a strategy for
|
|
21
|
+
* "compute the visible tool list given current context".
|
|
22
|
+
* Decorator (GoF) — `gatedTools(inner, predicate)` wraps any
|
|
23
|
+
* provider with an additional filter, mirroring how `withRetry`
|
|
24
|
+
* / `withFallback` decorate `LLMProvider`.
|
|
25
|
+
* Role: Layer-3 tool-dispatch primitive. Agent calls `provider.list(ctx)`
|
|
26
|
+
* each iteration to compute the visible tool set.
|
|
27
|
+
* Emits: N/A (pure compute; permission denials emit elsewhere via the
|
|
28
|
+
* permission subsystem).
|
|
29
|
+
*
|
|
30
|
+
* @example Static tool list (90% case — what `.tools(arr)` does today)
|
|
31
|
+
* const provider = staticTools([weather, lookupOrder]);
|
|
32
|
+
*
|
|
33
|
+
* @example Read-only enforcement (role-based gate)
|
|
34
|
+
* const readOnlyProvider = gatedTools(
|
|
35
|
+
* staticTools([weather, lookupOrder, processRefund]),
|
|
36
|
+
* (toolName) => policy.isAllowed(toolName),
|
|
37
|
+
* );
|
|
38
|
+
*
|
|
39
|
+
* @example Skill-gated dispatch (only active skill's tools visible)
|
|
40
|
+
* const skillGated = gatedTools(
|
|
41
|
+
* staticTools(allTools),
|
|
42
|
+
* (toolName, ctx) => ctx.activeSkillId
|
|
43
|
+
* ? skillsToolMap[ctx.activeSkillId].includes(toolName)
|
|
44
|
+
* : alwaysVisible.includes(toolName),
|
|
45
|
+
* );
|
|
46
|
+
*
|
|
47
|
+
* @example Stack: read-only over skill-gated
|
|
48
|
+
* const provider = gatedTools(
|
|
49
|
+
* gatedTools(staticTools(allTools), readOnlyPredicate),
|
|
50
|
+
* skillGatePredicate,
|
|
51
|
+
* );
|
|
52
|
+
*/
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tool-providers/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/AnthropicProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AnthropicProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/AnthropicProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAC;AAKrB,UAAU,eAAe;IACvB,QAAQ,EAAE;QACR,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACjE,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAAC;KACxD,CAAC;CACH;AAED,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,EAAE,CAA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B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAID,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;CACpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,wBAA6B,GAAG,WAAW,CA8C7E;AAED;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,eAAe;IAC5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;gBAExB,OAAO,GAAE,wBAA6B;IAIlD,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAI/C,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC;CAMjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/BedrockProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BedrockProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/BedrockProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,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AAM,CAAC,GAAG,EAAE,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC;CAIjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAIProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/OpenAIProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenAIProvider.d.ts","sourceRoot":"","sources":["../../../../src/adapters/llm/OpenAIProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,QAAQ,EAER,WAAW,EACX,UAAU,EACV,WAAW,EAEZ,MAAM,aAAa,CAAC;AAKrB,UAAU,YAAY;IACpB,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,MAAM,CACJ,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;SACrE,CAAC;KACH,CAAC;CACH;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;A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— AWS Bedrock AgentCore Memory adapter (peer-dep
|
|
3
3
|
* `@aws-sdk/client-bedrock-agent-runtime`).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Canonical subpath (v2.5+): `agentfootprint/memory-providers`.
|
|
6
|
+
* Legacy alias (still works through v2.x): `agentfootprint/memory-agentcore`.
|
|
6
7
|
*
|
|
8
|
+
* // New canonical (v2.5+):
|
|
9
|
+
* import { AgentCoreStore } from 'agentfootprint/memory-providers';
|
|
10
|
+
*
|
|
11
|
+
* // Legacy alias (still works through v2.x; removed in v3.0):
|
|
7
12
|
* import { AgentCoreStore } from 'agentfootprint/memory-agentcore';
|
|
13
|
+
*
|
|
8
14
|
* const store = new AgentCoreStore({
|
|
9
15
|
* memoryId: 'arn:aws:bedrock:us-east-1:...:memory/my-mem',
|
|
10
16
|
* region: 'us-east-1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/agentcore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agentcore.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/agentcore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,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AO,CAAC,IAAI,CAAC;IAU3D,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnE,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3E,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASjF,WAAW,CACf,QAAQ,EAAE,cAAc,EACxB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAO/C,MAAM,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAerD;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,OAAO,CAAC,UAAU;CAKnB"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RedisStore — Redis-backed `MemoryStore` adapter (peer-dep `ioredis`).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Canonical subpath (v2.5+): `agentfootprint/memory-providers`.
|
|
5
|
+
* Legacy alias (still works through v2.x): `agentfootprint/memory-redis`.
|
|
5
6
|
*
|
|
7
|
+
* // New canonical (v2.5+):
|
|
8
|
+
* import { RedisStore } from 'agentfootprint/memory-providers';
|
|
9
|
+
*
|
|
10
|
+
* // Legacy alias (still works through v2.x; removed in v3.0):
|
|
6
11
|
* import { RedisStore } from 'agentfootprint/memory-redis';
|
|
12
|
+
*
|
|
7
13
|
* const store = new RedisStore({ url: 'redis://localhost:6379' });
|
|
8
14
|
*
|
|
9
15
|
* Pattern: Adapter (GoF) — translates the `MemoryStore` interface onto
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/redis.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/redis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIrE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3F,GAAG,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,G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CAAC,CAAC,CAAC,CAAC;IAwBnB,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMnE,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3E,QAAQ,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjF,WAAW,CACf,QAAQ,EAAE,cAAc,EACxB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IASrD;;OAEG;IACG,MAAM,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBrD;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,OAAO,CAAC,UAAU;CAKnB"}
|
|
@@ -13,14 +13,16 @@
|
|
|
13
13
|
* agentfootprint.stream.tool_start / tool_end
|
|
14
14
|
* agentfootprint.context.* (via ContextRecorder)
|
|
15
15
|
*/
|
|
16
|
-
import { type FlowChart, type FlowchartCheckpoint, type RunOptions } from 'footprintjs';
|
|
16
|
+
import { type CombinedNarrativeEntry, type FlowChart, type FlowchartCheckpoint, type RunOptions, type RuntimeSnapshot } from 'footprintjs';
|
|
17
17
|
import { type RunnerPauseOutcome } from './pause.js';
|
|
18
18
|
import type { LLMProvider, PermissionChecker, PricingTable } from '../adapters/types.js';
|
|
19
19
|
import type { MemoryIdentity } from '../memory/identity/index.js';
|
|
20
20
|
import type { MemoryDefinition } from '../memory/define.types.js';
|
|
21
21
|
import type { Injection } from '../lib/injection-engine/types.js';
|
|
22
|
+
import { type OutputSchemaOptions, type OutputSchemaParser } from './outputSchema.js';
|
|
22
23
|
import { RunnerBase } from './RunnerBase.js';
|
|
23
24
|
import type { Tool, ToolRegistryEntry } from './tools.js';
|
|
25
|
+
import type { ToolProvider } from '../tool-providers/types.js';
|
|
24
26
|
export interface AgentOptions {
|
|
25
27
|
readonly provider: LLMProvider;
|
|
26
28
|
/** Human-friendly name shown in events/metrics. Default: 'Agent'. */
|
|
@@ -98,6 +100,21 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
98
100
|
readonly commentaryTemplates: Readonly<Record<string, string>>;
|
|
99
101
|
readonly thinkingTemplates: Readonly<Record<string, string>>;
|
|
100
102
|
private currentRunContext;
|
|
103
|
+
/**
|
|
104
|
+
* Reference to the most recent executor. Set on every `createExecutor()`
|
|
105
|
+
* call (i.e., every `run()` and `resume()`); read by `getLastSnapshot()`
|
|
106
|
+
* / `getLastNarrativeEntries()` so post-run UIs (Lens Trace tab,
|
|
107
|
+
* ExplainableShell) can pull execution state without intercepting the
|
|
108
|
+
* call. `undefined` until the first run.
|
|
109
|
+
*/
|
|
110
|
+
private lastExecutor?;
|
|
111
|
+
/**
|
|
112
|
+
* Reference to the FlowChart compiled for the most recent run. Cached
|
|
113
|
+
* here rather than recomputed via `buildChart()` so `getSpec()` returns
|
|
114
|
+
* the SAME spec the executor traced — important when the spec is used
|
|
115
|
+
* to reconcile `getLastSnapshot()` for ExplainableShell.
|
|
116
|
+
*/
|
|
117
|
+
private lastFlowChart?;
|
|
101
118
|
/**
|
|
102
119
|
* Memory subsystems registered via `.memory()`. Each definition mounts
|
|
103
120
|
* its `read` subflow before the InjectionEngine on every turn; per-id
|
|
@@ -105,13 +122,78 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
105
122
|
* collision-free.
|
|
106
123
|
*/
|
|
107
124
|
private readonly memories;
|
|
125
|
+
/**
|
|
126
|
+
* Optional terminal contract. Set via the builder's `.outputSchema()`.
|
|
127
|
+
* When present, `agent.runTyped()` parses + validates the final
|
|
128
|
+
* answer against this parser. `agent.run()` keeps returning the
|
|
129
|
+
* raw string; consumers opt into typed mode explicitly.
|
|
130
|
+
*/
|
|
131
|
+
private readonly outputSchemaParser?;
|
|
132
|
+
/**
|
|
133
|
+
* Optional `ToolProvider` set via the builder's `.toolProvider()`.
|
|
134
|
+
* When present, the Tools slot subflow consults it per iteration
|
|
135
|
+
* (Block A5 follow-up) — the provider's tools land alongside any
|
|
136
|
+
* tools registered statically via `.tool()` / `.tools()`. The
|
|
137
|
+
* tool-call dispatcher also consults it for per-iteration execute
|
|
138
|
+
* lookup so dynamic chains (`gatedTools`, `skillScopedTools`)
|
|
139
|
+
* dispatch correctly when their visible-set changes mid-turn.
|
|
140
|
+
*/
|
|
141
|
+
private readonly externalToolProvider?;
|
|
108
142
|
constructor(opts: AgentOptions, systemPromptValue: string, registry: readonly ToolRegistryEntry[], voice: {
|
|
109
143
|
readonly appName: string;
|
|
110
144
|
readonly commentaryTemplates: Readonly<Record<string, string>>;
|
|
111
145
|
readonly thinkingTemplates: Readonly<Record<string, string>>;
|
|
112
|
-
}, injections?: readonly Injection[], memories?: readonly MemoryDefinition[]);
|
|
146
|
+
}, injections?: readonly Injection[], memories?: readonly MemoryDefinition[], outputSchemaParser?: OutputSchemaParser<unknown>, toolProvider?: ToolProvider);
|
|
113
147
|
static create(opts: AgentOptions): AgentBuilder;
|
|
114
148
|
toFlowChart(): FlowChart;
|
|
149
|
+
/**
|
|
150
|
+
* The footprintjs `RuntimeSnapshot` from the most recent `run()` /
|
|
151
|
+
* `resume()`. Feeds Lens's Trace tab (ExplainableShell `runtimeSnapshot`
|
|
152
|
+
* prop) so consumers can scrub the execution timeline post-run without
|
|
153
|
+
* threading a recorder through the call site.
|
|
154
|
+
*
|
|
155
|
+
* Returns `undefined` before the first run completes. Returns the
|
|
156
|
+
* snapshot of the most recent run on every call after — including
|
|
157
|
+
* across multiple turns of the same Agent instance.
|
|
158
|
+
*/
|
|
159
|
+
getLastSnapshot(): RuntimeSnapshot | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Structured narrative entries from the most recent run. Pairs with
|
|
162
|
+
* `getLastSnapshot()` for ExplainableShell's `narrativeEntries` prop.
|
|
163
|
+
* Empty array (not `undefined`) when no run has completed — matches
|
|
164
|
+
* the prop's expected shape so consumers can wire it directly without
|
|
165
|
+
* a defensive guard.
|
|
166
|
+
*/
|
|
167
|
+
getLastNarrativeEntries(): readonly CombinedNarrativeEntry[];
|
|
168
|
+
/**
|
|
169
|
+
* The FlowChart compiled for the most recent run (or a freshly-built
|
|
170
|
+
* one if no run has happened yet). Feeds ExplainableShell's `spec`
|
|
171
|
+
* prop. Returning the cached chart matters: the spec must match what
|
|
172
|
+
* `getLastSnapshot()` traced, otherwise the Trace view's stage tree
|
|
173
|
+
* desyncs from the snapshot's runtime tree.
|
|
174
|
+
*/
|
|
175
|
+
getSpec(): FlowChart;
|
|
176
|
+
/**
|
|
177
|
+
* Parse + validate a raw agent answer against the agent's
|
|
178
|
+
* `outputSchema` parser. Throws `OutputSchemaError` on JSON parse
|
|
179
|
+
* or schema validation failure (the rawOutput is preserved on the
|
|
180
|
+
* error for triage). Throws a plain `Error` if the agent has no
|
|
181
|
+
* outputSchema set.
|
|
182
|
+
*
|
|
183
|
+
* Use this when you need to keep `agent.run()` returning the raw
|
|
184
|
+
* string for logging/observability and validate at a different
|
|
185
|
+
* layer; otherwise prefer `agent.runTyped()`.
|
|
186
|
+
*/
|
|
187
|
+
parseOutput<T = unknown>(raw: string): T;
|
|
188
|
+
/**
|
|
189
|
+
* Run the agent and return the schema-validated typed output.
|
|
190
|
+
* Convenience over `parseOutput(await agent.run({...}))`.
|
|
191
|
+
*
|
|
192
|
+
* Throws `OutputSchemaError` on parse / validation failure.
|
|
193
|
+
* Throws if the agent has no outputSchema set or if the run
|
|
194
|
+
* pauses (use `run()` directly when pauses are expected).
|
|
195
|
+
*/
|
|
196
|
+
runTyped<T = unknown>(input: AgentInput, options?: RunOptions): Promise<T>;
|
|
115
197
|
run(input: AgentInput, options?: RunOptions): Promise<AgentOutput | RunnerPauseOutcome>;
|
|
116
198
|
resume(checkpoint: FlowchartCheckpoint, input?: unknown, options?: RunOptions): Promise<AgentOutput | RunnerPauseOutcome>;
|
|
117
199
|
private createExecutor;
|
|
@@ -128,6 +210,29 @@ export declare class AgentBuilder {
|
|
|
128
210
|
private readonly registry;
|
|
129
211
|
private readonly injectionList;
|
|
130
212
|
private readonly memoryList;
|
|
213
|
+
/**
|
|
214
|
+
* Optional terminal contract — see `outputSchema()`. Stored on the
|
|
215
|
+
* builder, propagated to the Agent at `.build()` time.
|
|
216
|
+
*/
|
|
217
|
+
private outputSchemaParser?;
|
|
218
|
+
/**
|
|
219
|
+
* Optional `ToolProvider` set via `.toolProvider()`. Propagated to
|
|
220
|
+
* the Agent's Tools slot subflow + tool-call dispatcher; consulted
|
|
221
|
+
* per iteration so dynamic chains (`gatedTools`, `skillScopedTools`)
|
|
222
|
+
* react to current activation state.
|
|
223
|
+
*/
|
|
224
|
+
private toolProviderRef?;
|
|
225
|
+
/**
|
|
226
|
+
* Optional override for `AgentOptions.maxIterations`. When set via
|
|
227
|
+
* the `.maxIterations()` builder method, takes precedence over the
|
|
228
|
+
* value passed to `Agent.create({ maxIterations })`.
|
|
229
|
+
*/
|
|
230
|
+
private maxIterationsOverride?;
|
|
231
|
+
/**
|
|
232
|
+
* Recorders collected via `.recorder()`. Attached to the built Agent
|
|
233
|
+
* before `build()` returns (each via `agent.attach(rec)`).
|
|
234
|
+
*/
|
|
235
|
+
private readonly recorderList;
|
|
131
236
|
private appNameValue;
|
|
132
237
|
private commentaryOverrides;
|
|
133
238
|
private thinkingOverrides;
|
|
@@ -141,6 +246,61 @@ export declare class AgentBuilder {
|
|
|
141
246
|
* fires per-entry.
|
|
142
247
|
*/
|
|
143
248
|
tools(tools: ReadonlyArray<Tool>): this;
|
|
249
|
+
/**
|
|
250
|
+
* Wire a chainable `ToolProvider` (from `agentfootprint/tool-providers`)
|
|
251
|
+
* as the agent's per-iteration tool source.
|
|
252
|
+
*
|
|
253
|
+
* The provider is consulted EVERY iteration via `provider.list(ctx)`
|
|
254
|
+
* with `ctx = { iteration, activeSkillId, identity }`. Tools the
|
|
255
|
+
* provider emits flow into the Tools slot alongside any static
|
|
256
|
+
* tools registered via `.tool()` / `.tools()`. The tool-call
|
|
257
|
+
* dispatcher also consults the provider so dynamic chains
|
|
258
|
+
* (`gatedTools`, `skillScopedTools`) dispatch correctly when their
|
|
259
|
+
* visible-set changes mid-turn.
|
|
260
|
+
*
|
|
261
|
+
* Throws if called more than once on the same builder (avoids
|
|
262
|
+
* silent override surprises).
|
|
263
|
+
*
|
|
264
|
+
* @example Permission-gated baseline
|
|
265
|
+
* import { gatedTools, staticTools } from 'agentfootprint/tool-providers';
|
|
266
|
+
* import { PermissionPolicy } from 'agentfootprint/security';
|
|
267
|
+
*
|
|
268
|
+
* const policy = PermissionPolicy.fromRoles({
|
|
269
|
+
* readonly: ['lookup', 'list_skills', 'read_skill'],
|
|
270
|
+
* admin: ['lookup', 'list_skills', 'read_skill', 'delete'],
|
|
271
|
+
* }, 'readonly');
|
|
272
|
+
*
|
|
273
|
+
* const provider = gatedTools(
|
|
274
|
+
* staticTools(allTools),
|
|
275
|
+
* (toolName) => policy.isAllowed(toolName),
|
|
276
|
+
* );
|
|
277
|
+
*
|
|
278
|
+
* const agent = Agent.create({ provider: llm, model })
|
|
279
|
+
* .system('You answer.')
|
|
280
|
+
* .toolProvider(provider)
|
|
281
|
+
* .build();
|
|
282
|
+
*/
|
|
283
|
+
toolProvider(provider: ToolProvider): this;
|
|
284
|
+
/**
|
|
285
|
+
* Override the ReAct iteration cap set via `Agent.create({
|
|
286
|
+
* maxIterations })`. Convenience for builder-style code that prefers
|
|
287
|
+
* fluent setters over constructor opts. Last call wins.
|
|
288
|
+
*
|
|
289
|
+
* Throws if `n` is not a positive integer or exceeds the hard cap
|
|
290
|
+
* (`clampIterations`'s upper bound).
|
|
291
|
+
*/
|
|
292
|
+
maxIterations(n: number): this;
|
|
293
|
+
/**
|
|
294
|
+
* Attach a footprintjs `CombinedRecorder` to the built Agent. Wired
|
|
295
|
+
* via `agent.attach(rec)` immediately after construction, so the
|
|
296
|
+
* recorder sees every event from the very first run.
|
|
297
|
+
*
|
|
298
|
+
* Equivalent to calling `agent.attach(rec)` post-build; the builder
|
|
299
|
+
* method is a convenience for codebases that prefer fully-fluent
|
|
300
|
+
* agent assembly. Multiple recorders are supported (each gets its
|
|
301
|
+
* own `attach()` call).
|
|
302
|
+
*/
|
|
303
|
+
recorder(rec: import('footprintjs').CombinedRecorder): this;
|
|
144
304
|
/**
|
|
145
305
|
* Set the agent's display name — substituted as `{{appName}}` in
|
|
146
306
|
* commentary + thinking templates. Same place to brand a tenant
|
|
@@ -179,6 +339,20 @@ export declare class AgentBuilder {
|
|
|
179
339
|
* Skill stays active for the rest of the turn once activated.
|
|
180
340
|
*/
|
|
181
341
|
skill(injection: Injection): this;
|
|
342
|
+
/**
|
|
343
|
+
* Bulk-register every Skill in a `SkillRegistry`. Use for shared
|
|
344
|
+
* skill catalogs across multiple Agents — register skills once on
|
|
345
|
+
* the registry; attach the same registry to every consumer Agent.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* const registry = new SkillRegistry();
|
|
349
|
+
* registry.register(billingSkill).register(refundSkill);
|
|
350
|
+
* const supportAgent = Agent.create({ provider }).skills(registry).build();
|
|
351
|
+
* const escalationAgent = Agent.create({ provider }).skills(registry).build();
|
|
352
|
+
*/
|
|
353
|
+
skills(registry: {
|
|
354
|
+
list(): readonly Injection[];
|
|
355
|
+
}): this;
|
|
182
356
|
/**
|
|
183
357
|
* Register a Steering doc — always-on system-prompt rule.
|
|
184
358
|
* Use for invariant guidance: output format, persona, safety policies.
|
|
@@ -190,6 +364,14 @@ export declare class AgentBuilder {
|
|
|
190
364
|
* including the "Dynamic ReAct" `on-tool-return` pattern.
|
|
191
365
|
*/
|
|
192
366
|
instruction(injection: Injection): this;
|
|
367
|
+
/**
|
|
368
|
+
* Bulk-register many instructions at once. Convenience for consumer
|
|
369
|
+
* code that organizes its instruction set in a flat array (`const
|
|
370
|
+
* instructions = [outputFormat, dataRouting, ...]`). Each element
|
|
371
|
+
* is registered via `.instruction()` so duplicate-id checks still
|
|
372
|
+
* fire per-entry.
|
|
373
|
+
*/
|
|
374
|
+
instructions(injections: ReadonlyArray<Injection>): this;
|
|
193
375
|
/**
|
|
194
376
|
* Register a Fact — developer-supplied data the LLM should see.
|
|
195
377
|
* User profile, env info, computed summary, current time, …
|
|
@@ -239,6 +421,38 @@ export declare class AgentBuilder {
|
|
|
239
421
|
* intent, ids, and Lens chips.
|
|
240
422
|
*/
|
|
241
423
|
rag(definition: MemoryDefinition): this;
|
|
424
|
+
/**
|
|
425
|
+
* Declarative terminal contract. The agent's final answer must be
|
|
426
|
+
* JSON matching `parser`. Auto-injects a system-prompt instruction
|
|
427
|
+
* telling the LLM the shape, and exposes `agent.runTyped()` /
|
|
428
|
+
* `agent.parseOutput()` for parse + validate at the call site.
|
|
429
|
+
*
|
|
430
|
+
* The `parser` is duck-typed: any object with a `parse(unknown): T`
|
|
431
|
+
* method works (Zod, Valibot, ArkType, hand-written). The optional
|
|
432
|
+
* `description` field on the parser drives the auto-generated
|
|
433
|
+
* instruction; consumers can also override via `opts.instruction`.
|
|
434
|
+
*
|
|
435
|
+
* Throws if called more than once on the same builder (avoids
|
|
436
|
+
* silent override surprises).
|
|
437
|
+
*
|
|
438
|
+
* @param parser Validation strategy that throws on shape failure.
|
|
439
|
+
* @param opts Optional `{ name, instruction }` to customize.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* import { z } from 'zod';
|
|
443
|
+
* const Output = z.object({
|
|
444
|
+
* status: z.enum(['ok', 'err']),
|
|
445
|
+
* items: z.array(z.string()),
|
|
446
|
+
* }).describe('A status enum + an array of strings.');
|
|
447
|
+
*
|
|
448
|
+
* const agent = Agent.create({...})
|
|
449
|
+
* .outputSchema(Output)
|
|
450
|
+
* .build();
|
|
451
|
+
*
|
|
452
|
+
* const typed = await agent.runTyped({ message: '...' });
|
|
453
|
+
* typed.status; // narrowed to 'ok' | 'err'
|
|
454
|
+
*/
|
|
455
|
+
outputSchema<T>(parser: OutputSchemaParser<T>, opts?: OutputSchemaOptions): this;
|
|
242
456
|
build(): Agent;
|
|
243
457
|
}
|
|
244
458
|
//# sourceMappingURL=Agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,mBAAmB,EAExB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EAExB,KAAK,UAAU,EACf,KAAK,eAAe,EAErB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,KAAK,EACV,WAAW,EAIX,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAgB9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AASlE,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE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