@burdenoff/fe-libs 2026.1004.8 → 2026.1005.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.
Files changed (99) hide show
  1. package/dist/shared/assistant/api.d.ts +18 -0
  2. package/dist/shared/assistant/api.d.ts.map +1 -1
  3. package/dist/shared/assistant/api.js +169 -147
  4. package/dist/shared/assistant/capabilities.d.ts +21 -0
  5. package/dist/shared/assistant/capabilities.d.ts.map +1 -1
  6. package/dist/shared/assistant/capabilities.js +11 -1
  7. package/dist/shared/assistant/i18nManifest.d.ts +4 -0
  8. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  9. package/dist/shared/assistant/i18nManifest.js +4 -0
  10. package/dist/shared/assistant/index.d.ts +20 -0
  11. package/dist/shared/assistant/index.d.ts.map +1 -1
  12. package/dist/shared/assistant/liveDeltas.d.ts +76 -0
  13. package/dist/shared/assistant/liveDeltas.d.ts.map +1 -0
  14. package/dist/shared/assistant/liveDeltas.js +196 -0
  15. package/dist/shared/assistant/liveOverlay.d.ts +62 -0
  16. package/dist/shared/assistant/liveOverlay.d.ts.map +1 -0
  17. package/dist/shared/assistant/liveOverlay.js +64 -0
  18. package/dist/shared/assistant/snapshotPoller.d.ts +48 -0
  19. package/dist/shared/assistant/snapshotPoller.d.ts.map +1 -0
  20. package/dist/shared/assistant/snapshotPoller.js +58 -0
  21. package/dist/shared/assistant/speech/browserSpeechEngine.d.ts.map +1 -1
  22. package/dist/shared/assistant/speech/browserSpeechEngine.js +46 -45
  23. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.d.ts.map +1 -1
  24. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +80 -79
  25. package/dist/shared/assistant/store.d.ts +3 -0
  26. package/dist/shared/assistant/store.d.ts.map +1 -1
  27. package/dist/shared/assistant/store.js +43 -35
  28. package/dist/shared/assistant/turnStream.d.ts +71 -0
  29. package/dist/shared/assistant/turnStream.d.ts.map +1 -0
  30. package/dist/shared/assistant/turnStream.js +266 -0
  31. package/dist/shared/assistant/turnTimeline.d.ts +27 -2
  32. package/dist/shared/assistant/turnTimeline.d.ts.map +1 -1
  33. package/dist/shared/assistant/turnTimeline.js +17 -28
  34. package/dist/shared/assistant/types.d.ts +10 -0
  35. package/dist/shared/assistant/types.d.ts.map +1 -1
  36. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  37. package/dist/shared/assistant/ui/AssistantChatArea.js +886 -843
  38. package/dist/shared/assistant/ui/AssistantMessageList.d.ts +2 -0
  39. package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
  40. package/dist/shared/assistant/ui/AssistantMessageList.js +48 -32
  41. package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
  42. package/dist/shared/assistant/ui/AssistantMoreMenu.js +59 -57
  43. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts +17 -0
  44. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.d.ts.map +1 -0
  45. package/dist/shared/assistant/ui/composer/AssistantHandsFreeInterruptToggle.js +34 -0
  46. package/dist/shared/assistant/ui/useVoiceSession.d.ts +29 -2
  47. package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
  48. package/dist/shared/assistant/ui/useVoiceSession.js +247 -213
  49. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +2 -0
  50. package/dist/shared/assistant/voice/handsfree/audioTrackTransport.d.ts +33 -0
  51. package/dist/shared/assistant/voice/handsfree/audioTrackTransport.d.ts.map +1 -0
  52. package/dist/shared/assistant/voice/handsfree/audioTrackTransport.js +98 -0
  53. package/dist/shared/assistant/voice/handsfree/backendStreamTransport.d.ts +34 -0
  54. package/dist/shared/assistant/voice/handsfree/backendStreamTransport.d.ts.map +1 -0
  55. package/dist/shared/assistant/voice/handsfree/backendStreamTransport.js +130 -0
  56. package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts +43 -0
  57. package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts.map +1 -0
  58. package/dist/shared/assistant/voice/handsfree/bargeIn.js +32 -0
  59. package/dist/shared/assistant/voice/handsfree/captureWorklet.d.ts +47 -0
  60. package/dist/shared/assistant/voice/handsfree/captureWorklet.d.ts.map +1 -0
  61. package/dist/shared/assistant/voice/handsfree/captureWorklet.js +85 -0
  62. package/dist/shared/assistant/voice/handsfree/echoGate.d.ts +140 -0
  63. package/dist/shared/assistant/voice/handsfree/echoGate.d.ts.map +1 -0
  64. package/dist/shared/assistant/voice/handsfree/echoGate.js +198 -0
  65. package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts +77 -0
  66. package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts.map +1 -0
  67. package/dist/shared/assistant/voice/handsfree/handsFreeController.js +126 -0
  68. package/dist/shared/assistant/voice/handsfree/handsFreeRuntime.d.ts +15 -0
  69. package/dist/shared/assistant/voice/handsfree/handsFreeRuntime.d.ts.map +1 -0
  70. package/dist/shared/assistant/voice/handsfree/handsFreeRuntime.js +78 -0
  71. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts +26 -0
  72. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.d.ts.map +1 -0
  73. package/dist/shared/assistant/voice/handsfree/handsFreeSetting.js +25 -0
  74. package/dist/shared/assistant/voice/handsfree/micCapture.d.ts +21 -0
  75. package/dist/shared/assistant/voice/handsfree/micCapture.d.ts.map +1 -0
  76. package/dist/shared/assistant/voice/handsfree/micCapture.js +72 -0
  77. package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +38 -0
  78. package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts.map +1 -0
  79. package/dist/shared/assistant/voice/handsfree/playbackReference.js +55 -0
  80. package/dist/shared/assistant/voice/handsfree/preRollRing.d.ts +32 -0
  81. package/dist/shared/assistant/voice/handsfree/preRollRing.d.ts.map +1 -0
  82. package/dist/shared/assistant/voice/handsfree/preRollRing.js +34 -0
  83. package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts +94 -0
  84. package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts.map +1 -0
  85. package/dist/shared/assistant/voice/handsfree/sttTransport.js +27 -0
  86. package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts +33 -0
  87. package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts.map +1 -0
  88. package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.js +70 -0
  89. package/dist/shared/assistant/voice/handsfree/vad.d.ts +55 -0
  90. package/dist/shared/assistant/voice/handsfree/vad.d.ts.map +1 -0
  91. package/dist/shared/assistant/voice/handsfree/vad.js +41 -0
  92. package/dist/shared/assistant/voice/handsfree/webSpeechTransport.d.ts +3 -0
  93. package/dist/shared/assistant/voice/handsfree/webSpeechTransport.d.ts.map +1 -0
  94. package/dist/shared/assistant/voice/handsfree/webSpeechTransport.js +16 -0
  95. package/dist/shared/assistant/voice/voiceSession.d.ts +9 -0
  96. package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
  97. package/dist/shared/assistant/voice/voiceSession.js +2 -2
  98. package/dist/shared-assistant.js +224 -204
  99. package/package.json +2 -1
