agentfootprint 2.13.0 → 2.14.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 (117) hide show
  1. package/dist/adapters/llm/AnthropicProvider.js +69 -2
  2. package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
  3. package/dist/adapters/llm/BrowserAnthropicProvider.js +110 -2
  4. package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
  5. package/dist/core/Agent.js +47 -1
  6. package/dist/core/Agent.js.map +1 -1
  7. package/dist/core/agent/AgentBuilder.js +112 -1
  8. package/dist/core/agent/AgentBuilder.js.map +1 -1
  9. package/dist/core/agent/buildAgentChart.js +20 -1
  10. package/dist/core/agent/buildAgentChart.js.map +1 -1
  11. package/dist/core/agent/stages/callLLM.js +11 -0
  12. package/dist/core/agent/stages/callLLM.js.map +1 -1
  13. package/dist/core/agent/stages/prepareFinal.js +12 -1
  14. package/dist/core/agent/stages/prepareFinal.js.map +1 -1
  15. package/dist/core/agent/stages/seed.js +4 -0
  16. package/dist/core/agent/stages/seed.js.map +1 -1
  17. package/dist/core/agent/stages/toolCalls.js +7 -0
  18. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  19. package/dist/core/slots/buildThinkingSubflow.js +112 -0
  20. package/dist/core/slots/buildThinkingSubflow.js.map +1 -0
  21. package/dist/esm/adapters/llm/AnthropicProvider.js +69 -2
  22. package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
  23. package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +110 -2
  24. package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
  25. package/dist/esm/core/Agent.js +47 -1
  26. package/dist/esm/core/Agent.js.map +1 -1
  27. package/dist/esm/core/agent/AgentBuilder.js +112 -1
  28. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  29. package/dist/esm/core/agent/buildAgentChart.js +20 -1
  30. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  31. package/dist/esm/core/agent/stages/callLLM.js +11 -0
  32. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  33. package/dist/esm/core/agent/stages/prepareFinal.js +12 -1
  34. package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
  35. package/dist/esm/core/agent/stages/seed.js +4 -0
  36. package/dist/esm/core/agent/stages/seed.js.map +1 -1
  37. package/dist/esm/core/agent/stages/toolCalls.js +7 -0
  38. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  39. package/dist/esm/core/slots/buildThinkingSubflow.js +108 -0
  40. package/dist/esm/core/slots/buildThinkingSubflow.js.map +1 -0
  41. package/dist/esm/events/registry.js +6 -0
  42. package/dist/esm/events/registry.js.map +1 -1
  43. package/dist/esm/security/index.js +1 -0
  44. package/dist/esm/security/index.js.map +1 -1
  45. package/dist/esm/security/thinkingRedaction.js +66 -0
  46. package/dist/esm/security/thinkingRedaction.js.map +1 -0
  47. package/dist/esm/thinking/AnthropicThinkingHandler.js +111 -0
  48. package/dist/esm/thinking/AnthropicThinkingHandler.js.map +1 -0
  49. package/dist/esm/thinking/MockThinkingHandler.js +94 -0
  50. package/dist/esm/thinking/MockThinkingHandler.js.map +1 -0
  51. package/dist/esm/thinking/OpenAIThinkingHandler.js +72 -0
  52. package/dist/esm/thinking/OpenAIThinkingHandler.js.map +1 -0
  53. package/dist/esm/thinking/index.js +51 -0
  54. package/dist/esm/thinking/index.js.map +1 -0
  55. package/dist/esm/thinking/registry.js +46 -0
  56. package/dist/esm/thinking/registry.js.map +1 -0
  57. package/dist/esm/thinking/types.js +30 -0
  58. package/dist/esm/thinking/types.js.map +1 -0
  59. package/dist/events/registry.js +6 -0
  60. package/dist/events/registry.js.map +1 -1
  61. package/dist/security/index.js +4 -1
  62. package/dist/security/index.js.map +1 -1
  63. package/dist/security/thinkingRedaction.js +70 -0
  64. package/dist/security/thinkingRedaction.js.map +1 -0
  65. package/dist/thinking/AnthropicThinkingHandler.js +114 -0
  66. package/dist/thinking/AnthropicThinkingHandler.js.map +1 -0
  67. package/dist/thinking/MockThinkingHandler.js +99 -0
  68. package/dist/thinking/MockThinkingHandler.js.map +1 -0
  69. package/dist/thinking/OpenAIThinkingHandler.js +75 -0
  70. package/dist/thinking/OpenAIThinkingHandler.js.map +1 -0
  71. package/dist/thinking/index.js +61 -0
  72. package/dist/thinking/index.js.map +1 -0
  73. package/dist/thinking/registry.js +50 -0
  74. package/dist/thinking/registry.js.map +1 -0
  75. package/dist/thinking/types.js +31 -0
  76. package/dist/thinking/types.js.map +1 -0
  77. package/dist/types/adapters/llm/AnthropicProvider.d.ts +11 -0
  78. package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
  79. package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
  80. package/dist/types/adapters/types.d.ts +97 -0
  81. package/dist/types/adapters/types.d.ts.map +1 -1
  82. package/dist/types/core/Agent.d.ts +16 -1
  83. package/dist/types/core/Agent.d.ts.map +1 -1
  84. package/dist/types/core/agent/AgentBuilder.d.ts +99 -0
  85. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
  86. package/dist/types/core/agent/buildAgentChart.d.ts +8 -0
  87. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  88. package/dist/types/core/agent/stages/callLLM.d.ts +4 -0
  89. package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
  90. package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
  91. package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
  92. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  93. package/dist/types/core/agent/types.d.ts +12 -0
  94. package/dist/types/core/agent/types.d.ts.map +1 -1
  95. package/dist/types/core/slots/buildThinkingSubflow.d.ts +41 -0
  96. package/dist/types/core/slots/buildThinkingSubflow.d.ts.map +1 -0
  97. package/dist/types/events/payloads.d.ts +100 -0
  98. package/dist/types/events/payloads.d.ts.map +1 -1
  99. package/dist/types/events/registry.d.ts +7 -1
  100. package/dist/types/events/registry.d.ts.map +1 -1
  101. package/dist/types/security/index.d.ts +1 -0
  102. package/dist/types/security/index.d.ts.map +1 -1
  103. package/dist/types/security/thinkingRedaction.d.ts +51 -0
  104. package/dist/types/security/thinkingRedaction.d.ts.map +1 -0
  105. package/dist/types/thinking/AnthropicThinkingHandler.d.ts +43 -0
  106. package/dist/types/thinking/AnthropicThinkingHandler.d.ts.map +1 -0
  107. package/dist/types/thinking/MockThinkingHandler.d.ts +51 -0
  108. package/dist/types/thinking/MockThinkingHandler.d.ts.map +1 -0
  109. package/dist/types/thinking/OpenAIThinkingHandler.d.ts +38 -0
  110. package/dist/types/thinking/OpenAIThinkingHandler.d.ts.map +1 -0
  111. package/dist/types/thinking/index.d.ts +52 -0
  112. package/dist/types/thinking/index.d.ts.map +1 -0
  113. package/dist/types/thinking/registry.d.ts +34 -0
  114. package/dist/types/thinking/registry.d.ts.map +1 -0
  115. package/dist/types/thinking/types.d.ts +163 -0
  116. package/dist/types/thinking/types.d.ts.map +1 -0
  117. package/package.json +6 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,wCAAwC,EACxC,wBAAwB,EACxB,aAAa,EACb,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,yBAAyB,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,EAAE,2BAA2B,CAClE,uCAAuC,EACvC,2BAA2B,CAC5B,CAAC;IAEF,8BAA8B,EAAE,2BAA2B,CACzD,8BAA8B,EAC9B,mBAAmB,CACpB,CAAC;IACF,gCAAgC,EAAE,2BAA2B,CAC3D,gCAAgC,EAChC,qBAAqB,CACtB,CAAC;IACF,4BAA4B,EAAE,2BAA2B,CACvD,4BAA4B,EAC5B,iBAAiB,CAClB,CAAC;IAEF,8BAA8B,EAAE,2BAA2B,CACzD,8BAA8B,EAC9B,mBAAmB,CACpB,CAAC;IACF,6BAA6B,EAAE,2BAA2B,CACxD,6BAA6B,EAC7B,kBAAkB,CACnB,CAAC;IAEF,oCAAoC,EAAE,2BAA2B,CAC/D,oCAAoC,EACpC,yBAAyB,CAC1B,CAAC;CACH;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,sBAAsB,CAAC,CAAC;AAEvF,yEAAyE;AACzE,MAAM,MAAM,uBAAuB,GAAG,MAAM,sBAAsB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,uBAAuB,EAqDpD,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,wCAAwC,EACxC,+BAA+B,EAC/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B,kBAAkB,CACnB,CAAC;IACF,mCAAmC,EAAE,2BAA2B,CAC9D,mCAAmC,EACnC,wBAAwB,CACzB,CAAC;IAEF,0BAA0B,EAAE,2BAA2B,CACrD,0BAA0B,EAC1B,eAAe,CAChB,CAAC;IACF,+BAA+B,EAAE,2BAA2B,CAC1D,+BAA+B,EAC/B,mBAAmB,CACpB,CAAC;IAEF,2BAA2B,EAAE,2BAA2B,CACtD,2BAA2B,EAC3B,gBAAgB,CACjB,CAAC;IACF,uCAAuC,EAAE,2BAA2B,CAClE,uCAAuC,EACvC,2BAA2B,CAC5B,CAAC;IAEF,8BAA8B,EAAE,2BAA2B,CACzD,8BAA8B,EAC9B,mBAAmB,CACpB,CAAC;IACF,gCAAgC,EAAE,2BAA2B,CAC3D,gCAAgC,EAChC,qBAAqB,CACtB,CAAC;IACF,4BAA4B,EAAE,2BAA2B,CACvD,4BAA4B,EAC5B,iBAAiB,CAClB,CAAC;IAEF,8BAA8B,EAAE,2BAA2B,CACzD,8BAA8B,EAC9B,mBAAmB,CACpB,CAAC;IACF,6BAA6B,EAAE,2BAA2B,CACxD,6BAA6B,EAC7B,kBAAkB,CACnB,CAAC;IAEF,oCAAoC,EAAE,2BAA2B,CAC/D,oCAAoC,EACpC,yBAAyB,CAC1B,CAAC;CACH;AAED,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,sBAAsB,CAAC,CAAC;AAEvF,yEAAyE;AACzE,MAAM,MAAM,uBAAuB,GAAG,MAAM,sBAAsB,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,uBAAuB,EAwDpD,CAAC"}
