agentfootprint 9.90.0 → 9.92.1

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 (91) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +213 -0
  3. package/CLAUDE.md +1 -1
  4. package/ai-instructions/claude-code/SKILL.md +1 -1
  5. package/dist/core/Agent.js +23 -7
  6. package/dist/core/Agent.js.map +1 -1
  7. package/dist/core/LLMCall.js +62 -7
  8. package/dist/core/LLMCall.js.map +1 -1
  9. package/dist/core/agent/buildAgentMessageApiChart.js +36 -3
  10. package/dist/core/agent/buildAgentMessageApiChart.js.map +1 -1
  11. package/dist/core/agent/buildMessageApiChart.js +26 -3
  12. package/dist/core/agent/buildMessageApiChart.js.map +1 -1
  13. package/dist/core/agent/buildToolRegistry.js +90 -33
  14. package/dist/core/agent/buildToolRegistry.js.map +1 -1
  15. package/dist/core/agent/messageApiReceipt.js +77 -0
  16. package/dist/core/agent/messageApiReceipt.js.map +1 -0
  17. package/dist/core/agent/stages/callLLM.js +1 -5
  18. package/dist/core/agent/stages/callLLM.js.map +1 -1
  19. package/dist/core/agent/stages/toolCalls.js +176 -28
  20. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  21. package/dist/core/slots/buildToolsSlot.js +209 -62
  22. package/dist/core/slots/buildToolsSlot.js.map +1 -1
  23. package/dist/esm/core/Agent.js +24 -8
  24. package/dist/esm/core/Agent.js.map +1 -1
  25. package/dist/esm/core/LLMCall.d.ts +18 -0
  26. package/dist/esm/core/LLMCall.js +63 -8
  27. package/dist/esm/core/LLMCall.js.map +1 -1
  28. package/dist/esm/core/agent/buildAgentMessageApiChart.d.ts +22 -0
  29. package/dist/esm/core/agent/buildAgentMessageApiChart.js +37 -4
  30. package/dist/esm/core/agent/buildAgentMessageApiChart.js.map +1 -1
  31. package/dist/esm/core/agent/buildMessageApiChart.d.ts +32 -0
  32. package/dist/esm/core/agent/buildMessageApiChart.js +27 -4
  33. package/dist/esm/core/agent/buildMessageApiChart.js.map +1 -1
  34. package/dist/esm/core/agent/buildToolRegistry.d.ts +80 -31
  35. package/dist/esm/core/agent/buildToolRegistry.js +90 -33
  36. package/dist/esm/core/agent/buildToolRegistry.js.map +1 -1
  37. package/dist/esm/core/agent/messageApiReceipt.d.ts +82 -0
  38. package/dist/esm/core/agent/messageApiReceipt.js +73 -0
  39. package/dist/esm/core/agent/messageApiReceipt.js.map +1 -0
  40. package/dist/esm/core/agent/stages/callLLM.js +3 -7
  41. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  42. package/dist/esm/core/agent/stages/toolCalls.d.ts +43 -5
  43. package/dist/esm/core/agent/stages/toolCalls.js +174 -27
  44. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  45. package/dist/esm/core/agent/types.d.ts +15 -0
  46. package/dist/esm/core/slots/buildToolsSlot.d.ts +100 -0
  47. package/dist/esm/core/slots/buildToolsSlot.js +207 -61
  48. package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
  49. package/dist/esm/events/payloads.d.ts +92 -18
  50. package/dist/esm/events/registry.d.ts +5 -1
  51. package/dist/esm/events/registry.js +4 -0
  52. package/dist/esm/events/registry.js.map +1 -1
  53. package/dist/esm/lib/time-travel/receipt.d.ts +45 -13
  54. package/dist/esm/lib/time-travel/receipt.js +41 -10
  55. package/dist/esm/lib/time-travel/receipt.js.map +1 -1
  56. package/dist/esm/lib/time-travel/servedView.d.ts +36 -35
  57. package/dist/esm/lib/time-travel/servedView.js +64 -43
  58. package/dist/esm/lib/time-travel/servedView.js.map +1 -1
  59. package/dist/events/registry.js +4 -0
  60. package/dist/events/registry.js.map +1 -1
  61. package/dist/lib/time-travel/receipt.js +43 -11
  62. package/dist/lib/time-travel/receipt.js.map +1 -1
  63. package/dist/lib/time-travel/servedView.js +64 -43
  64. package/dist/lib/time-travel/servedView.js.map +1 -1
  65. package/dist/types/core/Agent.d.ts.map +1 -1
  66. package/dist/types/core/LLMCall.d.ts +18 -0
  67. package/dist/types/core/LLMCall.d.ts.map +1 -1
  68. package/dist/types/core/agent/buildAgentMessageApiChart.d.ts +22 -0
  69. package/dist/types/core/agent/buildAgentMessageApiChart.d.ts.map +1 -1
  70. package/dist/types/core/agent/buildMessageApiChart.d.ts +32 -0
  71. package/dist/types/core/agent/buildMessageApiChart.d.ts.map +1 -1
  72. package/dist/types/core/agent/buildToolRegistry.d.ts +80 -31
  73. package/dist/types/core/agent/buildToolRegistry.d.ts.map +1 -1
  74. package/dist/types/core/agent/messageApiReceipt.d.ts +83 -0
  75. package/dist/types/core/agent/messageApiReceipt.d.ts.map +1 -0
  76. package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
  77. package/dist/types/core/agent/stages/toolCalls.d.ts +43 -5
  78. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  79. package/dist/types/core/agent/types.d.ts +15 -0
  80. package/dist/types/core/agent/types.d.ts.map +1 -1
  81. package/dist/types/core/slots/buildToolsSlot.d.ts +100 -0
  82. package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
  83. package/dist/types/events/payloads.d.ts +92 -18
  84. package/dist/types/events/payloads.d.ts.map +1 -1
  85. package/dist/types/events/registry.d.ts +5 -1
  86. package/dist/types/events/registry.d.ts.map +1 -1
  87. package/dist/types/lib/time-travel/receipt.d.ts +45 -13
  88. package/dist/types/lib/time-travel/receipt.d.ts.map +1 -1
  89. package/dist/types/lib/time-travel/servedView.d.ts +36 -35
  90. package/dist/types/lib/time-travel/servedView.d.ts.map +1 -1
  91. package/package.json +1 -1
