@burdenoff/fe-libs 2026.926.5 → 2026.927.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 (95) hide show
  1. package/dist/shared/assistant/conversation.d.ts +91 -3
  2. package/dist/shared/assistant/conversation.d.ts.map +1 -1
  3. package/dist/shared/assistant/gatewayClient.d.ts +15 -0
  4. package/dist/shared/assistant/gatewayClient.d.ts.map +1 -1
  5. package/dist/shared/assistant/gatewayClient.js +1 -1
  6. package/dist/shared/assistant/guardedStorage.d.ts +4 -2
  7. package/dist/shared/assistant/guardedStorage.d.ts.map +1 -1
  8. package/dist/shared/assistant/guardedStorage.js +1 -1
  9. package/dist/shared/assistant/history/historyApi.d.ts +38 -0
  10. package/dist/shared/assistant/history/historyApi.d.ts.map +1 -0
  11. package/dist/shared/assistant/history/historyApi.js +153 -0
  12. package/dist/shared/assistant/history/historyEngine.d.ts +96 -0
  13. package/dist/shared/assistant/history/historyEngine.d.ts.map +1 -0
  14. package/dist/shared/assistant/history/historyEngine.js +774 -0
  15. package/dist/shared/assistant/history/historyErrors.d.ts +72 -0
  16. package/dist/shared/assistant/history/historyErrors.d.ts.map +1 -0
  17. package/dist/shared/assistant/history/historyErrors.js +74 -0
  18. package/dist/shared/assistant/history/historyList.d.ts +115 -0
  19. package/dist/shared/assistant/history/historyList.d.ts.map +1 -0
  20. package/dist/shared/assistant/history/historyList.js +116 -0
  21. package/dist/shared/assistant/history/historyMapping.d.ts +65 -0
  22. package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -0
  23. package/dist/shared/assistant/history/historyMapping.js +383 -0
  24. package/dist/shared/assistant/history/historyMerge.d.ts +65 -0
  25. package/dist/shared/assistant/history/historyMerge.d.ts.map +1 -0
  26. package/dist/shared/assistant/history/historyMerge.js +97 -0
  27. package/dist/shared/assistant/history/historyOperations.d.ts +24 -0
  28. package/dist/shared/assistant/history/historyOperations.d.ts.map +1 -0
  29. package/dist/shared/assistant/history/historyOperations.js +125 -0
  30. package/dist/shared/assistant/history/historyResume.d.ts +56 -0
  31. package/dist/shared/assistant/history/historyResume.d.ts.map +1 -0
  32. package/dist/shared/assistant/history/historyResume.js +55 -0
  33. package/dist/shared/assistant/history/historyStatus.d.ts +76 -0
  34. package/dist/shared/assistant/history/historyStatus.d.ts.map +1 -0
  35. package/dist/shared/assistant/history/historyStatus.js +47 -0
  36. package/dist/shared/assistant/history/historyStore.d.ts +192 -0
  37. package/dist/shared/assistant/history/historyStore.d.ts.map +1 -0
  38. package/dist/shared/assistant/history/historyStore.js +503 -0
  39. package/dist/shared/assistant/history/historyTimestamps.d.ts +11 -0
  40. package/dist/shared/assistant/history/historyTimestamps.d.ts.map +1 -0
  41. package/dist/shared/assistant/history/historyTimestamps.js +9 -0
  42. package/dist/shared/assistant/history/historyTypes.d.ts +256 -0
  43. package/dist/shared/assistant/history/historyTypes.d.ts.map +1 -0
  44. package/dist/shared/assistant/history/historyTypes.js +20 -0
  45. package/dist/shared/assistant/history/profileBoundStorage.d.ts +36 -0
  46. package/dist/shared/assistant/history/profileBoundStorage.d.ts.map +1 -0
  47. package/dist/shared/assistant/history/profileBoundStorage.js +74 -0
  48. package/dist/shared/assistant/history/stampRegistry.d.ts +84 -0
  49. package/dist/shared/assistant/history/stampRegistry.d.ts.map +1 -0
  50. package/dist/shared/assistant/history/stampRegistry.js +58 -0
  51. package/dist/shared/assistant/history/useAssistantServerHistory.d.ts +18 -0
  52. package/dist/shared/assistant/history/useAssistantServerHistory.d.ts.map +1 -0
  53. package/dist/shared/assistant/history/useAssistantServerHistory.js +12 -0
  54. package/dist/shared/assistant/i18nManifest.d.ts +18 -0
  55. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  56. package/dist/shared/assistant/i18nManifest.js +18 -0
  57. package/dist/shared/assistant/index.d.ts +16 -0
  58. package/dist/shared/assistant/index.d.ts.map +1 -1
  59. package/dist/shared/assistant/liveTurns.d.ts +7 -0
  60. package/dist/shared/assistant/liveTurns.d.ts.map +1 -1
  61. package/dist/shared/assistant/liveTurns.js +35 -32
  62. package/dist/shared/assistant/spokenTurns.d.ts +20 -0
  63. package/dist/shared/assistant/spokenTurns.d.ts.map +1 -1
  64. package/dist/shared/assistant/spokenTurns.js +13 -8
  65. package/dist/shared/assistant/store.d.ts +35 -1
  66. package/dist/shared/assistant/store.d.ts.map +1 -1
  67. package/dist/shared/assistant/store.js +93 -24
  68. package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +16 -0
  69. package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
  70. package/dist/shared/assistant/ui/AIAssistantPanel.js +63 -60
  71. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  72. package/dist/shared/assistant/ui/AssistantChatArea.js +730 -672
  73. package/dist/shared/assistant/ui/AssistantConversationList.d.ts +17 -0
  74. package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
  75. package/dist/shared/assistant/ui/AssistantConversationList.js +324 -145
  76. package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +36 -0
  77. package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts.map +1 -0
  78. package/dist/shared/assistant/ui/AssistantHistoryNotices.js +103 -0
  79. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +4 -0
  80. package/dist/shared/assistant/ui/AssistantOverlay.d.ts.map +1 -1
  81. package/dist/shared/assistant/ui/AssistantOverlay.js +97 -94
  82. package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts +5 -3
  83. package/dist/shared/assistant/ui/AssistantSpokenTurnsNotice.d.ts.map +1 -1
  84. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
  85. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
  86. package/dist/shared/assistant/ui/composer/AssistantComposer.js +54 -54
  87. package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts +9 -0
  88. package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.d.ts.map +1 -1
  89. package/dist/shared/assistant/ui/voice/VoiceTranscriptDrawer.js +37 -32
  90. package/dist/shared/assistant/voice/turnVisibility.d.ts +7 -5
  91. package/dist/shared/assistant/voice/turnVisibility.d.ts.map +1 -1
  92. package/dist/shared/assistant/voice/voiceTranscript.d.ts +3 -2
  93. package/dist/shared/assistant/voice/voiceTranscript.d.ts.map +1 -1
  94. package/dist/shared-assistant.js +153 -137
  95. package/package.json +1 -1
