agentfootprint 9.93.0 → 9.94.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 (36) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +2 -1
  3. package/dist/core/agent/AgentBuilder.js +2 -2
  4. package/dist/core/agent/AgentBuilder.js.map +1 -1
  5. package/dist/esm/core/agent/AgentBuilder.js +1 -1
  6. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  7. package/dist/esm/lib/trace-toolpack/lazyToolpack.d.ts +2 -2
  8. package/dist/esm/lib/trace-toolpack/lazyToolpack.js +5 -3
  9. package/dist/esm/lib/trace-toolpack/lazyToolpack.js.map +1 -1
  10. package/dist/esm/lib/trace-toolpack/selfExplain.d.ts +17 -0
  11. package/dist/esm/lib/trace-toolpack/selfExplain.js +53 -5
  12. package/dist/esm/lib/trace-toolpack/selfExplain.js.map +1 -1
  13. package/dist/esm/lib/trace-toolpack/traceToolNames.d.ts +37 -0
  14. package/dist/esm/lib/trace-toolpack/traceToolNames.js +51 -0
  15. package/dist/esm/lib/trace-toolpack/traceToolNames.js.map +1 -0
  16. package/dist/esm/lib/trace-toolpack/traceToolpack.d.ts +5 -7
  17. package/dist/esm/lib/trace-toolpack/traceToolpack.js +5 -19
  18. package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -1
  19. package/dist/esm/package.json +1 -1
  20. package/dist/lib/trace-toolpack/lazyToolpack.js +3 -4
  21. package/dist/lib/trace-toolpack/lazyToolpack.js.map +1 -1
  22. package/dist/lib/trace-toolpack/selfExplain.js +54 -6
  23. package/dist/lib/trace-toolpack/selfExplain.js.map +1 -1
  24. package/dist/lib/trace-toolpack/traceToolNames.js +54 -0
  25. package/dist/lib/trace-toolpack/traceToolNames.js.map +1 -0
  26. package/dist/lib/trace-toolpack/traceToolpack.js +6 -19
  27. package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -1
  28. package/dist/types/lib/trace-toolpack/lazyToolpack.d.ts +2 -2
  29. package/dist/types/lib/trace-toolpack/lazyToolpack.d.ts.map +1 -1
  30. package/dist/types/lib/trace-toolpack/selfExplain.d.ts +17 -0
  31. package/dist/types/lib/trace-toolpack/selfExplain.d.ts.map +1 -1
  32. package/dist/types/lib/trace-toolpack/traceToolNames.d.ts +38 -0
  33. package/dist/types/lib/trace-toolpack/traceToolNames.d.ts.map +1 -0
  34. package/dist/types/lib/trace-toolpack/traceToolpack.d.ts +5 -7
  35. package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
  36. package/package.json +4 -1
@@ -178,6 +178,23 @@ export declare function buildSelfExplainSkill(options: SelfExplainOptions): Inje
178
178
  * when they set one. The iteration after activation, `ctx.activeSkillId`
179
179
  * matches and the catalog gains the trace tools (inline) or the single
180
180
  * `explain_run` tool (delegate).
181
+ *
182
+ * INLINE MODE LOADS THE PACK LAZILY (9.94.0). The toolpack module is the
183
+ * largest single module on the library's default graph, and until this
184
+ * release every consumer who imported `Agent` carried it — `.selfExplain()`
185
+ * or not — because this function reached it statically. Now the pack is
186
+ * `import()`ed the first time the self-explain skill is ACTIVE on an
187
+ * iteration, and never before: not at `build()`, not on a turn where the
188
+ * model never opened the skill, not at all for an agent that did not enable
189
+ * `.selfExplain()`. A bundler splits it into its own chunk; Node loads it
190
+ * through the same `require` it always did, one microtask later.
191
+ *
192
+ * What the consumer sees: `list(ctx)` still answers `[]` synchronously when
193
+ * the skill is not active (the sync fast path the tools slot skips the await
194
+ * for), and a Promise of the same eleven tools when it is — the shape
195
+ * `ToolProvider.list` has always allowed, and the one the composed provider
196
+ * below already used. The provider id is unchanged, so `.watch()` output and
197
+ * the `skill-scoped:` refusal in the builder read exactly as before.
181
198
  */
182
199
  export declare function buildSelfExplainToolProvider(binding: SelfExplainBinding, options: SelfExplainOptions, existing?: ToolProvider): ToolProvider;
183
200
  //# sourceMappingURL=selfExplain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selfExplain.d.ts","sour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SAAS,GAAE,MAAgC;IAG9D,OAAO,KAAK,cAAc,GAEzB;IAED,OAAO,KAAK,WAAW,GAEtB;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,IAAI;IAQ7E,6EAA6E;IAC7E,IAAI,SAAS,IAAI,sBAAsB,GAAG,SAAS,CAUlD;IAED,yEAAyE;IACzE,QAAQ,IAAI,gBAAgB;CA6C7B;AA2CD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAM5E;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,CAAC,EAAE,YAAY,GACtB,YAAY,CAUd"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * traceToolNames — the two facts about the trace toolpack that are needed
