@opengeni/react 0.11.0 → 0.13.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 +1 -1
- package/dist/{chunk-5C7RGAWA.js → chunk-NFYVQWIB.js} +170 -64
- package/dist/chunk-NFYVQWIB.js.map +1 -0
- package/dist/index.d.ts +791 -145
- package/dist/index.js +5447 -2213
- package/dist/index.js.map +1 -1
- package/dist/{machines-BeZ3bD3t.d.ts → machines-CnlMb7E-.d.ts} +5 -5
- package/dist/machines.d.ts +1 -1
- package/dist/machines.js +1 -1
- package/package.json +17 -12
- package/src/approvals.ts +16 -4
- package/src/client.ts +32 -5
- package/src/commands/index.ts +1 -7
- package/src/commands/registry.ts +46 -12
- package/src/components/chat-composer.tsx +135 -39
- package/src/components/code-editor.tsx +28 -36
- package/src/components/command-palette.tsx +26 -5
- package/src/components/desktop-viewer.tsx +29 -16
- package/src/components/diff-view.tsx +27 -189
- package/src/components/enrollment-consent.tsx +28 -10
- package/src/components/enrollment-device-flow.tsx +8 -5
- package/src/components/file-browser.tsx +190 -56
- package/src/components/fleet-tile.tsx +13 -4
- package/src/components/machine-card.tsx +16 -4
- package/src/components/machine-dock-bar.tsx +20 -8
- package/src/components/machine-metrics.tsx +31 -8
- package/src/components/machine-status-pill.tsx +26 -5
- package/src/components/machines-dashboard.tsx +8 -2
- package/src/components/markdown.tsx +39 -9
- package/src/components/message-timeline.tsx +633 -109
- package/src/components/pierre-diff.tsx +83 -15
- package/src/components/pierre-file.tsx +10 -9
- package/src/components/sandbox-files.tsx +110 -227
- package/src/components/sandbox-terminal.tsx +256 -88
- package/src/components/sandbox-workspace.tsx +823 -0
- package/src/components/session-status.tsx +28 -2
- package/src/components/workbench-changes.tsx +541 -0
- package/src/components/workspace-dock.tsx +85 -22
- package/src/hooks/internal.ts +5 -2
- package/src/hooks/use-available-models.ts +7 -2
- package/src/hooks/use-billing-usage.ts +4 -1
- package/src/hooks/use-codex-accounts.ts +74 -44
- package/src/hooks/use-composer.ts +57 -36
- package/src/hooks/use-environments.ts +92 -47
- package/src/hooks/use-file-attachments.ts +101 -55
- package/src/hooks/use-goal.ts +52 -16
- package/src/hooks/use-machine-chip.ts +134 -0
- package/src/hooks/use-machines.ts +34 -16
- package/src/hooks/use-packs.ts +24 -19
- package/src/hooks/use-relay-frame-stream.ts +5 -2
- package/src/hooks/use-rigs.ts +335 -0
- package/src/hooks/use-sandbox-files.ts +213 -39
- package/src/hooks/use-sandbox-git.ts +188 -11
- package/src/hooks/use-sandbox-terminal.ts +18 -14
- package/src/hooks/use-scheduled-tasks.ts +10 -2
- package/src/hooks/use-session-capabilities.ts +77 -20
- package/src/hooks/use-session-control.ts +49 -21
- package/src/hooks/use-session-events.ts +48 -20
- package/src/hooks/use-session-lineage.ts +119 -0
- package/src/hooks/use-session.ts +43 -28
- package/src/hooks/use-slash-commands.ts +6 -4
- package/src/hooks/use-turn-queue.ts +74 -147
- package/src/hooks/use-windowed-sections.ts +204 -0
- package/src/hooks/use-workspace-capture.ts +233 -0
- package/src/hooks/use-workspace-edit.ts +231 -0
- package/src/hooks/use-workspace-sessions.ts +48 -5
- package/src/hooks/use-workspaces.ts +18 -15
- package/src/index.ts +128 -23
- package/src/lib/format.ts +44 -6
- package/src/lib/xterm-renderer.ts +65 -0
- package/src/lib/xterm-theme.ts +224 -18
- package/src/machines.ts +13 -3
- package/src/provider.tsx +3 -1
- package/src/timeline/activity-rail.tsx +213 -54
- package/src/timeline/disclosure-context.tsx +12 -2
- package/src/timeline/index.ts +21 -2
- package/src/timeline/parsers.ts +44 -10
- package/src/timeline/projection.ts +435 -84
- package/src/timeline/shared.tsx +111 -24
- package/src/timeline/tool-diff.tsx +24 -20
- package/src/timeline/tool-renderers.tsx +98 -21
- package/src/timeline/turn-summary.tsx +76 -23
- package/src/timeline/types.ts +96 -12
- package/styles/tokens.css +2 -2
- package/dist/chunk-5C7RGAWA.js.map +0 -1
|
@@ -37,6 +37,14 @@ export type PierreDiffProps = {
|
|
|
37
37
|
loading?: ReactNode | undefined;
|
|
38
38
|
/** Rendered if `@pierre/diffs/react` is not installed / fails to import. */
|
|
39
39
|
fallback?: ReactNode | undefined;
|
|
40
|
+
/** Skip the Shiki renderer entirely and show the plain-text degrade (the old
|
|
41
|
+
* `usePierre={false}` path — one renderer, opted out of highlighting). */
|
|
42
|
+
plain?: boolean | undefined;
|
|
43
|
+
/** Long-line handling: `"wrap"` soft-wraps (the default — a diff in a narrow
|
|
44
|
+
* dock pane should be readable without a horizontal-scroll tax), `"scroll"`
|
|
45
|
+
* keeps lines on one row behind a horizontal scrollbar (better for a wide
|
|
46
|
+
* viewport or pathological minified lines). */
|
|
47
|
+
overflow?: "wrap" | "scroll" | undefined;
|
|
40
48
|
className?: string | undefined;
|
|
41
49
|
};
|
|
42
50
|
|
|
@@ -54,8 +62,8 @@ const LazyPatchDiff = lazy(async () => {
|
|
|
54
62
|
/**
|
|
55
63
|
* The Pierre-backed diff: Shiki-highlighted, virtualized, unified/split. Renders
|
|
56
64
|
* one `PatchDiff` per changed file (a reconstructed unified patch from the
|
|
57
|
-
* `GitFileDiff` hunks).
|
|
58
|
-
*
|
|
65
|
+
* `GitFileDiff` hunks). The ONE workbench diff renderer; a host without
|
|
66
|
+
* `@pierre/diffs` gets the built-in plain-text degrade (`PlainPatch`).
|
|
59
67
|
*/
|
|
60
68
|
export function PierreDiff({
|
|
61
69
|
diff,
|
|
@@ -65,13 +73,16 @@ export function PierreDiff({
|
|
|
65
73
|
disableWorkerPool,
|
|
66
74
|
loading,
|
|
67
75
|
fallback,
|
|
76
|
+
plain,
|
|
77
|
+
overflow = "wrap",
|
|
68
78
|
className,
|
|
69
79
|
}: PierreDiffProps) {
|
|
70
80
|
const [failed, setFailed] = useState(false);
|
|
71
81
|
|
|
72
82
|
// Probe the import once so a hard failure (peer missing) shows `fallback`
|
|
73
|
-
// rather than a Suspense boundary that never resolves.
|
|
83
|
+
// rather than a Suspense boundary that never resolves. Skipped when `plain`.
|
|
74
84
|
useEffect(() => {
|
|
85
|
+
if (plain) return;
|
|
75
86
|
let cancelled = false;
|
|
76
87
|
void import("@pierre/diffs/react").catch(() => {
|
|
77
88
|
if (!cancelled) setFailed(true);
|
|
@@ -79,10 +90,13 @@ export function PierreDiff({
|
|
|
79
90
|
return () => {
|
|
80
91
|
cancelled = true;
|
|
81
92
|
};
|
|
82
|
-
}, []);
|
|
93
|
+
}, [plain]);
|
|
83
94
|
|
|
84
|
-
if (
|
|
85
|
-
|
|
95
|
+
if (plain || failed) {
|
|
96
|
+
// `plain` opts out of highlighting; `failed` = `@pierre/diffs` not installed.
|
|
97
|
+
// Render the caller's fallback, or a plain (unhighlighted) patch dump — NOT a
|
|
98
|
+
// second hunk renderer. One highlighted renderer (Pierre) + a text degrade.
|
|
99
|
+
return <div className={className}>{fallback ?? <PlainPatch diff={diff} />}</div>;
|
|
86
100
|
}
|
|
87
101
|
|
|
88
102
|
// Default to the dark theme: the host UI is dark-first, and Pierre's own
|
|
@@ -90,9 +104,16 @@ export function PierreDiff({
|
|
|
90
104
|
// inside a dark dock). Callers pass `themeType="light"` to opt into light.
|
|
91
105
|
const options = {
|
|
92
106
|
diffStyle: layout,
|
|
93
|
-
overflow
|
|
107
|
+
overflow,
|
|
94
108
|
stickyHeader: true,
|
|
95
|
-
...(theme
|
|
109
|
+
...(theme
|
|
110
|
+
? { theme }
|
|
111
|
+
: {
|
|
112
|
+
theme: {
|
|
113
|
+
dark: "github-dark-high-contrast",
|
|
114
|
+
light: "github-light-high-contrast",
|
|
115
|
+
},
|
|
116
|
+
}),
|
|
96
117
|
themeType: themeType ?? "dark",
|
|
97
118
|
};
|
|
98
119
|
|
|
@@ -105,16 +126,24 @@ export function PierreDiff({
|
|
|
105
126
|
"--diffs-light-bg": "var(--og-color-bg)",
|
|
106
127
|
"--diffs-bg-buffer-override": "var(--og-color-surface-1)",
|
|
107
128
|
"--diffs-bg-separator-override": "var(--og-color-surface-1)",
|
|
129
|
+
"--diffs-addition-color-override": "var(--og-color-status-idle)",
|
|
130
|
+
"--diffs-deletion-color-override": "var(--og-color-status-failed)",
|
|
131
|
+
"--diffs-fg-number-addition-override": "var(--og-color-status-idle)",
|
|
132
|
+
"--diffs-fg-number-deletion-override": "var(--og-color-status-failed)",
|
|
133
|
+
"--diffs-bg-addition-override":
|
|
134
|
+
"color-mix(in oklch, var(--og-color-status-idle) 12%, var(--og-color-bg))",
|
|
135
|
+
"--diffs-bg-deletion-override":
|
|
136
|
+
"color-mix(in oklch, var(--og-color-status-failed) 12%, var(--og-color-bg))",
|
|
137
|
+
"--diffs-bg-addition-emphasis-override":
|
|
138
|
+
"color-mix(in oklch, var(--og-color-status-idle) 22%, var(--og-color-bg))",
|
|
139
|
+
"--diffs-bg-deletion-emphasis-override":
|
|
140
|
+
"color-mix(in oklch, var(--og-color-status-failed) 22%, var(--og-color-bg))",
|
|
108
141
|
"--diffs-font-size": "var(--og-code-font-size)",
|
|
109
142
|
"--diffs-line-height": "var(--og-code-line-height)",
|
|
110
143
|
} as CSSProperties;
|
|
111
144
|
|
|
112
145
|
return (
|
|
113
|
-
<div
|
|
114
|
-
className={cn("min-w-0", className)}
|
|
115
|
-
data-opengeni-pierre-diff
|
|
116
|
-
style={pierreVars}
|
|
117
|
-
>
|
|
146
|
+
<div className={cn("min-w-0", className)} data-opengeni-pierre-diff style={pierreVars}>
|
|
118
147
|
<Suspense fallback={loading ?? <DiffSkeleton />}>
|
|
119
148
|
{diff.map((file) => (
|
|
120
149
|
<div key={file.path} className="mb-2">
|
|
@@ -131,9 +160,48 @@ export function PierreDiff({
|
|
|
131
160
|
}
|
|
132
161
|
|
|
133
162
|
function DiffSkeleton() {
|
|
163
|
+
return <div className="p-3 text-og-sm text-og-fg-subtle">Loading diff…</div>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The unhighlighted degrade for a host without `@pierre/diffs`: the reconstructed
|
|
168
|
+
* unified patch as monospace text with +/−/@@ tinting. Deliberately NOT a
|
|
169
|
+
* structured hunk renderer — the workbench keeps exactly one of those (Pierre).
|
|
170
|
+
*/
|
|
171
|
+
function PlainPatch({ diff }: { diff: GitFileDiff[] }) {
|
|
172
|
+
if (diff.length === 0) {
|
|
173
|
+
return <div className="p-3 text-og-sm text-og-fg-subtle">No changes</div>;
|
|
174
|
+
}
|
|
134
175
|
return (
|
|
135
|
-
<div className="
|
|
136
|
-
|
|
176
|
+
<div className="min-w-0">
|
|
177
|
+
{diff.map((file) => (
|
|
178
|
+
<pre
|
|
179
|
+
key={file.path}
|
|
180
|
+
className="mb-2 overflow-auto whitespace-pre rounded-og-sm border border-og-border bg-og-bg/60 p-2.5 font-og-mono text-og-xs leading-5"
|
|
181
|
+
>
|
|
182
|
+
{gitFileDiffToPatch(file)
|
|
183
|
+
.split("\n")
|
|
184
|
+
.map((line, index) => (
|
|
185
|
+
<span
|
|
186
|
+
// Patch line position is the stable identity in this immutable plain-text fallback.
|
|
187
|
+
// oxlint-disable-next-line react/no-array-index-key
|
|
188
|
+
key={index}
|
|
189
|
+
className={cn(
|
|
190
|
+
"block",
|
|
191
|
+
line.startsWith("@@")
|
|
192
|
+
? "text-og-accent"
|
|
193
|
+
: line.startsWith("+")
|
|
194
|
+
? "text-og-status-idle"
|
|
195
|
+
: line.startsWith("-")
|
|
196
|
+
? "text-og-status-failed"
|
|
197
|
+
: "text-og-fg-muted",
|
|
198
|
+
)}
|
|
199
|
+
>
|
|
200
|
+
{line || " "}
|
|
201
|
+
</span>
|
|
202
|
+
))}
|
|
203
|
+
</pre>
|
|
204
|
+
))}
|
|
137
205
|
</div>
|
|
138
206
|
);
|
|
139
207
|
}
|
|
@@ -82,9 +82,7 @@ export function PierreFile({
|
|
|
82
82
|
|
|
83
83
|
if (failed) {
|
|
84
84
|
return (
|
|
85
|
-
<div className={className}>
|
|
86
|
-
{fallback ?? <PlainFile name={name} contents={contents} />}
|
|
87
|
-
</div>
|
|
85
|
+
<div className={className}>{fallback ?? <PlainFile name={name} contents={contents} />}</div>
|
|
88
86
|
);
|
|
89
87
|
}
|
|
90
88
|
|
|
@@ -92,7 +90,14 @@ export function PierreFile({
|
|
|
92
90
|
overflow: "scroll" as const,
|
|
93
91
|
stickyHeader: true,
|
|
94
92
|
showLineNumbers: true,
|
|
95
|
-
...(theme
|
|
93
|
+
...(theme
|
|
94
|
+
? { theme }
|
|
95
|
+
: {
|
|
96
|
+
theme: {
|
|
97
|
+
dark: "github-dark-high-contrast",
|
|
98
|
+
light: "github-light-high-contrast",
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
96
101
|
themeType: themeType ?? "dark",
|
|
97
102
|
};
|
|
98
103
|
|
|
@@ -134,9 +139,5 @@ function PlainFile({ name, contents }: { name: string; contents: string }) {
|
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
function FileSkeleton() {
|
|
137
|
-
return
|
|
138
|
-
<div className="p-3 text-og-sm text-og-fg-subtle">
|
|
139
|
-
Loading file…
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
+
return <div className="p-3 text-og-sm text-og-fg-subtle">Loading file…</div>;
|
|
142
143
|
}
|