@@ -1,3 +1,20 @@
1
1
  import { FC } from 'react';
2
+ /**
3
+ * The history drawer.
4
+ *
5
+ * ★★ BOFF-7335: with server history OFF (every product that has not opted in)
6
+ * this is the device's own list, exactly as it always was. With it ON, two
7
+ * groups, never mixed:
8
+ *
9
+ * - "This workspace": this account's conversations in this workspace — the
10
+ * ones held here and the ones only the server has so far (opened, they are
11
+ * read from it) — newest first, with "Show older conversations" past the
12
+ * ones kept on this device.
13
+ * - "On this device": everything from before history was on. Never uploaded;
14
+ * usable exactly as before.
15
+ *
16
+ * A conversation of another account or workspace is not listed, and a deleted
17
+ * one is gone from the list at once, before the server has heard of it.
18
+ */
2
19
  export declare const AssistantConversationList: FC;
3
20
  //# sourceMappingURL=AssistantConversationList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantConversationList.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantConversationList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB1C,eAAO,MAAM,yBAAyB,EAAE,EAiRvC,CAAC"}
1
+ {"version":3,"file":"AssistantConversationList.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantConversationList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,EAAE,EAGR,MAAM,OAAO,CAAC;AAqKf;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,EAAE,EAgkBvC,CAAC"}
@@ -4,162 +4,341 @@ import { chatTurns as n } from "../voice/turnVisibility.js";
4
4
  import { useAssistantStore as r } from "../store.js";
5
5
  import { getAssistantDisplayContent as i } from "../displayContent.js";
6
6
  import { useOverlayFocus as a } from "./useOverlayFocus.js";
