@burdenoff/fe-libs 2026.924.3 → 2026.925.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.
Files changed (31) hide show
  1. package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
  2. package/dist/shared/assistant/adminModeSendGate.js +23 -20
  3. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  4. package/dist/shared/assistant/i18nManifest.js +21 -19
  5. package/dist/shared/assistant/index.d.ts +2 -0
  6. package/dist/shared/assistant/index.d.ts.map +1 -1
  7. package/dist/shared/assistant/modeCapabilities.d.ts +1 -1
  8. package/dist/shared/assistant/modeCapabilities.d.ts.map +1 -1
  9. package/dist/shared/assistant/modeCapabilities.js +29 -28
  10. package/dist/shared/assistant/permissionError.d.ts.map +1 -1
  11. package/dist/shared/assistant/permissionError.js +11 -10
  12. package/dist/shared/assistant/speech/hostedTtsProtocol.d.ts +7 -0
  13. package/dist/shared/assistant/speech/hostedTtsProtocol.d.ts.map +1 -1
  14. package/dist/shared/assistant/speech/hostedTtsProtocol.js +5 -2
  15. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.d.ts.map +1 -1
  16. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +2 -2
  17. package/dist/shared/assistant/speech/routingSpeechEngine.d.ts.map +1 -1
  18. package/dist/shared/assistant/speech/routingSpeechEngine.js +49 -31
  19. package/dist/shared/assistant/turnOutcome.d.ts +58 -0
  20. package/dist/shared/assistant/turnOutcome.d.ts.map +1 -0
  21. package/dist/shared/assistant/turnOutcome.js +79 -0
  22. package/dist/shared/assistant/turnOutcomeCopy.d.ts +62 -0
  23. package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -0
  24. package/dist/shared/assistant/turnOutcomeCopy.js +49 -0
  25. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  26. package/dist/shared/assistant/ui/AssistantChatArea.js +412 -423
  27. package/dist/shared/assistant/writeModeConsent.d.ts +15 -2
  28. package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
  29. package/dist/shared/assistant/writeModeConsent.js +24 -19
  30. package/dist/shared-assistant.js +116 -114
  31. package/package.json +1 -1
@@ -1 +1 @@
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;CACpC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,IAAI,IAAI,eAAe,CAAC;IACxB,iFAAiF;IACjF,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACnD;;;;;;;;;;;;;OAaG;IACH,OAAO,IAAI,IAAI,CAAC;IAChB,gFAAgF;IAChF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAOD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,eAAe,GACvB,mBAAmB,CAwDrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,EAC/D,IAAI,EAAE,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GAAE,MAAkC,GAC5C,OAAO,CAAC,iBAAiB,CAAC,CAoC5B"}
@@ -1,8 +1,9 @@
1
- import { adminOnlyModeSendRefusal as e, resolveAssistantModeCapabilities as t, unofferedModeSendRefusal as n } from "./modeCapabilities.js";
1
+ import { UNAVAILABLE_MODE_REFUSAL as e, adminOnlyModeSendRefusal as t, resolveAssistantModeCapabilities as n, unofferedModeSendRefusal as r } from "./modeCapabilities.js";
2
+ import { AssistantSendRefusal as i } from "./turnOutcome.js";
2
3
  //#region src/shared/assistant/adminModeSendGate.ts
