@burdenoff/fe-libs 2026.919.1 → 2026.920.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/api.d.ts +17 -0
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +88 -66
- package/dist/shared/assistant/attachmentTurn.d.ts +21 -0
- package/dist/shared/assistant/attachmentTurn.d.ts.map +1 -0
- package/dist/shared/assistant/attachmentTurn.js +48 -0
- package/dist/shared/assistant/attachments.d.ts +85 -6
- package/dist/shared/assistant/attachments.d.ts.map +1 -1
- package/dist/shared/assistant/attachments.js +165 -112
- package/dist/shared/assistant/conversation.d.ts +21 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/documentExtract.d.ts +11 -2
- package/dist/shared/assistant/documentExtract.d.ts.map +1 -1
- package/dist/shared/assistant/documentExtract.js +39 -37
- package/dist/shared/assistant/gatewayLimits.d.ts +10 -0
- package/dist/shared/assistant/gatewayLimits.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayLimits.js +2 -2
- 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 +2 -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 +305 -272
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +12 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +57 -57
- package/dist/shared/assistant/useAssistantAttachments.d.ts +12 -1
- package/dist/shared/assistant/useAssistantAttachments.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantAttachments.js +98 -98
- 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 +116 -114
- package/package.json +1 -1
|
@@ -234,5 +234,26 @@ export interface AssistantModeConfig {
|
|
|
234
234
|
* Default: `false` for every mode, built-in or product-declared.
|
|
235
235
|
*/
|
|
236
236
|
accumulatesNarration?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* How many characters of ONE attached file's text this mode sends inline
|
|
239
|
+
* (BOFF-7334). For a mode that builds from what it is handed — BigConsole's
|
|
240
|
+
* Build designs a data sink from a CSV.
|
|
241
|
+
*
|
|
242
|
+
* Default: `MAX_INLINE_CHARS_PER_FILE` (8,000). A positive number; anything
|
|
243
|
+
* else is ignored, and anything above `MAX_CONFIGURABLE_INLINE_CHARS`
|
|
244
|
+
* (200,000) is held at it. Set alone, the turn total rises to match it.
|
|
245
|
+
* Resolved by `resolveAssistantInlineLimits`.
|
|
246
|
+
*
|
|
247
|
+
* ★ A ceiling, not a promise: however large, a turn still has to fit the
|
|
248
|
+
* gateway's 256 KB body, and text that would not fit is cut — documents first,
|
|
249
|
+
* then text files — with the cut said in the prompt.
|
|
250
|
+
*/
|
|
251
|
+
maxInlineCharsPerFile?: number;
|
|
252
|
+
/**
|
|
253
|
+
* How many characters of attached text, across every file in one turn, this
|
|
254
|
+
* mode sends inline. Default: `MAX_INLINE_CHARS_TOTAL` (20,000), or the
|
|
255
|
+
* per-file limit if that is larger; bounded like `maxInlineCharsPerFile`.
|
|
256
|
+
*/
|
|
257
|
+
maxInlineCharsTotal?: number;
|
|
237
258
|
}
|
|
238
259
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAC3C;;;;;;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A+B;IAC9C,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;OAeG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,C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,CAAC;IAC/B;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -2,7 +2,10 @@ import { DocumentExtraction } from './documentText';
|
|
|
2
2
|
import { DocumentFormat } from './attachments';
|
|
3
3
|
export interface ExtractedDocument {
|
|
4
4
|
extraction: DocumentExtraction;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Already trimmed to the per-file limit passed in (`MAX_INLINE_CHARS_PER_FILE`
|
|
7
|
+
* by default). Absent unless status is 'ok'.
|
|
8
|
+
*/
|
|
6
9
|
textContent?: string;
|
|
7
10
|
/** True when `textContent` is a prefix of what the document actually holds. */
|
|
8
11
|
textTruncated?: boolean;
|
|
@@ -18,5 +21,11 @@ export interface ExtractedDocument {
|
|
|
18
21
|
* generic 'unreadable' rejection, and the user would lose the file over
|
|
19
22
|
* something that is only a partial loss.
|
|
20
23
|
*/
|
|
21
|
-
export declare function extractDocumentText(file: File, format: DocumentFormat
|
|
24
|
+
export declare function extractDocumentText(file: File, format: DocumentFormat,
|
|
25
|
+
/**
|
|
26
|
+
* How much of the text to keep (BOFF-7334). Defaults to the shared per-file
|
|
27
|
+
* limit; the composer passes the largest limit among the modes on offer —
|
|
28
|
+
* see `largestInlineCharsPerFile`.
|
|
29
|
+
*/
|
|
30
|
+
perFileChars?: number): Promise<ExtractedDocument>;
|
|
22
31
|
//# sourceMappingURL=documentExtract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentExtract.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/documentExtract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAUL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/E,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,kBAAkB,CAAC;IAC/B
|
|
1
|
+
{"version":3,"file":"documentExtract.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/documentExtract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAUL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/E,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAgQD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,cAAc;AACtB;;;;GAIG;AACH,YAAY,GAAE,MAAkC,GAC/C,OAAO,CAAC,iBAAiB,CAAC,CAM5B"}
|
|
@@ -21,107 +21,109 @@ async function f() {
|
|
|
21
21
|
let [e, t] = await Promise.all([import("../../node_modules/pdfjs-dist/build/pdf.js"), import("../../node_modules/pdfjs-dist/build/pdf.worker.min.js")]);
|
|
22
22
|
return globalThis.pdfjsWorker = t, e;
|
|
23
23
|
}
|
|
24
|
-
async function p(e) {
|
|
25
|
-
let
|
|
24
|
+
async function p(e, t) {
|
|
25
|
+
let r = (await f()).getDocument({
|
|
26
26
|
data: e,
|
|
27
27
|
disableFontFace: !0,
|
|
28
28
|
useSystemFonts: !1
|
|
29
|
-
}),
|
|
29
|
+
}), i;
|
|
30
30
|
try {
|
|
31
|
-
|
|
31
|
+
i = await r.promise;
|
|
32
32
|
} catch (e) {
|
|
33
|
-
return await
|
|
33
|
+
return await r.destroy().catch(() => void 0), (e instanceof Error ? e.name : "") === "PasswordException" ? { extraction: { status: "encrypted" } } : { extraction: {
|
|
34
34
|
status: "corrupt",
|
|
35
35
|
detail: d(e)
|
|
36
36
|
} };
|
|
37
37
|
}
|
|
38
|
-
let
|
|
38
|
+
let a = i.numPages, s = Math.min(a, 100), c = [];
|
|
39
39
|
try {
|
|
40
40
|
let e = 0;
|
|
41
|
-
for (let t = 1; t <=
|
|
42
|
-
let n = await
|
|
43
|
-
if (n.cleanup(),
|
|
41
|
+
for (let t = 1; t <= s; t += 1) {
|
|
42
|
+
let n = await i.getPage(t), r = o((await n.getTextContent()).items);
|
|
43
|
+
if (n.cleanup(), c.push(r), e += r.length, e >= 2e5) break;
|
|
44
44
|
}
|
|
45
45
|
} catch (e) {
|
|
46
|
-
if (
|
|
46
|
+
if (c.length === 0) return { extraction: {
|
|
47
47
|
status: "corrupt",
|
|
48
48
|
detail: d(e)
|
|
49
49
|
} };
|
|
50
50
|
} finally {
|
|
51
|
-
await
|
|
51
|
+
await r.destroy().catch(() => void 0);
|
|
52
52
|
}
|
|
53
|
-
return n(
|
|
53
|
+
return n(c, a, c.length, t);
|
|
54
54
|
}
|
|
55
55
|
async function m(e, t) {
|
|
56
56
|
let { unzipSync: n, strFromU8: r } = await import("../../node_modules/fflate/esm/browser.js"), i = n(e, { filter: (e) => t(e.name) }), a = {};
|
|
57
57
|
for (let [e, t] of Object.entries(i)) a[e] = r(t);
|
|
58
58
|
return a;
|
|
59
59
|
}
|
|
60
|
-
async function h(n) {
|
|
60
|
+
async function h(n, r) {
|
|
61
61
|
if (u(n)) return { extraction: {
|
|
62
62
|
status: "corrupt",
|
|
63
63
|
detail: "not an Office Open XML file — an OLE container, i.e. password-protected or a legacy .doc"
|
|
64
64
|
} };
|
|
65
|
-
let
|
|
65
|
+
let i;
|
|
66
66
|
try {
|
|
67
|
-
|
|
67
|
+
i = await m(n, (e) => e === "word/document.xml");
|
|
68
68
|
} catch (e) {
|
|
69
69
|
return { extraction: {
|
|
70
70
|
status: "corrupt",
|
|
71
71
|
detail: d(e)
|
|
72
72
|
} };
|
|
73
73
|
}
|
|
74
|
-
let
|
|
75
|
-
|
|
74
|
+
let a = i["word/document.xml"];
|
|
75
|
+
if (!a) return { extraction: {
|
|
76
76
|
status: "corrupt",
|
|
77
77
|
detail: "no word/document.xml inside the file"
|
|
78
78
|
} };
|
|
79
|
+
let o = t(a);
|
|
80
|
+
return _(o.slice(0, e), r, o.length);
|
|
79
81
|
}
|
|
80
|
-
async function g(t) {
|
|
82
|
+
async function g(t, n) {
|
|
81
83
|
if (u(t)) return { extraction: {
|
|
82
84
|
status: "corrupt",
|
|
83
85
|
detail: "not an Office Open XML file — an OLE container, i.e. password-protected or a legacy .xls"
|
|
84
86
|
} };
|
|
85
|
-
let
|
|
87
|
+
let o;
|
|
86
88
|
try {
|
|
87
|
-
|
|
89
|
+
o = await m(t, (e) => e === "xl/workbook.xml" || e === "xl/_rels/workbook.xml.rels" || e === "xl/sharedStrings.xml" || e.startsWith("xl/worksheets/"));
|
|
88
90
|
} catch (e) {
|
|
89
91
|
return { extraction: {
|
|
90
92
|
status: "corrupt",
|
|
91
93
|
detail: d(e)
|
|
92
94
|
} };
|
|
93
95
|
}
|
|
94
|
-
let
|
|
95
|
-
if (!
|
|
96
|
+
let c = o["xl/workbook.xml"];
|
|
97
|
+
if (!c) return { extraction: {
|
|
96
98
|
status: "corrupt",
|
|
97
99
|
detail: "no xl/workbook.xml inside the file"
|
|
98
100
|
} };
|
|
99
|
-
let
|
|
101
|
+
let l = i(o["xl/sharedStrings.xml"] ?? ""), f = a(c, o["xl/_rels/workbook.xml.rels"] ?? "").map((e) => ({
|
|
100
102
|
name: e.name,
|
|
101
|
-
rows: e.path &&
|
|
102
|
-
})), f = _(
|
|
103
|
-
return
|
|
103
|
+
rows: e.path && o[e.path] ? s(o[e.path], l) : []
|
|
104
|
+
})), p = r(f), h = _(p.slice(0, e), n, p.length), g = f.filter((e) => e.rows.length > 0).map((e) => e.name);
|
|
105
|
+
return g.length > 0 && (h.extraction.sheetNames = g), h;
|
|
104
106
|
}
|
|
105
|
-
function _(e) {
|
|
107
|
+
function _(e, t, n) {
|
|
106
108
|
if (e.trim() === "") return { extraction: { status: "no-text" } };
|
|
107
|
-
let
|
|
109
|
+
let r = e.length > t || n > e.length, i = e.slice(0, t), a = i.lastIndexOf("\n");
|
|
108
110
|
return {
|
|
109
111
|
extraction: {
|
|
110
112
|
status: "ok",
|
|
111
|
-
sourceChars:
|
|
113
|
+
sourceChars: n
|
|
112
114
|
},
|
|
113
|
-
textContent:
|
|
114
|
-
textTruncated:
|
|
115
|
+
textContent: r && a > t * .5 ? i.slice(0, a) : i,
|
|
116
|
+
textTruncated: r
|
|
115
117
|
};
|
|
116
118
|
}
|
|
117
|
-
async function v(e, t) {
|
|
118
|
-
let
|
|
119
|
-
return
|
|
119
|
+
async function v(e, t, n = c) {
|
|
120
|
+
let r = await y(e, t, n);
|
|
121
|
+
return r.extraction.format = t, r;
|
|
120
122
|
}
|
|
121
|
-
async function y(e, t) {
|
|
123
|
+
async function y(e, t, n) {
|
|
122
124
|
try {
|
|
123
|
-
let
|
|
124
|
-
return t === "pdf" ? await p(n) : t === "docx" ? await h(n) : await g(n);
|
|
125
|
+
let r = new Uint8Array(await e.arrayBuffer());
|
|
126
|
+
return t === "pdf" ? await p(r, n) : t === "docx" ? await h(r, n) : await g(r, n);
|
|
125
127
|
} catch (e) {
|
|
126
128
|
return { extraction: {
|
|
127
129
|
status: "corrupt",
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
* Anything that POSTs base64 from the browser has to be sized against this.
|
|
15
15
|
*/
|
|
16
16
|
export declare const MAX_REQUEST_BODY_BYTES = 262144;
|
|
17
|
+
/**
|
|
18
|
+
* What the person is told when a turn cannot be made to fit.
|
|
19
|
+
*
|
|
20
|
+
* ★ Shared by the planner that sizes a turn and by the dispatch belt in
|
|
21
|
+
* `api.ts`, because they are the same refusal seen from two places and must not
|
|
22
|
+
* drift into two different sentences. It names the two things the person can
|
|
23
|
+
* actually do — the gateway's own 413 reaches `graphqlFetch` as "The request
|
|
24
|
+
* could not be processed. Please refresh and try again.", which names neither.
|
|
25
|
+
*/
|
|
26
|
+
export declare const REQUEST_TOO_LARGE_REFUSAL = "This message is too large to send. Shorten it or send fewer attachments.";
|
|
17
27
|
/**
|
|
18
28
|
* What is left for a base64 image once the rest of a GraphQL request is paid
|
|
19
29
|
* for: the query document, operation name, variables, and the workspace/org
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatewayLimits.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/gatewayLimits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,QAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"gatewayLimits.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/gatewayLimits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,SAAU,CAAC;AAE9C;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,6EACsC,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,QAAkC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/shared/assistant/gatewayLimits.ts
|
|
2
|
-
var e = 262144, t = e - 32768;
|
|
2
|
+
var e = 262144, t = "This message is too large to send. Shorten it or send fewer attachments.", n = e - 32768;
|
|
3
3
|
//#endregion
|
|
4
|
-
export {
|
|
4
|
+
export { n as MAX_INLINE_IMAGE_BASE64_BYTES, e as MAX_REQUEST_BODY_BYTES, t as REQUEST_TOO_LARGE_REFUSAL };
|
|
@@ -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,8 @@ export * from './modeCopy';
|
|
|
69
69
|
export * from './modeIds';
|
|
70
70
|
export * from './modeCapabilities';
|
|
71
71
|
export * from './adminModeSendGate';
|
|
72
|
+
export * from './attachmentTurn';
|
|
73
|
+
export * from './writeModeConsent';
|
|
72
74
|
export * from './voice/speechLabels';
|
|
73
75
|
export * from './voice/replyLanguage';
|
|
74
76
|
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,gCAA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B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AAErC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAElC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,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,M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gB,EAAE,OAAO,CAAA;CAAE,GACxE,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,sFACgD,CAAC;AAEtF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACxD,MAAM,GAAG,IAAI,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,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,uBAAu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}
|
|
@@ -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"}
|