@lumerahq/ui 0.21.5 → 0.24.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RecordSheet-1aS1sssQ.js → RecordSheet-9fHBPi_o.js} +415 -76
- package/dist/{audit-log-DW-ts7mh.js → audit-log-QIEvuWf9.js} +1 -1
- package/dist/{automations-4aVNe5uF.js → automations-D4mDAarR.js} +6 -6
- package/dist/components/agent-chat/AgentChat.d.ts.map +1 -1
- package/dist/components/agent-chat/AgentChatComposer.d.ts.map +1 -1
- package/dist/components/agent-chat/lumera-agent-transport.d.ts.map +1 -1
- package/dist/components/agent-chat/types.d.ts +7 -1
- package/dist/components/agent-chat/types.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/dictation-worklet.js +67 -0
- package/dist/{highlighted-body-JLMTFACH-D1NSviFj.js → highlighted-body-JLMTFACH-CFO3t4N6.js} +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/use-agent-chat.d.ts +1 -1
- package/dist/hooks/use-agent-chat.d.ts.map +1 -1
- package/dist/hooks/use-chat-draft.d.ts +1 -1
- package/dist/hooks/use-chat-draft.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/lib/dictation-recording.d.ts +2 -0
- package/dist/lib/dictation-recording.d.ts.map +1 -0
- package/dist/lib/dictation-transcript.d.ts +5 -0
- package/dist/lib/dictation-transcript.d.ts.map +1 -0
- package/dist/lib/dictation.d.ts +24 -0
- package/dist/lib/dictation.d.ts.map +1 -0
- package/dist/lib/draft-hooks.d.ts +4 -3
- package/dist/lib/draft-hooks.d.ts.map +1 -1
- package/dist/lib/drafts.d.ts +6 -3
- package/dist/lib/drafts.d.ts.map +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/mermaid-WFAXDIZX-4tI67A1Y.js +4 -0
- package/dist/ui.css +92 -1
- package/dist/{use-automation-run-udyHkYbG.js → use-automation-run-lhk85ke0.js} +51 -16
- package/dist/{use-sql-table-CgGHt8b8.js → use-sql-table-JkDEPAi_.js} +3 -3
- package/package.json +1 -1
- package/dist/mermaid-WFAXDIZX-f94Zh_PW.js +0 -4
|
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useMemo, useRef, useEffect, useLayoutEffect, isValidElement, cloneElement, useSyncExternalStore, useState, useCallback, Suspense, lazy } from "react";
|
|
4
4
|
import { p as clsx, c as cn$1, a as formatCellValue$2 } from "./formatters-Ejvss8qz.js";
|
|
5
|
-
import { U as pbSql, o as getDownloadUrl, L as parentApiRequest, M as parentApiStream, B as BridgeError, k as getAppProjectExternalId, a7 as resolveProjectResourceId, a as automationStatuses, n as getAutomationRunFileDownloadUrl, F as listAutomationRunFiles } from "./automations-
|
|
6
|
-
import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-
|
|
5
|
+
import { U as pbSql, o as getDownloadUrl, L as parentApiRequest, M as parentApiStream, B as BridgeError, k as getAppProjectExternalId, a7 as resolveProjectResourceId, a as automationStatuses, n as getAutomationRunFileDownloadUrl, F as listAutomationRunFiles } from "./automations-D4mDAarR.js";
|
|
6
|
+
import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-lhk85ke0.js";
|
|
7
7
|
import * as ReactDOM from "react-dom";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
|
|
@@ -85,24 +85,24 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
85
85
|
Component.displayName = toPascalCase(iconName);
|
|
86
86
|
return Component;
|
|
87
87
|
};
|
|
88
|
-
const __iconNode$
|
|
88
|
+
const __iconNode$F = [
|
|
89
89
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
90
90
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
91
91
|
];
|
|
92
|
-
const ArrowDown = createLucideIcon("arrow-down", __iconNode$
|
|
93
|
-
const __iconNode$
|
|
92
|
+
const ArrowDown = createLucideIcon("arrow-down", __iconNode$F);
|
|
93
|
+
const __iconNode$E = [
|
|
94
94
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
95
95
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
96
96
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
97
97
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
98
98
|
];
|
|
99
|
-
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$
|
|
100
|
-
const __iconNode$
|
|
99
|
+
const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$E);
|
|
100
|
+
const __iconNode$D = [
|
|
101
101
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
102
102
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
103
103
|
];
|
|
104
|
-
const ArrowUp = createLucideIcon("arrow-up", __iconNode$
|
|
105
|
-
const __iconNode$
|
|
104
|
+
const ArrowUp = createLucideIcon("arrow-up", __iconNode$D);
|
|
105
|
+
const __iconNode$C = [
|
|
106
106
|
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
107
107
|
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
108
108
|
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
@@ -110,8 +110,8 @@ const __iconNode$B = [
|
|
|
110
110
|
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
111
111
|
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
112
112
|
];
|
|
113
|
-
const Bot = createLucideIcon("bot", __iconNode$
|
|
114
|
-
const __iconNode$
|
|
113
|
+
const Bot = createLucideIcon("bot", __iconNode$C);
|
|
114
|
+
const __iconNode$B = [
|
|
115
115
|
["path", { d: "M12 18V5", key: "adv99a" }],
|
|
116
116
|
["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
|
|
117
117
|
["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
|
|
@@ -121,67 +121,67 @@ const __iconNode$A = [
|
|
|
121
121
|
["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
|
|
122
122
|
["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
|
|
123
123
|
];
|
|
124
|
-
const Brain = createLucideIcon("brain", __iconNode$
|
|
125
|
-
const __iconNode$
|
|
126
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
127
|
-
const __iconNode$
|
|
128
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
129
|
-
const __iconNode$
|
|
130
|
-
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$
|
|
131
|
-
const __iconNode$
|
|
132
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
133
|
-
const __iconNode$
|
|
134
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
135
|
-
const __iconNode$
|
|
124
|
+
const Brain = createLucideIcon("brain", __iconNode$B);
|
|
125
|
+
const __iconNode$A = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
126
|
+
const Check = createLucideIcon("check", __iconNode$A);
|
|
127
|
+
const __iconNode$z = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
128
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$z);
|
|
129
|
+
const __iconNode$y = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
130
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$y);
|
|
131
|
+
const __iconNode$x = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
132
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$x);
|
|
133
|
+
const __iconNode$w = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
134
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$w);
|
|
135
|
+
const __iconNode$v = [
|
|
136
136
|
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
|
137
137
|
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
|
138
138
|
];
|
|
139
|
-
const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$
|
|
140
|
-
const __iconNode$
|
|
139
|
+
const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$v);
|
|
140
|
+
const __iconNode$u = [
|
|
141
141
|
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
|
142
142
|
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
|
143
143
|
];
|
|
144
|
-
const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$
|
|
145
|
-
const __iconNode$
|
|
144
|
+
const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$u);
|
|
145
|
+
const __iconNode$t = [
|
|
146
146
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
147
147
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
148
148
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
149
149
|
];
|
|
150
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
151
|
-
const __iconNode$
|
|
150
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$t);
|
|
151
|
+
const __iconNode$s = [
|
|
152
152
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
153
153
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
154
154
|
];
|
|
155
|
-
const CircleCheck = createLucideIcon("circle-check", __iconNode$
|
|
156
|
-
const __iconNode$
|
|
155
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$s);
|
|
156
|
+
const __iconNode$r = [
|
|
157
157
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
158
158
|
["rect", { x: "9", y: "9", width: "6", height: "6", rx: "1", key: "1ssd4o" }]
|
|
159
159
|
];
|
|
160
|
-
const CircleStop = createLucideIcon("circle-stop", __iconNode$
|
|
161
|
-
const __iconNode$
|
|
160
|
+
const CircleStop = createLucideIcon("circle-stop", __iconNode$r);
|
|
161
|
+
const __iconNode$q = [
|
|
162
162
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
163
163
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
164
164
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
165
165
|
];
|
|
166
|
-
const CircleX = createLucideIcon("circle-x", __iconNode$
|
|
167
|
-
const __iconNode$
|
|
166
|
+
const CircleX = createLucideIcon("circle-x", __iconNode$q);
|
|
167
|
+
const __iconNode$p = [
|
|
168
168
|
["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
|
|
169
169
|
["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
|
|
170
170
|
];
|
|
171
|
-
const Code = createLucideIcon("code", __iconNode$
|
|
172
|
-
const __iconNode$
|
|
171
|
+
const Code = createLucideIcon("code", __iconNode$p);
|
|
172
|
+
const __iconNode$o = [
|
|
173
173
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
174
174
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
175
175
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
176
176
|
];
|
|
177
|
-
const Download = createLucideIcon("download", __iconNode$
|
|
178
|
-
const __iconNode$
|
|
177
|
+
const Download = createLucideIcon("download", __iconNode$o);
|
|
178
|
+
const __iconNode$n = [
|
|
179
179
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
180
180
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
181
181
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
182
182
|
];
|
|
183
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
184
|
-
const __iconNode$
|
|
183
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$n);
|
|
184
|
+
const __iconNode$m = [
|
|
185
185
|
[
|
|
186
186
|
"path",
|
|
187
187
|
{
|
|
@@ -195,8 +195,8 @@ const __iconNode$l = [
|
|
|
195
195
|
["path", { d: "M8 17h2", key: "2yhykz" }],
|
|
196
196
|
["path", { d: "M14 17h2", key: "10kma7" }]
|
|
197
197
|
];
|
|
198
|
-
const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$
|
|
199
|
-
const __iconNode$
|
|
198
|
+
const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$m);
|
|
199
|
+
const __iconNode$l = [
|
|
200
200
|
[
|
|
201
201
|
"path",
|
|
202
202
|
{
|
|
@@ -209,8 +209,8 @@ const __iconNode$k = [
|
|
|
209
209
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
210
210
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
211
211
|
];
|
|
212
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
213
|
-
const __iconNode$
|
|
212
|
+
const FileText = createLucideIcon("file-text", __iconNode$l);
|
|
213
|
+
const __iconNode$k = [
|
|
214
214
|
[
|
|
215
215
|
"path",
|
|
216
216
|
{
|
|
@@ -220,8 +220,8 @@ const __iconNode$j = [
|
|
|
220
220
|
],
|
|
221
221
|
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
222
222
|
];
|
|
223
|
-
const File = createLucideIcon("file", __iconNode$
|
|
224
|
-
const __iconNode$
|
|
223
|
+
const File = createLucideIcon("file", __iconNode$k);
|
|
224
|
+
const __iconNode$j = [
|
|
225
225
|
[
|
|
226
226
|
"path",
|
|
227
227
|
{
|
|
@@ -230,14 +230,14 @@ const __iconNode$i = [
|
|
|
230
230
|
}
|
|
231
231
|
]
|
|
232
232
|
];
|
|
233
|
-
const Funnel = createLucideIcon("funnel", __iconNode$
|
|
234
|
-
const __iconNode$
|
|
233
|
+
const Funnel = createLucideIcon("funnel", __iconNode$j);
|
|
234
|
+
const __iconNode$i = [
|
|
235
235
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
236
236
|
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
237
237
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
238
238
|
];
|
|
239
|
-
const Globe = createLucideIcon("globe", __iconNode$
|
|
240
|
-
const __iconNode$
|
|
239
|
+
const Globe = createLucideIcon("globe", __iconNode$i);
|
|
240
|
+
const __iconNode$h = [
|
|
241
241
|
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }],
|
|
242
242
|
["path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83", key: "1bzlo9" }],
|
|
243
243
|
["line", { x1: "13.5", x2: "6", y1: "13.5", y2: "21", key: "1q0aeu" }],
|
|
@@ -251,37 +251,37 @@ const __iconNode$g = [
|
|
|
251
251
|
],
|
|
252
252
|
["path", { d: "M21 15V5a2 2 0 0 0-2-2H9", key: "43el77" }]
|
|
253
253
|
];
|
|
254
|
-
const ImageOff = createLucideIcon("image-off", __iconNode$
|
|
255
|
-
const __iconNode$
|
|
254
|
+
const ImageOff = createLucideIcon("image-off", __iconNode$h);
|
|
255
|
+
const __iconNode$g = [
|
|
256
256
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
257
257
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
258
258
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
259
259
|
];
|
|
260
|
-
const Image$1 = createLucideIcon("image", __iconNode$
|
|
261
|
-
const __iconNode$
|
|
260
|
+
const Image$1 = createLucideIcon("image", __iconNode$g);
|
|
261
|
+
const __iconNode$f = [
|
|
262
262
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
263
263
|
["path", { d: "M12 16v-4", key: "1dtifu" }],
|
|
264
264
|
["path", { d: "M12 8h.01", key: "e9boi3" }]
|
|
265
265
|
];
|
|
266
|
-
const Info$1 = createLucideIcon("info", __iconNode$
|
|
267
|
-
const __iconNode$
|
|
266
|
+
const Info$1 = createLucideIcon("info", __iconNode$f);
|
|
267
|
+
const __iconNode$e = [
|
|
268
268
|
["path", { d: "M10 5h11", key: "1hkqpe" }],
|
|
269
269
|
["path", { d: "M10 12h11", key: "6m4ad9" }],
|
|
270
270
|
["path", { d: "M10 19h11", key: "14g2nv" }],
|
|
271
271
|
["path", { d: "m3 10 3-3-3-3", key: "i7pm08" }],
|
|
272
272
|
["path", { d: "m3 20 3-3-3-3", key: "20gx1n" }]
|
|
273
273
|
];
|
|
274
|
-
const ListCollapse = createLucideIcon("list-collapse", __iconNode$
|
|
275
|
-
const __iconNode$
|
|
276
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
277
|
-
const __iconNode$
|
|
274
|
+
const ListCollapse = createLucideIcon("list-collapse", __iconNode$e);
|
|
275
|
+
const __iconNode$d = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
276
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$d);
|
|
277
|
+
const __iconNode$c = [
|
|
278
278
|
["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }],
|
|
279
279
|
["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
|
|
280
280
|
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
|
|
281
281
|
["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
|
|
282
282
|
];
|
|
283
|
-
const Maximize = createLucideIcon("maximize", __iconNode$
|
|
284
|
-
const __iconNode$
|
|
283
|
+
const Maximize = createLucideIcon("maximize", __iconNode$c);
|
|
284
|
+
const __iconNode$b = [
|
|
285
285
|
[
|
|
286
286
|
"path",
|
|
287
287
|
{
|
|
@@ -297,7 +297,13 @@ const __iconNode$a = [
|
|
|
297
297
|
}
|
|
298
298
|
]
|
|
299
299
|
];
|
|
300
|
-
const MessagesSquare = createLucideIcon("messages-square", __iconNode$
|
|
300
|
+
const MessagesSquare = createLucideIcon("messages-square", __iconNode$b);
|
|
301
|
+
const __iconNode$a = [
|
|
302
|
+
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
303
|
+
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
304
|
+
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
305
|
+
];
|
|
306
|
+
const Mic = createLucideIcon("mic", __iconNode$a);
|
|
301
307
|
const __iconNode$9 = [
|
|
302
308
|
["path", { d: "M8 3v3a2 2 0 0 1-2 2H3", key: "hohbtr" }],
|
|
303
309
|
["path", { d: "M21 8h-3a2 2 0 0 1-2-2V3", key: "5jw1f3" }],
|
|
@@ -27619,7 +27625,7 @@ var Ts = (e) => {
|
|
|
27619
27625
|
for (; t > 0 && e[t - 1] === `
|
|
27620
27626
|
`; ) t--;
|
|
27621
27627
|
return e.slice(0, t);
|
|
27622
|
-
}, Ps = lazy(() => import("./highlighted-body-JLMTFACH-
|
|
27628
|
+
}, Ps = lazy(() => import("./highlighted-body-JLMTFACH-CFO3t4N6.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), At = ({ code: e, language: t, className: n, children: o, isIncomplete: r = false, startLine: s2, lineNumbers: a3, ...i }) => {
|
|
27623
27629
|
let l = w(), { codeBlockMaxHeight: c2 } = useContext(R), d2 = useMemo(() => Ts(e), [e]), p2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
|
|
27624
27630
|
`).map((b2) => [{ content: b2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
|
|
27625
27631
|
return jsx(Lt.Provider, { value: { code: e }, children: jsxs(It, { dir: "ltr", isIncomplete: r, language: t, children: [jsx(Dt, { language: t }), o ? jsx("div", { className: l("pointer-events-none absolute top-2 right-2 z-10 flex items-center"), children: jsx("div", { className: l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: o }) }) : null, jsx(Suspense, { fallback: jsx(In, { className: n, language: t, lineNumbers: a3, maxHeight: c2, result: p2, startLine: s2, ...i }), children: jsx(Ps, { className: n, code: d2, isIncomplete: r, language: t, lineNumbers: a3, maxHeight: c2, raw: p2, startLine: s2, ...i }) })] }) });
|
|
@@ -28054,7 +28060,7 @@ var Co = ({ children: e, className: t, maxHeight: n, showControls: o, showCopy:
|
|
|
28054
28060
|
let l = w(), { isAnimating: c2 } = useContext(R), d2 = rt(n), p2 = st(c2, !!d2, e), b2 = o && r, f2 = o && s2, u = o && a3, g2 = b2 || f2 || u;
|
|
28055
28061
|
return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [g2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [b2 ? jsx(Ze, {}) : null, f2 ? jsx(Ge, {}) : null, u ? jsx(ho, { showCopy: b2, showDownload: f2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), ref: p2, style: d2 ? { maxHeight: d2 } : void 0, children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...i, children: e }) })] });
|
|
28056
28062
|
};
|
|
28057
|
-
var Na = /startLine=(\d+)/, Ra = /\bnoLineNumbers\b/, Ia = lazy(() => import("./mermaid-WFAXDIZX-
|
|
28063
|
+
var Na = /startLine=(\d+)/, Ra = /\bnoLineNumbers\b/, Ia = lazy(() => import("./mermaid-WFAXDIZX-4tI67A1Y.js").then((e) => ({ default: e.Mermaid }))), La = /language-([^\s]+)/, Da = "node";
|
|
28058
28064
|
function H(e, t) {
|
|
28059
28065
|
let n = Object.keys(e);
|
|
28060
28066
|
if (n.length !== Object.keys(t).length) return false;
|
|
@@ -30398,6 +30404,223 @@ function ToolArgsProgress({ payload }) {
|
|
|
30398
30404
|
] })
|
|
30399
30405
|
] });
|
|
30400
30406
|
}
|
|
30407
|
+
async function recordDictation(signal, onPhrase, onDone, onError) {
|
|
30408
|
+
const context = new AudioContext();
|
|
30409
|
+
let stream;
|
|
30410
|
+
let node2;
|
|
30411
|
+
let released = false;
|
|
30412
|
+
let flushTimeout;
|
|
30413
|
+
function releaseMic() {
|
|
30414
|
+
stream?.getTracks().forEach((track) => track.stop());
|
|
30415
|
+
stream = void 0;
|
|
30416
|
+
}
|
|
30417
|
+
function release() {
|
|
30418
|
+
if (released) return;
|
|
30419
|
+
released = true;
|
|
30420
|
+
signal.removeEventListener("abort", release);
|
|
30421
|
+
clearTimeout(flushTimeout);
|
|
30422
|
+
releaseMic();
|
|
30423
|
+
node2?.disconnect();
|
|
30424
|
+
node2?.port.close();
|
|
30425
|
+
void context.close().catch(() => {
|
|
30426
|
+
});
|
|
30427
|
+
}
|
|
30428
|
+
signal.addEventListener("abort", release, { once: true });
|
|
30429
|
+
try {
|
|
30430
|
+
await Promise.all([
|
|
30431
|
+
context.resume(),
|
|
30432
|
+
context.audioWorklet.addModule(new URL("" + new URL("./dictation-worklet.js?no-inline", import.meta.url).href, import.meta.url)),
|
|
30433
|
+
navigator.mediaDevices.getUserMedia({ audio: { channelCount: 1 } }).then((media) => {
|
|
30434
|
+
if (released) media.getTracks().forEach((track) => track.stop());
|
|
30435
|
+
else stream = media;
|
|
30436
|
+
})
|
|
30437
|
+
]);
|
|
30438
|
+
if (released || !stream) throw new Error("Microphone setup was cancelled.");
|
|
30439
|
+
node2 = new AudioWorkletNode(context, "lumera-dictation", { channelCount: 1, channelCountMode: "explicit" });
|
|
30440
|
+
node2.port.onmessage = ({ data }) => {
|
|
30441
|
+
if (released) return;
|
|
30442
|
+
if (data === "done") {
|
|
30443
|
+
release();
|
|
30444
|
+
onDone();
|
|
30445
|
+
} else if (data instanceof ArrayBuffer) onPhrase(data);
|
|
30446
|
+
};
|
|
30447
|
+
node2.onprocessorerror = onError;
|
|
30448
|
+
context.createMediaStreamSource(stream).connect(node2).connect(context.destination);
|
|
30449
|
+
const stop = () => {
|
|
30450
|
+
if (released || flushTimeout !== void 0) return;
|
|
30451
|
+
node2?.port.postMessage("stop");
|
|
30452
|
+
releaseMic();
|
|
30453
|
+
flushTimeout = setTimeout(onError, 2e3);
|
|
30454
|
+
};
|
|
30455
|
+
stream.getAudioTracks()[0]?.addEventListener("ended", stop, { once: true });
|
|
30456
|
+
return stop;
|
|
30457
|
+
} catch (error2) {
|
|
30458
|
+
release();
|
|
30459
|
+
throw error2;
|
|
30460
|
+
}
|
|
30461
|
+
}
|
|
30462
|
+
const statusText = {
|
|
30463
|
+
idle: "",
|
|
30464
|
+
starting: "Waiting for microphone…",
|
|
30465
|
+
listening: "Recording",
|
|
30466
|
+
stopping: "Finishing dictation…"
|
|
30467
|
+
};
|
|
30468
|
+
function appendPhrase(draft, phrase) {
|
|
30469
|
+
const words = phrase.trim();
|
|
30470
|
+
if (!words) return draft;
|
|
30471
|
+
const space2 = draft && !/\s$/.test(draft) && !/^[.,!?;:]/.test(words) ? " " : "";
|
|
30472
|
+
return draft + space2 + words;
|
|
30473
|
+
}
|
|
30474
|
+
function createDictationHook({
|
|
30475
|
+
useRef: useRef2,
|
|
30476
|
+
useLayoutEffect: useLayoutEffect2,
|
|
30477
|
+
useState: useState2
|
|
30478
|
+
}, defaultTranscribe) {
|
|
30479
|
+
return function useDictation2(value, onChange, disabled, scope, transcribe = defaultTranscribe) {
|
|
30480
|
+
const session = useRef2(null);
|
|
30481
|
+
const draft = useRef2({ value, onChange });
|
|
30482
|
+
const [phase, setPhase] = useState2("idle");
|
|
30483
|
+
const [notice, setNotice] = useState2("");
|
|
30484
|
+
const [preview, setPreview] = useState2("");
|
|
30485
|
+
useLayoutEffect2(() => {
|
|
30486
|
+
draft.current = { value, onChange };
|
|
30487
|
+
return void 0;
|
|
30488
|
+
}, [value, onChange]);
|
|
30489
|
+
useLayoutEffect2(() => {
|
|
30490
|
+
setPhase("idle");
|
|
30491
|
+
setNotice("");
|
|
30492
|
+
setPreview("");
|
|
30493
|
+
function cancel() {
|
|
30494
|
+
session.current?.controller.abort();
|
|
30495
|
+
session.current = null;
|
|
30496
|
+
}
|
|
30497
|
+
function onVisibilityChange() {
|
|
30498
|
+
if (document.hidden) {
|
|
30499
|
+
cancel();
|
|
30500
|
+
setPreview("");
|
|
30501
|
+
setPhase("idle");
|
|
30502
|
+
}
|
|
30503
|
+
}
|
|
30504
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
30505
|
+
return () => {
|
|
30506
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
30507
|
+
cancel();
|
|
30508
|
+
};
|
|
30509
|
+
}, [disabled, scope]);
|
|
30510
|
+
const supported = Boolean(
|
|
30511
|
+
transcribe && typeof window !== "undefined" && window.isSecureContext && typeof navigator.mediaDevices?.getUserMedia === "function" && typeof AudioContext !== "undefined" && typeof AudioWorkletNode !== "undefined"
|
|
30512
|
+
);
|
|
30513
|
+
async function toggle() {
|
|
30514
|
+
if (!supported || disabled || !transcribe) return;
|
|
30515
|
+
if (session.current) {
|
|
30516
|
+
if (phase === "listening" && session.current.stop) {
|
|
30517
|
+
setPhase("stopping");
|
|
30518
|
+
session.current.stop();
|
|
30519
|
+
} else {
|
|
30520
|
+
session.current.controller.abort();
|
|
30521
|
+
session.current = null;
|
|
30522
|
+
setPreview("");
|
|
30523
|
+
setPhase("idle");
|
|
30524
|
+
}
|
|
30525
|
+
return;
|
|
30526
|
+
}
|
|
30527
|
+
const current = { controller: new AbortController() };
|
|
30528
|
+
session.current = current;
|
|
30529
|
+
const { signal } = current.controller;
|
|
30530
|
+
let ended = false;
|
|
30531
|
+
let outstanding = 0;
|
|
30532
|
+
let queue = Promise.resolve();
|
|
30533
|
+
function finish(message = "") {
|
|
30534
|
+
if (signal.aborted) return;
|
|
30535
|
+
current.controller.abort();
|
|
30536
|
+
session.current = null;
|
|
30537
|
+
setPhase("idle");
|
|
30538
|
+
setPreview("");
|
|
30539
|
+
setNotice(message);
|
|
30540
|
+
}
|
|
30541
|
+
function finishIfDrained() {
|
|
30542
|
+
if (ended && outstanding === 0) finish();
|
|
30543
|
+
}
|
|
30544
|
+
const transcribePhrase = transcribe;
|
|
30545
|
+
function enqueue(pcm) {
|
|
30546
|
+
if (signal.aborted) return;
|
|
30547
|
+
if (outstanding >= 6) {
|
|
30548
|
+
finish("Transcription fell behind. Check your connection and dictate the remaining words again.");
|
|
30549
|
+
return;
|
|
30550
|
+
}
|
|
30551
|
+
outstanding++;
|
|
30552
|
+
queue = queue.then(async () => {
|
|
30553
|
+
if (signal.aborted) return;
|
|
30554
|
+
const words = await transcribePhrase(
|
|
30555
|
+
new Blob([pcm], { type: "application/octet-stream" }),
|
|
30556
|
+
signal,
|
|
30557
|
+
(text2) => {
|
|
30558
|
+
if (!signal.aborted) setPreview(text2);
|
|
30559
|
+
}
|
|
30560
|
+
);
|
|
30561
|
+
if (signal.aborted) return;
|
|
30562
|
+
setPreview("");
|
|
30563
|
+
const next2 = appendPhrase(draft.current.value, words);
|
|
30564
|
+
if (draft.current.value !== next2) {
|
|
30565
|
+
draft.current.value = next2;
|
|
30566
|
+
draft.current.onChange(next2, Array.from(words.trim()).length);
|
|
30567
|
+
}
|
|
30568
|
+
outstanding--;
|
|
30569
|
+
finishIfDrained();
|
|
30570
|
+
}).catch((error2) => {
|
|
30571
|
+
finish(error2 instanceof Error ? error2.message : "Could not transcribe this phrase. Try again.");
|
|
30572
|
+
});
|
|
30573
|
+
}
|
|
30574
|
+
setNotice("");
|
|
30575
|
+
setPhase("starting");
|
|
30576
|
+
try {
|
|
30577
|
+
current.stop = await recordDictation(
|
|
30578
|
+
signal,
|
|
30579
|
+
enqueue,
|
|
30580
|
+
() => {
|
|
30581
|
+
if (signal.aborted) return;
|
|
30582
|
+
ended = true;
|
|
30583
|
+
setPhase("stopping");
|
|
30584
|
+
finishIfDrained();
|
|
30585
|
+
},
|
|
30586
|
+
() => finish("Microphone recording was interrupted. Try dictating again.")
|
|
30587
|
+
);
|
|
30588
|
+
if (!signal.aborted) setPhase("listening");
|
|
30589
|
+
} catch (error2) {
|
|
30590
|
+
const denied = error2 instanceof Error && error2.name === "NotAllowedError";
|
|
30591
|
+
finish(
|
|
30592
|
+
denied ? "Allow microphone access in your browser to dictate." : "Could not start dictation. Check your microphone and try again."
|
|
30593
|
+
);
|
|
30594
|
+
}
|
|
30595
|
+
}
|
|
30596
|
+
const active = phase !== "idle";
|
|
30597
|
+
let label = "Dictate message";
|
|
30598
|
+
if (phase === "listening") label = "Stop dictation";
|
|
30599
|
+
if (phase === "starting" || phase === "stopping") label = "Cancel dictation";
|
|
30600
|
+
return {
|
|
30601
|
+
supported,
|
|
30602
|
+
active,
|
|
30603
|
+
recording: phase === "listening",
|
|
30604
|
+
displayValue: active && preview ? appendPhrase(value, preview) : value,
|
|
30605
|
+
onShortcut(event) {
|
|
30606
|
+
const keyEvent = event.nativeEvent;
|
|
30607
|
+
if (!supported || disabled || keyEvent.key !== " " || keyEvent.altKey || keyEvent.metaKey || keyEvent.isComposing)
|
|
30608
|
+
return;
|
|
30609
|
+
const toggleChord = keyEvent.ctrlKey && keyEvent.shiftKey;
|
|
30610
|
+
const activeDraftSpace = active && !keyEvent.ctrlKey && !keyEvent.shiftKey && keyEvent.target.tagName === "TEXTAREA";
|
|
30611
|
+
if (!toggleChord && !activeDraftSpace) return;
|
|
30612
|
+
event.preventDefault();
|
|
30613
|
+
event.stopPropagation();
|
|
30614
|
+
if (!keyEvent.repeat) void toggle();
|
|
30615
|
+
},
|
|
30616
|
+
toggle,
|
|
30617
|
+
disabled,
|
|
30618
|
+
label,
|
|
30619
|
+
tip: active ? label : "Dictate with OpenAI (Ctrl + Shift + Space)",
|
|
30620
|
+
status: notice || statusText[phase]
|
|
30621
|
+
};
|
|
30622
|
+
};
|
|
30623
|
+
}
|
|
30401
30624
|
function useAutosizeTextarea(ref, value, maxHeight) {
|
|
30402
30625
|
useLayoutEffect(() => {
|
|
30403
30626
|
const el2 = ref.current;
|
|
@@ -30407,16 +30630,26 @@ function useAutosizeTextarea(ref, value, maxHeight) {
|
|
|
30407
30630
|
el2.style.overflowY = el2.scrollHeight > maxHeight ? "auto" : "hidden";
|
|
30408
30631
|
}, [maxHeight, ref, value]);
|
|
30409
30632
|
}
|
|
30633
|
+
const recordingDot = "size-1.5 shrink-0 rounded-full bg-destructive motion-safe:animate-pulse";
|
|
30410
30634
|
const TEXTAREA_MAX_HEIGHT = 120;
|
|
30635
|
+
const useDictation = createDictationHook({ useRef, useLayoutEffect, useState });
|
|
30411
30636
|
function AgentChatComposer({ state, actions }) {
|
|
30412
30637
|
const textareaRef = useRef(null);
|
|
30413
|
-
|
|
30638
|
+
const dictation = useDictation(
|
|
30639
|
+
state.value,
|
|
30640
|
+
actions.setValue,
|
|
30641
|
+
state.disabled,
|
|
30642
|
+
state.dictationScope,
|
|
30643
|
+
actions.transcribePhrase
|
|
30644
|
+
);
|
|
30645
|
+
useAutosizeTextarea(textareaRef, dictation.displayValue, TEXTAREA_MAX_HEIGHT);
|
|
30414
30646
|
const submit = () => {
|
|
30415
|
-
if (state.canSubmit) void actions.submit();
|
|
30647
|
+
if (state.canSubmit && !dictation.active) void actions.submit();
|
|
30416
30648
|
};
|
|
30417
30649
|
return /* @__PURE__ */ jsxs(
|
|
30418
30650
|
"form",
|
|
30419
30651
|
{
|
|
30652
|
+
onKeyDownCapture: dictation.onShortcut,
|
|
30420
30653
|
className: "px-3 pt-2.5 pb-3",
|
|
30421
30654
|
onSubmit: (event) => {
|
|
30422
30655
|
event.preventDefault();
|
|
@@ -30427,7 +30660,7 @@ function AgentChatComposer({ state, actions }) {
|
|
|
30427
30660
|
"button",
|
|
30428
30661
|
{
|
|
30429
30662
|
type: "button",
|
|
30430
|
-
disabled: state.disabled,
|
|
30663
|
+
disabled: state.disabled || dictation.active,
|
|
30431
30664
|
onClick: () => actions.pickChip?.(chip.value),
|
|
30432
30665
|
className: "rounded-full border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",
|
|
30433
30666
|
children: chip.label
|
|
@@ -30442,7 +30675,8 @@ function AgentChatComposer({ state, actions }) {
|
|
|
30442
30675
|
{
|
|
30443
30676
|
"data-update-managed": true,
|
|
30444
30677
|
ref: textareaRef,
|
|
30445
|
-
value:
|
|
30678
|
+
value: dictation.displayValue,
|
|
30679
|
+
readOnly: dictation.active,
|
|
30446
30680
|
placeholder: state.placeholder,
|
|
30447
30681
|
disabled: state.disabled,
|
|
30448
30682
|
rows: 1,
|
|
@@ -30456,7 +30690,7 @@ function AgentChatComposer({ state, actions }) {
|
|
|
30456
30690
|
}
|
|
30457
30691
|
}
|
|
30458
30692
|
),
|
|
30459
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 px-1.5 pt-1 pb-1.5", children: [
|
|
30693
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-1 px-1.5 pt-1 pb-1.5", children: [
|
|
30460
30694
|
actions.attachFiles && /* @__PURE__ */ jsx(AttachButton, { disabled: state.disabled, onFiles: actions.attachFiles }),
|
|
30461
30695
|
state.webSearchEnabled !== void 0 && actions.setWebSearchEnabled && /* @__PURE__ */ jsx(
|
|
30462
30696
|
WebSearchChip,
|
|
@@ -30470,7 +30704,37 @@ function AgentChatComposer({ state, actions }) {
|
|
|
30470
30704
|
state.queueLength > 0 ? /* @__PURE__ */ jsxs("span", { className: "mr-1.5 text-[11px] text-muted-foreground", children: [
|
|
30471
30705
|
state.queueLength,
|
|
30472
30706
|
" queued"
|
|
30473
|
-
] }) : /* @__PURE__ */
|
|
30707
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "mr-1.5 text-[11px] text-muted-foreground", children: [
|
|
30708
|
+
dictation.active && !dictation.recording && dictation.status,
|
|
30709
|
+
!dictation.active && state.hint
|
|
30710
|
+
] }),
|
|
30711
|
+
dictation.supported && /* @__PURE__ */ jsx(
|
|
30712
|
+
"button",
|
|
30713
|
+
{
|
|
30714
|
+
type: "button",
|
|
30715
|
+
"aria-label": dictation.label,
|
|
30716
|
+
"aria-keyshortcuts": dictation.active ? "Space Control+Shift+Space" : "Control+Shift+Space",
|
|
30717
|
+
title: dictation.tip,
|
|
30718
|
+
"aria-pressed": dictation.active,
|
|
30719
|
+
disabled: dictation.disabled,
|
|
30720
|
+
onClick: dictation.toggle,
|
|
30721
|
+
className: cn$1(
|
|
30722
|
+
"mx-1 flex h-[30px] w-[30px] shrink-0 items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-md text-[11px] font-normal leading-none text-muted-foreground transition-[width,background-color] duration-150 ease-out hover:bg-muted aria-pressed:w-[7.5rem] aria-pressed:bg-accent aria-pressed:text-accent-foreground disabled:opacity-50 motion-reduce:transition-none",
|
|
30723
|
+
dictation.recording && "aria-pressed:bg-destructive/10 hover:bg-destructive/15"
|
|
30724
|
+
),
|
|
30725
|
+
children: dictation.active ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30726
|
+
/* @__PURE__ */ jsx(
|
|
30727
|
+
"span",
|
|
30728
|
+
{
|
|
30729
|
+
"aria-hidden": "true",
|
|
30730
|
+
className: dictation.recording ? recordingDot : "size-1.5 rounded-sm bg-current"
|
|
30731
|
+
}
|
|
30732
|
+
),
|
|
30733
|
+
/* @__PURE__ */ jsx("span", { className: "w-9 shrink-0 text-left", children: dictation.recording ? "Stop" : "Cancel" }),
|
|
30734
|
+
/* @__PURE__ */ jsx("kbd", { className: "shrink-0 rounded border border-current/15 px-1.5 font-sans text-[10px] font-normal leading-3.5 text-muted-foreground", children: "Space" })
|
|
30735
|
+
] }) : /* @__PURE__ */ jsx(Mic, { className: "size-3.5", "aria-hidden": "true" })
|
|
30736
|
+
}
|
|
30737
|
+
),
|
|
30474
30738
|
state.canAbort ? /* @__PURE__ */ jsx(
|
|
30475
30739
|
"button",
|
|
30476
30740
|
{
|
|
@@ -30486,14 +30750,15 @@ function AgentChatComposer({ state, actions }) {
|
|
|
30486
30750
|
"button",
|
|
30487
30751
|
{
|
|
30488
30752
|
type: "submit",
|
|
30489
|
-
disabled: !state.canSubmit,
|
|
30753
|
+
disabled: !state.canSubmit || dictation.active,
|
|
30490
30754
|
"aria-label": state.sendLabel,
|
|
30491
30755
|
title: state.sendLabel,
|
|
30492
30756
|
className: "flex size-[30px] shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:opacity-90 disabled:cursor-default disabled:bg-border disabled:text-muted-foreground disabled:hover:opacity-100",
|
|
30493
30757
|
children: state.phase === "submitting" ? /* @__PURE__ */ jsx(LoaderCircle, { className: "size-3.5 animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ArrowUp, { className: "size-3.5", strokeWidth: 2.2, "aria-hidden": "true" })
|
|
30494
30758
|
}
|
|
30495
30759
|
)
|
|
30496
|
-
] })
|
|
30760
|
+
] }),
|
|
30761
|
+
/* @__PURE__ */ jsx("div", { role: "status", className: "px-3 text-xs text-muted-foreground", children: dictation.active ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: dictation.status }) : dictation.status })
|
|
30497
30762
|
] })
|
|
30498
30763
|
]
|
|
30499
30764
|
}
|
|
@@ -32593,7 +32858,7 @@ function AgentChat({
|
|
|
32593
32858
|
const attachmentsEnabled = Boolean(features?.attachments && transport.uploadFile);
|
|
32594
32859
|
const queueWhileStreaming = features?.queueWhileStreaming !== false;
|
|
32595
32860
|
const canSubmit = chat.canSubmit && (queueWhileStreaming || !chat.hasActive);
|
|
32596
|
-
const
|
|
32861
|
+
const statusText2 = chat.isCompacting ? labels.compacting : chat.phase === "streaming" ? "Streaming response…" : chat.phase === "submitting" ? "Submitting…" : chat.isWorking ? "Working…" : "Ready";
|
|
32597
32862
|
const send = useCallback(
|
|
32598
32863
|
async (message) => {
|
|
32599
32864
|
await chat.sendMessage(message);
|
|
@@ -32643,7 +32908,7 @@ function AgentChat({
|
|
|
32643
32908
|
name: profile.name,
|
|
32644
32909
|
description: profile.description,
|
|
32645
32910
|
avatarUrl: profile.avatarUrl,
|
|
32646
|
-
statusText,
|
|
32911
|
+
statusText: statusText2,
|
|
32647
32912
|
phase: chat.phase,
|
|
32648
32913
|
isWorking: chat.isWorking,
|
|
32649
32914
|
canAbort: chat.canAbort,
|
|
@@ -32687,6 +32952,7 @@ function AgentChat({
|
|
|
32687
32952
|
Composer,
|
|
32688
32953
|
{
|
|
32689
32954
|
state: {
|
|
32955
|
+
dictationScope: JSON.stringify([agentId, sessionId]),
|
|
32690
32956
|
value: chat.input,
|
|
32691
32957
|
pendingFiles: chat.pendingFiles,
|
|
32692
32958
|
disabled: chat.mutationsBlocked,
|
|
@@ -32703,6 +32969,7 @@ function AgentChat({
|
|
|
32703
32969
|
webSearchEnabled: chat.webSearchEnabled
|
|
32704
32970
|
},
|
|
32705
32971
|
actions: {
|
|
32972
|
+
transcribePhrase: transport.transcribePhrase,
|
|
32706
32973
|
setValue: chat.setInput,
|
|
32707
32974
|
submit: send,
|
|
32708
32975
|
abort: stop,
|
|
@@ -32815,6 +33082,32 @@ function ResizeHandle({
|
|
|
32815
33082
|
}
|
|
32816
33083
|
);
|
|
32817
33084
|
}
|
|
33085
|
+
function createPhraseTranscript(onPreview) {
|
|
33086
|
+
let buffer = "";
|
|
33087
|
+
let preview = "";
|
|
33088
|
+
let final;
|
|
33089
|
+
function line(input) {
|
|
33090
|
+
if (!input.trim()) return;
|
|
33091
|
+
const event = JSON.parse(input);
|
|
33092
|
+
if (typeof event.text === "string") final = event.text;
|
|
33093
|
+
else if (typeof event.delta === "string" && final === void 0) {
|
|
33094
|
+
preview += event.delta;
|
|
33095
|
+
onPreview?.(preview);
|
|
33096
|
+
}
|
|
33097
|
+
}
|
|
33098
|
+
return {
|
|
33099
|
+
feed(chunk) {
|
|
33100
|
+
const lines = (buffer + chunk).split("\n");
|
|
33101
|
+
buffer = lines.pop() ?? "";
|
|
33102
|
+
for (const input of lines) line(input);
|
|
33103
|
+
},
|
|
33104
|
+
finish() {
|
|
33105
|
+
line(buffer);
|
|
33106
|
+
if (final === void 0) throw new Error("Transcription was interrupted. Dictate the last phrase again.");
|
|
33107
|
+
return final;
|
|
33108
|
+
}
|
|
33109
|
+
};
|
|
33110
|
+
}
|
|
32818
33111
|
function isSessionActive(activity) {
|
|
32819
33112
|
return activity?.status === "active";
|
|
32820
33113
|
}
|
|
@@ -32973,6 +33266,51 @@ function createLumeraAgentChatTransport(options) {
|
|
|
32973
33266
|
}
|
|
32974
33267
|
};
|
|
32975
33268
|
},
|
|
33269
|
+
transcribePhrase: async (pcm, signal, onPreview) => {
|
|
33270
|
+
const body = await fileToBase64(pcm);
|
|
33271
|
+
signal.throwIfAborted();
|
|
33272
|
+
const upload = {
|
|
33273
|
+
method: "POST",
|
|
33274
|
+
url: "/api/me/dictation",
|
|
33275
|
+
headers: { "Content-Type": "application/octet-stream" },
|
|
33276
|
+
body,
|
|
33277
|
+
isBase64: true,
|
|
33278
|
+
timeout: 3e4
|
|
33279
|
+
};
|
|
33280
|
+
if (onPreview && (!options.request || options.stream)) {
|
|
33281
|
+
upload.headers = { ...upload.headers, Accept: "application/x-ndjson" };
|
|
33282
|
+
const transcript = createPhraseTranscript(onPreview);
|
|
33283
|
+
let connection;
|
|
33284
|
+
let onAbort;
|
|
33285
|
+
try {
|
|
33286
|
+
await new Promise((resolve, reject) => {
|
|
33287
|
+
onAbort = () => reject(signal.reason);
|
|
33288
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
33289
|
+
connection = stream(upload, {
|
|
33290
|
+
onChunk(chunk) {
|
|
33291
|
+
try {
|
|
33292
|
+
transcript.feed(chunk);
|
|
33293
|
+
} catch (error2) {
|
|
33294
|
+
reject(error2);
|
|
33295
|
+
}
|
|
33296
|
+
},
|
|
33297
|
+
onError: () => reject(new Error("Could not transcribe this phrase. Try again.")),
|
|
33298
|
+
onClose: resolve
|
|
33299
|
+
});
|
|
33300
|
+
});
|
|
33301
|
+
return transcript.finish();
|
|
33302
|
+
} finally {
|
|
33303
|
+
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
33304
|
+
connection?.close();
|
|
33305
|
+
}
|
|
33306
|
+
}
|
|
33307
|
+
const response = await request(upload);
|
|
33308
|
+
signal.throwIfAborted();
|
|
33309
|
+
ensureBridgeOK(response, "Could not transcribe this phrase. Try again.");
|
|
33310
|
+
if (!isRecord(response.body) || typeof response.body.text !== "string")
|
|
33311
|
+
throw new Error("Invalid dictation response.");
|
|
33312
|
+
return response.body.text;
|
|
33313
|
+
},
|
|
32976
33314
|
uploadFile: async (file, context) => {
|
|
32977
33315
|
const resolvedAgentId = await resolveAgentId(context?.agentId);
|
|
32978
33316
|
const base64 = await fileToBase64(file);
|
|
@@ -33060,6 +33398,7 @@ ${input.message || "Please review the uploaded file(s)."}` : input.message;
|
|
|
33060
33398
|
session_id: sessionId,
|
|
33061
33399
|
message,
|
|
33062
33400
|
...input.requestId && { request_id: input.requestId },
|
|
33401
|
+
...input.dictatedCharacters && { dictated_characters: input.dictatedCharacters },
|
|
33063
33402
|
...options.model && { model: options.model },
|
|
33064
33403
|
...options.systemPrompt && { system_prompt: options.systemPrompt },
|
|
33065
33404
|
...webSearchEnabled !== void 0 && { web_search_enabled: webSearchEnabled }
|