@burdenoff/fe-libs 2026.919.1 → 2026.920.1
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/shared/assistant/adminModeSendGate.d.ts +43 -0
- package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
- package/dist/shared/assistant/adminModeSendGate.js +33 -18
- package/dist/shared/assistant/i18nManifest.d.ts +5 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +6 -1
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.d.ts +25 -0
- package/dist/shared/assistant/modeCapabilities.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +6 -2
- package/dist/shared/assistant/store.d.ts +26 -5
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +28 -18
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.d.ts +27 -10
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +22 -16
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +363 -347
- package/dist/shared/assistant/writeModeConsent.d.ts +99 -0
- package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -0
- package/dist/shared/assistant/writeModeConsent.js +48 -0
- package/dist/shared-assistant.js +110 -109
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { AssistantModeCapabilities } from './modeCapabilities';
|
|
2
|
+
import { AssistantModeConfig } from './conversation';
|
|
3
|
+
import { AssistantMode } from './types';
|
|
1
4
|
/** The role check's latest answer: is it still running, and did it say yes? */
|
|
2
5
|
export interface AdminModeAccess {
|
|
3
6
|
readonly loading: boolean;
|
|
@@ -37,6 +40,8 @@ export declare const ADMIN_MODE_ACCESS_WAIT_MS = 10000;
|
|
|
37
40
|
* behind the requested one), not here; the mode list has the same window today.
|
|
38
41
|
*/
|
|
39
42
|
export interface AdminModeAccessGate {
|
|
43
|
+
/** The latest answer, for the final synchronous validation after a wait. */
|
|
44
|
+
read(): AdminModeAccess;
|
|
40
45
|
/** Record the check's current state, releasing every held send once it lands. */
|
|
41
46
|
update(access: AdminModeAccess): void;
|
|
42
47
|
/**
|
|
@@ -78,4 +83,42 @@ export declare function createAdminModeAccessGate(initial: AdminModeAccess): Adm
|
|
|
78
83
|
export declare function adminOnlyModeSendRefusalAfterAccess(config: {
|
|
79
84
|
readonly requiresAdmin?: boolean;
|
|
80
85
|
} | null | undefined, gate: AdminModeAccessGate, timeoutMs?: number): Promise<string | null>;
|
|
86
|
+
/**
|
|
87
|
+
* Why a send in a mode the product does not offer must not go out, or null —
|
|
88
|
+
* decided when the role check has answered, against the product's mode list AS
|
|
89
|
+
* IT IS THEN (BOFF-7308).
|
|
90
|
+
*
|
|
91
|
+
* An unlisted mode gets the same role-check window as the reset effect, and
|
|
92
|
+
* `readConfig` is read again afterwards. This honours a list that arrives
|
|
93
|
+
* DURING that check, but is not a mode-list readiness signal: the product
|
|
94
|
+
* contract cannot distinguish a loading list from a settled empty one.
|
|
95
|
+
*
|
|
96
|
+
* A mode that IS listed is never held: the common path pays nothing.
|
|
97
|
+
*/
|
|
98
|
+
export declare function unofferedModeSendRefusalAfterAccess(mode: AssistantMode, readConfig: () => {
|
|
99
|
+
readonly id: AssistantMode;
|
|
100
|
+
} | null | undefined, gate: AdminModeAccessGate, timeoutMs?: number): Promise<string | null>;
|
|
101
|
+
/** One validated snapshot for the turn's capabilities, consent and voice gates. */
|
|
102
|
+
export interface AssistantSendMode {
|
|
103
|
+
readonly config: AssistantModeConfig | undefined;
|
|
104
|
+
readonly capabilities: AssistantModeCapabilities;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The one snapshot a send is judged on, taken after BOTH possible access waits
|
|
108
|
+
* (BOFF-7308).
|
|
109
|
+
*
|
|
110
|
+
* ★★ Everything downstream reads THIS, not a value captured when the send
|
|
111
|
+
* began. A held send used to re-read `requiresAdmin` from the live list while
|
|
112
|
+
* keeping the capabilities resolved before the wait, so a turn in a mode whose
|
|
113
|
+
* config landed during the hold ran on built-in defaults: the wrong stream
|
|
114
|
+
* budget, and artifacts never collected for a mode configured to produce them.
|
|
115
|
+
* A removed mode must not fall back to its old config either.
|
|
116
|
+
*
|
|
117
|
+
* ★ Roles are the only thing waited for. A mode list that loads independently
|
|
118
|
+
* of them needs a readiness signal the product seam does not carry today —
|
|
119
|
+
* `AssistantProductProvider` has no "modes still loading" flag, and a settled
|
|
120
|
+
* empty list is indistinguishable from a loading one. Adding that contract,
|
|
121
|
+
* shared with the reset effect, is a separate change.
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveAssistantSendModeAfterAccess(mode: AssistantMode, readConfig: () => AssistantModeConfig | undefined, gate: AdminModeAccessGate, timeoutMs?: number): Promise<AssistantSendMode>;
|
|
81
124
|
//# sourceMappingURL=adminModeSendGate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminModeSendGate.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/adminModeSendGate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adminModeSendGate.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/adminModeSendGate.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CAC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mC,CACvD,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,mBAAmB,GAAG,SAAS,EACjD,IAAI,EAAE,mBAAmB,EACzB,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CA6B5B"}
|
|
@@ -1,37 +1,52 @@
|
|
|
1
|
-
import { adminOnlyModeSendRefusal as e } from "./modeCapabilities.js";
|
|
1
|
+
import { adminOnlyModeSendRefusal as e, resolveAssistantModeCapabilities as t, unofferedModeSendRefusal as n } from "./modeCapabilities.js";
|
|
2
2
|
//#region src/shared/assistant/adminModeSendGate.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
let t =
|
|
7
|
-
|
|
3
|
+
var r = 1e4;
|
|
4
|
+
function i(e) {
|
|
5
|
+
let t = e, n = [], i = (e) => {
|
|
6
|
+
let t = n;
|
|
7
|
+
n = [];
|
|
8
8
|
for (let n of t) n.timer !== null && clearTimeout(n.timer), n.settle(e);
|
|
9
9
|
};
|
|
10
10
|
return {
|
|
11
|
+
read: () => t,
|
|
11
12
|
update(e) {
|
|
12
|
-
|
|
13
|
+
t = e, e.loading || i(e);
|
|
13
14
|
},
|
|
14
|
-
wait(e =
|
|
15
|
-
return
|
|
15
|
+
wait(e = r) {
|
|
16
|
+
return t.loading ? new Promise((r) => {
|
|
16
17
|
let i = {
|
|
17
|
-
settle:
|
|
18
|
+
settle: r,
|
|
18
19
|
timer: null
|
|
19
20
|
};
|
|
20
21
|
i.timer = setTimeout(() => {
|
|
21
|
-
|
|
22
|
-
}, e),
|
|
23
|
-
}) : Promise.resolve(
|
|
22
|
+
n = n.filter((e) => e !== i), r(t);
|
|
23
|
+
}, e), n.push(i);
|
|
24
|
+
}) : Promise.resolve(t);
|
|
24
25
|
},
|
|
25
26
|
abandon() {
|
|
26
|
-
i(
|
|
27
|
+
i(t);
|
|
27
28
|
},
|
|
28
29
|
get pendingCount() {
|
|
29
|
-
return
|
|
30
|
+
return n.length;
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
async function
|
|
34
|
-
return
|
|
34
|
+
async function a(t, n, i = r) {
|
|
35
|
+
return t?.requiresAdmin ? e(t, await n.wait(i)) : null;
|
|
36
|
+
}
|
|
37
|
+
async function o(e, t, i, a = r) {
|
|
38
|
+
return n(e, t()) === null ? null : (await i.wait(a), n(e, t()));
|
|
39
|
+
}
|
|
40
|
+
async function s(i, a, s, c = r) {
|
|
41
|
+
let l = Date.now() + c, u = await o(i, a, s, c);
|
|
42
|
+
if (u) throw Error(u);
|
|
43
|
+
a()?.requiresAdmin && await s.wait(Math.max(0, l - Date.now()));
|
|
44
|
+
let d = a(), f = t(i, d), p = n(i, d) ?? (f.provisionable ? null : "This assistant mode is not available here. Switch to another mode and send again.") ?? e(d, s.read());
|
|
45
|
+
if (p) throw Error(p);
|
|
46
|
+
return {
|
|
47
|
+
config: d,
|
|
48
|
+
capabilities: f
|
|
49
|
+
};
|
|
35
50
|
}
|
|
36
51
|
//#endregion
|
|
37
|
-
export {
|
|
52
|
+
export { r as ADMIN_MODE_ACCESS_WAIT_MS, a as adminOnlyModeSendRefusalAfterAccess, i as createAdminModeAccessGate, s as resolveAssistantSendModeAfterAccess, o as unofferedModeSendRefusalAfterAccess };
|
|
@@ -290,6 +290,11 @@ export declare const ASSISTANT_I18N_LITERAL_COPY: {
|
|
|
290
290
|
readonly "voiceSession.transcriptHint": "Spoken turns in this conversation — kept out of your typed chat.";
|
|
291
291
|
readonly "voiceSession.transcriptTitle": "Voice transcript";
|
|
292
292
|
readonly "voiceSession.unmute": "Turn the microphone on";
|
|
293
|
+
readonly "writeConsent.body": "In {{mode}} mode the assistant can read AND change your data — creating records, logging activity, updating details, and more, on your behalf.";
|
|
294
|
+
readonly "writeConsent.cancel": "Stay in {{mode}}";
|
|
295
|
+
readonly "writeConsent.confirm": "Enable {{mode}}";
|
|
296
|
+
readonly "writeConsent.title": "Switch to {{mode}} mode?";
|
|
297
|
+
readonly "writeConsent.unconfirmed": "It does not stop to ask before each change — it makes changes as soon as it decides to. Only continue if you want the assistant to change your data without asking first.";
|
|
293
298
|
};
|
|
294
299
|
/** A relative key written out in a `tr()` call. */
|
|
295
300
|
export type AssistantI18nLiteralKey = keyof typeof ASSISTANT_I18N_LITERAL_COPY;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/i18nManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAS1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"i18nManifest.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/i18nManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAS1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkNG,CAAC;AAE5C,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAW/E;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBtE,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIjE,CAAC;AAEL,kEAAkE;AAClE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,EACnB,IAAI,GAAG,OAAO,GAAG,mBAAmB,CACrC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,uBAAuB,EAAE,GACxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9C,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiCzB"}
|
|
@@ -183,7 +183,12 @@ var l = {
|
|
|
183
183
|
"voiceSession.transcriptEmpty": "Nothing spoken yet in this session.",
|
|
184
184
|
"voiceSession.transcriptHint": "Spoken turns in this conversation — kept out of your typed chat.",
|
|
185
185
|
"voiceSession.transcriptTitle": "Voice transcript",
|
|
186
|
-
"voiceSession.unmute": "Turn the microphone on"
|
|
186
|
+
"voiceSession.unmute": "Turn the microphone on",
|
|
187
|
+
"writeConsent.body": "In {{mode}} mode the assistant can read AND change your data — creating records, logging activity, updating details, and more, on your behalf.",
|
|
188
|
+
"writeConsent.cancel": "Stay in {{mode}}",
|
|
189
|
+
"writeConsent.confirm": "Enable {{mode}}",
|
|
190
|
+
"writeConsent.title": "Switch to {{mode}} mode?",
|
|
191
|
+
"writeConsent.unconfirmed": "It does not stop to ask before each change — it makes changes as soon as it decides to. Only continue if you want the assistant to change your data without asking first."
|
|
187
192
|
}, u = (e) => Object.fromEntries(e.map((e) => [e.key, e.fallback])), d = Object.freeze({
|
|
188
193
|
...u(Object.values(i)),
|
|
189
194
|
...u(a),
|
|
@@ -69,6 +69,7 @@ export * from './modeCopy';
|
|
|
69
69
|
export * from './modeIds';
|
|
70
70
|
export * from './modeCapabilities';
|
|
71
71
|
export * from './adminModeSendGate';
|
|
72
|
+
export * from './writeModeConsent';
|
|
72
73
|
export * from './voice/speechLabels';
|
|
73
74
|
export * from './voice/replyLanguage';
|
|
74
75
|
export * from './voice/speechPlayback';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAGxB,cAAc,wBAAwB,CAAC;AAKvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAG9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+B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B,cAAc,2BAA2B,CAAC;AAE1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
|
@@ -113,6 +113,31 @@ export declare function adminOnlyModeSendRefusal(config: {
|
|
|
113
113
|
readonly loading: boolean;
|
|
114
114
|
readonly canUseAdminModes: boolean;
|
|
115
115
|
}): string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Why a send in a mode the product does not offer must not go out, or null
|
|
118
|
+
* when it may (BOFF-7308).
|
|
119
|
+
*
|
|
120
|
+
* ★★ The gap `adminOnlyModeSendRefusal` cannot see. That check reads the mode's
|
|
121
|
+
* config — and a BUILT-IN id the product never listed has none, so there is no
|
|
122
|
+
* `requiresAdmin` to read and nothing is held. A built-in id is also always
|
|
123
|
+
* provisionable (`resolveAssistantModeCapabilities`), so a persisted `api-calls`
|
|
124
|
+
* or `vibe-plugins` in a product whose list lacks it was provisioned on the
|
|
125
|
+
* first send. The reset effect does move it to Ask, but only after the role
|
|
126
|
+
* check answers, which is later than a help button that sends on the next tick.
|
|
127
|
+
*
|
|
128
|
+
* Refused rather than held: waiting on the role check cannot help, because no
|
|
129
|
+
* answer from it makes an unlisted mode listed. The copy matches the refusal for
|
|
130
|
+
* an undeclared product id, so the person sees one message for one situation.
|
|
131
|
+
*
|
|
132
|
+
* ★ `assistant` (Ask) is exempt even when unlisted. It is the mode every person
|
|
133
|
+
* starts in and where the reset effect lands for everyone, including in a panel
|
|
134
|
+
* mounted with no product modes at all; refusing it would leave such a panel
|
|
135
|
+
* with no mode that can send.
|
|
136
|
+
*/
|
|
137
|
+
export declare const UNAVAILABLE_MODE_REFUSAL = "This assistant mode is not available here. Switch to another mode and send again.";
|
|
138
|
+
export declare function unofferedModeSendRefusal(mode: AssistantMode, config: {
|
|
139
|
+
readonly id: AssistantMode;
|
|
140
|
+
} | null | undefined): string | null;
|
|
116
141
|
/**
|
|
117
142
|
* The product's config for EXACTLY this mode, or undefined.
|
|
118
143
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modeCapabilities.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/modeCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC;;;;;;;;;OASG;IACH,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED,2EAA2E;AAC3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,mBAAmB,EACjB,IAAI,GACJ,mBAAmB,GACnB,gBAAgB,GAChB,uBAAuB,GACvB,sBAAsB,CACzB,CAAC;AAKF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,UAAY,CAAC;AAUxD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAC/C,MAAM,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAkBvD,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,4BAA4B,EAAE,yBAOvC,CAAC;AAeL;;;;;;;;;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,aAAa,CAAA;CAAE,EACrE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EACtC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACrC,CAAC,GAAG,SAAS,CAGf"}
|
|
@@ -43,8 +43,12 @@ function u(n, r) {
|
|
|
43
43
|
function d(e, t) {
|
|
44
44
|
return e?.requiresAdmin ? t.loading ? "Still checking whether you can use this assistant mode. Wait a moment, then send again." : t.canUseAdminModes ? null : "This assistant mode is only available to organization admins. Switch to another mode and send again." : null;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
var f = "This assistant mode is not available here. Switch to another mode and send again.";
|
|
47
|
+
function p(e, t) {
|
|
48
|
+
return t?.id === e || e === "assistant" ? null : f;
|
|
49
|
+
}
|
|
50
|
+
function m(e, t) {
|
|
47
51
|
if (t) return e?.find((e) => e.id === t);
|
|
48
52
|
}
|
|
49
53
|
//#endregion
|
|
50
|
-
export { o as BUILT_IN_MODE_CAPABILITIES, i as MAX_ASSISTANT_STREAM_BUDGET_MS, s as UNDECLARED_MODE_CAPABILITIES, d as adminOnlyModeSendRefusal,
|
|
54
|
+
export { o as BUILT_IN_MODE_CAPABILITIES, i as MAX_ASSISTANT_STREAM_BUDGET_MS, f as UNAVAILABLE_MODE_REFUSAL, s as UNDECLARED_MODE_CAPABILITIES, d as adminOnlyModeSendRefusal, m as findAssistantModeConfig, u as resolveAssistantModeCapabilities, p as unofferedModeSendRefusal };
|
|
@@ -16,10 +16,16 @@ interface AssistantState {
|
|
|
16
16
|
*/
|
|
17
17
|
pendingPrompt: string | null;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* The write-capable modes whose consent dialog this profile has accepted, by
|
|
20
|
+
* mode id (BOFF-7308). Persisted per-profile so the dialog shows once per
|
|
21
|
+
* MODE, not on every switch.
|
|
22
|
+
*
|
|
23
|
+
* ★★ Per mode. It replaced one `apiCallsAcknowledged` flag that covered every
|
|
24
|
+
* write-capable mode, so accepting the dialog for one skipped it for all the
|
|
25
|
+
* others. A stored flag is carried over to `api-calls` only — see
|
|
26
|
+
* `restoreAcknowledgedWriteModes`.
|
|
21
27
|
*/
|
|
22
|
-
|
|
28
|
+
acknowledgedWriteModes: readonly AssistantMode[];
|
|
23
29
|
/**
|
|
24
30
|
* Read every assistant reply aloud as it settles (BOFF-6290).
|
|
25
31
|
*
|
|
@@ -95,8 +101,8 @@ interface AssistantState {
|
|
|
95
101
|
submitPrompt: (text: string) => void;
|
|
96
102
|
/** Returns and clears any queued prompt. */
|
|
97
103
|
consumePendingPrompt: () => string | null;
|
|
98
|
-
/**
|
|
99
|
-
|
|
104
|
+
/** Record that the write consent for `mode` was accepted (persisted). */
|
|
105
|
+
acknowledgeWriteMode: (mode: AssistantMode) => void;
|
|
100
106
|
/** Turn automatic read-aloud of new replies on or off (persisted). */
|
|
101
107
|
setAutoSpeak: (enabled: boolean) => void;
|
|
102
108
|
/** Choose the language spoken to the assistant; `null` follows the app locale (persisted). */
|
|
@@ -124,6 +130,21 @@ export declare function resolveActiveModeSandbox(state: {
|
|
|
124
130
|
mode: AssistantMode;
|
|
125
131
|
sandboxesByMode: Partial<Record<AssistantMode, AssistantSandboxRuntime>>;
|
|
126
132
|
}): AssistantModeSandboxTarget | null;
|
|
133
|
+
/**
|
|
134
|
+
* Fold what storage holds into the live state — zustand's own default (a shallow
|
|
135
|
+
* spread, persisted over current), plus the write-consent migration.
|
|
136
|
+
*
|
|
137
|
+
* ★★ A `merge`, not a `version` + `migrate`. Bumping the persist version would
|
|
138
|
+
* make every OLDER build — a product rolled back to an earlier fe-libs pin —
|
|
139
|
+
* find a version it has no `migrate` for, and zustand then hydrates NOTHING: the
|
|
140
|
+
* person's saved conversations would be dropped on the next write. This reads
|
|
141
|
+
* old and new shapes alike and leaves the version where it is.
|
|
142
|
+
*
|
|
143
|
+
* ★ The legacy flag is removed from the live state, not merely ignored, so it
|
|
144
|
+
* can never be written back (`partialize` would not write it anyway) nor read
|
|
145
|
+
* by mistake as a second source of truth.
|
|
146
|
+
*/
|
|
147
|
+
export declare function mergePersistedAssistantState<S extends object>(persisted: unknown, current: S): S;
|
|
127
148
|
export declare const useAssistantStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<AssistantState>, "setState" | "persist"> & {
|
|
128
149
|
setState(partial: AssistantState | Partial<AssistantState> | ((state: AssistantState) => AssistantState | Partial<AssistantState>), replace?: false | undefined): unknown;
|
|
129
150
|
setState(state: AssistantState | ((state: AssistantState) => AssistantState), replace: true): unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACR,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,+BAA+B,EAC/B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACR,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,UAAU,cAAc;IACtB,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;IAC5E,oBAAoB,EAAE,OAAO,CAAC;IAC9B,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E;IACtE,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,8FAA8F;IAC9F,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,iBAAiB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7E;AAMD,6EAA6E;AAC7E,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,IAAI,EAAE,aAAa,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC,CAAC;CAC1E,GAAG,0BAA0B,GAAG,IAAI,CAGpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAC3D,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,CAAC,GACT,CAAC,CAcH;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAoV7B,CAAC"}
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { createProfileScopedStorage as e } from "../utils/profileScopedStorage.js";
|
|
2
2
|
import "../../shared-utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { LEGACY_WRITE_CONSENT_KEY as t, restoreAcknowledgedWriteModes as n, withWriteModeAcknowledged as r } from "./writeModeConsent.js";
|
|
4
|
+
import { create as i } from "zustand";
|
|
5
|
+
import { persist as a } from "zustand/middleware";
|
|
5
6
|
//#region src/shared/assistant/store.ts
|
|
6
|
-
function
|
|
7
|
+
function o() {
|
|
7
8
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function s(e) {
|
|
10
11
|
let t = e.sandboxesByMode[e.mode]?.sandboxId;
|
|
11
12
|
return t ? {
|
|
12
13
|
sandboxId: t,
|
|
13
14
|
mode: e.mode
|
|
14
15
|
} : null;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
function c(e, r) {
|
|
18
|
+
let i = typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)) : {};
|
|
19
|
+
return {
|
|
20
|
+
...r,
|
|
21
|
+
...i,
|
|
22
|
+
acknowledgedWriteModes: n(e)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var l = i()(a((e, t) => ({
|
|
17
26
|
conversations: [],
|
|
18
27
|
activeConversationId: null,
|
|
19
28
|
mode: "assistant",
|
|
@@ -21,26 +30,26 @@ var a = t()(n((e, t) => ({
|
|
|
21
30
|
conversationListOpen: !1,
|
|
22
31
|
sandboxesByMode: {},
|
|
23
32
|
pendingPrompt: null,
|
|
24
|
-
|
|
33
|
+
acknowledgedWriteModes: [],
|
|
25
34
|
autoSpeakEnabled: !1,
|
|
26
35
|
assistantLanguage: null,
|
|
27
36
|
replyLanguage: null,
|
|
28
37
|
preferredVoices: {},
|
|
29
|
-
createConversation: (n,
|
|
30
|
-
let
|
|
31
|
-
id:
|
|
38
|
+
createConversation: (n, r) => {
|
|
39
|
+
let i = o(), a = (/* @__PURE__ */ new Date()).toISOString(), s = r ?? t().mode, c = {
|
|
40
|
+
id: i,
|
|
32
41
|
title: n || "New conversation",
|
|
33
42
|
mode: s,
|
|
34
43
|
messages: [],
|
|
35
44
|
backendSessionId: null,
|
|
36
|
-
createdAt:
|
|
37
|
-
updatedAt:
|
|
45
|
+
createdAt: a,
|
|
46
|
+
updatedAt: a
|
|
38
47
|
};
|
|
39
48
|
return e((e) => ({
|
|
40
49
|
conversations: [c, ...e.conversations],
|
|
41
|
-
activeConversationId:
|
|
50
|
+
activeConversationId: i,
|
|
42
51
|
conversationListOpen: !1
|
|
43
|
-
})),
|
|
52
|
+
})), i;
|
|
44
53
|
},
|
|
45
54
|
deleteConversation: (t) => e((e) => {
|
|
46
55
|
let n = e.conversations.filter((e) => e.id !== t), r = { ...e.processingByConversationId };
|
|
@@ -174,7 +183,7 @@ var a = t()(n((e, t) => ({
|
|
|
174
183
|
conversationListOpen: !1,
|
|
175
184
|
sandboxesByMode: {},
|
|
176
185
|
pendingPrompt: null,
|
|
177
|
-
|
|
186
|
+
acknowledgedWriteModes: [],
|
|
178
187
|
autoSpeakEnabled: !1,
|
|
179
188
|
assistantLanguage: null,
|
|
180
189
|
replyLanguage: null,
|
|
@@ -185,7 +194,7 @@ var a = t()(n((e, t) => ({
|
|
|
185
194
|
let n = t().pendingPrompt;
|
|
186
195
|
return n !== null && e({ pendingPrompt: null }), n;
|
|
187
196
|
},
|
|
188
|
-
|
|
197
|
+
acknowledgeWriteMode: (t) => e((e) => ({ acknowledgedWriteModes: r(e.acknowledgedWriteModes, t) })),
|
|
189
198
|
setAutoSpeak: (t) => e({ autoSpeakEnabled: t }),
|
|
190
199
|
setAssistantLanguage: (t) => e({ assistantLanguage: t }),
|
|
191
200
|
setReplyLanguage: (t) => e({ replyLanguage: t }),
|
|
@@ -201,12 +210,13 @@ var a = t()(n((e, t) => ({
|
|
|
201
210
|
activeConversationId: e.activeConversationId,
|
|
202
211
|
mode: e.mode,
|
|
203
212
|
conversationListOpen: e.conversationListOpen,
|
|
204
|
-
|
|
213
|
+
acknowledgedWriteModes: e.acknowledgedWriteModes,
|
|
205
214
|
autoSpeakEnabled: e.autoSpeakEnabled,
|
|
206
215
|
assistantLanguage: e.assistantLanguage,
|
|
207
216
|
replyLanguage: e.replyLanguage,
|
|
208
217
|
preferredVoices: e.preferredVoices
|
|
209
|
-
})
|
|
218
|
+
}),
|
|
219
|
+
merge: c
|
|
210
220
|
}));
|
|
211
221
|
//#endregion
|
|
212
|
-
export {
|
|
222
|
+
export { c as mergePersistedAssistantState, s as resolveActiveModeSandbox, l as useAssistantStore };
|
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
|
|
2
|
+
import { WriteConsentMode } from '../writeModeConsent';
|
|
3
|
+
export interface AssistantApiCallsConsentDialogProps {
|
|
3
4
|
open: boolean;
|
|
4
5
|
onConfirm: () => void;
|
|
5
6
|
onCancel: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* The write-capable mode being switched INTO — the product's config for it,
|
|
9
|
+
* or at least its id. The dialog names it the way its pill does.
|
|
10
|
+
*
|
|
11
|
+
* Absent: Take action (`api-calls`), which is the only mode this dialog
|
|
12
|
+
* described before it took one, so an older caller renders exactly as it did.
|
|
13
|
+
*/
|
|
14
|
+
mode?: WriteConsentMode;
|
|
15
|
+
/** The mode being left, which names the cancel button. Absent: Ask. */
|
|
16
|
+
currentMode?: WriteConsentMode | null;
|
|
6
17
|
}
|
|
7
18
|
/**
|
|
8
|
-
* One-time consent shown the first time a user switches the assistant into
|
|
9
|
-
* write-capable
|
|
19
|
+
* One-time consent shown the first time a user switches the assistant into a
|
|
20
|
+
* write-capable mode — once PER MODE (BOFF-7308).
|
|
10
21
|
*
|
|
11
22
|
* This is the DEPENDABLE guardrail: the in-sandbox agent executes mutations
|
|
12
|
-
* autonomously, so a host-side acknowledgement (plus the
|
|
13
|
-
* describe-and-confirm
|
|
14
|
-
*
|
|
15
|
-
*
|
|
23
|
+
* autonomously, so a host-side acknowledgement (plus, in Take action, the
|
|
24
|
+
* describe-and-confirm gate) is the FE's strongest lever. The acknowledgement is
|
|
25
|
+
* persisted per profile and per mode in the assistant store
|
|
26
|
+
* (`acknowledgedWriteModes`), so accepting it for one mode never skips another's.
|
|
27
|
+
*
|
|
28
|
+
* ★★ It says what THIS mode does. Whether the assistant stops for approval
|
|
29
|
+
* before each change is read from the sandbox's own configuration
|
|
30
|
+
* (`modeRequiresConfirmWrites`), not taken as a prop, so no caller can promise a
|
|
31
|
+
* confirmation step the sandbox does not enforce. Only `api-calls` has one.
|
|
16
32
|
*
|
|
17
33
|
* ★ The English fallbacks name NO product. They used to say "your HealthyBowl
|
|
18
34
|
* data", which was correct in exactly one product and a lie in every other —
|
|
19
35
|
* and a fallback is what renders wherever the key has not been seeded, which
|
|
20
36
|
* today is most locales. A product wanting its own name here supplies it through
|
|
21
|
-
* `<product>.assistant.apiCalls.*`, which
|
|
37
|
+
* `<product>.assistant.apiCalls.*` / `<product>.assistant.writeConsent.*`, which
|
|
38
|
+
* is the mechanism that already exists. Which keys render for which mode is
|
|
39
|
+
* decided in `writeModeConsentCopy`.
|
|
22
40
|
*/
|
|
23
|
-
export declare const AssistantApiCallsConsentDialog: FC<
|
|
24
|
-
export {};
|
|
41
|
+
export declare const AssistantApiCallsConsentDialog: FC<AssistantApiCallsConsentDialogProps>;
|
|
25
42
|
//# sourceMappingURL=AssistantApiCallsConsentDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantApiCallsConsentDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantApiCallsConsentDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,
|
|
1
|
+
{"version":3,"file":"AssistantApiCallsConsentDialog.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantApiCallsConsentDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,EAAwB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAElF,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,uEAAuE;IACvE,WAAW,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACvC;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC,mCAAmC,CA6ClF,CAAC"}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { Button as e } from "../../../ui/button.js";
|
|
2
2
|
import { ModalShell as t } from "../../../ui/modal-shell.js";
|
|
3
3
|
import { useAssistantTr as n } from "../i18n.js";
|
|
4
|
-
import {
|
|
4
|
+
import { modeRequiresConfirmWrites as r } from "../api.js";
|
|
5
|
+
import { writeModeConsentCopy as i } from "../writeModeConsent.js";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
7
|
//#region src/shared/assistant/ui/AssistantApiCallsConsentDialog.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var c = { id: "api-calls" }, l = ({ open: l, onConfirm: u, onCancel: d, mode: f = c, currentMode: p }) => {
|
|
9
|
+
let m = i(n(), {
|
|
10
|
+
target: f,
|
|
11
|
+
current: p,
|
|
12
|
+
confirmsWrites: r(f.id)
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ o(t, {
|
|
15
|
+
open: l,
|
|
16
|
+
onClose: d,
|
|
11
17
|
size: "sm",
|
|
12
|
-
title:
|
|
13
|
-
footer: /* @__PURE__ */ a
|
|
18
|
+
title: m.title,
|
|
19
|
+
footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
|
|
14
20
|
variant: "outline",
|
|
15
|
-
onClick:
|
|
21
|
+
onClick: d,
|
|
16
22
|
"data-testid": "assistant-api-calls-consent-cancel",
|
|
17
|
-
children:
|
|
18
|
-
}), /* @__PURE__ */
|
|
23
|
+
children: m.cancel
|
|
24
|
+
}), /* @__PURE__ */ o(e, {
|
|
19
25
|
variant: "default",
|
|
20
|
-
onClick:
|
|
26
|
+
onClick: u,
|
|
21
27
|
"data-testid": "assistant-api-calls-consent-confirm",
|
|
22
|
-
children:
|
|
28
|
+
children: m.confirm
|
|
23
29
|
})] }),
|
|
24
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ s("div", {
|
|
25
31
|
className: "space-y-2 text-sm text-text-secondary",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ o("p", { children: m.body }), /* @__PURE__ */ o("p", { children: m.safeguard })]
|
|
27
33
|
})
|
|
28
34
|
});
|
|
29
35
|
};
|
|
30
36
|
//#endregion
|
|
31
|
-
export {
|
|
37
|
+
export { l as AssistantApiCallsConsentDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAyEf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAyDvE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA8sExD,CAAC"}
|