@burdenoff/fe-libs 2026.1018.1 → 2026.1019.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/AccountSwitcher.js +90 -89
- package/dist/chrome/Breadcrumbs.js +1 -1
- package/dist/chrome/CommandPalette.js +91 -90
- package/dist/chrome/Footer.js +31 -8
- package/dist/chrome/GlobalSearch.js +78 -77
- package/dist/chrome/HeaderBar.js +1 -1
- package/dist/chrome/HeaderThemeSwitcher.js +48 -47
- package/dist/chrome/LanguagePickerSheet.js +23 -22
- package/dist/chrome/NavCustomizeDialog.d.ts +0 -14
- package/dist/chrome/NavCustomizeDialog.js +114 -122
- package/dist/chrome/PanelTabs.js +45 -41
- package/dist/chrome/PersonaSurfaceControls.d.ts +0 -17
- package/dist/chrome/PersonaSurfaceControls.js +115 -118
- package/dist/chrome/PluginSettingsPage.js +29 -28
- package/dist/chrome/PluginWidgetGrid.js +19 -18
- package/dist/chrome/ProductPickerSheet.js +44 -47
- package/dist/chrome/ProductSwitcher.js +2 -6
- package/dist/chrome/ProfileSwitcher.js +6 -10
- package/dist/chrome/ShortcutHelpDialog.js +60 -65
- package/dist/chrome/SideNavigation.js +2 -2
- package/dist/chrome/Sidebar.js +44 -43
- package/dist/chrome/ThemePreferences.js +289 -267
- package/dist/chrome/contextSwitcher/EmptyState.js +31 -27
- package/dist/chrome/contextSwitcher/OrganizationList.js +40 -30
- package/dist/chrome/contextSwitcher/ProjectList.js +48 -44
- package/dist/chrome/contextSwitcher/SearchInput.js +44 -40
- package/dist/chrome/contextSwitcher/TriggerButton.js +2 -2
- package/dist/chrome/contextSwitcher/WorkspaceList.js +36 -32
- package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +128 -126
- package/dist/chrome/globalSearch/ResultsList.js +25 -27
- package/dist/chrome/globalSearch/SearchInput.js +16 -14
- package/dist/chrome/notificationCenter/NotificationCardItem.js +58 -47
- package/dist/chrome/notificationCenter/NotificationFilters.js +76 -62
- package/dist/chrome/notificationCenter/NotificationFooter.js +21 -21
- package/dist/chrome/notificationCenter/NotificationHeader.js +67 -63
- package/dist/chrome/notificationCenter/NotificationList.js +75 -71
- package/dist/chrome/notificationCenter/NotificationPanel.js +37 -33
- package/dist/chrome/notificationCenter/PushOptInToggle.js +33 -32
- package/dist/chrome/notificationCenter/constants.d.ts +6 -1
- package/dist/chrome/notificationCenter/constants.js +12 -11
- package/dist/chrome/useThemeOptionLabels.d.ts +33 -0
- package/dist/chrome/useThemeOptionLabels.js +39 -0
- package/dist/shared/assistant/conversation.d.ts +8 -0
- package/dist/shared/assistant/history/historyMapping.js +1 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +6 -6
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +86 -85
- package/dist/shared/assistant/ui/AssistantMessageItem.js +101 -96
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +93 -89
- package/dist/shared/assistant/ui/WorkflowAssistantPanel.js +152 -140
- package/dist/shared/assistant/ui/useWriteProposals.js +122 -85
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +3 -1
- package/dist/shared/assistant/writeProposalDiscovery.js +2 -2
- package/dist/shared/events/sinks/RybbitSink.js +2 -2
- package/dist/shared/providers/shell/interpolateShellLabel.d.ts +3 -0
- package/dist/shared/providers/shell/interpolateShellLabel.js +11 -0
- package/dist/shared/providers/shell/useAssistantShellLabels.d.ts +45 -0
- package/dist/shared/providers/shell/useAssistantShellLabels.js +54 -0
- package/dist/shared/tours/TourPlayer.js +33 -32
- package/dist/shared/tours/TourTooltip.js +108 -109
- package/dist/shared/tours/tourTrigger/MobileTourSheet.js +98 -85
- package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +20 -18
- package/dist/shared/tours/tourTrigger/TourListItemMobile.js +23 -25
- package/dist/shared-assistant.js +188 -188
- package/package.json +2 -2
|
@@ -5,8 +5,9 @@ import { readSandboxWriteCapabilitiesOnce as n } from "../api.js";
|
|
|
5
5
|
import { writeProposalErrorLine as r } from "../writeProposalErrorCopy.js";
|
|
6
6
|
import { getOrganizationId as i, getWorkspaceId as a } from "../context.js";
|
|
7
7
|
import { redactWriteProposalText as o, writeProposalConfirmState as s, writeProposalSensitiveTexts as c } from "./writeProposalPresentation.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { statusText as l } from "./AssistantWriteProposalCard.js";
|
|
9
|
+
import { useAssistantPreview as u } from "../preview/context.js";
|
|
10
|
+
import { currentPreviewOwner as d, sameOwner as ee } from "../preview/surfaceState.js";
|
|
10
11
|
import { deliverPreviewEvent as f } from "../preview/useAssistantPreviewBridge.js";
|
|
11
12
|
import { writeActionResultEvents as p } from "../preview/writeActionResults.js";
|
|
12
13
|
import { WRITE_PROPOSAL_SANDBOX_MODE as m, createSandboxWriteProposalClient as h } from "../writeProposals.js";
|
|
@@ -21,8 +22,12 @@ var D = new Set([
|
|
|
21
22
|
"declined",
|
|
22
23
|
"superseded",
|
|
23
24
|
"expired"
|
|
24
|
-
])
|
|
25
|
-
function
|
|
25
|
+
]);
|
|
26
|
+
function O(e) {
|
|
27
|
+
return D.has(e) && e !== "outcome_unknown";
|
|
28
|
+
}
|
|
29
|
+
var k = (e) => `${e.sandboxId}\u0000${e.sessionId}`;
|
|
30
|
+
function A(e) {
|
|
26
31
|
return {
|
|
27
32
|
accessToken: e.getAccessToken(),
|
|
28
33
|
workspaceToken: e.getWorkspaceToken(),
|
|
@@ -30,15 +35,19 @@ function k(e) {
|
|
|
30
35
|
organizationId: i()
|
|
31
36
|
};
|
|
32
37
|
}
|
|
33
|
-
function
|
|
38
|
+
function j() {
|
|
34
39
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
35
40
|
}
|
|
36
|
-
function
|
|
41
|
+
function M(e, t, n) {
|
|
42
|
+
let r = e.metadata?.writeProposalTransportNote;
|
|
43
|
+
return e.role === "system" && r?.status === "uncertain" && r.proposalId === n && r.sandboxId === t.sandboxId && r.sessionId === t.sessionId;
|
|
44
|
+
}
|
|
45
|
+
function N(e) {
|
|
37
46
|
let t = /* @__PURE__ */ new Set();
|
|
38
47
|
for (let n of e.messages) for (let e of _(n.metadata)) t.add(e.proposalId);
|
|
39
48
|
return t;
|
|
40
49
|
}
|
|
41
|
-
function
|
|
50
|
+
function P(e, t, n) {
|
|
42
51
|
if (n) {
|
|
43
52
|
let t = e.messages.find((e) => e.id === n);
|
|
44
53
|
if (t?.role === "assistant") return t;
|
|
@@ -49,11 +58,11 @@ function M(e, t, n) {
|
|
|
49
58
|
}
|
|
50
59
|
return null;
|
|
51
60
|
}
|
|
52
|
-
function
|
|
61
|
+
function F(e) {
|
|
53
62
|
let t = /* @__PURE__ */ new Map();
|
|
54
63
|
for (let n of e) {
|
|
55
64
|
if (n.view.status !== "pending") continue;
|
|
56
|
-
let e = `${
|
|
65
|
+
let e = `${k(n.session)}\u0000${n.session.conversationId}`, r = t.get(e) ?? {
|
|
57
66
|
session: n.session,
|
|
58
67
|
proposalIds: []
|
|
59
68
|
};
|
|
@@ -61,124 +70,152 @@ function N(e) {
|
|
|
61
70
|
}
|
|
62
71
|
return t;
|
|
63
72
|
}
|
|
64
|
-
function
|
|
65
|
-
let { getAccessToken:
|
|
73
|
+
function I(i) {
|
|
74
|
+
let { getAccessToken: I, getWorkspaceToken: L, userId: R } = e(), z = u(), B = T({
|
|
66
75
|
tr: i.tr,
|
|
67
76
|
productWriteApproval: i.productWriteApproval ?? "legacy",
|
|
68
|
-
getAccessToken:
|
|
69
|
-
getWorkspaceToken:
|
|
70
|
-
userId:
|
|
71
|
-
preview:
|
|
77
|
+
getAccessToken: I,
|
|
78
|
+
getWorkspaceToken: L,
|
|
79
|
+
userId: R,
|
|
80
|
+
preview: z
|
|
72
81
|
});
|
|
73
82
|
C(() => {
|
|
74
|
-
|
|
83
|
+
B.current = {
|
|
75
84
|
tr: i.tr,
|
|
76
85
|
productWriteApproval: i.productWriteApproval ?? "legacy",
|
|
77
|
-
getAccessToken:
|
|
78
|
-
getWorkspaceToken:
|
|
79
|
-
userId:
|
|
80
|
-
preview:
|
|
86
|
+
getAccessToken: I,
|
|
87
|
+
getWorkspaceToken: L,
|
|
88
|
+
userId: R,
|
|
89
|
+
preview: z
|
|
81
90
|
};
|
|
82
91
|
});
|
|
83
|
-
let [
|
|
92
|
+
let [te, V] = E({}), H = T({}), U = T(/* @__PURE__ */ new Map()), W = T(/* @__PURE__ */ new Map()), G = T(/* @__PURE__ */ new Set()), K = T(/* @__PURE__ */ new Map()), q = T(/* @__PURE__ */ new Set()), J = T(null), Y = T(/* @__PURE__ */ new Set()), X = T(/* @__PURE__ */ new Map()), Z = T(/* @__PURE__ */ new Set()), [ne, re] = E(() => /* @__PURE__ */ new Set());
|
|
84
93
|
C(() => {
|
|
85
|
-
let e =
|
|
86
|
-
e.activeConversationId !== t.activeConversationId &&
|
|
94
|
+
let e = q.current, n = t.subscribe((e, t) => {
|
|
95
|
+
e.activeConversationId !== t.activeConversationId && G.current.clear();
|
|
87
96
|
}), i = (e) => {
|
|
88
97
|
if (e.length === 0) return;
|
|
89
|
-
let n = { ...
|
|
98
|
+
let n = { ...H.current };
|
|
90
99
|
for (let r of [...e].sort((e, t) => e.view.createdAt - t.view.createdAt)) {
|
|
91
100
|
let e = n[r.view.proposalId];
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
if (e && D.has(e.view.status) && !D.has(r.view.status)) continue;
|
|
102
|
+
n[r.view.proposalId] = r;
|
|
103
|
+
let i = !1;
|
|
104
|
+
if (O(r.view.status)) {
|
|
105
|
+
let e = t.getState(), n = e.conversations.find((e) => e.id === r.session.conversationId);
|
|
106
|
+
for (let t of n?.messages ?? []) M(t, r.session, r.view.proposalId) && (e.patchMessage(r.session.conversationId, t.id, {
|
|
107
|
+
content: l(r.view, B.current.tr),
|
|
108
|
+
metadata: {
|
|
109
|
+
...t.metadata,
|
|
110
|
+
writeProposalTransportNote: {
|
|
111
|
+
proposalId: r.view.proposalId,
|
|
112
|
+
sandboxId: r.session.sandboxId,
|
|
113
|
+
sessionId: r.session.sessionId,
|
|
114
|
+
status: r.view.status
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}), i = !0);
|
|
118
|
+
}
|
|
119
|
+
if (U.current.has(r.view.proposalId) || U.current.set(r.view.proposalId, W.current.get(`${k(r.session)}\u0000${r.session.conversationId}`) ?? d()), r.view.status === "succeeded" && !r.view.result?.errors?.length) {
|
|
120
|
+
let n = U.current.get(r.view.proposalId);
|
|
121
|
+
if (!n || !ee(n, d())) continue;
|
|
122
|
+
let a = t.getState(), s = a.conversations.find((e) => e.id === r.session.conversationId), l = s && (s.messages.find((e) => _(e.metadata).some((e) => e.proposalId === r.view.proposalId)) ?? P(s, r.session, null));
|
|
123
|
+
if (!l) continue;
|
|
124
|
+
if (a.activeConversationId === r.session.conversationId && B.current.preview?.onEvent) for (let e of p(r.view, r.session.conversationId, l.id, n)) G.current.has(e.action.id) || (G.current.add(e.action.id), f(B.current.preview, e));
|
|
125
|
+
if (!e || D.has(e.view.status) || i) continue;
|
|
126
|
+
a.addMessage(r.session.conversationId, {
|
|
127
|
+
id: j(),
|
|
101
128
|
role: "system",
|
|
102
|
-
content:
|
|
129
|
+
content: B.current.tr("writeProposal.status.succeeded", "Done — {{summary}}", { summary: o(r.view.result?.summary || r.view.description.readbackPast, c(r.view)) }),
|
|
103
130
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
104
131
|
});
|
|
105
132
|
}
|
|
106
133
|
}
|
|
107
|
-
|
|
134
|
+
H.current = n, V(n);
|
|
108
135
|
}, s = (e, n, r) => {
|
|
109
136
|
let i = t.getState(), a = i.conversations.find((t) => t.id === e.conversationId);
|
|
110
137
|
if (!a) return;
|
|
111
|
-
let o =
|
|
138
|
+
let o = N(a), s = n.filter((e) => !o.has(e.proposalId) && (e.status === "pending" || e.status === "executing"));
|
|
112
139
|
if (s.length === 0) return;
|
|
113
|
-
let c =
|
|
140
|
+
let c = P(a, e, r);
|
|
114
141
|
c && i.mergeMessageMetadata(a.id, c.id, { writeProposalRefs: [..._(c.metadata), ...s.map((t) => ({
|
|
115
142
|
proposalId: t.proposalId,
|
|
116
143
|
sandboxId: e.sandboxId,
|
|
117
144
|
sessionId: e.sessionId
|
|
118
145
|
}))] });
|
|
119
|
-
},
|
|
146
|
+
}, u = h({
|
|
120
147
|
getWorkspaceId: a,
|
|
121
|
-
getAuthContext: () =>
|
|
148
|
+
getAuthContext: () => A(B.current)
|
|
122
149
|
}), m = g({
|
|
123
150
|
client: {
|
|
124
|
-
...
|
|
151
|
+
...u,
|
|
125
152
|
list: (e, t) => {
|
|
126
|
-
let n = `${
|
|
127
|
-
return
|
|
153
|
+
let n = `${k(e)}\u0000${e.conversationId}`;
|
|
154
|
+
return W.current.has(n) || W.current.set(n, d()), u.list(e, t);
|
|
128
155
|
}
|
|
129
156
|
},
|
|
130
157
|
capabilitiesOf: (e) => t.getState().sandboxWriteCapabilities[e],
|
|
131
|
-
actorOf: () =>
|
|
158
|
+
actorOf: () => B.current.userId,
|
|
132
159
|
onList: (e, t, n) => {
|
|
133
160
|
let r = {
|
|
134
161
|
serverNow: t.serverNow,
|
|
135
162
|
arrivedAt: Date.now()
|
|
136
163
|
};
|
|
137
|
-
|
|
164
|
+
K.current.set(k(e), r), i(t.proposals.map((t) => ({
|
|
138
165
|
view: t,
|
|
139
166
|
...r,
|
|
140
167
|
session: e
|
|
141
168
|
}))), s(e, t.proposals, n.turnMessageId);
|
|
142
169
|
},
|
|
143
170
|
onView: (e, t) => {
|
|
144
|
-
let n =
|
|
171
|
+
let n = H.current[t.proposalId];
|
|
145
172
|
i([{
|
|
146
173
|
view: t,
|
|
147
|
-
...
|
|
174
|
+
...K.current.get(k(e)) ?? {
|
|
148
175
|
serverNow: n?.serverNow ?? NaN,
|
|
149
176
|
arrivedAt: n?.arrivedAt ?? NaN
|
|
150
177
|
},
|
|
151
178
|
session: e
|
|
152
179
|
}]);
|
|
153
180
|
},
|
|
154
|
-
onError: (e, n, i) => {
|
|
155
|
-
let
|
|
181
|
+
onError: (e, n, i, a) => {
|
|
182
|
+
let o = r(n, i), { tr: s } = B.current, c = i === "approve" && n.indeterminate && a;
|
|
183
|
+
if (c) {
|
|
184
|
+
let t = H.current[a];
|
|
185
|
+
if (t?.session.conversationId === e.conversationId && k(t.session) === k(e) && O(t.view.status)) return;
|
|
186
|
+
}
|
|
156
187
|
t.getState().addMessage(e.conversationId, {
|
|
157
|
-
id:
|
|
188
|
+
id: j(),
|
|
158
189
|
role: "system",
|
|
159
|
-
content: o
|
|
160
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
190
|
+
content: s(o.key, o.fallback),
|
|
191
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
192
|
+
...c ? { metadata: { writeProposalTransportNote: {
|
|
193
|
+
proposalId: a,
|
|
194
|
+
sandboxId: e.sandboxId,
|
|
195
|
+
sessionId: e.sessionId,
|
|
196
|
+
status: "uncertain"
|
|
197
|
+
} } } : {}
|
|
161
198
|
});
|
|
162
199
|
}
|
|
163
200
|
});
|
|
164
|
-
|
|
165
|
-
let v =
|
|
201
|
+
J.current = m;
|
|
202
|
+
let v = X.current;
|
|
166
203
|
return () => {
|
|
167
|
-
m.dispose(), n(),
|
|
204
|
+
m.dispose(), n(), J.current === m && (J.current = null), e.clear(), v.clear();
|
|
168
205
|
};
|
|
169
206
|
}, []), C(() => t.subscribe((e, t) => {
|
|
170
207
|
if (e.sandboxWriteCapabilities === t.sandboxWriteCapabilities) return;
|
|
171
|
-
let n =
|
|
208
|
+
let n = X.current;
|
|
172
209
|
for (let [t, r] of [...n]) {
|
|
173
210
|
let i = e.sandboxWriteCapabilities[r.sandboxId];
|
|
174
|
-
i && (n.delete(t), y(i) && (
|
|
211
|
+
i && (n.delete(t), y(i) && (q.current.add(k(r)), J.current?.discover(r, "open")));
|
|
175
212
|
}
|
|
176
213
|
}), []);
|
|
177
214
|
let Q = (e, t) => {
|
|
178
|
-
let n =
|
|
215
|
+
let n = J.current;
|
|
179
216
|
if (!n) return;
|
|
180
|
-
let r =
|
|
181
|
-
for (let { session: e, proposalIds: a } of
|
|
217
|
+
let r = Y.current, i = e.filter((e) => !r.has(e.view.proposalId));
|
|
218
|
+
for (let { session: e, proposalIds: a } of F(i).values()) {
|
|
182
219
|
for (let e of a) r.add(e);
|
|
183
220
|
n.declineAll(e, t, "system");
|
|
184
221
|
}
|
|
@@ -187,26 +224,26 @@ function P(i) {
|
|
|
187
224
|
$.current = Q;
|
|
188
225
|
}), C(() => t.subscribe((e, t) => {
|
|
189
226
|
if (e.conversations === t.conversations) return;
|
|
190
|
-
let n = new Set(e.conversations.map((e) => e.id)), r = Object.values(
|
|
227
|
+
let n = new Set(e.conversations.map((e) => e.id)), r = Object.values(H.current).filter((e) => !n.has(e.session.conversationId));
|
|
191
228
|
r.length > 0 && $.current(r, "conversation_closed");
|
|
192
229
|
}), []), {
|
|
193
230
|
panel: w(() => {
|
|
194
231
|
let e = (e) => t.getState().sandboxWriteCapabilities[e], r = (e) => {
|
|
195
|
-
let t =
|
|
232
|
+
let t = B.current;
|
|
196
233
|
if (t.productWriteApproval !== "proposal-v1") return;
|
|
197
|
-
let r =
|
|
234
|
+
let r = Z.current;
|
|
198
235
|
if (r.has(e)) return;
|
|
199
236
|
let i = a();
|
|
200
|
-
i && (r.add(e), n(e, i, m,
|
|
237
|
+
i && (r.add(e), n(e, i, m, A(t)).finally(() => r.delete(e)));
|
|
201
238
|
};
|
|
202
239
|
return {
|
|
203
240
|
afterTurn: (e, t) => {
|
|
204
|
-
|
|
241
|
+
J.current?.discover(e, "turn", { turnMessageId: t });
|
|
205
242
|
},
|
|
206
243
|
openConversation: (n) => {
|
|
207
|
-
let i =
|
|
244
|
+
let i = J.current;
|
|
208
245
|
if (!i) return;
|
|
209
|
-
let a =
|
|
246
|
+
let a = X.current;
|
|
210
247
|
for (let [e, t] of [...a]) t.conversationId !== n && a.delete(e);
|
|
211
248
|
let o = t.getState().conversations.find((e) => e.id === n);
|
|
212
249
|
if (o) for (let { session: t, issuing: n } of v(o)) {
|
|
@@ -215,61 +252,61 @@ function P(i) {
|
|
|
215
252
|
i.discover(t, "open");
|
|
216
253
|
continue;
|
|
217
254
|
}
|
|
218
|
-
o || (a.set(`${
|
|
255
|
+
o || (a.set(`${k(t)}\u0000${t.conversationId}`, t), n && r(t.sandboxId));
|
|
219
256
|
}
|
|
220
257
|
},
|
|
221
258
|
ensureKnown: (t, n) => {
|
|
222
|
-
let r =
|
|
223
|
-
if (!r ||
|
|
224
|
-
let i =
|
|
225
|
-
|
|
259
|
+
let r = J.current;
|
|
260
|
+
if (!r || H.current[t.proposalId] || !y(e(t.sandboxId))) return;
|
|
261
|
+
let i = k(t);
|
|
262
|
+
q.current.has(i) || (q.current.add(i), r.discover({
|
|
226
263
|
sandboxId: t.sandboxId,
|
|
227
264
|
sessionId: t.sessionId,
|
|
228
265
|
conversationId: n
|
|
229
266
|
}, "mount"));
|
|
230
267
|
},
|
|
231
268
|
approve: async (e, t) => {
|
|
232
|
-
let n =
|
|
269
|
+
let n = H.current[e.proposalId], r = J.current;
|
|
233
270
|
!n || !r || await r.approve(n.session, e, t);
|
|
234
271
|
},
|
|
235
272
|
decline: async (e, t, n) => {
|
|
236
|
-
let r =
|
|
273
|
+
let r = H.current[e.proposalId], i = J.current;
|
|
237
274
|
!r || !i || await i.decline(r.session, e, t, "button", n);
|
|
238
275
|
},
|
|
239
276
|
presented: async (e, t) => {
|
|
240
|
-
let n =
|
|
277
|
+
let n = H.current[e.proposalId], r = J.current;
|
|
241
278
|
!n || !r || await r.presented(n.session, e, t);
|
|
242
279
|
},
|
|
243
|
-
entry: (e) =>
|
|
280
|
+
entry: (e) => H.current[e],
|
|
244
281
|
liveFor: (t) => {
|
|
245
|
-
let n =
|
|
246
|
-
return S(t ? Object.values(
|
|
282
|
+
let n = J.current;
|
|
283
|
+
return S(t ? Object.values(H.current).filter((e) => e.session.conversationId === t && !n?.isRetired(e.session.sandboxId)).map((t) => ({
|
|
247
284
|
status: t.view.status,
|
|
248
285
|
sandboxId: t.session.sandboxId,
|
|
249
286
|
offersConfirm: s(t.view, e(t.session.sandboxId)).offerConfirm
|
|
250
287
|
})) : []);
|
|
251
288
|
},
|
|
252
289
|
declineForReply: async (e, t, n) => {
|
|
253
|
-
let r =
|
|
290
|
+
let r = J.current;
|
|
254
291
|
if (!r) return;
|
|
255
292
|
let i = n;
|
|
256
|
-
await x([...
|
|
293
|
+
await x([...F(Object.values(H.current).filter((t) => t.session.conversationId === e && !r.isRetired(t.session.sandboxId))).values()].map(({ session: e }) => r.declineAll(e, t, i, { report: !0 })), b);
|
|
257
294
|
},
|
|
258
295
|
withdraw: (e, t) => {
|
|
259
|
-
$.current(Object.values(
|
|
296
|
+
$.current(Object.values(H.current).filter((t) => t.session.conversationId === e), t);
|
|
260
297
|
},
|
|
261
298
|
retireSandbox: (e) => {
|
|
262
|
-
let t =
|
|
263
|
-
!t || t.isRetired(e) || ($.current(Object.values(
|
|
299
|
+
let t = J.current;
|
|
300
|
+
!t || t.isRetired(e) || ($.current(Object.values(H.current).filter((t) => t.session.sandboxId === e), "sandbox_replaced"), t.retire(e), re((t) => {
|
|
264
301
|
let n = new Set(t);
|
|
265
302
|
return n.add(e), n;
|
|
266
303
|
}));
|
|
267
304
|
}
|
|
268
305
|
};
|
|
269
306
|
}, []),
|
|
270
|
-
entries:
|
|
271
|
-
retiredSandboxes:
|
|
307
|
+
entries: te,
|
|
308
|
+
retiredSandboxes: ne
|
|
272
309
|
};
|
|
273
310
|
}
|
|
274
311
|
//#endregion
|
|
275
|
-
export {
|
|
312
|
+
export { I as useWriteProposals };
|
|
@@ -107,7 +107,9 @@ export interface WriteProposalDiscoveryDeps {
|
|
|
107
107
|
/** One proposal as the sandbox now reports it. */
|
|
108
108
|
onView: (session: WriteProposalSession, view: WriteProposalView) => void;
|
|
109
109
|
/** A refusal or failure the person should be told about. */
|
|
110
|
-
onError: (session: WriteProposalSession, error: WriteProposalError, action: WriteProposalFailedAction
|
|
110
|
+
onError: (session: WriteProposalSession, error: WriteProposalError, action: WriteProposalFailedAction,
|
|
111
|
+
/** Present for the one proposal whose approve answer was lost. */
|
|
112
|
+
proposalId?: string) => void;
|
|
111
113
|
timers?: WriteProposalTimers;
|
|
112
114
|
/** How often an executing proposal is re-read. */
|
|
113
115
|
pollMs?: number;
|
|
@@ -168,8 +168,8 @@ function m(e) {
|
|
|
168
168
|
s.kind === "settled" ? (x(i, s.proposal), o = !1) : s.proposal ? x(i, s.proposal) : i.executing.add(n.proposalId);
|
|
169
169
|
} catch (t) {
|
|
170
170
|
if (m) return;
|
|
171
|
-
let
|
|
172
|
-
|
|
171
|
+
let r = u(t);
|
|
172
|
+
r.current && x(i, r.current), e.onError(i.session, r, "approve", n.proposalId);
|
|
173
173
|
}
|
|
174
174
|
o && await C(i.session, "refresh");
|
|
175
175
|
}
|
|
@@ -148,7 +148,7 @@ function D({ siteId: e, scriptUrl: a = "https://app.rybbit.io/api/script.js", re
|
|
|
148
148
|
f
|
|
149
149
|
]), null;
|
|
150
150
|
}
|
|
151
|
-
function O({ productName: t
|
|
151
|
+
function O({ productName: t }) {
|
|
152
152
|
let [n, r] = i(() => v() === null), s = e();
|
|
153
153
|
return !n || _() ? null : /* @__PURE__ */ o("aside", {
|
|
154
154
|
className: "fixed bottom-4 left-4 z-[100] w-[calc(100%-2rem)] max-w-sm rounded-xl border border-border-seam bg-bg-surface p-4 text-text-primary shadow-pop",
|
|
@@ -156,7 +156,7 @@ function O({ productName: t = "this product" }) {
|
|
|
156
156
|
"data-testid": "analytics-consent-banner",
|
|
157
157
|
children: [/* @__PURE__ */ a("p", {
|
|
158
158
|
className: "text-sm",
|
|
159
|
-
children: s("privacyConsent.message", "Allow optional analytics to help improve {{productName}}? Essential product operation works either way.", { productName: t })
|
|
159
|
+
children: s("privacyConsent.message", "Allow optional analytics to help improve {{productName}}? Essential product operation works either way.", { productName: t ?? s("privacyConsent.productFallback", "this product") })
|
|
160
160
|
}), /* @__PURE__ */ o("div", {
|
|
161
161
|
className: "mt-3 flex gap-2",
|
|
162
162
|
children: [/* @__PURE__ */ a("button", {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fragment as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/shared/providers/shell/interpolateShellLabel.tsx
|
|
4
|
+
function n(n, r) {
|
|
5
|
+
return n.split(/(\{\{[A-Za-z][A-Za-z0-9]*\}\})/g).map((n, i) => {
|
|
6
|
+
let a = n.startsWith("{{") ? n.slice(2, -2) : "";
|
|
7
|
+
return /* @__PURE__ */ t(e, { children: Object.hasOwn(r, a) ? r[a] : n }, i);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as interpolateShellLabel };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Generic shell labels stay separate from the product-prefixed assistant dictionary. */
|
|
2
|
+
export declare function useWorkflowAssistantLabels(): {
|
|
3
|
+
title: string;
|
|
4
|
+
savedPending: string;
|
|
5
|
+
conversationUnavailable: string;
|
|
6
|
+
historyUnavailable: string;
|
|
7
|
+
olderUnavailable: string;
|
|
8
|
+
audioUnavailable: string;
|
|
9
|
+
unknownTurn: string;
|
|
10
|
+
cancelledTurn: string;
|
|
11
|
+
failedTurn: string;
|
|
12
|
+
answerPending: string;
|
|
13
|
+
admissionRefused: string;
|
|
14
|
+
interrupted: string;
|
|
15
|
+
cancelUnconfirmed: string;
|
|
16
|
+
newChat: string;
|
|
17
|
+
savedConversations: string;
|
|
18
|
+
savedAssistantConversations: string;
|
|
19
|
+
noSavedConversations: string;
|
|
20
|
+
loadOlderConversations: string;
|
|
21
|
+
assistantConversation: string;
|
|
22
|
+
loadingYourConversation: string;
|
|
23
|
+
emptyHint: string;
|
|
24
|
+
loadOlderMessages: string;
|
|
25
|
+
you: string;
|
|
26
|
+
generatingAnswer: string;
|
|
27
|
+
readAnswerAloud: string;
|
|
28
|
+
answerSources: string;
|
|
29
|
+
sourceReference: (params: Record<string, string | number>) => string;
|
|
30
|
+
preparingYourAnswer: string;
|
|
31
|
+
dictationUnavailable: string;
|
|
32
|
+
question: string;
|
|
33
|
+
askAQuestion: string;
|
|
34
|
+
stopDictation: string;
|
|
35
|
+
dictateQuestion: string;
|
|
36
|
+
stopAudio: string;
|
|
37
|
+
reloadConversation: string;
|
|
38
|
+
recoverTurn: string;
|
|
39
|
+
cancelTurn: string;
|
|
40
|
+
ask: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function useAssistantChromeLabels(): {
|
|
43
|
+
tokens: string;
|
|
44
|
+
code: string;
|
|
45
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useShellLabel as e } from "./useShellLabel.js";
|
|
2
|
+
//#region src/shared/providers/shell/useAssistantShellLabels.ts
|
|
3
|
+
function t() {
|
|
4
|
+
let t = e();
|
|
5
|
+
return {
|
|
6
|
+
title: t("workflowAssistant.title", "AI assistant"),
|
|
7
|
+
savedPending: t("workflowAssistant.savedPending", "A saved turn is pending. Recover it to check the answer."),
|
|
8
|
+
conversationUnavailable: t("workflowAssistant.conversationUnavailable", "Your conversation is unavailable. Reload it before sending another question."),
|
|
9
|
+
historyUnavailable: t("workflowAssistant.historyUnavailable", "Conversation history is unavailable. Try loading it again."),
|
|
10
|
+
olderUnavailable: t("workflowAssistant.olderUnavailable", "Older messages are unavailable. Try loading them again."),
|
|
11
|
+
audioUnavailable: t("workflowAssistant.audioUnavailable", "Audio playback is unavailable. You can read the answer above."),
|
|
12
|
+
unknownTurn: t("workflowAssistant.unknownTurn", "This turn could not be confirmed. It will not be generated again automatically."),
|
|
13
|
+
cancelledTurn: t("workflowAssistant.cancelledTurn", "This turn was cancelled."),
|
|
14
|
+
failedTurn: t("workflowAssistant.failedTurn", "The assistant could not complete this turn."),
|
|
15
|
+
answerPending: t("workflowAssistant.answerPending", "Your answer is still pending. Recover this turn to check it again."),
|
|
16
|
+
admissionRefused: t("workflowAssistant.admissionRefused", "The assistant could not accept this question. Check your access, available quota or assistant configuration."),
|
|
17
|
+
interrupted: t("workflowAssistant.interrupted", "The connection was interrupted. Recover this turn using the same request."),
|
|
18
|
+
cancelUnconfirmed: t("workflowAssistant.cancelUnconfirmed", "Cancellation could not be confirmed. Recover the saved turn to check its result."),
|
|
19
|
+
newChat: t("workflowAssistant.newChat", "New chat"),
|
|
20
|
+
savedConversations: t("workflowAssistant.savedConversations", "Saved conversations"),
|
|
21
|
+
savedAssistantConversations: t("workflowAssistant.savedAssistantConversations", "Saved assistant conversations"),
|
|
22
|
+
noSavedConversations: t("workflowAssistant.noSavedConversations", "No saved conversations."),
|
|
23
|
+
loadOlderConversations: t("workflowAssistant.loadOlderConversations", "Load older conversations"),
|
|
24
|
+
assistantConversation: t("workflowAssistant.assistantConversation", "Assistant conversation"),
|
|
25
|
+
loadingYourConversation: t("workflowAssistant.loadingYourConversation", "Loading your conversation…"),
|
|
26
|
+
emptyHint: t("workflowAssistant.emptyHint", "Ask a question about the available content."),
|
|
27
|
+
loadOlderMessages: t("workflowAssistant.loadOlderMessages", "Load older messages"),
|
|
28
|
+
you: t("workflowAssistant.you", "You"),
|
|
29
|
+
generatingAnswer: t("workflowAssistant.generatingAnswer", "Generating answer…"),
|
|
30
|
+
readAnswerAloud: t("workflowAssistant.readAnswerAloud", "Read answer aloud"),
|
|
31
|
+
answerSources: t("workflowAssistant.answerSources", "Answer sources"),
|
|
32
|
+
sourceReference: (e) => t("workflowAssistant.sourceReference", "[{{reference}}] Source {{documentId}}", e),
|
|
33
|
+
preparingYourAnswer: t("workflowAssistant.preparingYourAnswer", "Preparing your answer…"),
|
|
34
|
+
dictationUnavailable: t("workflowAssistant.dictationUnavailable", "Dictation is unavailable. You can type your question."),
|
|
35
|
+
question: t("workflowAssistant.question", "Question"),
|
|
36
|
+
askAQuestion: t("workflowAssistant.askAQuestion", "Ask a question…"),
|
|
37
|
+
stopDictation: t("workflowAssistant.stopDictation", "Stop dictation"),
|
|
38
|
+
dictateQuestion: t("workflowAssistant.dictateQuestion", "Dictate question"),
|
|
39
|
+
stopAudio: t("workflowAssistant.stopAudio", "Stop audio"),
|
|
40
|
+
reloadConversation: t("workflowAssistant.reloadConversation", "Reload conversation"),
|
|
41
|
+
recoverTurn: t("workflowAssistant.recoverTurn", "Recover turn"),
|
|
42
|
+
cancelTurn: t("workflowAssistant.cancelTurn", "Cancel turn"),
|
|
43
|
+
ask: t("workflowAssistant.ask", "Ask")
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function n() {
|
|
47
|
+
let t = e();
|
|
48
|
+
return {
|
|
49
|
+
tokens: t("assistantChrome.tokens", "tokens"),
|
|
50
|
+
code: t("markdownEditor.placeholder.code", "code")
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { n as useAssistantChromeLabels, t as useWorkflowAssistantLabels };
|
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useShellLabel as e } from "../providers/shell/useShellLabel.js";
|
|
2
|
+
import { useTourPlayerContext as t } from "./TourPlayerProvider.js";
|
|
3
|
+
import { useCallback as n, useEffect as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
5
|
//#region src/shared/tours/TourPlayer.tsx
|
|
5
|
-
function
|
|
6
|
-
let { startTour: s, isPlaying: c, isCompleted: l, isSkipped: u, currentTour: d } =
|
|
7
|
-
return
|
|
8
|
-
if (
|
|
9
|
-
let
|
|
10
|
-
s(
|
|
6
|
+
function a({ tour: e, autoStart: n = !1, autoStartDelay: i = 0, onComplete: a, onSkip: o }) {
|
|
7
|
+
let { startTour: s, isPlaying: c, isCompleted: l, isSkipped: u, currentTour: d } = t();
|
|
8
|
+
return r(() => {
|
|
9
|
+
if (e && n && !c) {
|
|
10
|
+
let t = setTimeout(() => {
|
|
11
|
+
s(e);
|
|
11
12
|
}, i);
|
|
12
|
-
return () => clearTimeout(
|
|
13
|
+
return () => clearTimeout(t);
|
|
13
14
|
}
|
|
14
15
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
e,
|
|
17
|
+
n,
|
|
17
18
|
i,
|
|
18
19
|
s,
|
|
19
20
|
c
|
|
20
|
-
]),
|
|
21
|
-
l && d?.id ===
|
|
21
|
+
]), r(() => {
|
|
22
|
+
l && d?.id === e?.id && a?.();
|
|
22
23
|
}, [
|
|
23
24
|
l,
|
|
24
25
|
d,
|
|
25
|
-
|
|
26
|
+
e,
|
|
26
27
|
a
|
|
27
|
-
]),
|
|
28
|
-
u && d?.id ===
|
|
28
|
+
]), r(() => {
|
|
29
|
+
u && d?.id === e?.id && o?.();
|
|
29
30
|
}, [
|
|
30
31
|
u,
|
|
31
32
|
d,
|
|
32
|
-
|
|
33
|
+
e,
|
|
33
34
|
o
|
|
34
35
|
]), null;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
let { startTour:
|
|
38
|
-
return
|
|
39
|
-
r && i(),
|
|
37
|
+
function o() {
|
|
38
|
+
let { startTour: e, isPlaying: r, stopTour: i } = t();
|
|
39
|
+
return n((t) => {
|
|
40
|
+
r && i(), e(t);
|
|
40
41
|
}, [
|
|
41
|
-
|
|
42
|
+
e,
|
|
42
43
|
i,
|
|
43
44
|
r
|
|
44
45
|
]);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
return /* @__PURE__ */
|
|
47
|
+
function s({ tour: t, children: n, className: r, style: a }) {
|
|
48
|
+
let s = e(), c = o();
|
|
49
|
+
return /* @__PURE__ */ i("button", {
|
|
49
50
|
type: "button",
|
|
50
|
-
onClick: () =>
|
|
51
|
-
className:
|
|
52
|
-
style:
|
|
53
|
-
"aria-label":
|
|
54
|
-
children:
|
|
51
|
+
onClick: () => c(t),
|
|
52
|
+
className: r,
|
|
53
|
+
style: a,
|
|
54
|
+
"aria-label": s("tours.startNamed", "Start tour: {{name}}", { name: t.name }),
|
|
55
|
+
children: n
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
58
|
-
export {
|
|
59
|
+
export { a as TourPlayer, s as TourTriggerButton, o as usePlayTour };
|