@baochunli/flakes 0.0.2 → 0.0.4

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.
Files changed (55) hide show
  1. package/dist/commands/auth.d.ts.map +1 -1
  2. package/dist/commands/auth.js +133 -13
  3. package/dist/commands/auth.js.map +1 -1
  4. package/dist/commands/host.js +1 -0
  5. package/dist/commands/host.js.map +1 -1
  6. package/dist/commands/tasks.js +3 -0
  7. package/dist/commands/tasks.js.map +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +175 -22
  10. package/dist/index.js.map +1 -1
  11. package/dist/node_modules/@flakes/auth/package.json +1 -1
  12. package/dist/node_modules/@flakes/console/.output/nitro.json +1 -1
  13. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-DM-ZYPgQ.js +1 -0
  14. package/dist/node_modules/@flakes/console/.output/public/assets/{RunPage-BC3sGoPN.js → RunPage-i03UqHYF.js} +1 -1
  15. package/dist/node_modules/@flakes/console/.output/public/assets/{RunsPage-LkYGVvbL.js → RunsPage-u8qbeAoV.js} +1 -1
  16. package/dist/node_modules/@flakes/console/.output/public/assets/{SandboxesPage-CwWMogj6.js → SandboxesPage-D8D_5kXP.js} +1 -1
  17. package/dist/node_modules/@flakes/console/.output/public/assets/{TranscriptPage-CTMgJgHp.js → TranscriptPage-ChoFjiPI.js} +1 -1
  18. package/dist/node_modules/@flakes/console/.output/public/assets/{_-DRcA_CG9.js → _-C4ecJpHe.js} +1 -1
  19. package/dist/node_modules/@flakes/console/.output/public/assets/{_runId-CO1ozt9P.js → _runId-BZXYFY32.js} +2 -2
  20. package/dist/node_modules/@flakes/console/.output/public/assets/{_taskId-CcIypX6M.js → _taskId-C28oHEU_.js} +2 -2
  21. package/dist/node_modules/@flakes/console/.output/public/assets/{account-DKgjbb-C.js → account-B4wDEC7t.js} +1 -1
  22. package/dist/node_modules/@flakes/console/.output/public/assets/{account-forms-DrHA3zEd.js → account-forms-BLo66Mqa.js} +1 -1
  23. package/dist/node_modules/@flakes/console/.output/public/assets/{auth-layout-INHonQMf.js → auth-layout-DiUSgtaY.js} +1 -1
  24. package/dist/node_modules/@flakes/console/.output/public/assets/{device-DOGZUNMB.js → device-NrLWypMd.js} +1 -1
  25. package/dist/node_modules/@flakes/console/.output/public/assets/{documentation-Dr9Bdqxh.js → documentation-NRDmcDud.js} +1 -1
  26. package/dist/node_modules/@flakes/console/.output/public/assets/{forgot-password-C7qvwcpm.js → forgot-password--3Mujc8s.js} +1 -1
  27. package/dist/node_modules/@flakes/console/.output/public/assets/{main-RzjfJZwD.js → main-KBvz0mSQ.js} +21 -87
  28. package/dist/node_modules/@flakes/console/.output/public/assets/{otp-verification-Cqa6lopR.js → otp-verification-BSXwS5bo.js} +1 -1
  29. package/dist/node_modules/@flakes/console/.output/public/assets/{reset-password-tImCgEn0.js → reset-password-C7SbNx2J.js} +1 -1
  30. package/dist/node_modules/@flakes/console/.output/public/assets/{runs-Cuk0VOVi.js → runs-xD4ynllK.js} +2 -2
  31. package/dist/node_modules/@flakes/console/.output/public/assets/{sandboxes-BBIIbVN8.js → sandboxes-Cfr1Y2Dn.js} +2 -2
  32. package/dist/node_modules/@flakes/console/.output/public/assets/{security-D3N68cBT.js → security-CCThSJae.js} +1 -1
  33. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-DylILjyG.js → signin-CYeR3TaY.js} +1 -1
  34. package/dist/node_modules/@flakes/console/.output/public/assets/{signin-form-DWaa_uwj.js → signin-form-Bp22jPob.js} +1 -1
  35. package/dist/node_modules/@flakes/console/.output/public/assets/{signup-KmFQL_1g.js → signup-DHhPfohX.js} +1 -1
  36. package/dist/node_modules/@flakes/console/.output/server/{_-8ZDVkA1O.mjs → _-C-u135Pp.mjs} +3 -3
  37. package/dist/node_modules/@flakes/console/.output/server/{_-CjpSIsvB.mjs → _-DwPiGKLE.mjs} +3 -3
  38. package/dist/node_modules/@flakes/console/.output/server/_chunks/router.mjs +5 -5
  39. package/dist/node_modules/@flakes/console/.output/server/_ssr/{DocumentationPage-D85Budiq.mjs → DocumentationPage-CtBAQbzy.mjs} +4 -4
  40. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-Do_Mr_e4.mjs → documentation-Bf0VPrnt.mjs} +4 -4
  41. package/dist/node_modules/@flakes/console/.output/server/_ssr/{documentation-4BCES--X.mjs → documentation-PC93pMWl.mjs} +3 -3
  42. package/dist/node_modules/@flakes/console/.output/server/_ssr/{router-B3vKkNtv.mjs → router-elhBqT5k.mjs} +4 -4
  43. package/dist/node_modules/@flakes/console/.output/server/_ssr/ssr.mjs +2 -2
  44. package/dist/node_modules/@flakes/console/.output/server/{_tanstack-start-manifest_v-llXRWxjT.mjs → _tanstack-start-manifest_v-CR_hZXXv.mjs} +31 -31
  45. package/dist/node_modules/@flakes/console/package.json +1 -1
  46. package/dist/node_modules/@flakes/control-plane/package.json +1 -1
  47. package/dist/node_modules/@flakes/core/package.json +1 -1
  48. package/dist/node_modules/@flakes/harness-agent/package.json +1 -1
  49. package/dist/node_modules/@flakes/harness-sdk/package.json +1 -1
  50. package/dist/node_modules/@flakes/pi-agent/package.json +1 -1
  51. package/dist/node_modules/@flakes/protocol/package.json +1 -1
  52. package/dist/node_modules/@flakes/sandbox-runtime/package.json +1 -1
  53. package/dist/node_modules/@flakes/store/package.json +1 -1
  54. package/package.json +1 -1
  55. package/dist/node_modules/@flakes/console/.output/public/assets/DocumentationPage-DrqDulyL.js +0 -1
package/dist/index.js CHANGED
@@ -14,24 +14,113 @@ import { commandSandbox } from "./commands/sandbox.js";
14
14
  import { commandServer } from "./commands/server.js";
15
15
  import { commandTasks } from "./commands/tasks.js";
16
16
  import { CliError, toError, writeJson } from "./io.js";
