agentfootprint 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +3 -2
  3. package/ai-instructions/claude-code/SKILL.md +1 -1
  4. package/dist/core/agent/buildAgentChart.js +3 -0
  5. package/dist/core/agent/buildAgentChart.js.map +1 -1
  6. package/dist/core/agent/buildDynamicAgentChart.js +6 -0
  7. package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
  8. package/dist/core/agent/stages/seed.js +2 -0
  9. package/dist/core/agent/stages/seed.js.map +1 -1
  10. package/dist/core/agent/stages/toolCalls.js +21 -0
  11. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  12. package/dist/esm/core/agent/buildAgentChart.js +3 -0
  13. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  14. package/dist/esm/core/agent/buildDynamicAgentChart.js +6 -0
  15. package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
  16. package/dist/esm/core/agent/stages/seed.js +2 -0
  17. package/dist/esm/core/agent/stages/seed.js.map +1 -1
  18. package/dist/esm/core/agent/stages/toolCalls.js +21 -0
  19. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  20. package/dist/esm/core/agent/types.d.ts +7 -0
  21. package/dist/esm/events/payloads.d.ts +19 -0
  22. package/dist/esm/events/registry.d.ts +3 -1
  23. package/dist/esm/events/registry.js +2 -0
  24. package/dist/esm/events/registry.js.map +1 -1
  25. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +21 -1
  26. package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  27. package/dist/esm/lib/injection-engine/skillGraph.d.ts +19 -8
  28. package/dist/esm/lib/injection-engine/skillGraph.js +99 -29
  29. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  30. package/dist/esm/lib/injection-engine/types.d.ts +14 -0
  31. package/dist/esm/lib/injection-engine/types.js.map +1 -1
  32. package/dist/esm/tool-providers/skillScopedTools.d.ts +24 -17
  33. package/dist/esm/tool-providers/skillScopedTools.js +24 -17
  34. package/dist/esm/tool-providers/skillScopedTools.js.map +1 -1
  35. package/dist/events/registry.js +2 -0
  36. package/dist/events/registry.js.map +1 -1
  37. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +21 -1
  38. package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
  39. package/dist/lib/injection-engine/skillGraph.js +99 -29
  40. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  41. package/dist/lib/injection-engine/types.js.map +1 -1
  42. package/dist/tool-providers/skillScopedTools.js +24 -17
  43. package/dist/tool-providers/skillScopedTools.js.map +1 -1
  44. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  45. package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
  46. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  47. package/dist/types/core/agent/types.d.ts +7 -0
  48. package/dist/types/core/agent/types.d.ts.map +1 -1
  49. package/dist/types/events/payloads.d.ts +19 -0
  50. package/dist/types/events/payloads.d.ts.map +1 -1
  51. package/dist/types/events/registry.d.ts +3 -1
  52. package/dist/types/events/registry.d.ts.map +1 -1
  53. package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
  54. package/dist/types/lib/injection-engine/skillGraph.d.ts +19 -8
  55. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  56. package/dist/types/lib/injection-engine/types.d.ts +14 -0
  57. package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
  58. package/dist/types/tool-providers/skillScopedTools.d.ts +24 -17
  59. package/dist/types/tool-providers/skillScopedTools.d.ts.map +1 -1
  60. package/package.json +1 -1
