@mastra/observability 0.0.0-main-test-2-20251127211532 → 0.0.0-partial-response-backport-20251204204441
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/CHANGELOG.md +36 -87
- package/dist/index.cjs +0 -2313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2293
- package/dist/index.js.map +1 -1
- package/package.json +15 -17
- package/README.md +0 -99
- package/dist/config.d.ts +0 -445
- package/dist/config.d.ts.map +0 -1
- package/dist/default.d.ts +0 -29
- package/dist/default.d.ts.map +0 -1
- package/dist/exporters/base.d.ts +0 -111
- package/dist/exporters/base.d.ts.map +0 -1
- package/dist/exporters/cloud.d.ts +0 -30
- package/dist/exporters/cloud.d.ts.map +0 -1
- package/dist/exporters/console.d.ts +0 -10
- package/dist/exporters/console.d.ts.map +0 -1
- package/dist/exporters/default.d.ts +0 -89
- package/dist/exporters/default.d.ts.map +0 -1
- package/dist/exporters/index.d.ts +0 -10
- package/dist/exporters/index.d.ts.map +0 -1
- package/dist/exporters/test.d.ts +0 -13
- package/dist/exporters/test.d.ts.map +0 -1
- package/dist/instances/base.d.ts +0 -110
- package/dist/instances/base.d.ts.map +0 -1
- package/dist/instances/default.d.ts +0 -8
- package/dist/instances/default.d.ts.map +0 -1
- package/dist/instances/index.d.ts +0 -6
- package/dist/instances/index.d.ts.map +0 -1
- package/dist/model-tracing.d.ts +0 -48
- package/dist/model-tracing.d.ts.map +0 -1
- package/dist/registry.d.ts +0 -49
- package/dist/registry.d.ts.map +0 -1
- package/dist/span_processors/index.d.ts +0 -5
- package/dist/span_processors/index.d.ts.map +0 -1
- package/dist/span_processors/sensitive-data-filter.d.ts +0 -85
- package/dist/span_processors/sensitive-data-filter.d.ts.map +0 -1
- package/dist/spans/base.d.ts +0 -109
- package/dist/spans/base.d.ts.map +0 -1
- package/dist/spans/default.d.ts +0 -13
- package/dist/spans/default.d.ts.map +0 -1
- package/dist/spans/index.d.ts +0 -7
- package/dist/spans/index.d.ts.map +0 -1
- package/dist/spans/no-op.d.ts +0 -15
- package/dist/spans/no-op.d.ts.map +0 -1
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { TracingEvent, InitExporterOptions, TracingStorageStrategy } from '@mastra/core/observability';
|
|
2
|
-
import type { BaseExporterConfig } from './base.js';
|
|
3
|
-
import { BaseExporter } from './base.js';
|
|
4
|
-
interface DefaultExporterConfig extends BaseExporterConfig {
|
|
5
|
-
maxBatchSize?: number;
|
|
6
|
-
maxBufferSize?: number;
|
|
7
|
-
maxBatchWaitMs?: number;
|
|
8
|
-
maxRetries?: number;
|
|
9
|
-
retryDelayMs?: number;
|
|
10
|
-
strategy?: TracingStorageStrategy | 'auto';
|
|
11
|
-
}
|
|
12
|
-
export declare class DefaultExporter extends BaseExporter {
|
|
13
|
-
#private;
|
|
14
|
-
name: string;
|
|
15
|
-
private buffer;
|
|
16
|
-
private allCreatedSpans;
|
|
17
|
-
constructor(config?: DefaultExporterConfig);
|
|
18
|
-
/**
|
|
19
|
-
* Initialize the exporter (called after all dependencies are ready)
|
|
20
|
-
*/
|
|
21
|
-
init(options: InitExporterOptions): void;
|
|
22
|
-
/**
|
|
23
|
-
* Initialize the resolved strategy once storage is available
|
|
24
|
-
*/
|
|
25
|
-
private initializeStrategy;
|
|
26
|
-
/**
|
|
27
|
-
* Builds a unique span key for tracking
|
|
28
|
-
*/
|
|
29
|
-
private buildSpanKey;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the next sequence number for a span
|
|
32
|
-
*/
|
|
33
|
-
private getNextSequence;
|
|
34
|
-
/**
|
|
35
|
-
* Handles out-of-order span updates by logging and skipping
|
|
36
|
-
*/
|
|
37
|
-
private handleOutOfOrderUpdate;
|
|
38
|
-
/**
|
|
39
|
-
* Adds an event to the appropriate buffer based on strategy
|
|
40
|
-
*/
|
|
41
|
-
private addToBuffer;
|
|
42
|
-
/**
|
|
43
|
-
* Checks if buffer should be flushed based on size or time triggers
|
|
44
|
-
*/
|
|
45
|
-
private shouldFlush;
|
|
46
|
-
/**
|
|
47
|
-
* Resets the buffer after successful flush
|
|
48
|
-
*/
|
|
49
|
-
private resetBuffer;
|
|
50
|
-
/**
|
|
51
|
-
* Schedules a flush using setTimeout
|
|
52
|
-
*/
|
|
53
|
-
private scheduleFlush;
|
|
54
|
-
/**
|
|
55
|
-
* Serializes span attributes to storage record format
|
|
56
|
-
* Handles all Span types and their specific attributes
|
|
57
|
-
*/
|
|
58
|
-
private serializeAttributes;
|
|
59
|
-
private buildCreateRecord;
|
|
60
|
-
private buildUpdateRecord;
|
|
61
|
-
/**
|
|
62
|
-
* Handles realtime strategy - processes each event immediately
|
|
63
|
-
*/
|
|
64
|
-
private handleRealtimeEvent;
|
|
65
|
-
/**
|
|
66
|
-
* Handles batch-with-updates strategy - buffers events and processes in batches
|
|
67
|
-
*/
|
|
68
|
-
private handleBatchWithUpdatesEvent;
|
|
69
|
-
/**
|
|
70
|
-
* Handles insert-only strategy - only processes SPAN_ENDED events in batches
|
|
71
|
-
*/
|
|
72
|
-
private handleInsertOnlyEvent;
|
|
73
|
-
/**
|
|
74
|
-
* Calculates retry delay using exponential backoff
|
|
75
|
-
*/
|
|
76
|
-
private calculateRetryDelay;
|
|
77
|
-
/**
|
|
78
|
-
* Flushes the current buffer to storage with retry logic
|
|
79
|
-
*/
|
|
80
|
-
private flush;
|
|
81
|
-
/**
|
|
82
|
-
* Attempts to flush with exponential backoff retry logic
|
|
83
|
-
*/
|
|
84
|
-
private flushWithRetries;
|
|
85
|
-
_exportTracingEvent(event: TracingEvent): Promise<void>;
|
|
86
|
-
shutdown(): Promise<void>;
|
|
87
|
-
}
|
|
88
|
-
export {};
|
|
89
|
-
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/exporters/default.ts"],"names":[],"mappings":"A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mB;IAI3B;;OAEG;YACW,KAAK;IAsDnB;;OAEG;YACW,gBAAgB;IA2DxB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBvD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAuBhC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mastra Tracing Exporters
|
|
3
|
-
*/
|
|
4
|
-
export * from './base.js';
|
|
5
|
-
export { CloudExporter } from './cloud.js';
|
|
6
|
-
export type { CloudExporterConfig } from './cloud.js';
|
|
7
|
-
export * from './console.js';
|
|
8
|
-
export * from './default.js';
|
|
9
|
-
export * from './test.js';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exporters/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,QAAQ,CAAC;AAGvB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
package/dist/exporters/test.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TracingEvent } from '@mastra/core/observability';
|
|
2
|
-
import { BaseExporter } from './base.js';
|
|
3
|
-
import type { BaseExporterConfig } from './base.js';
|
|
4
|
-
export declare class TestExporter extends BaseExporter {
|
|
5
|
-
#private;
|
|
6
|
-
name: string;
|
|
7
|
-
constructor(config?: BaseExporterConfig);
|
|
8
|
-
protected _exportTracingEvent(event: TracingEvent): Promise<void>;
|
|
9
|
-
clearEvents(): void;
|
|
10
|
-
get events(): TracingEvent[];
|
|
11
|
-
shutdown(): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/exporters/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,qBAAa,YAAa,SAAQ,YAAY;;IAC5C,IAAI,SAA2B;gBAGnB,MAAM,GAAE,kBAAuB;cAI3B,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvE,WAAW;IAIX,IAAI,MAAM,IAAI,YAAY,EAAE,CAE3B;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|
package/dist/instances/base.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BaseObservability - Abstract base class for Observability implementations
|
|
3
|
-
*/
|
|
4
|
-
import { MastraBase } from '@mastra/core/base';
|
|
5
|
-
import type { RequestContext } from '@mastra/core/di';
|
|
6
|
-
import type { IMastraLogger } from '@mastra/core/logger';
|
|
7
|
-
import type { Span, SpanType, ObservabilityExporter, ObservabilityBridge, SpanOutputProcessor, TracingEvent, AnySpan, StartSpanOptions, CreateSpanOptions, ObservabilityInstance, CustomSamplerOptions, AnyExportedSpan, TraceState, TracingOptions } from '@mastra/core/observability';
|
|
8
|
-
import type { ObservabilityInstanceConfig } from '../config.js';
|
|
9
|
-
/**
|
|
10
|
-
* Abstract base class for all Observability implementations in Mastra.
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class BaseObservabilityInstance extends MastraBase implements ObservabilityInstance {
|
|
13
|
-
protected config: ObservabilityInstanceConfig;
|
|
14
|
-
constructor(config: ObservabilityInstanceConfig);
|
|
15
|
-
/**
|
|
16
|
-
* Override setLogger to add Observability specific initialization log
|
|
17
|
-
* and propagate logger to exporters and bridge
|
|
18
|
-
*/
|
|
19
|
-
__setLogger(logger: IMastraLogger): void;
|
|
20
|
-
protected get exporters(): ObservabilityExporter[];
|
|
21
|
-
protected get spanOutputProcessors(): SpanOutputProcessor[];
|
|
22
|
-
/**
|
|
23
|
-
* Start a new span of a specific SpanType
|
|
24
|
-
*/
|
|
25
|
-
startSpan<TType extends SpanType>(options: StartSpanOptions<TType>): Span<TType>;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new span (called after sampling)
|
|
28
|
-
*
|
|
29
|
-
* Implementations should:
|
|
30
|
-
* 1. Create a plain span with the provided attributes
|
|
31
|
-
* 2. Return the span - base class handles all tracing lifecycle automatically
|
|
32
|
-
*
|
|
33
|
-
* The base class will automatically:
|
|
34
|
-
* - Set trace relationships
|
|
35
|
-
* - Wire span lifecycle callbacks
|
|
36
|
-
* - Emit span_started event
|
|
37
|
-
*/
|
|
38
|
-
protected abstract createSpan<TType extends SpanType>(options: CreateSpanOptions<TType>): Span<TType>;
|
|
39
|
-
/**
|
|
40
|
-
* Get current configuration
|
|
41
|
-
*/
|
|
42
|
-
getConfig(): Readonly<ObservabilityInstanceConfig>;
|
|
43
|
-
/**
|
|
44
|
-
* Get all exporters
|
|
45
|
-
*/
|
|
46
|
-
getExporters(): readonly ObservabilityExporter[];
|
|
47
|
-
/**
|
|
48
|
-
* Get all span output processors
|
|
49
|
-
*/
|
|
50
|
-
getSpanOutputProcessors(): readonly SpanOutputProcessor[];
|
|
51
|
-
/**
|
|
52
|
-
* Get the bridge instance if configured
|
|
53
|
-
*/
|
|
54
|
-
getBridge(): ObservabilityBridge | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Get the logger instance (for exporters and other components)
|
|
57
|
-
*/
|
|
58
|
-
getLogger(): IMastraLogger;
|
|
59
|
-
/**
|
|
60
|
-
* Automatically wires up Observability lifecycle events for any span
|
|
61
|
-
* This ensures all spans emit events regardless of implementation
|
|
62
|
-
*/
|
|
63
|
-
private wireSpanLifecycle;
|
|
64
|
-
/**
|
|
65
|
-
* Check if a trace should be sampled
|
|
66
|
-
*/
|
|
67
|
-
protected shouldSample(options?: CustomSamplerOptions): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Compute TraceState for a new trace based on configured and per-request keys
|
|
70
|
-
*/
|
|
71
|
-
protected computeTraceState(tracingOptions?: TracingOptions): TraceState | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Extract metadata from RequestContext using TraceState
|
|
74
|
-
*/
|
|
75
|
-
protected extractMetadataFromRequestContext(requestContext: RequestContext | undefined, explicitMetadata: Record<string, any> | undefined, traceState: TraceState | undefined): Record<string, any> | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Extract specific keys from RequestContext
|
|
78
|
-
*/
|
|
79
|
-
protected extractKeys(requestContext: RequestContext, keys: string[]): Record<string, any>;
|
|
80
|
-
/**
|
|
81
|
-
* Process a span through all output processors
|
|
82
|
-
*/
|
|
83
|
-
private processSpan;
|
|
84
|
-
getSpanForExport(span: AnySpan): AnyExportedSpan | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* Emit a span started event
|
|
87
|
-
*/
|
|
88
|
-
protected emitSpanStarted(span: AnySpan): void;
|
|
89
|
-
/**
|
|
90
|
-
* Emit a span ended event (called automatically when spans end)
|
|
91
|
-
*/
|
|
92
|
-
protected emitSpanEnded(span: AnySpan): void;
|
|
93
|
-
/**
|
|
94
|
-
* Emit a span updated event
|
|
95
|
-
*/
|
|
96
|
-
protected emitSpanUpdated(span: AnySpan): void;
|
|
97
|
-
/**
|
|
98
|
-
* Export tracing event through all exporters and bridge (realtime mode)
|
|
99
|
-
*/
|
|
100
|
-
protected exportTracingEvent(event: TracingEvent): Promise<void>;
|
|
101
|
-
/**
|
|
102
|
-
* Initialize Observability (called by Mastra during component registration)
|
|
103
|
-
*/
|
|
104
|
-
init(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Shutdown Observability and clean up resources
|
|
107
|
-
*/
|
|
108
|
-
shutdown(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,IAAI,IAAI,IAAI;IASZ;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBhC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SpanType, Span, CreateSpanOptions } from '@mastra/core/observability';
|
|
2
|
-
import type { ObservabilityInstanceConfig } from '../config.js';
|
|
3
|
-
import { BaseObservabilityInstance } from './base.js';
|
|
4
|
-
export declare class DefaultObservabilityInstance extends BaseObservabilityInstance {
|
|
5
|
-
constructor(config: ObservabilityInstanceConfig);
|
|
6
|
-
protected createSpan<TType extends SpanType>(options: CreateSpanOptions<TType>): Span<TType>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/instances/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AAEnD,qBAAa,4BAA6B,SAAQ,yBAAyB;gBAC7D,MAAM,EAAE,2BAA2B;IAI/C,SAAS,CAAC,UAAU,CAAC,KAAK,SAAS,QAAQ,EAAE,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;CAI7F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/instances/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
package/dist/model-tracing.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model Span Tracing
|
|
3
|
-
*
|
|
4
|
-
* Provides span tracking for Model generations, including:
|
|
5
|
-
* - MODEL_STEP spans (one per Model API call)
|
|
6
|
-
* - MODEL_CHUNK spans (individual streaming chunks within a step)
|
|
7
|
-
*
|
|
8
|
-
* Hierarchy: MODEL_GENERATION -> MODEL_STEP -> MODEL_CHUNK
|
|
9
|
-
*/
|
|
10
|
-
import { SpanType } from '@mastra/core/observability';
|
|
11
|
-
import type { Span, EndSpanOptions, ErrorSpanOptions, TracingContext, UpdateSpanOptions } from '@mastra/core/observability';
|
|
12
|
-
/**
|
|
13
|
-
* Manages MODEL_STEP and MODEL_CHUNK span tracking for streaming Model responses.
|
|
14
|
-
*
|
|
15
|
-
* Should be instantiated once per MODEL_GENERATION span and shared across
|
|
16
|
-
* all streaming steps (including after tool calls).
|
|
17
|
-
*/
|
|
18
|
-
export declare class ModelSpanTracker {
|
|
19
|
-
#private;
|
|
20
|
-
constructor(modelSpan?: Span<SpanType.MODEL_GENERATION>);
|
|
21
|
-
/**
|
|
22
|
-
* Get the tracing context for creating child spans.
|
|
23
|
-
* Returns the current step span if active, otherwise the model span.
|
|
24
|
-
*/
|
|
25
|
-
getTracingContext(): TracingContext;
|
|
26
|
-
/**
|
|
27
|
-
* Report an error on the generation span
|
|
28
|
-
*/
|
|
29
|
-
reportGenerationError(options: ErrorSpanOptions<SpanType.MODEL_GENERATION>): void;
|
|
30
|
-
/**
|
|
31
|
-
* End the generation span
|
|
32
|
-
*/
|
|
33
|
-
endGeneration(options?: EndSpanOptions<SpanType.MODEL_GENERATION>): void;
|
|
34
|
-
/**
|
|
35
|
-
* Update the generation span
|
|
36
|
-
*/
|
|
37
|
-
updateGeneration(options: UpdateSpanOptions<SpanType.MODEL_GENERATION>): void;
|
|
38
|
-
/**
|
|
39
|
-
* Wraps a stream with model tracing transform to track MODEL_STEP and MODEL_CHUNK spans.
|
|
40
|
-
*
|
|
41
|
-
* This should be added to the stream pipeline to automatically
|
|
42
|
-
* create MODEL_STEP and MODEL_CHUNK spans for each semantic unit in the stream.
|
|
43
|
-
*/
|
|
44
|
-
wrapStream<T extends {
|
|
45
|
-
pipeThrough: Function;
|
|
46
|
-
}>(stream: T): T;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=model-tracing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-tracing.d.ts","sourceRoot":"","sources":["../src/model-tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAGpC;;;;;GAKG;AACH,qBAAa,gBAAgB;;gBAQf,SAAS,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAIvD;;;OAGG;IACH,iBAAiB,IAAI,cAAc;IAMnC;;OAEG;IACH,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAIjF;;OAEG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAIxE;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI;IA4O7E;;;;;OAKG;IACH,UAAU,CAAC,CAAC,SAAS;QAAE,WAAW,EAAE,QAAQ,CAAA;KAAE,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;CAyE9D"}
|
package/dist/registry.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observability Registry for Mastra
|
|
3
|
-
*
|
|
4
|
-
* Provides registry for Observability instances.
|
|
5
|
-
*/
|
|
6
|
-
import type { ObservabilityInstance, ConfigSelectorOptions, ConfigSelector } from '@mastra/core/observability';
|
|
7
|
-
/**
|
|
8
|
-
* Registry for Observability instances.
|
|
9
|
-
*/
|
|
10
|
-
export declare class ObservabilityRegistry {
|
|
11
|
-
#private;
|
|
12
|
-
/**
|
|
13
|
-
* Register a tracing instance
|
|
14
|
-
*/
|
|
15
|
-
register(name: string, instance: ObservabilityInstance, isDefault?: boolean): void;
|
|
16
|
-
/**
|
|
17
|
-
* Get a tracing instance by name
|
|
18
|
-
*/
|
|
19
|
-
get(name: string): ObservabilityInstance | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Get the default tracing instance
|
|
22
|
-
*/
|
|
23
|
-
getDefault(): ObservabilityInstance | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Set the tracing selector function
|
|
26
|
-
*/
|
|
27
|
-
setSelector(selector: ConfigSelector): void;
|
|
28
|
-
/**
|
|
29
|
-
* Get the selected tracing instance based on context
|
|
30
|
-
*/
|
|
31
|
-
getSelected(options: ConfigSelectorOptions): ObservabilityInstance | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Unregister a tracing instance
|
|
34
|
-
*/
|
|
35
|
-
unregister(name: string): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Shutdown all instances and clear the registry
|
|
38
|
-
*/
|
|
39
|
-
shutdown(): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Clear all instances without shutdown
|
|
42
|
-
*/
|
|
43
|
-
clear(): void;
|
|
44
|
-
/**
|
|
45
|
-
* list all registered instances
|
|
46
|
-
*/
|
|
47
|
-
list(): ReadonlyMap<string, ObservabilityInstance>;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAM/G;;GAEG;AACH,qBAAa,qBAAqB;;IAKhC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,UAAQ,GAAG,IAAI;IAahF;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS;IAIpD;;OAEG;IACH,UAAU,IAAI,qBAAqB,GAAG,SAAS;IAI/C;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAI3C;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,GAAG,SAAS;IAa9E;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAYjC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,IAAI,IAAI,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC;CAGnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/span_processors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { SpanOutputProcessor, AnySpan } from '@mastra/core/observability';
|
|
2
|
-
export type RedactionStyle = 'full' | 'partial';
|
|
3
|
-
/**
|
|
4
|
-
* Options for configuring the SensitiveDataFilter.
|
|
5
|
-
*/
|
|
6
|
-
export interface SensitiveDataFilterOptions {
|
|
7
|
-
/**
|
|
8
|
-
* List of sensitive field names to redact.
|
|
9
|
-
* Matching is case-insensitive and normalizes separators (`api-key`, `api_key`, `Api Key` → `apikey`).
|
|
10
|
-
*
|
|
11
|
-
* Defaults include: password, token, secret, key, apikey, auth, authorization,
|
|
12
|
-
* bearer, bearertoken, jwt, credential, clientsecret, privatekey, refresh, ssn.
|
|
13
|
-
*/
|
|
14
|
-
sensitiveFields?: string[];
|
|
15
|
-
/**
|
|
16
|
-
* The token used for full redaction.
|
|
17
|
-
* Default: "[REDACTED]"
|
|
18
|
-
*/
|
|
19
|
-
redactionToken?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Style of redaction to use:
|
|
22
|
-
* - "full": always replace with redactionToken.
|
|
23
|
-
* - "partial": show 3 characters from the start and end, redact the middle.
|
|
24
|
-
*
|
|
25
|
-
* Default: "full"
|
|
26
|
-
*/
|
|
27
|
-
redactionStyle?: RedactionStyle;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* SensitiveDataFilter
|
|
31
|
-
*
|
|
32
|
-
* An SpanOutputProcessor that redacts sensitive information from span fields.
|
|
33
|
-
*
|
|
34
|
-
* - Sensitive keys are matched case-insensitively, normalized to remove separators.
|
|
35
|
-
* - Sensitive values are redacted using either full or partial redaction.
|
|
36
|
-
* - Partial redaction always keeps 3 chars at the start and end.
|
|
37
|
-
* - If filtering a field fails, the field is replaced with:
|
|
38
|
-
* `{ error: { processor: "sensitive-data-filter" } }`
|
|
39
|
-
*/
|
|
40
|
-
export declare class SensitiveDataFilter implements SpanOutputProcessor {
|
|
41
|
-
name: string;
|
|
42
|
-
private sensitiveFields;
|
|
43
|
-
private redactionToken;
|
|
44
|
-
private redactionStyle;
|
|
45
|
-
constructor(options?: SensitiveDataFilterOptions);
|
|
46
|
-
/**
|
|
47
|
-
* Process a span by filtering sensitive data across its key fields.
|
|
48
|
-
* Fields processed: attributes, metadata, input, output, errorInfo.
|
|
49
|
-
*
|
|
50
|
-
* @param span - The input span to filter
|
|
51
|
-
* @returns A new span with sensitive values redacted
|
|
52
|
-
*/
|
|
53
|
-
process(span: AnySpan): AnySpan;
|
|
54
|
-
/**
|
|
55
|
-
* Recursively filter objects/arrays for sensitive keys.
|
|
56
|
-
* Handles circular references by replacing with a marker.
|
|
57
|
-
*/
|
|
58
|
-
private deepFilter;
|
|
59
|
-
private tryFilter;
|
|
60
|
-
/**
|
|
61
|
-
* Normalize keys by lowercasing and stripping non-alphanumeric characters.
|
|
62
|
-
* Ensures consistent matching for variants like "api-key", "api_key", "Api Key".
|
|
63
|
-
*/
|
|
64
|
-
private normalizeKey;
|
|
65
|
-
/**
|
|
66
|
-
* Check whether a normalized key exactly matches any sensitive field.
|
|
67
|
-
* Both key and sensitive fields are normalized by removing all non-alphanumeric
|
|
68
|
-
* characters and converting to lowercase before comparison.
|
|
69
|
-
*
|
|
70
|
-
* Examples:
|
|
71
|
-
* - "api_key", "api-key", "ApiKey" all normalize to "apikey" → MATCHES "apikey"
|
|
72
|
-
* - "promptTokens", "prompt_tokens" normalize to "prompttokens" → DOES NOT MATCH "token"
|
|
73
|
-
*/
|
|
74
|
-
private isSensitive;
|
|
75
|
-
/**
|
|
76
|
-
* Redact a sensitive value.
|
|
77
|
-
* - Full style: replaces with a fixed token.
|
|
78
|
-
* - Partial style: shows 3 chars at start and end, hides the middle.
|
|
79
|
-
*
|
|
80
|
-
* Non-string values are converted to strings before partial redaction.
|
|
81
|
-
*/
|
|
82
|
-
private redactValue;
|
|
83
|
-
shutdown(): Promise<void>;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=sensitive-data-filter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sensitive-data-filter.d.ts","sourceRoot":"","sources":["../../src/span_processors/sensitive-data-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,qBAAa,mBAAoB,YAAW,mBAAmB;IAC7D,IAAI,SAA2B;IAC/B,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAAiB;gBAE3B,OAAO,GAAE,0BAA+B;IAyBpD;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAS/B;;;OAGG;IACH,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,SAAS;IAQjB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW;IAOnB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAab,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|
package/dist/spans/base.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import type { Span, SpanTypeMap, AnySpan, ChildSpanOptions, ChildEventOptions, EndSpanOptions, ErrorSpanOptions, UpdateSpanOptions, CreateSpanOptions, ObservabilityInstance, ExportedSpan, TraceState, IModelSpanTracker, AIModelGenerationSpan } from '@mastra/core/observability';
|
|
2
|
-
import { SpanType } from '@mastra/core/observability';
|
|
3
|
-
/**
|
|
4
|
-
* Get the external parent span ID from CreateSpanOptions.
|
|
5
|
-
*
|
|
6
|
-
* If the parent is internal, walks up the parent chain to find
|
|
7
|
-
* the closest external ancestor. If the parent is already external,
|
|
8
|
-
* returns its ID directly.
|
|
9
|
-
*
|
|
10
|
-
* This is useful when exporting spans to external observability systems
|
|
11
|
-
* that shouldn't include internal framework spans.
|
|
12
|
-
*
|
|
13
|
-
* @param options - Span creation options
|
|
14
|
-
* @returns The external parent span ID, or undefined if no external parent exists
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* // Parent is external - returns parent.id
|
|
19
|
-
* const externalParent = { id: 'span-123', isInternal: false };
|
|
20
|
-
* const options = { parent: externalParent, ... };
|
|
21
|
-
* getExternalParentId(options); // 'span-123'
|
|
22
|
-
*
|
|
23
|
-
* // Parent is internal - walks up to find external ancestor
|
|
24
|
-
* const externalGrandparent = { id: 'span-456', isInternal: false };
|
|
25
|
-
* const internalParent = { id: 'span-123', isInternal: true, parent: externalGrandparent };
|
|
26
|
-
* const options = { parent: internalParent, ... };
|
|
27
|
-
* getExternalParentId(options); // 'span-456'
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function getExternalParentId(options: CreateSpanOptions<any>): string | undefined;
|
|
31
|
-
export declare abstract class BaseSpan<TType extends SpanType = any> implements Span<TType> {
|
|
32
|
-
abstract id: string;
|
|
33
|
-
abstract traceId: string;
|
|
34
|
-
name: string;
|
|
35
|
-
type: TType;
|
|
36
|
-
attributes: SpanTypeMap[TType];
|
|
37
|
-
parent?: AnySpan;
|
|
38
|
-
startTime: Date;
|
|
39
|
-
endTime?: Date;
|
|
40
|
-
isEvent: boolean;
|
|
41
|
-
isInternal: boolean;
|
|
42
|
-
observabilityInstance: ObservabilityInstance;
|
|
43
|
-
input?: any;
|
|
44
|
-
output?: any;
|
|
45
|
-
errorInfo?: {
|
|
46
|
-
message: string;
|
|
47
|
-
id?: string;
|
|
48
|
-
domain?: string;
|
|
49
|
-
category?: string;
|
|
50
|
-
details?: Record<string, any>;
|
|
51
|
-
};
|
|
52
|
-
metadata?: Record<string, any>;
|
|
53
|
-
traceState?: TraceState;
|
|
54
|
-
/** Parent span ID (for root spans that are children of external spans) */
|
|
55
|
-
protected parentSpanId?: string;
|
|
56
|
-
constructor(options: CreateSpanOptions<TType>, observabilityInstance: ObservabilityInstance);
|
|
57
|
-
/** End the span */
|
|
58
|
-
abstract end(options?: EndSpanOptions<TType>): void;
|
|
59
|
-
/** Record an error for the span, optionally end the span as well */
|
|
60
|
-
abstract error(options: ErrorSpanOptions<TType>): void;
|
|
61
|
-
/** Update span attributes */
|
|
62
|
-
abstract update(options: UpdateSpanOptions<TType>): void;
|
|
63
|
-
createChildSpan(options: ChildSpanOptions<SpanType.MODEL_GENERATION>): AIModelGenerationSpan;
|
|
64
|
-
createEventSpan<TChildType extends SpanType>(options: ChildEventOptions<TChildType>): Span<TChildType>;
|
|
65
|
-
/**
|
|
66
|
-
* Create a ModelSpanTracker for this span (only works if this is a MODEL_GENERATION span)
|
|
67
|
-
* Returns undefined for non-MODEL_GENERATION spans
|
|
68
|
-
*/
|
|
69
|
-
createTracker(): IModelSpanTracker | undefined;
|
|
70
|
-
/** Returns `TRUE` if the span is the root span of a trace */
|
|
71
|
-
get isRootSpan(): boolean;
|
|
72
|
-
/** Returns `TRUE` if the span is a valid span (not a NO-OP Span) */
|
|
73
|
-
abstract get isValid(): boolean;
|
|
74
|
-
/** Get the closest parent spanId that isn't an internal span */
|
|
75
|
-
getParentSpanId(includeInternalSpans?: boolean): string | undefined;
|
|
76
|
-
/** Find the closest parent span of a specific type by walking up the parent chain */
|
|
77
|
-
findParent<T extends SpanType>(spanType: T): Span<T> | undefined;
|
|
78
|
-
/** Returns a lightweight span ready for export */
|
|
79
|
-
exportSpan(includeInternalSpans?: boolean): ExportedSpan<TType>;
|
|
80
|
-
get externalTraceId(): string | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* Execute an async function within this span's tracing context.
|
|
83
|
-
* Delegates to the bridge if available.
|
|
84
|
-
*/
|
|
85
|
-
executeInContext<T>(fn: () => Promise<T>): Promise<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Execute a synchronous function within this span's tracing context.
|
|
88
|
-
* Delegates to the bridge if available.
|
|
89
|
-
*/
|
|
90
|
-
executeInContextSync<T>(fn: () => T): T;
|
|
91
|
-
}
|
|
92
|
-
export interface DeepCleanOptions {
|
|
93
|
-
keysToStrip?: Set<string>;
|
|
94
|
-
maxDepth?: number;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Recursively cleans a value by removing circular references and stripping problematic or sensitive keys.
|
|
98
|
-
* Circular references are replaced with "[Circular]". Unserializable values are replaced with error messages.
|
|
99
|
-
* Keys like "logger" and "tracingContext" are stripped by default.
|
|
100
|
-
* A maximum recursion depth is enforced to avoid stack overflow or excessive memory usage.
|
|
101
|
-
*
|
|
102
|
-
* @param value - The value to clean (object, array, primitive, etc.)
|
|
103
|
-
* @param options - Optional configuration:
|
|
104
|
-
* - keysToStrip: Set of keys to remove from objects (default: logger, tracingContext)
|
|
105
|
-
* - maxDepth: Maximum recursion depth before values are replaced with "[MaxDepth]" (default: 10)
|
|
106
|
-
* @returns A cleaned version of the input with circular references, specified keys, and overly deep values handled
|
|
107
|
-
*/
|
|
108
|
-
export declare function deepClean(value: any, options?: DeepCleanOptions, _seen?: WeakSet<any>, _depth?: number): any;
|
|
109
|
-
//# sourceMappingURL=base.d.ts.map
|
package/dist/spans/base.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/spans/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAiB,MAAM,4BAA4B,CAAC;AA6CrE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,SAAS,CAYvF;AAED,8BAAsB,QAAQ,CAAC,KAAK,SAAS,QAAQ,GAAG,GAAG,CAAE,YAAW,IAAI,CAAC,KAAK,CAAC;IACjF,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEzB,IAAI,EAAE,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SpanOptions, UpdateSpanOptions, CreateSpanOptions } from '@mastra/core/observability';
|
|
2
|
-
import { BaseSpan } from './base.js';
|
|
3
|
-
export declare class DefaultSpan<TType extends SpanType> extends BaseSpan<TType> {
|
|
4
|
-
id: string;
|
|
5
|
-
traceId: string;
|
|
6
|
-
constructor(options: CreateSpanOptions<TType>, observabilityInstance: ObservabilityInstance);
|
|
7
|
-
end(options?: EndSpanOptions<TType>): void;
|
|
8
|
-
error(options: ErrorSpanOptions<TType>): void;
|
|
9
|
-
update(options: UpdateSpanOptions<TType>): void;
|
|
10
|
-
get isValid(): boolean;
|
|
11
|
-
export(): Promise<string>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/spans/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAE7C,qBAAa,WAAW,CAAC,KAAK,SAAS,QAAQ,CAAE,SAAQ,QAAQ,CAAC,KAAK,CAAC;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,qBAAqB,EAAE,qBAAqB;IAqC3F,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI;IAiB1C,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI;IAoC7C,MAAM,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI;IAoB/C,IAAI,OAAO,IAAI,OAAO,CAErB;IAEK,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;CAUhC"}
|
package/dist/spans/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spans/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
package/dist/spans/no-op.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NoOpSpan Implementation for Mastra Observability
|
|
3
|
-
*/
|
|
4
|
-
import type { ObservabilityInstance, SpanType, CreateSpanOptions, EndSpanOptions, UpdateSpanOptions, ErrorSpanOptions } from '@mastra/core/observability';
|
|
5
|
-
import { BaseSpan } from './base.js';
|
|
6
|
-
export declare class NoOpSpan<TType extends SpanType = any> extends BaseSpan<TType> {
|
|
7
|
-
id: string;
|
|
8
|
-
traceId: string;
|
|
9
|
-
constructor(options: CreateSpanOptions<TType>, observabilityInstance: ObservabilityInstance);
|
|
10
|
-
end(_options?: EndSpanOptions<TType>): void;
|
|
11
|
-
error(_options: ErrorSpanOptions<TType>): void;
|
|
12
|
-
update(_options: UpdateSpanOptions<TType>): void;
|
|
13
|
-
get isValid(): boolean;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=no-op.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-op.d.ts","sourceRoot":"","sources":["../../src/spans/no-op.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,qBAAa,QAAQ,CAAC,KAAK,SAAS,QAAQ,GAAG,GAAG,CAAE,SAAQ,QAAQ,CAAC,KAAK,CAAC;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,qBAAqB,EAAE,qBAAqB;IAM3F,GAAG,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI;IAE3C,KAAK,CAAC,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI;IAE9C,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI;IAEhD,IAAI,OAAO,IAAI,OAAO,CAErB;CACF"}
|