agentfootprint 2.7.2 → 2.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/dist/core/RunnerBase.js +6 -0
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/RunnerBase.js +6 -0
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/strategies/attach.js +227 -0
- package/dist/esm/strategies/attach.js.map +1 -0
- package/dist/esm/strategies/compose.js +158 -0
- package/dist/esm/strategies/compose.js.map +1 -0
- package/dist/esm/strategies/defaults/chatBubbleLiveStatus.js +34 -0
- package/dist/esm/strategies/defaults/chatBubbleLiveStatus.js.map +1 -0
- package/dist/esm/strategies/defaults/consoleObservability.js +61 -0
- package/dist/esm/strategies/defaults/consoleObservability.js.map +1 -0
- package/dist/esm/strategies/defaults/inMemorySinkCost.js +48 -0
- package/dist/esm/strategies/defaults/inMemorySinkCost.js.map +1 -0
- package/dist/esm/strategies/defaults/index.js +31 -0
- package/dist/esm/strategies/defaults/index.js.map +1 -0
- package/dist/esm/strategies/defaults/noopLens.js +29 -0
- package/dist/esm/strategies/defaults/noopLens.js.map +1 -0
- package/dist/esm/strategies/index.js +23 -0
- package/dist/esm/strategies/index.js.map +1 -0
- package/dist/esm/strategies/registry.js +102 -0
- package/dist/esm/strategies/registry.js.map +1 -0
- package/dist/esm/strategies/types.js +36 -0
- package/dist/esm/strategies/types.js.map +1 -0
- package/dist/strategies/attach.js +256 -0
- package/dist/strategies/attach.js.map +1 -0
- package/dist/strategies/compose.js +165 -0
- package/dist/strategies/compose.js.map +1 -0
- package/dist/strategies/defaults/chatBubbleLiveStatus.js +38 -0
- package/dist/strategies/defaults/chatBubbleLiveStatus.js.map +1 -0
- package/dist/strategies/defaults/consoleObservability.js +65 -0
- package/dist/strategies/defaults/consoleObservability.js.map +1 -0
- package/dist/strategies/defaults/inMemorySinkCost.js +52 -0
- package/dist/strategies/defaults/inMemorySinkCost.js.map +1 -0
- package/dist/strategies/defaults/index.js +38 -0
- package/dist/strategies/defaults/index.js.map +1 -0
- package/dist/strategies/defaults/noopLens.js +33 -0
- package/dist/strategies/defaults/noopLens.js.map +1 -0
- package/dist/strategies/index.js +47 -0
- package/dist/strategies/index.js.map +1 -0
- package/dist/strategies/registry.js +118 -0
- package/dist/strategies/registry.js.map +1 -0
- package/dist/strategies/types.js +37 -0
- package/dist/strategies/types.js.map +1 -0
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/runner.d.ts +29 -2
- package/dist/types/core/runner.d.ts.map +1 -1
- package/dist/types/strategies/attach.d.ts +48 -0
- package/dist/types/strategies/attach.d.ts.map +1 -0
- package/dist/types/strategies/compose.d.ts +49 -0
- package/dist/types/strategies/compose.d.ts.map +1 -0
- package/dist/types/strategies/defaults/chatBubbleLiveStatus.d.ts +37 -0
- package/dist/types/strategies/defaults/chatBubbleLiveStatus.d.ts.map +1 -0
- package/dist/types/strategies/defaults/consoleObservability.d.ts +43 -0
- package/dist/types/strategies/defaults/consoleObservability.d.ts.map +1 -0
- package/dist/types/strategies/defaults/inMemorySinkCost.d.ts +51 -0
- package/dist/types/strategies/defaults/inMemorySinkCost.d.ts.map +1 -0
- package/dist/types/strategies/defaults/index.d.ts +31 -0
- package/dist/types/strategies/defaults/index.d.ts.map +1 -0
- package/dist/types/strategies/defaults/noopLens.d.ts +29 -0
- package/dist/types/strategies/defaults/noopLens.d.ts.map +1 -0
- package/dist/types/strategies/index.d.ts +23 -0
- package/dist/types/strategies/index.d.ts.map +1 -0
- package/dist/types/strategies/registry.d.ts +71 -0
- package/dist/types/strategies/registry.d.ts.map +1 -0
- package/dist/types/strategies/types.d.ts +304 -0
- package/dist/types/strategies/types.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -19,15 +19,22 @@ import type { AgentfootprintEvent, AgentfootprintEventType } from '../events/reg
|
|
|
19
19
|
import type { LoggingOptions } from '../recorders/observability/LoggingRecorder.js';
|
|
20
20
|
import type { ThinkingOptions } from '../recorders/observability/ThinkingRecorder.js';
|
|
21
21
|
import type { FlowchartHandle, FlowchartOptions } from '../recorders/observability/FlowchartRecorder.js';
|
|
22
|
+
import type { ObservabilityEnableOptions, CostEnableOptions, LiveStatusEnableOptions } from '../strategies/attach.js';
|
|
22
23
|
/**
|
|
23
24
|
* High-level feature-enable methods. Each attaches a pre-built observability
|
|
24
25
|
* recorder and returns an Unsubscribe function. Additional methods land in
|
|
25
26
|
* Phase 5 (lens, tracing, cost, guardrails, ...).
|
|
26
27
|
*/
|
|
27
28
|
export interface EnableNamespace {
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated v2.8 — use `enable.liveStatus({ strategy: chatBubbleLiveStatus({onLine}) })`.
|
|
31
|
+
* Kept for back-compat; removed in v3.0.
|
|
32
|
+
*/
|
|
29
33
|
thinking(opts: ThinkingOptions): Unsubscribe;
|
|
30
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated v2.8 — use `enable.observability({ strategy: pinoObservability({...}) })`
|
|
36
|
+
* or another vendor strategy. Kept for back-compat; removed in v3.0.
|
|
37
|
+
*/
|
|
31
38
|
logging(opts?: LoggingOptions): Unsubscribe;
|
|
32
39
|
/**
|
|
33
40
|
* Live composition graph — subflow / fork-branch / decision-branch
|
|
@@ -39,6 +46,26 @@ export interface EnableNamespace {
|
|
|
39
46
|
* at any time (not just via onUpdate).
|
|
40
47
|
*/
|
|
41
48
|
flowchart(opts?: FlowchartOptions): FlowchartHandle;
|
|
49
|
+
/**
|
|
50
|
+
* v2.8+ — grouped strategy enabler for observability. Pipes every
|
|
51
|
+
* typed event into a vendor strategy (Datadog, OTel, AgentCore,
|
|
52
|
+
* CloudWatch, …) or the default `consoleObservability()`. See
|
|
53
|
+
* `agentfootprint/strategies` + `docs/inspiration/strategy-everywhere.md`.
|
|
54
|
+
*/
|
|
55
|
+
observability(opts?: ObservabilityEnableOptions): Unsubscribe;
|
|
56
|
+
/**
|
|
57
|
+
* v2.8+ — grouped strategy enabler for cost. Subscribes the strategy
|
|
58
|
+
* to `cost.tick` events; defaults to `inMemorySinkCost()` for
|
|
59
|
+
* read-back / test inspection.
|
|
60
|
+
*/
|
|
61
|
+
cost(opts?: CostEnableOptions): Unsubscribe;
|
|
62
|
+
/**
|
|
63
|
+
* v2.8+ — grouped strategy enabler for chat-bubble live status.
|
|
64
|
+
* Maintains the thinking-state machine; calls strategy.renderStatus
|
|
65
|
+
* each time the rendered line changes (deduped — not on every token).
|
|
66
|
+
* Strategy is required (consumer must wire UI).
|
|
67
|
+
*/
|
|
68
|
+
liveStatus(opts: LiveStatusEnableOptions): Unsubscribe;
|
|
42
69
|
}
|
|
43
70
|
/**
|
|
44
71
|
* Every primitive (LLMCall, Agent), every composition (Sequence, Parallel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/core/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/core/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GA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;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,6EAA6E;AAC7E,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire each grouped strategy to its data source on the dispatcher /
|
|
3
|
+
* recorder substrate. These are the 4 `enable.*` facades' actual
|
|
4
|
+
* implementations; `RunnerBase.enable` calls them with the right
|
|
5
|
+
* dispatcher / attach handle.
|
|
6
|
+
*
|
|
7
|
+
* Pattern: every facade follows the same shape:
|
|
8
|
+
*
|
|
9
|
+
* 1. Resolve strategy (consumer-supplied OR default)
|
|
10
|
+
* 2. Run `strategy.validate?()` — early-fail on misconfig (New Relic
|
|
11
|
+
* panel review)
|
|
12
|
+
* 3. Set up subscription / projection
|
|
13
|
+
* 4. Apply per-strategy event-type filter (`relevantEventTypes`)
|
|
14
|
+
* 5. Apply per-call sample rate
|
|
15
|
+
* 6. Wrap calls in try/catch — route errors to `_onError` (passive
|
|
16
|
+
* recorder rule: never throw to caller)
|
|
17
|
+
* 7. Return Unsubscribe (or handle for lens)
|
|
18
|
+
*/
|
|
19
|
+
import type { EventDispatcher, Unsubscribe } from '../events/dispatcher.js';
|
|
20
|
+
import type { ObservabilityStrategy, CostStrategy, LiveStatusStrategy, CommonStrategyOptions, ObservabilityTier } from './types.js';
|
|
21
|
+
import { type ThinkingTemplates } from '../recorders/observability/thinking/thinkingTemplates.js';
|
|
22
|
+
export interface ObservabilityEnableOptions extends CommonStrategyOptions {
|
|
23
|
+
/** Cost-of-on knob. `'minimal'` → only error + lifecycle events.
|
|
24
|
+
* `'standard'` → most domains. `'firehose'` → every event including
|
|
25
|
+
* per-token streams. Default `'standard'`. */
|
|
26
|
+
readonly tier?: ObservabilityTier;
|
|
27
|
+
readonly strategy?: ObservabilityStrategy;
|
|
28
|
+
}
|
|
29
|
+
export declare function attachObservabilityStrategy(dispatcher: EventDispatcher, opts?: ObservabilityEnableOptions): Unsubscribe;
|
|
30
|
+
export interface CostEnableOptions extends CommonStrategyOptions {
|
|
31
|
+
readonly strategy?: CostStrategy;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to `agentfootprint.cost.tick` events, project payload into
|
|
35
|
+
* the canonical `CostTick` shape, hand to strategy.
|
|
36
|
+
*/
|
|
37
|
+
export declare function attachCostStrategy(dispatcher: EventDispatcher, opts?: CostEnableOptions): Unsubscribe;
|
|
38
|
+
export interface LiveStatusEnableOptions extends CommonStrategyOptions {
|
|
39
|
+
readonly strategy: LiveStatusStrategy;
|
|
40
|
+
/** Override the bundled English thinking templates with locale /
|
|
41
|
+
* per-tool / per-skill overrides. Same shape as
|
|
42
|
+
* `agent.thinkingTemplates(...)`. */
|
|
43
|
+
readonly templates?: ThinkingTemplates;
|
|
44
|
+
/** App name woven into `{{appName}}` template var. */
|
|
45
|
+
readonly appName?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function attachLiveStatusStrategy(dispatcher: EventDispatcher, opts: LiveStatusEnableOptions): Unsubscribe;
|
|
48
|
+
//# sourceMappingURL=attach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../src/strategies/attach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EAEZ,kBAAkB,EAElB,qBAAqB,EACrB,iBAAiB,EAElB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,0DAA0D,CAAC;AA0IlE,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE;;mDAE+C;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAC3C;AAQD,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,eAAe,EAC3B,IAAI,GAAE,0BAA+B,GACpC,WAAW,CA2Bb;AAID,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,eAAe,EAC3B,IAAI,GAAE,iBAAsB,GAC3B,WAAW,CAiCb;AAID,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC;;0CAEsC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IACvC,sDAAsD;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAgBD,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,uBAAuB,GAC5B,WAAW,CA0Bb"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `compose([...])` — fan-out combinator.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Composite. Same shape as React's children array, RxJS's
|
|
5
|
+
* `merge`, OTel's `MultiSpanProcessor`. Pass an array of
|
|
6
|
+
* strategies; get back a single strategy that fan-outs each
|
|
7
|
+
* call to every child.
|
|
8
|
+
*
|
|
9
|
+
* Use when:
|
|
10
|
+
* - Multi-vendor pipelines (`compose([datadog(), otel(), console()])`)
|
|
11
|
+
* - Test instrumentation alongside production sink
|
|
12
|
+
* (`compose([inMemorySink(), stripeBilling()])`) so test assertions
|
|
13
|
+
* can read ticks while production also ships
|
|
14
|
+
* - Tier-staging — local dev mirrors what production sees
|
|
15
|
+
*
|
|
16
|
+
* Per-child error isolation: if one child's `exportEvent` throws, the
|
|
17
|
+
* other children still receive the event. The throwing child's
|
|
18
|
+
* `_onError` is called (if present); otherwise the error is logged
|
|
19
|
+
* via `console.warn` once. One bad sink never breaks the chain.
|
|
20
|
+
*
|
|
21
|
+
* Capabilities are OR-ed across children — if any child supports a
|
|
22
|
+
* capability, the composite reports it as supported. The dispatcher
|
|
23
|
+
* uses this to decide whether to bother building event objects at all.
|
|
24
|
+
*
|
|
25
|
+
* Idempotent operations:
|
|
26
|
+
* - `flush()` — calls every child's `flush()` (sync or async)
|
|
27
|
+
* concurrently, awaits all
|
|
28
|
+
* - `stop()` — calls every child's `stop()` once, in order; failures
|
|
29
|
+
* in one child don't block the others
|
|
30
|
+
*/
|
|
31
|
+
import type { ObservabilityStrategy, CostStrategy, LiveStatusStrategy, LensStrategy } from './types.js';
|
|
32
|
+
/**
|
|
33
|
+
* Compose multiple ObservabilityStrategies into a single fan-out.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const all = composeObservability([
|
|
37
|
+
* consoleObservability(),
|
|
38
|
+
* datadogObservability({ apiKey }),
|
|
39
|
+
* otelObservability(tracer),
|
|
40
|
+
* ]);
|
|
41
|
+
*/
|
|
42
|
+
export declare function composeObservability(children: readonly ObservabilityStrategy[]): ObservabilityStrategy;
|
|
43
|
+
/** Compose CostStrategies. */
|
|
44
|
+
export declare function composeCost(children: readonly CostStrategy[]): CostStrategy;
|
|
45
|
+
/** Compose LiveStatusStrategies. */
|
|
46
|
+
export declare function composeLiveStatus(children: readonly LiveStatusStrategy[]): LiveStatusStrategy;
|
|
47
|
+
/** Compose LensStrategies. */
|
|
48
|
+
export declare function composeLens(children: readonly LensStrategy[]): LensStrategy;
|
|
49
|
+
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../src/strategies/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EAEZ,kBAAkB,EAElB,YAAY,EAEb,MAAM,YAAY,CAAC;AAuEpB;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,GACzC,qBAAqB,CAUvB;AAED,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,CAU3E;AAED,oCAAoC;AACpC,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,kBAAkB,CAU7F;AAED,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,CAU3E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chatBubbleLiveStatus()` — default LiveStatusStrategy.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Strategy. Adapter for a consumer-supplied callback.
|
|
5
|
+
* Role: The "every chat UI" sink. Wraps a `(line: string) => void`
|
|
6
|
+
* callback so the consumer just hands us the function their
|
|
7
|
+
* chat-bubble component needs and we drive it on every
|
|
8
|
+
* rendered status update.
|
|
9
|
+
*
|
|
10
|
+
* Use when:
|
|
11
|
+
* - Building a chat UI (Neo, Lens, embedded widget) where the
|
|
12
|
+
* consumer owns rendering but not state derivation
|
|
13
|
+
* - Tier-1 of compose chains (`compose([chatBubble(setLine), stdout()])`
|
|
14
|
+
* so dev console mirrors what the user sees)
|
|
15
|
+
*
|
|
16
|
+
* The callback runs on EVERY status transition. Consumer can debounce
|
|
17
|
+
* / coalesce per their needs (we don't impose UI policy).
|
|
18
|
+
*/
|
|
19
|
+
import type { LiveStatusStrategy } from '../types.js';
|
|
20
|
+
export interface ChatBubbleLiveStatusOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Required — called per status update with the rendered line.
|
|
23
|
+
* Pass `setStatus` from your React component, or any function
|
|
24
|
+
* whose job is "show this line in the chat bubble."
|
|
25
|
+
*
|
|
26
|
+
* NOTE: this is INTENTIONALLY the only callback. If you need access
|
|
27
|
+
* to the underlying `ThinkingState` (for color-per-state, animation
|
|
28
|
+
* triggers, etc.), build your own `LiveStatusStrategy` directly OR
|
|
29
|
+
* use `compose([chatBubbleLiveStatus({onLine}), customStrategy])`.
|
|
30
|
+
* We don't surface `ThinkingState` here because it's an INTERNAL
|
|
31
|
+
* shape — exposing it would couple consumer UIs to changes in the
|
|
32
|
+
* state machine.
|
|
33
|
+
*/
|
|
34
|
+
readonly onLine: (line: string) => void;
|
|
35
|
+
}
|
|
36
|
+
export declare function chatBubbleLiveStatus(opts: ChatBubbleLiveStatusOptions): LiveStatusStrategy;
|
|
37
|
+
//# sourceMappingURL=chatBubbleLiveStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatBubbleLiveStatus.d.ts","sourceRoot":"","sources":["../../../../src/strategies/defaults/chatBubbleLiveStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,aAAa,CAAC;AAEpE,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,kBAAkB,CAgB1F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `consoleObservability()` — default ObservabilityStrategy.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Strategy. Adapter for `globalThis.console`. Used when no
|
|
5
|
+
* vendor-specific strategy is configured (zero-config dev
|
|
6
|
+
* experience). Same role as `NoOpCacheStrategy` is for the
|
|
7
|
+
* cache layer.
|
|
8
|
+
* Role: Tier-1 fallback — print every event to the console with a
|
|
9
|
+
* one-line type+payload summary. Vendor-neutral, dependency-
|
|
10
|
+
* free, works in browser + Node + Deno + Bun.
|
|
11
|
+
*
|
|
12
|
+
* Use when:
|
|
13
|
+
* - Local development (`agent.enable.observability()` with no opts)
|
|
14
|
+
* - CI logs ("what events fired during this test?")
|
|
15
|
+
* - Tier-1 of compose chains (`compose([console(), datadog()])`)
|
|
16
|
+
*
|
|
17
|
+
* Don't use when: production. Console output is unstructured + can't
|
|
18
|
+
* be queried; switch to a vendor strategy (Datadog, OTel, CloudWatch).
|
|
19
|
+
*/
|
|
20
|
+
import type { AgentfootprintEvent } from '../../events/registry.js';
|
|
21
|
+
import type { ObservabilityStrategy } from '../types.js';
|
|
22
|
+
export interface ConsoleObservabilityOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Where to write. Defaults to `globalThis.console`. Override for
|
|
25
|
+
* tests or to wrap with a custom sink (browser DevTools' grouped
|
|
26
|
+
* console, a Node.js stream, etc.).
|
|
27
|
+
*/
|
|
28
|
+
readonly logger?: {
|
|
29
|
+
log(...args: unknown[]): void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Custom line formatter. Receives the typed event; returns the line.
|
|
33
|
+
* Defaults to `[type] payload-as-JSON`. Override to colorize, filter
|
|
34
|
+
* fields, or pretty-print.
|
|
35
|
+
*/
|
|
36
|
+
readonly format?: (event: AgentfootprintEvent) => string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Factory. Returns a fresh ObservabilityStrategy each call so multiple
|
|
40
|
+
* agents in the same process get independent instances.
|
|
41
|
+
*/
|
|
42
|
+
export declare function consoleObservability(opts?: ConsoleObservabilityOptions): ObservabilityStrategy;
|
|
43
|
+
//# sourceMappingURL=consoleObservability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consoleObservability.d.ts","sourceRoot":"","sources":["../../../../src/strategies/defaults/consoleObservability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;KAAE,CAAC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,MAAM,CAAC;CAC1D;AAmBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,GAAE,2BAAgC,GACrC,qBAAqB,CAUvB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `inMemorySinkCost()` — default CostStrategy.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Strategy. In-process accumulator. Same role as InMemoryStore
|
|
5
|
+
* for memory-providers.
|
|
6
|
+
* Role: Tier-1 fallback — accumulate cost ticks in a process-local
|
|
7
|
+
* array. Consumer reads via `getTicks()` or hooks `onRecord`
|
|
8
|
+
* for streaming. Vendor-free.
|
|
9
|
+
*
|
|
10
|
+
* Use when:
|
|
11
|
+
* - Tests / CI ("what cost did this run accrue?")
|
|
12
|
+
* - Local dev before billing integration
|
|
13
|
+
* - Tier-1 of compose chains (`compose([inMemorySink(), stripeBilling()])`
|
|
14
|
+
* so test assertions can read ticks while production also ships)
|
|
15
|
+
*
|
|
16
|
+
* Don't use when: process is long-running with high cost-tick volume —
|
|
17
|
+
* the buffer grows unbounded. Add a `maxTicks` cap (drops oldest) or
|
|
18
|
+
* pair with a streaming strategy (`stripeBilling`, `webhook`).
|
|
19
|
+
*/
|
|
20
|
+
import type { CostStrategy, CostTick } from '../types.js';
|
|
21
|
+
export interface InMemorySinkCostOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Optional streaming hook called per tick. Useful for piping the
|
|
24
|
+
* accumulator into a custom sink without writing a full strategy.
|
|
25
|
+
*/
|
|
26
|
+
readonly onRecord?: (tick: CostTick) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum ticks to retain in the buffer. When exceeded, the OLDEST
|
|
29
|
+
* tick is dropped (FIFO). Default `Infinity` — no cap.
|
|
30
|
+
*/
|
|
31
|
+
readonly maxTicks?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Extended interface — the in-memory sink also exposes the buffer
|
|
35
|
+
* for read-back. Strategies aren't required to do this; this one
|
|
36
|
+
* does because that IS its purpose (accumulate for inspection).
|
|
37
|
+
*/
|
|
38
|
+
export interface InMemorySinkCostStrategy extends CostStrategy {
|
|
39
|
+
/** Snapshot of the buffered ticks. O(n) per call — for cheap
|
|
40
|
+
* polling use `getTicksCount()` + `getTicksSince(idx)`. */
|
|
41
|
+
readonly getTicks: () => readonly CostTick[];
|
|
42
|
+
/** Cheap O(1) read for "did anything new arrive?" polling. */
|
|
43
|
+
readonly getTicksCount: () => number;
|
|
44
|
+
/** Incremental read — returns ticks WITH index >= `idx`. Lets a
|
|
45
|
+
* dashboard poll cheaply by tracking its last-seen index. */
|
|
46
|
+
readonly getTicksSince: (idx: number) => readonly CostTick[];
|
|
47
|
+
/** Drop all buffered ticks. */
|
|
48
|
+
readonly clear: () => void;
|
|
49
|
+
}
|
|
50
|
+
export declare function inMemorySinkCost(opts?: InMemorySinkCostOptions): InMemorySinkCostStrategy;
|
|
51
|
+
//# sourceMappingURL=inMemorySinkCost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inMemorySinkCost.d.ts","sourceRoot":"","sources":["../../../../src/strategies/defaults/inMemorySinkCost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D;gEAC4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAAE,CAAC;IAC7C,8DAA8D;IAC9D,QAAQ,CAAC,aAAa,EAAE,MAAM,MAAM,CAAC;IACrC;kEAC8D;IAC9D,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,QAAQ,EAAE,CAAC;IAC7D,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,GAAG,wBAAwB,CA0B7F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default strategies — the four "shipped in core" sinks.
|
|
3
|
+
*
|
|
4
|
+
* `consoleObservability` — print events to console
|
|
5
|
+
* `inMemorySinkCost` — accumulate cost ticks in a process-local buffer
|
|
6
|
+
* `chatBubbleLiveStatus` — call a consumer-supplied line callback
|
|
7
|
+
* `noopLens` — drop graph updates (zero-arg fallback)
|
|
8
|
+
*
|
|
9
|
+
* Vendor strategies (datadog, otel, agentcore, cloudwatch, …) ship as
|
|
10
|
+
* separate subpaths with peer-dep on the vendor SDK. See
|
|
11
|
+
* `docs/inspiration/strategy-everywhere.md` for the AWS-first roadmap.
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────
|
|
14
|
+
* Why defaults skip `validate()`:
|
|
15
|
+
*
|
|
16
|
+
* The optional `BaseStrategy.validate()` hook is the right place for
|
|
17
|
+
* runtime config checks (API keys, endpoint reachability, peer-dep
|
|
18
|
+
* presence). Defaults skip it by design — their inputs are TypeScript-
|
|
19
|
+
* checked at construction, and they don't talk to a remote vendor that
|
|
20
|
+
* might be misconfigured.
|
|
21
|
+
*
|
|
22
|
+
* Vendor strategies that DO talk to a remote (datadog, agentcore,
|
|
23
|
+
* cloudwatch) MUST implement `validate()` per the New Relic panel
|
|
24
|
+
* review — early-fail-with-useful-message beats silent zero-emission.
|
|
25
|
+
* ─────────────────────────────────────────────────────────────────
|
|
26
|
+
*/
|
|
27
|
+
export { consoleObservability, type ConsoleObservabilityOptions } from './consoleObservability.js';
|
|
28
|
+
export { inMemorySinkCost, type InMemorySinkCostOptions, type InMemorySinkCostStrategy, } from './inMemorySinkCost.js';
|
|
29
|
+
export { chatBubbleLiveStatus, type ChatBubbleLiveStatusOptions } from './chatBubbleLiveStatus.js';
|
|
30
|
+
export { noopLens, type NoopLensOptions } from './noopLens.js';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategies/defaults/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,KAAK,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `noopLens()` — default LensStrategy.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Strategy. Wildcard fallback. Same role as `NoOpCacheStrategy`.
|
|
5
|
+
* Role: Drops every update. Used when no Lens vendor strategy is
|
|
6
|
+
* configured AND the consumer hasn't supplied a callback.
|
|
7
|
+
* Keeps `enable.lens()` callable without args without
|
|
8
|
+
* throwing — important for the zero-arg HelloWorld pattern.
|
|
9
|
+
*
|
|
10
|
+
* Use when:
|
|
11
|
+
* - You want the agent to run without a Lens UI (production
|
|
12
|
+
* server-side, headless eval, batch jobs)
|
|
13
|
+
* - Tier-1 of compose chains where you want the chain to compile
|
|
14
|
+
* even if the real Lens strategy is conditional
|
|
15
|
+
*
|
|
16
|
+
* Don't use when: you actually want to see the StepGraph. Use
|
|
17
|
+
* `lens-browser`, `lens-cli`, or `lens-jsonExport` from the
|
|
18
|
+
* vendor-strategy subpaths once they ship in v2.12+.
|
|
19
|
+
*/
|
|
20
|
+
import type { LensStrategy, LensUpdate } from '../types.js';
|
|
21
|
+
export interface NoopLensOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Optional callback called per update — useful for tests that want
|
|
24
|
+
* to verify the strategy was wired without actually rendering.
|
|
25
|
+
*/
|
|
26
|
+
readonly onUpdate?: (update: LensUpdate) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function noopLens(opts?: NoopLensOptions): LensStrategy;
|
|
29
|
+
//# sourceMappingURL=noopLens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noopLens.d.ts","sourceRoot":"","sources":["../../../../src/strategies/defaults/noopLens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,YAAY,CAQjE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agentfootprint/strategies` — typed strategy interfaces + default
|
|
3
|
+
* sinks for the v2.8 grouped-enabler architecture.
|
|
4
|
+
*
|
|
5
|
+
* See:
|
|
6
|
+
* - `docs/inspiration/strategy-everywhere.md` — design memo + AWS-first roadmap
|
|
7
|
+
* - `types.ts` — typed interfaces (Observability, Cost, LiveStatus, Lens)
|
|
8
|
+
* - `defaults/` — the 4 in-core default strategies
|
|
9
|
+
*
|
|
10
|
+
* Vendor strategies ship as separate subpaths:
|
|
11
|
+
* - `agentfootprint/observability-agentcore` (v2.8.1)
|
|
12
|
+
* - `agentfootprint/observability-cloudwatch` (v2.8.2)
|
|
13
|
+
* - `agentfootprint/observability-xray` (v2.8.3)
|
|
14
|
+
* - `agentfootprint/observability-otel` (v2.9.x)
|
|
15
|
+
* - `agentfootprint/observability-datadog` (v2.9.x)
|
|
16
|
+
* - `agentfootprint/cost-stripe` (v2.10.x)
|
|
17
|
+
* - `agentfootprint/lens-browser` / `lens-cli` (v2.12.x)
|
|
18
|
+
*/
|
|
19
|
+
export * from './types.js';
|
|
20
|
+
export * from './defaults/index.js';
|
|
21
|
+
export { composeObservability, composeCost, composeLiveStatus, composeLens } from './compose.js';
|
|
22
|
+
export { attachObservabilityStrategy, attachCostStrategy, attachLiveStatusStrategy, type ObservabilityEnableOptions, type CostEnableOptions, type LiveStatusEnableOptions, } from './attach.js';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy registry — name → factory for each of the 4 groups.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `src/cache/strategyRegistry.ts` exactly: maps a string name
|
|
5
|
+
* to a factory function that takes vendor-specific config and returns
|
|
6
|
+
* a typed strategy instance. Vendor adapter subpaths self-register on
|
|
7
|
+
* import via side-effect.
|
|
8
|
+
*
|
|
9
|
+
* Two ways consumers wire a strategy:
|
|
10
|
+
*
|
|
11
|
+
* 1. By NAME (registry lookup) — the recommended path for vendor
|
|
12
|
+
* adapters:
|
|
13
|
+
* ```ts
|
|
14
|
+
* import 'agentfootprint/observability-datadog'; // self-registers 'datadog'
|
|
15
|
+
* agent.enable.observability({ vendor: 'datadog', config: { apiKey } });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* 2. By INSTANCE (explicit pass) — for custom in-house strategies
|
|
19
|
+
* or test mocks:
|
|
20
|
+
* ```ts
|
|
21
|
+
* agent.enable.observability({ strategy: myCustomStrategy });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* The two paths are mutually exclusive in `EnableOptions` — the type
|
|
25
|
+
* union enforces that consumers pick one.
|
|
26
|
+
*
|
|
27
|
+
* Lookup is exact-match by name (case-insensitive fallback). Unknown
|
|
28
|
+
* names return `undefined`; the consumer's `enable.X` then no-ops
|
|
29
|
+
* (per "do nothing if not configured" rule).
|
|
30
|
+
*/
|
|
31
|
+
import type { ObservabilityStrategy, CostStrategy, LiveStatusStrategy, LensStrategy } from './types.js';
|
|
32
|
+
/** Vendor adapter subpaths register a factory keyed by their vendor
|
|
33
|
+
* name. Config shape is vendor-specific — type-erased at the registry
|
|
34
|
+
* boundary; consumer's responsibility to pass the right shape. */
|
|
35
|
+
export type ObservabilityFactory = (config?: unknown) => ObservabilityStrategy;
|
|
36
|
+
export type CostFactory = (config?: unknown) => CostStrategy;
|
|
37
|
+
export type LiveStatusFactory = (config?: unknown) => LiveStatusStrategy;
|
|
38
|
+
export type LensFactory = (config?: unknown) => LensStrategy;
|
|
39
|
+
/**
|
|
40
|
+
* Register a vendor observability strategy by name. Called from the
|
|
41
|
+
* vendor's subpath at module load (side-effect import):
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* // agentfootprint/observability-datadog/index.ts
|
|
45
|
+
* import { registerObservabilityStrategy } from 'agentfootprint/strategies';
|
|
46
|
+
* registerObservabilityStrategy('datadog', (config) => datadogObservability(config));
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* Replacing an existing registration is allowed — most-recent wins.
|
|
50
|
+
* Useful for test mocks.
|
|
51
|
+
*/
|
|
52
|
+
export declare function registerObservabilityStrategy(name: string, factory: ObservabilityFactory): void;
|
|
53
|
+
/** Look up an observability factory by vendor name. Case-insensitive
|
|
54
|
+
* fallback. Returns `undefined` when the name is unknown — caller
|
|
55
|
+
* decides to noop or throw. */
|
|
56
|
+
export declare function getObservabilityStrategy(name: string): ObservabilityFactory | undefined;
|
|
57
|
+
/** Diagnostic — list all registered vendor names. */
|
|
58
|
+
export declare function listObservabilityStrategies(): readonly string[];
|
|
59
|
+
export declare function registerCostStrategy(name: string, factory: CostFactory): void;
|
|
60
|
+
export declare function getCostStrategy(name: string): CostFactory | undefined;
|
|
61
|
+
export declare function listCostStrategies(): readonly string[];
|
|
62
|
+
export declare function registerLiveStatusStrategy(name: string, factory: LiveStatusFactory): void;
|
|
63
|
+
export declare function getLiveStatusStrategy(name: string): LiveStatusFactory | undefined;
|
|
64
|
+
export declare function listLiveStatusStrategies(): readonly string[];
|
|
65
|
+
export declare function registerLensStrategy(name: string, factory: LensFactory): void;
|
|
66
|
+
export declare function getLensStrategy(name: string): LensFactory | undefined;
|
|
67
|
+
export declare function listLensStrategies(): readonly string[];
|
|
68
|
+
/** Reset every registry to empty. Tests only — not in the public
|
|
69
|
+
* barrel. */
|
|
70
|
+
export declare function _resetRegistriesForTests(): void;
|
|
71
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/strategies/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACb,MAAM,YAAY,CAAC;AAIpB;;mEAEmE;AACnE,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,qBAAqB,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,YAAY,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,kBAAkB,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,YAAY,CAAC;AAW7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAE/F;AAED;;gCAEgC;AAChC,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAEvF;AAED,qDAAqD;AACrD,wBAAgB,2BAA2B,IAAI,SAAS,MAAM,EAAE,CAE/D;AAID,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAE7E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAED,wBAAgB,kBAAkB,IAAI,SAAS,MAAM,E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