@opengeni/react 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-5C7RGAWA.js → chunk-NFYVQWIB.js} +170 -64
- package/dist/chunk-NFYVQWIB.js.map +1 -0
- package/dist/index.d.ts +791 -145
- package/dist/index.js +5447 -2213
- package/dist/index.js.map +1 -1
- package/dist/{machines-BeZ3bD3t.d.ts → machines-CnlMb7E-.d.ts} +5 -5
- package/dist/machines.d.ts +1 -1
- package/dist/machines.js +1 -1
- package/package.json +17 -12
- package/src/approvals.ts +16 -4
- package/src/client.ts +32 -5
- package/src/commands/index.ts +1 -7
- package/src/commands/registry.ts +46 -12
- package/src/components/chat-composer.tsx +135 -39
- package/src/components/code-editor.tsx +28 -36
- package/src/components/command-palette.tsx +26 -5
- package/src/components/desktop-viewer.tsx +29 -16
- package/src/components/diff-view.tsx +27 -189
- package/src/components/enrollment-consent.tsx +28 -10
- package/src/components/enrollment-device-flow.tsx +8 -5
- package/src/components/file-browser.tsx +190 -56
- package/src/components/fleet-tile.tsx +13 -4
- package/src/components/machine-card.tsx +16 -4
- package/src/components/machine-dock-bar.tsx +20 -8
- package/src/components/machine-metrics.tsx +31 -8
- package/src/components/machine-status-pill.tsx +26 -5
- package/src/components/machines-dashboard.tsx +8 -2
- package/src/components/markdown.tsx +39 -9
- package/src/components/message-timeline.tsx +633 -109
- package/src/components/pierre-diff.tsx +83 -15
- package/src/components/pierre-file.tsx +10 -9
- package/src/components/sandbox-files.tsx +110 -227
- package/src/components/sandbox-terminal.tsx +256 -88
- package/src/components/sandbox-workspace.tsx +823 -0
- package/src/components/session-status.tsx +28 -2
- package/src/components/workbench-changes.tsx +541 -0
- package/src/components/workspace-dock.tsx +85 -22
- package/src/hooks/internal.ts +5 -2
- package/src/hooks/use-available-models.ts +7 -2
- package/src/hooks/use-billing-usage.ts +4 -1
- package/src/hooks/use-codex-accounts.ts +74 -44
- package/src/hooks/use-composer.ts +57 -36
- package/src/hooks/use-environments.ts +92 -47
- package/src/hooks/use-file-attachments.ts +101 -55
- package/src/hooks/use-goal.ts +52 -16
- package/src/hooks/use-machine-chip.ts +134 -0
- package/src/hooks/use-machines.ts +34 -16
- package/src/hooks/use-packs.ts +24 -19
- package/src/hooks/use-relay-frame-stream.ts +5 -2
- package/src/hooks/use-rigs.ts +335 -0
- package/src/hooks/use-sandbox-files.ts +213 -39
- package/src/hooks/use-sandbox-git.ts +188 -11
- package/src/hooks/use-sandbox-terminal.ts +18 -14
- package/src/hooks/use-scheduled-tasks.ts +10 -2
- package/src/hooks/use-session-capabilities.ts +77 -20
- package/src/hooks/use-session-control.ts +49 -21
- package/src/hooks/use-session-events.ts +48 -20
- package/src/hooks/use-session-lineage.ts +119 -0
- package/src/hooks/use-session.ts +43 -28
- package/src/hooks/use-slash-commands.ts +6 -4
- package/src/hooks/use-turn-queue.ts +74 -147
- package/src/hooks/use-windowed-sections.ts +204 -0
- package/src/hooks/use-workspace-capture.ts +233 -0
- package/src/hooks/use-workspace-edit.ts +231 -0
- package/src/hooks/use-workspace-sessions.ts +48 -5
- package/src/hooks/use-workspaces.ts +18 -15
- package/src/index.ts +128 -23
- package/src/lib/format.ts +44 -6
- package/src/lib/xterm-renderer.ts +65 -0
- package/src/lib/xterm-theme.ts +224 -18
- package/src/machines.ts +13 -3
- package/src/provider.tsx +3 -1
- package/src/timeline/activity-rail.tsx +213 -54
- package/src/timeline/disclosure-context.tsx +12 -2
- package/src/timeline/index.ts +21 -2
- package/src/timeline/parsers.ts +44 -10
- package/src/timeline/projection.ts +435 -84
- package/src/timeline/shared.tsx +111 -24
- package/src/timeline/tool-diff.tsx +24 -20
- package/src/timeline/tool-renderers.tsx +98 -21
- package/src/timeline/turn-summary.tsx +76 -23
- package/src/timeline/types.ts +96 -12
- package/styles/tokens.css +2 -2
- package/dist/chunk-5C7RGAWA.js.map +0 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ export function App() {
|
|
|
123
123
|
handlers) behind `CommandPalette`.
|
|
124
124
|
- `useWorkspaceSessions()` / `useScheduledTasks()` — workspace lists for
|
|
125
125
|
fleet/manager views (optional polling).
|
|
126
|
-
- `
|
|
126
|
+
- `useVariable sets()` — workspace variable sets with create/update/remove and
|
|
127
127
|
write-only `setVariable`/`deleteVariable` (values never come back on reads).
|
|
128
128
|
- `usePacks()` — capability packs + installations with
|
|
129
129
|
register/enable/remove and `installationFor(packId)`.
|
|
@@ -67,7 +67,12 @@ var MACHINE_STATE_BADGE_META = {
|
|
|
67
67
|
badgeClassName: "text-og-accent border-og-accent/30 bg-og-accent-soft"
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
function ConnectionStatusPill({
|
|
70
|
+
function ConnectionStatusPill({
|
|
71
|
+
status,
|
|
72
|
+
label,
|
|
73
|
+
size = "md",
|
|
74
|
+
className
|
|
75
|
+
}) {
|
|
71
76
|
const meta = CONNECTION_STATUS_META[status];
|
|
72
77
|
return /* @__PURE__ */ jsxs(
|
|
73
78
|
"span",
|
|
@@ -88,42 +93,64 @@ function ConnectionStatusPill({ status, label, size = "md", className }) {
|
|
|
88
93
|
}
|
|
89
94
|
function ConnectionDot({ status, className }) {
|
|
90
95
|
const meta = CONNECTION_STATUS_META[status];
|
|
91
|
-
return /* @__PURE__ */ jsx(
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: cn(
|
|
100
|
+
"relative inline-flex size-1.5 shrink-0 rounded-full",
|
|
101
|
+
meta.dotClassName,
|
|
102
|
+
className
|
|
103
|
+
),
|
|
104
|
+
children: meta.pulse ? /* @__PURE__ */ jsx("span", { className: cn("absolute inset-0 animate-og-pulse rounded-full", meta.dotClassName) }) : null
|
|
105
|
+
}
|
|
106
|
+
);
|
|
92
107
|
}
|
|
93
|
-
function MachineStatusPill({
|
|
108
|
+
function MachineStatusPill({
|
|
109
|
+
state,
|
|
110
|
+
sharedSessionCount,
|
|
111
|
+
size = "md",
|
|
112
|
+
className
|
|
113
|
+
}) {
|
|
94
114
|
const stateBadge = MACHINE_STATE_BADGE_META[state];
|
|
95
115
|
const shared = (sharedSessionCount ?? 0) > 1;
|
|
96
|
-
return /* @__PURE__ */ jsxs(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
return /* @__PURE__ */ jsxs(
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
className: cn("og-root inline-flex flex-wrap items-center gap-1", className),
|
|
120
|
+
"data-machine-state": state,
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx(ConnectionStatusPill, { status: connectionStatusForState(state), size }),
|
|
123
|
+
stateBadge ? /* @__PURE__ */ jsx(
|
|
124
|
+
"span",
|
|
125
|
+
{
|
|
126
|
+
"data-state-badge": state,
|
|
127
|
+
className: cn(
|
|
128
|
+
"inline-flex shrink-0 items-center rounded-full border font-medium",
|
|
129
|
+
size === "sm" ? "px-1.5 py-px text-og-xs" : "px-2 py-0.5 text-og-sm",
|
|
130
|
+
stateBadge.badgeClassName
|
|
131
|
+
),
|
|
132
|
+
children: stateBadge.label
|
|
133
|
+
}
|
|
134
|
+
) : null,
|
|
135
|
+
shared ? /* @__PURE__ */ jsxs(
|
|
136
|
+
"span",
|
|
137
|
+
{
|
|
138
|
+
"data-shared-chip": true,
|
|
139
|
+
className: cn(
|
|
140
|
+
"inline-flex shrink-0 items-center gap-1 rounded-full border font-medium",
|
|
141
|
+
"text-og-accent border-og-accent/30 bg-og-accent-soft",
|
|
142
|
+
size === "sm" ? "px-1.5 py-px text-og-xs" : "px-2 py-0.5 text-og-sm"
|
|
143
|
+
),
|
|
144
|
+
title: `${sharedSessionCount} sessions are on this machine`,
|
|
145
|
+
children: [
|
|
146
|
+
"Shared \xB7 ",
|
|
147
|
+
sharedSessionCount
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
) : null
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
127
154
|
}
|
|
128
155
|
|
|
129
156
|
// src/lib/format.ts
|
|
@@ -202,10 +229,28 @@ function tryParseJson(text) {
|
|
|
202
229
|
return void 0;
|
|
203
230
|
}
|
|
204
231
|
}
|
|
232
|
+
var CREDIT_EXHAUSTION_MESSAGE = "Out of OpenGeni credits \u2014 this workspace's balance is empty. Add credits to continue; the conversation is preserved.";
|
|
233
|
+
function isCreditExhaustion(input) {
|
|
234
|
+
if (typeof input === "string") {
|
|
235
|
+
return input.toLowerCase().includes("insufficient opengeni credits");
|
|
236
|
+
}
|
|
237
|
+
if (input.segmentLimit === "budget_exhausted") {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
for (const text of [input.error, input.detail]) {
|
|
241
|
+
if (typeof text === "string" && text.toLowerCase().includes("insufficient opengeni credits")) {
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
205
247
|
function humanizeFailureReason(reason) {
|
|
206
248
|
if (!reason) {
|
|
207
249
|
return reason;
|
|
208
250
|
}
|
|
251
|
+
if (isCreditExhaustion(reason)) {
|
|
252
|
+
return CREDIT_EXHAUSTION_MESSAGE;
|
|
253
|
+
}
|
|
209
254
|
const normalized = reason.toLowerCase();
|
|
210
255
|
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
256
|
if (authFailure) {
|
|
@@ -269,7 +314,16 @@ function StatTriple({
|
|
|
269
314
|
/* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
270
315
|
/* @__PURE__ */ jsx2("span", { className: "text-[10px] font-medium uppercase tracking-wide text-og-fg-subtle", children: "Load" }),
|
|
271
316
|
/* @__PURE__ */ jsx2("div", { className: "flex items-baseline gap-3", children: stats.map((s) => /* @__PURE__ */ jsxs2("div", { className: "flex items-baseline gap-1", children: [
|
|
272
|
-
/* @__PURE__ */ jsx2(
|
|
317
|
+
/* @__PURE__ */ jsx2(
|
|
318
|
+
"span",
|
|
319
|
+
{
|
|
320
|
+
className: cn(
|
|
321
|
+
"text-[10px] font-medium uppercase tracking-wide",
|
|
322
|
+
toneTextClass(tone)
|
|
323
|
+
),
|
|
324
|
+
children: s.label
|
|
325
|
+
}
|
|
326
|
+
),
|
|
273
327
|
/* @__PURE__ */ jsx2("span", { className: cn("font-og-mono text-[12px] tabular-nums", toneTextClass(tone)), children: s.value.toFixed(2) })
|
|
274
328
|
] }, s.label)) })
|
|
275
329
|
] }),
|
|
@@ -359,7 +413,8 @@ import {
|
|
|
359
413
|
} from "lucide-react";
|
|
360
414
|
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
361
415
|
function KindIcon({ machine }) {
|
|
362
|
-
if (machine.isSessionGroup)
|
|
416
|
+
if (machine.isSessionGroup)
|
|
417
|
+
return /* @__PURE__ */ jsx3(ServerIcon, { className: "size-4 text-og-fg-subtle", "aria-hidden": true });
|
|
363
418
|
if (machine.kind === "modal") return /* @__PURE__ */ jsx3(CpuIcon, { className: "size-4 text-og-fg-subtle", "aria-hidden": true });
|
|
364
419
|
return /* @__PURE__ */ jsx3(LaptopIcon, { className: "size-4 text-og-fg-subtle", "aria-hidden": true });
|
|
365
420
|
}
|
|
@@ -411,7 +466,15 @@ function MachineCard({ machine, onAttach, attaching, className }) {
|
|
|
411
466
|
] })
|
|
412
467
|
] })
|
|
413
468
|
] }),
|
|
414
|
-
/* @__PURE__ */ jsx3(
|
|
469
|
+
/* @__PURE__ */ jsx3(
|
|
470
|
+
MachineStatusPill,
|
|
471
|
+
{
|
|
472
|
+
state: machine.state,
|
|
473
|
+
sharedSessionCount: machine.sharedSessionCount,
|
|
474
|
+
size: "sm",
|
|
475
|
+
className: "shrink-0"
|
|
476
|
+
}
|
|
477
|
+
)
|
|
415
478
|
] }),
|
|
416
479
|
shared ? /* @__PURE__ */ jsxs3(
|
|
417
480
|
"p",
|
|
@@ -564,10 +627,19 @@ function MachinesDashboard({
|
|
|
564
627
|
]
|
|
565
628
|
}
|
|
566
629
|
) : null,
|
|
567
|
-
loading && machines.length === 0 ? /* @__PURE__ */ jsx4("div", { "data-machines-loading": true, className: "grid gap-3 sm:grid-cols-2", children: [0, 1].map((i) => /* @__PURE__ */ jsx4(
|
|
630
|
+
loading && machines.length === 0 ? /* @__PURE__ */ jsx4("div", { "data-machines-loading": true, className: "grid gap-3 sm:grid-cols-2", children: [0, 1].map((i) => /* @__PURE__ */ jsx4(
|
|
631
|
+
"div",
|
|
632
|
+
{
|
|
633
|
+
className: "h-36 animate-og-pulse rounded-og-lg border border-og-border bg-og-surface-1"
|
|
634
|
+
},
|
|
635
|
+
i
|
|
636
|
+
)) }) : isEmpty ? /* @__PURE__ */ jsx4(EmptyState, { onEnroll }) : /* @__PURE__ */ jsx4("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", "data-machines-grid": true, children: machines.map((machine) => /* @__PURE__ */ jsx4(
|
|
568
637
|
MachineCard,
|
|
569
638
|
{
|
|
570
|
-
machine: {
|
|
639
|
+
machine: {
|
|
640
|
+
...machine,
|
|
641
|
+
active: machine.active || machine.sandboxId === activeSandboxId
|
|
642
|
+
},
|
|
571
643
|
onAttach,
|
|
572
644
|
attaching: attachingSandboxId === machine.sandboxId
|
|
573
645
|
},
|
|
@@ -579,10 +651,9 @@ function MachinesDashboard({
|
|
|
579
651
|
// src/components/machine-dock-bar.tsx
|
|
580
652
|
import { LaptopIcon as LaptopIcon3, CpuIcon as CpuIcon2, UsersIcon as UsersIcon2 } from "lucide-react";
|
|
581
653
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
582
|
-
function MachineDockBar({ name, kind, state,
|
|
654
|
+
function MachineDockBar({ name, kind, state, className }) {
|
|
583
655
|
const Icon = kind === "selfhosted" ? LaptopIcon3 : CpuIcon2;
|
|
584
656
|
const stateBadge = MACHINE_STATE_BADGE_META[state];
|
|
585
|
-
const shared = (sharedSessionCount ?? 0) > 1;
|
|
586
657
|
return /* @__PURE__ */ jsxs5(
|
|
587
658
|
"div",
|
|
588
659
|
{
|
|
@@ -599,17 +670,31 @@ function MachineDockBar({ name, kind, state, sharedSessionCount, className }) {
|
|
|
599
670
|
"span",
|
|
600
671
|
{
|
|
601
672
|
"data-state-badge": state,
|
|
602
|
-
className: cn(
|
|
673
|
+
className: cn(
|
|
674
|
+
"shrink-0 rounded-full border px-1.5 py-px text-[10px] font-medium",
|
|
675
|
+
stateBadge.badgeClassName
|
|
676
|
+
),
|
|
603
677
|
children: stateBadge.label
|
|
604
678
|
}
|
|
605
679
|
) : null
|
|
606
680
|
] }),
|
|
607
|
-
/* @__PURE__ */ jsx5(
|
|
681
|
+
/* @__PURE__ */ jsx5(
|
|
682
|
+
ConnectionStatusPill,
|
|
683
|
+
{
|
|
684
|
+
status: connectionStatusForState(state),
|
|
685
|
+
size: "sm",
|
|
686
|
+
className: "shrink-0"
|
|
687
|
+
}
|
|
688
|
+
)
|
|
608
689
|
]
|
|
609
690
|
}
|
|
610
691
|
);
|
|
611
692
|
}
|
|
612
|
-
function SharedMachineDisclosure({
|
|
693
|
+
function SharedMachineDisclosure({
|
|
694
|
+
sharedSessionCount,
|
|
695
|
+
density = "compact",
|
|
696
|
+
className
|
|
697
|
+
}) {
|
|
613
698
|
const others = Math.max(0, sharedSessionCount - 1);
|
|
614
699
|
return /* @__PURE__ */ jsxs5(
|
|
615
700
|
"div",
|
|
@@ -758,7 +843,8 @@ function EnrollmentDeviceFlow({
|
|
|
758
843
|
] }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
759
844
|
"Confirm code ",
|
|
760
845
|
/* @__PURE__ */ jsx6("span", { className: "font-og-mono text-og-fg-muted", children: userCode }),
|
|
761
|
-
" \u2014 the one printed by the one-liner \u2014 at
|
|
846
|
+
" \u2014 the one printed by the one-liner \u2014 at",
|
|
847
|
+
" ",
|
|
762
848
|
/* @__PURE__ */ jsx6("span", { className: "font-og-mono text-og-fg-muted", children: verificationUri }),
|
|
763
849
|
".",
|
|
764
850
|
typeof expiresInSeconds === "number" ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
@@ -851,7 +937,8 @@ function EnrollmentConsent({
|
|
|
851
937
|
/* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
|
|
852
938
|
/* @__PURE__ */ jsx7("h1", { className: "text-og-md font-semibold text-og-fg", children: "Give the agent your whole machine?" }),
|
|
853
939
|
/* @__PURE__ */ jsxs7("p", { className: "mt-1 text-og-base text-og-fg-muted", children: [
|
|
854
|
-
"Approving lets the OpenGeni agent run on
|
|
940
|
+
"Approving lets the OpenGeni agent run on",
|
|
941
|
+
" ",
|
|
855
942
|
/* @__PURE__ */ jsx7("span", { className: "font-medium text-og-fg", children: machine.machineName }),
|
|
856
943
|
" with full access. This is your real computer \u2014 not a sandbox."
|
|
857
944
|
] })
|
|
@@ -972,7 +1059,16 @@ function ConsentResult({
|
|
|
972
1059
|
className
|
|
973
1060
|
),
|
|
974
1061
|
children: [
|
|
975
|
-
/* @__PURE__ */ jsx7(
|
|
1062
|
+
/* @__PURE__ */ jsx7(
|
|
1063
|
+
"span",
|
|
1064
|
+
{
|
|
1065
|
+
className: cn(
|
|
1066
|
+
"flex size-10 items-center justify-center rounded-full bg-og-surface-2",
|
|
1067
|
+
iconClass
|
|
1068
|
+
),
|
|
1069
|
+
children: /* @__PURE__ */ jsx7(LaptopIcon5, { className: "size-5", "aria-hidden": true })
|
|
1070
|
+
}
|
|
1071
|
+
),
|
|
976
1072
|
/* @__PURE__ */ jsx7("h1", { className: "text-og-md font-semibold text-og-fg", children: title }),
|
|
977
1073
|
/* @__PURE__ */ jsx7("p", { className: "max-w-sm text-og-base text-og-fg-muted", children: body })
|
|
978
1074
|
]
|
|
@@ -1193,10 +1289,18 @@ function useMachines(options = {}) {
|
|
|
1193
1289
|
const load = useCallback2(async () => {
|
|
1194
1290
|
return await machinesClient.listMachines(workspaceId, sessionId ? { sessionId } : void 0);
|
|
1195
1291
|
}, [machinesClient, workspaceId, sessionId]);
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1292
|
+
const {
|
|
1293
|
+
data: loadedData,
|
|
1294
|
+
loading,
|
|
1295
|
+
error,
|
|
1296
|
+
refresh
|
|
1297
|
+
} = usePolledValue(load, {
|
|
1298
|
+
pollIntervalMs: options.pollIntervalMs,
|
|
1299
|
+
enabled: options.enabled
|
|
1300
|
+
});
|
|
1301
|
+
const { run, mutating, mutationError, clearMutationError } = useMutationRunner();
|
|
1198
1302
|
const [attachingSandboxId, setAttachingSandboxId] = useState3(null);
|
|
1199
|
-
const data =
|
|
1303
|
+
const data = loadedData ?? EMPTY;
|
|
1200
1304
|
const canAttach = sessionId !== void 0 && (typeof machinesClient.attachMachine === "function" || typeof machinesClient.swapActiveSandbox === "function");
|
|
1201
1305
|
const attach = useCallback2(
|
|
1202
1306
|
async (sandboxId) => {
|
|
@@ -1204,15 +1308,15 @@ function useMachines(options = {}) {
|
|
|
1204
1308
|
const runSwap = machinesClient.attachMachine ? () => machinesClient.attachMachine(workspaceId, sessionId, sandboxId) : machinesClient.swapActiveSandbox ? () => machinesClient.swapActiveSandbox(workspaceId, sessionId, { target: sandboxId }) : null;
|
|
1205
1309
|
if (!runSwap) return false;
|
|
1206
1310
|
setAttachingSandboxId(sandboxId);
|
|
1207
|
-
const result = await
|
|
1311
|
+
const result = await run(async () => {
|
|
1208
1312
|
await runSwap();
|
|
1209
1313
|
return true;
|
|
1210
1314
|
});
|
|
1211
1315
|
setAttachingSandboxId(null);
|
|
1212
|
-
if (result) await
|
|
1316
|
+
if (result) await refresh();
|
|
1213
1317
|
return result === true;
|
|
1214
1318
|
},
|
|
1215
|
-
[machinesClient, workspaceId, sessionId,
|
|
1319
|
+
[machinesClient, workspaceId, sessionId, run, refresh]
|
|
1216
1320
|
);
|
|
1217
1321
|
const fetchSeries = useCallback2(
|
|
1218
1322
|
async (enrollmentId, window = "1h") => {
|
|
@@ -1225,16 +1329,16 @@ function useMachines(options = {}) {
|
|
|
1225
1329
|
machines: data.machines,
|
|
1226
1330
|
activeSandboxId: data.activeSandboxId,
|
|
1227
1331
|
activeEpoch: data.activeEpoch,
|
|
1228
|
-
loading
|
|
1229
|
-
error
|
|
1230
|
-
refresh
|
|
1332
|
+
loading,
|
|
1333
|
+
error,
|
|
1334
|
+
refresh,
|
|
1231
1335
|
attach,
|
|
1232
1336
|
canAttach,
|
|
1233
1337
|
fetchSeries,
|
|
1234
|
-
attaching:
|
|
1338
|
+
attaching: mutating,
|
|
1235
1339
|
attachingSandboxId,
|
|
1236
|
-
mutationError
|
|
1237
|
-
clearMutationError
|
|
1340
|
+
mutationError,
|
|
1341
|
+
clearMutationError
|
|
1238
1342
|
};
|
|
1239
1343
|
}
|
|
1240
1344
|
|
|
@@ -1251,21 +1355,23 @@ export {
|
|
|
1251
1355
|
truncate,
|
|
1252
1356
|
stringifyPayload,
|
|
1253
1357
|
tryParseJson,
|
|
1358
|
+
CREDIT_EXHAUSTION_MESSAGE,
|
|
1359
|
+
isCreditExhaustion,
|
|
1254
1360
|
humanizeFailureReason,
|
|
1255
1361
|
cn,
|
|
1362
|
+
useMachines,
|
|
1256
1363
|
connectionStatusForState,
|
|
1257
1364
|
CONNECTION_STATUS_META,
|
|
1258
1365
|
MACHINE_STATE_BADGE_META,
|
|
1259
1366
|
ConnectionStatusPill,
|
|
1260
1367
|
ConnectionDot,
|
|
1261
1368
|
MachineStatusPill,
|
|
1369
|
+
MachineDockBar,
|
|
1370
|
+
SharedMachineDisclosure,
|
|
1262
1371
|
MachineMetrics,
|
|
1263
1372
|
MachineCard,
|
|
1264
1373
|
MachinesDashboard,
|
|
1265
|
-
MachineDockBar,
|
|
1266
|
-
SharedMachineDisclosure,
|
|
1267
1374
|
EnrollmentDeviceFlow,
|
|
1268
|
-
EnrollmentConsent
|
|
1269
|
-
useMachines
|
|
1375
|
+
EnrollmentConsent
|
|
1270
1376
|
};
|
|
1271
|
-
//# sourceMappingURL=chunk-
|
|
1377
|
+
//# sourceMappingURL=chunk-NFYVQWIB.js.map
|