@coreplane/switchboard 1.19.3 → 1.201.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/assets/config/config.example.yaml +9 -0
  2. package/dist/assets/deploy/cloudflare/package.json +1 -1
  3. package/dist/assets/deploy/cloudflare-resident/package.json +1 -1
  4. package/dist/assets/deploy/cloudflare-resident/worker.ts +1663 -456
  5. package/dist/assets/deploy/cloudflare-resident/wrangler.template.jsonc +12 -0
  6. package/dist/assets/deploy/cloudflare-sandbox/package.json +1 -1
  7. package/dist/assets/package-lock.json +13 -22
  8. package/dist/assets/package.json +1 -1
  9. package/dist/assets/project.json +1 -1
  10. package/dist/assets/source.json +3 -3
  11. package/dist/assets/src/core/schedules.ts +7 -2
  12. package/dist/assets/src/core/trace/attrs.ts +7 -0
  13. package/dist/assets/src/execution/residentDepsStore.ts +16 -0
  14. package/dist/assets/src/execution/residentIncarnation.ts +134 -0
  15. package/dist/assets/src/execution/residentInstanceId.ts +177 -0
  16. package/dist/assets/src/execution/residentStepPlan.ts +128 -0
  17. package/dist/assets/web/dist/.vite/manifest.json +104 -67
  18. package/dist/assets/web/dist/assets/{AppShell-Bk2gbvet.js → AppShell-CjDyTiip.js} +1 -1
  19. package/dist/assets/web/dist/assets/CostsPage-CMAh3G74.js +1 -0
  20. package/dist/assets/web/dist/assets/NotFoundPage-CbEKm0tY.js +1 -0
  21. package/dist/assets/web/dist/assets/ResidentDetailPage-CcfmOAIP.js +1 -0
  22. package/dist/assets/web/dist/assets/ResidentsIndexPage-9Z5jcteM.js +1 -0
  23. package/dist/assets/web/dist/assets/{RunRoutePage-XVFj0XDc.css → RunRoutePage-CdbrbqU2.css} +1 -1
  24. package/dist/assets/web/dist/assets/{RunRoutePage-ty94olNM.js → RunRoutePage-Cdimh4e0.js} +4 -4
  25. package/dist/assets/web/dist/assets/RunsIndexPage-CvgDXrO4.js +1 -0
  26. package/dist/assets/web/dist/assets/{RunsTabs-C4krAL9o.js → RunsTabs-rEjVQG6H.js} +1 -1
  27. package/dist/assets/web/dist/assets/ScheduledPage-C5bG9qvd.js +1 -0
  28. package/dist/assets/web/dist/assets/StatusDot-D_IPK3WP.js +1 -0
  29. package/dist/assets/web/dist/assets/{Tooltip-BfLPyxQy.js → Tooltip-JlZp3OVC.js} +1 -1
  30. package/dist/assets/web/dist/assets/{favicon-DL1rdWJt.js → favicon-DZDjc8ab.js} +1 -1
  31. package/dist/assets/web/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 +0 -0
  32. package/dist/assets/web/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 +0 -0
  33. package/dist/assets/web/dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  34. package/dist/assets/web/dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  35. package/dist/assets/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  36. package/dist/assets/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  37. package/dist/assets/web/dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  38. package/dist/assets/web/dist/assets/{main-Bnbk_Rsg.js → main-BKKzFAnK.js} +3 -3
  39. package/dist/assets/web/dist/assets/main-DoTjwE-G.css +1 -0
  40. package/dist/assets/web/dist/assets/{seed-BglCRKLA.js → seed-B8mQEhhw.js} +1 -1
  41. package/dist/assets/web/dist/assets/{wallClock-Ckv3sKoR.js → wallClock-DI4HIEN5.js} +1 -1
  42. package/dist/cli.js +66 -9
  43. package/package.json +1 -1
  44. package/dist/assets/web/dist/assets/CostsPage-CTZcMYYx.js +0 -1
  45. package/dist/assets/web/dist/assets/NotFoundPage-C-BuaSm8.js +0 -1
  46. package/dist/assets/web/dist/assets/ResidentDetailPage-DvQ05AGa.js +0 -1
  47. package/dist/assets/web/dist/assets/ResidentsIndexPage-B3uxKUne.js +0 -1
  48. package/dist/assets/web/dist/assets/RunsIndexPage-CM-qxyQm.js +0 -1
  49. package/dist/assets/web/dist/assets/ScheduledPage-C1psvLD4.js +0 -1
  50. package/dist/assets/web/dist/assets/StatusDot-DuoQnQeU.js +0 -1
  51. package/dist/assets/web/dist/assets/main-BsBGUyMH.css +0 -2
@@ -1 +1 @@
1
- import{$n as e,Yn as t,ai as n}from"./seed-BglCRKLA.js";function r(e,t){let n=t-e;if(!(n>45e3))return`just now`;let r=Math.floor(n/6e4);if(r<60)return r<=1?`1 minute ago`:r+` minutes ago`;let i=Math.floor(r/60);if(i<24)return i===1?`1 hour ago`:i+` hours ago`;let a=Math.floor(i/24);if(a<7)return a===1?`yesterday`:a+` days ago`;let o=new Date(e),s=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][o.getMonth()]+` `+o.getDate();return o.getFullYear()===new Date(t).getFullYear()?s:s+`, `+o.getFullYear()}function i(e,t){let n=new Date(e),r=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],i=n.getHours(),a=n.getMinutes(),o=(i%12==0?12:i%12)+`:`+(a<10?`0`:``)+a+(i<12?` AM`:` PM`),s=r[n.getMonth()]+` `+n.getDate();return(n.getFullYear()===new Date(t).getFullYear()?s:s+`, `+n.getFullYear())+`, `+o}function a(e){let t=e.split(` · `),n={scope:e};if(t.length<2||!/^[a-z][a-z0-9_-]*$/.test(t[0]))return n;n.agent=t[0];let r=t.slice(1),i=r[r.length-1];return r.length>=2&&i.length>=2&&i.charAt(0)===`"`&&i.charAt(i.length-1)===`"`&&(n.snippet=i.slice(1,-1),r=r.slice(0,-1)),n.scope=r.join(` · `),n}function o(){return Date.now()}function s(r,i=1e3){let a=n(r??o()),s=null;return t(()=>{s=setInterval(()=>{a.value=o()},i)}),e(()=>{s&&clearInterval(s)}),a}export{a,r as i,o as n,i as r,s as t};
1
+ import{$n as e,Yn as t,ai as n}from"./seed-B8mQEhhw.js";function r(e,t){let n=t-e;if(!(n>45e3))return`just now`;let r=Math.floor(n/6e4);if(r<60)return r<=1?`1 minute ago`:r+` minutes ago`;let i=Math.floor(r/60);if(i<24)return i===1?`1 hour ago`:i+` hours ago`;let a=Math.floor(i/24);if(a<7)return a===1?`yesterday`:a+` days ago`;let o=new Date(e),s=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][o.getMonth()]+` `+o.getDate();return o.getFullYear()===new Date(t).getFullYear()?s:s+`, `+o.getFullYear()}function i(e,t){let n=new Date(e),r=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],i=n.getHours(),a=n.getMinutes(),o=(i%12==0?12:i%12)+`:`+(a<10?`0`:``)+a+(i<12?` AM`:` PM`),s=r[n.getMonth()]+` `+n.getDate();return(n.getFullYear()===new Date(t).getFullYear()?s:s+`, `+n.getFullYear())+`, `+o}function a(e){let t=e.split(` · `),n={scope:e};if(t.length<2||!/^[a-z][a-z0-9_-]*$/.test(t[0]))return n;n.agent=t[0];let r=t.slice(1),i=r[r.length-1];return r.length>=2&&i.length>=2&&i.charAt(0)===`"`&&i.charAt(i.length-1)===`"`&&(n.snippet=i.slice(1,-1),r=r.slice(0,-1)),n.scope=r.join(` · `),n}function o(){return Date.now()}function s(r,i=1e3){let a=n(r??o()),s=null;return t(()=>{s=setInterval(()=>{a.value=o()},i)}),e(()=>{s&&clearInterval(s)}),a}export{a,r as i,o as n,i as r,s as t};
package/dist/cli.js CHANGED
@@ -1164,7 +1164,7 @@ var init_schedules = __esm({
1164
1164
  name: "resident-watchdog",
1165
1165
  cron: "*/10 * * * *",
1166
1166
  worker: "resident",
1167
- description: "Resident watchdog: re-arm dead refresh alarm chains (marking degraded(alarm-missed)) and time out stuck onboarding. Cadence must stay shorter than the resident SLEEP_AFTER (20m). Not a run.",
1167
+ description: "Resident watchdog: re-arm dead refresh alarm chains (marking degraded(alarm-missed)), time out stuck onboarding, and create the refresh Workflow instance for residents whose lifecycle is `workflow`. Cadence must stay shorter than the resident SLEEP_AFTER (20m). Not a run.",
1168
1168
  action: { type: "watchdog" }
1169
1169
  }
1170
1170
  ];
@@ -1259,7 +1259,8 @@ Maintain the user-facing status card with the update_status tool: right after yo
1259
1259
  Report outcomes faithfully: if tests fail or a step was skipped, say so plainly.
1260
1260
  Your final message is posted to Slack \u2014 keep it readable, lead with the outcome.`;
1261
1261
  REVIEW_VERDICT_INSTRUCTION = `VERDICT: before your final message, call the submit_verdict tool exactly once with \`approve\` (no blocking issues \u2014 nits alone are not blocking) or \`request_changes\`, a one-line summary, \`head\` = the output of \`git rev-parse HEAD\` in the checkout you reviewed, and \`findings\` \u2014 every issue you report as a structured entry with a stable id you assign in order (F1, F2, \u2026), a severity of exactly blocking|major|minor|nit, the file (plus line when it points at one), and a one-line title. The findings array is the index of your review: the full explanation of each finding stays in your prose, keyed by the same ids. Switchboard writes the verdict as the first line of the GitHub comment itself and lists the findings under it; a review with no submitted verdict is posted as not approving, so never skip it. An \`approve\` carrying a blocking finding is downgraded to \`request_changes\` \u2014 approve only when nothing blocking remains. Do not write "LGTM" in your own text \u2014 the verdict line carries it.`;
