@tekmidian/pai 1.0.3 → 1.0.5

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 (147) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/{auto-route-B7Yu6Uam.mjs → auto-route-DUYr57rs.mjs} +2 -2
  3. package/dist/auto-route-DWYK_0i0.mjs +11 -0
  4. package/dist/budget-DX-VIWGf.mjs +15 -0
  5. package/dist/{caller-identity-yLFb7CKq.mjs → caller-identity-Bim8JT-D.mjs} +3 -3
  6. package/dist/{capacity-DEveQdFV.mjs → capacity-CsZMkVyg.mjs} +7 -4
  7. package/dist/{chain-7n9Gx56r.mjs → chain-Dzz6xcKH.mjs} +5 -5
  8. package/dist/cli/index.mjs +114 -208
  9. package/dist/{cockpit-actions-BBHeyEZI.mjs → cockpit-actions-BTA1njMO.mjs} +31 -25
  10. package/dist/{cockpit-actions-DR9X514g.mjs → cockpit-actions-BgsiNcUY.mjs} +18 -18
  11. package/dist/cockpit-memory-DIrNs4xr.mjs +20 -0
  12. package/dist/config/defaults/config.yaml +9 -0
  13. package/dist/{config-XpZWOYOG.mjs → config-CST2uq1v.mjs} +29 -4
  14. package/dist/{config-Bu1_vbY8.mjs → config-DYbyEe4-.mjs} +2 -2
  15. package/dist/{config-DtENJ6cL.mjs → config-Dv3t7xnT.mjs} +1 -1
  16. package/dist/config-h5qK3fst.mjs +4 -0
  17. package/dist/{controls-CPoeudou.mjs → controls-OiVVbe-f.mjs} +18 -16
  18. package/dist/daemon/index.mjs +38 -37
  19. package/dist/{daemon-DPAo6WTa.mjs → daemon-C1dycZ3W.mjs} +35 -29
  20. package/dist/daemon-ieo0lnpq.mjs +46 -0
  21. package/dist/daemon-mcp/index.mjs +35 -35
  22. package/dist/detect-C0ZBXqDL.mjs +10 -0
  23. package/dist/{detect-9CZNO0yf.mjs → detect-CHuxFrLy.mjs} +2 -2
  24. package/dist/{embed-pass-DIWjA68P.mjs → embed-pass-DtVF2fOV.mjs} +4 -4
  25. package/dist/{embedding-gate-Cnk4YCyX.mjs → embedding-gate-B98PK_wz.mjs} +2 -2
  26. package/dist/{embedding-gate-6rZrWRXa.mjs → embedding-gate-CTAk8STe.mjs} +2 -2
  27. package/dist/{endreason-C577xIQz.mjs → endreason-BqyyU7BH.mjs} +20 -6
  28. package/dist/{factory-DjAAsqr_.mjs → factory-BV0MQA3T.mjs} +4 -4
  29. package/dist/{factory-Bsib-qDG.mjs → factory-DeASMV7Z.mjs} +4 -4
  30. package/dist/{fallback-DFlItw1Z.mjs → fallback-Bj2cyVk_.mjs} +230 -8
  31. package/dist/{health-Dnym-qcT.mjs → health-kufVIf6i.mjs} +4 -4
  32. package/dist/{helpers-BD6V-p9w.mjs → helpers-CvbYEKoD.mjs} +2 -2
  33. package/dist/{helpers-CMGjy_0N.mjs → helpers-WV8tdQHM.mjs} +5 -5
  34. package/dist/hooks/block-sleep-poll.mjs +1 -1
  35. package/dist/hooks/capture-all-events.mjs +21 -2
  36. package/dist/hooks/capture-tool-output.mjs +21 -2
  37. package/dist/hooks/load-project-context.mjs +7 -7
  38. package/dist/hooks/local-model-hint.mjs +1 -1
  39. package/dist/hooks/route-agents-to-worker.mjs +1 -1
  40. package/dist/hooks/security-validator.mjs +2 -2
  41. package/dist/hooks/worker-edit-repair.mjs +2 -2
  42. package/dist/hooks/worker-guard.mjs +8 -8
  43. package/dist/hooks/worker-note.mjs +2 -2
  44. package/dist/hooks/worker-pool-host.mjs +158 -55
  45. package/dist/hooks/worker-proxy.mjs +1 -1
  46. package/dist/hooks/worker-status-line.mjs +50 -22
  47. package/dist/hooks/worker-supervision.mjs +1 -1
  48. package/dist/hooks/worker-tool-name-repair.mjs +2 -2
  49. package/dist/index.mjs +8 -8
  50. package/dist/{indexer-backend-Cll7le4P.mjs → indexer-backend-B2vtFl38.mjs} +37 -234
  51. package/dist/{ipc-client-CaiGJnSM.mjs → ipc-client-CnYEF31R.mjs} +1 -1
  52. package/dist/{ipc-client-ZRmDKd5Z.mjs → ipc-client-DN7EvoVo.mjs} +1 -1
  53. package/dist/kill-tree-CXZ0WfVf.mjs +10 -0
  54. package/dist/{kill-tree-EWYaEk5v.mjs → kill-tree-CcpsRLCZ.mjs} +7 -7
  55. package/dist/{launch-Jh5NVeNe.mjs → launch-DpQPZGsT.mjs} +3 -3
  56. package/dist/{launch-CXVlZjHt.mjs → launch-UPQBoW2q.mjs} +3 -3
  57. package/dist/{local-candidate-DLdwQt0s.mjs → local-candidate-Cp_bw4kK.mjs} +3 -3
  58. package/dist/{local-instances-ZeRkkuS5.mjs → local-instances-B-c-CxzP.mjs} +4 -4
  59. package/dist/{local-instances-DOxSgT_L.mjs → local-instances-bdCNNSsL.mjs} +2 -2
  60. package/dist/{local-tiers-BE4jGaMa.mjs → local-tiers-BtdEEe5n.mjs} +2 -2
  61. package/dist/{local-tiers-DNMI5W86.mjs → local-tiers-OBqAAfOg.mjs} +3 -3
  62. package/dist/{main-config-ops-BEMpuhDz.mjs → main-config-ops-BYsK3BxM.mjs} +3 -3
  63. package/dist/{main-resolver-3Ns1HPmS.mjs → main-resolver-CAC3xfZM.mjs} +17 -17
  64. package/dist/{model-inventory-BFVSNFT3.mjs → model-inventory-BuTpi9a6.mjs} +13 -13
  65. package/dist/{models-add-C1QIc1DA.mjs → models-add-CJx2YAwh.mjs} +37 -36
  66. package/dist/operator-Bpxq_WB5.mjs +7 -0
  67. package/dist/{operator-CyuB3aVw.mjs → operator-DrwWItVt.mjs} +2 -2
  68. package/dist/{pai-marker-BcZyJguM.mjs → pai-marker-DLKJ9Yr5.mjs} +2 -2
  69. package/dist/{pane-audit-DKQt71s4.mjs → pane-audit-wv9UkyCe.mjs} +27 -9
  70. package/dist/{paths-CFHTloSe.mjs → paths-DBd78I7Z.mjs} +3 -3
  71. package/dist/{paths-CHifubDh.mjs → paths-DS5VQKoR.mjs} +3 -3
  72. package/dist/{planner-BmFACdLa.mjs → planner-K0mFrCpL.mjs} +28 -28
  73. package/dist/{pool-Dh-q3iJi.mjs → pool-BZ94nFuq.mjs} +2 -2
  74. package/dist/{pool-cli-BggU8GRp.mjs → pool-cli-B1eKySeN.mjs} +5 -5
  75. package/dist/{pool-cli-DQ6OzRy2.mjs → pool-cli-BjYQDfx6.mjs} +6 -6
  76. package/dist/{postgres-C6ti4haA.mjs → postgres-C-T5OWer.mjs} +19 -9
  77. package/dist/{postgres-BdBNkL_l.mjs → postgres-CBHY5PIi.mjs} +3 -3
  78. package/dist/{project-setup-jvfONJTQ.mjs → project-setup-pIPHZaXf.mjs} +26 -246
  79. package/dist/{providers-CblTFrhz.mjs → providers-Dzx5GAUI.mjs} +6 -6
  80. package/dist/providers-QJzpaNhX.mjs +16 -0
  81. package/dist/{query-feedback-BRfPtqki.mjs → query-feedback-DN52N9C5.mjs} +1 -1
  82. package/dist/{registrable-DpyTtajg.mjs → registrable-CXBBpUcz.mjs} +4 -4
  83. package/dist/registrable-Drn8wIDO.mjs +9 -0
  84. package/dist/render-C4KR8qQ8.mjs +13 -0
  85. package/dist/{render-BYmQkuLd.mjs → render-Cz3BWIBO.mjs} +8 -8
  86. package/dist/root-Bfb1zgwE.mjs +36 -0
  87. package/dist/{root-Xglu0OPD.mjs → root-bG48WVpW.mjs} +10 -10
  88. package/dist/route-table-ZVMNBsy7.mjs +15 -0
  89. package/dist/{routing-BAAST9vT.mjs → routing-BlD_tKjW.mjs} +136 -18
  90. package/dist/{routing-CENt4HH1.mjs → routing-D27jxj9x.mjs} +13 -13
  91. package/dist/{run-CSC7mgPf.mjs → run-AZVwceiU.mjs} +49 -27
  92. package/dist/{scan-C_Y5W9py.mjs → scan-C3uotg_f.mjs} +5 -5
  93. package/dist/{scope-D-h6F6DN.mjs → scope-D8HK6vU7.mjs} +4 -4
  94. package/dist/{session-8iqQDkqb.mjs → session-BAfypQb9.mjs} +26 -26
  95. package/dist/session-BcnhepLZ.mjs +35 -0
  96. package/dist/{session-scan-W-gbwJHM.mjs → session-scan-BmnjSReu.mjs} +5 -5
  97. package/dist/session-scan-CqUQdCac.mjs +9 -0
  98. package/dist/session-usage-oycSdiD3.mjs +337 -0
  99. package/dist/{sources-ESUkZaWv.mjs → sources-CiE3rZek.mjs} +1 -1
  100. package/dist/{status-ggJ7lgVg.mjs → status-COtzewKV.mjs} +3 -3
  101. package/dist/{status-Dm4dYciN.mjs → status-D_SWmOlH.mjs} +4 -4
  102. package/dist/{tool-errors-CJWODvlo.mjs → tool-errors-B2LnIqR0.mjs} +6 -6
  103. package/dist/{tool-errors-7E13StWd.mjs → tool-errors-DXJ70-sr.mjs} +2 -2
  104. package/dist/{viewer-mDXUNHNy.mjs → viewer-BgGRqXfD.mjs} +14 -14
  105. package/dist/viewer-CbGN2Ri4.mjs +22 -0
  106. package/dist/{wait-ByV0OyMZ.mjs → wait-ChpHKJZV.mjs} +3 -3
  107. package/dist/worker-config-D1KVAMp4.mjs +42 -0
  108. package/dist/{worker-config-CJhEMk19.mjs → worker-config-DgdT0iTB.mjs} +443 -40
  109. package/dist/workers-config-BhZBrR-Q.mjs +4 -0
  110. package/dist/{worktree-CRs2gyg0.mjs → worktree-BY--Rgmy.mjs} +5 -5
  111. package/dist/{zettelkasten-B_rRRRvD.mjs → zettelkasten-BHVx5zj-.mjs} +4 -4
  112. package/dist/{zettelkasten-BzMm8REH.mjs → zettelkasten-LoH9RBiN.mjs} +2 -2
  113. package/docs/cockpit.md +1 -0
  114. package/docs/commands/README.md +1 -0
  115. package/docs/commands/config.md +20 -0
  116. package/gemini-extension.json +1 -1
  117. package/package.json +1 -1
  118. package/pai-plugin.json +1 -1
  119. package/plugins/context-preservation/plugin.json +1 -1
  120. package/plugins/core/plugin.json +1 -1
  121. package/plugins/creative/plugin.json +1 -1
  122. package/plugins/observability/plugin.json +1 -1
  123. package/plugins/productivity/plugin.json +1 -1
  124. package/plugins/semantic-search/plugin.json +1 -1
  125. package/plugins/ui/plugin.json +1 -1
  126. package/plugins/zettelkasten/plugin.json +1 -1
  127. package/src/hooks/ts/capture-all-events.ts +15 -3
  128. package/src/hooks/ts/lib/raw-capture.ts +7 -0
  129. package/src/hooks/ts/post-tool-use/capture-tool-output.ts +13 -3
  130. package/dist/auto-route-CjjQqU1o.mjs +0 -11
  131. package/dist/budget-Dod6rnA9.mjs +0 -15
  132. package/dist/cockpit-memory--dnShXBA.mjs +0 -20
  133. package/dist/config-Cxi-aBf4.mjs +0 -4
  134. package/dist/daemon-DKdBNKfa.mjs +0 -45
  135. package/dist/detect-D1ziFFfA.mjs +0 -10
  136. package/dist/kill-tree-BG7dRVtp.mjs +0 -10
  137. package/dist/operator-BTqvTIc8.mjs +0 -7
  138. package/dist/providers-BeDiVEb-.mjs +0 -16
  139. package/dist/registrable-BzH4TObg.mjs +0 -9
  140. package/dist/render-CoMvwMPs.mjs +0 -13
  141. package/dist/root-FtJsxYnm.mjs +0 -36
  142. package/dist/route-table-B7zpoypi.mjs +0 -15
  143. package/dist/session-BeqAbNPd.mjs +0 -35
  144. package/dist/session-scan-BJI_ZO8M.mjs +0 -9
  145. package/dist/viewer-CqozWW39.mjs +0 -22
  146. package/dist/worker-config-DESkIjMF.mjs +0 -41
  147. package/dist/workers-config-f8KrkY4L.mjs +0 -4