@@ -1,32 +1,42 @@
1
1
  /**
2
- * skillScopedTools — ToolProvider that exposes a tool subset only when
3
- * a specific Skill is active in the current iteration's context.
2
+ * skillScopedTools — ToolProvider that exposes a tool subset only while a
3
+ * specific Skill is the one the model most recently loaded.
4
4
  *
5
- * The Block A5 piece. Pairs with `defineSkill({ autoActivate: 'currentSkill' })`
6
- * to give the LLM a sharper choice space: when `billing` activates, the
7
- * tool list flips from "all 25 agent tools" to "the 7 billing tools" +
8
- * any baseline (always-on) tools the consumer composes alongside.
5
+ * **You probably don't need this.** If the tools belong to the skill, hand them
6
+ * to the skill: `defineSkill({ tools: [...], autoActivate: 'currentSkill' })`
7
+ * already narrows the LLM's tool list to the active skill, with no provider
8
+ * wiring at all. This provider is for tools that CAN'T ride on the skill
9
+ * a list assembled elsewhere, discovered at runtime, or owned by another module.
9
10
  *
10
- * Pattern: gated ToolProvider keyed by `ctx.activeSkillId`. Pure compute;
11
- * no Agent-runtime dependency. Composes freely with `staticTools`
12
- * for the always-on baseline.
11
+ * Three facts worth knowing before you wire it:
12
+ *
13
+ * 1. **`ctx.activeSkillId` is the last `read_skill` activation, not the graph
14
+ * cursor.** The runtime fills it from the tail of `scope.activatedInjectionIds`,
15
+ * which only `read_skill` ever appends to. A skill that activated because an
16
+ * entry RULE matched, or because a `skillGraph()` edge routed into it, does
17
+ * NOT set it — `list(ctx)` will return `[]` for that skill. Scope by graph
18
+ * position with the skill's own `tools:[]` instead.
19
+ * 2. **One ToolProvider per agent.** `AgentBuilder.toolProvider()` throws on the
20
+ * second call. Compose several scopes into ONE provider (see the example
21
+ * below) rather than calling it in a loop.
22
+ * 3. It is pure compute — no Agent-runtime dependency — so it is equally usable
23
+ * from a test or a design-time inspection.
13
24
  *
14
25
  * @example One skill's tools, scoped by activation
15
26
  * const billingTools = skillScopedTools('billing', [refundTool, chargeTool]);
16
27
  * billingTools.list({ iteration: 1, activeSkillId: 'billing' });
17
28
  * // → [refundTool, chargeTool]
18
29
  * billingTools.list({ iteration: 1, activeSkillId: 'refund' });
19
- * // → [] (different skill active)
30
+ * // → [] (a different skill was loaded)
20
31
  * billingTools.list({ iteration: 1 });
21
- * // → [] (no skill active)
32
+ * // → [] (nothing loaded via read_skill — see fact 1 above)
22
33
  *
23
34
  * @example Compose with baseline + multiple skills
24
35
  * const baseline = staticTools([lookupOrderTool, listSkills, readSkill]);
25
36
  * const billingTbx = skillScopedTools('billing', [refundTool, chargeTool]);
26
37
  * const refundTbx = skillScopedTools('refund', [reverseTool]);
27
38
  *
28
- * // Wrap each scope-provider in a gatedTools for downstream composition,
29
- * // OR build a small wrapper that concatenates list(ctx) outputs:
39
+ * // ONE provider for the agent (see fact 2) — concatenate the scopes:
30
40
  * const provider: ToolProvider = {
31
41
  * id: 'composite',
32
42
  * list: (ctx) => [
@@ -35,10 +45,7 @@
35
45
  * ...refundTbx.list(ctx),
36
46
  * ],
37
47
  * };
38
- *
39
- * Note: the runtime that POPULATES `ctx.activeSkillId` from
40
- * `scope.activatedInjectionIds` lands in Block C / v2.5+. Today,
41
- * consumers can drive it manually for tests + design-time inspection.
48
+ * Agent.create({ provider: llm, model }).toolProvider(provider).build();
42
49
  */
43
50
  import type { Tool } from '../core/tools.js';
44
51
  import type { ToolProvider } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"skillScopedTools.d.ts","sourceRoot":"","sources":["../../../src/tool-providers/skillScopedTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAGpE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,YAAY,CAgBtF"}
1
+ {"version":3,"file":"skillScopedTools.d.ts","sourceRoot":"","sources":["../../../src/tool-providers/skillScopedTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAGpE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,YAAY,CAgBtF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfootprint",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",