@burdenoff/fe-libs 2026.1001.1 → 2026.1001.3

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 (54) hide show
  1. package/dist/connections/api.d.ts.map +1 -1
  2. package/dist/connections/api.js +4 -3
  3. package/dist/connections/oauthPopup.d.ts.map +1 -1
  4. package/dist/connections/oauthPopup.js +8 -9
  5. package/dist/shared/assistant/conversationDeleteCommand.d.ts +31 -0
  6. package/dist/shared/assistant/conversationDeleteCommand.d.ts.map +1 -0
  7. package/dist/shared/assistant/conversationDeleteCommand.js +14 -0
  8. package/dist/shared/assistant/history/historyControls.d.ts +9 -0
  9. package/dist/shared/assistant/history/historyControls.d.ts.map +1 -1
  10. package/dist/shared/assistant/history/historyControls.js +7 -1
  11. package/dist/shared/assistant/history/historyList.d.ts +10 -0
  12. package/dist/shared/assistant/history/historyList.d.ts.map +1 -1
  13. package/dist/shared/assistant/history/historyList.js +33 -28
  14. package/dist/shared/assistant/history/useHistoryRowControls.d.ts +13 -0
  15. package/dist/shared/assistant/history/useHistoryRowControls.d.ts.map +1 -0
  16. package/dist/shared/assistant/history/useHistoryRowControls.js +24 -0
  17. package/dist/shared/assistant/i18nManifest.d.ts +36 -0
  18. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  19. package/dist/shared/assistant/i18nManifest.js +36 -0
  20. package/dist/shared/assistant/index.d.ts +6 -0
  21. package/dist/shared/assistant/index.d.ts.map +1 -1
  22. package/dist/shared/assistant/localUiCommands.d.ts +8 -0
  23. package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
  24. package/dist/shared/assistant/localUiCommands.js +20 -19
  25. package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
  26. package/dist/shared/assistant/ui/AIAssistantPanel.js +67 -66
  27. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  28. package/dist/shared/assistant/ui/AssistantChatArea.js +854 -809
  29. package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts +12 -0
  30. package/dist/shared/assistant/ui/AssistantConversationFilters.d.ts.map +1 -0
  31. package/dist/shared/assistant/ui/AssistantConversationFilters.js +92 -0
  32. package/dist/shared/assistant/ui/AssistantConversationList.d.ts +9 -0
  33. package/dist/shared/assistant/ui/AssistantConversationList.d.ts.map +1 -1
  34. package/dist/shared/assistant/ui/AssistantConversationList.js +314 -214
  35. package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.d.ts +59 -0
  36. package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.d.ts.map +1 -0
  37. package/dist/shared/assistant/ui/AssistantDeleteConversationDialog.js +84 -0
  38. package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts +18 -0
  39. package/dist/shared/assistant/ui/AssistantHistoryNotices.d.ts.map +1 -1
  40. package/dist/shared/assistant/ui/AssistantHistoryNotices.js +76 -29
  41. package/dist/shared/assistant/ui/conversationDelete.d.ts +18 -0
  42. package/dist/shared/assistant/ui/conversationDelete.d.ts.map +1 -0
  43. package/dist/shared/assistant/ui/conversationDelete.js +16 -0
  44. package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts +32 -0
  45. package/dist/shared/assistant/ui/conversationDeleteDialog.d.ts.map +1 -0
  46. package/dist/shared/assistant/ui/conversationDeleteDialog.js +54 -0
  47. package/dist/shared/assistant/ui/useVoiceSession.d.ts +5 -0
  48. package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
  49. package/dist/shared/assistant/ui/useVoiceSession.js +129 -121
  50. package/dist/shared/assistant/voice/voiceSession.d.ts +10 -0
  51. package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
  52. package/dist/shared/assistant/voice/voiceSession.js +6 -0
  53. package/dist/shared-assistant.js +170 -164
  54. package/package.json +1 -1
@@ -1,344 +1,444 @@
1
1
  import { useAssistantProduct as e } from "../product.js";
2
2
  import { useAssistantTr as t } from "../i18n.js";