@@ -25,13 +25,16 @@
25
25
  * which slots the Context selector lights per iteration differs.
26
26
  */
27
27
  import { flowChartSelector, select } from 'footprintjs';
28
+ import { ArrayMergeMode } from 'footprintjs/advanced';
29
+ import { RECEIPT_KEY } from '../../lib/time-travel/receipt.js';
30
+ import { messageApiReceipt } from './messageApiReceipt.js';
28
31
  import { SUBFLOW_IDS, STAGE_IDS, milestoneTagsFor } from '../../conventions.js';
29
32
  import { typedEmit } from '../../recorders/core/typedEmit.js';
30
33
  import { resilienceHooks } from '../../recorders/core/resilienceHooks.js';
31
34
  import { buildSystemPromptSlot } from '../slots/buildSystemPromptSlot.js';
32
35
  import { buildMessagesSlot } from '../slots/buildMessagesSlot.js';
33
36
  import { buildToolsSlot } from '../slots/buildToolsSlot.js';
34
- import { joinSystemPrompt } from './composeRequest.js';
37
+ import { joinSystemPrompt, stripFrameworkFields } from './composeRequest.js';
35
38
  /** Route branch ids. */
36
39
  const ROUTE_TOOL_CALLS = 'tool-calls';
37
40
  const ROUTE_FINAL = SUBFLOW_IDS.FINAL;
