openai 7.23.0 → 7.25.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/CHANGELOG.md +51 -0
- package/README.md +4 -1
- package/client.d.mts +1 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -1
- package/client.d.ts.map +1 -1
- package/client.js +43 -5
- package/client.js.map +1 -1
- package/client.mjs +43 -5
- package/client.mjs.map +1 -1
- package/internal/responses/canonical-output-text.d.mts +8 -4
- package/internal/responses/canonical-output-text.d.mts.map +1 -1
- package/internal/responses/canonical-output-text.d.ts +8 -4
- package/internal/responses/canonical-output-text.d.ts.map +1 -1
- package/internal/responses/canonical-output-text.js +11 -0
- package/internal/responses/canonical-output-text.js.map +1 -1
- package/internal/responses/canonical-output-text.mjs +11 -0
- package/internal/responses/canonical-output-text.mjs.map +1 -1
- package/internal/responses/response-accumulator.d.mts +12 -1
- package/internal/responses/response-accumulator.d.mts.map +1 -1
- package/internal/responses/response-accumulator.d.ts +12 -1
- package/internal/responses/response-accumulator.d.ts.map +1 -1
- package/internal/responses/response-accumulator.js +99 -25
- package/internal/responses/response-accumulator.js.map +1 -1
- package/internal/responses/response-accumulator.mjs +97 -26
- package/internal/responses/response-accumulator.mjs.map +1 -1
- package/internal/ws.d.mts +6 -2
- package/internal/ws.d.mts.map +1 -1
- package/internal/ws.d.ts +6 -2
- package/internal/ws.d.ts.map +1 -1
- package/internal/ws.js +5 -3
- package/internal/ws.js.map +1 -1
- package/internal/ws.mjs +5 -3
- package/internal/ws.mjs.map +1 -1
- package/lib/live/transcript-grouping.d.mts.map +1 -1
- package/lib/live/transcript-grouping.d.ts.map +1 -1
- package/lib/live/transcript-grouping.js +6 -5
- package/lib/live/transcript-grouping.js.map +1 -1
- package/lib/live/transcript-grouping.mjs +6 -5
- package/lib/live/transcript-grouping.mjs.map +1 -1
- package/lib/responses/responses-websocket-accumulator.d.mts +72 -0
- package/lib/responses/responses-websocket-accumulator.d.mts.map +1 -0
- package/lib/responses/responses-websocket-accumulator.d.ts +72 -0
- package/lib/responses/responses-websocket-accumulator.d.ts.map +1 -0
- package/lib/responses/responses-websocket-accumulator.js +291 -0
- package/lib/responses/responses-websocket-accumulator.js.map +1 -0
- package/lib/responses/responses-websocket-accumulator.mjs +287 -0
- package/lib/responses/responses-websocket-accumulator.mjs.map +1 -0
- package/package.json +1 -1
- package/realtime/translations/ws.d.mts +84 -0
- package/realtime/translations/ws.d.mts.map +1 -0
- package/realtime/translations/ws.d.ts +84 -0
- package/realtime/translations/ws.d.ts.map +1 -0
- package/realtime/translations/ws.js +444 -0
- package/realtime/translations/ws.js.map +1 -0
- package/realtime/translations/ws.mjs +439 -0
- package/realtime/translations/ws.mjs.map +1 -0
- package/resources/audio/speech.d.mts +2 -2
- package/resources/audio/speech.d.mts.map +1 -1
- package/resources/audio/speech.d.ts +2 -2
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js +1 -1
- package/resources/audio/speech.mjs +1 -1
- package/resources/audio/transcriptions.d.mts +2 -1
- package/resources/audio/transcriptions.d.mts.map +1 -1
- package/resources/audio/transcriptions.d.ts +2 -1
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/beta/agents/agents.d.mts +577 -18
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +577 -18
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/environments/templates.d.mts +62 -9
- package/resources/beta/agents/environments/templates.d.mts.map +1 -1
- package/resources/beta/agents/environments/templates.d.ts +62 -9
- package/resources/beta/agents/environments/templates.d.ts.map +1 -1
- package/resources/beta/agents/index.d.mts +1 -1
- package/resources/beta/agents/index.d.mts.map +1 -1
- package/resources/beta/agents/index.d.ts +1 -1
- package/resources/beta/agents/index.d.ts.map +1 -1
- package/resources/beta/agents/index.js.map +1 -1
- package/resources/beta/agents/index.mjs.map +1 -1
- package/resources/beta/agents/sessions/events.d.mts +10 -7
- package/resources/beta/agents/sessions/events.d.mts.map +1 -1
- package/resources/beta/agents/sessions/events.d.ts +10 -7
- package/resources/beta/agents/sessions/events.d.ts.map +1 -1
- package/resources/beta/agents/sessions/events.js +10 -7
- package/resources/beta/agents/sessions/events.js.map +1 -1
- package/resources/beta/agents/sessions/events.mjs +10 -7
- package/resources/beta/agents/sessions/events.mjs.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.mts +4 -2
- package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/agents/sessions/sessions.d.ts +4 -2
- package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/agents/sessions/sessions.js.map +1 -1
- package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.mts +24 -7
- package/resources/beta/agents/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/agents/vaults/credentials.d.ts +24 -7
- package/resources/beta/agents/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/agents/vaults/credentials.js +2 -6
- package/resources/beta/agents/vaults/credentials.js.map +1 -1
- package/resources/beta/agents/vaults/credentials.mjs +2 -6
- package/resources/beta/agents/vaults/credentials.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/responses/responses.d.mts +69 -10
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +69 -10
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/files.d.mts +2 -2
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +2 -2
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/live/forks/ws-base.js +1 -1
- package/resources/live/forks/ws-base.js.map +1 -1
- package/resources/live/forks/ws-base.mjs +1 -1
- package/resources/live/forks/ws-base.mjs.map +1 -1
- package/resources/live/sideband/ws-base.js +1 -1
- package/resources/live/sideband/ws-base.js.map +1 -1
- package/resources/live/sideband/ws-base.mjs +1 -1
- package/resources/live/sideband/ws-base.mjs.map +1 -1
- package/resources/live/ws-base.js +1 -1
- package/resources/live/ws-base.js.map +1 -1
- package/resources/live/ws-base.mjs +1 -1
- package/resources/live/ws-base.mjs.map +1 -1
- package/resources/realtime/index.d.mts +1 -0
- package/resources/realtime/index.d.mts.map +1 -1
- package/resources/realtime/index.d.ts +1 -0
- package/resources/realtime/index.d.ts.map +1 -1
- package/resources/realtime/index.js +3 -1
- package/resources/realtime/index.js.map +1 -1
- package/resources/realtime/index.mjs +1 -0
- package/resources/realtime/index.mjs.map +1 -1
- package/resources/realtime/realtime.d.mts +4 -0
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +4 -0
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js +4 -0
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs +4 -0
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/realtime/translations/client-secrets.d.mts +67 -0
- package/resources/realtime/translations/client-secrets.d.mts.map +1 -0
- package/resources/realtime/translations/client-secrets.d.ts +67 -0
- package/resources/realtime/translations/client-secrets.d.ts.map +1 -0
- package/resources/realtime/translations/client-secrets.js +39 -0
- package/resources/realtime/translations/client-secrets.js.map +1 -0
- package/resources/realtime/translations/client-secrets.mjs +35 -0
- package/resources/realtime/translations/client-secrets.mjs.map +1 -0
- package/resources/realtime/translations/index.d.mts +3 -0
- package/resources/realtime/translations/index.d.mts.map +1 -0
- package/resources/realtime/translations/index.d.ts +3 -0
- package/resources/realtime/translations/index.d.ts.map +1 -0
- package/resources/realtime/translations/index.js +9 -0
- package/resources/realtime/translations/index.js.map +1 -0
- package/resources/realtime/translations/index.mjs +4 -0
- package/resources/realtime/translations/index.mjs.map +1 -0
- package/resources/realtime/translations/translations.d.mts +10 -0
- package/resources/realtime/translations/translations.d.mts.map +1 -0
- package/resources/realtime/translations/translations.d.ts +10 -0
- package/resources/realtime/translations/translations.d.ts.map +1 -0
- package/resources/realtime/translations/translations.js +17 -0
- package/resources/realtime/translations/translations.js.map +1 -0
- package/resources/realtime/translations/translations.mjs +12 -0
- package/resources/realtime/translations/translations.mjs.map +1 -0
- package/resources/realtime/translations.d.mts +2 -0
- package/resources/realtime/translations.d.mts.map +1 -0
- package/resources/realtime/translations.d.ts +2 -0
- package/resources/realtime/translations.d.ts.map +1 -0
- package/resources/realtime/translations.js +6 -0
- package/resources/realtime/translations.js.map +1 -0
- package/resources/realtime/translations.mjs +3 -0
- package/resources/realtime/translations.mjs.map +1 -0
- package/resources/responses/responses.d.mts +66 -7
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +66 -7
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/src/client.ts +42 -6
- package/src/internal/responses/canonical-output-text.ts +30 -5
- package/src/internal/responses/response-accumulator.ts +155 -56
- package/src/internal/ws.ts +5 -3
- package/src/lib/live/transcript-grouping.ts +6 -5
- package/src/lib/responses/responses-websocket-accumulator.ts +374 -0
- package/src/realtime/translations/ws.ts +539 -0
- package/src/resources/audio/speech.ts +4 -1
- package/src/resources/audio/transcriptions.ts +2 -1
- package/src/resources/beta/agents/agents.ts +699 -12
- package/src/resources/beta/agents/environments/templates.ts +70 -9
- package/src/resources/beta/agents/index.ts +3 -0
- package/src/resources/beta/agents/sessions/events.ts +10 -7
- package/src/resources/beta/agents/sessions/sessions.ts +4 -2
- package/src/resources/beta/agents/vaults/credentials.ts +21 -7
- package/src/resources/beta/beta.ts +6 -0
- package/src/resources/beta/index.ts +3 -0
- package/src/resources/beta/responses/responses.ts +75 -6
- package/src/resources/files.ts +3 -3
- package/src/resources/index.ts +1 -1
- package/src/resources/live/forks/ws-base.ts +1 -1
- package/src/resources/live/sideband/ws-base.ts +1 -1
- package/src/resources/live/ws-base.ts +1 -1
- package/src/resources/realtime/api.md +8 -0
- package/src/resources/realtime/index.ts +1 -0
- package/src/resources/realtime/realtime.ts +6 -0
- package/src/resources/realtime/translations/client-secrets.ts +93 -0
- package/src/resources/realtime/translations/index.ts +4 -0
- package/src/resources/realtime/translations/translations.ts +15 -0
- package/src/resources/realtime/translations.ts +3 -0
- package/src/resources/responses/responses.ts +72 -6
- package/src/resources/shared.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Response, ResponseOutputItem } from "../../resources/responses/responses.mjs";
|
|
2
|
+
import type { ResponsesWebSocketEvent } from "./responses-websocket-lane.mjs";
|
|
3
|
+
/** The discriminator is checked; other wire fields can be absent or not schema-valid yet. */
|
|
4
|
+
type ProvisionalOutputItem = {
|
|
5
|
+
[Type in ResponseOutputItem['type']]: {
|
|
6
|
+
type: Type;
|
|
7
|
+
} & Partial<Record<Exclude<keyof Extract<ResponseOutputItem, {
|
|
8
|
+
type: Type;
|
|
9
|
+
}>, 'type'>, unknown>>;
|
|
10
|
+
}[ResponseOutputItem['type']];
|
|
11
|
+
type PartSelector = {
|
|
12
|
+
content_index: number;
|
|
13
|
+
annotation_index?: number;
|
|
14
|
+
} | {
|
|
15
|
+
summary_index: number;
|
|
16
|
+
};
|
|
17
|
+
/** Provisional output is never substituted for a completed, failed, or incomplete response. */
|
|
18
|
+
export type ResponsesWebSocketAccumulatorState = {
|
|
19
|
+
phase: 'provisional';
|
|
20
|
+
snapshot: {
|
|
21
|
+
output: ProvisionalOutputItem[];
|
|
22
|
+
output_text: string;
|
|
23
|
+
} & {
|
|
24
|
+
[Field in Exclude<keyof Response, 'output' | 'output_text'>]?: unknown;
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
phase: 'unavailable';
|
|
28
|
+
error: Error;
|
|
29
|
+
} | {
|
|
30
|
+
phase: 'terminal';
|
|
31
|
+
event: ResponsesWebSocketEvent;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Optional, caller-fed reconstruction of one lane's provisional output.
|
|
35
|
+
*
|
|
36
|
+
* Feed the raw events returned by lane.receive(). Use a separate instance per
|
|
37
|
+
* lane. This helper never reads, sends, closes, or registers a listener on a
|
|
38
|
+
* socket; raw events remain in the caller's hands. Tools remain output data.
|
|
39
|
+
* Provisional response metadata is preserved as received and is not yet schema
|
|
40
|
+
* validated. Narrow its unknown fields before use. Omitted fields remain absent.
|
|
41
|
+
* Raw deltas give per-event progress. Use outputAt(event.output_index) when an
|
|
42
|
+
* item finishes, or pass its content_index/summary_index to read only a changed
|
|
43
|
+
* part. For citations use content_index and annotation_index together. A full
|
|
44
|
+
* current, item, or part read materializes its entire nested contents, so
|
|
45
|
+
* reserve those reads for when that complete snapshot is needed.
|
|
46
|
+
*
|
|
47
|
+
* A socket stream can omit the item/content scaffolding required for deltas.
|
|
48
|
+
* Such a response is marked unavailable until the next creation or terminal
|
|
49
|
+
* event. Terminal events, including failures and errors, are retained exactly as
|
|
50
|
+
* delivered, without filling omitted output from provisional data.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ResponsesWebSocketAccumulator {
|
|
53
|
+
#private;
|
|
54
|
+
/** Materialize the full state. For per-item progress prefer outputAt(). */
|
|
55
|
+
get current(): ResponsesWebSocketAccumulatorState | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Read one provisional item by wire output_index, or just one message/
|
|
58
|
+
* reasoning part with its wire content_index/summary_index. Add annotation_index
|
|
59
|
+
* to content_index to read one raw citation. Full item and part reads copy all
|
|
60
|
+
* nested entries; prefer a selector for progress on a growing collection.
|
|
61
|
+
* Copies remain valid after further events, and cannot change the accumulator.
|
|
62
|
+
* Returns undefined for absent/mismatched parts or outside provisional output.
|
|
63
|
+
*/
|
|
64
|
+
outputAt(outputIndex: number): ProvisionalOutputItem | undefined;
|
|
65
|
+
outputAt(outputIndex: number, part: PartSelector): unknown;
|
|
66
|
+
/** Drop retained provisional and terminal state without affecting any lane. */
|
|
67
|
+
reset(): void;
|
|
68
|
+
/** Record one raw lane event. Unknown event types leave the current state unchanged. */
|
|
69
|
+
add(event: ResponsesWebSocketEvent): void;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=responses-websocket-accumulator.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses-websocket-accumulator.d.mts","sourceRoot":"","sources":["../../src/lib/responses/responses-websocket-accumulator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gDAA4C;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,uCAAmC;AAE1E,6FAA6F;AAC7F,KAAK,qBAAqB,GAAG;KAE1B,IAAI,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAC5D,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,CAAC,k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import type { ResponsesWebSocketEvent } from "./responses-websocket-lane.js";
|
|
3
|
+
/** The discriminator is checked; other wire fields can be absent or not schema-valid yet. */
|
|
4
|
+
type ProvisionalOutputItem = {
|
|
5
|
+
[Type in ResponseOutputItem['type']]: {
|
|
6
|
+
type: Type;
|
|
7
|
+
} & Partial<Record<Exclude<keyof Extract<ResponseOutputItem, {
|
|
8
|
+
type: Type;
|
|
9
|
+
}>, 'type'>, unknown>>;
|
|
10
|
+
}[ResponseOutputItem['type']];
|
|
11
|
+
type PartSelector = {
|
|
12
|
+
content_index: number;
|
|
13
|
+
annotation_index?: number;
|
|
14
|
+
} | {
|
|
15
|
+
summary_index: number;
|
|
16
|
+
};
|
|
17
|
+
/** Provisional output is never substituted for a completed, failed, or incomplete response. */
|
|
18
|
+
export type ResponsesWebSocketAccumulatorState = {
|
|
19
|
+
phase: 'provisional';
|
|
20
|
+
snapshot: {
|
|
21
|
+
output: ProvisionalOutputItem[];
|
|
22
|
+
output_text: string;
|
|
23
|
+
} & {
|
|
24
|
+
[Field in Exclude<keyof Response, 'output' | 'output_text'>]?: unknown;
|
|
25
|
+
};
|
|
26
|
+
} | {
|
|
27
|
+
phase: 'unavailable';
|
|
28
|
+
error: Error;
|
|
29
|
+
} | {
|
|
30
|
+
phase: 'terminal';
|
|
31
|
+
event: ResponsesWebSocketEvent;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Optional, caller-fed reconstruction of one lane's provisional output.
|
|
35
|
+
*
|
|
36
|
+
* Feed the raw events returned by lane.receive(). Use a separate instance per
|
|
37
|
+
* lane. This helper never reads, sends, closes, or registers a listener on a
|
|
38
|
+
* socket; raw events remain in the caller's hands. Tools remain output data.
|
|
39
|
+
* Provisional response metadata is preserved as received and is not yet schema
|
|
40
|
+
* validated. Narrow its unknown fields before use. Omitted fields remain absent.
|
|
41
|
+
* Raw deltas give per-event progress. Use outputAt(event.output_index) when an
|
|
42
|
+
* item finishes, or pass its content_index/summary_index to read only a changed
|
|
43
|
+
* part. For citations use content_index and annotation_index together. A full
|
|
44
|
+
* current, item, or part read materializes its entire nested contents, so
|
|
45
|
+
* reserve those reads for when that complete snapshot is needed.
|
|
46
|
+
*
|
|
47
|
+
* A socket stream can omit the item/content scaffolding required for deltas.
|
|
48
|
+
* Such a response is marked unavailable until the next creation or terminal
|
|
49
|
+
* event. Terminal events, including failures and errors, are retained exactly as
|
|
50
|
+
* delivered, without filling omitted output from provisional data.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ResponsesWebSocketAccumulator {
|
|
53
|
+
#private;
|
|
54
|
+
/** Materialize the full state. For per-item progress prefer outputAt(). */
|
|
55
|
+
get current(): ResponsesWebSocketAccumulatorState | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Read one provisional item by wire output_index, or just one message/
|
|
58
|
+
* reasoning part with its wire content_index/summary_index. Add annotation_index
|
|
59
|
+
* to content_index to read one raw citation. Full item and part reads copy all
|
|
60
|
+
* nested entries; prefer a selector for progress on a growing collection.
|
|
61
|
+
* Copies remain valid after further events, and cannot change the accumulator.
|
|
62
|
+
* Returns undefined for absent/mismatched parts or outside provisional output.
|
|
63
|
+
*/
|
|
64
|
+
outputAt(outputIndex: number): ProvisionalOutputItem | undefined;
|
|
65
|
+
outputAt(outputIndex: number, part: PartSelector): unknown;
|
|
66
|
+
/** Drop retained provisional and terminal state without affecting any lane. */
|
|
67
|
+
reset(): void;
|
|
68
|
+
/** Record one raw lane event. Unknown event types leave the current state unchanged. */
|
|
69
|
+
add(event: ResponsesWebSocketEvent): void;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=responses-websocket-accumulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses-websocket-accumulator.d.ts","sourceRoot":"","sources":["../../src/lib/responses/responses-websocket-accumulator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,+CAA4C;AACxF,OAAO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E,YAAY,GAAG,OAAO;IA4D1D,+EAA+E;IAC/E,KAAK,IAAI,IAAI;IA0Jb,wFAAwF;IACxF,GAAG,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI;CAoC1C"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _ResponsesWebSocketAccumulator_instances, _a, _ResponsesWebSocketAccumulator_context, _ResponsesWebSocketAccumulator_current, _ResponsesWebSocketAccumulator_at, _ResponsesWebSocketAccumulator_copyOutput, _ResponsesWebSocketAccumulator_validateOutputScaffold, _ResponsesWebSocketAccumulator_validateContentPart, _ResponsesWebSocketAccumulator_validateOutputEvent, _ResponsesWebSocketAccumulator_start;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ResponsesWebSocketAccumulator = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const error_1 = require("../../core/error.js");
|
|
7
|
+
const canonical_output_text_1 = require("../../internal/responses/canonical-output-text.js");
|
|
8
|
+
const response_accumulator_1 = require("../../internal/responses/response-accumulator.js");
|
|
9
|
+
const utils_1 = require("../../internal/utils.js");
|
|
10
|
+
const values_1 = require("../../internal/utils/values.js");
|
|
11
|
+
// Keep the raw boundary aligned with the generated discriminants. Future wire
|
|
12
|
+
// items still belong to the raw lane and authoritative terminal event.
|
|
13
|
+
const outputItemTypes = {
|
|
14
|
+
message: true,
|
|
15
|
+
file_search_call: true,
|
|
16
|
+
function_call: true,
|
|
17
|
+
function_call_output: true,
|
|
18
|
+
web_search_call: true,
|
|
19
|
+
computer_call: true,
|
|
20
|
+
computer_call_output: true,
|
|
21
|
+
reasoning: true,
|
|
22
|
+
program: true,
|
|
23
|
+
program_output: true,
|
|
24
|
+
tool_search_call: true,
|
|
25
|
+
tool_search_output: true,
|
|
26
|
+
additional_tools: true,
|
|
27
|
+
compaction: true,
|
|
28
|
+
image_generation_call: true,
|
|
29
|
+
code_interpreter_call: true,
|
|
30
|
+
local_shell_call: true,
|
|
31
|
+
local_shell_call_output: true,
|
|
32
|
+
shell_call: true,
|
|
33
|
+
shell_call_output: true,
|
|
34
|
+
apply_patch_call: true,
|
|
35
|
+
apply_patch_call_output: true,
|
|
36
|
+
mcp_call: true,
|
|
37
|
+
mcp_list_tools: true,
|
|
38
|
+
mcp_approval_request: true,
|
|
39
|
+
mcp_approval_response: true,
|
|
40
|
+
custom_tool_call: true,
|
|
41
|
+
custom_tool_call_output: true,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Optional, caller-fed reconstruction of one lane's provisional output.
|
|
45
|
+
*
|
|
46
|
+
* Feed the raw events returned by lane.receive(). Use a separate instance per
|
|
47
|
+
* lane. This helper never reads, sends, closes, or registers a listener on a
|
|
48
|
+
* socket; raw events remain in the caller's hands. Tools remain output data.
|
|
49
|
+
* Provisional response metadata is preserved as received and is not yet schema
|
|
50
|
+
* validated. Narrow its unknown fields before use. Omitted fields remain absent.
|
|
51
|
+
* Raw deltas give per-event progress. Use outputAt(event.output_index) when an
|
|
52
|
+
* item finishes, or pass its content_index/summary_index to read only a changed
|
|
53
|
+
* part. For citations use content_index and annotation_index together. A full
|
|
54
|
+
* current, item, or part read materializes its entire nested contents, so
|
|
55
|
+
* reserve those reads for when that complete snapshot is needed.
|
|
56
|
+
*
|
|
57
|
+
* A socket stream can omit the item/content scaffolding required for deltas.
|
|
58
|
+
* Such a response is marked unavailable until the next creation or terminal
|
|
59
|
+
* event. Terminal events, including failures and errors, are retained exactly as
|
|
60
|
+
* delivered, without filling omitted output from provisional data.
|
|
61
|
+
*/
|
|
62
|
+
class ResponsesWebSocketAccumulator {
|
|
63
|
+
constructor() {
|
|
64
|
+
_ResponsesWebSocketAccumulator_instances.add(this);
|
|
65
|
+
_ResponsesWebSocketAccumulator_context.set(this, (0, response_accumulator_1.createResponseContext)());
|
|
66
|
+
_ResponsesWebSocketAccumulator_current.set(this, void 0);
|
|
67
|
+
}
|
|
68
|
+
/** Materialize the full state. For per-item progress prefer outputAt(). */
|
|
69
|
+
get current() {
|
|
70
|
+
if (tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f")?.phase === 'provisional') {
|
|
71
|
+
if (tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f").outputTextDirty) {
|
|
72
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f").snapshot.output_text = tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f").snapshot.output
|
|
73
|
+
.map((output) => (0, canonical_output_text_1.getOutputText)(tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f"), output))
|
|
74
|
+
.join('');
|
|
75
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f").outputTextDirty = false;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
phase: 'provisional',
|
|
79
|
+
snapshot: tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f").snapshot),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return structuredClone(tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f"));
|
|
83
|
+
}
|
|
84
|
+
// oxlint-disable-next-line anti-slop/no-unknown-returns -- Only the generated output discriminator is validated; every raw nested value must remain unknown to callers.
|
|
85
|
+
outputAt(outputIndex, part) {
|
|
86
|
+
if (tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f")?.phase !== 'provisional') {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
const output = tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_at).call(_a, tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f").snapshot.output, outputIndex);
|
|
90
|
+
if (!part) {
|
|
91
|
+
return tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, output);
|
|
92
|
+
}
|
|
93
|
+
if ('content_index' in part) {
|
|
94
|
+
if (output?.type === 'message' || output?.type === 'reasoning') {
|
|
95
|
+
const content = tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_at).call(_a, output.content, part.content_index);
|
|
96
|
+
if ('annotation_index' in part) {
|
|
97
|
+
return tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, content?.type === 'output_text'
|
|
98
|
+
? tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_at).call(_a, content.annotations, part.annotation_index)
|
|
99
|
+
: undefined);
|
|
100
|
+
}
|
|
101
|
+
return tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, content);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (output?.type === 'reasoning') {
|
|
105
|
+
return tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_at).call(_a, output.summary, part.summary_index));
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
/** Drop retained provisional and terminal state without affecting any lane. */
|
|
110
|
+
reset() {
|
|
111
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_context, (0, response_accumulator_1.createResponseContext)(), "f");
|
|
112
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_current, undefined, "f");
|
|
113
|
+
}
|
|
114
|
+
/** Record one raw lane event. Unknown event types leave the current state unchanged. */
|
|
115
|
+
add(event) {
|
|
116
|
+
if (event.type === 'response.completed' ||
|
|
117
|
+
event.type === 'response.failed' ||
|
|
118
|
+
event.type === 'response.incomplete' ||
|
|
119
|
+
event.type === 'error') {
|
|
120
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_context, (0, response_accumulator_1.createResponseContext)(), "f");
|
|
121
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_current, { phase: 'terminal', event: structuredClone(event) }, "f");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
if (event.type === 'response.created') {
|
|
126
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_instances, "m", _ResponsesWebSocketAccumulator_start).call(this, { response: event.response });
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (!(0, response_accumulator_1.isResponseOutputEvent)(event) ||
|
|
130
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f")?.phase === 'unavailable' ||
|
|
131
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f")?.phase === 'terminal') {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f")?.phase !== 'provisional') {
|
|
135
|
+
throw new error_1.OpenAIError("Cannot reconstruct WebSocket output before 'response.created'");
|
|
136
|
+
}
|
|
137
|
+
const outputEvent = structuredClone(event);
|
|
138
|
+
tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_validateOutputEvent).call(_a, outputEvent);
|
|
139
|
+
(0, response_accumulator_1.accumulateWebSocketOutput)(outputEvent, tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_current, "f").snapshot, tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f"));
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_current, {
|
|
143
|
+
phase: 'unavailable',
|
|
144
|
+
error: error instanceof Error ? error : new error_1.OpenAIError('Invalid Responses WebSocket output event'),
|
|
145
|
+
}, "f");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.ResponsesWebSocketAccumulator = ResponsesWebSocketAccumulator;
|
|
150
|
+
_a = ResponsesWebSocketAccumulator, _ResponsesWebSocketAccumulator_context = new WeakMap(), _ResponsesWebSocketAccumulator_current = new WeakMap(), _ResponsesWebSocketAccumulator_instances = new WeakSet(), _ResponsesWebSocketAccumulator_at = function _ResponsesWebSocketAccumulator_at(collection, index) {
|
|
151
|
+
if (!Array.isArray(collection) || index === undefined || !Number.isSafeInteger(index) || index < 0) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
return collection[index];
|
|
155
|
+
}, _ResponsesWebSocketAccumulator_copyOutput = function _ResponsesWebSocketAccumulator_copyOutput(value) {
|
|
156
|
+
if (Array.isArray(value)) {
|
|
157
|
+
// SAFETY: Copying the array preserves every element's type and order.
|
|
158
|
+
return value.map((item) => tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, item));
|
|
159
|
+
}
|
|
160
|
+
if ((0, values_1.isObj)(value)) {
|
|
161
|
+
// SAFETY: Copying own data properties preserves the snapshot's JSON shape.
|
|
162
|
+
// fromEntries defines "__proto__" as an own property instead of invoking a setter.
|
|
163
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_copyOutput).call(_a, item)]));
|
|
164
|
+
}
|
|
165
|
+
return value;
|
|
166
|
+
}, _ResponsesWebSocketAccumulator_validateOutputScaffold = function _ResponsesWebSocketAccumulator_validateOutputScaffold(item) {
|
|
167
|
+
if (!(0, values_1.isObj)(item) ||
|
|
168
|
+
!(0, utils_1.hasOwn)(item, 'type') ||
|
|
169
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- An unknown discriminator cannot satisfy the generated typed preview union.
|
|
170
|
+
typeof item['type'] !== 'string' ||
|
|
171
|
+
!(0, utils_1.hasOwn)(outputItemTypes, item['type'])) {
|
|
172
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket output item');
|
|
173
|
+
}
|
|
174
|
+
if (item['type'] === 'message') {
|
|
175
|
+
if (!Array.isArray(item['content'])) {
|
|
176
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket message content');
|
|
177
|
+
}
|
|
178
|
+
for (const part of item['content']) {
|
|
179
|
+
tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_validateContentPart).call(_a, part);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (item['type'] === 'function_call' ||
|
|
183
|
+
item['type'] === 'custom_tool_call' ||
|
|
184
|
+
item['type'] === 'mcp_call') {
|
|
185
|
+
const field = item['type'] === 'custom_tool_call' ? 'input' : 'arguments';
|
|
186
|
+
if (!(0, utils_1.hasOwn)(item, 'name') ||
|
|
187
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- The caller feeds raw socket events; validate own required tool fields before exposing a typed snapshot.
|
|
188
|
+
typeof item['name'] !== 'string' ||
|
|
189
|
+
!(0, utils_1.hasOwn)(item, field) ||
|
|
190
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Missing and numeric tool data cannot be extended as text.
|
|
191
|
+
typeof item[field] !== 'string') {
|
|
192
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket tool scaffold');
|
|
193
|
+
}
|
|
194
|
+
if (item['type'] === 'mcp_call' &&
|
|
195
|
+
(!(0, utils_1.hasOwn)(item, 'server_label') ||
|
|
196
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- The server identity on an MCP scaffold is raw data, not a generated decoded string.
|
|
197
|
+
typeof item['server_label'] !== 'string')) {
|
|
198
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket MCP server label');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, _ResponsesWebSocketAccumulator_validateContentPart = function _ResponsesWebSocketAccumulator_validateContentPart(part) {
|
|
202
|
+
if (!(0, values_1.isObj)(part) ||
|
|
203
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Raw output_text must not be silently coerced during a later provisional read.
|
|
204
|
+
(part['type'] === 'output_text' && typeof part['text'] !== 'string')) {
|
|
205
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket content part');
|
|
206
|
+
}
|
|
207
|
+
}, _ResponsesWebSocketAccumulator_validateOutputEvent = function _ResponsesWebSocketAccumulator_validateOutputEvent(event) {
|
|
208
|
+
switch (event.type) {
|
|
209
|
+
case 'response.output_item.added':
|
|
210
|
+
case 'response.output_item.done': {
|
|
211
|
+
tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_validateOutputScaffold).call(_a, event.item);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case 'response.content_part.added':
|
|
215
|
+
case 'response.content_part.done': {
|
|
216
|
+
tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_validateContentPart).call(_a, event.part);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
case 'response.function_call_arguments.delta':
|
|
220
|
+
case 'response.mcp_call_arguments.delta':
|
|
221
|
+
case 'response.custom_tool_call_input.delta':
|
|
222
|
+
case 'response.output_text.delta':
|
|
223
|
+
case 'response.refusal.delta': {
|
|
224
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- The cloned raw event has not been schema-validated; do not coerce data into typed tool arguments.
|
|
225
|
+
if (typeof event.delta !== 'string') {
|
|
226
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket tool delta');
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
case 'response.function_call_arguments.done':
|
|
231
|
+
case 'response.mcp_call_arguments.done': {
|
|
232
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- A final raw argument payload must satisfy the field exposed by the provisional snapshot.
|
|
233
|
+
if (typeof event.arguments !== 'string') {
|
|
234
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket tool arguments');
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
case 'response.custom_tool_call_input.done': {
|
|
239
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Do not substitute omitted, null or object input for the typed text field.
|
|
240
|
+
if (typeof event.input !== 'string') {
|
|
241
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket custom tool input');
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
case 'response.output_text.done': {
|
|
246
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Only actual wire text can replace the accumulated message text.
|
|
247
|
+
if (typeof event.text !== 'string') {
|
|
248
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket completed text');
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
case 'response.refusal.done': {
|
|
253
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Refusals use their own finalized wire text field.
|
|
254
|
+
if (typeof event.refusal !== 'string') {
|
|
255
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket completed refusal');
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
default: {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, _ResponsesWebSocketAccumulator_start = function _ResponsesWebSocketAccumulator_start(event) {
|
|
264
|
+
this.reset();
|
|
265
|
+
if (!(0, values_1.isObj)(event.response)) {
|
|
266
|
+
throw new error_1.OpenAIError('Responses WebSocket created event must contain a response');
|
|
267
|
+
}
|
|
268
|
+
// Only output fields are normalized; omitted response metadata is never invented.
|
|
269
|
+
const { output, output_text: outputText } = event.response;
|
|
270
|
+
if ((output !== undefined && !Array.isArray(output)) ||
|
|
271
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Validate optional text from an untyped WebSocket lifecycle before placing it in a typed provisional snapshot.
|
|
272
|
+
(outputText !== undefined && typeof outputText !== 'string')) {
|
|
273
|
+
throw new error_1.OpenAIError('Invalid Responses WebSocket initial output');
|
|
274
|
+
}
|
|
275
|
+
if (output !== undefined) {
|
|
276
|
+
for (const item of output) {
|
|
277
|
+
tslib_1.__classPrivateFieldGet(_a, _a, "m", _ResponsesWebSocketAccumulator_validateOutputScaffold).call(_a, item);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
const snapshot = (0, response_accumulator_1.cloneValidatedResponse)(tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f"), {
|
|
281
|
+
...event.response,
|
|
282
|
+
output: output ?? [],
|
|
283
|
+
output_text: outputText ?? '',
|
|
284
|
+
});
|
|
285
|
+
if (outputText === undefined) {
|
|
286
|
+
(0, canonical_output_text_1.ensureCanonicalOutputText)(tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f"), snapshot);
|
|
287
|
+
}
|
|
288
|
+
tslib_1.__classPrivateFieldGet(this, _ResponsesWebSocketAccumulator_context, "f").deferOutputText = true;
|
|
289
|
+
tslib_1.__classPrivateFieldSet(this, _ResponsesWebSocketAccumulator_current, { phase: 'provisional', snapshot }, "f");
|
|
290
|
+
};
|
|
291
|
+
//# sourceMappingURL=responses-websocket-accumulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses-websocket-accumulator.js","sourceRoot":"","sources":["../../src/lib/responses/responses-websocket-accumulator.ts"],"names":[],"mappings":";;;;;AAAA,+CAA+C;AAE/C,6FAA0G;AAC1G,2FAKuD;AACvD,mDAA8C;AAC9C,2DAAoD;AAapD,8EAA8E;AAC9E,uEAAuE;AACvE,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,IAAI;IACb,gBAAgB,EAAE,IAAI;IACtB,aAAa,EAAE,IAAI;IACnB,oBAAoB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