@sensu-ai/sdk 0.1.1 → 0.1.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/package.json +6 -6
- package/src/client.ts +6 -1
- package/src/index.ts +1 -0
- package/src/types.ts +14 -0
- package/dist/client.d.ts +0 -76
- package/dist/client.d.ts.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/integrations/langchain.d.ts +0 -46
- package/dist/integrations/langchain.d.ts.map +0 -1
- package/dist/integrations/openai.d.ts +0 -26
- package/dist/integrations/openai.d.ts.map +0 -1
- package/dist/types.d.ts +0 -60
- package/dist/types.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensu-ai/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"./integrations/langchain": "./src/integrations/langchain.ts",
|
|
9
9
|
"./integrations/openai": "./src/integrations/openai.ts"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsc --watch"
|
|
14
|
+
},
|
|
11
15
|
"dependencies": {
|
|
12
16
|
"@sensu-ai/shared": "*",
|
|
13
17
|
"zod": "^3.23.8"
|
|
@@ -27,9 +31,5 @@
|
|
|
27
31
|
"openai": {
|
|
28
32
|
"optional": true
|
|
29
33
|
}
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsc",
|
|
33
|
-
"dev": "tsc --watch"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
TrackLlmOptions,
|
|
8
8
|
TrackToolOptions,
|
|
9
9
|
RawLlmCallOptions,
|
|
10
|
+
ContextBreakdown,
|
|
10
11
|
} from './types.js';
|
|
11
12
|
|
|
12
13
|
// ---------------------------------------------------------------------------
|
|
@@ -96,6 +97,7 @@ export class StepHandle {
|
|
|
96
97
|
|
|
97
98
|
// Try to extract token usage from common response shapes
|
|
98
99
|
const usage = extractUsage(result, opts.model);
|
|
100
|
+
const contextBreakdown = opts.extractContextBreakdown?.(result);
|
|
99
101
|
|
|
100
102
|
this.client.enqueue({
|
|
101
103
|
...this.base(),
|
|
@@ -107,6 +109,7 @@ export class StepHandle {
|
|
|
107
109
|
latency_ms: latencyMs,
|
|
108
110
|
status,
|
|
109
111
|
...usage,
|
|
112
|
+
...(contextBreakdown ? { context_breakdown: contextBreakdown } : {}),
|
|
110
113
|
});
|
|
111
114
|
|
|
112
115
|
if (err) throw err;
|
|
@@ -115,10 +118,12 @@ export class StepHandle {
|
|
|
115
118
|
|
|
116
119
|
/** Emit a raw LLM call event (when you have the stats already) */
|
|
117
120
|
recordLlm(opts: RawLlmCallOptions): void {
|
|
121
|
+
const { contextBreakdown, ...rest } = opts;
|
|
118
122
|
this.client.enqueue({
|
|
119
123
|
...this.base(),
|
|
120
124
|
event_type: 'llm.request.completed',
|
|
121
|
-
...
|
|
125
|
+
...rest,
|
|
126
|
+
...(contextBreakdown ? { context_breakdown: contextBreakdown } : {}),
|
|
122
127
|
});
|
|
123
128
|
}
|
|
124
129
|
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -27,12 +27,25 @@ export interface StartStepOptions {
|
|
|
27
27
|
stepId?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
export interface ContextBreakdown {
|
|
31
|
+
system_tokens?: number;
|
|
32
|
+
user_tokens?: number;
|
|
33
|
+
assistant_tokens?: number;
|
|
34
|
+
tool_tokens?: number;
|
|
35
|
+
retrieval_tokens?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
export interface TrackLlmOptions {
|
|
31
39
|
provider: string;
|
|
32
40
|
model: string;
|
|
33
41
|
/** Wraps the LLM call and measures latency automatically */
|
|
34
42
|
fn: () => Promise<unknown>;
|
|
35
43
|
maxContextTokens?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Optional callback to extract a context breakdown from the LLM response.
|
|
46
|
+
* Called with the raw response after fn() resolves.
|
|
47
|
+
*/
|
|
48
|
+
extractContextBreakdown?: (result: unknown) => ContextBreakdown | undefined;
|
|
36
49
|
}
|
|
37
50
|
|
|
38
51
|
export interface LlmResult {
|
|
@@ -62,4 +75,5 @@ export interface RawLlmCallOptions {
|
|
|
62
75
|
ttftMs?: number;
|
|
63
76
|
costUsdEstimate?: number;
|
|
64
77
|
status?: 'success' | 'error' | 'timeout';
|
|
78
|
+
contextBreakdown?: ContextBreakdown;
|
|
65
79
|
}
|
package/dist/client.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { TelemetryEvent } from '@sensu-ai/shared';
|
|
2
|
-
import type { SensuClientOptions, StartRunOptions, StartStepOptions, TrackLlmOptions, TrackToolOptions, RawLlmCallOptions } from './types.js';
|
|
3
|
-
export declare class StepHandle {
|
|
4
|
-
private readonly client;
|
|
5
|
-
readonly stepId: string;
|
|
6
|
-
readonly runId: string;
|
|
7
|
-
readonly sessionId: string;
|
|
8
|
-
readonly agentId: string;
|
|
9
|
-
readonly orgId: string;
|
|
10
|
-
readonly traceId: string;
|
|
11
|
-
readonly spanId: string;
|
|
12
|
-
private sequence;
|
|
13
|
-
private stepName?;
|
|
14
|
-
private ended;
|
|
15
|
-
constructor(client: SensuClient, opts: {
|
|
16
|
-
stepId: string;
|
|
17
|
-
runId: string;
|
|
18
|
-
sessionId: string;
|
|
19
|
-
agentId: string;
|
|
20
|
-
orgId: string;
|
|
21
|
-
traceId: string;
|
|
22
|
-
spanId: string;
|
|
23
|
-
sequence: number;
|
|
24
|
-
name?: string;
|
|
25
|
-
});
|
|
26
|
-
private base;
|
|
27
|
-
/** Track an LLM call — wraps fn(), measures latency, emits event */
|
|
28
|
-
trackLlm(opts: TrackLlmOptions): Promise<unknown>;
|
|
29
|
-
/** Emit a raw LLM call event (when you have the stats already) */
|
|
30
|
-
recordLlm(opts: RawLlmCallOptions): void;
|
|
31
|
-
/** Track a tool call — wraps fn(), measures latency */
|
|
32
|
-
trackTool(opts: TrackToolOptions): Promise<unknown>;
|
|
33
|
-
end(): Promise<void>;
|
|
34
|
-
}
|
|
35
|
-
export declare class RunHandle {
|
|
36
|
-
private readonly client;
|
|
37
|
-
readonly runId: string;
|
|
38
|
-
readonly sessionId: string;
|
|
39
|
-
readonly agentId: string;
|
|
40
|
-
readonly orgId: string;
|
|
41
|
-
readonly traceId: string;
|
|
42
|
-
readonly spanId: string;
|
|
43
|
-
private stepCount;
|
|
44
|
-
private ended;
|
|
45
|
-
constructor(client: SensuClient, opts: {
|
|
46
|
-
runId: string;
|
|
47
|
-
sessionId: string;
|
|
48
|
-
agentId: string;
|
|
49
|
-
orgId: string;
|
|
50
|
-
traceId: string;
|
|
51
|
-
spanId: string;
|
|
52
|
-
});
|
|
53
|
-
private base;
|
|
54
|
-
startStep(opts?: StartStepOptions): StepHandle;
|
|
55
|
-
end(status?: 'completed' | 'failed'): Promise<void>;
|
|
56
|
-
}
|
|
57
|
-
export declare class SensuClient {
|
|
58
|
-
private readonly apiKey;
|
|
59
|
-
private readonly baseUrl;
|
|
60
|
-
private readonly agentId;
|
|
61
|
-
private readonly orgId;
|
|
62
|
-
private readonly batchSize;
|
|
63
|
-
private readonly flushIntervalMs;
|
|
64
|
-
readonly disabled: boolean;
|
|
65
|
-
private buffer;
|
|
66
|
-
private flushTimer;
|
|
67
|
-
constructor(opts?: SensuClientOptions);
|
|
68
|
-
/** Enqueue an event for batched sending */
|
|
69
|
-
enqueue(event: TelemetryEvent): void;
|
|
70
|
-
/** Flush all buffered events to the Sensu API */
|
|
71
|
-
flush(): Promise<void>;
|
|
72
|
-
/** Start a new agent run */
|
|
73
|
-
startRun(opts?: StartRunOptions): RunHandle;
|
|
74
|
-
destroy(): void;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAMpB,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAS;gBAGpB,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAcH,OAAO,CAAC,IAAI;IAeZ,oEAAoE;IAC9D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AS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,UAAU,CAA+C;gBAErD,IAAI,GAAE,kBAAuB;IA8BzC,2CAA2C;IAC3C,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAQpC,iDAAiD;IAC3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB5B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,SAAS;IA8B/C,OAAO,IAAI,IAAI;CAGhB"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LangChain callback handler for Sensu telemetry.
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* import { SensuCallbackHandler } from '@sensu-ai/sdk/integrations/langchain';
|
|
6
|
-
* const handler = new SensuCallbackHandler({ client: sensu });
|
|
7
|
-
* const chain = new LLMChain({ ..., callbacks: [handler] });
|
|
8
|
-
*/
|
|
9
|
-
import type { SensuClient } from '../client.ts';
|
|
10
|
-
interface LangChainCallbackHandlerOptions {
|
|
11
|
-
client: SensuClient;
|
|
12
|
-
sessionId?: string;
|
|
13
|
-
runId?: string;
|
|
14
|
-
}
|
|
15
|
-
interface LangChainLlmStartInput {
|
|
16
|
-
name?: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
interface LangChainLlmEndOutput {
|
|
20
|
-
generations?: Array<Array<{
|
|
21
|
-
text?: string;
|
|
22
|
-
generationInfo?: Record<string, unknown>;
|
|
23
|
-
}>>;
|
|
24
|
-
llmOutput?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
export declare class SensuCallbackHandler {
|
|
27
|
-
private readonly client;
|
|
28
|
-
private readonly sessionId;
|
|
29
|
-
private runId;
|
|
30
|
-
private traceId;
|
|
31
|
-
private startTimes;
|
|
32
|
-
private toolStartTimes;
|
|
33
|
-
private stepIds;
|
|
34
|
-
constructor(opts: LangChainCallbackHandlerOptions);
|
|
35
|
-
private base;
|
|
36
|
-
handleChainStart(_chain: unknown, _inputs: unknown, runId: string): Promise<void>;
|
|
37
|
-
handleChainEnd(_outputs: unknown, runId: string): Promise<void>;
|
|
38
|
-
handleLLMStart(llm: LangChainLlmStartInput, _prompts: string[], runId: string): Promise<void>;
|
|
39
|
-
handleLLMEnd(output: LangChainLlmEndOutput, runId: string): Promise<void>;
|
|
40
|
-
handleLLMError(err: Error, runId: string): Promise<void>;
|
|
41
|
-
handleToolStart(_tool: unknown, _input: string, runId: string): Promise<void>;
|
|
42
|
-
handleToolEnd(output: string, runId: string): Promise<void>;
|
|
43
|
-
handleToolError(err: Error, runId: string): Promise<void>;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=langchain.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"langchain.d.ts","sourceRoot":"","sources":["../../src/integrations/langchain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,UAAU,+BAA+B;IACvC,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAA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AM;IAgB3C,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;CAahD"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI SDK wrapper for Sensu telemetry.
|
|
3
|
-
* Wraps the OpenAI client to automatically track all completions.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* import { wrapOpenAI } from '@sensu-ai/sdk/integrations/openai';
|
|
7
|
-
* const openai = wrapOpenAI(new OpenAI({ apiKey }), { client: sensu, runHandle });
|
|
8
|
-
* const resp = await openai.chat.completions.create({ ... }); // auto-tracked
|
|
9
|
-
*/
|
|
10
|
-
import type { SensuClient, RunHandle } from '../client.ts';
|
|
11
|
-
interface OpenAILike {
|
|
12
|
-
chat: {
|
|
13
|
-
completions: {
|
|
14
|
-
create: (params: unknown) => Promise<unknown>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
interface WrapOpenAIOptions {
|
|
19
|
-
client: SensuClient;
|
|
20
|
-
runHandle?: RunHandle;
|
|
21
|
-
defaultModel?: string;
|
|
22
|
-
defaultProvider?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function wrapOpenAI<T extends OpenAILike>(openai: T, opts: WrapOpenAIOptions): T;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/integrations/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3D,UAAU,UAAU;IAClB,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;SAC/C,CAAC;KACH,CAAC;CACH;AAED,UAAU,iBAAiB;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAaD,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAC7C,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,iBAAiB,GACtB,CAAC,CAmEH"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export interface SensuClientOptions {
|
|
2
|
-
apiKey?: string;
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
agentId?: string;
|
|
5
|
-
orgId?: string;
|
|
6
|
-
/** Read config from environment variables */
|
|
7
|
-
fromEnv?: boolean;
|
|
8
|
-
/** Flush buffer when this many events accumulate */
|
|
9
|
-
batchSize?: number;
|
|
10
|
-
/** Flush buffer every N milliseconds */
|
|
11
|
-
flushIntervalMs?: number;
|
|
12
|
-
/** Disable all telemetry (useful for tests) */
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface StartRunOptions {
|
|
16
|
-
sessionId?: string;
|
|
17
|
-
runType?: string;
|
|
18
|
-
endUserId?: string;
|
|
19
|
-
runId?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface StartStepOptions {
|
|
22
|
-
name?: string;
|
|
23
|
-
stepType?: string;
|
|
24
|
-
sequence?: number;
|
|
25
|
-
stepId?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface TrackLlmOptions {
|
|
28
|
-
provider: string;
|
|
29
|
-
model: string;
|
|
30
|
-
/** Wraps the LLM call and measures latency automatically */
|
|
31
|
-
fn: () => Promise<unknown>;
|
|
32
|
-
maxContextTokens?: number;
|
|
33
|
-
}
|
|
34
|
-
export interface LlmResult {
|
|
35
|
-
inputTokens?: number;
|
|
36
|
-
outputTokens?: number;
|
|
37
|
-
cachedInputTokens?: number;
|
|
38
|
-
totalTokens?: number;
|
|
39
|
-
costUsdEstimate?: number;
|
|
40
|
-
result: unknown;
|
|
41
|
-
}
|
|
42
|
-
export interface TrackToolOptions {
|
|
43
|
-
toolName: string;
|
|
44
|
-
fn: () => Promise<unknown>;
|
|
45
|
-
}
|
|
46
|
-
export interface RawLlmCallOptions {
|
|
47
|
-
provider: string;
|
|
48
|
-
model: string;
|
|
49
|
-
inputTokens?: number;
|
|
50
|
-
outputTokens?: number;
|
|
51
|
-
cachedInputTokens?: number;
|
|
52
|
-
totalTokens?: number;
|
|
53
|
-
maxContextTokens?: number;
|
|
54
|
-
contextUsedTokens?: number;
|
|
55
|
-
latencyMs?: number;
|
|
56
|
-
ttftMs?: number;
|
|
57
|
-
costUsdEstimate?: number;
|
|
58
|
-
status?: 'success' | 'error' | 'timeout';
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,I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