1262
- REVIEW_SPEC_CHECK = `3. SPEC CONTRADICTION CHECK, when the repository has \`docs/reference/specs/\`: list the specs the change touches \u2014 \`npm run --silent specs:coverage -- --changed origin/<base>...HEAD\` (\`<base>\` is the PR's base branch) when the repository's package.json has that script, otherwise match the changed paths against each spec's \`- **Code**:\` / \`- **Tests**:\` header lines (a header path covers itself and everything beneath it). If the command fails for any reason \u2014 dependencies not installed, tsx missing, a cold checkout \u2014 fall back to matching the header lines by hand; never install dependencies or build to make it run. Then read ONLY those specs, never the whole specs tree \u2014 fold the reads into your gather batch where you can. For each touched spec, judge whether the diff contradicts a numbered behavior statement or a validation criterion: code that now does what the spec says it does not, a criterion whose named test the diff removed or retitled, a behavior the diff deleted that the spec still promises. A contradiction is a finding of severity \`minor\` or higher titled \`Spec contradiction \u2014 <spec file> item <n>: <what the code now does vs what the spec says>\`; a spec updated in the same diff to match the code is not a finding. A repository with no \`docs/reference/specs/\` has nothing to check \u2014 skip this step silently.`;
1262
+ REVIEW_SPEC_CHECK = `3. SPEC CONTRADICTION CHECK, when the repository has \`docs/reference/specs/\`: list the specs the change touches \u2014 \`npm run --silent specs:coverage -- --changed origin/<base>...HEAD\` (\`<base>\` is the PR's base branch) when the repository's package.json has that script, otherwise match the changed paths against each spec's \`- **Code**:\` / \`- **Tests**:\` header lines (a header path covers itself and everything beneath it). If the command fails for any reason \u2014 dependencies not installed, tsx missing, a cold checkout \u2014 fall back to matching the header lines by hand; never install dependencies or build to make it run. Then read ONLY those specs, never the whole specs tree \u2014 fold the reads into your gather batch where you can. For each touched spec, judge whether the diff contradicts a numbered behavior statement or a validation criterion: code that now does what the spec says it does not, a criterion whose named test the diff removed or retitled, a behavior the diff deleted that the spec still promises. A contradiction is a finding of severity \`minor\` or higher titled \`Spec contradiction \u2014 <spec file> item <n>: <what the code now does vs what the spec says>\`; a spec updated in the same diff to match the code is not a finding. A repository with no \`docs/reference/specs/\` has nothing to check \u2014 skip this step silently.
1263
+ 3a. TEST GUARD, in the same repositories: run \`npm run --silent specs:coverage -- --changed origin/<base>...HEAD --test-guard\` (fold it into the same batch). It compares every test file the diff touches at the base and at the head and prints one line per thing lost, in two classes. A \`test-guard: <file> \u2014 removed: \u2026\` line is deterministic \u2014 the test file deleted, an it/test/describe title gone with no new title to pair with, a skip/only/todo marker (\`.skip(\`, \`.only(\`, \`xit(\`, \`xdescribe(\`, \`it.todo(\`, \`test.todo(\`) on a test the base ran \u2014 and each one is a finding of severity \`minor\` or higher titled \`Test removed \u2014 <file>: <what>\` whose explanation quotes the guard's line exactly as printed. A \`test-guard: <file> \u2014 check: \u2026\` line is a heuristic \u2014 fewer \`expect(\` calls in the file, a title gone while another arrived (a rename or a split) \u2014 and you dispose of every one of them explicitly in your review, never silently: either "weakened", which makes it a finding at \`minor\`, or "refactor, verification intact" with one clause saying why. A line ending \`\u2014 allowed by <spec>\` is licensed by a spec change in the same diff and is neither; \`test-guard ok\` is nothing to report. If the command fails for any reason, judge the same facts from the diff by hand \u2014 a deleted test file, a removed title, a new skip marker, fewer assertions \u2014 and file each one the diff does not license the same way; never install or build to make it run.`;
1263
1264
  REVIEW_WHOLE_CHANGE = ` - READ THE WHOLE CHANGE: the REVIEW TARGET block states the PR's size as GitHub reports it (files, +/\u2212) and \`diff_digest\` states the totals of what it covered \u2014 they must agree, and every file the digest lists must be in the diff you read. A tool output ending in \`...[truncated N chars]\` was cut short; when the digest or your diff shows fewer files or lines than the PR, read the rest file by file (\`git diff <base>...HEAD -- <path>\`) until every file is covered. Never judge from a partial diff: Switchboard does not post a verdict whose digest covered less than the PR.`;
1264
1265
  REVIEW_SYSTEM = `You are Switchboard's code review agent, operating from a Slack request.
1265
1266
 
@@ -9170,6 +9171,9 @@ function r2OperationClass(actionType) {
9170
9171
  if (/^(Get|Head|Usage)/.test(a)) return "B";
9171
9172
  return "A";
9172
9173
  }
9174
+ function workflowsCostUsd(steps, stateBytes) {
9175
+ return steps / 1e5 * CLOUDFLARE_PRICES.workflowStepsPer100k + storageDayCostUsd(stateBytes, CLOUDFLARE_PRICES.workflowStorageGbMonth);
9176
+ }
9173
9177
  function r2OperationsCostUsd(actionType, requests) {
9174
9178
  const cls = r2OperationClass(actionType);
9175
9179
  if (cls === "free") return 0;
@@ -9191,7 +9195,18 @@ function attributionOf(cfg, usage) {
9191
9195
  for (const name of bucketNames)
9192
9196
  if (!(name in r2Buckets) && cfg.workers.some((w) => TEMPLATE_BUCKET_NAMES.some((shape) => shape(w) === name)))
9193
9197
  r2Buckets[name] = name;
9194
- return { workers: [...cfg.workers], containerApps: { ...cfg.containerApps }, durableObjectNamespaces, r2Buckets };
9198
+ const workflows = {};
9199
+ for (const name of new Set(usage.workflows.map((r) => r.workflowName).filter(Boolean))) {
9200
+ const host = cfg.workers.find((w) => TEMPLATE_WORKFLOW_NAMES.some((shape) => shape(w) === name));
9201
+ if (host) workflows[name] = host;
9202
+ }
9203
+ return {
9204
+ workers: [...cfg.workers],
9205
+ containerApps: { ...cfg.containerApps },
9206
+ durableObjectNamespaces,
9207
+ r2Buckets,
9208
+ workflows
9209
+ };
9195
9210
  }
9196
9211
  function addDays(iso, n2) {
9197
9212
  const d = /* @__PURE__ */ new Date(`${iso}T00:00:00Z`);
@@ -9208,6 +9223,7 @@ function buildCostReport(group, cfg, usage, llm, range) {
9208
9223
  const workers = new Set(cfg.workers);
9209
9224
  const namespaces = attribution.durableObjectNamespaces;
9210
9225
  const buckets = attribution.r2Buckets;
9226
+ const workflowNames = attribution.workflows;
9211
9227
  const byResource = emptySplit();
9212
9228
  let accountCloudUsd = 0;
9213
9229
  const days = eachDay(range).map((date) => {
@@ -9281,8 +9297,16 @@ function buildCostReport(group, cfg, usage, llm, range) {
9281
9297
  if (row.bucketName in buckets) r2Usd += usd;
9282
9298
  }
9283
9299
  byResource.r2 += r2Usd;
9300
+ let workflowsUsd = 0;
9301
+ for (const row of usage.workflows) {
9302
+ if (row.date !== date) continue;
9303
+ const usd = workflowsCostUsd(row.steps, row.stateBytes);
9304
+ accountCloudUsd += usd;
9305
+ if (row.workflowName in workflowNames) workflowsUsd += usd;
9306
+ }
9307
+ byResource.workflows += workflowsUsd;
9284
9308
  const llmUsd2 = llm && cfg.anthropicWorkspaceId ? llm.filter((r) => r.date === date && r.workspaceId === cfg.anthropicWorkspaceId).reduce((s, r) => s + r.amountUsd, 0) : 0;
9285
- const cloudUsd2 = Object.values(containers).reduce((s, c) => s + c.total, 0) + Object.values(durableObjects).reduce((s, v) => s + v, 0) + doRequestsUsd + doRowsUsd + doStorageUsd + workersUsd + r2Usd;
9309
+ const cloudUsd2 = Object.values(containers).reduce((s, c) => s + c.total, 0) + Object.values(durableObjects).reduce((s, v) => s + v, 0) + doRequestsUsd + doRowsUsd + doStorageUsd + workersUsd + r2Usd + workflowsUsd;
9286
9310
  return {
9287
9311
  date,
9288
9312
  containers,
@@ -9292,6 +9316,7 @@ function buildCostReport(group, cfg, usage, llm, range) {
9292
9316
  doStorageUsd,
9293
9317
  workersUsd,
9294
9318
  r2Usd,
9319
+ workflowsUsd,
9295
9320
  cloudUsd: cloudUsd2,
9296
9321
  llmUsd: llmUsd2,
9297
9322
  total: cloudUsd2 + llmUsd2
@@ -9316,6 +9341,17 @@ function resolveRange(daysParam, now = new Date(systemClock())) {
9316
9341
  const to = now.toISOString().slice(0, 10);
9317
9342
  return { from: addDays(to, -(days - 1)), to, days, partialLastDay: true };
9318
9343
  }
9344
+ function workflowStepsFromEvents(rows) {
9345
+ const byKey = /* @__PURE__ */ new Map();
9346
+ for (const r of rows) {
9347
+ if (!WORKFLOW_STEP_EVENTS.has(r.eventType) || !r.workflowName) continue;
9348
+ const key = `${r.date}\0${r.workflowName}`;
9349
+ const row = byKey.get(key) ?? { date: r.date, workflowName: r.workflowName, steps: 0, stateBytes: 0 };
9350
+ row.steps += r.count;
9351
+ byKey.set(key, row);
9352
+ }
9353
+ return [...byKey.values()];
9354
+ }
9319
9355
  function createCostsService(cfg, cloudflare, llm, now = () => new Date(systemClock())) {
9320
9356
  return {
9321
9357
  groups: () => Object.keys(cfg.groups),
@@ -9328,7 +9364,7 @@ function createCostsService(cfg, cloudflare, llm, now = () => new Date(systemClo
9328
9364
  }
9329
9365
  };
9330
9366
  }
9331
- var DEFAULT_CF_TOKEN_ENV, DEFAULT_ANTHROPIC_ADMIN_ENV, CLOUDFLARE_PRICES, GIB, GB, DAYS_PER_MONTH, TEMPLATE_BUCKET_NAMES, emptySplit, DEFAULT_DAYS, MAX_DAYS, NullLlmCostSource, CF_GRAPHQL, CF_USAGE_QUERY, num, str, CloudflareGraphqlUsageSource, ANTHROPIC_COST_REPORT, ANTHROPIC_VERSION, MAX_COST_PAGES, AnthropicCostReportSource, COSTS_OFF_MESSAGE, NullCostsService;
9367
+ var DEFAULT_CF_TOKEN_ENV, DEFAULT_ANTHROPIC_ADMIN_ENV, CLOUDFLARE_PRICES, GIB, GB, DAYS_PER_MONTH, TEMPLATE_BUCKET_NAMES, TEMPLATE_WORKFLOW_NAMES, emptySplit, DEFAULT_DAYS, MAX_DAYS, NullLlmCostSource, CF_GRAPHQL, CF_USAGE_QUERY, WORKFLOW_STEP_EVENTS, num, str, CloudflareGraphqlUsageSource, ANTHROPIC_COST_REPORT, ANTHROPIC_VERSION, MAX_COST_PAGES, AnthropicCostReportSource, COSTS_OFF_MESSAGE, NullCostsService;
9332
9368
  var init_costs = __esm({
9333
9369
  "../../src/core/costs.ts"() {
9334
9370
  "use strict";
@@ -9353,12 +9389,20 @@ var init_costs = __esm({
9353
9389
  /** R2 Standard: storage $0.015/GB-month, class A $4.50/M, class B $0.36/M, egress free. */
9354
9390
  r2StorageGbMonth: 0.015,
9355
9391
  r2ClassAPerMillion: 4.5,
9356
- r2ClassBPerMillion: 0.36
9392
+ r2ClassBPerMillion: 0.36,
9393
+ /** Workflows (developers.cloudflare.com/workflows/reference/pricing, Workers
9394
+ * Paid): steps "500,000 included per month + $0.80/ additional 100,000",
9395
+ * storage "1 GB-month included + $0.20/ GB-month". The other two line items,
9396
+ * requests and CPU time, "use Workers Standard pricing" and land on the
9397
+ * hosting Worker's own `workersInvocationsAdaptive` row — never re-metered here. */
9398
+ workflowStepsPer100k: 0.8,
9399
+ workflowStorageGbMonth: 0.2
9357
9400
  };
9358
9401
  GIB = 2 ** 30;
9359
9402
  GB = 1e9;
9360
9403
  DAYS_PER_MONTH = 30.4375;
9361
9404
  TEMPLATE_BUCKET_NAMES = [(w) => `${w}-cache`];
9405
+ TEMPLATE_WORKFLOW_NAMES = [(w) => `${w}-refresh`];
9362
9406
  emptySplit = () => ({
9363
9407
  cpu: 0,
9364
9408
  memory: 0,
@@ -9367,7 +9411,8 @@ var init_costs = __esm({
9367
9411
  doRows: 0,
9368
9412
  doStorage: 0,
9369
9413
  workers: 0,
9370
- r2: 0
9414
+ r2: 0,
9415
+ workflows: 0
9371
9416
  });
9372
9417
  DEFAULT_DAYS = 30;
9373
9418
  MAX_DAYS = 90;
@@ -9393,8 +9438,11 @@ var init_costs = __esm({
9393
9438
  max { payloadSize metadataSize } dimensions { date bucketName } }
9394
9439
  r2Operations: r2OperationsAdaptiveGroups(limit: 10000, filter: { datetime_geq: $from, datetime_lt: $to }) {
9395
9440
  sum { requests } dimensions { date bucketName actionType } }
9441
+ workflows: workflowsAdaptiveGroups(limit: 10000, filter: { datetimeHour_geq: $from, datetimeHour_lt: $to }) {
9442
+ count dimensions { date workflowName eventType } }
9396
9443
  } }
9397
9444
  }`;