@@ -3,58 +3,60 @@ import "../../shared-utils.js";
3
3
  import { restoreAutoRouting as t } from "./autoRouting.js";
4
4
  import { createGuardedAssistantStorage as n } from "./guardedStorage.js";
5
5
  import { DEFAULT_VOICE_GRACE_MS as r, resolveVoiceGraceMs as i } from "./voice/handsFree.js";
6
- import { normaliseHistoryTitle as a } from "./history/historyControls.js";
7
- import { getHistoryStamp as o, historyOpenFilter as s, notifyAssistantStorageFull as c, offerHistoryRename as l } from "./history/stampRegistry.js";
8
- import { forgetLiveTurns as u } from "./liveTurns.js";
9
- import { LEGACY_WRITE_CONSENT_KEY as d, restoreAcknowledgedWriteModes as f, withWriteModeAcknowledged as p } from "./writeModeConsent.js";
10
- import { create as m } from "zustand";
11
- import { persist as h } from "zustand/middleware";
6
+ import { resolveStoredHandsFree as a } from "./voice/handsfree/handsFreeSetting.js";
7
+ import { normaliseHistoryTitle as o } from "./history/historyControls.js";
8
+ import { getHistoryStamp as s, historyOpenFilter as c, notifyAssistantStorageFull as l, offerHistoryRename as u } from "./history/stampRegistry.js";
9
+ import { forgetLiveTurns as d } from "./liveTurns.js";
10
+ import { LEGACY_WRITE_CONSENT_KEY as f, restoreAcknowledgedWriteModes as p, withWriteModeAcknowledged as m } from "./writeModeConsent.js";
11
+ import { create as h } from "zustand";
12
+ import { persist as g } from "zustand/middleware";
12
13
  //#region src/shared/assistant/store.ts