3
- var r = 1e4;
4
- function i(e) {
5
- let t = e, n = [], i = (e) => {
4
+ var a = 1e4;
5
+ function o(e) {
6
+ let t = e, n = [], r = (e) => {
6
7
  let t = n;
7
8
  n = [];
8
9
  for (let n of t) n.timer !== null && clearTimeout(n.timer), n.settle(e);
@@ -10,9 +11,9 @@ function i(e) {
10
11
  return {
11
12
  read: () => t,
12
13
  update(e) {
13
- t = e, e.loading || i(e);
14
+ t = e, e.loading || r(e);
14
15
  },
15
- wait(e = r) {
16
+ wait(e = a) {
16
17
  return t.loading ? new Promise((r) => {
17
18
  let i = {
18
19
  settle: r,
@@ -24,29 +25,31 @@ function i(e) {
24
25
  }) : Promise.resolve(t);
25
26
  },
26
27
  abandon() {
27
- i(t);
28
+ r(t);
28
29
  },
29
30
  get pendingCount() {
30
31
  return n.length;
31
32
  }
32
33
  };
33
34
  }
34
- async function a(t, n, i = r) {
35
- return t?.requiresAdmin ? e(t, await n.wait(i)) : null;
35
+ async function s(e, n, r = a) {
36
+ return e?.requiresAdmin ? t(e, await n.wait(r)) : null;
36
37
  }
37
- async function o(e, t, i, a = r) {
38
- return n(e, t()) === null ? null : (await i.wait(a), n(e, t()));
38
+ async function c(e, t, n, i = a) {
39
+ return r(e, t()) === null ? null : (await n.wait(i), r(e, t()));
39
40
  }
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);
41
+ async function l(o, s, l, u = a) {
42
+ let d = Date.now() + u, f = await c(o, s, l, u);
43
+ if (f) throw new i("mode-unavailable", f);
44
+ s()?.requiresAdmin && await l.wait(Math.max(0, d - Date.now()));
45
+ let p = s(), m = n(o, p), h = r(o, p) ?? (m.provisionable ? null : e);
46
+ if (h) throw new i("mode-unavailable", h);
47
+ let g = l.read(), _ = t(p, g);
48
+ if (_) throw new i(g.loading ? "mode-access-pending" : "mode-admin-only", _);
46
49
  return {
47
- config: d,
48
- capabilities: f
50
+ config: p,
51
+ capabilities: m
49
52
  };
50
53
  }
51
54
  //#endregion
52
- export { r as ADMIN_MODE_ACCESS_WAIT_MS, a as adminOnlyModeSendRefusalAfterAccess, i as createAdminModeAccessGate, s as resolveAssistantSendModeAfterAccess, o as unofferedModeSendRefusalAfterAccess };
55
+ export { a as ADMIN_MODE_ACCESS_WAIT_MS, s as adminOnlyModeSendRefusalAfterAccess, o as createAdminModeAccessGate, l as resolveAssistantSendModeAfterAccess, c as unofferedModeSendRefusalAfterAccess };
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
3
  import { isAssistantModeId as n } from "./modeIds.js";
4
- import { INCOMPLETE_TURN_NOTICES as r } from "./streamBudget.js";
5
- import { STAGE_COPY as i, THINKING_PHRASES as a } from "./stageCopy.js";
6
- import { VOICE_MUTED_LABEL as o, VOICE_THINKING_LABEL as s } from "./voice/voiceStatus.js";
7
- import { ATTACHMENT_SOURCES as c } from "./attachmentSources.js";
4
+ import { TURN_OUTCOME_COPY as r } from "./turnOutcomeCopy.js";
5
+ import { INCOMPLETE_TURN_NOTICES as i } from "./streamBudget.js";
6
+ import { STAGE_COPY as a, THINKING_PHRASES as o } from "./stageCopy.js";
7
+ import { VOICE_MUTED_LABEL as s, VOICE_THINKING_LABEL as c } from "./voice/voiceStatus.js";
8
+ import { ATTACHMENT_SOURCES as l } from "./attachmentSources.js";
8
9
  //#region src/shared/assistant/i18nManifest.ts
9
- var l = {
10
+ var u = {
10
11
  "apiCalls.consentBody": "In Take action mode the assistant can read AND change your data — creating records, logging activity, updating details, and more, on your behalf.",
11
12
  "apiCalls.consentBody2": "It will describe what it is about to do and ask you to confirm before making a change. Only continue if you want the assistant to take actions for you.",
12
13
  "apiCalls.consentCancel": "Stay in Ask",
@@ -191,25 +192,26 @@ var l = {
191
192
  "writeConsent.confirm": "Enable {{mode}}",
192
193
  "writeConsent.title": "Switch to {{mode}} mode?",
193
194
  "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."
194
- }, u = (e) => Object.fromEntries(e.map((e) => [e.key, e.fallback])), d = Object.freeze({
195
- ...u(Object.values(i)),
196
- ...u(a),
197
- ...u([s, o]),
198
- ...u(r),
199
- ...Object.fromEntries(c.map((e) => [e.labelKey, e.labelFallback]))
200
- }), f = Object.freeze({
201
- ...l,
202
- ...d
195
+ }, d = (e) => Object.fromEntries(e.map((e) => [e.key, e.fallback])), f = Object.freeze({
196
+ ...d(Object.values(a)),
197
+ ...d(o),
198
+ ...d([c, s]),
199
+ ...d(i),
200
+ ...d(Object.values(r)),
201
+ ...Object.fromEntries(l.map((e) => [e.labelKey, e.labelFallback]))
202
+ }), p = Object.freeze({
203
+ ...u,
204
+ ...f
203
205
  });
204
- function p(e) {
206
+ function m(e) {
205
207
  let r = e.map((e) => e.id).filter((e) => !n(e));
206
208
  if (r.length > 0) throw Error(`assistantModeI18nCopy: malformed mode id ${r.map((e) => JSON.stringify(e)).join(", ")}. Declare product modes with declareAssistantMode().`);
207
209
  return Object.fromEntries(e.map((e) => [`mode.${e.id}`, e.label || t(e)]));
208
210
  }
209
- function m(t) {
211
+ function h(t) {
210
212
  let n = {
211
- ...f,
212
- ...p(t.modes)
213
+ ...p,
214
+ ...m(t.modes)
213
215
  }, r = Object.entries(t.overrides ?? {}), i = r.filter(([e]) => !Object.hasOwn(n, e)).map(([e]) => e);
214
216
  if (i.length > 0) throw Error(`assistantI18nSeedCopy: no shared assistant key ${i.join(", ")} to override. Check the spelling, or that the key is a mode this product offers; a key fe-libs no longer requests belongs with the product's own keys.`);
215
217
  let a = r.filter(([, e]) => e.trim() === "").map(([e]) => e);
@@ -221,4 +223,4 @@ function m(t) {
221
223
  return Object.fromEntries(Object.entries(o).map(([n, r]) => [e(t.namespace, n), r]));
222
224
  }
223
225
  //#endregion
224
- export { d as ASSISTANT_I18N_COMPUTED_COPY, l as ASSISTANT_I18N_LITERAL_COPY, f as ASSISTANT_I18N_MANIFEST, m as assistantI18nSeedCopy, p as assistantModeI18nCopy };
226
+ export { f as ASSISTANT_I18N_COMPUTED_COPY, u as ASSISTANT_I18N_LITERAL_COPY, p as ASSISTANT_I18N_MANIFEST, h as assistantI18nSeedCopy, m as assistantModeI18nCopy };
@@ -152,6 +152,8 @@ export * from './transportErrors';
152
152
  export * from './quota';
153
153
  export * from './permissionError';
154
154
  export * from './autoRouting';
155
+ export * from './turnOutcome';
156
+ export * from './turnOutcomeCopy';
155
157
  export * from './aiCredits';
156
158
  export * from './useWorkspaceWriteAccess';
157
159
  export * from './documentExtract';
@@ -1 +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BAAyB,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"}
@@ -134,7 +134,7 @@ export declare function adminOnlyModeSendRefusal(config: {
134
134
  * mounted with no product modes at all; refusing it would leave such a panel
135
135
  * with no mode that can send.
136
136
  */
137
- export declare const UNAVAILABLE_MODE_REFUSAL = "This assistant mode is not available here. Switch to another mode and send again.";
137
+ export declare const UNAVAILABLE_MODE_REFUSAL: string;
138
138
  export declare function unofferedModeSendRefusal(mode: AssistantMode, config: {
139
139
  readonly id: AssistantMode;
140
140
  } | null | undefined): string | null;
@@ -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;;;;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AAI,GAAG,SAAS,EAC/D,MAAM,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,GACxE,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,EAAE,MACK,CAAC;AAE7C,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"}
@@ -1,54 +1,55 @@
1
1
  import { isBuiltInAssistantMode as e } from "./modeCopy.js";
2
2
  import { isProductAssistantModeId as t } from "./modeIds.js";
3
+ import { TURN_OUTCOME_COPY as n } from "./turnOutcomeCopy.js";
3
4
  //#region src/shared/assistant/modeCapabilities.ts
4
- var n = 18e4, r = 6e5, i = 36e5, a = Object.freeze({
5
+ var r = 18e4, i = 6e5, a = 36e5, o = Object.freeze({
5
6
  producesArtifacts: !1,
6
- streamBudgetMs: n,
7
+ streamBudgetMs: r,
7
8
  continuesInBackground: !1,
8
9
  accumulatesNarration: !1,
9
10
  provisionable: !0
10
- }), o = Object.freeze({
11
- general: a,
12
- assistant: a,
13
- "api-calls": a,
11
+ }), s = Object.freeze({
12
+ general: o,
13
+ assistant: o,
14
+ "api-calls": o,
14
15
  "vibe-plugins": Object.freeze({
15
16
  producesArtifacts: !0,
16
- streamBudgetMs: r,
17
+ streamBudgetMs: i,
17
18
  continuesInBackground: !0,
18
19
  accumulatesNarration: !1,
19
20
  provisionable: !0
20
21
  })
21
- }), s = Object.freeze({
22
+ }), c = Object.freeze({
22
23
  producesArtifacts: !1,
23
- streamBudgetMs: n,
24
+ streamBudgetMs: r,
24
25
  continuesInBackground: !1,
25
26
  accumulatesNarration: !1,
26
27
  provisionable: !1
27
- }), c = (e) => typeof e == "boolean" ? e : void 0, l = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 && e <= 36e5 ? e : void 0;
28
- function u(n, r) {
29
- let i = r && r.id === n ? r : void 0, u;
30
- if (e(n)) u = o[n];
31
- else if (i && t(n)) u = a;
32
- else return s;
33
- if (!i) return u;
34
- let d = c(i.producesArtifacts);
28
+ }), l = (e) => typeof e == "boolean" ? e : void 0, u = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 && e <= 36e5 ? e : void 0;
29
+ function d(n, r) {
30
+ let i = r && r.id === n ? r : void 0, a;
31
+ if (e(n)) a = s[n];
32
+ else if (i && t(n)) a = o;
33
+ else return c;
34
+ if (!i) return a;
35
+ let d = l(i.producesArtifacts);
35
36
  return {
36
- producesArtifacts: d ?? u.producesArtifacts,
37
- streamBudgetMs: l(i.streamBudgetMs) ?? u.streamBudgetMs,
38
- continuesInBackground: c(i.continuesInBackground) ?? d ?? u.continuesInBackground,
39
- accumulatesNarration: c(i.accumulatesNarration) ?? u.accumulatesNarration,
37
+ producesArtifacts: d ?? a.producesArtifacts,
38
+ streamBudgetMs: u(i.streamBudgetMs) ?? a.streamBudgetMs,
39
+ continuesInBackground: l(i.continuesInBackground) ?? d ?? a.continuesInBackground,
40
+ accumulatesNarration: l(i.accumulatesNarration) ?? a.accumulatesNarration,
40
41
  provisionable: !0
41
42
  };
42
43
  }
43
- function d(e, t) {
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
- }
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;
44
+ function f(e, t) {
45
+ return e?.requiresAdmin ? t.loading ? n.modeAccessPending.fallback : t.canUseAdminModes ? null : n.modeAdminOnly.fallback : null;
49
46
  }
47
+ var p = n.modeUnavailable.fallback;
50
48
  function m(e, t) {
49
+ return t?.id === e || e === "assistant" ? null : p;
50
+ }
51
+ function h(e, t) {
51
52
  if (t) return e?.find((e) => e.id === t);
52
53
  }
53
54
  //#endregion
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 };
55
+ export { s as BUILT_IN_MODE_CAPABILITIES, a as MAX_ASSISTANT_STREAM_BUDGET_MS, p as UNAVAILABLE_MODE_REFUSAL, c as UNDECLARED_MODE_CAPABILITIES, f as adminOnlyModeSendRefusal, h as findAssistantModeConfig, d as resolveAssistantModeCapabilities, m as unofferedModeSendRefusal };
@@ -1 +1 @@
1
- {"version":3,"file":"permissionError.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/permissionError.ts"],"names":[],"mappings":"AAmCA,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AASD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,uBAAuB,GAAG,IAAI,CAwBhC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAIR"}
1
+ {"version":3,"file":"permissionError.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/permissionError.ts"],"names":[],"mappings":"AAoCA,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AASD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,uBAAuB,GAAG,IAAI,CAwBhC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAIR"}
@@ -1,25 +1,26 @@
1
1
  import { extensionObjectsIn as e } from "./quota.js";
2
+ import { TURN_OUTCOME_COPY as t } from "./turnOutcomeCopy.js";
2
3
  //#region src/shared/assistant/permissionError.ts
3
- var t = new Set([
4
+ var n = new Set([
4
5
  "UNAUTHENTICATED_ACTOR",
5
6
  "WORKSPACE_SESSION_UNRESOLVED",
6
7
  "WORKSPACE_CONTEXT_MISSING"
7
8
  ]);
8
- function n(n) {
9
+ function r(t) {
9
10
  let r = !1, i = null;
10
- for (let t of e(n)) {
11
- let e = t.code;
11
+ for (let n of e(t)) {
12
+ let e = n.code;
12
13
  (e === "FORBIDDEN" || e === "PERMISSION_DENIED") && (r = !0);
13
- let n = t.authFailure;
14
- typeof n == "string" && n.length > 0 && !i && (i = n);
14
+ let t = n.authFailure;
15
+ typeof t == "string" && t.length > 0 && !i && (i = t);
15
16
  }
16
17
  return !r && !i ? null : {
17
- refusal: i && t.has(i) ? "session" : "denied",
18
+ refusal: i && n.has(i) ? "session" : "denied",
18
19
  authFailure: i
19
20
  };
20
21
  }
21
- function r(e) {
22
- return e.refusal === "session" ? "Your session could not be verified for this workspace. Reopen the page, then send again." : "You do not have permission to do that in this workspace. Ask someone who administers it for access.";
22
+ function i(e) {
23
+ return e.refusal === "session" ? t.sessionUnverified.fallback : t.permissionDenied.fallback;
23
24
  }
24
25
  //#endregion
25
- export { n as describePermissionError, r as permissionRefusalMessage };
26
+ export { r as describePermissionError, i as permissionRefusalMessage };
@@ -130,6 +130,13 @@ export declare function base64ToBytes(base64: string): Uint8Array;
130
130
  * dead-button bug this feature already fixed once.
131
131
  */
132
132
  export declare function decodeAudioResponse(contentType: string | null, body: ArrayBuffer | HostedTtsJsonResponse): Uint8Array | null;
133
+ /**
134
+ * The pieces the hosted engine plays for `chunks`, in order — empty chunks
135
+ * dropped, long ones split to the vendor's limit. `onChunkStart(index)` from
136
+ * the hosted engine indexes THIS list, so anything that resumes a reply part
137
+ * way through must count in it too (`routingSpeechEngine`).
138
+ */
139
+ export declare function speakableChunks(chunks: readonly string[]): string[];
133
140
  /**
134
141
  * Split text the hosted vendor would reject for length.
135
142
  *
@@ -1 +1 @@
1
- {"version":3,"file":"hostedTtsProtocol.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/speech/hostedTtsProtocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,uCAAuC;AACvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,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AI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,YAAY,CAAC,EAAE,MAAM,GACpB,gBAAgB,CAUlB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAOrE;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAaxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,IAAI,EAAE,WAAW,GAAG,qBAAqB,GACxC,UAAU,GAAG,IAAI,CAWnB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAEnE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAuB,GAAG,MAAM,EAAE,CAenF"}
@@ -37,7 +37,10 @@ function d(e, t) {
37
37
  }
38
38
  return null;
39
39
  }
40
- function f(e, t = s) {
40
+ function f(e) {
41
+ return e.filter((e) => e.trim().length > 0).flatMap((e) => p(e));
42
+ }
43
+ function p(e, t = s) {
41
44
  if (e.length <= t) return [e];
42
45
  let n = [], r = e;
43
46
  for (; r.length > t;) {
@@ -47,4 +50,4 @@ function f(e, t = s) {
47
50
  return r && n.push(r), n.filter((e) => e.length > 0);
48
51
  }
49
52
  //#endregion
50
- export { a as HOSTED_DISABLE_MS, s as HOSTED_TTS_MAX_CHARS, r as SPEAKING_RATE_MAX, n as SPEAKING_RATE_MAX_STREAMING, t as SPEAKING_RATE_MAX_SYNC, e as SPEAKING_RATE_MIN, u as base64ToBytes, c as buildRequest, l as classifyHttpFailure, d as decodeAudioResponse, o as disableDurationMs, i as shouldDisableEngine, f as splitForVendor };
53
+ export { a as HOSTED_DISABLE_MS, s as HOSTED_TTS_MAX_CHARS, r as SPEAKING_RATE_MAX, n as SPEAKING_RATE_MAX_STREAMING, t as SPEAKING_RATE_MAX_SYNC, e as SPEAKING_RATE_MIN, u as base64ToBytes, c as buildRequest, l as classifyHttpFailure, d as decodeAudioResponse, o as disableDurationMs, i as shouldDisableEngine, f as speakableChunks, p as splitForVendor };
@@ -1 +1 @@
1
- {"version":3,"file":"hostedTtsSpeechEngine.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/speech/hostedTtsSpeechEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAeH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD;;;;;;OAMG;IACH,cAAc,IAAI,IAAI,CAAC;CACxB;AAwCD,gFAAgF;AAChF,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AA2BD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,GACxB,kBAAkB,CAmapB"}
1
+ {"version":3,"file":"hostedTtsSpeechEngine.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/speech/hostedTtsSpeechEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAeH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD;;;;;;OAMG;IACH,cAAc,IAAI,IAAI,CAAC;CACxB;AAwCD,gFAAgF;AAChF,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AA2BD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,GACxB,kBAAkB,CAkapB"}
@@ -1,5 +1,5 @@
1
1
  import { HOSTED_TTS_TIER as e, HOSTED_VOICES as t, hostedLocaleFor as n } from "./hostedVoiceCatalogue.js";
2
- import { buildRequest as r, classifyHttpFailure as i, decodeAudioResponse as a, disableDurationMs as o, shouldDisableEngine as s, splitForVendor as c } from "./hostedTtsProtocol.js";
2
+ import { buildRequest as r, classifyHttpFailure as i, decodeAudioResponse as a, disableDurationMs as o, shouldDisableEngine as s, speakableChunks as c } from "./hostedTtsProtocol.js";
3
3
  //#region src/shared/assistant/speech/hostedTtsSpeechEngine.ts
4
4
  function l(e) {
5
5
  let t = Object.entries(e).map(([e, t]) => `${e.toLowerCase()}:${t}`).sort().join("\n"), n = 5381;
@@ -134,7 +134,7 @@ function g(f) {
134
134
  };
135
135
  },
136
136
  speak(e, t, n = {}) {
137
- let r = e.filter((e) => e.trim().length > 0).flatMap((e) => c(e));
137
+ let r = c(e);
138
138
  if (r.length === 0) {
139
139
  n.onEnd?.();
140
140
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"routingSpeechEngine.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/speech/routingSpeechEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,KAAK,EAAE,YAAY,EAA4D,MAAM,SAAS,CAAC;AAEtG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,4EAA4E;IAC5E,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,yBAAyB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,YAAY,CAyJ1F"}
1
+ {"version":3,"file":"routingSpeechEngine.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/speech/routingSpeechEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,KAAK,EAAE,YAAY,EAA4D,MAAM,SAAS,CAAC;AAEtG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,4EAA4E;IAC5E,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,yBAAyB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,YAAY,CAoM1F"}
@@ -1,65 +1,83 @@
1
1
  import { hostedSupportsLanguage as e } from "./hostedVoiceCatalogue.js";
2
- import { selectVoiceForLocale as t } from "../voice/speechVoices.js";
2
+ import { speakableChunks as t } from "./hostedTtsProtocol.js";
3
+ import { selectVoiceForLocale as n } from "../voice/speechVoices.js";
3
4
  //#region src/shared/assistant/speech/routingSpeechEngine.ts
4
- function n({ device: n, hosted: r }) {
5
- if (!r) return n;
6
- let i = new Set(r.listVoices().map((e) => e.name)), a = (e) => e.source === "hosted" || i.has(e.name), o = (e, r, i) => {
7
- if (!r.voice || !a(r.voice)) {
8
- n.speak(e, r, i);
5
+ function r({ device: r, hosted: i }) {
6
+ if (!i) return r;
7
+ let a = new Set(i.listVoices().map((e) => e.name)), o = (e) => e.source === "hosted" || a.has(e.name), s = (e, t, i) => {
8
+ if (!t.voice || !o(t.voice)) {
9
+ r.speak(e, t, i);
9
10
  return;
10
11
  }
11
- if (r.fallback === !1) {
12
+ if (t.fallback === !1) {
12
13
  i?.onError?.("unsupported");
13
14
  return;
14
15
  }
15
- let o = t(n.listVoices(), r.lang);
16
- if (!o) {
16
+ let a = n(r.listVoices(), t.lang);
17
+ if (!a) {
17
18
  i?.onError?.("unsupported");
18
19
  return;
19
20
  }
20
- n.speak(e, {
21
- ...r,
22
- voice: o
21
+ r.speak(e, {
22
+ ...t,
23
+ voice: a
23
24
  }, i);
24
- }, s = (t) => r.isSupported() ? t.voice ? i.has(t.voice.name) ? r : n : e(t.lang) ? r : n : n;
25
+ }, c = (t) => i.isSupported() ? t.voice ? a.has(t.voice.name) ? i : r : e(t.lang) ? i : r : r;
25
26
  return {
26
- id: `routing(${r.id}+${n.id})`,
27
+ id: `routing(${i.id}+${r.id})`,
27
28
  isSupported() {
28
- return r.isSupported() || n.isSupported();
29
+ return i.isSupported() || r.isSupported();
29
30
  },
30
31
  listVoices() {
31
- return r.isSupported() ? [...r.listVoices(), ...n.listVoices()] : n.listVoices();
32
+ return i.isSupported() ? [...i.listVoices(), ...r.listVoices()] : r.listVoices();
32
33
  },
33
34
  subscribeVoices(e) {
34
- let t = n.subscribeVoices(e), i = r.subscribeVoices(e);
35
+ let t = r.subscribeVoices(e), n = i.subscribeVoices(e);
35
36
  return () => {
36
- t(), i();
37
+ t(), n();
37
38
  };
38
39
  },
39
- speak(e, t, i) {
40
- if (n.cancel(), r.cancel(), s(t) !== r) {
41
- o(e, t, i);
40
+ speak(e, n, a) {
41
+ if (r.cancel(), i.cancel(), c(n) !== i) {
42
+ s(e, n, a);
42
43
  return;
43
44
  }
44
- let a = !1;
45
- r.speak(e, t, {
46
- ...i,
45
+ let o = !1, l = -1;
46
+ i.speak(e, n, {
47
+ ...a,
47
48
  onStart: () => {
48
- a = !0, i?.onStart?.();
49
+ o = !0, a?.onStart?.();
49
50
  },
50
- onError: (n) => {
51
- if (n === "cancelled" || a || t.fallback === !1) {
52
- i?.onError?.(n);
51
+ onChunkStart: (e) => {
52
+ l = e, a?.onChunkStart?.(e);
53
+ },
54
+ onError: (r) => {
55
+ if (r === "cancelled" || n.fallback === !1) {
56
+ a?.onError?.(r);
57
+ return;
58
+ }
59
+ if (!o) {
60
+ s(e, n, a);
61
+ return;
62
+ }
63
+ let i = l >= 0 ? t(e).slice(l + 1) : [];
64
+ if (i.length === 0) {
65
+ a?.onError?.(r);
53
66
  return;
54
67
  }
55
- o(e, t, i);
68
+ let c = l + 1;
69
+ s(i, n, {
70
+ ...a,
71
+ onStart: void 0,
72
+ onChunkStart: (e) => a?.onChunkStart?.(c + e)
73
+ });
56
74
  }
57
75
  });
58
76
  },
59
77
  cancel() {
60
- n.cancel(), r.cancel();
78
+ r.cancel(), i.cancel();
61
79
  }
62
80
  };
63
81
  }
64
82
  //#endregion
65
- export { n as createRoutingSpeechEngine };
83
+ export { r as createRoutingSpeechEngine };
@@ -0,0 +1,58 @@
1
+ import { AssistantTr } from './i18n';
2
+ import { TurnOutcomeCopyId } from './turnOutcomeCopy';
3
+ /** Why a send was refused before it reached the backend. */
4
+ export type SendRefusalReason = "confirm-write-mode" | "voice-in-write-mode" | "mode-unavailable" | "mode-admin-only" | "mode-access-pending";
5
+ /**
6
+ * A send refused on the client, before it reached the backend: something must
7
+ * be confirmed, chosen or waited for first. Thrown instead of a bare `Error` so
8
+ * the outcome is decided by what it IS, never by matching its words.
9
+ */
10
+ export declare class AssistantSendRefusal extends Error {
11
+ readonly reason: SendRefusalReason;
12
+ constructor(reason: SendRefusalReason, message: string);
13
+ }
14
+ export type TurnOutcomeKind = "usage" | "permission" | "confirmation" | "temporary";
15
+ export interface TurnOutcome {
16
+ kind: TurnOutcomeKind;
17
+ /** The copy that says it. */
18
+ copy: TurnOutcomeCopyId;
19
+ /** Only for a usage wall that more allowance would fix: open the upgrade dialog. */
20
+ offersUpgrade: boolean;
21
+ /** Which quota was hit, when the server named one. */
22
+ quotaName: string | null;
23
+ /** The server's trace id, for support — shown as a reference, never as the message. */
24
+ traceId: string | null;
25
+ }
26
+ /**
27
+ * The outcome of a failed turn.
28
+ *
29
+ * ★★ Order matters: a client refusal first (it never reached a server); then
30
+ * the usage wall, BEFORE permission — a sandbox quota refusal can also carry a
31
+ * denial-shaped code, and permission checked first would swallow it and the
32
+ * upgrade dialog would never open; then permission; and only what is left is
33
+ * temporary. "Temporary" is the honest default for the rest: a network drop, a
34
+ * timeout, a 5xx, a sandbox that did not come up — retrying can succeed, and
35
+ * nothing about the person's plan or access is implied.
36
+ */
37
+ export declare function classifyTurnFailure(error: unknown): TurnOutcome;
38
+ /**
39
+ * What the outcome says: `text` for the conversation, `headline` alone for
40
+ * compact surfaces (a preview's end state), and whether it is `translated`.
41
+ *
42
+ * ★★ ONE LANGUAGE PER MESSAGE. The headline and the reference line are
43
+ * separate keys, and a product can seed one before the other. A message half
44
+ * translated would be stamped with ONE language and read aloud in that voice,
45
+ * English words included — so unless every part is translated, every part is
46
+ * English, stamped `en`.
47
+ *
48
+ * ★ The panel's own copy follows the INTERFACE language (`tr` resolves in the
49
+ * active locale), not the reply language a person may have set apart from it:
50
+ * a Tamil reply under an English interface gets an English outcome, correctly
51
+ * stamped `en`. The translator has no way to ask for another language.
52
+ */
53
+ export declare function turnOutcomeCopy(outcome: TurnOutcome, tr: AssistantTr): {
54
+ text: string;
55
+ headline: string;
56
+ translated: boolean;
57
+ };
58
+ //# sourceMappingURL=turnOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnOutcome.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnOutcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,4DAA4D;AAC5D,MAAM,MAAM,iBAAiB,GACzB,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAEvB,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM;CAKvD;AAED,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,YAAY,GACZ,cAAc,GACd,WAAW,CAAC;AAEhB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,6BAA6B;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,oFAAoF;IACpF,aAAa,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uFAAuF;IACvF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAsBD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAsC/D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,WAAW,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAuBzD"}