@opengeni/react 0.12.0 → 0.15.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 +20 -14
- package/dist/chunk-TOJR776I.js +2280 -0
- package/dist/chunk-TOJR776I.js.map +1 -0
- package/dist/index.d.ts +1040 -363
- package/dist/index.js +10938 -6281
- package/dist/index.js.map +1 -1
- package/dist/{machines-BeZ3bD3t.d.ts → machines-BpdwuQcD.d.ts} +134 -14
- package/dist/machines.d.ts +1 -1
- package/dist/machines.js +23 -1
- package/package.json +20 -12
- package/src/approvals.ts +16 -4
- package/src/client.ts +41 -5
- package/src/commands/index.ts +1 -7
- package/src/commands/registry.ts +46 -12
- package/src/components/chat-composer.tsx +417 -69
- 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 +93 -15
- package/src/components/machine-dock-bar.tsx +20 -8
- package/src/components/machine-health-pill.tsx +68 -0
- package/src/components/machine-metrics.tsx +28 -19
- package/src/components/machine-status-pill.tsx +26 -5
- package/src/components/machines/health.ts +146 -0
- package/src/components/machines/machine-detail.tsx +220 -0
- package/src/components/machines/metric-history-chart.tsx +298 -0
- package/src/components/machines/metric-sparkline.tsx +76 -0
- package/src/components/machines/series.ts +113 -0
- package/src/components/machines-dashboard.tsx +21 -3
- 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/queue-surface.tsx +578 -0
- package/src/components/sandbox-files.tsx +193 -225
- package/src/components/sandbox-terminal.tsx +256 -88
- package/src/components/sandbox-workspace.tsx +957 -0
- package/src/components/session-status.tsx +22 -2
- package/src/components/workbench-changes.tsx +585 -0
- package/src/components/workspace-dock.tsx +213 -59
- 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 +414 -63
- 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 +50 -23
- package/src/hooks/use-session-events.ts +50 -21
- package/src/hooks/use-session-lineage.ts +128 -0
- package/src/hooks/use-session.ts +53 -30
- package/src/hooks/use-slash-commands.ts +6 -4
- package/src/hooks/use-turn-queue.ts +202 -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 +133 -23
- package/src/lib/format.ts +3 -3
- package/src/lib/xterm-renderer.ts +65 -0
- package/src/lib/xterm-theme.ts +224 -18
- package/src/machines.ts +29 -3
- package/src/provider.tsx +195 -6
- 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 +87 -16
- package/src/timeline/projection.ts +412 -87
- 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/index.css +22 -0
- package/styles/tokens.css +2 -2
- package/dist/chunk-5TIXRCSI.js +0 -1291
- package/dist/chunk-5TIXRCSI.js.map +0 -1
package/src/timeline/parsers.ts
CHANGED
|
@@ -29,7 +29,8 @@ export function sandboxCommandExitCode(out: unknown): number | null {
|
|
|
29
29
|
export function parseExecBannerSessionId(out: unknown): number | null {
|
|
30
30
|
const text = String(out ?? "");
|
|
31
31
|
const outputIdx = text.indexOf("\nOutput:\n");
|
|
32
|
-
const banner =
|
|
32
|
+
const banner =
|
|
33
|
+
outputIdx >= 0 ? text.slice(0, outputIdx) : text.startsWith("Output:\n") ? "" : text;
|
|
33
34
|
const match = banner.match(/Process running with session ID (\d+)/);
|
|
34
35
|
if (!match) {
|
|
35
36
|
return null;
|
|
@@ -53,7 +54,9 @@ export function stripExecBanner(out: unknown): string {
|
|
|
53
54
|
|
|
54
55
|
/** The sandbox clamped the output (token/line truncation markers in the banner). */
|
|
55
56
|
export function execTruncated(out: unknown): boolean {
|
|
56
|
-
return /Total output lines:|\.{3}\d+ tokens truncated\.{3}|\[\.{3}\d+ characters truncated/.test(
|
|
57
|
+
return /Total output lines:|\.{3}\d+ tokens truncated\.{3}|\[\.{3}\d+ characters truncated/.test(
|
|
58
|
+
String(out ?? ""),
|
|
59
|
+
);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
/** A `write_stdin` whose target PTY vanished (`write_stdin failed: session not found: N`). */
|
|
@@ -71,7 +74,10 @@ export function looksBinary(text: string): boolean {
|
|
|
71
74
|
* `write_stdin` keystroke payload reads cleanly in the row title.
|
|
72
75
|
*/
|
|
73
76
|
export function controlCaret(printable: string): string {
|
|
74
|
-
return String(printable).replace(
|
|
77
|
+
return String(printable).replace(
|
|
78
|
+
/[\u0000-\u001f]/g,
|
|
79
|
+
(c) => `^${String.fromCharCode(c.charCodeAt(0) + 64)}`,
|
|
80
|
+
);
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
/* --- V4A apply_patch diff -> GitFileDiff ------------------------------------ */
|
|
@@ -100,7 +106,13 @@ export type ApplyPatchOperation = {
|
|
|
100
106
|
*/
|
|
101
107
|
export function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff {
|
|
102
108
|
const status: GitFileDiff["status"] =
|
|
103
|
-
op.type === "create_file"
|
|
109
|
+
op.type === "create_file"
|
|
110
|
+
? "added"
|
|
111
|
+
: op.type === "delete_file"
|
|
112
|
+
? "deleted"
|
|
113
|
+
: op.moveTo
|
|
114
|
+
? "renamed"
|
|
115
|
+
: "modified";
|
|
104
116
|
const oldPath = op.moveTo ? op.path : null;
|
|
105
117
|
const path = op.moveTo || op.path;
|
|
106
118
|
|
|
@@ -136,21 +148,43 @@ export function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff {
|
|
|
136
148
|
// `@@ -0,0 +1,N @@` from the range fields once newLines is counted — a
|
|
137
149
|
// pre-baked partial header (e.g. `@@ +1 @@`) renders zero lines in a
|
|
138
150
|
// generic unified-diff parser.
|
|
139
|
-
cur = {
|
|
151
|
+
cur = {
|
|
152
|
+
oldStart: 0,
|
|
153
|
+
oldLines: 0,
|
|
154
|
+
newStart: 1,
|
|
155
|
+
newLines: 0,
|
|
156
|
+
header: "",
|
|
157
|
+
lines: [],
|
|
158
|
+
};
|
|
140
159
|
hunks.push(cur);
|
|
141
160
|
oldNo = 0;
|
|
142
161
|
newNo = 1;
|
|
143
162
|
}
|
|
144
163
|
if (raw.startsWith("+")) {
|
|
145
|
-
cur.lines.push({
|
|
164
|
+
cur.lines.push({
|
|
165
|
+
type: "add",
|
|
166
|
+
oldNo: null,
|
|
167
|
+
newNo: newNo++,
|
|
168
|
+
text: raw.slice(1),
|
|
169
|
+
});
|
|
146
170
|
cur.newLines += 1;
|
|
147
171
|
additions += 1;
|
|
148
172
|
} else if (raw.startsWith("-")) {
|
|
149
|
-
cur.lines.push({
|
|
173
|
+
cur.lines.push({
|
|
174
|
+
type: "del",
|
|
175
|
+
oldNo: oldNo++,
|
|
176
|
+
newNo: null,
|
|
177
|
+
text: raw.slice(1),
|
|
178
|
+
});
|
|
150
179
|
cur.oldLines += 1;
|
|
151
180
|
deletions += 1;
|
|
152
181
|
} else {
|
|
153
|
-
cur.lines.push({
|
|
182
|
+
cur.lines.push({
|
|
183
|
+
type: "context",
|
|
184
|
+
oldNo: oldNo++,
|
|
185
|
+
newNo: newNo++,
|
|
186
|
+
text: raw.replace(/^ /, ""),
|
|
187
|
+
});
|
|
154
188
|
cur.oldLines += 1;
|
|
155
189
|
cur.newLines += 1;
|
|
156
190
|
}
|
|
@@ -163,7 +197,17 @@ export function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff {
|
|
|
163
197
|
}
|
|
164
198
|
}
|
|
165
199
|
|
|
166
|
-
return {
|
|
200
|
+
return {
|
|
201
|
+
path,
|
|
202
|
+
oldPath,
|
|
203
|
+
status,
|
|
204
|
+
isBinary: false,
|
|
205
|
+
isImage: false,
|
|
206
|
+
additions,
|
|
207
|
+
deletions,
|
|
208
|
+
hunks,
|
|
209
|
+
truncated: false,
|
|
210
|
+
};
|
|
167
211
|
}
|
|
168
212
|
|
|
169
213
|
/**
|
|
@@ -173,7 +217,10 @@ export function v4aToGitFileDiff(op: ApplyPatchOperation): GitFileDiff {
|
|
|
173
217
|
* renderer and the turn-summary facet counter never drift.
|
|
174
218
|
*/
|
|
175
219
|
export function applyPatchOps(raw: unknown): ApplyPatchOperation[] {
|
|
176
|
-
const r = (raw ?? {}) as {
|
|
220
|
+
const r = (raw ?? {}) as {
|
|
221
|
+
operation?: ApplyPatchOperation;
|
|
222
|
+
operations?: ApplyPatchOperation[];
|
|
223
|
+
};
|
|
177
224
|
if (Array.isArray(r.operations)) {
|
|
178
225
|
return r.operations;
|
|
179
226
|
}
|
|
@@ -186,7 +233,8 @@ export function applyPatchOps(raw: unknown): ApplyPatchOperation[] {
|
|
|
186
233
|
* replays that omit `raw`). Centralizes the rawType-or-name check.
|
|
187
234
|
*/
|
|
188
235
|
export function isApplyPatch(item: { name: string; raw: unknown }): boolean {
|
|
189
|
-
const type =
|
|
236
|
+
const type =
|
|
237
|
+
item.raw && typeof item.raw === "object" ? (item.raw as { type?: unknown }).type : undefined;
|
|
190
238
|
return type === "apply_patch_call" || item.name === "apply_patch_call";
|
|
191
239
|
}
|
|
192
240
|
|
|
@@ -236,7 +284,21 @@ export function tailPeek(text: string): string {
|
|
|
236
284
|
* into a flat `{ text, isError }`. Non-MCP outputs pass through as their string
|
|
237
285
|
* form.
|
|
238
286
|
*/
|
|
239
|
-
export function unwrapMcpOutput(output: unknown): {
|
|
287
|
+
export function unwrapMcpOutput(output: unknown): {
|
|
288
|
+
text: string;
|
|
289
|
+
isError: boolean;
|
|
290
|
+
} {
|
|
291
|
+
// Managed MCP events persist a normalized single text part as
|
|
292
|
+
// `{ type: "text", text }`; accept it alongside the SDK-native content array.
|
|
293
|
+
if (
|
|
294
|
+
output &&
|
|
295
|
+
typeof output === "object" &&
|
|
296
|
+
(output as { type?: unknown }).type === "text" &&
|
|
297
|
+
typeof (output as { text?: unknown }).text === "string"
|
|
298
|
+
) {
|
|
299
|
+
const record = output as { text: string; isError?: unknown };
|
|
300
|
+
return { text: record.text, isError: Boolean(record.isError) };
|
|
301
|
+
}
|
|
240
302
|
if (output && typeof output === "object" && "content" in output) {
|
|
241
303
|
const record = output as { content?: unknown; isError?: unknown };
|
|
242
304
|
const isError = Boolean(record.isError);
|
|
@@ -245,11 +307,17 @@ export function unwrapMcpOutput(output: unknown): { text: string; isError: boole
|
|
|
245
307
|
(part): part is { type: string; text: string } =>
|
|
246
308
|
!!part && typeof part === "object" && (part as { type?: unknown }).type === "text",
|
|
247
309
|
);
|
|
248
|
-
return {
|
|
310
|
+
return {
|
|
311
|
+
text: textPart ? String(textPart.text) : JSON.stringify(output),
|
|
312
|
+
isError,
|
|
313
|
+
};
|
|
249
314
|
}
|
|
250
315
|
return { text: JSON.stringify(output), isError };
|
|
251
316
|
}
|
|
252
|
-
return {
|
|
317
|
+
return {
|
|
318
|
+
text: typeof output === "string" ? output : output == null ? "" : JSON.stringify(output),
|
|
319
|
+
isError: false,
|
|
320
|
+
};
|
|
253
321
|
}
|
|
254
322
|
|
|
255
323
|
/* --- computer-use screenshot extraction ------------------------------------- */
|
|
@@ -322,7 +390,8 @@ export function screenshotDataUrl(out: unknown): string | null {
|
|
|
322
390
|
/** Serialize whatever a Uint8Array became in JSON (number[], {"0":n,…} index
|
|
323
391
|
* map, or Buffer-JSON {type:"Buffer",data:[…]}) back into base64. */
|
|
324
392
|
function bytesToBase64(data: unknown): string | null {
|
|
325
|
-
const isByte = (n: unknown): n is number =>
|
|
393
|
+
const isByte = (n: unknown): n is number =>
|
|
394
|
+
typeof n === "number" && Number.isInteger(n) && n >= 0 && n <= 255;
|
|
326
395
|
let bytes: number[] | null = null;
|
|
327
396
|
if (Array.isArray(data) && data.every(isByte)) {
|
|
328
397
|
bytes = data;
|
|
@@ -349,7 +418,9 @@ function bytesToBase64(data: unknown): string | null {
|
|
|
349
418
|
for (let i = 0; i < bytes.length; i += CHUNK) {
|
|
350
419
|
binary += String.fromCharCode(...bytes.slice(i, i + CHUNK));
|
|
351
420
|
}
|
|
352
|
-
return typeof btoa === "function"
|
|
421
|
+
return typeof btoa === "function"
|
|
422
|
+
? btoa(binary)
|
|
423
|
+
: Buffer.from(binary, "binary").toString("base64");
|
|
353
424
|
} catch {
|
|
354
425
|
// A hostile/absurd payload must degrade to "no image", never crash a render.
|
|
355
426
|
return null;
|