@rasputin-ai/node 0.4.1 → 0.5.0-alpha.2
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/README.md +188 -162
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts +2 -37
- package/dist/auto-instrumentation/collect-instrumentation-delta.d.ts.map +1 -1
- package/dist/auto-instrumentation/instrument-compiled-esm.d.ts +17 -0
- package/dist/auto-instrumentation/instrument-compiled-esm.d.ts.map +1 -0
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts +40 -0
- package/dist/auto-instrumentation/instrumentation-manifest-delta.d.ts.map +1 -0
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts +4 -1
- package/dist/auto-instrumentation/instrumentation-manifest-registry.d.ts.map +1 -1
- package/dist/auto-instrumentation/transform-source.d.ts +1 -1
- package/dist/auto-instrumentation/transform-source.d.ts.map +1 -1
- package/dist/auto-instrumentation/warn-production-runtime-transform.d.ts +8 -0
- package/dist/auto-instrumentation/warn-production-runtime-transform.d.ts.map +1 -0
- package/dist/execution-recorder/automatic-runtime.d.ts +19 -10
- package/dist/execution-recorder/automatic-runtime.d.ts.map +1 -1
- package/dist/execution-recorder/call-aware-event-buffer.d.ts +17 -3
- package/dist/execution-recorder/call-aware-event-buffer.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder-types.d.ts +19 -0
- package/dist/execution-recorder/execution-recorder-types.d.ts.map +1 -1
- package/dist/execution-recorder/execution-recorder.d.ts.map +1 -1
- package/dist/execution-recorder/function-plan.d.ts +26 -0
- package/dist/execution-recorder/function-plan.d.ts.map +1 -0
- package/dist/execution-recorder/recorder-memory-budget.d.ts +7 -1
- package/dist/execution-recorder/recorder-memory-budget.d.ts.map +1 -1
- package/dist/execution-recorder/safe-serialize.d.ts +7 -0
- package/dist/execution-recorder/safe-serialize.d.ts.map +1 -1
- package/dist/index.js +546 -294
- package/dist/instrument/build.d.ts +2 -0
- package/dist/instrument/build.d.ts.map +1 -0
- package/dist/instrument/build.js +707 -0
- package/dist/instrument/bun.js +55 -21
- package/dist/instrument/node.js +55 -21
- package/dist/rasputin-init.d.ts +5 -5
- package/dist/rasputin-init.d.ts.map +1 -1
- package/dist/sdk-meta.d.ts +1 -1
- package/dist/sdk-meta.d.ts.map +1 -1
- package/package.json +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-aware-event-buffer.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/call-aware-event-buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,qBAAa,oBAAoB;IAMpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IALrC,OAAO,CAAC,QAAQ,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"call-aware-event-buffer.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/call-aware-event-buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9F,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,sBAAsB,CAAC;AAEjE,eAAO,MAAM,wBAAwB,GAAI,MAAM,UAAU,KAAG,IAAI,IAAI,sBACvB,CAAC;AAE9C,qBAAa,oBAAoB;IAMpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IALrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,SAAK;gBAEiB,QAAQ,EAAE,MAAM;IAE7C,YAAY,IAAI,OAAO;IAIvB,SAAS,CAAC,KAAK,EAAE,2BAA2B;IAK5C,UAAU,CAAC,KAAK,EAAE,cAAc;IAMhC,QAAQ;IAIR,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO;IAYpD,kBAAkB,CAAC,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO;IAYzF,MAAM,IAAI,UAAU,EAAE;IAItB,OAAO,CAAC,2BAA2B;CAkDnC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* work, and future serverless invocations without coupling the recorder to one framework lifecycle.
|
|
5
5
|
*/
|
|
6
6
|
import type { RuntimeExecutionEvent, RuntimeExecutionKind, RuntimeExecutionMetadata, RuntimeExecutionState, RuntimeFunctionCallsSuppressedEvent, RuntimeFunctionDefinition, RuntimeFunctionEnterEvent, SourcePosition } from '@rasputin-ai/core';
|
|
7
|
+
import type { EncodedFunctionPlan, PreparedFunctionPlan } from './function-plan';
|
|
7
8
|
export type ExecutionSourceExclusion = string | RegExp;
|
|
8
9
|
export type ExecutionRecorderOptions = {
|
|
9
10
|
/** Disable runtime-state capture explicitly. It is enabled by SDK initializers by default. */
|
|
@@ -42,6 +43,18 @@ export type ExecutionFunctionDescriptor = {
|
|
|
42
43
|
source?: SourcePosition;
|
|
43
44
|
};
|
|
44
45
|
export type ExecutionRecorderStats = {
|
|
46
|
+
/** Function hooks observed while an active execution scope exists. */
|
|
47
|
+
functionCallsObserved: number;
|
|
48
|
+
/** Observed calls for which a complete enter/terminal pair was captured. */
|
|
49
|
+
functionCallsCaptured: number;
|
|
50
|
+
/** Observed calls omitted because their source or parent subtree was excluded. */
|
|
51
|
+
functionCallsExcluded: number;
|
|
52
|
+
/** Values actually traversed by the bounded serializer. */
|
|
53
|
+
serializedValues: number;
|
|
54
|
+
/** Application value nodes visited while producing bounded snapshots. */
|
|
55
|
+
serializedValueNodes: number;
|
|
56
|
+
/** Bounded serialized bytes produced before values are stored in recorder events. */
|
|
57
|
+
serializedValueBytes: number;
|
|
45
58
|
errorSnapshots: number;
|
|
46
59
|
successfulExecutionsDiscarded: number;
|
|
47
60
|
truncatedEvents: number;
|
|
@@ -71,6 +84,12 @@ export type RasputinExecution = {
|
|
|
71
84
|
getErrorState: (error: unknown, metadata?: Partial<ExecutionMetadata>) => ExecutionState | undefined;
|
|
72
85
|
/** Internal primitive used by SDK-owned source instrumentation. */
|
|
73
86
|
runFunction: <T>(definition: RuntimeFunctionDefinition | string, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
87
|
+
/** Internal prepared-plan path used by automatic instrumentation. */
|
|
88
|
+
runFunctionPlans: <T>(plans: readonly EncodedFunctionPlan[], planIndex: number, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
89
|
+
/** Resolve a module plan table once so generated wrappers can bind to prepared plans. */
|
|
90
|
+
prepareFunctionPlans: (plans: readonly EncodedFunctionPlan[]) => PreparedFunctionPlan[];
|
|
91
|
+
/** Internal primitive used after a module's function plans have been resolved. */
|
|
92
|
+
runPreparedFunction: <T>(plan: PreparedFunctionPlan, args: ArrayLike<unknown>, callback: () => T) => T;
|
|
74
93
|
/** Manual fallback for runtimes/build systems without automatic instrumentation. */
|
|
75
94
|
trace: <TThis, TArgs extends unknown[], TResult>(definition: string | ExecutionFunctionDescriptor, fn: (this: TThis, ...args: TArgs) => TResult) => (this: TThis, ...args: TArgs) => TResult;
|
|
76
95
|
getStats: () => ExecutionRecorderStats;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"execution-recorder-types.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG;IACtC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uGAAuG;IACvG,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC5C,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AACzD,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC;AACjD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AAoF;IACpF,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,SAAS,OAAO,EAAE,EAAE,OAAO,EAC9C,UAAU,EAAE,MAAM,GAAG,2BAA2B,EAChD,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,KACxC,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;IAC9C,QAAQ,EAAE,MAAM,sBAAsB,CAAC;CACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-recorder.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/execution-recorder.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAKX,wBAAwB,EAExB,iBAAiB,EACjB,MAAM,4BAA4B,CAAC;AAuNpC,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,GACnC,SAAS,wBAAwB,GAAG,SAAS,KAC3C,iBA4kBF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RuntimeFunctionDefinition } from '@rasputin-ai/core';
|
|
2
|
+
export type EncodedFunctionPlan = readonly [
|
|
3
|
+
functionId: string,
|
|
4
|
+
name: string,
|
|
5
|
+
packageName: string | null,
|
|
6
|
+
packageRelativePath: string | null,
|
|
7
|
+
line: number | null,
|
|
8
|
+
column: number | null
|
|
9
|
+
];
|
|
10
|
+
export type PreparedFunctionPlan = {
|
|
11
|
+
runtimePlanId: number;
|
|
12
|
+
definition: RuntimeFunctionDefinition;
|
|
13
|
+
functionId: string;
|
|
14
|
+
excluded: boolean;
|
|
15
|
+
estimatedCallBytes: number;
|
|
16
|
+
};
|
|
17
|
+
export type AutomaticFunctionSource = {
|
|
18
|
+
filePath: string;
|
|
19
|
+
name: string;
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const encodeFunctionPlan: (source: AutomaticFunctionSource) => EncodedFunctionPlan;
|
|
24
|
+
export declare const definitionFromEncodedPlan: (plan: EncodedFunctionPlan) => RuntimeFunctionDefinition;
|
|
25
|
+
export declare const estimatedCallBytesFor: (functionId: string) => number;
|
|
26
|
+
//# sourceMappingURL=function-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-plan.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/function-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,mBAAmB,GAAG,SAAS;IAC1C,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI;IAC1B,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,yBAAyB,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,uBAAuB,KAAG,mBAcpE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,yBAerE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MACiB,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-execution limits are insufficient when many requests overlap. This process-wide estimator
|
|
3
|
+
* bounds recorder-owned live memory and degrades snapshots explicitly under pressure so an error can
|
|
4
|
+
* still be reported without risking an application OOM. Telemetry completeness is intentionally
|
|
5
|
+
* sacrificed before application health.
|
|
6
|
+
*/
|
|
1
7
|
import type { SafeSerializedValue } from './safe-serialize';
|
|
2
8
|
type CaptureMode = 'full' | 'structure-only' | 'metadata-only';
|
|
3
9
|
export type RecorderMemoryAllocation = {
|
|
@@ -24,7 +30,7 @@ export declare class RecorderMemoryBudget {
|
|
|
24
30
|
constructor(maximumBytes: number, maximumSerializedValueBytes: number);
|
|
25
31
|
startExecution(): RecorderMemoryAllocation;
|
|
26
32
|
captureValue(allocation: RecorderMemoryAllocation, serialize: () => SafeSerializedValue): unknown;
|
|
27
|
-
reserveCall(allocation: RecorderMemoryAllocation,
|
|
33
|
+
reserveCall(allocation: RecorderMemoryAllocation, estimatedBytes: number): boolean;
|
|
28
34
|
reserveStandaloneEvent(allocation: RecorderMemoryAllocation): boolean;
|
|
29
35
|
release(allocation: RecorderMemoryAllocation): void;
|
|
30
36
|
getStats(): RecorderMemoryStats;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder-memory-budget.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/recorder-memory-budget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recorder-memory-budget.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/recorder-memory-budget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAU5D,KAAK,WAAW,GAAG,MAAM,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,WAAW,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,MAAM,CAAC;IACjC,wBAAwB,EAAE,MAAM,CAAC;IACjC,0BAA0B,EAAE,MAAM,CAAC;IACnC,2BAA2B,EAAE,MAAM,CAAC;IACpC,2BAA2B,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,qBAAa,oBAAoB;IAY/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,2BAA2B;IAZ7C,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAOpB;gBAGgB,YAAY,EAAE,MAAM,EACpB,2BAA2B,EAAE,MAAM;IAGrD,cAAc,IAAI,wBAAwB;IAwB1C,YAAY,CACX,UAAU,EAAE,wBAAwB,EACpC,SAAS,EAAE,MAAM,mBAAmB,GAClC,OAAO;IAuBV,WAAW,CAAC,UAAU,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO;IAalF,sBAAsB,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO;IAarE,OAAO,CAAC,UAAU,EAAE,wBAAwB;IAQ5C,QAAQ,IAAI,mBAAmB;IAI/B,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,UAAU;CAIlB"}
|
|
@@ -2,7 +2,14 @@ import type { ExecutionRecorderOptions } from './execution-recorder-types';
|
|
|
2
2
|
export type SafeSerializedValue = {
|
|
3
3
|
value: unknown;
|
|
4
4
|
bytes: number;
|
|
5
|
+
/** User-value nodes visited by the bounded traversal; synthetic markers are not counted. */
|
|
6
|
+
visitedNodes: number;
|
|
5
7
|
};
|
|
8
|
+
export type SafeSerializer = {
|
|
9
|
+
serialize: (value: unknown) => unknown;
|
|
10
|
+
serializeWithBytes: (value: unknown) => SafeSerializedValue;
|
|
11
|
+
};
|
|
12
|
+
export declare const createSafeSerializer: (options?: ExecutionRecorderOptions) => SafeSerializer;
|
|
6
13
|
/** Safely converts an arbitrary value and reports its bounded JSON byte size. */
|
|
7
14
|
export declare const safeSerializeWithBytes: (value: unknown, options?: ExecutionRecorderOptions) => SafeSerializedValue;
|
|
8
15
|
/** Safely converts an arbitrary value to bounded JSON-compatible data. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-serialize.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/safe-serialize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"safe-serialize.d.ts","sourceRoot":"","sources":["../../src/execution-recorder/safe-serialize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAqI3E,MAAM,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACvC,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,mBAAmB,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAS,wBAA6B,KAAG,cAyK7E,CAAC;AAYF,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,GAClC,OAAO,OAAO,EACd,UAAS,wBAA6B,KACpC,mBAIyB,CAAC;AAE7B,0EAA0E;AAC1E,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,EAAE,UAAS,wBAA6B,KAAG,OAC1C,CAAC"}
|