@@ -40,5 +40,6 @@ export { PolicyHaltError } from './PolicyHaltError.js';
40
40
  export type { PolicyHaltContext } from './PolicyHaltError.js';
41
41
  export { extractSequence, SYNTHETIC_DENY_PREFIX } from './extractSequence.js';
42
42
  export type { ExtractSequenceOptions } from './extractSequence.js';
43
+ export { redactThinkingBlocks, REDACTED_PLACEHOLDER } from './thinkingRedaction.js';
43
44
  export type { PermissionChecker, PermissionRequest, PermissionDecision, ToolCallEntry, ToolResultContent, } from '../adapters/types.js';
44
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/security/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAMnE,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/security/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAMpF,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * thinkingRedaction — content scrubbing for ThinkingBlock[] before
3
+ * persistence + audit-log adapters fire.
4
+ *
5
+ * Pattern: Pure function. Same shape as the v2.4 RedactionPolicy.scope-
6
+ * patterns / emit-patterns helpers — regex match + replace.
7
+ *
8
+ * Mental model — TWO-LAYER persistence:
9
+ * - LLMMessage.thinkingBlocks IS persisted to scope.history (required
10
+ * for Anthropic signature round-trip).
11
+ * - Audit-log adapters (CloudWatch, Datadog OTel, etc.) read from
12
+ * scope.history. Sensitive reasoning (PII in chain-of-thought,
13
+ * internal IDs the model worked through) lands there too.
14
+ * - This helper scrubs content patterns BEFORE the assistant message
15
+ * pushes to scope.history, so the audit-log surface only sees
16
+ * redacted content while the LLM still sees the unredacted reasoning
17
+ * for round-trip integrity.
18
+ *
19
+ * The signature field is NEVER touched by redaction — Anthropic's
20
+ * server-side signature is bound to the original content; modifying
21
+ * content here would invalidate the signature. Resolution: signature
22
+ * survives byte-exact, content gets scrubbed. This means the Anthropic
23
+ * API will reject the next turn IF the consumer wired thinkingPatterns
24
+ * AND uses Anthropic with extended-thinking-plus-tools. Document.
25
+ *
26
+ * Recommended use:
27
+ * - DON'T wire thinkingPatterns when using Anthropic extended thinking
28
+ * + tool calls (signature breaks).
29
+ * - DO wire thinkingPatterns when using OpenAI o1/o3 (no signature,
30
+ * no round-trip requirement) or for offline log scrubbing.
31
+ * - For Anthropic + sensitive reasoning, prefer audit-log-side
32
+ * redaction (filter in your CloudWatch / Datadog adapter rather
33
+ * than the framework's persistence point).
34
+ */
35
+ import type { ThinkingBlock } from '../thinking/types.js';
36
+ /** Sentinel string used in place of redacted content. */
37
+ export declare const REDACTED_PLACEHOLDER = "[REDACTED]";
38
+ /**
39
+ * Return a copy of `blocks` with each block's `content` field scrubbed
40
+ * by every pattern in `patterns`. Returns the input array unchanged
41
+ * when `patterns` is undefined, empty, or no block content matches.
42
+ *
43
+ * Signature + summary + providerMeta fields are preserved BYTE-EXACT
44
+ * — only `content` is touched.
45
+ *
46
+ * Anthropic signature warning: scrubbing content invalidates the
47
+ * Anthropic server-side signature. Round-trip will fail with HTTP 400
48
+ * on the next turn. Document this in the consumer recipe.
49
+ */
50
+ export declare function redactThinkingBlocks(blocks: readonly ThinkingBlock[], patterns: readonly RegExp[] | undefined): readonly ThinkingBlock[];
51
+ //# sourceMappingURL=thinkingRedaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinkingRedaction.d.ts","sourceRoot":"","sources":["../../../src/security/thinkingRedaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACtC,SAAS,aAAa,EAAE,CAe1B"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * AnthropicThinkingHandler — normalizes Anthropic's extended-thinking
3
+ * response shape into the framework's `ThinkingBlock[]` contract.
4
+ *
5
+ * Anthropic emits thinking via blocks in `response.content`:
6
+ *
7
+ * ```ts
8
+ * { type: 'thinking', thinking: 'reasoning text', signature: 'opaque-base64' }
9
+ * { type: 'redacted_thinking', signature: 'opaque-base64' }
10
+ * { type: 'text', text: 'visible content' }
11
+ * { type: 'tool_use', id, name, input }
12
+ * ```
13
+ *
14
+ * The handler filters for `'thinking'` + `'redacted_thinking'` blocks,
15
+ * preserves the `signature` field BYTE-EXACT (Anthropic validates
16
+ * signatures server-side on the next turn — any modification = HTTP 400),
17
+ * and ignores other block types (visible text + tool calls flow through
18
+ * the existing `LLMResponse.content` / `LLMResponse.toolCalls` paths).
19
+ *
20
+ * **Critical invariant:** signature pass-through is byte-exact. The
21
+ * handler MUST NOT trim, normalize encoding, JSON-roundtrip, or
22
+ * otherwise touch the signature string. Tests verify this explicitly.
23
+ *
24
+ * **Three input shapes** Anthropic produces (per Phase 4a panel review):
25
+ * 1. Non-streaming response: full `response.content` array
26
+ * 2. Streaming aggregated: AnthropicProvider accumulates chunks +
27
+ * calls handler with the same array shape
28
+ * 3. Bedrock-via-Anthropic: deferred to Phase 5+ (separate handler
29
+ * or extension of this one)
30
+ *
31
+ * Streaming + non-streaming converge on shape #1 because the provider
32
+ * handles the distinction — handler only sees the assembled content
33
+ * array.
34
+ *
35
+ * **`parseChunk` is OPTIONAL** — Phase 3's framework path populates
36
+ * `LLMChunk.thinkingDelta` from inside AnthropicProvider's `stream()`
37
+ * directly, bypassing handler.parseChunk. We still implement it for
38
+ * consumer integrations that want to use the handler on raw Anthropic
39
+ * chunks directly (e.g., custom transports).
40
+ */
41
+ import type { ThinkingHandler } from './types.js';
42
+ export declare const anthropicThinkingHandler: ThinkingHandler;
43
+ //# sourceMappingURL=AnthropicThinkingHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnthropicThinkingHandler.d.ts","sourceRoot":"","sources":["../../../src/thinking/AnthropicThinkingHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,YAAY,CAAC;AAqDjE,eAAO,MAAM,wBAAwB,EAAE,eAwDtC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * MockThinkingHandler — canonical example for the v2.14 ThinkingHandler
3
+ * contract. Used by:
4
+ *
5
+ * 1. Tests — drives the shared contract test (every shipped handler
6
+ * MUST satisfy the same invariants this mock demonstrates).
7
+ * 2. Future provider authors — reference implementation showing how
8
+ * to handle BOTH Anthropic-shape inputs (signed blocks, possibly
9
+ * redacted) and OpenAI-shape inputs (multi-block summary). The
10
+ * pattern of "discriminate by shape, normalize each branch" is
11
+ * reusable across providers.
12
+ * 3. The MockProvider for end-to-end tests of the framework wiring
13
+ * without depending on a real LLM SDK.
14
+ *
15
+ * Defaults are deliberately sensitive-data-free — no fake PII, no
16
+ * fake-signature material that could be confused for real cryptography,
17
+ * no internal-looking IDs. Sets the example for consumer-authored
18
+ * handlers.
19
+ */
20
+ import type { ThinkingHandler } from './types.js';
21
+ /** Shape the mock recognizes for Anthropic-style raw inputs. */
22
+ interface MockAnthropicRaw {
23
+ readonly kind: 'anthropic';
24
+ readonly blocks: ReadonlyArray<{
25
+ readonly type: 'thinking' | 'redacted_thinking';
26
+ readonly thinking?: string;
27
+ readonly signature?: string;
28
+ }>;
29
+ }
30
+ /** Shape the mock recognizes for OpenAI-style raw inputs. */
31
+ interface MockOpenAIRaw {
32
+ readonly kind: 'openai';
33
+ readonly summarySteps: readonly string[];
34
+ }
35
+ /**
36
+ * Build an Anthropic-style raw input for tests. Signature is a marker
37
+ * string — real Anthropic signatures are opaque base64.
38
+ */
39
+ export declare function mockAnthropicRaw(blocks: readonly {
40
+ content: string;
41
+ signature?: string;
42
+ redacted?: boolean;
43
+ }[]): MockAnthropicRaw;
44
+ /**
45
+ * Build an OpenAI-style raw input for tests — one summary step per
46
+ * string. Each step becomes a separate ThinkingBlock with `summary: true`.
47
+ */
48
+ export declare function mockOpenAIRaw(summarySteps: readonly string[]): MockOpenAIRaw;
49
+ export declare const mockThinkingHandler: ThinkingHandler;
50
+ export {};
51
+ //# sourceMappingURL=MockThinkingHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockThinkingHandler.d.ts","sourceRoot":"","sources":["../../../src/thinking/MockThinkingHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,gEAAgE;AAChE,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;QAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,mBAAmB,CAAC;QAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC,CAAC;CACJ;AAED,6DAA6D;AAC7D,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GAC7E,gBAAgB,CASlB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,CAE5E;AAED,eAAO,MAAM,mBAAmB,EAAE,eA0CjC,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * OpenAIThinkingHandler — normalizes OpenAI's o1/o3 reasoning_summary
3
+ * structured output into the framework's `ThinkingBlock[]` contract.
4
+ *
5
+ * OpenAI's reasoning_summary shape varies by model + API version:
6
+ *
7
+ * 1. Older o1 format — simple string:
8
+ * "I worked through the problem by first..."
9
+ *
10
+ * 2. Newer o3+ structured — array of summary items:
11
+ * [
12
+ * { type: 'summary_text', text: 'Identify the user request' },
13
+ * { type: 'summary_text', text: 'Choose appropriate tool' },
14
+ * ]
15
+ *
16
+ * 3. Missing entirely — most calls (gpt-4o, or o1/o3 without
17
+ * reasoning_summary param requested) → undefined raw input
18
+ *
19
+ * Handler dispatches on shape; output is `ThinkingBlock[]` with
20
+ * `summary: true` per Phase 1 contract — distinguishes structured-
21
+ * summary blocks from raw thinking content (Anthropic's shape).
22
+ *
23
+ * **No signature** — OpenAI doesn't sign reasoning. The output's
24
+ * `signature` field stays undefined. No round-trip integrity invariant
25
+ * (unlike Anthropic).
26
+ *
27
+ * **No `parseChunk`** — OpenAI doesn't stream reasoning content as of
28
+ * early 2026. Reasoning arrives only on the terminal response. Per
29
+ * Phase 1 design, `parseChunk` is optional; we omit entirely.
30
+ *
31
+ * **No `usage.thinking` computation** — reasoning_tokens lives on
32
+ * `response.usage.completion_tokens_details.reasoning_tokens` and is
33
+ * the OpenAIProvider's job to surface (deferred). Handler doesn't
34
+ * compute token counts.
35
+ */
36
+ import type { ThinkingHandler } from './types.js';
37
+ export declare const openAIThinkingHandler: ThinkingHandler;
38
+ //# sourceMappingURL=OpenAIThinkingHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAIThinkingHandler.d.ts","sourceRoot":"","sources":["../../../src/thinking/OpenAIThinkingHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,YAAY,CAAC;AAcjE,eAAO,MAAM,qBAAqB,EAAE,eAoCnC,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * agentfootprint/thinking — extended-thinking subsystem (v2.14+).
3
+ *
4
+ * **Two-layer architecture:**
5
+ *
6
+ * • CONSUMER-FACING: `ThinkingHandler` — simple function-pair
7
+ * implemented by provider authors.
8
+ * • FRAMEWORK-INTERNAL: each handler is auto-wrapped in a real
9
+ * footprintjs subflow at chart build time;
10
+ * shows in trace as own runtimeStageId.
11
+ *
12
+ * **Auto-wire by provider name:**
13
+ *
14
+ * ```ts
15
+ * import { Agent } from 'agentfootprint';
16
+ *
17
+ * // Library scans SHIPPED_THINKING_HANDLERS, finds the handler
18
+ * // whose providerNames includes provider.name. Mounted as a
19
+ * // sub-subflow of sf-call-llm.
20
+ * const agent = Agent.create({ provider: anthropic({...}), model: '...' })
21
+ * .build();
22
+ *
23
+ * // Opt out:
24
+ * // .thinkingHandler(undefined)
25
+ * // Override with a custom handler:
26
+ * // .thinkingHandler(myCustomHandler)
27
+ * ```
28
+ *
29
+ * **Custom handlers:**
30
+ *
31
+ * ```ts
32
+ * import { type ThinkingHandler } from 'agentfootprint/thinking';
33
+ *
34
+ * export const geminiThinkingHandler: ThinkingHandler = {
35
+ * id: 'gemini',
36
+ * providerNames: ['gemini'],
37
+ * normalize(raw) { ... },
38
+ * parseChunk(chunk) { ... }, // optional
39
+ * };
40
+ * ```
41
+ *
42
+ * Failure isolation: handler `normalize()` throws are caught by the
43
+ * framework — emit `agentfootprint.agent.thinking_parse_failed`, drop
44
+ * the blocks, continue. Same graceful pattern as v2.11.6
45
+ * `tools.discovery_failed`.
46
+ */
47
+ export type { ThinkingBlock, ThinkingHandler } from './types.js';
48
+ export { mockThinkingHandler, mockAnthropicRaw, mockOpenAIRaw } from './MockThinkingHandler.js';
49
+ export { anthropicThinkingHandler } from './AnthropicThinkingHandler.js';
50
+ export { openAIThinkingHandler } from './OpenAIThinkingHandler.js';
51
+ export { SHIPPED_THINKING_HANDLERS, findThinkingHandler } from './registry.js';
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/thinking/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Registry — single source of truth for the framework's auto-wire
3
+ * logic AND the shared contract test.
4
+ *
5
+ * Phase 3 wiring scans this array at chart build time and selects the
6
+ * first handler whose `providerNames` includes the active
7
+ * `provider.name`. Phase 4a adds AnthropicThinkingHandler; Phase 5
8
+ * adds OpenAIThinkingHandler — append-only as new providers ship.
9
+ *
10
+ * Future provider authors:
11
+ * • Implement `ThinkingHandler` for your provider
12
+ * • Append to this array
13
+ * • The shared contract test in `test/thinking/contract.test.ts`
14
+ * verifies your handler honors the framework's invariants
15
+ */
16
+ import type { ThinkingHandler } from './types.js';
17
+ /**
18
+ * All thinking handlers shipped with the library. Append in alphabetical
19
+ * order (by `id`) so diffs stay readable as new handlers land.
20
+ */
21
+ export declare const SHIPPED_THINKING_HANDLERS: readonly ThinkingHandler[];
22
+ /**
23
+ * Look up a handler by `provider.name`. Returns the first match in
24
+ * `SHIPPED_THINKING_HANDLERS`. Returns `undefined` when no handler
25
+ * matches — framework treats this as "no thinking support for this
26
+ * provider", which is the correct default for providers that don't
27
+ * emit thinking content (gpt-3.5, mistral, etc.).
28
+ *
29
+ * Used by:
30
+ * • Phase 3 framework auto-wire (chart build time)
31
+ * • Tests verifying registry lookup
32
+ */
33
+ export declare function findThinkingHandler(providerName: string): ThinkingHandler | undefined;
34
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/thinking/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,eAAe,EAI/D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAKrF"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Thinking — public types for the v2.14 extended-thinking subsystem.
3
+ *
4
+ * Mental model — TWO-LAYER architecture:
5
+ *
6
+ * • CONSUMER-FACING: `ThinkingHandler` — a simple function-pair
7
+ * (id, providerNames, normalize, parseChunk?).
8
+ * Provider authors and custom-LLM consumers
9
+ * implement THIS shape.
10
+ *
11
+ * • FRAMEWORK-INTERNAL: each `ThinkingHandler` is auto-wrapped in a
12
+ * real footprintjs subflow at chart build time.
13
+ * The subflow gets its own `runtimeStageId`,
14
+ * narrative entry, and InOutRecorder boundary
15
+ * — full trace observability for free without
16
+ * the consumer writing flowchart code.
17
+ *
18
+ * Same pattern as how consumers write a `Tool` and the framework wraps
19
+ * dispatch in a tool-call subflow, or how consumers write a
20
+ * `ToolProvider` and the framework wraps `list()` in the Tools slot
21
+ * subflow.
22
+ *
23
+ * @see SHIPPED_THINKING_HANDLERS for the registry the framework uses
24
+ * to auto-wire by `provider.name` (Phase 3 wiring).
25
+ * @see MockThinkingHandler for the canonical example demonstrating
26
+ * both Anthropic-shape (signed blocks) and OpenAI-shape (multi-
27
+ * block summary) inputs.
28
+ */
29
+ /**
30
+ * One thinking block from an LLM response, normalized into a provider-
31
+ * agnostic shape. A response may contain multiple blocks (e.g. OpenAI's
32
+ * structured reasoning_summary emits one block per summary step).
33
+ *
34
+ * Discriminator `type`:
35
+ * - `'thinking'` — content is the model's reasoning
36
+ * - `'redacted_thinking'` — Anthropic emits this when reasoning
37
+ * trips a safety filter; content is
38
+ * EMPTY but `signature` is still required
39
+ * for round-trip on the next turn
40
+ */
41
+ export interface ThinkingBlock {
42
+ /**
43
+ * Block type discriminator. Required so consumers can distinguish
44
+ * normal thinking blocks from server-redacted ones (Anthropic-only
45
+ * today; other providers may produce only `'thinking'`).
46
+ */
47
+ readonly type: 'thinking' | 'redacted_thinking';
48
+ /**
49
+ * Reasoning content as plain text. EMPTY string when `type ===
50
+ * 'redacted_thinking'` (the model's reasoning was redacted by the
51
+ * provider's safety layer; only the signature remains).
52
+ */
53
+ readonly content: string;
54
+ /**
55
+ * Provider cryptographic signature for round-trip integrity.
56
+ *
57
+ * **Anthropic:** REQUIRED for any block emitted in a response that
58
+ * also contained tool_use. The signed block MUST be echoed
59
+ * byte-exact in the assistant message of subsequent tool_result
60
+ * turns — Anthropic validates the signature server-side and rejects
61
+ * (HTTP 400) requests where signed blocks are missing or modified.
62
+ *
63
+ * **OpenAI:** not used (their reasoning_summary doesn't sign blocks).
64
+ *
65
+ * **Future providers:** opaque to the framework; preserved as-is.
66
+ *
67
+ * The framework persists this field in `scope.history` so the
68
+ * provider's serialization layer (Phase 4b) can echo it back on the
69
+ * next request.
70
+ */
71
+ readonly signature?: string;
72
+ /**
73
+ * `true` when this block is a structured-summary step rather than
74
+ * raw thinking content. Set by `OpenAIThinkingHandler` for each step
75
+ * of `reasoning_summary`; never set by Anthropic. Consumers
76
+ * displaying thinking can render summary blocks differently
77
+ * (e.g. as numbered steps) from raw blocks (continuous prose).
78
+ */
79
+ readonly summary?: boolean;
80
+ /**
81
+ * Provider-specific metadata escape hatch for fields the normalized
82
+ * shape doesn't model.
83
+ *
84
+ * **ANTI-PATTERN:** providers MUST NOT include sensitive raw data
85
+ * here (PII, internal IDs, request tokens, customer data). Use the
86
+ * dedicated `signature` field for cryptographic material; nothing
87
+ * else identity-bearing. The framework excludes `providerMeta` from
88
+ * `getNarrative()` by default to avoid accidental audit-log leakage.
89
+ */
90
+ readonly providerMeta?: Readonly<Record<string, unknown>>;
91
+ }
92
+ /**
93
+ * The consumer-facing contract for thinking normalization. Provider
94
+ * authors and custom-LLM consumers implement this shape; the framework
95
+ * auto-wraps each handler in a real footprintjs subflow at chart build
96
+ * time so the trace shows it as a discrete `runtimeStageId` (e.g.
97
+ * `sf-call-llm/thinking-{id}#5`).
98
+ *
99
+ * The framework matches handlers to providers by `providerNames` —
100
+ * the first handler whose `providerNames` includes the active
101
+ * `provider.name` is auto-wired. Override per-agent via
102
+ * `.thinkingHandler(customHandler)` (Phase 3 wiring).
103
+ */
104
+ export interface ThinkingHandler {
105
+ /**
106
+ * Stable identifier used for `runtimeStageId`, telemetry, narrative
107
+ * entries, and the `agentfootprint.agent.thinking_parse_failed` event
108
+ * payload's `subflowId` field. Convention: lowercase + dash, e.g.
109
+ * `'anthropic'`, `'openai'`, `'mock'`.
110
+ */
111
+ readonly id: string;
112
+ /**
113
+ * Provider names this handler matches for auto-wire. The framework
114
+ * scans `SHIPPED_THINKING_HANDLERS` at chart build time and selects
115
+ * the first handler whose `providerNames` contains the active
116
+ * `provider.name`. Most handlers list one name; Bedrock-via-Anthropic
117
+ * style handlers may list multiple.
118
+ */
119
+ readonly providerNames: readonly string[];
120
+ /**
121
+ * Pure: raw provider data → normalized blocks.
122
+ *
123
+ * The framework wraps this call in a try/catch — throwing from
124
+ * `normalize()` does NOT abort the agent run. Instead the framework
125
+ * emits `agentfootprint.agent.thinking_parse_failed`, drops the
126
+ * thinking blocks (LLMMessage.thinkingBlocks remains undefined),
127
+ * and continues. Same graceful-failure pattern as v2.11.6
128
+ * `tools.discovery_failed`.
129
+ *
130
+ * Sync only in v2.14. Future widening to Promise return is a
131
+ * separate decision once a real consumer needs network-backed
132
+ * normalization.
133
+ *
134
+ * @param raw Provider-specific raw data — typically pulled from
135
+ * `LLMResponse.providerRef`. Handler is responsible for
136
+ * shape-checking; framework passes whatever the provider
137
+ * stashed.
138
+ * @returns Normalized blocks in the order they appeared in the
139
+ * response. Empty array when no thinking is present
140
+ * (preferred over `undefined` for type stability).
141
+ */
142
+ normalize(raw: unknown): readonly ThinkingBlock[];
143
+ /**
144
+ * Optional streaming hot-path. When provided AND the provider streams,
145
+ * the framework calls `parseChunk(chunk)` per provider chunk and
146
+ * emits `agentfootprint.stream.thinking_delta` events for any
147
+ * `thinkingDelta` returned. Handlers without streaming support omit
148
+ * this field; the framework still calls `normalize()` on the
149
+ * response's terminal `LLMResponse.providerRef`.
150
+ *
151
+ * @param chunk Provider-specific chunk shape (Anthropic emits
152
+ * `content_block_delta` events; OpenAI doesn't yet
153
+ * stream reasoning content).
154
+ * @returns Object with optional `thinkingDelta` text — when set,
155
+ * framework fires `stream.thinking_delta` event with the
156
+ * content. Return `{}` (or omit) for chunks that contain
157
+ * no thinking content.
158
+ */
159
+ parseChunk?(chunk: unknown): {
160
+ thinkingDelta?: string;
161
+ };
162
+ }
163
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/thinking/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,mBAAmB,CAAC;IAEhD;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC3D;AAID;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,aAAa,EAAE,CAAC;IAElD;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentfootprint",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "The explainable agent framework — build AI agents you can explain, audit, and trust. Built on footprintjs.",
5
5
  "license": "MIT",
6
6
  "author": "Sanjay Krishna Anbalagan",
@@ -159,6 +159,11 @@
159
159
  "import": "./dist/esm/reliability/index.js",
160
160
  "require": "./dist/reliability/index.js"
161
161
  },
162
+ "./thinking": {
163
+ "types": "./dist/types/thinking/index.d.ts",
164
+ "import": "./dist/esm/thinking/index.js",
165
+ "require": "./dist/thinking/index.js"
166
+ },
162
167
  "./locales": {
163
168
  "types": "./dist/types/locales/index.d.ts",
164
169
  "import": "./dist/esm/locales/index.js",