@@ -1,17 +1,17 @@
1
1
  import { g as paiHomePath, h as paiHomeDir } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { Et as parseLedger, j as readWorkersSection, t as ANTHROPIC_NATIVE, tt as workersYamlPath, wt as appendLedger } from "./config-XpZWOYOG.mjs";
3
- import { c as loadConfig, f as readMainConfigRaw, h as effectiveMainConfig, m as deepMergeConfig, p as writeMainConfigRaw, u as paiConfigFilePath, y as shippedMainDefaults } from "./config-Bu1_vbY8.mjs";
4
- import { i as ledgerPath, u as workersLogDir } from "./paths-CHifubDh.mjs";
5
- import { it as readInventory } from "./routing-BAAST9vT.mjs";
6
- import { _ as readLocalConfig } from "./local-tiers-BE4jGaMa.mjs";
2
+ import { Et as appendLedger, M as readWorkersSection, Ot as parseLedger, rt as workersYamlPath, t as ANTHROPIC_NATIVE } from "./config-CST2uq1v.mjs";
3
+ import { c as loadConfig, f as readMainConfigRaw, h as effectiveMainConfig, m as deepMergeConfig, p as writeMainConfigRaw, u as paiConfigFilePath, y as shippedMainDefaults } from "./config-DYbyEe4-.mjs";
4
+ import { i as ledgerPath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
+ import { it as readInventory } from "./routing-BlD_tKjW.mjs";
6
+ import { _ as readLocalConfig } from "./local-tiers-BtdEEe5n.mjs";
7
7
  import { f as sharedScheduler } from "./scheduler-CtUyWJ3O.mjs";
8
- import { r as instanceEngineKey } from "./local-instances-DOxSgT_L.mjs";
9
- import { o as primaryLocal, s as readLocalStatus } from "./local-candidate-DLdwQt0s.mjs";
8
+ import { r as instanceEngineKey } from "./local-instances-bdCNNSsL.mjs";
9
+ import { o as primaryLocal, s as readLocalStatus } from "./local-candidate-Cp_bw4kK.mjs";
10
10
  import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
11
- import { f as setClass } from "./providers-CblTFrhz.mjs";
12
- import { o as setConfigValueOp, s as unsetConfigValueOp } from "./main-config-ops-BEMpuhDz.mjs";
13
- import { n as PaiClient } from "./ipc-client-CaiGJnSM.mjs";
14
- import { l as readEmbedPasses } from "./embed-pass-DIWjA68P.mjs";
11
+ import { f as setClass } from "./providers-Dzx5GAUI.mjs";
12
+ import { o as setConfigValueOp, s as unsetConfigValueOp } from "./main-config-ops-BYsK3BxM.mjs";
13
+ import { n as PaiClient } from "./ipc-client-CnYEF31R.mjs";
14
+ import { l as readEmbedPasses } from "./embed-pass-DtVF2fOV.mjs";
15
15
  import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, rmdirSync, statSync, writeFileSync } from "node:fs";
