@opengeni/react 0.15.0 → 0.20.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 +110 -10
- package/dist/{chunk-TOJR776I.js → chunk-6BXBGJ3B.js} +45 -369
- package/dist/chunk-6BXBGJ3B.js.map +1 -0
- package/dist/chunk-6UT5OC3P.js +2133 -0
- package/dist/chunk-6UT5OC3P.js.map +1 -0
- package/dist/chunk-EBTT3MYN.js +92 -0
- package/dist/chunk-EBTT3MYN.js.map +1 -0
- package/dist/chunk-HHFA4AFX.js +425 -0
- package/dist/chunk-HHFA4AFX.js.map +1 -0
- package/dist/chunk-LAZ2A743.js +2393 -0
- package/dist/chunk-LAZ2A743.js.map +1 -0
- package/dist/chunk-MRSECXRP.js +563 -0
- package/dist/chunk-MRSECXRP.js.map +1 -0
- package/dist/chunk-TK7G6XLT.js +18 -0
- package/dist/chunk-TK7G6XLT.js.map +1 -0
- package/dist/composer-DvUaa5ki.d.ts +585 -0
- package/dist/composer.d.ts +6 -0
- package/dist/composer.js +56 -0
- package/dist/composer.js.map +1 -0
- package/dist/index.d.ts +1288 -1785
- package/dist/index.js +7015 -8806
- package/dist/index.js.map +1 -1
- package/dist/machines.d.ts +412 -3
- package/dist/machines.js +3 -1
- package/dist/noto-sans-arabic-loader-IA2T4X2A.js +21 -0
- package/dist/noto-sans-arabic-loader-IA2T4X2A.js.map +1 -0
- package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js +292 -0
- package/dist/noto-sans-jp-loader.generated-HFGLYBR3.js.map +1 -0
- package/dist/queue-surface-implementation-NQMV2ML3.js +890 -0
- package/dist/queue-surface-implementation-NQMV2ML3.js.map +1 -0
- package/dist/session-Gd4iVPYw.d.ts +425 -0
- package/dist/session-context-DIFFlXKc.d.ts +52 -0
- package/dist/session.d.ts +4 -0
- package/dist/session.js +50 -0
- package/dist/session.js.map +1 -0
- package/dist/use-composer-BCfm4mzX.d.ts +112 -0
- package/package.json +20 -4
- package/src/approvals.ts +5 -3
- package/src/client.ts +40 -0
- package/src/components/approval-surface.tsx +198 -0
- package/src/components/chat-composer.tsx +94 -993
- package/src/components/code-editor.tsx +104 -26
- package/src/components/command-palette.tsx +8 -2
- package/src/components/composer-transcription-control.tsx +211 -0
- package/src/components/composer.tsx +1536 -0
- package/src/components/desktop-viewer.tsx +3 -3
- package/src/components/enrollment-consent.tsx +2 -2
- package/src/components/file-browser.tsx +367 -29
- package/src/components/human-input-form.tsx +417 -0
- package/src/components/machine-card.tsx +1 -1
- package/src/components/machines-dashboard.tsx +3 -3
- package/src/components/message-timeline.tsx +15 -7
- package/src/components/model-picker.tsx +12 -3
- package/src/components/pierre-diff.tsx +32 -6
- package/src/components/queue-surface-implementation.tsx +1041 -0
- package/src/components/queue-surface-state.tsx +94 -0
- package/src/components/queue-surface.tsx +41 -559
- package/src/components/sandbox-files.tsx +138 -14
- package/src/components/sandbox-terminal.tsx +8 -2
- package/src/components/sandbox-workspace.tsx +339 -119
- package/src/components/workbench-changes.tsx +84 -33
- package/src/components/workspace-dock.tsx +188 -18
- package/src/composer.ts +60 -0
- package/src/hooks/internal.ts +115 -34
- package/src/hooks/use-composer.ts +335 -104
- package/src/hooks/use-human-input.ts +131 -0
- package/src/hooks/use-machine-chip.ts +2 -2
- package/src/hooks/use-machines.ts +27 -11
- package/src/hooks/use-sandbox-files.ts +310 -62
- package/src/hooks/use-sandbox-git.ts +154 -40
- package/src/hooks/use-sandbox-terminal.ts +28 -6
- package/src/hooks/use-session-capabilities.ts +38 -9
- package/src/hooks/use-session-control.ts +37 -8
- package/src/hooks/use-session-events.ts +522 -48
- package/src/hooks/use-slash-commands.ts +38 -38
- package/src/hooks/use-transcription.ts +757 -0
- package/src/hooks/use-turn-queue.ts +134 -66
- package/src/hooks/use-windowed-sections.ts +2 -2
- package/src/hooks/use-workspace-capture.ts +146 -40
- package/src/hooks/use-workspace-edit.ts +50 -14
- package/src/hooks/use-workspace-sessions.ts +3 -0
- package/src/human-input.ts +72 -0
- package/src/index.ts +76 -6
- package/src/lib/noto-sans-arabic-loader.ts +21 -0
- package/src/lib/noto-sans-jp-loader.generated.ts +295 -0
- package/src/lib/use-portal-token-style.ts +51 -0
- package/src/lib/use-unicode-fonts.ts +57 -0
- package/src/provider.tsx +4 -69
- package/src/session-context.ts +135 -0
- package/src/session.ts +79 -0
- package/src/timeline/parsers.ts +35 -0
- package/src/timeline/projection.ts +12 -4
- package/src/timeline/tool-renderers.tsx +41 -0
- package/src/timeline/turn-summary.tsx +2 -2
- package/src/timeline/types.ts +16 -8
- package/styles/index.css +56 -0
- package/styles/index.d.ts +2 -0
- package/styles/tokens.css +11 -6
- package/styles/tokens.d.ts +2 -0
- package/dist/chunk-TOJR776I.js.map +0 -1
- package/dist/machines-BpdwuQcD.d.ts +0 -449
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Loader2Icon, RotateCwIcon } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import type { UseTurnQueueResult } from "../hooks/use-turn-queue";
|
|
4
|
+
|
|
5
|
+
type QueueStateProps = {
|
|
6
|
+
queue: UseTurnQueueResult;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function EmptyQueueStateSurface({ queue }: QueueStateProps) {
|
|
10
|
+
const hasError = Boolean(queue.error || queue.mutationError);
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
className="mx-auto mb-2 w-full max-w-3xl shrink-0 px-4 sm:px-6"
|
|
14
|
+
data-testid="queue-surface"
|
|
15
|
+
>
|
|
16
|
+
<div className="overflow-hidden rounded-lg border border-border bg-surface/80 shadow-sm">
|
|
17
|
+
{queue.stoppingPreviousAttempt ? (
|
|
18
|
+
<QueueStoppingStatus queue={queue} dividerAfter={hasError} />
|
|
19
|
+
) : null}
|
|
20
|
+
{hasError ? <QueueErrorAlert queue={queue} /> : null}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function QueueStoppingStatus({
|
|
27
|
+
queue,
|
|
28
|
+
dividerAfter = false,
|
|
29
|
+
}: QueueStateProps & { dividerAfter?: boolean }) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
role="status"
|
|
33
|
+
aria-live="polite"
|
|
34
|
+
className={`flex min-h-11 items-center gap-2.5 bg-status-waiting/[0.07] px-3 py-2 text-xs text-fg ${
|
|
35
|
+
dividerAfter ? "border-b border-status-waiting/20" : ""
|
|
36
|
+
}`}
|
|
37
|
+
data-testid="stopping-previous-attempt"
|
|
38
|
+
>
|
|
39
|
+
<Loader2Icon
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
className="size-3.5 shrink-0 animate-spin text-status-waiting motion-reduce:animate-none"
|
|
42
|
+
/>
|
|
43
|
+
<span className="min-w-0">
|
|
44
|
+
<span className="font-medium">
|
|
45
|
+
{queue.effectiveControl?.state === "paused"
|
|
46
|
+
? "Stopping current attempt…"
|
|
47
|
+
: "Stopping previous attempt…"}
|
|
48
|
+
</span>{" "}
|
|
49
|
+
<span className="text-fg-muted">
|
|
50
|
+
{queue.effectiveControl?.state === "paused"
|
|
51
|
+
? "Queued work stays saved until you resume."
|
|
52
|
+
: "Queued work is saved and starts automatically."}
|
|
53
|
+
</span>
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function QueueErrorAlert({
|
|
60
|
+
queue,
|
|
61
|
+
dividerBefore = false,
|
|
62
|
+
}: QueueStateProps & { dividerBefore?: boolean }) {
|
|
63
|
+
return (
|
|
64
|
+
<div className={`${dividerBefore ? "border-t border-border" : ""} p-2`}>
|
|
65
|
+
<div
|
|
66
|
+
role="alert"
|
|
67
|
+
className="flex min-w-0 max-w-full flex-wrap items-start gap-2 rounded-md bg-status-failed/10 px-2 py-1.5 text-xs text-status-failed"
|
|
68
|
+
>
|
|
69
|
+
<span
|
|
70
|
+
role="region"
|
|
71
|
+
aria-label="Queue error details"
|
|
72
|
+
tabIndex={0}
|
|
73
|
+
className="max-h-[min(5rem,20dvh)] min-w-0 max-w-full flex-[1_1_5rem] overflow-auto overscroll-contain whitespace-pre-wrap rounded-sm outline-none [overflow-wrap:anywhere] [unicode-bidi:plaintext] focus-visible:ring-2 focus-visible:ring-ring/40"
|
|
74
|
+
data-testid="queue-error-message"
|
|
75
|
+
dir="auto"
|
|
76
|
+
>
|
|
77
|
+
{(queue.mutationError ?? queue.error)?.message}
|
|
78
|
+
</span>
|
|
79
|
+
<button
|
|
80
|
+
type="button"
|
|
81
|
+
onClick={() => {
|
|
82
|
+
queue.clearMutationError();
|
|
83
|
+
void queue.refresh();
|
|
84
|
+
}}
|
|
85
|
+
aria-label="Dismiss queue error and retry"
|
|
86
|
+
title="Retry loading the queue"
|
|
87
|
+
className="ms-auto inline-flex size-7 shrink-0 items-center justify-center self-start rounded-md outline-none transition-colors hover:bg-surface-3 focus-visible:ring-2 focus-visible:ring-ring/40 motion-reduce:transition-none pointer-coarse:size-[44px]"
|
|
88
|
+
>
|
|
89
|
+
<RotateCwIcon className="size-3.5" />
|
|
90
|
+
</button>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|