agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
49 lines • 2.28 kB
TypeScript
/**
* `compose([...])` — fan-out combinator.
*
* Pattern: Composite. Same shape as React's children array, RxJS's
* `merge`, OTel's `MultiSpanProcessor`. Pass an array of
* strategies; get back a single strategy that fan-outs each
* call to every child.
*
* Use when:
* - Multi-vendor pipelines (`compose([datadog(), otel(), console()])`)
* - Test instrumentation alongside production sink
* (`compose([inMemorySink(), stripeBilling()])`) so test assertions
* can read ticks while production also ships
* - Tier-staging — local dev mirrors what production sees
*
* Per-child error isolation: if one child's `exportEvent` throws, the
* other children still receive the event. The throwing child's
* `_onError` is called (if present); otherwise the error is logged
* via `console.warn` once. One bad sink never breaks the chain.
*
* Capabilities are OR-ed across children — if any child supports a
* capability, the composite reports it as supported. The dispatcher
* uses this to decide whether to bother building event objects at all.
*
* Idempotent operations:
* - `flush()` — calls every child's `flush()` (sync or async)
* concurrently, awaits all
* - `stop()` — calls every child's `stop()` once, in order; failures
* in one child don't block the others
*/
import type { ObservabilityStrategy, CostStrategy, LiveStatusStrategy, LensStrategy } from './types.js';
/**
* Compose multiple ObservabilityStrategies into a single fan-out.
*
* @example
* const all = composeObservability([
* consoleObservability(),
* cloudwatchObservability({ logGroupName: '/agent/prod' }),
* otelObservability({ serviceName: 'my-agent-prod' }),
* ]);
*/
export declare function composeObservability(children: readonly ObservabilityStrategy[]): ObservabilityStrategy;
/** Compose CostStrategies. */
export declare function composeCost(children: readonly CostStrategy[]): CostStrategy;
/** Compose LiveStatusStrategies. */
export declare function composeLiveStatus(children: readonly LiveStatusStrategy[]): LiveStatusStrategy;
/** Compose LensStrategies. */
export declare function composeLens(children: readonly LensStrategy[]): LensStrategy;
//# sourceMappingURL=compose.d.ts.map