@@ -76,7 +79,7 @@ export function buildAgentMessageApiChart(deps) {
76
79
  // ── Call-LLM: send the assembled payload + the tool schemas. ──
77
80
  const callLLM = async (scope) => {
78
81
  const system = scope.assembledSystem;
79
- const messages = (scope.assembledMessages ?? []);
82
+ const messages = stripFrameworkFields((scope.assembledMessages ?? []));
80
83
  const toolSchemas = (scope.toolSchemas ?? []);
81
84
  typedEmit(scope, 'agentfootprint.stream.llm_start', {
82
85
  iteration: scope.iteration,
@@ -93,12 +96,33 @@ export function buildAgentMessageApiChart(deps) {
93
96
  }),
94
97
  });
95
98
  const startMs = Date.now();
96
- const response = await provider.complete({
99
+ // ONE request object, sent and fingerprinted — never assembled twice.
100
+ const request = {
97
101
  ...(system.length > 0 && { systemPrompt: system }),
98
102
  messages,
99
103
  ...(toolSchemas.length > 0 && { tools: toolSchemas }),
100
104
  model,
101
- },
105
+ };
106
+ // ── THE RECEIPT (9.91.0) ───────────────────────────────────────────
107
+ // Minted immediately before the port is called, so it is committed in the
108
+ // call-llm bundle that already exists — and before rather than after on
109
+ // purpose: the stage commits on the error path too, so a call that throws
110
+ // still leaves the record of what it was about to send. No run id ⇒ no
111
+ // receipt; the rule and its reason live in `messageApiReceipt.ts`.
112
+ const receipt = messageApiReceipt({
113
+ runId: deps.getRunId?.(),
114
+ epoch: scope.iteration,
115
+ model,
116
+ provider: provider.name,
117
+ systemText: system,
118
+ systemPieces: (scope.systemPromptInjections ?? []),
119
+ messages,
120
+ tools: toolSchemas,
121
+ request,
122
+ });
123
+ if (receipt !== undefined)
124
+ scope[RECEIPT_KEY] = receipt;
125
+ const response = await provider.complete(request,
102
126
  // Resilience-report channel: a decorated provider's fallback /
103
127
  // retry / recovery becomes an in-run typed event here.
104
128
  //
@@ -193,6 +217,15 @@ export function buildAgentMessageApiChart(deps) {
193
217
  tags: milestoneTagsFor(SUBFLOW_IDS.TOOLS),
194
218
  inputMapper: (parent) => ({ iteration: parent.iteration }),
195
219
  outputMapper: (sf) => ({ toolSchemas: sf.toolSchemas }),
220
+ // REPLACE, never concatenate (9.92.0). footprintjs's default output
221
+ // mapping CONCATENATES a subflow's array output onto the parent's
222
+ // existing array, so turn 2 of this loop handed the model
223
+ // `['weather','weather']` — the same tool twice, and Anthropic rejects
224
+ // a request whose tool names repeat. The receipt and `servedAt` recorded
225
+ // the doubled list truthfully, which is how the defect became visible
226
+ // (9.91.0 follow-up). The agent charts already say this on their own
227
+ // tools mount; this chart had the same mapper without the same law.
228
+ arrayMerge: ArrayMergeMode.Replace,
196
229
  // tools is a SEPARATE Anthropic wire field — it BYPASSES messageAPI
197
230
  // (which assembles only system+messages) and pairs with its output at
198
231
  // Call-LLM. `convergeAt` makes the structure edge `sf-tools → call-llm`
@@ -1 +1 @@
1
- {"version":3,"file":"buildAgentMessageApiChart.js","sourceRoot":"","sources":["../../../../src/core/agent/buildAgentMessageApiChart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AA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qE;QACrE,oEAAoE;QACpE,UAAU,EAAE,cAAc,CAAC,OAAO;QAClC,oEAAoE;QACpE,sEAAsE;QACtE,wEAAwE;QACxE,0EAA0E;QAC1E,sEAAsE;QACtE,uDAAuD;QACvD,UAAU,EAAE,UAAU;KACvB,CAAC;SACD,GAAG,EAAE;QACN,sEAAsE;QACtE,yDAAyD;SACxD,WAAW,CACV,YAAY,EACZ,eAAwB,EACxB,aAAa,EACb,iDAAiD,CAClD;SACA,WAAW,CACV,SAAS,EACT,OAAgB,EAChB,UAAU,EACV,+CAA+C,CAChD;QACD,yEAAyE;QACzE,mEAAmE;SAClE,GAAG,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC7C,oEAAoE;SACnE,kBAAkB,CAAC,OAAO,EAAE,YAAqB,EAAE,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE;QACtF,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC;KAC1C,CAAC;SACD,iBAAiB,CAAC,gBAAgB,EAAE,WAAW,EAAE,QAAiB,EAAE,oBAAoB,EAAE;QACzF,IAAI,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;KACzC,CAAC;QACF,yEAAyE;QACzE,4EAA4E;QAC5E,qEAAqE;SACpE,MAAM,CAAC,SAAS,CAAC;SACjB,iBAAiB,CAChB,WAAW,EACX,OAAO,EACP,UAAmB,EACnB,qCAAqC,CACtC;SACA,UAAU,CAAC,WAAW,CAAC;SACvB,GAAG,EAAE;SACL,KAAK,EAAE,CACX,CAAC;AACJ,CAAC"}
@@ -41,6 +41,38 @@ export interface MessageApiChartDeps {
41
41
  readonly model: string;
42
42
  readonly systemPrompt: string;
43
43
  readonly structureRecorders?: readonly import('footprintjs').StructureRecorder[];
44
+ /**
45
+ * The id of the run this chart is about to make (9.91.0) — supply it and
46
+ * Call-LLM mints a receipt, the fingerprint of what the model was handed,
47
+ * committed at the call for `receiptAt` and `servedAt` to read.
48
+ *
49
+ * IT IS A DEP BECAUSE THIS IS A CHART BUILDER, NOT A RUNNER. `Agent` and
50
+ * `LLMCall` own their executor and mint a run id per run; this chart is
51
+ * handed to a `FlowChartExecutor` the caller owns, and nothing in a stage's
52
+ * scope carries that executor's run id. So the one value the receipt cannot
53
+ * do without has to come from whoever starts the run.
54
+ *
55
+ * OMIT IT AND NO RECEIPT IS MINTED — deliberately, rather than minting an
56
+ * unsalted one. Every hash on a receipt is salted with the run id precisely
57
+ * so a short system prompt or a two-word turn cannot be fingerprinted across
58
+ * runs (`receipt.ts`, the third law), and a receipt is committed state that
59
+ * travels in recordings. A chart that minted with an empty salt would ship
60
+ * dictionary-attackable fingerprints by default. `servedAt` then declares
61
+ * the absence — `no-receipt-on-chart`, cause `'no-receipt-committed'` — and
62
+ * rebuilds the view as it always did.
63
+ *
64
+ * @example (internal — `buildMessageApiChart` is not on the package's public
65
+ * surface; the type is, so a caller composing this chart inside the library
66
+ * reads the contract here)
67
+ * ```ts
68
+ * const runId = `run-${Date.now()}`;
69
+ * const chart = buildMessageApiChart({ provider, model, systemPrompt, getRunId: () => runId });
70
+ * const executor = new FlowChartExecutor(chart);
71
+ * await executor.run({ input: { message: 'hi' } });
72
+ * receiptAt(executor.getSnapshot(), 1)?.basis.runId; // runId
73
+ * ```
74
+ */
75
+ readonly getRunId?: () => string | undefined;
44
76
  }
45
77
  /**
46
78
  * Build the LLM-only messageAPI merge-tree chart.
@@ -35,12 +35,14 @@
35
35
  * emits context.injected and Lens renders them — no bespoke collapser.
36
36
  */
37
37
  import { flowChartSelector, select } from 'footprintjs';
38
+ import { RECEIPT_KEY } from '../../lib/time-travel/receipt.js';
39
+ import { messageApiReceipt } from './messageApiReceipt.js';
38
40
  import { SUBFLOW_IDS, STAGE_IDS, milestoneTagsFor } from '../../conventions.js';
39
41
  import { typedEmit } from '../../recorders/core/typedEmit.js';
40
42
  import { resilienceHooks } from '../../recorders/core/resilienceHooks.js';
41
43
  import { buildSystemPromptSlot } from '../slots/buildSystemPromptSlot.js';
42
44
  import { buildMessagesSlot } from '../slots/buildMessagesSlot.js';
43
- import { joinSystemPrompt } from './composeRequest.js';
45
+ import { joinSystemPrompt, stripFrameworkFields } from './composeRequest.js';
44
46
  /**
45
47
  * Build the LLM-only messageAPI merge-tree chart.
46
48
  */
@@ -92,7 +94,7 @@ export function buildMessageApiChart(deps) {
92
94
  // ── Call-LLM: send the assembled payload, write the answer. ──
93
95
  const callLLM = async (scope) => {
94
96
  const system = scope.assembledSystem;
95
- const messages = (scope.assembledMessages ?? []);
97
+ const messages = stripFrameworkFields((scope.assembledMessages ?? []));
96
98
  typedEmit(scope, 'agentfootprint.stream.llm_start', {
97
99
  iteration: scope.iteration,
98
100
  provider: provider.name,
@@ -102,11 +104,32 @@ export function buildMessageApiChart(deps) {
102
104
  toolsCount: 0,
103
105
  });
104
106
  const startMs = Date.now();
105
- const response = await provider.complete({
107
+ // ONE request object, sent and fingerprinted — see the receipt below.
108
+ const request = {
106
109
  ...(system.length > 0 && { systemPrompt: system }),
107
110
  messages,
108
111
  model,
109
- },
112
+ };
113
+ // ── THE RECEIPT (9.91.0) ───────────────────────────────────────────
114
+ // Minted immediately before the port is called, so it is committed in the
115
+ // call-llm bundle that already exists — and before rather than after on
116
+ // purpose: the stage commits on the error path too, so a call that throws
117
+ // still leaves the record of what it was about to send. No run id ⇒ no
118
+ // receipt; the rule and its reason live in `messageApiReceipt.ts`.
119
+ const receipt = messageApiReceipt({
120
+ runId: deps.getRunId?.(),
121
+ epoch: scope.iteration,
122
+ model,
123
+ provider: provider.name,
124
+ systemText: system,
125
+ systemPieces: (scope.systemPromptInjections ?? []),
126
+ messages,
127
+ tools: [],
128
+ request,
129
+ });
130
+ if (receipt !== undefined)
131
+ scope[RECEIPT_KEY] = receipt;
132
+ const response = await provider.complete(request,
110
133
  // Resilience-report channel — see buildAgentMessageApiChart.
111
134
  resilienceHooks(scope));
112
135
  scope.answer = response.content;
@@ -1 +1 @@
1
- {"version":3,"file":"buildMessageAp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E,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC;QAC5C,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACxB,QAAQ,EAAG,MAA0B,CAAC,OAAO;YAC7C,SAAS,EAAG,MAA0B,CAAC,SAAS;SACjD,CAAC;QACF,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,kBAAkB,EAAG,EAAsB,CAAC,kBAAkB,EAAE,CAAC;KAC3F,CAAC;SACD,GAAG,EAAE;QACN,+DAA+D;SAC9D,WAAW,CACV,YAAY,EACZ,eAAwB,EACxB,aAAa,EACb,iDAAiD,CAClD;SACA,WAAW,CAAC,SAAS,EAAE,OAAgB,EAAE,UAAU,EAAE,uCAAuC,CAAC;QAC9F,qEAAqE;QACrE,0CAA0C;SACzC,GAAG,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhD,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC"}
@@ -57,16 +57,18 @@
57
57
  * the autoActivate invariant above exists, and why the name-uniqueness throws
58
58
  * below are throws: an identity that is not stable is one the model cannot
59
59
  * address. Where a provider schema reaches the wire ahead of a skill tool of
60
- * the same name, the identity half is the SHADOW SEAM illustrated below.
60
+ * the same name, the identity half WAS the SHADOW SEAM illustrated below —
61
+ * closed in 9.92.0 by making dispatch follow the offer.
61
62
  *
62
63
  * `with stable identity` is kept rather than dropped, and the reason is the
63
64
  * event. A law reading only "every offered name resolves to something" would
64
65
  * be true everywhere and would leave `agentfootprint.tools.shadowed` reporting
65
66
  * a deviation from nothing — the framework spends an event on that seam
66
67
  * precisely because reading one contract and calling another implementation is
67
- * a violation of an expectation worth naming. Scoping a true clause and
68
- * walking its exceptions keeps the expectation stated; weakening the clause to
69
- * name resolution would delete it.
68
+ * a violation of an expectation worth naming. Since 9.92.0 the clause HOLDS
69
+ * for every name on the wire (dispatch follows the offer); the event now names
70
+ * the collision that would have broken it, and its companion
71
+ * `agentfootprint.tools.claim_swallowed` names the party the collision silenced.
70
72
  *
71
73
  * Clause two is the whole point of the narrowing dials — `autoActivate`,
72
74
  * `skillGraph({ scopeTools })`, `.toolsFromActiveSkill()`, a parked map,
@@ -133,33 +135,44 @@
133
135
  * `makeReachableSkills` filters the cursor out of its own successor set,
134
136
  * and under `.tree()` the reachable set is `() => []` outright
135
137
  * (skillGraph.ts) — a tree routes by predicate and has no cursor to move.
136
- * • The SHADOW SEAM — a SAME-EPOCH divergence, and the one the framework
137
- * TRIES to emit an event for — `claim-swallowed` fires it outside the
138
- * shadow seam too, so the event is a signal, never a boundary. A `ToolProvider` and an ACTIVE skill can declare the
139
- * same tool name, and the two lose in opposite directions, each by a rule
140
- * rather than a race: the wire merge puts provider schemas
141
- * ahead of skill injections first-occurrence-wins, so the model reads the
142
- * PROVIDER's description and `inputSchema`; `lookupTool` checks
143
- * `registryByName` first, where every skill tool lives and no provider
144
- * tool does, so the SKILL's `execute` runs. Clause one's dispatchability
145
- * survives — the name resolves, there is no `Unknown tool` — but stable
146
- * identity does not: the contract offered and the implementation that
147
- * answered are different tools, inside ONE epoch. Nothing throws, because
148
- * nothing here can see it coming: the provider's list is resolved per
149
- * iteration (`list(ctx)`) and the skill has to be active, so there is no
150
- * build-time moment at which the pair is knowable. The pair this file CAN
151
- * see — a static `.tool()` against a skill tool — is refused below, which
152
- * is the better answer whenever the answer is available that early.
153
- * Reported rather than refused: `agentfootprint.tools.shadowed` every
154
- * iteration plus one dev-mode line (`reportShadowedTools`,
155
- * buildToolsSlot.ts). Pinned by `test/toolShadowing.test.ts` and, as a
156
- * counterexample to this law, by epoch-laws 1(g).
157
- * What the event covers is NARROWER than the seam, which is the reason
158
- * this bullet is illustration and the walk is the enumeration: the walk
159
- * records the same divergence with an INACTIVE skill winning dispatch and
160
- * no event at all, a provider claiming `skip_step` and the framework's own
161
- * tool answering, and a configuration where the event fires and names the
162
- * wrong schema source. Their reasons are in the baseline.
138
+ * • The SHADOW SEAM — the SAME-EPOCH divergence this file's two maps used
139
+ * to produce, CLOSED in 9.92.0 and kept here because a reader meeting
140
+ * the maps has to know why dispatch no longer reads them first. A
141
+ * `ToolProvider` and a skill can declare the same tool name. The wire
142
+ * merge puts provider schemas ahead of skill injections
143
+ * first-occurrence-wins, so the model reads the PROVIDER's contract; until
144
+ * 9.92.0 `lookupTool` checked `registryByName` first, where every skill
145
+ * tool lives and no provider tool does, so the SKILL's `execute` ran —
146
+ * the contract offered and the implementation that answered were
147
+ * different tools, inside ONE epoch, and an INACTIVE skill could answer
148
+ * a call it was never offered. Now DISPATCH FOLLOWS THE OFFER: the tools
149
+ * slot records which party put each name on the wire (`ServedToolParties`,
150
+ * buildToolsSlot.ts) and `lookupTool` resolves a name on the wire to THAT
151
+ * party's implementation; `registryByName` is the fallback for a name
152
+ * that is not on this epoch's wire at all (the held-out, parked and
153
+ * restored-transcript cases the capability law keeps dispatchable) —
154
+ * reached only for the party the model LAST read the name under, or the
155
+ * name's only holder when it was never served, and put on the record by
156
+ * `agentfootprint.tools.answered_off_wire`; a name whose last-served
157
+ * party can no longer answer is refused (`toolCalls.ts` ·
158
+ * `notServedResult`), never handed to a party the model was not shown
159
+ * under that name. The
160
+ * collision itself is still REPORTED rather than refused, because nothing
161
+ * here can see it coming: the provider's list is resolved per iteration
162
+ * (`list(ctx)`), so there is no build-time moment at which the pair is
163
+ * knowable. The pair this file CAN see — a static `.tool()` against a
164
+ * skill tool — is refused upstream (`validators.ts` ·
165
+ * `validateToolNameUniqueness`), which is the better answer whenever the
166
+ * answer is available that early. `agentfootprint.tools.shadowed` names
167
+ * the wire's party (now the same party in both of its halves) every
168
+ * iteration two contracts compete, and `agentfootprint.tools.claim_swallowed`
169
+ * names every party whose claim is dead that iteration — the loser of a
170
+ * competition, and the claimant that never even reached the merge (a
171
+ * provider tool whose name a registry holder owns, a skill tool named
172
+ * after a framework auto-attach). `toolClaimants` below is what makes the
173
+ * second event possible: the list of who claimed a name, kept instead of
174
+ * collapsed to a winner. Pinned by `test/toolShadowing.test.ts`,
175
+ * `test/core/tools/offer-and-answer.test.ts` and epoch-laws 1(g).
163
176
  *
164
177
  * MCP does not add a seam of its OWN, and it is worth saying so because it
165
178
  * looks like it does: `mcpServe` builds `listing` and `byName` ONCE at
@@ -176,6 +189,20 @@
176
189
  import type { Injection } from '../../lib/injection-engine/types.js';
177
190
  import type { LLMToolSchema } from '../../adapters/types.js';
178
191
  import { type Tool, type ToolRegistryEntry } from '../tools.js';
192
+ import type { ToolNameChannel } from '../../events/payloads.js';
193
+ /**
194
+ * One party's claim to a tool name, as declared at build (9.92.0).
195
+ *
196
+ * `channel` is the vocabulary `tools.shadowed` / `tools.claim_swallowed` name
197
+ * parties in; `id` is the skill id for a skill's claim (a static `.tool()` and
198
+ * a framework auto-attach carry none). `tool` is the implementation that
199
+ * answers when THIS claim is the one on the wire.
200
+ */
201
+ export interface ToolClaim {
202
+ readonly channel: Exclude<ToolNameChannel, 'provider'>;
203
+ readonly id?: string;
204
+ readonly tool: Tool;
205
+ }
179
206
  export interface ToolRegistryArtifacts {
180
207
  /** All tools the LLM sees in the static portion of its tool list
181
208
  * (registry + read_skill + non-autoActivate skill tools). */
@@ -209,6 +236,28 @@ export interface ToolRegistryArtifacts {
209
236
  * they are the framework's or the app's, not a skill's.
210
237
  */
211
238
  readonly toolDeclaringSkills: ReadonlyMap<string, readonly string[]>;
239
+ /**
240
+ * EVERY BUILD-TIME CLAIMANT PER TOOL NAME (9.92.0) — a list, not a winner.
241
+ *
242
+ * `registryByName` holds one implementation per name and still does: it is
243
+ * the map dispatch falls back to for a name that is NOT on this epoch's
244
+ * wire (a held-out step tool, a parked map's tool, a scoped tool named from
245
+ * a restored transcript — the capability law's "a narrowing takes a name
246
+ * off the wire, never out of dispatch", qualified since the 9.92.0 review
247
+ * by "to the party the model last read it under"). What it cannot say is who ELSE
248
+ * claimed the name, and that is what the tools slot needs to report a
249
+ * dead claim (`tools.claim_swallowed`) and to name the wire's party
250
+ * truthfully (`tools.shadowed`). Provider claims are not here — a
251
+ * `ToolProvider` resolves per iteration and is a runtime fact.
252
+ *
253
+ * Order per name: the `augmentedRegistry` holder first (a static `.tool()`,
254
+ * the framework's `read_skill`/`present`, an always-visible skill's tool),
255
+ * then every other skill that declares the name (a shared reference is
256
+ * listed under each declaring skill), then the framework's `skip_step` when
257
+ * any skill declares steps. Build time decides nothing here: the wire
258
+ * decides, per epoch, in `buildToolsSlot`.
259
+ */
260
+ readonly toolClaimants: ReadonlyMap<string, readonly ToolClaim[]>;
212
261
  }
213
262
  /** The build facts that gate auto-attached tools beyond skills (9.22.0). */
214
263
  export interface BuildToolRegistryOptions {
@@ -61,16 +61,18 @@
61
61
  * the autoActivate invariant above exists, and why the name-uniqueness throws
62
62
  * below are throws: an identity that is not stable is one the model cannot
63
63
  * address. Where a provider schema reaches the wire ahead of a skill tool of
64
- * the same name, the identity half is the SHADOW SEAM illustrated below.
64
+ * the same name, the identity half WAS the SHADOW SEAM illustrated below —
65
+ * closed in 9.92.0 by making dispatch follow the offer.
65
66
  *
66
67
  * `with stable identity` is kept rather than dropped, and the reason is the
67
68
  * event. A law reading only "every offered name resolves to something" would
68
69
  * be true everywhere and would leave `agentfootprint.tools.shadowed` reporting
69
70
  * a deviation from nothing — the framework spends an event on that seam
70
71
  * precisely because reading one contract and calling another implementation is
71
- * a violation of an expectation worth naming. Scoping a true clause and
72
- * walking its exceptions keeps the expectation stated; weakening the clause to
73
- * name resolution would delete it.
72
+ * a violation of an expectation worth naming. Since 9.92.0 the clause HOLDS
73
+ * for every name on the wire (dispatch follows the offer); the event now names
74
+ * the collision that would have broken it, and its companion
75
+ * `agentfootprint.tools.claim_swallowed` names the party the collision silenced.
74
76
  *
75
77
  * Clause two is the whole point of the narrowing dials — `autoActivate`,
76
78
  * `skillGraph({ scopeTools })`, `.toolsFromActiveSkill()`, a parked map,
@@ -137,33 +139,44 @@
137
139
  * `makeReachableSkills` filters the cursor out of its own successor set,
138
140
  * and under `.tree()` the reachable set is `() => []` outright
139
141
  * (skillGraph.ts) — a tree routes by predicate and has no cursor to move.
140
- * • The SHADOW SEAM — a SAME-EPOCH divergence, and the one the framework
141
- * TRIES to emit an event for — `claim-swallowed` fires it outside the
142
- * shadow seam too, so the event is a signal, never a boundary. A `ToolProvider` and an ACTIVE skill can declare the
143
- * same tool name, and the two lose in opposite directions, each by a rule
144
- * rather than a race: the wire merge puts provider schemas
145
- * ahead of skill injections first-occurrence-wins, so the model reads the
146
- * PROVIDER's description and `inputSchema`; `lookupTool` checks
147
- * `registryByName` first, where every skill tool lives and no provider
148
- * tool does, so the SKILL's `execute` runs. Clause one's dispatchability
149
- * survives — the name resolves, there is no `Unknown tool` — but stable
150
- * identity does not: the contract offered and the implementation that
151
- * answered are different tools, inside ONE epoch. Nothing throws, because
152
- * nothing here can see it coming: the provider's list is resolved per
153
- * iteration (`list(ctx)`) and the skill has to be active, so there is no
154
- * build-time moment at which the pair is knowable. The pair this file CAN
155
- * see — a static `.tool()` against a skill tool — is refused below, which
156
- * is the better answer whenever the answer is available that early.
157
- * Reported rather than refused: `agentfootprint.tools.shadowed` every
158
- * iteration plus one dev-mode line (`reportShadowedTools`,
159
- * buildToolsSlot.ts). Pinned by `test/toolShadowing.test.ts` and, as a
160
- * counterexample to this law, by epoch-laws 1(g).
161
- * What the event covers is NARROWER than the seam, which is the reason
162
- * this bullet is illustration and the walk is the enumeration: the walk
163
- * records the same divergence with an INACTIVE skill winning dispatch and
164
- * no event at all, a provider claiming `skip_step` and the framework's own
165
- * tool answering, and a configuration where the event fires and names the
166
- * wrong schema source. Their reasons are in the baseline.
142
+ * • The SHADOW SEAM — the SAME-EPOCH divergence this file's two maps used
143
+ * to produce, CLOSED in 9.92.0 and kept here because a reader meeting
144
+ * the maps has to know why dispatch no longer reads them first. A
145
+ * `ToolProvider` and a skill can declare the same tool name. The wire
146
+ * merge puts provider schemas ahead of skill injections
147
+ * first-occurrence-wins, so the model reads the PROVIDER's contract; until
148
+ * 9.92.0 `lookupTool` checked `registryByName` first, where every skill
149
+ * tool lives and no provider tool does, so the SKILL's `execute` ran —
150
+ * the contract offered and the implementation that answered were
151
+ * different tools, inside ONE epoch, and an INACTIVE skill could answer
152
+ * a call it was never offered. Now DISPATCH FOLLOWS THE OFFER: the tools
153
+ * slot records which party put each name on the wire (`ServedToolParties`,
154
+ * buildToolsSlot.ts) and `lookupTool` resolves a name on the wire to THAT
155
+ * party's implementation; `registryByName` is the fallback for a name
156
+ * that is not on this epoch's wire at all (the held-out, parked and
157
+ * restored-transcript cases the capability law keeps dispatchable) —
158
+ * reached only for the party the model LAST read the name under, or the
159
+ * name's only holder when it was never served, and put on the record by
160
+ * `agentfootprint.tools.answered_off_wire`; a name whose last-served
161
+ * party can no longer answer is refused (`toolCalls.ts` ·
162
+ * `notServedResult`), never handed to a party the model was not shown
163
+ * under that name. The
164
+ * collision itself is still REPORTED rather than refused, because nothing
165
+ * here can see it coming: the provider's list is resolved per iteration
166
+ * (`list(ctx)`), so there is no build-time moment at which the pair is
167
+ * knowable. The pair this file CAN see — a static `.tool()` against a
168
+ * skill tool — is refused upstream (`validators.ts` ·
169
+ * `validateToolNameUniqueness`), which is the better answer whenever the
170
+ * answer is available that early. `agentfootprint.tools.shadowed` names
171
+ * the wire's party (now the same party in both of its halves) every
172
+ * iteration two contracts compete, and `agentfootprint.tools.claim_swallowed`
173
+ * names every party whose claim is dead that iteration — the loser of a
174
+ * competition, and the claimant that never even reached the merge (a
175
+ * provider tool whose name a registry holder owns, a skill tool named
176
+ * after a framework auto-attach). `toolClaimants` below is what makes the
177
+ * second event possible: the list of who claimed a name, kept instead of
178
+ * collapsed to a winner. Pinned by `test/toolShadowing.test.ts`,
179
+ * `test/core/tools/offer-and-answer.test.ts` and epoch-laws 1(g).
167
180
  *
168
181
  * MCP does not add a seam of its OWN, and it is worth saying so because it
169
182
  * looks like it does: `mcpServe` builds `listing` and `byName` ONCE at
@@ -202,6 +215,16 @@ export function buildToolRegistry(registry, injections, options = {}) {
202
215
  // a shared Tool reference is genuinely declared by both skills, and a reader
203
216
  // asking "may this name be spoken?" needs both ids to answer.
204
217
  const declaringSkills = new Map();
218
+ // The claims (9.92.0), in the order the doc on `toolClaimants` states.
219
+ const claims = new Map();
220
+ const claim = (name, c) => {
221
+ const held = claims.get(name);
222
+ if (held === undefined)
223
+ claims.set(name, [c]);
224
+ else
225
+ held.push(c);
226
+ };
227
+ const skillClaims = [];
205
228
  for (const skill of skills) {
206
229
  const meta = skill.metadata;
207
230
  const isAutoActivate = meta?.autoActivate === 'currentSkill';
@@ -213,6 +236,10 @@ export function buildToolRegistry(registry, injections, options = {}) {
213
236
  declaringSkills.set(name, [skill.id]);
214
237
  else if (!declared.includes(skill.id))
215
238
  declared.push(skill.id);
239
+ skillClaims.push({
240
+ name,
241
+ claim: { channel: 'skill', id: skill.id, tool: tool },
242
+ });
216
243
  // Check EVERY skill tool — including autoActivate ones, which `continue`
217
244
  // below and never reach the static registry's gate. (This is the common
218
245
  // case: all of Neo's skills are autoActivate, so their scoped tools would
@@ -300,6 +327,22 @@ export function buildToolRegistry(registry, injections, options = {}) {
300
327
  }
301
328
  seenNames.add(entry.name);
302
329
  }
330
+ // Claims, in `toolClaimants` order: the augmentedRegistry holders first
331
+ // (registry, read_skill, present — every always-visible skill tool is a
332
+ // skill claim and lands in the next loop, in declaration order, which is
333
+ // the order `skillToolEntries` was pushed in), then every skill claim.
334
+ for (const e of registry) {
335
+ claim(e.name, {
336
+ channel: 'registry',
337
+ ...(e.tool.owner && { id: e.tool.owner.id }),
338
+ tool: e.tool,
339
+ });
340
+ }
341
+ for (const e of [...readSkillEntries, ...presentEntries]) {
342
+ claim(e.name, { channel: 'framework', tool: e.tool });
343
+ }
344
+ for (const { name, claim: c } of skillClaims)
345
+ claim(name, c);
303
346
  const registryByName = new Map(augmentedRegistry.map((e) => [e.name, e.tool]));
304
347
  // autoActivate skill tools live outside augmentedRegistry but MUST
305
348
  // be findable by name at dispatch time. Add them to the dispatch
@@ -329,9 +372,23 @@ export function buildToolRegistry(registry, injections, options = {}) {
329
372
  `name, and a same-named tool would silently take over the model's recorded skips. ` +
330
373
  `Rename your tool.`);
331
374
  }
332
- registryByName.set(SKIP_STEP_TOOL_NAME, buildSkipStepTool());
375
+ const skipStep = buildSkipStepTool();
376
+ registryByName.set(SKIP_STEP_TOOL_NAME, skipStep);
377
+ // The framework's own claim (9.92.0): a claimant like any other. It wins
378
+ // the wire only when no other party puts the name forward that epoch —
379
+ // the tools slot merges its schema LAST — and when a provider does, the
380
+ // provider's contract is what the model reads and the provider's tool is
381
+ // what answers; the procedure does not advance on a call whose contract
382
+ // the model read from somebody else (recorded-not-built, entry 3).
383
+ claim(SKIP_STEP_TOOL_NAME, { channel: 'framework', tool: skipStep });
333
384
  }
334
385
  const toolSchemas = augmentedRegistry.map((e) => e.tool.schema);
335
- return { augmentedRegistry, registryByName, toolSchemas, toolDeclaringSkills: declaringSkills };
386
+ return {
387
+ augmentedRegistry,
388
+ registryByName,
389
+ toolSchemas,
390
+ toolDeclaringSkills: declaringSkills,
391
+ toolClaimants: claims,
392
+ };
336
393
  }
337
394
  //# sourceMappingURL=buildToolRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildToolRegistry.js","sourceRoot":"","sources":["../../../../src/core/agent/buildToolRegistry.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,8FAA8F;AAC9F,+FAA+F;AAC/F,2CAA2C;AAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8KG;AAEH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,mBAAmB,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