13
- function g() {
14
+ function _() {
14
15
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
15
16
  }
16
- function _(e) {
17
+ function v(e) {
17
18
  let t = e.sandboxesByMode[e.mode]?.sandboxId;
18
19
  return t ? {
19
20
  sandboxId: t,
20
21
  mode: e.mode
21
22
  } : null;
22
23
  }
23
- var v = new Set([d, "sandboxWriteCapabilities"]);
24
- function y(e, n) {
25
- let r = typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([e]) => !v.has(e))) : {};
24
+ var y = new Set([f, "sandboxWriteCapabilities"]);
25
+ function b(e, n) {
26
+ let r = typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter(([e]) => !y.has(e))) : {};
26
27
  return {
27
28
  ...n,
28
29
  ...r,
29
- acknowledgedWriteModes: f(e),
30
+ acknowledgedWriteModes: p(e),
30
31
  autoRouting: t(e),
31
- voiceGraceMs: i(r.voiceGraceMs)
32
+ voiceGraceMs: i(r.voiceGraceMs),
33
+ handsFreeInterrupt: a(r.handsFreeInterrupt)
32
34
  };
33
35
  }
34
- function b(e, t, n) {
36
+ function x(e, t, n) {
35
37
  let r = new Set(t);
36
38
  n && e.activeConversationId !== null && r.delete(e.activeConversationId);
37
39
  let i = e.conversations.filter((e) => r.has(e.id));
38
40
  if (i.length === 0) return {};
39
- u(i.flatMap((e) => e.messages.map((e) => e.id)));
41
+ d(i.flatMap((e) => e.messages.map((e) => e.id)));
40
42
  let a = e.conversations.filter((e) => !r.has(e.id)), o = { ...e.processingByConversationId };
41
43
  for (let e of r) delete o[e];
42
44
  if (e.activeConversationId === null || !r.has(e.activeConversationId)) return {
43
45
  conversations: a,
44
46
  processingByConversationId: o
45
47
  };
46
- let c = a.find(s());
48
+ let s = a.find(c());
47
49
  return {
48
50
  conversations: a,
49
51
  processingByConversationId: o,
50
- activeConversationId: c?.id ?? null,
51
- ...c ? {
52
- mode: c.mode,
53
- autoRouting: c.routedBy === "auto"
52
+ activeConversationId: s?.id ?? null,
53
+ ...s ? {
54
+ mode: s.mode,
55
+ autoRouting: s.routedBy === "auto"
54
56
  } : {}
55
57
  };
56
58
  }
57
- var x = m()(h((e, t) => ({
59
+ var S = h()(g((e, t) => ({
58
60
  conversations: [],
59
61
  activeConversationId: null,
60
62
  mode: "assistant",
@@ -70,15 +72,16 @@ var x = m()(h((e, t) => ({
70
72
  replyLanguage: null,
71
73
  preferredVoices: {},
72
74
  voiceGraceMs: r,
75
+ handsFreeInterrupt: !1,
73
76
  createConversation: (n, r, i) => {
74
- let a = g(), s = (/* @__PURE__ */ new Date()).toISOString(), c = r === void 0 && t().autoRouting, l = i?.routedBy ?? (c ? "auto" : void 0), u = r ?? (c ? "assistant" : t().mode), d = o(), f = {
77
+ let a = _(), o = (/* @__PURE__ */ new Date()).toISOString(), c = r === void 0 && t().autoRouting, l = i?.routedBy ?? (c ? "auto" : void 0), u = r ?? (c ? "assistant" : t().mode), d = s(), f = {
75
78
  id: a,
76
79
  title: n || "New conversation",
77
80
  mode: u,
78
81
  messages: [],
79
82
  backendSessionId: null,
80
- createdAt: s,
81
- updatedAt: s,
83
+ createdAt: o,
84
+ updatedAt: o,
82
85
  ...l ? { routedBy: l } : {},
83
86
  ...d ? { sync: {
84
87
  v: 1,
@@ -100,7 +103,7 @@ var x = m()(h((e, t) => ({
100
103
  conversations: n,
101
104
  processingByConversationId: r
102
105
  };
103
- let i = n.find(s());
106
+ let i = n.find(c());
104
107
  return {
105
108
  conversations: n,
106
109
  processingByConversationId: r,
@@ -112,8 +115,8 @@ var x = m()(h((e, t) => ({
112
115
  };
113
116
  }),
114
117
  renameConversation: (t, n) => {
115
- let r = a(n);
116
- r && (l(t, r) || e((e) => ({ conversations: e.conversations.map((e) => e.id === t ? {
118
+ let r = o(n);
119
+ r && (u(t, r) || e((e) => ({ conversations: e.conversations.map((e) => e.id === t ? {
117
120
  ...e,
118
121
  title: r,
119
122
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -276,20 +279,24 @@ var x = m()(h((e, t) => ({
276
279
  assistantLanguage: null,
277
280
  replyLanguage: null,
278
281
  preferredVoices: {},
279
- voiceGraceMs: r
282
+ voiceGraceMs: r,
283
+ handsFreeInterrupt: !1
280
284
  }),
281
285
  submitPrompt: (t) => e({ pendingPrompt: t }),
282
286
  consumePendingPrompt: () => {
283
287
  let n = t().pendingPrompt;
284
288
  return n !== null && e({ pendingPrompt: null }), n;
285
289
  },
286
- acknowledgeWriteMode: (t) => e((e) => ({ acknowledgedWriteModes: p(e.acknowledgedWriteModes, t) })),
290
+ acknowledgeWriteMode: (t) => e((e) => ({ acknowledgedWriteModes: m(e.acknowledgedWriteModes, t) })),
287
291
  setAutoSpeak: (t) => e({ autoSpeakEnabled: t }),
288
292
  setAssistantLanguage: (t) => e({ assistantLanguage: t }),
289
293
  setReplyLanguage: (t) => e({ replyLanguage: t }),
290
294
  setVoiceGraceMs: (t) => {
291
295
  i(t) === t && e({ voiceGraceMs: i(t) });
292
296
  },
297
+ setHandsFreeInterrupt: (t) => {
298
+ e({ handsFreeInterrupt: a(t) });
299
+ },
293
300
  setPreferredVoice: (t, n) => e((e) => {
294
301
  let r = { ...e.preferredVoices };
295
302
  return n === null ? delete r[t] : r[t] = n, { preferredVoices: r };
@@ -327,11 +334,11 @@ var x = m()(h((e, t) => ({
327
334
  ...a && !i.titleLocked ? { title: a } : {}
328
335
  };
329
336
  }) })),
330
- removeConversationsSilently: (t) => e((e) => b(e, t, !1)),
331
- evictConversations: (t) => e((e) => b(e, t, !0))
337
+ removeConversationsSilently: (t) => e((e) => x(e, t, !1)),
338
+ evictConversations: (t) => e((e) => x(e, t, !0))
332
339
  }), {
333
340
  name: "hb-ai-assistant",
334
- storage: n(e(), (e, t, n) => c(n)),
341
+ storage: n(e(), (e, t, n) => l(n)),
335
342
  partialize: (e) => ({
336
343
  conversations: e.conversations.map(({ ...e }) => e),
337
344
  activeConversationId: e.activeConversationId,
@@ -343,9 +350,10 @@ var x = m()(h((e, t) => ({
343
350
  assistantLanguage: e.assistantLanguage,
344
351
  replyLanguage: e.replyLanguage,
345
352
  preferredVoices: e.preferredVoices,
346
- voiceGraceMs: e.voiceGraceMs
353
+ voiceGraceMs: e.voiceGraceMs,
354
+ handsFreeInterrupt: e.handsFreeInterrupt
347
355
  }),
348
- merge: y
356
+ merge: b
349
357
  }));
350
358
  //#endregion
351
- export { y as mergePersistedAssistantState, _ as resolveActiveModeSandbox, x as useAssistantStore };
359
+ export { b as mergePersistedAssistantState, v as resolveActiveModeSandbox, S as useAssistantStore };
@@ -0,0 +1,71 @@
1
+ import { LiveDeltaState } from './liveDeltas';
2
+ import { StreamAccess } from './types';
3
+ export type TurnStreamStatus = "minting" | "connecting" | "open" | "closed" | "unavailable";
4
+ export type WakeResult = "wake" | "idle" | "timeout" | "abort";
5
+ /** The slice of the browser `EventSource` this client uses. */
6
+ export interface EventSourceLike {
7
+ readonly readyState: number;
8
+ addEventListener(type: string, listener: (event: {
9
+ readonly data?: unknown;
10
+ }) => void): void;
11
+ close(): void;
12
+ }
13
+ /** The timeline marks the stream makes (`turnTimeline.ts`). */
14
+ export type TurnStreamMark = "streamOpen" | "streamIdle" | "streamRemint";
15
+ export interface TurnStreamOptions {
16
+ /** Mint a stream URL, or null when there is none. Never throws into here. */
17
+ mint: () => Promise<StreamAccess | null>;
18
+ /** Open a connection; null when the browser has no EventSource. */
19
+ createEventSource?: (url: string) => EventSourceLike | null;
20
+ mark?: (mark: TurnStreamMark, reason?: string) => void;
21
+ now?: () => number;
22
+ setTimer?: (run: () => void, ms: number) => unknown;
23
+ clearTimer?: (timer: unknown) => void;
24
+ /** Delays before each re-mint; its length is the cap (2 per turn). */
25
+ remintDelaysMs?: readonly number[];
26
+ /** Wake-triggered polls are at least this far apart. */
27
+ minWakeGapMs?: number;
28
+ }
29
+ export interface TurnStream {
30
+ readonly status: TurnStreamStatus;
31
+ /** An `open` with `subscribed: true` arrived during this turn. */
32
+ readonly reachedOpen: boolean;
33
+ /** The current connection's `open` carried `projection: 1`. */
34
+ readonly projection: boolean;
35
+ /** +1 per re-mint. */
36
+ readonly generation: number;
37
+ /** The reason of each re-mint, in order. */
38
+ readonly remintReasons: readonly string[];
39
+ /**
40
+ * Resolve when the stream says something worth polling for, or after `maxMs`.
41
+ * `idle` is the bridge's own end-of-turn: poll NOW. A wake that arrives with
42
+ * nobody waiting is remembered, so the next wait resolves at once.
43
+ */
44
+ waitWake(maxMs: number, signal?: AbortSignal): Promise<WakeResult>;
45
+ readonly live: LiveDeltaState;
46
+ onLive(listener: () => void): () => void;
47
+ /**
48
+ * Called synchronously when the bridge's idle arrives. A listener that
49
+ * returns true has acted on it (the completion fast path started a poll), so
50
+ * the idle is not also remembered for the next `waitWake`.
51
+ */
52
+ onIdle(listener: () => boolean): () => void;
53
+ /** Synchronous. Detach live listeners and stop reducing text. Idempotent. */
54
+ endLive(): void;
55
+ readonly liveEnded: boolean;
56
+ /** Tear everything down. Idempotent. */
57
+ close(): void;
58
+ }
59
+ /**
60
+ * The debug override: `localStorage["burdenoff.assistant.transport"] = "poll"`
61
+ * forces polling for this browser — no mint, no stream — for a zero-cost A/B of
62
+ * the two transports. Absent by default; a storage that throws reads as absent.
63
+ */
64
+ export declare const TRANSPORT_OVERRIDE_KEY = "burdenoff.assistant.transport";
65
+ export declare function transportForcedToPoll(): boolean;
66
+ /** Can this page open a turn stream at all, and has nobody switched it off? */
67
+ export declare function turnStreamAvailable(): boolean;
68
+ export declare const DEFAULT_REMINT_DELAYS_MS: readonly number[];
69
+ export declare const MIN_WAKE_GAP_MS = 250;
70
+ export declare function openTurnStream(options: TurnStreamOptions): TurnStream;
71
+ //# sourceMappingURL=turnStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turnStream.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnStream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAYH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/D,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,GACrD,IAAI,CAAC;IACR,KAAK,IAAI,IAAI,CAAC;CACf;AAKD,+DAA+D;AAC/D,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IACzC,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAA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BAAmB,IAAI,OAAO,CAE7C;AAED,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAAmB,CAAC;AAC1E,eAAO,MAAM,eAAe,MAAM,CAAC;AA6CnC,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CA8ZrE"}
@@ -0,0 +1,266 @@
1
+ import { STREAM_MINT_BACKOFF_ERROR_MS as e, backOffStreamMint as t } from "./capabilities.js";
2
+ import { beginLiveGeneration as n, createLiveState as r, freezeLiveParts as i, reduceLiveFrame as a } from "./liveDeltas.js";
3
+ //#region src/shared/assistant/turnStream.ts
4
+ var o = 2, s = "burdenoff.assistant.transport";
5
+ function c() {
6
+ try {
7
+ return globalThis.localStorage?.getItem(s) === "poll";
8
+ } catch {
9
+ return !1;
10
+ }
11
+ }
12
+ function l() {
13
+ return typeof EventSource < "u" && !c();
14
+ }
15
+ var u = [1e3, 5e3], d = 250, f = [
16
+ "open",
17
+ "message.updated",
18
+ "message.part.updated",
19
+ "message.part.delta",
20
+ "session.error",
21
+ "session.idle",
22
+ "stream.end",
23
+ "relay.closed"
24
+ ];
25
+ function p(e) {
26
+ return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
27
+ }
28
+ function m(e) {
29
+ if (typeof e == "string") try {
30
+ return JSON.parse(e);
31
+ } catch {
32
+ return;
33
+ }
34
+ }
35
+ function h(e) {
36
+ return typeof EventSource > "u" ? null : new EventSource(e, { withCredentials: !0 });
37
+ }
38
+ function g(s) {
39
+ let c = s.now ?? Date.now, l = s.setTimer ?? ((e, t) => setTimeout(e, t)), d = s.clearTimer ?? ((e) => {
40
+ clearTimeout(e);
41
+ }), g = s.createEventSource ?? h, _ = s.remintDelaysMs ?? u, v = s.minWakeGapMs ?? 250, y = "minting", b = !1, x = !1, S = 0, C = [], w = !1, T = !1, E = r(), D = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Set(), k = null, A = 0, j = -1, M = !1, N = null, P = null, F = null, I = -Infinity, L = (e, t) => {
42
+ try {
43
+ s.mark?.(e, t);
44
+ } catch {}
45
+ }, R = (e, t) => {
46
+ e.settled || (e.settled = !0, d(e.maxTimer), e.gapTimer !== null && d(e.gapTimer), e.signal && e.onAbort && e.signal.removeEventListener("abort", e.onAbort), F === e && (F = null), (t === "wake" || t === "idle") && (I = c()), e.resolve(t));
47
+ }, z = (e) => {
48
+ let t = F;
49
+ if (!t) {
50
+ P = e === "idle" || P === "idle" ? "idle" : "wake";
51
+ return;
52
+ }
53
+ if (e === "idle") {
54
+ R(t, "idle");
55
+ return;
56
+ }
57
+ let n = I + v - c();
58
+ if (n <= 0) {
59
+ R(t, "wake");
60
+ return;
61
+ }
62
+ t.gapTimer === null && (t.gapTimer = l(() => {
63
+ t.gapTimer = null, R(t, "wake");
64
+ }, n));
65
+ }, B = () => {
66
+ if (!T) for (let e of [...D]) try {
67
+ e();
68
+ } catch {}
69
+ }, V = () => {
70
+ A += 1;
71
+ let e = k;
72
+ k = null;
73
+ try {
74
+ e?.close();
75
+ } catch {}
76
+ }, H = () => {
77
+ y = "unavailable", t(e, c());
78
+ }, U = () => {
79
+ y = "closed";
80
+ }, W = (e) => {
81
+ if (w) return;
82
+ if (C.length >= _.length) {
83
+ U();
84
+ return;
85
+ }
86
+ let t = _[C.length] ?? 0;
87
+ C.push(e), y = "minting", N !== null && d(N), N = l(() => {
88
+ N = null, !w && (L("streamRemint", e), S += 1, E = n(E), J());
89
+ }, t);
90
+ }, G = (e) => {
91
+ let t = F !== null;
92
+ switch (V(), E = i(E), z("wake"), e) {
93
+ case "client-closed":
94
+ U();
95
+ return;
96
+ case "session-idle":
97
+ t ? W("session-idle") : (y = "closed", M = !0);
98
+ return;
99
+ default: W(e);
100
+ }
101
+ }, K = (e, t, n) => {
102
+ if (w || e !== A) return;
103
+ let r = m(n);
104
+ if (t === "open") {
105
+ let t = p(r);
106
+ if (!t) return;
107
+ if (t.subscribed === !0) {
108
+ y = "open", j = e, b = !0, x = typeof t.projection == "number" && t.projection >= 1, L("streamOpen");
109
+ return;
110
+ }
111
+ G("not-subscribed");
112
+ return;
113
+ }
114
+ if (y === "open") {
115
+ if (t === "relay.closed") {
116
+ G(String(p(r)?.reason ?? "relay-closed"));
117
+ return;
118
+ }
119
+ if (t === "stream.end") {
120
+ G(`stream-end:${String(p(r)?.reason ?? "unknown")}`);
121
+ return;
122
+ }
123
+ if (x && !T && (t === "message.updated" || t === "message.part.updated" || t === "message.part.delta")) {
124
+ let e = a(E, {
125
+ event: t,
126
+ data: r
127
+ });
128
+ e !== E && (E = e, B());
129
+ }
130
+ switch (t) {
131
+ case "message.updated":
132
+ z("wake");
133
+ return;
134
+ case "message.part.updated": {
135
+ let e = p(r);
136
+ if (!x) {
137
+ z("wake");
138
+ return;
139
+ }
140
+ let t = p(e?.time)?.end !== void 0;
141
+ (e?.type === "tool" || e?.type === "text" && t) && z("wake");
142
+ return;
143
+ }
144
+ case "session.error":
145
+ z("wake");
146
+ return;
147
+ case "session.idle": {
148
+ if (!x) {
149
+ z("wake");
150
+ return;
151
+ }
152
+ L("streamIdle");
153
+ let e = !1;
154
+ for (let t of [...O]) try {
155
+ t() && (e = !0);
156
+ } catch {}
157
+ if (e) {
158
+ I = c();
159
+ return;
160
+ }
161
+ z("idle");
162
+ return;
163
+ }
164
+ default: return;
165
+ }
166
+ }
167
+ }, q = (e) => {
168
+ let t;
169
+ try {
170
+ t = g(e.url);
171
+ } catch {
172
+ t = null;
173
+ }
174
+ if (!t) {
175
+ H();
176
+ return;
177
+ }
178
+ let n = t, r = A += 1;
179
+ k = n, y = "connecting";
180
+ for (let e of f) n.addEventListener(e, (t) => {
181
+ e === "open" && typeof t.data != "string" || K(r, e, t.data);
182
+ });
183
+ n.addEventListener("error", () => {
184
+ if (!(w || r !== A)) {
185
+ if (n.readyState === o && j !== r) {
186
+ V(), z("wake"), H();
187
+ return;
188
+ }
189
+ G("error");
190
+ }
191
+ });
192
+ }, J = () => {
193
+ y = "minting";
194
+ let e = A;
195
+ s.mint().then((e) => e, () => null).then((t) => {
196
+ if (!(w || e !== A)) {
197
+ if (!t) {
198
+ H();
199
+ return;
200
+ }
201
+ q(t);
202
+ }
203
+ });
204
+ };
205
+ return J(), {
206
+ get status() {
207
+ return y;
208
+ },
209
+ get reachedOpen() {
210
+ return b;
211
+ },
212
+ get projection() {
213
+ return x;
214
+ },
215
+ get generation() {
216
+ return S;
217
+ },
218
+ get remintReasons() {
219
+ return C;
220
+ },
221
+ get live() {
222
+ return E;
223
+ },
224
+ get liveEnded() {
225
+ return T;
226
+ },
227
+ waitWake(e, t) {
228
+ return new Promise((n) => {
229
+ if (t?.aborted) {
230
+ n("abort");
231
+ return;
232
+ }
233
+ M && (M = !1, W("session-idle"));
234
+ let r = {
235
+ resolve: n,
236
+ maxTimer: null,
237
+ gapTimer: null,
238
+ signal: t,
239
+ onAbort: void 0,
240
+ settled: !1
241
+ };
242
+ r.maxTimer = l(() => R(r, "timeout"), e), t && (r.onAbort = () => R(r, "abort"), t.addEventListener("abort", r.onAbort)), F = r;
243
+ let i = P;
244
+ P = null, i && z(i);
245
+ });
246
+ },
247
+ onLive(e) {
248
+ return T ? () => void 0 : (D.add(e), () => {
249
+ D.delete(e);
250
+ });
251
+ },
252
+ onIdle(e) {
253
+ return O.add(e), () => {
254
+ O.delete(e);
255
+ };
256
+ },
257
+ endLive() {
258
+ T || (T = !0, D.clear());
259
+ },
260
+ close() {
261
+ w || (w = !0, T = !0, D.clear(), O.clear(), N !== null && (d(N), N = null), V(), F && R(F, "abort"), y !== "unavailable" && (y = "closed"));
262
+ }
263
+ };
264
+ }
265
+ //#endregion
266
+ export { u as DEFAULT_REMINT_DELAYS_MS, d as MIN_WAKE_GAP_MS, s as TRANSPORT_OVERRIDE_KEY, g as openTurnStream, c as transportForcedToPoll, l as turnStreamAvailable };
@@ -32,12 +32,19 @@
32
32
  * promptSent the sandbox accepted the prompt
33
33
  * lastQuietPoll the last poll that saw nothing — with firstOutput, the
34
34
  * UPPER bound of how late polling noticed the output
35
- * firstOutput the first poll that saw anything to show (a tool line too)
35
+ * streamOpen the turn stream said `open` (BOFF-7914 S3); it can precede
36
+ * `promptSent`, because the mint runs beside the prompt
37
+ * streamRemint the stream was minted again after it ended; the FIRST
38
+ * re-mint (the reasons are the `remintReasons` of the stream)
39
+ * firstDelta the first live text of this turn that could be shown
40
+ * firstOutput the first poll — or live render — that had anything to
41
+ * show (a tool line too)
36
42
  * firstText the first poll that saw answer TEXT — prose not followed
37
43
  * by a tool call, confirmed when the turn completes, so
38
44
  * pre-tool narration does not count. In modes whose
39
45
  * narration IS the answer (BigConsole's build log), the
40
46
  * first narration: group reports by `mode`
47
+ * streamIdle the bridge said the turn is idle (stream turns only)
41
48
  * answerDone the poll that saw the answer complete
42
49
  * complete the turn ended (after artifacts and the credit report)
43
50
  * speechQueued the answer was handed to the speech feed (BOFF-8062 C1):
@@ -78,7 +85,7 @@
78
85
  * window event: any script on the page can dispatch that event, so a listener
79
86
  * on it can be fed invented timings. Only this module calls subscribers.
80
87
  */
81
- export declare const TURN_MILESTONES: readonly ["speechEnded", "graceStarted", "graceEnded", "handedOver", "accepted", "cleared", "attemptStarted", "prewarmJoined", "bootAdopted", "provisionStarted", "createRequested", "sandboxRunning", "serviceReady", "runtimeReady", "promptSent", "lastQuietPoll", "firstOutput", "firstText", "answerDone", "complete", "speechQueued", "ttsStarted", "firstAudio", "audioEnded"];
88
+ export declare const TURN_MILESTONES: readonly ["speechEnded", "graceStarted", "graceEnded", "handedOver", "accepted", "cleared", "attemptStarted", "prewarmJoined", "bootAdopted", "provisionStarted", "createRequested", "sandboxRunning", "serviceReady", "runtimeReady", "promptSent", "lastQuietPoll", "streamOpen", "streamRemint", "firstDelta", "firstOutput", "firstText", "streamIdle", "answerDone", "complete", "speechQueued", "ttsStarted", "firstAudio", "audioEnded"];
82
89
  export type TurnMilestone = (typeof TURN_MILESTONES)[number];
83
90
  /**
84
91
  * How the runtime was found:
@@ -145,6 +152,16 @@ export interface TurnAttemptFacts {
145
152
  * the `prewarmJoined` mark says so.
146
153
  */
147
154
  prewarm?: "hit" | "joined" | "joinedFailed";
155
+ /**
156
+ * BOFF-7914 S3: how this attempt learnt about the reply — `sse` when the turn
157
+ * stream reached `open`, else `poll`. Timeline-only; the production latency
158
+ * report builds from an allowlist and does not carry it (until S0b).
159
+ */
160
+ transport?: "sse" | "poll";
161
+ /** How much of the text the stream carried: all of it, some, or none. */
162
+ live?: "full" | "partial" | "none";
163
+ /** The session: `reused`, `created` (new) or `preopened` (BOFF-8015). */
164
+ session?: "reused" | "created" | "preopened";
148
165
  }
149
166
  export interface TurnAttempt extends TurnAttemptFacts {
150
167
  at: Partial<Record<TurnMilestone, number>>;
@@ -265,6 +282,14 @@ export declare const TURN_SEGMENTS: readonly [{
265
282
  readonly name: "finish";
266
283
  readonly from: "firstOutput";
267
284
  readonly to: "answerDone";
285
+ }, {
286
+ readonly name: "deltaToVisible";
287
+ readonly from: "firstDelta";
288
+ readonly to: "firstOutput";
289
+ }, {
290
+ readonly name: "wakeLag";
291
+ readonly from: "streamIdle";
292
+ readonly to: "answerDone";
268
293
  }, {
269
294
  readonly name: "post";
270
295
  readonly from: "answerDone";
@@ -1 +1 @@
1
- {"version":3,"file":"turnTimeline.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnTimeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAEH,eAAO,MAAM,eAAe,uXAyBlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAmB7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,WAAW,GACX,aAAa,GACb,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;AAEX;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAC3B,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