3
+ * BEFORE the pack is loaded.
4
+ *
5
+ * `.selfExplain()` mounts the pack lazily (9.94.0): the toolpack module —
6
+ * eleven tools over a finished trace, the largest single module on the
7
+ * library's default graph — is reached through `import()` the first time
8
+ * the self-explain skill is active on an iteration, never at build time and
9
+ * never for an agent that did not enable it (see `selfExplain.ts` ·
10
+ * `buildSelfExplainToolProvider`). Two things the builder needs cannot wait
11
+ * for that load, and they live here so that reading them costs nothing:
12
+ *
13
+ * - `TRACE_TOOL_NAMES` — the names the pack can mount, which `build()`
14
+ * reserves synchronously (a consumer tool sharing a name would silently
15
+ * shadow the trace tool);
16
+ * - `NO_COMPLETED_RUN_MESSAGE` — the model-visible answer every trace tool
17
+ * gives before a turn has finished, which the delegate-mode `explain_run`
18
+ * tool returns without loading the pack at all.
19
+ *
20
+ * `traceToolpack.ts` re-exports `TRACE_TOOL_NAMES` and `lazyToolpack.ts`
21
+ * re-exports `NO_COMPLETED_RUN_MESSAGE`, so every existing import path still
22
+ * resolves — this module only changes what a static import of them COSTS.
23
+ */
24
+ /**
25
+ * The tool names this pack can mount. The Agent builder reserves these at
26
+ * `.selfExplain()` build time — the tools slot dedupes by name with
27
+ * first-occurrence-wins, so a consumer tool sharing a name would silently
28
+ * shadow the trace tool AND the skill body would instruct the model into
29
+ * the wrong one. Exported so the reservation list is DERIVED from the pack
30
+ * rather than typed out beside it (a second list is a list that drifts).
31
+ *
32
+ * The pack itself asserts, at test time, that what it mounts is exactly
33
+ * this list (test/lib/trace-toolpack/selfExplainAgent.test.ts).
34
+ */
35
+ export declare const TRACE_TOOL_NAMES: readonly ["run_overview", "find_context_errors", "find_in_trace", "trace_node", "trace_slice", "backtrack", "who_wrote", "get_value", "inspect_tool_call", "inspect_tool_run", "read_narrative"];
36
+ /** Model-visible answer when no completed run is available yet. */
37
+ export declare const NO_COMPLETED_RUN_MESSAGE: string;
38
+ //# sourceMappingURL=traceToolNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceToolNames.d.ts","sourceRoot":"","sources":["../../../../src/lib/trace-toolpack/traceToolNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,kMAYnB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,QAEa,CAAC"}
@@ -66,14 +66,12 @@ import { type TraceToolpackArtifacts, type TraceToolpackOptions } from './types.
66
66
  */
67
67
  export declare function traceToolpack(artifacts: TraceToolpackArtifacts, options?: TraceToolpackOptions): Tool[];
68
68
  /**
69
- * The tool names this pack can mount. The Agent builder reserves these at
70
- * `.selfExplain()` build time — the tools slot dedupes by name with
71
- * first-occurrence-wins, so a consumer tool sharing a name would silently
72
- * shadow the trace tool AND the skill body would instruct the model into
73
- * the wrong one. Exported so the reservation list is DERIVED from the pack
74
- * rather than typed out beside it (a second list is a list that drifts).
69
+ * The tool names this pack can mount — declared in `traceToolNames.ts` so the
70
+ * Agent builder can reserve them WITHOUT loading this module (the pack is
71
+ * mounted lazily since 9.94.0); re-exported here so the list still reads as
72
+ * the pack's own.
75
73
  */
76
- export declare const TRACE_TOOL_NAMES: readonly ["run_overview", "find_context_errors", "find_in_trace", "trace_node", "trace_slice", "backtrack", "who_wrote", "get_value", "inspect_tool_call", "inspect_tool_run", "read_narrative"];
74
+ export { TRACE_TOOL_NAMES } from './traceToolNames.js';
77
75
  /**
78
76
  * Invoke a toolpack tool OUTSIDE an Agent (scripted debug sessions, tests,
79
77
  * offline auditors). Mirrors the Agent's #9 boundary: args are validated
@@ -1 +1 @@
1
- {"version":3,"file":"traceToolpack.d.ts","sourceRoot":"","sources":["../../../../src/lib/trace-toolpack/traceToolpack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,OAAO,EAAc,KAAK,IAAI,EAA6B,MAAM,qBAAqB,CAAC;AAcvF,OAAO,EAIL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AA4QpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,sBAAsB,EACjC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,IAAI,EAAE,CA0BR;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,kMAYnB,CAAC;AAsqEX;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,MAAM,CAAC,CASjB"}
1
+ {"version":3,"file":"traceToolpack.d.ts","sourceRoot":"","sources":["../../../../src/lib/trace-toolpack/traceToolpack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,OAAO,EAAc,KAAK,IAAI,EAA6B,MAAM,qBAAqB,CAAC;AAcvF,OAAO,EAIL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AA4QpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,sBAAsB,EACjC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,IAAI,EAAE,CA0BR;AAED;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAsqEvD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,MAAM,CAAC,CASjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfootprint",
3
- "version": "9.93.0",
3
+ "version": "9.94.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",
@@ -304,8 +304,11 @@
304
304
  }
305
305
  },
306
306
  "sideEffects": [
307
+ "./dist/index.js",
308
+ "./dist/esm/index.js",
307
309
  "**/cache/strategies/*.js",
308
310
  "**/cache/index.js",
311
+ "**/lib/injection-engine/index.js",
309
312
  "**/lib/injection-engine/devWarnHost.js"
310
313
  ],
311
314
  "peerDependencies": {