@baochunli/flakes 0.0.5 → 0.0.6
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/dist/node_modules/@flakes/auth/package.json +1 -1
- package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{DocumentationPage-CNPk8RVl.js → DocumentationPage-CGIcMKwf.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-ByTl4Kyy.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-5MmbVpaE.js +3 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{RunsPage-CJbycrqM.js → RunsPage-fbDKP9kM.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{SandboxesLens-BoLM52PY.js → SandboxesLens-DPG87mUE.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-DIpzR_Ef.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-mCgSqfv0.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/_-CM2hE2sZ.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/_runId-3ZZOAqUK.js +2 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-cy4RxW8Y.js +2 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{account-BoRurhrq.js → account-BWoGGXJw.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{account-forms-D4eVqOhW.js → account-forms-Dq70JDyg.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{auth-layout-DBnq_eif.js → auth-layout-BFusNq3W.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{bits-BOMPEHvv.js → bits-CTGNpp-v.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/device-BajR3eSF.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/documentation-6ao_Ux6x.js +1 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{forgot-password-BSQ4TWpA.js → forgot-password-DOKn8_7P.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/main-DVO9gWzi.js +1215 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{otp-verification-CussJQT1.js → otp-verification-qolVtiom.js} +2 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/projects-n5LSsNi3.js +2 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{reset-password-DwWhVkEh.js → reset-password-D-OlZeHQ.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/runs-BB9ogobQ.js +2 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-BIimz5FI.js +2 -0
- package/dist/node_modules/@flakes/console/.output/public/assets/{security-MjM55vIw.js → security-DdQNcp6k.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{signin-KbA1cD6o.js → signin-BoZiVxyq.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{signin-form-CBF-d8iK.js → signin-form-tTBWDjhi.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/{signup-CbHsThKr.js → signup-CBSszmUC.js} +1 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/styles-B8OXOvkO.css +2 -0
- package/dist/node_modules/@flakes/console/.output/server/{_-BULJ6utw.mjs → _-BGsKgsbF.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/{_-_ST9QYWn.mjs → _-DtPMXzt0.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/_chunks/ProjectsPage.mjs +1 -2
- package/dist/node_modules/@flakes/console/.output/server/_chunks/RunPage.mjs +1 -2
- package/dist/node_modules/@flakes/console/.output/server/_chunks/RunsPage.mjs +1 -2
- package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesLens.mjs +1 -1
- package/dist/node_modules/@flakes/console/.output/server/_chunks/SandboxesPage.mjs +253 -18
- package/dist/node_modules/@flakes/console/.output/server/_chunks/TranscriptPage.mjs +1 -2
- package/dist/node_modules/@flakes/console/.output/server/_chunks/bits.mjs +1 -1
- package/dist/node_modules/@flakes/console/.output/server/_chunks/button.mjs +461 -3
- package/dist/node_modules/@flakes/console/.output/server/_chunks/card.mjs +1 -1
- package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +3 -4
- package/dist/node_modules/@flakes/console/.output/server/_chunks/table.mjs +1 -1
- package/dist/node_modules/@flakes/console/.output/server/{_runId-WZmbo654.mjs → _runId-P1u-vfcm.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/{_runId-CmYWNL8A.mjs → _runId-vO4tlCOP.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{App-CUx8Ftit.mjs → App-C-XaVKoO.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-0I9oWWJT.mjs → DocumentationPage-BR2KosFz.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{ProjectsPage-CGj9V2Of.mjs → ProjectsPage-BUrep1wl.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunPage-B2vhVaj6.mjs → RunPage-BHs-v0LU.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{RunsPage-BifKogQE.mjs → RunsPage-iTNYVwL0.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-C1Z6dVce.mjs +423 -0
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{TranscriptPage-deSxVZaQ.mjs → TranscriptPage-BcomoTls.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{account-D5y9vkAc.mjs → account-Cp0s_IQK.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C91gfyy0.mjs → documentation-BnxmM-Yo.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-C69e9_eF.mjs → documentation-Cgyr3VKK.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{hooks-DrgN35zn.mjs → hooks-CsVtQ1m-.mjs} +117 -51
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{projects-lJ2tIIPj.mjs → projects-R9sxR_t4.mjs} +1 -1
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-DHxFQ03L.mjs → router-CobdI6gO.mjs} +12 -12
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-dnPfp9dt.mjs → runs-D8MHe3QU.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{runs-BWxEGKO_.mjs → runs-mTxbc_pm.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-v28LJQM3.mjs → sandboxes-B2z_9JyU.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/_ssr/{sandboxes-hxFINxDS.mjs → sandboxes-r0y6Ihg6.mjs} +3 -3
- package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
- package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-DfwuEzTr.mjs → _tanstack-start-manifest_v-DpAwCFK9.mjs} +32 -33
- package/dist/node_modules/@flakes/console/.output/server/{_taskId-CBo95z-s.mjs → _taskId-Cz9xwj5L.mjs} +2 -2
- package/dist/node_modules/@flakes/console/.output/server/{_taskId-Sil3-PKh.mjs → _taskId-wQsG2CQj.mjs} +3 -3
- package/dist/node_modules/@flakes/console/package.json +1 -1
- package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts +1 -1
- package/dist/node_modules/@flakes/control-plane/dist/host-credentials.d.ts.map +1 -1
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js +48 -3
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes.js.map +1 -1
- package/dist/node_modules/@flakes/control-plane/package.json +1 -1
- package/dist/node_modules/@flakes/core/package.json +1 -1
- package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
- package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
- package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
- package/dist/node_modules/@flakes/protocol/package.json +1 -1
- package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
- package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts +9 -1
- package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.d.ts.map +1 -1
- package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js +407 -6
- package/dist/node_modules/@flakes/store/dist/managed-sandbox-instances-store.js.map +1 -1
- package/dist/node_modules/@flakes/store/dist/mappers.d.ts.map +1 -1
- package/dist/node_modules/@flakes/store/dist/mappers.js +1 -0
- package/dist/node_modules/@flakes/store/dist/mappers.js.map +1 -1
- package/dist/node_modules/@flakes/store/dist/types.d.ts +30 -1
- package/dist/node_modules/@flakes/store/dist/types.d.ts.map +1 -1
- package/dist/node_modules/@flakes/store/package.json +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts +0 -10
- package/dist/node_modules/@flakes/auth/dist/better-auth-shape.d.ts.map +0 -1
- package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js +0 -16
- package/dist/node_modules/@flakes/auth/dist/better-auth-shape.js.map +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/ProjectsPage-CKPR1nnu.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/RunPage-BdugbnA3.js +0 -3
- package/dist/node_modules/@flakes/console/.output/public/assets/SandboxesPage-6KHjMeaR.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/TranscriptPage-CHSq0_qN.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/_-CD1Voz9h.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/_runId-_0VPmGYe.js +0 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/_taskId-CPAKAp4X.js +0 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/device-FqII-S41.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/dist-BEfdrJTS.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/documentation-2C3ncAuV.js +0 -1
- package/dist/node_modules/@flakes/console/.output/public/assets/main-LpSDdT-S.js +0 -1215
- package/dist/node_modules/@flakes/console/.output/public/assets/projects-CLgKBrCe.js +0 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/runs-CFYk2iRh.js +0 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/sandboxes-mGsOcVFL.js +0 -2
- package/dist/node_modules/@flakes/console/.output/public/assets/styles-DtA2wbW8.css +0 -2
- package/dist/node_modules/@flakes/console/.output/server/_chunks/utils.mjs +0 -393
- package/dist/node_modules/@flakes/console/.output/server/_ssr/SandboxesPage-DGji_OdB.mjs +0 -187
- package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts +0 -71
- package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.d.ts.map +0 -1
- package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js +0 -243
- package/dist/node_modules/@flakes/control-plane/dist/managed-sandbox-provisioner.js.map +0 -1
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts +0 -3
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.d.ts.map +0 -1
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js +0 -153
- package/dist/node_modules/@flakes/control-plane/dist/routes/sandboxes-admin.js.map +0 -1
- package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts +0 -19
- package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.d.ts.map +0 -1
- package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js +0 -46
- package/dist/node_modules/@flakes/control-plane/dist/sandbox-drain.js.map +0 -1
- package/dist/node_modules/@flakes/store/dist/sqlite.d.ts +0 -4
- package/dist/node_modules/@flakes/store/dist/sqlite.d.ts.map +0 -1
- package/dist/node_modules/@flakes/store/dist/sqlite.js +0 -34
- package/dist/node_modules/@flakes/store/dist/sqlite.js.map +0 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { o as __toESM } from "../_runtime.mjs";
|
|
1
2
|
import { c as require_jsx_runtime } from "../_libs/@radix-ui/react-arrow+[...].mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { u as require_react } from "../_libs/@floating-ui/react-dom+[...].mjs";
|
|
4
|
+
import { D as LoaderCircle, I as ExternalLink, J as Boxes, X as ArrowRight, r as X, s as Trash2 } from "../_libs/lucide-react.mjs";
|
|
5
|
+
import { D as managedSandboxDeleteAction, O as managedSandboxDeleteErrorMessage, h as useSandboxFleet, m as useRuns, n as cn, p as useRunTasks, r as useDeleteManagedSandbox, t as Button } from "./button.mjs";
|
|
4
6
|
import { n as CardContent, t as Card } from "./card.mjs";
|
|
5
7
|
import { c as timeAgo, d as Skeleton, l as useClockTick, o as taskOrdinals, t as StateBadge } from "./bits.mjs";
|
|
8
|
+
import { a as TableHeader, i as TableHead, n as TableBody, o as TableRow, r as TableCell, t as Table } from "./table.mjs";
|
|
6
9
|
import { t as SandboxesLens } from "./SandboxesLens.mjs";
|
|
7
10
|
//#region src/views/SandboxesPage.tsx
|
|
11
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
12
|
var import_jsx_runtime = require_jsx_runtime();
|
|
9
13
|
function SandboxesPage(props) {
|
|
10
14
|
const runs = useRuns();
|
|
@@ -13,26 +17,257 @@ function SandboxesPage(props) {
|
|
|
13
17
|
const selectedRun = loadedRuns.find((run) => run.runId === props.selectedRunId) ?? loadedRuns[0];
|
|
14
18
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
15
19
|
className: "grid gap-5",
|
|
16
|
-
children: [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
22
|
+
className: "text-lg font-semibold tracking-tight",
|
|
23
|
+
children: "Sandboxes"
|
|
24
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
25
|
+
className: "text-sm text-muted-foreground",
|
|
26
|
+
children: "Managed fleet state and sandbox placement by run."
|
|
27
|
+
})] }),
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ManagedSandboxFleet, {}),
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RunPlacementHistory, {
|
|
30
|
+
runs,
|
|
31
|
+
loadedRuns,
|
|
32
|
+
selectedRun,
|
|
33
|
+
onSelectRun: props.onSelectRun,
|
|
34
|
+
onOpenRun: props.onOpenRun,
|
|
35
|
+
onOpenTask: props.onOpenTask
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function ManagedSandboxFleet() {
|
|
41
|
+
const sandboxFleet = useSandboxFleet();
|
|
42
|
+
const deleteSandbox = useDeleteManagedSandbox();
|
|
43
|
+
const [confirmingSandboxId, setConfirmingSandboxId] = (0, import_react.useState)(null);
|
|
44
|
+
const [pendingSandboxId, setPendingSandboxId] = (0, import_react.useState)(null);
|
|
45
|
+
const [feedback, setFeedback] = (0, import_react.useState)(null);
|
|
46
|
+
async function confirmDelete(sandbox) {
|
|
47
|
+
setPendingSandboxId(sandbox.sandboxId);
|
|
48
|
+
setFeedback(null);
|
|
49
|
+
try {
|
|
50
|
+
const result = await deleteSandbox.mutateAsync(sandbox.sandboxId);
|
|
51
|
+
setConfirmingSandboxId(null);
|
|
52
|
+
setFeedback(deleteSuccessFeedback(result));
|
|
53
|
+
} catch (error) {
|
|
54
|
+
setFeedback({
|
|
55
|
+
tone: "error",
|
|
56
|
+
sandboxId: sandbox.sandboxId,
|
|
57
|
+
message: managedSandboxDeleteErrorMessage(error)
|
|
58
|
+
});
|
|
59
|
+
} finally {
|
|
60
|
+
setPendingSandboxId(null);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const rows = sandboxFleet.data?.sandboxes ?? [];
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, {
|
|
65
|
+
className: "py-0",
|
|
66
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
|
|
67
|
+
className: "grid gap-3 p-4",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
70
|
+
className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
|
|
71
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
72
|
+
className: "min-w-0",
|
|
73
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
|
|
74
|
+
className: "console-callout",
|
|
75
|
+
children: "Managed fleet"
|
|
76
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
77
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
78
|
+
"data-num": true,
|
|
79
|
+
children: sandboxFleet.isPending ? "Loading" : `${rows.length} sandboxes`
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
sandboxFleet.isError ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
84
|
+
className: "text-sm text-destructive",
|
|
85
|
+
children: ["Cannot list managed sandboxes: ", String(sandboxFleet.error)]
|
|
86
|
+
}) : sandboxFleet.isPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
87
|
+
className: "grid gap-2",
|
|
88
|
+
children: [
|
|
89
|
+
0,
|
|
90
|
+
1,
|
|
91
|
+
2
|
|
92
|
+
].map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-10 w-full" }, row))
|
|
93
|
+
}) : rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
94
|
+
className: "rounded-md border border-dashed py-8 text-center",
|
|
95
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Boxes, { className: "mx-auto size-5 text-muted-foreground" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
96
|
+
className: "mt-3 text-sm font-medium",
|
|
97
|
+
children: "No managed sandboxes"
|
|
98
|
+
})]
|
|
99
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, { children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Sandbox" }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Lifecycle" }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Liveness" }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Host" }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, { children: "Updated" }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
106
|
+
className: "text-right",
|
|
107
|
+
children: "Delete"
|
|
108
|
+
})
|
|
109
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, { children: rows.map((sandbox) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ManagedSandboxRow, {
|
|
110
|
+
sandbox,
|
|
111
|
+
confirming: confirmingSandboxId === sandbox.sandboxId,
|
|
112
|
+
pending: pendingSandboxId === sandbox.sandboxId,
|
|
113
|
+
disabled: deleteSandbox.isPending,
|
|
114
|
+
onRequestDelete: () => {
|
|
115
|
+
setFeedback(null);
|
|
116
|
+
setConfirmingSandboxId(sandbox.sandboxId);
|
|
117
|
+
},
|
|
118
|
+
onCancelDelete: () => setConfirmingSandboxId(null),
|
|
119
|
+
onConfirmDelete: () => void confirmDelete(sandbox)
|
|
120
|
+
}, sandbox.sandboxId)) })] }),
|
|
121
|
+
feedback ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
122
|
+
role: feedback.tone === "error" ? "alert" : "status",
|
|
123
|
+
className: cn("text-xs", feedback.tone === "error" ? "text-destructive" : "text-muted-foreground"),
|
|
124
|
+
children: [feedback.sandboxId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
125
|
+
className: "font-mono",
|
|
126
|
+
"data-num": true,
|
|
127
|
+
children: [
|
|
128
|
+
feedback.sandboxId,
|
|
129
|
+
":",
|
|
130
|
+
" "
|
|
131
|
+
]
|
|
132
|
+
}) : null, feedback.message]
|
|
133
|
+
}) : null
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function ManagedSandboxRow(props) {
|
|
139
|
+
const action = managedSandboxDeleteAction(props.sandbox, props.pending, props.confirming);
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, { children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableCell, {
|
|
142
|
+
className: "max-w-[16rem]",
|
|
143
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
144
|
+
className: "truncate font-mono text-xs text-foreground",
|
|
145
|
+
title: props.sandbox.sandboxId,
|
|
146
|
+
"data-num": true,
|
|
147
|
+
children: props.sandbox.sandboxId
|
|
148
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
149
|
+
className: "mt-1 truncate font-mono text-[11px] text-muted-foreground",
|
|
150
|
+
title: props.sandbox.instanceId,
|
|
151
|
+
"data-num": true,
|
|
152
|
+
children: props.sandbox.instanceId
|
|
153
|
+
})]
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StateBadge, {
|
|
156
|
+
state: props.sandbox.status,
|
|
157
|
+
id: props.sandbox.sandboxId
|
|
158
|
+
}) }),
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StateBadge, {
|
|
160
|
+
state: props.sandbox.sandboxStatus ?? "unknown",
|
|
161
|
+
id: props.sandbox.sandboxId
|
|
162
|
+
}) }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableCell, {
|
|
164
|
+
className: "max-w-[13rem]",
|
|
165
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
166
|
+
className: "truncate font-mono text-xs",
|
|
167
|
+
title: props.sandbox.hostId,
|
|
168
|
+
"data-num": true,
|
|
169
|
+
children: props.sandbox.hostId
|
|
170
|
+
}), props.sandbox.hostPoolId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
171
|
+
className: "mt-1 truncate font-mono text-[11px] text-muted-foreground",
|
|
172
|
+
title: props.sandbox.hostPoolId,
|
|
173
|
+
"data-num": true,
|
|
174
|
+
children: props.sandbox.hostPoolId
|
|
175
|
+
}) : null]
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
178
|
+
className: "font-mono text-[11px] text-muted-foreground",
|
|
179
|
+
title: props.sandbox.updatedAt,
|
|
180
|
+
"data-num": true,
|
|
181
|
+
children: timeAgo(props.sandbox.updatedAt)
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
184
|
+
className: "text-right",
|
|
185
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ManagedSandboxDeleteControls, {
|
|
186
|
+
action,
|
|
187
|
+
cleanupQueued: props.sandbox.status === "deleting",
|
|
188
|
+
disabled: props.disabled,
|
|
189
|
+
sandboxId: props.sandbox.sandboxId,
|
|
190
|
+
onRequestDelete: props.onRequestDelete,
|
|
191
|
+
onCancelDelete: props.onCancelDelete,
|
|
192
|
+
onConfirmDelete: props.onConfirmDelete
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
] });
|
|
196
|
+
}
|
|
197
|
+
function ManagedSandboxDeleteControls(props) {
|
|
198
|
+
if (props.action === "pending") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, {
|
|
199
|
+
size: "xs",
|
|
200
|
+
variant: "outline",
|
|
201
|
+
disabled: true,
|
|
202
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoaderCircle, { className: "size-3 animate-spin" }), "Deleting"]
|
|
203
|
+
});
|
|
204
|
+
if (props.action === "confirm") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
205
|
+
className: "flex justify-end gap-1",
|
|
206
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, {
|
|
207
|
+
type: "button",
|
|
208
|
+
size: "xs",
|
|
209
|
+
variant: "destructive",
|
|
210
|
+
disabled: props.disabled,
|
|
211
|
+
onClick: props.onConfirmDelete,
|
|
212
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trash2, { className: "size-3" }), "Confirm delete"]
|
|
213
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
214
|
+
type: "button",
|
|
215
|
+
size: "icon-xs",
|
|
216
|
+
variant: "ghost",
|
|
217
|
+
"aria-label": `Cancel deleting ${props.sandboxId}`,
|
|
218
|
+
title: "Cancel",
|
|
219
|
+
disabled: props.disabled,
|
|
220
|
+
onClick: props.onCancelDelete,
|
|
221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "size-3" })
|
|
222
|
+
})]
|
|
223
|
+
});
|
|
224
|
+
if (props.action === "request") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
225
|
+
type: "button",
|
|
226
|
+
size: "icon-xs",
|
|
227
|
+
variant: "ghost",
|
|
228
|
+
"aria-label": `Delete stale managed sandbox ${props.sandboxId}`,
|
|
229
|
+
title: "Delete stale sandbox",
|
|
230
|
+
disabled: props.disabled,
|
|
231
|
+
onClick: props.onRequestDelete,
|
|
232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trash2, { className: "size-3" })
|
|
233
|
+
});
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
235
|
+
className: "text-xs text-muted-foreground",
|
|
236
|
+
children: props.cleanupQueued ? "Cleanup queued" : "—"
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function deleteSuccessFeedback(result) {
|
|
240
|
+
if (result.status === "cleanup_queued") return {
|
|
241
|
+
tone: "info",
|
|
242
|
+
sandboxId: result.sandboxId,
|
|
243
|
+
message: "Cleanup queued."
|
|
244
|
+
};
|
|
245
|
+
return {
|
|
246
|
+
tone: "info",
|
|
247
|
+
sandboxId: result.sandboxId,
|
|
248
|
+
message: "Deleted."
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function RunPlacementHistory(props) {
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
253
|
+
className: "grid gap-3",
|
|
254
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
|
|
255
|
+
className: "console-callout",
|
|
256
|
+
children: "Run placement history"
|
|
257
|
+
}) }), props.runs.isError ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
|
23
258
|
className: "text-sm text-destructive",
|
|
24
|
-
children: ["Cannot list runs: ", String(runs.error)]
|
|
25
|
-
}) : runs.isPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingLayout, {}) : loadedRuns.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
259
|
+
children: ["Cannot list runs: ", String(props.runs.error)]
|
|
260
|
+
}) : props.runs.isPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingLayout, {}) : props.loadedRuns.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyState, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
26
261
|
className: "grid min-w-0 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]",
|
|
27
262
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RunChooser, {
|
|
28
|
-
runs: loadedRuns,
|
|
29
|
-
selectedRunId: selectedRun?.runId,
|
|
30
|
-
hasMore: runs.hasNextPage,
|
|
31
|
-
loadingMore: runs.isFetchingNextPage,
|
|
32
|
-
onLoadMore: () => void runs.fetchNextPage(),
|
|
263
|
+
runs: props.loadedRuns,
|
|
264
|
+
selectedRunId: props.selectedRun?.runId,
|
|
265
|
+
hasMore: props.runs.hasNextPage,
|
|
266
|
+
loadingMore: props.runs.isFetchingNextPage,
|
|
267
|
+
onLoadMore: () => void props.runs.fetchNextPage(),
|
|
33
268
|
onSelect: props.onSelectRun
|
|
34
|
-
}), selectedRun ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectedRunSandboxes, {
|
|
35
|
-
run: selectedRun,
|
|
269
|
+
}), props.selectedRun ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectedRunSandboxes, {
|
|
270
|
+
run: props.selectedRun,
|
|
36
271
|
onOpenRun: props.onOpenRun,
|
|
37
272
|
onOpenTask: props.onOpenTask
|
|
38
273
|
}) : null]
|
|
@@ -5,8 +5,7 @@ import { u as require_react } from "../_libs/@floating-ui/react-dom+[...].mjs";
|
|
|
5
5
|
import { G as ChevronRight, K as ChevronLeft, Z as ArrowDown, g as Route, h as Save, p as SendHorizontal, r as X, v as Pencil, x as MessageSquarePlus } from "../_libs/lucide-react.mjs";
|
|
6
6
|
import { t as Markdown } from "../_libs/react-markdown+[...].mjs";
|
|
7
7
|
import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
|
|
8
|
-
import { _ as
|
|
9
|
-
import { t as Button } from "./button.mjs";
|
|
8
|
+
import { S as useTaskWorkpad, _ as useSendTaskMessage, b as useTaskPiSession, g as useSaveTaskWorkpad, k as ApiError, n as cn, p as useRunTasks, t as Button, x as useTaskPiSessionRaw, y as useTaskActivity } from "./button.mjs";
|
|
10
9
|
import { a as taskDisplayName, d as Skeleton, f as Badge, l as useClockTick, o as taskOrdinals, r as fmtTime, t as StateBadge } from "./bits.mjs";
|
|
11
10
|
//#region src/views/TranscriptView.tsx
|
|
12
11
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
@@ -2,7 +2,7 @@ import { o as __toESM } from "../_runtime.mjs";
|
|
|
2
2
|
import { c as require_jsx_runtime, i as Slot } from "../_libs/@radix-ui/react-arrow+[...].mjs";
|
|
3
3
|
import { u as require_react } from "../_libs/@floating-ui/react-dom+[...].mjs";
|
|
4
4
|
import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as cn } from "./button.mjs";
|
|
6
6
|
//#region src/components/ui/badge.tsx
|
|
7
7
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
8
|
var import_jsx_runtime = require_jsx_runtime();
|