16
16
  import { randomBytes } from "node:crypto";
17
17
  import { dirname, join } from "node:path";
@@ -329,6 +329,7 @@ const SHIPPED = {
329
329
  dailyDays: 14,
330
330
  sessionsRows: 20,
331
331
  sessionsTopRows: 10,
332
+ sessionDetailTurns: 200,
332
333
  sessionNameMaxPct: 35,
333
334
  workerRows: 15,
334
335
  lowRequestMin: 5,
@@ -342,6 +343,8 @@ const SHIPPED = {
342
343
  jobPollMs: 5e3,
343
344
  jobFirstDelayMs: 2e3,
344
345
  jobMaxTries: 120,
346
+ concurrencyMin: 1,
347
+ concurrencyMax: 16,
345
348
  serverCounterStaleSecs: 60,
346
349
  gaugeWarnPct: 70,
347
350
  gaugeBadPct: 90,
@@ -397,6 +400,7 @@ function cockpitLayout() {
397
400
  dailyDays: num(s, "dailyDays", SHIPPED.dailyDays),
398
401
  sessionsRows: num(s, "sessionsRows", SHIPPED.sessionsRows),
399
402
  sessionsTopRows: num(s, "sessionsTopRows", SHIPPED.sessionsTopRows),
403
+ sessionDetailTurns: num(s, "sessionDetailTurns", SHIPPED.sessionDetailTurns),
400
404
  sessionNameMaxPct: num(s, "sessionNameMaxPct", SHIPPED.sessionNameMaxPct),
401
405
  workerRows: num(s, "workerRows", SHIPPED.workerRows),
402
406
  lowRequestMin: numZ(s, "lowRequestMin", SHIPPED.lowRequestMin),
@@ -410,6 +414,8 @@ function cockpitLayout() {
410
414
  jobPollMs: num(s, "jobPollMs", SHIPPED.jobPollMs),
411
415
  jobFirstDelayMs: numZ(s, "jobFirstDelayMs", SHIPPED.jobFirstDelayMs),
412
416
  jobMaxTries: num(s, "jobMaxTries", SHIPPED.jobMaxTries),
417
+ concurrencyMin: num(s, "concurrencyMin", SHIPPED.concurrencyMin),
418
+ concurrencyMax: num(s, "concurrencyMax", SHIPPED.concurrencyMax),
413
419
  serverCounterStaleSecs: num(s, "serverCounterStaleSecs", SHIPPED.serverCounterStaleSecs),
414
420
  gaugeWarnPct: numZ(s, "gaugeWarnPct", SHIPPED.gaugeWarnPct),
415
421
  gaugeBadPct: numZ(s, "gaugeBadPct", SHIPPED.gaugeBadPct),
@@ -1273,23 +1279,23 @@ function defaultDeps() {
1273
1279
  const logDir = workersLogDir(workers);
1274
1280
  return {
1275
1281
  startTier: async (tierName) => {
1276
- const { startTier } = await import("./worker-config-DESkIjMF.mjs");
1282
+ const { startTier } = await import("./worker-config-D1KVAMp4.mjs");
1277
1283
  const cfg = readLocalConfig(workersYamlPath());
1278
1284
  const tier = cfg.tiers[tierName];
1279
1285
  if (!tier) throw new Error(`no tier "${tierName}" (configured: ${Object.keys(cfg.tiers).join(", ") || "none"})`);
1280
1286
  await startTier(cfg, tierName, tier);
1281
1287
  },
1282
1288
  stopAll: async () => {
1283
- const { stopAll } = await import("./worker-config-DESkIjMF.mjs");
1289
+ const { stopAll } = await import("./worker-config-D1KVAMp4.mjs");
1284
1290
  await stopAll(readLocalConfig(workersYamlPath()));
1285
1291
  },
1286
1292
  startModel: async (model) => {
1287
- const { startInstance } = await import("./worker-config-DESkIjMF.mjs");
1293
+ const { startInstance } = await import("./worker-config-D1KVAMp4.mjs");
1288
1294
  await startInstance(readLocalConfig(workersYamlPath()), model);
1289
1295
  },
1290
1296
  stopModel: async (target, opts) => {
1291
- const { stopInstance } = await import("./worker-config-DESkIjMF.mjs");
1292
- const { currentInstances } = await import("./worker-config-DESkIjMF.mjs");
1297
+ const { stopInstance } = await import("./worker-config-D1KVAMp4.mjs");
1298
+ const { currentInstances } = await import("./worker-config-D1KVAMp4.mjs");
1293
1299
  const cfg = readLocalConfig(workersYamlPath());
1294
1300
  const keys = new Map(currentInstances(cfg).map((r) => [r.id, instanceEngineKey(r)]));
1295
1301
  await stopInstance(cfg, target, opts, {
@@ -1298,7 +1304,7 @@ function defaultDeps() {
1298
1304
  });
1299
1305
  },
1300
1306
  runningCount: async (model) => {
1301
- const { currentInstances } = await import("./worker-config-DESkIjMF.mjs");
1307
+ const { currentInstances } = await import("./worker-config-D1KVAMp4.mjs");
1302
1308
  return currentInstances(readLocalConfig(workersYamlPath())).filter((r) => r.model === model && r.state !== "failed").length;
1303
1309
  },
1304
1310
  setClass: (cls, target) => void setClass(cls, target),
@@ -1582,7 +1588,7 @@ async function runCockpitAction(body, deps, hooks = {}) {
1582
1588
  if (action === "route.set") {
1583
1589
  if (!target) return fail("target (tier) required");
1584
1590
  try {
1585
- const { setRoute } = await import("./route-table-B7zpoypi.mjs");
1591
+ const { setRoute } = await import("./route-table-ZVMNBsy7.mjs");
1586
1592
  const models = Array.isArray(body.models) ? body.models : value !== void 0 ? value.split(",") : body.models;
1587
1593
  const change = setRoute(target, models, deps.configPath);
1588
1594
  writeLedgerLine(deps, action, change.id, `set:${change.entries.join(">")}`);
@@ -1599,7 +1605,7 @@ async function runCockpitAction(body, deps, hooks = {}) {
1599
1605
  if (value !== "on" && value !== "off") return fail(`value must be on or off, got "${value ?? ""}"`);
1600
1606
  if (!deps.workers.providers[target]?.characteristics) return fail(`"${target}" is not a registered endpoint (providers.${target}.characteristics)`);
1601
1607
  try {
1602
- const { setProviderEnabled } = await import("./providers-BeDiVEb-.mjs");
1608
+ const { setProviderEnabled } = await import("./providers-QJzpaNhX.mjs");
1603
1609
  setProviderEnabled(target, value === "on", deps.configPath);
1604
1610
  writeLedgerLine(deps, action, target, `routing ${value}`);
1605
1611
  return {
@@ -1625,7 +1631,7 @@ async function runCockpitAction(body, deps, hooks = {}) {
1625
1631
  message: `worker classes → ${provider}`
1626
1632
  };
1627
1633
  }
1628
- const { useProvider } = await import("./providers-BeDiVEb-.mjs");
1634
+ const { useProvider } = await import("./providers-QJzpaNhX.mjs");
1629
1635
  useProvider(provider);
1630
1636
  try {
1631
1637
  const raw = readMainConfigRaw();
@@ -1660,14 +1666,14 @@ async function memoryRunRefusal(deps, nowMs = Date.now()) {
1660
1666
  }
1661
1667
  /** The daemon's count of chunks without vectors; null when it does not answer. */
1662
1668
  async function daemonEmbedBacklog() {
1663
- const { fetchDaemonMemory } = await import("./cockpit-memory--dnShXBA.mjs");
1669
+ const { fetchDaemonMemory } = await import("./cockpit-memory-DIrNs4xr.mjs");
1664
1670
  return (await fetchDaemonMemory())?.embedBacklog ?? null;
1665
1671
  }
1666
1672
  /** The daemon's in-process passes (no child, so no marker): its status says whether one runs. */
1667
1673
  async function daemonMemoryBusy() {
1668
1674
  try {
1669
- const { PaiClient } = await import("./ipc-client-ZRmDKd5Z.mjs");
1670
- const { loadConfig } = await import("./config-DtENJ6cL.mjs");
1675
+ const { PaiClient } = await import("./ipc-client-DN7EvoVo.mjs");
1676
+ const { loadConfig } = await import("./config-Dv3t7xnT.mjs");
1671
1677
  const s = await new PaiClient(loadConfig().socketPath).call("status", {}, 5e3);
1672
1678
  if (s.embedInProgress) return "embed already running (started by daemon)";
1673
1679
  if (s.indexInProgress) return "index already running (started by daemon)";
@@ -1781,7 +1787,7 @@ async function finishRuntimeJob(deps, hooks, id, runtime, op) {
1781
1787
  end(state, message);
1782
1788
  }
1783
1789
  async function defaultRefreshInventory() {
1784
- const { computeInventory, readInventoryInput, writeInventory } = await import("./model-inventory-BFVSNFT3.mjs");
1790
+ const { computeInventory, readInventoryInput, writeInventory } = await import("./model-inventory-BuTpi9a6.mjs");
1785
1791
  writeInventory(workersLogDir(readWorkersSection().workers), await computeInventory(readInventoryInput()));
1786
1792
  }
1787
1793
  /** Runs the injected local job, records its outcome in the job file and ledger. */
@@ -1851,4 +1857,4 @@ function cockpitActionLedger(ledgerFile, lastN = 10) {
1851
1857
 
1852
1858
  //#endregion
1853
1859
  export { cockpitMemoryPayload as A, cockpitLayout as B, runtimeOpRefusal as C, writeLedgerLine as D, tierNames as E, memoryRunLog as F, acquireRun as H, rateSeries as I, runProgress as L, latestMemoryJob as M, liveMemoryDeps as N, embeddingRuntimeName as O, memoryJobProgress as P, runningMemoryJob as R, runtimeJobProgress as S, spawnMemoryRun as T, readRun as U, cockpitProbeSettings as V, resolveTierName as _, classesOnProvider as a, runningRuntimeJob as b, defaultDeps as c, labelPath as d, logTailSince as f, readLabels as g, readCockpitJob as h, WORKER_ROLE_CLASSES as i, fetchDaemonMemory as j, readRuntimeCommands as k, engineInflight as l, orchestratorProvider as m, RUNTIME_START_EVENT as n, cockpitActionLedger as o, memoryRunRefusal as p, RUNTIME_STOP_EVENT as r, cockpitJobFile as s, COCKPIT_ACTION_EVENT as t, labelFor as u, runCockpitAction as v, runtimeStartStop as w, runningRuntimeJobs as x, runningLocalModel as y, sameModel as z };
1854
- //# sourceMappingURL=cockpit-actions-BBHeyEZI.mjs.map
1860
+ //# sourceMappingURL=cockpit-actions-BTA1njMO.mjs.map
@@ -1,20 +1,20 @@
1
- import "./config-XpZWOYOG.mjs";
2
- import "./config-Bu1_vbY8.mjs";
3
- import "./paths-CHifubDh.mjs";
4
- import "./status-ggJ7lgVg.mjs";
5
- import "./scope-D-h6F6DN.mjs";
6
- import "./routing-BAAST9vT.mjs";
7
- import "./tool-errors-7E13StWd.mjs";
8
- import "./wait-ByV0OyMZ.mjs";
9
- import "./local-tiers-BE4jGaMa.mjs";
10
- import "./caller-identity-yLFb7CKq.mjs";
11
- import "./capacity-DEveQdFV.mjs";
12
- import "./local-instances-DOxSgT_L.mjs";
13
- import "./local-candidate-DLdwQt0s.mjs";
14
- import "./providers-CblTFrhz.mjs";
15
- import "./main-config-ops-BEMpuhDz.mjs";
16
- import { C as runtimeOpRefusal, D as writeLedgerLine, E as tierNames, S as runtimeJobProgress, T as spawnMemoryRun, _ as resolveTierName, a as classesOnProvider, b as runningRuntimeJob, c as defaultDeps, d as labelPath, f as logTailSince, g as readLabels, h as readCockpitJob, i as WORKER_ROLE_CLASSES, l as engineInflight, m as orchestratorProvider, n as RUNTIME_START_EVENT, o as cockpitActionLedger, p as memoryRunRefusal, r as RUNTIME_STOP_EVENT, s as cockpitJobFile, t as COCKPIT_ACTION_EVENT, u as labelFor, v as runCockpitAction, w as runtimeStartStop, x as runningRuntimeJobs, y as runningLocalModel } from "./cockpit-actions-BBHeyEZI.mjs";
17
- import "./ipc-client-CaiGJnSM.mjs";
18
- import "./embed-pass-DIWjA68P.mjs";
1
+ import "./config-CST2uq1v.mjs";
2
+ import "./config-DYbyEe4-.mjs";
3
+ import "./paths-DS5VQKoR.mjs";
4
+ import "./status-COtzewKV.mjs";
5
+ import "./scope-D8HK6vU7.mjs";
6
+ import "./routing-BlD_tKjW.mjs";
7
+ import "./tool-errors-DXJ70-sr.mjs";
8
+ import "./wait-ChpHKJZV.mjs";
9
+ import "./local-tiers-BtdEEe5n.mjs";
10
+ import "./caller-identity-Bim8JT-D.mjs";
11
+ import "./capacity-CsZMkVyg.mjs";
12
+ import "./local-instances-bdCNNSsL.mjs";
13
+ import "./local-candidate-Cp_bw4kK.mjs";
14
+ import "./providers-Dzx5GAUI.mjs";
15
+ import "./main-config-ops-BYsK3BxM.mjs";
16
+ import { C as runtimeOpRefusal, D as writeLedgerLine, E as tierNames, S as runtimeJobProgress, T as spawnMemoryRun, _ as resolveTierName, a as classesOnProvider, b as runningRuntimeJob, c as defaultDeps, d as labelPath, f as logTailSince, g as readLabels, h as readCockpitJob, i as WORKER_ROLE_CLASSES, l as engineInflight, m as orchestratorProvider, n as RUNTIME_START_EVENT, o as cockpitActionLedger, p as memoryRunRefusal, r as RUNTIME_STOP_EVENT, s as cockpitJobFile, t as COCKPIT_ACTION_EVENT, u as labelFor, v as runCockpitAction, w as runtimeStartStop, x as runningRuntimeJobs, y as runningLocalModel } from "./cockpit-actions-BTA1njMO.mjs";
17
+ import "./ipc-client-CnYEF31R.mjs";
18
+ import "./embed-pass-DtVF2fOV.mjs";
19
19
 
20
20
  export { COCKPIT_ACTION_EVENT, RUNTIME_START_EVENT, RUNTIME_STOP_EVENT, WORKER_ROLE_CLASSES, classesOnProvider, cockpitActionLedger, cockpitJobFile, defaultDeps, engineInflight, labelFor, labelPath, logTailSince, memoryRunRefusal, orchestratorProvider, readCockpitJob, readLabels, resolveTierName, runCockpitAction, runningLocalModel, runningRuntimeJob, runningRuntimeJobs, runtimeJobProgress, runtimeOpRefusal, runtimeStartStop, spawnMemoryRun, tierNames, writeLedgerLine };
@@ -0,0 +1,20 @@
1
+ import "./config-CST2uq1v.mjs";
2
+ import "./config-DYbyEe4-.mjs";
3
+ import "./paths-DS5VQKoR.mjs";
4
+ import "./status-COtzewKV.mjs";
5
+ import "./scope-D8HK6vU7.mjs";
6
+ import "./routing-BlD_tKjW.mjs";
7
+ import "./tool-errors-DXJ70-sr.mjs";
8
+ import "./wait-ChpHKJZV.mjs";
9
+ import "./local-tiers-BtdEEe5n.mjs";
10
+ import "./caller-identity-Bim8JT-D.mjs";
11
+ import "./capacity-CsZMkVyg.mjs";
12
+ import "./local-instances-bdCNNSsL.mjs";
13
+ import "./local-candidate-Cp_bw4kK.mjs";
14
+ import "./providers-Dzx5GAUI.mjs";
15
+ import "./main-config-ops-BYsK3BxM.mjs";
16
+ import { A as cockpitMemoryPayload, F as memoryRunLog, I as rateSeries, L as runProgress, M as latestMemoryJob, N as liveMemoryDeps, P as memoryJobProgress, R as runningMemoryJob, j as fetchDaemonMemory, z as sameModel } from "./cockpit-actions-BTA1njMO.mjs";
17
+ import "./ipc-client-CnYEF31R.mjs";
18
+ import "./embed-pass-DtVF2fOV.mjs";
19
+
20
+ export { fetchDaemonMemory };
@@ -150,6 +150,10 @@ router:
150
150
  # Bare aliases (besides ids starting with claude-) that also go to claudeUpstream.
151
151
  claudeModelAliases: [sonnet, opus, haiku, default, opusplan]
152
152
  bind: loopback
153
+ # Extra Host headers the router accepts beyond loopback and the bind address
154
+ # (tailnet/MagicDNS names the cockpit is opened by). Empty by default; a
155
+ # request whose Host matches none of these is refused with 403.
156
+ allowedHosts: []
153
157
  # Milliseconds a stopping router waits for in-flight requests before force-closing.
154
158
  drainMs: 120000
155
159
  # Cockpit page layout policy (src/router/cockpit-layout.ts): tile min/max
@@ -217,6 +221,8 @@ router:
217
221
  # sessions beyond the top N by tokens collapse into one expandable row;
218
222
  # the session-name column is capped at this percent of the table width.
219
223
  sessionsTopRows: 10
224
+ # turns kept in the per-session drill-down (the last N).
225
+ sessionDetailTurns: 200
220
226
  sessionNameMaxPct: 35
221
227
  workerRows: 15
222
228
  # models under this many requests render as chips, not rings.
@@ -237,6 +243,9 @@ router:
237
243
  jobFirstDelayMs: 2000
238
244
  jobPollMs: 5000
239
245
  jobMaxTries: 120
246
+ # bounds of the parallel-runs +/- stepper on a provider card in the Models section.
247
+ concurrencyMin: 1
248
+ concurrencyMax: 16
240
249
  # a server prefix-cache counter older than this (seconds) is marked.
241
250
  serverCounterStaleSecs: 60
242
251
  # colour thresholds, stated per pair: for a limits gauge and an error
@@ -1,6 +1,6 @@
1
1
  import { _ as resolvePaiFile, f as legacyConfigDir, g as paiHomePath, l as claudeHomeDir, m as migratePaiFile } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { D as readJsonStrict, E as writeYamlFileAtomic, O as writeJsonAtomic, T as YamlStoreError, _ as effectiveWorkersYamlRaw, b as shippedWorkersDefaults, f as readMainConfigRaw, g as effectiveWorkersYamlDoc, h as effectiveMainConfig, n as CONFIG_FILE, o as expandHome, p as writeMainConfigRaw, u as paiConfigFilePath, x as userWorkersYamlRaw } from "./config-Bu1_vbY8.mjs";
3
- import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { D as writeYamlFileAtomic, E as YamlStoreError, O as readJsonStrict, _ as effectiveWorkersYamlRaw, b as shippedWorkersDefaults, f as readMainConfigRaw, g as effectiveWorkersYamlDoc, h as effectiveMainConfig, k as writeJsonAtomic, n as CONFIG_FILE, o as expandHome, p as writeMainConfigRaw, u as paiConfigFilePath, x as userWorkersYamlRaw } from "./config-DYbyEe4-.mjs";
3
+ import { appendFileSync, chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import { Document, Scalar, parseDocument } from "yaml";
6
6
 
@@ -2283,6 +2283,31 @@ function readWorkersSection(path = paiConfigFilePath(), onWarn = (msg) => proces
2283
2283
  workers
2284
2284
  };
2285
2285
  }
2286
+ let cachedWorkers = null;
2287
+ function mtimeOf(path) {
2288
+ try {
2289
+ return statSync(path).mtimeMs;
2290
+ } catch {
2291
+ return 0;
2292
+ }
2293
+ }
2294
+ /** Signature of the files the workers config reads: changes whenever either is saved. */
2295
+ function workersConfigStamp(path = paiConfigFilePath()) {
2296
+ return `${path}:${mtimeOf(path)}:${mtimeOf(workersYamlPath())}`;
2297
+ }
2298
+ /**
2299
+ * readWorkersSection for pollers (the capacity gate re-reads the cap on every
2300
+ * poll): the parsed config is reused until the config file or workers.yaml
2301
+ * changes mtime, so a saved change applies without a restart and a poll costs two stats.
2302
+ */
2303
+ function readWorkersCached(path = paiConfigFilePath()) {
2304
+ const key = workersConfigStamp(path);
2305
+ if (cachedWorkers?.key !== key) cachedWorkers = {
2306
+ key,
2307
+ workers: readWorkersSection(path, () => {}).workers
2308
+ };
2309
+ return cachedWorkers.workers;
2310
+ }
2286
2311
  /**
2287
2312
  * Write the workers section back, atomically. When workers.yaml exists, its
2288
2313
  * providers/classes/mcpSets/active are synced there (comment-preserving,
@@ -2474,5 +2499,5 @@ function escalationCloud() {
2474
2499
  }
2475
2500
 
2476
2501
  //#endregion
2477
- export { starterWorkersYamlText as $, providerQuotaSkipAt as A, WORKERS_YAML_FILENAME as B, parseMcpSetsValue as C, withSummary as Ct, providerContextWindow as D, parseWorkersConfig as E, parseLedger as Et, writeWorkersSection as F, inlineWorkersYamlKeys as G, defaultWorkersYamlPath as H, LOOPBACK_HOST as I, parseBuiltinAnthropic as J, migrateWorkersToYaml as K, isLoopbackHostname as L, resolveCapability as M, resolveModelCapability as N, providerCostTier as O, resolveProviderKey as P, relocateWorkersYaml as Q, isLoopbackUrl as R, parseClassesValue as S, sessionNote as St, parseProvider as T, ledgerSummary as Tt, effectiveWorkersYamlData as U, buildWorkersYamlText as V, initWorkersYaml as W, readMergeVerify as X, parseWorkersYamlDocument as Y, readWorkersYaml as Z, maskKey as _, contextWindowFromModelId as _t, MODEL_CAPABILITIES as a, MAX_ROUTE_MODELS as at, nativeOrchestratorModel as b, ledgerEscalate as bt, WorkersConfigError as c, entryProvider as ct, defaultWorkersConfig as d, migrateSessionRoutes as dt, workersYamlLegacyNotice as et, escalationCloud as f, parseEntry as ft, keysDir as g, certainContextWindow as gt, isModelCapability as h, DEFAULT_CONTEXT_WINDOW as ht, DEFAULT_POOL_PORT as i, yamlProviderToRaw as it, readWorkersSection as j, providerKeyPath as k, assertProviderRunnable as l, findTier as lt, isLocalProvider as m, targetList as mt, CAPABILITY_NAME_RE as n, writeWorkersYaml as nt, PROVIDER_TAGS as o, applyRouteOverrides as ot, getProviderOrNative as p, sessionTier as pt, needsWorkersYamlRelocation as q, DEFAULT_COST_TIER as r, writeWorkersYamlText as rt, WORKER_CLASSES as s, classRoute as st, ANTHROPIC_NATIVE as t, workersYamlPath as tt, classModelCapability as u, listForPolicy as ut, nativeAnthropicModels as v, stripModelVariant as vt, parseModelsBlock as w, appendLedger as wt, parseCapabilitiesValue as x, planEscalation as xt, nativeAnthropicProvider as y, ESCALATE_FAILURES as yt, loopbackUrl as z };
2478
- //# sourceMappingURL=config-XpZWOYOG.mjs.map
2502
+ export { readWorkersYaml as $, providerQuotaSkipAt as A, isLoopbackUrl as B, parseMcpSetsValue as C, planEscalation as Ct, providerContextWindow as D, ledgerSummary as Dt, parseWorkersConfig as E, appendLedger as Et, resolveProviderKey as F, effectiveWorkersYamlData as G, WORKERS_YAML_FILENAME as H, workersConfigStamp as I, migrateWorkersToYaml as J, initWorkersYaml as K, writeWorkersSection as L, readWorkersSection as M, resolveCapability as N, providerCostTier as O, parseLedger as Ot, resolveModelCapability as P, readMergeVerify as Q, LOOPBACK_HOST as R, parseClassesValue as S, ledgerEscalate as St, parseProvider as T, withSummary as Tt, buildWorkersYamlText as U, loopbackUrl as V, defaultWorkersYamlPath as W, parseBuiltinAnthropic as X, needsWorkersYamlRelocation as Y, parseWorkersYamlDocument as Z, maskKey as _, DEFAULT_CONTEXT_WINDOW as _t, MODEL_CAPABILITIES as a, writeWorkersYamlText as at, nativeOrchestratorModel as b, stripModelVariant as bt, WorkersConfigError as c, applyRouteOverrides as ct, defaultWorkersConfig as d, findTier as dt, relocateWorkersYaml as et, escalationCloud as f, listForPolicy as ft, keysDir as g, targetList as gt, isModelCapability as h, sessionTier as ht, DEFAULT_POOL_PORT as i, writeWorkersYaml as it, readWorkersCached as j, providerKeyPath as k, assertProviderRunnable as l, classRoute as lt, isLocalProvider as m, parseEntry as mt, CAPABILITY_NAME_RE as n, workersYamlLegacyNotice as nt, PROVIDER_TAGS as o, yamlProviderToRaw as ot, getProviderOrNative as p, migrateSessionRoutes as pt, inlineWorkersYamlKeys as q, DEFAULT_COST_TIER as r, workersYamlPath as rt, WORKER_CLASSES as s, MAX_ROUTE_MODELS as st, ANTHROPIC_NATIVE as t, starterWorkersYamlText as tt, classModelCapability as u, entryProvider as ut, nativeAnthropicModels as v, certainContextWindow as vt, parseModelsBlock as w, sessionNote as wt, parseCapabilitiesValue as x, ESCALATE_FAILURES as xt, nativeAnthropicProvider as y, contextWindowFromModelId as yt, isLoopbackHostname as z };
2503
+ //# sourceMappingURL=config-CST2uq1v.mjs.map
@@ -791,5 +791,5 @@ function ensureConfigDir() {
791
791
  }
792
792
 
793
793
  //#endregion
794
- export { assertPgName as A, migrateMainConfigToYaml as C, readJsonStrict as D, writeYamlFileAtomic as E, postgresConnectionString as M, postgresFullTarget as N, writeJsonAtomic as O, quoteIdent as P, MainConfigError as S, YamlStoreError as T, effectiveWorkersYamlRaw as _, ensureConfigDir as a, shippedWorkersDefaults as b, loadConfig as c, paiConfigYamlFilePath as d, readMainConfigRaw as f, effectiveWorkersYamlDoc as g, effectiveMainConfig as h, defaults as i, isContainerTarget as j, DEFAULT_PG_CONNECTION_TIMEOUT_MS as k, migrateConfigFile as l, deepMergeConfig as m, CONFIG_FILE as n, expandHome as o, writeMainConfigRaw as p, ConfigMigrationError as r, homeRel as s, CONFIG_DIR as t, paiConfigFilePath as u, shippedDefaultsDir as v, resolvedMainConfigPath as w, userWorkersYamlRaw as x, shippedMainDefaults as y };
795
- //# sourceMappingURL=config-Bu1_vbY8.mjs.map
794
+ export { DEFAULT_PG_CONNECTION_TIMEOUT_MS as A, migrateMainConfigToYaml as C, writeYamlFileAtomic as D, YamlStoreError as E, quoteIdent as F, isContainerTarget as M, postgresConnectionString as N, readJsonStrict as O, postgresFullTarget as P, MainConfigError as S, resolvedMainConfigPath as T, effectiveWorkersYamlRaw as _, ensureConfigDir as a, shippedWorkersDefaults as b, loadConfig as c, paiConfigYamlFilePath as d, readMainConfigRaw as f, effectiveWorkersYamlDoc as g, effectiveMainConfig as h, defaults as i, assertPgName as j, writeJsonAtomic as k, migrateConfigFile as l, deepMergeConfig as m, CONFIG_FILE as n, expandHome as o, writeMainConfigRaw as p, ConfigMigrationError as r, homeRel as s, CONFIG_DIR as t, paiConfigFilePath as u, shippedDefaultsDir as v, readDualFormatConfigRaw as w, userWorkersYamlRaw as x, shippedMainDefaults as y };
795
+ //# sourceMappingURL=config-DYbyEe4-.mjs.map
@@ -1,3 +1,3 @@
1
- import { a as ensureConfigDir, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, i as defaults, l as migrateConfigFile, n as CONFIG_FILE, o as expandHome, p as writeMainConfigRaw, r as ConfigMigrationError, s as homeRel, t as CONFIG_DIR, u as paiConfigFilePath } from "./config-Bu1_vbY8.mjs";
1
+ import { a as ensureConfigDir, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, i as defaults, l as migrateConfigFile, n as CONFIG_FILE, o as expandHome, p as writeMainConfigRaw, r as ConfigMigrationError, s as homeRel, t as CONFIG_DIR, u as paiConfigFilePath } from "./config-DYbyEe4-.mjs";
2
2
 
3
3
  export { CONFIG_DIR, CONFIG_FILE, ConfigMigrationError, defaults, ensureConfigDir, expandHome, homeRel, loadConfig, migrateConfigFile, paiConfigFilePath, paiConfigYamlFilePath, readMainConfigRaw, writeMainConfigRaw };
@@ -0,0 +1,4 @@
1
+ import { A as providerQuotaSkipAt, C as parseMcpSetsValue, D as providerContextWindow, E as parseWorkersConfig, F as resolveProviderKey, I as workersConfigStamp, L as writeWorkersSection, M as readWorkersSection, N as resolveCapability, O as providerCostTier, P as resolveModelCapability, S as parseClassesValue, T as parseProvider, _ as maskKey, _t as DEFAULT_CONTEXT_WINDOW, a as MODEL_CAPABILITIES, b as nativeOrchestratorModel, c as WorkersConfigError, d as defaultWorkersConfig, f as escalationCloud, g as keysDir, h as isModelCapability, i as DEFAULT_POOL_PORT, j as readWorkersCached, k as providerKeyPath, l as assertProviderRunnable, m as isLocalProvider, n as CAPABILITY_NAME_RE, o as PROVIDER_TAGS, p as getProviderOrNative, r as DEFAULT_COST_TIER, s as WORKER_CLASSES, t as ANTHROPIC_NATIVE, u as classModelCapability, v as nativeAnthropicModels, w as parseModelsBlock, x as parseCapabilitiesValue, y as nativeAnthropicProvider } from "./config-CST2uq1v.mjs";
2
+ import { o as expandHome, s as homeRel } from "./config-DYbyEe4-.mjs";
3
+
4
+ export { ANTHROPIC_NATIVE, CAPABILITY_NAME_RE, DEFAULT_CONTEXT_WINDOW, DEFAULT_COST_TIER, DEFAULT_POOL_PORT, MODEL_CAPABILITIES, PROVIDER_TAGS, WORKER_CLASSES, WorkersConfigError, assertProviderRunnable, classModelCapability, defaultWorkersConfig, escalationCloud, expandHome, getProviderOrNative, homeRel, isLocalProvider, isModelCapability, keysDir, maskKey, nativeAnthropicModels, nativeAnthropicProvider, nativeOrchestratorModel, parseCapabilitiesValue, parseClassesValue, parseMcpSetsValue, parseModelsBlock, parseProvider, parseWorkersConfig, providerContextWindow, providerCostTier, providerKeyPath, providerQuotaSkipAt, readWorkersCached, readWorkersSection, resolveCapability, resolveModelCapability, resolveProviderKey, workersConfigStamp, writeWorkersSection };
@@ -1,14 +1,14 @@
1
1
  import { g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { Et as parseLedger, d as defaultWorkersConfig, f as escalationCloud, j as readWorkersSection, m as isLocalProvider, wt as appendLedger, yt as ESCALATE_FAILURES } from "./config-XpZWOYOG.mjs";
3
- import { h as effectiveMainConfig, u as paiConfigFilePath } from "./config-Bu1_vbY8.mjs";
4
- import { i as ledgerPath, l as statusPath, o as panesDir, u as workersLogDir } from "./paths-CHifubDh.mjs";
5
- import { C as nowStamp, D as pidAlive$1, T as ownsPidCached, b as loadStatusesCached, g as isLive, h as isChatPane, k as saveStatus, v as loadStatus } from "./status-ggJ7lgVg.mjs";
6
- import { c as scopeKey, i as itermUuid$1, p as currentWorkerId } from "./scope-D-h6F6DN.mjs";
7
- import { a as buildsDir, l as listBuildsSync, m as ticketKind } from "./caller-identity-yLFb7CKq.mjs";
8
- import { o as providerCap, s as queueRows } from "./capacity-DEveQdFV.mjs";
9
- import { n as tierProviderNames, s as readLocalStatus, t as isLocalCandidate } from "./local-candidate-DLdwQt0s.mjs";
10
- import { d as paneRunStatusRow, f as paneStatusRow } from "./render-BYmQkuLd.mjs";
11
- import { r as sayToWorker } from "./operator-CyuB3aVw.mjs";
2
+ import { Et as appendLedger, M as readWorkersSection, Ot as parseLedger, d as defaultWorkersConfig, f as escalationCloud, m as isLocalProvider, xt as ESCALATE_FAILURES } from "./config-CST2uq1v.mjs";
3
+ import { h as effectiveMainConfig, u as paiConfigFilePath } from "./config-DYbyEe4-.mjs";
4
+ import { i as ledgerPath, l as statusPath, o as panesDir, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
+ import { C as nowStamp, D as pidAlive$1, T as ownsPidCached, b as loadStatusesCached, g as isLive, h as isChatPane, k as saveStatus, v as loadStatus } from "./status-COtzewKV.mjs";
6
+ import { c as scopeKey, i as itermUuid$1, p as currentWorkerId } from "./scope-D8HK6vU7.mjs";
7
+ import { a as buildsDir, l as listBuildsSync, m as ticketKind } from "./caller-identity-Bim8JT-D.mjs";
8
+ import { o as providerCap, s as queueRows } from "./capacity-CsZMkVyg.mjs";
9
+ import { n as tierProviderNames, s as readLocalStatus, t as isLocalCandidate } from "./local-candidate-Cp_bw4kK.mjs";
10
+ import { d as paneRunStatusRow, f as paneStatusRow } from "./render-Cz3BWIBO.mjs";
11
+ import { r as sayToWorker } from "./operator-DrwWItVt.mjs";
12
12
  import { appendFileSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
13
13
  import { createHash } from "node:crypto";
14
14
  import { dirname, isAbsolute, join, resolve } from "node:path";
@@ -847,8 +847,8 @@ async function runPaneExec(id, d = {}) {
847
847
  let show = out;
848
848
  let showErr = err;
849
849
  if (sp.statusLine && (d.tty ?? process.stdout.isTTY === true)) {
850
- const { loadStatus } = await import("./status-Dm4dYciN.mjs");
851
- const { sayToWorker } = await import("./operator-BTqvTIc8.mjs");
850
+ const { loadStatus } = await import("./status-D_SWmOlH.mjs");
851
+ const { sayToWorker } = await import("./operator-Bpxq_WB5.mjs");
852
852
  const b = startPaneBar({
853
853
  spec: sp.statusLine,
854
854
  write: (x) => out(x),
@@ -955,8 +955,8 @@ async function renderer(sp, id, out, err) {
955
955
  err: (c) => err(c),
956
956
  end: () => void 0
957
957
  };
958
- const { applyEvent, initialFollowState } = await import("./viewer-CqozWW39.mjs");
959
- const { makeColor } = await import("./render-CoMvwMPs.mjs");
958
+ const { applyEvent, initialFollowState } = await import("./viewer-CbGN2Ri4.mjs");
959
+ const { makeColor } = await import("./render-C4KR8qQ8.mjs");
960
960
  const c = makeColor(true);
961
961
  let state = initialFollowState("");
962
962
  let buf = "";
@@ -1086,13 +1086,15 @@ async function openOwnedPane(o) {
1086
1086
  let pidWaiter = null;
1087
1087
  let ended = false;
1088
1088
  let startedAt = 0;
1089
+ const openedAt = Date.now();
1089
1090
  const record = (extra = {}) => writeJson(recordPath(o.id), {
1090
1091
  id: o.id,
1091
1092
  kind: o.kind,
1092
1093
  caller: process.pid,
1093
1094
  wrapper: wrapper || void 0,
1094
1095
  session,
1095
- startedMs: startedAt || Date.now(),
1096
+ openedMs: openedAt,
1097
+ startedMs: startedAt || openedAt,
1096
1098
  ...extra
1097
1099
  });
1098
1100
  const settle = (code, signal) => {
@@ -4706,4 +4708,4 @@ async function returnControlsIfHeld(logDir, id) {
4706
4708
 
4707
4709
  //#endregion
4708
4710
  export { checkPaneForWorker as $, tail as A, recordPath as At, loadPlanStatus as B, chatTickerRow as Bt, readRunLog as C, PANE_EXEC_PID_ENV as Ct, resumeState as D, pidAlive as Dt, requestPlanStop as E, openOwnedPane as Et, runLogPath as F, chatEnter as Ft, planRunId as G, handoffFromInside as Gt, planLogTail as H, parseChatLine as Ht, PlanTracker as I, chatInsertLine as It, queueLockPath as J, LOCAL_FAILURE_LIMIT as Jt, renderPlanLines as K, isHandoffMessage as Kt, fmtElapsed as L, chatLeave as Lt, dirtyConflicts as M, panePolicy as Mt, filesOverlap as N, CHAT_HELP as Nt, runExitCode as O, readExit as Ot, loadPlan as P, chatBlankRow as Pt, NoTerminalError as Q, followPlanLog as R, chatPromptRow as Rt, planStopPath as S, PANE_EXEC_ENV as St, renderStatus as T, listRecords as Tt, planRows as U, wrapText as Ut, loadPlanStatuses as V, holdAutoExit as Vt, planRunEnded as W, deliverHandoff as Wt, sinceText as X, localFailures as Xt, readRunLock as Y, classifyRoute as Yt, withRunLock as Z, routeLine as Zt, troublePolicy as _, paneTitle as _t, localIdleTick as a, headlessAllowed as at, idleText as b, psTableOrNull as bt, setMuted as c, openFollowPane as ct, aibrokerMessenger as d, osascript as dt, closeEndedPanes as et, detachRun as f, paneBackend as ft, sweepRuns as g, workerEnded as gt, originFromEnv as h, resolveHostSession as ht, localIdleLine as i, followCommand as it, PlanError as j, runPaneExec as jt, runPlan as k, readRecord as kt, PlanReporter as l, openPaneForWorker as lt, markRunDone as m, realPaneOps as mt, markControlsHeld as n, closePaneForWorker as nt, ownerOf as o, inVisiblePane as ot, eventLine as p, paneMayClose as pt, planLockPath as q, readInbox as qt, returnControlsIfHeld as r, closeSelfPane as rt, readLocalIdle as s, loadRegistry as st, clickrControlsArgv as t, closeOwnPane as tt, QueueReporter as u, openVerifiedPane as ut, appendRunLog as v, writePaneTitle as vt, renderSchedule as w, exitFilePath as wt, planStatus as x, truncateLines as xt, blockedMessage as y, psTable as yt, gatePhaseName as z, chatScrollRegion as zt };
4709
- //# sourceMappingURL=controls-CPoeudou.mjs.map
4711
+ //# sourceMappingURL=controls-OiVVbe-f.mjs.map
@@ -1,48 +1,49 @@
1
1
  #!/usr/bin/env node
2
2
  import "../utils-J2b9y8PC.mjs";
3
3
  import "../migrate-DrA_OwlZ.mjs";
4
- import "../config-XpZWOYOG.mjs";
5
- import { a as ensureConfigDir, c as loadConfig } from "../config-Bu1_vbY8.mjs";
6
- import "../paths-CHifubDh.mjs";
7
- import "../worktree-CRs2gyg0.mjs";
8
- import "../status-ggJ7lgVg.mjs";
9
- import "../pool-Dh-q3iJi.mjs";
10
- import "../registrable-DpyTtajg.mjs";
11
- import "../pai-marker-BcZyJguM.mjs";
4
+ import "../config-CST2uq1v.mjs";
5
+ import { a as ensureConfigDir, c as loadConfig } from "../config-DYbyEe4-.mjs";
6
+ import "../paths-DS5VQKoR.mjs";
7
+ import "../worktree-BY--Rgmy.mjs";
8
+ import "../status-COtzewKV.mjs";
9
+ import "../pool-BZ94nFuq.mjs";
10
+ import "../registrable-CXBBpUcz.mjs";
11
+ import "../pai-marker-DLKJ9Yr5.mjs";
12
12
  import "../helpers-CRuBUas3.mjs";
13
13
  import "../reranker-CqCbpGnX.mjs";
14
14
  import { t as dropItermBundleId } from "../env-BE8mrsxr.mjs";
15
- import "../scope-D-h6F6DN.mjs";
16
- import "../routing-BAAST9vT.mjs";
17
- import "../tool-errors-7E13StWd.mjs";
18
- import "../wait-ByV0OyMZ.mjs";
19
- import "../local-tiers-BE4jGaMa.mjs";
20
- import "../caller-identity-yLFb7CKq.mjs";
21
- import "../capacity-DEveQdFV.mjs";
22
- import "../local-instances-DOxSgT_L.mjs";
23
- import "../local-candidate-DLdwQt0s.mjs";
24
- import "../factory-DjAAsqr_.mjs";
25
- import "../postgres-C6ti4haA.mjs";
26
- import "../embedding-gate-6rZrWRXa.mjs";
15
+ import "../scope-D8HK6vU7.mjs";
16
+ import "../routing-BlD_tKjW.mjs";
17
+ import "../tool-errors-DXJ70-sr.mjs";
18
+ import "../wait-ChpHKJZV.mjs";
19
+ import "../local-tiers-BtdEEe5n.mjs";
20
+ import "../caller-identity-Bim8JT-D.mjs";
21
+ import "../capacity-CsZMkVyg.mjs";
22
+ import "../local-instances-bdCNNSsL.mjs";
23
+ import "../local-candidate-Cp_bw4kK.mjs";
24
+ import "../factory-BV0MQA3T.mjs";
25
+ import "../postgres-C-T5OWer.mjs";
26
+ import "../embedding-gate-CTAk8STe.mjs";
27
27
  import "../embeddings-BVq3esBF.mjs";
28
28
  import "../router-CQSc3lk3.mjs";
29
- import "../detect-9CZNO0yf.mjs";
30
- import "../scan-C_Y5W9py.mjs";
31
- import "../launch-Jh5NVeNe.mjs";
32
- import "../run-CSC7mgPf.mjs";
33
- import "../controls-CPoeudou.mjs";
34
- import "../endreason-C577xIQz.mjs";
35
- import "../render-BYmQkuLd.mjs";
36
- import "../operator-CyuB3aVw.mjs";
37
- import "../kill-tree-EWYaEk5v.mjs";
38
- import "../pool-cli-BggU8GRp.mjs";
39
- import "../pane-audit-DKQt71s4.mjs";
40
- import { n as PaiClient } from "../ipc-client-CaiGJnSM.mjs";
41
- import "../embed-pass-DIWjA68P.mjs";
42
- import "../indexer-backend-Cll7le4P.mjs";
43
- import { t as serve } from "../daemon-DPAo6WTa.mjs";
44
- import "../auto-route-B7Yu6Uam.mjs";
45
- import "../zettelkasten-BzMm8REH.mjs";
29
+ import "../detect-CHuxFrLy.mjs";
30
+ import "../scan-C3uotg_f.mjs";
31
+ import "../launch-DpQPZGsT.mjs";
32
+ import "../run-AZVwceiU.mjs";
33
+ import "../controls-OiVVbe-f.mjs";
34
+ import "../endreason-BqyyU7BH.mjs";
35
+ import "../render-Cz3BWIBO.mjs";
36
+ import "../operator-DrwWItVt.mjs";
37
+ import "../kill-tree-CcpsRLCZ.mjs";
38
+ import "../pool-cli-B1eKySeN.mjs";
39
+ import "../pane-audit-wv9UkyCe.mjs";
40
+ import { n as PaiClient } from "../ipc-client-CnYEF31R.mjs";
41
+ import "../embed-pass-DtVF2fOV.mjs";
42
+ import "../session-usage-oycSdiD3.mjs";
43
+ import "../indexer-backend-B2vtFl38.mjs";
44
+ import { t as serve } from "../daemon-C1dycZ3W.mjs";
45
+ import "../auto-route-DUYr57rs.mjs";
46
+ import "../zettelkasten-LoH9RBiN.mjs";
46
47
 
47
48
  //#region src/daemon/index.ts
48
49
  /**