17
- /** One-line usage per command; `flakes --help` prints the set, `flakes <cmd> --help` one entry. */
18
- const COMMAND_USAGE = {
19
- server: "flakes server --config <file> [--host H] [--port P] [--dry-run]",
20
- sandbox: "flakes sandbox --config <file> [--dry-run]",
21
- up: "flakes up --server-config S [--sandbox-config W...] [--host H] [--port P] [--session N] [--ready-timeout-ms N] [--dry-run] [--json]; use flakes host run --config <host.toml> for host agent MatchLock capacity",
22
- down: "flakes down [--session N] [--dry-run] [--json]",
23
- init: "flakes init --database-url URL [--dir DIR] [--root-dir DIR] [--port PORT] [--adapter pi|harness] [--force] [--json]",
24
- harness: "flakes harness init [--template paper|review-revise|fanout-fanin|autowrite|autoresearch] [--dir DIR] [--file FILE] [--force] [--json]; flakes harness check FILE [--defaults FILE] [--json]",
25
- config: "flakes config schema [server|sandbox]",
26
- auth: "flakes auth <login|status|logout>",
27
- host: "flakes host setup [--config PATH] [--credential-file PATH] [--state-dir PATH] [--host-name NAME] [--json]; flakes host rotate --config <host.toml> [--json]; flakes host run --config <host.toml>; flakes host status --config <host.toml> [--json]. Start with host setup before running a host agent.",
28
- runs: "flakes runs create --key KEY --name NAME [--token T]; flakes runs close RUN_KEY [--wait] [--timeout-ms N]",
29
- inspect: "flakes inspect <runId|runKey|taskId> [--task] [--token T]",
30
- logs: "flakes logs <taskId> [--after C] [--limit N] [--token T]",
31
- tasks: "flakes tasks save --run R --key K --title T --adapter A (--body-file F | --body T | --harness-file F) [--acceptance A...] [--depends-on K...] [--required-capability C...] [--tool-grant NAME...]; flakes tasks admit --run R (K... | --all); flakes tasks workpad <show|save|template> <taskId>; flakes tasks files <reserve|release|list|check>",
32
- metrics: "flakes metrics <runId> [--token T]",
33
- artifacts: "flakes artifacts <create|get|fetch>; fetch <id> [-o <file> | --raw] [--location-id L]",
17
+ const COMMAND_HELP = {
18
+ server: {
19
+ summary: "Start the control-plane HTTP server.",
20
+ usage: [
21
+ "flakes server (--config <file> | -c <file>) [--host H] [--port P] [--dry-run]",
22
+ ],
23
+ },
24
+ sandbox: {
25
+ summary: "Start a sandbox runtime from a sandbox config.",
26
+ usage: ["flakes sandbox (--config <file> | -c <file>) [--dry-run]"],
27
+ },
28
+ up: {
29
+ summary: "Start a local server plus configured sandbox runtimes.",
30
+ usage: [
31
+ "flakes up --server-config S --sandbox-config W...",
32
+ "flakes up --server-config S --sandbox-config W... [--host H] [--port P] [--session N] [--ready-timeout-ms N] [--dry-run] [--json]",
33
+ ],
34
+ notes: [
35
+ "For MatchLock capacity, run a host agent with `flakes host run --config <host.toml>`.",
36
+ ],
37
+ },
38
+ down: {
39
+ summary: "Stop a local runtime session started by `flakes up`.",
40
+ usage: ["flakes down [--session N] [--dry-run] [--json]"],
41
+ },
42
+ init: {
43
+ summary: "Create starter runtime config files and env snippets.",
44
+ usage: [
45
+ "flakes init --database-url URL [--dir DIR] [--root-dir DIR] [--port PORT] [--adapter pi|harness] [--force] [--json]",
46
+ ],
47
+ },
48
+ harness: {
49
+ summary: "Create or validate harness entrypoints.",
50
+ usage: [
51
+ "flakes harness init [--template paper|review-revise|fanout-fanin|autowrite|autoresearch] [--dir DIR] [--file FILE] [--force] [--json]",
52
+ "flakes harness check FILE [--defaults FILE] [--json]",
53
+ ],
54
+ },
55
+ config: {
56
+ summary: "Print runtime config schemas.",
57
+ usage: ["flakes config schema [server|sandbox]"],
58
+ },
59
+ auth: {
60
+ summary: "Manage CLI login credentials.",
61
+ usage: [
62
+ "flakes auth login [--no-open] [--timeout-ms N] [--json]",
63
+ "flakes auth status [--json]",
64
+ "flakes auth logout [--json]",
65
+ ],
66
+ },
67
+ host: {
68
+ summary: "Set up, rotate, run, and inspect host agents.",
69
+ usage: [
70
+ "flakes host setup [--config PATH] [--credential-file PATH] [--state-dir PATH] [--host-name NAME] [--no-open] [--timeout-ms N] [--json]",
71
+ "flakes host rotate --config <host.toml> [--json]",
72
+ "flakes host run --config <host.toml>",
73
+ "flakes host status --config <host.toml> [--json]",
74
+ ],
75
+ notes: ["Start with `flakes host setup` before running a host agent."],
76
+ },
77
+ runs: {
78
+ summary: "Create runs and close them when work is complete.",
79
+ usage: [
80
+ "flakes runs create --key KEY --name NAME [--token T | -t T]",
81
+ "flakes runs close RUN_KEY [--wait] [--timeout-ms N] [--token T | -t T]",
82
+ ],
83
+ },
84
+ inspect: {
85
+ summary: "Inspect a run, run key, or task.",
86
+ usage: ["flakes inspect <runId|runKey|taskId> [--task] [--token T | -t T]"],
87
+ },
88
+ logs: {
89
+ summary: "Read task logs from the control plane.",
90
+ usage: ["flakes logs <taskId> [--after C] [--limit N] [--token T | -t T]"],
91
+ },
92
+ tasks: {
93
+ summary: "Save tasks, admit queued work, and manage task workpads/files.",
94
+ usage: [
95
+ "flakes tasks save --run R --key K --title T --adapter A (--body-file F | --body T | --harness-file F) [--acceptance A...] [--depends-on K...] [--required-capability C...] [--tool-grant NAME...] [--token T | -t T]",
96
+ "flakes tasks admit --run R (K... | --all) [--token T | -t T]",
97
+ "flakes tasks workpad show <taskId> [--raw] [--token T | -t T]",
98
+ "flakes tasks workpad save <taskId> (--file F | -f F) --base-version N [--token T | -t T]",
99
+ "flakes tasks workpad template <taskId> [--output F | -o F]",
100
+ "flakes tasks workpad <pull|push>",
101
+ "flakes tasks files list [--json]",
102
+ "flakes tasks files reserve <path...> [--prefix] [--reason TEXT] [--json]",
103
+ "flakes tasks files release (<path...> [--prefix] | --all) [--json]",
104
+ "flakes tasks files check <path...> [--prefix] [--json]",
105
+ ],
106
+ },
107
+ metrics: {
108
+ summary: "Read run evaluation metrics.",
109
+ usage: ["flakes metrics <runId> [--token T | -t T]"],
110
+ },
111
+ artifacts: {
112
+ summary: "Create, inspect, or fetch artifacts.",
113
+ usage: [
114
+ "flakes artifacts create (--file F | -f F) [--token T | -t T]",
115
+ "flakes artifacts get <id> [--token T | -t T]",
116
+ "flakes artifacts fetch <id> [--location-id L] [--output F | -o F | --raw] [--token T | -t T]",
117
+ ],
118
+ },
34
119
  };
120
+ const COMMAND_USAGE = Object.fromEntries(Object.entries(COMMAND_HELP).map(([command, help]) => [
121
+ command,
122
+ help.usage.join("; "),
123
+ ]));
35
124
  /**
36
125
  * Runs a `flakes` command with injectable IO and transport dependencies.
37
126
  *
@@ -54,15 +143,26 @@ export async function runCli(argv = process.argv.slice(2), options = {}) {
54
143
  };
55
144
  try {
56
145
  const [command, ...rest] = argv;
57
- // Help is a first-class, JSON-emitting command so a short skill.md can
58
- // route an agent to `flakes --help` instead of carrying the flag reference.
146
+ // Default help is human-readable. Append --json when automation needs the
147
+ // compact command usage map.
59
148
  if (command === undefined || command === "--help" || command === "-h") {
60
- writeJson(context.stdout, { command: "help", commands: COMMAND_USAGE });
149
+ if (rest.includes("--json")) {
150
+ writeJson(context.stdout, { command: "help", commands: COMMAND_USAGE });
151
+ }
152
+ else {
153
+ context.stdout.write(renderTopLevelHelp());
154
+ }
61
155
  return 0;
62
156
  }
63
- if (COMMAND_USAGE[command] !== undefined &&
157
+ const help = commandHelpFor(command);
158
+ if (help !== undefined &&
64
159
  (rest.includes("--help") || rest.includes("-h"))) {
65
- writeJson(context.stdout, { command, usage: COMMAND_USAGE[command] });
160
+ if (rest.includes("--json")) {
161
+ writeJson(context.stdout, { command, usage: COMMAND_USAGE[command] });
162
+ }
163
+ else {
164
+ context.stdout.write(renderCommandHelp(command, help));
165
+ }
66
166
  return 0;
67
167
  }
68
168
  // Centralized dispatch keeps the programmatic API and bin entry point on
@@ -192,4 +292,57 @@ function openUrl(url) {
192
292
  });
193
293
  child.unref();
194
294
  }
295
+ function commandHelpFor(command) {
296
+ return Object.hasOwn(COMMAND_HELP, command)
297
+ ? COMMAND_HELP[command]
298
+ : undefined;
299
+ }
300
+ function renderTopLevelHelp() {
301
+ const maxNameLength = Math.max(...Object.keys(COMMAND_HELP).map((command) => command.length));
302
+ return [
303
+ "Flakes CLI",
304
+ "",
305
+ "Distributed runtime tooling for coordinating agents, runs, tasks, host agents, and artifacts.",
306
+ "",
307
+ "Usage:",
308
+ " flakes <command> [arguments] [options]",
309
+ " flakes <command> --help",
310
+ "",
311
+ "Common workflows:",
312
+ " flakes auth login",
313
+ " flakes init --database-url postgres://USER:PASSWORD@HOST/DB",
314
+ " flakes server --config ./flakes/server.toml",
315
+ " flakes host setup --config ./flakes/host.toml",
316
+ " flakes host run --config <host.toml>",
317
+ "",
318
+ "Commands:",
319
+ ...Object.entries(COMMAND_HELP).flatMap(([command, help]) => [
320
+ ` ${command.padEnd(maxNameLength)} ${help.summary}`,
321
+ ...help.usage.map((usage) => ` ${" ".repeat(maxNameLength)} ${usage}`),
322
+ ]),
323
+ "",
324
+ "Run `flakes <command> --help` for focused command help.",
325
+ "Use `--json` where shown for structured command output.",
326
+ "Use `flakes --help --json` for machine-readable help.",
327
+ "",
328
+ ].join("\n");
329
+ }
330
+ function renderCommandHelp(command, help) {
331
+ return [
332
+ `Flakes ${command}`,
333
+ "",
334
+ help.summary,
335
+ "",
336
+ "Usage:",
337
+ ...help.usage.map((usage) => ` ${usage}`),
338
+ ...renderOptionalSection("Notes:", help.notes),
339
+ "",
340
+ ].join("\n");
341
+ }
342
+ function renderOptionalSection(heading, lines) {
343
+ if (lines === undefined || lines.length === 0) {
344
+ return [];
345
+ }
346
+ return ["", heading, ...lines.map((line) => ` ${line}`)];
347
+ }
195
348
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW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EAAE;QACF,yDAAyD;QACzD,yDAAyD;QACzD,uDAAuD;QACvD,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAAiB;IAC3D,OAAO;QACL,UAAU,OAAO,EAAE;QACnB,EAAE;QACF,IAAI,CAAC,OAAO;QACZ,EAAE;QACF,QAAQ;QACR,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;QAC1C,GAAG,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC;QAC9C,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,qBAAqB,CAC5B,OAAe,EACf,KAAoC;IAEpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flakes/auth",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-07-03T06:31:11.410Z",
2
+ "date": "2026-07-03T07:25:59.537Z",
3
3
  "preset": "node-middleware",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -0,0 +1 @@
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./link-BsixJinJ.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{n as o,r as s,t as c}from"./lib-DtfURcG3.js";import{t as l}from"./external-link-BW8lpiMR.js";import{t as u}from"./file-text-DMdy8OfN.js";import{at as d,c as f,l as p,o as m,s as h}from"./main-KBvz0mSQ.js";var g=i(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),_=n(t(),1),v=e();function y(e){let t=p(e.selectedPath);return(0,v.jsxs)(`section`,{className:`grid gap-5`,children:[(0,v.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-4`,children:(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsx)(`p`,{className:`console-callout`,children:`Documentation`}),(0,v.jsx)(`h1`,{className:`mt-1 text-lg font-semibold tracking-tight`,children:`Flakes`}),(0,v.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-muted-foreground`,children:`Guides and reference for using Flakes, a harness runtime for distributed agent workflows.`})]})}),(0,v.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[18rem_minmax(0,1fr)]`,children:[(0,v.jsx)(b,{selectedPath:t?.path}),t?(0,v.jsxs)(`article`,{className:`min-w-0 rounded-lg border bg-card text-card-foreground shadow-sm`,children:[(0,v.jsxs)(`header`,{className:`border-b px-5 py-5 sm:px-6`,children:[(0,v.jsx)(`p`,{className:`console-callout`,children:`Guide`}),(0,v.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:t.title}),t.description.length>0?(0,v.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm text-muted-foreground`,children:t.description}):null]}),(0,v.jsx)(`div`,{className:`min-w-0 px-5 py-5 sm:px-6`,children:(0,v.jsx)(o,{remarkPlugins:[c],components:T,children:t.body})})]}):null]})]})}function b(e){let t=h.length===1?`1 page`:`${h.length} pages`;return(0,v.jsxs)(`nav`,{"aria-label":`Documentation pages`,className:`min-w-0 overflow-hidden rounded-lg border bg-card/80 text-card-foreground shadow-sm lg:sticky lg:top-6 lg:self-start`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b bg-muted/30 px-3 py-2.5`,children:[(0,v.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,v.jsx)(d,{className:`size-4 text-muted-foreground`})}),(0,v.jsxs)(`span`,{className:`min-w-0`,children:[(0,v.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:`Contents`}),(0,v.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground`,children:t})]})]}),(0,v.jsx)(`div`,{className:`grid max-h-72 gap-0.5 overflow-y-auto p-2 lg:max-h-[calc(100vh-12rem)]`,children:(0,v.jsx)(x,{items:m,selectedPath:e.selectedPath})})]})}function x(e){let t=e.depth??0;return(0,v.jsx)(v.Fragment,{children:e.items.map(n=>n.type===`page`?(0,v.jsx)(w,{page:n.page,selected:n.page.path===e.selectedPath,depth:t},n.page.path||`overview`):(0,v.jsx)(S,{item:n,selectedPath:e.selectedPath,depth:t},n.key))})}function S(e){let t=C(e.item,e.selectedPath),[n,r]=(0,_.useState)(t);return(0,_.useEffect)(()=>{t&&r(!0)},[t]),(0,v.jsxs)(`div`,{className:`grid gap-1`,children:[(0,v.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:a(`group flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-sm text-muted-foreground transition-state hover:bg-secondary/70 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,t&&`text-foreground`),children:[(0,v.jsx)(g,{className:`size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-foreground`,"aria-hidden":`true`}),(0,v.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.item.title}),(0,v.jsx)(s,{className:a(`size-3.5 shrink-0 text-muted-foreground transition-transform group-hover:text-foreground`,n&&`rotate-90`),"aria-hidden":`true`})]}),n?(0,v.jsx)(`div`,{className:a(`ml-3 grid gap-0.5 border-l border-border/80 pl-3`,e.depth>0&&`ml-5`),children:(0,v.jsx)(x,{items:e.item.children,selectedPath:e.selectedPath,depth:e.depth+1})}):null]})}function C(e,t){return t===void 0?!1:e.type===`page`?e.page.path===t:e.children.some(e=>C(e,t))}function w(e){let t=a(`relative flex h-8 min-w-0 items-center gap-2 rounded-md px-2 text-left text-sm transition-state focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:outline-none`,e.selected?`bg-secondary text-foreground before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-primary`:`text-muted-foreground hover:bg-secondary/70 hover:text-foreground`),n=(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(u,{className:a(`size-4 shrink-0 text-muted-foreground transition-colors`,e.selected&&`text-primary`),"aria-hidden":`true`}),(0,v.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.page.title})]});return e.page.path===``?(0,v.jsx)(r,{to:`/documentation`,"aria-current":e.selected?`page`:void 0,className:t,children:n}):(0,v.jsx)(r,{to:`/documentation/$`,params:{_splat:e.page.path},"aria-current":e.selected?`page`:void 0,className:t,children:n})}var T={h1({children:e}){return(0,v.jsx)(`h2`,{className:`mt-8 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0`,children:e})},h2({children:e}){return(0,v.jsx)(`h2`,{className:`mt-8 scroll-m-20 border-t pt-6 text-lg font-semibold tracking-tight first:mt-0 first:border-t-0 first:pt-0`,children:e})},h3({children:e}){return(0,v.jsx)(`h3`,{className:`mt-6 scroll-m-20 text-base font-semibold tracking-tight`,children:e})},p({children:e}){return(0,v.jsx)(`p`,{className:`mt-4 text-sm leading-7 text-foreground`,children:e})},a({href:e,children:t}){let n=f(e);return n===void 0?(0,v.jsxs)(`a`,{href:e,target:e?.startsWith(`http`)?`_blank`:void 0,rel:e?.startsWith(`http`)?`noreferrer`:void 0,className:`inline-flex items-center gap-1 font-medium text-primary underline-offset-4 hover:underline`,children:[t,e?.startsWith(`http`)?(0,v.jsx)(l,{className:`size-3`,"aria-hidden":`true`}):null]}):n===``?(0,v.jsx)(r,{to:`/documentation`,className:`font-medium text-primary underline-offset-4 hover:underline`,children:t}):(0,v.jsx)(r,{to:`/documentation/$`,params:{_splat:n},className:`font-medium text-primary underline-offset-4 hover:underline`,children:t})},ul({children:e}){return(0,v.jsx)(`ul`,{className:`mt-4 grid gap-2 pl-5 text-sm`,children:e})},ol({children:e}){return(0,v.jsx)(`ol`,{className:`mt-4 grid list-decimal gap-3 pl-5 text-sm`,children:e})},li({children:e}){return(0,v.jsx)(`li`,{className:`pl-1 leading-7 marker:text-muted-foreground`,children:e})},code({children:e,className:t}){return t===void 0?(0,v.jsx)(`code`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[0.85em] text-foreground`,children:e}):(0,v.jsx)(`code`,{className:a(`font-mono text-xs leading-6`,t),children:e})},pre({children:e}){return(0,v.jsx)(`pre`,{className:`mt-4 max-w-full overflow-x-auto rounded-lg border bg-muted/40 p-3 text-xs text-foreground`,children:e})},blockquote({children:e}){return(0,v.jsx)(`blockquote`,{className:`mt-4 border-l-2 pl-4 text-sm text-muted-foreground`,children:e})},table({children:e}){return(0,v.jsx)(`div`,{className:`mt-4 max-w-full overflow-x-auto rounded-lg border`,children:(0,v.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})},thead({children:e}){return(0,v.jsx)(`thead`,{className:`bg-muted/50`,children:e})},th({children:e}){return(0,v.jsx)(`th`,{className:`border-b px-3 py-2 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,children:e})},td({children:e}){return(0,v.jsx)(`td`,{className:`border-b px-3 py-2 align-top`,children:e})},hr(){return(0,v.jsx)(`hr`,{className:`my-8 border-border`})}};export{y as t};
@@ -1,3 +1,3 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./react-dom-DrIU40PY.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./file-text-DMdy8OfN.js";import{t as s}from"./lock-D4OhqEPW.js";import{t as c}from"./x-fKvnmCoQ.js";import{a as l}from"./dist-BtPw3IIV.js";import{A as u,F as d,G as f,H as p,I as m,K as ee,L as h,M as g,N as _,P as v,R as y,U as te,V as ne,W as re,ct as ie,it as ae,j as b,k as x,nt as oe,tt as se,z as S}from"./main-RzjfJZwD.js";import{n as C,t as w}from"./card-DSG3_teC.js";import{a as T,c as ce,d as E,f as D,i as le,l as ue,n as de,o as fe,r as O,t as pe,u as me}from"./bits-Cv0Te4iz.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-DptQuuuq.js";import{t as he}from"./SandboxesLens-BUQQWmH6.js";var ge=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_e=i(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ve=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ye=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),be=i(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),xe=i(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=n(t(),1),I=e(),L=`Tabs`,[Se,Ce]=y(L,[g]),we=g(),[Te,R]=Se(L),Ee=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=_(s),[d,f]=m({prop:r,onChange:i,defaultProp:a??``,caller:L});return(0,I.jsx)(Te,{scope:n,baseId:v(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(S.div,{dir:u,"data-orientation":o,...l,ref:t})})});Ee.displayName=L;var De=`TabsList`,Oe=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=R(De,n),o=we(n);return(0,I.jsx)(b,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(S.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Oe.displayName=De;var ke=`TabsTrigger`,Ae=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=R(ke,n),s=we(n),c=Ne(o.baseId,r),l=Pe(o.baseId,r),d=r===o.value;return(0,I.jsx)(u,{asChild:!0,...s,focusable:!i,active:d,children:(0,I.jsx)(S.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:h(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:h(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:h(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ae.displayName=ke;var je=`TabsContent`,Me=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=R(je,n),c=Ne(s.baseId,r),l=Pe(s.baseId,r),u=r===s.value,f=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(d,{present:i||u,children:({present:n})=>(0,I.jsx)(S.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})});Me.displayName=je;function Ne(e,t){return`${e}-trigger-${t}`}function Pe(e,t){return`${e}-content-${t}`}var Fe=Ee,Ie=Oe,Le=Ae,Re=Me;function ze({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Fe,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:a(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Be=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t=`default`,...n}){return(0,I.jsx)(Ie,{"data-slot":`tabs-list`,"data-variant":t,className:a(Be({variant:t}),e),...n})}function z({className:e,...t}){return(0,I.jsx)(Le,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`tabs-content`,className:a(`flex-1 outline-none`,e),...t})}var He=n(r(),1),V=192,H=60,U=248,W=76,Ue=2,We=18,Ge=16,Ke=1e4,G=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),qe=new Set([`CREATED`,`QUEUED`,`BLOCKED`]);function K(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function Je(e){if(e.length===0)return{positions:new Map,width:0,height:0};let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a!==void 0)return a;if(r.has(e))return 0;r.add(e);let o=t.get(e)?.deps.filter(e=>t.has(e))??[],s=o.length===0?0:1+Math.max(...o.map(e=>i(e)));return r.delete(e),n.set(e,s),s},a=[];for(let t of e){let e=i(t.id);for(;a.length<=e;)a.push([]);a[e]?.push(t.id)}let o=new Map;for(let e of a){let n=e=>{let n=(t.get(e)?.deps??[]).map(e=>o.get(e)).filter(e=>e!==void 0).sort((e,t)=>e-t);return n[Math.floor((n.length-1)/2)]??2**53-1};e.sort((e,t)=>n(e)-n(t)||e.localeCompare(t)),e.forEach((e,t)=>{o.set(e,t)})}let s=Math.max(1,...a.map(e=>e.length)),c=new Map;return a.forEach((e,t)=>{let n=(s-e.length)*W/2;e.forEach((e,r)=>{c.set(e,{x:t*U,y:r*W+n})})}),{positions:c,width:(a.length-1)*U+V,height:(s-1)*W+H}}function Ye(e,t){return Xe(e,t)>=2&&Math.abs(t.y-e.y)<W*.5}function Xe(e,t){return Math.max(1,Math.round((t.x-e.x)/U))}function Ze(e,t,n){let r=e.x+V,i=e.y+H/2,a=t.x,o=t.y+H/2;if(n!==null){let s=Math.min(e.y,t.y)-n,c=Math.min(40,(a-r)/2-8),l=r+c,u=a-c,d=c*.6;return`M ${r} ${i} C ${r+d} ${i}, ${l-d} ${s}, ${l} ${s} L ${u} ${s} C ${u+d} ${s}, ${a-d} ${o}, ${a} ${o}`}let s=Math.max(16,Math.min(90,(a-r)*.45));return`M ${r} ${i} C ${r+s} ${i}, ${a-s} ${o}, ${a} ${o}`}function Qe(e){let t=e===``?[]:e.split(`
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{t as r}from"./react-dom-DrIU40PY.js";import{r as i,t as a}from"./utils-CEE0-YEp.js";import{t as o}from"./file-text-DMdy8OfN.js";import{t as s}from"./lock-D4OhqEPW.js";import{t as c}from"./x-fKvnmCoQ.js";import{a as l}from"./dist-BtPw3IIV.js";import{A as u,F as d,G as f,H as p,I as m,K as ee,L as h,M as g,N as _,P as v,R as y,U as te,V as ne,W as re,ct as ie,it as ae,j as b,k as x,nt as oe,tt as se,z as S}from"./main-KBvz0mSQ.js";import{n as C,t as w}from"./card-DSG3_teC.js";import{a as T,c as ce,d as E,f as D,i as le,l as ue,n as de,o as fe,r as O,t as pe,u as me}from"./bits-Cv0Te4iz.js";import{a as k,i as A,n as j,o as M,r as N,t as P}from"./table-DptQuuuq.js";import{t as he}from"./SandboxesLens-BUQQWmH6.js";var ge=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_e=i(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ve=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),ye=i(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),be=i(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),xe=i(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=n(t(),1),I=e(),L=`Tabs`,[Se,Ce]=y(L,[g]),we=g(),[Te,R]=Se(L),Ee=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=_(s),[d,f]=m({prop:r,onChange:i,defaultProp:a??``,caller:L});return(0,I.jsx)(Te,{scope:n,baseId:v(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(S.div,{dir:u,"data-orientation":o,...l,ref:t})})});Ee.displayName=L;var De=`TabsList`,Oe=F.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=R(De,n),o=we(n);return(0,I.jsx)(b,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(S.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Oe.displayName=De;var ke=`TabsTrigger`,Ae=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=R(ke,n),s=we(n),c=Ne(o.baseId,r),l=Pe(o.baseId,r),d=r===o.value;return(0,I.jsx)(u,{asChild:!0,...s,focusable:!i,active:d,children:(0,I.jsx)(S.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:h(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:h(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:h(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ae.displayName=ke;var je=`TabsContent`,Me=F.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=R(je,n),c=Ne(s.baseId,r),l=Pe(s.baseId,r),u=r===s.value,f=F.useRef(u);return F.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(d,{present:i||u,children:({present:n})=>(0,I.jsx)(S.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})});Me.displayName=je;function Ne(e,t){return`${e}-trigger-${t}`}function Pe(e,t){return`${e}-content-${t}`}var Fe=Ee,Ie=Oe,Le=Ae,Re=Me;function ze({className:e,orientation:t=`horizontal`,...n}){return(0,I.jsx)(Fe,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:a(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Be=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t=`default`,...n}){return(0,I.jsx)(Ie,{"data-slot":`tabs-list`,"data-variant":t,className:a(Be({variant:t}),e),...n})}function z({className:e,...t}){return(0,I.jsx)(Le,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`tabs-content`,className:a(`flex-1 outline-none`,e),...t})}var He=n(r(),1),V=192,H=60,U=248,W=76,Ue=2,We=18,Ge=16,Ke=1e4,G=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),qe=new Set([`CREATED`,`QUEUED`,`BLOCKED`]);function K(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h${String(n%60).padStart(2,`0`)}m`}function Je(e){if(e.length===0)return{positions:new Map,width:0,height:0};let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a!==void 0)return a;if(r.has(e))return 0;r.add(e);let o=t.get(e)?.deps.filter(e=>t.has(e))??[],s=o.length===0?0:1+Math.max(...o.map(e=>i(e)));return r.delete(e),n.set(e,s),s},a=[];for(let t of e){let e=i(t.id);for(;a.length<=e;)a.push([]);a[e]?.push(t.id)}let o=new Map;for(let e of a){let n=e=>{let n=(t.get(e)?.deps??[]).map(e=>o.get(e)).filter(e=>e!==void 0).sort((e,t)=>e-t);return n[Math.floor((n.length-1)/2)]??2**53-1};e.sort((e,t)=>n(e)-n(t)||e.localeCompare(t)),e.forEach((e,t)=>{o.set(e,t)})}let s=Math.max(1,...a.map(e=>e.length)),c=new Map;return a.forEach((e,t)=>{let n=(s-e.length)*W/2;e.forEach((e,r)=>{c.set(e,{x:t*U,y:r*W+n})})}),{positions:c,width:(a.length-1)*U+V,height:(s-1)*W+H}}function Ye(e,t){return Xe(e,t)>=2&&Math.abs(t.y-e.y)<W*.5}function Xe(e,t){return Math.max(1,Math.round((t.x-e.x)/U))}function Ze(e,t,n){let r=e.x+V,i=e.y+H/2,a=t.x,o=t.y+H/2;if(n!==null){let s=Math.min(e.y,t.y)-n,c=Math.min(40,(a-r)/2-8),l=r+c,u=a-c,d=c*.6;return`M ${r} ${i} C ${r+d} ${i}, ${l-d} ${s}, ${l} ${s} L ${u} ${s} C ${u+d} ${s}, ${a-d} ${o}, ${a} ${o}`}let s=Math.max(16,Math.min(90,(a-r)*.45));return`M ${r} ${i} C ${r+s} ${i}, ${a-s} ${o}, ${a} ${o}`}function Qe(e){let t=e===``?[]:e.split(`
2
2
  `).map(e=>{let[t=``,n=``]=e.split(`>`);return{id:t,deps:n===``?[]:n.split(`,`)}}),n=Je(t),r=new Map,i=new Map,a=[];for(let e of t){let t=e.deps.filter(e=>n.positions.has(e)),o=[];for(let r of t){let t=n.positions.get(r),s=n.positions.get(e.id);if(t===void 0||s===void 0||Xe(t,s)>Ue)continue;o.push(r);let c=i.get(r);c===void 0?i.set(r,[e.id]):c.push(e.id),a.push({source:r,target:e.id,from:t,to:s})}r.set(e.id,o)}let o=new Map,s=[],c=a.map((e,t)=>({edge:e,index:t})).filter(e=>Ye(e.edge.from,e.edge.to)).sort((e,t)=>e.edge.from.x-t.edge.from.x||e.edge.to.x-t.edge.to.x);for(let{edge:e,index:t}of c){let n=e.from.x+V,r=s.findIndex(e=>e<=n);r===-1&&(r=s.length),s[r]=e.to.x,o.set(t,We+r*Ge)}let l=0;for(let{edge:e,index:t}of c){let n=o.get(t)??0;l=Math.max(l,n-Math.min(e.from.y,e.to.y))}l=l>0?Math.ceil(l)+6:0;let u=l===0?n.positions:new Map(Array.from(n.positions,([e,t])=>[e,{x:t.x,y:t.y+l}]));return{layout:{...n,positions:u,height:n.height+l},edges:a.map((e,t)=>({key:`${e.source}->${e.target}`,source:e.source,target:e.target,d:Ze({x:e.from.x,y:e.from.y+l},{x:e.to.x,y:e.to.y+l},o.get(t)??null)})),parents:r,children:i}}function q(e,t){let n=new Set,r=[...t.get(e)??[]];for(;r.length>0;){let e=r.pop();if(!(e===void 0||n.has(e))){n.add(e);for(let i of t.get(e)??[])n.has(i)||r.push(i)}}return n}function $e(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(new Map),[s,c]=(0,F.useState)(new Map),l=(0,F.useRef)(null),u=e.tasks.map(e=>`${e.taskId}>${e.dependsOn.join(`,`)}`).join(`
3
3
  `),d=(0,F.useMemo)(()=>Qe(u),[u]);(0,F.useEffect)(()=>{let t=l.current;if(l.current=new Map(e.tasks.map(e=>[e.taskId,e.status])),t===null)return;let n=[],r=[];for(let i of e.tasks){let e=t.get(i.taskId);e===void 0||e===i.status||(i.status===`SUCCEEDED`&&n.push(i.taskId),G.has(i.status)&&r.push(i.taskId))}if(r.length>0){let e=Date.now();c(t=>{let n=new Map(t);for(let t of r)n.set(t,e);return n})}if(n.length>0){let e=Date.now();o(t=>{let r=new Map(t);for(let t of n)r.set(t,e);return r}),setTimeout(()=>{o(t=>{let r=new Map(t);for(let t of n)r.get(t)===e&&r.delete(t);return r})},800)}},[e.tasks]);let f=(0,F.useMemo)(()=>{let t=new Set;for(let n of e.tasks)if(n.status===`FAILED`)for(let e of q(n.taskId,d.children))t.add(e);return t},[e.tasks,d]),p=e.selectedTaskId??t,m=(0,F.useMemo)(()=>{if(p===null||!d.layout.positions.has(p))return null;let e=new Set([p]);for(let t of q(p,d.parents))e.add(t);for(let t of q(p,d.children))e.add(t);return e},[p,d]);if(e.pending)return(0,I.jsx)(ut,{});if(e.tasks.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No tasks in this run.`});let ee=new Map(e.tasks.map(e=>[e.taskId,e.status])),h=Date.now(),g=(0,I.jsx)(et,{graph:d,tasks:e.tasks,ordinals:e.ordinals,now:h,statusById:ee,ignitions:a,terminalFlashes:s,blastSet:f,focusSet:m,selectedTaskId:e.selectedTaskId,onSelect:e.onSelect,onHover:n});return(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`sr-only`,children:`Task dependency map. The manifest table below lists the same tasks.`}),(0,I.jsx)(nt,{width:d.layout.width,height:d.layout.height,onExpand:()=>i(!0),collapsed:r,children:g}),r?(0,I.jsx)(rt,{width:d.layout.width,height:d.layout.height,onClose:()=>i(!1),children:g}):null]})}function et(e){let{graph:t,statusById:n,focusSet:r,blastSet:i}=e,a=e=>{let t=n.get(e);if(t===void 0)throw Error(`DAG edge references missing task ${e}`);return t};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 overflow-visible`,width:t.layout.width,height:t.layout.height,children:t.edges.map(t=>(0,I.jsx)(at,{edge:t,sourceStatus:a(t.source),targetStatus:a(t.target),igniteNonce:e.ignitions.get(t.source),blast:n.get(t.source)===`FAILED`||i.has(t.source),dimmed:r!==null&&!(r.has(t.source)&&r.has(t.target))},t.key))}),e.tasks.map((n,a)=>{let o=t.layout.positions.get(n.taskId);return o===void 0?null:(0,I.jsx)(ct,{task:n,ordinal:e.ordinals.get(n.taskId)??a+1,x:o.x,y:o.y,now:e.now,flashNonce:e.terminalFlashes.get(n.taskId),dimmed:r!==null&&!r.has(n.taskId),blast:i.has(n.taskId),selected:e.selectedTaskId===n.taskId,onSelect:e.onSelect,onHover:e.onHover},n.taskId)})]})}var J={backgroundImage:`radial-gradient(var(--border) 1px, transparent 1px)`,backgroundSize:`24px 24px`};function tt(e,t,n){return Math.min(n,Math.max(t,e))}function nt(e){return e.collapsed?(0,I.jsxs)(`div`,{className:`flex min-h-[420px] w-full min-w-0 flex-col items-center justify-center gap-2 rounded-lg border bg-card/40 text-sm text-muted-foreground`,style:J,children:[(0,I.jsx)(ve,{className:`size-5`,"aria-hidden":!0}),(0,I.jsx)(`span`,{children:`Dependency map open in fullscreen — press Esc to return`})]}):(0,I.jsxs)(`div`,{className:`relative h-[min(56vh,34rem)] min-h-[420px] w-full min-w-0 rounded-lg border bg-card/40`,children:[e.onExpand?(0,I.jsx)(`button`,{type:`button`,"aria-label":`Open dependency map in fullscreen`,onClick:e.onExpand,className:`absolute top-3 right-3 z-10 flex size-8 items-center justify-center rounded-md border bg-card/80 text-muted-foreground backdrop-blur transition-state hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,I.jsx)(ve,{className:`size-4`,"aria-hidden":!0})}):null,(0,I.jsx)(`div`,{className:`flex size-full min-w-0 overflow-auto overscroll-contain rounded-lg p-6`,style:J,children:(0,I.jsx)(`div`,{className:`relative m-auto shrink-0`,style:{width:e.width,height:e.height},children:e.children})})]})}function rt(e){let{onClose:t}=e;return(0,F.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};window.addEventListener(`keydown`,e);let n=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),document.body.style.overflow=n}},[t]),(0,He.createPortal)((0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background/95 backdrop-blur-sm`,children:(0,I.jsx)(it,{width:e.width,height:e.height,onClose:t,children:e.children})}),document.body)}function it(e){let t=(0,F.useRef)(null),[n,r]=(0,F.useState)({scale:1,x:0,y:0}),i=(0,F.useRef)(null),a=(0,F.useCallback)(()=>{let n=t.current;if(!n)return;let i=tt(Math.min((n.clientWidth-80)/e.width,(n.clientHeight-80)/e.height),.1,1.6);r({scale:i,x:(n.clientWidth-e.width*i)/2,y:(n.clientHeight-e.height*i)/2})},[e.width,e.height]);(0,F.useEffect)(()=>{a()},[a]);let o=(e,t,n)=>{r(r=>{let i=tt(r.scale*e,.1,4),a=i/r.scale;return{scale:i,x:t-(t-r.x)*a,y:n-(n-r.y)*a}})},s=e=>{let n=t.current;if(!n)return;let r=n.getBoundingClientRect();o(Math.exp(-e.deltaY*.0015),e.clientX-r.left,e.clientY-r.top)},l=e=>{let n=t.current;n&&o(e,n.clientWidth/2,n.clientHeight/2)},u=e=>{e.button===0&&(e.target instanceof Element&&e.target.closest(`button`)!==null||(i.current={px:e.clientX,py:e.clientY,ox:n.x,oy:n.y},e.currentTarget.setPointerCapture(e.pointerId)))},d=e=>{let t=i.current;t&&r(n=>({...n,x:t.ox+(e.clientX-t.px),y:t.oy+(e.clientY-t.py)}))},f=()=>{i.current=null};return(0,I.jsxs)(`div`,{ref:t,className:`absolute inset-0 cursor-grab touch-none overflow-hidden active:cursor-grabbing`,style:J,onWheel:s,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerLeave:f,children:[(0,I.jsx)(`div`,{style:{transform:`translate(${n.x}px, ${n.y}px) scale(${n.scale})`,transformOrigin:`0 0`},children:(0,I.jsx)(`div`,{className:`relative`,style:{width:e.width,height:e.height},children:e.children})}),(0,I.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1.5`,onPointerDown:e=>e.stopPropagation(),children:[(0,I.jsx)(Y,{label:`Zoom out`,onClick:()=>l(1/1.2),children:(0,I.jsx)(xe,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsxs)(`span`,{className:`w-11 text-center font-mono text-xs text-muted-foreground`,"data-num":!0,children:[Math.round(n.scale*100),`%`]}),(0,I.jsx)(Y,{label:`Zoom in`,onClick:()=>l(1.2),children:(0,I.jsx)(be,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsx)(Y,{label:`Fit to screen`,onClick:a,children:(0,I.jsx)(ye,{className:`size-4`,"aria-hidden":!0})}),(0,I.jsx)(Y,{label:`Close fullscreen`,onClick:e.onClose,children:(0,I.jsx)(c,{className:`size-4`,"aria-hidden":!0})})]}),(0,I.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 left-4 font-mono text-[11px] text-muted-foreground/70`,children:`scroll to zoom · drag to pan · esc to close`})]})}function Y(e){return(0,I.jsx)(`button`,{type:`button`,"aria-label":e.label,onClick:e.onClick,className:`flex size-8 items-center justify-center rounded-md border bg-card text-muted-foreground transition-state hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:e.children})}function at(e){let t=e.dimmed?.35:void 0,n={d:e.edge.d,fill:`none`};return e.blast?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-failed transition-state`,style:{opacity:t??.4}}):e.targetStatus===`RUNNING`?(0,I.jsx)(`path`,{...n,strokeWidth:2,className:`edge-flow stroke-status-running transition-state`,style:{...le(e.edge.key,1200),opacity:t??1}}):e.igniteNonce===void 0?e.sourceStatus===`SUCCEEDED`&&G.has(e.targetStatus)?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-succeeded transition-state`,style:{opacity:t??.5}}):G.has(e.sourceStatus)&&qe.has(e.targetStatus)?(0,I.jsx)(`path`,{...n,strokeWidth:1.5,className:`stroke-status-idle transition-state`,style:{opacity:t??1}}):(0,I.jsx)(`path`,{...n,strokeWidth:1.5,strokeDasharray:`4 6`,className:`stroke-border transition-state`,style:{opacity:t??.4}}):(0,F.createElement)(`path`,{...n,key:`${e.edge.key}:${e.igniteNonce}`,strokeWidth:2,pathLength:1,className:`edge-ignite stroke-status-succeeded`,style:{opacity:t??1}})}var ot={RUNNING:`border-status-running bg-status-running/5`,SUCCEEDED:`border-l-status-succeeded`,FAILED:`border-status-failed`,CANCELLED:`border-status-warn`,QUEUED:`border-dashed border-status-idle/60 bg-transparent text-muted-foreground`,CREATED:`border-dashed border-status-idle/60 bg-transparent text-muted-foreground`,BLOCKED:`border-dashed border-status-blocked/60 bg-transparent text-muted-foreground`},st={SUCCEEDED:`var(--status-succeeded)`,FAILED:`var(--status-failed)`,CANCELLED:`var(--status-warn)`};function ct(e){let t=e.task,n=t.status.toUpperCase(),r=n===`RUNNING`,i=T(t),o=t.assignmentHeartbeatAt,s=r&&o!==void 0&&e.now-Date.parse(o)>Ke,c=e.dimmed?.35:e.blast?.4:n===`CANCELLED`?.7:1,l=t.assignedSandboxId??t.lastSandboxId,u=l??t.agentId,d=`text-muted-foreground`;n===`FAILED`?(u=t.error?.code??`FAILED`,d=`text-status-failed`):r&&t.startedAt!==void 0?u=`${l??t.agentId} · ${K(e.now-Date.parse(t.startedAt))}`:n===`SUCCEEDED`&&t.startedAt!==void 0&&t.completedAt!==void 0&&(u=`${l??t.agentId} · ${K(Date.parse(t.completedAt)-Date.parse(t.startedAt))}`);let f={left:e.x,top:e.y,width:V,height:H,opacity:c,...r?le(t.taskId):void 0,...s?{"--glow-level":.3}:void 0};return(0,I.jsxs)(`button`,{type:`button`,className:a(`absolute rounded-md border border-l-2 bg-card px-2.5 py-1.5 text-left transition-state`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,ot[n]??`border-status-idle/60 text-muted-foreground`,r&&`glow`,r&&!s&&`pulse-running`,e.selected&&`ring-1 ring-ring`),style:f,onClick:()=>e.onSelect(t.taskId),onMouseEnter:()=>e.onHover(t.taskId),onMouseLeave:()=>e.onHover(null),onFocus:()=>e.onHover(t.taskId),onBlur:()=>e.onHover(null),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(lt,{status:n}),(0,I.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[`#`,e.ordinal]}),(0,I.jsx)(`span`,{className:a(`min-w-0 flex-1 truncate`,i===void 0?`font-mono text-[11px]`:`text-xs font-medium`),children:i??t.taskId}),(t.currentAttemptNumber??1)>1?(0,I.jsxs)(`span`,{className:`shrink-0 rounded-sm border border-status-warn/50 px-1 font-mono text-[9px] leading-4 text-status-warn`,"data-num":!0,children:[`A`,t.currentAttemptNumber,t.maxAttempts===void 0?``:`/${t.maxAttempts}`]}):null]}),(0,I.jsx)(`span`,{className:a(`mt-1 block truncate font-mono text-[10px]`,d),"data-num":!0,children:u}),r?(0,I.jsx)(`span`,{"aria-hidden":!0,className:a(`absolute top-1.5 right-1.5 size-1 rounded-full`,s?`bg-status-warn`:`bg-status-running`),children:!s&&o!==void 0?(0,I.jsx)(`span`,{className:`blip absolute inset-0 rounded-full border border-status-running`},o):null}):null,e.flashNonce===void 0?null:(0,I.jsx)(`span`,{"aria-hidden":!0,className:`glow flash-terminal pointer-events-none absolute inset-0 rounded-md`,style:{"--glow-color":st[n]??`var(--status-idle)`}},e.flashNonce)]})}function lt(e){switch(e.status){case`RUNNING`:return(0,I.jsx)(ae,{className:`size-3.5 shrink-0 animate-spin text-status-running`});case`SUCCEEDED`:return(0,I.jsx)(`svg`,{viewBox:`0 0 16 16`,className:`size-3.5 shrink-0`,fill:`none`,"aria-hidden":`true`,children:(0,I.jsx)(`path`,{d:`M3 8.5 6.5 12 13 4.5`,pathLength:1,className:`stroke-draw stroke-status-succeeded`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})});case`FAILED`:return(0,I.jsx)(c,{className:`size-3.5 shrink-0 text-status-failed`});case`CANCELLED`:return(0,I.jsx)(c,{className:`size-3.5 shrink-0 text-status-warn`});case`BLOCKED`:return(0,I.jsx)(s,{className:`size-3.5 shrink-0 text-status-blocked`});default:return(0,I.jsx)(ge,{className:`size-3.5 shrink-0 text-status-idle`})}}var X=[{x:0,y:W},{x:U,y:0},{x:U,y:W*2}];function ut(){return(0,I.jsxs)(nt,{width:440,height:212,children:[(0,I.jsx)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 overflow-visible`,width:440,height:212,children:[X[1],X[2]].map(e=>e!==void 0&&X[0]!==void 0?(0,I.jsx)(`path`,{d:Ze(X[0],e,null),fill:`none`,strokeWidth:1.5,strokeDasharray:`4 6`,className:`stroke-border`,opacity:.6},e.y):null)}),X.map(e=>(0,I.jsxs)(`div`,{className:`absolute rounded-md border border-dashed`,style:{left:e.x,top:e.y,width:V,height:H},children:[(0,I.jsx)(`div`,{className:`mx-2.5 mt-3.5 h-2 w-24 rounded-sm bg-muted`}),(0,I.jsx)(`div`,{className:`mx-2.5 mt-2 h-2 w-16 rounded-sm bg-muted/60`})]},`${e.x}:${e.y}`))]})}function dt(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Z(e){return e===void 0?`—`:e<1e3?`${Math.round(e)}ms`:K(e)}function ft(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load metrics: `,e.error]});let t=e.metrics;if(t===void 0)return(0,I.jsx)(E,{className:`h-40 w-full`});let n=[{label:`TASK LATENCY`,dist:t.timing?.taskLatencyMs},{label:`QUEUE WAIT`,dist:t.timing?.queueWaitMs},{label:`ASSIGNMENT`,dist:t.timing?.assignmentDurationMs}],r=Math.max(1,...n.map(e=>e.dist?.max??0)),i=t.timing?.runDurationMs;return(0,I.jsxs)(`div`,{className:`grid gap-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 rounded-lg border bg-card p-4`,children:[(0,I.jsx)(`h3`,{className:`console-callout`,children:`Latency distributions`}),n.map(e=>(0,I.jsx)(pt,{label:e.label,dist:e.dist,scaleMax:r},e.label))]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,I.jsx)(mt,{label:`Success rate`,rate:t.tasks?.successRate}),(0,I.jsx)(mt,{label:`Locality hit`,rate:t.locality?.localityHitRate}),(0,I.jsx)(mt,{label:`Compliance`,rate:t.policy?.complianceRate})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(Q,{label:`Bytes moved`,value:dt(t.artifacts?.bytesTransferred??0)}),(0,I.jsx)(Q,{label:`Movements`,value:String(t.artifacts?.movementCount??0)}),(0,I.jsx)(Q,{label:`Policy denials`,value:String(t.policy?.denialCount??0)}),(0,I.jsx)(Q,{label:`Run duration`,value:typeof i==`number`?K(i):`—`})]})]})}function pt(e){let t=e.dist?.count??0,n=e.dist?.min,r=e.dist?.max,i=e.dist!==void 0&&t>0?e.dist.total/t:void 0,a=t=>e.scaleMax>0?Math.min(100,t/e.scaleMax*100):0;return(0,I.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,I.jsx)(`span`,{className:`console-callout`,children:e.label}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[t,` SAMPLES`]})]}),(0,I.jsxs)(`div`,{className:`relative h-2 rounded-full bg-muted`,children:[n!==void 0&&r!==void 0?(0,I.jsx)(`div`,{className:`absolute inset-y-0 rounded-full bg-primary/30 transition-all duration-500 ease-out-fast`,style:{left:`${a(n)}%`,width:`${Math.max(a(r)-a(n),.5)}%`}}):null,i===void 0?null:(0,I.jsx)(`div`,{className:`absolute inset-y-0 w-[3px] rounded-full bg-primary transition-all duration-500 ease-out-fast`,style:{left:`calc(${a(i)}% - 1.5px)`}})]}),(0,I.jsxs)(`div`,{className:`flex justify-between font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:[(0,I.jsx)(`span`,{children:Z(n)}),(0,I.jsxs)(`span`,{children:[`μ `,Z(i)]}),(0,I.jsx)(`span`,{children:Z(r)})]})]})}function mt(e){let t=e.rate===void 0?void 0:Math.round(Math.min(1,Math.max(0,e.rate))*100);return(0,I.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border bg-card px-4 py-3`,children:[(0,I.jsxs)(`div`,{className:`relative size-11 shrink-0`,children:[(0,I.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 44 44`,className:`size-11 -rotate-90`,children:[(0,I.jsx)(`circle`,{cx:22,cy:22,r:19,fill:`none`,strokeWidth:4,className:`stroke-muted`}),(0,I.jsx)(`circle`,{cx:22,cy:22,r:19,fill:`none`,strokeWidth:4,strokeLinecap:`round`,pathLength:100,strokeDasharray:100,strokeDashoffset:100-(t??0),className:a(`transition-[stroke-dashoffset] duration-500 ease-out-fast`,(t??0)>=90?`stroke-status-succeeded`:`stroke-status-warn`)})]}),(0,I.jsx)(`span`,{className:`absolute inset-0 grid place-items-center font-mono text-[10px]`,"data-num":!0,children:t===void 0?`—`:`${t}%`})]}),(0,I.jsx)(`span`,{className:`console-callout`,children:e.label})]})}function Q(e){return(0,I.jsxs)(`div`,{className:`rounded-lg border bg-card px-4 py-3`,"data-flash":me(e.value),children:[(0,I.jsx)(`div`,{className:`console-callout`,children:e.label}),(0,I.jsx)(`div`,{className:`mt-1 font-mono text-xl font-medium`,"data-num":!0,children:e.value})]})}var ht=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`]),gt={RUNNING:`bg-status-running`,SUCCEEDED:`bg-status-succeeded`,FAILED:`bg-status-failed`,CANCELLED:`bg-status-warn`},_t=`repeating-linear-gradient(45deg, var(--status-idle) 0 3px, transparent 3px 6px)`,vt=`grid-cols-[minmax(8rem,12rem)_1fr_4.5rem]`;function $(e){if(e===void 0)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function yt(e){let t=(0,F.useMemo)(()=>{let t=e.tasks.map(e=>({task:e,queuedAt:$(e.queuedAt??e.createdAt),startedAt:$(e.startedAt),completedAt:$(e.completedAt)}));t.sort((e,t)=>(e.startedAt??e.queuedAt??2**53-1)-(t.startedAt??t.queuedAt??2**53-1)||e.task.taskId.localeCompare(t.task.taskId));let n=$(e.runCreatedAt)??2**53-1,r=0;for(let e of t)n=Math.min(n,e.queuedAt??e.startedAt??n),r=Math.max(r,e.completedAt??e.startedAt??e.queuedAt??0);return n===2**53-1&&(n=r>0?r:Date.now()),{rows:t,start:n,end:r}},[e.tasks,e.runCreatedAt]);if(e.pending)return(0,I.jsx)(`div`,{className:`rounded-lg border bg-card/40 p-4`,children:(0,I.jsx)(`div`,{className:`grid gap-2.5`,children:[0,1,2].map(e=>(0,I.jsxs)(`div`,{className:a(`grid items-center gap-3 px-1.5`,vt),children:[(0,I.jsx)(`div`,{className:`h-3 w-24 rounded-sm bg-muted`}),(0,I.jsx)(`div`,{className:`h-2 rounded-sm bg-muted/50`}),(0,I.jsx)(`div`,{className:`h-3 w-10 justify-self-end rounded-sm bg-muted`})]},e))})});if(t.rows.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No tasks in this run.`});let n=Date.now(),r=e.runActive?Math.max(t.end,n):Math.max(t.end,t.start+1),i=Math.max(1,r-t.start),o=e=>(e-t.start)/i*100;return(0,I.jsx)(`div`,{className:`rounded-lg border bg-card/40 p-4`,children:(0,I.jsx)(`div`,{className:`grid gap-1`,children:t.rows.map(t=>{let r=t.task.status,i=ht.has(r),s=t.startedAt??(i?t.completedAt??t.queuedAt:n),c=t.completedAt??(t.startedAt===void 0?void 0:n),l=t.startedAt!==void 0&&c!==void 0?c-t.startedAt:void 0;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelect(t.task.taskId),className:a(`grid w-full items-center gap-3 rounded-sm px-1.5 py-0.5 text-left hover:bg-accent/50`,vt),children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:T(t.task)??t.task.taskId}),(0,I.jsxs)(`span`,{className:`relative block h-4`,children:[t.queuedAt!==void 0&&s!==void 0&&s>t.queuedAt?(0,I.jsx)(`span`,{className:`absolute inset-y-1 rounded-[1px]`,style:{left:`${o(t.queuedAt)}%`,width:`${Math.max(o(s)-o(t.queuedAt),.3)}%`,backgroundImage:_t}}):null,t.startedAt!==void 0&&c!==void 0?(0,I.jsx)(`span`,{className:a(`absolute inset-y-0.5 rounded-[2px]`,gt[r]??`bg-status-idle`),style:{left:`${o(t.startedAt)}%`,width:`${Math.max(o(c)-o(t.startedAt),.4)}%`}}):null]}),(0,I.jsx)(`span`,{className:`text-right font-mono text-[10px] text-muted-foreground`,"data-num":!0,children:l===void 0?`—`:K(l)})]},t.task.taskId)})})})}var bt=[`SUCCEEDED`,`FAILED`,`CANCELLED`],xt=new Set([`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`]),St=40;function Ct(e){if(e===void 0)return;let t=Date.parse(e.createdAt),n=e.completedAt===void 0?xt.has(e.state)?Date.parse(e.updatedAt):Date.now():Date.parse(e.completedAt);return Number.isFinite(t)&&Number.isFinite(n)?n-t:void 0}function wt(e){let t=p(e.runId),n=ee(e.runId),r=te(e.runId),i=f(e.runId),a=re(e.runId),o=ne(),s=ie(),c=e.view,[l,u]=(0,F.useState)(null),[d,m]=(0,F.useState)(null),h=t.data?.state===`RUNNING`;ue(h?1e3:3e4);let g=n.data?.tasks??[],_=fe(g),v=t=>s({to:`/runs/$runId/t/$taskId`,params:{runId:e.runId,taskId:t}}),y={};if(g.length>0)for(let e of g)y[e.status]=(y[e.status]??0)+1;else t.data?.taskStatusCounts!==void 0&&Object.assign(y,t.data.taskStatusCounts);let ae=Object.values(y).reduce((e,t)=>e+t,0),b=bt.reduce((e,t)=>e+(y[t]??0),0),x=me(b),S=Ct(t.data),C=l??g.length<=St,w=t.data!==void 0&&xt.has(t.data.state);async function T(){if(t.data!==void 0&&window.confirm(`Delete "${t.data.name}" from run history?`)){m(null);try{await o.mutateAsync(e.runId),s({to:`/runs`})}catch(e){m(e instanceof Error?e.message:`Failed to delete run`)}}}return(0,I.jsxs)(`section`,{className:`grid gap-5`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,I.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:t.data?.name??e.runId}),t.data?(0,I.jsx)(pe,{state:t.data.state,id:e.runId}):null,(0,I.jsx)(de,{counts:y,className:`h-2 w-40 max-w-md flex-1`,segmentClassName:`duration-300`}),(0,I.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,"data-num":!0,"data-flash":x,children:[b,`/`,ae,` TASKS TERMINAL`]}),S===void 0?null:(0,I.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground`,"data-num":!0,children:[K(S),` ELAPSED`]}),(0,I.jsxs)(`button`,{type:`button`,title:`Download the run history as NDJSON`,onClick:()=>{se(`/v1/runs/${encodeURIComponent(e.runId)}/history.jsonl`,`${e.runId}.jsonl`).catch(()=>{})},className:`ml-auto flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] tracking-[0.08em] text-muted-foreground uppercase transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,I.jsx)(_e,{className:`size-3.5`}),`History`]}),(0,I.jsxs)(`button`,{type:`button`,title:w?`Delete this run from history`:`Delete is available after the run finishes`,disabled:!w||o.isPending,onClick:()=>{T()},className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] tracking-[0.08em] text-destructive uppercase transition-colors hover:bg-destructive/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,I.jsx)(oe,{className:`size-3.5`}),o.isPending?`Deleting`:`Delete`]})]}),(0,I.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.runId,t.data?(0,I.jsxs)(I.Fragment,{children:[` · created `,(0,I.jsx)(`span`,{title:t.data.createdAt,children:ce(t.data.createdAt)})]}):null]}),d?(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:d}):null]}),(0,I.jsxs)(ze,{value:e.tab,onValueChange:e.onTabChange,children:[(0,I.jsxs)(Ve,{children:[(0,I.jsx)(z,{value:`overview`,children:`Overview`}),(0,I.jsxs)(z,{value:`artifacts`,children:[`Artifacts`,r.data?.artifacts.length?(0,I.jsx)(D,{variant:`secondary`,"data-num":!0,children:r.data.artifacts.length}):null]}),(0,I.jsx)(z,{value:`metrics`,children:`Metrics`}),(0,I.jsxs)(z,{value:`files`,children:[`Files`,a.data?.reservations.length?(0,I.jsx)(D,{variant:`secondary`,"data-num":!0,children:a.data.reservations.length}):null]})]}),(0,I.jsxs)(B,{value:`overview`,className:`grid min-w-0 gap-4 pt-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(Tt,{active:c===`map`,onClick:()=>e.onViewChange(`map`),children:`Map`}),(0,I.jsx)(Tt,{active:c===`timeline`,onClick:()=>e.onViewChange(`timeline`),children:`Timeline`}),(0,I.jsx)(Tt,{active:c===`sandboxes`,onClick:()=>e.onViewChange(`sandboxes`),children:`By Sandbox`}),c!==`sandboxes`&&g.length>St?(0,I.jsx)(`button`,{type:`button`,onClick:()=>u(!C),className:`ml-2 rounded-md border border-transparent px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground hover:bg-secondary/60`,children:C?`Collapse`:`Expand (${g.length} tasks)`}):null]}),c===`sandboxes`?(0,I.jsxs)(`div`,{className:`grid gap-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Tasks grouped by the sandbox assigned to run them. This is run context, not the global fleet page.`}),(0,I.jsx)(he,{tasks:g,ordinals:_,pending:n.isPending,onSelect:v})]}):(0,I.jsxs)(I.Fragment,{children:[C&&!n.isError?c===`map`?(0,I.jsx)($e,{tasks:g,ordinals:_,pending:n.isPending,selectedTaskId:null,onSelect:v}):(0,I.jsx)(yt,{tasks:g,pending:n.isPending,runCreatedAt:t.data?.createdAt,runActive:h,onSelect:v}):null,(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsx)(`h2`,{className:`console-callout`,children:`Tasks`}),(0,I.jsx)(Et,{tasks:g,ordinals:_,pending:n.isPending,error:n.isError?String(n.error):null,onOpen:v})]})]})]}),(0,I.jsx)(B,{value:`artifacts`,className:`pt-3`,children:(0,I.jsx)(jt,{artifacts:r.data?.artifacts,error:r.isError?String(r.error):null})}),(0,I.jsx)(B,{value:`metrics`,className:`pt-3`,children:(0,I.jsx)(ft,{metrics:i.data,error:i.isError?String(i.error):null})}),(0,I.jsx)(B,{value:`files`,className:`pt-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsx)(`h2`,{className:`console-callout`,children:`Active file reservations`}),(0,I.jsx)(Dt,{reservations:a.data?.reservations,tasks:g,ordinals:_,pending:a.isPending,error:a.isError?String(a.error):null,onOpen:v})]})})]})]})}function Tt(e){return(0,I.jsx)(`button`,{type:`button`,onClick:e.onClick,className:a(`rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.14em] transition-state`,e.active?`border-primary/40 bg-secondary text-foreground`:`border-transparent text-muted-foreground hover:bg-secondary/60`),children:e.children})}function Et(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,e.error]});let t=[...e.tasks].sort((t,n)=>(e.ordinals.get(t.taskId)??0)-(e.ordinals.get(n.taskId)??0));return(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{children:[(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`#`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Task`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Status`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Workpad`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Sandbox`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Depends on`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Accepted`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Finished`}),(0,I.jsx)(A,{className:`console-callout pr-4 text-right text-muted-foreground`,children:`Open`})]})}),(0,I.jsx)(j,{children:e.pending?(0,I.jsx)(M,{children:[0,1,2,3,4,5,6,7,8].map(e=>(0,I.jsx)(N,{children:(0,I.jsx)(E,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let n=T(t);return(0,I.jsxs)(M,{className:`cursor-pointer`,onClick:()=>e.onOpen(t.taskId),children:[(0,I.jsxs)(N,{className:`font-mono text-xs text-muted-foreground`,"data-num":!0,children:[`#`,e.ordinals.get(t.taskId)]}),(0,I.jsx)(N,{children:(0,I.jsx)(`button`,{type:`button`,className:n===void 0?`block text-left font-mono text-xs hover:underline`:`block text-left text-sm font-medium hover:underline`,onClick:()=>e.onOpen(t.taskId),title:t.taskId,children:n??t.taskId})}),(0,I.jsx)(N,{children:(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(pe,{state:t.status,id:t.taskId}),(0,I.jsx)(Ot,{task:t})]})}),(0,I.jsx)(N,{children:t.workpad?(0,I.jsxs)(D,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Updated ${t.workpad.updatedAt}`,children:[`v`,t.workpad.version,` ·`,` `,O(t.workpad.updatedAt)]}):(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`—`})}),(0,I.jsx)(N,{className:`font-mono text-xs`,children:t.assignedSandboxId??t.lastSandboxId??`—`}),(0,I.jsx)(N,{className:`space-x-1`,children:t.dependsOn.length===0?`—`:t.dependsOn.map(t=>(0,I.jsxs)(D,{variant:`secondary`,className:`font-mono text-[11px]`,title:t,children:[`#`,e.ordinals.get(t)??`?`]},t))}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.assignmentAcceptedAt,"data-num":!0,children:O(t.assignmentAcceptedAt)}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.lastFinishedAt,"data-num":!0,children:O(t.lastFinishedAt)}),(0,I.jsx)(N,{className:`pr-4 text-right`,children:(0,I.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,title:`Open this task's workpad and agent transcript`,onClick:n=>{n.stopPropagation(),e.onOpen(t.taskId)},children:[(0,I.jsx)(o,{}),`Task`]})})]},t.taskId)})})]})})})}function Dt(e){if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load file reservations: `,e.error]});let t=e.reservations??[],n=new Map(e.tasks.map(e=>[e.taskId,e]));return!e.pending&&t.length===0?(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No active file reservations in this run.`}):(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{className:`min-w-[960px] table-fixed`,children:[(0,I.jsxs)(`colgroup`,{children:[(0,I.jsx)(`col`,{style:{width:`22%`}}),(0,I.jsx)(`col`,{style:{width:`27%`}}),(0,I.jsx)(`col`,{style:{width:`13%`}}),(0,I.jsx)(`col`,{style:{width:`28%`}}),(0,I.jsx)(`col`,{style:{width:`10%`}})]}),(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Path`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Task`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Sandbox`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Reason`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Reserved`})]})}),(0,I.jsx)(j,{children:e.pending&&t.length===0?(0,I.jsx)(M,{children:[0,1,2,3,4].map(e=>(0,I.jsx)(N,{children:(0,I.jsx)(E,{className:`h-4 w-full max-w-28`})},e))}):t.map(t=>{let r=n.get(t.taskId),i=r?T(r):void 0;return(0,I.jsxs)(M,{children:[(0,I.jsx)(N,{className:`overflow-hidden`,children:(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,I.jsx)(D,{variant:`outline`,className:`shrink-0 font-mono text-[10px] uppercase`,children:t.selector.kind}),(0,I.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-xs`,title:kt(t),children:t.selector.path})]})}),(0,I.jsxs)(N,{className:`overflow-hidden`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-sm font-medium hover:underline`,title:t.taskId,onClick:()=>e.onOpen(t.taskId),children:[e.ordinals.has(t.taskId)?`#${e.ordinals.get(t.taskId)} `:``,i??t.taskId]}),(0,I.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground`,children:t.assignmentId})]}),(0,I.jsx)(N,{className:`overflow-hidden truncate font-mono text-xs`,title:t.sandboxId,children:t.sandboxId}),(0,I.jsx)(N,{className:`overflow-hidden text-sm`,children:(0,I.jsx)(`div`,{className:`max-w-full overflow-x-auto whitespace-nowrap`,title:t.reason??`No reason`,children:t.reason??`No reason`})}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,title:t.createdAt,"data-num":!0,children:O(t.createdAt)})]},t.reservationId)})})]})})})}function Ot(e){let t=e.task.live;if(!t)return null;let n=t.idleTimeout?.graceExpiresAt??t.idleTimeout?.expiresAt;return(0,I.jsxs)(`div`,{className:`flex max-w-56 flex-wrap items-center gap-1`,children:[t.state?.liveStatus===void 0?null:(0,I.jsx)(D,{variant:`outline`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Live task round state`,children:t.state.liveStatus}),t.latestRoundKey===void 0?null:(0,I.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:`Latest round ${t.latestRoundKey}`,children:t.latestRoundKey}),n===void 0?null:(0,I.jsxs)(D,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,title:`Idle timeout ${n}`,children:[`idle `,O(n)]})]})}function kt(e){return`${e.selector.kind}:${e.selector.path}`}function At(e){return e===`allow`?`border-status-idle/40 text-status-idle`:e===`deny`?`border-status-failed/40 text-status-failed`:`border-status-warn/40 text-status-warn`}function jt(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null);if(e.error!==null)return(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load artifacts: `,e.error]});let o=e.artifacts??[];if(o.length===0)return(0,I.jsx)(`p`,{className:`py-6 text-center text-sm text-muted-foreground`,children:`No artifacts declared in this run.`});async function s(e){n(e.artifactId),i(null);try{await se(`/v1/artifacts/${encodeURIComponent(e.artifactId)}/fetch`,Mt(e))}catch(e){i(e instanceof Error?e.message:String(e))}finally{n(null)}}return(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[r===null?null:(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot download artifact: `,r]}),(0,I.jsx)(w,{className:`py-0`,children:(0,I.jsx)(C,{className:`p-0`,children:(0,I.jsxs)(P,{children:[(0,I.jsx)(k,{children:(0,I.jsxs)(M,{children:[(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Descriptor`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Kind`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Policy`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Size`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Locations`}),(0,I.jsx)(A,{className:`console-callout text-muted-foreground`,children:`Download`})]})}),(0,I.jsx)(j,{children:o.map(e=>{let n=e.locations.some(e=>Pt(e)),r=t===e.artifactId;return(0,I.jsxs)(M,{children:[(0,I.jsxs)(N,{children:[(0,I.jsx)(`div`,{className:`font-mono text-xs`,children:e.artifactId}),e.metadata===void 0?null:(0,I.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:Lt(e.metadata)})]}),(0,I.jsx)(N,{children:(0,I.jsx)(D,{variant:`secondary`,className:`font-mono text-[10px] uppercase tracking-[0.08em]`,children:e.kind})}),(0,I.jsx)(N,{children:(0,I.jsx)(D,{variant:`outline`,className:a(`font-mono text-[10px] uppercase tracking-[0.08em]`,At(e.movementPolicy)),children:e.movementPolicy})}),(0,I.jsx)(N,{className:`font-mono text-xs text-muted-foreground`,"data-num":!0,children:e.sizeBytes===void 0?`—`:dt(e.sizeBytes)}),(0,I.jsx)(N,{className:`min-w-44`,children:(0,I.jsx)(Ft,{locations:e.locations})}),(0,I.jsx)(N,{children:n?(0,I.jsxs)(x,{type:`button`,size:`xs`,variant:`outline`,disabled:r,title:`Download artifact bytes through the control plane`,onClick:()=>void s(e),children:[(0,I.jsx)(_e,{}),r?`Saving`:`Download`]}):(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,title:`This descriptor has no produced artifact bytes.`,children:`not produced`})})]},e.artifactId)})})]})})})]})}function Mt(e){return Nt(e.metadata)??e.locations.map(e=>Nt(e.metadata)).find(e=>e!==void 0)??e.artifactId}function Nt(e){for(let t of[`filename`,`fileName`,`name`,`path`,`relativePath`]){let n=e?.[t];if(typeof n!=`string`)continue;let r=n.split(/[\\/]/).filter(Boolean).at(-1);if(r!==void 0&&r.length>0)return r}}function Pt(e){return e.storageKind===`sandbox-local`&&e.bytesAvailable}function Ft(e){return e.locations.length===0?(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:`none`}):(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.locations.map(e=>(0,I.jsxs)(D,{variant:e.bytesAvailable?`outline`:`secondary`,className:a(`font-mono text-[10px] uppercase tracking-[0.08em]`,e.storageKind===`sandbox-local`&&e.bytesAvailable&&`border-status-succeeded/40 text-status-succeeded`),title:It(e),children:[e.storageKind,e.sandboxId?` · ${e.sandboxId}`:``,e.bytesAvailable?``:` · unavailable`]},e.artifactLocationId))})}function It(e){let t=[e.artifactLocationId,e.location,e.site,e.region,e.network,e.substrate,e.uri].filter(e=>typeof e==`string`);return t.length>0?t.join(` · `):e.storageKind}function Lt(e){let t=Object.entries(e).filter(([e])=>e!==`clientScope`);return t.length===0?`descriptor`:t.slice(0,2).map(([e,t])=>`${e}=${Rt(t)}`).join(` · `)}function Rt(e){return typeof e==`string`||typeof e==`number`?String(e):typeof e==`boolean`?e?`true`:`false`:JSON.stringify(e)}export{wt as RunPage};
@@ -1 +1 @@
1
- import{h as e,t,v as n}from"./react-DtOYBmep.js";import{r,t as i}from"./utils-CEE0-YEp.js";import{k as a,q as o}from"./main-RzjfJZwD.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";import{c as f,d as p,l as m,n as h,s as g,t as _,u as v}from"./bits-Cv0Te4iz.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-DptQuuuq.js";var T=r(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),E=n(t(),1),D=e(),O=[{label:`All`,value:void 0},{label:`Running`,value:`RUNNING`},{label:`Succeeded`,value:`SUCCEEDED`},{label:`Failed`,value:`FAILED`}];function k(e){let t=e.filter,n=o(),r=o(t),s=(n.data?.pages??[]).flatMap(e=>e.runs),c=(r.data?.pages??[]).flatMap(e=>e.runs);m();let u=(0,E.useRef)(null),f=new Set;if(u.current!==null)for(let e of c){if(u.current.has(e.runId))break;f.add(e.runId)}(0,E.useEffect)(()=>{if(r.isPending)return;let e=u.current??new Set;u.current=e;for(let t of c)e.add(t.runId)});let p=M(s);return(0,D.jsxs)(`section`,{className:`grid gap-5`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Runs`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run your account can read, newest first.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,D.jsx)(j,{label:`Active runs`,hint:`of ${s.length} loaded`,value:String(s.filter(e=>e.state===`RUNNING`).length)}),(0,D.jsx)(j,{label:`Success rate`,hint:`of ${s.length} loaded`,value:p===void 0?`—`:`${p}%`,baseline:p??0})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-1.5`,children:O.map(n=>(0,D.jsx)(a,{size:`sm`,"aria-pressed":t===n.value,variant:t===n.value?`secondary`:`ghost`,className:i(`h-7 px-2.5 font-mono text-xs uppercase tracking-[0.08em]`,t!==n.value&&`text-muted-foreground`),onClick:()=>e.onFilterChange(n.value),children:n.label},n.label))}),r.isError?(0,D.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot list runs: `,String(r.error)]}):c.length===0&&!r.isPending?(0,D.jsx)(P,{filtered:t!==void 0}):(0,D.jsx)(d,{className:`py-0`,children:(0,D.jsx)(l,{className:`p-0`,children:(0,D.jsxs)(w,{children:[(0,D.jsx)(y,{children:(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Run`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`State`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Tasks`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Created`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Updated`})]})}),(0,D.jsx)(x,{children:r.isPending?(0,D.jsx)(N,{}):c.map(t=>(0,D.jsx)(A,{run:t,rising:f.has(t.runId),onOpen:()=>e.onOpenRun(t.runId)},t.runId))})]})})}),r.hasNextPage?(0,D.jsx)(a,{variant:`outline`,onClick:()=>void r.fetchNextPage(),disabled:r.isFetchingNextPage,children:`Load more`}):null]})}function A(e){let t=v(e.run.updatedAt);return(0,D.jsxs)(S,{"data-flash":t,className:i(`cursor-pointer`,e.rising&&`animate-in fade-in slide-in-from-bottom-1 duration-200`),onClick:e.onOpen,children:[(0,D.jsxs)(C,{className:`relative`,children:[t===void 0?null:(0,D.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 w-[3px] bg-primary animate-out fade-out fill-mode-forwards duration-700`}),(0,D.jsx)(`button`,{type:`button`,className:`block text-left font-medium hover:underline`,onClick:e.onOpen,children:e.run.name}),(0,D.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,D.jsx)(C,{children:(0,D.jsx)(_,{state:e.run.state,id:e.run.runId})}),(0,D.jsx)(C,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,D.jsx)(`span`,{className:`font-mono text-xs`,"data-num":!0,children:g(e.run.taskStatusCounts)}),(0,D.jsx)(h,{counts:e.run.taskStatusCounts})]})}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.createdAt,children:f(e.run.createdAt)}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.updatedAt,children:f(e.run.updatedAt)})]})}function j(e){let t=v(e.value);return(0,D.jsx)(d,{className:`gap-1 py-4`,children:(0,D.jsxs)(c,{className:`gap-1.5 py-0`,children:[(0,D.jsxs)(u,{className:`console-callout`,children:[e.label,e.hint===void 0?null:(0,D.jsxs)(`span`,{className:`ml-1 opacity-70`,"data-num":!0,children:[`· `,e.hint]})]}),(0,D.jsx)(s,{"data-num":!0,"data-flash":t,className:`-mx-1 w-fit rounded-sm px-1 font-mono text-2xl font-medium`,children:e.value}),e.baseline===void 0?null:(0,D.jsx)(`div`,{"aria-hidden":!0,className:`h-px w-full bg-border`,children:(0,D.jsx)(`div`,{className:`h-full bg-status-succeeded transition-state`,style:{width:`${e.baseline}%`}})})]})})}function M(e){let t=e.filter(e=>[`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`].includes(e.state));if(t.length===0)return;let n=t.filter(e=>e.state===`SUCCEEDED`).length;return Math.round(n/t.length*100)}function N(){return(0,D.jsx)(D.Fragment,{children:[0,1,2].map(e=>(0,D.jsx)(S,{children:[0,1,2,3,4].map(e=>(0,D.jsx)(C,{children:(0,D.jsx)(p,{className:`h-4 w-full max-w-32`})},e))},e))})}function P(e){return(0,D.jsx)(d,{className:`py-12 text-center`,children:(0,D.jsxs)(l,{className:`grid justify-items-center gap-2`,children:[(0,D.jsx)(T,{className:`size-8 text-muted-foreground`}),(0,D.jsx)(`p`,{className:`font-medium`,children:e.filtered?`No runs match this filter`:`No runs yet`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.filtered?`Try another state.`:`Create a run and it will appear here within a second.`})]})})}export{k as RunsPage};
1
+ import{h as e,t,v as n}from"./react-DtOYBmep.js";import{r,t as i}from"./utils-CEE0-YEp.js";import{k as a,q as o}from"./main-KBvz0mSQ.js";import{a as s,i as c,n as l,r as u,t as d}from"./card-DSG3_teC.js";import{c as f,d as p,l as m,n as h,s as g,t as _,u as v}from"./bits-Cv0Te4iz.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-DptQuuuq.js";var T=r(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),E=n(t(),1),D=e(),O=[{label:`All`,value:void 0},{label:`Running`,value:`RUNNING`},{label:`Succeeded`,value:`SUCCEEDED`},{label:`Failed`,value:`FAILED`}];function k(e){let t=e.filter,n=o(),r=o(t),s=(n.data?.pages??[]).flatMap(e=>e.runs),c=(r.data?.pages??[]).flatMap(e=>e.runs);m();let u=(0,E.useRef)(null),f=new Set;if(u.current!==null)for(let e of c){if(u.current.has(e.runId))break;f.add(e.runId)}(0,E.useEffect)(()=>{if(r.isPending)return;let e=u.current??new Set;u.current=e;for(let t of c)e.add(t.runId)});let p=M(s);return(0,D.jsxs)(`section`,{className:`grid gap-5`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Runs`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run your account can read, newest first.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,D.jsx)(j,{label:`Active runs`,hint:`of ${s.length} loaded`,value:String(s.filter(e=>e.state===`RUNNING`).length)}),(0,D.jsx)(j,{label:`Success rate`,hint:`of ${s.length} loaded`,value:p===void 0?`—`:`${p}%`,baseline:p??0})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-1.5`,children:O.map(n=>(0,D.jsx)(a,{size:`sm`,"aria-pressed":t===n.value,variant:t===n.value?`secondary`:`ghost`,className:i(`h-7 px-2.5 font-mono text-xs uppercase tracking-[0.08em]`,t!==n.value&&`text-muted-foreground`),onClick:()=>e.onFilterChange(n.value),children:n.label},n.label))}),r.isError?(0,D.jsxs)(`p`,{className:`text-sm text-status-failed`,children:[`Cannot list runs: `,String(r.error)]}):c.length===0&&!r.isPending?(0,D.jsx)(P,{filtered:t!==void 0}):(0,D.jsx)(d,{className:`py-0`,children:(0,D.jsx)(l,{className:`p-0`,children:(0,D.jsxs)(w,{children:[(0,D.jsx)(y,{children:(0,D.jsxs)(S,{children:[(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Run`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`State`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Tasks`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Created`}),(0,D.jsx)(b,{className:`console-callout text-muted-foreground`,children:`Updated`})]})}),(0,D.jsx)(x,{children:r.isPending?(0,D.jsx)(N,{}):c.map(t=>(0,D.jsx)(A,{run:t,rising:f.has(t.runId),onOpen:()=>e.onOpenRun(t.runId)},t.runId))})]})})}),r.hasNextPage?(0,D.jsx)(a,{variant:`outline`,onClick:()=>void r.fetchNextPage(),disabled:r.isFetchingNextPage,children:`Load more`}):null]})}function A(e){let t=v(e.run.updatedAt);return(0,D.jsxs)(S,{"data-flash":t,className:i(`cursor-pointer`,e.rising&&`animate-in fade-in slide-in-from-bottom-1 duration-200`),onClick:e.onOpen,children:[(0,D.jsxs)(C,{className:`relative`,children:[t===void 0?null:(0,D.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 w-[3px] bg-primary animate-out fade-out fill-mode-forwards duration-700`}),(0,D.jsx)(`button`,{type:`button`,className:`block text-left font-medium hover:underline`,onClick:e.onOpen,children:e.run.name}),(0,D.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,D.jsx)(C,{children:(0,D.jsx)(_,{state:e.run.state,id:e.run.runId})}),(0,D.jsx)(C,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,D.jsx)(`span`,{className:`font-mono text-xs`,"data-num":!0,children:g(e.run.taskStatusCounts)}),(0,D.jsx)(h,{counts:e.run.taskStatusCounts})]})}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.createdAt,children:f(e.run.createdAt)}),(0,D.jsx)(C,{"data-num":!0,className:`font-mono text-xs text-muted-foreground`,title:e.run.updatedAt,children:f(e.run.updatedAt)})]})}function j(e){let t=v(e.value);return(0,D.jsx)(d,{className:`gap-1 py-4`,children:(0,D.jsxs)(c,{className:`gap-1.5 py-0`,children:[(0,D.jsxs)(u,{className:`console-callout`,children:[e.label,e.hint===void 0?null:(0,D.jsxs)(`span`,{className:`ml-1 opacity-70`,"data-num":!0,children:[`· `,e.hint]})]}),(0,D.jsx)(s,{"data-num":!0,"data-flash":t,className:`-mx-1 w-fit rounded-sm px-1 font-mono text-2xl font-medium`,children:e.value}),e.baseline===void 0?null:(0,D.jsx)(`div`,{"aria-hidden":!0,className:`h-px w-full bg-border`,children:(0,D.jsx)(`div`,{className:`h-full bg-status-succeeded transition-state`,style:{width:`${e.baseline}%`}})})]})})}function M(e){let t=e.filter(e=>[`SUCCEEDED`,`FAILED`,`CANCELLED`,`STALLED`].includes(e.state));if(t.length===0)return;let n=t.filter(e=>e.state===`SUCCEEDED`).length;return Math.round(n/t.length*100)}function N(){return(0,D.jsx)(D.Fragment,{children:[0,1,2].map(e=>(0,D.jsx)(S,{children:[0,1,2,3,4].map(e=>(0,D.jsx)(C,{children:(0,D.jsx)(p,{className:`h-4 w-full max-w-32`})},e))},e))})}function P(e){return(0,D.jsx)(d,{className:`py-12 text-center`,children:(0,D.jsxs)(l,{className:`grid justify-items-center gap-2`,children:[(0,D.jsx)(T,{className:`size-8 text-muted-foreground`}),(0,D.jsx)(`p`,{className:`font-medium`,children:e.filtered?`No runs match this filter`:`No runs yet`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.filtered?`Try another state.`:`Create a run and it will appear here within a second.`})]})})}export{k as RunsPage};
@@ -1 +1 @@
1
- import{h as e}from"./react-DtOYBmep.js";import{r as t,t as n}from"./utils-CEE0-YEp.js";import{t as r}from"./arrow-right-BMW8fJP5.js";import{t as i}from"./external-link-BW8lpiMR.js";import{K as a,q as o}from"./main-RzjfJZwD.js";import{n as s,t as c}from"./card-DSG3_teC.js";import{c as l,d as u,l as d,o as f,t as p}from"./bits-Cv0Te4iz.js";import{t as m}from"./SandboxesLens-BUQQWmH6.js";var h=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),g=e();function _(e){let t=o();d();let n=(t.data?.pages??[]).flatMap(e=>e.runs),r=n.find(t=>t.runId===e.selectedRunId)??n[0];return(0,g.jsxs)(`section`,{className:`grid gap-5`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Sandboxes`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sandboxes used by your runs. This is task/session context, not global fleet capacity.`})]}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot list runs: `,String(t.error)]}):t.isPending?(0,g.jsx)(v,{}):n.length===0?(0,g.jsx)(y,{}):(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(b,{runs:n,selectedRunId:r?.runId,hasMore:t.hasNextPage,loadingMore:t.isFetchingNextPage,onLoadMore:()=>void t.fetchNextPage(),onSelect:e.onSelectRun}),r?(0,g.jsx)(S,{run:r,onOpenRun:e.onOpenRun,onOpenTask:e.onOpenTask}):null]})]})}function v(){return(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(c,{className:`gap-2 p-3`,children:[0,1,2].map(e=>(0,g.jsx)(u,{className:`h-12 w-full`},e))}),(0,g.jsxs)(c,{className:`p-4`,children:[(0,g.jsx)(u,{className:`h-5 w-40`}),(0,g.jsx)(u,{className:`mt-4 h-32 w-full`})]})]})}function y(){return(0,g.jsxs)(`div`,{className:`rounded-lg border border-dashed py-12 text-center`,children:[(0,g.jsx)(h,{className:`mx-auto size-5 text-muted-foreground`}),(0,g.jsx)(`p`,{className:`mt-3 console-callout`,children:`No runs yet`}),(0,g.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Sandbox placement appears after your account has task runs.`})]})}function b(e){return(0,g.jsxs)(c,{className:`gap-2 p-2`,children:[(0,g.jsx)(`div`,{className:`px-2 py-1`,children:(0,g.jsx)(`h2`,{className:`console-callout`,children:`Recent runs`})}),(0,g.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map(t=>(0,g.jsx)(x,{run:t,selected:t.runId===e.selectedRunId,onSelect:e.onSelect},t.runId))}),e.hasMore?(0,g.jsx)(`button`,{type:`button`,disabled:e.loadingMore,onClick:e.onLoadMore,className:`mt-1 rounded-md px-2 py-1.5 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 disabled:cursor-wait disabled:opacity-60`,children:e.loadingMore?`Loading`:`Load more`}):null]})}function x(e){return(0,g.jsxs)(`button`,{type:`button`,"aria-pressed":e.selected,onClick:()=>e.onSelect(e.run.runId),className:n(`grid min-w-0 gap-1 rounded-md px-2 py-2 text-left transition-colors`,e.selected?`bg-secondary text-foreground`:`text-muted-foreground hover:bg-secondary/60 hover:text-foreground`),children:[(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-mono text-[11px]`,children:[(0,g.jsx)(`span`,{className:`truncate`,title:e.run.runId,children:e.run.runId}),(0,g.jsx)(`span`,{className:`shrink-0`,title:e.run.updatedAt,"data-num":!0,children:l(e.run.updatedAt)})]})]})}function S(e){let t=a(e.run.runId),n=t.data?.tasks??[],o=f(n);return(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,g.jsx)(c,{className:`py-0`,children:(0,g.jsxs)(s,{className:`flex min-w-0 flex-wrap items-center gap-3 p-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`h2`,{className:`min-w-0 truncate text-base font-semibold`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,g.jsx)(i,{className:`size-3.5`}),`Open run`]})]})}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,String(t.error)]}):(0,g.jsx)(m,{tasks:n,ordinals:o,pending:t.isPending,onSelect:t=>e.onOpenTask(e.run.runId,t)}),!t.isPending&&n.length>0?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`inline-flex w-fit items-center gap-1.5 rounded-md px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[`Open run by sandbox`,(0,g.jsx)(r,{className:`size-3.5`})]}):null]})}export{_ as SandboxesPage};
1
+ import{h as e}from"./react-DtOYBmep.js";import{r as t,t as n}from"./utils-CEE0-YEp.js";import{t as r}from"./arrow-right-BMW8fJP5.js";import{t as i}from"./external-link-BW8lpiMR.js";import{K as a,q as o}from"./main-KBvz0mSQ.js";import{n as s,t as c}from"./card-DSG3_teC.js";import{c as l,d as u,l as d,o as f,t as p}from"./bits-Cv0Te4iz.js";import{t as m}from"./SandboxesLens-BUQQWmH6.js";var h=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),g=e();function _(e){let t=o();d();let n=(t.data?.pages??[]).flatMap(e=>e.runs),r=n.find(t=>t.runId===e.selectedRunId)??n[0];return(0,g.jsxs)(`section`,{className:`grid gap-5`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Sandboxes`}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Sandboxes used by your runs. This is task/session context, not global fleet capacity.`})]}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot list runs: `,String(t.error)]}):t.isPending?(0,g.jsx)(v,{}):n.length===0?(0,g.jsx)(y,{}):(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(b,{runs:n,selectedRunId:r?.runId,hasMore:t.hasNextPage,loadingMore:t.isFetchingNextPage,onLoadMore:()=>void t.fetchNextPage(),onSelect:e.onSelectRun}),r?(0,g.jsx)(S,{run:r,onOpenRun:e.onOpenRun,onOpenTask:e.onOpenTask}):null]})]})}function v(){return(0,g.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]`,children:[(0,g.jsx)(c,{className:`gap-2 p-3`,children:[0,1,2].map(e=>(0,g.jsx)(u,{className:`h-12 w-full`},e))}),(0,g.jsxs)(c,{className:`p-4`,children:[(0,g.jsx)(u,{className:`h-5 w-40`}),(0,g.jsx)(u,{className:`mt-4 h-32 w-full`})]})]})}function y(){return(0,g.jsxs)(`div`,{className:`rounded-lg border border-dashed py-12 text-center`,children:[(0,g.jsx)(h,{className:`mx-auto size-5 text-muted-foreground`}),(0,g.jsx)(`p`,{className:`mt-3 console-callout`,children:`No runs yet`}),(0,g.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Sandbox placement appears after your account has task runs.`})]})}function b(e){return(0,g.jsxs)(c,{className:`gap-2 p-2`,children:[(0,g.jsx)(`div`,{className:`px-2 py-1`,children:(0,g.jsx)(`h2`,{className:`console-callout`,children:`Recent runs`})}),(0,g.jsx)(`div`,{className:`grid gap-1`,children:e.runs.map(t=>(0,g.jsx)(x,{run:t,selected:t.runId===e.selectedRunId,onSelect:e.onSelect},t.runId))}),e.hasMore?(0,g.jsx)(`button`,{type:`button`,disabled:e.loadingMore,onClick:e.onLoadMore,className:`mt-1 rounded-md px-2 py-1.5 text-left font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 disabled:cursor-wait disabled:opacity-60`,children:e.loadingMore?`Loading`:`Load more`}):null]})}function x(e){return(0,g.jsxs)(`button`,{type:`button`,"aria-pressed":e.selected,onClick:()=>e.onSelect(e.run.runId),className:n(`grid min-w-0 gap-1 rounded-md px-2 py-2 text-left transition-colors`,e.selected?`bg-secondary text-foreground`:`text-muted-foreground hover:bg-secondary/60 hover:text-foreground`),children:[(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-mono text-[11px]`,children:[(0,g.jsx)(`span`,{className:`truncate`,title:e.run.runId,children:e.run.runId}),(0,g.jsx)(`span`,{className:`shrink-0`,title:e.run.updatedAt,"data-num":!0,children:l(e.run.updatedAt)})]})]})}function S(e){let t=a(e.run.runId),n=t.data?.tasks??[],o=f(n);return(0,g.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,g.jsx)(c,{className:`py-0`,children:(0,g.jsxs)(s,{className:`flex min-w-0 flex-wrap items-center gap-3 p-4`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,g.jsx)(`h2`,{className:`min-w-0 truncate text-base font-semibold`,children:e.run.name}),(0,g.jsx)(p,{state:e.run.state,id:e.run.runId})]}),(0,g.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-muted-foreground`,children:e.run.runId})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[(0,g.jsx)(i,{className:`size-3.5`}),`Open run`]})]})}),t.isError?(0,g.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Cannot load tasks: `,String(t.error)]}):(0,g.jsx)(m,{tasks:n,ordinals:o,pending:t.isPending,onSelect:t=>e.onOpenTask(e.run.runId,t)}),!t.isPending&&n.length>0?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>e.onOpenRun(e.run.runId),className:`inline-flex w-fit items-center gap-1.5 rounded-md px-2 py-1 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground`,children:[`Open run by sandbox`,(0,g.jsx)(r,{className:`size-3.5`})]}):null]})}export{_ as SandboxesPage};