@opengeni/react 0.6.2 → 0.8.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 +17 -6
- package/dist/{chunk-DEW2ZNF2.js → chunk-5C7RGAWA.js} +70 -37
- package/dist/chunk-5C7RGAWA.js.map +1 -0
- package/dist/index.d.ts +45 -9
- package/dist/index.js +1385 -732
- package/dist/index.js.map +1 -1
- package/dist/{machines-BD6h9P_s.d.ts → machines-BeZ3bD3t.d.ts} +2 -2
- package/dist/machines.d.ts +1 -1
- package/dist/machines.js +1 -1
- package/package.json +2 -2
- package/src/client.ts +1 -0
- package/src/components/chat-composer.tsx +127 -60
- package/src/components/code-editor.tsx +15 -15
- package/src/components/desktop-viewer.tsx +40 -36
- package/src/components/diff-view.tsx +22 -22
- package/src/components/enrollment-consent.tsx +13 -13
- package/src/components/file-browser.tsx +74 -67
- package/src/components/fleet-tile.tsx +3 -3
- package/src/components/machine-card.tsx +6 -6
- package/src/components/machine-status-pill.tsx +3 -3
- package/src/components/machines-dashboard.tsx +28 -14
- package/src/components/markdown.tsx +6 -6
- package/src/components/message-timeline.tsx +207 -12
- package/src/components/pierre-diff.tsx +9 -10
- package/src/components/pierre-file.tsx +8 -8
- package/src/components/sandbox-files.tsx +37 -40
- package/src/components/sandbox-terminal.tsx +9 -11
- package/src/components/session-status.tsx +2 -2
- package/src/components/workspace-dock.tsx +153 -49
- package/src/hooks/use-file-attachments.ts +45 -15
- package/src/hooks/use-session-events.ts +283 -8
- package/src/index.ts +2 -2
- package/src/lib/format.ts +32 -0
- package/src/lib/xterm-theme.ts +8 -11
- package/src/timeline/activity-rail.tsx +5 -2
- package/src/timeline/entrance.tsx +30 -0
- package/src/timeline/parsers.ts +104 -0
- package/src/timeline/projection.ts +22 -5
- package/src/timeline/screenshot-lightbox.tsx +1 -1
- package/src/timeline/shared.tsx +4 -1
- package/src/timeline/tool-diff.tsx +1 -1
- package/src/timeline/tool-renderers.tsx +46 -7
- package/src/timeline/turn-summary.tsx +24 -4
- package/styles/tokens.css +8 -0
- package/dist/chunk-DEW2ZNF2.js.map +0 -1
package/README.md
CHANGED
|
@@ -53,12 +53,19 @@ import {
|
|
|
53
53
|
const client = new OpenGeniClient({ baseUrl: "/api/opengeni" }); // proxy through your API
|
|
54
54
|
|
|
55
55
|
function OpsChannel({ sessionId }: { sessionId: string }) {
|
|
56
|
-
const { timeline, sessionStatus } = useSessionEvents(sessionId);
|
|
56
|
+
const { timeline, sessionStatus, hasOlder, loadingOlder, loadOlder } = useSessionEvents(sessionId);
|
|
57
57
|
const composer = useComposer(sessionId);
|
|
58
58
|
return (
|
|
59
59
|
<div className="flex h-full flex-col">
|
|
60
60
|
{sessionStatus ? <SessionStatus status={sessionStatus} /> : null}
|
|
61
|
-
<MessageTimeline
|
|
61
|
+
<MessageTimeline
|
|
62
|
+
items={timeline}
|
|
63
|
+
status={sessionStatus}
|
|
64
|
+
hasOlder={hasOlder}
|
|
65
|
+
loadingOlder={loadingOlder}
|
|
66
|
+
onLoadOlder={() => void loadOlder()}
|
|
67
|
+
className="min-h-0 flex-1"
|
|
68
|
+
/>
|
|
62
69
|
<ChatComposer composer={composer} status={sessionStatus} />
|
|
63
70
|
</div>
|
|
64
71
|
);
|
|
@@ -75,10 +82,14 @@ export function App() {
|
|
|
75
82
|
|
|
76
83
|
## Hooks
|
|
77
84
|
|
|
78
|
-
- `useSessionEvents(sessionId)` —
|
|
79
|
-
exactly-once/ordered event delivery
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
- `useSessionEvents(sessionId)` — loads a compact, bounded tail window by
|
|
86
|
+
default, then live-streams on the SDK's exactly-once/ordered event delivery.
|
|
87
|
+
Initial replay is capped at three 5000-row raw pages and `loadOlder` at two;
|
|
88
|
+
timeline group density is only an early stop. It returns the raw windowed
|
|
89
|
+
`events`, projected `timeline`, latest `sessionStatus`, connection state, and
|
|
90
|
+
older-history controls (`hasOlder`, `loadingOlder`, `loadOlder`). Pass
|
|
91
|
+
`replay: "full"` to opt back into full replay; a nonzero `after` keeps the
|
|
92
|
+
previous resume semantics.
|
|
82
93
|
- `useComposer(sessionId, { sendExtras, defaultMode })` — draft/send/interrupt
|
|
83
94
|
state plus the compose-time **queue-vs-steer** choice (`mode`/`setMode`,
|
|
84
95
|
default `"queue"`): queue stacks the message behind the running turn, steer
|
|
@@ -75,7 +75,7 @@ function ConnectionStatusPill({ status, label, size = "md", className }) {
|
|
|
75
75
|
"data-connection-status": status,
|
|
76
76
|
className: cn(
|
|
77
77
|
"og-root inline-flex shrink-0 items-center rounded-full border font-medium",
|
|
78
|
-
size === "sm" ? "gap-1 px-1.5 py-px text-
|
|
78
|
+
size === "sm" ? "gap-1 px-1.5 py-px text-og-xs" : "gap-1.5 px-2 py-0.5 text-og-sm",
|
|
79
79
|
meta.badgeClassName,
|
|
80
80
|
className
|
|
81
81
|
),
|
|
@@ -101,7 +101,7 @@ function MachineStatusPill({ state, sharedSessionCount, size = "md", className }
|
|
|
101
101
|
"data-state-badge": state,
|
|
102
102
|
className: cn(
|
|
103
103
|
"inline-flex shrink-0 items-center rounded-full border font-medium",
|
|
104
|
-
size === "sm" ? "px-1.5 py-px text-
|
|
104
|
+
size === "sm" ? "px-1.5 py-px text-og-xs" : "px-2 py-0.5 text-og-sm",
|
|
105
105
|
stateBadge.badgeClassName
|
|
106
106
|
),
|
|
107
107
|
children: stateBadge.label
|
|
@@ -114,7 +114,7 @@ function MachineStatusPill({ state, sharedSessionCount, size = "md", className }
|
|
|
114
114
|
className: cn(
|
|
115
115
|
"inline-flex shrink-0 items-center gap-1 rounded-full border font-medium",
|
|
116
116
|
"text-og-accent border-og-accent/30 bg-og-accent-soft",
|
|
117
|
-
size === "sm" ? "px-1.5 py-px text-
|
|
117
|
+
size === "sm" ? "px-1.5 py-px text-og-xs" : "px-2 py-0.5 text-og-sm"
|
|
118
118
|
),
|
|
119
119
|
title: `${sharedSessionCount} sessions are on this machine`,
|
|
120
120
|
children: [
|
|
@@ -202,6 +202,21 @@ function tryParseJson(text) {
|
|
|
202
202
|
return void 0;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
+
function humanizeFailureReason(reason) {
|
|
206
|
+
if (!reason) {
|
|
207
|
+
return reason;
|
|
208
|
+
}
|
|
209
|
+
const normalized = reason.toLowerCase();
|
|
210
|
+
const authFailure = normalized.includes("incorrect api key") || normalized.includes("invalid api key") || normalized.includes("invalid_api_key") || normalized.includes("platform.openai.com/account/api-keys") || normalized.includes("401") && (normalized.includes("api key") || normalized.includes("unauthorized"));
|
|
211
|
+
if (authFailure) {
|
|
212
|
+
return "The model provider rejected this deployment's engine credentials. Sending messages won't help until the deployment's engine configuration is fixed.";
|
|
213
|
+
}
|
|
214
|
+
const quotaFailure = normalized.includes("insufficient_quota") || normalized.includes("exceeded your current quota");
|
|
215
|
+
if (quotaFailure) {
|
|
216
|
+
return "The model provider refused the request: this deployment's provider quota is exhausted.";
|
|
217
|
+
}
|
|
218
|
+
return reason;
|
|
219
|
+
}
|
|
205
220
|
|
|
206
221
|
// src/components/machine-metrics.tsx
|
|
207
222
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -370,17 +385,17 @@ function MachineCard({ machine, onAttach, attaching, className }) {
|
|
|
370
385
|
/* @__PURE__ */ jsx3("span", { className: "mt-0.5 shrink-0", children: /* @__PURE__ */ jsx3(KindIcon, { machine }) }),
|
|
371
386
|
/* @__PURE__ */ jsxs3("div", { className: "min-w-0", children: [
|
|
372
387
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
|
|
373
|
-
/* @__PURE__ */ jsx3("span", { className: "truncate text-
|
|
388
|
+
/* @__PURE__ */ jsx3("span", { className: "truncate text-og-base font-medium text-og-fg", children: machine.name }),
|
|
374
389
|
machine.active ? /* @__PURE__ */ jsx3(
|
|
375
390
|
"span",
|
|
376
391
|
{
|
|
377
392
|
"data-active-marker": true,
|
|
378
|
-
className: "shrink-0 rounded-full border border-og-accent/30 bg-og-accent-soft px-1.5 py-px text-
|
|
393
|
+
className: "shrink-0 rounded-full border border-og-accent/30 bg-og-accent-soft px-1.5 py-px text-og-xs font-medium text-og-accent",
|
|
379
394
|
children: "Active"
|
|
380
395
|
}
|
|
381
396
|
) : null
|
|
382
397
|
] }),
|
|
383
|
-
/* @__PURE__ */ jsxs3("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-
|
|
398
|
+
/* @__PURE__ */ jsxs3("div", { className: "mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-og-xs text-og-fg-subtle", children: [
|
|
384
399
|
/* @__PURE__ */ jsx3("span", { className: "capitalize", children: machine.isSessionGroup ? "session sandbox" : machine.kind }),
|
|
385
400
|
/* @__PURE__ */ jsx3("span", { "aria-hidden": true, children: "\xB7" }),
|
|
386
401
|
/* @__PURE__ */ jsxs3("span", { className: "font-og-mono", children: [
|
|
@@ -402,7 +417,7 @@ function MachineCard({ machine, onAttach, attaching, className }) {
|
|
|
402
417
|
"p",
|
|
403
418
|
{
|
|
404
419
|
"data-shared-disclosure": true,
|
|
405
|
-
className: "flex items-center gap-1.5 rounded-og-md border border-og-accent/25 bg-og-accent-soft px-2.5 py-1.5 text-
|
|
420
|
+
className: "flex items-center gap-1.5 rounded-og-md border border-og-accent/25 bg-og-accent-soft px-2.5 py-1.5 text-og-xs text-og-fg-muted",
|
|
406
421
|
children: [
|
|
407
422
|
/* @__PURE__ */ jsx3(UsersIcon, { className: "size-3.5 shrink-0 text-og-accent", "aria-hidden": true }),
|
|
408
423
|
"Shared \u2014 ",
|
|
@@ -412,7 +427,7 @@ function MachineCard({ machine, onAttach, attaching, className }) {
|
|
|
412
427
|
}
|
|
413
428
|
) : null,
|
|
414
429
|
/* @__PURE__ */ jsx3(MachineMetrics, { metrics: machine.metrics }),
|
|
415
|
-
/* @__PURE__ */ jsxs3("div", { className: "mt-1 flex items-center justify-between gap-3 text-
|
|
430
|
+
/* @__PURE__ */ jsxs3("div", { className: "mt-1 flex items-center justify-between gap-3 text-og-xs text-og-fg-subtle", children: [
|
|
416
431
|
/* @__PURE__ */ jsx3("span", { children: machine.lastSeenAt ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
417
432
|
"Last seen ",
|
|
418
433
|
formatRelativeTime(machine.lastSeenAt)
|
|
@@ -425,7 +440,7 @@ function MachineCard({ machine, onAttach, attaching, className }) {
|
|
|
425
440
|
disabled: attaching,
|
|
426
441
|
onClick: () => onAttach?.(machine),
|
|
427
442
|
className: cn(
|
|
428
|
-
"rounded-og-sm border border-og-border px-2.5 py-1 text-
|
|
443
|
+
"rounded-og-sm border border-og-border px-2.5 py-1 text-og-xs font-medium text-og-fg-muted transition-colors pointer-coarse:min-h-10",
|
|
429
444
|
"hover:border-og-border-strong hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50"
|
|
430
445
|
),
|
|
431
446
|
children: attaching ? "Switching\u2026" : "Attach"
|
|
@@ -449,8 +464,8 @@ function EmptyState({ onEnroll }) {
|
|
|
449
464
|
children: [
|
|
450
465
|
/* @__PURE__ */ jsx4("span", { className: "flex size-10 items-center justify-center rounded-full bg-og-surface-2 text-og-fg-subtle", children: /* @__PURE__ */ jsx4(LaptopIcon2, { className: "size-5", "aria-hidden": true }) }),
|
|
451
466
|
/* @__PURE__ */ jsxs4("div", { className: "space-y-1", children: [
|
|
452
|
-
/* @__PURE__ */ jsx4("p", { className: "text-
|
|
453
|
-
/* @__PURE__ */ jsx4("p", { className: "max-w-xs text-
|
|
467
|
+
/* @__PURE__ */ jsx4("p", { className: "text-og-base font-medium text-og-fg", children: "No machines yet" }),
|
|
468
|
+
/* @__PURE__ */ jsx4("p", { className: "max-w-xs text-og-sm text-og-fg-muted", children: "Enroll your own computer to run the agent on it \u2014 your files, your terminal, your desktop." })
|
|
454
469
|
] }),
|
|
455
470
|
onEnroll ? /* @__PURE__ */ jsxs4(
|
|
456
471
|
"button",
|
|
@@ -458,7 +473,7 @@ function EmptyState({ onEnroll }) {
|
|
|
458
473
|
type: "button",
|
|
459
474
|
"data-enroll-cta": true,
|
|
460
475
|
onClick: onEnroll,
|
|
461
|
-
className: "inline-flex items-center gap-1.5 rounded-og-sm bg-og-accent px-3 py-1.5 text-
|
|
476
|
+
className: "inline-flex items-center gap-1.5 rounded-og-sm bg-og-accent px-3 py-1.5 text-og-sm font-medium text-og-accent-fg transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-10",
|
|
462
477
|
children: [
|
|
463
478
|
/* @__PURE__ */ jsx4(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
464
479
|
"Enroll a machine"
|
|
@@ -472,12 +487,13 @@ function EmptyState({ onEnroll }) {
|
|
|
472
487
|
function Header({
|
|
473
488
|
count,
|
|
474
489
|
onEnroll,
|
|
475
|
-
onRefresh
|
|
490
|
+
onRefresh,
|
|
491
|
+
loading
|
|
476
492
|
}) {
|
|
477
493
|
return /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-3", children: [
|
|
478
494
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-baseline gap-2", children: [
|
|
479
|
-
/* @__PURE__ */ jsx4("h2", { className: "text-
|
|
480
|
-
/* @__PURE__ */ jsx4("span", { className: "font-og-mono text-
|
|
495
|
+
/* @__PURE__ */ jsx4("h2", { className: "text-og-base font-semibold text-og-fg", children: "Machines" }),
|
|
496
|
+
/* @__PURE__ */ jsx4("span", { className: "font-og-mono text-og-xs text-og-fg-subtle", children: count })
|
|
481
497
|
] }),
|
|
482
498
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
|
|
483
499
|
onRefresh ? /* @__PURE__ */ jsx4(
|
|
@@ -488,7 +504,7 @@ function Header({
|
|
|
488
504
|
onClick: onRefresh,
|
|
489
505
|
title: "Refresh",
|
|
490
506
|
className: "rounded-og-sm p-1.5 text-og-fg-subtle transition-colors hover:bg-og-surface-2 hover:text-og-fg",
|
|
491
|
-
children: /* @__PURE__ */ jsx4(RefreshCwIcon, { className: "size-3.5", "aria-hidden": true })
|
|
507
|
+
children: /* @__PURE__ */ jsx4(RefreshCwIcon, { className: cn("size-3.5", loading && "animate-og-spin"), "aria-hidden": true })
|
|
492
508
|
}
|
|
493
509
|
) : null,
|
|
494
510
|
onEnroll ? /* @__PURE__ */ jsxs4(
|
|
@@ -497,10 +513,10 @@ function Header({
|
|
|
497
513
|
type: "button",
|
|
498
514
|
"data-enroll-cta": true,
|
|
499
515
|
onClick: onEnroll,
|
|
500
|
-
className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2.5 py-1 text-
|
|
516
|
+
className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2.5 py-1 text-og-sm font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg pointer-coarse:min-h-10",
|
|
501
517
|
children: [
|
|
502
518
|
/* @__PURE__ */ jsx4(PlusIcon, { className: "size-3.5", "aria-hidden": true }),
|
|
503
|
-
"Enroll"
|
|
519
|
+
"Enroll machine"
|
|
504
520
|
]
|
|
505
521
|
}
|
|
506
522
|
) : null
|
|
@@ -520,15 +536,31 @@ function MachinesDashboard({
|
|
|
520
536
|
}) {
|
|
521
537
|
const isEmpty = !loading && !error && machines.length === 0;
|
|
522
538
|
return /* @__PURE__ */ jsxs4("section", { "data-machines-dashboard": true, className: cn("og-root flex flex-col gap-3", className), children: [
|
|
523
|
-
/* @__PURE__ */ jsx4(Header, { count: machines.length, onEnroll, onRefresh }),
|
|
539
|
+
/* @__PURE__ */ jsx4(Header, { count: machines.length, onEnroll, onRefresh, loading }),
|
|
524
540
|
error ? /* @__PURE__ */ jsxs4(
|
|
525
|
-
"
|
|
541
|
+
"div",
|
|
526
542
|
{
|
|
527
543
|
"data-machines-error": true,
|
|
528
|
-
className: "rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-
|
|
544
|
+
className: "flex flex-wrap items-center justify-between gap-2 rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-og-sm text-og-status-failed",
|
|
529
545
|
children: [
|
|
530
|
-
"
|
|
531
|
-
|
|
546
|
+
/* @__PURE__ */ jsxs4("span", { children: [
|
|
547
|
+
"Could not load machines: ",
|
|
548
|
+
error.message
|
|
549
|
+
] }),
|
|
550
|
+
onRefresh ? /* @__PURE__ */ jsxs4(
|
|
551
|
+
"button",
|
|
552
|
+
{
|
|
553
|
+
type: "button",
|
|
554
|
+
"data-machines-retry": true,
|
|
555
|
+
onClick: onRefresh,
|
|
556
|
+
disabled: loading,
|
|
557
|
+
className: "inline-flex items-center gap-1.5 rounded-og-sm border border-og-status-failed/30 px-2 py-1 text-og-xs font-medium transition-colors hover:border-og-status-failed/50 disabled:cursor-not-allowed disabled:opacity-60 pointer-coarse:min-h-10",
|
|
558
|
+
children: [
|
|
559
|
+
/* @__PURE__ */ jsx4(RefreshCwIcon, { className: cn("size-3.5", loading && "animate-og-spin"), "aria-hidden": true }),
|
|
560
|
+
loading ? "Retrying\u2026" : "Retry"
|
|
561
|
+
]
|
|
562
|
+
}
|
|
563
|
+
) : null
|
|
532
564
|
]
|
|
533
565
|
}
|
|
534
566
|
) : null,
|
|
@@ -756,8 +788,8 @@ function Capability({ icon, title, body }) {
|
|
|
756
788
|
return /* @__PURE__ */ jsxs7("li", { className: "flex items-start gap-2.5", children: [
|
|
757
789
|
/* @__PURE__ */ jsx7("span", { className: "mt-0.5 shrink-0 text-og-status-failed", children: icon }),
|
|
758
790
|
/* @__PURE__ */ jsxs7("span", { className: "min-w-0", children: [
|
|
759
|
-
/* @__PURE__ */ jsx7("span", { className: "block text-
|
|
760
|
-
/* @__PURE__ */ jsx7("span", { className: "block text-
|
|
791
|
+
/* @__PURE__ */ jsx7("span", { className: "block text-og-base font-medium text-og-fg", children: title }),
|
|
792
|
+
/* @__PURE__ */ jsx7("span", { className: "block text-og-sm text-og-fg-muted", children: body })
|
|
761
793
|
] })
|
|
762
794
|
] });
|
|
763
795
|
}
|
|
@@ -817,15 +849,15 @@ function EnrollmentConsent({
|
|
|
817
849
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-3", children: [
|
|
818
850
|
/* @__PURE__ */ jsx7("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-og-status-failed/15 text-og-status-failed", children: /* @__PURE__ */ jsx7(ShieldAlertIcon, { className: "size-5", "aria-hidden": true }) }),
|
|
819
851
|
/* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
|
|
820
|
-
/* @__PURE__ */ jsx7("h1", { className: "text-
|
|
821
|
-
/* @__PURE__ */ jsxs7("p", { className: "mt-1 text-
|
|
852
|
+
/* @__PURE__ */ jsx7("h1", { className: "text-og-md font-semibold text-og-fg", children: "Give the agent your whole machine?" }),
|
|
853
|
+
/* @__PURE__ */ jsxs7("p", { className: "mt-1 text-og-base text-og-fg-muted", children: [
|
|
822
854
|
"Approving lets the OpenGeni agent run on ",
|
|
823
855
|
/* @__PURE__ */ jsx7("span", { className: "font-medium text-og-fg", children: machine.machineName }),
|
|
824
856
|
" with full access. This is your real computer \u2014 not a sandbox."
|
|
825
857
|
] })
|
|
826
858
|
] })
|
|
827
859
|
] }),
|
|
828
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-2 rounded-og-md border border-og-border bg-og-surface-2 px-3 py-2 text-
|
|
860
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-2 rounded-og-md border border-og-border bg-og-surface-2 px-3 py-2 text-og-sm", children: [
|
|
829
861
|
/* @__PURE__ */ jsx7(LaptopIcon5, { className: "size-4 text-og-fg-subtle", "aria-hidden": true }),
|
|
830
862
|
/* @__PURE__ */ jsx7("span", { className: "font-medium text-og-fg", children: machine.machineName }),
|
|
831
863
|
/* @__PURE__ */ jsxs7("span", { className: "font-og-mono text-og-fg-subtle", children: [
|
|
@@ -878,19 +910,19 @@ function EnrollmentConsent({
|
|
|
878
910
|
checked: allowScreenControl,
|
|
879
911
|
disabled: busy,
|
|
880
912
|
onChange: (e) => setAllowScreenControl(e.target.checked),
|
|
881
|
-
className: "mt-0.5 size-4 accent-
|
|
913
|
+
className: "mt-0.5 size-4 accent-og-accent"
|
|
882
914
|
}
|
|
883
915
|
),
|
|
884
916
|
/* @__PURE__ */ jsxs7("span", { className: "min-w-0", children: [
|
|
885
|
-
/* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1.5 text-
|
|
917
|
+
/* @__PURE__ */ jsxs7("span", { className: "flex items-center gap-1.5 text-og-base font-medium text-og-fg", children: [
|
|
886
918
|
/* @__PURE__ */ jsx7(ScreenShareIcon, { className: "size-3.5 text-og-fg-muted", "aria-hidden": true }),
|
|
887
919
|
"Also let the agent control my mouse & keyboard"
|
|
888
920
|
] }),
|
|
889
|
-
/* @__PURE__ */ jsx7("span", { className: "mt-0.5 block text-
|
|
921
|
+
/* @__PURE__ */ jsx7("span", { className: "mt-0.5 block text-og-sm text-og-fg-muted", children: "Optional. Enables computer-use \u2014 the agent can move the pointer, type, and click on this machine's desktop. Leave off to let it only watch." })
|
|
890
922
|
] })
|
|
891
923
|
]
|
|
892
924
|
}
|
|
893
|
-
) : /* @__PURE__ */ jsxs7("p", { className: "flex items-start gap-2 rounded-og-md border border-og-border bg-og-bg px-3 py-2 text-
|
|
925
|
+
) : /* @__PURE__ */ jsxs7("p", { className: "flex items-start gap-2 rounded-og-md border border-og-border bg-og-bg px-3 py-2 text-og-sm text-og-fg-muted", children: [
|
|
894
926
|
/* @__PURE__ */ jsx7(CircleAlertIcon, { className: "mt-px size-3.5 shrink-0 text-og-fg-subtle", "aria-hidden": true }),
|
|
895
927
|
"This machine has no display, so screen control isn't available \u2014 files, terminal, and git only."
|
|
896
928
|
] }),
|
|
@@ -902,7 +934,7 @@ function EnrollmentConsent({
|
|
|
902
934
|
"data-deny": true,
|
|
903
935
|
disabled: busy,
|
|
904
936
|
onClick: () => onDeny?.(),
|
|
905
|
-
className: "flex-1 rounded-og-sm border border-og-border px-3 py-2 text-sm font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg disabled:opacity-50",
|
|
937
|
+
className: "flex-1 rounded-og-sm border border-og-border px-3 py-2 text-og-sm font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg disabled:opacity-50 pointer-coarse:min-h-10",
|
|
906
938
|
children: "Cancel"
|
|
907
939
|
}
|
|
908
940
|
),
|
|
@@ -913,7 +945,7 @@ function EnrollmentConsent({
|
|
|
913
945
|
"data-approve": true,
|
|
914
946
|
disabled: busy,
|
|
915
947
|
onClick: () => onApprove?.(allowScreenControl),
|
|
916
|
-
className: "flex-1 rounded-og-sm bg-og-status-failed px-3 py-2 text-sm font-semibold text-
|
|
948
|
+
className: "flex-1 rounded-og-sm bg-og-status-failed px-3 py-2 text-og-sm font-semibold text-og-accent-fg transition-colors hover:opacity-90 disabled:opacity-50 pointer-coarse:min-h-10",
|
|
917
949
|
children: busy ? "Connecting\u2026" : "Grant full access"
|
|
918
950
|
}
|
|
919
951
|
)
|
|
@@ -941,8 +973,8 @@ function ConsentResult({
|
|
|
941
973
|
),
|
|
942
974
|
children: [
|
|
943
975
|
/* @__PURE__ */ jsx7("span", { className: cn("flex size-10 items-center justify-center rounded-full bg-og-surface-2", iconClass), children: /* @__PURE__ */ jsx7(LaptopIcon5, { className: "size-5", "aria-hidden": true }) }),
|
|
944
|
-
/* @__PURE__ */ jsx7("h1", { className: "text-
|
|
945
|
-
/* @__PURE__ */ jsx7("p", { className: "max-w-sm text-
|
|
976
|
+
/* @__PURE__ */ jsx7("h1", { className: "text-og-md font-semibold text-og-fg", children: title }),
|
|
977
|
+
/* @__PURE__ */ jsx7("p", { className: "max-w-sm text-og-base text-og-fg-muted", children: body })
|
|
946
978
|
]
|
|
947
979
|
}
|
|
948
980
|
);
|
|
@@ -1219,6 +1251,7 @@ export {
|
|
|
1219
1251
|
truncate,
|
|
1220
1252
|
stringifyPayload,
|
|
1221
1253
|
tryParseJson,
|
|
1254
|
+
humanizeFailureReason,
|
|
1222
1255
|
cn,
|
|
1223
1256
|
connectionStatusForState,
|
|
1224
1257
|
CONNECTION_STATUS_META,
|
|
@@ -1235,4 +1268,4 @@ export {
|
|
|
1235
1268
|
EnrollmentConsent,
|
|
1236
1269
|
useMachines
|
|
1237
1270
|
};
|
|
1238
|
-
//# sourceMappingURL=chunk-
|
|
1271
|
+
//# sourceMappingURL=chunk-5C7RGAWA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/machines.ts","../src/lib/cn.ts","../src/components/machine-status-pill.tsx","../src/lib/format.ts","../src/components/machine-metrics.tsx","../src/components/machine-card.tsx","../src/components/machines-dashboard.tsx","../src/components/machine-dock-bar.tsx","../src/components/enrollment-device-flow.tsx","../src/components/enrollment-consent.tsx","../src/hooks/use-machines.ts","../src/provider.tsx","../src/hooks/internal.ts"],"sourcesContent":["// ----------------------------------------------------------------------------\n// Bring-your-own-compute — Machines view-model.\n//\n// The data-contract types (MachineView / MetricSample / MachinesResponse /\n// MachineMetricsSeriesResponse / MachineKind / MachineState) are the\n// orchestrator-owned SHARED DATA CONTRACT that M10 ships in `@opengeni/sdk`\n// (hand-written mirrors of `@opengeni/contracts`, pinned by contract-parity).\n// M9 RE-EXPORTS them here so the dashboard UI imports a single, stable name and\n// never drifts from the API — exactly as the contract intends.\n//\n// (During concurrent M9/M10 development this module briefly carried a local\n// view-model with the same field names; once M10 landed the SDK types we\n// reconciled to re-export them — the field names were identical by design.)\n//\n// Endpoints these model (M10 owns the SDK client methods):\n// GET /v1/workspaces/:ws/machines -> MachinesResponse\n// GET /v1/workspaces/:ws/machines/:enrollmentId/metrics/series?window=1h\n// -> { samples: MetricSample[] }\n// ----------------------------------------------------------------------------\nimport type {\n MachineKind,\n MachineMetricsSeriesResponse,\n MachinesResponse,\n MachineState,\n MachineView,\n MetricSample,\n} from \"@opengeni/sdk\";\n\nexport type {\n MachineKind,\n MachineMetricsSeriesResponse,\n MachinesResponse,\n MachineState,\n MachineView,\n MetricSample,\n};\n\n// --- connection-status grouping (a PURE UI projection — not a contract type) --\n\n/**\n * The three connection-status pill values the UI surfaces across the dashboard,\n * the dock, and the timeline. `consent_required` / `display_unavailable` /\n * `enrolling` are NOT connection states — they map onto a connection state for\n * the pill and carry their own badge separately.\n */\nexport type ConnectionStatus = \"online\" | \"reconnecting\" | \"offline\";\n\n/** Project a machine `state` onto its connection-status pill value. */\nexport function connectionStatusForState(state: MachineState): ConnectionStatus {\n switch (state) {\n case \"online\":\n case \"consent_required\":\n case \"display_unavailable\":\n // The control plane is reachable; the limitation is consent / no display.\n return \"online\";\n case \"reconnecting\":\n case \"enrolling\":\n return \"reconnecting\";\n case \"offline\":\n return \"offline\";\n default: {\n // Exhaustiveness guard — a new state must be classified explicitly.\n const _never: never = state;\n return _never;\n }\n }\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n/* ----------------------------------------------------------------------------\n tailwind-merge, taught our design tokens.\n\n Our type scale and color ramp share the `og-` prefix: `text-og-base` is a\n FONT SIZE, `text-og-fg-muted` is a COLOR. Stock tailwind-merge can't tell\n them apart — it lumps every `text-og-*` into one `font-size` group and, when\n two land in the same class list, drops the earlier one. That silently ate the\n size off rows like `text-og-base text-og-fg-muted`, leaving titles at the\n browser-default 16px. Register the custom font-size scale so the size and the\n color live in different conflict groups and both survive a merge.\n -------------------------------------------------------------------------- */\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n \"font-size\": [{ text: [\"og-xs\", \"og-sm\", \"og-base\", \"og-md\"] }],\n },\n },\n});\n\n/** Merge class names with Tailwind-aware conflict resolution. */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cn } from \"../lib/cn\";\nimport {\n type ConnectionStatus,\n connectionStatusForState,\n type MachineState,\n} from \"../types/machines\";\n\nexport type ConnectionStatusMeta = {\n label: string;\n dotClassName: string;\n badgeClassName: string;\n /** Live/transient states breathe; settled states hold still. */\n pulse: boolean;\n};\n\n/** Token-backed meta for the three connection-status pill values. */\nexport const CONNECTION_STATUS_META: Record<ConnectionStatus, ConnectionStatusMeta> = {\n online: {\n label: \"Online\",\n dotClassName: \"bg-og-status-running\",\n badgeClassName: \"text-og-status-running border-og-status-running/30 bg-og-status-running/10\",\n pulse: false,\n },\n reconnecting: {\n label: \"Reconnecting\",\n dotClassName: \"bg-og-status-waiting\",\n badgeClassName: \"text-og-status-waiting border-og-status-waiting/35 bg-og-status-waiting/10\",\n pulse: true,\n },\n offline: {\n label: \"Offline\",\n dotClassName: \"bg-og-status-failed\",\n badgeClassName: \"text-og-fg-subtle border-og-border bg-og-status-failed/10\",\n pulse: false,\n },\n};\n\nexport type MachineStateBadgeMeta = {\n label: string;\n badgeClassName: string;\n};\n\n/**\n * The non-connection state badges that ride ALONGSIDE the connection pill —\n * `consent_required` / `display_unavailable` / `enrolling` describe a capability\n * limitation, not reachability, so they render as their own tinted chip.\n */\nexport const MACHINE_STATE_BADGE_META: Partial<Record<MachineState, MachineStateBadgeMeta>> = {\n consent_required: {\n label: \"Consent required\",\n badgeClassName: \"text-og-status-waiting border-og-status-waiting/35 bg-og-status-waiting/10\",\n },\n display_unavailable: {\n label: \"No display\",\n badgeClassName: \"text-og-fg-muted border-og-border bg-og-surface-2\",\n },\n enrolling: {\n label: \"Enrolling\",\n badgeClassName: \"text-og-accent border-og-accent/30 bg-og-accent-soft\",\n },\n};\n\nexport type ConnectionStatusPillProps = {\n status: ConnectionStatus;\n /** Override the label (\"Online\" -> \"Connected\", ...). */\n label?: string | undefined;\n size?: \"sm\" | \"md\" | undefined;\n className?: string | undefined;\n};\n\n/**\n * The connection-status pill (online / reconnecting / offline) surfaced across\n * the Machines dashboard, the dock header, and the session timeline. Reconnecting\n * breathes (the resiliency-as-headline blip), online/offline hold still.\n */\nexport function ConnectionStatusPill({ status, label, size = \"md\", className }: ConnectionStatusPillProps) {\n const meta = CONNECTION_STATUS_META[status];\n return (\n <span\n data-connection-status={status}\n className={cn(\n \"og-root inline-flex shrink-0 items-center rounded-full border font-medium\",\n size === \"sm\" ? \"gap-1 px-1.5 py-px text-og-xs\" : \"gap-1.5 px-2 py-0.5 text-og-sm\",\n meta.badgeClassName,\n className,\n )}\n >\n <ConnectionDot status={status} className={size === \"sm\" ? \"size-1\" : \"size-1.5\"} />\n {label ?? meta.label}\n </span>\n );\n}\n\nexport type ConnectionDotProps = {\n status: ConnectionStatus;\n className?: string | undefined;\n};\n\n/** Just the dot — for dense rows, the dock header, and timeline notices. */\nexport function ConnectionDot({ status, className }: ConnectionDotProps) {\n const meta = CONNECTION_STATUS_META[status];\n return (\n <span className={cn(\"relative inline-flex size-1.5 shrink-0 rounded-full\", meta.dotClassName, className)}>\n {meta.pulse ? <span className={cn(\"absolute inset-0 animate-og-pulse rounded-full\", meta.dotClassName)} /> : null}\n </span>\n );\n}\n\nexport type MachineStatusPillProps = {\n /** The machine's full state — drives the connection pill + any state badge. */\n state: MachineState;\n /** How many live sessions share this lease (renders a \"Shared\" chip when >1). */\n sharedSessionCount?: number | undefined;\n size?: \"sm\" | \"md\" | undefined;\n className?: string | undefined;\n};\n\n/**\n * The composite machine status surface: the connection pill PLUS any\n * consent/display/enrolling badge PLUS a shared-in-use chip. One component the\n * dashboard row, the dock header, and the timeline all reuse so the status\n * language is identical everywhere.\n */\nexport function MachineStatusPill({ state, sharedSessionCount, size = \"md\", className }: MachineStatusPillProps) {\n const stateBadge = MACHINE_STATE_BADGE_META[state];\n const shared = (sharedSessionCount ?? 0) > 1;\n return (\n <span className={cn(\"og-root inline-flex flex-wrap items-center gap-1\", className)} data-machine-state={state}>\n <ConnectionStatusPill status={connectionStatusForState(state)} size={size} />\n {stateBadge ? (\n <span\n data-state-badge={state}\n className={cn(\n \"inline-flex shrink-0 items-center rounded-full border font-medium\",\n size === \"sm\" ? \"px-1.5 py-px text-og-xs\" : \"px-2 py-0.5 text-og-sm\",\n stateBadge.badgeClassName,\n )}\n >\n {stateBadge.label}\n </span>\n ) : null}\n {shared ? (\n <span\n data-shared-chip\n className={cn(\n \"inline-flex shrink-0 items-center gap-1 rounded-full border font-medium\",\n \"text-og-accent border-og-accent/30 bg-og-accent-soft\",\n size === \"sm\" ? \"px-1.5 py-px text-og-xs\" : \"px-2 py-0.5 text-og-sm\",\n )}\n title={`${sharedSessionCount} sessions are on this machine`}\n >\n Shared · {sharedSessionCount}\n </span>\n ) : null}\n </span>\n );\n}\n","/** Compact relative time: \"now\", \"42s\", \"7m\", \"3h\", \"2d\", then a date. */\nexport function formatRelativeTime(iso: string, now: Date = new Date()): string {\n const then = new Date(iso).getTime();\n if (Number.isNaN(then)) {\n return \"\";\n }\n const seconds = Math.max(0, Math.floor((now.getTime() - then) / 1000));\n if (seconds < 10) {\n return \"now\";\n }\n if (seconds < 60) {\n return `${seconds}s`;\n }\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) {\n return `${minutes}m`;\n }\n const hours = Math.floor(minutes / 60);\n if (hours < 24) {\n return `${hours}h`;\n }\n const days = Math.floor(hours / 24);\n if (days < 14) {\n return `${days}d`;\n }\n return new Date(iso).toLocaleDateString();\n}\n\n/** Human-readable byte size: \"512 B\", \"8.0 KB\", \"1.4 MB\", \"3 GB\". */\nexport function formatBytes(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const units = [\"KB\", \"MB\", \"GB\"] as const;\n let value = bytes / 1024;\n for (const unit of units) {\n if (value < 1024 || unit === \"GB\") {\n return `${value.toFixed(value < 10 ? 1 : 0)} ${unit}`;\n }\n value /= 1024;\n }\n return `${bytes} B`;\n}\n\n/** Single-line preview of arbitrary text, for tiles and collapsed rows. */\nexport function truncate(text: string, maxLength: number): string {\n const collapsed = text.replace(/\\s+/g, \" \").trim();\n if (collapsed.length <= maxLength) {\n return collapsed;\n }\n return `${collapsed.slice(0, Math.max(0, maxLength - 1)).trimEnd()}…`;\n}\n\n/** Render an unknown payload as readable text (pretty JSON when possible). */\nexport function stringifyPayload(value: unknown): string {\n if (value === null || value === undefined) {\n return \"\";\n }\n if (typeof value === \"string\") {\n const parsed = tryParseJson(value);\n if (parsed !== undefined && typeof parsed === \"object\") {\n return stringifyPayload(parsed);\n }\n return value;\n }\n try {\n return JSON.stringify(value, null, 2) ?? String(value);\n } catch {\n return String(value);\n }\n}\n\n/** JSON.parse that returns `undefined` instead of throwing. */\nexport function tryParseJson(text: string): unknown {\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"{\") && !trimmed.startsWith(\"[\") && !trimmed.startsWith('\"')) {\n return undefined;\n }\n try {\n return JSON.parse(trimmed) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Humanize engine/provider failure text before it reaches the timeline or a\n * failure banner. Raw provider errors leak the wrong audience's instructions —\n * \"Incorrect API key … find your API key at platform.openai.com\" tells a\n * managed-deployment USER to fix credentials only an OPERATOR controls (and is\n * flatly wrong for Azure or subscription-backed engines). Auth and quota\n * failures collapse to one neutral, honest sentence; every other reason passes\n * through untouched. Raw payloads stay available in the debug surfaces.\n */\nexport function humanizeFailureReason(reason: string | null): string | null {\n if (!reason) {\n return reason;\n }\n const normalized = reason.toLowerCase();\n const authFailure =\n normalized.includes(\"incorrect api key\") ||\n normalized.includes(\"invalid api key\") ||\n normalized.includes(\"invalid_api_key\") ||\n normalized.includes(\"platform.openai.com/account/api-keys\") ||\n (normalized.includes(\"401\") && (normalized.includes(\"api key\") || normalized.includes(\"unauthorized\")));\n if (authFailure) {\n return \"The model provider rejected this deployment's engine credentials. Sending messages won't help until the deployment's engine configuration is fixed.\";\n }\n const quotaFailure =\n normalized.includes(\"insufficient_quota\") ||\n normalized.includes(\"exceeded your current quota\");\n if (quotaFailure) {\n return \"The model provider refused the request: this deployment's provider quota is exhausted.\";\n }\n return reason;\n}\n","import { cn } from \"../lib/cn\";\nimport { formatBytes } from \"../lib/format\";\nimport type { MetricSample } from \"../types/machines\";\n\nexport type MachineMetricsProps = {\n /** The latest metric sample, or null when the machine hasn't reported yet. */\n metrics: MetricSample | null;\n /** Compact (dashboard row) vs full (the dock detail). */\n density?: \"compact\" | \"full\" | undefined;\n className?: string | undefined;\n};\n\n/** Clamp a 0..100-ish percent into the bar range. */\nfunction pct(value: number): number {\n if (!Number.isFinite(value)) return 0;\n return Math.max(0, Math.min(100, value));\n}\n\n/** A label/value pair with a token-tinted utilisation bar. */\nfunction Meter({\n label,\n value,\n fillPct,\n tone,\n}: {\n label: string;\n value: string;\n fillPct: number;\n tone: \"ok\" | \"warn\" | \"hot\";\n}) {\n const fillClass =\n tone === \"hot\" ? \"bg-og-status-failed\" : tone === \"warn\" ? \"bg-og-status-waiting\" : \"bg-og-status-running\";\n return (\n <div className=\"flex min-w-0 flex-col gap-1\" data-metric={label.toLowerCase()}>\n <div className=\"flex items-baseline justify-between gap-2\">\n <span className=\"text-[10px] font-medium uppercase tracking-wide text-og-fg-subtle\">{label}</span>\n <span className=\"font-og-mono text-[11px] tabular-nums text-og-fg-muted\">{value}</span>\n </div>\n <div className=\"h-1 w-full overflow-hidden rounded-full bg-og-surface-2\">\n <div\n className={cn(\"h-full rounded-full transition-[width] duration-500\", fillClass)}\n style={{ width: `${pct(fillPct)}%` }}\n />\n </div>\n </div>\n );\n}\n\n/** Map a percent to a calm/warn/hot tone (no color invented — token classes). */\nfunction toneFor(p: number): \"ok\" | \"warn\" | \"hot\" {\n if (p >= 90) return \"hot\";\n if (p >= 70) return \"warn\";\n return \"ok\";\n}\n\n/** The token text color for a tone (matches the `Meter` fill ramp). */\nfunction toneTextClass(tone: \"ok\" | \"warn\" | \"hot\"): string {\n return tone === \"hot\" ? \"text-og-status-failed\" : tone === \"warn\" ? \"text-og-status-waiting\" : \"text-og-status-running\";\n}\n\n/**\n * Load average as three labeled mini-stats (1m / 5m / 15m) — an honest triple of\n * numbers, NOT a fake gauge. The whole triple is tinted by `load1`'s tone (load\n * isn't a 0..100 ratio, so we tone it but never draw a bar). Run queue rides\n * alongside as a quiet chip when there's pending work.\n */\nfunction StatTriple({\n load1,\n load5,\n load15,\n runQueue,\n}: {\n load1: number;\n load5: number;\n load15: number;\n runQueue: number;\n}) {\n // Load isn't a percent — tone by load1 against a nominal single-core ceiling\n // (≥0.9/core ≈ saturated). Used only to tint the labels/values, never a bar.\n const tone = toneFor(load1 * 100);\n const stats: Array<{ label: string; value: number }> = [\n { label: \"1m\", value: load1 },\n { label: \"5m\", value: load5 },\n { label: \"15m\", value: load15 },\n ];\n return (\n <div className=\"flex items-center justify-between gap-3\" data-metric=\"load\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <span className=\"text-[10px] font-medium uppercase tracking-wide text-og-fg-subtle\">Load</span>\n <div className=\"flex items-baseline gap-3\">\n {stats.map((s) => (\n <div key={s.label} className=\"flex items-baseline gap-1\">\n <span className={cn(\"text-[10px] font-medium uppercase tracking-wide\", toneTextClass(tone))}>\n {s.label}\n </span>\n <span className={cn(\"font-og-mono text-[12px] tabular-nums\", toneTextClass(tone))}>\n {s.value.toFixed(2)}\n </span>\n </div>\n ))}\n </div>\n </div>\n {runQueue > 0 ? (\n <div\n className=\"flex shrink-0 items-baseline gap-1.5 rounded-og-sm bg-og-surface-2 px-2 py-1 text-[11px] text-og-fg-subtle\"\n data-metric=\"runqueue\"\n >\n <span className=\"font-medium uppercase tracking-wide\">Queue</span>\n <span className=\"font-og-mono tabular-nums text-og-fg-muted\">{runQueue}</span>\n </div>\n ) : null}\n </div>\n );\n}\n\n/**\n * Per-machine resource meters: CPU%, load average, memory, disk, and GPU when\n * present. Renders the M2 `machine_metrics_latest` sample. When `metrics` is\n * null the panel shows a quiet \"no samples yet\" placeholder (offline / just\n * enrolled). GPU rows only render when `gpuUtilPct` is non-null.\n */\nexport function MachineMetrics({ metrics, density = \"compact\", className }: MachineMetricsProps) {\n if (!metrics) {\n return (\n <div className={cn(\"text-[11px] text-og-fg-subtle\", className)} data-metrics-empty>\n No metrics yet\n </div>\n );\n }\n\n const memPct = metrics.memTotalBytes > 0 ? (metrics.memUsedBytes / metrics.memTotalBytes) * 100 : 0;\n const diskPct = metrics.diskTotalBytes > 0 ? (metrics.diskUsedBytes / metrics.diskTotalBytes) * 100 : 0;\n const hasGpu = metrics.gpuUtilPct !== null;\n const gpuMemLabel = metrics.gpuMemBytes !== null ? formatBytes(metrics.gpuMemBytes) : null;\n // Memory & disk are honest used/total ratios → full-width meters; stack them in\n // the dock detail, two-up in the dashboard row.\n const ratioGridClass = density === \"full\" ? \"grid-cols-1\" : \"grid-cols-1 sm:grid-cols-2\";\n\n return (\n <div className={cn(\"flex flex-col gap-3\", className)} data-machine-metrics>\n {/* Resources — used/total ratios with real 0..100% bars. */}\n <div className={cn(\"grid gap-x-4 gap-y-2.5\", ratioGridClass)}>\n <Meter\n label=\"Memory\"\n value={`${formatBytes(metrics.memUsedBytes)} / ${formatBytes(metrics.memTotalBytes)}`}\n fillPct={memPct}\n tone={toneFor(memPct)}\n />\n <Meter\n label=\"Disk\"\n value={`${formatBytes(metrics.diskUsedBytes)} / ${formatBytes(metrics.diskTotalBytes)}`}\n fillPct={diskPct}\n tone={toneFor(diskPct)}\n />\n </div>\n\n {/* Utilization — CPU% (and GPU% when present) as honest percent gauges. */}\n <div className=\"grid grid-cols-2 gap-x-4 gap-y-2.5\">\n <Meter\n label=\"CPU\"\n value={`${metrics.cpuPct.toFixed(0)}%`}\n fillPct={metrics.cpuPct}\n tone={toneFor(metrics.cpuPct)}\n />\n {hasGpu ? (\n <Meter\n label=\"GPU\"\n value={gpuMemLabel ? `${metrics.gpuUtilPct!.toFixed(0)}% · ${gpuMemLabel}` : `${metrics.gpuUtilPct!.toFixed(0)}%`}\n fillPct={metrics.gpuUtilPct!}\n tone={toneFor(metrics.gpuUtilPct!)}\n />\n ) : null}\n </div>\n\n {/* Activity — load average as labeled mini-stats (no fake bar) + run queue. */}\n <StatTriple\n load1={metrics.load1}\n load5={metrics.load5}\n load15={metrics.load15}\n runQueue={metrics.runQueue}\n />\n </div>\n );\n}\n","import {\n CpuIcon,\n LaptopIcon,\n MonitorIcon,\n MonitorOffIcon,\n ServerIcon,\n UsersIcon,\n} from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { formatRelativeTime } from \"../lib/format\";\nimport type { MachineView } from \"../types/machines\";\nimport { MachineMetrics } from \"./machine-metrics\";\nimport { MachineStatusPill } from \"./machine-status-pill\";\n\nexport type MachineCardProps = {\n machine: MachineView;\n /** Attach/swap the session's active sandbox to this machine. */\n onAttach?: ((machine: MachineView) => void) | undefined;\n /** Whether an attach/swap is currently in flight (disables the affordance). */\n attaching?: boolean | undefined;\n className?: string | undefined;\n};\n\nfunction KindIcon({ machine }: { machine: MachineView }) {\n if (machine.isSessionGroup) return <ServerIcon className=\"size-4 text-og-fg-subtle\" aria-hidden />;\n if (machine.kind === \"modal\") return <CpuIcon className=\"size-4 text-og-fg-subtle\" aria-hidden />;\n return <LaptopIcon className=\"size-4 text-og-fg-subtle\" aria-hidden />;\n}\n\n/**\n * One machine in the Machines dashboard: name + kind + OS/arch, the composite\n * connection/state/shared status, latest resource meters, last-seen recency, and\n * an attach/swap affordance. The session's currently-active sandbox carries an\n * accent edge + an \"Active\" marker (never an attach button — it's already active).\n */\nexport function MachineCard({ machine, onAttach, attaching, className }: MachineCardProps) {\n const offline = machine.state === \"offline\";\n const attachable = !machine.active && !offline && Boolean(onAttach);\n const shared = machine.sharedSessionCount > 1;\n\n return (\n <div\n data-machine-card={machine.sandboxId}\n data-active={machine.active ? \"true\" : \"false\"}\n className={cn(\n \"og-root relative flex flex-col gap-3 overflow-hidden rounded-og-lg border border-og-border\",\n \"bg-og-surface-1 p-4 shadow-og-sm\",\n machine.active && \"border-og-accent/40\",\n className,\n )}\n >\n {machine.active ? (\n <span aria-hidden className=\"absolute inset-y-0 left-0 w-0.5 bg-og-accent\" />\n ) : null}\n\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-2.5\">\n <span className=\"mt-0.5 shrink-0\">\n <KindIcon machine={machine} />\n </span>\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"truncate text-og-base font-medium text-og-fg\">{machine.name}</span>\n {machine.active ? (\n <span\n data-active-marker\n className=\"shrink-0 rounded-full border border-og-accent/30 bg-og-accent-soft px-1.5 py-px text-og-xs font-medium text-og-accent\"\n >\n Active\n </span>\n ) : null}\n </div>\n <div className=\"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-og-xs text-og-fg-subtle\">\n <span className=\"capitalize\">{machine.isSessionGroup ? \"session sandbox\" : machine.kind}</span>\n <span aria-hidden>·</span>\n <span className=\"font-og-mono\">\n {machine.os}/{machine.arch}\n </span>\n <span aria-hidden>·</span>\n <span className=\"inline-flex items-center gap-1\">\n {machine.hasDisplay ? (\n <MonitorIcon className=\"size-3\" aria-hidden />\n ) : (\n <MonitorOffIcon className=\"size-3\" aria-hidden />\n )}\n {machine.hasDisplay ? \"display\" : \"headless\"}\n </span>\n </div>\n </div>\n </div>\n <MachineStatusPill state={machine.state} sharedSessionCount={machine.sharedSessionCount} size=\"sm\" className=\"shrink-0\" />\n </div>\n\n {shared ? (\n <p\n data-shared-disclosure\n className=\"flex items-center gap-1.5 rounded-og-md border border-og-accent/25 bg-og-accent-soft px-2.5 py-1.5 text-og-xs text-og-fg-muted\"\n >\n <UsersIcon className=\"size-3.5 shrink-0 text-og-accent\" aria-hidden />\n Shared — {machine.sharedSessionCount} sessions are on this machine.\n </p>\n ) : null}\n\n <MachineMetrics metrics={machine.metrics} />\n\n <div className=\"mt-1 flex items-center justify-between gap-3 text-og-xs text-og-fg-subtle\">\n <span>\n {machine.lastSeenAt ? <>Last seen {formatRelativeTime(machine.lastSeenAt)}</> : \"Never connected\"}\n </span>\n {machine.active ? (\n <span className=\"text-og-accent\">Routing here</span>\n ) : attachable ? (\n <button\n type=\"button\"\n data-attach\n disabled={attaching}\n onClick={() => onAttach?.(machine)}\n className={cn(\n \"rounded-og-sm border border-og-border px-2.5 py-1 text-og-xs font-medium text-og-fg-muted transition-colors pointer-coarse:min-h-10\",\n \"hover:border-og-border-strong hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n >\n {attaching ? \"Switching…\" : \"Attach\"}\n </button>\n ) : (\n <span className=\"text-og-fg-subtle/70\">{offline ? \"Unavailable\" : \"—\"}</span>\n )}\n </div>\n </div>\n );\n}\n","import { type ReactNode } from \"react\";\nimport { LaptopIcon, PlusIcon, RefreshCwIcon } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport type { MachineView } from \"../types/machines\";\nimport { MachineCard } from \"./machine-card\";\n\nexport type MachinesDashboardProps = {\n machines: MachineView[];\n /** The session's active sandbox id (drives the per-card \"Active\" marker). */\n activeSandboxId?: string | null | undefined;\n loading?: boolean | undefined;\n error?: Error | null | undefined;\n /** Attach/swap the session's active sandbox to a machine. */\n onAttach?: ((machine: MachineView) => void) | undefined;\n /** The sandbox id currently being attached/swapped to (disables that card). */\n attachingSandboxId?: string | null | undefined;\n /** Open the enrollment flow (the \"Enroll a machine\" CTA). */\n onEnroll?: (() => void) | undefined;\n onRefresh?: (() => void) | undefined;\n className?: string | undefined;\n};\n\nfunction EmptyState({ onEnroll }: { onEnroll?: (() => void) | undefined }) {\n return (\n <div\n data-machines-empty\n className=\"flex flex-col items-center justify-center gap-3 rounded-og-lg border border-dashed border-og-border bg-og-surface-1 px-6 py-12 text-center\"\n >\n <span className=\"flex size-10 items-center justify-center rounded-full bg-og-surface-2 text-og-fg-subtle\">\n <LaptopIcon className=\"size-5\" aria-hidden />\n </span>\n <div className=\"space-y-1\">\n <p className=\"text-og-base font-medium text-og-fg\">No machines yet</p>\n <p className=\"max-w-xs text-og-sm text-og-fg-muted\">\n Enroll your own computer to run the agent on it — your files, your terminal, your desktop.\n </p>\n </div>\n {onEnroll ? (\n <button\n type=\"button\"\n data-enroll-cta\n onClick={onEnroll}\n className=\"inline-flex items-center gap-1.5 rounded-og-sm bg-og-accent px-3 py-1.5 text-og-sm font-medium text-og-accent-fg transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-10\"\n >\n <PlusIcon className=\"size-3.5\" aria-hidden />\n Enroll a machine\n </button>\n ) : null}\n </div>\n );\n}\n\nfunction Header({\n count,\n onEnroll,\n onRefresh,\n loading,\n}: {\n count: number;\n onEnroll?: (() => void) | undefined;\n onRefresh?: (() => void) | undefined;\n loading?: boolean | undefined;\n}): ReactNode {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-baseline gap-2\">\n <h2 className=\"text-og-base font-semibold text-og-fg\">Machines</h2>\n <span className=\"font-og-mono text-og-xs text-og-fg-subtle\">{count}</span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {onRefresh ? (\n <button\n type=\"button\"\n data-refresh\n onClick={onRefresh}\n title=\"Refresh\"\n className=\"rounded-og-sm p-1.5 text-og-fg-subtle transition-colors hover:bg-og-surface-2 hover:text-og-fg\"\n >\n <RefreshCwIcon className={cn(\"size-3.5\", loading && \"animate-og-spin\")} aria-hidden />\n </button>\n ) : null}\n {onEnroll ? (\n <button\n type=\"button\"\n data-enroll-cta\n onClick={onEnroll}\n className=\"inline-flex items-center gap-1.5 rounded-og-sm border border-og-border px-2.5 py-1 text-og-sm font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg pointer-coarse:min-h-10\"\n >\n <PlusIcon className=\"size-3.5\" aria-hidden />\n Enroll machine\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n\n/**\n * The workspace Machines dashboard: the fleet of selfhosted enrollments + the\n * session's managed sandbox, each with its connection-status pill, state badges,\n * latest metrics, and an attach/swap affordance. Renders the empty state (no\n * machines → enroll CTA), a load error, and the populated grid. The component\n * is purely presentational — feed it `MachinesResponse` data via `useMachines`.\n */\nexport function MachinesDashboard({\n machines,\n activeSandboxId,\n loading,\n error,\n onAttach,\n attachingSandboxId,\n onEnroll,\n onRefresh,\n className,\n}: MachinesDashboardProps) {\n const isEmpty = !loading && !error && machines.length === 0;\n\n return (\n <section data-machines-dashboard className={cn(\"og-root flex flex-col gap-3\", className)}>\n <Header count={machines.length} onEnroll={onEnroll} onRefresh={onRefresh} loading={loading} />\n\n {error ? (\n <div\n data-machines-error\n className=\"flex flex-wrap items-center justify-between gap-2 rounded-og-md border border-og-status-failed/30 bg-og-status-failed/10 px-3 py-2 text-og-sm text-og-status-failed\"\n >\n <span>Could not load machines: {error.message}</span>\n {onRefresh ? (\n <button\n type=\"button\"\n data-machines-retry\n onClick={onRefresh}\n disabled={loading}\n className=\"inline-flex items-center gap-1.5 rounded-og-sm border border-og-status-failed/30 px-2 py-1 text-og-xs font-medium transition-colors hover:border-og-status-failed/50 disabled:cursor-not-allowed disabled:opacity-60 pointer-coarse:min-h-10\"\n >\n <RefreshCwIcon className={cn(\"size-3.5\", loading && \"animate-og-spin\")} aria-hidden />\n {loading ? \"Retrying…\" : \"Retry\"}\n </button>\n ) : null}\n </div>\n ) : null}\n\n {loading && machines.length === 0 ? (\n <div data-machines-loading className=\"grid gap-3 sm:grid-cols-2\">\n {[0, 1].map((i) => (\n <div key={i} className=\"h-36 animate-og-pulse rounded-og-lg border border-og-border bg-og-surface-1\" />\n ))}\n </div>\n ) : isEmpty ? (\n <EmptyState onEnroll={onEnroll} />\n ) : (\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\" data-machines-grid>\n {machines.map((machine) => (\n <MachineCard\n key={machine.sandboxId}\n machine={{ ...machine, active: machine.active || machine.sandboxId === activeSandboxId }}\n onAttach={onAttach}\n attaching={attachingSandboxId === machine.sandboxId}\n />\n ))}\n </div>\n )}\n </section>\n );\n}\n","import { LaptopIcon, CpuIcon, UsersIcon } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport type { MachineKind, MachineState } from \"../types/machines\";\nimport { ConnectionStatusPill, MACHINE_STATE_BADGE_META } from \"./machine-status-pill\";\nimport { connectionStatusForState } from \"../types/machines\";\n\nexport type MachineDockBarProps = {\n /** The active machine's display name. */\n name: string;\n kind: MachineKind;\n state: MachineState;\n /** Live sessions sharing this whole-machine lease (>1 ⇒ shared disclosure). */\n sharedSessionCount?: number | undefined;\n className?: string | undefined;\n};\n\n/**\n * A slim bar that surfaces WHICH machine the dock surfaces (Files/Terminal/\n * Desktop) are bound to + its connection status. Mounted above the dock tabs so\n * the user always knows whether they are looking at the Modal box or their own\n * machine, and whether it is online / reconnecting / offline. The surfaces below\n * render IDENTICALLY regardless of backend — this bar is the only backend-aware\n * chrome (the dock-parity contract: selfhosted == Modal for the surfaces).\n */\nexport function MachineDockBar({ name, kind, state, sharedSessionCount, className }: MachineDockBarProps) {\n const Icon = kind === \"selfhosted\" ? LaptopIcon : CpuIcon;\n const stateBadge = MACHINE_STATE_BADGE_META[state];\n const shared = (sharedSessionCount ?? 0) > 1;\n return (\n <div\n data-machine-dock-bar\n className={cn(\n \"flex shrink-0 items-center justify-between gap-2 border-b border-og-border bg-og-surface-1 px-2.5 py-1\",\n className,\n )}\n >\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <Icon className=\"size-3.5 shrink-0 text-og-fg-subtle\" aria-hidden />\n <span className=\"truncate text-[11px] font-medium text-og-fg\">{name}</span>\n {stateBadge ? (\n <span\n data-state-badge={state}\n className={cn(\"shrink-0 rounded-full border px-1.5 py-px text-[10px] font-medium\", stateBadge.badgeClassName)}\n >\n {stateBadge.label}\n </span>\n ) : null}\n </div>\n <ConnectionStatusPill status={connectionStatusForState(state)} size=\"sm\" className=\"shrink-0\" />\n </div>\n );\n}\n\nexport type SharedMachineDisclosureProps = {\n sharedSessionCount: number;\n /** Compact (inline strip) vs full (a notice block). */\n density?: \"compact\" | \"full\" | undefined;\n className?: string | undefined;\n};\n\n/**\n * The \"shared — another session is on this machine\" disclosure. Surfaced in the\n * dock (and reused on the desktop take-control gate) so the user knows others are\n * driving the same whole-machine lease. Render when `sharedSessionCount > 1`.\n */\nexport function SharedMachineDisclosure({ sharedSessionCount, density = \"compact\", className }: SharedMachineDisclosureProps) {\n const others = Math.max(0, sharedSessionCount - 1);\n return (\n <div\n data-shared-disclosure\n className={cn(\n \"flex items-center gap-1.5 border-og-accent/25 bg-og-accent-soft text-og-fg-muted\",\n density === \"full\" ? \"rounded-og-md border px-3 py-2 text-[12px]\" : \"border-b px-2.5 py-1 text-[11px]\",\n className,\n )}\n >\n <UsersIcon className=\"size-3.5 shrink-0 text-og-accent\" aria-hidden />\n <span>\n Shared — {others === 1 ? \"another session is\" : `${others} other sessions are`} on this machine. They see the same\n terminal, files, and desktop.\n </span>\n </div>\n );\n}\n","import { type ReactNode } from \"react\";\nimport { CopyIcon, ExternalLinkIcon, LaptopIcon, TerminalIcon } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport type { MachineState } from \"../types/machines\";\nimport { ConnectionStatusPill } from \"./machine-status-pill\";\n\n/** The poll state of an in-flight device-flow enrollment. */\nexport type DeviceFlowPhase = \"pending\" | \"authorized\" | \"denied\" | \"expired\" | \"disabled\";\n\nexport type EnrollmentDeviceFlowProps = {\n /** The short user code the agent printed (shown big for the human to confirm). */\n userCode: string;\n /** Where the user approves — the same-origin device page. */\n verificationUri: string;\n /** The complete URI (code pre-filled) for a one-click / QR open. */\n verificationUriComplete?: string | undefined;\n /** The install one-liner the user ran (echoed for context). Optional. */\n installCommand?: string | undefined;\n phase?: DeviceFlowPhase | undefined;\n /** Seconds remaining before the code expires (drives a quiet countdown). */\n expiresInSeconds?: number | undefined;\n onCopyCode?: (() => void) | undefined;\n onCopyInstall?: (() => void) | undefined;\n onOpenVerification?: (() => void) | undefined;\n className?: string | undefined;\n};\n\nconst PHASE_TO_STATE: Record<DeviceFlowPhase, MachineState> = {\n pending: \"enrolling\",\n authorized: \"online\",\n denied: \"offline\",\n expired: \"offline\",\n disabled: \"offline\",\n};\n\nfunction PhaseLabel({ phase }: { phase: DeviceFlowPhase }): ReactNode {\n const text: Record<DeviceFlowPhase, string> = {\n pending: \"Waiting for approval\",\n authorized: \"Connected\",\n denied: \"Denied\",\n expired: \"Code expired\",\n disabled: \"Enrollment disabled\",\n };\n return <span>{text[phase]}</span>;\n}\n\n/**\n * The IN-SESSION device-flow panel: the agent (after the install one-liner) prints\n * a short `userCode` + a `verificationUri`; this surfaces them so the user can open\n * the approve page and confirm the code. Polls in the caller; this renders the\n * pending → authorized/denied/expired progression with a connection pill. This is\n * the FIRST step of the IA flow (device-flow → Machines list → attach/swap).\n */\nexport function EnrollmentDeviceFlow({\n userCode,\n verificationUri,\n verificationUriComplete,\n installCommand,\n phase = \"pending\",\n expiresInSeconds,\n onCopyCode,\n onCopyInstall,\n onOpenVerification,\n className,\n}: EnrollmentDeviceFlowProps) {\n const href = verificationUriComplete ?? verificationUri;\n // Before the one-liner runs the caller passes a placeholder (dashes) for the\n // code — surface that as an explicit waiting state rather than dashes that look\n // like a real code to type.\n const codeIsPlaceholder = !/[A-Za-z0-9]/.test(userCode);\n const awaitingCode = phase === \"pending\" && codeIsPlaceholder;\n return (\n <div\n data-enrollment-device-flow\n className={cn(\n \"og-root flex w-full max-w-md flex-col gap-4 rounded-og-lg border border-og-border bg-og-surface-1 p-5 shadow-og-sm\",\n className,\n )}\n >\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-2\">\n <span className=\"flex size-7 items-center justify-center rounded-full bg-og-surface-2 text-og-fg-muted\">\n <LaptopIcon className=\"size-4\" aria-hidden />\n </span>\n <h2 className=\"text-sm font-semibold text-og-fg\">Connect a machine</h2>\n </div>\n <ConnectionStatusPill\n status={\n PHASE_TO_STATE[phase] === \"online\"\n ? \"online\"\n : PHASE_TO_STATE[phase] === \"offline\"\n ? \"offline\"\n : \"reconnecting\"\n }\n label={(<PhaseLabel phase={phase} />) as unknown as string}\n size=\"sm\"\n />\n </div>\n\n {installCommand ? (\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-og-fg-subtle\">1 · Run on the machine</span>\n <div className=\"flex items-center justify-between gap-2 overflow-hidden rounded-og-md border border-og-border bg-og-bg px-2.5 py-1.5\">\n <code className=\"flex min-w-0 items-center gap-2 overflow-x-auto font-og-mono text-[12px] text-og-fg\">\n <TerminalIcon className=\"size-3.5 shrink-0 text-og-fg-subtle\" aria-hidden />\n {installCommand}\n </code>\n <button\n type=\"button\"\n data-copy-install\n onClick={onCopyInstall}\n title=\"Copy command\"\n className=\"shrink-0 rounded-og-sm p-1.5 text-og-fg-subtle transition-colors hover:bg-og-surface-2 hover:text-og-fg\"\n >\n <CopyIcon className=\"size-4\" aria-hidden />\n </button>\n </div>\n </div>\n ) : null}\n\n <div className=\"flex flex-col gap-1.5\">\n <span className=\"text-[11px] font-medium uppercase tracking-wide text-og-fg-subtle\">\n {installCommand ? \"2 · Approve the machine\" : \"Approve the machine\"}\n </span>\n <div className=\"flex items-center justify-between gap-3 rounded-og-md border border-og-border bg-og-bg px-3 py-2.5\">\n {awaitingCode ? (\n <span data-user-code className=\"font-og-mono text-[13px] text-og-fg-subtle\">\n Run the command above — your code appears here\n </span>\n ) : (\n <span\n data-user-code\n className=\"select-all font-og-mono text-2xl font-semibold tracking-[0.25em] text-og-fg\"\n >\n {userCode}\n </span>\n )}\n <button\n type=\"button\"\n data-copy-code\n onClick={onCopyCode}\n disabled={awaitingCode}\n title=\"Copy code\"\n className=\"shrink-0 rounded-og-sm p-1.5 text-og-fg-subtle transition-colors hover:bg-og-surface-2 hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-og-fg-subtle\"\n >\n <CopyIcon className=\"size-4\" aria-hidden />\n </button>\n </div>\n </div>\n\n <a\n href={href}\n data-open-verification\n target=\"_blank\"\n rel=\"noreferrer\"\n onClick={onOpenVerification}\n className=\"inline-flex items-center justify-center gap-1.5 rounded-og-sm bg-og-accent px-3 py-2 text-sm font-medium text-og-accent-fg transition-colors hover:bg-og-accent-strong\"\n >\n Open approval page\n <ExternalLinkIcon className=\"size-3.5\" aria-hidden />\n </a>\n\n <p className=\"text-center text-[11px] text-og-fg-subtle\">\n {awaitingCode ? (\n <>\n The one-liner prints a short code. Open{\" \"}\n <span className=\"font-og-mono text-og-fg-muted\">{verificationUri}</span> and confirm the code shown there\n matches.\n </>\n ) : (\n <>\n Confirm code <span className=\"font-og-mono text-og-fg-muted\">{userCode}</span> — the one printed by the\n one-liner — at <span className=\"font-og-mono text-og-fg-muted\">{verificationUri}</span>.\n {typeof expiresInSeconds === \"number\" ? (\n <> Expires in {Math.max(0, Math.round(expiresInSeconds / 60))} min.</>\n ) : null}\n </>\n )}\n </p>\n </div>\n );\n}\n","import { type ReactNode, useState } from \"react\";\nimport {\n CircleAlertIcon,\n LaptopIcon,\n MonitorIcon,\n ScreenShareIcon,\n ShieldAlertIcon,\n TerminalIcon,\n UsersIcon,\n} from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\n\n/** The machine identity surfaced to the approver, from the device-flow start. */\nexport type EnrollmentConsentMachine = {\n /** Human-friendly name (hostname by default). */\n machineName: string;\n os: string;\n arch: string;\n /** The agent can offer a display (a real screen / Xvfb is available). */\n canOfferDisplay: boolean;\n /** The agent requests screen control (computer-use). */\n requestsScreenControl: boolean;\n};\n\n/** The phase of the approve page (drives the rendered panel). */\nexport type EnrollmentConsentPhase = \"review\" | \"approving\" | \"approved\" | \"denied\" | \"error\";\n\nexport type EnrollmentConsentProps = {\n /** The short code the user typed / scanned (echoed back for confirmation). */\n userCode: string;\n machine: EnrollmentConsentMachine;\n phase?: EnrollmentConsentPhase | undefined;\n /** Approve with the chosen screen-control consent. */\n onApprove?: ((allowScreenControl: boolean) => void) | undefined;\n onDeny?: (() => void) | undefined;\n /** Error message when phase === \"error\". */\n errorMessage?: string | undefined;\n className?: string | undefined;\n};\n\nfunction Capability({ icon, title, body }: { icon: ReactNode; title: string; body: string }) {\n return (\n <li className=\"flex items-start gap-2.5\">\n <span className=\"mt-0.5 shrink-0 text-og-status-failed\">{icon}</span>\n <span className=\"min-w-0\">\n <span className=\"block text-og-base font-medium text-og-fg\">{title}</span>\n <span className=\"block text-og-sm text-og-fg-muted\">{body}</span>\n </span>\n </li>\n );\n}\n\n/**\n * The user-facing APPROVE page for the device-flow enrollment: a LOUD,\n * un-minimised whole-machine consent. Approving grants the agent FULL access to\n * this machine — exec, files, terminal — and (when toggled) live screen control.\n * The danger framing is deliberate (§18 hardening: whole-machine = loud consent),\n * never buried. Renders review / approving / approved / denied / error phases.\n */\nexport function EnrollmentConsent({\n userCode,\n machine,\n phase = \"review\",\n onApprove,\n onDeny,\n errorMessage,\n className,\n}: EnrollmentConsentProps) {\n const [allowScreenControl, setAllowScreenControl] = useState(machine.requestsScreenControl);\n const busy = phase === \"approving\";\n\n if (phase === \"approved\") {\n return (\n <ConsentResult\n className={className}\n tone=\"ok\"\n title=\"Machine connected\"\n body={`${machine.machineName} is now enrolled in this workspace. You can close this page — it will appear in your Machines dashboard.`}\n />\n );\n }\n if (phase === \"denied\") {\n return (\n <ConsentResult\n className={className}\n tone=\"muted\"\n title=\"Enrollment denied\"\n body={`You declined to connect ${machine.machineName}. The agent has no access to this machine. You can re-run the install one-liner to try again.`}\n />\n );\n }\n if (phase === \"error\") {\n return (\n <ConsentResult\n className={className}\n tone=\"danger\"\n title=\"Could not complete enrollment\"\n body={errorMessage ?? \"The code may have expired. Re-run the install one-liner on the machine for a fresh code.\"}\n />\n );\n }\n\n return (\n <div\n data-enrollment-consent\n className={cn(\n \"og-root mx-auto flex w-full max-w-md flex-col gap-5 rounded-og-lg border border-og-status-failed/30 bg-og-surface-1 p-6 shadow-og-md\",\n className,\n )}\n >\n <div className=\"flex items-start gap-3\">\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-og-status-failed/15 text-og-status-failed\">\n <ShieldAlertIcon className=\"size-5\" aria-hidden />\n </span>\n <div className=\"min-w-0\">\n <h1 className=\"text-og-md font-semibold text-og-fg\">Give the agent your whole machine?</h1>\n <p className=\"mt-1 text-og-base text-og-fg-muted\">\n Approving lets the OpenGeni agent run on <span className=\"font-medium text-og-fg\">{machine.machineName}</span> with\n full access. This is your real computer — not a sandbox.\n </p>\n </div>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-2 rounded-og-md border border-og-border bg-og-surface-2 px-3 py-2 text-og-sm\">\n <LaptopIcon className=\"size-4 text-og-fg-subtle\" aria-hidden />\n <span className=\"font-medium text-og-fg\">{machine.machineName}</span>\n <span className=\"font-og-mono text-og-fg-subtle\">\n {machine.os}/{machine.arch}\n </span>\n <span aria-hidden className=\"text-og-fg-subtle\">·</span>\n <span className=\"text-og-fg-subtle\">\n code <span className=\"font-og-mono font-medium text-og-fg\">{userCode}</span>\n </span>\n </div>\n\n <ul className=\"flex flex-col gap-3\">\n <Capability\n icon={<TerminalIcon className=\"size-4\" aria-hidden />}\n title=\"Read, write & run anything\"\n body=\"The agent can read and modify any file, run any command, and use your git credentials — as if it were you at the keyboard.\"\n />\n {machine.canOfferDisplay ? (\n <Capability\n icon={<MonitorIcon className=\"size-4\" aria-hidden />}\n title=\"See your screen\"\n body=\"The agent can capture this machine's display to watch what it is doing.\"\n />\n ) : null}\n <Capability\n icon={<UsersIcon className=\"size-4\" aria-hidden />}\n title=\"Shared while connected\"\n body=\"Any session in this workspace can use this machine while it is online. Disconnect the agent to revoke access instantly.\"\n />\n </ul>\n\n {machine.canOfferDisplay ? (\n <label\n data-screen-control-toggle\n className=\"flex cursor-pointer items-start gap-3 rounded-og-md border border-og-border bg-og-bg px-3 py-2.5\"\n >\n <input\n type=\"checkbox\"\n checked={allowScreenControl}\n disabled={busy}\n onChange={(e) => setAllowScreenControl(e.target.checked)}\n className=\"mt-0.5 size-4 accent-og-accent\"\n />\n <span className=\"min-w-0\">\n <span className=\"flex items-center gap-1.5 text-og-base font-medium text-og-fg\">\n <ScreenShareIcon className=\"size-3.5 text-og-fg-muted\" aria-hidden />\n Also let the agent control my mouse & keyboard\n </span>\n <span className=\"mt-0.5 block text-og-sm text-og-fg-muted\">\n Optional. Enables computer-use — the agent can move the pointer, type, and click on this machine's desktop. Leave\n off to let it only watch.\n </span>\n </span>\n </label>\n ) : (\n <p className=\"flex items-start gap-2 rounded-og-md border border-og-border bg-og-bg px-3 py-2 text-og-sm text-og-fg-muted\">\n <CircleAlertIcon className=\"mt-px size-3.5 shrink-0 text-og-fg-subtle\" aria-hidden />\n This machine has no display, so screen control isn't available — files, terminal, and git only.\n </p>\n )}\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n data-deny\n disabled={busy}\n onClick={() => onDeny?.()}\n className=\"flex-1 rounded-og-sm border border-og-border px-3 py-2 text-og-sm font-medium text-og-fg-muted transition-colors hover:border-og-border-strong hover:text-og-fg disabled:opacity-50 pointer-coarse:min-h-10\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n data-approve\n disabled={busy}\n onClick={() => onApprove?.(allowScreenControl)}\n className=\"flex-1 rounded-og-sm bg-og-status-failed px-3 py-2 text-og-sm font-semibold text-og-accent-fg transition-colors hover:opacity-90 disabled:opacity-50 pointer-coarse:min-h-10\"\n >\n {busy ? \"Connecting…\" : \"Grant full access\"}\n </button>\n </div>\n </div>\n );\n}\n\nfunction ConsentResult({\n tone,\n title,\n body,\n className,\n}: {\n tone: \"ok\" | \"muted\" | \"danger\";\n title: string;\n body: string;\n className?: string | undefined;\n}) {\n const ring =\n tone === \"ok\"\n ? \"border-og-status-running/30\"\n : tone === \"danger\"\n ? \"border-og-status-failed/30\"\n : \"border-og-border\";\n const iconClass =\n tone === \"ok\" ? \"text-og-status-running\" : tone === \"danger\" ? \"text-og-status-failed\" : \"text-og-fg-subtle\";\n return (\n <div\n data-enrollment-result={tone}\n className={cn(\n \"og-root mx-auto flex w-full max-w-md flex-col items-center gap-3 rounded-og-lg border bg-og-surface-1 p-6 text-center shadow-og-md\",\n ring,\n className,\n )}\n >\n <span className={cn(\"flex size-10 items-center justify-center rounded-full bg-og-surface-2\", iconClass)}>\n <LaptopIcon className=\"size-5\" aria-hidden />\n </span>\n <h1 className=\"text-og-md font-semibold text-og-fg\">{title}</h1>\n <p className=\"max-w-sm text-og-base text-og-fg-muted\">{body}</p>\n </div>\n );\n}\n","import { useCallback, useState } from \"react\";\nimport { useOpenGeni, type ClientOverride } from \"../provider\";\nimport { useMutationRunner, usePolledValue } from \"./internal\";\nimport type { MachinesResponse, MachineView, MetricSample } from \"../types/machines\";\n\n/**\n * The slice of the SDK client the Machines surface needs. The method NAMES +\n * SIGNATURES match M10's `OpenGeniClient` (`listMachines`, `machineMetricsSeries`)\n * so the real SDK client satisfies this surface DIRECTLY for the read paths — no\n * adapter needed. It is declared structurally (not a hard `OpenGeniClient` Pick)\n * so a test/demo/Geni-frontend client can stand in, keeping the hook dual-consumer\n * safe (works in apps/web AND the separate Geni frontend).\n *\n * The active-sandbox SWAP is now a typed SDK call (`swapActiveSandbox`, the M7\n * user-authenticated REST equivalent of the `sandbox_swap` MCP tool). The real\n * SDK client satisfies it structurally, so the default attach path is wired\n * WHENEVER a sessionId is in scope (the swap is session-scoped). `attachMachine`\n * stays an OPTIONAL escape hatch for a host that wants to supply its own swap\n * adapter; when neither it nor a sessionId is present, attach is a no-op and the\n * card hides the button.\n */\nexport type MachinesClientLike = {\n /** GET /v1/workspaces/:ws/machines — the dashboard list + active pointer. */\n listMachines: (workspaceId: string, options?: { sessionId?: string }) => Promise<MachinesResponse>;\n /** GET .../machines/:enrollmentId/metrics/series — the downsampled history. */\n machineMetricsSeries?: (\n workspaceId: string,\n enrollmentId: string,\n options?: { window?: \"15m\" | \"1h\" | \"6h\" | \"24h\" },\n ) => Promise<MetricSample[]>;\n /**\n * POST .../sessions/:sessionId/active-sandbox — swap the session's active\n * sandbox to a machine. The default swap path; the real SDK client provides it.\n */\n swapActiveSandbox?: (\n workspaceId: string,\n sessionId: string,\n request: { target: string },\n ) => Promise<unknown>;\n /**\n * Host-supplied swap adapter (an escape hatch). When present it wins over the\n * default `swapActiveSandbox` path. Session-scoped, like the swap it backs.\n */\n attachMachine?: (workspaceId: string, sessionId: string, sandboxId: string) => Promise<unknown>;\n};\n\nexport type UseMachinesOptions = ClientOverride & {\n pollIntervalMs?: number | undefined;\n enabled?: boolean | undefined;\n /** Scope the list to a session (adds the synthetic Modal group box + pointer). */\n sessionId?: string | undefined;\n /**\n * Override the client with one implementing `MachinesClientLike`. Defaults to\n * the provider client cast to the surface (the real SDK client satisfies the\n * read paths). An app supplies an adapter to wire `attachMachine` (the swap).\n */\n machinesClient?: MachinesClientLike | undefined;\n};\n\nexport type UseMachinesResult = {\n machines: MachineView[];\n activeSandboxId: string | null;\n activeEpoch: number;\n loading: boolean;\n error: Error | null;\n refresh: () => Promise<void>;\n /** Attach/swap the session's active sandbox to a machine (returns the new pointer). */\n attach: (sandboxId: string) => Promise<boolean>;\n /** Whether the host wired an attach/swap path (drives the card affordance). */\n canAttach: boolean;\n /** Fetch a downsampled metric series for one enrolled machine. */\n fetchSeries: (enrollmentId: string, window?: \"15m\" | \"1h\" | \"6h\" | \"24h\") => Promise<MetricSample[]>;\n attaching: boolean;\n /** The sandbox id of the in-flight attach (for per-card spinner gating). */\n attachingSandboxId: string | null;\n mutationError: Error | null;\n clearMutationError: () => void;\n};\n\nconst EMPTY: MachinesResponse = { activeSandboxId: null, activeEpoch: 0, machines: [] };\n\n/**\n * The workspace Machines fleet: the selfhosted enrollments + the session's Modal\n * box, each with latest metrics + state, plus the active-sandbox pointer. Polls\n * the M10 `GET /machines` endpoint and exposes attach/swap + a metric-series\n * fetch. Renders via `<MachinesDashboard>`. Dual-consumer safe: it reads only the\n * structural `MachinesClientLike` surface, so it works in apps/web AND the Geni\n * frontend (each provides its own client/adapter).\n */\nexport function useMachines(options: UseMachinesOptions = {}): UseMachinesResult {\n const { client, workspaceId } = useOpenGeni(options);\n const machinesClient = (options.machinesClient ?? (client as unknown as MachinesClientLike)) satisfies MachinesClientLike;\n const sessionId = options.sessionId;\n\n const load = useCallback(async () => {\n return await machinesClient.listMachines(workspaceId, sessionId ? { sessionId } : undefined);\n }, [machinesClient, workspaceId, sessionId]);\n\n const state = usePolledValue(load, { pollIntervalMs: options.pollIntervalMs, enabled: options.enabled });\n const mutation = useMutationRunner();\n // The sandbox id of the in-flight attach (drives the per-card spinner).\n const [attachingSandboxId, setAttachingSandboxId] = useState<string | null>(null);\n\n const data = state.data ?? EMPTY;\n // The swap is session-scoped: a host adapter (`attachMachine`) wins; otherwise\n // the default `swapActiveSandbox` path is wired whenever a sessionId is in\n // scope. Either way attach needs a sessionId to point at.\n const canAttach =\n sessionId !== undefined &&\n (typeof machinesClient.attachMachine === \"function\" ||\n typeof machinesClient.swapActiveSandbox === \"function\");\n\n const attach = useCallback(\n async (sandboxId: string): Promise<boolean> => {\n if (sessionId === undefined) return false;\n const runSwap = machinesClient.attachMachine\n ? () => machinesClient.attachMachine!(workspaceId, sessionId, sandboxId)\n : machinesClient.swapActiveSandbox\n ? () => machinesClient.swapActiveSandbox!(workspaceId, sessionId, { target: sandboxId })\n : null;\n if (!runSwap) return false;\n setAttachingSandboxId(sandboxId);\n const result = await mutation.run(async () => {\n await runSwap();\n return true;\n });\n setAttachingSandboxId(null);\n if (result) await state.refresh();\n return result === true;\n },\n [machinesClient, workspaceId, sessionId, mutation.run, state.refresh],\n );\n\n const fetchSeries = useCallback(\n async (enrollmentId: string, window: \"15m\" | \"1h\" | \"6h\" | \"24h\" = \"1h\"): Promise<MetricSample[]> => {\n if (!machinesClient.machineMetricsSeries) return [];\n return await machinesClient.machineMetricsSeries(workspaceId, enrollmentId, { window });\n },\n [machinesClient, workspaceId],\n );\n\n return {\n machines: data.machines,\n activeSandboxId: data.activeSandboxId,\n activeEpoch: data.activeEpoch,\n loading: state.loading,\n error: state.error,\n refresh: state.refresh,\n attach,\n canAttach,\n fetchSeries,\n attaching: mutation.mutating,\n attachingSandboxId,\n mutationError: mutation.mutationError,\n clearMutationError: mutation.clearMutationError,\n };\n}\n","import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { SessionClientLike } from \"./client\";\n\nexport type OpenGeniContextValue = {\n client: SessionClientLike;\n workspaceId: string;\n};\n\nconst OpenGeniContext = createContext<OpenGeniContextValue | null>(null);\n\nexport type OpenGeniProviderProps = {\n client: SessionClientLike;\n workspaceId: string;\n children?: ReactNode;\n};\n\n/**\n * Supplies the OpenGeni client + workspace to all hooks below it. Hooks also\n * accept `{ client, workspaceId }` overrides per call for multi-workspace UIs.\n */\nexport function OpenGeniProvider({ client, workspaceId, children }: OpenGeniProviderProps) {\n const value = useMemo(() => ({ client, workspaceId }), [client, workspaceId]);\n return <OpenGeniContext.Provider value={value}>{children}</OpenGeniContext.Provider>;\n}\n\nexport type ClientOverride = {\n client?: SessionClientLike | undefined;\n workspaceId?: string | undefined;\n};\n\n/** Resolve client + workspace from explicit overrides or the provider. */\nexport function useOpenGeni(override: ClientOverride = {}): OpenGeniContextValue {\n const context = useContext(OpenGeniContext);\n const client = override.client ?? context?.client;\n const workspaceId = override.workspaceId ?? context?.workspaceId;\n if (!client || !workspaceId) {\n throw new Error(\n \"@opengeni/react: no OpenGeni client/workspace available. Wrap the tree in <OpenGeniProvider> or pass { client, workspaceId } to the hook.\",\n );\n }\n return { client, workspaceId };\n}\n\n/**\n * Resolve the client only — for hooks that are not workspace-scoped\n * (`useWorkspaces`, `useBillingUsage`).\n */\nexport function useOpenGeniClient(override: Pick<ClientOverride, \"client\"> = {}): SessionClientLike {\n const context = useContext(OpenGeniContext);\n const client = override.client ?? context?.client;\n if (!client) {\n throw new Error(\n \"@opengeni/react: no OpenGeni client available. Wrap the tree in <OpenGeniProvider> or pass { client } to the hook.\",\n );\n }\n return client;\n}\n","import type { SessionEvent } from \"@opengeni/sdk\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { SessionClientLike } from \"../client\";\n\nexport type AsyncListState<T> = {\n data: T | null;\n loading: boolean;\n error: Error | null;\n refresh: () => Promise<void>;\n};\n\n/**\n * Shared fetch + optional polling loop for the list/read hooks. Stale\n * responses (superseded by a newer load or an unmount) are dropped.\n */\nexport function usePolledValue<T>(load: () => Promise<T>, options: { pollIntervalMs?: number | undefined; enabled?: boolean | undefined } = {}): AsyncListState<T> {\n const enabled = options.enabled ?? true;\n const pollIntervalMs = options.pollIntervalMs;\n const [data, setData] = useState<T | null>(null);\n const [loading, setLoading] = useState(enabled);\n const [error, setError] = useState<Error | null>(null);\n const generation = useRef(0);\n const loadRef = useRef(load);\n\n // A new loader identity means a new query (different session/workspace/...):\n // drop the previous result instead of showing it as the new query's data.\n useEffect(() => {\n if (loadRef.current !== load) {\n loadRef.current = load;\n setData(null);\n setError(null);\n }\n }, [load]);\n\n const run = useCallback(async () => {\n const ticket = ++generation.current;\n try {\n const result = await load();\n if (ticket === generation.current) {\n setData(result);\n setError(null);\n setLoading(false);\n }\n } catch (cause) {\n if (ticket === generation.current) {\n setError(cause instanceof Error ? cause : new Error(String(cause)));\n setLoading(false);\n }\n }\n }, [load]);\n\n useEffect(() => {\n if (!enabled) {\n setLoading(false);\n return;\n }\n setLoading(true);\n void run();\n if (pollIntervalMs === undefined || pollIntervalMs <= 0) {\n return () => {\n generation.current += 1;\n };\n }\n const timer = setInterval(() => void run(), pollIntervalMs);\n return () => {\n clearInterval(timer);\n generation.current += 1;\n };\n }, [run, enabled, pollIntervalMs]);\n\n return { data, loading, error, refresh: run };\n}\n\nexport type MutationState = {\n mutating: boolean;\n mutationError: Error | null;\n clearMutationError: () => void;\n};\n\n/**\n * Shared async mutation runner for the write hooks. `run` resolves with the\n * operation's value, or `null` after capturing the error in `mutationError`\n * (callers then roll back optimistic state).\n */\nexport function useMutationRunner(): MutationState & {\n run: <T>(operation: () => Promise<T>) => Promise<T | null>;\n} {\n const [mutating, setMutating] = useState(false);\n const [mutationError, setMutationError] = useState<Error | null>(null);\n const inFlight = useRef(0);\n const mounted = useRef(true);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n const run = useCallback(async <T,>(operation: () => Promise<T>): Promise<T | null> => {\n inFlight.current += 1;\n if (mounted.current) {\n setMutating(true);\n setMutationError(null);\n }\n try {\n return await operation();\n } catch (cause) {\n if (mounted.current) {\n setMutationError(cause instanceof Error ? cause : new Error(String(cause)));\n }\n return null;\n } finally {\n inFlight.current -= 1;\n if (mounted.current && inFlight.current === 0) {\n setMutating(false);\n }\n }\n }, []);\n return {\n mutating,\n mutationError,\n clearMutationError: useCallback(() => setMutationError(null), []),\n run,\n };\n}\n\nexport type SessionEventFeedOptions = {\n /**\n * Share an existing event log (from `useSessionEvents`) instead of opening\n * a second stream. When omitted the hook tails the session's event stream\n * itself, starting at the current `lastSequence`.\n */\n events?: SessionEvent[] | undefined;\n enabled?: boolean | undefined;\n};\n\n/**\n * Invoke `onEvent` for every session event matching `match` — the live-update\n * primitive behind `useTurnQueue` and `useGoal`. Either watches a shared\n * `events` log or tails the stream directly (reconnect handled by the SDK).\n */\nexport function useSessionEventTrigger(\n client: SessionClientLike,\n workspaceId: string,\n sessionId: string | null | undefined,\n match: (event: SessionEvent) => boolean,\n onEvent: (event: SessionEvent) => void,\n options: SessionEventFeedOptions = {},\n): void {\n const enabled = options.enabled ?? true;\n const events = options.events;\n const sharedFeed = events !== undefined;\n const matchRef = useRef(match);\n matchRef.current = match;\n const onEventRef = useRef(onEvent);\n onEventRef.current = onEvent;\n const consumedRef = useRef(0);\n const feedKeyRef = useRef<string | null>(null);\n\n // Shared-log mode: scan only the unseen tail on every append.\n useEffect(() => {\n if (!sharedFeed || !enabled || !sessionId) {\n return;\n }\n const feedKey = `${workspaceId}\\u0000${sessionId}`;\n const firstSequence = events[0]?.sequence ?? 0;\n // A new session target or a log reset (sequence restarted below the\n // cursor) restarts consumption from the top of the shared log.\n if (feedKeyRef.current !== feedKey || firstSequence > consumedRef.current + 1) {\n feedKeyRef.current = feedKey;\n consumedRef.current = 0;\n }\n for (const event of events) {\n if (event.sequence <= consumedRef.current) {\n continue;\n }\n consumedRef.current = event.sequence;\n if (matchRef.current(event)) {\n onEventRef.current(event);\n }\n }\n }, [sharedFeed, enabled, events, workspaceId, sessionId]);\n\n // Self-stream mode: tail from the session's current lastSequence.\n useEffect(() => {\n if (sharedFeed || !enabled || !sessionId) {\n return;\n }\n const controller = new AbortController();\n void (async () => {\n try {\n const session = await client.getSession(workspaceId, sessionId);\n if (controller.signal.aborted) {\n return;\n }\n const stream = client.streamEvents(workspaceId, sessionId, {\n after: session.lastSequence,\n signal: controller.signal,\n });\n for await (const event of stream) {\n if (matchRef.current(event)) {\n onEventRef.current(event);\n }\n }\n } catch {\n // Live updates are best-effort: the read hooks still expose refresh()\n // and the initial load already populated state.\n }\n })();\n return () => {\n controller.abort();\n };\n }, [sharedFeed, enabled, client, workspaceId, sessionId]);\n}\n\n/** Debounce rapid event bursts into one trailing call (default 150ms). */\nexport function useDebouncedCallback(callback: () => void, delayMs = 150): () => void {\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => {\n return () => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n return useCallback(() => {\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n callbackRef.current();\n }, delayMs);\n }, [delayMs]);\n}\n"],"mappings":";AAgDO,SAAS,yBAAyB,OAAuC;AAC9E,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAEH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,SAAS;AAEP,YAAM,SAAgB;AACtB,aAAO;AAAA,IACT;AAAA,EACF;AACF;;;AClEA,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAapC,IAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,aAAa;AAAA,MACX,aAAa,CAAC,EAAE,MAAM,CAAC,SAAS,SAAS,WAAW,OAAO,EAAE,CAAC;AAAA,IAChE;AAAA,EACF;AACF,CAAC;AAGM,SAAS,MAAM,QAA8B;AAClD,SAAO,QAAQ,KAAK,MAAM,CAAC;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,CAAC;AACD,4BAAsB,IAAI;AAC1B,UAAI,OAAQ,OAAM,MAAM,QAAQ;AAChC,aAAO,WAAW;AAAA,IACpB;AAAA,IACA,CAAC,gBAAgB,aAAa,WAAW,SAAS,KAAK,MAAM,OAAO;AAAA,EACtE;AAEA,QAAM,cAAcA;AAAA,IAClB,OAAO,cAAsB,SAAsC,SAAkC;AACnG,UAAI,CAAC,eAAe,qBAAsB,QAAO,CAAC;AAClD,aAAO,MAAM,eAAe,qBAAqB,aAAa,cAAc,EAAE,OAAO,CAAC;AAAA,IACxF;AAAA,IACA,CAAC,gBAAgB,WAAW;AAAA,EAC9B;AAEA,SAAO;AAAA,IACL,UAAU,KAAK;AAAA,IACf,iBAAiB,KAAK;AAAA,IACtB,aAAa,KAAK;AAAA,IAClB,SAAS,MAAM;AAAA,IACf,OAAO,MAAM;AAAA,IACb,SAAS,MAAM;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,IACA,eAAe,SAAS;AAAA,IACxB,oBAAoB,SAAS;AAAA,EAC/B;AACF;","names":["jsx","jsxs","jsx","jsxs","LaptopIcon","jsx","jsxs","LaptopIcon","LaptopIcon","CpuIcon","UsersIcon","jsx","jsxs","LaptopIcon","CpuIcon","UsersIcon","LaptopIcon","Fragment","jsx","jsxs","LaptopIcon","LaptopIcon","MonitorIcon","TerminalIcon","UsersIcon","jsx","jsxs","LaptopIcon","TerminalIcon","MonitorIcon","UsersIcon","useCallback","useState","jsx","useState","useCallback","useState"]}
|