7
- import { useState as o } from "react";
8
- import { Check as s, MessageSquare as c, PanelLeftClose as l, Pencil as u, Plus as d, Trash2 as f } from "lucide-react";
9
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
7
+ import { AssistantHistoryUnsavedDeleteNotice as o } from "./AssistantHistoryNotices.js";
8
+ import { selectAssistantHistoryList as s } from "../history/historyList.js";
9
+ import { useAssistantHistoryStatus as c } from "../history/historyStatus.js";
10
+ import { useAssistantHistoryStore as l } from "../history/historyStore.js";
11
+ import { assistantHistory as u } from "../history/historyEngine.js";
12
+ import { useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
13
+ import { Check as ee, MessageSquare as te, PanelLeftClose as ne, Pencil as re, Plus as ie, Trash2 as _ } from "lucide-react";
14
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
15
  //#region src/shared/assistant/ui/AssistantConversationList.tsx
11
- var g = () => {
12
- let g = t(), { modes: _ } = e(), { conversations: v, activeConversationId: y, processingByConversationId: b, setActiveConversation: x, setMode: S, createConversation: C, deleteConversation: w, renameConversation: T, setConversationListOpen: E } = r(), [D, O] = o(null), [k, A] = o(""), j = () => {
13
- C(), E(!1);
14
- }, M = (e) => {
15
- let t = v.find((t) => t.id === e);
16
- x(e), t && S(t.mode), E(!1);
17
- }, N = (e, t) => {
18
- O(e), A(t);
19
- }, P = () => {
20
- D && k.trim() && T(D, k.trim()), O(null);
21
- }, F = (e, t) => {
22
- e.stopPropagation(), w(t);
23
- };
24
- return /* @__PURE__ */ h("div", {
25
- ref: a("assistant-open-history"),
16
+ var ae = (e) => `group relative px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${e ? "bg-bg-elevated border-l-2 border-action-primary-bg" : ""}`, x = ({ active: e, title: t, onOpen: n, details: r, actions: i, openRef: a, testId: o }) => {
17
+ let s = f(), c = `${s}-title`, l = `${s}-details`;
18
+ return /* @__PURE__ */ b("div", {
19
+ className: ae(e),
20
+ "data-testid": o,
21
+ children: [/* @__PURE__ */ b("div", {
22
+ className: "flex items-center justify-between",
23
+ children: [/* @__PURE__ */ y("button", {
24
+ ref: a,
25
+ type: "button",
26
+ onClick: n,
27
+ "aria-current": e ? "true" : void 0,
28
+ "aria-describedby": l,
29
+ className: "flex-1 min-w-0 text-left cursor-pointer focus:outline-none after:absolute after:inset-0 focus-visible:after:outline-2 focus-visible:after:outline-solid focus-visible:after:-outline-offset-2 focus-visible:after:outline-[var(--color-focus-ring)]",
30
+ "data-testid": "open-conversation",
31
+ children: /* @__PURE__ */ y("span", {
32
+ id: c,
33
+ className: "block text-xs font-medium text-text-primary truncate",
34
+ children: t
35
+ })
36
+ }), /* @__PURE__ */ y("div", {
37
+ className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only",
38
+ children: /* @__PURE__ */ y("div", {
39
+ className: "relative z-10 flex items-center gap-0.5 ml-1",
40
+ children: i.map((e) => /* @__PURE__ */ y("button", {
41
+ type: "button",
42
+ onClick: e.onActivate,
43
+ className: "p-0.5 hover:bg-bg-sunken rounded",
44
+ "aria-label": e.label,
45
+ "aria-describedby": c,
46
+ "data-testid": e.testId,
47
+ children: e.icon
48
+ }, e.label))
49
+ })
50
+ })]
51
+ }), /* @__PURE__ */ y("div", {
52
+ id: l,
53
+ children: r
54
+ })]
55
+ });
56
+ }, oe = (e, t) => {
57
+ let n = [];
58
+ for (let r = 1; r < e.length; r += 1) {
59
+ let i = e[t + r], a = t - r >= 0 ? e[t - r] : void 0;
60
+ i !== void 0 && n.push(i), a !== void 0 && n.push(a);
61
+ }
62
+ return n;
63
+ }, S = () => {
64
+ let f = t(), { modes: S } = e(), { conversations: C, activeConversationId: w, processingByConversationId: se, setActiveConversation: ce, setMode: le, createConversation: ue, deleteConversation: de, renameConversation: fe, setConversationListOpen: T } = r(), [E, D] = g(null), [O, k] = g(""), A = c((e) => e.product !== null), j = c((e) => e.scopeKey), M = c((e) => e.loadingIds), N = c((e) => e.olderHeaders), pe = c((e) => e.unsavedDelete !== void 0), P = l((e) => j === null ? void 0 : e.scopes[j]), F = l((e) => e.tombstones), I = m(() => A ? s({
65
+ conversations: C,
66
+ scopeKey: j,
67
+ headers: P?.headers ?? {},
68
+ olderHeaders: N && N.scopeKey === j ? N.headers : void 0,
69
+ tombstones: F,
70
+ loadingIds: M
71
+ }) : null, [
72
+ A,
73
+ C,
74
+ j,
75
+ P,
76
+ N,
77
+ F,
78
+ M
79
+ ]), L = N && N.scopeKey === j ? N.hasMore : P?.hasOlderHeaders === !0, R = m(() => I ? [...I.workspace.map((e) => e.key), ...I.device.map((e) => e.id)] : C.map((e) => e.id), [I, C]);
80
+ d(() => {
81
+ A && u.notePanelOpened();
82
+ }, [A]);
83
+ let z = () => {
84
+ ue(), T(!1);
85
+ }, B = (e) => {
86
+ if (A) {
87
+ u.openConversation(e, { modes: S }), T(!1);
88
+ return;
89
+ }
90
+ let t = C.find((t) => t.id === e);
91
+ ce(e), t && le(t.mode), T(!1);
92
+ }, V = h(/* @__PURE__ */ new Map()), H = (e) => (t) => {
93
+ t ? V.current.set(e, t) : V.current.delete(e);
94
+ }, U = h(null), W = h(null), G = h(null), K = h(null), me = (e, t) => {
95
+ D(e), k(t);
96
+ }, q = () => {
97
+ E && O.trim() && fe(E, O.trim()), E && (U.current = {
98
+ kind: "renamed",
99
+ key: E
100
+ }), D(null);
101
+ }, J = (e) => {
102
+ U.current = {
103
+ kind: "deleted",
104
+ key: e,
105
+ before: R
106
+ }, A ? u.deleteConversation(e) : de(e);
107
+ }, Y = f("history.untitled", "Untitled conversation"), X = (e, t) => {
108
+ let r = e.id === w, a = e.id === E, o = S.find((t) => t.id === e.mode), s = n(e.messages), c = s[s.length - 1], l = s.length === 0 && e.messages.length > 0, u = se[e.id], d = c ? i(c, u, f).text.slice(0, 60) : "";
109
+ return a ? /* @__PURE__ */ y("div", {
110
+ className: ae(r),
111
+ children: /* @__PURE__ */ b("div", {
112
+ className: "flex items-center gap-1",
113
+ children: [/* @__PURE__ */ y("input", {
114
+ ref: W,
115
+ "aria-label": f("conversations.renameLabel", "Conversation title"),
116
+ value: O,
117
+ onChange: (e) => k(e.target.value),
118
+ onKeyDown: (t) => {
119
+ t.key === "Enter" && (t.preventDefault(), q()), t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), D(null), U.current = {
120
+ kind: "renamed",
121
+ key: e.id
122
+ });
123
+ },
124
+ className: "flex-1 text-xs bg-bg-sunken border border-border-default rounded px-2 py-1 text-text-primary focus:outline-none focus:border-action-primary-bg"
125
+ }), /* @__PURE__ */ y("button", {
126
+ type: "button",
127
+ onClick: q,
128
+ className: "p-1 hover:bg-bg-sunken rounded",
129
+ "aria-label": f("conversations.saveTitle", "Save title"),
130
+ children: /* @__PURE__ */ y(ee, { className: "size-3 text-status-success-text" })
131
+ })]
132
+ })
133
+ }, e.id) : /* @__PURE__ */ y(x, {
134
+ active: r,
135
+ title: (t ? t.title : e.title) || Y,
136
+ onOpen: () => B(e.id),
137
+ openRef: H(e.id),
138
+ actions: [{
139
+ label: f("conversations.rename", "Rename conversation"),
140
+ icon: /* @__PURE__ */ y(re, { className: "size-3 text-text-muted" }),
141
+ onActivate: () => me(e.id, e.title)
142
+ }, {
143
+ label: f("conversations.delete", "Delete conversation"),
144
+ icon: /* @__PURE__ */ y(_, { className: "size-3 text-status-error-text" }),
145
+ onActivate: () => J(e.id),
146
+ testId: "delete-conversation"
147
+ }],
148
+ details: /* @__PURE__ */ b(v, { children: [
149
+ /* @__PURE__ */ b("div", {
150
+ className: "flex items-center gap-1.5 mt-0.5",
151
+ children: [
152
+ /* @__PURE__ */ y("span", {
153
+ className: "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded",
154
+ children: o?.label ?? e.mode
155
+ }),
156
+ /* @__PURE__ */ b("span", {
157
+ className: "text-[10px] text-text-muted",
158
+ children: [s.length, " msgs"]
159
+ }),
160
+ u && u.status !== "idle" && /* @__PURE__ */ y("span", {
161
+ className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
162
+ children: u.status
163
+ }),
164
+ t?.badges
165
+ ]
166
+ }),
167
+ t?.note,
168
+ d && /* @__PURE__ */ y("p", {
169
+ className: "text-[10px] text-text-muted truncate mt-0.5",
170
+ children: d
171
+ }),
172
+ l && /* @__PURE__ */ y("p", {
173
+ className: "text-[10px] text-text-muted truncate mt-0.5",
174
+ children: f("conversationList.voiceOnly", "Spoken conversation")
175
+ })
176
+ ] })
177
+ }, e.id);
178
+ }, Z = (e) => e.blocked === "quota" ? f("history.notSavedQuota", "Not saved yet: this workspace has reached its conversation limit. It will be saved when there is room.") : e.blocked === "invalid" ? f("history.notSavedInvalid", "Part of this conversation couldn't be saved. It stays on this device.") : e.blocked === "scope" ? f("history.notSavedScope", "Some turns were sent from another workspace. They stay on this device.") : null, he = (e) => {
179
+ let t = "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded", n = Z(e);
180
+ return /* @__PURE__ */ b(v, { children: [
181
+ e.legacy ? /* @__PURE__ */ y("span", {
182
+ className: t,
183
+ "data-testid": "history-badge-read-only",
184
+ children: f("history.badgeReadOnly", "Read-only")
185
+ }) : null,
186
+ n === null ? null : /* @__PURE__ */ y("span", {
187
+ className: t,
188
+ "data-testid": "history-badge-not-saved",
189
+ children: f("history.badgeNotSaved", "Not saved")
190
+ }),
191
+ e.loading ? /* @__PURE__ */ y("span", {
192
+ className: t,
193
+ "data-testid": "history-badge-loading",
194
+ children: f("history.badgeLoading", "Loading…")
195
+ }) : null
196
+ ] });
197
+ }, ge = (e) => {
198
+ let t = Z(e);
199
+ return t === null ? null : /* @__PURE__ */ y("p", {
200
+ className: "text-[10px] text-text-muted break-words mt-0.5",
201
+ "data-testid": "history-not-saved-reason",
202
+ children: t
203
+ });
204
+ }, _e = (e) => /* @__PURE__ */ y(x, {
205
+ active: e.key === w,
206
+ title: e.title || Y,
207
+ onOpen: () => B(e.key),
208
+ openRef: H(e.key),
209
+ actions: [{
210
+ label: f("conversations.delete", "Delete conversation"),
211
+ icon: /* @__PURE__ */ y(_, { className: "size-3 text-status-error-text" }),
212
+ onActivate: () => J(e.key),
213
+ testId: "delete-conversation"
214
+ }],
215
+ details: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
216
+ className: "flex items-center gap-1.5 mt-0.5",
217
+ children: he(e)
218
+ }), ge(e)] }),
219
+ testId: "history-server-row"
220
+ }, e.key), Q = (e) => /* @__PURE__ */ y("h3", {
221
+ className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",
222
+ children: e
223
+ }), ve = I ? I.workspace.length === 0 && I.device.length === 0 && !L : C.length === 0, $ = a("assistant-open-history");
224
+ return p(() => {
225
+ E !== null && W.current?.focus({ preventScroll: !0 });
226
+ }, [E]), p(() => {
227
+ let e = U.current;
228
+ if (!e || (e.kind === "deleted" ? R.includes(e.key) : e.kind === "renamed" ? E === e.key : L)) return;
229
+ U.current = null;
230
+ let t = document.activeElement;
231
+ if (t && t !== document.body) return;
232
+ let n;
233
+ if (e.kind === "renamed") n = [e.key];
234
+ else if (e.kind === "deleted") n = [...oe(e.before, e.before.indexOf(e.key)), ...R];
235
+ else {
236
+ let t = N && N.scopeKey === j ? N.headers : {}, r = new Set(e.before), i = I?.workspace ?? [];
237
+ n = [
238
+ ...R.filter((e) => !r.has(e) && e in t),
239
+ i[i.length - 1]?.key,
240
+ ...R
241
+ ];
242
+ }
243
+ (n.map((e) => e === void 0 ? void 0 : e === E ? W.current ?? void 0 : V.current.get(e)).find((e) => e !== void 0) ?? G.current ?? K.current ?? $.current)?.focus({ preventScroll: !0 });
244
+ }, [
245
+ R,
246
+ E,
247
+ L,
248
+ N,
249
+ j,
250
+ I,
251
+ $
252
+ ]), /* @__PURE__ */ b("div", {
253
+ ref: $,
26
254
  tabIndex: -1,
27
255
  role: "region",
28
- "aria-label": g("conversations.title", "History"),
256
+ "aria-label": f("conversations.title", "History"),
29
257
  className: "absolute inset-0 z-10 flex flex-col bg-bg-surface outline-none animate-in slide-in-from-left-2 fade-in duration-200",
30
258
  "data-testid": "conversation-list",
31
- children: [/* @__PURE__ */ h("div", {
32
- className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
33
- children: [/* @__PURE__ */ m("span", {
34
- className: "text-[13px] font-semibold text-text-primary",
35
- children: g("conversations.title", "History")
36
- }), /* @__PURE__ */ h("div", {
37
- className: "flex items-center gap-0.5",
38
- children: [/* @__PURE__ */ m("button", {
39
- type: "button",
40
- onClick: j,
41
- className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
42
- "aria-label": g("conversations.new", "New conversation"),
43
- "data-testid": "new-conversation",
44
- children: /* @__PURE__ */ m(d, { className: "size-4" })
45
- }), /* @__PURE__ */ h("button", {
46
- type: "button",
47
- onClick: () => E(!1),
48
- className: "flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
49
- "aria-label": g("conversations.collapse", "Collapse history"),
50
- "data-testid": "collapse-conversation-list",
51
- children: [/* @__PURE__ */ m(l, { className: "size-4" }), /* @__PURE__ */ m("span", {
52
- className: "text-[11px] font-medium",
53
- children: g("conversations.collapseLabel", "Collapse")
259
+ children: [
260
+ /* @__PURE__ */ b("div", {
261
+ className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
262
+ children: [/* @__PURE__ */ y("span", {
263
+ className: "text-[13px] font-semibold text-text-primary",
264
+ children: f("conversations.title", "History")
265
+ }), /* @__PURE__ */ b("div", {
266
+ className: "flex items-center gap-0.5",
267
+ children: [/* @__PURE__ */ y("button", {
268
+ type: "button",
269
+ onClick: z,
270
+ className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
271
+ "aria-label": f("conversations.new", "New conversation"),
272
+ "data-testid": "new-conversation",
273
+ children: /* @__PURE__ */ y(ie, { className: "size-4" })
274
+ }), /* @__PURE__ */ b("button", {
275
+ type: "button",
276
+ onClick: () => T(!1),
277
+ className: "flex items-center gap-1 px-2 py-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
278
+ "aria-label": f("conversations.collapse", "Collapse history"),
279
+ "data-testid": "collapse-conversation-list",
280
+ children: [/* @__PURE__ */ y(ne, { className: "size-4" }), /* @__PURE__ */ y("span", {
281
+ className: "text-[11px] font-medium",
282
+ children: f("conversations.collapseLabel", "Collapse")
283
+ })]
54
284
  })]
55
285
  })]
56
- })]
57
- }), /* @__PURE__ */ m("div", {
58
- className: "scrollbar-slim flex-1 overflow-y-auto",
59
- children: v.length === 0 ? /* @__PURE__ */ h("div", {
60
- className: "flex flex-col items-center justify-center h-full text-center px-4",
61
- children: [
62
- /* @__PURE__ */ m(c, { className: "size-6 text-text-muted mb-2" }),
63
- /* @__PURE__ */ m("p", {
64
- className: "text-xs text-text-muted",
65
- children: g("conversations.empty", "No conversations yet")
66
- }),
67
- /* @__PURE__ */ m("button", {
68
- type: "button",
69
- onClick: j,
70
- className: "mt-2 text-xs text-action-primary-bg hover:underline",
71
- children: g("conversations.startNew", "Start a new conversation")
72
- })
73
- ]
74
- }) : /* @__PURE__ */ m("div", {
75
- className: "py-1",
76
- children: v.map((e) => {
77
- let t = e.id === y, r = e.id === D, a = _.find((t) => t.id === e.mode), o = n(e.messages), c = o[o.length - 1], l = o.length === 0 && e.messages.length > 0, d = b[e.id], v = c ? i(c, d, g).text.slice(0, 60) : "";
78
- return /* @__PURE__ */ m("div", {
79
- role: "button",
80
- tabIndex: 0,
81
- onKeyDown: (t) => {
82
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), !r && M(e.id));
83
- },
84
- onClick: () => !r && M(e.id),
85
- className: `group px-3 py-2 cursor-pointer hover:bg-bg-elevated transition-colors ${t ? "bg-bg-elevated border-l-2 border-action-primary-bg" : ""}`,
86
- children: r ? /* @__PURE__ */ h("div", {
87
- className: "flex items-center gap-1",
88
- children: [/* @__PURE__ */ m("input", {
89
- "aria-label": g("conversations.renameLabel", "Conversation title"),
90
- value: k,
91
- onChange: (e) => A(e.target.value),
92
- onKeyDown: (e) => {
93
- e.key === "Enter" && P(), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), O(null));
94
- },
95
- className: "flex-1 text-xs bg-bg-sunken border border-border-default rounded px-2 py-1 text-text-primary focus:outline-none focus:border-action-primary-bg",
96
- onClick: (e) => e.stopPropagation()
97
- }), /* @__PURE__ */ m("button", {
286
+ }),
287
+ A && pe ? /* @__PURE__ */ y(o, {}) : null,
288
+ /* @__PURE__ */ y("div", {
289
+ className: "scrollbar-slim flex-1 overflow-y-auto",
290
+ children: ve ? /* @__PURE__ */ b("div", {
291
+ className: "flex flex-col items-center justify-center h-full text-center px-4",
292
+ children: [
293
+ /* @__PURE__ */ y(te, { className: "size-6 text-text-muted mb-2" }),
294
+ /* @__PURE__ */ y("p", {
295
+ className: "text-xs text-text-muted",
296
+ children: f("conversations.empty", "No conversations yet")
297
+ }),
298
+ /* @__PURE__ */ y("button", {
299
+ ref: K,
300
+ type: "button",
301
+ onClick: z,
302
+ className: "mt-2 text-xs text-action-primary-bg hover:underline",
303
+ children: f("conversations.startNew", "Start a new conversation")
304
+ })
305
+ ]
306
+ }) : I ? /* @__PURE__ */ b("div", {
307
+ className: "py-1",
308
+ children: [I.workspace.length > 0 || L ? /* @__PURE__ */ b("section", {
309
+ "data-testid": "history-group-workspace",
310
+ children: [
311
+ Q(f("history.groupWorkspace", "This workspace")),
312
+ I.workspace.map((e) => e.conversation ? X(e.conversation, {
313
+ title: e.title || Y,
314
+ badges: he(e),
315
+ note: ge(e)
316
+ }) : _e(e)),
317
+ L ? /* @__PURE__ */ y("button", {
318
+ ref: G,
98
319
  type: "button",
99
- onClick: (e) => {
100
- e.stopPropagation(), P();
320
+ onClick: () => {
321
+ U.current = {
322
+ kind: "older",
323
+ before: R
324
+ }, u.loadOlderHeaders();
101
325
  },
102
- className: "p-1 hover:bg-bg-sunken rounded",
103
- "aria-label": g("conversations.saveTitle", "Save title"),
104
- children: /* @__PURE__ */ m(s, { className: "size-3 text-status-success-text" })
105
- })]
106
- }) : /* @__PURE__ */ h(p, { children: [
107
- /* @__PURE__ */ h("div", {
108
- className: "flex items-center justify-between",
109
- children: [/* @__PURE__ */ m("span", {
110
- className: "text-xs font-medium text-text-primary truncate flex-1",
111
- children: e.title
112
- }), /* @__PURE__ */ h("div", {
113
- className: "hidden group-hover:flex group-focus-within:flex items-center gap-0.5 ml-1",
114
- children: [/* @__PURE__ */ m("button", {
115
- type: "button",
116
- onClick: (t) => {
117
- t.stopPropagation(), N(e.id, e.title);
118
- },
119
- className: "p-0.5 hover:bg-bg-sunken rounded",
120
- "aria-label": g("conversations.rename", "Rename conversation"),
121
- children: /* @__PURE__ */ m(u, { className: "size-3 text-text-muted" })
122
- }), /* @__PURE__ */ m("button", {
123
- type: "button",
124
- onClick: (t) => F(t, e.id),
125
- className: "p-0.5 hover:bg-bg-sunken rounded",
126
- "aria-label": g("conversations.delete", "Delete conversation"),
127
- "data-testid": "delete-conversation",
128
- children: /* @__PURE__ */ m(f, { className: "size-3 text-status-error-text" })
129
- })]
130
- })]
131
- }),
132
- /* @__PURE__ */ h("div", {
133
- className: "flex items-center gap-1.5 mt-0.5",
134
- children: [
135
- /* @__PURE__ */ m("span", {
136
- className: "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded",
137
- children: a?.label ?? e.mode
138
- }),
139
- /* @__PURE__ */ h("span", {
140
- className: "text-[10px] text-text-muted",
141
- children: [o.length, " msgs"]
142
- }),
143
- d && d.status !== "idle" && /* @__PURE__ */ m("span", {
144
- className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
145
- children: d.status
146
- })
147
- ]
148
- }),
149
- v && /* @__PURE__ */ m("p", {
150
- className: "text-[10px] text-text-muted truncate mt-0.5",
151
- children: v
152
- }),
153
- l && /* @__PURE__ */ m("p", {
154
- className: "text-[10px] text-text-muted truncate mt-0.5",
155
- children: g("conversationList.voiceOnly", "Spoken conversation")
156
- })
157
- ] })
158
- }, e.id);
326
+ className: "mx-3 my-1 text-xs text-action-primary-bg hover:underline",
327
+ "data-testid": "history-show-older",
328
+ children: f("history.showOlder", "Show older conversations")
329
+ }) : null
330
+ ]
331
+ }) : null, I.device.length > 0 ? /* @__PURE__ */ b("section", {
332
+ "data-testid": "history-group-device",
333
+ children: [Q(f("history.groupDevice", "On this device")), I.device.map((e) => X(e))]
334
+ }) : null]
335
+ }) : /* @__PURE__ */ y("div", {
336
+ className: "py-1",
337
+ children: C.map((e) => X(e))
159
338
  })
160
339
  })
161
- })]
340
+ ]
162
341
  });
163
342
  };
164
343
  //#endregion
165
- export { g as AssistantConversationList };
344
+ export { S as AssistantConversationList };
@@ -0,0 +1,36 @@
1
+ import { FC } from 'react';
2
+ /**
3
+ * The open conversation's messages: loading, or the load failed. `compact` is
4
+ * the line above the composer, for a conversation that already shows messages;
5
+ * otherwise it fills the empty thread.
6
+ */
7
+ export declare const AssistantHistoryLoadState: FC<{
8
+ state: "loading" | "failed";
9
+ onRetry: () => void;
10
+ compact?: boolean;
11
+ }>;
12
+ /** Older messages of this conversation exist on the server than are shown. */
13
+ export declare const AssistantHistoryShowEarlier: FC<{
14
+ onShowEarlier: () => void;
15
+ disabled?: boolean;
16
+ }>;
17
+ /**
18
+ * A conversation saved before server history. It can be read and deleted,
19
+ * never continued — the composer below it is disabled — so the one action
20
+ * offered is a new conversation.
21
+ */
22
+ export declare const AssistantHistoryReadOnlyBanner: FC<{
23
+ onStartNew: () => void;
24
+ }>;
25
+ /** The conversation open here was deleted on another device (or in another tab). */
26
+ export declare const AssistantHistoryDeletedNotice: FC<{
27
+ onDismiss: () => void;
28
+ }>;
29
+ /**
30
+ * A delete made here is not saved on this device yet: the browser refused the
31
+ * write (its storage is full) and the server has not confirmed the delete. A
32
+ * reload now would bring the conversation back, so this stays until either
33
+ * happens — it is not dismissible, because it is not over until then.
34
+ */
35
+ export declare const AssistantHistoryUnsavedDeleteNotice: FC;
36
+ //# sourceMappingURL=AssistantHistoryNotices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssistantHistoryNotices.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantHistoryNotices.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC;IACzC,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAkCA,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC;IAC3C,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAcA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CA4BzE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,6BAA6B,EAAE,EAAE,CAAC;IAAE,SAAS,EAAE,MAAM,IAAI,CAAA;CAAE,CA4BvE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,EAiBjD,CAAC"}