@genesislcap/ai-assistant 15.6.2 → 15.7.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/dist/ai-assistant.api.json +391 -5
- package/dist/ai-assistant.d.ts +613 -6
- package/dist/chat-driver.cjs +285 -26
- package/dist/chat-driver.cjs.map +3 -3
- package/dist/chat-driver.mjs +285 -26
- package/dist/chat-driver.mjs.map +3 -3
- package/dist/custom-elements.json +254 -10
- package/dist/dts/channel/ai-activity-channel.d.ts +51 -1
- package/dist/dts/channel/ai-activity-channel.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts +99 -1
- package/dist/dts/components/chat-driver/chat-driver.d.ts.map +1 -1
- package/dist/dts/components/chat-driver/chat-driver.test.d.ts.map +1 -1
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.budget.test.d.ts +2 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.budget.test.d.ts.map +1 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts +14 -0
- package/dist/dts/components/orchestrating-driver/orchestrating-driver.d.ts.map +1 -1
- package/dist/dts/main/blocked-state.test.d.ts +2 -0
- package/dist/dts/main/blocked-state.test.d.ts.map +1 -0
- package/dist/dts/main/main.d.ts +394 -6
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.styles.test.d.ts +2 -0
- package/dist/dts/main/main.styles.test.d.ts.map +1 -0
- package/dist/dts/main/main.template.d.ts +53 -0
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/state/ai-assistant-slice.d.ts +162 -6
- package/dist/dts/state/ai-assistant-slice.d.ts.map +1 -1
- package/dist/dts/state/debug-event-log.d.ts +6 -1
- package/dist/dts/state/debug-event-log.d.ts.map +1 -1
- package/dist/dts/state/session-store.d.ts +11 -0
- package/dist/dts/state/session-store.d.ts.map +1 -1
- package/dist/esm/components/chat-driver/chat-driver.js +263 -21
- package/dist/esm/components/chat-driver/chat-driver.test.js +464 -1
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.budget.test.js +312 -0
- package/dist/esm/components/orchestrating-driver/orchestrating-driver.js +89 -4
- package/dist/esm/main/blocked-state.test.js +969 -0
- package/dist/esm/main/main.js +704 -16
- package/dist/esm/main/main.styles.js +47 -0
- package/dist/esm/main/main.styles.test.js +86 -0
- package/dist/esm/main/main.template.js +121 -4
- package/dist/esm/state/ai-assistant-slice.js +145 -7
- package/dist/esm/state/ai-assistant-slice.test.js +138 -1
- package/dist/esm/state/debug-event-log.js +7 -2
- package/dist/esm/state/debug-event-log.test.js +49 -1
- package/dist/esm/state/persistence/session-snapshot.test.js +18 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/migration-GENC-1464.md +562 -0
- package/docs/sub_agent.md +20 -3
- package/package.json +17 -17
- package/src/channel/ai-activity-channel.ts +56 -2
- package/src/components/chat-driver/chat-driver.test.ts +549 -0
- package/src/components/chat-driver/chat-driver.ts +324 -14
- package/src/components/orchestrating-driver/orchestrating-driver.budget.test.ts +438 -0
- package/src/components/orchestrating-driver/orchestrating-driver.ts +101 -6
- package/src/main/blocked-state.test.ts +1316 -0
- package/src/main/main.styles.test.ts +103 -0
- package/src/main/main.styles.ts +47 -0
- package/src/main/main.template.ts +131 -4
- package/src/main/main.ts +704 -10
- package/src/state/ai-assistant-slice.test.ts +215 -0
- package/src/state/ai-assistant-slice.ts +218 -8
- package/src/state/debug-event-log.test.ts +63 -0
- package/src/state/debug-event-log.ts +7 -2
- package/src/state/persistence/session-snapshot.test.ts +22 -0
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { AIProviderRegistry, ChatAttachment, ChatDriverResult, ChatMessage, ChatToolChoice, InteractionRequestOptions, SubAgentFailureReason } from '@genesislcap/foundation-ai';
|
|
2
|
+
import { BudgetExhaustedError } from '@genesislcap/foundation-ai';
|
|
2
3
|
import { type ActivityBus } from '../../channel/ai-activity-bus';
|
|
3
4
|
import type { AgentConfig, SystemPromptInput, ToolDefinitionsInput, ToolHandlersInput } from '../../config/config';
|
|
4
5
|
import type { DiagnosticEntry } from '../../state/persistence/diagnostics';
|
|
5
6
|
import type { InteractionContext } from '../../types/interaction-context';
|
|
6
7
|
import type { AiDriver, AllAgentSummary } from '../ai-driver/ai-driver';
|
|
8
|
+
/**
|
|
9
|
+
* The `budget` payload carried on a `'budget-exhausted'` {@link ChatDriverResult}.
|
|
10
|
+
* Derived from the type rather than restated so the two cannot drift.
|
|
11
|
+
*/
|
|
12
|
+
type BudgetDetail = NonNullable<Extract<ChatDriverResult, {
|
|
13
|
+
reason: 'done';
|
|
14
|
+
}>['budget']>;
|
|
7
15
|
/** Name reserved for the cross-agent handoff tool — injected by OrchestratingDriver. */
|
|
8
16
|
export declare const REQUEST_CONTINUATION_TOOL = "request_continuation";
|
|
9
17
|
/**
|
|
@@ -116,6 +124,22 @@ export interface ChatDriverConfig {
|
|
|
116
124
|
* it defaults to {@link NOOP_ACTIVITY_BUS} so no `BroadcastChannel` is ever opened.
|
|
117
125
|
*/
|
|
118
126
|
activityBus?: ActivityBus;
|
|
127
|
+
/**
|
|
128
|
+
* Transcript copy appended when the AI-spend budget wall is hit (GENC-1464).
|
|
129
|
+
* Defaults to `DEFAULT_BUDGET_EXHAUSTED_MESSAGE`.
|
|
130
|
+
*
|
|
131
|
+
* The assistant element already lets a host override the blocked **banner**
|
|
132
|
+
* via `setBlocked(true, reason)`; without this the transcript **bubble** stayed
|
|
133
|
+
* on the default, so a white-labelled host got its own copy in the banner and
|
|
134
|
+
* the shipped default directly below it. Passing the same effective copy here
|
|
135
|
+
* keeps the two surfaces saying one thing.
|
|
136
|
+
*
|
|
137
|
+
* Deliberately a driver-config field rather than something read off a chat
|
|
138
|
+
* config: `ChatDriver` has no `chatConfig` and is used standalone (see
|
|
139
|
+
* `chat-driver-node`), so threading one in would be a much larger and less
|
|
140
|
+
* reversible change.
|
|
141
|
+
*/
|
|
142
|
+
budgetExhaustedMessage?: string;
|
|
119
143
|
}
|
|
120
144
|
/**
|
|
121
145
|
* Plain TS class that drives a multi-turn chat conversation, including the tool-call loop.
|
|
@@ -287,6 +311,10 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
287
311
|
* Set when a sub-agent's tool loop ends without `completeSubAgent` being
|
|
288
312
|
* called. Read by the parent's `invokeSubAgent` to build the `{ ok: false }`
|
|
289
313
|
* branch of `requestSubAgent`. Only ever set when `isSubAgent` is true.
|
|
314
|
+
*
|
|
315
|
+
* `budget` rides along on a `'budget_exhausted'` failure so the parent inherits
|
|
316
|
+
* the child's ATTRIBUTION, not just the fact of a wall — see
|
|
317
|
+
* `budgetWallDetail`.
|
|
290
318
|
*/
|
|
291
319
|
private subAgentFailure;
|
|
292
320
|
/**
|
|
@@ -435,6 +463,39 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
435
463
|
private readonly sessionKey;
|
|
436
464
|
/** Injected activity bus; defaults to a no-op off-browser (Node/tests/headless). */
|
|
437
465
|
private readonly activityBus;
|
|
466
|
+
/** Transcript copy for a budget wall — see `ChatDriverConfig.budgetExhaustedMessage`. */
|
|
467
|
+
private readonly budgetExhaustedMessage;
|
|
468
|
+
/**
|
|
469
|
+
* Set the moment a budget wall is observed anywhere in this turn — this
|
|
470
|
+
* driver's own 402, or a sub-agent's (which surfaces here only as a
|
|
471
|
+
* `'budget_exhausted'` tool result). Read at the top of the tool loop to end
|
|
472
|
+
* the turn before issuing another model call that would hit the same wall.
|
|
473
|
+
* Reset per turn alongside the other per-turn counters.
|
|
474
|
+
*/
|
|
475
|
+
private budgetExhaustedThisTurn;
|
|
476
|
+
/**
|
|
477
|
+
* The refusing vendor's own attribution for the wall `budgetExhaustedThisTurn`
|
|
478
|
+
* records, when it was knowable. Kept SEPARATE from the flag rather than
|
|
479
|
+
* replacing it: a figure-less 402 from a transport no vendor claims yields no
|
|
480
|
+
* detail at all (`budgetDetailOf` returns `undefined`), and folding the two
|
|
481
|
+
* would make that case stop ending the turn.
|
|
482
|
+
*
|
|
483
|
+
* It matters most for a sub-agent's wall. The child can sit on a different
|
|
484
|
+
* vendor from its parent — `applyAgent` reads `config.provider` — so without
|
|
485
|
+
* this the parent's short-circuit reports `lastResolvedProvider`, i.e. the one
|
|
486
|
+
* vendor that did NOT refuse. Under a mixed registry that walls Gemini because
|
|
487
|
+
* an Anthropic child 402'd, and if those are the only two reachable vendors the
|
|
488
|
+
* host then derives `blocked` and locks a composer that still had headroom.
|
|
489
|
+
*/
|
|
490
|
+
private budgetWallDetail?;
|
|
491
|
+
/**
|
|
492
|
+
* Whether this turn's budget wall came from a SUB-AGENT rather than this
|
|
493
|
+
* driver's own request. Decides whether `lastResolvedProvider` is a valid
|
|
494
|
+
* attribution fallback: for an own wall it is the refusing vendor, for a
|
|
495
|
+
* child's wall it is the parent's vendor — the one known NOT to have refused.
|
|
496
|
+
* Reset per turn alongside `budgetWallDetail`.
|
|
497
|
+
*/
|
|
498
|
+
private budgetWallViaSubAgent;
|
|
438
499
|
constructor(providerRegistry: AIProviderRegistry, config?: ChatDriverConfig);
|
|
439
500
|
/**
|
|
440
501
|
* Tear down the driver: aborts the lifecycle signal so any in-flight provider
|
|
@@ -481,14 +542,49 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
481
542
|
* the historical `{ reason: 'done' }`.
|
|
482
543
|
*/
|
|
483
544
|
private turnDone;
|
|
545
|
+
/**
|
|
546
|
+
* Terminal budget outcome for a wall hit **outside** the tool loop — today,
|
|
547
|
+
* `OrchestratingDriver`'s classification phase, which calls the provider
|
|
548
|
+
* directly and so never enters `runToolLoop`.
|
|
549
|
+
*
|
|
550
|
+
* Does **not** publish `tool-loop-end`: no `tool-loop-start` was published for
|
|
551
|
+
* the classify phase, and an unbalanced end would break start/end pairing for
|
|
552
|
+
* subscribers that rely on it. The driver **return value** is what reports this
|
|
553
|
+
* case — see `FoundationAiAssistant`'s latch, which reads both seams for
|
|
554
|
+
* exactly this reason.
|
|
555
|
+
*
|
|
556
|
+
* The non-sub-agent tail of the in-loop `BudgetExhaustedError` branch lives
|
|
557
|
+
* here so there is one copy of the log line, the debug-log entry, the
|
|
558
|
+
* transcript bubble and the result shape rather than two that can drift.
|
|
559
|
+
*
|
|
560
|
+
* @param pendingUserMessage - a user message that has NOT yet been appended,
|
|
561
|
+
* appended first so the answer does not end up replying to nothing. Only the
|
|
562
|
+
* classification seam passes it: `OrchestratingDriver` dispatches the user's
|
|
563
|
+
* text as an optimistic `history-updated` detail and leaves the real append
|
|
564
|
+
* to `chatDriver.sendMessage`, which never runs when `classify()` throws — so
|
|
565
|
+
* the bubble below would re-dispatch a history the user's own message was
|
|
566
|
+
* never in, and it would vanish from the transcript on the next render. The
|
|
567
|
+
* in-loop caller has already appended it and passes nothing.
|
|
568
|
+
*
|
|
569
|
+
* @internal
|
|
570
|
+
*/
|
|
571
|
+
reportBudgetExhausted(e: BudgetExhaustedError, pendingUserMessage?: ChatMessage): ChatDriverResult;
|
|
484
572
|
/** The typed failure reason on a loop result, or `undefined` for a clean turn / handoff. */
|
|
485
573
|
private static failureReasonOf;
|
|
486
574
|
/**
|
|
487
575
|
* Build the `tool-loop-end` event detail for a turn's result. A failure carries a
|
|
488
576
|
* `{ failureReason }` detail; a clean turn emits `undefined` — the historical shape,
|
|
489
577
|
* kept byte-identical so subscribers see exactly what they always have.
|
|
578
|
+
*
|
|
579
|
+
* A budget failure additionally carries `vendor` — the concrete vendor
|
|
580
|
+
* (`'anthropic'`/`'gemini'`) the walled turn resolved to, which the driver knows
|
|
581
|
+
* and used to discard. Optional and additive: a subscriber reading only
|
|
582
|
+
* `failureReason` is unaffected, a non-budget failure still emits the historical
|
|
583
|
+
* `{ failureReason }` with no `vendor` key, and the value is a plain string so
|
|
584
|
+
* the detail stays structured-cloneable for the cross-tab hop. It is the field a
|
|
585
|
+
* per-vendor budget model needs and the one that would be awkward to retrofit.
|
|
490
586
|
*/
|
|
491
|
-
private
|
|
587
|
+
private loopEndDetail;
|
|
492
588
|
/**
|
|
493
589
|
* Swap in a new agent's configuration. Called by OrchestratingDriver before
|
|
494
590
|
* each specialist turn so the shared driver runs with the right tools and prompt.
|
|
@@ -555,6 +651,7 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
555
651
|
*/
|
|
556
652
|
getSubAgentFailure(): {
|
|
557
653
|
reason: SubAgentFailureReason;
|
|
654
|
+
budget?: BudgetDetail;
|
|
558
655
|
} | undefined;
|
|
559
656
|
/**
|
|
560
657
|
* Record a sub-agent failure reason (first one wins). No-op for top-level
|
|
@@ -745,4 +842,5 @@ export declare class ChatDriver extends EventTarget implements AiDriver {
|
|
|
745
842
|
private runToolLoop;
|
|
746
843
|
private appendToHistory;
|
|
747
844
|
}
|
|
845
|
+
export {};
|
|
748
846
|
//# sourceMappingURL=chat-driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAGlB,cAAc,EACd,gBAAgB,EAEhB,WAAW,EAGX,cAAc,EAKd,yBAAyB,EAEzB,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAGlB,cAAc,EACd,gBAAgB,EAEhB,WAAW,EAGX,cAAc,EAKd,yBAAyB,EAEzB,qBAAqB,EAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EAMrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EAKX,iBAAiB,EAIjB,oBAAoB,EACpB,iBAAiB,EAElB,MAAM,q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AC/B,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,GAAG,EACT,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,CAAC,CAAC;IAmEb;;;OAGG;IACI,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;IAyInE;;;;OAIG;IACI,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAInF;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;IASjC;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAS3C,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsD/F;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,mBAAmB;IA8F3B;;;;;OAKG;YACW,cAAc;IAsO5B;;;OAGG;IACG,mBAAmB,CAAC,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAoDrF,wFAAwF;IACxF,OAAO,CAAC,OAAO;IAKf;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;IAMtB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA+BxB,uFAAuF;IACvF,OAAO,CAAC,QAAQ;IAsChB,OAAO,CAAC,aAAa;IAQrB,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAWjB,mFAAmF;IACnF,OAAO,CAAC,2BAA2B;YAkCrB,WAAW;IAq5BzB,OAAO,CAAC,eAAe;CAoBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-driver.test.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-driver.test.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-driver/chat-driver.test.ts"],"names":[],"mappings":"AA8BA,OAAO,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.budget.test.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.budget.test.ts"],"names":[],"mappings":"AAaA,OAAO,oCAAoC,CAAC"}
|
|
@@ -33,6 +33,17 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
|
|
|
33
33
|
* user stops. Reset at the start of each `sendMessage`.
|
|
34
34
|
*/
|
|
35
35
|
private cancelled;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the CURRENT turn's user message has reached the inner driver's
|
|
38
|
+
* history. False through the pre-first-turn classify (where the only echo of
|
|
39
|
+
* the message is an optimistic `history-updated` dispatch), true from the
|
|
40
|
+
* moment `chatDriver.sendMessage` is entered — including through every later
|
|
41
|
+
* handoff classify. Read by the budget-wall catch in `sendMessage` to decide
|
|
42
|
+
* whether `reportBudgetExhausted` must append the message itself: appending
|
|
43
|
+
* it when already appended duplicated it; not appending it when unappended
|
|
44
|
+
* made it vanish. Reset at the top of each `runOrchestratedTurn`.
|
|
45
|
+
*/
|
|
46
|
+
private userMessageAppended;
|
|
36
47
|
/**
|
|
37
48
|
* Sticky user pick from the picker (or the host's `setAgent` API). Only
|
|
38
49
|
* changes on explicit user action. Survives flow completion: when a stateful
|
|
@@ -66,6 +77,8 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
|
|
|
66
77
|
maxTurnSnapshots?: number;
|
|
67
78
|
/** Activity bus passed through to the inner ChatDriver (browser host injects the singleton). */
|
|
68
79
|
activityBus?: ActivityBus;
|
|
80
|
+
/** Budget-wall transcript copy, passed through to the inner ChatDriver (GENC-1464). */
|
|
81
|
+
budgetExhaustedMessage?: string;
|
|
69
82
|
});
|
|
70
83
|
resolveInteraction(interactionId: string, result: unknown): void;
|
|
71
84
|
getInteractionContext(interactionId: string): InteractionContext | undefined;
|
|
@@ -98,6 +111,7 @@ export declare class OrchestratingDriver extends EventTarget implements AiDriver
|
|
|
98
111
|
getExternalDiagnostics(): ReadonlyArray<DiagnosticEntry>;
|
|
99
112
|
getSuggestions(history: ChatMessage[], prompt: string, count: number, allAgentInfo?: AllAgentSummary[]): Promise<string[]>;
|
|
100
113
|
sendMessage(input: string, attachments?: ChatAttachment[]): Promise<ChatDriverResult>;
|
|
114
|
+
private runOrchestratedTurn;
|
|
101
115
|
continueFromHistory(transientPrimer?: ChatMessage[]): Promise<ChatDriverResult>;
|
|
102
116
|
/** {@inheritDoc AiDriver.primeRestoredAgentState} */
|
|
103
117
|
primeRestoredAgentState(snapshots: Record<string, unknown>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrating-driver.d.ts","sourceRoot":"","sources":["../../../../src/components/orchestrating-driver/orchestrating-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AAoDpC;;;;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