@opengeni/react 3.8.0-canary.0 → 4.0.1-canary.0
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 +11 -24
- package/dist/artifacts.js +7 -7
- package/dist/{browser-viewer-SS46LUAC.js → browser-viewer-NTD6UIPR.js} +3 -3
- package/dist/{chunk-VEPNNDNG.js → chunk-24M4YBCL.js} +4 -4
- package/dist/chunk-5M6VTFJ5.js +171 -0
- package/dist/chunk-5M6VTFJ5.js.map +1 -0
- package/dist/{chunk-IOLVN74D.js → chunk-6J56T3MG.js} +15 -1
- package/dist/chunk-6J56T3MG.js.map +1 -0
- package/dist/{chunk-ELIYWBZR.js → chunk-BV5A4OTE.js} +4 -4
- package/dist/{chunk-3HIF5IFC.js → chunk-HO6X4FHG.js} +2597 -1030
- package/dist/chunk-HO6X4FHG.js.map +1 -0
- package/dist/{chunk-BXJOQFCD.js → chunk-HUMIRRYI.js} +84 -221
- package/dist/chunk-HUMIRRYI.js.map +1 -0
- package/dist/{chunk-ZFOFY5ST.js → chunk-NLTS7JHI.js} +16 -31
- package/dist/chunk-NLTS7JHI.js.map +1 -0
- package/dist/chunk-NOSYBS2D.js +208 -0
- package/dist/chunk-NOSYBS2D.js.map +1 -0
- package/dist/chunk-YBM6CQRU.js +292 -0
- package/dist/chunk-YBM6CQRU.js.map +1 -0
- package/dist/{chunk-BQGIXRKV.js → chunk-Z7WBDB4E.js} +416 -290
- package/dist/chunk-Z7WBDB4E.js.map +1 -0
- package/dist/chunk-ZYRGEKWS.js +216 -0
- package/dist/chunk-ZYRGEKWS.js.map +1 -0
- package/dist/components/composer.d.ts +4 -2
- package/dist/components/human-input-form.d.ts +3 -1
- package/dist/components/human-input-surface.d.ts +3 -2
- package/dist/components/message-timeline.d.ts +9 -2
- package/dist/components/session-conversation.d.ts +2 -0
- package/dist/components/timeline-annotation-chrome.d.ts +25 -0
- package/dist/components/timeline-annotation-layout.d.ts +42 -0
- package/dist/components/timeline-annotation-markers.d.ts +8 -0
- package/dist/components/timeline-annotation-reveal-context.d.ts +4 -0
- package/dist/components/timeline-annotation-shared.d.ts +31 -0
- package/dist/components/timeline-annotations-dialog.d.ts +1 -1
- package/dist/components/timeline-annotations.d.ts +8 -2
- package/dist/composer.js +3 -4
- package/dist/{computer-viewer-FWEZISW4.js → computer-viewer-7TEZC6Y2.js} +3 -3
- package/dist/hooks/use-codex-accounts.d.ts +11 -1
- package/dist/hooks/use-composer.d.ts +2 -0
- package/dist/hooks/use-session-events.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +50 -37
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +3 -3
- package/dist/machines.js +1 -1
- package/dist/older-history.d.ts +3 -2
- package/dist/{platform-activity-row-BJHUHXAT.js → platform-activity-row-27LKAWZD.js} +2 -2
- package/dist/platform-activity-row-27LKAWZD.js.map +1 -0
- package/dist/{queue-surface-implementation-XL2A6PBM.js → queue-surface-implementation-LK3S4BIW.js} +5 -2
- package/dist/{queue-surface-implementation-XL2A6PBM.js.map → queue-surface-implementation-LK3S4BIW.js.map} +1 -1
- package/dist/realtime.js +3 -3
- package/dist/session-ui.js +11 -11
- package/dist/session.js +2 -2
- package/dist/timeline/types.d.ts +3 -0
- package/dist/timeline-annotation-markers-DRSTLEM6.js +165 -0
- package/dist/timeline-annotation-markers-DRSTLEM6.js.map +1 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js +236 -0
- package/dist/timeline-annotation-selection-IHLUGVND.js.map +1 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js +262 -0
- package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +1 -0
- package/package.json +2 -6
- package/src/components/chat-composer.tsx +5 -2
- package/src/components/composer.tsx +40 -5
- package/src/components/copy-button.tsx +1 -0
- package/src/components/human-input-form.tsx +185 -53
- package/src/components/human-input-surface.tsx +3 -0
- package/src/components/machines-dashboard.tsx +1 -16
- package/src/components/message-timeline.tsx +397 -302
- package/src/components/session-commands-panel.tsx +7 -1
- package/src/components/session-conversation.tsx +4 -1
- package/src/components/timeline-annotation-chrome.tsx +183 -0
- package/src/components/timeline-annotation-layout.ts +268 -0
- package/src/components/timeline-annotation-markers.tsx +185 -0
- package/src/components/timeline-annotation-reveal-context.ts +9 -0
- package/src/components/timeline-annotation-selection.tsx +99 -54
- package/src/components/timeline-annotation-shared.ts +245 -0
- package/src/components/timeline-annotations-dialog.tsx +172 -128
- package/src/components/timeline-annotations.tsx +178 -45
- package/src/hooks/use-codex-accounts.ts +32 -5
- package/src/hooks/use-composer.ts +17 -0
- package/src/hooks/use-session-events.ts +16 -277
- package/src/index.ts +0 -1
- package/src/older-history.ts +22 -4
- package/src/timeline/platform-activity-row.tsx +4 -1
- package/src/timeline/projection.ts +99 -9
- package/src/timeline/types.ts +3 -0
- package/styles/compiled.css +86 -22
- package/dist/chat.d.ts +0 -37
- package/dist/chat.js +0 -315
- package/dist/chat.js.map +0 -1
- package/dist/chunk-3HIF5IFC.js.map +0 -1
- package/dist/chunk-BQGIXRKV.js.map +0 -1
- package/dist/chunk-BXJOQFCD.js.map +0 -1
- package/dist/chunk-F2CFHN3Y.js +0 -1415
- package/dist/chunk-F2CFHN3Y.js.map +0 -1
- package/dist/chunk-HQV2I5HV.js +0 -124
- package/dist/chunk-HQV2I5HV.js.map +0 -1
- package/dist/chunk-IOLVN74D.js.map +0 -1
- package/dist/chunk-W3OUAH6M.js +0 -170
- package/dist/chunk-W3OUAH6M.js.map +0 -1
- package/dist/chunk-ZFOFY5ST.js.map +0 -1
- package/dist/platform-activity-row-BJHUHXAT.js.map +0 -1
- package/dist/timeline-annotation-selection-3L7LHGG2.js +0 -187
- package/dist/timeline-annotation-selection-3L7LHGG2.js.map +0 -1
- package/dist/timeline-annotations-dialog-U7EVLR75.js +0 -196
- package/dist/timeline-annotations-dialog-U7EVLR75.js.map +0 -1
- package/src/chat.tsx +0 -393
- /package/dist/{browser-viewer-SS46LUAC.js.map → browser-viewer-NTD6UIPR.js.map} +0 -0
- /package/dist/{chunk-VEPNNDNG.js.map → chunk-24M4YBCL.js.map} +0 -0
- /package/dist/{chunk-ELIYWBZR.js.map → chunk-BV5A4OTE.js.map} +0 -0
- /package/dist/{computer-viewer-FWEZISW4.js.map → computer-viewer-7TEZC6Y2.js.map} +0 -0
|
@@ -1,22 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComposerResponsiveContext,
|
|
3
|
+
usePortalTokenStyle
|
|
4
|
+
} from "./chunk-VZTQ73XT.js";
|
|
1
5
|
import {
|
|
2
6
|
shouldSteerOnKey,
|
|
3
7
|
shouldSubmitOnKey
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6J56T3MG.js";
|
|
5
9
|
import {
|
|
6
10
|
composerSubmissionErrorMessage,
|
|
7
11
|
formatBytes,
|
|
8
12
|
formatRelativeTime
|
|
9
13
|
} from "./chunk-PLYRL5ER.js";
|
|
10
|
-
import {
|
|
11
|
-
Tooltip,
|
|
12
|
-
TooltipContent,
|
|
13
|
-
TooltipProvider,
|
|
14
|
-
TooltipTrigger
|
|
15
|
-
} from "./chunk-HQV2I5HV.js";
|
|
16
|
-
import {
|
|
17
|
-
ComposerResponsiveContext,
|
|
18
|
-
usePortalTokenStyle
|
|
19
|
-
} from "./chunk-VZTQ73XT.js";
|
|
20
14
|
import {
|
|
21
15
|
groupPickerRowsByBillingClass
|
|
22
16
|
} from "./chunk-VRBL3F5E.js";
|
|
@@ -24,25 +18,135 @@ import {
|
|
|
24
18
|
cn
|
|
25
19
|
} from "./chunk-22KP6LR5.js";
|
|
26
20
|
|
|
21
|
+
// src/components/tooltip.tsx
|
|
22
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
23
|
+
import {
|
|
24
|
+
createContext,
|
|
25
|
+
useContext,
|
|
26
|
+
useLayoutEffect,
|
|
27
|
+
useMemo,
|
|
28
|
+
useRef,
|
|
29
|
+
useState
|
|
30
|
+
} from "react";
|
|
31
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
+
var TooltipSourceContext = createContext(null);
|
|
33
|
+
function TooltipProvider({
|
|
34
|
+
delayDuration = 300,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, ...props });
|
|
38
|
+
}
|
|
39
|
+
function Tooltip({ children, ...props }) {
|
|
40
|
+
const { onOpenChange, ...rootProps } = props;
|
|
41
|
+
const sourceRef = useRef(null);
|
|
42
|
+
const sourcePublishedRef = useRef(false);
|
|
43
|
+
const [source, setSource] = useState(null);
|
|
44
|
+
const ref = useRef((node) => {
|
|
45
|
+
sourceRef.current = node;
|
|
46
|
+
if (sourcePublishedRef.current) setSource(node);
|
|
47
|
+
}).current;
|
|
48
|
+
useLayoutEffect(() => {
|
|
49
|
+
if (rootProps.open === true || rootProps.defaultOpen === true) {
|
|
50
|
+
sourcePublishedRef.current = true;
|
|
51
|
+
setSource(sourceRef.current);
|
|
52
|
+
}
|
|
53
|
+
}, [rootProps.defaultOpen, rootProps.open]);
|
|
54
|
+
const sourceContext = useMemo(() => ({ source, ref }), [ref, source]);
|
|
55
|
+
return /* @__PURE__ */ jsx(TooltipSourceContext.Provider, { value: sourceContext, children: /* @__PURE__ */ jsx(
|
|
56
|
+
TooltipPrimitive.Root,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "tooltip",
|
|
59
|
+
onOpenChange: (open) => {
|
|
60
|
+
if (open) {
|
|
61
|
+
sourcePublishedRef.current = true;
|
|
62
|
+
setSource(sourceRef.current);
|
|
63
|
+
}
|
|
64
|
+
onOpenChange?.(open);
|
|
65
|
+
},
|
|
66
|
+
...rootProps,
|
|
67
|
+
children
|
|
68
|
+
}
|
|
69
|
+
) });
|
|
70
|
+
}
|
|
71
|
+
function TooltipTrigger({
|
|
72
|
+
asChild = true,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
const sourceRef = useContext(TooltipSourceContext);
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
TooltipPrimitive.Trigger,
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "tooltip-trigger",
|
|
80
|
+
asChild,
|
|
81
|
+
ref: (node) => {
|
|
82
|
+
sourceRef?.ref(node);
|
|
83
|
+
},
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
var tooltipSurfaceStyle = {
|
|
89
|
+
backgroundColor: "var(--og-color-fg)",
|
|
90
|
+
color: "var(--og-color-bg)"
|
|
91
|
+
};
|
|
92
|
+
function TooltipContent({
|
|
93
|
+
className,
|
|
94
|
+
sideOffset = 6,
|
|
95
|
+
children,
|
|
96
|
+
style,
|
|
97
|
+
...props
|
|
98
|
+
}) {
|
|
99
|
+
const source = useContext(TooltipSourceContext);
|
|
100
|
+
const portalStyle = usePortalTokenStyle(source?.source ?? null);
|
|
101
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
102
|
+
TooltipPrimitive.Content,
|
|
103
|
+
{
|
|
104
|
+
"data-slot": "tooltip-content",
|
|
105
|
+
sideOffset,
|
|
106
|
+
className: cn(
|
|
107
|
+
"og-root z-50 w-fit max-w-xs origin-[var(--radix-tooltip-content-transform-origin)]",
|
|
108
|
+
"rounded-og-md px-2.5 py-1.5 text-og-xs leading-4 text-balance shadow-og-md",
|
|
109
|
+
"animate-og-enter data-[state=closed]:opacity-0 data-[state=closed]:transition-opacity",
|
|
110
|
+
className
|
|
111
|
+
),
|
|
112
|
+
style: { ...portalStyle, ...tooltipSurfaceStyle, ...style },
|
|
113
|
+
...props,
|
|
114
|
+
children: [
|
|
115
|
+
children,
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
TooltipPrimitive.Arrow,
|
|
118
|
+
{
|
|
119
|
+
className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
120
|
+
style: {
|
|
121
|
+
backgroundColor: "var(--og-color-fg)",
|
|
122
|
+
fill: "var(--og-color-fg)"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
) });
|
|
129
|
+
}
|
|
130
|
+
|
|
27
131
|
// src/timeline/screenshot-lightbox.tsx
|
|
28
132
|
import { DownloadIcon, XIcon } from "lucide-react";
|
|
29
133
|
import { AnimatePresence, motion } from "motion/react";
|
|
30
134
|
import {
|
|
31
|
-
createContext,
|
|
135
|
+
createContext as createContext2,
|
|
32
136
|
useCallback,
|
|
33
|
-
useContext,
|
|
137
|
+
useContext as useContext2,
|
|
34
138
|
useEffect,
|
|
35
|
-
useMemo,
|
|
36
|
-
useState
|
|
139
|
+
useMemo as useMemo2,
|
|
140
|
+
useState as useState2
|
|
37
141
|
} from "react";
|
|
38
142
|
import { Dialog } from "radix-ui";
|
|
39
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
-
var LightboxContext =
|
|
143
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
144
|
+
var LightboxContext = createContext2(null);
|
|
41
145
|
function useLightbox() {
|
|
42
|
-
return
|
|
146
|
+
return useContext2(LightboxContext) ?? NOOP;
|
|
43
147
|
}
|
|
44
148
|
function useLightboxOptional() {
|
|
45
|
-
return
|
|
149
|
+
return useContext2(LightboxContext);
|
|
46
150
|
}
|
|
47
151
|
var NOOP = { open: () => {
|
|
48
152
|
} };
|
|
@@ -62,16 +166,16 @@ function createLightboxSourceOwner() {
|
|
|
62
166
|
};
|
|
63
167
|
}
|
|
64
168
|
function LightboxProvider({ children }) {
|
|
65
|
-
const ancestor =
|
|
169
|
+
const ancestor = useContext2(LightboxContext);
|
|
66
170
|
if (ancestor) {
|
|
67
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ jsx2(Fragment, { children });
|
|
68
172
|
}
|
|
69
|
-
return /* @__PURE__ */
|
|
173
|
+
return /* @__PURE__ */ jsx2(LightboxRoot, { children });
|
|
70
174
|
}
|
|
71
175
|
function LightboxRoot({ children }) {
|
|
72
|
-
const [state, setState] =
|
|
73
|
-
const [tokenSource, setTokenSource] =
|
|
74
|
-
const sourceOwner =
|
|
176
|
+
const [state, setState] = useState2(null);
|
|
177
|
+
const [tokenSource, setTokenSource] = useState2(null);
|
|
178
|
+
const sourceOwner = useMemo2(() => createLightboxSourceOwner(), []);
|
|
75
179
|
const portalStyle = usePortalTokenStyle(tokenSource);
|
|
76
180
|
const releaseCurrentSource = useCallback(() => {
|
|
77
181
|
sourceOwner.release();
|
|
@@ -96,11 +200,11 @@ function LightboxRoot({ children }) {
|
|
|
96
200
|
setState(null);
|
|
97
201
|
setTokenSource(null);
|
|
98
202
|
}, [releaseCurrentSource]);
|
|
99
|
-
const controller =
|
|
100
|
-
return /* @__PURE__ */
|
|
203
|
+
const controller = useMemo2(() => ({ open }), [open]);
|
|
204
|
+
return /* @__PURE__ */ jsxs2(LightboxContext.Provider, { value: controller, children: [
|
|
101
205
|
children,
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ jsx2(Dialog.Root, { open: state !== null, onOpenChange: (next) => !next && close(), children: /* @__PURE__ */ jsx2(AnimatePresence, { children: state !== null ? /* @__PURE__ */ jsxs2(Dialog.Portal, { forceMount: true, children: [
|
|
207
|
+
/* @__PURE__ */ jsx2(Dialog.Overlay, { asChild: true, forceMount: true, children: /* @__PURE__ */ jsx2(
|
|
104
208
|
motion.div,
|
|
105
209
|
{
|
|
106
210
|
initial: { opacity: 0 },
|
|
@@ -111,14 +215,14 @@ function LightboxRoot({ children }) {
|
|
|
111
215
|
style: portalStyle
|
|
112
216
|
}
|
|
113
217
|
) }),
|
|
114
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ jsx2(
|
|
115
219
|
Dialog.Content,
|
|
116
220
|
{
|
|
117
221
|
asChild: true,
|
|
118
222
|
forceMount: true,
|
|
119
223
|
"aria-label": state.label,
|
|
120
224
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
121
|
-
children: /* @__PURE__ */
|
|
225
|
+
children: /* @__PURE__ */ jsxs2(
|
|
122
226
|
motion.div,
|
|
123
227
|
{
|
|
124
228
|
initial: { opacity: 0, scale: 0.98 },
|
|
@@ -133,11 +237,11 @@ function LightboxRoot({ children }) {
|
|
|
133
237
|
className: "og-root fixed inset-0 z-50 flex items-center justify-center p-6 sm:p-12",
|
|
134
238
|
style: portalStyle,
|
|
135
239
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ jsx2(Dialog.Title, { className: "sr-only", children: state.label }),
|
|
241
|
+
/* @__PURE__ */ jsx2(Dialog.Description, { className: "sr-only", children: state.caption ?? `Expanded ${state.label.toLowerCase()}` }),
|
|
242
|
+
/* @__PURE__ */ jsxs2("figure", { className: "m-0 flex max-h-full max-w-5xl flex-col items-center gap-3", children: [
|
|
243
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative flex min-h-0 w-fit max-w-full", children: [
|
|
244
|
+
/* @__PURE__ */ jsx2(
|
|
141
245
|
"img",
|
|
142
246
|
{
|
|
143
247
|
src: state.src,
|
|
@@ -145,7 +249,7 @@ function LightboxRoot({ children }) {
|
|
|
145
249
|
className: "min-h-0 max-h-[82vh] w-auto max-w-full rounded-og-md border border-white/10 object-contain shadow-og-lg"
|
|
146
250
|
}
|
|
147
251
|
),
|
|
148
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ jsx2(
|
|
149
253
|
ScreenshotLightboxControls,
|
|
150
254
|
{
|
|
151
255
|
src: state.src,
|
|
@@ -154,7 +258,7 @@ function LightboxRoot({ children }) {
|
|
|
154
258
|
}
|
|
155
259
|
)
|
|
156
260
|
] }),
|
|
157
|
-
state.caption ? /* @__PURE__ */
|
|
261
|
+
state.caption ? /* @__PURE__ */ jsx2("figcaption", { className: "max-w-2xl text-center font-og-mono text-og-xs text-white/55", children: state.caption }) : /* @__PURE__ */ jsx2("figcaption", { className: "font-og-mono text-og-xs uppercase tracking-[0.1em] text-white/35", children: "Esc or click outside to close" })
|
|
158
262
|
] })
|
|
159
263
|
]
|
|
160
264
|
}
|
|
@@ -169,8 +273,8 @@ function ScreenshotLightboxControls({
|
|
|
169
273
|
downloadFilename,
|
|
170
274
|
controlLabels
|
|
171
275
|
}) {
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
downloadFilename ? /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ jsxs2("div", { className: "absolute -right-3 -top-3 flex items-center gap-2", children: [
|
|
277
|
+
downloadFilename ? /* @__PURE__ */ jsx2(
|
|
174
278
|
"a",
|
|
175
279
|
{
|
|
176
280
|
href: src,
|
|
@@ -181,10 +285,10 @@ function ScreenshotLightboxControls({
|
|
|
181
285
|
"transition-colors hover:border-white/30 hover:text-white"
|
|
182
286
|
),
|
|
183
287
|
"aria-label": controlLabels?.download ?? `Download ${downloadFilename}`,
|
|
184
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ jsx2(DownloadIcon, { className: "size-4" })
|
|
185
289
|
}
|
|
186
290
|
) : null,
|
|
187
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ jsx2(
|
|
188
292
|
Dialog.Close,
|
|
189
293
|
{
|
|
190
294
|
className: cn(
|
|
@@ -193,7 +297,7 @@ function ScreenshotLightboxControls({
|
|
|
193
297
|
"transition-colors hover:border-white/30 hover:text-white"
|
|
194
298
|
),
|
|
195
299
|
"aria-label": controlLabels?.close ?? "Close",
|
|
196
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ jsx2(XIcon, { className: "size-4" })
|
|
197
301
|
}
|
|
198
302
|
)
|
|
199
303
|
] });
|
|
@@ -391,20 +495,20 @@ function clearErrorMessage(cause) {
|
|
|
391
495
|
}
|
|
392
496
|
|
|
393
497
|
// src/hooks/use-slash-commands.ts
|
|
394
|
-
import { useCallback as useCallback2, useMemo as
|
|
498
|
+
import { useCallback as useCallback2, useMemo as useMemo3, useRef as useRef2, useState as useState3 } from "react";
|
|
395
499
|
function useSlashCommands(options) {
|
|
396
500
|
const { commands, context, handlers, value, setValue } = options;
|
|
397
|
-
const [highlight, setHighlight] =
|
|
398
|
-
const [dismissedValue, setDismissedValue] =
|
|
501
|
+
const [highlight, setHighlight] = useState3(0);
|
|
502
|
+
const [dismissedValue, setDismissedValue] = useState3(null);
|
|
399
503
|
const dismissed = dismissedValue !== null && dismissedValue === value;
|
|
400
|
-
const navigatedRef =
|
|
401
|
-
const navTokenRef =
|
|
504
|
+
const navigatedRef = useRef2(false);
|
|
505
|
+
const navTokenRef = useRef2(value);
|
|
402
506
|
if (navTokenRef.current !== value) {
|
|
403
507
|
navTokenRef.current = value;
|
|
404
508
|
navigatedRef.current = false;
|
|
405
509
|
}
|
|
406
|
-
const parsed =
|
|
407
|
-
const filterCtx =
|
|
510
|
+
const parsed = useMemo3(() => parseCommandLine(value), [value]);
|
|
511
|
+
const filterCtx = useMemo3(
|
|
408
512
|
() => ({
|
|
409
513
|
sessionId: context?.sessionId ?? null,
|
|
410
514
|
status: context?.status ?? null,
|
|
@@ -412,13 +516,13 @@ function useSlashCommands(options) {
|
|
|
412
516
|
}),
|
|
413
517
|
[context?.sessionId, context?.status, context?.permissions]
|
|
414
518
|
);
|
|
415
|
-
const activeCommand =
|
|
519
|
+
const activeCommand = useMemo3(() => {
|
|
416
520
|
if (!parsed || !parsed.hasTrailingSpace) {
|
|
417
521
|
return null;
|
|
418
522
|
}
|
|
419
523
|
return matchCommand(commands, value);
|
|
420
524
|
}, [commands, value, parsed]);
|
|
421
|
-
const items =
|
|
525
|
+
const items = useMemo3(() => {
|
|
422
526
|
if (!parsed) {
|
|
423
527
|
return [];
|
|
424
528
|
}
|
|
@@ -473,7 +577,7 @@ function useSlashCommands(options) {
|
|
|
473
577
|
autocomplete(command);
|
|
474
578
|
}
|
|
475
579
|
}, [items, clampedHighlight, autocomplete]);
|
|
476
|
-
const runningRef =
|
|
580
|
+
const runningRef = useRef2(false);
|
|
477
581
|
const runResolved = useCallback2(
|
|
478
582
|
async (command, executionOptions) => {
|
|
479
583
|
if (!parsed || runningRef.current) {
|
|
@@ -601,7 +705,7 @@ function errorMessage2(cause) {
|
|
|
601
705
|
|
|
602
706
|
// src/components/command-palette.tsx
|
|
603
707
|
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
604
|
-
import { jsx as
|
|
708
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
605
709
|
function CommandPalette({
|
|
606
710
|
open,
|
|
607
711
|
items,
|
|
@@ -613,7 +717,7 @@ function CommandPalette({
|
|
|
613
717
|
label = "Slash commands",
|
|
614
718
|
dangerLabel = "danger"
|
|
615
719
|
}) {
|
|
616
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ jsx3(AnimatePresence2, { children: open ? /* @__PURE__ */ jsxs3(
|
|
617
721
|
motion2.div,
|
|
618
722
|
{
|
|
619
723
|
initial: { opacity: 0, y: 6, scale: 0.99 },
|
|
@@ -625,7 +729,7 @@ function CommandPalette({
|
|
|
625
729
|
"rounded-og-lg border border-og-border bg-og-surface-2 shadow-og-sm"
|
|
626
730
|
),
|
|
627
731
|
children: [
|
|
628
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ jsx3(
|
|
629
733
|
"ul",
|
|
630
734
|
{
|
|
631
735
|
id: listboxId,
|
|
@@ -635,7 +739,7 @@ function CommandPalette({
|
|
|
635
739
|
children: items.map((command, index) => {
|
|
636
740
|
const selected = index === highlight;
|
|
637
741
|
const hint = argHint(command.args);
|
|
638
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ jsxs3(
|
|
639
743
|
"li",
|
|
640
744
|
{
|
|
641
745
|
id: `${listboxId}-option-${index}`,
|
|
@@ -652,8 +756,8 @@ function CommandPalette({
|
|
|
652
756
|
selected ? "bg-og-accent/15 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3"
|
|
653
757
|
),
|
|
654
758
|
children: [
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
|
|
760
|
+
/* @__PURE__ */ jsxs3(
|
|
657
761
|
"span",
|
|
658
762
|
{
|
|
659
763
|
className: cn(
|
|
@@ -666,11 +770,11 @@ function CommandPalette({
|
|
|
666
770
|
]
|
|
667
771
|
}
|
|
668
772
|
),
|
|
669
|
-
hint ? /* @__PURE__ */
|
|
773
|
+
hint ? /* @__PURE__ */ jsx3("span", { className: "truncate font-mono text-[11px] text-og-fg-subtle", children: hint }) : null
|
|
670
774
|
] }),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
command.danger ? /* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ jsxs3("span", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
776
|
+
command.danger ? /* @__PURE__ */ jsx3("span", { className: "rounded-og-xs bg-og-status-failed/15 px-1 text-[10px] uppercase tracking-wide text-og-status-failed", children: dangerLabel }) : null,
|
|
777
|
+
/* @__PURE__ */ jsx3("span", { className: "og-command-description truncate text-[12px] text-og-fg-subtle max-sm:hidden", children: command.description })
|
|
674
778
|
] })
|
|
675
779
|
]
|
|
676
780
|
},
|
|
@@ -679,7 +783,7 @@ function CommandPalette({
|
|
|
679
783
|
})
|
|
680
784
|
}
|
|
681
785
|
),
|
|
682
|
-
argHintText ? /* @__PURE__ */
|
|
786
|
+
argHintText ? /* @__PURE__ */ jsx3("div", { className: "border-t border-og-border px-3 py-1.5 font-mono text-[11px] text-og-fg-subtle", children: argHintText }) : null
|
|
683
787
|
]
|
|
684
788
|
}
|
|
685
789
|
) : null });
|
|
@@ -687,8 +791,8 @@ function CommandPalette({
|
|
|
687
791
|
|
|
688
792
|
// src/components/model-picker.tsx
|
|
689
793
|
import { ChevronDownIcon } from "lucide-react";
|
|
690
|
-
import { useId, useMemo as
|
|
691
|
-
import { jsx as
|
|
794
|
+
import { useId, useMemo as useMemo4 } from "react";
|
|
795
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
692
796
|
var EMPTY_CLIENT_MODELS = [];
|
|
693
797
|
function isCodexClientModel(model) {
|
|
694
798
|
return model.id.startsWith("codex/") || model.source === "codex";
|
|
@@ -733,22 +837,22 @@ function ModelPicker({
|
|
|
733
837
|
codexOnly = false
|
|
734
838
|
}) {
|
|
735
839
|
const selectId = useId();
|
|
736
|
-
const effectiveRows =
|
|
840
|
+
const effectiveRows = useMemo4(
|
|
737
841
|
() => rows && rows.length > 0 ? applyCodexOnlyRows(rows, codexOnly) : [],
|
|
738
842
|
[rows, codexOnly]
|
|
739
843
|
);
|
|
740
|
-
const billingGroups =
|
|
844
|
+
const billingGroups = useMemo4(
|
|
741
845
|
() => effectiveRows.length > 0 ? groupPickerRowsByBillingClass(effectiveRows) : [],
|
|
742
846
|
[effectiveRows]
|
|
743
847
|
);
|
|
744
|
-
const providerGroupList =
|
|
848
|
+
const providerGroupList = useMemo4(() => providerGroups(models, codexOnly), [models, codexOnly]);
|
|
745
849
|
const useBillingGroups = Boolean(effectiveRows.length);
|
|
746
850
|
if (models.length === 0 && effectiveRows.length === 0) {
|
|
747
851
|
return null;
|
|
748
852
|
}
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ jsxs4("span", { className: cn("relative inline-flex items-center", className), children: [
|
|
854
|
+
/* @__PURE__ */ jsx4("label", { htmlFor: selectId, className: "sr-only", children: label }),
|
|
855
|
+
/* @__PURE__ */ jsx4(
|
|
752
856
|
"select",
|
|
753
857
|
{
|
|
754
858
|
id: selectId,
|
|
@@ -763,10 +867,10 @@ function ModelPicker({
|
|
|
763
867
|
"focus:outline-hidden focus-visible:outline-hidden",
|
|
764
868
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
765
869
|
),
|
|
766
|
-
children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */
|
|
870
|
+
children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */ jsx4("optgroup", { label: group.label, children: group.rows.map((row) => /* @__PURE__ */ jsx4("option", { value: row.id, disabled: !row.selectable, children: row.unavailableReason ? `${row.label} (${row.unavailableReason})` : row.label }, row.id)) }, group.billingClass)) : providerGroupList.map((group) => /* @__PURE__ */ jsx4("optgroup", { label: group.label, children: group.models.map((model) => /* @__PURE__ */ jsx4("option", { value: model.id, disabled: model.optionDisabled, children: model.label }, model.id)) }, group.label))
|
|
767
871
|
}
|
|
768
872
|
),
|
|
769
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ jsx4(
|
|
770
874
|
ChevronDownIcon,
|
|
771
875
|
{
|
|
772
876
|
"aria-hidden": true,
|
|
@@ -792,18 +896,18 @@ import {
|
|
|
792
896
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
|
|
793
897
|
import {
|
|
794
898
|
cloneElement,
|
|
795
|
-
createContext as
|
|
899
|
+
createContext as createContext3,
|
|
796
900
|
forwardRef,
|
|
797
901
|
useCallback as useCallback3,
|
|
798
|
-
useContext as
|
|
902
|
+
useContext as useContext3,
|
|
799
903
|
useEffect as useEffect2,
|
|
800
904
|
useId as useId2,
|
|
801
|
-
useLayoutEffect,
|
|
802
|
-
useMemo as
|
|
803
|
-
useRef as
|
|
804
|
-
useState as
|
|
905
|
+
useLayoutEffect as useLayoutEffect2,
|
|
906
|
+
useMemo as useMemo5,
|
|
907
|
+
useRef as useRef3,
|
|
908
|
+
useState as useState4
|
|
805
909
|
} from "react";
|
|
806
|
-
import { Fragment as Fragment2, jsx as
|
|
910
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
807
911
|
function ComposerTip({
|
|
808
912
|
tip,
|
|
809
913
|
children
|
|
@@ -827,6 +931,7 @@ var defaultChatComposerMessages = {
|
|
|
827
931
|
sendAndResumeAriaLabel: "Add message to queue",
|
|
828
932
|
sendTitle: "Queue message (Enter); steer with Cmd/Ctrl+Enter",
|
|
829
933
|
sendAndResumeTitle: "Add to queue (Enter); steer now with Cmd/Ctrl+Enter",
|
|
934
|
+
annotationNotesRequired: "Add a note to each quote before sending.",
|
|
830
935
|
workspacePaused: "Workspace paused",
|
|
831
936
|
pausedHere: "Paused here",
|
|
832
937
|
parentBlocker: "parent",
|
|
@@ -951,28 +1056,28 @@ function useChatComposerController({
|
|
|
951
1056
|
onPaste,
|
|
952
1057
|
messages: messageOverrides
|
|
953
1058
|
}) {
|
|
954
|
-
const messages =
|
|
1059
|
+
const messages = useMemo5(
|
|
955
1060
|
() => ({ ...defaultChatComposerMessages, ...messageOverrides }),
|
|
956
1061
|
[messageOverrides]
|
|
957
1062
|
);
|
|
958
1063
|
const id = useId2();
|
|
959
|
-
const rootRef =
|
|
960
|
-
const textareaRef =
|
|
961
|
-
const pauseButtonRef =
|
|
962
|
-
const fileInputRef =
|
|
1064
|
+
const rootRef = useRef3(null);
|
|
1065
|
+
const textareaRef = useRef3(null);
|
|
1066
|
+
const pauseButtonRef = useRef3(null);
|
|
1067
|
+
const fileInputRef = useRef3(null);
|
|
963
1068
|
const listboxId = useId2();
|
|
964
1069
|
const paused = effectiveControl?.state === "paused";
|
|
965
|
-
const [controlDetailsOpen, setControlDetailsOpen] =
|
|
966
|
-
const [paletteMounted, setPaletteMounted] =
|
|
967
|
-
const [submitting, setSubmitting] =
|
|
968
|
-
const submittingRef =
|
|
969
|
-
const controlOperationRef =
|
|
1070
|
+
const [controlDetailsOpen, setControlDetailsOpen] = useState4(false);
|
|
1071
|
+
const [paletteMounted, setPaletteMounted] = useState4(false);
|
|
1072
|
+
const [submitting, setSubmitting] = useState4(false);
|
|
1073
|
+
const submittingRef = useRef3(false);
|
|
1074
|
+
const controlOperationRef = useRef3(false);
|
|
970
1075
|
const deliveryValue = delivery.value;
|
|
971
1076
|
const setDeliveryValue = delivery.setValue;
|
|
972
|
-
const mountedRef =
|
|
973
|
-
const deliveredValueRef =
|
|
974
|
-
const liveValueRef =
|
|
975
|
-
const [renderedValue, setRenderedValue] =
|
|
1077
|
+
const mountedRef = useRef3(true);
|
|
1078
|
+
const deliveredValueRef = useRef3(deliveryValue);
|
|
1079
|
+
const liveValueRef = useRef3(deliveryValue);
|
|
1080
|
+
const [renderedValue, setRenderedValue] = useState4(deliveryValue);
|
|
976
1081
|
const deliveryChanged = deliveryValue !== deliveredValueRef.current;
|
|
977
1082
|
if (deliveryChanged) {
|
|
978
1083
|
deliveredValueRef.current = deliveryValue;
|
|
@@ -987,7 +1092,7 @@ function useChatComposerController({
|
|
|
987
1092
|
[setDeliveryValue]
|
|
988
1093
|
);
|
|
989
1094
|
const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
|
|
990
|
-
|
|
1095
|
+
useLayoutEffect2(() => {
|
|
991
1096
|
if (renderedValue !== liveValueRef.current) {
|
|
992
1097
|
setRenderedValue(liveValueRef.current);
|
|
993
1098
|
}
|
|
@@ -1018,7 +1123,7 @@ function useChatComposerController({
|
|
|
1018
1123
|
}, [id, paused]);
|
|
1019
1124
|
const blockedByAttachment = attachments?.hasUnresolved === true;
|
|
1020
1125
|
const hasReadyAttachment = (attachments?.readyResources.length ?? 0) > 0;
|
|
1021
|
-
const [dragging, setDragging] =
|
|
1126
|
+
const [dragging, setDragging] = useState4(false);
|
|
1022
1127
|
const dragCarriesFiles = (event) => event.dataTransfer !== null && [...event.dataTransfer.types].includes("Files");
|
|
1023
1128
|
const handleDragOver = useCallback3(
|
|
1024
1129
|
(event) => {
|
|
@@ -1045,10 +1150,10 @@ function useChatComposerController({
|
|
|
1045
1150
|
},
|
|
1046
1151
|
[attachments]
|
|
1047
1152
|
);
|
|
1048
|
-
const [notice, setNotice] =
|
|
1049
|
-
const [helpOpen, setHelpOpen] =
|
|
1050
|
-
const [confirmState, setConfirmState] =
|
|
1051
|
-
const pendingConfirm =
|
|
1153
|
+
const [notice, setNotice] = useState4(null);
|
|
1154
|
+
const [helpOpen, setHelpOpen] = useState4(false);
|
|
1155
|
+
const [confirmState, setConfirmState] = useState4(null);
|
|
1156
|
+
const pendingConfirm = useRef3(null);
|
|
1052
1157
|
const settleConfirmation = useCallback3((confirmed) => {
|
|
1053
1158
|
const resolve = pendingConfirm.current;
|
|
1054
1159
|
pendingConfirm.current = null;
|
|
@@ -1062,7 +1167,7 @@ function useChatComposerController({
|
|
|
1062
1167
|
},
|
|
1063
1168
|
[]
|
|
1064
1169
|
);
|
|
1065
|
-
const resizeInputRafRef =
|
|
1170
|
+
const resizeInputRafRef = useRef3(null);
|
|
1066
1171
|
const resizeInput = useCallback3(() => {
|
|
1067
1172
|
if (resizeInputRafRef.current !== null) {
|
|
1068
1173
|
return;
|
|
@@ -1086,7 +1191,7 @@ function useChatComposerController({
|
|
|
1086
1191
|
},
|
|
1087
1192
|
[]
|
|
1088
1193
|
);
|
|
1089
|
-
const handlers =
|
|
1194
|
+
const handlers = useMemo5(
|
|
1090
1195
|
() => ({
|
|
1091
1196
|
notice: (next) => {
|
|
1092
1197
|
setNotice(next);
|
|
@@ -1115,7 +1220,10 @@ function useChatComposerController({
|
|
|
1115
1220
|
});
|
|
1116
1221
|
const paletteEnabled = commandContext !== void 0;
|
|
1117
1222
|
const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
|
|
1118
|
-
const
|
|
1223
|
+
const annotationsIncomplete = (delivery.annotations ?? []).some(
|
|
1224
|
+
(annotation) => annotation.note.trim().length === 0
|
|
1225
|
+
);
|
|
1226
|
+
const submitBlocker = disabled ? "disabled" : blockedByAttachment ? "attachment" : delivery.sending || submitting ? "sending" : commandDraftBlocked ? "command" : annotationsIncomplete ? "annotations" : delivery.canSend || hasReadyAttachment ? null : "empty";
|
|
1119
1227
|
const canSubmit = submitBlocker === null;
|
|
1120
1228
|
const submit = useCallback3(
|
|
1121
1229
|
async (mode) => {
|
|
@@ -1126,6 +1234,12 @@ function useChatComposerController({
|
|
|
1126
1234
|
}
|
|
1127
1235
|
if (disabled || blockedByAttachment || delivery.sending || submittingRef.current)
|
|
1128
1236
|
return false;
|
|
1237
|
+
if (annotationsIncomplete) {
|
|
1238
|
+
setNotice({ tone: "error", message: messages.annotationNotesRequired });
|
|
1239
|
+
delivery.clearError();
|
|
1240
|
+
delivery.requestAnnotationReview?.();
|
|
1241
|
+
return false;
|
|
1242
|
+
}
|
|
1129
1243
|
if (!delivery.canSend && !hasReadyAttachment) return false;
|
|
1130
1244
|
submittingRef.current = true;
|
|
1131
1245
|
setSubmitting(true);
|
|
@@ -1137,11 +1251,13 @@ function useChatComposerController({
|
|
|
1137
1251
|
}
|
|
1138
1252
|
},
|
|
1139
1253
|
[
|
|
1254
|
+
annotationsIncomplete,
|
|
1140
1255
|
blockedByAttachment,
|
|
1141
1256
|
commandDraftBlocked,
|
|
1142
1257
|
delivery,
|
|
1143
1258
|
disabled,
|
|
1144
1259
|
hasReadyAttachment,
|
|
1260
|
+
messages.annotationNotesRequired,
|
|
1145
1261
|
messages.slashCommandBlocked
|
|
1146
1262
|
]
|
|
1147
1263
|
);
|
|
@@ -1168,7 +1284,7 @@ function useChatComposerController({
|
|
|
1168
1284
|
},
|
|
1169
1285
|
[attachments]
|
|
1170
1286
|
);
|
|
1171
|
-
const helpCommands =
|
|
1287
|
+
const helpCommands = useMemo5(
|
|
1172
1288
|
() => commands.filter((command) => {
|
|
1173
1289
|
if (command.permission && commandContext) {
|
|
1174
1290
|
const permissions = commandContext.permissions;
|
|
@@ -1190,6 +1306,12 @@ function useChatComposerController({
|
|
|
1190
1306
|
);
|
|
1191
1307
|
return () => window.clearTimeout(timer);
|
|
1192
1308
|
}, [notice]);
|
|
1309
|
+
useEffect2(() => {
|
|
1310
|
+
if (annotationsIncomplete) return;
|
|
1311
|
+
setNotice(
|
|
1312
|
+
(current) => current?.message === messages.annotationNotesRequired ? null : current
|
|
1313
|
+
);
|
|
1314
|
+
}, [annotationsIncomplete, messages.annotationNotesRequired]);
|
|
1193
1315
|
const runControlOperation = useCallback3(async (operation) => {
|
|
1194
1316
|
if (controlOperationRef.current) return false;
|
|
1195
1317
|
controlOperationRef.current = true;
|
|
@@ -1279,9 +1401,9 @@ function useChatComposerController({
|
|
|
1279
1401
|
value: visibleValue
|
|
1280
1402
|
};
|
|
1281
1403
|
}
|
|
1282
|
-
var ComposerContext =
|
|
1404
|
+
var ComposerContext = createContext3(null);
|
|
1283
1405
|
function useComposerController() {
|
|
1284
|
-
const controller =
|
|
1406
|
+
const controller = useContext3(ComposerContext);
|
|
1285
1407
|
if (!controller) throw new Error("useChatComposer must be used inside <Composer.Root>");
|
|
1286
1408
|
return controller;
|
|
1287
1409
|
}
|
|
@@ -1292,12 +1414,12 @@ function isRecord(value) {
|
|
|
1292
1414
|
return typeof value === "object" && value !== null;
|
|
1293
1415
|
}
|
|
1294
1416
|
var Root = forwardRef(function ComposerRoot({ controller, children, className, style, responsiveBasis = "viewport", ...props }, forwardedRef) {
|
|
1295
|
-
const responsiveRootRef =
|
|
1296
|
-
const responsiveContext =
|
|
1417
|
+
const responsiveRootRef = useRef3(null);
|
|
1418
|
+
const responsiveContext = useMemo5(
|
|
1297
1419
|
() => ({ responsiveBasis, rootRef: responsiveRootRef }),
|
|
1298
1420
|
[responsiveBasis]
|
|
1299
1421
|
);
|
|
1300
|
-
return /* @__PURE__ */
|
|
1422
|
+
return /* @__PURE__ */ jsx5(ComposerContext.Provider, { value: controller, children: /* @__PURE__ */ jsx5(ComposerResponsiveContext.Provider, { value: responsiveContext, children: /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs5(
|
|
1301
1423
|
"div",
|
|
1302
1424
|
{
|
|
1303
1425
|
...props,
|
|
@@ -1308,13 +1430,13 @@ var Root = forwardRef(function ComposerRoot({ controller, children, className, s
|
|
|
1308
1430
|
style: { paddingBottom: "env(safe-area-inset-bottom)", ...style },
|
|
1309
1431
|
children: [
|
|
1310
1432
|
children,
|
|
1311
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ jsx5(ComposerAnnouncements, {})
|
|
1312
1434
|
]
|
|
1313
1435
|
}
|
|
1314
1436
|
) }) }) });
|
|
1315
1437
|
});
|
|
1316
1438
|
var Frame = forwardRef(function ComposerFrame({ className, ...props }, ref) {
|
|
1317
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ jsx5("div", { ...props, ref, className: cn("relative", className) });
|
|
1318
1440
|
});
|
|
1319
1441
|
function CommandPalette2({ className }) {
|
|
1320
1442
|
const controller = useComposerController();
|
|
@@ -1324,7 +1446,7 @@ function CommandPalette2({ className }) {
|
|
|
1324
1446
|
return () => setPaletteMounted(false);
|
|
1325
1447
|
}, [setPaletteMounted]);
|
|
1326
1448
|
if (!controller.paletteEnabled) return null;
|
|
1327
|
-
return /* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ jsx5("div", { className, children: /* @__PURE__ */ jsx5(
|
|
1328
1450
|
CommandPalette,
|
|
1329
1451
|
{
|
|
1330
1452
|
open: controller.palette.open && controller.confirmState === null,
|
|
@@ -1344,7 +1466,7 @@ function CommandPalette2({ className }) {
|
|
|
1344
1466
|
}
|
|
1345
1467
|
var Surface = forwardRef(function ComposerSurface({ className, children, ...props }, ref) {
|
|
1346
1468
|
const controller = useComposerController();
|
|
1347
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ jsxs5(
|
|
1348
1470
|
"div",
|
|
1349
1471
|
{
|
|
1350
1472
|
...props,
|
|
@@ -1360,7 +1482,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1360
1482
|
className
|
|
1361
1483
|
),
|
|
1362
1484
|
children: [
|
|
1363
|
-
controller.dragging ? /* @__PURE__ */
|
|
1485
|
+
controller.dragging ? /* @__PURE__ */ jsx5(
|
|
1364
1486
|
"div",
|
|
1365
1487
|
{
|
|
1366
1488
|
"aria-hidden": true,
|
|
@@ -1368,8 +1490,8 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1368
1490
|
"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
1369
1491
|
"rounded-og-lg bg-og-surface-1/85 text-og-menu font-medium text-og-accent backdrop-blur-[1px]"
|
|
1370
1492
|
),
|
|
1371
|
-
children: /* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1493
|
+
children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex items-center gap-2", children: [
|
|
1494
|
+
/* @__PURE__ */ jsx5(PaperclipIcon, { className: "size-4" }),
|
|
1373
1495
|
controller.messages.dropFiles
|
|
1374
1496
|
] })
|
|
1375
1497
|
}
|
|
@@ -1382,7 +1504,7 @@ var Surface = forwardRef(function ComposerSurface({ className, children, ...prop
|
|
|
1382
1504
|
function PausedState() {
|
|
1383
1505
|
const controller = useComposerController();
|
|
1384
1506
|
if (!controller.paused || !controller.effectiveControl || !controller.hasControl) return null;
|
|
1385
|
-
return /* @__PURE__ */
|
|
1507
|
+
return /* @__PURE__ */ jsx5(
|
|
1386
1508
|
WorkstreamPausedStrip,
|
|
1387
1509
|
{
|
|
1388
1510
|
control: controller.effectiveControl,
|
|
@@ -1402,7 +1524,7 @@ function PausedState() {
|
|
|
1402
1524
|
function RestoredResources() {
|
|
1403
1525
|
const controller = useComposerController();
|
|
1404
1526
|
if (controller.restoredResources.length === 0 || !controller.removeRestoredResource) return null;
|
|
1405
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ jsx5(
|
|
1406
1528
|
RestoredResourceChips,
|
|
1407
1529
|
{
|
|
1408
1530
|
resources: controller.restoredResources,
|
|
@@ -1414,7 +1536,7 @@ function RestoredResources() {
|
|
|
1414
1536
|
function Attachments() {
|
|
1415
1537
|
const controller = useComposerController();
|
|
1416
1538
|
if (!controller.attachments || controller.attachments.attachments.length === 0) return null;
|
|
1417
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ jsx5(
|
|
1418
1540
|
AttachmentChips,
|
|
1419
1541
|
{
|
|
1420
1542
|
attachments: controller.attachments.attachments,
|
|
@@ -1428,7 +1550,7 @@ function Attachments() {
|
|
|
1428
1550
|
}
|
|
1429
1551
|
var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className, "aria-label": ariaLabel, autoFocus = false, ...props }, forwardedRef) {
|
|
1430
1552
|
const controller = useComposerController();
|
|
1431
|
-
const autoFocusedRef =
|
|
1553
|
+
const autoFocusedRef = useRef3(false);
|
|
1432
1554
|
const paletteOpen = controller.paletteEnabled && controller.paletteMounted && controller.palette.open;
|
|
1433
1555
|
useEffect2(() => {
|
|
1434
1556
|
if (!autoFocus || controller.disabled || autoFocusedRef.current) return;
|
|
@@ -1440,7 +1562,7 @@ var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className
|
|
|
1440
1562
|
});
|
|
1441
1563
|
return () => window.cancelAnimationFrame(frame);
|
|
1442
1564
|
}, [autoFocus, controller.disabled, controller.textareaRef]);
|
|
1443
|
-
return /* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ jsx5(
|
|
1444
1566
|
"textarea",
|
|
1445
1567
|
{
|
|
1446
1568
|
...props,
|
|
@@ -1471,7 +1593,7 @@ function Confirmation() {
|
|
|
1471
1593
|
const controller = useComposerController();
|
|
1472
1594
|
const command = controller.confirmState?.command;
|
|
1473
1595
|
if (!command || !controller.confirmState) return null;
|
|
1474
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ jsx5(
|
|
1475
1597
|
ConfirmBar,
|
|
1476
1598
|
{
|
|
1477
1599
|
command,
|
|
@@ -1483,7 +1605,7 @@ function Confirmation() {
|
|
|
1483
1605
|
);
|
|
1484
1606
|
}
|
|
1485
1607
|
var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
1486
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ jsx5(
|
|
1487
1609
|
"div",
|
|
1488
1610
|
{
|
|
1489
1611
|
...props,
|
|
@@ -1499,7 +1621,7 @@ var Footer = forwardRef(function ComposerFooter({ className, ...props }, ref) {
|
|
|
1499
1621
|
});
|
|
1500
1622
|
var Controls = forwardRef(
|
|
1501
1623
|
function ComposerControls({ className, ...props }, ref) {
|
|
1502
|
-
return /* @__PURE__ */
|
|
1624
|
+
return /* @__PURE__ */ jsx5(
|
|
1503
1625
|
"span",
|
|
1504
1626
|
{
|
|
1505
1627
|
...props,
|
|
@@ -1515,7 +1637,7 @@ var Controls = forwardRef(
|
|
|
1515
1637
|
);
|
|
1516
1638
|
var Hint = forwardRef(function ComposerHint({ className, children, ...props }, ref) {
|
|
1517
1639
|
const controller = useComposerController();
|
|
1518
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ jsx5(
|
|
1519
1641
|
"span",
|
|
1520
1642
|
{
|
|
1521
1643
|
...props,
|
|
@@ -1529,7 +1651,7 @@ var Hint = forwardRef(function ComposerHint({ className, children, ...props }, r
|
|
|
1529
1651
|
);
|
|
1530
1652
|
});
|
|
1531
1653
|
var Actions = forwardRef(function ComposerActions({ className, ...props }, ref) {
|
|
1532
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx5(
|
|
1533
1655
|
"span",
|
|
1534
1656
|
{
|
|
1535
1657
|
...props,
|
|
@@ -1547,8 +1669,8 @@ var AttachButton = forwardRef(
|
|
|
1547
1669
|
const controller = useComposerController();
|
|
1548
1670
|
if (!controller.attachments) return null;
|
|
1549
1671
|
const tip = title ?? controller.messages.attachFiles;
|
|
1550
|
-
return /* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1673
|
+
/* @__PURE__ */ jsx5(
|
|
1552
1674
|
"input",
|
|
1553
1675
|
{
|
|
1554
1676
|
ref: controller.fileInputRef,
|
|
@@ -1560,7 +1682,7 @@ var AttachButton = forwardRef(
|
|
|
1560
1682
|
onChange: controller.handleFileChange
|
|
1561
1683
|
}
|
|
1562
1684
|
),
|
|
1563
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx5(ComposerTip, { tip, children: /* @__PURE__ */ jsx5(
|
|
1564
1686
|
"button",
|
|
1565
1687
|
{
|
|
1566
1688
|
...props,
|
|
@@ -1575,7 +1697,7 @@ var AttachButton = forwardRef(
|
|
|
1575
1697
|
"disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11",
|
|
1576
1698
|
className
|
|
1577
1699
|
),
|
|
1578
|
-
children: children ?? /* @__PURE__ */
|
|
1700
|
+
children: children ?? /* @__PURE__ */ jsx5(PaperclipIcon, { className: "size-4" })
|
|
1579
1701
|
}
|
|
1580
1702
|
) })
|
|
1581
1703
|
] });
|
|
@@ -1591,7 +1713,7 @@ function ModelPicker2({
|
|
|
1591
1713
|
codexOnly
|
|
1592
1714
|
}) {
|
|
1593
1715
|
const controller = useComposerController();
|
|
1594
|
-
return /* @__PURE__ */
|
|
1716
|
+
return /* @__PURE__ */ jsx5(
|
|
1595
1717
|
ModelPicker,
|
|
1596
1718
|
{
|
|
1597
1719
|
models,
|
|
@@ -1611,7 +1733,7 @@ var PauseButton = forwardRef(
|
|
|
1611
1733
|
if (!controller.effectiveControl || controller.paused || !controller.hasControl) return null;
|
|
1612
1734
|
const busy = controller.pausing || controller.resuming;
|
|
1613
1735
|
const tip = title ?? controller.messages.pauseTitle;
|
|
1614
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ jsx5(ComposerTip, { tip, children: /* @__PURE__ */ jsx5(
|
|
1615
1737
|
"button",
|
|
1616
1738
|
{
|
|
1617
1739
|
...props,
|
|
@@ -1627,7 +1749,7 @@ var PauseButton = forwardRef(
|
|
|
1627
1749
|
"disabled:opacity-50",
|
|
1628
1750
|
className
|
|
1629
1751
|
),
|
|
1630
|
-
children: children ?? (busy ? /* @__PURE__ */
|
|
1752
|
+
children: children ?? (busy ? /* @__PURE__ */ jsx5(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx5(PauseIcon, { className: "size-3.5 fill-current" }))
|
|
1631
1753
|
}
|
|
1632
1754
|
) });
|
|
1633
1755
|
}
|
|
@@ -1635,8 +1757,8 @@ var PauseButton = forwardRef(
|
|
|
1635
1757
|
var SendButton = forwardRef(
|
|
1636
1758
|
function ComposerSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
|
|
1637
1759
|
const controller = useComposerController();
|
|
1638
|
-
const tip = title ?? (controller.paused ? controller.messages.sendAndResumeTitle : controller.messages.sendTitle);
|
|
1639
|
-
return /* @__PURE__ */
|
|
1760
|
+
const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : controller.paused ? controller.messages.sendAndResumeTitle : controller.messages.sendTitle);
|
|
1761
|
+
return /* @__PURE__ */ jsx5(ComposerTip, { tip, children: /* @__PURE__ */ jsx5(
|
|
1640
1762
|
"button",
|
|
1641
1763
|
{
|
|
1642
1764
|
...props,
|
|
@@ -1654,14 +1776,14 @@ var SendButton = forwardRef(
|
|
|
1654
1776
|
"disabled:cursor-not-allowed disabled:bg-og-surface-3 disabled:text-og-fg-subtle disabled:shadow-none",
|
|
1655
1777
|
className
|
|
1656
1778
|
),
|
|
1657
|
-
children: children ?? (controller.sending ? /* @__PURE__ */
|
|
1779
|
+
children: children ?? (controller.sending ? /* @__PURE__ */ jsx5(LoaderCircleIcon, { className: "size-4 animate-og-spin" }) : /* @__PURE__ */ jsx5(ArrowUpIcon, { className: "size-4" }))
|
|
1658
1780
|
}
|
|
1659
1781
|
) });
|
|
1660
1782
|
}
|
|
1661
1783
|
);
|
|
1662
1784
|
function Help() {
|
|
1663
1785
|
const controller = useComposerController();
|
|
1664
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ jsx5(AnimatePresence3, { children: controller.helpOpen ? /* @__PURE__ */ jsx5(
|
|
1665
1787
|
HelpPanel,
|
|
1666
1788
|
{
|
|
1667
1789
|
commands: controller.helpCommands,
|
|
@@ -1672,8 +1794,8 @@ function Help() {
|
|
|
1672
1794
|
}
|
|
1673
1795
|
function Status() {
|
|
1674
1796
|
const controller = useComposerController();
|
|
1675
|
-
return /* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1798
|
+
/* @__PURE__ */ jsx5(AnimatePresence3, { children: controller.activeNotice ? /* @__PURE__ */ jsx5(
|
|
1677
1799
|
motion3.p,
|
|
1678
1800
|
{
|
|
1679
1801
|
initial: { opacity: 0, height: 0 },
|
|
@@ -1686,9 +1808,9 @@ function Status() {
|
|
|
1686
1808
|
children: controller.activeNotice.message
|
|
1687
1809
|
}
|
|
1688
1810
|
) : null }),
|
|
1689
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1811
|
+
controller.draftConflict ? /* @__PURE__ */ jsxs5("div", { className: "mt-1.5 flex flex-wrap items-center gap-2 px-1 text-og-xs text-og-status-failed", children: [
|
|
1812
|
+
/* @__PURE__ */ jsx5("span", { className: "min-w-0 flex-1", children: controller.messages.draftConflict }),
|
|
1813
|
+
/* @__PURE__ */ jsx5(
|
|
1692
1814
|
"button",
|
|
1693
1815
|
{
|
|
1694
1816
|
type: "button",
|
|
@@ -1697,7 +1819,7 @@ function Status() {
|
|
|
1697
1819
|
children: controller.messages.useOtherDraft
|
|
1698
1820
|
}
|
|
1699
1821
|
),
|
|
1700
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ jsx5(
|
|
1701
1823
|
"button",
|
|
1702
1824
|
{
|
|
1703
1825
|
type: "button",
|
|
@@ -1711,9 +1833,9 @@ function Status() {
|
|
|
1711
1833
|
}
|
|
1712
1834
|
function ComposerAnnouncements() {
|
|
1713
1835
|
const controller = useComposerController();
|
|
1714
|
-
return /* @__PURE__ */
|
|
1715
|
-
controller.activeNotice ? /* @__PURE__ */
|
|
1716
|
-
controller.draftConflict ? /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ jsxs5("div", { className: "sr-only", children: [
|
|
1837
|
+
controller.activeNotice ? /* @__PURE__ */ jsx5("p", { role: controller.activeNotice.tone === "error" ? "alert" : "status", children: controller.activeNotice.message }) : null,
|
|
1838
|
+
controller.draftConflict ? /* @__PURE__ */ jsx5("p", { role: "alert", children: controller.messages.draftConflict }) : null
|
|
1717
1839
|
] });
|
|
1718
1840
|
}
|
|
1719
1841
|
function mergeRefs(...refs) {
|
|
@@ -1743,10 +1865,10 @@ function WorkstreamPausedStrip({
|
|
|
1743
1865
|
const broaderOptions = control.resumeOptions.filter(
|
|
1744
1866
|
(option) => option !== primary && option.scope !== "selected" && (option.scope !== "workspace" || canControlWorkspace)
|
|
1745
1867
|
);
|
|
1746
|
-
return /* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ jsxs5("div", { className: "border-b border-og-status-waiting/25 bg-og-status-waiting/[0.07]", children: [
|
|
1869
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 items-center gap-2 px-3 py-2", children: [
|
|
1870
|
+
/* @__PURE__ */ jsx5(PauseIcon, { className: "size-3.5 shrink-0 text-og-status-waiting" }),
|
|
1871
|
+
/* @__PURE__ */ jsxs5(
|
|
1750
1872
|
"button",
|
|
1751
1873
|
{
|
|
1752
1874
|
type: "button",
|
|
@@ -1754,12 +1876,12 @@ function WorkstreamPausedStrip({
|
|
|
1754
1876
|
onClick: () => onOpenChange(!open),
|
|
1755
1877
|
"aria-expanded": open,
|
|
1756
1878
|
children: [
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx5("span", { className: "block truncate text-og-xs font-medium text-og-fg", children: cause }),
|
|
1880
|
+
/* @__PURE__ */ jsx5("span", { className: "block truncate text-[11px] text-og-fg-muted", children: queuedAheadCount > 0 ? messages.queuedAhead(queuedAheadCount) : sending ? messages.resumingAndSending : messages.nextMessageResumes })
|
|
1759
1881
|
]
|
|
1760
1882
|
}
|
|
1761
1883
|
),
|
|
1762
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ jsxs5(
|
|
1763
1885
|
"button",
|
|
1764
1886
|
{
|
|
1765
1887
|
type: "button",
|
|
@@ -1768,47 +1890,47 @@ function WorkstreamPausedStrip({
|
|
|
1768
1890
|
disabled: busy,
|
|
1769
1891
|
onClick: onResume,
|
|
1770
1892
|
children: [
|
|
1771
|
-
busy ? /* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
/* @__PURE__ */
|
|
1893
|
+
busy ? /* @__PURE__ */ jsx5(LoaderCircleIcon, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx5(PlayIcon, { className: "size-3.5 fill-current" }),
|
|
1894
|
+
/* @__PURE__ */ jsx5("span", { className: "og-composer-resume-label-long hidden min-[400px]:inline", children: messages.resumeThisWorkstream }),
|
|
1895
|
+
/* @__PURE__ */ jsx5("span", { className: "og-composer-resume-label-short min-[400px]:hidden", children: messages.resumeShort })
|
|
1774
1896
|
]
|
|
1775
1897
|
}
|
|
1776
1898
|
),
|
|
1777
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsx5(
|
|
1778
1900
|
"button",
|
|
1779
1901
|
{
|
|
1780
1902
|
type: "button",
|
|
1781
1903
|
className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md text-og-fg-muted hover:bg-og-surface-2 pointer-coarse:size-11",
|
|
1782
1904
|
onClick: () => onOpenChange(!open),
|
|
1783
1905
|
"aria-label": open ? messages.hidePauseDetails : messages.showPauseDetails,
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1906
|
+
children: /* @__PURE__ */ jsx5(ChevronDownIcon2, { className: cn("size-3.5 transition-transform", open && "rotate-180") })
|
|
1785
1907
|
}
|
|
1786
1908
|
)
|
|
1787
1909
|
] }),
|
|
1788
|
-
open ? /* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1910
|
+
open ? /* @__PURE__ */ jsxs5("div", { className: "border-t border-og-status-waiting/20 px-3 pb-3 pt-2", children: [
|
|
1911
|
+
/* @__PURE__ */ jsx5("ul", { className: "grid gap-2", "aria-label": messages.pauseReasonsLabel, children: control.blockers.map((entry, index) => /* @__PURE__ */ jsxs5(
|
|
1790
1912
|
"li",
|
|
1791
1913
|
{
|
|
1792
1914
|
className: "text-og-xs",
|
|
1793
1915
|
children: [
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
blockerHref(entry, controlLinks) ? /* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ jsx5("span", { className: "font-medium text-og-fg", children: index === 0 ? messages.pausedByLabel : messages.alsoPausedByLabel }),
|
|
1917
|
+
blockerHref(entry, controlLinks) ? /* @__PURE__ */ jsx5(
|
|
1796
1918
|
"a",
|
|
1797
1919
|
{
|
|
1798
1920
|
href: blockerHref(entry, controlLinks),
|
|
1799
1921
|
className: "font-medium text-og-fg underline decoration-og-border-strong underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-ring/40",
|
|
1800
1922
|
children: entry.displayName
|
|
1801
1923
|
}
|
|
1802
|
-
) : /* @__PURE__ */
|
|
1803
|
-
entry.reason ? /* @__PURE__ */
|
|
1924
|
+
) : /* @__PURE__ */ jsx5("span", { className: "font-medium text-og-fg", children: entry.displayName }),
|
|
1925
|
+
entry.reason ? /* @__PURE__ */ jsxs5("span", { className: "text-og-fg-muted", children: [
|
|
1804
1926
|
" \xB7 ",
|
|
1805
1927
|
entry.reason
|
|
1806
1928
|
] }) : null,
|
|
1807
|
-
entry.actor ? /* @__PURE__ */
|
|
1929
|
+
entry.actor ? /* @__PURE__ */ jsxs5("span", { className: "text-og-fg-subtle", children: [
|
|
1808
1930
|
" \xB7 ",
|
|
1809
1931
|
entry.actor
|
|
1810
1932
|
] }) : null,
|
|
1811
|
-
entry.changedAt ? /* @__PURE__ */
|
|
1933
|
+
entry.changedAt ? /* @__PURE__ */ jsxs5("span", { className: "text-og-fg-subtle", children: [
|
|
1812
1934
|
" ",
|
|
1813
1935
|
"\xB7 ",
|
|
1814
1936
|
messages.formatRelativeTime(entry.changedAt)
|
|
@@ -1817,11 +1939,11 @@ function WorkstreamPausedStrip({
|
|
|
1817
1939
|
},
|
|
1818
1940
|
`${entry.kind}-${entry.sessionId ?? "workspace"}-${entry.revision}`
|
|
1819
1941
|
)) }),
|
|
1820
|
-
broaderOptions.length > 0 ? /* @__PURE__ */
|
|
1942
|
+
broaderOptions.length > 0 ? /* @__PURE__ */ jsx5("div", { className: "mt-2 flex flex-wrap gap-1.5", children: broaderOptions.map((option) => /* @__PURE__ */ jsx5(
|
|
1821
1943
|
ComposerTip,
|
|
1822
1944
|
{
|
|
1823
1945
|
tip: option.impactCopy,
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1946
|
+
children: /* @__PURE__ */ jsxs5(
|
|
1825
1947
|
"button",
|
|
1826
1948
|
{
|
|
1827
1949
|
type: "button",
|
|
@@ -1829,8 +1951,8 @@ function WorkstreamPausedStrip({
|
|
|
1829
1951
|
onClick: () => onResumeOption(option),
|
|
1830
1952
|
className: "rounded-og-md border border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-10",
|
|
1831
1953
|
children: [
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ jsx5("span", { className: "block font-medium", children: option.scope === "workspace" ? messages.resumeWorkspace : messages.resumeFromSession }),
|
|
1955
|
+
/* @__PURE__ */ jsx5("span", { className: "block text-[10px] text-og-fg-subtle", children: option.selectedStateAfter === "active" ? messages.sessionCanRun : messages.stillPausedBy(
|
|
1834
1956
|
option.remainingPrimaryBlocker?.displayName ?? messages.narrowerPause
|
|
1835
1957
|
) })
|
|
1836
1958
|
]
|
|
@@ -1851,26 +1973,26 @@ function RestoredResourceChips({
|
|
|
1851
1973
|
messages,
|
|
1852
1974
|
onRemove
|
|
1853
1975
|
}) {
|
|
1854
|
-
return /* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ jsx5(
|
|
1855
1977
|
"div",
|
|
1856
1978
|
{
|
|
1857
1979
|
className: "flex flex-wrap gap-1.5 border-b border-og-border px-3 py-2",
|
|
1858
1980
|
"aria-label": messages.restoredResourcesLabel,
|
|
1859
|
-
children: resources.map((resource, index) => /* @__PURE__ */
|
|
1981
|
+
children: resources.map((resource, index) => /* @__PURE__ */ jsxs5(
|
|
1860
1982
|
"span",
|
|
1861
1983
|
{
|
|
1862
1984
|
className: "inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-og-md border border-og-border bg-og-surface-2 px-2 py-1 text-og-xs text-og-fg-muted",
|
|
1863
1985
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx5(FileIcon, { className: "size-3 shrink-0" }),
|
|
1987
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate", children: resource.kind === "file" ? messages.restoredFile(resource.fileId) : resource.uri }),
|
|
1988
|
+
/* @__PURE__ */ jsx5(
|
|
1867
1989
|
"button",
|
|
1868
1990
|
{
|
|
1869
1991
|
type: "button",
|
|
1870
1992
|
className: "shrink-0 hover:text-og-fg",
|
|
1871
1993
|
onClick: () => onRemove(index),
|
|
1872
1994
|
"aria-label": messages.removeRestoredResource(index),
|
|
1873
|
-
children: /* @__PURE__ */
|
|
1995
|
+
children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-3" })
|
|
1874
1996
|
}
|
|
1875
1997
|
)
|
|
1876
1998
|
]
|
|
@@ -1887,14 +2009,14 @@ function ConfirmBar({
|
|
|
1887
2009
|
onConfirm,
|
|
1888
2010
|
returnFocusRef
|
|
1889
2011
|
}) {
|
|
1890
|
-
const confirmRef =
|
|
2012
|
+
const confirmRef = useRef3(null);
|
|
1891
2013
|
const descriptionId = useId2();
|
|
1892
2014
|
useEffect2(() => {
|
|
1893
2015
|
const returnTo = returnFocusRef?.current ?? null;
|
|
1894
2016
|
confirmRef.current?.focus();
|
|
1895
2017
|
return () => returnTo?.focus();
|
|
1896
2018
|
}, [returnFocusRef]);
|
|
1897
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ jsxs5(
|
|
1898
2020
|
"div",
|
|
1899
2021
|
{
|
|
1900
2022
|
role: "alertdialog",
|
|
@@ -1910,9 +2032,9 @@ function ConfirmBar({
|
|
|
1910
2032
|
},
|
|
1911
2033
|
className: "flex items-end justify-between gap-2 px-2.5 pb-2.5 pt-1",
|
|
1912
2034
|
children: [
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ jsx5("span", { id: descriptionId, className: "min-w-0 flex-1 px-1.5 text-og-sm text-og-status-failed", children: messages.confirmDescription(command) }),
|
|
2036
|
+
/* @__PURE__ */ jsxs5("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
2037
|
+
/* @__PURE__ */ jsx5(
|
|
1916
2038
|
"button",
|
|
1917
2039
|
{
|
|
1918
2040
|
type: "button",
|
|
@@ -1921,7 +2043,7 @@ function ConfirmBar({
|
|
|
1921
2043
|
children: messages.cancel
|
|
1922
2044
|
}
|
|
1923
2045
|
),
|
|
1924
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx5(
|
|
1925
2047
|
"button",
|
|
1926
2048
|
{
|
|
1927
2049
|
ref: confirmRef,
|
|
@@ -1945,9 +2067,9 @@ function AttachmentChips({
|
|
|
1945
2067
|
onLoadPreview
|
|
1946
2068
|
}) {
|
|
1947
2069
|
const lightbox = useLightboxOptional();
|
|
1948
|
-
const previewRequest =
|
|
1949
|
-
const [previewLoadingId, setPreviewLoadingId] =
|
|
1950
|
-
const [previewErrorId, setPreviewErrorId] =
|
|
2070
|
+
const previewRequest = useRef3(null);
|
|
2071
|
+
const [previewLoadingId, setPreviewLoadingId] = useState4(null);
|
|
2072
|
+
const [previewErrorId, setPreviewErrorId] = useState4(null);
|
|
1951
2073
|
useEffect2(() => () => previewRequest.current?.abort(), [onLoadPreview]);
|
|
1952
2074
|
async function openPreview(attachment, source, canLoadPreview) {
|
|
1953
2075
|
previewRequest.current?.abort();
|
|
@@ -1988,7 +2110,7 @@ function AttachmentChips({
|
|
|
1988
2110
|
releaseSource
|
|
1989
2111
|
);
|
|
1990
2112
|
}
|
|
1991
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsx5("div", { className: "flex flex-wrap gap-2 px-3 py-2", children: attachments.map((attachment) => {
|
|
1992
2114
|
const failed = attachment.status === "failed";
|
|
1993
2115
|
const secureContextRequired = attachment.errorCode === "secure_context_required";
|
|
1994
2116
|
const previewFailed = previewErrorId === attachment.id;
|
|
@@ -1997,7 +2119,7 @@ function AttachmentChips({
|
|
|
1997
2119
|
lightbox && onLoadPreview && attachment.status === "ready" && attachment.file && attachment.contentType.startsWith("image/")
|
|
1998
2120
|
);
|
|
1999
2121
|
const statusText = previewFailed ? messages.previewUnavailable ?? "Preview unavailable" : attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : messages.formatBytes(attachment.sizeBytes);
|
|
2000
|
-
return /* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ jsxs5(
|
|
2001
2123
|
"div",
|
|
2002
2124
|
{
|
|
2003
2125
|
className: cn(
|
|
@@ -2008,7 +2130,7 @@ function AttachmentChips({
|
|
|
2008
2130
|
) : "max-w-[240px] border-og-border bg-og-surface-2"
|
|
2009
2131
|
),
|
|
2010
2132
|
children: [
|
|
2011
|
-
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */
|
|
2133
|
+
lightbox && (attachment.previewUrl || canLoadPreview) ? /* @__PURE__ */ jsx5(
|
|
2012
2134
|
"button",
|
|
2013
2135
|
{
|
|
2014
2136
|
type: "button",
|
|
@@ -2020,46 +2142,46 @@ function AttachmentChips({
|
|
|
2020
2142
|
"aria-busy": previewLoading || void 0,
|
|
2021
2143
|
disabled: previewLoading,
|
|
2022
2144
|
onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
|
|
2023
|
-
children: attachment.previewUrl ? /* @__PURE__ */
|
|
2145
|
+
children: attachment.previewUrl ? /* @__PURE__ */ jsx5(
|
|
2024
2146
|
"img",
|
|
2025
2147
|
{
|
|
2026
2148
|
src: attachment.previewUrl,
|
|
2027
2149
|
alt: "",
|
|
2028
2150
|
className: "h-full w-full object-cover transition-opacity hover:opacity-80"
|
|
2029
2151
|
}
|
|
2030
|
-
) : previewLoading ? /* @__PURE__ */
|
|
2152
|
+
) : previewLoading ? /* @__PURE__ */ jsx5(LoaderCircleIcon, { className: "size-4 animate-og-spin text-og-fg-muted" }) : /* @__PURE__ */ jsx5(ImageIcon, { className: "size-4 text-og-fg-muted" })
|
|
2031
2153
|
}
|
|
2032
|
-
) : attachment.previewUrl ? /* @__PURE__ */
|
|
2154
|
+
) : attachment.previewUrl ? /* @__PURE__ */ jsx5(
|
|
2033
2155
|
"img",
|
|
2034
2156
|
{
|
|
2035
2157
|
src: attachment.previewUrl,
|
|
2036
2158
|
alt: "",
|
|
2037
2159
|
className: "size-8 shrink-0 rounded object-cover"
|
|
2038
2160
|
}
|
|
2039
|
-
) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
secureContextRequired ? /* @__PURE__ */
|
|
2161
|
+
) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */ jsx5(ImageIcon, { className: "size-4 shrink-0 text-og-fg-muted" }) : /* @__PURE__ */ jsx5(FileIcon, { className: "size-4 shrink-0 text-og-fg-muted" }),
|
|
2162
|
+
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
|
|
2163
|
+
/* @__PURE__ */ jsx5("div", { className: "truncate font-medium text-og-fg", children: attachment.name }),
|
|
2164
|
+
secureContextRequired ? /* @__PURE__ */ jsx5("div", { className: "break-words text-og-xs leading-4 text-og-status-failed", children: statusText }) : failed || previewFailed ? /* @__PURE__ */ jsx5(ComposerTip, { tip: statusText, children: /* @__PURE__ */ jsx5("div", { className: "truncate text-og-xs text-og-status-failed", children: statusText }) }) : /* @__PURE__ */ jsx5("div", { className: "truncate text-og-xs text-og-fg-subtle", children: statusText })
|
|
2043
2165
|
] }),
|
|
2044
|
-
attachment.status === "uploading" ? /* @__PURE__ */
|
|
2045
|
-
failed && !secureContextRequired && onRetry ? /* @__PURE__ */
|
|
2166
|
+
attachment.status === "uploading" ? /* @__PURE__ */ jsx5(LoaderCircleIcon, { className: "size-3.5 shrink-0 animate-og-spin" }) : null,
|
|
2167
|
+
failed && !secureContextRequired && onRetry ? /* @__PURE__ */ jsx5(ComposerTip, { tip: messages.retryUpload, children: /* @__PURE__ */ jsx5(
|
|
2046
2168
|
"button",
|
|
2047
2169
|
{
|
|
2048
2170
|
type: "button",
|
|
2049
2171
|
onClick: () => onRetry(attachment.id),
|
|
2050
2172
|
className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg pointer-coarse:size-10",
|
|
2051
2173
|
"aria-label": messages.retryAttachment(attachment.name),
|
|
2052
|
-
children: /* @__PURE__ */
|
|
2174
|
+
children: /* @__PURE__ */ jsx5(RotateCwIcon, { className: "size-3.5" })
|
|
2053
2175
|
}
|
|
2054
2176
|
) }) : null,
|
|
2055
|
-
/* @__PURE__ */
|
|
2177
|
+
/* @__PURE__ */ jsx5(
|
|
2056
2178
|
"button",
|
|
2057
2179
|
{
|
|
2058
2180
|
type: "button",
|
|
2059
2181
|
onClick: () => onRemove(attachment.id),
|
|
2060
2182
|
className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg pointer-coarse:size-10",
|
|
2061
2183
|
"aria-label": messages.removeAttachment(attachment.name),
|
|
2062
|
-
children: /* @__PURE__ */
|
|
2184
|
+
children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-3.5" })
|
|
2063
2185
|
}
|
|
2064
2186
|
)
|
|
2065
2187
|
]
|
|
@@ -2073,7 +2195,7 @@ function HelpPanel({
|
|
|
2073
2195
|
messages,
|
|
2074
2196
|
onClose
|
|
2075
2197
|
}) {
|
|
2076
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ jsxs5(
|
|
2077
2199
|
motion3.div,
|
|
2078
2200
|
{
|
|
2079
2201
|
initial: { opacity: 0, height: 0 },
|
|
@@ -2081,9 +2203,9 @@ function HelpPanel({
|
|
|
2081
2203
|
exit: { opacity: 0, height: 0 },
|
|
2082
2204
|
className: "mt-2 overflow-hidden rounded-og-lg border border-og-border bg-og-surface-2",
|
|
2083
2205
|
children: [
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between border-b border-og-border px-3 py-1.5", children: [
|
|
2207
|
+
/* @__PURE__ */ jsx5("span", { className: "text-og-sm font-medium text-og-fg", children: messages.commands }),
|
|
2208
|
+
/* @__PURE__ */ jsx5(
|
|
2087
2209
|
"button",
|
|
2088
2210
|
{
|
|
2089
2211
|
type: "button",
|
|
@@ -2093,16 +2215,16 @@ function HelpPanel({
|
|
|
2093
2215
|
}
|
|
2094
2216
|
)
|
|
2095
2217
|
] }),
|
|
2096
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ jsx5("ul", { className: "py-1", children: commands.map((command) => {
|
|
2097
2219
|
const hint = argHint(command.args);
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2220
|
+
return /* @__PURE__ */ jsxs5("li", { className: "flex items-baseline gap-2 px-3 py-1", children: [
|
|
2221
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-mono text-og-sm text-og-accent", children: [
|
|
2100
2222
|
"/",
|
|
2101
2223
|
command.name,
|
|
2102
|
-
hint ? /* @__PURE__ */
|
|
2224
|
+
hint ? /* @__PURE__ */ jsx5("span", { className: "ml-1 text-og-fg-subtle", children: hint }) : null
|
|
2103
2225
|
] }),
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
command.danger ? /* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ jsx5("span", { className: "text-og-sm text-og-fg-muted", children: command.description }),
|
|
2227
|
+
command.danger ? /* @__PURE__ */ jsx5("span", { className: "ml-auto rounded-og-xs bg-og-status-failed/15 px-1 text-og-xs uppercase tracking-wide text-og-status-failed", children: messages.danger }) : null
|
|
2106
2228
|
] }, command.name);
|
|
2107
2229
|
}) })
|
|
2108
2230
|
]
|
|
@@ -2460,7 +2582,7 @@ import {
|
|
|
2460
2582
|
authorizeTranscriptionAdapter,
|
|
2461
2583
|
createTranscriptionSessionRequest
|
|
2462
2584
|
} from "@opengeni/sdk";
|
|
2463
|
-
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as
|
|
2585
|
+
import { useCallback as useCallback4, useEffect as useEffect3, useMemo as useMemo6, useRef as useRef4, useState as useState5 } from "react";
|
|
2464
2586
|
var INITIAL_TRANSCRIPTION_CONTROL_STATE = {
|
|
2465
2587
|
status: "idle",
|
|
2466
2588
|
generation: 0,
|
|
@@ -2622,12 +2744,12 @@ function useTranscription({
|
|
|
2622
2744
|
lifecycleTimeouts,
|
|
2623
2745
|
onDiagnostic
|
|
2624
2746
|
}) {
|
|
2625
|
-
const [state, setState] =
|
|
2626
|
-
const stateRef =
|
|
2627
|
-
const valueRef =
|
|
2628
|
-
const sessionRef =
|
|
2629
|
-
const pendingStartRef =
|
|
2630
|
-
const activePolicyRef =
|
|
2747
|
+
const [state, setState] = useState5(INITIAL_TRANSCRIPTION_CONTROL_STATE);
|
|
2748
|
+
const stateRef = useRef4(state);
|
|
2749
|
+
const valueRef = useRef4(value);
|
|
2750
|
+
const sessionRef = useRef4(null);
|
|
2751
|
+
const pendingStartRef = useRef4(null);
|
|
2752
|
+
const activePolicyRef = useRef4(null);
|
|
2631
2753
|
valueRef.current = value;
|
|
2632
2754
|
const startTimeoutMs = normalizeTimeout(
|
|
2633
2755
|
lifecycleTimeouts?.startMs,
|
|
@@ -2647,15 +2769,15 @@ function useTranscription({
|
|
|
2647
2769
|
},
|
|
2648
2770
|
[onDiagnostic]
|
|
2649
2771
|
);
|
|
2650
|
-
const cleanupRuntimeRef =
|
|
2772
|
+
const cleanupRuntimeRef = useRef4({ cleanupTimeoutMs, reportDiagnostic });
|
|
2651
2773
|
useEffect3(() => {
|
|
2652
2774
|
cleanupRuntimeRef.current = { cleanupTimeoutMs, reportDiagnostic };
|
|
2653
2775
|
}, [cleanupTimeoutMs, reportDiagnostic]);
|
|
2654
|
-
const policyRevision =
|
|
2776
|
+
const policyRevision = useMemo6(
|
|
2655
2777
|
() => transcriptionPolicyRevision(policy, selection),
|
|
2656
2778
|
[policy, selection]
|
|
2657
2779
|
);
|
|
2658
|
-
const authorization =
|
|
2780
|
+
const authorization = useMemo6(
|
|
2659
2781
|
() => adapter ? authorizeTranscriptionAdapter(policy, adapter.descriptor, selection) : null,
|
|
2660
2782
|
[adapter, policy, selection]
|
|
2661
2783
|
);
|
|
@@ -3021,7 +3143,7 @@ function transcriptionPolicyRevision(policy, selection) {
|
|
|
3021
3143
|
|
|
3022
3144
|
// src/hooks/use-voice-input.ts
|
|
3023
3145
|
import { OpenGeniApiError } from "@opengeni/sdk";
|
|
3024
|
-
import { useCallback as useCallback5, useEffect as useEffect4, useRef as
|
|
3146
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as useState6 } from "react";
|
|
3025
3147
|
|
|
3026
3148
|
// src/voice-recording-owner.ts
|
|
3027
3149
|
var VOICE_RECORDING_OWNER_SESSION_KEY = "opengeni.voice-recording-owner.v1";
|
|
@@ -3245,44 +3367,44 @@ function useVoiceInput({
|
|
|
3245
3367
|
now = currentDate,
|
|
3246
3368
|
automaticRetryDelayMilliseconds
|
|
3247
3369
|
}) {
|
|
3248
|
-
const [status, setStatus] =
|
|
3249
|
-
const [error, setError] =
|
|
3250
|
-
const [stream, setStream] =
|
|
3251
|
-
const [recordingId, setRecordingId] =
|
|
3252
|
-
const [durationSeconds, setDurationSeconds] =
|
|
3253
|
-
const [locallySaved, setLocallySaved] =
|
|
3254
|
-
const [storageAvailable, setStorageAvailable] =
|
|
3370
|
+
const [status, setStatus] = useState6("idle");
|
|
3371
|
+
const [error, setError] = useState6(null);
|
|
3372
|
+
const [stream, setStream] = useState6(null);
|
|
3373
|
+
const [recordingId, setRecordingId] = useState6(null);
|
|
3374
|
+
const [durationSeconds, setDurationSeconds] = useState6(0);
|
|
3375
|
+
const [locallySaved, setLocallySaved] = useState6(false);
|
|
3376
|
+
const [storageAvailable, setStorageAvailable] = useState6(
|
|
3255
3377
|
() => Boolean(createRecordingStore) || typeof globalThis.indexedDB !== "undefined"
|
|
3256
3378
|
);
|
|
3257
|
-
const createRecordingStoreRef =
|
|
3379
|
+
const createRecordingStoreRef = useRef5(createRecordingStore);
|
|
3258
3380
|
createRecordingStoreRef.current = createRecordingStore;
|
|
3259
|
-
const nowRef =
|
|
3381
|
+
const nowRef = useRef5(now);
|
|
3260
3382
|
nowRef.current = now;
|
|
3261
3383
|
const readNow = useCallback5(() => nowRef.current(), []);
|
|
3262
|
-
const generationRef =
|
|
3263
|
-
const workspaceIdRef =
|
|
3264
|
-
const ownerIdRef =
|
|
3265
|
-
const ownerLeaseRef =
|
|
3266
|
-
const ownerIdPromiseRef =
|
|
3267
|
-
const createOwnerIdRef =
|
|
3268
|
-
const recorderRef =
|
|
3269
|
-
const streamRef =
|
|
3270
|
-
const timerRef =
|
|
3271
|
-
const automaticRetryTimerRef =
|
|
3272
|
-
const automaticRetryAttemptRef =
|
|
3273
|
-
const ownerHeartbeatTimerRef =
|
|
3274
|
-
const controllerRef =
|
|
3275
|
-
const valueRef =
|
|
3276
|
-
const storeRef =
|
|
3277
|
-
const storePromiseRef =
|
|
3278
|
-
const ownsStoreRef =
|
|
3279
|
-
const manifestRef =
|
|
3280
|
-
const persistenceQueueRef =
|
|
3281
|
-
const persistenceErrorRef =
|
|
3282
|
-
const captureLimitErrorRef =
|
|
3283
|
-
const captureSettledRef =
|
|
3284
|
-
const resolveCaptureSettledRef =
|
|
3285
|
-
const statusRef =
|
|
3384
|
+
const generationRef = useRef5(0);
|
|
3385
|
+
const workspaceIdRef = useRef5(workspaceId);
|
|
3386
|
+
const ownerIdRef = useRef5(null);
|
|
3387
|
+
const ownerLeaseRef = useRef5(null);
|
|
3388
|
+
const ownerIdPromiseRef = useRef5(null);
|
|
3389
|
+
const createOwnerIdRef = useRef5(createOwnerId);
|
|
3390
|
+
const recorderRef = useRef5(null);
|
|
3391
|
+
const streamRef = useRef5(null);
|
|
3392
|
+
const timerRef = useRef5(null);
|
|
3393
|
+
const automaticRetryTimerRef = useRef5(null);
|
|
3394
|
+
const automaticRetryAttemptRef = useRef5(0);
|
|
3395
|
+
const ownerHeartbeatTimerRef = useRef5(null);
|
|
3396
|
+
const controllerRef = useRef5(null);
|
|
3397
|
+
const valueRef = useRef5(value);
|
|
3398
|
+
const storeRef = useRef5(null);
|
|
3399
|
+
const storePromiseRef = useRef5(null);
|
|
3400
|
+
const ownsStoreRef = useRef5(false);
|
|
3401
|
+
const manifestRef = useRef5(null);
|
|
3402
|
+
const persistenceQueueRef = useRef5(Promise.resolve());
|
|
3403
|
+
const persistenceErrorRef = useRef5(null);
|
|
3404
|
+
const captureLimitErrorRef = useRef5(null);
|
|
3405
|
+
const captureSettledRef = useRef5(Promise.resolve());
|
|
3406
|
+
const resolveCaptureSettledRef = useRef5(null);
|
|
3407
|
+
const statusRef = useRef5(status);
|
|
3286
3408
|
valueRef.current = value;
|
|
3287
3409
|
statusRef.current = status;
|
|
3288
3410
|
workspaceIdRef.current = workspaceId;
|
|
@@ -3606,7 +3728,7 @@ function useVoiceInput({
|
|
|
3606
3728
|
workspaceId
|
|
3607
3729
|
]
|
|
3608
3730
|
);
|
|
3609
|
-
const finalizePersistedRecordingRef =
|
|
3731
|
+
const finalizePersistedRecordingRef = useRef5(finalizePersistedRecording);
|
|
3610
3732
|
finalizePersistedRecordingRef.current = finalizePersistedRecording;
|
|
3611
3733
|
const clientAvailable = client !== null && client !== void 0;
|
|
3612
3734
|
useEffect4(() => {
|
|
@@ -4382,12 +4504,12 @@ import {
|
|
|
4382
4504
|
XIcon as XIcon3
|
|
4383
4505
|
} from "lucide-react";
|
|
4384
4506
|
import { AnimatePresence as AnimatePresence4, motion as motion4 } from "motion/react";
|
|
4385
|
-
import { useEffect as useEffect5, useState as
|
|
4386
|
-
import { Fragment as Fragment3, jsx as
|
|
4507
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
4508
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4387
4509
|
function Tip({ tip, children }) {
|
|
4388
|
-
return /* @__PURE__ */
|
|
4389
|
-
/* @__PURE__ */
|
|
4390
|
-
/* @__PURE__ */
|
|
4510
|
+
return /* @__PURE__ */ jsxs6(Tooltip, { children: [
|
|
4511
|
+
/* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children }),
|
|
4512
|
+
/* @__PURE__ */ jsx6(TooltipContent, { side: "top", children: tip })
|
|
4391
4513
|
] });
|
|
4392
4514
|
}
|
|
4393
4515
|
var defaultMessages = {
|
|
@@ -4471,7 +4593,7 @@ function ComposerTranscriptionControl({
|
|
|
4471
4593
|
}
|
|
4472
4594
|
void transcription.start();
|
|
4473
4595
|
}
|
|
4474
|
-
return /* @__PURE__ */
|
|
4596
|
+
return /* @__PURE__ */ jsx6(AnimatePresence4, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx6(
|
|
4475
4597
|
motion4.span,
|
|
4476
4598
|
{
|
|
4477
4599
|
initial: { opacity: 0, width: 0 },
|
|
@@ -4487,8 +4609,8 @@ function ComposerTranscriptionControl({
|
|
|
4487
4609
|
),
|
|
4488
4610
|
"data-transcription-status": status,
|
|
4489
4611
|
"data-transcription-capturing": capturing ? "" : void 0,
|
|
4490
|
-
children: /* @__PURE__ */
|
|
4491
|
-
/* @__PURE__ */
|
|
4612
|
+
children: /* @__PURE__ */ jsxs6("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
4613
|
+
/* @__PURE__ */ jsx6(AnimatePresence4, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs6(
|
|
4492
4614
|
motion4.span,
|
|
4493
4615
|
{
|
|
4494
4616
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4500,12 +4622,12 @@ function ComposerTranscriptionControl({
|
|
|
4500
4622
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4501
4623
|
),
|
|
4502
4624
|
children: [
|
|
4503
|
-
/* @__PURE__ */
|
|
4504
|
-
/* @__PURE__ */
|
|
4625
|
+
/* @__PURE__ */ jsx6("span", { className: "og-transcription-recovered-label max-w-44 truncate text-og-xs text-og-fg-muted max-sm:max-w-28", children: savedTranscript ? errorMessage3 ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage3 ?? messages.errorRetryable : messages.recovered }),
|
|
4626
|
+
/* @__PURE__ */ jsx6(
|
|
4505
4627
|
Tip,
|
|
4506
4628
|
{
|
|
4507
4629
|
tip: savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : messages.retry,
|
|
4508
|
-
children: /* @__PURE__ */
|
|
4630
|
+
children: /* @__PURE__ */ jsx6(
|
|
4509
4631
|
"button",
|
|
4510
4632
|
{
|
|
4511
4633
|
type: "button",
|
|
@@ -4516,12 +4638,12 @@ function ComposerTranscriptionControl({
|
|
|
4516
4638
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4517
4639
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4518
4640
|
),
|
|
4519
|
-
children: savedTranscript ? /* @__PURE__ */
|
|
4641
|
+
children: savedTranscript ? /* @__PURE__ */ jsx6(ClipboardPasteIcon, { className: "size-3.5" }) : retrying ? /* @__PURE__ */ jsx6(SquareIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx6(RefreshCwIcon, { className: "size-3.5" })
|
|
4520
4642
|
}
|
|
4521
4643
|
)
|
|
4522
4644
|
}
|
|
4523
4645
|
),
|
|
4524
|
-
/* @__PURE__ */
|
|
4646
|
+
/* @__PURE__ */ jsx6(Tip, { tip: messages.discardRecovered, children: /* @__PURE__ */ jsx6(
|
|
4525
4647
|
"button",
|
|
4526
4648
|
{
|
|
4527
4649
|
type: "button",
|
|
@@ -4532,13 +4654,13 @@ function ComposerTranscriptionControl({
|
|
|
4532
4654
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4533
4655
|
"hover:bg-og-surface-3 hover:text-og-status-failed pointer-coarse:size-11"
|
|
4534
4656
|
),
|
|
4535
|
-
children: /* @__PURE__ */
|
|
4657
|
+
children: /* @__PURE__ */ jsx6(Trash2Icon, { className: "size-3.5" })
|
|
4536
4658
|
}
|
|
4537
4659
|
) })
|
|
4538
4660
|
]
|
|
4539
4661
|
},
|
|
4540
4662
|
"recovered"
|
|
4541
|
-
) : active ? /* @__PURE__ */
|
|
4663
|
+
) : active ? /* @__PURE__ */ jsxs6(
|
|
4542
4664
|
motion4.span,
|
|
4543
4665
|
{
|
|
4544
4666
|
initial: { opacity: 0, scale: 0.96 },
|
|
@@ -4550,21 +4672,21 @@ function ComposerTranscriptionControl({
|
|
|
4550
4672
|
"bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
|
|
4551
4673
|
),
|
|
4552
4674
|
children: [
|
|
4553
|
-
status === "requesting-permission" ? /* @__PURE__ */
|
|
4675
|
+
status === "requesting-permission" ? /* @__PURE__ */ jsx6(
|
|
4554
4676
|
LoaderCircleIcon2,
|
|
4555
4677
|
{
|
|
4556
4678
|
className: "size-3.5 shrink-0 text-og-fg-muted animate-og-spin motion-reduce:animate-none",
|
|
4557
4679
|
"aria-hidden": true
|
|
4558
4680
|
}
|
|
4559
|
-
) : /* @__PURE__ */
|
|
4560
|
-
status === "recording" ? /* @__PURE__ */
|
|
4681
|
+
) : /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-1.5", children: [
|
|
4682
|
+
status === "recording" ? /* @__PURE__ */ jsx6(
|
|
4561
4683
|
"span",
|
|
4562
4684
|
{
|
|
4563
4685
|
"aria-hidden": true,
|
|
4564
4686
|
className: "size-1.5 shrink-0 rounded-full bg-og-status-failed animate-og-pulse motion-reduce:animate-none"
|
|
4565
4687
|
}
|
|
4566
4688
|
) : null,
|
|
4567
|
-
/* @__PURE__ */
|
|
4689
|
+
/* @__PURE__ */ jsx6(
|
|
4568
4690
|
VoiceWaveform,
|
|
4569
4691
|
{
|
|
4570
4692
|
stream: status === "recording" ? transcription.stream : null,
|
|
@@ -4572,8 +4694,8 @@ function ComposerTranscriptionControl({
|
|
|
4572
4694
|
}
|
|
4573
4695
|
)
|
|
4574
4696
|
] }),
|
|
4575
|
-
status === "recording" ? /* @__PURE__ */
|
|
4576
|
-
/* @__PURE__ */
|
|
4697
|
+
status === "recording" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
4698
|
+
/* @__PURE__ */ jsx6(Tip, { tip: messages.cancel, children: /* @__PURE__ */ jsx6(
|
|
4577
4699
|
"button",
|
|
4578
4700
|
{
|
|
4579
4701
|
type: "button",
|
|
@@ -4585,10 +4707,10 @@ function ComposerTranscriptionControl({
|
|
|
4585
4707
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4586
4708
|
"hover:bg-og-surface-3 hover:text-og-fg pointer-coarse:size-11"
|
|
4587
4709
|
),
|
|
4588
|
-
children: /* @__PURE__ */
|
|
4710
|
+
children: /* @__PURE__ */ jsx6(XIcon3, { className: "size-3.5" })
|
|
4589
4711
|
}
|
|
4590
4712
|
) }),
|
|
4591
|
-
/* @__PURE__ */
|
|
4713
|
+
/* @__PURE__ */ jsx6(Tip, { tip: messages.stop, children: /* @__PURE__ */ jsx6(
|
|
4592
4714
|
"button",
|
|
4593
4715
|
{
|
|
4594
4716
|
type: "button",
|
|
@@ -4599,14 +4721,14 @@ function ComposerTranscriptionControl({
|
|
|
4599
4721
|
"bg-og-fg text-og-bg transition-colors duration-150 motion-reduce:transition-none",
|
|
4600
4722
|
"hover:bg-og-fg-muted pointer-coarse:size-11"
|
|
4601
4723
|
),
|
|
4602
|
-
children: /* @__PURE__ */
|
|
4724
|
+
children: /* @__PURE__ */ jsx6(SquareIcon, { className: "size-2.5 fill-current" })
|
|
4603
4725
|
}
|
|
4604
4726
|
) })
|
|
4605
|
-
] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */
|
|
4727
|
+
] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */ jsx6("span", { className: "og-shimmer-text px-1.5 text-og-xs font-medium whitespace-nowrap", children: status === "saving" ? messages.saving : messages.transcribing }) : /* @__PURE__ */ jsx6("span", { className: "px-1.5 text-og-xs text-og-fg-muted whitespace-nowrap", children: messages.requestingPermission })
|
|
4606
4728
|
]
|
|
4607
4729
|
},
|
|
4608
4730
|
status === "transcribing" || status === "saving" ? "processing" : "capture"
|
|
4609
|
-
) : /* @__PURE__ */
|
|
4731
|
+
) : /* @__PURE__ */ jsx6(Tip, { tip: idleLabel, children: /* @__PURE__ */ jsx6(
|
|
4610
4732
|
motion4.button,
|
|
4611
4733
|
{
|
|
4612
4734
|
type: "button",
|
|
@@ -4624,10 +4746,10 @@ function ComposerTranscriptionControl({
|
|
|
4624
4746
|
"text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
|
|
4625
4747
|
unavailableMessage ? "cursor-not-allowed opacity-45" : "hover:bg-og-surface-2 hover:text-og-fg"
|
|
4626
4748
|
),
|
|
4627
|
-
children: /* @__PURE__ */
|
|
4749
|
+
children: /* @__PURE__ */ jsx6(MicIcon, { className: "size-4" })
|
|
4628
4750
|
}
|
|
4629
4751
|
) }, "idle") }),
|
|
4630
|
-
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */
|
|
4752
|
+
status === "error" && errorMessage3 && !recoverable ? /* @__PURE__ */ jsx6(Tip, { tip: errorMessage3, children: /* @__PURE__ */ jsx6(
|
|
4631
4753
|
"span",
|
|
4632
4754
|
{
|
|
4633
4755
|
"aria-hidden": "true",
|
|
@@ -4635,7 +4757,7 @@ function ComposerTranscriptionControl({
|
|
|
4635
4757
|
children: errorMessage3
|
|
4636
4758
|
}
|
|
4637
4759
|
) }) : null,
|
|
4638
|
-
/* @__PURE__ */
|
|
4760
|
+
/* @__PURE__ */ jsx6(
|
|
4639
4761
|
"span",
|
|
4640
4762
|
{
|
|
4641
4763
|
className: "sr-only",
|
|
@@ -4653,8 +4775,8 @@ function VoiceWaveform({
|
|
|
4653
4775
|
stream,
|
|
4654
4776
|
mode
|
|
4655
4777
|
}) {
|
|
4656
|
-
const [levels, setLevels] =
|
|
4657
|
-
const [live, setLive] =
|
|
4778
|
+
const [levels, setLevels] = useState7(() => restingLevels(WAVEFORM_BARS));
|
|
4779
|
+
const [live, setLive] = useState7(false);
|
|
4658
4780
|
useEffect5(() => {
|
|
4659
4781
|
if (!stream || mode !== "recording") {
|
|
4660
4782
|
setLive(false);
|
|
@@ -4703,7 +4825,7 @@ function VoiceWaveform({
|
|
|
4703
4825
|
void context?.close();
|
|
4704
4826
|
};
|
|
4705
4827
|
}, [stream, mode]);
|
|
4706
|
-
return /* @__PURE__ */
|
|
4828
|
+
return /* @__PURE__ */ jsx6(
|
|
4707
4829
|
"span",
|
|
4708
4830
|
{
|
|
4709
4831
|
"aria-hidden": true,
|
|
@@ -4711,7 +4833,7 @@ function VoiceWaveform({
|
|
|
4711
4833
|
className: "flex h-4 w-[3.75rem] items-center justify-center gap-px",
|
|
4712
4834
|
children: WAVEFORM_BAR_KEYS.map((key, index) => {
|
|
4713
4835
|
const level = levels[index] ?? 0;
|
|
4714
|
-
return /* @__PURE__ */
|
|
4836
|
+
return /* @__PURE__ */ jsx6(
|
|
4715
4837
|
"span",
|
|
4716
4838
|
{
|
|
4717
4839
|
className: cn(
|
|
@@ -4762,6 +4884,10 @@ function transcriptionErrorMessage(code, messages) {
|
|
|
4762
4884
|
}
|
|
4763
4885
|
|
|
4764
4886
|
export {
|
|
4887
|
+
TooltipProvider,
|
|
4888
|
+
Tooltip,
|
|
4889
|
+
TooltipTrigger,
|
|
4890
|
+
TooltipContent,
|
|
4765
4891
|
useLightbox,
|
|
4766
4892
|
useLightboxOptional,
|
|
4767
4893
|
LightboxProvider,
|
|
@@ -4818,4 +4944,4 @@ export {
|
|
|
4818
4944
|
useVoiceInput,
|
|
4819
4945
|
ComposerTranscriptionControl
|
|
4820
4946
|
};
|
|
4821
|
-
//# sourceMappingURL=chunk-
|
|
4947
|
+
//# sourceMappingURL=chunk-Z7WBDB4E.js.map
|