@arbidocs/react 0.4.2 → 0.4.4
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/README.md +24 -0
- package/dist/{chunk-3CLGHHME.js → chunk-MIJRORQL.js} +395 -313
- package/dist/chunk-MIJRORQL.js.map +1 -0
- package/dist/{chunk-OU2QLIKS.cjs → chunk-ORKGCXG3.cjs} +444 -361
- package/dist/chunk-ORKGCXG3.cjs.map +1 -0
- package/dist/index.cjs +990 -1337
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1820 -291
- package/dist/index.d.ts +1820 -291
- package/dist/index.js +743 -1123
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +126 -126
- package/dist/ui/index.d.cts +12 -12
- package/dist/ui/index.d.ts +12 -12
- package/dist/ui/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-3CLGHHME.js.map +0 -1
- package/dist/chunk-OU2QLIKS.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBXP6S34V_cjs = require('./chunk-BXP6S34V.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkORKGCXG3_cjs = require('./chunk-ORKGCXG3.cjs');
|
|
5
5
|
var chunkRZQACYNQ_cjs = require('./chunk-RZQACYNQ.cjs');
|
|
6
6
|
var chunk7IOCMCC5_cjs = require('./chunk-7IOCMCC5.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactQuery = require('@tanstack/react-query');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
9
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
11
|
var browser = require('@arbidocs/sdk/browser');
|
|
11
|
-
var lucideReact = require('lucide-react');
|
|
12
12
|
var client = require('@arbidocs/client');
|
|
13
13
|
var zustand = require('zustand');
|
|
14
14
|
var diff = require('diff');
|
|
@@ -25,566 +25,23 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
25
25
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
26
26
|
var Cropper__default = /*#__PURE__*/_interopDefault(Cropper);
|
|
27
27
|
|
|
28
|
-
// src/
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
borderColor: "#e5e7eb",
|
|
36
|
-
userBubbleColor: "#f3f4f6",
|
|
37
|
-
userBubbleTextColor: "#111827",
|
|
38
|
-
assistantBubbleColor: "rgba(0, 173, 239, 0.08)",
|
|
39
|
-
assistantBubbleTextColor: "#111827",
|
|
40
|
-
borderRadius: "8px",
|
|
41
|
-
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"
|
|
42
|
-
};
|
|
43
|
-
var DEFAULT_LABELS = {
|
|
44
|
-
title: "Chat",
|
|
45
|
-
email: "Email",
|
|
46
|
-
password: "Password",
|
|
47
|
-
loginButton: "Log in",
|
|
48
|
-
loginButtonLoading: "Logging in...",
|
|
49
|
-
registerButton: "Create account",
|
|
50
|
-
sendCodeButton: "Email me a code",
|
|
51
|
-
haveCodeButton: "I have an invitation code",
|
|
52
|
-
verificationCode: "Verification code",
|
|
53
|
-
confirmPassword: "Confirm password",
|
|
54
|
-
firstName: "First name",
|
|
55
|
-
lastName: "Last name",
|
|
56
|
-
switchToRegister: "Create account",
|
|
57
|
-
switchToLogin: "Back to login",
|
|
58
|
-
selectWorkspace: "Select a workspace",
|
|
59
|
-
workspacePlaceholder: "Choose...",
|
|
60
|
-
continueButton: "Continue",
|
|
61
|
-
createWorkspace: "Create new workspace",
|
|
62
|
-
workspaceName: "Workspace name",
|
|
63
|
-
createButton: "Create",
|
|
64
|
-
changeWorkspace: "Change workspace",
|
|
65
|
-
documents: "Documents",
|
|
66
|
-
sendButton: "Send",
|
|
67
|
-
placeholder: "Ask a question...",
|
|
68
|
-
uploadButton: "Upload",
|
|
69
|
-
uploading: "Uploading...",
|
|
70
|
-
emptyNoDocs: "No documents found in this workspace.",
|
|
71
|
-
emptyNoSelection: "Select at least one document to start chatting.",
|
|
72
|
-
emptyReady: "Ask a question about your documents."
|
|
73
|
-
};
|
|
74
|
-
function getTheme(partial) {
|
|
75
|
-
return { ...DEFAULT_THEME, ...partial };
|
|
76
|
-
}
|
|
77
|
-
function getLabels(partial) {
|
|
78
|
-
return { ...DEFAULT_LABELS, ...partial };
|
|
79
|
-
}
|
|
80
|
-
function containerStyle(theme, width, height) {
|
|
81
|
-
return {
|
|
82
|
-
width: typeof width === "number" ? `${width}px` : width,
|
|
83
|
-
height: typeof height === "number" ? `${height}px` : height,
|
|
84
|
-
display: "flex",
|
|
85
|
-
flexDirection: "column",
|
|
86
|
-
fontFamily: theme.fontFamily,
|
|
87
|
-
fontSize: "14px",
|
|
88
|
-
lineHeight: "1.5",
|
|
89
|
-
color: theme.textColor,
|
|
90
|
-
backgroundColor: theme.backgroundColor,
|
|
91
|
-
border: `1px solid ${theme.borderColor}`,
|
|
92
|
-
borderRadius: theme.borderRadius,
|
|
93
|
-
overflow: "hidden",
|
|
94
|
-
boxSizing: "border-box"
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
function headerStyle(theme) {
|
|
98
|
-
return {
|
|
99
|
-
display: "flex",
|
|
100
|
-
alignItems: "center",
|
|
101
|
-
padding: "12px 16px",
|
|
102
|
-
fontWeight: 600,
|
|
103
|
-
fontSize: "15px",
|
|
104
|
-
borderBottom: `1px solid ${theme.borderColor}`,
|
|
105
|
-
flexShrink: 0
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function bodyStyle() {
|
|
109
|
-
return {
|
|
110
|
-
flex: 1,
|
|
111
|
-
display: "flex",
|
|
112
|
-
flexDirection: "column",
|
|
113
|
-
overflow: "hidden"
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function formContainerStyle() {
|
|
117
|
-
return {
|
|
118
|
-
flex: 1,
|
|
119
|
-
display: "flex",
|
|
120
|
-
flexDirection: "column",
|
|
121
|
-
justifyContent: "center",
|
|
122
|
-
padding: "24px 16px",
|
|
123
|
-
gap: "12px"
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function labelStyle(theme) {
|
|
127
|
-
return {
|
|
128
|
-
fontSize: "13px",
|
|
129
|
-
fontWeight: 500,
|
|
130
|
-
color: theme.textColor,
|
|
131
|
-
marginBottom: "4px"
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
function inputStyle(theme) {
|
|
135
|
-
return {
|
|
136
|
-
width: "100%",
|
|
137
|
-
padding: "8px 12px",
|
|
138
|
-
fontSize: "14px",
|
|
139
|
-
fontFamily: theme.fontFamily,
|
|
140
|
-
color: theme.textColor,
|
|
141
|
-
backgroundColor: theme.backgroundColor,
|
|
142
|
-
border: `1px solid ${theme.borderColor}`,
|
|
143
|
-
borderRadius: "8px",
|
|
144
|
-
outline: "none",
|
|
145
|
-
boxSizing: "border-box"
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function selectStyle(theme) {
|
|
149
|
-
return {
|
|
150
|
-
...inputStyle(theme),
|
|
151
|
-
cursor: "pointer",
|
|
152
|
-
appearance: "auto"
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function buttonStyle(theme, disabled) {
|
|
156
|
-
return {
|
|
157
|
-
padding: "8px 16px",
|
|
158
|
-
fontSize: "14px",
|
|
159
|
-
fontWeight: 500,
|
|
160
|
-
fontFamily: theme.fontFamily,
|
|
161
|
-
color: "#ffffff",
|
|
162
|
-
backgroundColor: disabled ? theme.mutedColor : theme.primaryColor,
|
|
163
|
-
border: "none",
|
|
164
|
-
borderRadius: "8px",
|
|
165
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
166
|
-
opacity: disabled ? 0.6 : 1,
|
|
167
|
-
transition: "opacity 150ms"
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function errorStyle() {
|
|
171
|
-
return {
|
|
172
|
-
fontSize: "13px",
|
|
173
|
-
color: "#ef4444",
|
|
174
|
-
margin: "4px 0 0"
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
function messagesContainerStyle() {
|
|
178
|
-
return {
|
|
179
|
-
flex: 1,
|
|
180
|
-
overflowY: "auto",
|
|
181
|
-
padding: "12px 16px",
|
|
182
|
-
display: "flex",
|
|
183
|
-
flexDirection: "column",
|
|
184
|
-
gap: "8px"
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
function messageBubbleStyle(theme, role) {
|
|
188
|
-
const isUser = role === "user";
|
|
189
|
-
return {
|
|
190
|
-
maxWidth: "85%",
|
|
191
|
-
padding: "8px 12px",
|
|
192
|
-
borderRadius: "12px",
|
|
193
|
-
fontSize: "14px",
|
|
194
|
-
lineHeight: "1.5",
|
|
195
|
-
wordBreak: "break-word",
|
|
196
|
-
whiteSpace: "pre-wrap",
|
|
197
|
-
alignSelf: isUser ? "flex-end" : "flex-start",
|
|
198
|
-
backgroundColor: isUser ? theme.userBubbleColor : theme.assistantBubbleColor,
|
|
199
|
-
color: isUser ? theme.userBubbleTextColor : theme.assistantBubbleTextColor
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function inputBarStyle(theme) {
|
|
203
|
-
return {
|
|
204
|
-
display: "flex",
|
|
205
|
-
gap: "8px",
|
|
206
|
-
padding: "12px 16px",
|
|
207
|
-
borderTop: `1px solid ${theme.borderColor}`,
|
|
208
|
-
flexShrink: 0
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
function chatInputStyle(theme) {
|
|
212
|
-
return {
|
|
213
|
-
...inputStyle(theme),
|
|
214
|
-
flex: 1
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function sendButtonStyle(theme, disabled) {
|
|
218
|
-
return {
|
|
219
|
-
...buttonStyle(theme, disabled),
|
|
220
|
-
padding: "8px 14px",
|
|
221
|
-
flexShrink: 0
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
function docSelectorStyle(theme) {
|
|
225
|
-
return {
|
|
226
|
-
padding: "8px 16px",
|
|
227
|
-
borderBottom: `1px solid ${theme.borderColor}`,
|
|
228
|
-
flexShrink: 0
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
function docToggleStyle(theme) {
|
|
232
|
-
return {
|
|
233
|
-
display: "flex",
|
|
234
|
-
alignItems: "center",
|
|
235
|
-
gap: "6px",
|
|
236
|
-
fontSize: "13px",
|
|
237
|
-
fontWeight: 500,
|
|
238
|
-
color: theme.mutedColor,
|
|
239
|
-
cursor: "pointer",
|
|
240
|
-
background: "none",
|
|
241
|
-
border: "none",
|
|
242
|
-
padding: 0,
|
|
243
|
-
fontFamily: theme.fontFamily
|
|
244
|
-
};
|
|
28
|
+
// src/credits.ts
|
|
29
|
+
var DEFAULT_USD_PER_CREDIT = 0.01;
|
|
30
|
+
function formatCredits(credits, options = {}) {
|
|
31
|
+
const { unit = true, locale = "en-US" } = options;
|
|
32
|
+
const whole = Math.round(Number.isFinite(credits) ? credits : 0);
|
|
33
|
+
const digits = whole.toLocaleString(locale);
|
|
34
|
+
return unit ? `${digits} ${whole === 1 ? "credit" : "credits"}` : digits;
|
|
245
35
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
248
|
-
marginTop: "6px",
|
|
249
|
-
display: "flex",
|
|
250
|
-
flexDirection: "column",
|
|
251
|
-
gap: "4px",
|
|
252
|
-
maxHeight: "120px",
|
|
253
|
-
overflowY: "auto"
|
|
254
|
-
};
|
|
36
|
+
function creditsToUsd(credits, usdPerCredit = DEFAULT_USD_PER_CREDIT) {
|
|
37
|
+
return credits * usdPerCredit;
|
|
255
38
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
alignItems: "center",
|
|
260
|
-
gap: "6px",
|
|
261
|
-
fontSize: "13px",
|
|
262
|
-
color: theme.textColor,
|
|
263
|
-
cursor: "pointer",
|
|
264
|
-
textAlign: "left"
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
function emptyStateStyle(theme) {
|
|
268
|
-
return {
|
|
269
|
-
flex: 1,
|
|
270
|
-
display: "flex",
|
|
271
|
-
alignItems: "center",
|
|
272
|
-
justifyContent: "center",
|
|
273
|
-
color: theme.mutedColor,
|
|
274
|
-
fontSize: "13px",
|
|
275
|
-
padding: "24px",
|
|
276
|
-
textAlign: "center"
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
function loadingContainerStyle() {
|
|
280
|
-
return {
|
|
281
|
-
flex: 1,
|
|
282
|
-
display: "flex",
|
|
283
|
-
alignItems: "center",
|
|
284
|
-
justifyContent: "center",
|
|
285
|
-
gap: "8px",
|
|
286
|
-
fontSize: "13px"
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
function brandingStyle(theme) {
|
|
290
|
-
return {
|
|
291
|
-
display: "flex",
|
|
292
|
-
alignItems: "center",
|
|
293
|
-
justifyContent: "center",
|
|
294
|
-
gap: "4px",
|
|
295
|
-
padding: "6px 16px",
|
|
296
|
-
fontSize: "11px",
|
|
297
|
-
color: theme.mutedColor,
|
|
298
|
-
borderTop: `1px solid ${theme.borderColor}`,
|
|
299
|
-
flexShrink: 0,
|
|
300
|
-
userSelect: "none"
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function brandingLinkStyle(theme) {
|
|
304
|
-
return {
|
|
305
|
-
color: theme.mutedColor,
|
|
306
|
-
fontWeight: 600,
|
|
307
|
-
textDecoration: "none"
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
function linkButtonStyle(theme) {
|
|
311
|
-
return {
|
|
312
|
-
background: "none",
|
|
313
|
-
border: "none",
|
|
314
|
-
padding: 0,
|
|
315
|
-
fontSize: "13px",
|
|
316
|
-
color: theme.primaryColor,
|
|
317
|
-
cursor: "pointer",
|
|
318
|
-
fontFamily: theme.fontFamily,
|
|
319
|
-
textDecoration: "underline"
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
function secondaryButtonStyle(theme, disabled) {
|
|
323
|
-
return {
|
|
324
|
-
padding: "4px 10px",
|
|
325
|
-
fontSize: "12px",
|
|
326
|
-
fontWeight: 500,
|
|
327
|
-
fontFamily: theme.fontFamily,
|
|
328
|
-
color: disabled ? theme.mutedColor : theme.primaryColor,
|
|
329
|
-
backgroundColor: "transparent",
|
|
330
|
-
border: `1px solid ${disabled ? theme.borderColor : theme.primaryColor}`,
|
|
331
|
-
borderRadius: "6px",
|
|
332
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
333
|
-
opacity: disabled ? 0.6 : 1,
|
|
334
|
-
transition: "opacity 150ms",
|
|
335
|
-
whiteSpace: "nowrap"
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
function fileInputStyle() {
|
|
339
|
-
return { display: "none" };
|
|
340
|
-
}
|
|
341
|
-
function agentStatusStyle(theme) {
|
|
342
|
-
return {
|
|
343
|
-
fontSize: "12px",
|
|
344
|
-
color: theme.mutedColor,
|
|
345
|
-
fontStyle: "italic",
|
|
346
|
-
padding: "4px 0",
|
|
347
|
-
alignSelf: "flex-start"
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
function AuthScreen({ theme, labels, onLogin }) {
|
|
351
|
-
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
352
|
-
const [mode, setMode] = React.useState("login");
|
|
353
|
-
const [step, setStep] = React.useState("email");
|
|
354
|
-
const [email, setEmail] = React.useState("");
|
|
355
|
-
const [password, setPassword] = React.useState("");
|
|
356
|
-
const [confirmPw, setConfirmPw] = React.useState("");
|
|
357
|
-
const [code, setCode] = React.useState("");
|
|
358
|
-
const [firstName, setFirstName] = React.useState("");
|
|
359
|
-
const [lastName, setLastName] = React.useState("");
|
|
360
|
-
const [loading, setLoading] = React.useState(false);
|
|
361
|
-
const [error, setError] = React.useState("");
|
|
362
|
-
const resetForm = () => {
|
|
363
|
-
setPassword("");
|
|
364
|
-
setConfirmPw("");
|
|
365
|
-
setCode("");
|
|
366
|
-
setFirstName("");
|
|
367
|
-
setLastName("");
|
|
368
|
-
setError("");
|
|
369
|
-
setStep("email");
|
|
370
|
-
};
|
|
371
|
-
const switchMode = (next) => {
|
|
372
|
-
resetForm();
|
|
373
|
-
setMode(next);
|
|
374
|
-
};
|
|
375
|
-
const handleLogin = async (e) => {
|
|
376
|
-
e.preventDefault();
|
|
377
|
-
setLoading(true);
|
|
378
|
-
setError("");
|
|
379
|
-
try {
|
|
380
|
-
await arbi.login(email, password);
|
|
381
|
-
onLogin();
|
|
382
|
-
} catch (err) {
|
|
383
|
-
setError(err instanceof Error ? err.message : "Login failed");
|
|
384
|
-
} finally {
|
|
385
|
-
setLoading(false);
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
const handleHaveCode = () => {
|
|
389
|
-
setError("");
|
|
390
|
-
setStep("verify");
|
|
391
|
-
};
|
|
392
|
-
const handleEmailCode = async () => {
|
|
393
|
-
if (!email) return;
|
|
394
|
-
setLoading(true);
|
|
395
|
-
setError("");
|
|
396
|
-
try {
|
|
397
|
-
await arbi.requestVerification(email);
|
|
398
|
-
setStep("verify");
|
|
399
|
-
} catch (err) {
|
|
400
|
-
setError(err instanceof Error ? err.message : "Failed to send verification code");
|
|
401
|
-
} finally {
|
|
402
|
-
setLoading(false);
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
const handleRegister = async (e) => {
|
|
406
|
-
e.preventDefault();
|
|
407
|
-
if (password !== confirmPw) {
|
|
408
|
-
setError("Passwords do not match");
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
setLoading(true);
|
|
412
|
-
setError("");
|
|
413
|
-
try {
|
|
414
|
-
await arbi.register({ email, password, verificationCode: code, firstName, lastName });
|
|
415
|
-
await arbi.login(email, password);
|
|
416
|
-
onLogin();
|
|
417
|
-
} catch (err) {
|
|
418
|
-
setError(err instanceof Error ? err.message : "Registration failed");
|
|
419
|
-
} finally {
|
|
420
|
-
setLoading(false);
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
if (mode === "login") {
|
|
424
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleLogin, style: formContainerStyle(), children: [
|
|
425
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
426
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.email }),
|
|
427
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
428
|
-
"input",
|
|
429
|
-
{
|
|
430
|
-
type: "email",
|
|
431
|
-
value: email,
|
|
432
|
-
onChange: (e) => setEmail(e.target.value),
|
|
433
|
-
placeholder: "you@example.com",
|
|
434
|
-
autoComplete: "email",
|
|
435
|
-
required: true,
|
|
436
|
-
style: inputStyle(theme)
|
|
437
|
-
}
|
|
438
|
-
)
|
|
439
|
-
] }),
|
|
440
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
441
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.password }),
|
|
442
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
443
|
-
"input",
|
|
444
|
-
{
|
|
445
|
-
type: "password",
|
|
446
|
-
value: password,
|
|
447
|
-
onChange: (e) => setPassword(e.target.value),
|
|
448
|
-
autoComplete: "current-password",
|
|
449
|
-
required: true,
|
|
450
|
-
style: inputStyle(theme)
|
|
451
|
-
}
|
|
452
|
-
)
|
|
453
|
-
] }),
|
|
454
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: loading, style: buttonStyle(theme, loading), children: loading ? labels.loginButtonLoading : labels.loginButton }),
|
|
455
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(), children: error }),
|
|
456
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
457
|
-
"button",
|
|
458
|
-
{
|
|
459
|
-
type: "button",
|
|
460
|
-
onClick: () => switchMode("register"),
|
|
461
|
-
style: linkButtonStyle(theme),
|
|
462
|
-
children: labels.switchToRegister
|
|
463
|
-
}
|
|
464
|
-
) })
|
|
465
|
-
] });
|
|
466
|
-
}
|
|
467
|
-
if (step === "email") {
|
|
468
|
-
const noEmail = !email.trim();
|
|
469
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: formContainerStyle(), children: [
|
|
470
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
471
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.email }),
|
|
472
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
473
|
-
"input",
|
|
474
|
-
{
|
|
475
|
-
type: "email",
|
|
476
|
-
value: email,
|
|
477
|
-
onChange: (e) => setEmail(e.target.value),
|
|
478
|
-
placeholder: "you@example.com",
|
|
479
|
-
autoComplete: "email",
|
|
480
|
-
style: inputStyle(theme)
|
|
481
|
-
}
|
|
482
|
-
)
|
|
483
|
-
] }),
|
|
484
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
485
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
486
|
-
"button",
|
|
487
|
-
{
|
|
488
|
-
type: "button",
|
|
489
|
-
onClick: handleHaveCode,
|
|
490
|
-
disabled: noEmail,
|
|
491
|
-
style: { ...buttonStyle(theme, noEmail), flex: 1 },
|
|
492
|
-
children: labels.haveCodeButton
|
|
493
|
-
}
|
|
494
|
-
),
|
|
495
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
496
|
-
"button",
|
|
497
|
-
{
|
|
498
|
-
type: "button",
|
|
499
|
-
onClick: handleEmailCode,
|
|
500
|
-
disabled: noEmail || loading,
|
|
501
|
-
style: { ...buttonStyle(theme, noEmail || loading), flex: 1 },
|
|
502
|
-
children: loading ? "..." : labels.sendCodeButton
|
|
503
|
-
}
|
|
504
|
-
)
|
|
505
|
-
] }),
|
|
506
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(), children: error }),
|
|
507
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => switchMode("login"), style: linkButtonStyle(theme), children: labels.switchToLogin }) })
|
|
508
|
-
] });
|
|
509
|
-
}
|
|
510
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleRegister, style: formContainerStyle(), children: [
|
|
511
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
512
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
513
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.firstName }),
|
|
514
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
515
|
-
"input",
|
|
516
|
-
{
|
|
517
|
-
type: "text",
|
|
518
|
-
value: firstName,
|
|
519
|
-
onChange: (e) => setFirstName(e.target.value),
|
|
520
|
-
autoComplete: "given-name",
|
|
521
|
-
required: true,
|
|
522
|
-
style: inputStyle(theme)
|
|
523
|
-
}
|
|
524
|
-
)
|
|
525
|
-
] }),
|
|
526
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
527
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.lastName }),
|
|
528
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
529
|
-
"input",
|
|
530
|
-
{
|
|
531
|
-
type: "text",
|
|
532
|
-
value: lastName,
|
|
533
|
-
onChange: (e) => setLastName(e.target.value),
|
|
534
|
-
autoComplete: "family-name",
|
|
535
|
-
required: true,
|
|
536
|
-
style: inputStyle(theme)
|
|
537
|
-
}
|
|
538
|
-
)
|
|
539
|
-
] })
|
|
540
|
-
] }),
|
|
541
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
542
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.verificationCode }),
|
|
543
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
544
|
-
"input",
|
|
545
|
-
{
|
|
546
|
-
type: "text",
|
|
547
|
-
value: code,
|
|
548
|
-
onChange: (e) => setCode(e.target.value),
|
|
549
|
-
autoComplete: "one-time-code",
|
|
550
|
-
required: true,
|
|
551
|
-
style: inputStyle(theme)
|
|
552
|
-
}
|
|
553
|
-
)
|
|
554
|
-
] }),
|
|
555
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
556
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.password }),
|
|
557
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
558
|
-
"input",
|
|
559
|
-
{
|
|
560
|
-
type: "password",
|
|
561
|
-
value: password,
|
|
562
|
-
onChange: (e) => setPassword(e.target.value),
|
|
563
|
-
autoComplete: "new-password",
|
|
564
|
-
required: true,
|
|
565
|
-
style: inputStyle(theme)
|
|
566
|
-
}
|
|
567
|
-
)
|
|
568
|
-
] }),
|
|
569
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
570
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.confirmPassword }),
|
|
571
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
572
|
-
"input",
|
|
573
|
-
{
|
|
574
|
-
type: "password",
|
|
575
|
-
value: confirmPw,
|
|
576
|
-
onChange: (e) => setConfirmPw(e.target.value),
|
|
577
|
-
autoComplete: "new-password",
|
|
578
|
-
required: true,
|
|
579
|
-
style: inputStyle(theme)
|
|
580
|
-
}
|
|
581
|
-
)
|
|
582
|
-
] }),
|
|
583
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", disabled: loading, style: buttonStyle(theme, loading), children: loading ? "..." : labels.registerButton }),
|
|
584
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(), children: error }),
|
|
585
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => switchMode("login"), style: linkButtonStyle(theme), children: labels.switchToLogin }) })
|
|
586
|
-
] });
|
|
39
|
+
function isUsageMetered(usage, subscription) {
|
|
40
|
+
const empty = usage.total_spend === 0 && usage.total_tokens === 0 && usage.total_requests === 0;
|
|
41
|
+
return !(empty && subscription === "dev");
|
|
587
42
|
}
|
|
43
|
+
|
|
44
|
+
// src/hooks.ts
|
|
588
45
|
var arbiQueryKeys = {
|
|
589
46
|
workspaces: () => ["arbi", "workspaces"],
|
|
590
47
|
documents: (workspaceId) => ["arbi", "documents", workspaceId],
|
|
@@ -602,7 +59,14 @@ var arbiQueryKeys = {
|
|
|
602
59
|
projects: () => ["arbi", "projects"],
|
|
603
60
|
projectUsage: (projectExtId, monthsBack) => ["arbi", "projectUsage", projectExtId, monthsBack],
|
|
604
61
|
projectInvoices: (projectExtId) => ["arbi", "projectInvoices", projectExtId],
|
|
605
|
-
userUsageToday: () => ["arbi", "userUsageToday"]
|
|
62
|
+
userUsageToday: () => ["arbi", "userUsageToday"],
|
|
63
|
+
contacts: () => ["arbi", "contacts"],
|
|
64
|
+
skills: () => ["arbi", "skills"],
|
|
65
|
+
taskRuns: (taskId) => ["arbi", "taskRuns", taskId],
|
|
66
|
+
/** An agent's pinned config; `undefined` = the library default config. */
|
|
67
|
+
agentConfig: (agentExtId) => ["arbi", "agentConfig", agentExtId ?? "default"],
|
|
68
|
+
agentWorkspaces: (agentExtId) => ["arbi", "agentWorkspaces", agentExtId],
|
|
69
|
+
models: () => ["arbi", "models"]
|
|
606
70
|
};
|
|
607
71
|
function useWorkspaces(options) {
|
|
608
72
|
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
@@ -731,15 +195,20 @@ function useProjects(options) {
|
|
|
731
195
|
}
|
|
732
196
|
function useProjectUsage(projectExtId, monthsBack = 0, options) {
|
|
733
197
|
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
734
|
-
|
|
198
|
+
const usage = reactQuery.useQuery({
|
|
735
199
|
queryKey: arbiQueryKeys.projectUsage(projectExtId ?? "", monthsBack),
|
|
736
200
|
queryFn: () => arbi.projects.usage(projectExtId, monthsBack),
|
|
737
201
|
enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
|
|
738
202
|
});
|
|
203
|
+
const projects = useProjects({ enabled: !!projectExtId && (options?.enabled ?? true) });
|
|
204
|
+
const subscription = projects.data?.find((p) => p.external_id === projectExtId)?.subscription;
|
|
205
|
+
const metered = usage.data ? isUsageMetered(usage.data, subscription) : void 0;
|
|
206
|
+
return { ...usage, metered };
|
|
739
207
|
}
|
|
740
208
|
function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
|
|
741
209
|
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
742
210
|
const enabled = (options?.enabled ?? true) && arbi.isLoggedIn;
|
|
211
|
+
const projects = useProjects({ enabled: enabled && projectExtIds.length > 0 });
|
|
743
212
|
const results = reactQuery.useQueries({
|
|
744
213
|
queries: projectExtIds.map((id) => ({
|
|
745
214
|
queryKey: arbiQueryKeys.projectUsage(id, monthsBack),
|
|
@@ -747,27 +216,34 @@ function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
|
|
|
747
216
|
enabled: enabled && !!id
|
|
748
217
|
}))
|
|
749
218
|
});
|
|
750
|
-
const signature = results.map((r) => `${r.status}:${r.dataUpdatedAt ?? 0}`).join("|")
|
|
219
|
+
const signature = results.map((r) => `${r.status}:${r.dataUpdatedAt ?? 0}`).join("|") + `#${projects.dataUpdatedAt}`;
|
|
751
220
|
return React.useMemo(() => {
|
|
752
221
|
const dailyMap = /* @__PURE__ */ new Map();
|
|
753
222
|
const modelMap = /* @__PURE__ */ new Map();
|
|
754
|
-
let
|
|
223
|
+
let totalCredits = 0;
|
|
224
|
+
let anyData = false;
|
|
225
|
+
let anyMetered = false;
|
|
755
226
|
let totalTokens = 0;
|
|
756
227
|
let totalRequests = 0;
|
|
757
|
-
|
|
228
|
+
results.forEach((r, i) => {
|
|
758
229
|
const d = r.data;
|
|
759
|
-
if (!d)
|
|
760
|
-
|
|
230
|
+
if (!d) return;
|
|
231
|
+
anyData = true;
|
|
232
|
+
const subscription = projects.data?.find(
|
|
233
|
+
(p) => p.external_id === projectExtIds[i]
|
|
234
|
+
)?.subscription;
|
|
235
|
+
if (isUsageMetered(d, subscription)) anyMetered = true;
|
|
236
|
+
totalCredits += d.total_spend ?? 0;
|
|
761
237
|
totalTokens += d.total_tokens ?? 0;
|
|
762
238
|
totalRequests += d.total_requests ?? 0;
|
|
763
239
|
for (const day of d.daily ?? []) {
|
|
764
240
|
const cur = dailyMap.get(day.date) ?? {
|
|
765
241
|
date: day.date,
|
|
766
|
-
|
|
242
|
+
credits: 0,
|
|
767
243
|
totalTokens: 0,
|
|
768
244
|
apiRequests: 0
|
|
769
245
|
};
|
|
770
|
-
cur.
|
|
246
|
+
cur.credits += day.spend ?? 0;
|
|
771
247
|
cur.totalTokens += day.total_tokens ?? 0;
|
|
772
248
|
cur.apiRequests += day.api_requests ?? 0;
|
|
773
249
|
dailyMap.set(day.date, cur);
|
|
@@ -775,567 +251,264 @@ function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
|
|
|
775
251
|
for (const [model, mg] of Object.entries(d.model_groups ?? {})) {
|
|
776
252
|
const cur = modelMap.get(model) ?? {
|
|
777
253
|
model,
|
|
778
|
-
|
|
254
|
+
credits: 0,
|
|
779
255
|
totalTokens: 0,
|
|
780
256
|
promptTokens: 0,
|
|
781
257
|
completionTokens: 0,
|
|
782
258
|
successfulRequests: 0
|
|
783
259
|
};
|
|
784
|
-
cur.
|
|
260
|
+
cur.credits += mg.spend ?? 0;
|
|
785
261
|
cur.totalTokens += mg.total_tokens ?? 0;
|
|
786
262
|
cur.promptTokens += mg.prompt_tokens ?? 0;
|
|
787
263
|
cur.completionTokens += mg.completion_tokens ?? 0;
|
|
788
264
|
cur.successfulRequests += mg.successful_requests ?? 0;
|
|
789
265
|
modelMap.set(model, cur);
|
|
790
266
|
}
|
|
791
|
-
}
|
|
267
|
+
});
|
|
792
268
|
return {
|
|
793
|
-
|
|
269
|
+
totalCredits,
|
|
794
270
|
totalTokens,
|
|
795
271
|
totalRequests,
|
|
796
|
-
daily: [...dailyMap.values()].sort((a, b) => a.date.localeCompare(b.date)),
|
|
797
|
-
modelGroups: [...modelMap.values()].sort(
|
|
798
|
-
(a, b) => b.
|
|
799
|
-
),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
}
|
|
805
|
-
function useProjectInvoices(projectExtId, options) {
|
|
806
|
-
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
807
|
-
return reactQuery.useQuery({
|
|
808
|
-
queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ""),
|
|
809
|
-
queryFn: () => arbi.projects.invoices(projectExtId),
|
|
810
|
-
enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
function useUserUsageToday(options) {
|
|
814
|
-
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
815
|
-
return reactQuery.useQuery({
|
|
816
|
-
queryKey: arbiQueryKeys.userUsageToday(),
|
|
817
|
-
queryFn: () => arbi.user.usageToday(),
|
|
818
|
-
enabled: options?.enabled ?? arbi.isLoggedIn
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
function WorkspaceScreen({ theme, labels, onSelect }) {
|
|
822
|
-
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
823
|
-
const { data: workspaces, isLoading } = useWorkspaces();
|
|
824
|
-
const [mode, setMode] = React.useState("select");
|
|
825
|
-
const [selected, setSelected] = React.useState("");
|
|
826
|
-
const [newName, setNewName] = React.useState("");
|
|
827
|
-
const [loading, setLoading] = React.useState(false);
|
|
828
|
-
const [error, setError] = React.useState("");
|
|
829
|
-
if (isLoading) {
|
|
830
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: loadingContainerStyle(), children: "Loading workspaces..." });
|
|
831
|
-
}
|
|
832
|
-
const handleConfirm = async () => {
|
|
833
|
-
if (!selected) return;
|
|
834
|
-
setLoading(true);
|
|
835
|
-
setError("");
|
|
836
|
-
try {
|
|
837
|
-
await arbi.selectWorkspace(selected);
|
|
838
|
-
onSelect(selected);
|
|
839
|
-
} catch (err) {
|
|
840
|
-
setError(err instanceof Error ? err.message : "Failed to select workspace");
|
|
841
|
-
} finally {
|
|
842
|
-
setLoading(false);
|
|
843
|
-
}
|
|
844
|
-
};
|
|
845
|
-
const handleCreate = async () => {
|
|
846
|
-
const name = newName.trim();
|
|
847
|
-
if (!name) return;
|
|
848
|
-
setLoading(true);
|
|
849
|
-
setError("");
|
|
850
|
-
try {
|
|
851
|
-
const projects = await arbi.projects.list();
|
|
852
|
-
const projectExtId = projects[0]?.external_id;
|
|
853
|
-
if (!projectExtId) {
|
|
854
|
-
throw new Error("No project available; create one before adding a workspace");
|
|
855
|
-
}
|
|
856
|
-
const ws = await arbi.workspaces.create(name, projectExtId);
|
|
857
|
-
await arbi.selectWorkspace(ws.external_id);
|
|
858
|
-
onSelect(ws.external_id);
|
|
859
|
-
} catch (err) {
|
|
860
|
-
setError(err instanceof Error ? err.message : "Failed to create workspace");
|
|
861
|
-
} finally {
|
|
862
|
-
setLoading(false);
|
|
863
|
-
}
|
|
864
|
-
};
|
|
865
|
-
if (mode === "create") {
|
|
866
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: formContainerStyle(), children: [
|
|
867
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
868
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.workspaceName }),
|
|
869
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
870
|
-
"input",
|
|
871
|
-
{
|
|
872
|
-
type: "text",
|
|
873
|
-
value: newName,
|
|
874
|
-
onChange: (e) => setNewName(e.target.value),
|
|
875
|
-
disabled: loading,
|
|
876
|
-
style: inputStyle(theme)
|
|
877
|
-
}
|
|
878
|
-
)
|
|
879
|
-
] }),
|
|
880
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
881
|
-
"button",
|
|
882
|
-
{
|
|
883
|
-
type: "button",
|
|
884
|
-
onClick: handleCreate,
|
|
885
|
-
disabled: !newName.trim() || loading,
|
|
886
|
-
style: buttonStyle(theme, !newName.trim() || loading),
|
|
887
|
-
children: loading ? "..." : labels.createButton
|
|
888
|
-
}
|
|
889
|
-
),
|
|
890
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(), children: error }),
|
|
891
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
892
|
-
"button",
|
|
893
|
-
{
|
|
894
|
-
type: "button",
|
|
895
|
-
onClick: () => {
|
|
896
|
-
setError("");
|
|
897
|
-
setMode("select");
|
|
898
|
-
},
|
|
899
|
-
style: linkButtonStyle(theme),
|
|
900
|
-
children: "or select existing"
|
|
901
|
-
}
|
|
902
|
-
) })
|
|
903
|
-
] });
|
|
904
|
-
}
|
|
905
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: formContainerStyle(), children: [
|
|
906
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
907
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: labelStyle(theme), children: labels.selectWorkspace }),
|
|
908
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
909
|
-
"select",
|
|
910
|
-
{
|
|
911
|
-
value: selected,
|
|
912
|
-
onChange: (e) => setSelected(e.target.value),
|
|
913
|
-
disabled: loading,
|
|
914
|
-
style: selectStyle(theme),
|
|
915
|
-
children: [
|
|
916
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: labels.workspacePlaceholder }),
|
|
917
|
-
workspaces?.map((ws) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: ws.external_id, children: ws.name }, ws.external_id))
|
|
918
|
-
]
|
|
919
|
-
}
|
|
920
|
-
)
|
|
921
|
-
] }),
|
|
922
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
923
|
-
"button",
|
|
924
|
-
{
|
|
925
|
-
type: "button",
|
|
926
|
-
onClick: handleConfirm,
|
|
927
|
-
disabled: !selected || loading,
|
|
928
|
-
style: buttonStyle(theme, !selected || loading),
|
|
929
|
-
children: loading ? "Connecting..." : labels.continueButton
|
|
930
|
-
}
|
|
931
|
-
),
|
|
932
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("div", { style: errorStyle(), children: error }),
|
|
933
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
934
|
-
"button",
|
|
935
|
-
{
|
|
936
|
-
type: "button",
|
|
937
|
-
onClick: () => {
|
|
938
|
-
setError("");
|
|
939
|
-
setMode("create");
|
|
940
|
-
},
|
|
941
|
-
style: linkButtonStyle(theme),
|
|
942
|
-
children: labels.createWorkspace
|
|
943
|
-
}
|
|
944
|
-
) })
|
|
945
|
-
] });
|
|
946
|
-
}
|
|
947
|
-
var CITE_RE = /\[([^\]]+)\]\(#cite-(\d+)\)/g;
|
|
948
|
-
function MessageBubble({ message, theme }) {
|
|
949
|
-
const [expandedCite, setExpandedCite] = React.useState(null);
|
|
950
|
-
const hasCitations = message.role === "assistant" && message.metadata && CITE_RE.test(message.text);
|
|
951
|
-
CITE_RE.lastIndex = 0;
|
|
952
|
-
const resolved = hasCitations ? browser.resolveCitations(message.metadata) : [];
|
|
953
|
-
const summaries = hasCitations ? browser.summarizeCitations(resolved) : [];
|
|
954
|
-
const summaryMap = new Map(summaries.map((s) => [s.citationNum, s]));
|
|
955
|
-
const activeSummary = expandedCite ? summaryMap.get(expandedCite) : null;
|
|
956
|
-
const activeResolved = expandedCite ? resolved.find((r) => r.citationNum === expandedCite) : null;
|
|
957
|
-
const markdownComponents = React.useMemo(
|
|
958
|
-
() => ({
|
|
959
|
-
a: ({ href, children, ...props }) => {
|
|
960
|
-
if (href?.startsWith("#cite-")) {
|
|
961
|
-
const num = href.slice("#cite-".length);
|
|
962
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
963
|
-
children,
|
|
964
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
965
|
-
"sup",
|
|
966
|
-
{
|
|
967
|
-
onClick: (e) => {
|
|
968
|
-
e.stopPropagation();
|
|
969
|
-
setExpandedCite((prev) => prev === num ? null : num);
|
|
970
|
-
},
|
|
971
|
-
style: citeSupStyle(theme),
|
|
972
|
-
title: `Citation ${num}`,
|
|
973
|
-
children: num
|
|
974
|
-
}
|
|
975
|
-
)
|
|
976
|
-
] });
|
|
977
|
-
}
|
|
978
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
979
|
-
"a",
|
|
980
|
-
{
|
|
981
|
-
href,
|
|
982
|
-
target: "_blank",
|
|
983
|
-
rel: "noopener noreferrer",
|
|
984
|
-
style: { color: theme.primaryColor },
|
|
985
|
-
...props,
|
|
986
|
-
children
|
|
987
|
-
}
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
}),
|
|
991
|
-
[theme]
|
|
992
|
-
);
|
|
993
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
994
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: messageBubbleStyle(theme, message.role), children: /* @__PURE__ */ jsxRuntime.jsx(chunkOU2QLIKS_cjs.MarkdownRenderer, { components: markdownComponents, children: message.text }) }),
|
|
995
|
-
activeSummary && activeResolved && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: citePanelStyle(theme), children: [
|
|
996
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: citePanelHeaderStyle(theme), children: [
|
|
997
|
-
/* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
|
|
998
|
-
"[",
|
|
999
|
-
activeSummary.citationNum,
|
|
1000
|
-
"]"
|
|
1001
|
-
] }),
|
|
1002
|
-
" ",
|
|
1003
|
-
activeSummary.docTitle,
|
|
1004
|
-
activeSummary.pageNumber != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: theme.mutedColor }, children: [
|
|
1005
|
-
" p.",
|
|
1006
|
-
activeSummary.pageNumber
|
|
1007
|
-
] })
|
|
1008
|
-
] }),
|
|
1009
|
-
activeResolved.chunks.map((chunk, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: citeChunkStyle(theme), children: chunk.content }, i))
|
|
1010
|
-
] })
|
|
1011
|
-
] });
|
|
1012
|
-
}
|
|
1013
|
-
function citeSupStyle(theme) {
|
|
1014
|
-
return {
|
|
1015
|
-
display: "inline-flex",
|
|
1016
|
-
alignItems: "center",
|
|
1017
|
-
justifyContent: "center",
|
|
1018
|
-
fontSize: "10px",
|
|
1019
|
-
fontWeight: 600,
|
|
1020
|
-
color: theme.primaryColor,
|
|
1021
|
-
cursor: "pointer",
|
|
1022
|
-
marginLeft: "1px",
|
|
1023
|
-
minWidth: "14px",
|
|
1024
|
-
lineHeight: 1
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
function citePanelStyle(theme) {
|
|
1028
|
-
return {
|
|
1029
|
-
marginTop: "4px",
|
|
1030
|
-
padding: "8px 10px",
|
|
1031
|
-
fontSize: "12px",
|
|
1032
|
-
lineHeight: "1.5",
|
|
1033
|
-
backgroundColor: theme.surfaceColor,
|
|
1034
|
-
border: `1px solid ${theme.borderColor}`,
|
|
1035
|
-
borderRadius: "8px",
|
|
1036
|
-
maxWidth: "85%"
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
function citePanelHeaderStyle(theme) {
|
|
1040
|
-
return {
|
|
1041
|
-
fontSize: "12px",
|
|
1042
|
-
fontWeight: 500,
|
|
1043
|
-
color: theme.textColor,
|
|
1044
|
-
marginBottom: "4px"
|
|
1045
|
-
};
|
|
1046
|
-
}
|
|
1047
|
-
function citeChunkStyle(theme) {
|
|
1048
|
-
return {
|
|
1049
|
-
fontSize: "11px",
|
|
1050
|
-
color: theme.mutedColor,
|
|
1051
|
-
borderLeft: `2px solid ${theme.borderColor}`,
|
|
1052
|
-
paddingLeft: "8px",
|
|
1053
|
-
marginTop: "4px",
|
|
1054
|
-
whiteSpace: "pre-wrap",
|
|
1055
|
-
wordBreak: "break-word"
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
function ChatView({ workspaceId, theme, labels }) {
|
|
1059
|
-
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1060
|
-
const { data: docs, refetch: refetchDocs } = useDocuments(workspaceId);
|
|
1061
|
-
const mutation = useAssistantQuery();
|
|
1062
|
-
const [messages, setMessages] = React.useState([]);
|
|
1063
|
-
const [input, setInput] = React.useState("");
|
|
1064
|
-
const [streaming, setStreaming] = React.useState("");
|
|
1065
|
-
const [agentStatus, setAgentStatus] = React.useState("");
|
|
1066
|
-
const [selectedDocs, setSelectedDocs] = React.useState([]);
|
|
1067
|
-
const [docsExpanded, setDocsExpanded] = React.useState(false);
|
|
1068
|
-
const [previousResponseId, setPreviousResponseId] = React.useState(null);
|
|
1069
|
-
const [uploading, setUploading] = React.useState(false);
|
|
1070
|
-
const messagesEndRef = React.useRef(null);
|
|
1071
|
-
const fileInputRef = React.useRef(null);
|
|
1072
|
-
React.useEffect(() => {
|
|
1073
|
-
if (docs && docs.length > 0 && selectedDocs.length === 0) {
|
|
1074
|
-
setSelectedDocs(docs.map((d) => d.external_id));
|
|
1075
|
-
}
|
|
1076
|
-
}, [docs, selectedDocs.length]);
|
|
1077
|
-
React.useEffect(() => {
|
|
1078
|
-
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
1079
|
-
}, [messages, streaming, agentStatus]);
|
|
1080
|
-
const toggleDoc = (docId) => {
|
|
1081
|
-
setSelectedDocs(
|
|
1082
|
-
(prev) => prev.includes(docId) ? prev.filter((id) => id !== docId) : [...prev, docId]
|
|
1083
|
-
);
|
|
1084
|
-
};
|
|
1085
|
-
const handleUpload = React.useCallback(
|
|
1086
|
-
async (e) => {
|
|
1087
|
-
const files = e.target.files;
|
|
1088
|
-
if (!files || files.length === 0) return;
|
|
1089
|
-
setUploading(true);
|
|
1090
|
-
try {
|
|
1091
|
-
const newIds = [];
|
|
1092
|
-
for (const file of Array.from(files)) {
|
|
1093
|
-
const result = await arbi.documents.uploadFile(file, file.name);
|
|
1094
|
-
if (result.doc_ext_ids) newIds.push(...result.doc_ext_ids);
|
|
1095
|
-
}
|
|
1096
|
-
await refetchDocs();
|
|
1097
|
-
setSelectedDocs((prev) => [...prev, ...newIds]);
|
|
1098
|
-
} catch {
|
|
1099
|
-
} finally {
|
|
1100
|
-
setUploading(false);
|
|
1101
|
-
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
1102
|
-
}
|
|
1103
|
-
},
|
|
1104
|
-
[arbi, refetchDocs]
|
|
1105
|
-
);
|
|
1106
|
-
const handleSubmit = React.useCallback(
|
|
1107
|
-
(e) => {
|
|
1108
|
-
e.preventDefault();
|
|
1109
|
-
const question = input.trim();
|
|
1110
|
-
if (!question || selectedDocs.length === 0 || mutation.isPending) return;
|
|
1111
|
-
setMessages((prev) => [...prev, { role: "user", text: question }]);
|
|
1112
|
-
setInput("");
|
|
1113
|
-
setStreaming("");
|
|
1114
|
-
setAgentStatus("");
|
|
1115
|
-
mutation.mutate(
|
|
1116
|
-
{
|
|
1117
|
-
question,
|
|
1118
|
-
docIds: selectedDocs,
|
|
1119
|
-
previousResponseId,
|
|
1120
|
-
onToken: (t) => setStreaming((prev) => prev + t),
|
|
1121
|
-
onOutputItemDone: (ev) => {
|
|
1122
|
-
const item = ev.item;
|
|
1123
|
-
if (item.type === "function_call" || item.type === "reasoning") {
|
|
1124
|
-
setAgentStatus(item.arbi?.focus || item.arbi?.label || "");
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
},
|
|
1128
|
-
{
|
|
1129
|
-
onSuccess: (result) => {
|
|
1130
|
-
setStreaming("");
|
|
1131
|
-
setAgentStatus("");
|
|
1132
|
-
setMessages((prev) => [
|
|
1133
|
-
...prev,
|
|
1134
|
-
{ role: "assistant", text: result.text, metadata: result.metadata }
|
|
1135
|
-
]);
|
|
1136
|
-
setPreviousResponseId(result.assistantMessageExtId);
|
|
1137
|
-
},
|
|
1138
|
-
onError: (err) => {
|
|
1139
|
-
setStreaming("");
|
|
1140
|
-
setAgentStatus("");
|
|
1141
|
-
setMessages((prev) => [...prev, { role: "assistant", text: `Error: ${err.message}` }]);
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
);
|
|
1145
|
-
},
|
|
1146
|
-
[input, selectedDocs, previousResponseId, mutation]
|
|
1147
|
-
);
|
|
1148
|
-
const noDocs = !docs || docs.length === 0;
|
|
1149
|
-
const noDocsSelected = selectedDocs.length === 0;
|
|
1150
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1151
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1152
|
-
"input",
|
|
1153
|
-
{
|
|
1154
|
-
ref: fileInputRef,
|
|
1155
|
-
type: "file",
|
|
1156
|
-
multiple: true,
|
|
1157
|
-
accept: ".pdf,.txt,.md,.html,.doc,.docx,.rtf,.ppt,.pptx,.xls,.xlsx",
|
|
1158
|
-
onChange: handleUpload,
|
|
1159
|
-
style: fileInputStyle()
|
|
1160
|
-
}
|
|
1161
|
-
),
|
|
1162
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: docSelectorStyle(theme), children: [
|
|
1163
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
1164
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1165
|
-
"button",
|
|
1166
|
-
{
|
|
1167
|
-
type: "button",
|
|
1168
|
-
onClick: () => setDocsExpanded((prev) => !prev),
|
|
1169
|
-
style: docToggleStyle(theme),
|
|
1170
|
-
children: [
|
|
1171
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "10px" }, children: docsExpanded ? "\u25BC" : "\u25B6" }),
|
|
1172
|
-
labels.documents,
|
|
1173
|
-
" (",
|
|
1174
|
-
selectedDocs.length,
|
|
1175
|
-
"/",
|
|
1176
|
-
docs?.length ?? 0,
|
|
1177
|
-
" in chat)"
|
|
1178
|
-
]
|
|
1179
|
-
}
|
|
1180
|
-
),
|
|
1181
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1182
|
-
"button",
|
|
1183
|
-
{
|
|
1184
|
-
type: "button",
|
|
1185
|
-
onClick: () => fileInputRef.current?.click(),
|
|
1186
|
-
disabled: uploading,
|
|
1187
|
-
style: secondaryButtonStyle(theme, uploading),
|
|
1188
|
-
children: uploading ? labels.uploading : labels.uploadButton
|
|
1189
|
-
}
|
|
1190
|
-
)
|
|
1191
|
-
] }),
|
|
1192
|
-
docsExpanded && docs && docs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: docListStyle(), children: docs.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs("label", { style: docItemStyle(theme), children: [
|
|
1193
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1194
|
-
"input",
|
|
1195
|
-
{
|
|
1196
|
-
type: "checkbox",
|
|
1197
|
-
checked: selectedDocs.includes(doc.external_id),
|
|
1198
|
-
onChange: () => toggleDoc(doc.external_id)
|
|
1199
|
-
}
|
|
1200
|
-
),
|
|
1201
|
-
doc.file_name
|
|
1202
|
-
] }, doc.external_id)) })
|
|
1203
|
-
] }),
|
|
1204
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: messagesContainerStyle(), children: [
|
|
1205
|
-
messages.length === 0 && !streaming && /* @__PURE__ */ jsxRuntime.jsx("div", { style: emptyStateStyle(theme), children: noDocs ? labels.emptyNoDocs : noDocsSelected ? labels.emptyNoSelection : labels.emptyReady }),
|
|
1206
|
-
messages.map((msg, i) => /* @__PURE__ */ jsxRuntime.jsx(MessageBubble, { message: msg, theme }, i)),
|
|
1207
|
-
agentStatus && !streaming && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: agentStatusStyle(theme), children: [
|
|
1208
|
-
agentStatus,
|
|
1209
|
-
"..."
|
|
1210
|
-
] }),
|
|
1211
|
-
streaming && /* @__PURE__ */ jsxRuntime.jsx(MessageBubble, { message: { role: "assistant", text: streaming }, theme }),
|
|
1212
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: messagesEndRef })
|
|
1213
|
-
] }),
|
|
1214
|
-
/* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, style: inputBarStyle(theme), children: [
|
|
1215
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1216
|
-
"input",
|
|
1217
|
-
{
|
|
1218
|
-
type: "text",
|
|
1219
|
-
value: input,
|
|
1220
|
-
onChange: (e) => setInput(e.target.value),
|
|
1221
|
-
placeholder: noDocs || noDocsSelected ? "Select documents first..." : labels.placeholder,
|
|
1222
|
-
disabled: noDocs || noDocsSelected || mutation.isPending,
|
|
1223
|
-
style: chatInputStyle(theme)
|
|
1224
|
-
}
|
|
1225
|
-
),
|
|
1226
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
|
-
"button",
|
|
1228
|
-
{
|
|
1229
|
-
type: "submit",
|
|
1230
|
-
disabled: !input.trim() || noDocsSelected || mutation.isPending,
|
|
1231
|
-
style: sendButtonStyle(theme, !input.trim() || noDocsSelected || mutation.isPending),
|
|
1232
|
-
children: mutation.isPending ? "..." : labels.sendButton
|
|
1233
|
-
}
|
|
1234
|
-
)
|
|
1235
|
-
] })
|
|
1236
|
-
] });
|
|
272
|
+
daily: [...dailyMap.values()].sort((a, b) => a.date.localeCompare(b.date)),
|
|
273
|
+
modelGroups: [...modelMap.values()].sort(
|
|
274
|
+
(a, b) => b.credits - a.credits || b.totalTokens - a.totalTokens
|
|
275
|
+
),
|
|
276
|
+
metered: !anyData || anyMetered,
|
|
277
|
+
isLoading: results.some((r) => r.isLoading),
|
|
278
|
+
isError: results.some((r) => r.isError)
|
|
279
|
+
};
|
|
280
|
+
}, [signature]);
|
|
1237
281
|
}
|
|
1238
|
-
function
|
|
282
|
+
function useProjectInvoices(projectExtId, options) {
|
|
1239
283
|
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
284
|
+
return reactQuery.useQuery({
|
|
285
|
+
queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ""),
|
|
286
|
+
queryFn: () => arbi.projects.invoices(projectExtId),
|
|
287
|
+
enabled: (options?.enabled ?? true) && !!projectExtId && arbi.isLoggedIn
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function useUserUsageToday(options) {
|
|
291
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
292
|
+
return reactQuery.useQuery({
|
|
293
|
+
queryKey: arbiQueryKeys.userUsageToday(),
|
|
294
|
+
queryFn: () => arbi.user.usageToday(),
|
|
295
|
+
enabled: options?.enabled ?? arbi.isLoggedIn
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/chat/useArbiChat.ts
|
|
300
|
+
var counter = 0;
|
|
301
|
+
var nextId = (prefix) => `${prefix}-${Date.now().toString(36)}-${(counter++).toString(36)}`;
|
|
302
|
+
var emptyThread = () => ({
|
|
303
|
+
id: nextId("thread"),
|
|
304
|
+
title: "",
|
|
305
|
+
messages: [],
|
|
306
|
+
responseId: null
|
|
307
|
+
});
|
|
308
|
+
function titleFromQuestion(question, maxLength = 48) {
|
|
309
|
+
const flat = question.replace(/\s+/g, " ").trim();
|
|
310
|
+
if (flat.length <= maxLength) return flat;
|
|
311
|
+
const cut = flat.slice(0, maxLength);
|
|
312
|
+
const lastSpace = cut.lastIndexOf(" ");
|
|
313
|
+
const words = lastSpace > maxLength / 2 ? cut.slice(0, lastSpace) : cut;
|
|
314
|
+
return `${words.replace(/[\s,;:.\-–—]+$/, "")}\u2026`;
|
|
315
|
+
}
|
|
316
|
+
var messageOf = (e, fallback) => e instanceof Error ? e.message : fallback;
|
|
317
|
+
function useArbiChat(options = {}) {
|
|
318
|
+
const { workspaceId, model, titleLength = 48 } = options;
|
|
319
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
320
|
+
const { data: docs = [], isLoading: isLoadingDocuments, refetch } = useDocuments(workspaceId);
|
|
321
|
+
const query = useAssistantQuery();
|
|
322
|
+
const { mutateAsync } = query;
|
|
323
|
+
const [threads, setThreads] = React.useState(() => [emptyThread()]);
|
|
324
|
+
const [activeId, setActiveId] = React.useState(() => threads[0].id);
|
|
325
|
+
const [deselected, setDeselected] = React.useState(/* @__PURE__ */ new Set());
|
|
326
|
+
const [isRunning, setIsRunning] = React.useState(false);
|
|
327
|
+
const [isUploading, setIsUploading] = React.useState(false);
|
|
328
|
+
const [uploadError, setUploadError] = React.useState(null);
|
|
329
|
+
const scopeRef = React.useRef(workspaceId);
|
|
1256
330
|
React.useEffect(() => {
|
|
1257
|
-
if (
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
331
|
+
if (scopeRef.current === workspaceId) return;
|
|
332
|
+
scopeRef.current = workspaceId;
|
|
333
|
+
const fresh = emptyThread();
|
|
334
|
+
setThreads([fresh]);
|
|
335
|
+
setActiveId(fresh.id);
|
|
336
|
+
setDeselected(/* @__PURE__ */ new Set());
|
|
337
|
+
setUploadError(null);
|
|
338
|
+
}, [workspaceId]);
|
|
339
|
+
const active = threads.find((t) => t.id === activeId) ?? threads[0];
|
|
340
|
+
const selectedIds = React.useMemo(
|
|
341
|
+
() => docs.map((d) => d.external_id).filter((id) => !!id && !deselected.has(id)),
|
|
342
|
+
[docs, deselected]
|
|
343
|
+
);
|
|
344
|
+
const documents = React.useMemo(
|
|
345
|
+
() => docs.filter((d) => !!d.external_id).map((d) => ({
|
|
346
|
+
id: d.external_id,
|
|
347
|
+
name: d.file_name ?? d.external_id,
|
|
348
|
+
isSelected: !deselected.has(d.external_id)
|
|
349
|
+
})),
|
|
350
|
+
[docs, deselected]
|
|
351
|
+
);
|
|
352
|
+
const patchThread = React.useCallback(
|
|
353
|
+
(id, patch) => setThreads((all) => all.map((t) => t.id === id ? patch(t) : t)),
|
|
354
|
+
[]
|
|
355
|
+
);
|
|
356
|
+
const patchMessage = React.useCallback(
|
|
357
|
+
(threadId, messageId, patch) => patchThread(threadId, (t) => ({
|
|
358
|
+
...t,
|
|
359
|
+
messages: t.messages.map((m) => m.id === messageId ? { ...m, ...patch } : m)
|
|
360
|
+
})),
|
|
361
|
+
[patchThread]
|
|
362
|
+
);
|
|
363
|
+
const ask = React.useCallback(
|
|
364
|
+
async (thread, text) => {
|
|
365
|
+
const userMessage = {
|
|
366
|
+
id: nextId("msg"),
|
|
367
|
+
role: "user",
|
|
368
|
+
content: text,
|
|
369
|
+
status: "complete"
|
|
370
|
+
};
|
|
371
|
+
const answer = {
|
|
372
|
+
id: nextId("msg"),
|
|
373
|
+
role: "assistant",
|
|
374
|
+
content: "",
|
|
375
|
+
status: "streaming"
|
|
376
|
+
};
|
|
377
|
+
patchThread(thread.id, (t) => ({
|
|
378
|
+
...t,
|
|
379
|
+
title: t.title || titleFromQuestion(text, titleLength),
|
|
380
|
+
messages: [...t.messages, userMessage, answer]
|
|
381
|
+
}));
|
|
382
|
+
setIsRunning(true);
|
|
383
|
+
let buffer = "";
|
|
384
|
+
let steps = 0;
|
|
385
|
+
let streamError = null;
|
|
386
|
+
try {
|
|
387
|
+
const result = await mutateAsync({
|
|
388
|
+
question: text,
|
|
389
|
+
docIds: selectedIds,
|
|
390
|
+
previousResponseId: thread.responseId,
|
|
391
|
+
model,
|
|
392
|
+
onToken: (token) => {
|
|
393
|
+
buffer += token;
|
|
394
|
+
patchMessage(thread.id, answer.id, { content: buffer });
|
|
395
|
+
},
|
|
396
|
+
onOutputItemDone: (ev) => {
|
|
397
|
+
const type = ev.item.type;
|
|
398
|
+
if (type === "function_call" || type === "reasoning") {
|
|
399
|
+
steps += 1;
|
|
400
|
+
patchMessage(thread.id, answer.id, { stepCount: steps });
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
onError: (message) => {
|
|
404
|
+
streamError = message;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
const finalText = result.text || buffer;
|
|
408
|
+
const failure = streamError || result.errors[0] || null;
|
|
409
|
+
if (failure && !finalText) {
|
|
410
|
+
patchMessage(thread.id, answer.id, { status: "error", error: failure });
|
|
411
|
+
} else {
|
|
412
|
+
patchMessage(thread.id, answer.id, {
|
|
413
|
+
status: "complete",
|
|
414
|
+
content: finalText,
|
|
415
|
+
stepCount: result.agentSteps.length || steps || void 0
|
|
416
|
+
});
|
|
417
|
+
patchThread(thread.id, (t) => ({
|
|
418
|
+
...t,
|
|
419
|
+
responseId: result.assistantMessageExtId ?? t.responseId
|
|
420
|
+
}));
|
|
1287
421
|
}
|
|
1288
|
-
)
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}) {
|
|
1299
|
-
const theme = React.useMemo(() => getTheme(themeOverrides), [themeOverrides]);
|
|
1300
|
-
const labels = React.useMemo(() => getLabels(labelOverrides), [labelOverrides]);
|
|
1301
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1302
|
-
ChatWidget,
|
|
1303
|
-
{
|
|
1304
|
-
theme,
|
|
1305
|
-
labels,
|
|
1306
|
-
initialWorkspaceId: workspaceId,
|
|
1307
|
-
width,
|
|
1308
|
-
height
|
|
1309
|
-
}
|
|
422
|
+
} catch (e) {
|
|
423
|
+
patchMessage(thread.id, answer.id, {
|
|
424
|
+
status: "error",
|
|
425
|
+
error: messageOf(e, "The assistant request failed.")
|
|
426
|
+
});
|
|
427
|
+
} finally {
|
|
428
|
+
setIsRunning(false);
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
[mutateAsync, patchMessage, patchThread, selectedIds, model, titleLength]
|
|
1310
432
|
);
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
433
|
+
const send = React.useCallback(
|
|
434
|
+
async (text) => {
|
|
435
|
+
const trimmed = text.trim();
|
|
436
|
+
if (!trimmed || isRunning) return;
|
|
437
|
+
await ask(active, trimmed);
|
|
438
|
+
},
|
|
439
|
+
[active, ask, isRunning]
|
|
440
|
+
);
|
|
441
|
+
const lastMessage = active.messages[active.messages.length - 1];
|
|
442
|
+
const error = lastMessage?.status === "error" ? lastMessage.error ?? null : null;
|
|
443
|
+
const retry = React.useCallback(async () => {
|
|
444
|
+
if (isRunning) return;
|
|
445
|
+
const messages = active.messages;
|
|
446
|
+
const failed = messages[messages.length - 1];
|
|
447
|
+
const question = messages[messages.length - 2];
|
|
448
|
+
if (failed?.status !== "error" || question?.role !== "user") return;
|
|
449
|
+
const trimmed = { ...active, messages: messages.slice(0, -2) };
|
|
450
|
+
patchThread(active.id, () => trimmed);
|
|
451
|
+
await ask(trimmed, question.content);
|
|
452
|
+
}, [active, ask, isRunning, patchThread]);
|
|
453
|
+
const newThread = React.useCallback(() => {
|
|
454
|
+
if (active.messages.length === 0) return;
|
|
455
|
+
const fresh = emptyThread();
|
|
456
|
+
setThreads((all) => [fresh, ...all]);
|
|
457
|
+
setActiveId(fresh.id);
|
|
458
|
+
}, [active.messages.length]);
|
|
459
|
+
const deleteThread = React.useCallback(
|
|
460
|
+
(id) => {
|
|
461
|
+
const rest = threads.filter((t) => t.id !== id);
|
|
462
|
+
const next = rest.length > 0 ? rest : [emptyThread()];
|
|
463
|
+
setThreads(next);
|
|
464
|
+
if (id === activeId) setActiveId(next[0].id);
|
|
465
|
+
},
|
|
466
|
+
[threads, activeId]
|
|
467
|
+
);
|
|
468
|
+
const toggleDocument = React.useCallback((id) => {
|
|
469
|
+
setDeselected((prev) => {
|
|
470
|
+
const next = new Set(prev);
|
|
471
|
+
if (next.has(id)) next.delete(id);
|
|
472
|
+
else next.add(id);
|
|
473
|
+
return next;
|
|
474
|
+
});
|
|
475
|
+
}, []);
|
|
476
|
+
const selectAllDocuments = React.useCallback(() => setDeselected(/* @__PURE__ */ new Set()), []);
|
|
477
|
+
const upload = React.useCallback(
|
|
478
|
+
async (files) => {
|
|
479
|
+
if (files.length === 0) return;
|
|
480
|
+
setIsUploading(true);
|
|
481
|
+
setUploadError(null);
|
|
482
|
+
try {
|
|
483
|
+
for (const file of files) await arbi.documents.uploadFile(file, file.name);
|
|
484
|
+
await refetch();
|
|
485
|
+
} catch (e) {
|
|
486
|
+
setUploadError(messageOf(e, "The upload failed."));
|
|
487
|
+
} finally {
|
|
488
|
+
setIsUploading(false);
|
|
1325
489
|
}
|
|
1326
|
-
}
|
|
1327
|
-
[]
|
|
490
|
+
},
|
|
491
|
+
[arbi, refetch]
|
|
1328
492
|
);
|
|
1329
|
-
return
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
493
|
+
return {
|
|
494
|
+
threads: threads.map(({ id, title }) => ({ id, title })),
|
|
495
|
+
activeThreadId: active.id,
|
|
496
|
+
messages: active.messages,
|
|
497
|
+
isRunning,
|
|
498
|
+
error,
|
|
499
|
+
documents,
|
|
500
|
+
isLoadingDocuments,
|
|
501
|
+
isUploading,
|
|
502
|
+
uploadError,
|
|
503
|
+
send,
|
|
504
|
+
retry,
|
|
505
|
+
selectThread: setActiveId,
|
|
506
|
+
newThread,
|
|
507
|
+
deleteThread,
|
|
508
|
+
toggleDocument,
|
|
509
|
+
selectAllDocuments,
|
|
510
|
+
upload
|
|
511
|
+
};
|
|
1339
512
|
}
|
|
1340
513
|
var TypingIndicator = React.memo(function TypingIndicator2() {
|
|
1341
514
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full justify-start mb-2", "data-testid": "dm-typing-indicator", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-card border border-primary rounded-2xl rounded-bl-md px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
@@ -1618,6 +791,324 @@ function useArbiDocumentSync(workspaceId) {
|
|
|
1618
791
|
}
|
|
1619
792
|
});
|
|
1620
793
|
}
|
|
794
|
+
|
|
795
|
+
// src/workspaces/shell-workspaces.ts
|
|
796
|
+
function getWorkspaceKind(workspace) {
|
|
797
|
+
if (workspace.is_public) return "common";
|
|
798
|
+
if ((workspace.users?.length ?? 0) > 1) return "shared";
|
|
799
|
+
return "private";
|
|
800
|
+
}
|
|
801
|
+
function memberName(user) {
|
|
802
|
+
const full = [user?.given_name, user?.family_name].filter(Boolean).join(" ").trim();
|
|
803
|
+
return full || user?.email || "";
|
|
804
|
+
}
|
|
805
|
+
function toShellWorkspace(workspace) {
|
|
806
|
+
const people = (workspace.users ?? []).filter((u) => !u.agent_ext_id);
|
|
807
|
+
return {
|
|
808
|
+
id: workspace.external_id,
|
|
809
|
+
name: workspace.name,
|
|
810
|
+
kind: getWorkspaceKind(workspace),
|
|
811
|
+
description: workspace.description,
|
|
812
|
+
projectName: workspace.project_name,
|
|
813
|
+
docCount: (workspace.shared_document_count ?? 0) + (workspace.private_document_count ?? 0),
|
|
814
|
+
memberCount: people.length,
|
|
815
|
+
members: people.map((u) => ({ name: memberName(u.user), picture: u.user?.picture })),
|
|
816
|
+
updatedAt: workspace.updated_at
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
function recency(workspace, lastOpened) {
|
|
820
|
+
const opened = lastOpened?.[workspace.id];
|
|
821
|
+
if (opened !== void 0) return opened;
|
|
822
|
+
const updated = Date.parse(workspace.updatedAt ?? "");
|
|
823
|
+
return Number.isNaN(updated) ? 0 : updated;
|
|
824
|
+
}
|
|
825
|
+
function resolveActiveWorkspace(items, selectedId, options = {}) {
|
|
826
|
+
const selected = selectedId ? items.find((w) => w.id === selectedId) : void 0;
|
|
827
|
+
if (selected) return selected;
|
|
828
|
+
if (options.isSeed && options.seedActiveId) {
|
|
829
|
+
const seeded = items.find((w) => w.id === options.seedActiveId);
|
|
830
|
+
if (seeded) return seeded;
|
|
831
|
+
}
|
|
832
|
+
return items[0];
|
|
833
|
+
}
|
|
834
|
+
function pickRecentWorkspaces(items, activeId, options = {}) {
|
|
835
|
+
const { limit = 4, lastOpened, formatLastSeen } = options;
|
|
836
|
+
return items.filter((w) => w.id !== activeId).map((w) => ({ w, at: recency(w, lastOpened) })).sort((a, b) => b.at - a.at).slice(0, limit).map(({ w, at }) => formatLastSeen ? { ...w, lastSeen: formatLastSeen(at) } : w);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// src/workspaces/useShellWorkspaces.ts
|
|
840
|
+
function useShellWorkspaces(options) {
|
|
841
|
+
const {
|
|
842
|
+
workspaces,
|
|
843
|
+
isLoading = false,
|
|
844
|
+
loadError,
|
|
845
|
+
selectedId,
|
|
846
|
+
seed,
|
|
847
|
+
decorate,
|
|
848
|
+
recentLimit,
|
|
849
|
+
lastOpened,
|
|
850
|
+
formatLastSeen
|
|
851
|
+
} = options;
|
|
852
|
+
const live = React.useMemo(
|
|
853
|
+
() => (workspaces ?? []).map((source) => {
|
|
854
|
+
const item = toShellWorkspace(source);
|
|
855
|
+
return decorate ? { ...item, ...decorate(item, source) } : item;
|
|
856
|
+
}),
|
|
857
|
+
[workspaces, decorate]
|
|
858
|
+
);
|
|
859
|
+
const isLive = live.length > 0;
|
|
860
|
+
const isSeed = !isLive && !isLoading && !!seed;
|
|
861
|
+
const items = React.useMemo(
|
|
862
|
+
() => isLive ? live : isSeed ? [...seed.workspaces] : [],
|
|
863
|
+
[isLive, live, isSeed, seed]
|
|
864
|
+
);
|
|
865
|
+
const active = React.useMemo(
|
|
866
|
+
() => resolveActiveWorkspace(items, selectedId, { isSeed, seedActiveId: seed?.activeId }),
|
|
867
|
+
[items, selectedId, isSeed, seed?.activeId]
|
|
868
|
+
);
|
|
869
|
+
const recent = React.useMemo(
|
|
870
|
+
() => pickRecentWorkspaces(items, active?.id, { limit: recentLimit, lastOpened, formatLastSeen }),
|
|
871
|
+
[items, active?.id, recentLimit, lastOpened, formatLastSeen]
|
|
872
|
+
);
|
|
873
|
+
const [openingId, setOpeningId] = React.useState(null);
|
|
874
|
+
const [openError, setOpenError] = React.useState(void 0);
|
|
875
|
+
const callbacks = React.useRef({
|
|
876
|
+
select: options.select,
|
|
877
|
+
onOpened: options.onOpened,
|
|
878
|
+
onOpenError: options.onOpenError
|
|
879
|
+
});
|
|
880
|
+
callbacks.current = {
|
|
881
|
+
select: options.select,
|
|
882
|
+
onOpened: options.onOpened,
|
|
883
|
+
onOpenError: options.onOpenError
|
|
884
|
+
};
|
|
885
|
+
const itemsRef = React.useRef(items);
|
|
886
|
+
itemsRef.current = items;
|
|
887
|
+
const open = React.useCallback(async (target) => {
|
|
888
|
+
const id = typeof target === "string" ? target : target.id;
|
|
889
|
+
const workspace = itemsRef.current.find((w) => w.id === id);
|
|
890
|
+
if (!workspace) return false;
|
|
891
|
+
setOpenError(void 0);
|
|
892
|
+
setOpeningId(id);
|
|
893
|
+
try {
|
|
894
|
+
await callbacks.current.select(workspace);
|
|
895
|
+
} catch (err) {
|
|
896
|
+
setOpenError(err);
|
|
897
|
+
setOpeningId(null);
|
|
898
|
+
callbacks.current.onOpenError?.(err, workspace);
|
|
899
|
+
return false;
|
|
900
|
+
}
|
|
901
|
+
setOpeningId(null);
|
|
902
|
+
callbacks.current.onOpened?.(workspace);
|
|
903
|
+
return true;
|
|
904
|
+
}, []);
|
|
905
|
+
return {
|
|
906
|
+
items,
|
|
907
|
+
active,
|
|
908
|
+
recent,
|
|
909
|
+
isLive,
|
|
910
|
+
isLoading,
|
|
911
|
+
error: openError ?? loadError ?? null,
|
|
912
|
+
openingId,
|
|
913
|
+
open
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function useArbiShellWorkspaces(options = {}) {
|
|
917
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
918
|
+
const query = useWorkspaces();
|
|
919
|
+
const { select, ...rest } = options;
|
|
920
|
+
const defaultSelect = React.useCallback(
|
|
921
|
+
(workspace) => arbi.selectWorkspace(workspace.id),
|
|
922
|
+
[arbi]
|
|
923
|
+
);
|
|
924
|
+
return useShellWorkspaces({
|
|
925
|
+
...rest,
|
|
926
|
+
workspaces: Array.isArray(query.data) ? query.data : void 0,
|
|
927
|
+
isLoading: query.isLoading,
|
|
928
|
+
loadError: query.error,
|
|
929
|
+
select: select ?? defaultSelect
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
function useCreateTask() {
|
|
933
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
934
|
+
const qc = reactQuery.useQueryClient();
|
|
935
|
+
return reactQuery.useMutation({
|
|
936
|
+
mutationFn: (body) => arbi.tasks.create(body),
|
|
937
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.tasks() })
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
function useUpdateTask() {
|
|
941
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
942
|
+
const qc = reactQuery.useQueryClient();
|
|
943
|
+
return reactQuery.useMutation({
|
|
944
|
+
mutationFn: ({ taskId, patch }) => arbi.tasks.update(taskId, patch),
|
|
945
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.tasks() })
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
function useRunTask() {
|
|
949
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
950
|
+
const qc = reactQuery.useQueryClient();
|
|
951
|
+
return reactQuery.useMutation({
|
|
952
|
+
mutationFn: (taskId) => arbi.tasks.runWithAuth(taskId),
|
|
953
|
+
onSuccess: (_task, taskId) => Promise.all([
|
|
954
|
+
qc.invalidateQueries({ queryKey: arbiQueryKeys.tasks() }),
|
|
955
|
+
qc.invalidateQueries({ queryKey: arbiQueryKeys.taskRuns(taskId) })
|
|
956
|
+
])
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
function useDeleteTask() {
|
|
960
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
961
|
+
const qc = reactQuery.useQueryClient();
|
|
962
|
+
return reactQuery.useMutation({
|
|
963
|
+
mutationFn: (taskId) => arbi.tasks.delete(taskId),
|
|
964
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.tasks() })
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
function useTaskRuns(taskId, options) {
|
|
968
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
969
|
+
return reactQuery.useQuery({
|
|
970
|
+
queryKey: arbiQueryKeys.taskRuns(taskId ?? ""),
|
|
971
|
+
queryFn: () => arbi.tasks.listRuns(taskId),
|
|
972
|
+
enabled: (options?.enabled ?? true) && !!taskId && arbi.isLoggedIn,
|
|
973
|
+
refetchInterval: (q) => q.state.data?.some((r) => r.status === "running") ? 3e3 : false
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
function useCreateAgent() {
|
|
977
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
978
|
+
const qc = reactQuery.useQueryClient();
|
|
979
|
+
return reactQuery.useMutation({
|
|
980
|
+
mutationFn: (name) => arbi.agents.create(name),
|
|
981
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.agents() })
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
function useAgentConfig(agentExtId, options) {
|
|
985
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
986
|
+
return reactQuery.useQuery({
|
|
987
|
+
queryKey: arbiQueryKeys.agentConfig(agentExtId),
|
|
988
|
+
queryFn: async () => agentExtId ? await arbi.agents.getConfig(agentExtId) : await arbi.agentConfig.get("default"),
|
|
989
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
function useAgentModels(options) {
|
|
993
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
994
|
+
return reactQuery.useQuery({
|
|
995
|
+
queryKey: arbiQueryKeys.models(),
|
|
996
|
+
queryFn: async () => (await arbi.agentConfig.getModels()).models.map((m) => m.model_name),
|
|
997
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
function useSaveAgentConfig() {
|
|
1001
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1002
|
+
const qc = reactQuery.useQueryClient();
|
|
1003
|
+
return reactQuery.useMutation({
|
|
1004
|
+
mutationFn: async ({ agentExtId, title, sections }) => {
|
|
1005
|
+
const pinned = await arbi.agents.getConfig(agentExtId);
|
|
1006
|
+
const base = pinned ?? await arbi.agentConfig.get("default");
|
|
1007
|
+
const merged = structuredClone(base);
|
|
1008
|
+
for (const [section, params] of Object.entries(sections)) {
|
|
1009
|
+
merged[section] = { ...merged[section] ?? {}, ...params };
|
|
1010
|
+
}
|
|
1011
|
+
return arbi.agentConfig.save({
|
|
1012
|
+
...merged,
|
|
1013
|
+
agent_ext_id: agentExtId,
|
|
1014
|
+
title: title ?? `agent-${agentExtId}`
|
|
1015
|
+
});
|
|
1016
|
+
},
|
|
1017
|
+
onSuccess: (_saved, { agentExtId }) => Promise.all([
|
|
1018
|
+
qc.invalidateQueries({ queryKey: arbiQueryKeys.configs() }),
|
|
1019
|
+
qc.invalidateQueries({ queryKey: arbiQueryKeys.agentConfig(agentExtId) })
|
|
1020
|
+
])
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
function useAgentWorkspaces(agentExtId, options) {
|
|
1024
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1025
|
+
return reactQuery.useQuery({
|
|
1026
|
+
queryKey: arbiQueryKeys.agentWorkspaces(agentExtId ?? ""),
|
|
1027
|
+
queryFn: () => arbi.agents.listWorkspaces(agentExtId),
|
|
1028
|
+
enabled: (options?.enabled ?? true) && !!agentExtId && arbi.isLoggedIn
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
function useGrantAgentAccess() {
|
|
1032
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1033
|
+
const qc = reactQuery.useQueryClient();
|
|
1034
|
+
return reactQuery.useMutation({
|
|
1035
|
+
mutationFn: async ({
|
|
1036
|
+
agentExtId,
|
|
1037
|
+
workspaceId,
|
|
1038
|
+
mode = { kind: "standing" }
|
|
1039
|
+
}) => {
|
|
1040
|
+
if (mode.kind === "temporary") {
|
|
1041
|
+
return arbi.agents.grantTemporaryAccess(agentExtId, workspaceId, mode.ttlSeconds);
|
|
1042
|
+
}
|
|
1043
|
+
const agent = (await arbi.agents.list()).find((a) => a.external_id === agentExtId);
|
|
1044
|
+
if (!agent?.email) throw new Error("The agent's address is unknown.");
|
|
1045
|
+
return arbi.workspaces.grantAccess({ workspaceId, emails: [agent.email] });
|
|
1046
|
+
},
|
|
1047
|
+
onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: arbiQueryKeys.agentWorkspaces(agentExtId) })
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
function useRevokeAgentAccess() {
|
|
1051
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1052
|
+
const qc = reactQuery.useQueryClient();
|
|
1053
|
+
return reactQuery.useMutation({
|
|
1054
|
+
mutationFn: async ({
|
|
1055
|
+
agentExtId,
|
|
1056
|
+
workspaceId
|
|
1057
|
+
}) => {
|
|
1058
|
+
const previous = arbi.hasWorkspace ? arbi.getWorkspaceId() : null;
|
|
1059
|
+
await arbi.selectWorkspace(workspaceId);
|
|
1060
|
+
try {
|
|
1061
|
+
await arbi.workspaces.removeUsers([agentExtId]);
|
|
1062
|
+
} finally {
|
|
1063
|
+
if (previous && previous !== workspaceId) await arbi.selectWorkspace(previous);
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
onSuccess: (_res, { agentExtId }) => qc.invalidateQueries({ queryKey: arbiQueryKeys.agentWorkspaces(agentExtId) })
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
function useSkills(options) {
|
|
1070
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1071
|
+
return reactQuery.useQuery({
|
|
1072
|
+
queryKey: [...arbiQueryKeys.skills(), options?.includeHidden ?? false],
|
|
1073
|
+
queryFn: () => arbi.assistant.listSkills({ includeHidden: options?.includeHidden }),
|
|
1074
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn,
|
|
1075
|
+
staleTime: 3e4
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
function useContacts(options) {
|
|
1079
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1080
|
+
return reactQuery.useQuery({
|
|
1081
|
+
queryKey: arbiQueryKeys.contacts(),
|
|
1082
|
+
queryFn: () => arbi.contacts.list(),
|
|
1083
|
+
enabled: (options?.enabled ?? true) && arbi.isLoggedIn
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
function usePendingContacts(options) {
|
|
1087
|
+
const contacts = useContacts(options);
|
|
1088
|
+
const pending = React.useMemo(
|
|
1089
|
+
() => (contacts.data ?? []).filter(
|
|
1090
|
+
(c) => c.status === "invitation_pending" || c.status === "invitation_expired"
|
|
1091
|
+
),
|
|
1092
|
+
[contacts.data]
|
|
1093
|
+
);
|
|
1094
|
+
return { ...contacts, pending };
|
|
1095
|
+
}
|
|
1096
|
+
function useAddContacts() {
|
|
1097
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1098
|
+
const qc = reactQuery.useQueryClient();
|
|
1099
|
+
return reactQuery.useMutation({
|
|
1100
|
+
mutationFn: (emails) => arbi.contacts.add(emails),
|
|
1101
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.contacts() })
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
function useRemoveContacts() {
|
|
1105
|
+
const arbi = chunk7IOCMCC5_cjs.useArbi();
|
|
1106
|
+
const qc = reactQuery.useQueryClient();
|
|
1107
|
+
return reactQuery.useMutation({
|
|
1108
|
+
mutationFn: (contactIds) => arbi.contacts.remove(contactIds),
|
|
1109
|
+
onSuccess: () => qc.invalidateQueries({ queryKey: arbiQueryKeys.contacts() })
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1621
1112
|
function useWorkspaceDocs(workspaceId) {
|
|
1622
1113
|
const { data: docs = [], isLoading, isError } = useDocuments(workspaceId);
|
|
1623
1114
|
const docIds = React.useMemo(
|
|
@@ -1840,7 +1331,7 @@ function AiAnswer({
|
|
|
1840
1331
|
}
|
|
1841
1332
|
),
|
|
1842
1333
|
hasText && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1843
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1334
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.AiMarkdown, { isStreaming: running, children: text }),
|
|
1844
1335
|
!running && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-t border-border pt-2.5", children: [
|
|
1845
1336
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
1846
1337
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "size-3.5 text-ai-accent" }),
|
|
@@ -1885,7 +1376,7 @@ function AiActionCard({
|
|
|
1885
1376
|
const p = typeof prompt === "function" ? prompt() : prompt;
|
|
1886
1377
|
void task.run(p, docIds);
|
|
1887
1378
|
};
|
|
1888
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1379
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Card, { variant: "elevated", className: "rounded-xl p-5", "data-testid": testId, children: [
|
|
1889
1380
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
1890
1381
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
1891
1382
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-ai-accent-soft text-ai-accent", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }) }),
|
|
@@ -1895,7 +1386,7 @@ function AiActionCard({
|
|
|
1895
1386
|
] })
|
|
1896
1387
|
] }),
|
|
1897
1388
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1898
|
-
|
|
1389
|
+
chunkORKGCXG3_cjs.Button,
|
|
1899
1390
|
{
|
|
1900
1391
|
variant: task.isDone ? "outline" : "accent",
|
|
1901
1392
|
size: "sm",
|
|
@@ -2027,11 +1518,11 @@ function ArtifactCanvas({
|
|
|
2027
1518
|
children: active.title
|
|
2028
1519
|
}
|
|
2029
1520
|
),
|
|
2030
|
-
isRedline && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1521
|
+
isRedline && /* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Badge, { variant: "accent", className: "gap-1", children: [
|
|
2031
1522
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitCompareArrows, { className: "size-3" }),
|
|
2032
1523
|
" Redline"
|
|
2033
1524
|
] }),
|
|
2034
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1525
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Badge, { variant: "secondary", children: [
|
|
2035
1526
|
"v",
|
|
2036
1527
|
active.version
|
|
2037
1528
|
] }),
|
|
@@ -2087,7 +1578,7 @@ function ArtifactCanvas({
|
|
|
2087
1578
|
animate: { opacity: 1, y: 0 },
|
|
2088
1579
|
transition: { duration: 0.2 },
|
|
2089
1580
|
className: "mx-auto max-w-2xl rounded-lg bg-card p-8 shadow-sm ring-1 ring-border",
|
|
2090
|
-
children: active.mode === "html" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", dangerouslySetInnerHTML: { __html: active.content } }) : active.mode === "text" ? /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap font-mono text-xs text-foreground", children: active.content }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1581
|
+
children: active.mode === "html" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", dangerouslySetInnerHTML: { __html: active.content } }) : active.mode === "text" ? /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap font-mono text-xs text-foreground", children: active.content }) : /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.AiMarkdown, { children: active.content })
|
|
2091
1582
|
},
|
|
2092
1583
|
active.doc_ext_id
|
|
2093
1584
|
) }) })
|
|
@@ -2104,7 +1595,7 @@ function MessageArtifactCard({
|
|
|
2104
1595
|
const Icon = isImage ? lucideReact.Image : lucideReact.FileText;
|
|
2105
1596
|
const statusText = isImage ? isComplete ? "Image ready" : "Generating\u2026" : isComplete ? "Draft ready" : "Drafting\u2026";
|
|
2106
1597
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2107
|
-
|
|
1598
|
+
chunkORKGCXG3_cjs.Card,
|
|
2108
1599
|
{
|
|
2109
1600
|
variant: "outline",
|
|
2110
1601
|
className: "mt-3 flex items-center gap-3 px-3 py-2.5",
|
|
@@ -2180,7 +1671,7 @@ function DocSearch({
|
|
|
2180
1671
|
status === "done" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", "data-testid": "doc-search-results", children: [
|
|
2181
1672
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: results.length === 0 ? `No passages matched \u201C${query}\u201D.` : `${results.length} passage${results.length === 1 ? "" : "s"} for \u201C${query}\u201D` }),
|
|
2182
1673
|
results.slice(0, 8).map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2183
|
-
|
|
1674
|
+
chunkORKGCXG3_cjs.Card,
|
|
2184
1675
|
{
|
|
2185
1676
|
variant: "elevated",
|
|
2186
1677
|
className: chunkRZQACYNQ_cjs.cn(
|
|
@@ -2193,7 +1684,7 @@ function DocSearch({
|
|
|
2193
1684
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 flex items-center gap-2", children: [
|
|
2194
1685
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "size-3.5 text-ai-accent" }),
|
|
2195
1686
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-medium text-foreground", children: r.docTitle ?? "Document" }),
|
|
2196
|
-
r.page != null && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1687
|
+
r.page != null && /* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Badge, { variant: "secondary", children: [
|
|
2197
1688
|
"p.",
|
|
2198
1689
|
r.page
|
|
2199
1690
|
] }),
|
|
@@ -2287,7 +1778,7 @@ function DocumentReview({
|
|
|
2287
1778
|
findings.length ? ` \xB7 ${findings.length} findings` : ""
|
|
2288
1779
|
] })
|
|
2289
1780
|
] }),
|
|
2290
|
-
doc?.status ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1781
|
+
doc?.status ? /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Badge, { variant: "secondary", children: doc.status }) : null,
|
|
2291
1782
|
onClose ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2292
1783
|
"button",
|
|
2293
1784
|
{
|
|
@@ -2324,7 +1815,7 @@ function DocumentReview({
|
|
|
2324
1815
|
className: "w-full cursor-pointer rounded-md border p-2 text-left text-xs transition hover:border-ring hover:bg-muted/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2325
1816
|
children: [
|
|
2326
1817
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2327
|
-
|
|
1818
|
+
chunkORKGCXG3_cjs.TagEntity,
|
|
2328
1819
|
{
|
|
2329
1820
|
size: "sm",
|
|
2330
1821
|
tag: {
|
|
@@ -2369,7 +1860,7 @@ function DocumentReview({
|
|
|
2369
1860
|
),
|
|
2370
1861
|
children: [
|
|
2371
1862
|
highlighted ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2372
|
-
|
|
1863
|
+
chunkORKGCXG3_cjs.TagEntity,
|
|
2373
1864
|
{
|
|
2374
1865
|
size: "sm",
|
|
2375
1866
|
tag: {
|
|
@@ -2378,7 +1869,7 @@ function DocumentReview({
|
|
|
2378
1869
|
}
|
|
2379
1870
|
}
|
|
2380
1871
|
) }) : null,
|
|
2381
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1872
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.MarkdownRenderer, { className: "prose prose-sm max-w-none dark:prose-invert", children: c.content })
|
|
2382
1873
|
]
|
|
2383
1874
|
},
|
|
2384
1875
|
cid ?? i
|
|
@@ -2418,7 +1909,7 @@ function ResultRow({
|
|
|
2418
1909
|
onSelect
|
|
2419
1910
|
}) {
|
|
2420
1911
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2421
|
-
|
|
1912
|
+
chunkORKGCXG3_cjs.PassageCard,
|
|
2422
1913
|
{
|
|
2423
1914
|
onClick: onSelect,
|
|
2424
1915
|
active: isActive,
|
|
@@ -2427,7 +1918,7 @@ function ResultRow({
|
|
|
2427
1918
|
header: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2428
1919
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "size-3.5 shrink-0 text-ai-accent" }),
|
|
2429
1920
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-medium text-foreground", children: result.docTitle ?? "Document" }),
|
|
2430
|
-
result.page != null && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1921
|
+
result.page != null && /* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Badge, { variant: "secondary", children: [
|
|
2431
1922
|
"p.",
|
|
2432
1923
|
result.page
|
|
2433
1924
|
] })
|
|
@@ -2537,7 +2028,7 @@ function SemanticSearch({
|
|
|
2537
2028
|
"data-testid": "arbi-semantic-search-viewer",
|
|
2538
2029
|
children: selected && selected.docId ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col gap-2", children: [
|
|
2539
2030
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2540
|
-
|
|
2031
|
+
chunkORKGCXG3_cjs.Button,
|
|
2541
2032
|
{
|
|
2542
2033
|
variant: "ghost",
|
|
2543
2034
|
size: "sm",
|
|
@@ -2596,7 +2087,7 @@ Question: ${question}`,
|
|
|
2596
2087
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-3", "data-testid": "doc-qa", children: [
|
|
2597
2088
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2598
2089
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
-
|
|
2090
|
+
chunkORKGCXG3_cjs.Input,
|
|
2600
2091
|
{
|
|
2601
2092
|
value: q,
|
|
2602
2093
|
onChange: (e) => setQ(e.target.value),
|
|
@@ -2607,7 +2098,7 @@ Question: ${question}`,
|
|
|
2607
2098
|
}
|
|
2608
2099
|
),
|
|
2609
2100
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2610
|
-
|
|
2101
|
+
chunkORKGCXG3_cjs.Button,
|
|
2611
2102
|
{
|
|
2612
2103
|
variant: "accent",
|
|
2613
2104
|
size: "icon",
|
|
@@ -2619,7 +2110,7 @@ Question: ${question}`,
|
|
|
2619
2110
|
}
|
|
2620
2111
|
),
|
|
2621
2112
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2622
|
-
|
|
2113
|
+
chunkORKGCXG3_cjs.Button,
|
|
2623
2114
|
{
|
|
2624
2115
|
variant: "outline",
|
|
2625
2116
|
size: "sm",
|
|
@@ -2755,7 +2246,11 @@ var CitationRendererComponent = ({
|
|
|
2755
2246
|
onDismissCitation,
|
|
2756
2247
|
notify2
|
|
2757
2248
|
]);
|
|
2758
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkRZQACYNQ_cjs.cn("citation-container", className), "data-testid": "citation-renderer", children: renderMarkdown({
|
|
2249
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkRZQACYNQ_cjs.cn("citation-container", className), "data-testid": "citation-renderer", children: renderMarkdown({
|
|
2250
|
+
components: markdownComponents,
|
|
2251
|
+
isStreaming,
|
|
2252
|
+
children: chunkORKGCXG3_cjs.normalizeCitationMarkup(content)
|
|
2253
|
+
}) });
|
|
2759
2254
|
};
|
|
2760
2255
|
var CitationPopover = ({
|
|
2761
2256
|
citationNum,
|
|
@@ -2979,7 +2474,7 @@ var CitationLink = ({
|
|
|
2979
2474
|
triggerRef,
|
|
2980
2475
|
children
|
|
2981
2476
|
}) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2982
|
-
|
|
2477
|
+
chunkORKGCXG3_cjs.MarkMenu,
|
|
2983
2478
|
{
|
|
2984
2479
|
triggerRef,
|
|
2985
2480
|
items,
|
|
@@ -3017,8 +2512,8 @@ var DocIcon = ({ size = 16, className = "" }) => {
|
|
|
3017
2512
|
"path",
|
|
3018
2513
|
{
|
|
3019
2514
|
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z",
|
|
3020
|
-
fill:
|
|
3021
|
-
stroke:
|
|
2515
|
+
fill: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.doc,
|
|
2516
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.doc,
|
|
3022
2517
|
strokeWidth: "1",
|
|
3023
2518
|
strokeLinecap: "round",
|
|
3024
2519
|
strokeLinejoin: "round"
|
|
@@ -3029,7 +2524,7 @@ var DocIcon = ({ size = 16, className = "" }) => {
|
|
|
3029
2524
|
{
|
|
3030
2525
|
d: "M14 2v6h6",
|
|
3031
2526
|
fill: "none",
|
|
3032
|
-
stroke:
|
|
2527
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.white,
|
|
3033
2528
|
strokeWidth: "1",
|
|
3034
2529
|
strokeLinecap: "round",
|
|
3035
2530
|
strokeLinejoin: "round"
|
|
@@ -3067,8 +2562,8 @@ var HtmlIcon = ({ size = 16, className = "" }) => {
|
|
|
3067
2562
|
"path",
|
|
3068
2563
|
{
|
|
3069
2564
|
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z",
|
|
3070
|
-
fill:
|
|
3071
|
-
stroke:
|
|
2565
|
+
fill: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.html,
|
|
2566
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.html,
|
|
3072
2567
|
strokeWidth: "1",
|
|
3073
2568
|
strokeLinecap: "round",
|
|
3074
2569
|
strokeLinejoin: "round"
|
|
@@ -3079,7 +2574,7 @@ var HtmlIcon = ({ size = 16, className = "" }) => {
|
|
|
3079
2574
|
{
|
|
3080
2575
|
d: "M14 2v6h6",
|
|
3081
2576
|
fill: "none",
|
|
3082
|
-
stroke:
|
|
2577
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.white,
|
|
3083
2578
|
strokeWidth: "1",
|
|
3084
2579
|
strokeLinecap: "round",
|
|
3085
2580
|
strokeLinejoin: "round"
|
|
@@ -3117,8 +2612,8 @@ var TxtIcon = ({ size = 16, className = "" }) => {
|
|
|
3117
2612
|
"path",
|
|
3118
2613
|
{
|
|
3119
2614
|
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z",
|
|
3120
|
-
fill:
|
|
3121
|
-
stroke:
|
|
2615
|
+
fill: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.txt,
|
|
2616
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.txt,
|
|
3122
2617
|
strokeWidth: "1",
|
|
3123
2618
|
strokeLinecap: "round",
|
|
3124
2619
|
strokeLinejoin: "round"
|
|
@@ -3129,7 +2624,7 @@ var TxtIcon = ({ size = 16, className = "" }) => {
|
|
|
3129
2624
|
{
|
|
3130
2625
|
d: "M14 2v6h6",
|
|
3131
2626
|
fill: "none",
|
|
3132
|
-
stroke:
|
|
2627
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.white,
|
|
3133
2628
|
strokeWidth: "1",
|
|
3134
2629
|
strokeLinecap: "round",
|
|
3135
2630
|
strokeLinejoin: "round"
|
|
@@ -3167,8 +2662,8 @@ var XlsIcon = ({ size = 16, className = "" }) => {
|
|
|
3167
2662
|
"path",
|
|
3168
2663
|
{
|
|
3169
2664
|
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z",
|
|
3170
|
-
fill:
|
|
3171
|
-
stroke:
|
|
2665
|
+
fill: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.xls,
|
|
2666
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.xls,
|
|
3172
2667
|
strokeWidth: "1",
|
|
3173
2668
|
strokeLinecap: "round",
|
|
3174
2669
|
strokeLinejoin: "round"
|
|
@@ -3179,7 +2674,7 @@ var XlsIcon = ({ size = 16, className = "" }) => {
|
|
|
3179
2674
|
{
|
|
3180
2675
|
d: "M14 2v6h6",
|
|
3181
2676
|
fill: "none",
|
|
3182
|
-
stroke:
|
|
2677
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.white,
|
|
3183
2678
|
strokeWidth: "1",
|
|
3184
2679
|
strokeLinecap: "round",
|
|
3185
2680
|
strokeLinejoin: "round"
|
|
@@ -3217,8 +2712,8 @@ var FileIcon = ({ size = 16, className = "" }) => {
|
|
|
3217
2712
|
"path",
|
|
3218
2713
|
{
|
|
3219
2714
|
d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z",
|
|
3220
|
-
fill:
|
|
3221
|
-
stroke:
|
|
2715
|
+
fill: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.generic,
|
|
2716
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.generic,
|
|
3222
2717
|
strokeWidth: "1",
|
|
3223
2718
|
strokeLinecap: "round",
|
|
3224
2719
|
strokeLinejoin: "round"
|
|
@@ -3229,7 +2724,7 @@ var FileIcon = ({ size = 16, className = "" }) => {
|
|
|
3229
2724
|
{
|
|
3230
2725
|
d: "M14 2v6h6",
|
|
3231
2726
|
fill: "none",
|
|
3232
|
-
stroke:
|
|
2727
|
+
stroke: chunkORKGCXG3_cjs.FILE_TYPE_COLORS.white,
|
|
3233
2728
|
strokeWidth: "1",
|
|
3234
2729
|
strokeLinecap: "round",
|
|
3235
2730
|
strokeLinejoin: "round"
|
|
@@ -3585,7 +3080,7 @@ var ArbiBotIcon = ({ size = 24, className = "" }) => {
|
|
|
3585
3080
|
);
|
|
3586
3081
|
};
|
|
3587
3082
|
function getNotificationTypeMeta(type) {
|
|
3588
|
-
const WorkspaceIcon =
|
|
3083
|
+
const WorkspaceIcon = chunkORKGCXG3_cjs.getEntityIcon("WORKSPACE");
|
|
3589
3084
|
switch (type) {
|
|
3590
3085
|
case "user_message":
|
|
3591
3086
|
return { Icon: lucideReact.MessageCircleMore, iconClassName: "text-primary", label: "Message" };
|
|
@@ -3700,7 +3195,7 @@ function describeActivity(content) {
|
|
|
3700
3195
|
}
|
|
3701
3196
|
default:
|
|
3702
3197
|
return {
|
|
3703
|
-
Icon: parsed.workspace_ext_id ?
|
|
3198
|
+
Icon: parsed.workspace_ext_id ? chunkORKGCXG3_cjs.getEntityIcon("WORKSPACE") : lucideReact.Activity,
|
|
3704
3199
|
iconClassName: "text-muted-foreground",
|
|
3705
3200
|
title: humaniseEvent(parsed.event)
|
|
3706
3201
|
};
|
|
@@ -3789,7 +3284,6 @@ function isAgentUser(user) {
|
|
|
3789
3284
|
return user.external_id.startsWith("agt-");
|
|
3790
3285
|
}
|
|
3791
3286
|
var DM_QUERY_KEY = ["arbi", "directMessages"];
|
|
3792
|
-
var CONTACTS_QUERY_KEY = ["arbi", "contacts"];
|
|
3793
3287
|
function mergeContacts(threads, contacts) {
|
|
3794
3288
|
const byPeer = /* @__PURE__ */ new Map();
|
|
3795
3289
|
for (const t of threads) byPeer.set(t.peer.external_id, t);
|
|
@@ -3855,7 +3349,7 @@ function useDirectMessages(options) {
|
|
|
3855
3349
|
enabled
|
|
3856
3350
|
});
|
|
3857
3351
|
const contactsQuery = reactQuery.useQuery({
|
|
3858
|
-
queryKey:
|
|
3352
|
+
queryKey: arbiQueryKeys.contacts(),
|
|
3859
3353
|
queryFn: () => arbi.contacts.list(),
|
|
3860
3354
|
enabled
|
|
3861
3355
|
});
|
|
@@ -3917,7 +3411,7 @@ function DmAvatar({ user, className, size = "lg" }) {
|
|
|
3917
3411
|
const presence = useArbiWsStore((s) => s.presence[user.external_id]);
|
|
3918
3412
|
const displayStatus = presence === void 0 ? void 0 : presence === "online" ? "connected" : "disconnected";
|
|
3919
3413
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3920
|
-
|
|
3414
|
+
chunkORKGCXG3_cjs.UserEntity,
|
|
3921
3415
|
{
|
|
3922
3416
|
variant: "icon",
|
|
3923
3417
|
size,
|
|
@@ -3927,7 +3421,7 @@ function DmAvatar({ user, className, size = "lg" }) {
|
|
|
3927
3421
|
initials: userInitials(user),
|
|
3928
3422
|
displayName: userDisplayName(user),
|
|
3929
3423
|
picture: user.picture,
|
|
3930
|
-
avatarStyle:
|
|
3424
|
+
avatarStyle: chunkORKGCXG3_cjs.getEntityColorStyles(user.external_id),
|
|
3931
3425
|
isAgent: isAgentUser(user),
|
|
3932
3426
|
displayStatus
|
|
3933
3427
|
}
|
|
@@ -3940,6 +3434,7 @@ function ConversationList({
|
|
|
3940
3434
|
classNames,
|
|
3941
3435
|
emptyState,
|
|
3942
3436
|
header,
|
|
3437
|
+
lead,
|
|
3943
3438
|
className
|
|
3944
3439
|
}) {
|
|
3945
3440
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3959,6 +3454,7 @@ function ConversationList({
|
|
|
3959
3454
|
conversations.length === 1 ? "colleague" : "colleagues"
|
|
3960
3455
|
] })
|
|
3961
3456
|
] }) : header,
|
|
3457
|
+
lead,
|
|
3962
3458
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: conversations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-6 text-xs text-muted-foreground", children: emptyState ?? "No conversations yet." }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "w-full", children: conversations.map((c, i) => {
|
|
3963
3459
|
const { peer, lastMessage, unreadCount } = c;
|
|
3964
3460
|
const newSection = c.sectionLabel && c.sectionLabel !== conversations[i - 1]?.sectionLabel;
|
|
@@ -3980,10 +3476,10 @@ function ConversationList({
|
|
|
3980
3476
|
children: userDisplayName(peer)
|
|
3981
3477
|
}
|
|
3982
3478
|
),
|
|
3983
|
-
c.badge ?? (isAgentUser(peer) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3479
|
+
c.badge ?? (isAgentUser(peer) ? /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.AgentBadge, {}) : null)
|
|
3984
3480
|
] }),
|
|
3985
3481
|
c.statusLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3986
|
-
|
|
3482
|
+
chunkORKGCXG3_cjs.Badge,
|
|
3987
3483
|
{
|
|
3988
3484
|
variant: "outline",
|
|
3989
3485
|
className: "shrink-0 rounded-full px-2 py-0 text-xs font-medium text-muted-foreground",
|
|
@@ -3994,7 +3490,7 @@ function ConversationList({
|
|
|
3994
3490
|
// shouted louder than the message it was counting.
|
|
3995
3491
|
// Enough to catch the eye scanning the list, no more.
|
|
3996
3492
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3997
|
-
|
|
3493
|
+
chunkORKGCXG3_cjs.Badge,
|
|
3998
3494
|
{
|
|
3999
3495
|
variant: "accent",
|
|
4000
3496
|
className: chunkRZQACYNQ_cjs.cn(
|
|
@@ -4101,7 +3597,7 @@ function annotateThread(messages, accessors, runWindowMs = RUN_WINDOW_MS) {
|
|
|
4101
3597
|
function DateSeparator({ children }) {
|
|
4102
3598
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-3 flex justify-center", "data-testid": "dm-date-separator", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-background/80 px-2 py-0.5 text-xs text-muted-foreground", children }) });
|
|
4103
3599
|
}
|
|
4104
|
-
function
|
|
3600
|
+
function MessageBubble({
|
|
4105
3601
|
message,
|
|
4106
3602
|
classNames,
|
|
4107
3603
|
isLastOfRun = true,
|
|
@@ -4167,7 +3663,7 @@ function MessageThread({
|
|
|
4167
3663
|
items.map(({ message: m, isLastOfRun, isFirstOfDay }) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
4168
3664
|
isFirstOfDay && formatDay && /* @__PURE__ */ jsxRuntime.jsx(DateSeparator, { children: formatDay(m.createdAt) }),
|
|
4169
3665
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4170
|
-
|
|
3666
|
+
MessageBubble,
|
|
4171
3667
|
{
|
|
4172
3668
|
message: m,
|
|
4173
3669
|
classNames,
|
|
@@ -4213,7 +3709,7 @@ function DmComposer({
|
|
|
4213
3709
|
children,
|
|
4214
3710
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
4215
3711
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4216
|
-
|
|
3712
|
+
chunkORKGCXG3_cjs.Textarea,
|
|
4217
3713
|
{
|
|
4218
3714
|
ref: inputRef,
|
|
4219
3715
|
value: draft,
|
|
@@ -4227,7 +3723,7 @@ function DmComposer({
|
|
|
4227
3723
|
}
|
|
4228
3724
|
),
|
|
4229
3725
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4230
|
-
|
|
3726
|
+
chunkORKGCXG3_cjs.Button,
|
|
4231
3727
|
{
|
|
4232
3728
|
type: "button",
|
|
4233
3729
|
onClick: () => void submit(),
|
|
@@ -4245,14 +3741,117 @@ function DmComposer({
|
|
|
4245
3741
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-destructive", "data-testid": "arbi-dm-error", children: error })
|
|
4246
3742
|
] });
|
|
4247
3743
|
}
|
|
3744
|
+
var DEFAULT_START_BY_EMAIL_LABELS = {
|
|
3745
|
+
email: "Email address",
|
|
3746
|
+
emailPlaceholder: "name@example.com",
|
|
3747
|
+
message: "Message",
|
|
3748
|
+
messagePlaceholder: "Write the first message\u2026",
|
|
3749
|
+
send: "Send",
|
|
3750
|
+
sending: "Sending\u2026",
|
|
3751
|
+
invalidEmail: "Enter a valid email address."
|
|
3752
|
+
};
|
|
3753
|
+
var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
3754
|
+
function StartByEmail({
|
|
3755
|
+
onStart,
|
|
3756
|
+
onStarted,
|
|
3757
|
+
classNames,
|
|
3758
|
+
labels,
|
|
3759
|
+
className
|
|
3760
|
+
}) {
|
|
3761
|
+
const l = { ...DEFAULT_START_BY_EMAIL_LABELS, ...labels };
|
|
3762
|
+
const uid = React.useId();
|
|
3763
|
+
const [email, setEmail] = React.useState("");
|
|
3764
|
+
const [text, setText] = React.useState("");
|
|
3765
|
+
const [busy, setBusy] = React.useState(false);
|
|
3766
|
+
const [error, setError] = React.useState(null);
|
|
3767
|
+
const address = email.trim().toLowerCase();
|
|
3768
|
+
const valid = EMAIL.test(address);
|
|
3769
|
+
const submit = async () => {
|
|
3770
|
+
if (!valid || !text.trim() || busy) return;
|
|
3771
|
+
setBusy(true);
|
|
3772
|
+
setError(null);
|
|
3773
|
+
try {
|
|
3774
|
+
const result = await onStart(address, text.trim());
|
|
3775
|
+
setEmail("");
|
|
3776
|
+
setText("");
|
|
3777
|
+
onStarted?.(result);
|
|
3778
|
+
} catch (e) {
|
|
3779
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3780
|
+
} finally {
|
|
3781
|
+
setBusy(false);
|
|
3782
|
+
}
|
|
3783
|
+
};
|
|
3784
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3785
|
+
"form",
|
|
3786
|
+
{
|
|
3787
|
+
"data-testid": "arbi-dm-start",
|
|
3788
|
+
className: chunkRZQACYNQ_cjs.cn("flex flex-col gap-2 border-b border-border px-4 py-3", className),
|
|
3789
|
+
onSubmit: (e) => {
|
|
3790
|
+
e.preventDefault();
|
|
3791
|
+
void submit();
|
|
3792
|
+
},
|
|
3793
|
+
children: [
|
|
3794
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Label, { htmlFor: `${uid}-email`, children: l.email }),
|
|
3795
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3796
|
+
chunkORKGCXG3_cjs.Input,
|
|
3797
|
+
{
|
|
3798
|
+
id: `${uid}-email`,
|
|
3799
|
+
type: "email",
|
|
3800
|
+
value: email,
|
|
3801
|
+
onChange: (e) => setEmail(e.target.value),
|
|
3802
|
+
placeholder: l.emailPlaceholder,
|
|
3803
|
+
"aria-invalid": email !== "" && !valid,
|
|
3804
|
+
"aria-describedby": email !== "" && !valid ? `${uid}-bad` : void 0,
|
|
3805
|
+
disabled: busy,
|
|
3806
|
+
"data-testid": "arbi-dm-start-email"
|
|
3807
|
+
}
|
|
3808
|
+
),
|
|
3809
|
+
email !== "" && !valid && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${uid}-bad`, className: "text-xs text-destructive", children: l.invalidEmail }),
|
|
3810
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Label, { htmlFor: `${uid}-text`, children: l.message }),
|
|
3811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3812
|
+
chunkORKGCXG3_cjs.Textarea,
|
|
3813
|
+
{
|
|
3814
|
+
id: `${uid}-text`,
|
|
3815
|
+
value: text,
|
|
3816
|
+
onChange: (e) => setText(e.target.value),
|
|
3817
|
+
placeholder: l.messagePlaceholder,
|
|
3818
|
+
rows: 2,
|
|
3819
|
+
disabled: busy,
|
|
3820
|
+
"data-testid": "arbi-dm-start-message"
|
|
3821
|
+
}
|
|
3822
|
+
),
|
|
3823
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-xs text-destructive", "data-testid": "arbi-dm-start-error", children: error }),
|
|
3824
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3825
|
+
chunkORKGCXG3_cjs.Button,
|
|
3826
|
+
{
|
|
3827
|
+
type: "submit",
|
|
3828
|
+
size: "sm",
|
|
3829
|
+
disabled: !valid || !text.trim() || busy,
|
|
3830
|
+
className: chunkRZQACYNQ_cjs.cn("self-end", classNames?.sendButton),
|
|
3831
|
+
"data-testid": "arbi-dm-start-send",
|
|
3832
|
+
children: [
|
|
3833
|
+
busy ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "size-4", "aria-hidden": true }),
|
|
3834
|
+
busy ? l.sending : l.send
|
|
3835
|
+
]
|
|
3836
|
+
}
|
|
3837
|
+
)
|
|
3838
|
+
]
|
|
3839
|
+
}
|
|
3840
|
+
);
|
|
3841
|
+
}
|
|
4248
3842
|
function DirectMessages({
|
|
4249
3843
|
className,
|
|
4250
3844
|
classNames,
|
|
4251
|
-
emptyThread,
|
|
4252
|
-
emptyList
|
|
3845
|
+
emptyThread: emptyThread2,
|
|
3846
|
+
emptyList,
|
|
3847
|
+
listHeader,
|
|
3848
|
+
listLead,
|
|
3849
|
+
startByEmail,
|
|
3850
|
+
hideOwnContact
|
|
4253
3851
|
}) {
|
|
4254
3852
|
const {
|
|
4255
|
-
conversations,
|
|
3853
|
+
conversations: allConversations,
|
|
3854
|
+
myExtId,
|
|
4256
3855
|
isLoading,
|
|
4257
3856
|
isError,
|
|
4258
3857
|
error,
|
|
@@ -4262,6 +3861,14 @@ function DirectMessages({
|
|
|
4262
3861
|
markRead
|
|
4263
3862
|
} = useDirectMessages();
|
|
4264
3863
|
const [selectedPeerId, setSelectedPeerId] = React.useState(null);
|
|
3864
|
+
const conversations = React.useMemo(
|
|
3865
|
+
() => hideOwnContact && myExtId ? allConversations.filter((c) => c.peer.external_id !== myExtId) : allConversations,
|
|
3866
|
+
[allConversations, hideOwnContact, myExtId]
|
|
3867
|
+
);
|
|
3868
|
+
const openStarted = (created) => {
|
|
3869
|
+
const peer = Array.isArray(created) ? created[0]?.recipient?.external_id : void 0;
|
|
3870
|
+
if (peer) setSelectedPeerId(peer);
|
|
3871
|
+
};
|
|
4265
3872
|
const loadError = isError ? error instanceof Error ? error.message : "Couldn\u2019t load messages." : null;
|
|
4266
3873
|
const selected = React.useMemo(
|
|
4267
3874
|
() => conversations.find((c) => c.peer.external_id === selectedPeerId) ?? null,
|
|
@@ -4305,11 +3912,24 @@ function DirectMessages({
|
|
|
4305
3912
|
selectedPeerId: selected?.peer.external_id ?? null,
|
|
4306
3913
|
onSelect: setSelectedPeerId,
|
|
4307
3914
|
classNames,
|
|
4308
|
-
emptyState: isLoading ? "Loading messages\u2026" : emptyList
|
|
3915
|
+
emptyState: isLoading ? "Loading messages\u2026" : emptyList,
|
|
3916
|
+
header: listHeader,
|
|
3917
|
+
lead: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3918
|
+
listLead,
|
|
3919
|
+
startByEmail && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3920
|
+
StartByEmail,
|
|
3921
|
+
{
|
|
3922
|
+
onStart: sendMessageTo,
|
|
3923
|
+
onStarted: openStarted,
|
|
3924
|
+
classNames,
|
|
3925
|
+
labels: typeof startByEmail === "object" ? startByEmail.labels : void 0
|
|
3926
|
+
}
|
|
3927
|
+
)
|
|
3928
|
+
] })
|
|
4309
3929
|
}
|
|
4310
3930
|
),
|
|
4311
3931
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
4312
|
-
/* @__PURE__ */ jsxRuntime.jsx(MessageThread, { conversation: selected, classNames, emptyState:
|
|
3932
|
+
/* @__PURE__ */ jsxRuntime.jsx(MessageThread, { conversation: selected, classNames, emptyState: emptyThread2 }),
|
|
4313
3933
|
selected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4314
3934
|
DmComposer,
|
|
4315
3935
|
{
|
|
@@ -4392,7 +4012,7 @@ function ImageCropper({
|
|
|
4392
4012
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
4393
4013
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: "Zoom" }),
|
|
4394
4014
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4395
|
-
|
|
4015
|
+
chunkORKGCXG3_cjs.Slider,
|
|
4396
4016
|
{
|
|
4397
4017
|
value: [zoom],
|
|
4398
4018
|
onValueChange: ([v]) => setZoom(v ?? 1),
|
|
@@ -4469,8 +4089,8 @@ function ImageCropModal({
|
|
|
4469
4089
|
setBusy(false);
|
|
4470
4090
|
}
|
|
4471
4091
|
};
|
|
4472
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4473
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4092
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Dialog, { open, onOpenChange: (next) => !next ? onCancel() : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.DialogContent, { className: "sm:max-w-md", "data-testid": "image-crop-modal", children: [
|
|
4093
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.DialogTitle, { children: title }) }),
|
|
4474
4094
|
image ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4475
4095
|
ImageCropper,
|
|
4476
4096
|
{
|
|
@@ -4481,9 +4101,9 @@ function ImageCropModal({
|
|
|
4481
4101
|
onCropComplete: setArea
|
|
4482
4102
|
}
|
|
4483
4103
|
) : null,
|
|
4484
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4485
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4486
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.DialogFooter, { className: "gap-2 sm:gap-2", children: [
|
|
4105
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Button, { variant: "ghost", onClick: onCancel, disabled: busy, children: "Cancel" }),
|
|
4106
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Button, { onClick: handleSave, disabled: !area || busy, "data-testid": "image-crop-save", children: [
|
|
4487
4107
|
busy ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 size-4 animate-spin" }) : null,
|
|
4488
4108
|
saveLabel
|
|
4489
4109
|
] })
|
|
@@ -4549,8 +4169,8 @@ function CommandPalette({
|
|
|
4549
4169
|
if (!q || task.isRunning) return;
|
|
4550
4170
|
void task.run(buildAskPrompt(q), askDocIds, { model });
|
|
4551
4171
|
};
|
|
4552
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4553
|
-
|
|
4172
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4173
|
+
chunkORKGCXG3_cjs.DialogContent,
|
|
4554
4174
|
{
|
|
4555
4175
|
className: chunkRZQACYNQ_cjs.cn(
|
|
4556
4176
|
"top-[12%] max-w-2xl translate-y-0 gap-0 overflow-hidden p-0",
|
|
@@ -4558,7 +4178,7 @@ function CommandPalette({
|
|
|
4558
4178
|
),
|
|
4559
4179
|
"data-testid": testId,
|
|
4560
4180
|
children: [
|
|
4561
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4181
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.DialogTitle, { className: "sr-only", children: "Command palette" }),
|
|
4562
4182
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-b border-border px-4", children: [
|
|
4563
4183
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: chunkRZQACYNQ_cjs.cn("size-4 shrink-0 text-ai-accent", classNames?.leadingIcon) }),
|
|
4564
4184
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4629,7 +4249,7 @@ function CommandPalette({
|
|
|
4629
4249
|
}
|
|
4630
4250
|
),
|
|
4631
4251
|
task.isDone && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4632
|
-
|
|
4252
|
+
chunkORKGCXG3_cjs.Button,
|
|
4633
4253
|
{
|
|
4634
4254
|
variant: "outline",
|
|
4635
4255
|
size: "sm",
|
|
@@ -4827,7 +4447,7 @@ function DocumentTable({
|
|
|
4827
4447
|
const doc = p.data;
|
|
4828
4448
|
if (!doc) return null;
|
|
4829
4449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4830
|
-
|
|
4450
|
+
chunkORKGCXG3_cjs.DocumentEntity,
|
|
4831
4451
|
{
|
|
4832
4452
|
doc,
|
|
4833
4453
|
size: "base",
|
|
@@ -4850,7 +4470,7 @@ function DocumentTable({
|
|
|
4850
4470
|
cellRenderer: (p) => {
|
|
4851
4471
|
const status = p.data?.status;
|
|
4852
4472
|
if (!status) return null;
|
|
4853
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4473
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkORKGCXG3_cjs.Badge, { variant: STATUS_VARIANTS[status.toLowerCase()] ?? "secondary", children: status });
|
|
4854
4474
|
}
|
|
4855
4475
|
},
|
|
4856
4476
|
{
|
|
@@ -4864,7 +4484,7 @@ function DocumentTable({
|
|
|
4864
4484
|
const doctags = p.data?.doctags ?? [];
|
|
4865
4485
|
if (doctags.length === 0) return null;
|
|
4866
4486
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-1 py-1", children: doctags.map((dt) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4867
|
-
|
|
4487
|
+
chunkORKGCXG3_cjs.TagEntity,
|
|
4868
4488
|
{
|
|
4869
4489
|
size: "sm",
|
|
4870
4490
|
tag: {
|
|
@@ -5140,7 +4760,7 @@ function DocumentGallery({
|
|
|
5140
4760
|
(dt) => tagNameById.get(dt.tag_ext_id) ?? dt.tag_ext_id.slice(0, 8)
|
|
5141
4761
|
);
|
|
5142
4762
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-doc-id": id, "data-testid": "document-gallery-card", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5143
|
-
|
|
4763
|
+
chunkORKGCXG3_cjs.DocumentCard,
|
|
5144
4764
|
{
|
|
5145
4765
|
doc,
|
|
5146
4766
|
thumbnailUrl: thumbs[id],
|
|
@@ -5177,7 +4797,7 @@ function VoiceNoteRecorder({
|
|
|
5177
4797
|
isSaving = false,
|
|
5178
4798
|
transcribe
|
|
5179
4799
|
}) {
|
|
5180
|
-
const recorder =
|
|
4800
|
+
const recorder = chunkORKGCXG3_cjs.useAudioRecorder();
|
|
5181
4801
|
const [transcript, setTranscript] = React.useState(null);
|
|
5182
4802
|
const [isTranscribing, setIsTranscribing] = React.useState(false);
|
|
5183
4803
|
React.useEffect(() => {
|
|
@@ -5209,7 +4829,7 @@ function VoiceNoteRecorder({
|
|
|
5209
4829
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-6 p-8", children: [
|
|
5210
4830
|
recorder.state === "idle" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5211
4831
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5212
|
-
|
|
4832
|
+
chunkORKGCXG3_cjs.Button,
|
|
5213
4833
|
{
|
|
5214
4834
|
type: "button",
|
|
5215
4835
|
size: "lg",
|
|
@@ -5223,7 +4843,7 @@ function VoiceNoteRecorder({
|
|
|
5223
4843
|
] }),
|
|
5224
4844
|
(recorder.state === "recording" || recorder.state === "paused") && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5225
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5226
|
-
|
|
4846
|
+
chunkORKGCXG3_cjs.MicWaveformIndicator,
|
|
5227
4847
|
{
|
|
5228
4848
|
level: recorder.level,
|
|
5229
4849
|
elapsedMs: recorder.elapsedMs,
|
|
@@ -5232,7 +4852,7 @@ function VoiceNoteRecorder({
|
|
|
5232
4852
|
),
|
|
5233
4853
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5234
4854
|
recorder.state === "recording" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5235
|
-
|
|
4855
|
+
chunkORKGCXG3_cjs.Button,
|
|
5236
4856
|
{
|
|
5237
4857
|
type: "button",
|
|
5238
4858
|
variant: "outline",
|
|
@@ -5244,7 +4864,7 @@ function VoiceNoteRecorder({
|
|
|
5244
4864
|
]
|
|
5245
4865
|
}
|
|
5246
4866
|
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5247
|
-
|
|
4867
|
+
chunkORKGCXG3_cjs.Button,
|
|
5248
4868
|
{
|
|
5249
4869
|
type: "button",
|
|
5250
4870
|
variant: "outline",
|
|
@@ -5256,7 +4876,7 @@ function VoiceNoteRecorder({
|
|
|
5256
4876
|
]
|
|
5257
4877
|
}
|
|
5258
4878
|
),
|
|
5259
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4879
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkORKGCXG3_cjs.Button, { type: "button", onClick: recorder.stop, "data-testid": "voice-note-stop-button", children: [
|
|
5260
4880
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "mr-1.5 h-3.5 w-3.5 fill-current" }),
|
|
5261
4881
|
"Stop"
|
|
5262
4882
|
] })
|
|
@@ -5280,7 +4900,7 @@ function VoiceNoteRecorder({
|
|
|
5280
4900
|
),
|
|
5281
4901
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5282
4902
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5283
|
-
|
|
4903
|
+
chunkORKGCXG3_cjs.Button,
|
|
5284
4904
|
{
|
|
5285
4905
|
type: "button",
|
|
5286
4906
|
variant: "outline",
|
|
@@ -5294,7 +4914,7 @@ function VoiceNoteRecorder({
|
|
|
5294
4914
|
}
|
|
5295
4915
|
),
|
|
5296
4916
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5297
|
-
|
|
4917
|
+
chunkORKGCXG3_cjs.Button,
|
|
5298
4918
|
{
|
|
5299
4919
|
type: "button",
|
|
5300
4920
|
variant: "outline",
|
|
@@ -5308,7 +4928,7 @@ function VoiceNoteRecorder({
|
|
|
5308
4928
|
}
|
|
5309
4929
|
),
|
|
5310
4930
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5311
|
-
|
|
4931
|
+
chunkORKGCXG3_cjs.Button,
|
|
5312
4932
|
{
|
|
5313
4933
|
type: "button",
|
|
5314
4934
|
onClick: handleSave,
|
|
@@ -5345,7 +4965,7 @@ function DraftTitleControls({
|
|
|
5345
4965
|
}
|
|
5346
4966
|
),
|
|
5347
4967
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5348
|
-
|
|
4968
|
+
chunkORKGCXG3_cjs.IconToggle,
|
|
5349
4969
|
{
|
|
5350
4970
|
icon: lucideReact.Sparkles,
|
|
5351
4971
|
isActive: autoRename,
|
|
@@ -5379,7 +4999,7 @@ function useCameraStream(constraints = { video: true, audio: false }) {
|
|
|
5379
4999
|
streamRef.current = media;
|
|
5380
5000
|
setStream(media);
|
|
5381
5001
|
} catch (err) {
|
|
5382
|
-
setError(
|
|
5002
|
+
setError(chunkORKGCXG3_cjs.classifyMediaError(err, "camera"));
|
|
5383
5003
|
} finally {
|
|
5384
5004
|
setIsStarting(false);
|
|
5385
5005
|
}
|
|
@@ -5510,7 +5130,7 @@ function PhotoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5510
5130
|
}
|
|
5511
5131
|
) }),
|
|
5512
5132
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5513
|
-
|
|
5133
|
+
chunkORKGCXG3_cjs.Button,
|
|
5514
5134
|
{
|
|
5515
5135
|
type: "button",
|
|
5516
5136
|
size: "lg",
|
|
@@ -5528,7 +5148,7 @@ function PhotoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5528
5148
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsxRuntime.jsx(chunk7IOCMCC5_cjs.ImageViewer, { blob: capturedBlob, alt: "Captured photo" }) }),
|
|
5529
5149
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5530
5150
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5531
|
-
|
|
5151
|
+
chunkORKGCXG3_cjs.Button,
|
|
5532
5152
|
{
|
|
5533
5153
|
type: "button",
|
|
5534
5154
|
variant: "outline",
|
|
@@ -5542,7 +5162,7 @@ function PhotoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5542
5162
|
}
|
|
5543
5163
|
),
|
|
5544
5164
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5545
|
-
|
|
5165
|
+
chunkORKGCXG3_cjs.Button,
|
|
5546
5166
|
{
|
|
5547
5167
|
type: "button",
|
|
5548
5168
|
variant: "outline",
|
|
@@ -5556,7 +5176,7 @@ function PhotoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5556
5176
|
}
|
|
5557
5177
|
),
|
|
5558
5178
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5559
|
-
|
|
5179
|
+
chunkORKGCXG3_cjs.Button,
|
|
5560
5180
|
{
|
|
5561
5181
|
type: "button",
|
|
5562
5182
|
onClick: handleSave,
|
|
@@ -5615,10 +5235,10 @@ function VideoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5615
5235
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-red-500" })
|
|
5616
5236
|
] }),
|
|
5617
5237
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-red-500", children: "Rec" }),
|
|
5618
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children:
|
|
5238
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: chunkORKGCXG3_cjs.formatElapsed(recorder.elapsedMs) })
|
|
5619
5239
|
] }),
|
|
5620
5240
|
recorder.state === "recording" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5621
|
-
|
|
5241
|
+
chunkORKGCXG3_cjs.Button,
|
|
5622
5242
|
{
|
|
5623
5243
|
type: "button",
|
|
5624
5244
|
size: "lg",
|
|
@@ -5628,7 +5248,7 @@ function VideoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5628
5248
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "h-5 w-5 fill-current" })
|
|
5629
5249
|
}
|
|
5630
5250
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5631
|
-
|
|
5251
|
+
chunkORKGCXG3_cjs.Button,
|
|
5632
5252
|
{
|
|
5633
5253
|
type: "button",
|
|
5634
5254
|
size: "lg",
|
|
@@ -5645,7 +5265,7 @@ function VideoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5645
5265
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsxRuntime.jsx(chunk7IOCMCC5_cjs.VideoViewer, { blob: recorder.blob, title: "Captured video" }) }),
|
|
5646
5266
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5647
5267
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5648
|
-
|
|
5268
|
+
chunkORKGCXG3_cjs.Button,
|
|
5649
5269
|
{
|
|
5650
5270
|
type: "button",
|
|
5651
5271
|
variant: "outline",
|
|
@@ -5659,7 +5279,7 @@ function VideoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5659
5279
|
}
|
|
5660
5280
|
),
|
|
5661
5281
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5662
|
-
|
|
5282
|
+
chunkORKGCXG3_cjs.Button,
|
|
5663
5283
|
{
|
|
5664
5284
|
type: "button",
|
|
5665
5285
|
variant: "outline",
|
|
@@ -5673,7 +5293,7 @@ function VideoCapture({ onSave, onDiscard, onError, isSaving = false }) {
|
|
|
5673
5293
|
}
|
|
5674
5294
|
),
|
|
5675
5295
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5676
|
-
|
|
5296
|
+
chunkORKGCXG3_cjs.Button,
|
|
5677
5297
|
{
|
|
5678
5298
|
type: "button",
|
|
5679
5299
|
onClick: handleSave,
|
|
@@ -5752,551 +5372,555 @@ Object.defineProperty(exports, "useNotify", {
|
|
|
5752
5372
|
});
|
|
5753
5373
|
Object.defineProperty(exports, "AgentBadge", {
|
|
5754
5374
|
enumerable: true,
|
|
5755
|
-
get: function () { return
|
|
5375
|
+
get: function () { return chunkORKGCXG3_cjs.AgentBadge; }
|
|
5756
5376
|
});
|
|
5757
5377
|
Object.defineProperty(exports, "AiMarkdown", {
|
|
5758
5378
|
enumerable: true,
|
|
5759
|
-
get: function () { return
|
|
5379
|
+
get: function () { return chunkORKGCXG3_cjs.AiMarkdown; }
|
|
5760
5380
|
});
|
|
5761
5381
|
Object.defineProperty(exports, "ArbiBotHeadIcon", {
|
|
5762
5382
|
enumerable: true,
|
|
5763
|
-
get: function () { return
|
|
5383
|
+
get: function () { return chunkORKGCXG3_cjs.ArbiBotHeadIcon; }
|
|
5764
5384
|
});
|
|
5765
5385
|
Object.defineProperty(exports, "AudIcon", {
|
|
5766
5386
|
enumerable: true,
|
|
5767
|
-
get: function () { return
|
|
5387
|
+
get: function () { return chunkORKGCXG3_cjs.AudIcon; }
|
|
5768
5388
|
});
|
|
5769
5389
|
Object.defineProperty(exports, "Avatar", {
|
|
5770
5390
|
enumerable: true,
|
|
5771
|
-
get: function () { return
|
|
5391
|
+
get: function () { return chunkORKGCXG3_cjs.Avatar; }
|
|
5772
5392
|
});
|
|
5773
5393
|
Object.defineProperty(exports, "AvatarFallback", {
|
|
5774
5394
|
enumerable: true,
|
|
5775
|
-
get: function () { return
|
|
5395
|
+
get: function () { return chunkORKGCXG3_cjs.AvatarFallback; }
|
|
5776
5396
|
});
|
|
5777
5397
|
Object.defineProperty(exports, "AvatarImage", {
|
|
5778
5398
|
enumerable: true,
|
|
5779
|
-
get: function () { return
|
|
5399
|
+
get: function () { return chunkORKGCXG3_cjs.AvatarImage; }
|
|
5780
5400
|
});
|
|
5781
5401
|
Object.defineProperty(exports, "BASE_COLORS", {
|
|
5782
5402
|
enumerable: true,
|
|
5783
|
-
get: function () { return
|
|
5403
|
+
get: function () { return chunkORKGCXG3_cjs.BASE_COLORS; }
|
|
5784
5404
|
});
|
|
5785
5405
|
Object.defineProperty(exports, "Badge", {
|
|
5786
5406
|
enumerable: true,
|
|
5787
|
-
get: function () { return
|
|
5407
|
+
get: function () { return chunkORKGCXG3_cjs.Badge; }
|
|
5788
5408
|
});
|
|
5789
5409
|
Object.defineProperty(exports, "Button", {
|
|
5790
5410
|
enumerable: true,
|
|
5791
|
-
get: function () { return
|
|
5411
|
+
get: function () { return chunkORKGCXG3_cjs.Button; }
|
|
5792
5412
|
});
|
|
5793
5413
|
Object.defineProperty(exports, "Card", {
|
|
5794
5414
|
enumerable: true,
|
|
5795
|
-
get: function () { return
|
|
5415
|
+
get: function () { return chunkORKGCXG3_cjs.Card; }
|
|
5796
5416
|
});
|
|
5797
5417
|
Object.defineProperty(exports, "CardContent", {
|
|
5798
5418
|
enumerable: true,
|
|
5799
|
-
get: function () { return
|
|
5419
|
+
get: function () { return chunkORKGCXG3_cjs.CardContent; }
|
|
5800
5420
|
});
|
|
5801
5421
|
Object.defineProperty(exports, "CardDescription", {
|
|
5802
5422
|
enumerable: true,
|
|
5803
|
-
get: function () { return
|
|
5423
|
+
get: function () { return chunkORKGCXG3_cjs.CardDescription; }
|
|
5804
5424
|
});
|
|
5805
5425
|
Object.defineProperty(exports, "CardFooter", {
|
|
5806
5426
|
enumerable: true,
|
|
5807
|
-
get: function () { return
|
|
5427
|
+
get: function () { return chunkORKGCXG3_cjs.CardFooter; }
|
|
5808
5428
|
});
|
|
5809
5429
|
Object.defineProperty(exports, "CardHeader", {
|
|
5810
5430
|
enumerable: true,
|
|
5811
|
-
get: function () { return
|
|
5431
|
+
get: function () { return chunkORKGCXG3_cjs.CardHeader; }
|
|
5812
5432
|
});
|
|
5813
5433
|
Object.defineProperty(exports, "CardTitle", {
|
|
5814
5434
|
enumerable: true,
|
|
5815
|
-
get: function () { return
|
|
5435
|
+
get: function () { return chunkORKGCXG3_cjs.CardTitle; }
|
|
5816
5436
|
});
|
|
5817
5437
|
Object.defineProperty(exports, "Checkbox", {
|
|
5818
5438
|
enumerable: true,
|
|
5819
|
-
get: function () { return
|
|
5439
|
+
get: function () { return chunkORKGCXG3_cjs.Checkbox; }
|
|
5820
5440
|
});
|
|
5821
5441
|
Object.defineProperty(exports, "Collapsible", {
|
|
5822
5442
|
enumerable: true,
|
|
5823
|
-
get: function () { return
|
|
5443
|
+
get: function () { return chunkORKGCXG3_cjs.Collapsible; }
|
|
5824
5444
|
});
|
|
5825
5445
|
Object.defineProperty(exports, "CollapsibleContent", {
|
|
5826
5446
|
enumerable: true,
|
|
5827
|
-
get: function () { return
|
|
5447
|
+
get: function () { return chunkORKGCXG3_cjs.CollapsibleContent; }
|
|
5828
5448
|
});
|
|
5829
5449
|
Object.defineProperty(exports, "CollapsibleTrigger", {
|
|
5830
5450
|
enumerable: true,
|
|
5831
|
-
get: function () { return
|
|
5451
|
+
get: function () { return chunkORKGCXG3_cjs.CollapsibleTrigger; }
|
|
5832
5452
|
});
|
|
5833
5453
|
Object.defineProperty(exports, "Command", {
|
|
5834
5454
|
enumerable: true,
|
|
5835
|
-
get: function () { return
|
|
5455
|
+
get: function () { return chunkORKGCXG3_cjs.Command; }
|
|
5836
5456
|
});
|
|
5837
5457
|
Object.defineProperty(exports, "CommandDialog", {
|
|
5838
5458
|
enumerable: true,
|
|
5839
|
-
get: function () { return
|
|
5459
|
+
get: function () { return chunkORKGCXG3_cjs.CommandDialog; }
|
|
5840
5460
|
});
|
|
5841
5461
|
Object.defineProperty(exports, "CommandEmpty", {
|
|
5842
5462
|
enumerable: true,
|
|
5843
|
-
get: function () { return
|
|
5463
|
+
get: function () { return chunkORKGCXG3_cjs.CommandEmpty; }
|
|
5844
5464
|
});
|
|
5845
5465
|
Object.defineProperty(exports, "CommandGroup", {
|
|
5846
5466
|
enumerable: true,
|
|
5847
|
-
get: function () { return
|
|
5467
|
+
get: function () { return chunkORKGCXG3_cjs.CommandGroup; }
|
|
5848
5468
|
});
|
|
5849
5469
|
Object.defineProperty(exports, "CommandInput", {
|
|
5850
5470
|
enumerable: true,
|
|
5851
|
-
get: function () { return
|
|
5471
|
+
get: function () { return chunkORKGCXG3_cjs.CommandInput; }
|
|
5852
5472
|
});
|
|
5853
5473
|
Object.defineProperty(exports, "CommandItem", {
|
|
5854
5474
|
enumerable: true,
|
|
5855
|
-
get: function () { return
|
|
5475
|
+
get: function () { return chunkORKGCXG3_cjs.CommandItem; }
|
|
5856
5476
|
});
|
|
5857
5477
|
Object.defineProperty(exports, "CommandList", {
|
|
5858
5478
|
enumerable: true,
|
|
5859
|
-
get: function () { return
|
|
5479
|
+
get: function () { return chunkORKGCXG3_cjs.CommandList; }
|
|
5860
5480
|
});
|
|
5861
5481
|
Object.defineProperty(exports, "CommandSeparator", {
|
|
5862
5482
|
enumerable: true,
|
|
5863
|
-
get: function () { return
|
|
5483
|
+
get: function () { return chunkORKGCXG3_cjs.CommandSeparator; }
|
|
5864
5484
|
});
|
|
5865
5485
|
Object.defineProperty(exports, "CommandShortcut", {
|
|
5866
5486
|
enumerable: true,
|
|
5867
|
-
get: function () { return
|
|
5487
|
+
get: function () { return chunkORKGCXG3_cjs.CommandShortcut; }
|
|
5868
5488
|
});
|
|
5869
5489
|
Object.defineProperty(exports, "Dialog", {
|
|
5870
5490
|
enumerable: true,
|
|
5871
|
-
get: function () { return
|
|
5491
|
+
get: function () { return chunkORKGCXG3_cjs.Dialog; }
|
|
5872
5492
|
});
|
|
5873
5493
|
Object.defineProperty(exports, "DialogClose", {
|
|
5874
5494
|
enumerable: true,
|
|
5875
|
-
get: function () { return
|
|
5495
|
+
get: function () { return chunkORKGCXG3_cjs.DialogClose; }
|
|
5876
5496
|
});
|
|
5877
5497
|
Object.defineProperty(exports, "DialogContent", {
|
|
5878
5498
|
enumerable: true,
|
|
5879
|
-
get: function () { return
|
|
5499
|
+
get: function () { return chunkORKGCXG3_cjs.DialogContent; }
|
|
5880
5500
|
});
|
|
5881
5501
|
Object.defineProperty(exports, "DialogDescription", {
|
|
5882
5502
|
enumerable: true,
|
|
5883
|
-
get: function () { return
|
|
5503
|
+
get: function () { return chunkORKGCXG3_cjs.DialogDescription; }
|
|
5884
5504
|
});
|
|
5885
5505
|
Object.defineProperty(exports, "DialogFooter", {
|
|
5886
5506
|
enumerable: true,
|
|
5887
|
-
get: function () { return
|
|
5507
|
+
get: function () { return chunkORKGCXG3_cjs.DialogFooter; }
|
|
5888
5508
|
});
|
|
5889
5509
|
Object.defineProperty(exports, "DialogHeader", {
|
|
5890
5510
|
enumerable: true,
|
|
5891
|
-
get: function () { return
|
|
5511
|
+
get: function () { return chunkORKGCXG3_cjs.DialogHeader; }
|
|
5892
5512
|
});
|
|
5893
5513
|
Object.defineProperty(exports, "DialogOverlay", {
|
|
5894
5514
|
enumerable: true,
|
|
5895
|
-
get: function () { return
|
|
5515
|
+
get: function () { return chunkORKGCXG3_cjs.DialogOverlay; }
|
|
5896
5516
|
});
|
|
5897
5517
|
Object.defineProperty(exports, "DialogPortal", {
|
|
5898
5518
|
enumerable: true,
|
|
5899
|
-
get: function () { return
|
|
5519
|
+
get: function () { return chunkORKGCXG3_cjs.DialogPortal; }
|
|
5900
5520
|
});
|
|
5901
5521
|
Object.defineProperty(exports, "DialogTitle", {
|
|
5902
5522
|
enumerable: true,
|
|
5903
|
-
get: function () { return
|
|
5523
|
+
get: function () { return chunkORKGCXG3_cjs.DialogTitle; }
|
|
5904
5524
|
});
|
|
5905
5525
|
Object.defineProperty(exports, "DialogTrigger", {
|
|
5906
5526
|
enumerable: true,
|
|
5907
|
-
get: function () { return
|
|
5527
|
+
get: function () { return chunkORKGCXG3_cjs.DialogTrigger; }
|
|
5908
5528
|
});
|
|
5909
5529
|
Object.defineProperty(exports, "DictateProvider", {
|
|
5910
5530
|
enumerable: true,
|
|
5911
|
-
get: function () { return
|
|
5531
|
+
get: function () { return chunkORKGCXG3_cjs.DictateProvider; }
|
|
5912
5532
|
});
|
|
5913
5533
|
Object.defineProperty(exports, "DocumentCard", {
|
|
5914
5534
|
enumerable: true,
|
|
5915
|
-
get: function () { return
|
|
5535
|
+
get: function () { return chunkORKGCXG3_cjs.DocumentCard; }
|
|
5916
5536
|
});
|
|
5917
5537
|
Object.defineProperty(exports, "DocumentEntity", {
|
|
5918
5538
|
enumerable: true,
|
|
5919
|
-
get: function () { return
|
|
5539
|
+
get: function () { return chunkORKGCXG3_cjs.DocumentEntity; }
|
|
5920
5540
|
});
|
|
5921
5541
|
Object.defineProperty(exports, "ENTITY_MAPPINGS", {
|
|
5922
5542
|
enumerable: true,
|
|
5923
|
-
get: function () { return
|
|
5543
|
+
get: function () { return chunkORKGCXG3_cjs.ENTITY_MAPPINGS; }
|
|
5924
5544
|
});
|
|
5925
5545
|
Object.defineProperty(exports, "EmlIcon", {
|
|
5926
5546
|
enumerable: true,
|
|
5927
|
-
get: function () { return
|
|
5547
|
+
get: function () { return chunkORKGCXG3_cjs.EmlIcon; }
|
|
5928
5548
|
});
|
|
5929
5549
|
Object.defineProperty(exports, "EntityIcon", {
|
|
5930
5550
|
enumerable: true,
|
|
5931
|
-
get: function () { return
|
|
5551
|
+
get: function () { return chunkORKGCXG3_cjs.EntityIcon; }
|
|
5932
5552
|
});
|
|
5933
5553
|
Object.defineProperty(exports, "EntityPill", {
|
|
5934
5554
|
enumerable: true,
|
|
5935
|
-
get: function () { return
|
|
5555
|
+
get: function () { return chunkORKGCXG3_cjs.EntityPill; }
|
|
5936
5556
|
});
|
|
5937
5557
|
Object.defineProperty(exports, "FILE_TYPE_COLORS", {
|
|
5938
5558
|
enumerable: true,
|
|
5939
|
-
get: function () { return
|
|
5559
|
+
get: function () { return chunkORKGCXG3_cjs.FILE_TYPE_COLORS; }
|
|
5940
5560
|
});
|
|
5941
5561
|
Object.defineProperty(exports, "HoverCard", {
|
|
5942
5562
|
enumerable: true,
|
|
5943
|
-
get: function () { return
|
|
5563
|
+
get: function () { return chunkORKGCXG3_cjs.HoverCard; }
|
|
5944
5564
|
});
|
|
5945
5565
|
Object.defineProperty(exports, "HoverCardContent", {
|
|
5946
5566
|
enumerable: true,
|
|
5947
|
-
get: function () { return
|
|
5567
|
+
get: function () { return chunkORKGCXG3_cjs.HoverCardContent; }
|
|
5948
5568
|
});
|
|
5949
5569
|
Object.defineProperty(exports, "HoverCardTrigger", {
|
|
5950
5570
|
enumerable: true,
|
|
5951
|
-
get: function () { return
|
|
5571
|
+
get: function () { return chunkORKGCXG3_cjs.HoverCardTrigger; }
|
|
5952
5572
|
});
|
|
5953
5573
|
Object.defineProperty(exports, "IconToggle", {
|
|
5954
5574
|
enumerable: true,
|
|
5955
|
-
get: function () { return
|
|
5575
|
+
get: function () { return chunkORKGCXG3_cjs.IconToggle; }
|
|
5956
5576
|
});
|
|
5957
5577
|
Object.defineProperty(exports, "ImgIcon", {
|
|
5958
5578
|
enumerable: true,
|
|
5959
|
-
get: function () { return
|
|
5579
|
+
get: function () { return chunkORKGCXG3_cjs.ImgIcon; }
|
|
5960
5580
|
});
|
|
5961
5581
|
Object.defineProperty(exports, "InlineMicButton", {
|
|
5962
5582
|
enumerable: true,
|
|
5963
|
-
get: function () { return
|
|
5583
|
+
get: function () { return chunkORKGCXG3_cjs.InlineMicButton; }
|
|
5964
5584
|
});
|
|
5965
5585
|
Object.defineProperty(exports, "Input", {
|
|
5966
5586
|
enumerable: true,
|
|
5967
|
-
get: function () { return
|
|
5587
|
+
get: function () { return chunkORKGCXG3_cjs.Input; }
|
|
5968
5588
|
});
|
|
5969
5589
|
Object.defineProperty(exports, "Label", {
|
|
5970
5590
|
enumerable: true,
|
|
5971
|
-
get: function () { return
|
|
5591
|
+
get: function () { return chunkORKGCXG3_cjs.Label; }
|
|
5972
5592
|
});
|
|
5973
5593
|
Object.defineProperty(exports, "MarkMenu", {
|
|
5974
5594
|
enumerable: true,
|
|
5975
|
-
get: function () { return
|
|
5595
|
+
get: function () { return chunkORKGCXG3_cjs.MarkMenu; }
|
|
5976
5596
|
});
|
|
5977
5597
|
Object.defineProperty(exports, "MarkdownRenderer", {
|
|
5978
5598
|
enumerable: true,
|
|
5979
|
-
get: function () { return
|
|
5599
|
+
get: function () { return chunkORKGCXG3_cjs.MarkdownRenderer; }
|
|
5980
5600
|
});
|
|
5981
5601
|
Object.defineProperty(exports, "MarkdownStreamingContext", {
|
|
5982
5602
|
enumerable: true,
|
|
5983
|
-
get: function () { return
|
|
5603
|
+
get: function () { return chunkORKGCXG3_cjs.MarkdownStreamingContext; }
|
|
5984
5604
|
});
|
|
5985
5605
|
Object.defineProperty(exports, "MicRecordingOverlay", {
|
|
5986
5606
|
enumerable: true,
|
|
5987
|
-
get: function () { return
|
|
5607
|
+
get: function () { return chunkORKGCXG3_cjs.MicRecordingOverlay; }
|
|
5988
5608
|
});
|
|
5989
5609
|
Object.defineProperty(exports, "MicWaveformIndicator", {
|
|
5990
5610
|
enumerable: true,
|
|
5991
|
-
get: function () { return
|
|
5611
|
+
get: function () { return chunkORKGCXG3_cjs.MicWaveformIndicator; }
|
|
5992
5612
|
});
|
|
5993
5613
|
Object.defineProperty(exports, "NEUTRAL_GRAY", {
|
|
5994
5614
|
enumerable: true,
|
|
5995
|
-
get: function () { return
|
|
5615
|
+
get: function () { return chunkORKGCXG3_cjs.NEUTRAL_GRAY; }
|
|
5996
5616
|
});
|
|
5997
5617
|
Object.defineProperty(exports, "PLACEHOLDER_COLOR", {
|
|
5998
5618
|
enumerable: true,
|
|
5999
|
-
get: function () { return
|
|
5619
|
+
get: function () { return chunkORKGCXG3_cjs.PLACEHOLDER_COLOR; }
|
|
6000
5620
|
});
|
|
6001
5621
|
Object.defineProperty(exports, "PassageCard", {
|
|
6002
5622
|
enumerable: true,
|
|
6003
|
-
get: function () { return
|
|
5623
|
+
get: function () { return chunkORKGCXG3_cjs.PassageCard; }
|
|
6004
5624
|
});
|
|
6005
5625
|
Object.defineProperty(exports, "PdfIcon", {
|
|
6006
5626
|
enumerable: true,
|
|
6007
|
-
get: function () { return
|
|
5627
|
+
get: function () { return chunkORKGCXG3_cjs.PdfIcon; }
|
|
6008
5628
|
});
|
|
6009
5629
|
Object.defineProperty(exports, "Popover", {
|
|
6010
5630
|
enumerable: true,
|
|
6011
|
-
get: function () { return
|
|
5631
|
+
get: function () { return chunkORKGCXG3_cjs.Popover; }
|
|
6012
5632
|
});
|
|
6013
5633
|
Object.defineProperty(exports, "PopoverAnchor", {
|
|
6014
5634
|
enumerable: true,
|
|
6015
|
-
get: function () { return
|
|
5635
|
+
get: function () { return chunkORKGCXG3_cjs.PopoverAnchor; }
|
|
6016
5636
|
});
|
|
6017
5637
|
Object.defineProperty(exports, "PopoverContent", {
|
|
6018
5638
|
enumerable: true,
|
|
6019
|
-
get: function () { return
|
|
5639
|
+
get: function () { return chunkORKGCXG3_cjs.PopoverContent; }
|
|
6020
5640
|
});
|
|
6021
5641
|
Object.defineProperty(exports, "PopoverTrigger", {
|
|
6022
5642
|
enumerable: true,
|
|
6023
|
-
get: function () { return
|
|
5643
|
+
get: function () { return chunkORKGCXG3_cjs.PopoverTrigger; }
|
|
6024
5644
|
});
|
|
6025
5645
|
Object.defineProperty(exports, "PresenceLabel", {
|
|
6026
5646
|
enumerable: true,
|
|
6027
|
-
get: function () { return
|
|
5647
|
+
get: function () { return chunkORKGCXG3_cjs.PresenceLabel; }
|
|
6028
5648
|
});
|
|
6029
5649
|
Object.defineProperty(exports, "Progress", {
|
|
6030
5650
|
enumerable: true,
|
|
6031
|
-
get: function () { return
|
|
5651
|
+
get: function () { return chunkORKGCXG3_cjs.Progress; }
|
|
6032
5652
|
});
|
|
6033
5653
|
Object.defineProperty(exports, "ProjectEntity", {
|
|
6034
5654
|
enumerable: true,
|
|
6035
|
-
get: function () { return
|
|
5655
|
+
get: function () { return chunkORKGCXG3_cjs.ProjectEntity; }
|
|
6036
5656
|
});
|
|
6037
5657
|
Object.defineProperty(exports, "RadioGroup", {
|
|
6038
5658
|
enumerable: true,
|
|
6039
|
-
get: function () { return
|
|
5659
|
+
get: function () { return chunkORKGCXG3_cjs.RadioGroup; }
|
|
6040
5660
|
});
|
|
6041
5661
|
Object.defineProperty(exports, "RadioGroupItem", {
|
|
6042
5662
|
enumerable: true,
|
|
6043
|
-
get: function () { return
|
|
5663
|
+
get: function () { return chunkORKGCXG3_cjs.RadioGroupItem; }
|
|
6044
5664
|
});
|
|
6045
5665
|
Object.defineProperty(exports, "RagDot", {
|
|
6046
5666
|
enumerable: true,
|
|
6047
|
-
get: function () { return
|
|
5667
|
+
get: function () { return chunkORKGCXG3_cjs.RagDot; }
|
|
6048
5668
|
});
|
|
6049
5669
|
Object.defineProperty(exports, "RelevanceDot", {
|
|
6050
5670
|
enumerable: true,
|
|
6051
|
-
get: function () { return
|
|
5671
|
+
get: function () { return chunkORKGCXG3_cjs.RelevanceDot; }
|
|
6052
5672
|
});
|
|
6053
5673
|
Object.defineProperty(exports, "Select", {
|
|
6054
5674
|
enumerable: true,
|
|
6055
|
-
get: function () { return
|
|
5675
|
+
get: function () { return chunkORKGCXG3_cjs.Select; }
|
|
6056
5676
|
});
|
|
6057
5677
|
Object.defineProperty(exports, "SelectContent", {
|
|
6058
5678
|
enumerable: true,
|
|
6059
|
-
get: function () { return
|
|
5679
|
+
get: function () { return chunkORKGCXG3_cjs.SelectContent; }
|
|
6060
5680
|
});
|
|
6061
5681
|
Object.defineProperty(exports, "SelectGroup", {
|
|
6062
5682
|
enumerable: true,
|
|
6063
|
-
get: function () { return
|
|
5683
|
+
get: function () { return chunkORKGCXG3_cjs.SelectGroup; }
|
|
6064
5684
|
});
|
|
6065
5685
|
Object.defineProperty(exports, "SelectItem", {
|
|
6066
5686
|
enumerable: true,
|
|
6067
|
-
get: function () { return
|
|
5687
|
+
get: function () { return chunkORKGCXG3_cjs.SelectItem; }
|
|
6068
5688
|
});
|
|
6069
5689
|
Object.defineProperty(exports, "SelectLabel", {
|
|
6070
5690
|
enumerable: true,
|
|
6071
|
-
get: function () { return
|
|
5691
|
+
get: function () { return chunkORKGCXG3_cjs.SelectLabel; }
|
|
6072
5692
|
});
|
|
6073
5693
|
Object.defineProperty(exports, "SelectScrollDownButton", {
|
|
6074
5694
|
enumerable: true,
|
|
6075
|
-
get: function () { return
|
|
5695
|
+
get: function () { return chunkORKGCXG3_cjs.SelectScrollDownButton; }
|
|
6076
5696
|
});
|
|
6077
5697
|
Object.defineProperty(exports, "SelectScrollUpButton", {
|
|
6078
5698
|
enumerable: true,
|
|
6079
|
-
get: function () { return
|
|
5699
|
+
get: function () { return chunkORKGCXG3_cjs.SelectScrollUpButton; }
|
|
6080
5700
|
});
|
|
6081
5701
|
Object.defineProperty(exports, "SelectSeparator", {
|
|
6082
5702
|
enumerable: true,
|
|
6083
|
-
get: function () { return
|
|
5703
|
+
get: function () { return chunkORKGCXG3_cjs.SelectSeparator; }
|
|
6084
5704
|
});
|
|
6085
5705
|
Object.defineProperty(exports, "SelectTrigger", {
|
|
6086
5706
|
enumerable: true,
|
|
6087
|
-
get: function () { return
|
|
5707
|
+
get: function () { return chunkORKGCXG3_cjs.SelectTrigger; }
|
|
6088
5708
|
});
|
|
6089
5709
|
Object.defineProperty(exports, "SelectValue", {
|
|
6090
5710
|
enumerable: true,
|
|
6091
|
-
get: function () { return
|
|
5711
|
+
get: function () { return chunkORKGCXG3_cjs.SelectValue; }
|
|
6092
5712
|
});
|
|
6093
5713
|
Object.defineProperty(exports, "Separator", {
|
|
6094
5714
|
enumerable: true,
|
|
6095
|
-
get: function () { return
|
|
5715
|
+
get: function () { return chunkORKGCXG3_cjs.Separator; }
|
|
6096
5716
|
});
|
|
6097
5717
|
Object.defineProperty(exports, "Slider", {
|
|
6098
5718
|
enumerable: true,
|
|
6099
|
-
get: function () { return
|
|
5719
|
+
get: function () { return chunkORKGCXG3_cjs.Slider; }
|
|
6100
5720
|
});
|
|
6101
5721
|
Object.defineProperty(exports, "StatusPill", {
|
|
6102
5722
|
enumerable: true,
|
|
6103
|
-
get: function () { return
|
|
5723
|
+
get: function () { return chunkORKGCXG3_cjs.StatusPill; }
|
|
6104
5724
|
});
|
|
6105
5725
|
Object.defineProperty(exports, "Switch", {
|
|
6106
5726
|
enumerable: true,
|
|
6107
|
-
get: function () { return
|
|
5727
|
+
get: function () { return chunkORKGCXG3_cjs.Switch; }
|
|
6108
5728
|
});
|
|
6109
5729
|
Object.defineProperty(exports, "TAG_TYPE_ICONS", {
|
|
6110
5730
|
enumerable: true,
|
|
6111
|
-
get: function () { return
|
|
5731
|
+
get: function () { return chunkORKGCXG3_cjs.TAG_TYPE_ICONS; }
|
|
6112
5732
|
});
|
|
6113
5733
|
Object.defineProperty(exports, "TAG_TYPE_LABELS", {
|
|
6114
5734
|
enumerable: true,
|
|
6115
|
-
get: function () { return
|
|
5735
|
+
get: function () { return chunkORKGCXG3_cjs.TAG_TYPE_LABELS; }
|
|
6116
5736
|
});
|
|
6117
5737
|
Object.defineProperty(exports, "Table", {
|
|
6118
5738
|
enumerable: true,
|
|
6119
|
-
get: function () { return
|
|
5739
|
+
get: function () { return chunkORKGCXG3_cjs.Table; }
|
|
6120
5740
|
});
|
|
6121
5741
|
Object.defineProperty(exports, "TableBody", {
|
|
6122
5742
|
enumerable: true,
|
|
6123
|
-
get: function () { return
|
|
5743
|
+
get: function () { return chunkORKGCXG3_cjs.TableBody; }
|
|
6124
5744
|
});
|
|
6125
5745
|
Object.defineProperty(exports, "TableCaption", {
|
|
6126
5746
|
enumerable: true,
|
|
6127
|
-
get: function () { return
|
|
5747
|
+
get: function () { return chunkORKGCXG3_cjs.TableCaption; }
|
|
6128
5748
|
});
|
|
6129
5749
|
Object.defineProperty(exports, "TableCell", {
|
|
6130
5750
|
enumerable: true,
|
|
6131
|
-
get: function () { return
|
|
5751
|
+
get: function () { return chunkORKGCXG3_cjs.TableCell; }
|
|
6132
5752
|
});
|
|
6133
5753
|
Object.defineProperty(exports, "TableFooter", {
|
|
6134
5754
|
enumerable: true,
|
|
6135
|
-
get: function () { return
|
|
5755
|
+
get: function () { return chunkORKGCXG3_cjs.TableFooter; }
|
|
6136
5756
|
});
|
|
6137
5757
|
Object.defineProperty(exports, "TableHead", {
|
|
6138
5758
|
enumerable: true,
|
|
6139
|
-
get: function () { return
|
|
5759
|
+
get: function () { return chunkORKGCXG3_cjs.TableHead; }
|
|
6140
5760
|
});
|
|
6141
5761
|
Object.defineProperty(exports, "TableHeader", {
|
|
6142
5762
|
enumerable: true,
|
|
6143
|
-
get: function () { return
|
|
5763
|
+
get: function () { return chunkORKGCXG3_cjs.TableHeader; }
|
|
6144
5764
|
});
|
|
6145
5765
|
Object.defineProperty(exports, "TableRow", {
|
|
6146
5766
|
enumerable: true,
|
|
6147
|
-
get: function () { return
|
|
5767
|
+
get: function () { return chunkORKGCXG3_cjs.TableRow; }
|
|
6148
5768
|
});
|
|
6149
5769
|
Object.defineProperty(exports, "Tabs", {
|
|
6150
5770
|
enumerable: true,
|
|
6151
|
-
get: function () { return
|
|
5771
|
+
get: function () { return chunkORKGCXG3_cjs.Tabs; }
|
|
6152
5772
|
});
|
|
6153
5773
|
Object.defineProperty(exports, "TabsContent", {
|
|
6154
5774
|
enumerable: true,
|
|
6155
|
-
get: function () { return
|
|
5775
|
+
get: function () { return chunkORKGCXG3_cjs.TabsContent; }
|
|
6156
5776
|
});
|
|
6157
5777
|
Object.defineProperty(exports, "TabsList", {
|
|
6158
5778
|
enumerable: true,
|
|
6159
|
-
get: function () { return
|
|
5779
|
+
get: function () { return chunkORKGCXG3_cjs.TabsList; }
|
|
6160
5780
|
});
|
|
6161
5781
|
Object.defineProperty(exports, "TabsTrigger", {
|
|
6162
5782
|
enumerable: true,
|
|
6163
|
-
get: function () { return
|
|
5783
|
+
get: function () { return chunkORKGCXG3_cjs.TabsTrigger; }
|
|
6164
5784
|
});
|
|
6165
5785
|
Object.defineProperty(exports, "TagEntity", {
|
|
6166
5786
|
enumerable: true,
|
|
6167
|
-
get: function () { return
|
|
5787
|
+
get: function () { return chunkORKGCXG3_cjs.TagEntity; }
|
|
6168
5788
|
});
|
|
6169
5789
|
Object.defineProperty(exports, "Textarea", {
|
|
6170
5790
|
enumerable: true,
|
|
6171
|
-
get: function () { return
|
|
5791
|
+
get: function () { return chunkORKGCXG3_cjs.Textarea; }
|
|
6172
5792
|
});
|
|
6173
5793
|
Object.defineProperty(exports, "Toggle", {
|
|
6174
5794
|
enumerable: true,
|
|
6175
|
-
get: function () { return
|
|
5795
|
+
get: function () { return chunkORKGCXG3_cjs.Toggle; }
|
|
6176
5796
|
});
|
|
6177
5797
|
Object.defineProperty(exports, "ToggleGroup", {
|
|
6178
5798
|
enumerable: true,
|
|
6179
|
-
get: function () { return
|
|
5799
|
+
get: function () { return chunkORKGCXG3_cjs.ToggleGroup; }
|
|
6180
5800
|
});
|
|
6181
5801
|
Object.defineProperty(exports, "ToggleGroupItem", {
|
|
6182
5802
|
enumerable: true,
|
|
6183
|
-
get: function () { return
|
|
5803
|
+
get: function () { return chunkORKGCXG3_cjs.ToggleGroupItem; }
|
|
6184
5804
|
});
|
|
6185
5805
|
Object.defineProperty(exports, "Tooltip", {
|
|
6186
5806
|
enumerable: true,
|
|
6187
|
-
get: function () { return
|
|
5807
|
+
get: function () { return chunkORKGCXG3_cjs.Tooltip; }
|
|
6188
5808
|
});
|
|
6189
5809
|
Object.defineProperty(exports, "TooltipContent", {
|
|
6190
5810
|
enumerable: true,
|
|
6191
|
-
get: function () { return
|
|
5811
|
+
get: function () { return chunkORKGCXG3_cjs.TooltipContent; }
|
|
6192
5812
|
});
|
|
6193
5813
|
Object.defineProperty(exports, "TooltipProvider", {
|
|
6194
5814
|
enumerable: true,
|
|
6195
|
-
get: function () { return
|
|
5815
|
+
get: function () { return chunkORKGCXG3_cjs.TooltipProvider; }
|
|
6196
5816
|
});
|
|
6197
5817
|
Object.defineProperty(exports, "TooltipTrigger", {
|
|
6198
5818
|
enumerable: true,
|
|
6199
|
-
get: function () { return
|
|
5819
|
+
get: function () { return chunkORKGCXG3_cjs.TooltipTrigger; }
|
|
6200
5820
|
});
|
|
6201
5821
|
Object.defineProperty(exports, "UserEntity", {
|
|
6202
5822
|
enumerable: true,
|
|
6203
|
-
get: function () { return
|
|
5823
|
+
get: function () { return chunkORKGCXG3_cjs.UserEntity; }
|
|
6204
5824
|
});
|
|
6205
5825
|
Object.defineProperty(exports, "UserMenu", {
|
|
6206
5826
|
enumerable: true,
|
|
6207
|
-
get: function () { return
|
|
5827
|
+
get: function () { return chunkORKGCXG3_cjs.UserMenu; }
|
|
6208
5828
|
});
|
|
6209
5829
|
Object.defineProperty(exports, "VISIBILITY_ICONS", {
|
|
6210
5830
|
enumerable: true,
|
|
6211
|
-
get: function () { return
|
|
5831
|
+
get: function () { return chunkORKGCXG3_cjs.VISIBILITY_ICONS; }
|
|
6212
5832
|
});
|
|
6213
5833
|
Object.defineProperty(exports, "VidIcon", {
|
|
6214
5834
|
enumerable: true,
|
|
6215
|
-
get: function () { return
|
|
5835
|
+
get: function () { return chunkORKGCXG3_cjs.VidIcon; }
|
|
6216
5836
|
});
|
|
6217
5837
|
Object.defineProperty(exports, "VisibilityIcon", {
|
|
6218
5838
|
enumerable: true,
|
|
6219
|
-
get: function () { return
|
|
5839
|
+
get: function () { return chunkORKGCXG3_cjs.VisibilityIcon; }
|
|
6220
5840
|
});
|
|
6221
5841
|
Object.defineProperty(exports, "badgeVariants", {
|
|
6222
5842
|
enumerable: true,
|
|
6223
|
-
get: function () { return
|
|
5843
|
+
get: function () { return chunkORKGCXG3_cjs.badgeVariants; }
|
|
6224
5844
|
});
|
|
6225
5845
|
Object.defineProperty(exports, "buttonVariants", {
|
|
6226
5846
|
enumerable: true,
|
|
6227
|
-
get: function () { return
|
|
5847
|
+
get: function () { return chunkORKGCXG3_cjs.buttonVariants; }
|
|
6228
5848
|
});
|
|
6229
5849
|
Object.defineProperty(exports, "cardVariants", {
|
|
6230
5850
|
enumerable: true,
|
|
6231
|
-
get: function () { return
|
|
5851
|
+
get: function () { return chunkORKGCXG3_cjs.cardVariants; }
|
|
6232
5852
|
});
|
|
6233
5853
|
Object.defineProperty(exports, "configureEntityRegistry", {
|
|
6234
5854
|
enumerable: true,
|
|
6235
|
-
get: function () { return
|
|
5855
|
+
get: function () { return chunkORKGCXG3_cjs.configureEntityRegistry; }
|
|
6236
5856
|
});
|
|
6237
5857
|
Object.defineProperty(exports, "configureRagLabels", {
|
|
6238
5858
|
enumerable: true,
|
|
6239
|
-
get: function () { return
|
|
5859
|
+
get: function () { return chunkORKGCXG3_cjs.configureRagLabels; }
|
|
6240
5860
|
});
|
|
6241
5861
|
Object.defineProperty(exports, "configureStatusRegistry", {
|
|
6242
5862
|
enumerable: true,
|
|
6243
|
-
get: function () { return
|
|
5863
|
+
get: function () { return chunkORKGCXG3_cjs.configureStatusRegistry; }
|
|
6244
5864
|
});
|
|
6245
5865
|
Object.defineProperty(exports, "formatElapsed", {
|
|
6246
5866
|
enumerable: true,
|
|
6247
|
-
get: function () { return
|
|
5867
|
+
get: function () { return chunkORKGCXG3_cjs.formatElapsed; }
|
|
6248
5868
|
});
|
|
6249
5869
|
Object.defineProperty(exports, "getDocIcon", {
|
|
6250
5870
|
enumerable: true,
|
|
6251
|
-
get: function () { return
|
|
5871
|
+
get: function () { return chunkORKGCXG3_cjs.getDocIcon; }
|
|
6252
5872
|
});
|
|
6253
5873
|
Object.defineProperty(exports, "getEntityColor", {
|
|
6254
5874
|
enumerable: true,
|
|
6255
|
-
get: function () { return
|
|
5875
|
+
get: function () { return chunkORKGCXG3_cjs.getEntityColor; }
|
|
6256
5876
|
});
|
|
6257
5877
|
Object.defineProperty(exports, "getEntityColorStyles", {
|
|
6258
5878
|
enumerable: true,
|
|
6259
|
-
get: function () { return
|
|
5879
|
+
get: function () { return chunkORKGCXG3_cjs.getEntityColorStyles; }
|
|
6260
5880
|
});
|
|
6261
5881
|
Object.defineProperty(exports, "getEntityIcon", {
|
|
6262
5882
|
enumerable: true,
|
|
6263
|
-
get: function () { return
|
|
5883
|
+
get: function () { return chunkORKGCXG3_cjs.getEntityIcon; }
|
|
6264
5884
|
});
|
|
6265
5885
|
Object.defineProperty(exports, "getEntityLabel", {
|
|
6266
5886
|
enumerable: true,
|
|
6267
|
-
get: function () { return
|
|
5887
|
+
get: function () { return chunkORKGCXG3_cjs.getEntityLabel; }
|
|
6268
5888
|
});
|
|
6269
5889
|
Object.defineProperty(exports, "getStatusVariant", {
|
|
6270
5890
|
enumerable: true,
|
|
6271
|
-
get: function () { return
|
|
5891
|
+
get: function () { return chunkORKGCXG3_cjs.getStatusVariant; }
|
|
6272
5892
|
});
|
|
6273
5893
|
Object.defineProperty(exports, "getTagTypeIcon", {
|
|
6274
5894
|
enumerable: true,
|
|
6275
|
-
get: function () { return
|
|
5895
|
+
get: function () { return chunkORKGCXG3_cjs.getTagTypeIcon; }
|
|
6276
5896
|
});
|
|
6277
5897
|
Object.defineProperty(exports, "getTagTypeLabel", {
|
|
6278
5898
|
enumerable: true,
|
|
6279
|
-
get: function () { return
|
|
5899
|
+
get: function () { return chunkORKGCXG3_cjs.getTagTypeLabel; }
|
|
6280
5900
|
});
|
|
6281
5901
|
Object.defineProperty(exports, "getWorkspaceColor", {
|
|
6282
5902
|
enumerable: true,
|
|
6283
|
-
get: function () { return
|
|
5903
|
+
get: function () { return chunkORKGCXG3_cjs.getWorkspaceColor; }
|
|
6284
5904
|
});
|
|
6285
5905
|
Object.defineProperty(exports, "markdownBaseComponents", {
|
|
6286
5906
|
enumerable: true,
|
|
6287
|
-
get: function () { return
|
|
5907
|
+
get: function () { return chunkORKGCXG3_cjs.markdownBaseComponents; }
|
|
5908
|
+
});
|
|
5909
|
+
Object.defineProperty(exports, "normalizeCitationMarkup", {
|
|
5910
|
+
enumerable: true,
|
|
5911
|
+
get: function () { return chunkORKGCXG3_cjs.normalizeCitationMarkup; }
|
|
6288
5912
|
});
|
|
6289
5913
|
Object.defineProperty(exports, "splitMarkdownBlocks", {
|
|
6290
5914
|
enumerable: true,
|
|
6291
|
-
get: function () { return
|
|
5915
|
+
get: function () { return chunkORKGCXG3_cjs.splitMarkdownBlocks; }
|
|
6292
5916
|
});
|
|
6293
5917
|
Object.defineProperty(exports, "toggleVariants", {
|
|
6294
5918
|
enumerable: true,
|
|
6295
|
-
get: function () { return
|
|
5919
|
+
get: function () { return chunkORKGCXG3_cjs.toggleVariants; }
|
|
6296
5920
|
});
|
|
6297
5921
|
Object.defineProperty(exports, "useAudioRecorder", {
|
|
6298
5922
|
enumerable: true,
|
|
6299
|
-
get: function () { return
|
|
5923
|
+
get: function () { return chunkORKGCXG3_cjs.useAudioRecorder; }
|
|
6300
5924
|
});
|
|
6301
5925
|
Object.defineProperty(exports, "DropdownMenu", {
|
|
6302
5926
|
enumerable: true,
|
|
@@ -6395,8 +6019,6 @@ exports.AiActionCard = AiActionCard;
|
|
|
6395
6019
|
exports.AiAnswer = AiAnswer;
|
|
6396
6020
|
exports.AppleIcon = AppleIcon;
|
|
6397
6021
|
exports.ArbiBotIcon = ArbiBotIcon;
|
|
6398
|
-
exports.ArbiChat = ArbiChat;
|
|
6399
|
-
exports.ArbiChatPanel = ArbiChatPanel;
|
|
6400
6022
|
exports.ArbiIcon = ArbiIcon;
|
|
6401
6023
|
exports.ArbiWebSocketProvider = ArbiWebSocketProvider;
|
|
6402
6024
|
exports.ArtifactCanvas = ArtifactCanvas;
|
|
@@ -6407,6 +6029,8 @@ exports.CommandPalette = CommandPalette;
|
|
|
6407
6029
|
exports.CommandPaletteProvider = CommandPaletteProvider;
|
|
6408
6030
|
exports.ConversationList = ConversationList;
|
|
6409
6031
|
exports.DEFAULT_ASPECT_OPTIONS = DEFAULT_ASPECT_OPTIONS;
|
|
6032
|
+
exports.DEFAULT_START_BY_EMAIL_LABELS = DEFAULT_START_BY_EMAIL_LABELS;
|
|
6033
|
+
exports.DEFAULT_USD_PER_CREDIT = DEFAULT_USD_PER_CREDIT;
|
|
6410
6034
|
exports.DateSeparator = DateSeparator;
|
|
6411
6035
|
exports.DirectMessages = DirectMessages;
|
|
6412
6036
|
exports.DmAvatar = DmAvatar;
|
|
@@ -6429,13 +6053,14 @@ exports.ImageCropModal = ImageCropModal;
|
|
|
6429
6053
|
exports.ImageCropper = ImageCropper;
|
|
6430
6054
|
exports.LinkedInIcon = LinkedInIcon;
|
|
6431
6055
|
exports.MessageArtifactCard = MessageArtifactCard;
|
|
6432
|
-
exports.MessageBubble =
|
|
6056
|
+
exports.MessageBubble = MessageBubble;
|
|
6433
6057
|
exports.MessageThread = MessageThread;
|
|
6434
6058
|
exports.OpenAIIcon = OpenAIIcon;
|
|
6435
6059
|
exports.PhotoCapture = PhotoCapture;
|
|
6436
6060
|
exports.ProviderIcon = ProviderIcon;
|
|
6437
6061
|
exports.RUN_WINDOW_MS = RUN_WINDOW_MS;
|
|
6438
6062
|
exports.SemanticSearch = SemanticSearch;
|
|
6063
|
+
exports.StartByEmail = StartByEmail;
|
|
6439
6064
|
exports.TxtIcon = TxtIcon;
|
|
6440
6065
|
exports.TypingIndicator = TypingIndicator;
|
|
6441
6066
|
exports.VideoCapture = VideoCapture;
|
|
@@ -6444,23 +6069,37 @@ exports.XlsIcon = XlsIcon;
|
|
|
6444
6069
|
exports.annotateThread = annotateThread;
|
|
6445
6070
|
exports.arbiQueryKeys = arbiQueryKeys;
|
|
6446
6071
|
exports.captureFrameAsBlob = captureFrameAsBlob;
|
|
6072
|
+
exports.creditsToUsd = creditsToUsd;
|
|
6447
6073
|
exports.cropImage = cropImage;
|
|
6448
6074
|
exports.dayKey = dayKey;
|
|
6449
6075
|
exports.describeActivity = describeActivity;
|
|
6076
|
+
exports.formatCredits = formatCredits;
|
|
6450
6077
|
exports.getNotificationTypeMeta = getNotificationTypeMeta;
|
|
6451
6078
|
exports.getWorkspaceActionText = getWorkspaceActionText;
|
|
6079
|
+
exports.getWorkspaceKind = getWorkspaceKind;
|
|
6452
6080
|
exports.getWorkspaceSentPhrase = getWorkspaceSentPhrase;
|
|
6453
6081
|
exports.hasVideoTrack = hasVideoTrack;
|
|
6082
|
+
exports.isUsageMetered = isUsageMetered;
|
|
6454
6083
|
exports.isWorkspaceNotificationType = isWorkspaceNotificationType;
|
|
6455
6084
|
exports.parseActivityContent = parseActivityContent;
|
|
6085
|
+
exports.pickRecentWorkspaces = pickRecentWorkspaces;
|
|
6456
6086
|
exports.redlineStats = redlineStats;
|
|
6087
|
+
exports.resolveActiveWorkspace = resolveActiveWorkspace;
|
|
6457
6088
|
exports.textToArtifact = textToArtifact;
|
|
6089
|
+
exports.titleFromQuestion = titleFromQuestion;
|
|
6458
6090
|
exports.toRedlineMarkdown = toRedlineMarkdown;
|
|
6091
|
+
exports.toShellWorkspace = toShellWorkspace;
|
|
6459
6092
|
exports.useActivity = useActivity;
|
|
6093
|
+
exports.useAddContacts = useAddContacts;
|
|
6094
|
+
exports.useAgentConfig = useAgentConfig;
|
|
6095
|
+
exports.useAgentModels = useAgentModels;
|
|
6096
|
+
exports.useAgentWorkspaces = useAgentWorkspaces;
|
|
6460
6097
|
exports.useAgents = useAgents;
|
|
6461
6098
|
exports.useAiTask = useAiTask;
|
|
6099
|
+
exports.useArbiChat = useArbiChat;
|
|
6462
6100
|
exports.useArbiConnected = useArbiConnected;
|
|
6463
6101
|
exports.useArbiDocumentSync = useArbiDocumentSync;
|
|
6102
|
+
exports.useArbiShellWorkspaces = useArbiShellWorkspaces;
|
|
6464
6103
|
exports.useArbiUiStore = useArbiUiStore;
|
|
6465
6104
|
exports.useArbiWebSocket = useArbiWebSocket;
|
|
6466
6105
|
exports.useArbiWsContext = useArbiWsContext;
|
|
@@ -6473,22 +6112,36 @@ exports.useAssistantQuery = useAssistantQuery;
|
|
|
6473
6112
|
exports.useCameraStream = useCameraStream;
|
|
6474
6113
|
exports.useCommandPalette = useCommandPalette;
|
|
6475
6114
|
exports.useConfigs = useConfigs;
|
|
6115
|
+
exports.useContacts = useContacts;
|
|
6476
6116
|
exports.useConversations = useConversations;
|
|
6117
|
+
exports.useCreateAgent = useCreateAgent;
|
|
6118
|
+
exports.useCreateTask = useCreateTask;
|
|
6477
6119
|
exports.useDeleteAgents = useDeleteAgents;
|
|
6120
|
+
exports.useDeleteTask = useDeleteTask;
|
|
6478
6121
|
exports.useDirectMessages = useDirectMessages;
|
|
6479
6122
|
exports.useDocuments = useDocuments;
|
|
6480
6123
|
exports.useFacts = useFacts;
|
|
6124
|
+
exports.useGrantAgentAccess = useGrantAgentAccess;
|
|
6481
6125
|
exports.useHealth = useHealth;
|
|
6482
6126
|
exports.useParsedDocument = useParsedDocument;
|
|
6127
|
+
exports.usePendingContacts = usePendingContacts;
|
|
6483
6128
|
exports.useProjectInvoices = useProjectInvoices;
|
|
6484
6129
|
exports.useProjectUsage = useProjectUsage;
|
|
6485
6130
|
exports.useProjects = useProjects;
|
|
6486
6131
|
exports.useProjectsUsage = useProjectsUsage;
|
|
6132
|
+
exports.useRemoveContacts = useRemoveContacts;
|
|
6133
|
+
exports.useRevokeAgentAccess = useRevokeAgentAccess;
|
|
6134
|
+
exports.useRunTask = useRunTask;
|
|
6135
|
+
exports.useSaveAgentConfig = useSaveAgentConfig;
|
|
6487
6136
|
exports.useSemanticSearch = useSemanticSearch;
|
|
6488
6137
|
exports.useSessions = useSessions;
|
|
6138
|
+
exports.useShellWorkspaces = useShellWorkspaces;
|
|
6139
|
+
exports.useSkills = useSkills;
|
|
6489
6140
|
exports.useTags = useTags;
|
|
6141
|
+
exports.useTaskRuns = useTaskRuns;
|
|
6490
6142
|
exports.useTasks = useTasks;
|
|
6491
6143
|
exports.useThumbnails = useThumbnails;
|
|
6144
|
+
exports.useUpdateTask = useUpdateTask;
|
|
6492
6145
|
exports.useUserUsageToday = useUserUsageToday;
|
|
6493
6146
|
exports.useVideoRecorder = useVideoRecorder;
|
|
6494
6147
|
exports.useWorkspaceDocs = useWorkspaceDocs;
|