@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,22 +1,22 @@
1
1
  import { g as paiHomePath, h as paiHomeDir } from "./runtime-paths-WsO9sJFc.mjs";
2
2
  import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
3
- import { A as providerQuotaSkipAt, F as writeWorkersSection, L as isLoopbackHostname, M as resolveCapability, N as resolveModelCapability, O as providerCostTier, P as resolveProviderKey, R as isLoopbackUrl$1, at as MAX_ROUTE_MODELS, b as nativeOrchestratorModel, c as WorkersConfigError, ct as entryProvider, dt as migrateSessionRoutes, ft as parseEntry, j as readWorkersSection, lt as findTier, m as isLocalProvider, mt as targetList, p as getProviderOrNative, pt as sessionTier, s as WORKER_CLASSES, st as classRoute, t as ANTHROPIC_NATIVE, tt as workersYamlPath, u as classModelCapability, ut as listForPolicy, vt as stripModelVariant, y as nativeAnthropicProvider, z as loopbackUrl$1 } from "./config-XpZWOYOG.mjs";
4
- import { c as loadConfig, f as readMainConfigRaw } from "./config-Bu1_vbY8.mjs";
5
- import { s as routingStatePath, u as workersLogDir } from "./paths-CHifubDh.mjs";
6
- import { g as isLive, v as loadStatus, y as loadStatuses } from "./status-ggJ7lgVg.mjs";
7
- import { o as resolveSession, p as currentWorkerId, t as AIBROKER_REGISTRY } from "./scope-D-h6F6DN.mjs";
8
- import { x as recordToolError } from "./tool-errors-7E13StWd.mjs";
9
- import { _ as readLocalConfig, d as installedModelDirs, p as logPathFor } from "./local-tiers-BE4jGaMa.mjs";
10
- import { a as buildsDir, l as listBuildsSync, t as callerIdentity } from "./caller-identity-yLFb7CKq.mjs";
3
+ import { A as providerQuotaSkipAt, B as isLoopbackUrl$1, F as resolveProviderKey, L as writeWorkersSection, M as readWorkersSection, N as resolveCapability, O as providerCostTier, P as resolveModelCapability, R as LOOPBACK_HOST, V as loopbackUrl$1, b as nativeOrchestratorModel, bt as stripModelVariant, c as WorkersConfigError, dt as findTier, ft as listForPolicy, gt as targetList, ht as sessionTier, lt as classRoute, m as isLocalProvider, mt as parseEntry, p as getProviderOrNative, pt as migrateSessionRoutes, rt as workersYamlPath, s as WORKER_CLASSES, st as MAX_ROUTE_MODELS, t as ANTHROPIC_NATIVE, u as classModelCapability, ut as entryProvider, y as nativeAnthropicProvider, z as isLoopbackHostname } from "./config-CST2uq1v.mjs";
4
+ import { c as loadConfig, f as readMainConfigRaw } from "./config-DYbyEe4-.mjs";
5
+ import { s as routingStatePath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
6
+ import { g as isLive, v as loadStatus, y as loadStatuses } from "./status-COtzewKV.mjs";
7
+ import { o as resolveSession, p as currentWorkerId, t as AIBROKER_REGISTRY } from "./scope-D8HK6vU7.mjs";
8
+ import { x as recordToolError } from "./tool-errors-DXJ70-sr.mjs";
9
+ import { _ as readLocalConfig, d as installedModelDirs, p as logPathFor } from "./local-tiers-BtdEEe5n.mjs";
10
+ import { a as buildsDir, l as listBuildsSync, t as callerIdentity } from "./caller-identity-Bim8JT-D.mjs";
11
11
  import { a as newPrefill, c as schedEnabled, f as sharedScheduler } from "./scheduler-CtUyWJ3O.mjs";
12
- import { i as effectiveCap } from "./capacity-DEveQdFV.mjs";
13
- import { i as instanceNumber, l as readInstances, r as instanceEngineKey, s as pickInstance, t as endpointRegistry, u as readLiveInstances } from "./local-instances-DOxSgT_L.mjs";
14
- import { c as writeLocalStatus, n as tierProviderNames, r as LOCAL_STATUS_REFRESH_MS, s as readLocalStatus, t as isLocalCandidate } from "./local-candidate-DLdwQt0s.mjs";
15
- import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
12
+ import { i as effectiveCap } from "./capacity-CsZMkVyg.mjs";
13
+ import { i as instanceNumber, l as readInstances, r as instanceEngineKey, s as pickInstance, t as endpointRegistry, u as readLiveInstances } from "./local-instances-bdCNNSsL.mjs";
14
+ import { c as writeLocalStatus, n as tierProviderNames, r as LOCAL_STATUS_REFRESH_MS, s as readLocalStatus, t as isLocalCandidate } from "./local-candidate-Cp_bw4kK.mjs";
15
+ import { n as TAILSCALE_STATUS_TIMEOUT_MS, t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
16
16
  import { appendFileSync, chmodSync, closeSync, existsSync, fstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
17
- import { createHash } from "node:crypto";
17
+ import { createHash, randomBytes } from "node:crypto";
18
18
  import { delimiter, dirname, join } from "node:path";
19
- import { homedir, tmpdir } from "node:os";
19
+ import { homedir, networkInterfaces, tmpdir } from "node:os";
20
20
  import { execFile, execFileSync, spawnSync } from "node:child_process";
21
21
  import { parse, stringify } from "yaml";
22
22
  import http from "node:http";
@@ -1664,7 +1664,7 @@ function currentSessionName(env = process.env) {
1664
1664
  */
1665
1665
  async function registryProjectName(cwd) {
1666
1666
  try {
1667
- const { detectProject } = await import("./detect-D1ziFFfA.mjs");
1667
+ const { detectProject } = await import("./detect-C0ZBXqDL.mjs");
1668
1668
  return (await detectProject(cwd))?.display_name || void 0;
1669
1669
  } catch {
1670
1670
  return;
@@ -1690,7 +1690,7 @@ async function detectSessionName(env = process.env, deps = {}) {
1690
1690
  let name;
1691
1691
  const registry = deps.registryPath ?? AIBROKER_REGISTRY;
1692
1692
  const claudeId = env.CLAUDE_CODE_SESSION_ID?.trim();
1693
- const { loadBrokerNames, transcriptCustomTitle } = await import("./session-scan-BJI_ZO8M.mjs");
1693
+ const { loadBrokerNames, transcriptCustomTitle } = await import("./session-scan-CqUQdCac.mjs");
1694
1694
  name = resolveSession(env.ITERM_SESSION_ID ?? "", registry)?.name ?? (claudeId ? loadBrokerNames(registry, deps.mapPath).get(claudeId) ?? transcriptCustomTitle(claudeId, deps.projectsDir) : void 0) ?? await (deps.projectName ?? registryProjectName)(cwd);
1695
1695
  cached = {
1696
1696
  key,
@@ -2380,6 +2380,105 @@ function isTailnetOrLocalName(hostname) {
2380
2380
  return hostname.endsWith(".ts.net") || /^[a-z0-9-]+$/i.test(hostname) && !/^\d+$/.test(hostname);
2381
2381
  }
2382
2382
 
2383
+ //#endregion
2384
+ //#region src/router/cockpit-auth.ts
2385
+ /** The /v1 remote rule: loopback (any 127/8, ::1, v4-mapped) or the tailnet. */
2386
+ function defaultV1Guard(remoteAddress) {
2387
+ return isLoopbackAddress(remoteAddress) || inTailscaleRange(remoteAddress);
2388
+ }
2389
+ /** Strip the ::ffff: IPv4-mapped prefix (Node reports v4 peers this way on v6 sockets). */
2390
+ function normalizeIp(ip) {
2391
+ const a = (ip ?? "").trim().toLowerCase();
2392
+ return a.startsWith("::ffff:") ? a.slice(7) : a;
2393
+ }
2394
+ function isLoopbackAddress(ip) {
2395
+ const a = normalizeIp(ip);
2396
+ return a === "::1" || a.startsWith("127.");
2397
+ }
2398
+ function ipv4ToInt(ip) {
2399
+ const parts = ip.split(".");
2400
+ if (parts.length !== 4) return null;
2401
+ let out = 0;
2402
+ for (const p of parts) {
2403
+ if (!/^\d{1,3}$/.test(p)) return null;
2404
+ const n = Number(p);
2405
+ if (n > 255) return null;
2406
+ out = out * 256 + n;
2407
+ }
2408
+ return out;
2409
+ }
2410
+ function inTailscaleRange(ip) {
2411
+ const n = ipv4ToInt(normalizeIp(ip));
2412
+ if (n === null) return false;
2413
+ return (n & 4290772992) === 1681915904;
2414
+ }
2415
+ /**
2416
+ * router.bind → a concrete address. "loopback" (also empty/unset) is
2417
+ * 127.0.0.1; "tailscale" resolves the utun/tailscale interface's IPv4 inside
2418
+ * 100.64.0.0/10 (null when Tailscale is down); anything else must be a dotted
2419
+ * quad — 0.0.0.0 and every non-IPv4 value are refused (null).
2420
+ */
2421
+ function resolveBindAddress(bind, interfaces = networkInterfaces) {
2422
+ const v = (bind ?? "").trim().toLowerCase();
2423
+ if (!v || v === "loopback") return LOOPBACK_HOST;
2424
+ if (v === "tailscale") {
2425
+ let fallback;
2426
+ for (const [name, addrs] of Object.entries(interfaces() ?? {})) for (const a of addrs ?? []) {
2427
+ if (a.family !== "IPv4" && a.family !== 4) continue;
2428
+ if (!inTailscaleRange(a.address)) continue;
2429
+ if (/^(utun|tailscale)/i.test(name)) return a.address;
2430
+ fallback ??= a.address;
2431
+ }
2432
+ return fallback ?? null;
2433
+ }
2434
+ if (v === "0.0.0.0" || v === "::" || v === "*") return null;
2435
+ return ipv4ToInt(v) !== null ? v : null;
2436
+ }
2437
+ function isCockpitPath(path) {
2438
+ return path === "/cockpit" || path.startsWith("/cockpit/") || path.startsWith("/api/session/");
2439
+ }
2440
+ /**
2441
+ * DNS-rebinding check on the Host header. Allowed: `127.0.0.1[:port]`,
2442
+ * `localhost[:port]`, `[::1][:port]`, the bind address itself (loopback when
2443
+ * `bind` is empty/"loopback"), and any entry of `extraHosts` (tailnet names;
2444
+ * router.allowedHosts in config.yaml). A missing or unparsable Host is
2445
+ * rejected — non-browser clients always send one, so accepting its absence
2446
+ * would hand an attacker the whole check.
2447
+ */
2448
+ function hostAllowed(hostHeader, bind, extraHosts) {
2449
+ if (!hostHeader || !URL.canParse(`http://${hostHeader}`)) return false;
2450
+ const hostname = new URL(`http://${hostHeader}`).hostname.replace(/^\[|\]$/g, "");
2451
+ if (hostname === LOOPBACK_HOST || hostname === "localhost" || hostname === "::1") return true;
2452
+ const bindAddr = resolveBindAddress(bind);
2453
+ if (bindAddr && hostname === bindAddr) return true;
2454
+ return extraHosts.some((h) => h.trim().toLowerCase() === hostname);
2455
+ }
2456
+ /**
2457
+ * Cross-site check on the Origin header: no Origin passes (curl, the Claude
2458
+ * client); an Origin present must carry the same host:port as the Host header.
2459
+ */
2460
+ function originAllowed(originHeader, hostHeader) {
2461
+ if (!originHeader) return true;
2462
+ if (!hostHeader || !URL.canParse(`http://${hostHeader}`) || !URL.canParse(originHeader)) return false;
2463
+ return new URL(originHeader).host === new URL(`http://${hostHeader}`).host;
2464
+ }
2465
+ /**
2466
+ * The address to show a human for a bind address: the tailnet hostname
2467
+ * (MagicDNS name, from `tailscale status --json`) when the address is the
2468
+ * machine's own Tailscale IP, else the address itself.
2469
+ */
2470
+ async function displayHost(addr) {
2471
+ if (!inTailscaleRange(addr)) return addr;
2472
+ try {
2473
+ const { execFile } = await import("node:child_process");
2474
+ const { promisify } = await import("node:util");
2475
+ const { stdout } = await promisify(execFile)("tailscale", ["status", "--json"], { timeout: TAILSCALE_STATUS_TIMEOUT_MS });
2476
+ const self = JSON.parse(stdout).Self;
2477
+ if (self?.DNSName && self.TailscaleIPs?.includes(addr)) return self.DNSName.replace(/\.$/, "");
2478
+ } catch {}
2479
+ return addr;
2480
+ }
2481
+
2383
2482
  //#endregion
2384
2483
  //#region src/router/router.ts
2385
2484
  /**
@@ -2821,6 +2920,25 @@ function routerHandler(loadProviders = () => withTierProviders(readWorkersSectio
2821
2920
  log(`${(/* @__PURE__ */ new Date()).toISOString()} warning: model id ${model} is declared by several providers (${cands.join(", ")}); preferring one that is up`);
2822
2921
  };
2823
2922
  return (req, res) => {
2923
+ const hosts = options?.hosts;
2924
+ if (hosts) {
2925
+ const path = (req.url ?? "/").split("?")[0];
2926
+ const mutating = [
2927
+ "POST",
2928
+ "PUT",
2929
+ "PATCH",
2930
+ "DELETE"
2931
+ ].includes((req.method ?? "GET").toUpperCase());
2932
+ if (isCockpitPath(path) || mutating) {
2933
+ const refuse = (error) => {
2934
+ res.writeHead(403, { "content-type": "application/json" });
2935
+ res.end(JSON.stringify({ error }));
2936
+ log(`${(/* @__PURE__ */ new Date()).toISOString()} ${req.method ?? "-"} ${path} 403 ${error}`);
2937
+ };
2938
+ if (!hostAllowed(req.headers.host, hosts.bind, hosts.extraHosts)) return refuse("host not allowed");
2939
+ if (!originAllowed(req.headers.origin, req.headers.host)) return refuse("origin not allowed");
2940
+ }
2941
+ }
2824
2942
  if (extra?.(req, res)) return;
2825
2943
  const guard = options?.remoteAllowed;
2826
2944
  if (guard && !guard(req.socket.remoteAddress ?? void 0)) {
@@ -5907,5 +6025,5 @@ function resolveCapabilityRun(config, capability) {
5907
6025
  }
5908
6026
 
5909
6027
  //#endregion
5910
- export { parseFootprint as $, findLocal as $t, budgetSkipReason as A, saveSetup as An, TIGHT_PERCENT as At, MODEL_INVENTORY_MAX_AGE_MS as B, aggregate as Bn, routeRows as Bt, detectSessionProvider as C, PORT_TIMEOUT_MS as Cn, removeRunSettings as Ct, budgetExceeded as D, httpModelsCheck as Dn, routerPort as Dt, budgetCache as E, findSetup as En, routerHandler as Et, LimitsCache as F, workersLabel as Fn, flowText as Ft, fmtMem as G, isTimeOrdered as Gn, setRoute as Gt, ProbeHold as H, appendUsage as Hn, servingChip as Ht, buildSpeed as I, parkConfigFrom as In, parseSelector as It, inventoryRows as J, readUsage as Jn, validateRoute as Jt, fmtMemMapped as K, markTimeOrdered as Kn, setSessionRoute as Kt, percentile as L, setParkConfigSource as Ln, resolveSelector as Lt, budgetWall as M, setupWorkersLabel as Mn, clearSessionRoute as Mt, fetchBudgetReading as N, setupsPath as Nn, configuredLocal as Nt, budgetFresh as O, loadSaved as On, isTailnetOrLocalName as Ot, pickBudgetWindow as P, shortModel as Pn, entryLabel as Pt, modelLabel as Q, fallThroughReason as Qt, DOWN_AFTER_MISSES as R, sharedParker as Rn, resolveSessionArg as Rt, applySessionProviderEnv as S, startLocalStatusRefresh as Sn, gcSettingsFiles as St, BudgetCache as T, downLocalProviders as Tn, duplicateModelIds as Tt, computeInventory as U, formatSessionStats as Un, sessionRoutesPatch as Ut, MODEL_INVENTORY_REFRESH_MS as V, aggregateBySession as Vn, routeText as Vt, currentInventory as W, formatStats as Wn, sessionStartTarget as Wt, liveDeps as X, usageLogFile as Xn, clearPolicy as Xt, inventoryText as Y, splitBySessionKind as Yn, POLICY_MODES as Yt, modelKind as Z, committedFallThrough as Zt, resolveTarget as _, pickLocal as _n, nativeRoutePreflight as _t, clearCooldown as a, detectSessionName as an, readInventoryInput as at, SESSION_PROVIDER_ENV as b, resolveLocalProvider as bn, routeLoopbackViaRouter as bt, exclusionReason as c, getProfile as cn, writeInventory as ct, probeQuota as d, updateProfile as dn, claudeCommand as dt, onBattery as en, parseSizeMb as et, quotaExceeded as f, LOCAL_MECHANISM_LINE as fn, claudeSettingsExtra as ft, resolveCapabilityRun as g, localTierOrder as gn, nativeLaunchSettingsArgs as gt, recordBudgetCooldowns as h, localProviderForDelegation as hn, nativeLaunchEnv as ht, capabilityForRun as i, writePolicy as in, readInventory as it, budgetUntilLabel as j, setupProfile as jn, applyPolicyToRoutes as jt, budgetFull as k, orchestratorLabel as kn, loopbackRefusal as kt, isQuotaFailure as l, profilesPath as ln, addSchedulingHeaders as lt, readRoutingState as m, currentLocalStatus as mn, loopbackRouterChoice as mt, NoProviderError as n, readPolicy as nn, processTreeMemory as nt, cooldownRemaining as o, BATCH_ENV as on, readModelLabels as ot, quotaSkipThreshold as p, NoLocalServerError as pn, isLoopbackProvider as pt, inventoryPath as q, parseSince as qn, tierFlow as qt, autoOrder as r, routeRun as rn, processTreeRssMb as rt, entryModel as s, SESSION_NAME_ENV as sn, startInventoryRefresh as st, BUDGET_COOLDOWN_MIN as t, parseDuration as tn, parseTable as tt, nextAutoProvider as u, readProfiles as un, buildRunEnv as ut, setCooldown as v, probeLoopback as vn, pinnedSettings as vt, BUDGET_TTL_MS as w, allSetups as wn, writePrivateFile as wt, SESSION_WORKER_PROVIDER_ENV as x, resolveRunnerProvider as xn, routeVerdictLine as xt, writeRoutingState as y, providerHostPort as yn, pinnedSettingsArgs as yt, INVENTORY_HEADERS as z, recordDuration as zn, routeChoices as zt };
5911
- //# sourceMappingURL=routing-BAAST9vT.mjs.map
6028
+ export { parseFootprint as $, usageLogFile as $n, clearPolicy as $t, budgetSkipReason as A, httpModelsCheck as An, resolveBindAddress as At, MODEL_INVENTORY_MAX_AGE_MS as B, setParkConfigSource as Bn, resolveSelector as Bt, detectSessionProvider as C, resolveLocalProvider as Cn, removeRunSettings as Ct, budgetExceeded as D, allSetups as Dn, routerPort as Dt, budgetCache as E, PORT_TIMEOUT_MS as En, routerHandler as Et, LimitsCache as F, setupWorkersLabel as Fn, clearSessionRoute as Ft, fmtMem as G, appendUsage as Gn, servingChip as Gt, ProbeHold as H, recordDuration as Hn, routeChoices as Ht, buildSpeed as I, setupsPath as In, configuredLocal as It, inventoryRows as J, isTimeOrdered as Jn, setRoute as Jt, fmtMemMapped as K, formatSessionStats as Kn, sessionRoutesPatch as Kt, percentile as L, shortModel as Ln, entryLabel as Lt, budgetWall as M, orchestratorLabel as Mn, loopbackRefusal as Mt, fetchBudgetReading as N, saveSetup as Nn, TIGHT_PERCENT as Nt, budgetFresh as O, downLocalProviders as On, defaultV1Guard as Ot, pickBudgetWindow as P, setupProfile as Pn, applyPolicyToRoutes as Pt, modelLabel as Q, splitBySessionKind as Qn, POLICY_MODES as Qt, DOWN_AFTER_MISSES as R, workersLabel as Rn, flowText as Rt, applySessionProviderEnv as S, providerHostPort as Sn, gcSettingsFiles as St, BudgetCache as T, startLocalStatusRefresh as Tn, duplicateModelIds as Tt, computeInventory as U, aggregate as Un, routeRows as Ut, MODEL_INVENTORY_REFRESH_MS as V, sharedParker as Vn, resolveSessionArg as Vt, currentInventory as W, aggregateBySession as Wn, routeText as Wt, liveDeps as X, parseSince as Xn, tierFlow as Xt, inventoryText as Y, markTimeOrdered as Yn, setSessionRoute as Yt, modelKind as Z, readUsage as Zn, validateRoute as Zt, resolveTarget as _, currentLocalStatus as _n, nativeRoutePreflight as _t, clearCooldown as a, readPolicy as an, readInventoryInput as at, SESSION_PROVIDER_ENV as b, pickLocal as bn, routeLoopbackViaRouter as bt, exclusionReason as c, detectSessionName as cn, writeInventory as ct, probeQuota as d, getProfile as dn, claudeCommand as dt, committedFallThrough as en, parseSizeMb as et, quotaExceeded as f, profilesPath as fn, claudeSettingsExtra as ft, resolveCapabilityRun as g, NoLocalServerError as gn, nativeLaunchSettingsArgs as gt, recordBudgetCooldowns as h, LOCAL_MECHANISM_LINE as hn, nativeLaunchEnv as ht, capabilityForRun as i, parseDuration as in, readInventory as it, budgetUntilLabel as j, loadSaved as jn, isTailnetOrLocalName as jt, budgetFull as k, findSetup as kn, displayHost as kt, isQuotaFailure as l, BATCH_ENV as ln, addSchedulingHeaders as lt, readRoutingState as m, updateProfile as mn, loopbackRouterChoice as mt, NoProviderError as n, findLocal as nn, processTreeMemory as nt, cooldownRemaining as o, routeRun as on, readModelLabels as ot, quotaSkipThreshold as p, readProfiles as pn, isLoopbackProvider as pt, inventoryPath as q, formatStats as qn, sessionStartTarget as qt, autoOrder as r, onBattery as rn, processTreeRssMb as rt, entryModel as s, writePolicy as sn, startInventoryRefresh as st, BUDGET_COOLDOWN_MIN as t, fallThroughReason as tn, parseTable as tt, nextAutoProvider as u, SESSION_NAME_ENV as un, buildRunEnv as ut, setCooldown as v, localProviderForDelegation as vn, pinnedSettings as vt, BUDGET_TTL_MS as w, resolveRunnerProvider as wn, writePrivateFile as wt, SESSION_WORKER_PROVIDER_ENV as x, probeLoopback as xn, routeVerdictLine as xt, writeRoutingState as y, localTierOrder as yn, pinnedSettingsArgs as yt, INVENTORY_HEADERS as z, parkConfigFrom as zn, parseSelector as zt };
6029
+ //# sourceMappingURL=routing-BlD_tKjW.mjs.map
@@ -1,15 +1,15 @@
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 { _ as resolveTarget, a as clearCooldown, c as exclusionReason, d as probeQuota, f as quotaExceeded, g as resolveCapabilityRun, h as recordBudgetCooldowns, i as capabilityForRun, l as isQuotaFailure, m as readRoutingState, n as NoProviderError, o as cooldownRemaining, p as quotaSkipThreshold, r as autoOrder, s as entryModel, t as BUDGET_COOLDOWN_MIN, u as nextAutoProvider, v as setCooldown, y as writeRoutingState } from "./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";
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 { _ as resolveTarget, a as clearCooldown, c as exclusionReason, d as probeQuota, f as quotaExceeded, g as resolveCapabilityRun, h as recordBudgetCooldowns, i as capabilityForRun, l as isQuotaFailure, m as readRoutingState, n as NoProviderError, o as cooldownRemaining, p as quotaSkipThreshold, r as autoOrder, s as entryModel, t as BUDGET_COOLDOWN_MIN, u as nextAutoProvider, v as setCooldown, y as writeRoutingState } from "./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
14
 
15
15
  export { BUDGET_COOLDOWN_MIN, NoProviderError, autoOrder, capabilityForRun, clearCooldown, cooldownRemaining, entryModel, exclusionReason, isQuotaFailure, nextAutoProvider, probeQuota, quotaExceeded, quotaSkipThreshold, readRoutingState, recordBudgetCooldowns, resolveCapabilityRun, resolveTarget, setCooldown, writeRoutingState };
@@ -1,27 +1,27 @@
1
1
  import { g as paiHomePath, l as claudeHomeDir } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { Ct as withSummary, I as LOOPBACK_HOST, N as resolveModelCapability, P as resolveProviderKey, St as sessionNote, bt as ledgerEscalate, c as WorkersConfigError, f as escalationCloud, ft as parseEntry, gt as certainContextWindow, h as isModelCapability, j as readWorkersSection, k as providerKeyPath, l as assertProviderRunnable, m as isLocalProvider, ot as applyRouteOverrides, p as getProviderOrNative, t as ANTHROPIC_NATIVE, tt as workersYamlPath, u as classModelCapability, v as nativeAnthropicModels, wt as appendLedger, xt as planEscalation } from "./config-XpZWOYOG.mjs";
3
- import { _ as effectiveWorkersYamlRaw } from "./config-Bu1_vbY8.mjs";
4
- import { i as ledgerPath, n as ensureNoMcpConfig, r as eventsPath, u as workersLogDir } from "./paths-CHifubDh.mjs";
5
- import { A as applyScratchEnv, C as worktreeWanted, S as worktreeSystemPrompt, _ as ownedTree, a as archiveEmptyResult, f as gcWorktreesThrottled, h as markResumed, i as adoptTree, j as scratchPromptLine, o as commitLines, p as inPlaceSystemPrompt, r as addWorktree, t as GATE_MARK, v as recordWorktree, w as worktreesDir, x as worktreeRefusesStart, y as salvageOnExit } from "./worktree-CRs2gyg0.mjs";
6
- import { C as nowStamp, D as pidAlive, E as parseSleepSecs, J as loadPreamble, Q as appendSystemPromptArgs, S as newWorkerId, X as preambleLine, Y as preambleBlock, Z as projectRoot, a as UNLABELED, d as describeTool, g as isLive, k as saveStatus, nt as shortText, rt as stripPromptValues, tt as parseRunnerArgs, v as loadStatus, x as markStartFailed, y as loadStatuses } from "./status-ggJ7lgVg.mjs";
7
- import { D as readMcpServers, E as mcpServersFromToolGrants, O as writeMcpConfig, S as inputSideTokens, T as grantsChrome, d as poolIneligibleReason, g as postTaskToPool, h as poolSettings, n as SLOT_TOOLS, r as UNIT_MARKER, t as SHARED_MARKER, w as expandMcpNames, y as reloadInProgress } from "./pool-Dh-q3iJi.mjs";
8
- import { i as itermUuid, o as resolveSession, s as resolveSpawnerSession } from "./scope-D-h6F6DN.mjs";
9
- import { Cn as PORT_TIMEOUT_MS, Ct as removeRunSettings, Dn as httpModelsCheck, Dt as routerPort, E as budgetCache, Qt as fallThroughReason, S as applySessionProviderEnv, Zt as committedFallThrough, _ as resolveTarget, an as detectSessionName, bn as resolveLocalProvider, bt as routeLoopbackViaRouter, cn as getProfile, dt as claudeCommand, fn as LOCAL_MECHANISM_LINE, ft as claudeSettingsExtra, g as resolveCapabilityRun, h as recordBudgetCooldowns, i as capabilityForRun, k as budgetFull, l as isQuotaFailure, lt as addSchedulingHeaders, n as NoProviderError, o as cooldownRemaining, on as BATCH_ENV, pn as NoLocalServerError, pt as isLoopbackProvider, r as autoOrder, rn as routeRun, u as nextAutoProvider, ut as buildRunEnv, v as setCooldown, vn as probeLoopback, vt as pinnedSettings, wt as writePrivateFile, x as SESSION_WORKER_PROVIDER_ENV, xn as resolveRunnerProvider, yn as providerHostPort } from "./routing-BAAST9vT.mjs";
2
+ import { Ct as planEscalation, Et as appendLedger, F as resolveProviderKey, M as readWorkersSection, P as resolveModelCapability, R as LOOPBACK_HOST, St as ledgerEscalate, Tt as withSummary, c as WorkersConfigError, ct as applyRouteOverrides, f as escalationCloud, h as isModelCapability, j as readWorkersCached, k as providerKeyPath, l as assertProviderRunnable, m as isLocalProvider, mt as parseEntry, p as getProviderOrNative, rt as workersYamlPath, t as ANTHROPIC_NATIVE, u as classModelCapability, v as nativeAnthropicModels, vt as certainContextWindow, wt as sessionNote } from "./config-CST2uq1v.mjs";
3
+ import { _ as effectiveWorkersYamlRaw } from "./config-DYbyEe4-.mjs";
4
+ import { i as ledgerPath, n as ensureNoMcpConfig, r as eventsPath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
+ import { A as applyScratchEnv, C as worktreeWanted, S as worktreeSystemPrompt, _ as ownedTree, a as archiveEmptyResult, f as gcWorktreesThrottled, h as markResumed, i as adoptTree, j as scratchPromptLine, o as commitLines, p as inPlaceSystemPrompt, r as addWorktree, t as GATE_MARK, v as recordWorktree, w as worktreesDir, x as worktreeRefusesStart, y as salvageOnExit } from "./worktree-BY--Rgmy.mjs";
6
+ import { C as nowStamp, D as pidAlive, E as parseSleepSecs, J as loadPreamble, Q as appendSystemPromptArgs, S as newWorkerId, X as preambleLine, Y as preambleBlock, Z as projectRoot, a as UNLABELED, d as describeTool, g as isLive, k as saveStatus, nt as shortText, rt as stripPromptValues, tt as parseRunnerArgs, v as loadStatus, x as markStartFailed, y as loadStatuses } from "./status-COtzewKV.mjs";
7
+ import { D as readMcpServers, E as mcpServersFromToolGrants, O as writeMcpConfig, S as inputSideTokens, T as grantsChrome, d as poolIneligibleReason, g as postTaskToPool, h as poolSettings, n as SLOT_TOOLS, r as UNIT_MARKER, t as SHARED_MARKER, w as expandMcpNames, y as reloadInProgress } from "./pool-BZ94nFuq.mjs";
8
+ import { i as itermUuid, o as resolveSession, s as resolveSpawnerSession } from "./scope-D8HK6vU7.mjs";
9
+ import { An as httpModelsCheck, Cn as resolveLocalProvider, Ct as removeRunSettings, Dt as routerPort, E as budgetCache, En as PORT_TIMEOUT_MS, S as applySessionProviderEnv, Sn as providerHostPort, _ as resolveTarget, bt as routeLoopbackViaRouter, cn as detectSessionName, dn as getProfile, dt as claudeCommand, en as committedFallThrough, ft as claudeSettingsExtra, g as resolveCapabilityRun, gn as NoLocalServerError, h as recordBudgetCooldowns, hn as LOCAL_MECHANISM_LINE, i as capabilityForRun, k as budgetFull, l as isQuotaFailure, ln as BATCH_ENV, lt as addSchedulingHeaders, n as NoProviderError, o as cooldownRemaining, on as routeRun, pt as isLoopbackProvider, r as autoOrder, tn as fallThroughReason, u as nextAutoProvider, ut as buildRunEnv, v as setCooldown, vt as pinnedSettings, wn as resolveRunnerProvider, wt as writePrivateFile, x as SESSION_WORKER_PROVIDER_ENV, xn as probeLoopback } from "./routing-BlD_tKjW.mjs";
10
10
  import { t as maxOf } from "./min-max-DrSRUaWQ.mjs";
11
- import { b as readToolErrors, h as harnessToolErrorTexts, p as grantedToolNames, x as recordToolError } from "./tool-errors-7E13StWd.mjs";
12
- import { _ as workerContractPrompt, b as killProcessTree, c as checkProof, d as parseWorkerReport, f as promptTrailer, g as verifyReportChanges, h as verifyFailNote, l as newUntracked, m as untrackedPaths, o as AG2_REASK_TEXT, s as OPERATOR_MARK, u as noteTokenSentence, v as repairAndValidateAg2, x as processTree, y as validateAg2 } from "./wait-ByV0OyMZ.mjs";
13
- import { a as buildsDir, d as releaseBuildsOf } from "./caller-identity-yLFb7CKq.mjs";
14
- import { c as queuedText, d as resolveCap, h as staggerGate, m as recordWarmup, n as capacityGate, p as sessionScopeKey, t as admitCap } from "./capacity-DEveQdFV.mjs";
15
- import { n as tierProviderNames, t as isLocalCandidate } from "./local-candidate-DLdwQt0s.mjs";
11
+ import { b as readToolErrors, h as harnessToolErrorTexts, p as grantedToolNames, x as recordToolError } from "./tool-errors-DXJ70-sr.mjs";
12
+ import { _ as workerContractPrompt, b as killProcessTree, c as checkProof, d as parseWorkerReport, f as promptTrailer, g as verifyReportChanges, h as verifyFailNote, l as newUntracked, m as untrackedPaths, o as AG2_REASK_TEXT, s as OPERATOR_MARK, u as noteTokenSentence, v as repairAndValidateAg2, x as processTree, y as validateAg2 } from "./wait-ChpHKJZV.mjs";
13
+ import { a as buildsDir, d as releaseBuildsOf } from "./caller-identity-Bim8JT-D.mjs";
14
+ import { c as queuedText, d as resolveCap, h as staggerGate, m as recordWarmup, n as capacityGate, p as sessionScopeKey, r as capacityOf, t as admitCap } from "./capacity-CsZMkVyg.mjs";
15
+ import { n as tierProviderNames, t as isLocalCandidate } from "./local-candidate-Cp_bw4kK.mjs";
16
16
  import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
17
- import { i as getRegistryBackend } from "./factory-DjAAsqr_.mjs";
18
- import { c as ensureProxyRunning, i as detectCurrentModel, l as proxyPort } from "./launch-Jh5NVeNe.mjs";
19
- import { A as tail, Et as openOwnedPane, Kt as isHandoffMessage, Q as NoTerminalError, Wt as deliverHandoff, Xt as localFailures, _ as troublePolicy, _t as paneTitle, at as headlessAllowed, d as aibrokerMessenger, f as detachRun, h as originFromEnv, ht as resolveHostSession, it as followCommand, m as markRunDone, mt as realPaneOps, nt as closePaneForWorker, o as ownerOf, p as eventLine, r as returnControlsIfHeld, ut as openVerifiedPane, v as appendRunLog, z as gatePhaseName } from "./controls-CPoeudou.mjs";
20
- import { i as endFields, o as parentInfo, r as decideEndReason } from "./endreason-C577xIQz.mjs";
21
- import { A as resolveLimit, E as armDeadline, F as checkOrphanedChildren, I as isWorkerId, L as launchParent, M as blockedMsOf, O as deadlinePromptLine, P as assertChildAllowed, T as recordDenial, k as extendLimit, w as parseDenialText } from "./render-BYmQkuLd.mjs";
22
- import { t as createOperatorServer } from "./operator-CyuB3aVw.mjs";
23
- import { i as killTree } from "./kill-tree-EWYaEk5v.mjs";
24
- import { r as ensurePoolHost } from "./pool-cli-BggU8GRp.mjs";
17
+ import { i as getRegistryBackend } from "./factory-BV0MQA3T.mjs";
18
+ import { c as ensureProxyRunning, i as detectCurrentModel, l as proxyPort } from "./launch-DpQPZGsT.mjs";
19
+ import { A as tail, Et as openOwnedPane, Kt as isHandoffMessage, Q as NoTerminalError, Wt as deliverHandoff, Xt as localFailures, _ as troublePolicy, _t as paneTitle, at as headlessAllowed, d as aibrokerMessenger, f as detachRun, h as originFromEnv, ht as resolveHostSession, it as followCommand, m as markRunDone, mt as realPaneOps, nt as closePaneForWorker, o as ownerOf, p as eventLine, r as returnControlsIfHeld, ut as openVerifiedPane, v as appendRunLog, z as gatePhaseName } from "./controls-OiVVbe-f.mjs";
20
+ import { i as endFields, o as parentInfo, r as decideEndReason, t as appendStopEvent } from "./endreason-BqyyU7BH.mjs";
21
+ import { A as resolveLimit, E as armDeadline, F as checkOrphanedChildren, I as isWorkerId, L as launchParent, M as blockedMsOf, O as deadlinePromptLine, P as assertChildAllowed, T as recordDenial, k as extendLimit, w as parseDenialText } from "./render-Cz3BWIBO.mjs";
22
+ import { t as createOperatorServer } from "./operator-DrwWItVt.mjs";
23
+ import { i as killTree } from "./kill-tree-CcpsRLCZ.mjs";
24
+ import { r as ensurePoolHost } from "./pool-cli-B1eKySeN.mjs";
25
25
  import { closeSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, realpathSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
26
26
  import { createHash, randomBytes } from "node:crypto";
27
27
  import { dirname, join, resolve, sep } from "node:path";
@@ -936,6 +936,11 @@ function fireDeadline(logDir, status, ledger, limit) {
936
936
  minutes: limit.minutes,
937
937
  waitedMin: waited
938
938
  });
939
+ appendStopEvent(logDir, status.id, {
940
+ killed_by: "deadline",
941
+ forced: false,
942
+ reason: `${what} (timer: --max-minutes/--deadline, armed at spawn)`
943
+ });
939
944
  killTree(logDir, status.id, {
940
945
  skipRoot: true,
941
946
  by: "deadline",
@@ -1063,6 +1068,15 @@ async function finaliseRun(f) {
1063
1068
  loopStopped: !!loopStop
1064
1069
  });
1065
1070
  status.endReason = end.reason;
1071
+ if (end.reason === "pai-worker-kill" && !f.timedOut && end.killReason && !succeeded) {
1072
+ status.last = shortText(end.killReason, 90);
1073
+ report = {
1074
+ ...report ?? {},
1075
+ result: report?.result ?? "-",
1076
+ why: end.killReason,
1077
+ notes: [end.killReason, report?.notes ?? f.fallbackText].filter(Boolean).join("\n")
1078
+ };
1079
+ }
1066
1080
  status.claimsContinue = report?.result === "~";
1067
1081
  saveStatus(logDir, status);
1068
1082
  appendLedger(ledger, "WORKER-END", {
@@ -3412,10 +3426,10 @@ function resolveWorkers(args, ctx) {
3412
3426
  /** The live context: config, this session's profile, fresh budget readings (warmed best effort) and recorded cooldowns. */
3413
3427
  async function liveResolveCtx(env = process.env, warm = true) {
3414
3428
  const [{ readWorkersSection }, { budgetCache }, { readRoutingState }, { workersLogDir }] = await Promise.all([
3415
- import("./config-Cxi-aBf4.mjs"),
3416
- import("./budget-Dod6rnA9.mjs"),
3417
- import("./routing-CENt4HH1.mjs"),
3418
- import("./paths-CFHTloSe.mjs")
3429
+ import("./config-h5qK3fst.mjs"),
3430
+ import("./budget-DX-VIWGf.mjs"),
3431
+ import("./routing-D27jxj9x.mjs"),
3432
+ import("./paths-DBd78I7Z.mjs")
3419
3433
  ]);
3420
3434
  const { workers } = readWorkersSection();
3421
3435
  const profile = getProfile(await detectSessionName(env));
@@ -3730,6 +3744,14 @@ async function runGates(a, wid, status) {
3730
3744
  provider: target.providerName
3731
3745
  },
3732
3746
  cap: admitCap(target.provider.maxConcurrent, target.provider.conversationSlots, isLocalProvider(target.provider.baseUrl)),
3747
+ capOf: () => {
3748
+ try {
3749
+ const p = readWorkersCached().providers[target.providerName] ?? target.provider;
3750
+ return admitCap(p.maxConcurrent, p.conversationSlots, isLocalProvider(p.baseUrl), capacityOf(config.capacity));
3751
+ } catch {
3752
+ return;
3753
+ }
3754
+ },
3733
3755
  config: config.capacity,
3734
3756
  disabled: a.noQueue,
3735
3757
  priority: a.priority,
@@ -4882,7 +4904,7 @@ async function runWorker(opts) {
4882
4904
  if (gc?.length) process.stderr.write(`pai worker: archived ${gc.length} leftover worktree(s) (pai worker gc)\n`);
4883
4905
  } catch {}
4884
4906
  if (opts.className === "plan" && !opts._planner) {
4885
- const { runPlanner } = await import("./planner-BmFACdLa.mjs");
4907
+ const { runPlanner } = await import("./planner-K0mFrCpL.mjs");
4886
4908
  return runPlanner(opts);
4887
4909
  }
4888
4910
  const parent = launchParent(opts.parent);
@@ -5106,4 +5128,4 @@ setRunWorker(runWorker);
5106
5128
 
5107
5129
  //#endregion
5108
5130
  export { routerPidFile as A, usageContextTokens as B, workerUsage as C, routerHandoverFile as D, probeRouter as E, startHandover as F, testProvider as H, paneWaiver as I, launchPane as L, routerSwapArgs as M, runRouterTick as N, routerIsStale as O, spawnRouter as P, noTerminalReasons as R, usageJson as S, projectLaunchConfig as T, endProcesses as U, printResult as V, findWorktreeOrphans as W, stopLaunchedWorkers as _, resolveWorkers as a, renderUsage as b, reportOriginWithHost as c, capture as d, dirtyPaths as f, realRunnerDeps as g, realCommitsAhead as h, liveResolveCtx as i, routerRunningPid as j, routerLogFile as k, runMessenger as l, mergeBranch as m, LocalProviderRefusedError as n, sessionWorkersLine as o, launchWorker as p, PoolRefusedError as r, finishDetached as s, runWorker as t, startDetached as u, parseWhen as v, pinNotices as w, transcriptUsage as x, priceTableText as y, recordSystemJobStart as z };
5109
- //# sourceMappingURL=run-CSC7mgPf.mjs.map
5131
+ //# sourceMappingURL=run-AZVwceiU.mjs.map
@@ -1,10 +1,10 @@
1
1
  import { _ as warn, c as ok, i as err, n as dim, r as encodeDir, s as now, t as bold } from "./utils-J2b9y8PC.mjs";
2
2
  import { _ as resolvePaiFile, d as defaultPaiHomeDir, g as paiHomePath, m as migratePaiFile, u as claudeProjectsDir$1 } from "./runtime-paths-WsO9sJFc.mjs";
3
3
  import { a as slugify, i as parseSessionFilename, n as decodeEncodedDir, t as buildEncodedDirMap } from "./migrate-DrA_OwlZ.mjs";
4
- import { D as readJsonStrict, O as writeJsonAtomic, o as expandHome } from "./config-Bu1_vbY8.mjs";
5
- import { a as unregistrableReason, o as workerWorktreesRoot, r as pruneWorktreeProjects } from "./registrable-DpyTtajg.mjs";
6
- import { n as ensurePaiMarker, t as discoverPaiMarkers } from "./pai-marker-BcZyJguM.mjs";
7
- import { i as getRegistryBackend } from "./factory-DjAAsqr_.mjs";
4
+ import { O as readJsonStrict, k as writeJsonAtomic, o as expandHome } from "./config-DYbyEe4-.mjs";
5
+ import { a as unregistrableReason, o as workerWorktreesRoot, r as pruneWorktreeProjects } from "./registrable-CXBBpUcz.mjs";
6
+ import { n as ensurePaiMarker, t as discoverPaiMarkers } from "./pai-marker-DLKJ9Yr5.mjs";
7
+ import { i as getRegistryBackend } from "./factory-BV0MQA3T.mjs";
8
8
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
9
9
  import { basename, join, resolve } from "node:path";
10
10
  import { homedir } from "node:os";
@@ -718,4 +718,4 @@ async function cmdScan(opts = {}) {
718
718
 
719
719
  //#endregion
720
720
  export { resolveHome as a, upsertSession as c, scanTranscriptFolders as d, transcriptFiles as f, performScan as i, claudeProjectsDir as l, loadScanConfig as n, saveScanConfig as o, migrateScanConfig as r, upsertProject as s, cmdScan as t, findMovedProjects as u };
721
- //# sourceMappingURL=scan-C_Y5W9py.mjs.map
721
+ //# sourceMappingURL=scan-C3uotg_f.mjs.map
@@ -1,6 +1,6 @@
1
- import { j as readWorkersSection } from "./config-XpZWOYOG.mjs";
2
- import { c as slotCurrentPath, u as workersLogDir } from "./paths-CHifubDh.mjs";
3
- import { _ as isTerminal, v as loadStatus } from "./status-ggJ7lgVg.mjs";
1
+ import { M as readWorkersSection } from "./config-CST2uq1v.mjs";
2
+ import { c as slotCurrentPath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
3
+ import { _ as isTerminal, v as loadStatus } from "./status-COtzewKV.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
  import { homedir } from "node:os";
@@ -221,4 +221,4 @@ function terminalHasName(name, term, registryPath = AIBROKER_REGISTRY) {
221
221
 
222
222
  //#endregion
223
223
  export { ownerSessionName as a, scopeKey as c, terminalHasName as d, workerInScope as f, itermUuid as i, sessionMapPath as l, currentTabKey as n, resolveSession as o, currentWorkerId as p, itermForClaudeSession as r, resolveSpawnerSession as s, AIBROKER_REGISTRY as t, sessionTag as u };
224
- //# sourceMappingURL=scope-D-h6F6DN.mjs.map
224
+ //# sourceMappingURL=scope-D8HK6vU7.mjs.map
@@ -1,22 +1,22 @@
1
1
  import { _ as warn, a as fmtDate, c as ok, d as scaffoldProjectDirs, f as shortenPath, i as err, l as renderTable, n as dim, o as header, p as slugFromPath, r as encodeDir, s as now, t as bold, u as resolvePath } from "./utils-J2b9y8PC.mjs";
2
2
  import { u as claudeProjectsDir } from "./runtime-paths-WsO9sJFc.mjs";
3
- import { b as nativeOrchestratorModel, j as readWorkersSection, p as getProviderOrNative, t as ANTHROPIC_NATIVE, vt as stripModelVariant, wt as appendLedger } from "./config-XpZWOYOG.mjs";
4
- import { i as ledgerPath, u as workersLogDir } from "./paths-CHifubDh.mjs";
5
- import { M as trustProjectPath } from "./pool-Dh-q3iJi.mjs";
6
- import { a as unregistrableReason } from "./registrable-DpyTtajg.mjs";
7
- import { n as ensurePaiMarker } from "./pai-marker-BcZyJguM.mjs";
3
+ import { Et as appendLedger, M as readWorkersSection, b as nativeOrchestratorModel, bt as stripModelVariant, p as getProviderOrNative, t as ANTHROPIC_NATIVE } from "./config-CST2uq1v.mjs";
4
+ import { i as ledgerPath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
+ import { M as trustProjectPath } from "./pool-BZ94nFuq.mjs";
6
+ import { a as unregistrableReason } from "./registrable-CXBBpUcz.mjs";
7
+ import { n as ensurePaiMarker } from "./pai-marker-DLKJ9Yr5.mjs";
8
8
  import { t as STOP_WORDS } from "./stop-words-DSEYQdNe.mjs";
9
- import { cn as getProfile, sn as SESSION_NAME_ENV, x as SESSION_WORKER_PROVIDER_ENV, xt as routeVerdictLine } from "./routing-BAAST9vT.mjs";
9
+ import { dn as getProfile, un as SESSION_NAME_ENV, x as SESSION_WORKER_PROVIDER_ENV, xt as routeVerdictLine } from "./routing-BlD_tKjW.mjs";
10
10
  import { n as OPT, t as CliError } from "./define-CjJsmq-6.mjs";
11
- import { i as getRegistryBackend } from "./factory-DjAAsqr_.mjs";
12
- import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-9CZNO0yf.mjs";
13
- import { a as getSessionCount, c as upsertTag$1, i as getProjectTags, n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier, t as getLastSessionDate } from "./helpers-BD6V-p9w.mjs";
14
- import { a as resolveHome, n as loadScanConfig } from "./scan-C_Y5W9py.mjs";
15
- import { n as buildLaunchPlan, o as launchableProviderNames, s as maskLaunchEnv, t as LaunchError } from "./launch-Jh5NVeNe.mjs";
16
- import { a as colorEnabled, f as renderTable$1, i as saveBudgetSnapshot, n as readBudget, o as makeStyle, r as readBudgetSnapshot, t as providerHealth } from "./health-Dnym-qcT.mjs";
17
- import { d as printExitDir, i as probeResume, u as transcriptModelFor } from "./launch-CXVlZjHt.mjs";
11
+ import { i as getRegistryBackend } from "./factory-BV0MQA3T.mjs";
12
+ import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-CHuxFrLy.mjs";
13
+ import { a as getSessionCount, c as upsertTag$1, i as getProjectTags, n as getProject$1, o as requireProject, r as getProjectAliases, s as resolveIdentifier, t as getLastSessionDate } from "./helpers-CvbYEKoD.mjs";
14
+ import { a as resolveHome, n as loadScanConfig } from "./scan-C3uotg_f.mjs";
15
+ import { n as buildLaunchPlan, o as launchableProviderNames, s as maskLaunchEnv, t as LaunchError } from "./launch-DpQPZGsT.mjs";
16
+ import { a as colorEnabled, f as renderTable$1, i as saveBudgetSnapshot, n as readBudget, o as makeStyle, r as readBudgetSnapshot, t as providerHealth } from "./health-kufVIf6i.mjs";
17
+ import { d as printExitDir, i as probeResume, u as transcriptModelFor } from "./launch-UPQBoW2q.mjs";
18
18
  import { n as fetchLiveSessions } from "./aibroker-client-CQPGqLxL.mjs";
19
- import { a as resolveSessionByNameOrId, s as scanSessions, t as fmtAge } from "./session-scan-W-gbwJHM.mjs";
19
+ import { a as resolveSessionByNameOrId, s as scanSessions, t as fmtAge } from "./session-scan-BmnjSReu.mjs";
20
20
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
21
21
  import { basename, dirname, join, resolve } from "node:path";
22
22
  import chalk from "chalk";
@@ -1066,7 +1066,7 @@ async function getSessionTags(registryBackend, sessionId) {
1066
1066
  * Session CRUD commands: list, info, rename, slug, tag, route, active, auto-route.
1067
1067
  */
1068
1068
  async function cmdList(projectSlug, opts) {
1069
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1069
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1070
1070
  const registryBackend = await getRegistryBackend();
1071
1071
  const limit = parseInt(opts.limit ?? "20", 10);
1072
1072
  let project;
@@ -1131,7 +1131,7 @@ async function cmdList(projectSlug, opts) {
1131
1131
  console.log(dim(` ${rows.length} session(s) shown (limit: ${limit})`));
1132
1132
  }
1133
1133
  async function cmdInfo(projectSlug, sessionNumber) {
1134
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1134
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1135
1135
  const registryBackend = await getRegistryBackend();
1136
1136
  const project = await getProject(registryBackend, projectSlug);
1137
1137
  if (!project) {
@@ -1155,7 +1155,7 @@ async function cmdInfo(projectSlug, sessionNumber) {
1155
1155
  console.log();
1156
1156
  }
1157
1157
  async function cmdRename(projectSlug, numberOrLatest, newSlug) {
1158
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1158
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1159
1159
  await cmdRenameWith(await getRegistryBackend(), projectSlug, numberOrLatest, newSlug);
1160
1160
  }
1161
1161
  /** Strips path separators and ".." so a title can never leave the notes dir. */
@@ -1242,7 +1242,7 @@ async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSl
1242
1242
  console.log();
1243
1243
  }
1244
1244
  async function cmdSlug(projectSlug, numberOrLatest, opts) {
1245
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1245
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1246
1246
  const registryBackend = await getRegistryBackend();
1247
1247
  const project = await getProject(registryBackend, projectSlug);
1248
1248
  if (!project) {
@@ -1272,7 +1272,7 @@ async function cmdSlug(projectSlug, numberOrLatest, opts) {
1272
1272
  }
1273
1273
  }
1274
1274
  async function cmdTag(projectSlug, sessionNumber, rawTags) {
1275
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1275
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1276
1276
  const registryBackend = await getRegistryBackend();
1277
1277
  const project = await getProject(registryBackend, projectSlug);
1278
1278
  if (!project) {
@@ -1312,7 +1312,7 @@ async function cmdTag(projectSlug, sessionNumber, rawTags) {
1312
1312
  console.log();
1313
1313
  }
1314
1314
  async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
1315
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1315
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1316
1316
  const registryBackend = await getRegistryBackend();
1317
1317
  const project = await getProject(registryBackend, projectSlug);
1318
1318
  if (!project) {
@@ -1354,7 +1354,7 @@ async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
1354
1354
  console.log();
1355
1355
  }
1356
1356
  async function cmdActive(opts) {
1357
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
1357
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
1358
1358
  const registryBackend = await getRegistryBackend();
1359
1359
  const minutes = parseInt(opts.minutes ?? "60", 10);
1360
1360
  const cutoff = Date.now() - minutes * 60 * 1e3;
@@ -1441,9 +1441,9 @@ async function cmdActive(opts) {
1441
1441
  ], rows));
1442
1442
  }
1443
1443
  async function cmdAutoRoute(opts) {
1444
- const { autoRoute, formatAutoRouteJson } = await import("./auto-route-CjjQqU1o.mjs");
1445
- const { getRegistryBackend, createStorageBackend } = await import("./factory-Bsib-qDG.mjs");
1446
- const { loadConfig } = await import("./config-DtENJ6cL.mjs");
1444
+ const { autoRoute, formatAutoRouteJson } = await import("./auto-route-DWYK_0i0.mjs");
1445
+ const { getRegistryBackend, createStorageBackend } = await import("./factory-DeASMV7Z.mjs");
1446
+ const { loadConfig } = await import("./config-Dv3t7xnT.mjs");
1447
1447
  const config = loadConfig();
1448
1448
  const registryBackend = await getRegistryBackend();
1449
1449
  const federation = await createStorageBackend(config);
@@ -1854,7 +1854,7 @@ const newCommand = {
1854
1854
  const name = ctx.opts.name;
1855
1855
  const withSetup = ctx.opts.with;
1856
1856
  if (withSetup) {
1857
- const { runNewWith } = await import("./root-FtJsxYnm.mjs");
1857
+ const { runNewWith } = await import("./root-Bfb1zgwE.mjs");
1858
1858
  return runNewWith({
1859
1859
  dir,
1860
1860
  with: withSetup,
@@ -1960,4 +1960,4 @@ const renameTop = {
1960
1960
 
1961
1961
  //#endregion
1962
1962
  export { cmdAdd as A, cmdRebind as B, assertAvailable as C, execHarness as D, dryRunText as E, cmdEdit as F, cmdUnarchive as H, cmdGo as I, cmdInfo$1 as L, cmdArchive as M, cmdConsolidate as N, looksLikePath as O, cmdDetect as P, cmdList$1 as R, legacy as S, buildHarness as T, findMovedPath as U, cmdTag$1 as V, cmdList as _, newTop as a, cmdSlug as b, planOpen as c, runNewDefault as d, sessionCommand as f, cmdInfo as g, cmdAutoRoute as h, lsCommand as i, cmdAlias as j, prepareDir as k, renameTop as l, cmdActive as m, collectRows as n, oneLine as o, sessionDir as p, collectView as r, openTop as s, applyProfileChat as t, rowsTable as u, cmdRename as v, modelFor as w, cmdTag as x, cmdRoute as y, cmdMove as z };
1963
- //# sourceMappingURL=session-8iqQDkqb.mjs.map
1963
+ //# sourceMappingURL=session-BAfypQb9.mjs.map
@@ -0,0 +1,35 @@
1
+ import "./utils-J2b9y8PC.mjs";
2
+ import "./migrate-DrA_OwlZ.mjs";
3
+ import "./config-CST2uq1v.mjs";
4
+ import "./config-DYbyEe4-.mjs";
5
+ import "./paths-DS5VQKoR.mjs";
6
+ import "./worktree-BY--Rgmy.mjs";
7
+ import "./status-COtzewKV.mjs";
8
+ import "./pool-BZ94nFuq.mjs";
9
+ import "./registrable-CXBBpUcz.mjs";
10
+ import "./pai-marker-DLKJ9Yr5.mjs";
11
+ import "./helpers-CRuBUas3.mjs";
12
+ import "./scope-D8HK6vU7.mjs";
13
+ import "./routing-BlD_tKjW.mjs";
14
+ import "./tool-errors-DXJ70-sr.mjs";
15
+ import "./wait-ChpHKJZV.mjs";
16
+ import "./local-tiers-BtdEEe5n.mjs";
17
+ import "./caller-identity-Bim8JT-D.mjs";
18
+ import "./capacity-CsZMkVyg.mjs";
19
+ import "./local-instances-bdCNNSsL.mjs";
20
+ import "./local-candidate-Cp_bw4kK.mjs";
21
+ import "./factory-BV0MQA3T.mjs";
22
+ import "./postgres-C-T5OWer.mjs";
23
+ import "./embedding-gate-CTAk8STe.mjs";
24
+ import "./embeddings-BVq3esBF.mjs";
25
+ import "./router-CQSc3lk3.mjs";
26
+ import "./detect-CHuxFrLy.mjs";
27
+ import "./helpers-CvbYEKoD.mjs";
28
+ import "./scan-C3uotg_f.mjs";
29
+ import { a as newTop, c as planOpen, d as runNewDefault, f as sessionCommand, i as lsCommand, l as renameTop, n as collectRows, o as oneLine, p as sessionDir, r as collectView, s as openTop, t as applyProfileChat, u as rowsTable } from "./session-BAfypQb9.mjs";
30
+ import "./launch-DpQPZGsT.mjs";
31
+ import "./health-kufVIf6i.mjs";
32
+ import "./launch-UPQBoW2q.mjs";
33
+ import "./session-scan-BmnjSReu.mjs";
34
+
35
+ export { runNewDefault };
@@ -1,9 +1,9 @@
1
1
  import { h as smartDecodeDir } from "./utils-J2b9y8PC.mjs";
2
2
  import { _ as resolvePaiFile, f as legacyConfigDir, g as paiHomePath, l as claudeHomeDir, m as migratePaiFile, u as claudeProjectsDir } from "./runtime-paths-WsO9sJFc.mjs";
3
- import { j as readWorkersSection } from "./config-XpZWOYOG.mjs";
4
- import { u as workersLogDir } from "./paths-CHifubDh.mjs";
3
+ import { M as readWorkersSection } from "./config-CST2uq1v.mjs";
4
+ import { u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
5
  import { t as fmtAge$1 } from "./fmt-age-ByDkvkoU.mjs";
6
- import { i as itermUuid, l as sessionMapPath, t as AIBROKER_REGISTRY } from "./scope-D-h6F6DN.mjs";
6
+ import { i as itermUuid, l as sessionMapPath, t as AIBROKER_REGISTRY } from "./scope-D8HK6vU7.mjs";
7
7
  import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
8
8
  import { basename, join } from "node:path";
9
9
 
@@ -137,7 +137,7 @@ function loadBrokerNames(registryPath = AIBROKER_REGISTRY, mapPath) {
137
137
  /** Build encoded_dir → root_path map from PAI registry (authoritative cwd). */
138
138
  async function buildRegistryRootPathMap() {
139
139
  try {
140
- const { getRegistryBackend } = await import("./factory-Bsib-qDG.mjs");
140
+ const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
141
141
  const projects = await (await getRegistryBackend()).listProjects();
142
142
  const map = /* @__PURE__ */ new Map();
143
143
  for (const p of projects) if (p.encoded_dir) map.set(p.encoded_dir, p.root_path);
@@ -870,4 +870,4 @@ function transcriptCustomTitle(claudeSessionId, projectsDir = CLAUDE_PROJECTS_DI
870
870
 
871
871
  //#endregion
872
872
  export { resolveSessionByNameOrId as a, transcriptCustomTitle as c, resolveFriendlyName as i, loadBrokerNames as n, scanCacheFilePath as o, migrateSessionScanCache as r, scanSessions as s, fmtAge as t };
873
- //# sourceMappingURL=session-scan-W-gbwJHM.mjs.map
873
+ //# sourceMappingURL=session-scan-BmnjSReu.mjs.map
@@ -0,0 +1,9 @@
1
+ import "./utils-J2b9y8PC.mjs";
2
+ import "./config-CST2uq1v.mjs";
3
+ import "./config-DYbyEe4-.mjs";
4
+ import "./paths-DS5VQKoR.mjs";
5
+ import "./status-COtzewKV.mjs";
6
+ import "./scope-D8HK6vU7.mjs";
7
+ import { a as resolveSessionByNameOrId, c as transcriptCustomTitle, i as resolveFriendlyName, n as loadBrokerNames, o as scanCacheFilePath, r as migrateSessionScanCache, s as scanSessions, t as fmtAge } from "./session-scan-BmnjSReu.mjs";
8
+
9
+ export { loadBrokerNames, transcriptCustomTitle };