3
- import { useAssistantStore as n } from "../store.js";
4
- import { chatTurns as r } from "../voice/turnVisibility.js";
5
- import { getAssistantDisplayContent as i } from "../displayContent.js";
6
- import { useOverlayFocus as a } from "./useOverlayFocus.js";
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";
3
+ import { DEFAULT_HISTORY_LIST_FILTER as n, clampToCodePoints as r, codePointLength as i, historyFilterEmptyKind as a, historyFilterKey as o } from "../history/historyControls.js";
4
+ import { useAssistantStore as s } from "../store.js";
5
+ import { chatTurns as c, voiceTurnsOnly as l } from "../voice/turnVisibility.js";
6
+ import { getAssistantDisplayContent as u } from "../displayContent.js";
7
+ import { useOverlayFocus as d } from "./useOverlayFocus.js";
8
+ import { AssistantHistoryPinLimitBanner as f, AssistantHistoryUnsavedDeleteNotice as p } from "./AssistantHistoryNotices.js";
9
+ import { historyRowAcceptsControls as ee, selectAssistantHistoryList as te } from "../history/historyList.js";
10
+ import { useAssistantHistoryStatus as m } from "../history/historyStatus.js";
11
+ import { useAssistantHistoryStore as h } from "../history/historyStore.js";
12
+ import { assistantHistory as g } from "../history/historyEngine.js";
13
+ import { AssistantConversationFilters as ne } from "./AssistantConversationFilters.js";
14
+ import { useEffect as re, useId as ie, useLayoutEffect as ae, useMemo as oe, useRef as _, useState as v } from "react";
15
+ import { Archive as y, ArchiveRestore as se, Check as ce, MessageSquare as le, PanelLeftClose as ue, Pencil as de, Pin as fe, PinOff as pe, Plus as me, Trash2 as he } from "lucide-react";
16
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
15
17
  //#region src/shared/assistant/ui/AssistantConversationList.tsx
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", {
18
+ var ge = {
19
+ channel: "ANY",
20
+ pinned: null,
21
+ archived: "INCLUDE"
22
+ }, _e = (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" : ""}`, ve = ({ active: e, title: t, onOpen: n, details: r, actions: i, openRef: a, actionRef: o, testId: s }) => {
23
+ let c = ie(), l = `${c}-title`, u = `${c}-details`;
24
+ return /* @__PURE__ */ S("div", {
25
+ className: _e(e),
26
+ "data-testid": s,
27
+ children: [/* @__PURE__ */ S("div", {
22
28
  className: "flex items-center justify-between",
23
- children: [/* @__PURE__ */ y("button", {
29
+ children: [/* @__PURE__ */ x("button", {
24
30
  ref: a,
25
31
  type: "button",
26
32
  onClick: n,
27
33
  "aria-current": e ? "true" : void 0,
28
- "aria-describedby": l,
34
+ "aria-describedby": u,
29
35
  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
36
  "data-testid": "open-conversation",
31
- children: /* @__PURE__ */ y("span", {
32
- id: c,
37
+ children: /* @__PURE__ */ x("span", {
38
+ id: l,
33
39
  className: "block text-xs font-medium text-text-primary truncate",
34
40
  children: t
35
41
  })
36
- }), /* @__PURE__ */ y("div", {
37
- className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only",
38
- children: /* @__PURE__ */ y("div", {
42
+ }), /* @__PURE__ */ x("div", {
43
+ className: "sr-only group-hover:not-sr-only group-focus-within:not-sr-only [@media(pointer:coarse)]:not-sr-only",
44
+ children: /* @__PURE__ */ x("div", {
39
45
  className: "relative z-10 flex items-center gap-0.5 ml-1",
40
- children: i.map((e) => /* @__PURE__ */ y("button", {
46
+ children: i.map((e) => /* @__PURE__ */ x("button", {
47
+ ref: o(e.id),
41
48
  type: "button",
42
49
  onClick: e.onActivate,
43
- className: "p-0.5 hover:bg-bg-sunken rounded",
50
+ className: "p-0.5 [@media(pointer:coarse)]:p-1.5 hover:bg-bg-sunken rounded",
44
51
  "aria-label": e.label,
45
- "aria-describedby": c,
52
+ "aria-describedby": l,
46
53
  "data-testid": e.testId,
47
54
  children: e.icon
48
- }, e.label))
55
+ }, e.id))
49
56
  })
50
57
  })]
51
- }), /* @__PURE__ */ y("div", {
52
- id: l,
58
+ }), /* @__PURE__ */ x("div", {
59
+ id: u,
53
60
  children: r
54
61
  })]
55
62
  });
56
- }, oe = (e, t) => {
63
+ }, ye = (e, t) => {
57
64
  let n = [];
58
65
  for (let r = 1; r < e.length; r += 1) {
59
66
  let i = e[t + r], a = t - r >= 0 ? e[t - r] : void 0;
60
67
  i !== void 0 && n.push(i), a !== void 0 && n.push(a);
61
68
  }
62
69
  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 } = n(), [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,
70
+ }, C = () => {
71
+ let C = t(), { modes: be } = e(), { conversations: w, activeConversationId: T, processingByConversationId: xe, setActiveConversation: Se, setMode: Ce, createConversation: we, deleteConversation: Te, renameConversation: Ee, setConversationListOpen: E } = s(), [D, O] = v(null), [k, A] = v(""), [j, M] = v(!1), De = ie(), N = m((e) => e.product !== null), P = m((e) => e.scopeKey), F = m((e) => e.loadingIds), I = m((e) => e.olderHeaders), Oe = m((e) => e.unsavedDelete !== void 0), ke = m((e) => e.controlsAvailable), L = N && ke, Ae = m((e) => e.pinLimit), R = h((e) => P === null ? void 0 : e.scopes[P]), je = h((e) => e.tombstones), z = h((e) => e.outbox), [B, Me] = v(n), [Ne, Pe] = v(!1), Fe = L ? B : ge, Ie = (e) => {
72
+ Me(e), Pe(!0);
73
+ }, V = oe(() => N ? te({
74
+ conversations: w,
75
+ scopeKey: P,
76
+ headers: R?.headers ?? {},
77
+ olderHeaders: I && I.scopeKey === P ? I.headers : void 0,
78
+ tombstones: je,
79
+ loadingIds: F,
80
+ outbox: z
81
+ }, Fe) : null, [
76
82
  N,
83
+ w,
84
+ P,
85
+ R,
86
+ I,
87
+ je,
77
88
  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);
89
+ z,
90
+ Fe
91
+ ]), Le = L ? B : void 0, Re = o(Le), H = I && I.scopeKey === P ? I : void 0, U = H ? H.filterKey === Re ? H.hasMore : !0 : R?.hasOlderHeaders === !0, W = oe(() => V ? [...V.workspace.map((e) => e.key), ...V.device.map((e) => e.id)] : w.map((e) => e.id), [V, w]);
92
+ re(() => {
93
+ N && g.notePanelOpened();
94
+ }, [N]);
95
+ let ze = () => {
96
+ we(), E(!1);
97
+ }, Be = (e) => {
98
+ if (N) {
99
+ g.openConversation(e, { modes: be }), E(!1);
88
100
  return;
89
101
  }
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 = {
102
+ let t = w.find((t) => t.id === e);
103
+ Se(e), t && Ce(t.mode), E(!1);
104
+ }, G = _(/* @__PURE__ */ new Map()), Ve = (e) => (t) => {
105
+ t ? G.current.set(e, t) : G.current.delete(e);
106
+ }, K = _(/* @__PURE__ */ new Map()), He = (e) => (t) => (n) => {
107
+ let r = `${e}\u0000${t}`;
108
+ n ? K.current.set(r, n) : K.current.delete(r);
109
+ }, q = _(null), J = _(null), Ue = _(null), We = _(null), Ge = (e, t) => {
110
+ O(e), A(r(t, 80)), M(!1);
111
+ }, Ke = (e) => {
112
+ A(r(e, 80)), M(i(e) > 80);
113
+ }, qe = () => {
114
+ D && k.trim() && Ee(D, k), D && (q.current = {
98
115
  kind: "renamed",
99
- key: E
100
- }), D(null);
101
- }, J = (e) => {
102
- U.current = {
116
+ key: D
117
+ }), O(null), M(!1);
118
+ }, Je = (e) => {
119
+ q.current = {
103
120
  kind: "deleted",
104
121
  key: e,
105
- before: R
106
- }, A ? u.deleteConversation(e) : de(e);
107
- }, Y = f("history.untitled", "Untitled conversation"), X = (e, t) => {
108
- let n = e.id === w, a = e.id === E, o = S.find((t) => t.id === e.mode), s = r(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(n),
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, {
122
+ before: W
123
+ }, N ? g.deleteConversation(e) : Te(e);
124
+ }, Ye = (e, t, n) => {
125
+ q.current = {
126
+ kind: "control",
127
+ key: e,
128
+ control: t,
129
+ before: W
130
+ }, g.updateConversation(e, n) || (q.current = null);
131
+ }, Y = C("history.untitled", "Untitled conversation"), X = "text-[10px] text-text-muted px-1 py-0.5 bg-bg-sunken rounded", Xe = (e) => e === 1 ? C("conversationList.messageCountOne", "1 message") : C("conversationList.messageCount", "{{count}} messages", { count: e }), Ze = (e) => e === 1 ? C("conversationList.spokenCountOne", "1 spoken") : C("conversationList.spokenCount", "{{count}} spoken", { count: e }), Qe = (e, t) => /* @__PURE__ */ S("div", {
132
+ className: _e(t),
133
+ children: [/* @__PURE__ */ S("div", {
134
+ className: "flex items-center gap-1",
135
+ children: [/* @__PURE__ */ x("input", {
136
+ ref: J,
137
+ "aria-label": C("conversations.renameLabel", "Conversation title"),
138
+ "aria-describedby": j ? De : void 0,
139
+ value: k,
140
+ onChange: (e) => Ke(e.target.value),
141
+ onKeyDown: (t) => {
142
+ t.key === "Enter" && (t.preventDefault(), qe()), t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), O(null), M(!1), q.current = {
143
+ kind: "renamed",
144
+ key: e
145
+ });
146
+ },
147
+ 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"
148
+ }), /* @__PURE__ */ x("button", {
149
+ type: "button",
150
+ onClick: qe,
151
+ className: "p-1 hover:bg-bg-sunken rounded",
152
+ "aria-label": C("conversations.saveTitle", "Save title"),
153
+ children: /* @__PURE__ */ x(ce, { className: "size-3 text-status-success-text" })
154
+ })]
155
+ }), /* @__PURE__ */ x("p", {
156
+ id: De,
157
+ role: "status",
158
+ className: "text-[10px] text-text-muted",
159
+ children: j ? C("conversations.titleLimit", "Titles are up to {{limit}} characters", { limit: 80 }) : ""
160
+ })]
161
+ }, e), $e = (e) => {
162
+ let t = L && ee(e, z, P), n = e.pinnedAt !== null, r = e.archivedAt !== null, i = [];
163
+ return t && !r && i.push({
164
+ id: "pin",
165
+ label: n ? C("conversations.unpin", "Unpin conversation") : C("conversations.pin", "Pin conversation"),
166
+ icon: x(n ? pe : fe, { className: "size-3 text-text-muted" }),
167
+ onActivate: () => Ye(e.key, "pin", { pinned: !n }),
168
+ testId: "pin-conversation"
169
+ }), (e.conversation || t) && i.push({
170
+ id: "rename",
171
+ label: C("conversations.rename", "Rename conversation"),
172
+ icon: /* @__PURE__ */ x(de, { className: "size-3 text-text-muted" }),
173
+ onActivate: () => Ge(e.key, e.title),
174
+ testId: "rename-conversation"
175
+ }), t && i.push({
176
+ id: "archive",
177
+ label: r ? C("conversations.unarchive", "Unarchive conversation") : C("conversations.archive", "Archive conversation"),
178
+ icon: x(r ? se : y, { className: "size-3 text-text-muted" }),
179
+ onActivate: () => Ye(e.key, "archive", { archived: !r }),
180
+ testId: "archive-conversation"
181
+ }), i.push({
182
+ id: "delete",
183
+ label: C("conversations.delete", "Delete conversation"),
184
+ icon: /* @__PURE__ */ x(he, { className: "size-3 text-status-error-text" }),
185
+ onActivate: () => Je(e.key),
186
+ testId: "delete-conversation"
187
+ }), i;
188
+ }, et = (e) => [{
189
+ id: "rename",
190
+ label: C("conversations.rename", "Rename conversation"),
191
+ icon: /* @__PURE__ */ x(de, { className: "size-3 text-text-muted" }),
192
+ onActivate: () => Ge(e.id, e.title),
193
+ testId: "rename-conversation"
194
+ }, {
195
+ id: "delete",
196
+ label: C("conversations.delete", "Delete conversation"),
197
+ icon: /* @__PURE__ */ x(he, { className: "size-3 text-status-error-text" }),
198
+ onActivate: () => Je(e.id),
199
+ testId: "delete-conversation"
200
+ }], Z = (e, t) => {
201
+ let n = e.id === T, r = e.id === D, i = be.find((t) => t.id === e.mode), a = c(e.messages), o = l(e.messages), s = a[a.length - 1], d = a.length === 0 && e.messages.length > 0, f = xe[e.id], p = s ? u(s, f, C).text.slice(0, 60) : "";
202
+ return r ? Qe(e.id, n) : /* @__PURE__ */ x(ve, {
134
203
  active: n,
135
204
  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",
205
+ onOpen: () => Be(e.id),
206
+ openRef: Ve(e.id),
207
+ actionRef: He(e.id),
208
+ actions: t ? t.actions : et(e),
209
+ details: /* @__PURE__ */ S(b, { children: [
210
+ /* @__PURE__ */ S("div", {
211
+ className: "flex flex-wrap items-center gap-1.5 mt-0.5",
151
212
  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
213
+ /* @__PURE__ */ x("span", {
214
+ className: X,
215
+ children: i?.label ?? e.mode
155
216
  }),
156
- /* @__PURE__ */ b("span", {
217
+ /* @__PURE__ */ x("span", {
157
218
  className: "text-[10px] text-text-muted",
158
- children: [s.length, " msgs"]
219
+ children: Xe(a.length)
159
220
  }),
160
- u && u.status !== "idle" && /* @__PURE__ */ y("span", {
221
+ o.length > 0 ? /* @__PURE__ */ x("span", {
222
+ className: "text-[10px] text-text-muted",
223
+ "data-testid": "history-spoken-count",
224
+ children: Ze(o.length)
225
+ }) : null,
226
+ f && f.status !== "idle" && /* @__PURE__ */ x("span", {
161
227
  className: "text-[10px] text-action-primary-bg px-1 py-0.5 bg-bg-sunken rounded",
162
- children: u.status
228
+ children: f.status
163
229
  }),
164
230
  t?.badges
165
231
  ]
166
232
  }),
167
233
  t?.note,
168
- d && /* @__PURE__ */ y("p", {
234
+ p && /* @__PURE__ */ x("p", {
169
235
  className: "text-[10px] text-text-muted truncate mt-0.5",
170
- children: d
236
+ children: p
171
237
  }),
172
- l && /* @__PURE__ */ y("p", {
238
+ d && /* @__PURE__ */ x("p", {
173
239
  className: "text-[10px] text-text-muted truncate mt-0.5",
174
- children: f("conversationList.voiceOnly", "Spoken conversation")
240
+ children: C("conversationList.voiceOnly", "Spoken conversation")
175
241
  })
176
242
  ] })
177
243
  }, 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,
244
+ }, tt = (e) => e.blocked === "quota" ? C("history.notSavedQuota", "Not saved yet: this workspace has reached its conversation limit. It will be saved when there is room.") : e.blocked === "invalid" ? C("history.notSavedInvalid", "Part of this conversation couldn't be saved. It stays on this device.") : e.blocked === "scope" ? C("history.notSavedScope", "Some turns were sent from another workspace. They stay on this device.") : null, nt = (e) => {
245
+ let t = tt(e);
246
+ return /* @__PURE__ */ S(b, { children: [
247
+ e.channel === "VOICE" ? /* @__PURE__ */ x("span", {
248
+ className: X,
249
+ "data-testid": "history-badge-voice",
250
+ children: C("conversationList.badgeVoice", "Voice")
251
+ }) : e.channel === "MIXED" ? /* @__PURE__ */ x("span", {
252
+ className: X,
253
+ "data-testid": "history-badge-mixed",
254
+ children: C("conversationList.badgeMixed", "Chat + voice")
255
+ }) : null,
256
+ e.pinnedAt === null ? null : /* @__PURE__ */ S("span", {
257
+ className: `${X} inline-flex items-center gap-0.5`,
258
+ "data-testid": "history-badge-pinned",
259
+ children: [/* @__PURE__ */ x(fe, {
260
+ className: "size-2.5",
261
+ "aria-hidden": "true"
262
+ }), C("conversationList.badgePinned", "Pinned")]
263
+ }),
264
+ e.archivedAt === null ? null : /* @__PURE__ */ S("span", {
265
+ className: `${X} inline-flex items-center gap-0.5`,
266
+ "data-testid": "history-badge-archived",
267
+ children: [/* @__PURE__ */ x(y, {
268
+ className: "size-2.5",
269
+ "aria-hidden": "true"
270
+ }), C("conversationList.badgeArchived", "Archived")]
271
+ }),
272
+ e.legacy ? /* @__PURE__ */ x("span", {
273
+ className: X,
183
274
  "data-testid": "history-badge-read-only",
184
- children: f("history.badgeReadOnly", "Read-only")
275
+ children: C("history.badgeReadOnly", "Read-only")
185
276
  }) : null,
186
- n === null ? null : /* @__PURE__ */ y("span", {
187
- className: t,
277
+ t === null ? null : /* @__PURE__ */ x("span", {
278
+ className: X,
188
279
  "data-testid": "history-badge-not-saved",
189
- children: f("history.badgeNotSaved", "Not saved")
280
+ children: C("history.badgeNotSaved", "Not saved")
190
281
  }),
191
- e.loading ? /* @__PURE__ */ y("span", {
192
- className: t,
282
+ e.loading ? /* @__PURE__ */ x("span", {
283
+ className: X,
193
284
  "data-testid": "history-badge-loading",
194
- children: f("history.badgeLoading", "Loading…")
285
+ children: C("history.badgeLoading", "Loading…")
195
286
  }) : null
196
287
  ] });
197
- }, ge = (e) => {
198
- let t = Z(e);
199
- return t === null ? null : /* @__PURE__ */ y("p", {
288
+ }, rt = (e) => {
289
+ let t = tt(e);
290
+ return t === null ? null : /* @__PURE__ */ x("p", {
200
291
  className: "text-[10px] text-text-muted break-words mt-0.5",
201
292
  "data-testid": "history-not-saved-reason",
202
293
  children: t
203
294
  });
204
- }, _e = (e) => /* @__PURE__ */ y(x, {
205
- active: e.key === w,
295
+ }, it = (e) => e.key === D ? Qe(e.key, e.key === T) : /* @__PURE__ */ x(ve, {
296
+ active: e.key === T,
206
297
  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)] }),
298
+ onOpen: () => Be(e.key),
299
+ openRef: Ve(e.key),
300
+ actionRef: He(e.key),
301
+ actions: $e(e),
302
+ details: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
303
+ className: "flex flex-wrap items-center gap-1.5 mt-0.5",
304
+ children: nt(e)
305
+ }), rt(e)] }),
219
306
  testId: "history-server-row"
220
- }, e.key), Q = (e) => /* @__PURE__ */ y("h3", {
307
+ }, e.key), at = (e) => /* @__PURE__ */ x("h3", {
221
308
  className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-text-muted",
222
309
  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;
310
+ }), ot = V ? V.workspace.length + V.device.length : w.length, st = V ? ot === 0 && !U : w.length === 0, Q = L ? a(B) : null, ct = Q === "archived" ? C("conversationList.emptyArchived", "No archived conversations") : Q === "pinned" ? C("conversationList.emptyPinned", "No pinned conversations") : Q === "voice" ? C("conversationList.emptyVoice", "No voice conversations") : Q === "chat" ? C("conversationList.emptyChat", "No chat conversations") : C("conversations.empty", "No conversations yet"), $ = d("assistant-open-history");
311
+ return ae(() => {
312
+ D !== null && J.current?.focus({ preventScroll: !0 });
313
+ }, [D]), ae(() => {
314
+ let e = q.current;
315
+ if (!e || (e.kind === "deleted" ? W.includes(e.key) : e.kind === "renamed" ? D === e.key : e.kind !== "control" && U)) return;
316
+ q.current = null;
230
317
  let t = document.activeElement;
231
318
  if (t && t !== document.body) return;
232
- let n;
319
+ let n, r = e.kind === "control" && W.includes(e.key) ? K.current.get(`${e.key}\u0000${e.control}`) : void 0;
233
320
  if (e.kind === "renamed") n = [e.key];
234
- else if (e.kind === "deleted") n = [...oe(e.before, e.before.indexOf(e.key)), ...R];
321
+ else if (e.kind === "control") n = W.includes(e.key) ? [e.key] : [...ye(e.before, e.before.indexOf(e.key)), ...W];
322
+ else if (e.kind === "deleted") n = [...ye(e.before, e.before.indexOf(e.key)), ...W];
235
323
  else {
236
- let t = N && N.scopeKey === j ? N.headers : {}, r = new Set(e.before), i = I?.workspace ?? [];
324
+ let t = I && I.scopeKey === P ? I.headers : {}, r = new Set(e.before), i = V?.workspace ?? [];
237
325
  n = [
238
- ...R.filter((e) => !r.has(e) && e in t),
326
+ ...W.filter((e) => !r.has(e) && e in t),
239
327
  i[i.length - 1]?.key,
240
- ...R
328
+ ...W
241
329
  ];
242
330
  }
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 });
331
+ (r ?? n.map((e) => e === void 0 ? void 0 : e === D ? J.current ?? void 0 : G.current.get(e)).find((e) => e !== void 0) ?? Ue.current ?? We.current ?? $.current)?.focus({ preventScroll: !0 });
244
332
  }, [
245
- R,
246
- E,
247
- L,
248
- N,
249
- j,
333
+ W,
334
+ D,
335
+ U,
250
336
  I,
337
+ P,
338
+ V,
251
339
  $
252
- ]), /* @__PURE__ */ b("div", {
340
+ ]), /* @__PURE__ */ S("div", {
253
341
  ref: $,
254
342
  tabIndex: -1,
255
343
  role: "region",
256
- "aria-label": f("conversations.title", "History"),
344
+ "aria-label": C("conversations.title", "History"),
257
345
  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",
258
346
  "data-testid": "conversation-list",
259
347
  children: [
260
- /* @__PURE__ */ b("div", {
348
+ /* @__PURE__ */ S("div", {
261
349
  className: "flex items-center justify-between px-4 py-3 border-b border-border-default bg-bg-elevated",
262
- children: [/* @__PURE__ */ y("span", {
350
+ children: [/* @__PURE__ */ x("span", {
263
351
  className: "text-[13px] font-semibold text-text-primary",
264
- children: f("conversations.title", "History")
265
- }), /* @__PURE__ */ b("div", {
352
+ children: C("conversations.title", "History")
353
+ }), /* @__PURE__ */ S("div", {
266
354
  className: "flex items-center gap-0.5",
267
- children: [/* @__PURE__ */ y("button", {
355
+ children: [/* @__PURE__ */ x("button", {
268
356
  type: "button",
269
- onClick: z,
357
+ onClick: ze,
270
358
  className: "p-1.5 rounded-lg text-text-secondary hover:bg-bg-sunken transition-colors",
271
- "aria-label": f("conversations.new", "New conversation"),
359
+ "aria-label": C("conversations.new", "New conversation"),
272
360
  "data-testid": "new-conversation",
273
- children: /* @__PURE__ */ y(ie, { className: "size-4" })
274
- }), /* @__PURE__ */ b("button", {
361
+ children: /* @__PURE__ */ x(me, { className: "size-4" })
362
+ }), /* @__PURE__ */ S("button", {
275
363
  type: "button",
276
- onClick: () => T(!1),
364
+ onClick: () => E(!1),
277
365
  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"),
366
+ "aria-label": C("conversations.collapse", "Collapse history"),
279
367
  "data-testid": "collapse-conversation-list",
280
- children: [/* @__PURE__ */ y(ne, { className: "size-4" }), /* @__PURE__ */ y("span", {
368
+ children: [/* @__PURE__ */ x(ue, { className: "size-4" }), /* @__PURE__ */ x("span", {
281
369
  className: "text-[11px] font-medium",
282
- children: f("conversations.collapseLabel", "Collapse")
370
+ children: C("conversations.collapseLabel", "Collapse")
283
371
  })]
284
372
  })]
285
373
  })]
286
374
  }),
287
- A && pe ? /* @__PURE__ */ y(o, {}) : null,
288
- /* @__PURE__ */ y("div", {
375
+ N && Oe ? /* @__PURE__ */ x(p, {}) : null,
376
+ N && Ae ? /* @__PURE__ */ x(f, {
377
+ limit: Ae.limit,
378
+ onDismiss: () => m.getState().notePinLimit(void 0)
379
+ }) : null,
380
+ L ? /* @__PURE__ */ x(ne, {
381
+ filter: B,
382
+ onChange: Ie,
383
+ count: ot,
384
+ announce: Ne
385
+ }) : null,
386
+ /* @__PURE__ */ x("div", {
289
387
  className: "scrollbar-slim flex-1 overflow-y-auto",
290
- children: ve ? /* @__PURE__ */ b("div", {
388
+ children: st ? /* @__PURE__ */ S("div", {
291
389
  className: "flex flex-col items-center justify-center h-full text-center px-4",
390
+ "data-testid": "history-empty",
292
391
  children: [
293
- /* @__PURE__ */ y(te, { className: "size-6 text-text-muted mb-2" }),
294
- /* @__PURE__ */ y("p", {
392
+ /* @__PURE__ */ x(le, { className: "size-6 text-text-muted mb-2" }),
393
+ /* @__PURE__ */ x("p", {
295
394
  className: "text-xs text-text-muted",
296
- children: f("conversations.empty", "No conversations yet")
395
+ children: ct
297
396
  }),
298
- /* @__PURE__ */ y("button", {
299
- ref: K,
397
+ Q === null ? /* @__PURE__ */ x("button", {
398
+ ref: We,
300
399
  type: "button",
301
- onClick: z,
400
+ onClick: ze,
302
401
  className: "mt-2 text-xs text-action-primary-bg hover:underline",
303
- children: f("conversations.startNew", "Start a new conversation")
304
- })
402
+ children: C("conversations.startNew", "Start a new conversation")
403
+ }) : null
305
404
  ]
306
- }) : I ? /* @__PURE__ */ b("div", {
405
+ }) : V ? /* @__PURE__ */ S("div", {
307
406
  className: "py-1",
308
- children: [I.workspace.length > 0 || L ? /* @__PURE__ */ b("section", {
407
+ children: [V.workspace.length > 0 || U ? /* @__PURE__ */ S("section", {
309
408
  "data-testid": "history-group-workspace",
310
409
  children: [
311
- Q(f("history.groupWorkspace", "This workspace")),
312
- I.workspace.map((e) => e.conversation ? X(e.conversation, {
410
+ at(C("history.groupWorkspace", "This workspace")),
411
+ V.workspace.map((e) => e.conversation ? Z(e.conversation, {
313
412
  title: e.title || Y,
314
- badges: he(e),
315
- note: ge(e)
316
- }) : _e(e)),
317
- L ? /* @__PURE__ */ y("button", {
318
- ref: G,
413
+ badges: nt(e),
414
+ note: rt(e),
415
+ actions: $e(e)
416
+ }) : it(e)),
417
+ U ? /* @__PURE__ */ x("button", {
418
+ ref: Ue,
319
419
  type: "button",
320
420
  onClick: () => {
321
- U.current = {
421
+ q.current = {
322
422
  kind: "older",
323
- before: R
324
- }, u.loadOlderHeaders();
423
+ before: W
424
+ }, g.loadOlderHeaders(Le);
325
425
  },
326
426
  className: "mx-3 my-1 text-xs text-action-primary-bg hover:underline",
327
427
  "data-testid": "history-show-older",
328
- children: f("history.showOlder", "Show older conversations")
428
+ children: C("history.showOlder", "Show older conversations")
329
429
  }) : null
330
430
  ]
331
- }) : null, I.device.length > 0 ? /* @__PURE__ */ b("section", {
431
+ }) : null, V.device.length > 0 ? /* @__PURE__ */ S("section", {
332
432
  "data-testid": "history-group-device",
333
- children: [Q(f("history.groupDevice", "On this device")), I.device.map((e) => X(e))]
433
+ children: [at(C("history.groupDevice", "On this device")), V.device.map((e) => Z(e))]
334
434
  }) : null]
335
- }) : /* @__PURE__ */ y("div", {
435
+ }) : /* @__PURE__ */ x("div", {
336
436
  className: "py-1",
337
- children: C.map((e) => X(e))
437
+ children: w.map((e) => Z(e))
338
438
  })
339
439
  })
340
440
  ]
341
441
  });
342
442
  };
343
443
  //#endregion
344
- export { S as AssistantConversationList };
444
+ export { C as AssistantConversationList };