9445
+ WORKFLOW_STEP_EVENTS = /* @__PURE__ */ new Set(["STEP_SUCCESS", "STEP_FAILURE"]);
9398
9446
  num = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
9399
9447
  str = (v) => typeof v === "string" ? v : "";
9400
9448
  CloudflareGraphqlUsageSource = class {
@@ -9466,7 +9514,15 @@ var init_costs = __esm({
9466
9514
  bucketName: str(r.dimensions?.bucketName),
9467
9515
  actionType: str(r.dimensions?.actionType),
9468
9516
  requests: num(r.sum?.requests)
9469
- }))
9517
+ })),
9518
+ workflows: workflowStepsFromEvents(
9519
+ (account2.workflows ?? []).map((r) => ({
9520
+ date: str(r.dimensions?.date),
9521
+ workflowName: str(r.dimensions?.workflowName),
9522
+ eventType: str(r.dimensions?.eventType),
9523
+ count: num(r.count)
9524
+ }))
9525
+ )
9470
9526
  };
9471
9527
  }
9472
9528
  };
@@ -18663,7 +18719,8 @@ var init_attrs = __esm({
18663
18719
  sealed: "number",
18664
18720
  abandonedRuns: "number",
18665
18721
  residents: "number",
18666
- swept: "number"
18722
+ swept: "number",
18723
+ instanceId: "string"
18667
18724
  };
18668
18725
  ATTR_KEYS = Object.keys(ATTR_TYPE);
18669
18726
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreplane/switchboard",
3
- "version": "1.19.3",
3
+ "version": "1.201.0",
4
4
  "description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://openswitchboard.dev",
@@ -1 +0,0 @@
1
- import{t as e}from"./AppShell-Bk2gbvet.js";import{Pr as t,an as n,bi as r,gn as i,hi as a,in as o,mn as s,on as c,pn as l,qt as u,r as d,rn as f,sn as p,sr as m,tr as h,vi as g,xi as _}from"./seed-BglCRKLA.js";var v=`Durable Objects`,y=`Workers · storage · R2`,b=`LLM (Anthropic)`,x=(e,t=2)=>`$${e.toFixed(t)}`,S=e=>e.workersUsd+e.doRowsUsd+e.doStorageUsd+e.r2Usd;function ee(e){let t=[];for(let n of e.days)for(let e of Object.keys(n.containers))t.includes(e)||t.push(e);return e.days.some(e=>Object.keys(e.durableObjects).length>0)&&t.push(v),e.days.some(e=>S(e)>0)&&t.push(y),e.llmAvailable&&t.push(b),t}function C(e,t){return t===`Durable Objects`?Object.values(e.durableObjects).reduce((e,t)=>e+t,0)+e.doRequestsUsd:t===`Workers · storage · R2`?S(e):t===`LLM (Anthropic)`?e.llmUsd:e.containers[t]?.total??0}function w(e){let t=e.range.partialLastDay?e.days.slice(0,-1):e.days,n=t[t.length-1],r=t.slice(-7),i=r.length?r.reduce((e,t)=>e+t.total,0)/r.length:0,a=e.totals.total>0?Math.round(e.totals.llmUsd/e.totals.total*100):0,o=e.account.cloudUsd>0?Math.round(e.totals.cloudUsd/e.account.cloudUsd*100):0;return{...n?{yesterday:{date:n.date,total:n.total}}:{},avg7:i,projectedMonth:i*30.4,llmShare:a,accountShare:o}}function T(e,t){let n={t:12,r:12,b:30,l:48},r=960-n.l-n.r,i=260-n.t-n.b,a=e.days,o=Math.max(1e-9,...a.map(e=>e.total))*1.08,s=r/Math.max(1,a.length),c=Math.min(10,s*.28),l=e=>n.t+i-e/o*i,u=Array.from({length:5},(e,t)=>{let n=o/4*t;return{y:Number(l(n).toFixed(1)),label:x(n)}}),d=[],f=[];return a.forEach((e,r)=>{let i=0,o=n.l+r*s+c/2,u=s-c;t.forEach((t,n)=>{let r=C(e,t);if(r<=0)return;let a=l(i+r),s=l(i),c=Math.max(0,s-a-2);d.push({seriesIndex:n,x:Number(o.toFixed(1)),y:Number(a.toFixed(1)),width:Number(u.toFixed(1)),height:Number(c.toFixed(1)),title:`${e.date} · ${t} · ${x(r)}`}),i+=r}),(a.length<=16||r%Math.ceil(a.length/16)===0)&&f.push({x:Number((o+u/2).toFixed(1)),label:e.date.slice(5)})}),{width:960,height:260,gridLines:u,segments:d,dayLabels:f,axisY:Number(l(0).toFixed(1)),marginLeft:n.l,marginRight:n.r}}function E(e){let t=e.totals.byResource,n=[[`Memory (provisioned while awake)`,t.memory],[`vCPU (active use only)`,t.cpu],[`Durable Object duration + requests`,t.durableObjects],[`Disk (provisioned while awake)`,t.disk],[`Workers requests + CPU`,t.workers],[`Durable Object SQLite rows`,t.doRows],[`Durable Object SQLite storage`,t.doStorage],[`R2 storage + operations`,t.r2]],r=n.reduce((e,t)=>e+t[1],0)||1;return n.map(([e,t])=>({label:e,usd:t,percent:t/r*100}))}var D=[`fill-[#2a78d6] dark:fill-[#3987e5]`,`fill-[#eb6834] dark:fill-[#d95926]`,`fill-[#1baf7a] dark:fill-[#199e70]`,`fill-[#eda100] dark:fill-[#c98500]`,`fill-[#e87ba4] dark:fill-[#d55181]`,`fill-[#4a3aa7] dark:fill-[#9085e9]`,`fill-[#e34948] dark:fill-[#e66767]`,`fill-[#008300] dark:fill-[#008300]`],O=[`bg-[#2a78d6] dark:bg-[#3987e5]`,`bg-[#eb6834] dark:bg-[#d95926]`,`bg-[#1baf7a] dark:bg-[#199e70]`,`bg-[#eda100] dark:bg-[#c98500]`,`bg-[#e87ba4] dark:bg-[#d55181]`,`bg-[#4a3aa7] dark:bg-[#9085e9]`,`bg-[#e34948] dark:bg-[#e66767]`,`bg-[#008300] dark:bg-[#008300]`],k={class:`overflow-x-auto`},A=[`viewBox`],j=[`x1`,`x2`,`y1`,`y2`],M=[`x`,`y`],N=[`x`,`y`,`width`,`height`],P=[`x`,`y`],F=[`x1`,`x2`,`y1`,`y2`],I=i({__name:`CostChart`,props:{report:{},series:{}},setup(e){let t=e,n=f(()=>T(t.report,t.series));return(e,t)=>(h(),p(`div`,k,[(h(),p(`svg`,{class:`block h-auto w-full`,viewBox:`0 0 ${n.value.width} ${n.value.height}`,role:`img`,"aria-label":`Daily cost, stacked by component`},[(h(!0),p(u,null,m(n.value.gridLines,(e,t)=>(h(),p(u,{key:`g${t}`},[o(`line`,{class:`stroke-(--ui-border-muted)`,x1:n.value.marginLeft,x2:n.value.width-n.value.marginRight,y1:e.y,y2:e.y},null,8,j),o(`text`,{class:`fill-(--ui-text-dimmed) text-[11px] tabular-nums`,x:n.value.marginLeft-8,y:e.y+4,"text-anchor":`end`},_(e.label),9,M)],64))),128)),(h(!0),p(u,null,m(n.value.segments,(e,t)=>(h(),p(`rect`,{key:`s${t}`,class:g([`seg hover:opacity-85`,a(D)[e.seriesIndex%a(D).length]]),x:e.x,y:e.y,width:e.width,height:e.height},[o(`title`,null,_(e.title),1)],10,N))),128)),(h(!0),p(u,null,m(n.value.dayLabels,(e,t)=>(h(),p(`text`,{key:`d${t}`,class:`fill-(--ui-text-dimmed) text-[11px]`,x:e.x,y:n.value.height-10,"text-anchor":`middle`},_(e.label),9,P))),128)),o(`line`,{class:`stroke-(--ui-border)`,x1:n.value.marginLeft,x2:n.value.width-n.value.marginRight,y1:n.value.axisY,y2:n.value.axisY},null,8,F)],8,A))]))}}),L={class:`text-xs text-muted`},R={key:1,class:`text-highlighted`},z=[`href`],B={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},V={key:0,class:`flex items-center gap-1`,"aria-label":`Cost groups`},H={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-semibold text-highlighted`,"aria-current":`page`},U=[`href`],W={class:`text-sm tabular-nums text-muted`},G={class:`mb-5 grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},K={class:`grid gap-0.5 rounded-md border border-default bg-elevated px-4 py-3.5`},q={class:`text-2xl font-medium tabular-nums`},J={class:`text-xs text-muted`},Y={class:`grid gap-0.5 rounded-md border border-default bg-elevated px-4 py-3.5`},X={class:`text-2xl font-medium tabular-nums`},Z={class:`grid gap-0.5 rounded-md border border-default bg-elevated px-4 py-3.5`},Q={class:`text-2xl font-medium tabular-nums`},te={class:`grid gap-0.5 rounded-md border border-default bg-elevated px-4 py-3.5`},ne={class:`text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},re={class:`text-2xl font-medium tabular-nums`},ie={class:`text-xs text-muted`},ae={class:`grid gap-0.5 rounded-md border border-default bg-elevated px-4 py-3.5`},oe={class:`text-2xl font-medium tabular-nums`},se={class:`text-xs text-muted`},ce={class:`mb-5 grid gap-3 rounded-md border border-default bg-elevated px-5 py-4`},le={class:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2`},ue={class:`legend flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted`},de={key:0,class:`text-xs text-warn`},fe={class:`mb-5 grid gap-3 rounded-md border border-default bg-elevated px-5 py-4`},pe={class:`w-full border-collapse text-[0.8125rem] tabular-nums`},me={class:`px-2.5 py-1.5`},he={class:`px-2.5 py-1.5 text-right`},ge={class:`px-2.5 py-1.5 text-right`},_e={class:`w-2/5 px-2.5 py-1.5`},ve={class:`mb-5 grid gap-3 rounded-md border border-default bg-elevated px-5 py-4`},ye={open:``},be={class:`mt-2.5 overflow-x-auto`},$={class:`data w-full min-w-[38rem] border-collapse whitespace-nowrap text-[0.8125rem] tabular-nums`},xe=[`title`],Se={key:0,class:`text-xs text-dimmed`},Ce={class:`border-b border-muted px-2.5 py-1.5 text-right font-semibold`},we={class:`text-xs text-muted`},Te={class:`rounded bg-accented px-1 py-0.5`},Ee={class:`border-t border-default pt-3.5 text-xs text-dimmed`},De={class:`mt-2 grid gap-1.5`},Oe=i({__name:`CostsPage`,setup(i){let v=d(`costs`),y=f(()=>v?.report??null),b=f(()=>v?.groups??[]),S=f(()=>y.value?ee(y.value):[]),T=f(()=>y.value?w(y.value):null),D=f(()=>y.value?E(y.value):[]),k=[7,30,90];function A(e){let t=new Date(`${e}T00:00:00Z`);return Number.isNaN(t.getTime())?e:`${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][t.getUTCMonth()]} ${t.getUTCDate()}`}return(i,d)=>y.value&&T.value?(h(),n(e,{key:0,title:`${y.value.label} spend`,nav:`costs`},{actions:t(()=>[o(`span`,L,[(h(),p(u,null,m(k,(e,t)=>(h(),p(u,{key:e},[t>0?(h(),p(u,{key:0},[l(` · `)],64)):c(``,!0),e===y.value.range.days?(h(),p(`b`,R,_(e)+`d`,1)):(h(),p(`a`,{key:2,class:`text-primary hover:underline`,href:`/costs/${y.value.group}?days=${e}`},_(e)+`d`,9,z))],64))),64))])]),default:t(()=>[o(`div`,B,[b.value.length>1?(h(),p(`nav`,V,[(h(!0),p(u,null,m(b.value,e=>(h(),p(u,{key:e},[e===y.value.group?(h(),p(`span`,H,_(e),1)):(h(),p(`a`,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,href:`/costs/${e}`},_(e),9,U))],64))),128))])):c(``,!0),o(`p`,W,[l(_(A(y.value.range.from))+` → `+_(A(y.value.range.to))+` · `+_(y.value.range.days)+`d`,1),y.value.range.partialLastDay?(h(),p(u,{key:0},[l(` · today partial`)],64)):c(``,!0)])]),o(`section`,G,[o(`div`,K,[d[0]||=o(`span`,{class:`text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Yesterday`,-1),o(`span`,q,_(T.value.yesterday?a(x)(T.value.yesterday.total):`—`),1),o(`span`,J,_(T.value.yesterday?`${T.value.yesterday.date} · last full day`:`no full day in range`),1)]),o(`div`,Y,[d[1]||=o(`span`,{class:`text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`7-day average`,-1),o(`span`,X,_(a(x)(T.value.avg7)),1),d[2]||=o(`span`,{class:`text-xs text-muted`},`per day, full days only`,-1)]),o(`div`,Z,[d[3]||=o(`span`,{class:`text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Projected month`,-1),o(`span`,Q,_(a(x)(T.value.projectedMonth,0)),1),d[4]||=o(`span`,{class:`text-xs text-muted`},`7-day rate × 30.4, before plan fees and included allowances`,-1)]),o(`div`,te,[o(`span`,ne,_(y.value.llmAvailable?`LLM share`:`LLM spend`),1),o(`span`,re,_(y.value.llmAvailable?`${T.value.llmShare}%`:`—`),1),o(`span`,ie,_(y.value.llmAvailable?`of the range total`:`LLM spend not configured`),1)]),o(`div`,ae,[d[5]||=o(`span`,{class:`text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},`Share of account`,-1),o(`span`,oe,_(T.value.accountShare)+`%`,1),o(`span`,se,_(a(x)(y.value.totals.cloudUsd))+` of `+_(a(x)(y.value.account.cloudUsd))+` Cloudflare spend in range`,1)])]),o(`section`,ce,[o(`div`,le,[d[6]||=o(`div`,null,[o(`h2`,{class:`text-[0.9375rem] font-semibold`},`Daily cost`),o(`p`,{class:`text-sm text-muted`},`Stacked by component · USD list price`)],-1),o(`div`,ue,[(h(!0),p(u,null,m(S.value,(e,t)=>(h(),p(`span`,{key:e,class:`inline-flex items-center gap-1.5`},[o(`i`,{class:g([`inline-block size-2.5 rounded-xs`,a(O)[t%a(O).length]])},null,2),l(_(e),1)]))),128))])]),s(I,{report:y.value,series:S.value},null,8,[`report`,`series`]),y.value.llmAvailable?c(``,!0):(h(),p(`p`,de,[...d[7]||=[l(` LLM spend not configured — set `,-1),o(`code`,null,`ANTHROPIC_ADMIN_KEY`,-1),l(` and the group's `,-1),o(`code`,null,`anthropicWorkspaceId`,-1),l(` to layer it in. `,-1)]]))]),o(`section`,fe,[d[8]||=o(`div`,null,[o(`h2`,{class:`text-[0.9375rem] font-semibold`},`What each cloud dollar buys`)],-1),o(`table`,pe,[o(`tbody`,null,[(h(!0),p(u,null,m(D.value,e=>(h(),p(`tr`,{key:e.label,class:`border-b border-muted`},[o(`td`,me,_(e.label),1),o(`td`,he,_(a(x)(e.usd)),1),o(`td`,ge,_(Math.round(e.percent))+`%`,1),o(`td`,_e,[o(`i`,{class:`block h-2.5 rounded-xs bg-primary opacity-75`,style:r({width:`${e.percent.toFixed(1)}%`})},null,4)])]))),128))])])]),o(`section`,ve,[o(`details`,ye,[d[11]||=o(`summary`,{class:`cursor-pointer text-sm text-muted`},`Table view — daily cost by component (USD)`,-1),o(`div`,be,[o(`table`,$,[o(`thead`,null,[o(`tr`,null,[d[9]||=o(`th`,{class:`border-b border-muted px-2.5 py-1.5 text-left text-xs font-medium text-muted`},`Date`,-1),(h(!0),p(u,null,m(S.value,e=>(h(),p(`th`,{key:e,class:`border-b border-muted px-2.5 py-1.5 text-right text-xs font-medium text-muted`},_(e),1))),128)),d[10]||=o(`th`,{class:`border-b border-muted px-2.5 py-1.5 text-right text-xs font-medium text-muted`},`Total`,-1)])]),o(`tbody`,null,[(h(!0),p(u,null,m(y.value.days,e=>(h(),p(`tr`,{key:e.date},[o(`td`,{class:`border-b border-muted px-2.5 py-1.5`,title:e.date},[l(_(A(e.date))+` `,1),y.value.range.partialLastDay&&e.date===y.value.range.to?(h(),p(`span`,Se,`(partial day)`)):c(``,!0)],8,xe),(h(!0),p(u,null,m(S.value,t=>(h(),p(`td`,{key:t,class:`border-b border-muted px-2.5 py-1.5 text-right`},_(a(x)(a(C)(e,t),3)),1))),128)),o(`td`,Ce,_(a(x)(e.total,3)),1)]))),128))])])])]),o(`p`,we,[d[12]||=l(` Machine-readable twin: `,-1),o(`code`,Te,`GET /costs/`+_(y.value.group)+`.json`,1),d[13]||=l(` (same Access gate). `,-1)])]),o(`footer`,Ee,[o(`details`,null,[d[18]||=o(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),o(`div`,De,[d[16]||=o(`div`,null,[o(`b`,null,`Live.`),l(` Both billing sources are read live from this page — nothing cached, nothing stored. Cloudflare bills vCPU on active use only; memory and disk bill on the provisioned size for every second a container is awake. LLM spend is the Anthropic Admin API cost report for this group's workspace (gross, USD). `)],-1),d[17]||=o(`div`,null,[o(`b`,null,`Method.`),l(` Cloudflare GraphQL Analytics, every meter a Workers deployment is billed on: `),o(`code`,null,`containersUsageAdaptiveGroups`),l(` (cpuTimeSec, allocatedMemory, allocatedDisk per app per UTC day), `),o(`code`,null,`durableObjectsPeriodicGroups`),l(` (billable `),o(`code`,null,`duration`),l(` GB-s and SQLite rows read and written per namespace), `),o(`code`,null,`durableObjectsInvocationsAdaptiveGroups`),l(` (requests per namespace), `),o(`code`,null,`durableObjectsSqlStorageGroups`),l(` (bytes stored), `),o(`code`,null,`workersInvocationsAdaptive`),l(` (requests, CPU time), `),o(`code`,null,`r2StorageAdaptiveGroups`),l(` and `),o(`code`,null,`r2OperationsAdaptiveGroups`),l(` (bytes stored, class A/B operations). Prices: vCPU $0.000020/s, memory $0.0000025/GiB-s, disk $0.00000007/GB-s, DO duration $12.50 per million GB-s, DO requests $0.15/M, SQLite rows $0.001/M read and $1.00/M written, DO storage $0.20/GB-month, Workers $0.30/M requests and $0.02/M CPU-ms, R2 $0.015/GB-month, $4.50/M class A and $0.36/M class B (deletes free). Storage is the day's peak, prorated over a 30.44-day month. Gross list price — plan fees and included allowances are not subtracted; Workers Logs volume has no analytics dataset and is not priced. `)],-1),o(`div`,null,[d[14]||=o(`b`,null,`Scope.`,-1),d[15]||=l(` Attributed to this group: the Workers `,-1),o(`code`,null,_(y.value.attribution.workers.join(`, `)),1),l(`, every Durable Object namespace they host (`+_(Object.keys(y.value.attribution.durableObjectNamespaces).length)+`), the R2 buckets named after them (`+_(Object.keys(y.value.attribution.r2Buckets).length)+`), and the container apps mapped in `,1),o(`code`,null,`costs.groups.`+_(y.value.group),1),l(` (`+_(Object.keys(y.value.attribution.containerApps).length)+`). Everything else in the account is priced the same way into the account total, which is what "share of account" divides by. `,1)])])])])]),_:1},8,[`title`])):c(``,!0)}});export{Oe as default};
@@ -1 +0,0 @@
1
- import{t as e,y as t}from"./AppShell-Bk2gbvet.js";import{Pr as n,a as r,an as i,gn as a,hi as o,i as s,in as c,mn as l,r as u,tr as d,xi as f}from"./seed-BglCRKLA.js";import{t as p}from"./RunsTabs-C4krAL9o.js";var m={class:`notfound mx-auto my-12 max-w-xl text-center text-toned`},h={class:`why text-[0.8rem] text-muted`},g=a({__name:`NotFoundPage`,setup(t){let a=u(`runNotFound`),g=s(a?.retentionDays??null);return(t,a)=>{let s=r;return d(),i(e,{title:`Run not found`,nav:`runs`},{default:n(()=>[l(p,{current:`runs`}),c(`section`,m,[a[0]||=c(`p`,{class:`code mb-3 font-mono text-4xl font-semibold tracking-wide text-dimmed`},`404`,-1),a[1]||=c(`h2`,{class:`mb-3 text-lg font-semibold text-highlighted`},`That run isn't here.`,-1),a[2]||=c(`p`,{class:`mb-2.5 leading-relaxed`},` It may have finished and aged out, the link may be missing its token, or it never existed — this page says the same thing in every case. `,-1),c(`p`,h,f(o(g)),1),l(s,{class:`back mt-4`,color:`neutral`,variant:`outline`,to:`/runs`,label:`← All runs`})])]),_:1})}}}),_=t({default:()=>v}),v=g;export{_ as n,v as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./AppShell-Bk2gbvet.js";import{Pr as t,an as n,gn as r,hi as i,in as a,mn as o,on as ee,pn as s,qt as c,r as l,rn as u,sn as d,sr as f,tr as p,xi as m}from"./seed-BglCRKLA.js";import{t as h}from"./StatusDot-DuoQnQeU.js";import{a as te,c as ne,d as re,f as g,i as _,l as ie,n as ae,o as oe,r as se,s as v,t as ce,u as le}from"./residentDiskBudget-BMBKlYRH.js";var ue={class:`mt-4 first:mt-0`},de={class:`w-full border-collapse text-[0.8125rem]`},fe={class:`border-t border-muted`},pe={class:`px-2 py-1 align-top`},me={class:`ml-1.5 font-semibold`},y={class:`border-t border-muted`},b={class:`break-all px-2 py-1 align-top`},x={key:0},S={key:1,class:`text-dimmed`},C={class:`border-t border-muted`},w={class:`break-all px-2 py-1 align-top`},T={key:0},E={key:1,class:`text-dimmed`},D={class:`border-t border-muted`},O={class:`break-all px-2 py-1 align-top`},k={key:0},A={key:1,class:`text-dimmed`},j={class:`border-t border-muted`},M={class:`break-all px-2 py-1 align-top`},N={key:0},P={key:1,class:`text-dimmed`},F={class:`border-t border-muted`},I={class:`break-all px-2 py-1 align-top`},L={key:1,class:`text-dimmed`},R={class:`mt-4`},z={class:`w-full border-collapse text-[0.8125rem]`},he={class:`border-t border-muted`},ge={class:`break-all px-2 py-1 align-top`},_e=[`href`],ve={key:1},ye={class:`border-t border-muted`},be={class:`break-all px-2 py-1 align-top`},xe={class:`border-t border-muted`},Se={class:`break-all px-2 py-1 align-top`},Ce=[`href`],we={key:1},Te={key:2,class:`text-dimmed`},Ee={class:`border-t border-muted`},De={class:`break-all px-2 py-1 align-top`},Oe={key:0},ke={key:1,class:`text-dimmed`},Ae={class:`border-t border-muted`},je={class:`break-all px-2 py-1 align-top`},Me={key:0},Ne={key:1,class:`text-dimmed`},Pe={class:`border-t border-muted`},Fe={class:`break-all px-2 py-1 align-top`},Ie={key:0},Le={key:1,class:`text-dimmed`},Re={class:`mt-4`},ze={class:`w-full border-collapse text-[0.8125rem]`},Be={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Ve={class:`break-all px-2 py-1 align-top`},He={class:`w-full border-collapse text-[0.8125rem]`},Ue={class:`w-32 break-all px-2 py-1 align-top text-muted sm:w-96 sm:break-words`},We={class:`px-2 py-1 align-top`},Ge={key:1,class:`text-xs text-muted`},Ke={class:`mt-4`},qe={key:0,class:`w-full border-collapse text-[0.8125rem]`},Je={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Ye={class:`break-all px-2 py-1 align-top`},Xe={key:0},Ze={key:1,class:`text-dimmed`},B={key:1,class:`text-xs text-muted`},Qe={class:`mt-4`},$e={class:`mb-1 text-xs text-muted`},et={class:`overflow-x-auto`},tt={class:`w-full border-collapse text-[0.8125rem]`},nt={class:`break-all px-2 py-1 align-top`},rt={key:0,class:`text-xs text-muted`},it={class:`break-all px-2 py-1 align-top`},at=[`href`],ot={key:1},st={key:2,class:`text-dimmed`},ct={class:`break-all px-2 py-1 align-top`},lt={key:0},ut={key:1,class:`text-dimmed`},dt={key:2},ft={key:3,class:`text-dimmed`},pt={class:`break-all px-2 py-1 align-top`},mt={key:0},ht={key:1,class:`text-dimmed`},gt={key:2},_t={key:3,class:`text-dimmed`},vt={key:1,class:`text-xs text-muted`},yt={class:`mt-4`},bt={class:`w-full border-collapse text-[0.8125rem]`},xt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},St={class:`px-2 py-1 align-top`},Ct={class:`mt-4`},wt={key:0,class:`w-full border-collapse text-[0.8125rem]`},Tt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Et={class:`break-all px-2 py-1 align-top`},Dt={class:`text-xs text-muted`},Ot={key:1,class:`text-xs text-muted`},kt={class:`mt-4`},At={class:`w-full border-collapse text-[0.8125rem]`},jt={class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},Mt={class:`break-all px-2 py-1 align-top`},Nt={key:0},Pt={key:1,class:`text-dimmed`},Ft={class:`mt-4 text-xs text-muted`},It={class:`rounded bg-elevated px-1 py-0.5`},Lt={class:`rounded bg-elevated px-1 py-0.5`},Rt={class:`rounded bg-elevated px-1 py-0.5`},V=r({__name:`ResidentDetailPage`,setup(r){let V=l(`resident`),H=u(()=>V?.record??{}),U=u(()=>ie(H.value)),W=u(()=>le(H.value)||(V?.slug??``)),G=u(()=>g(U.value.sha)),K=u(()=>oe.test(W.value)?`https://github.com/${W.value}`:void 0),q=u(()=>K.value&&/^[0-9a-f]{7,40}$/.test(G.value)?`${K.value}/commit/${G.value}`:void 0),J=u(()=>{let e=U.value.snapshot;return e&&typeof e==`object`?v(e):void 0}),zt=u(()=>v(U.value.schedules)),Y=u(()=>{let e=v(H.value.commands),t=v(H.value.effects);return Object.keys(e).sort().map(n=>({name:n,command:g(e[n]),effect:g(t[n])||`readonly`}))}),X=u(()=>{let e=U.value.threads;return(Array.isArray(e)?e.map(v):[]).map(e=>{let t=g(e.sha);return{threadKey:g(e.threadKey)||`?`,ref:g(e.ref)||`?`,sha:t?t.slice(0,8):``,commitHref:K.value&&/^[0-9a-f]{7,40}$/.test(t)?`${K.value}/commit/${t}`:void 0,user:g(e.user),deps:g(e.deps),boundAt:g(e.boundAt),lastAttachAt:g(e.lastAttachAt),evicted:e.evicted===!0,evictedAt:g(e.evictedAt),evictedWhy:g(e.evictedWhy)}}).sort((e,t)=>t.lastAttachAt.localeCompare(e.lastAttachAt))}),Z=u(()=>X.value.filter(e=>!e.evicted).length),Q=u(()=>{let e=U.value.lastRestore;return e?JSON.stringify(e):``}),$=u(()=>ne(H.value)),Bt=u(()=>typeof H.value.diskBudgetMb==`number`?H.value.diskBudgetMb:void 0),Vt=u(()=>{let e=$.value;if(!e)return[];let t=ce(e),{freeKiB:n,capped:r,capacityKiB:i}=ae(e,Bt.value),a=n-t.totalKiB,o=t=>{let n=te(e.parts,t);return n===null?`? (checkout not measured)`:n===0?`?`:`${Math.max(0,Math.floor(a/n))} more (${_(n)} each)`};return[[`used / total`,se(e)],[`free`,`${_(n)}${r?` under the ${_(i)} diskBudgetMb cap`:``}`],[`reserve`,`${_(t.totalKiB)} (snapshot staging ${_(t.stagingKiB)} + floor ${_(t.floorKiB)})`],[`headroom`,`${_(Math.max(0,a))} — room for ${o(`hardlink`)} hardlinked trees, ${o(`reconcile`)} lockfile-diverged (reconciling)`],[`measured`,e.at||`—`]]}),Ht=u(()=>{let e=$.value;if(!e)return[];let t=[[`mirror`,_(e.parts.mirror)],[`checkout deps (node_modules)`,_(e.parts.deps)],[`checkout (history + tree + build)`,_(e.parts.checkout)]];for(let[n,r]of Object.entries(e.parts.threads).sort((e,t)=>t[1]-e[1]))t.push([`thread ${n}`,_(r)]);for(let[n,r]of Object.entries(e.parts.homes).sort((e,t)=>t[1]-e[1]))r>=1024&&t.push([`home ${n}`,_(r)]);return t.push([`other (image, /tmp, …)`,_(e.parts.other)]),t});return(r,l)=>(p(),n(e,{title:W.value||`Resident`,nav:`residents`},{leading:t(()=>[...l[0]||=[a(`a`,{class:`back text-sm text-muted no-underline hover:text-primary`,href:`/residents`},`← All residents`,-1)]]),default:t(()=>[a(`section`,ue,[l[8]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Lifecycle`,-1),a(`table`,de,[a(`tbody`,null,[a(`tr`,fe,[l[1]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state`,-1),a(`td`,pe,[o(h,{tone:i(re)(U.value.state),label:U.value.state},null,8,[`tone`,`label`]),a(`span`,me,m(U.value.state),1)])]),a(`tr`,y,[l[2]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`reason`,-1),a(`td`,b,[U.value.reason?(p(),d(`span`,x,m(U.value.reason),1)):(p(),d(`span`,S,`—`))])]),a(`tr`,C,[l[3]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh error`,-1),a(`td`,w,[i(g)(U.value.lastRefreshError)?(p(),d(`span`,T,m(i(g)(U.value.lastRefreshError)),1)):(p(),d(`span`,E,`—`))])]),a(`tr`,D,[l[4]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last restore`,-1),a(`td`,O,[Q.value?(p(),d(`span`,k,m(Q.value),1)):(p(),d(`span`,A,`—`))])]),a(`tr`,j,[l[5]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`state updated`,-1),a(`td`,M,[i(g)(U.value.updatedAt)?(p(),d(`span`,N,m(i(g)(U.value.updatedAt)),1)):(p(),d(`span`,P,`—`))])]),a(`tr`,F,[l[7]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`idle since`,-1),a(`td`,I,[i(g)(U.value.idleSince)?(p(),d(c,{key:0},[s(m(i(g)(U.value.idleSince))+` `,1),l[6]||=a(`span`,{class:`text-xs text-muted`},`(refresh parked; container may sleep)`,-1)],64)):(p(),d(`span`,L,`awake`))])])])])]),a(`section`,R,[l[15]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Pinned facts`,-1),a(`table`,z,[a(`tbody`,null,[a(`tr`,he,[l[9]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`repository`,-1),a(`td`,ge,[K.value?(p(),d(`a`,{key:0,class:`text-primary`,href:K.value},m(K.value),9,_e)):(p(),d(`span`,ve,m(i(g)(H.value.resource)||`—`),1))])]),a(`tr`,ye,[l[10]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`default ref`,-1),a(`td`,be,m(i(g)(U.value.defaultRef)||i(g)(H.value.defaultRef)||`—`),1)]),a(`tr`,xe,[l[11]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`pinned sha`,-1),a(`td`,Se,[q.value?(p(),d(`a`,{key:0,class:`text-primary`,href:q.value},m(G.value),9,Ce)):G.value?(p(),d(`span`,we,m(G.value),1)):(p(),d(`span`,Te,`—`))])]),a(`tr`,Ee,[l[12]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`lockfile hash`,-1),a(`td`,De,[i(g)(U.value.lockfileHash)?(p(),d(`span`,Oe,m(i(g)(U.value.lockfileHash)),1)):(p(),d(`span`,ke,`—`))])]),a(`tr`,Ae,[l[13]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`provisioned`,-1),a(`td`,je,[i(g)(U.value.provisionedAt)?(p(),d(`span`,Me,m(i(g)(U.value.provisionedAt)),1)):(p(),d(`span`,Ne,`—`))])]),a(`tr`,Pe,[l[14]||=a(`td`,{class:`w-32 px-2 py-1 align-top text-muted sm:w-48 sm:whitespace-nowrap`},`last refresh`,-1),a(`td`,Fe,[i(g)(U.value.lastRefreshAt)?(p(),d(`span`,Ie,m(i(g)(U.value.lastRefreshAt)),1)):(p(),d(`span`,Le,`—`))])])])])]),a(`section`,Re,[l[17]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Disk`,-1),$.value?(p(),d(c,{key:0},[a(`table`,ze,[a(`tbody`,null,[(p(!0),d(c,null,f(Vt.value,([e,t])=>(p(),d(`tr`,{key:e,class:`border-t border-muted`},[a(`td`,Be,m(e),1),a(`td`,Ve,m(t),1)]))),128))])]),l[16]||=a(`p`,{class:`mb-1 mt-2 text-xs text-muted`},` components (one du, hardlinks counted once — a thread tree shows only what it does not share with the checkout) `,-1),a(`table`,He,[a(`tbody`,null,[(p(!0),d(c,null,f(Ht.value,([e,t])=>(p(),d(`tr`,{key:e,class:`border-t border-muted`},[a(`td`,Ue,m(e),1),a(`td`,We,m(t),1)]))),128))])])],64)):(p(),d(`p`,Ge,` not measured yet — the first refresh cycle or attach of this container measures it `))]),a(`section`,Ke,[l[18]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Snapshot stamp`,-1),J.value?(p(),d(`table`,qe,[a(`tbody`,null,[(p(),d(c,null,f([`ref`,`sha`,`lockfileHash`,`createdAt`,`mirrorBackupId`,`checkoutBackupId`],e=>a(`tr`,{key:e,class:`border-t border-muted`},[a(`td`,Je,m(e),1),a(`td`,Ye,[i(g)(J.value[e])?(p(),d(`span`,Xe,m(i(g)(J.value[e])),1)):(p(),d(`span`,Ze,`—`))])])),64))])])):(p(),d(`p`,B,`no snapshot recorded`))]),a(`section`,Qe,[l[22]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Thread worktrees`,-1),X.value.length>0?(p(),d(c,{key:0},[a(`p`,$e,m(Z.value)+` live · `+m(X.value.length-Z.value)+` evicted`,1),a(`div`,et,[a(`table`,tt,[a(`tbody`,null,[l[21]||=a(`tr`,{class:`text-xs text-muted`},[a(`td`,{class:`px-2 py-1`},`thread`),a(`td`,{class:`px-2 py-1`},`ref · sha`),a(`td`,{class:`px-2 py-1`},`user · deps`),a(`td`,{class:`px-2 py-1`},`bound · last attach`)],-1),(p(!0),d(c,null,f(X.value,e=>(p(),d(`tr`,{key:e.threadKey,class:`border-t border-muted`},[a(`td`,nt,[e.evicted?(p(),d(`span`,rt,[s(`evicted `+m(e.evictedAt||`—`),1),e.evictedWhy?(p(),d(c,{key:0},[s(` · `+m(e.evictedWhy),1)],64)):ee(``,!0)])):(p(),n(h,{key:1,tone:`green`,label:`live`,tip:`live`})),s(` `+m(e.threadKey),1)]),a(`td`,it,[s(m(e.ref)+` · `,1),e.commitHref?(p(),d(`a`,{key:0,class:`text-primary`,href:e.commitHref},m(e.sha),9,at)):e.sha?(p(),d(`span`,ot,m(e.sha),1)):(p(),d(`span`,st,`—`))]),a(`td`,ct,[e.user?(p(),d(`span`,lt,m(e.user),1)):(p(),d(`span`,ut,`—`)),l[19]||=s(` · `,-1),e.deps?(p(),d(`span`,dt,m(e.deps),1)):(p(),d(`span`,ft,`—`))]),a(`td`,pt,[e.boundAt?(p(),d(`span`,mt,m(e.boundAt),1)):(p(),d(`span`,ht,`—`)),l[20]||=s(` · `,-1),e.lastAttachAt?(p(),d(`span`,gt,m(e.lastAttachAt),1)):(p(),d(`span`,_t,`—`))])]))),128))])])])],64)):(p(),d(`p`,vt,`no thread worktrees`))]),a(`section`,yt,[l[23]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Pending schedules`,-1),a(`table`,bt,[a(`tbody`,null,[(p(),d(c,null,f([[`refresh`,`refresh`],[`provision run`,`provisionRun`],[`provision deadline`,`provisionDeadline`]],([e,t])=>a(`tr`,{key:t,class:`border-t border-muted`},[a(`td`,xt,m(e),1),a(`td`,St,m(i(g)(zt.value[t]??0)||`0`),1)])),64))])])]),a(`section`,Ct,[l[25]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Command table`,-1),Y.value.length>0?(p(),d(`table`,wt,[a(`tbody`,null,[(p(!0),d(c,null,f(Y.value,e=>(p(),d(`tr`,{key:e.name,class:`border-t border-muted`},[a(`td`,Tt,m(e.name),1),a(`td`,Et,[a(`code`,null,m(e.command),1),l[24]||=s(),a(`span`,Dt,m(e.effect),1)])]))),128))])])):(p(),d(`p`,Ot,`no command table`))]),a(`section`,kt,[l[26]||=a(`h2`,{class:`mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted`},`Registry settings`,-1),a(`table`,At,[a(`tbody`,null,[(p(!0),d(c,null,f([[`onboarded`,i(g)(H.value.onboardedAt)],[`record updated`,i(g)(H.value.updatedAt)],[`provisioning timeout (ms)`,i(g)(H.value.provisioningTimeoutMs)],[`disk budget (MB)`,i(g)(H.value.diskBudgetMb)],[`worktree TTL (days)`,i(g)(H.value.worktreeTtlDays??7)]],([e,t])=>(p(),d(`tr`,{key:e,class:`border-t border-muted`},[a(`td`,jt,m(e),1),a(`td`,Mt,[t?(p(),d(`span`,Nt,m(t),1)):(p(),d(`span`,Pt,`—`))])]))),128))])])]),a(`p`,Ft,[l[27]||=s(` Manage from chat: `,-1),a(`code`,It,`repo rebuild `+m(W.value),1),l[28]||=s(` · `,-1),a(`code`,Lt,`repo reconfigure `+m(W.value)+` …`,1),l[29]||=s(` · `,-1),a(`code`,Rt,`repo offboard `+m(W.value)+` --dry-run`,1)])]),_:1},8,[`title`]))}});export{V as default};
@@ -1 +0,0 @@
1
- import{t as e}from"./AppShell-Bk2gbvet.js";import{Pr as t,an as n,dr as r,gn as i,in as a,mn as o,on as s,pn as c,qt as l,r as u,rn as d,sn as f,sr as p,tr as m,vi as h,xi as g}from"./seed-BglCRKLA.js";import{t as _}from"./StatusDot-DuoQnQeU.js";import{c as v,d as y,f as b,l as x,o as S,r as C,u as w}from"./residentDiskBudget-BMBKlYRH.js";import{i as T,n as E}from"./wallClock-Ckv3sKoR.js";var D={class:`mb-2 text-xs text-muted`},O={class:`m-0 list-none p-0`},k={class:`font-semibold text-primary`},A={class:`font-semibold`},j=[`title`],M=[`title`],N={key:0,class:`basis-full pl-5 text-xs text-warning`},P={key:1,class:`px-2 py-1.5 text-muted`},F=i({__name:`ResidentsIndexPage`,setup(i){let F=u(`residents`),I=E(),L=d(()=>(F?.residents??[]).map((e,t)=>{let n=e,r=w(n),i=x(n),a=b(i.sha),o=b(i.lastRefreshAt),s=o?Date.parse(o):NaN,c=v(n);return{key:`${r||`?`}-${t}`,display:r||b(n.resource)||`?`,state:i.state,tone:y(i.state),reason:i.reason,ref:b(n.defaultRef)||`?`,sha:a?a.slice(0,8):``,refreshed:o,refreshedLabel:Number.isFinite(s)?T(s,I):o,disk:c?C(c):``,diskAt:c?.at??``,href:S.test(r)?`/residents/${r}`:null}})),R=d(()=>b(F?.cap)||`?`),z=d(()=>b(F?.count)||String(L.value.length));return(i,u)=>(m(),n(e,{title:`Resident repos`,nav:`residents`},{default:t(()=>[L.value.length>0?(m(),f(l,{key:0},[a(`p`,D,g(z.value)+`/`+g(R.value)+` resident slots in use · live registry read, not cached `,1),a(`ul`,O,[(m(!0),f(l,null,p(L.value,e=>(m(),f(`li`,{key:e.key,class:`border-b border-muted first:border-t`},[(m(),n(r(e.href?`a`:`span`),{class:h([`row flex flex-wrap items-center gap-2.5 rounded-md px-2 py-1.5 text-inherit no-underline`,e.href?`hover:bg-elevated`:``]),href:e.href??void 0},{default:t(()=>[o(_,{tone:e.tone,label:e.state,tip:e.state},null,8,[`tone`,`label`,`tip`]),a(`span`,k,g(e.display),1),a(`span`,A,g(e.state),1),a(`span`,{class:`text-xs text-muted max-sm:basis-full max-sm:pl-5`,title:e.refreshed||void 0},[c(` ref `+g(e.ref),1),e.sha?(m(),f(l,{key:0},[c(` · sha `+g(e.sha),1)],64)):s(``,!0),e.refreshedLabel?(m(),f(l,{key:1},[c(` · refreshed `+g(e.refreshedLabel),1)],64)):s(``,!0),e.disk?(m(),f(l,{key:2},[u[0]||=c(` · `,-1),a(`span`,{title:e.diskAt?`measured ${e.diskAt}`:void 0},`disk `+g(e.disk),9,M)],64)):s(``,!0)],8,j),e.reason?(m(),f(`span`,N,g(e.reason),1)):s(``,!0)]),_:2},1032,[`class`,`href`]))]))),128))])],64)):(m(),f(`p`,P,[c(` No repos onboarded (0/`+g(R.value)+`). Onboard one from chat: `,1),u[1]||=a(`code`,{class:`rounded bg-elevated px-1.5 py-0.5`},`repo onboard <owner/name>`,-1),u[2]||=c(`. `,-1)]))]),_:1}))}});export{F as default};
@@ -1 +0,0 @@
1
- import{a as e,n as t,t as n}from"./AppShell-Bk2gbvet.js";import{$n as r,Pr as i,Yn as a,a as o,ai as s,an as c,bi as l,gn as u,hi as d,i as f,in as p,kr as m,mn as h,on as g,pn as _,qt as v,r as y,ri as b,rn as x,sn as S,sr as C,tr as w,vi as T,xi as E}from"./seed-BglCRKLA.js";import{t as D}from"./Tooltip-BfLPyxQy.js";import{t as O}from"./RunsTabs-C4krAL9o.js";import{t as k}from"./StatusDot-DuoQnQeU.js";import{a as A,i as j,r as ee,t as M}from"./wallClock-Ckv3sKoR.js";import{C as N,E as P,O as F,S as I,T as L,_ as R,a as z,b as B,c as V,d as H,f as U,g as W,h as G,i as K,j as q,k as J,l as te,m as ne,n as Y,o as X,p as Z,s as re,t as Q,u as ie,v as ae,w as oe,x as se,y as ce}from"./favicon-DL1rdWJt.js";import{t as le}from"./localIso-L06jV29p.js";var $={class:`flex items-baseline gap-1.5 whitespace-pre-line px-2 py-1 text-xs`},ue={key:1,class:`text-dimmed`},de=[`data-kind`,`aria-label`,`href`],fe=[`data-kind`,`aria-label`],pe=u({__name:`SourceMark`,props:{kind:{},tip:{},url:{}},setup(e){let t=e,n=()=>K[t.kind]??`○`,r=()=>z[t.kind]??t.kind;return(t,a)=>{let o=D;return w(),c(o,null,{content:i(()=>[p(`span`,$,[e.kind===`slack`?(w(),c(q,{key:0})):d(K)[e.kind]?(w(),S(`span`,ue,E(n()),1)):g(``,!0),p(`span`,null,E(e.tip),1)])]),default:i(()=>[e.url?(w(),S(`a`,{key:0,class:`source linked pointer-events-auto w-[1.6em] shrink-0 rounded border border-transparent text-center text-[0.8rem] text-toned opacity-0 transition-opacity hover:border-primary/30 hover:bg-primary/10 hover:text-primary focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"data-kind":e.kind,"aria-label":`open the ${r()} thread (new tab)`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`↗`,8,de)):(w(),S(`span`,{key:1,class:T([`source pointer-events-auto w-[1.6em] shrink-0 text-center text-[0.8rem] text-dimmed opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,e.kind===`cli`?`text-[0.7rem]`:``]),"data-kind":e.kind,"aria-label":`source: ${r()}`},E(n()),11,fe))]),_:1})}}}),me=[`data-run-id`,`data-started-at`,`data-persisted`,`data-expires-at`],he=[`href`,`aria-label`],ge={class:`pointer-events-auto flex items-center max-sm:order-1`},_e=[`data-agent-hue`],ve=[`href`],ye={key:3,class:`snippet min-w-0 truncate text-muted max-sm:order-6 max-sm:basis-full max-sm:whitespace-normal max-sm:pl-5 max-sm:text-[0.8rem] max-sm:leading-snug max-sm:line-clamp-2 sm:flex-1`},be={class:`hidden sm:contents`},xe={class:`expires pointer-events-auto shrink-0 text-xs tabular-nums text-warn max-sm:order-11`},Se=[`data-heat`],Ce={class:`count shrink-0 text-right text-xs tabular-nums max-sm:order-9 max-sm:text-dimmed sm:min-w-[6em] sm:text-muted`},we={class:`actions hidden min-w-[7.6em] shrink-0 justify-end gap-1.5 whitespace-nowrap sm:flex`},Te=u({__name:`RunRow`,props:{run:{},now:{},retentionMs:{}},setup(n){let r=n,a=x(()=>A(r.run.label||R(r.run.id))),s=x(()=>ne(r.run,a.value.scope)),u=x(()=>ce(r.run)),f=x(()=>G(r.run)),m=x(()=>oe(r.run)),_=x(()=>W(r.run)),y=x(()=>H(r.run,r.retentionMs)),C=x(()=>y.value!==void 0&&y.value-r.now<=864e5),O=x(()=>!r.run.finished&&!r.run.stop),M=x(()=>F(r.run.finished&&typeof r.run.finishedAt==`number`?r.run.finishedAt-r.run.startedAt:void 0,`run`)),P=x(()=>J(M.value)),U=x(()=>r.run.finished&&r.run.status&&r.run.status!==`completed`?B(r.run.status):``),K=x(()=>r.run.stop&&!(r.run.finished&&r.run.status)?N(r.run.stop):``),q={coding:`text-ok bg-ok/8 border-ok/25`,review:`text-review bg-review/8 border-review/25`,research:`text-research bg-research/8 border-research/25`,general:`text-info bg-info/8 border-info/25`,other:`text-toned bg-accented/60 border-accented`},Y=b({soft:!1,hard:!1}),Z=x(()=>[..._.value?[{label:`Open ${z[m.value.kind]??m.value.kind} thread`,icon:`i-lucide-external-link`,to:_.value,target:`_blank`}]:[],...O.value?[{label:`Stop (soft)`,icon:`i-lucide-octagon-pause`,onSelect:()=>Q(`soft`)},{label:`Kill (hard)`,icon:`i-lucide-octagon-x`,color:`error`,onSelect:()=>Q(`hard`)}]:[]]);function Q(e){(e!==`hard`||t.confirm(`Hard stop: abort this run now with no summary and free its sandbox?`))&&(Y[e]=!0,fetch(I(r.run,e),{method:`POST`,credentials:`same-origin`}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>{Y[e]=!1}))}function $(e){e.target?.closest(`a, button`)||t.navigate(f.value)}return(t,r)=>{let b=D,x=o,A=e;return w(),S(`li`,{class:T([`run group relative rounded-md border-b border-muted hover:bg-(--ui-bg-muted) focus-within:bg-(--ui-bg-muted)`,[n.run.finished?`finished`:`live`,C.value?`leaving`:``]]),"data-run-id":n.run.id,"data-started-at":String(n.run.startedAt),"data-persisted":n.run.persisted?`1`:void 0,"data-expires-at":y.value===void 0?void 0:String(y.value),onClick:$},[p(`a`,{class:`row absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary`,href:f.value,"aria-label":`open run ${n.run.label||d(R)(n.run.id)}`},null,8,he),p(`div`,{class:T([`body pointer-events-none relative z-[1] flex min-w-0 flex-wrap items-center gap-x-2.5 px-2 max-sm:gap-y-1.5 max-sm:py-3 sm:flex-nowrap sm:py-2`,[n.run.finished?`text-muted`:``,C.value?`opacity-85`:``]])},[p(`span`,ge,[h(k,{tone:u.value,label:d(se)(n.run),tip:d(te)(n.run),pulse:!n.run.finished},null,8,[`tone`,`label`,`tip`,`pulse`])]),h(b,{text:d(L)(n.run),ui:{text:`whitespace-pre-line`}},{default:i(()=>[p(`span`,{class:T([`when pointer-events-auto shrink-0 tabular-nums max-sm:order-7 max-sm:pl-5 max-sm:text-xs max-sm:text-dimmed sm:min-w-[8.5em] sm:text-[0.8rem]`,n.run.finished?`text-dimmed`:`text-muted`])},E(d(j)(n.run.startedAt,n.now)),3)]),_:1},8,[`text`]),a.value.agent?(w(),S(`span`,{key:0,class:T([`agent shrink-0 rounded border px-1.5 text-[0.68rem] font-semibold uppercase tracking-wider max-sm:order-2`,[q[d(X)(a.value.agent)],n.run.finished?`opacity-55`:``]]),"data-agent-hue":d(X)(a.value.agent)},E(a.value.agent),11,_e)):g(``,!0),s.value?(w(),c(b,{key:1,text:s.value},{default:i(()=>[p(`a`,{class:`repo pointer-events-auto min-w-0 shrink-0 rounded border border-accented bg-accented/50 px-1.5 text-[0.72rem] font-semibold leading-normal text-toned no-underline hover:border-(--ui-text-dimmed) hover:text-highlighted max-sm:order-3`,href:`https://github.com/${s.value}`,target:`_blank`,rel:`noopener noreferrer`},E(s.value.slice(s.value.indexOf(`/`)+1)),9,ve)]),_:1},8,[`text`])):(w(),S(`span`,{key:2,class:T([`scope min-w-0 shrink-0 truncate font-semibold max-sm:order-3`,n.run.finished?`text-toned`:`text-highlighted`])},E(a.value.scope),3)),a.value.snippet===void 0?g(``,!0):(w(),S(`span`,ye,E(a.value.snippet),1)),U.value?(w(),S(`span`,{key:4,class:T([`outcome shrink-0 rounded border px-1.5 text-[0.7rem] max-sm:order-10`,u.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},E(U.value),3)):g(``,!0),K.value?(w(),S(`span`,{key:5,class:T([`stopbadge shrink-0 rounded border px-1.5 text-[0.7rem] max-sm:order-10`,n.run.stop?.state===`stopped`?`border-accented text-muted`:`border-warn/30 text-warn`])},E(K.value),3)):g(``,!0),p(`span`,be,[h(pe,{kind:m.value.kind,tip:d(ae)(n.run),url:_.value||void 0},null,8,[`kind`,`tip`,`url`])]),C.value&&y.value!==void 0?(w(),c(b,{key:6,text:`removed at ${d(le)(y.value)}`},{default:i(()=>[p(`span`,xe,`gone `+E(d(ee)(y.value,n.now)),1)]),_:1},8,[`text`])):g(``,!0),h(b,{text:n.run.finished?`start to finish`:`running for`},{default:i(()=>[p(`span`,{class:T([`elapsed pointer-events-auto ml-auto shrink-0 text-right text-xs tabular-nums max-sm:order-4 sm:min-w-[4.5em]`,n.run.finished?[P.value?`heat`:`text-muted`,M.value.level>=2?`font-medium`:``]:`text-ok`]),style:l(n.run.finished?P.value:void 0),"data-heat":n.run.finished?M.value.level:void 0},E(d(ie)(n.run,n.now)),15,Se)]),_:1},8,[`text`]),r[2]||=p(`span`,{class:`hidden text-xs text-dimmed max-sm:order-8 max-sm:inline`,"aria-hidden":`true`},`·`,-1),h(b,{text:d(V)(n.run)},{default:i(()=>[p(`span`,Ce,E(d(re)(n.run)),1)]),_:1},8,[`text`]),p(`span`,we,[O.value?(w(),S(v,{key:0},[h(b,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:i(()=>[h(x,{class:`pointer-events-auto`,size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:Y.soft,onClick:r[0]||=e=>Q(`soft`)},null,8,[`disabled`])]),_:1}),h(b,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:i(()=>[h(x,{class:`pointer-events-auto`,size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:Y.hard,onClick:r[1]||=e=>Q(`hard`)},null,8,[`disabled`])]),_:1})],64)):g(``,!0)]),Z.value.length>0?(w(),c(A,{key:7,items:Z.value,content:{align:`end`}},{default:i(()=>[h(x,{class:`pointer-events-auto -my-1.5 -mr-1 max-sm:order-5 sm:hidden`,size:`md`,color:`neutral`,variant:`ghost`,icon:`i-lucide-ellipsis-vertical`,"aria-label":`Run actions`})]),_:1},8,[`items`])):g(``,!0)],2)],10,me)}}}),Ee={class:`conn flex items-center gap-1.5`},De={id:`state`,class:`text-xs text-muted`},Oe={class:`toolbar mb-1.5 flex items-center gap-4 px-2 text-xs text-muted`},ke={id:`livecount`,class:`count tabular-nums`},Ae={class:`filter ml-auto inline-flex items-center gap-1.5`},je={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},Me=[`checked`],Ne={id:`retention`,class:`sr-only`},Pe={key:0,class:`banner mb-3 rounded-md border border-warn px-2.5 py-1.5 text-[0.8rem] text-warn`,role:`status`},Fe={id:`runs`,class:`m-0 list-none border-t border-muted p-0`},Ie={key:0,id:`leaving`,class:`divider flex items-baseline gap-2 border-b border-dashed border-warn/40 px-2 pb-1.5 pt-3 text-[0.72rem] uppercase tracking-wider text-warn`,role:`separator`},Le={key:1,id:`empty`,class:`empty px-2 py-2 text-muted`},Re={key:1,class:`pager mt-3 flex items-baseline gap-2 px-2 text-[0.8rem] text-muted`,"aria-label":`Completed runs pages`},ze={class:`range tabular-nums text-dimmed`},Be=[`href`],Ve=u({__name:`RunsIndexPage`,setup(e){let o=y(`runs`),l=o?.all??!1,u=o?.olderThan!==void 0,T=o?.retentionDays??null,A=T===null?void 0:T*864e5,j=f(T),N=b(new Map);for(let e of o?.rows??[])N.set(e.id,e);let F=M(o?.now),I=s({tone:`amber`,text:`connecting…`}),L=x(()=>[...N.values()].sort((e,t)=>t.startedAt-e.startedAt)),R=x(()=>L.value.filter(e=>!e.finished).length),z=x(()=>A===void 0?-1:L.value.findIndex(e=>{let t=H(e,A);return t!==void 0&&t-F.value<=864e5})),B=x(()=>z.value===-1?L.value:L.value.slice(0,z.value)),V=x(()=>z.value===-1?[]:L.value.slice(z.value)),W=l?`All runs`:`Live runs`;m(R,e=>{t.setTitle((e>0?`(${e}) `:``)+W),t.setFavicon(e>0?Y:Q)},{immediate:!0});function G(e){t.navigate(e.target.checked?`/runs?all=1`:`/runs`)}let K=x(()=>o?.olderThan===void 0?``:ee(o.olderThan,F.value)),q=P(),J=null;return a(()=>{J=q(l?`/runs?stream=1&all=1`:`/runs?stream=1`);let e=!1;J.onopen=()=>{if(e){t.reload();return}e=!0,I.value={tone:`green`,text:`connected`}},J.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t.type===`removed`?t.id:t.run?.id,r=n?N.get(n):void 0;if(u&&!r)return;let i=U(t,l,r?.persisted===!0);i.op===`upsert`?N.set(i.run.id,Z(N.get(i.run.id),i.run)):i.op===`remove`&&N.delete(i.id)},J.onerror=()=>{J&&J.readyState===2?I.value={tone:`red`,text:`disconnected`}:I.value={tone:`amber`,text:`connecting…`}}}),r(()=>{J?.close()}),(e,t)=>{let r=D;return w(),c(n,{title:d(W),nav:`runs`},{status:i(()=>[p(`span`,Ee,[h(k,{tone:I.value.tone,label:I.value.text},null,8,[`tone`,`label`]),p(`span`,De,E(I.value.text),1)])]),default:i(()=>[h(O,{current:`runs`}),p(`div`,Oe,[p(`span`,ke,E(R.value)+` running`,1),p(`span`,Ae,[p(`label`,je,[p(`input`,{id:`showdone`,type:`checkbox`,class:`accent-green-600`,checked:d(l),"aria-describedby":`retention`,onChange:G},null,40,Me),t[0]||=_(` Show completed `,-1)]),h(r,{text:d(j)},{default:i(()=>[...t[1]||=[p(`span`,{class:`help inline-flex size-[1.1em] cursor-help items-center justify-center rounded-full border border-accented text-[0.7rem] leading-none text-dimmed hover:border-(--ui-text-dimmed) hover:text-toned`,tabindex:`0`},`?`,-1)]]),_:1},8,[`text`]),p(`span`,Ne,E(d(j)),1)])]),d(o)?.storeUnavailable?(w(),S(`p`,Pe,E(d(o).storeUnavailable),1)):g(``,!0),p(`ul`,Fe,[(w(!0),S(v,null,C(B.value,e=>(w(),c(Te,{key:e.id,run:e,now:d(F),"retention-ms":d(A)},null,8,[`run`,`now`,`retention-ms`]))),128)),V.value.length>0?(w(),S(`li`,Ie,[...t[2]||=[p(`span`,{"aria-hidden":`true`,class:`text-sm tracking-normal`},`⏳`,-1),p(`span`,{class:`whitespace-nowrap`},`Leaving within a day`,-1),p(`span`,{class:`normal-case tracking-normal text-dimmed max-sm:hidden`},`— each row says when it is removed`,-1)]])):g(``,!0),(w(!0),S(v,null,C(V.value,e=>(w(),c(Te,{key:e.id,run:e,now:d(F),"retention-ms":d(A)},null,8,[`run`,`now`,`retention-ms`]))),128)),L.value.length===0?(w(),S(`li`,Le,E(d(l)?`No runs.`:`No active runs.`),1)):g(``,!0)]),d(l)&&(d(o)?.olderHref||d(o)?.olderThan!==void 0)?(w(),S(`nav`,Re,[d(o)?.olderThan===void 0?g(``,!0):(w(),S(v,{key:0},[t[3]||=p(`a`,{class:`text-primary hover:underline`,href:`/runs?all=1`},`← Newest runs`,-1),p(`span`,ze,`· runs finished before `+E(K.value),1)],64)),d(o)?.olderHref?(w(),S(`a`,{key:1,class:`older ml-auto text-primary hover:underline`,href:d(o).olderHref},`Older runs →`,8,Be)):g(``,!0)])):g(``,!0)]),_:1},8,[`title`])}}});export{Ve as default};
@@ -1 +0,0 @@
1
- import{t as e}from"./AppShell-Bk2gbvet.js";import{Pr as t,an as n,gn as r,hi as i,in as a,mn as o,on as s,pn as c,qt as l,r as u,rn as d,sn as f,sr as p,tr as m,vi as h,xi as g}from"./seed-BglCRKLA.js";import{t as _}from"./Tooltip-BfLPyxQy.js";import{t as ee}from"./RunsTabs-C4krAL9o.js";import{n as v,r as y}from"./wallClock-Ckv3sKoR.js";import{t as b}from"./localIso-L06jV29p.js";function x(e,t){return{kind:`schedule`,id:`schedule:${e}`,grants:t}}x(`self-improvement`,Object.freeze({actions:new Set([`friction:read`,`friction:write`]),channels:`all`,repos:new Set}));function S(e,t){let n=e-t,r=Math.floor(Math.abs(n)/6e4),i=Math.floor(r/60),a=Math.floor(i/24),o=a>0?`${a}d ${i%24}h`:i>0?`${i}h ${r%60}m`:r>0?`${r}m`:`<1m`;return n>=0?`in ${o}`:`${o} ago`}var C={healthz:`container health check`,watchdog:`resident watchdog`},w={completed:`succeeded`,failed:`failed`,stopped_soft:`stopped early`,stopped_hard:`killed`,"no-run":`no run created`,"ingress-error":`ingress error`,misconfigured:`misconfigured — nothing ran`},T={completed:`ok`,failed:`bad`,stopped_soft:`warn`,stopped_hard:`warn`,"no-run":`warn`,"ingress-error":`bad`,misconfigured:`bad`},E=120;function D(e){let t=e.replace(/\s+/g,` `).trim();return t=t.replace(/^[^\p{L}\p{N}*_`<[(]+/u,``),t=t.replace(/^\*[^*]{1,60}\*\s+[—–-]\s+/,``),t=t.replace(/^[^\p{L}\p{N}]+/u,``).trim(),t.length>E?`${t.slice(0,E)}…`:t}var O={key:0,class:`px-2 py-1.5 text-muted`},k={key:1,id:`scheduled`,"aria-label":`Scheduled jobs`},A={class:`m-0 list-none p-0`},j=[`data-schedule`],M={class:`def flex flex-wrap items-baseline gap-x-2 gap-y-1.5 text-[0.8rem] text-toned`},N={class:`name font-semibold text-highlighted max-sm:text-[0.9rem]`},P={class:`max-sm:ml-auto`},F={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},te={class:`max-sm:flex max-sm:basis-full max-sm:flex-wrap max-sm:items-baseline max-sm:gap-2 sm:contents`},I={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},L={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},R={key:1,class:`text-dimmed`},z={class:`max-sm:flex max-sm:basis-full max-sm:flex-wrap max-sm:items-baseline max-sm:gap-2 sm:contents`},B={class:`rounded-xs bg-accented px-1.5 py-0.5 text-toned`},V=[`title`],H={class:`max-sm:hidden`},U={class:`font-medium text-highlighted`},W={class:`text-dimmed`},G={class:`text-toned sm:hidden`},K={key:1,class:`text-dimmed`},q={class:`fire mt-1.5 text-xs text-muted max-sm:flex max-sm:flex-wrap max-sm:items-baseline max-sm:gap-x-1.5 max-sm:gap-y-1 sm:overflow-hidden sm:text-ellipsis sm:whitespace-nowrap`},J=[`title`],Y=[`href`],X=[`title`],Z=[`title`],Q={key:1,class:`text-dimmed`},ne={key:0,class:`mt-2.5 px-2 text-xs text-muted`},$=r({__name:`ScheduledPage`,setup(r){let x=u(`scheduled`),E=d(()=>x?.now??v()),$=d(()=>x?.rows??null),re={ok:`text-ok`,bad:`text-bad`,warn:`text-warn`};return(r,u)=>{let d=_;return m(),n(e,{title:`Scheduled runs`,nav:`runs`},{default:t(()=>[o(ee,{current:`scheduled`}),$.value===null?(m(),f(`p`,O,`No schedule registry configured.`)):(m(),f(`section`,k,[a(`ul`,A,[(m(!0),f(l,null,p($.value,e=>(m(),f(`li`,{key:e.name,class:`border-b border-muted px-2 pb-3 pt-2.5`,"data-schedule":e.name},[a(`div`,M,[o(d,{text:e.description},{default:t(()=>[a(`span`,N,g(e.name),1)]),_:2},1032,[`text`]),u[5]||=a(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),a(`span`,P,[u[0]||=a(`span`,{class:`mr-1 text-[0.62rem] uppercase tracking-wider text-dimmed`},`on`,-1),a(`code`,F,g(e.worker),1)]),u[6]||=a(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),a(`span`,te,[e.action.type===`run`?(m(),f(l,{key:0},[a(`code`,I,g(e.action.command),1),u[1]||=a(`span`,{class:`text-dimmed`},`as`,-1),a(`code`,L,g(e.action.identity),1)],64)):(m(),f(`span`,R,g(i(C)[e.action.type])+` — not a run`,1))]),u[7]||=a(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),a(`span`,z,[a(`code`,B,g(e.cron),1),u[3]||=a(`span`,{class:`text-dimmed`},`UTC`,-1),u[4]||=a(`span`,{class:`hidden text-accented sm:inline`,"aria-hidden":`true`},`·`,-1),a(`span`,{class:`next tabular-nums max-sm:ml-auto`,title:e.nextFireAt===void 0?void 0:i(b)(e.nextFireAt)},[u[2]||=a(`span`,{class:`mr-1 text-[0.62rem] uppercase tracking-wider text-dimmed`},`next`,-1),e.nextFireAt===void 0?(m(),f(`span`,K,`never`)):(m(),f(l,{key:0},[a(`span`,H,[a(`b`,U,g(i(y)(e.nextFireAt,E.value)),1),a(`span`,W,` (`+g(i(S)(e.nextFireAt,E.value))+`)`,1)]),a(`span`,G,g(i(S)(e.nextFireAt,E.value)),1)],64))],8,V)])]),a(`div`,q,[u[12]||=a(`span`,{class:`mr-1 text-[0.62rem] uppercase tracking-wider text-dimmed`},`last`,-1),e.last?(m(),f(l,{key:0},[a(`span`,{class:h([`outcome`,re[i(T)[e.last.outcome]]])},g(i(w)[e.last.outcome]),3),u[11]||=a(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),a(`span`,{class:`when text-toned`,title:i(b)(e.last.firedAt)},g(i(S)(e.last.firedAt,E.value)),9,J),e.last.runId?(m(),f(l,{key:0},[u[8]||=a(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),e.last.runHref?(m(),f(`a`,{key:0,class:`text-primary hover:underline`,href:e.last.runHref},`run `+g(e.last.runId.slice(0,8)),9,Y)):(m(),f(l,{key:1},[c(`run `+g(e.last.runId.slice(0,8)),1)],64))],64)):s(``,!0),e.last.traceId?(m(),f(l,{key:1},[u[9]||=a(`span`,{class:`mx-1.5 text-accented max-sm:mx-0`,"aria-hidden":`true`},`·`,-1),a(`span`,{class:`trace font-mono text-dimmed`,title:`trace ${e.last.traceId}`},`trace `+g(e.last.traceId.slice(0,8)),9,X)],64)):s(``,!0),e.last.detail&&i(D)(e.last.detail)?(m(),f(l,{key:2},[u[10]||=a(`span`,{class:`mx-1.5 text-accented max-sm:hidden`,"aria-hidden":`true`},`·`,-1),a(`span`,{class:`detail max-sm:line-clamp-2 max-sm:basis-full max-sm:whitespace-normal`,title:e.last.detail},g(i(D)(e.last.detail)),9,Z)],64)):s(``,!0)],64)):(m(),f(`span`,Q,g(i(x)?.firingsUnavailable?`unknown`:`never fired`),1))])],8,j))),128))]),i(x)?.firingsUnavailable?(m(),f(`p`,ne,` Firing history unavailable: `+g(i(x).firingsUnavailable),1)):s(``,!0)]))]),_:1})}}});export{$ as default};
@@ -1 +0,0 @@
1
- import{Pr as e,an as t,gn as n,in as r,sn as i,tr as a,vi as o}from"./seed-BglCRKLA.js";import{t as s}from"./Tooltip-BfLPyxQy.js";var c=[`aria-label`,`data-tone`],l=[`aria-label`,`data-tone`],u=n({__name:`StatusDot`,props:{tone:{},label:{},tip:{},pulse:{type:Boolean}},setup(n){let u={green:`bg-green-600`,amber:`bg-yellow-600`,red:`bg-red-500`,grey:`bg-neutral-500`};return(d,f)=>{let p=s;return n.tip?(a(),t(p,{key:0,text:n.tip},{default:e(()=>[r(`span`,{class:o([`inline-block size-[0.6em] shrink-0 rounded-full`,[u[n.tone],n.pulse?`motion-safe:animate-pulse`:``]]),role:`img`,"aria-label":n.label,"data-tone":n.tone},null,10,c)]),_:1},8,[`text`])):(a(),i(`span`,{key:1,class:o([`inline-block size-[0.6em] shrink-0 rounded-full`,[u[n.tone],n.pulse?`motion-safe:animate-pulse`:``]]),role:`img`,"aria-label":n.label,"data-tone":n.tone},null,10,l))}}});export{u as t};