@burdenoff/fe-libs 2026.1027.13 → 2026.1028.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/api.d.ts +18 -3
- package/dist/shared/assistant/api.js +215 -183
- package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -2
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/operations.d.ts +8 -0
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/productAiCredits.d.ts +28 -0
- package/dist/shared/assistant/productAiCredits.js +64 -0
- package/dist/shared/assistant/types.d.ts +15 -0
- package/dist/shared/assistant/ui/AssistantAiDisclaimer.d.ts +26 -0
- package/dist/shared/assistant/ui/AssistantAiDisclaimer.js +13 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1176 -1174
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +159 -154
- package/dist/shared/assistant/ui/WorkflowAssistantPanel.js +194 -192
- package/dist/shared/pages/AiPage.js +92 -66
- package/dist/shared/pages/ai/BreakdownPanel.d.ts +6 -0
- package/dist/shared/pages/ai/BreakdownPanel.js +117 -0
- package/dist/shared/pages/ai/CreditsPanel.d.ts +10 -0
- package/dist/shared/pages/ai/CreditsPanel.js +64 -0
- package/dist/shared/pages/ai/contracts.d.ts +35 -0
- package/dist/shared/pages/ai/contracts.js +93 -1
- package/dist/shared/providers/shell/useAssistantShellLabels.d.ts +7 -0
- package/dist/shared/providers/shell/useAssistantShellLabels.js +4 -1
- package/dist/shared-assistant.js +310 -308
- package/package.json +1 -1
|
@@ -2,38 +2,39 @@ import { useVoiceInput as e } from "../voice/useVoiceInput.js";
|
|
|
2
2
|
import { useWorkflowAssistantLabels as t } from "../../providers/shell/useAssistantShellLabels.js";
|
|
3
3
|
import { getSpeechEngine as n, subscribeSpeechEngine as r } from "../speech/createSpeechEngine.js";
|
|
4
4
|
import { chunkForSpeech as i, toSpeakableText as a } from "../voice/speakableText.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { AssistantAiDisclaimer as o } from "./AssistantAiDisclaimer.js";
|
|
6
|
+
import { AssistantWorkflowClient as ee, isWorkflowAssistantAdmissionRefusal as te } from "../workflowApi.js";
|
|
7
|
+
import { useCallback as s, useEffect as c, useRef as l, useState as u, useSyncExternalStore as ne } from "react";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
9
|
//#region src/shared/assistant/ui/WorkflowAssistantPanel.tsx
|
|
9
|
-
function
|
|
10
|
+
function p(e) {
|
|
10
11
|
let t = e.target.kind === "botmanor" ? e.target.agentId : e.target.courseId;
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ d(m, { ...e }, `${e.context.workspaceId}:${e.ownerId}:${e.target.kind}:${t}`);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
savedPending:
|
|
16
|
-
conversationUnavailable:
|
|
17
|
-
historyUnavailable:
|
|
18
|
-
olderUnavailable:
|
|
19
|
-
audioUnavailable:
|
|
20
|
-
unknownTurn:
|
|
21
|
-
cancelledTurn:
|
|
22
|
-
failedTurn:
|
|
23
|
-
answerPending:
|
|
24
|
-
admissionRefused:
|
|
25
|
-
interrupted:
|
|
26
|
-
cancelUnconfirmed:
|
|
27
|
-
},
|
|
28
|
-
target:
|
|
29
|
-
context:
|
|
30
|
-
ownerId:
|
|
31
|
-
}),
|
|
32
|
-
if (
|
|
33
|
-
|
|
14
|
+
function m({ target: p, context: m, ownerId: h, title: re, description: g, client: ie, voiceLanguage: ae }) {
|
|
15
|
+
let _ = t(), v = re ?? _.title, oe = {
|
|
16
|
+
savedPending: _.savedPending,
|
|
17
|
+
conversationUnavailable: _.conversationUnavailable,
|
|
18
|
+
historyUnavailable: _.historyUnavailable,
|
|
19
|
+
olderUnavailable: _.olderUnavailable,
|
|
20
|
+
audioUnavailable: _.audioUnavailable,
|
|
21
|
+
unknownTurn: _.unknownTurn,
|
|
22
|
+
cancelledTurn: _.cancelledTurn,
|
|
23
|
+
failedTurn: _.failedTurn,
|
|
24
|
+
answerPending: _.answerPending,
|
|
25
|
+
admissionRefused: _.admissionRefused,
|
|
26
|
+
interrupted: _.interrupted,
|
|
27
|
+
cancelUnconfirmed: _.cancelUnconfirmed
|
|
28
|
+
}, y = l(ie ?? new ee()), b = l(crypto.randomUUID()), se = l({
|
|
29
|
+
target: p,
|
|
30
|
+
context: m,
|
|
31
|
+
ownerId: h
|
|
32
|
+
}), x = l(null), [S, C] = u(!0), [w, T] = u(!1), E = l(null), D = l(!1), O = l(!1), [k, A] = u(!1), [j, M] = u([]), [N, P] = u(""), [ce, F] = u(null), [I, L] = u(!1), [R, z] = u(null), [B, V] = u(!1), [H, U] = u(null), [W, G] = u(null), K = s((e) => {
|
|
33
|
+
if (F(null), L(!!e?.turns.length), !e) {
|
|
34
|
+
b.current = crypto.randomUUID(), M([]), U(null);
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
b.current = e.clientConversationId;
|
|
37
38
|
let t = e.turns.map((t) => ({
|
|
38
39
|
input: {
|
|
39
40
|
clientTurnId: t.receipt.clientTurnId,
|
|
@@ -45,77 +46,77 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
|
|
|
45
46
|
e.pending && t.push({
|
|
46
47
|
input: e.pending,
|
|
47
48
|
receipt: null
|
|
48
|
-
}),
|
|
49
|
-
}, []),
|
|
49
|
+
}), M(t), U(e.pending), e.pending && G("savedPending");
|
|
50
|
+
}, []), q = s(async (e, t, n = null) => {
|
|
50
51
|
let r = new AbortController();
|
|
51
|
-
|
|
52
|
+
x.current?.abort(), x.current = r, C(!0), T(!1), G(null);
|
|
52
53
|
try {
|
|
53
|
-
let i = await
|
|
54
|
+
let i = await y.current.conversation(e, {
|
|
54
55
|
...t,
|
|
55
56
|
signal: r.signal
|
|
56
57
|
}, n);
|
|
57
58
|
if (n !== null && i === null) throw Error("Conversation unavailable");
|
|
58
|
-
r.signal.aborted ||
|
|
59
|
+
r.signal.aborted || K(i);
|
|
59
60
|
} catch {
|
|
60
|
-
r.signal.aborted || (
|
|
61
|
+
r.signal.aborted || (T(!0), G("conversationUnavailable"));
|
|
61
62
|
} finally {
|
|
62
|
-
|
|
63
|
+
x.current === r && !r.signal.aborted && C(!1);
|
|
63
64
|
}
|
|
64
|
-
}, [G]);
|
|
65
|
-
s(() => {
|
|
66
|
-
let e = se.current;
|
|
67
|
-
return e.context.workspaceId && e.ownerId ? K(e.target, e.context) : S(!1), () => b.current?.abort();
|
|
68
65
|
}, [K]);
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
c(() => {
|
|
67
|
+
let e = se.current;
|
|
68
|
+
return e.context.workspaceId && e.ownerId ? q(e.target, e.context) : C(!1), () => x.current?.abort();
|
|
69
|
+
}, [q]);
|
|
70
|
+
let le = async (e = null) => {
|
|
71
|
+
if (D.current || O.current || S || H || $.isActive) return;
|
|
71
72
|
let t = new AbortController();
|
|
72
|
-
|
|
73
|
+
x.current?.abort(), x.current = t, C(!0);
|
|
73
74
|
try {
|
|
74
|
-
let n = await
|
|
75
|
-
...
|
|
75
|
+
let n = await y.current.conversations(p, {
|
|
76
|
+
...m,
|
|
76
77
|
signal: t.signal
|
|
77
78
|
}, e);
|
|
78
|
-
t.signal.aborted ||
|
|
79
|
+
t.signal.aborted || z((t) => ({
|
|
79
80
|
nodes: e && t ? [...t.nodes, ...n.nodes.filter((e) => !t.nodes.some((t) => t.clientConversationId === e.clientConversationId))].slice(-100) : n.nodes,
|
|
80
81
|
nextCursor: n.nextCursor
|
|
81
82
|
}));
|
|
82
83
|
} catch {
|
|
83
|
-
t.signal.aborted ||
|
|
84
|
+
t.signal.aborted || G("historyUnavailable");
|
|
84
85
|
} finally {
|
|
85
|
-
!t.signal.aborted &&
|
|
86
|
+
!t.signal.aborted && x.current === t && C(!1);
|
|
86
87
|
}
|
|
87
|
-
},
|
|
88
|
-
if (
|
|
88
|
+
}, ue = async () => {
|
|
89
|
+
if (D.current || O.current || S || H || $.isActive || !I || j.length >= 200) return;
|
|
89
90
|
let e = new AbortController();
|
|
90
|
-
|
|
91
|
-
let t =
|
|
92
|
-
|
|
91
|
+
x.current?.abort(), x.current = e;
|
|
92
|
+
let t = b.current;
|
|
93
|
+
C(!0);
|
|
93
94
|
try {
|
|
94
|
-
let n = await
|
|
95
|
-
...
|
|
95
|
+
let n = await y.current.messages(p, {
|
|
96
|
+
...m,
|
|
96
97
|
signal: e.signal
|
|
97
98
|
}, t, ce);
|
|
98
|
-
!e.signal.aborted && t ===
|
|
99
|
+
!e.signal.aborted && t === b.current && (M((e) => [...n.turns.filter((t) => !e.some((e) => e.input.clientTurnId === t.receipt.clientTurnId)).map((e) => ({
|
|
99
100
|
input: {
|
|
100
101
|
clientTurnId: e.receipt.clientTurnId,
|
|
101
102
|
clientConversationId: t,
|
|
102
103
|
message: e.message
|
|
103
104
|
},
|
|
104
105
|
receipt: e.receipt
|
|
105
|
-
})), ...e]),
|
|
106
|
+
})), ...e]), F(n.nextCursor), L(n.nextCursor !== null));
|
|
106
107
|
} catch {
|
|
107
|
-
e.signal.aborted ||
|
|
108
|
+
e.signal.aborted || G("olderUnavailable");
|
|
108
109
|
} finally {
|
|
109
|
-
!e.signal.aborted &&
|
|
110
|
+
!e.signal.aborted && x.current === e && C(!1);
|
|
110
111
|
}
|
|
111
|
-
}, J =
|
|
112
|
+
}, J = l(null), Y = ne(r, n, n), X = l(!1), Z = l(0), [de, Q] = u(!1), $ = e({
|
|
112
113
|
language: ae,
|
|
113
|
-
onFinalize: (e) =>
|
|
114
|
+
onFinalize: (e) => P((t) => `${t}${t.trim() ? " " : ""}${e}`.slice(0, 8192))
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
+
c(() => () => {
|
|
116
117
|
X.current && (Z.current += 1, X.current = !1, Y.cancel());
|
|
117
118
|
}, [Y]);
|
|
118
|
-
let
|
|
119
|
+
let fe = (e) => {
|
|
119
120
|
if ($.isActive) return;
|
|
120
121
|
let t = ++Z.current;
|
|
121
122
|
X.current = !0, Q(!0), Y.speak(i(a(e)), {
|
|
@@ -126,63 +127,63 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
|
|
|
126
127
|
t === Z.current && (X.current = !1, Q(!1));
|
|
127
128
|
},
|
|
128
129
|
onError: (e) => {
|
|
129
|
-
t === Z.current && (X.current = !1, Q(!1), e !== "cancelled" &&
|
|
130
|
+
t === Z.current && (X.current = !1, Q(!1), e !== "cancelled" && G("audioUnavailable"));
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
|
-
},
|
|
133
|
+
}, pe = () => {
|
|
133
134
|
X.current && Y.cancel(), $.toggle();
|
|
134
135
|
};
|
|
135
|
-
|
|
136
|
+
c(() => () => E.current?.abort(), []), c(() => {
|
|
136
137
|
J.current?.scrollTo({
|
|
137
138
|
top: J.current.scrollHeight,
|
|
138
139
|
behavior: "smooth"
|
|
139
140
|
});
|
|
140
|
-
}, [
|
|
141
|
-
let
|
|
142
|
-
|
|
141
|
+
}, [j, B]);
|
|
142
|
+
let me = (e, t) => {
|
|
143
|
+
M((n) => n.map((n) => n.input.clientTurnId === e.clientTurnId ? {
|
|
143
144
|
...n,
|
|
144
145
|
receipt: t
|
|
145
146
|
} : n));
|
|
146
|
-
},
|
|
147
|
-
if (
|
|
148
|
-
|
|
147
|
+
}, he = async (e, t = !1) => {
|
|
148
|
+
if (D.current || O.current || !m.workspaceId || !h) return;
|
|
149
|
+
D.current = !0, V(!0), G(null), U(e);
|
|
149
150
|
let n = new AbortController();
|
|
150
|
-
|
|
151
|
+
E.current = n;
|
|
151
152
|
let r = {
|
|
152
|
-
...
|
|
153
|
+
...m,
|
|
153
154
|
signal: n.signal
|
|
154
155
|
}, i = !0;
|
|
155
156
|
try {
|
|
156
|
-
let a = t ? await
|
|
157
|
-
(!a || a.status === "READY") && await
|
|
158
|
-
let o = await
|
|
159
|
-
n.signal.aborted ||
|
|
157
|
+
let a = t ? await y.current.read(p, e.clientTurnId, r) : null;
|
|
158
|
+
(!a || a.status === "READY") && await y.current.start(p, e, r), i = !1;
|
|
159
|
+
let o = await y.current.wait(p, e.clientTurnId, r, { onProgress: (t) => {
|
|
160
|
+
n.signal.aborted || me(e, t);
|
|
160
161
|
} });
|
|
161
162
|
if (n.signal.aborted) return;
|
|
162
|
-
o.kind === "completed" ?
|
|
163
|
+
o.kind === "completed" ? U(null) : o.kind === "terminal" ? (U(null), G(o.receipt.status === "UNKNOWN" ? "unknownTurn" : o.receipt.status === "CANCELLED" ? "cancelledTurn" : "failedTurn")) : G("answerPending");
|
|
163
164
|
} catch (e) {
|
|
164
|
-
n.signal.aborted || (i &&
|
|
165
|
+
n.signal.aborted || (i && te(e) ? (U(null), G("admissionRefused")) : G("interrupted"));
|
|
165
166
|
} finally {
|
|
166
|
-
|
|
167
|
+
E.current === n && (E.current = null, D.current = !1, V(!1));
|
|
167
168
|
}
|
|
168
|
-
},
|
|
169
|
-
if (
|
|
169
|
+
}, ge = () => {
|
|
170
|
+
if (S || w || !N.trim() || D.current || O.current || $.isActive || H || N.length > 8192) return;
|
|
170
171
|
X.current && Y.cancel();
|
|
171
172
|
let e = {
|
|
172
173
|
clientTurnId: crypto.randomUUID(),
|
|
173
|
-
clientConversationId:
|
|
174
|
-
message:
|
|
174
|
+
clientConversationId: b.current,
|
|
175
|
+
message: N.trim()
|
|
175
176
|
};
|
|
176
|
-
|
|
177
|
+
M((t) => [...t, {
|
|
177
178
|
input: e,
|
|
178
179
|
receipt: null
|
|
179
|
-
}]),
|
|
180
|
-
},
|
|
181
|
-
let e =
|
|
182
|
-
if (!(!e ||
|
|
183
|
-
|
|
180
|
+
}]), P(""), he(e);
|
|
181
|
+
}, _e = async () => {
|
|
182
|
+
let e = H;
|
|
183
|
+
if (!(!e || O.current)) {
|
|
184
|
+
O.current = !0, A(!0), E.current?.abort();
|
|
184
185
|
try {
|
|
185
|
-
await
|
|
186
|
+
await y.current.cancel(e.clientTurnId, m) ? (M((t) => t.map((t) => t.input.clientTurnId === e.clientTurnId && t.receipt ? {
|
|
186
187
|
...t,
|
|
187
188
|
receipt: {
|
|
188
189
|
...t.receipt,
|
|
@@ -190,147 +191,147 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
|
|
|
190
191
|
partialMessage: null,
|
|
191
192
|
result: null
|
|
192
193
|
}
|
|
193
|
-
} : t)),
|
|
194
|
+
} : t)), U(null), G("cancelledTurn")) : G("cancelUnconfirmed");
|
|
194
195
|
} catch {
|
|
195
|
-
|
|
196
|
+
G("cancelUnconfirmed");
|
|
196
197
|
} finally {
|
|
197
|
-
|
|
198
|
+
O.current = !1, A(!1);
|
|
198
199
|
}
|
|
199
200
|
}
|
|
200
201
|
};
|
|
201
|
-
return /* @__PURE__ */
|
|
202
|
-
"aria-label":
|
|
202
|
+
return /* @__PURE__ */ f("section", {
|
|
203
|
+
"aria-label": v,
|
|
203
204
|
className: "flex flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface",
|
|
204
205
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ f("header", {
|
|
206
207
|
className: "border-b border-border-seam px-4 py-3",
|
|
207
208
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ d("h2", {
|
|
209
210
|
className: "text-sm font-semibold text-text-primary",
|
|
210
|
-
children:
|
|
211
|
+
children: v
|
|
211
212
|
}),
|
|
212
|
-
|
|
213
|
+
g && /* @__PURE__ */ d("p", {
|
|
213
214
|
className: "text-xs text-text-secondary",
|
|
214
|
-
children:
|
|
215
|
+
children: g
|
|
215
216
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ f("div", {
|
|
217
218
|
className: "mt-2 flex flex-wrap gap-2",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ d("button", {
|
|
219
220
|
type: "button",
|
|
220
|
-
disabled:
|
|
221
|
+
disabled: S || B || k || !!H || $.isActive || !m.workspaceId || !h,
|
|
221
222
|
onClick: () => {
|
|
222
|
-
|
|
223
|
+
x.current?.abort(), X.current && Y.cancel(), K(null), P(""), G(null), T(!1), z(null);
|
|
223
224
|
},
|
|
224
225
|
className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
|
|
225
|
-
children:
|
|
226
|
-
}), /* @__PURE__ */
|
|
226
|
+
children: _.newChat
|
|
227
|
+
}), /* @__PURE__ */ d("button", {
|
|
227
228
|
type: "button",
|
|
228
|
-
disabled:
|
|
229
|
-
onClick: () => void
|
|
229
|
+
disabled: S || B || k || !!H || $.isActive || !m.workspaceId || !h,
|
|
230
|
+
onClick: () => void le(),
|
|
230
231
|
className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
|
|
231
|
-
children:
|
|
232
|
+
children: _.savedConversations
|
|
232
233
|
})]
|
|
233
234
|
}),
|
|
234
|
-
|
|
235
|
-
"aria-label":
|
|
235
|
+
R && /* @__PURE__ */ f("nav", {
|
|
236
|
+
"aria-label": _.savedAssistantConversations,
|
|
236
237
|
className: "mt-2 max-h-40 overflow-auto",
|
|
237
238
|
children: [
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ d("ul", { children: R.nodes.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d("button", {
|
|
239
240
|
type: "button",
|
|
240
|
-
disabled:
|
|
241
|
-
"aria-current": e.clientConversationId ===
|
|
241
|
+
disabled: S || B || k || !!H || $.isActive,
|
|
242
|
+
"aria-current": e.clientConversationId === b.current ? "true" : void 0,
|
|
242
243
|
onClick: () => {
|
|
243
|
-
X.current && Y.cancel(),
|
|
244
|
+
X.current && Y.cancel(), P(""), q(p, m, e.clientConversationId);
|
|
244
245
|
},
|
|
245
246
|
className: "rounded-lg px-2 py-1 text-xs",
|
|
246
247
|
children: new Date(e.createdAt).toLocaleString()
|
|
247
248
|
}) }, e.clientConversationId)) }),
|
|
248
|
-
|
|
249
|
+
R.nodes.length === 0 && /* @__PURE__ */ d("p", {
|
|
249
250
|
className: "text-xs",
|
|
250
|
-
children:
|
|
251
|
+
children: _.noSavedConversations
|
|
251
252
|
}),
|
|
252
|
-
|
|
253
|
+
R.nextCursor && /* @__PURE__ */ d("button", {
|
|
253
254
|
type: "button",
|
|
254
|
-
disabled:
|
|
255
|
-
onClick: () => void
|
|
255
|
+
disabled: S || B || k || !!H || $.isActive,
|
|
256
|
+
onClick: () => void le(R.nextCursor),
|
|
256
257
|
className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
|
|
257
|
-
children:
|
|
258
|
+
children: _.loadOlderConversations
|
|
258
259
|
})
|
|
259
260
|
]
|
|
260
261
|
})
|
|
261
262
|
]
|
|
262
263
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ f("div", {
|
|
264
265
|
ref: J,
|
|
265
266
|
role: "log",
|
|
266
|
-
"aria-label":
|
|
267
|
+
"aria-label": _.assistantConversation,
|
|
267
268
|
"aria-live": "polite",
|
|
268
269
|
className: "max-h-96 min-h-40 overflow-y-auto p-4",
|
|
269
270
|
children: [
|
|
270
|
-
|
|
271
|
+
S && /* @__PURE__ */ d("p", {
|
|
271
272
|
role: "status",
|
|
272
273
|
className: "text-sm text-text-secondary",
|
|
273
|
-
children:
|
|
274
|
+
children: _.loadingYourConversation
|
|
274
275
|
}),
|
|
275
|
-
!
|
|
276
|
+
!S && j.length === 0 && /* @__PURE__ */ d("p", {
|
|
276
277
|
className: "text-sm text-text-secondary",
|
|
277
|
-
children:
|
|
278
|
+
children: _.emptyHint
|
|
278
279
|
}),
|
|
279
|
-
|
|
280
|
+
I && j.length < 200 && /* @__PURE__ */ d("button", {
|
|
280
281
|
type: "button",
|
|
281
|
-
onClick: () => void
|
|
282
|
-
disabled:
|
|
282
|
+
onClick: () => void ue(),
|
|
283
|
+
disabled: S || B || k || !!H || $.isActive,
|
|
283
284
|
className: "mb-4 text-sm underline",
|
|
284
|
-
children:
|
|
285
|
+
children: _.loadOlderMessages
|
|
285
286
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ d("ol", {
|
|
287
288
|
className: "space-y-4",
|
|
288
|
-
children:
|
|
289
|
-
/* @__PURE__ */
|
|
289
|
+
children: j.map((e) => /* @__PURE__ */ f("li", { children: [
|
|
290
|
+
/* @__PURE__ */ d("p", {
|
|
290
291
|
className: "text-xs font-semibold text-text-primary",
|
|
291
|
-
children:
|
|
292
|
+
children: _.you
|
|
292
293
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ d("p", {
|
|
294
295
|
className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
|
|
295
296
|
children: e.input.message
|
|
296
297
|
}),
|
|
297
|
-
e.receipt?.status === "RUNNING" && e.receipt.partialMessage && /* @__PURE__ */
|
|
298
|
+
e.receipt?.status === "RUNNING" && e.receipt.partialMessage && /* @__PURE__ */ f("div", {
|
|
298
299
|
className: "mt-3",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ d("p", {
|
|
300
301
|
className: "text-xs text-text-secondary",
|
|
301
|
-
children:
|
|
302
|
-
}), /* @__PURE__ */
|
|
302
|
+
children: _.generatingAnswer
|
|
303
|
+
}), /* @__PURE__ */ d("p", {
|
|
303
304
|
className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
|
|
304
305
|
children: e.receipt.partialMessage
|
|
305
306
|
})]
|
|
306
307
|
}),
|
|
307
|
-
e.receipt?.status === "COMPLETED" && e.receipt.result && /* @__PURE__ */
|
|
308
|
+
e.receipt?.status === "COMPLETED" && e.receipt.result && /* @__PURE__ */ f("div", {
|
|
308
309
|
className: "mt-3",
|
|
309
310
|
children: [
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ d("p", {
|
|
311
312
|
className: "text-xs font-semibold text-text-primary",
|
|
312
|
-
children:
|
|
313
|
+
children: v
|
|
313
314
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ d("p", {
|
|
315
316
|
className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
|
|
316
317
|
children: e.receipt.result.message
|
|
317
318
|
}),
|
|
318
|
-
Y.isSupported() && /* @__PURE__ */
|
|
319
|
+
Y.isSupported() && /* @__PURE__ */ d("button", {
|
|
319
320
|
type: "button",
|
|
320
321
|
onClick: () => {
|
|
321
322
|
let t = e.receipt?.result;
|
|
322
|
-
t &&
|
|
323
|
+
t && fe(t.message);
|
|
323
324
|
},
|
|
324
325
|
disabled: $.isActive,
|
|
325
326
|
className: "mt-2 rounded-lg border border-border-seam px-2 py-1 text-xs",
|
|
326
|
-
children:
|
|
327
|
+
children: _.readAnswerAloud
|
|
327
328
|
}),
|
|
328
|
-
e.receipt.result.sources.length > 0 && /* @__PURE__ */
|
|
329
|
-
"aria-label":
|
|
329
|
+
e.receipt.result.sources.length > 0 && /* @__PURE__ */ d("ul", {
|
|
330
|
+
"aria-label": _.answerSources,
|
|
330
331
|
className: "mt-2 space-y-1 text-xs text-text-secondary",
|
|
331
|
-
children: e.receipt.result.sources.map((e) => /* @__PURE__ */
|
|
332
|
+
children: e.receipt.result.sources.map((e) => /* @__PURE__ */ d("li", {
|
|
332
333
|
title: e.documentId,
|
|
333
|
-
children:
|
|
334
|
+
children: _.sourceReference({
|
|
334
335
|
reference: e.reference,
|
|
335
336
|
documentId: e.documentId
|
|
336
337
|
})
|
|
@@ -340,98 +341,99 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
|
|
|
340
341
|
})
|
|
341
342
|
] }, e.input.clientTurnId))
|
|
342
343
|
}),
|
|
343
|
-
|
|
344
|
+
B && /* @__PURE__ */ d("p", {
|
|
344
345
|
role: "status",
|
|
345
346
|
className: "mt-3 text-sm text-text-secondary",
|
|
346
|
-
children:
|
|
347
|
+
children: _.preparingYourAnswer
|
|
347
348
|
})
|
|
348
349
|
]
|
|
349
350
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ f("div", {
|
|
351
352
|
className: "border-t border-border-seam p-3",
|
|
352
353
|
children: [
|
|
353
|
-
$.interim && /* @__PURE__ */
|
|
354
|
+
$.interim && /* @__PURE__ */ d("p", {
|
|
354
355
|
role: "status",
|
|
355
356
|
className: "mb-2 text-sm text-text-secondary",
|
|
356
357
|
children: $.interim
|
|
357
358
|
}),
|
|
358
|
-
$.error && /* @__PURE__ */
|
|
359
|
+
$.error && /* @__PURE__ */ d("p", {
|
|
359
360
|
role: "status",
|
|
360
361
|
className: "mb-2 text-sm text-text-secondary",
|
|
361
|
-
children:
|
|
362
|
+
children: _.dictationUnavailable
|
|
362
363
|
}),
|
|
363
|
-
|
|
364
|
+
W && /* @__PURE__ */ d("p", {
|
|
364
365
|
role: "status",
|
|
365
366
|
className: "mb-2 text-sm text-text-secondary",
|
|
366
|
-
children: oe[
|
|
367
|
+
children: oe[W]
|
|
367
368
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ d("label", {
|
|
369
370
|
className: "sr-only",
|
|
370
|
-
htmlFor: `assistant-question-${
|
|
371
|
-
children:
|
|
371
|
+
htmlFor: `assistant-question-${b.current}`,
|
|
372
|
+
children: _.question
|
|
372
373
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
id: `assistant-question-${
|
|
375
|
-
value:
|
|
376
|
-
onChange: (e) =>
|
|
374
|
+
/* @__PURE__ */ d("textarea", {
|
|
375
|
+
id: `assistant-question-${b.current}`,
|
|
376
|
+
value: N,
|
|
377
|
+
onChange: (e) => P(e.target.value),
|
|
377
378
|
onKeyDown: (e) => {
|
|
378
|
-
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(),
|
|
379
|
+
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), ge());
|
|
379
380
|
},
|
|
380
381
|
maxLength: 8192,
|
|
381
382
|
rows: 2,
|
|
382
|
-
placeholder:
|
|
383
|
-
disabled:
|
|
383
|
+
placeholder: _.askAQuestion,
|
|
384
|
+
disabled: S || w || B || k || !!H || !m.workspaceId || !h,
|
|
384
385
|
className: "w-full rounded-lg border border-border-seam bg-bg-sunken p-2 text-sm text-text-primary"
|
|
385
386
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ f("div", {
|
|
387
388
|
className: "mt-2 flex flex-wrap justify-end gap-2",
|
|
388
389
|
children: [
|
|
389
|
-
$.isSupported && /* @__PURE__ */
|
|
390
|
+
$.isSupported && /* @__PURE__ */ d("button", {
|
|
390
391
|
type: "button",
|
|
391
|
-
onClick:
|
|
392
|
-
disabled:
|
|
392
|
+
onClick: pe,
|
|
393
|
+
disabled: S || w || B || k || !!H,
|
|
393
394
|
"aria-pressed": $.isActive,
|
|
394
395
|
className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
|
|
395
|
-
children: $.isActive ?
|
|
396
|
+
children: $.isActive ? _.stopDictation : _.dictateQuestion
|
|
396
397
|
}),
|
|
397
|
-
|
|
398
|
+
de && /* @__PURE__ */ d("button", {
|
|
398
399
|
type: "button",
|
|
399
400
|
onClick: () => Y.cancel(),
|
|
400
401
|
className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
|
|
401
|
-
children:
|
|
402
|
+
children: _.stopAudio
|
|
402
403
|
}),
|
|
403
|
-
|
|
404
|
+
w && !S && /* @__PURE__ */ d("button", {
|
|
404
405
|
type: "button",
|
|
405
|
-
onClick: () => void
|
|
406
|
+
onClick: () => void q(p, m),
|
|
406
407
|
className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
|
|
407
|
-
children:
|
|
408
|
+
children: _.reloadConversation
|
|
408
409
|
}),
|
|
409
|
-
|
|
410
|
+
H && !B && !k && /* @__PURE__ */ d("button", {
|
|
410
411
|
type: "button",
|
|
411
|
-
onClick: () => void
|
|
412
|
+
onClick: () => void he(H, !0),
|
|
412
413
|
className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
|
|
413
|
-
children:
|
|
414
|
+
children: _.recoverTurn
|
|
414
415
|
}),
|
|
415
|
-
|
|
416
|
+
H && /* @__PURE__ */ d("button", {
|
|
416
417
|
type: "button",
|
|
417
|
-
onClick: () => void
|
|
418
|
-
disabled:
|
|
418
|
+
onClick: () => void _e(),
|
|
419
|
+
disabled: k,
|
|
419
420
|
className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
|
|
420
|
-
children:
|
|
421
|
+
children: _.cancelTurn
|
|
421
422
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ d("button", {
|
|
423
424
|
type: "button",
|
|
424
|
-
onClick:
|
|
425
|
-
disabled: !
|
|
425
|
+
onClick: ge,
|
|
426
|
+
disabled: !N.trim() || $.isActive || k || S || w || B || !!H || !m.workspaceId || !h,
|
|
426
427
|
className: "rounded-lg bg-[var(--color-accent-soft)] px-3 py-2 text-sm disabled:opacity-50",
|
|
427
|
-
children:
|
|
428
|
+
children: _.ask
|
|
428
429
|
})
|
|
429
430
|
]
|
|
430
|
-
})
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ d(o, { className: "mt-2" })
|
|
431
433
|
]
|
|
432
434
|
})
|
|
433
435
|
]
|
|
434
436
|
});
|
|
435
437
|
}
|
|
436
438
|
//#endregion
|
|
437
|
-
export {
|
|
439
|
+
export { p as WorkflowAssistantPanel };
|