agentfootprint 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +2 -1
- package/dist/adapters/llm/AnthropicProvider.js +5 -4
- package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/BedrockProvider.js +5 -4
- package/dist/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/adapters/llm/BrowserAnthropicProvider.js +5 -4
- package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/adapters/llm/BrowserOpenAIProvider.js +13 -10
- package/dist/adapters/llm/BrowserOpenAIProvider.js.map +1 -1
- package/dist/adapters/llm/OpenAIProvider.js +8 -6
- package/dist/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/core/Agent.js +10 -0
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/LLMCall.js +10 -1
- package/dist/core/LLMCall.js.map +1 -1
- package/dist/core/RunnerBase.js +42 -12
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +7 -3
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildAgentMessageApiChart.js +18 -1
- package/dist/core/agent/buildAgentMessageApiChart.js.map +1 -1
- package/dist/core/agent/buildMessageApiChart.js +4 -1
- package/dist/core/agent/buildMessageApiChart.js.map +1 -1
- package/dist/core/agent/stages/callLLM.js +18 -2
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core-flow/Parallel.js +9 -1
- package/dist/core-flow/Parallel.js.map +1 -1
- package/dist/esm/adapters/llm/AnthropicProvider.d.ts +3 -3
- package/dist/esm/adapters/llm/AnthropicProvider.js +5 -4
- package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BedrockProvider.d.ts +3 -3
- package/dist/esm/adapters/llm/BedrockProvider.js +5 -4
- package/dist/esm/adapters/llm/BedrockProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +3 -3
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +5 -4
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
- package/dist/esm/adapters/llm/BrowserOpenAIProvider.d.ts +5 -5
- package/dist/esm/adapters/llm/BrowserOpenAIProvider.js +13 -10
- package/dist/esm/adapters/llm/BrowserOpenAIProvider.js.map +1 -1
- package/dist/esm/adapters/llm/OpenAIProvider.d.ts +3 -3
- package/dist/esm/adapters/llm/OpenAIProvider.js +8 -6
- package/dist/esm/adapters/llm/OpenAIProvider.js.map +1 -1
- package/dist/esm/adapters/types.d.ts +95 -2
- package/dist/esm/core/Agent.js +10 -0
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/LLMCall.js +10 -1
- package/dist/esm/core/LLMCall.js.map +1 -1
- package/dist/esm/core/RunnerBase.d.ts +22 -1
- package/dist/esm/core/RunnerBase.js +42 -12
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.d.ts +7 -3
- package/dist/esm/core/agent/buildAgentChart.js +7 -3
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildAgentMessageApiChart.js +18 -1
- package/dist/esm/core/agent/buildAgentMessageApiChart.js.map +1 -1
- package/dist/esm/core/agent/buildMessageApiChart.js +4 -1
- package/dist/esm/core/agent/buildMessageApiChart.js.map +1 -1
- package/dist/esm/core/agent/stages/callLLM.js +18 -2
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/runner.d.ts +40 -5
- package/dist/esm/core-flow/Parallel.js +9 -1
- package/dist/esm/core-flow/Parallel.js.map +1 -1
- package/dist/esm/index.js +9 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/types.d.ts +9 -0
- package/dist/esm/lib/context-bisect/types.js.map +1 -1
- package/dist/esm/lib/recorded-chat/recordedChat.js +10 -1
- package/dist/esm/lib/recorded-chat/recordedChat.js.map +1 -1
- package/dist/esm/lib/recorded-chat/types.d.ts +10 -0
- package/dist/esm/observe.d.ts +3 -1
- package/dist/esm/observe.js +13 -1
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/providers.d.ts +1 -1
- package/dist/esm/recorders/core/EmitBridge.d.ts +9 -3
- package/dist/esm/recorders/core/EmitBridge.js +4 -3
- package/dist/esm/recorders/core/EmitBridge.js.map +1 -1
- package/dist/esm/recorders/core/ResilienceRecorder.d.ts +32 -0
- package/dist/esm/recorders/core/ResilienceRecorder.js +41 -0
- package/dist/esm/recorders/core/ResilienceRecorder.js.map +1 -0
- package/dist/esm/recorders/core/resilienceHooks.d.ts +34 -0
- package/dist/esm/recorders/core/resilienceHooks.js +74 -0
- package/dist/esm/recorders/core/resilienceHooks.js.map +1 -0
- package/dist/esm/recorders/core/typedEmit.d.ts +1 -2
- package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +176 -12
- package/dist/esm/recorders/observability/BoundaryRecorder.js +119 -8
- package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +13 -2
- package/dist/esm/recorders/observability/FlowchartRecorder.js +14 -3
- package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/localObservability.d.ts +66 -6
- package/dist/esm/recorders/observability/localObservability.js +27 -7
- package/dist/esm/recorders/observability/localObservability.js.map +1 -1
- package/dist/esm/recorders/observability/recordRun.d.ts +143 -0
- package/dist/esm/recorders/observability/recordRun.js +133 -0
- package/dist/esm/recorders/observability/recordRun.js.map +1 -0
- package/dist/esm/recorders/observability/trace.d.ts +65 -13
- package/dist/esm/recorders/observability/trace.js +36 -9
- package/dist/esm/recorders/observability/trace.js.map +1 -1
- package/dist/esm/reliability/buildReliabilityGateChart.d.ts +23 -9
- package/dist/esm/reliability/buildReliabilityGateChart.js +37 -10
- package/dist/esm/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/esm/resilience/withCircuitBreaker.d.ts +15 -5
- package/dist/esm/resilience/withCircuitBreaker.js +14 -7
- package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/esm/resilience/withFallback.d.ts +7 -1
- package/dist/esm/resilience/withFallback.js +30 -11
- package/dist/esm/resilience/withFallback.js.map +1 -1
- package/dist/esm/resilience/withRetry.d.ts +10 -5
- package/dist/esm/resilience/withRetry.js +53 -3
- package/dist/esm/resilience/withRetry.js.map +1 -1
- package/dist/esm/tool-providers/index.js +2 -2
- package/dist/esm/tool-providers/index.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/context-bisect/types.js.map +1 -1
- package/dist/lib/recorded-chat/recordedChat.js +10 -1
- package/dist/lib/recorded-chat/recordedChat.js.map +1 -1
- package/dist/observe.js +16 -2
- package/dist/observe.js.map +1 -1
- package/dist/recorders/core/EmitBridge.js +4 -3
- package/dist/recorders/core/EmitBridge.js.map +1 -1
- package/dist/recorders/core/ResilienceRecorder.js +45 -0
- package/dist/recorders/core/ResilienceRecorder.js.map +1 -0
- package/dist/recorders/core/resilienceHooks.js +78 -0
- package/dist/recorders/core/resilienceHooks.js.map +1 -0
- package/dist/recorders/observability/BoundaryRecorder.js +119 -8
- package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/recorders/observability/FlowchartRecorder.js +14 -3
- package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/recorders/observability/localObservability.js +27 -7
- package/dist/recorders/observability/localObservability.js.map +1 -1
- package/dist/recorders/observability/recordRun.js +137 -0
- package/dist/recorders/observability/recordRun.js.map +1 -0
- package/dist/recorders/observability/trace.js +36 -9
- package/dist/recorders/observability/trace.js.map +1 -1
- package/dist/reliability/buildReliabilityGateChart.js +37 -10
- package/dist/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/resilience/withCircuitBreaker.js +14 -7
- package/dist/resilience/withCircuitBreaker.js.map +1 -1
- package/dist/resilience/withFallback.js +30 -11
- package/dist/resilience/withFallback.js.map +1 -1
- package/dist/resilience/withRetry.js +53 -3
- package/dist/resilience/withRetry.js.map +1 -1
- package/dist/tool-providers/index.js +2 -2
- package/dist/tool-providers/index.js.map +1 -1
- package/dist/types/adapters/llm/AnthropicProvider.d.ts +3 -3
- package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BedrockProvider.d.ts +3 -3
- package/dist/types/adapters/llm/BedrockProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts +3 -3
- package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/BrowserOpenAIProvider.d.ts +5 -5
- package/dist/types/adapters/llm/BrowserOpenAIProvider.d.ts.map +1 -1
- package/dist/types/adapters/llm/OpenAIProvider.d.ts +3 -3
- package/dist/types/adapters/llm/OpenAIProvider.d.ts.map +1 -1
- package/dist/types/adapters/types.d.ts +95 -2
- package/dist/types/adapters/types.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/LLMCall.d.ts.map +1 -1
- package/dist/types/core/RunnerBase.d.ts +22 -1
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +7 -3
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentMessageApiChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildMessageApiChart.d.ts.map +1 -1
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/runner.d.ts +40 -5
- package/dist/types/core/runner.d.ts.map +1 -1
- package/dist/types/core-flow/Parallel.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/types.d.ts +9 -0
- package/dist/types/lib/context-bisect/types.d.ts.map +1 -1
- package/dist/types/lib/recorded-chat/recordedChat.d.ts.map +1 -1
- package/dist/types/lib/recorded-chat/types.d.ts +10 -0
- package/dist/types/lib/recorded-chat/types.d.ts.map +1 -1
- package/dist/types/observe.d.ts +3 -1
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/providers.d.ts +1 -1
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/recorders/core/EmitBridge.d.ts +9 -3
- package/dist/types/recorders/core/EmitBridge.d.ts.map +1 -1
- package/dist/types/recorders/core/ResilienceRecorder.d.ts +33 -0
- package/dist/types/recorders/core/ResilienceRecorder.d.ts.map +1 -0
- package/dist/types/recorders/core/resilienceHooks.d.ts +35 -0
- package/dist/types/recorders/core/resilienceHooks.d.ts.map +1 -0
- package/dist/types/recorders/core/typedEmit.d.ts +1 -2
- package/dist/types/recorders/core/typedEmit.d.ts.map +1 -1
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts +176 -12
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts +13 -2
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/localObservability.d.ts +66 -6
- package/dist/types/recorders/observability/localObservability.d.ts.map +1 -1
- package/dist/types/recorders/observability/recordRun.d.ts +144 -0
- package/dist/types/recorders/observability/recordRun.d.ts.map +1 -0
- package/dist/types/recorders/observability/trace.d.ts +65 -13
- package/dist/types/recorders/observability/trace.d.ts.map +1 -1
- package/dist/types/reliability/buildReliabilityGateChart.d.ts +23 -9
- package/dist/types/reliability/buildReliabilityGateChart.d.ts.map +1 -1
- package/dist/types/resilience/withCircuitBreaker.d.ts +15 -5
- package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
- package/dist/types/resilience/withFallback.d.ts +7 -1
- package/dist/types/resilience/withFallback.d.ts.map +1 -1
- package/dist/types/resilience/withRetry.d.ts +10 -5
- package/dist/types/resilience/withRetry.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoundaryRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/BoundaryRecorder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BoundaryRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/BoundaryRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AAEH,OAAO,EAIL,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAMrB,UAAU,YAAY;IACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAC9C;AAGD,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,eAAe,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAC9C;AACD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKzD,yCAAyC;AACzC,UAAU,eAAe;IACvB;;wEAEoE;IACpE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,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ACxE,eAAe,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,EAAE;IAI1D,mEAAmE;IACnE,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG;QACnC,KAAK,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAAC;QAC5C,IAAI,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAAC;KAC5C;IAcD,qDAAqD;IACrD,eAAe,IAAI;QACjB,KAAK,CAAC,EAAE,cAAc,CAAC;QACvB,IAAI,CAAC,EAAE,cAAc,CAAC;KACvB;IAQD,4EAA4E;IAC5E,iBAAiB,IAAI;QACnB,YAAY,EAAE,kBAAkB,EAAE,CAAC;QACnC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;QAC/B,KAAK,EAAE,kBAAkB,EAAE,CAAC;KAC7B;IAaD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAY3E;;;;;;;;;;OAUG;IACH,sBAAsB,IAAI,SAAS,iBAAiB,EAAE;IAkBtD;;;;;;;;;;;;;;;;;;;;;;;sBAuBkB;IAClB,UAAU,IAAI;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,WAAW,CAAC;QAChC,IAAI,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,CAAC;QACxC,IAAI,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KAC1C;CAYF"}
|
|
@@ -181,7 +181,9 @@ export interface FlowchartHandle {
|
|
|
181
181
|
/**
|
|
182
182
|
* Attach a live FlowchartRecorder to a runner.
|
|
183
183
|
*
|
|
184
|
-
* 1. Creates a `BoundaryRecorder` (the unified domain event log)
|
|
184
|
+
* 1. Creates a `BoundaryRecorder` (the unified domain event log) with
|
|
185
|
+
* commit tracking, so every boundary records WHERE on the commit
|
|
186
|
+
* axis it happened.
|
|
185
187
|
* 2. Attaches it to the executor's FlowRecorder channel via
|
|
186
188
|
* `runnerAttach` — captures run / subflow / fork / decision / loop.
|
|
187
189
|
* 3. Subscribes it to the dispatcher — captures llm.* / tool.* /
|
|
@@ -189,9 +191,18 @@ export interface FlowchartHandle {
|
|
|
189
191
|
* 4. Wires `onUpdate` so the consumer sees a fresh derived StepGraph
|
|
190
192
|
* on every event.
|
|
191
193
|
*
|
|
194
|
+
* @param getCommitCount where each boundary sits on the run's commit
|
|
195
|
+
* axis — the runner's `getCommitCount()`, sampled live. Optional only
|
|
196
|
+
* because a caller may have no runner to sample; omitting it stamps
|
|
197
|
+
* every boundary `commitIdxBefore: 0`, which reads as "all boundaries
|
|
198
|
+
* opened at once" and leaves an offline step strip with nothing to
|
|
199
|
+
* place. Nothing downstream can repair it — the commit log records
|
|
200
|
+
* what stages wrote, never when a boundary was crossed — so the
|
|
201
|
+
* runner always passes it.
|
|
202
|
+
*
|
|
192
203
|
* @internal Called from `RunnerBase.enable.flowchart`.
|
|
193
204
|
*/
|
|
194
|
-
export declare function attachFlowchart(runnerAttach: (recorder: CombinedRecorder) => () => void, dispatcher: EventDispatcher, options?: FlowchartOptions): FlowchartHandle;
|
|
205
|
+
export declare function attachFlowchart(runnerAttach: (recorder: CombinedRecorder) => () => void, dispatcher: EventDispatcher, options?: FlowchartOptions, getCommitCount?: () => number): FlowchartHandle;
|
|
195
206
|
/**
|
|
196
207
|
* Project a `BoundaryRecorder`'s event stream into a `StepGraph`.
|
|
197
208
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowchartRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/FlowchartRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM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Q,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,MAAM,IAAI,EACxD,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,gBAAqB,EAC9B,cAAc,CAAC,EAAE,MAAM,MAAM,GAC5B,eAAe,CAmCjB;AAwED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAyTlF"}
|
|
@@ -3,10 +3,24 @@
|
|
|
3
3
|
* render it live, and snapshot it for offline replay.
|
|
4
4
|
*
|
|
5
5
|
* One handle, two outputs:
|
|
6
|
-
* - LIVE — `
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* - LIVE — `onLive(graph)` fires per event with a fresh `StepGraph`; hand
|
|
7
|
+
* it to your own renderer, or read `handle.getSnapshot()` /
|
|
8
|
+
* `handle.boundary` whenever you like.
|
|
9
|
+
* - OFFLINE— `getTrace()` (any time) and `onRecorded(trace)` (auto, at run
|
|
10
|
+
* exit) freeze the model into a JSON-lossless `Trace`.
|
|
11
|
+
*
|
|
12
|
+
* This handle is NOT a Lens recorder. `<Lens recorder={…} />` wants a
|
|
13
|
+
* `LensRecorder` — a different object with a different surface — and passing
|
|
14
|
+
* this one gives a component with none of the members it calls. To put a run
|
|
15
|
+
* in front of Lens, record it and hand the recording over:
|
|
16
|
+
*
|
|
17
|
+
* const stop = recordRun(agent); // agentfootprint/observe
|
|
18
|
+
* await agent.run({ message });
|
|
19
|
+
* const recording = stop.toRecording(); // { snapshot, events, structure }
|
|
20
|
+
*
|
|
21
|
+
* // …in the viewer:
|
|
22
|
+
* const { recorder, runner } = observeRecording(recording); // lens
|
|
23
|
+
* <Lens recorder={recorder} runner={runner} />
|
|
10
24
|
*
|
|
11
25
|
* Contrast with `enable.observability({ strategy })` (Tier-4 / Monitor), which
|
|
12
26
|
* ships each event to a vendor and FORGETS. localObservability KEEPS the model
|
|
@@ -22,7 +36,7 @@ import type { DomainEvent } from './BoundaryRecorder.js';
|
|
|
22
36
|
import { type FlowchartHandle, type StepGraph } from './FlowchartRecorder.js';
|
|
23
37
|
import { type SerializeTraceOptions, type Trace } from './trace.js';
|
|
24
38
|
export interface LocalObservabilityOptions {
|
|
25
|
-
/** LIVE recording — called with a fresh StepGraph on every event
|
|
39
|
+
/** LIVE recording — called with a fresh StepGraph on every event. */
|
|
26
40
|
readonly onLive?: (graph: StepGraph) => void;
|
|
27
41
|
/** At run exit — called once with the finalized recording (a Trace, auto-serialized) to replay offline. */
|
|
28
42
|
readonly onRecorded?: (trace: Trace) => void;
|
|
@@ -33,6 +47,52 @@ export interface LocalObservabilityOptions {
|
|
|
33
47
|
* Pass `redactContent` for a ready-made redactor.
|
|
34
48
|
*/
|
|
35
49
|
readonly redact?: (event: DomainEvent) => DomainEvent;
|
|
50
|
+
/**
|
|
51
|
+
* Carry the run's footprintjs snapshot (state + commit log + recorder
|
|
52
|
+
* data) in the Trace. Default `false`.
|
|
53
|
+
*
|
|
54
|
+
* A Trace WITHOUT it draws a chart and a timeline and nothing else: the
|
|
55
|
+
* commit axis, ExplainableShell's memory and provenance panels, and
|
|
56
|
+
* WhereFrom all read the commit log, which lives in the snapshot and
|
|
57
|
+
* appears nowhere in the event log. Turn this on and the Trace can feed
|
|
58
|
+
* them.
|
|
59
|
+
*
|
|
60
|
+
* Off by default because of `redact`, not because of size. `redact` is a
|
|
61
|
+
* per-DOMAIN-EVENT function — it cannot reach inside a snapshot, whose
|
|
62
|
+
* `sharedState` is the run's raw working memory. Filling this field
|
|
63
|
+
* automatically would have widened what a carefully redacted Trace
|
|
64
|
+
* exports without a line of code changing at any call site, which is the
|
|
65
|
+
* kind of quiet trust-boundary move a library has no business making.
|
|
66
|
+
* When you turn it on, redaction for the snapshot half is footprintjs's
|
|
67
|
+
* `setRedactionPolicy()` at run time — the run's own policy, applied when
|
|
68
|
+
* the values were written.
|
|
69
|
+
*
|
|
70
|
+
* For a viewer, prefer `recordRun()`: `{ snapshot, events, structure }`
|
|
71
|
+
* is the shape the UIs consume, and it is explicit about carrying state.
|
|
72
|
+
*/
|
|
73
|
+
readonly includeSnapshot?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The three things a live runner knows that a recorder cannot see for
|
|
77
|
+
* itself. Each one lights a different surface of the stored Trace, and a
|
|
78
|
+
* missing one degrades exactly that surface:
|
|
79
|
+
*
|
|
80
|
+
* - `getStructure` → the chart. Nothing else can draw it.
|
|
81
|
+
* - `getSnapshot` → state, commit log, every attached recorder's data.
|
|
82
|
+
* - `getCommitCount` → where each boundary sits on the commit axis.
|
|
83
|
+
*
|
|
84
|
+
* All three are read lazily, at the moment they are needed, because all
|
|
85
|
+
* three answer differently before, during and after a run.
|
|
86
|
+
*
|
|
87
|
+
* @internal Supplied by `RunnerBase.enable.localObservability`.
|
|
88
|
+
*/
|
|
89
|
+
export interface RunAccess {
|
|
90
|
+
/** `() => runner.getSpec().buildTimeStructure` — the static chart. */
|
|
91
|
+
readonly getStructure?: () => unknown;
|
|
92
|
+
/** `() => runner.getLastSnapshot()` — the footprintjs run snapshot. */
|
|
93
|
+
readonly getSnapshot?: () => unknown;
|
|
94
|
+
/** `() => runner.getCommitCount()` — sampled live on every boundary. */
|
|
95
|
+
readonly getCommitCount?: () => number;
|
|
36
96
|
}
|
|
37
97
|
/** A `FlowchartHandle` (live) plus `getTrace()` (offline snapshot). */
|
|
38
98
|
export interface LocalObservabilityHandle extends FlowchartHandle {
|
|
@@ -45,5 +105,5 @@ export interface LocalObservabilityHandle extends FlowchartHandle {
|
|
|
45
105
|
*
|
|
46
106
|
* @internal Called from `RunnerBase.enable.localObservability`.
|
|
47
107
|
*/
|
|
48
|
-
export declare function attachLocalObservability(runnerAttach: (recorder: CombinedRecorder) => () => void, dispatcher: EventDispatcher, options?: LocalObservabilityOptions, now?: () => number,
|
|
108
|
+
export declare function attachLocalObservability(runnerAttach: (recorder: CombinedRecorder) => () => void, dispatcher: EventDispatcher, options?: LocalObservabilityOptions, now?: () => number, access?: RunAccess): LocalObservabilityHandle;
|
|
49
109
|
//# sourceMappingURL=localObservability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localObservability.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/localObservability.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"localObservability.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/localObservability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAkB,KAAK,qBAAqB,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,WAAW,yBAAyB;IACxC,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7C,2GAA2G;IAC3G,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,WAAW,CAAC;IACtD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IACxB,sEAAsE;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,MAAM,CAAC;CACxC;AAED,uEAAuE;AACvE,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,KAAK,CAAC;CAClD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,MAAM,IAAI,EACxD,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,yBAA8B,EACvC,GAAG,GAAE,MAAM,MAAiB,EAC5B,MAAM,GAAE,SAAc,GACrB,wBAAwB,CA2C1B"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* recordRun — save a run so a viewer can show it later.
|
|
3
|
+
*
|
|
4
|
+
* A RECORDING is exactly three things, and each one lights a different
|
|
5
|
+
* surface:
|
|
6
|
+
*
|
|
7
|
+
* `events` the typed agentfootprint stream, in the order it fired —
|
|
8
|
+
* the story, the commentary, the summary.
|
|
9
|
+
* `snapshot` the footprintjs run snapshot — shared state, the commit
|
|
10
|
+
* log, and every attached recorder's data (narrative,
|
|
11
|
+
* metrics, boundaries).
|
|
12
|
+
* `structure` the agent's build-time chart — THE CHART. Nothing else
|
|
13
|
+
* can draw it, and no snapshot carries it.
|
|
14
|
+
*
|
|
15
|
+
* Miss one and one surface goes dark. That is why this exists: every
|
|
16
|
+
* integration that assembled the bundle by hand assembled a different,
|
|
17
|
+
* incomplete one, and the piece most often missing was `structure` —
|
|
18
|
+
* because a completed run does not leave it behind. This is also the
|
|
19
|
+
* producer for the shape lens's `observeRecording()` consumes, which
|
|
20
|
+
* until now nothing produced.
|
|
21
|
+
*
|
|
22
|
+
* import { recordRun } from 'agentfootprint/observe';
|
|
23
|
+
*
|
|
24
|
+
* const recorder = recordRun(agent);
|
|
25
|
+
* await agent.run({ message });
|
|
26
|
+
* fs.writeFileSync('run.json', JSON.stringify(recorder.toRecording()));
|
|
27
|
+
*
|
|
28
|
+
* …and in the viewer:
|
|
29
|
+
*
|
|
30
|
+
* const { recorder, runner } = observeRecording(JSON.parse(json)); // lens
|
|
31
|
+
* <Lens recorder={recorder} runner={runner} />
|
|
32
|
+
*
|
|
33
|
+
* WHAT IT WIRES THAT HAND-ROLLING GETS WRONG
|
|
34
|
+
* ──────────────────────────────────────────
|
|
35
|
+
* The boundary recorder — the one that puts stops on the step strip —
|
|
36
|
+
* needs three connections, and each missing one fails differently:
|
|
37
|
+
*
|
|
38
|
+
* attach no boundaries at all (loud: the strip is empty)
|
|
39
|
+
* subscribe boundaries with nothing in them (quiet: no LLM or
|
|
40
|
+
* tool detail behind any stop)
|
|
41
|
+
* getCommitCount every boundary stamped at commit 0 (SILENT: the
|
|
42
|
+
* events look complete, and the strip cannot be
|
|
43
|
+
* rebuilt offline — the commit log records what
|
|
44
|
+
* stages wrote, never when a boundary was crossed,
|
|
45
|
+
* so nothing downstream can repair it)
|
|
46
|
+
*
|
|
47
|
+
* Wire it before the run or not at all — none of the three can be
|
|
48
|
+
* reconstructed from a finished run.
|
|
49
|
+
*
|
|
50
|
+
* WHAT IT DOES NOT DO
|
|
51
|
+
* ───────────────────
|
|
52
|
+
* It attaches no OTHER recorders. `narrative()` and `metrics()` are the
|
|
53
|
+
* consumer's choice — their data rides the snapshot when attached, and
|
|
54
|
+
* each viewer says so when it isn't there (a Gantt with no timings shows
|
|
55
|
+
* execution ORDER and says so; a story panel falls back to "X executed.
|
|
56
|
+
* Wrote: y"). Attaching them behind the consumer's back would make every
|
|
57
|
+
* recording pay for panels most runs never open.
|
|
58
|
+
*/
|
|
59
|
+
import type { Runner } from '../../core/runner.js';
|
|
60
|
+
import type { AgentfootprintEvent } from '../../events/registry.js';
|
|
61
|
+
import { type BoundaryRecorder } from './BoundaryRecorder.js';
|
|
62
|
+
/**
|
|
63
|
+
* One frozen run — everything a viewer needs, and nothing it doesn't.
|
|
64
|
+
*
|
|
65
|
+
* The field names are the ones `observeRecording()` reads, so a recording
|
|
66
|
+
* is handed over whole: no mapping, no adapter, no per-integration shape.
|
|
67
|
+
*/
|
|
68
|
+
export interface Recording {
|
|
69
|
+
/** The footprintjs run snapshot. `undefined` if nothing has run yet. */
|
|
70
|
+
readonly snapshot: unknown;
|
|
71
|
+
/** The typed events the run fired, in order. */
|
|
72
|
+
readonly events: readonly AgentfootprintEvent[];
|
|
73
|
+
/** The agent's build-time chart — the only route to a drawable graph. */
|
|
74
|
+
readonly structure: unknown;
|
|
75
|
+
}
|
|
76
|
+
export interface RecordRunOptions {
|
|
77
|
+
/**
|
|
78
|
+
* Cap on retained events. The oldest are dropped once the cap is hit,
|
|
79
|
+
* so a long-running server records a bounded tail rather than growing
|
|
80
|
+
* without limit. Default 10,000 — a few hundred KB for a typical turn,
|
|
81
|
+
* and far more than any single turn fires.
|
|
82
|
+
*
|
|
83
|
+
* A recording that dropped events says so: `droppedEvents` counts them
|
|
84
|
+
* rather than leaving a consumer to wonder why its timeline starts
|
|
85
|
+
* mid-run.
|
|
86
|
+
*/
|
|
87
|
+
readonly maxEvents?: number;
|
|
88
|
+
/**
|
|
89
|
+
* How much of the boundary log rides the snapshot:
|
|
90
|
+
* - `'full'` (default) — every field, content included. What an
|
|
91
|
+
* offline step strip needs to show detail behind each stop.
|
|
92
|
+
* - `'lean'` — boundary structure only, no captured payloads. The
|
|
93
|
+
* strip still rebuilds; the detail panels are empty, and a
|
|
94
|
+
* consumer reading the bundle's `meta.mode` can say so.
|
|
95
|
+
*/
|
|
96
|
+
readonly boundaryDetail?: 'full' | 'lean';
|
|
97
|
+
}
|
|
98
|
+
/** A recording in progress. Keep it until the run ends, then freeze it. */
|
|
99
|
+
export interface RunRecorder {
|
|
100
|
+
/**
|
|
101
|
+
* Freeze what has happened so far into `{ snapshot, events, structure }`.
|
|
102
|
+
* Call it after the run; calling it during one gives a partial
|
|
103
|
+
* recording, which is legitimate for a crash report but will show a
|
|
104
|
+
* timeline that stops mid-run.
|
|
105
|
+
*
|
|
106
|
+
* The events array is a fresh copy, so a recording taken and stored
|
|
107
|
+
* does not keep growing behind the caller's back. `snapshot` and
|
|
108
|
+
* `structure` are the runner's own objects, held by reference —
|
|
109
|
+
* serialize to detach.
|
|
110
|
+
*/
|
|
111
|
+
toRecording(): Recording;
|
|
112
|
+
/** The boundary recorder, for richer live queries (slot rows, ranges). */
|
|
113
|
+
readonly boundary: BoundaryRecorder;
|
|
114
|
+
/** How many events have been captured. */
|
|
115
|
+
readonly eventCount: number;
|
|
116
|
+
/** Events discarded to stay under `maxEvents`. `0` on a normal turn. */
|
|
117
|
+
readonly droppedEvents: number;
|
|
118
|
+
/**
|
|
119
|
+
* Stop recording. The events already captured stay readable, so
|
|
120
|
+
* `toRecording()` after `stop()` is the normal end of a run; call it
|
|
121
|
+
* when the runner outlives the recording (a server that records one
|
|
122
|
+
* turn out of many).
|
|
123
|
+
*/
|
|
124
|
+
stop(): void;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Start recording a runner. Call BEFORE `run()` — a recording is
|
|
128
|
+
* collected as the run happens and cannot be reconstructed after it.
|
|
129
|
+
*
|
|
130
|
+
* @param runner the Agent / composition / pattern to record.
|
|
131
|
+
* @param options event cap and boundary detail level.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const recorder = recordRun(agent);
|
|
136
|
+
* await agent.run({ message: 'Weather in San Francisco?' });
|
|
137
|
+
* const recording = recorder.toRecording();
|
|
138
|
+
* recorder.stop();
|
|
139
|
+
*
|
|
140
|
+
* fs.writeFileSync('run.json', JSON.stringify(recording));
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
export declare function recordRun(runner: Runner, options?: RecordRunOptions): RunRecorder;
|
|
144
|
+
//# sourceMappingURL=recordRun.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordRun.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/recordRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChD,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3C;AAED,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,WAAW,IAAI,SAAS,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,IAAI,IAAI,IAAI,CAAC;CACd;AAKD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,CAwDrF"}
|
|
@@ -5,14 +5,31 @@
|
|
|
5
5
|
* `serializeTrace()` freezes that model into a `Trace` — plain JSON you can
|
|
6
6
|
* persist (file, Redis, a bug report) and later rehydrate WITHOUT re-running
|
|
7
7
|
* the agent. `agentfootprint-lens`'s `<Replay trace={…} />` consumes it and
|
|
8
|
-
*
|
|
8
|
+
* draws the flowchart via the existing translators.
|
|
9
9
|
*
|
|
10
|
-
* A `Trace` stores
|
|
11
|
-
*
|
|
12
|
-
* events (footprint.js's "graph
|
|
13
|
-
* it is rebuilt at render time,
|
|
14
|
-
*
|
|
15
|
-
* `redact` could never reach.
|
|
10
|
+
* A `Trace` stores the domain-event log (the single source of truth the Lens
|
|
11
|
+
* already reads) plus, since 7.8, the run's footprintjs snapshot. The step
|
|
12
|
+
* graph is ALWAYS a derived projection of those events (footprint.js's "graph
|
|
13
|
+
* is derived, never post-processed" principle) — it is rebuilt at render time,
|
|
14
|
+
* never stored. Storing a derived graph would be redundant AND a redaction
|
|
15
|
+
* hazard: a second content surface a per-event `redact` could never reach.
|
|
16
|
+
*
|
|
17
|
+
* WHAT A TRACE CAN AND CANNOT DRIVE
|
|
18
|
+
* ─────────────────────────────────
|
|
19
|
+
* `<Replay trace={…} />` draws the chart from `structure`, and that is all it
|
|
20
|
+
* draws: a static shape, not a lit-up path. It does not read `trace.events` —
|
|
21
|
+
* time-travel over them is a planned refinement, and until it lands an offline
|
|
22
|
+
* `<Replay>` is a strictly smaller view than the live `<Lens>`, not a match
|
|
23
|
+
* for it.
|
|
24
|
+
*
|
|
25
|
+
* For the full viewers — `<Lens>`, ExplainableShell, WhereFrom, the commit
|
|
26
|
+
* axis — what you want is a RECORDING: `{ snapshot, events, structure }`, the
|
|
27
|
+
* shape `recordRun()` produces and lens's `observeRecording()` consumes. Note
|
|
28
|
+
* `events` there means the TYPED agentfootprint stream (`runner.on('*')`),
|
|
29
|
+
* which is not the domain-event log a Trace carries: the two are different
|
|
30
|
+
* projections of the same run, and a Trace holds only the second. So a Trace
|
|
31
|
+
* with a `snapshot` can drive the snapshot-fed surfaces, but it is not itself
|
|
32
|
+
* a recording — reach for `recordRun()` when the destination is a viewer.
|
|
16
33
|
*
|
|
17
34
|
* PII / trust boundary: the event log carries real content — `llm.end.content`,
|
|
18
35
|
* `tool.start.args`, `tool.end.result`, `context.injected.contentSummary`,
|
|
@@ -49,7 +66,8 @@ export interface TraceSummary {
|
|
|
49
66
|
}
|
|
50
67
|
/**
|
|
51
68
|
* A JSON-lossless, UI-free snapshot of one run. Persist it, ship it, replay it.
|
|
52
|
-
* `events` ARE the
|
|
69
|
+
* `events` ARE the timeline (the graph is a derived projection, rebuilt at
|
|
70
|
+
* render); `structure` is the chart; `snapshot` is the state the run left.
|
|
53
71
|
*/
|
|
54
72
|
export interface Trace {
|
|
55
73
|
/** Schema version. Bump on a breaking shape change. */
|
|
@@ -58,12 +76,36 @@ export interface Trace {
|
|
|
58
76
|
readonly events: readonly DomainEvent[];
|
|
59
77
|
/**
|
|
60
78
|
* The serialized STATIC chart structure (footprint.js `buildTimeStructure`).
|
|
61
|
-
* Design-time data (stage ids/names/types/edges) — UI-free. `<Replay>`
|
|
62
|
-
* the flowchart from this
|
|
63
|
-
* the live `<Lens>` exactly. NOT runtime-redacted (it carries no user data; the
|
|
79
|
+
* Design-time data (stage ids/names/types/edges) — UI-free. `<Replay>` draws
|
|
80
|
+
* the flowchart from this. NOT runtime-redacted (it carries no user data; the
|
|
64
81
|
* `redact` function targets runtime events).
|
|
82
|
+
*
|
|
83
|
+
* Absent, `<Replay>` has nothing to draw and says so.
|
|
65
84
|
*/
|
|
66
85
|
readonly structure?: unknown;
|
|
86
|
+
/**
|
|
87
|
+
* The run's footprintjs snapshot (`runner.getLastSnapshot()`) — shared
|
|
88
|
+
* state, the commit log, and every attached recorder's data.
|
|
89
|
+
*
|
|
90
|
+
* This is the piece the snapshot-fed surfaces need and the event log cannot
|
|
91
|
+
* supply: ExplainableShell's memory and provenance panels, WhereFrom, and
|
|
92
|
+
* the commit axis all read the commit log, which is a footprintjs artifact
|
|
93
|
+
* and appears nowhere in `events`. Without it a Trace draws a chart and a
|
|
94
|
+
* timeline and nothing else — which is what every Trace captured before 7.8
|
|
95
|
+
* is, and why they replay as a static picture.
|
|
96
|
+
*
|
|
97
|
+
* `unknown` on purpose: this is footprintjs's shape, not agentfootprint's,
|
|
98
|
+
* and a Trace is a transport — it should not pin a peer's type into its own
|
|
99
|
+
* schema. Cast at the consumer.
|
|
100
|
+
*
|
|
101
|
+
* NOT redacted by `redact`, which runs per domain event and cannot reach
|
|
102
|
+
* inside a snapshot. This field carries whatever the run's own footprintjs
|
|
103
|
+
* redaction policy (`setRedactionPolicy()`) let through, so a run whose
|
|
104
|
+
* state holds secrets wants that policy set at run time — which is why
|
|
105
|
+
* `enable.localObservability({ includeSnapshot: true })` is opt-in and a
|
|
106
|
+
* redacted Trace does not quietly grow a second content surface.
|
|
107
|
+
*/
|
|
108
|
+
readonly snapshot?: unknown;
|
|
67
109
|
/** Optional headline totals. */
|
|
68
110
|
readonly summary?: TraceSummary;
|
|
69
111
|
/** Self-describing redaction state — travels with the trace. */
|
|
@@ -81,8 +123,14 @@ export interface SerializeTraceOptions {
|
|
|
81
123
|
readonly redact?: (event: DomainEvent) => DomainEvent;
|
|
82
124
|
/** Override the `redaction` label. Defaults to `'pii'` when `redact` is given, else `'none'`. */
|
|
83
125
|
readonly redactionLabel?: TraceRedaction;
|
|
84
|
-
/** The serialized static chart (`getSpec().buildTimeStructure`) —
|
|
126
|
+
/** The serialized static chart (`getSpec().buildTimeStructure`) — what `<Replay>` draws. */
|
|
85
127
|
readonly structure?: unknown;
|
|
128
|
+
/**
|
|
129
|
+
* The run's footprintjs snapshot (`runner.getLastSnapshot()`) — the commit
|
|
130
|
+
* log and recorder data the snapshot-fed panels read. `enable.localObservability()`
|
|
131
|
+
* fills this for you; pass it explicitly when calling `serializeTrace` by hand.
|
|
132
|
+
*/
|
|
133
|
+
readonly snapshot?: unknown;
|
|
86
134
|
/** Optional precomputed headline rollup. */
|
|
87
135
|
readonly summary?: TraceSummary;
|
|
88
136
|
/** Wall-clock capture time. Pass `Date.now()` from the call site. */
|
|
@@ -102,10 +150,14 @@ export declare function redactContent(event: DomainEvent): DomainEvent;
|
|
|
102
150
|
* `getEvents()` output.
|
|
103
151
|
*
|
|
104
152
|
* const trace = serializeTrace(handle.boundary.getEvents(), {
|
|
105
|
-
* redact: redactContent,
|
|
153
|
+
* redact: redactContent, // PII stripped before it enters the trace
|
|
154
|
+
* structure: agent.getSpec().buildTimeStructure, // the chart
|
|
155
|
+
* snapshot: agent.getLastSnapshot(), // state + commit log + recorders
|
|
106
156
|
* capturedAtMs: Date.now(),
|
|
107
157
|
* });
|
|
108
158
|
* fs.writeFileSync('run.trace.json', JSON.stringify(trace));
|
|
159
|
+
*
|
|
160
|
+
* `enable.localObservability().getTrace()` passes all three for you.
|
|
109
161
|
*/
|
|
110
162
|
export declare function serializeTrace(events: readonly DomainEvent[], options?: SerializeTraceOptions): Trace;
|
|
111
163
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/trace.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;;;GAKG;AACH,MAAM,MAAM,cA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O,CAAC,EAAE,YAAY,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAuB7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,OAAO,GAAE,qBAA0B,GAClC,KAAK,CAmBP;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAExD"}
|
|
@@ -3,9 +3,20 @@
|
|
|
3
3
|
* an LLM call with rules-based reliability semantics, using the native
|
|
4
4
|
* `decide()` DSL via `addDeciderFunction` decider stages.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* ⚠ NOT REACHABLE FROM ANY SHIPPED PATH (verified 2026-07-28). This header
|
|
7
|
+
* used to say the chart "is mounted as a subflow in the agent's chart at
|
|
8
|
+
* Agent.build() time (only when reliability is configured)". It is not:
|
|
9
|
+
* `buildReliabilityGateChart` is exported from no barrel, and its only
|
|
10
|
+
* consumer in the repository is its own test
|
|
11
|
+
* (`test/reliability/gate-chart-7pattern.test.ts`). The live
|
|
12
|
+
* `.reliability()` path is `executeWithReliability`
|
|
13
|
+
* (`core/agent/stages/reliabilityExecution.ts`) driving
|
|
14
|
+
* `singleProviderCall` inline in `core/agent/stages/callLLM.ts` — which
|
|
15
|
+
* trades this chart's subflow visibility for streaming support. Keep this
|
|
16
|
+
* file honest rather than deleting it: it is the only implementation that
|
|
17
|
+
* honours the `providers` failover list (see MENTAL_MODEL §14 item 3).
|
|
18
|
+
*
|
|
19
|
+
* Inside the subflow, when something does mount it:
|
|
9
20
|
*
|
|
10
21
|
* PreCheck (decider) → CallProvider (function) → PostDecide (decider)
|
|
11
22
|
* │
|
|
@@ -26,15 +37,18 @@
|
|
|
26
37
|
* 'fallback' → call config.fallback(); $break() on success
|
|
27
38
|
* 'fail-fast' → set failKind, $emit, $break(reason)
|
|
28
39
|
*
|
|
29
|
-
* The subflow
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* agent-level `$break(reason)
|
|
33
|
-
* (`ok`/`fallback`) leave the agent running while fail-fast stops it.
|
|
40
|
+
* The design intends the subflow to be mounted WITHOUT `propagateBreak:
|
|
41
|
+
* true`, so subflow `$break` stays local and an agent-level
|
|
42
|
+
* `TranslateFailFast` stage reads `scope.reliabilityFailKind` and converts
|
|
43
|
+
* it into an agent-level `$break(reason)` — letting normal subflow exits
|
|
44
|
+
* (`ok`/`fallback`) leave the agent running while fail-fast stops it. That
|
|
45
|
+
* stage was never built (`grep TranslateFailFast` finds only comments), which
|
|
46
|
+
* is part of why nothing mounts this chart; the live path throws
|
|
47
|
+
* `ReliabilityFailFastError` from `Agent.run` instead.
|
|
34
48
|
*
|
|
35
49
|
* Three-channel discipline preserved:
|
|
36
50
|
* • SCOPE STATE — failKind/failPayload/failReason mapped to parent via
|
|
37
|
-
* outputMapper;
|
|
51
|
+
* outputMapper; for the intended TranslateFailFast.
|
|
38
52
|
* • $emit — passive observability for external consumers.
|
|
39
53
|
* • $break(reason)— control flow + human reason for narrative.
|
|
40
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildReliabilityGateChart.d.ts","sourceRoot":"","sources":["../../../src/reliability/buildReliabilityGateChart.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"buildReliabilityGateChart.d.ts","sourceRoot":"","sources":["../../../src/reliability/buildReliabilityGateChart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAWzD,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,YAAY,CAAC;AAoFvF;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAmU9E"}
|
|
@@ -48,9 +48,12 @@
|
|
|
48
48
|
*
|
|
49
49
|
* HALF-OPEN ──[ probe failure ]──► OPEN (cooldown restarts)
|
|
50
50
|
*
|
|
51
|
-
* `stream()` is decorated identically. `name
|
|
52
|
-
*
|
|
53
|
-
*
|
|
51
|
+
* `stream()` is decorated identically. `name` passes through unchanged
|
|
52
|
+
* (the consumer's existing observability hooks still see the underlying
|
|
53
|
+
* provider's identity), and the optional per-call `LLMCallHooks` is
|
|
54
|
+
* forwarded inward so a decorator nested inside this one can still
|
|
55
|
+
* report. Nothing else is copied — `LLMProvider` has exactly `name`,
|
|
56
|
+
* `complete` and the optional `stream`.
|
|
54
57
|
*
|
|
55
58
|
* **Scope: per-instance, NOT distributed.** Each `withCircuitBreaker(...)`
|
|
56
59
|
* call holds its own breaker state in process memory. If you run 100
|
|
@@ -93,8 +96,15 @@ export interface WithCircuitBreakerOptions {
|
|
|
93
96
|
* breaker for everyone.
|
|
94
97
|
*/
|
|
95
98
|
readonly shouldCount?: (error: unknown) => boolean;
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
99
|
+
/**
|
|
100
|
+
* Hook invoked on every state transition. This is the ONLY way to
|
|
101
|
+
* observe breaker state: there is no declared event for a breaker
|
|
102
|
+
* transition, so unlike `withFallback`/`withRetry` this decorator
|
|
103
|
+
* reports nothing through the in-run `LLMCallHooks` channel. A trip
|
|
104
|
+
* becomes visible in a trace only when composed under
|
|
105
|
+
* `withFallback`, whose `agentfootprint.fallback.triggered` carries
|
|
106
|
+
* the `CircuitOpenError` message as its `reason`.
|
|
107
|
+
*/
|
|
98
108
|
readonly onStateChange?: (state: CircuitState, reason: string) => void;
|
|
99
109
|
}
|
|
100
110
|
export type CircuitState = 'closed' | 'open' | 'half-open';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withCircuitBreaker.d.ts","sourceRoot":"","sources":["../../../src/resilience/withCircuitBreaker.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"withCircuitBreaker.d.ts","sourceRoot":"","sources":["../../../src/resilience/withCircuitBreaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;AAEH,OAAO,KAAK,EAGV,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,yBAAyB;IACxC,gEAAgE;IAChE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,mEAAmE;IACnE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACnD;;;;;;;;OAQG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAI3D;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,qBAA+B;IAC5C;+CAC2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAChB,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM;CAYrE;AAYD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE,yBAA8B,GACtC,WAAW,CA8Hb"}
|
|
@@ -27,7 +27,13 @@ export interface WithFallbackOptions {
|
|
|
27
27
|
readonly shouldFallback?: (error: unknown) => boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Hook invoked when the primary fails and we're about to call the
|
|
30
|
-
* fallback. Useful for
|
|
30
|
+
* fallback. Useful for logging in standalone (non-agentfootprint) use.
|
|
31
|
+
*
|
|
32
|
+
* You do NOT need this to get fallback telemetry inside a run: since
|
|
33
|
+
* v7.8 the in-run LLM call sites hand this decorator an `LLMCallHooks`
|
|
34
|
+
* and translate its reports into `agentfootprint.fallback.triggered`
|
|
35
|
+
* events, stamped with the real `runId`/`runtimeStageId`. This hook is
|
|
36
|
+
* the consumer-owned escape hatch and its contract is unchanged.
|
|
31
37
|
*/
|
|
32
38
|
readonly onFallback?: (error: unknown) => void;
|
|
33
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFallback.d.ts","sourceRoot":"","sources":["../../../src/resilience/withFallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"withFallback.d.ts","sourceRoot":"","sources":["../../../src/resilience/withFallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAGV,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACtD;;;;;;;;;OASG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,mBAAwB,GAChC,WAAW,CAoEb"}
|
|
@@ -35,11 +35,16 @@ export interface WithRetryOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
readonly shouldRetry?: (error: unknown, attempt: number) => boolean;
|
|
37
37
|
/**
|
|
38
|
-
* Hook invoked before each retry. Useful for logging
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
38
|
+
* Hook invoked before each retry. Useful for logging in standalone
|
|
39
|
+
* (non-agentfootprint) use. Receives the attempt number that's about
|
|
40
|
+
* to start (so attempt 2 = first retry).
|
|
41
|
+
*
|
|
42
|
+
* You do NOT need this to get retry telemetry inside a run: since v7.8
|
|
43
|
+
* the in-run LLM call sites hand this decorator an `LLMCallHooks` and
|
|
44
|
+
* translate its reports into `agentfootprint.error.retried` /
|
|
45
|
+
* `agentfootprint.error.recovered` events, stamped with the real
|
|
46
|
+
* `runId`/`runtimeStageId`. This hook is the consumer-owned escape
|
|
47
|
+
* hatch and its contract is unchanged.
|
|
43
48
|
*/
|
|
44
49
|
readonly onRetry?: (error: unknown, attempt: number, delayMs: number) => void;
|
|
45
50
|
}
|