@tekmidian/pai 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/{aibroker-client-CQPGqLxL.mjs → aibroker-client-CXsyC7A8.mjs} +2 -2
  3. package/dist/aibroker-client-ChB7gSxV.mjs +3 -0
  4. package/dist/auto-route-Bc8xP6TQ.mjs +11 -0
  5. package/dist/{auto-route-DUYr57rs.mjs → auto-route-YaEGVrFl.mjs} +2 -2
  6. package/dist/budget-DEiebT2A.mjs +15 -0
  7. package/dist/{caller-identity-Bim8JT-D.mjs → caller-identity-C6Nc96iM.mjs} +4 -4
  8. package/dist/{capacity-CsZMkVyg.mjs → capacity-B2PgKAg4.mjs} +65 -5
  9. package/dist/{chain-Dzz6xcKH.mjs → chain-CtK49-Ma.mjs} +5 -5
  10. package/dist/cli/index.mjs +2102 -282
  11. package/dist/{cockpit-actions-BgsiNcUY.mjs → cockpit-actions-C73mJAJ8.mjs} +18 -18
  12. package/dist/{cockpit-actions-BTA1njMO.mjs → cockpit-actions-D1OPP6Es.mjs} +26 -26
  13. package/dist/cockpit-memory-CLHZD64W.mjs +20 -0
  14. package/dist/config/defaults/config.yaml +18 -1
  15. package/dist/{config-CST2uq1v.mjs → config-Bz8pAU5Q.mjs} +3 -3
  16. package/dist/{config-Dv3t7xnT.mjs → config-DHgPx3ER.mjs} +1 -1
  17. package/dist/{config-h5qK3fst.mjs → config-DLmyEK2q.mjs} +2 -2
  18. package/dist/{config-DYbyEe4-.mjs → config-SlZ-Z52i.mjs} +3 -2
  19. package/dist/{controls-OiVVbe-f.mjs → controls-rIItFeIJ.mjs} +59 -66
  20. package/dist/daemon/index.mjs +40 -40
  21. package/dist/daemon-176qA79N.mjs +46 -0
  22. package/dist/{daemon-C1dycZ3W.mjs → daemon-SoUvPUOf.mjs} +79 -31
  23. package/dist/daemon-mcp/index.mjs +49 -38
  24. package/dist/detect-C8nFP-kR.mjs +10 -0
  25. package/dist/{detect-CHuxFrLy.mjs → detect-DLjeYwnt.mjs} +2 -2
  26. package/dist/{embed-pass-DtVF2fOV.mjs → embed-pass-CN1D8MXl.mjs} +5 -5
  27. package/dist/{embedding-gate-B98PK_wz.mjs → embedding-gate-BVQvUmox.mjs} +2 -2
  28. package/dist/{embedding-gate-CTAk8STe.mjs → embedding-gate-iq0oQEkF.mjs} +3 -3
  29. package/dist/{endreason-BqyyU7BH.mjs → endreason-C2-hYK0_.mjs} +4 -4
  30. package/dist/{factory-BV0MQA3T.mjs → factory-CYwa0jYj.mjs} +6 -6
  31. package/dist/factory-DFwez99M.mjs +9 -0
  32. package/dist/{fallback-Bj2cyVk_.mjs → fallback-CwPSCrX8.mjs} +9 -231
  33. package/dist/{health-kufVIf6i.mjs → health-D0mUAVdw.mjs} +5 -5
  34. package/dist/{helpers-CvbYEKoD.mjs → helpers-Dj2nY56t.mjs} +2 -2
  35. package/dist/{helpers-WV8tdQHM.mjs → helpers-DyHKAwrW.mjs} +6 -6
  36. package/dist/hooks/capture-all-events.mjs +68 -3
  37. package/dist/hooks/capture-tool-output.mjs +68 -3
  38. package/dist/hooks/handoff-link.mjs +128 -0
  39. package/dist/hooks/load-project-context.mjs +1 -1
  40. package/dist/hooks/security-validator.mjs +840 -88
  41. package/dist/hooks/supervision-banner.mjs +186 -48
  42. package/dist/hooks/worker-guard.mjs +57 -1
  43. package/dist/hooks/worker-note.mjs +68 -3
  44. package/dist/hooks/worker-pool-host.mjs +1417 -224
  45. package/dist/hooks/worker-status-line.mjs +209 -70
  46. package/dist/index.mjs +9 -9
  47. package/dist/{ipc-client-CnYEF31R.mjs → ipc-client-CmagIFLh.mjs} +2 -2
  48. package/dist/{ipc-client-DN7EvoVo.mjs → ipc-client-DmbSIBUK.mjs} +1 -1
  49. package/dist/{kill-tree-CcpsRLCZ.mjs → kill-tree-DPiMscaY.mjs} +8 -8
  50. package/dist/kill-tree-Dxei6qlR.mjs +10 -0
  51. package/dist/{launch-UPQBoW2q.mjs → launch-BZT3JDoZ.mjs} +3 -3
  52. package/dist/{launch-DpQPZGsT.mjs → launch-Bn2Zf90h.mjs} +3 -3
  53. package/dist/{indexer-backend-B2vtFl38.mjs → lessons-CFVU0cwA.mjs} +262 -43
  54. package/dist/{local-candidate-Cp_bw4kK.mjs → local-candidate-DFd4pp-w.mjs} +3 -3
  55. package/dist/{local-instances-bdCNNSsL.mjs → local-instances-DhF4_sV2.mjs} +2 -2
  56. package/dist/{local-instances-B-c-CxzP.mjs → local-instances-KTh8IeOT.mjs} +4 -4
  57. package/dist/{local-tiers-BtdEEe5n.mjs → local-tiers-CqwGUcEn.mjs} +3 -3
  58. package/dist/{local-tiers-OBqAAfOg.mjs → local-tiers-DSlIYvvm.mjs} +3 -3
  59. package/dist/{main-config-ops-BYsK3BxM.mjs → main-config-ops-rda08BCD.mjs} +3 -3
  60. package/dist/{main-resolver-CAC3xfZM.mjs → main-resolver-BKwI0I6H.mjs} +18 -18
  61. package/dist/{migrate-DrA_OwlZ.mjs → migrate-C2z1YmWC.mjs} +2 -2
  62. package/dist/{model-inventory-BuTpi9a6.mjs → model-inventory-BXv15B0d.mjs} +13 -13
  63. package/dist/{models-add-CJx2YAwh.mjs → models-add-5yXTyz3g.mjs} +38 -38
  64. package/dist/operator-Bmv5tiHQ.mjs +7 -0
  65. package/dist/{operator-DrwWItVt.mjs → operator-Br6GeswF.mjs} +2 -2
  66. package/dist/{pai-marker-DLKJ9Yr5.mjs → pai-marker-D6OoVbM_.mjs} +2 -2
  67. package/dist/{pane-audit-wv9UkyCe.mjs → pane-audit-DLYy9-4g.mjs} +13 -23
  68. package/dist/{paths-DS5VQKoR.mjs → paths-CypxFTfn.mjs} +4 -4
  69. package/dist/{paths-DBd78I7Z.mjs → paths-DIOwNcj-.mjs} +3 -3
  70. package/dist/{planner-K0mFrCpL.mjs → planner-BzZ_2lc-.mjs} +29 -29
  71. package/dist/{pool-BZ94nFuq.mjs → pool-9EsbKD-U.mjs} +2 -2
  72. package/dist/{pool-cli-BjYQDfx6.mjs → pool-cli-Cy5mlycP.mjs} +6 -6
  73. package/dist/{pool-cli-B1eKySeN.mjs → pool-cli-Db0uDwB9.mjs} +5 -5
  74. package/dist/{postgres-CBHY5PIi.mjs → postgres-B1B80bcj.mjs} +3 -3
  75. package/dist/{postgres-C-T5OWer.mjs → postgres-BL5oBBgY.mjs} +3 -3
  76. package/dist/{project-setup-pIPHZaXf.mjs → project-setup-DHxdJjEc.mjs} +24 -25
  77. package/dist/providers-BH6hQYbU.mjs +16 -0
  78. package/dist/{providers-Dzx5GAUI.mjs → providers-BNV7CzC-.mjs} +6 -6
  79. package/dist/{query-feedback-DN52N9C5.mjs → query-feedback-BWl2HRwN.mjs} +2 -2
  80. package/dist/registrable-BwFiqazy.mjs +9 -0
  81. package/dist/{registrable-CXBBpUcz.mjs → registrable-Dxs4oKIj.mjs} +4 -4
  82. package/dist/render-DVGXpfaT.mjs +13 -0
  83. package/dist/render-jPpMrudf.mjs +2240 -0
  84. package/dist/root-C8cxhdn9.mjs +36 -0
  85. package/dist/{root-bG48WVpW.mjs → root-DmOzMeSv.mjs} +10 -10
  86. package/dist/route-table-COAmc1nB.mjs +15 -0
  87. package/dist/{router-CQSc3lk3.mjs → router-D2476pOp.mjs} +2 -2
  88. package/dist/{router-DwHJRgG9.mjs → router-ghujlEFb.mjs} +1 -1
  89. package/dist/{routing-D27jxj9x.mjs → routing-B_cg1_Xx.mjs} +13 -13
  90. package/dist/{routing-BlD_tKjW.mjs → routing-aJKMIagQ.mjs} +15 -15
  91. package/dist/{run-AZVwceiU.mjs → run-DE9Q0ldN.mjs} +47 -31
  92. package/dist/{runtime-paths-WsO9sJFc.mjs → runtime-paths-twfV23YL.mjs} +2 -2
  93. package/dist/{scan-C3uotg_f.mjs → scan-CNMcltOX.mjs} +7 -7
  94. package/dist/{scope-D8HK6vU7.mjs → scope-BTWstJ1B.mjs} +4 -4
  95. package/dist/session-DgZifjLx.mjs +35 -0
  96. package/dist/{session-BAfypQb9.mjs → session-HBYOABWU.mjs} +28 -28
  97. package/dist/session-scan-BZxnYN1v.mjs +9 -0
  98. package/dist/{session-scan-BmnjSReu.mjs → session-scan-CX3MKCNg.mjs} +6 -6
  99. package/dist/{session-usage-oycSdiD3.mjs → session-usage-CCmPFFa6.mjs} +3 -3
  100. package/dist/{status-COtzewKV.mjs → status-Cecau8Ps.mjs} +9 -5
  101. package/dist/status-D52xC_i0.mjs +6 -0
  102. package/dist/{tool-errors-DXJ70-sr.mjs → tool-errors-BFw1gv-z.mjs} +2 -2
  103. package/dist/{tool-errors-B2LnIqR0.mjs → tool-errors-COM2JGEr.mjs} +6 -6
  104. package/dist/viewer-Ce-Xa9L3.mjs +22 -0
  105. package/dist/{viewer-BgGRqXfD.mjs → viewer-DvBg6N22.mjs} +16 -14
  106. package/dist/{wait-ChpHKJZV.mjs → wait-C5iWILj_.mjs} +3 -3
  107. package/dist/worker-config-BmcJ9R0U.mjs +42 -0
  108. package/dist/{worker-config-DgdT0iTB.mjs → worker-config-DkONNk_H.mjs} +54 -103
  109. package/dist/{workers-config-BhZBrR-Q.mjs → workers-config-DwzrtdYu.mjs} +2 -2
  110. package/dist/{worktree-BY--Rgmy.mjs → worktree-O_kU6Q3y.mjs} +164 -8
  111. package/dist/{zettelkasten-BHVx5zj-.mjs → zettelkasten-BH8AdNh8.mjs} +4 -4
  112. package/dist/{zettelkasten-LoH9RBiN.mjs → zettelkasten-FFhQFESJ.mjs} +2 -2
  113. package/docs/commands/README.md +32 -2
  114. package/docs/commands/audit.md +34 -3
  115. package/docs/commands/backup.md +1 -1
  116. package/docs/commands/build.md +4 -4
  117. package/docs/commands/cd.md +1 -1
  118. package/docs/commands/clear-names.md +1 -1
  119. package/docs/commands/cockpit.md +1 -1
  120. package/docs/commands/config.md +1 -1
  121. package/docs/commands/daemon.md +1 -1
  122. package/docs/commands/db.md +1 -1
  123. package/docs/commands/doc.md +1 -1
  124. package/docs/commands/end.md +1 -1
  125. package/docs/commands/find.md +1 -1
  126. package/docs/commands/git.md +110 -0
  127. package/docs/commands/handoff.md +70 -0
  128. package/docs/commands/harness.md +74 -0
  129. package/docs/commands/help.md +1 -1
  130. package/docs/commands/home.md +1 -1
  131. package/docs/commands/hooks-db.md +1 -1
  132. package/docs/commands/identity.md +1 -1
  133. package/docs/commands/install.md +1 -1
  134. package/docs/commands/issue.md +1 -1
  135. package/docs/commands/kg.md +1 -1
  136. package/docs/commands/launch.md +1 -1
  137. package/docs/commands/lessons.md +201 -0
  138. package/docs/commands/list.md +1 -1
  139. package/docs/commands/ls.md +1 -1
  140. package/docs/commands/mcp.md +1 -1
  141. package/docs/commands/memory.md +1 -1
  142. package/docs/commands/models.md +1 -1
  143. package/docs/commands/more.md +1 -1
  144. package/docs/commands/new.md +1 -1
  145. package/docs/commands/notes.md +1 -1
  146. package/docs/commands/notify.md +1 -1
  147. package/docs/commands/observation.md +1 -1
  148. package/docs/commands/obsidian.md +1 -1
  149. package/docs/commands/open.md +1 -1
  150. package/docs/commands/pane.md +1 -1
  151. package/docs/commands/pause.md +1 -1
  152. package/docs/commands/plan.md +1 -1
  153. package/docs/commands/project.md +1 -1
  154. package/docs/commands/projects.md +1 -1
  155. package/docs/commands/providers.md +1 -1
  156. package/docs/commands/queue.md +1 -1
  157. package/docs/commands/registry.md +1 -1
  158. package/docs/commands/reload.md +1 -1
  159. package/docs/commands/rename.md +1 -1
  160. package/docs/commands/restore.md +1 -1
  161. package/docs/commands/resume.md +1 -1
  162. package/docs/commands/router.md +1 -1
  163. package/docs/commands/rules.md +70 -0
  164. package/docs/commands/session.md +1 -1
  165. package/docs/commands/sessions.md +1 -1
  166. package/docs/commands/setup.md +1 -1
  167. package/docs/commands/setups.md +1 -1
  168. package/docs/commands/shell-init.md +1 -1
  169. package/docs/commands/skill.md +1 -1
  170. package/docs/commands/task.md +1 -1
  171. package/docs/commands/tasks.md +1 -1
  172. package/docs/commands/topic.md +1 -1
  173. package/docs/commands/update.md +1 -1
  174. package/docs/commands/worker.md +1 -1
  175. package/docs/commands/zettel.md +1 -1
  176. package/docs/concepts/panes.md +3 -2
  177. package/gemini-extension.json +1 -1
  178. package/package.json +2 -2
  179. package/pai-plugin.json +1 -1
  180. package/plugins/context-preservation/plugin.json +1 -1
  181. package/plugins/core/plugin.json +1 -1
  182. package/plugins/creative/plugin.json +1 -1
  183. package/plugins/observability/plugin.json +1 -1
  184. package/plugins/productivity/plugin.json +1 -1
  185. package/plugins/semantic-search/plugin.json +1 -1
  186. package/plugins/ui/plugin.json +1 -1
  187. package/plugins/zettelkasten/plugin.json +1 -1
  188. package/src/hooks/ts/lib/loop-guard.ts +3 -5
  189. package/src/hooks/ts/lib/rules/builtin/base64-decode-to-shell.rule.yaml +13 -0
  190. package/src/hooks/ts/lib/rules/builtin/chmod-world-writable.rule.yaml +13 -0
  191. package/src/hooks/ts/lib/rules/builtin/chmod-zero.rule.yaml +11 -0
  192. package/src/hooks/ts/lib/rules/builtin/credential-file-read.rule.yaml +13 -0
  193. package/src/hooks/ts/lib/rules/builtin/credential-read-then-network.rule.yaml +29 -0
  194. package/src/hooks/ts/lib/rules/builtin/crontab-persistence.rule.yaml +10 -0
  195. package/src/hooks/ts/lib/rules/builtin/curl-piped-to-shell.rule.yaml +15 -0
  196. package/src/hooks/ts/lib/rules/builtin/download-then-execute.rule.yaml +30 -0
  197. package/src/hooks/ts/lib/rules/builtin/find-root-delete.rule.yaml +11 -0
  198. package/src/hooks/ts/lib/rules/builtin/git-push-force.rule.yaml +24 -0
  199. package/src/hooks/ts/lib/rules/builtin/git-push-plus-refspec.rule.yaml +12 -0
  200. package/src/hooks/ts/lib/rules/builtin/git-reset-hard.rule.yaml +12 -0
  201. package/src/hooks/ts/lib/rules/builtin/injection-then-tool.rule.yaml +30 -0
  202. package/src/hooks/ts/lib/rules/builtin/instruction-override-disregard.rule.yaml +12 -0
  203. package/src/hooks/ts/lib/rules/builtin/instruction-override-ignore.rule.yaml +13 -0
  204. package/src/hooks/ts/lib/rules/builtin/launchagents-write-persistence.rule.yaml +12 -0
  205. package/src/hooks/ts/lib/rules/builtin/launchctl-load-persistence.rule.yaml +10 -0
  206. package/src/hooks/ts/lib/rules/builtin/reverse-shell-dev-tcp.rule.yaml +11 -0
  207. package/src/hooks/ts/lib/rules/builtin/reverse-shell-interactive-bash.rule.yaml +11 -0
  208. package/src/hooks/ts/lib/rules/builtin/rm-recursive-parent.rule.yaml +11 -0
  209. package/src/hooks/ts/lib/rules/builtin/rm-recursive-relative.rule.yaml +11 -0
  210. package/src/hooks/ts/lib/rules/builtin/rm-recursive-root.rule.yaml +24 -0
  211. package/src/hooks/ts/lib/rules/builtin/rm-trailing-tilde.rule.yaml +11 -0
  212. package/src/hooks/ts/lib/rules/builtin/sudoers-nopasswd.rule.yaml +15 -0
  213. package/src/hooks/ts/lib/rules/builtin.generated.ts +530 -0
  214. package/src/hooks/ts/lib/rules/eval.ts +74 -0
  215. package/src/hooks/ts/lib/rules/lint.ts +102 -0
  216. package/src/hooks/ts/lib/rules/load.ts +229 -0
  217. package/src/hooks/ts/lib/rules/types.ts +56 -0
  218. package/src/hooks/ts/pre-tool-use/security-validator.ts +27 -96
  219. package/src/hooks/ts/user-prompt/handoff-link.ts +34 -0
  220. package/dist/aibroker-client-BxzeEHPF.mjs +0 -3
  221. package/dist/auto-route-DWYK_0i0.mjs +0 -11
  222. package/dist/budget-DX-VIWGf.mjs +0 -15
  223. package/dist/cockpit-memory-DIrNs4xr.mjs +0 -20
  224. package/dist/daemon-ieo0lnpq.mjs +0 -46
  225. package/dist/detect-C0ZBXqDL.mjs +0 -10
  226. package/dist/factory-DeASMV7Z.mjs +0 -9
  227. package/dist/kill-tree-CXZ0WfVf.mjs +0 -10
  228. package/dist/operator-Bpxq_WB5.mjs +0 -7
  229. package/dist/providers-QJzpaNhX.mjs +0 -16
  230. package/dist/registrable-Drn8wIDO.mjs +0 -9
  231. package/dist/render-C4KR8qQ8.mjs +0 -13
  232. package/dist/render-Cz3BWIBO.mjs +0 -903
  233. package/dist/root-Bfb1zgwE.mjs +0 -36
  234. package/dist/route-table-ZVMNBsy7.mjs +0 -15
  235. package/dist/session-BcnhepLZ.mjs +0 -35
  236. package/dist/session-scan-CqUQdCac.mjs +0 -9
  237. package/dist/status-D_SWmOlH.mjs +0 -6
  238. package/dist/viewer-CbGN2Ri4.mjs +0 -22
  239. package/dist/worker-config-D1KVAMp4.mjs +0 -42
@@ -1,23 +1,24 @@
1
- import { _ as resolvePaiFile, a as paiCacheDir, d as defaultPaiHomeDir, f as legacyConfigDir, g as paiHomePath, i as daemonPidPath, l as claudeHomeDir, m as migratePaiFile, u as claudeProjectsDir } from "./runtime-paths-WsO9sJFc.mjs";
1
+ import { _ as paiHomePath, a as paiCacheDir, d as defaultPaiHomeDir, f as legacyConfigDir, h as migratePaiFile, i as daemonPidPath, l as claudeHomeDir, u as claudeProjectsDir, v as resolvePaiFile } from "./runtime-paths-twfV23YL.mjs";
2
2
  import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
3
- import { Et as appendLedger, M as readWorkersSection, P as resolveModelCapability, d as defaultWorkersConfig } from "./config-CST2uq1v.mjs";
4
- import { c as loadConfig, f as readMainConfigRaw, k as writeJsonAtomic, n as CONFIG_FILE, p as writeMainConfigRaw } from "./config-DYbyEe4-.mjs";
5
- import { n as ensureNoMcpConfig, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
6
- import { w as worktreesDir } from "./worktree-BY--Rgmy.mjs";
7
- import { B as loadStatusConfig, W as writeContinueToForge } from "./status-COtzewKV.mjs";
8
- import { i as itermUuid, l as sessionMapPath } from "./scope-D8HK6vU7.mjs";
9
- import { _ as resolveTarget, mt as loopbackRouterChoice, ut as buildRunEnv } from "./routing-BlD_tKjW.mjs";
10
- import { i as getRegistryBackend, r as createStorageBackend } from "./factory-BV0MQA3T.mjs";
11
- import { c as ensureProxyRunning, l as proxyPort } from "./launch-DpQPZGsT.mjs";
12
- import { n as fetchLiveSessions, r as sendToSession } from "./aibroker-client-CQPGqLxL.mjs";
13
- import { E as probeRouter, z as recordSystemJobStart } from "./run-AZVwceiU.mjs";
14
- import { bt as psTableOrNull } from "./controls-OiVVbe-f.mjs";
15
- import { n as isRealUserPrompt, t as extractUserPromptText } from "./session-usage-oycSdiD3.mjs";
3
+ import { Et as appendLedger, M as readWorkersSection, P as resolveModelCapability, d as defaultWorkersConfig } from "./config-Bz8pAU5Q.mjs";
4
+ import { c as loadConfig, f as readMainConfigRaw, k as writeJsonAtomic, n as CONFIG_FILE, p as writeMainConfigRaw } from "./config-SlZ-Z52i.mjs";
5
+ import { n as ensureNoMcpConfig, u as workersLogDir } from "./paths-CypxFTfn.mjs";
6
+ import { w as worktreesDir } from "./worktree-O_kU6Q3y.mjs";
7
+ import { G as writeContinueToForge, V as loadStatusConfig } from "./status-Cecau8Ps.mjs";
8
+ import { i as itermUuid, l as sessionMapPath } from "./scope-BTWstJ1B.mjs";
9
+ import { _ as resolveTarget, mt as loopbackRouterChoice, ut as buildRunEnv } from "./routing-aJKMIagQ.mjs";
10
+ import { i as getRegistryBackend, r as createStorageBackend } from "./factory-CYwa0jYj.mjs";
11
+ import { c as ensureProxyRunning, l as proxyPort } from "./launch-Bn2Zf90h.mjs";
12
+ import { n as fetchLiveSessions, r as sendToSession } from "./aibroker-client-CXsyC7A8.mjs";
13
+ import { E as probeRouter, z as recordSystemJobStart } from "./run-DE9Q0ldN.mjs";
14
+ import { J as psTableOrNull, U as redactSecrets } from "./render-jPpMrudf.mjs";
15
+ import { n as isRealUserPrompt, t as extractUserPromptText } from "./session-usage-CCmPFFa6.mjs";
16
16
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
17
17
  import { randomUUID } from "node:crypto";
18
18
  import { basename, delimiter, dirname, join } from "node:path";
19
19
  import { homedir, setPriority, userInfo } from "node:os";
20
20
  import { spawn, spawnSync } from "node:child_process";
21
+ import { parse, stringify } from "yaml";
21
22
  import { copyFileSync as copyFileSync$1, existsSync as existsSync$1, linkSync as linkSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, renameSync as renameSync$1, writeFileSync as writeFileSync$1 } from "fs";
22
23
  import { basename as basename$1, join as join$1, resolve as resolve$1 } from "path";
23
24
  import { homedir as homedir$1 } from "os";
@@ -1670,6 +1671,15 @@ function obsidianEnabled() {
1670
1671
  return false;
1671
1672
  }
1672
1673
  }
1674
+ /** Lessons indexing (`<PAI home>/lessons`) is on unless `lessonsIndex: { enabled: false }`. */
1675
+ function lessonsIndexEnabled() {
1676
+ try {
1677
+ const v = readMainConfigRaw()["lessonsIndex"];
1678
+ return !(v && typeof v === "object" && v.enabled === false);
1679
+ } catch {
1680
+ return true;
1681
+ }
1682
+ }
1673
1683
  /** Vault indexing (read-only, `vaultPath`) is on unless `vaultIndex: { enabled: false }`; independent of `obsidian.enabled`. */
1674
1684
  function vaultIndexEnabled() {
1675
1685
  try {
@@ -1799,6 +1809,14 @@ const HOOKS_DIR = join$1(ADAPTER_DIR, "Hooks");
1799
1809
  const SKILLS_DIR = join$1(ADAPTER_DIR, "skills");
1800
1810
  const AGENTS_DIR = join$1(ADAPTER_DIR, "agents");
1801
1811
  const COMMANDS_DIR = join$1(ADAPTER_DIR, "commands");
1812
+ function oldHistoryDir() {
1813
+ return join$1(ADAPTER_DIR, "History");
1814
+ }
1815
+ /** Read/write location for hook-captured history: PAI_HOME/History if
1816
+ * present, else the old ADAPTER_DIR/History (one-time stderr notice). */
1817
+ function historyDir() {
1818
+ return resolvePaiFile(paiHomePath("History"), [oldHistoryDir()], "pai config migrate --history");
1819
+ }
1802
1820
 
1803
1821
  //#endregion
1804
1822
  //#region src/hooks/ts/lib/project-utils/paths.ts
@@ -3383,7 +3401,7 @@ function updateNoteWithSummary(notePath, summaryText) {
3383
3401
  content = content.slice(0, insertAt) + `## Known Issues\n\n${issues}\n\n` + content.slice(insertAt);
3384
3402
  }
3385
3403
  }
3386
- writeFileSync(notePath, content, "utf-8");
3404
+ writeFileSync(notePath, redactSecrets(content), "utf-8");
3387
3405
  }
3388
3406
  /**
3389
3407
  * Create a brand new session note from the AI summary.
@@ -3433,7 +3451,7 @@ function createNoteFromSummary(notesDir, summaryText, sessionId) {
3433
3451
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
3434
3452
  const topic = extractTopic(summaryText);
3435
3453
  const aiBody = summaryText.replace(/^TOPIC:.*$/m, "").replace(/^# Session:.*$/m, "").replace(/^\*\*Date:\*\*.*$/m, "").replace(/^\*\*Status:\*\*.*$/m, "").replace(/^---$/m, "").trim();
3436
- writeFileSync(notePath, `# Session ${noteNumber}: ${title}
3454
+ writeFileSync(notePath, redactSecrets(`# Session ${noteNumber}: ${title}
3437
3455
  ${topic ? `<!-- TOPIC: ${topic} -->` : ""}${sessionId ? `\n<!-- SESSION: ${sessionId} -->` : ""}
3438
3456
 
3439
3457
  **Date:** ${date}
@@ -3452,7 +3470,7 @@ ${aiBody}
3452
3470
  ---
3453
3471
 
3454
3472
  **Tags:** #Session
3455
- `, "utf-8");
3473
+ `), "utf-8");
3456
3474
  process.stderr.write(`[session-summary] Created AI-powered note: ${noteFilename}\n`);
3457
3475
  return notePath;
3458
3476
  } catch (e) {
@@ -3542,14 +3560,14 @@ async function handleSessionSummary(payload) {
3542
3560
  existingNote = readFileSync(existingNotePath, "utf-8");
3543
3561
  } catch {}
3544
3562
  }
3545
- const prompt = buildSessionSummaryPrompt({
3563
+ const prompt = redactSecrets(buildSessionSummaryPrompt({
3546
3564
  userMessages: extracted.userMessages,
3547
3565
  gitLog,
3548
3566
  cwd,
3549
3567
  date: today,
3550
3568
  filesModified: extracted.filesModified,
3551
3569
  existingNote
3552
- });
3570
+ }));
3553
3571
  process.stderr.write(`[session-summary] Sending ${prompt.length} char prompt to ${selectedModel}...\n`);
3554
3572
  const summaryText = await spawnSummarizer(prompt, selectedModel);
3555
3573
  if (!summaryText) {
@@ -3560,30 +3578,10 @@ async function handleSessionSummary(payload) {
3560
3578
  process.stderr.write(`[session-summary] ${selectedModel} produced ${summaryText.length} char summary.\n`);
3561
3579
  const notePath = writeSessionNote(cwd, summaryText, extracted.filesModified, sessionId);
3562
3580
  if (notePath) process.stderr.write(`[session-summary] Session note written: ${basename(notePath)}\n`);
3563
- const effectiveSlug = projectSlug ?? basename(cwd);
3564
- const projectId = projectSlug ? await lookupProjectId(projectSlug) : null;
3565
- if (storageBackend?.supportsPostgresFeatures) try {
3566
- await storageBackend.storeObservation({
3567
- session_id: sessionId ?? cwd,
3568
- project_id: projectId,
3569
- project_slug: effectiveSlug,
3570
- type: "discovery",
3571
- title: `session summary (${selectedModel})`,
3572
- narrative: summaryText.slice(0, 2e3),
3573
- tool_name: "session-summary",
3574
- files_read: [],
3575
- files_modified: extracted.filesModified,
3576
- concepts: [],
3577
- source: "daemon",
3578
- fidelity: "inferred"
3579
- });
3580
- } catch (err) {
3581
- process.stderr.write(`[session-summary] Summary observation failed: ${err}\n`);
3582
- }
3583
3581
  await extractAndStoreTriples({
3584
3582
  summaryText,
3585
- projectSlug: effectiveSlug,
3586
- projectId,
3583
+ projectSlug: projectSlug ?? basename(cwd),
3584
+ projectId: projectSlug ? await lookupProjectId(projectSlug) : null,
3587
3585
  sessionId: sessionId ?? cwd,
3588
3586
  gitLog,
3589
3587
  model: selectedModel
@@ -4144,5 +4142,226 @@ function reexecBackground() {
4144
4142
  }
4145
4143
 
4146
4144
  //#endregion
4147
- export { setStartTime as $, indexSchedulerTimer as A, startQuietWatcher as At, setDaemonConfig as B, findLatestNote as Bt, migrateSummaryCooldowns as C, runSessionKeepaliveTick as Ct, embedInProgress as D, nextOccurrence as Dt, daemonConfig as E, describeQuiet as Et, lastVaultIndexTime as F, writeDaemonPidfile as Ft, setLastEmbedPass as G, setEmbedSchedulerTimer as H, readBodyFile as Ht, notificationConfig as I, readContextHandoverCache as It, setLastIndexTime as J, setLastEmbedTime as K, passFailures as L, writeContextHandoverCache as Lt, lastEmbedTime as M, LAUNCHD_LABEL as Mt, lastIndexPass as N, removeDaemonPidfile as Nt, embedSchedulerTimer as O, readQuiet as Ot, lastIndexTime as P, resolveDaemonPid as Pt, setShutdownRequested as Q, registryBackend as R, appendCheckpointToNote as Rt, handleSessionSummary as S, loadSessionKeepaliveState as St, cacheKeepaliveTimer as T, deferIfQuiet as Tt, setIndexInProgress as U, restartRouter as Ut, setEmbedInProgress as V, findNotesDir$1 as Vt, setIndexSchedulerTimer as W, setNotificationConfig as X, setLastVaultIndexTime as Y, setRegistryBackend as Z, markFailed as _, buildWakeupContext as _t, runPassChild as a, vaultIndexInProgress as at, findLatestJsonl as b, reapJob as bt, NonRetryableError as c, addWorkToSessionNote as ct, enqueue as d, getCurrentNotePath as dt, setStorageBackend as et, enqueueCoalesced as f, archiveSessionFilesToSessionsDir as ft, markCompleted as g, vaultIndexEnabled as gt, loadQueue as h, obsidianEnabled as ht, reexecBackground as i, storageBackend as it, lastEmbedPass as j, writeQuiet as jt, indexInProgress as k, registerQuietRunner as kt, cleanup as l, appendCheckpoint as lt, hasPendingOrProcessingOfType as m, OBSIDIAN_DISABLED_MESSAGE as mt, buildPassCommand as n, shutdownRequested as nt, backfillKgFromNotes as o, sessionIdFromTranscript as ot, getStats as p, findNotesDir as pt, setLastIndexPass as q, cliEntry as r, startTime as rt, migrateKgBackfillState as s, updateTodoContinue as st, PassSpawnError as t, setVaultIndexInProgress as tt, dequeue as u, finalizeSessionNote as ut, migrateWorkQueue as v, migrateIdentityFile as vt, spawnSummarizer as w, sessionKeepaliveLedgerSummary as wt, getGitContext as x, sweepOrphans as xt, contentToText as y, jobPaths as yt, setCacheKeepaliveTimer as z, applyContinue as zt };
4148
- //# sourceMappingURL=indexer-backend-B2vtFl38.mjs.map
4145
+ //#region src/memory/lessons.ts
4146
+ /**
4147
+ * Review-gated lessons: a short curated memory layer.
4148
+ *
4149
+ * One Markdown file per lesson under `<PAI home>/lessons/<slug>.md` with YAML
4150
+ * frontmatter, so the memory indexer finds them. Candidates (proposed from
4151
+ * transcripts or added by hand) only reach agents once approved.
4152
+ */
4153
+ const LESSON_STATES = [
4154
+ "candidate",
4155
+ "approved",
4156
+ "rejected",
4157
+ "superseded"
4158
+ ];
4159
+ const LESSON_KINDS = [
4160
+ "workflow",
4161
+ "correction",
4162
+ "debugging",
4163
+ "gotcha",
4164
+ "convention"
4165
+ ];
4166
+ const TRANSITIONS = {
4167
+ candidate: ["approved", "rejected"],
4168
+ approved: ["superseded"],
4169
+ rejected: ["candidate"],
4170
+ superseded: []
4171
+ };
4172
+ /** The lessons directory (`<PAI home>/lessons`). */
4173
+ function lessonsDir() {
4174
+ return paiHomePath("lessons");
4175
+ }
4176
+ function lessonPath(id) {
4177
+ return join(lessonsDir(), `${id}.md`);
4178
+ }
4179
+ /** Lower-case, dash-separated slug of a title (max 60 chars). */
4180
+ function slugify(title) {
4181
+ return title.toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/, "") || "lesson";
4182
+ }
4183
+ function serializeLesson(l) {
4184
+ const { body, ...front } = l;
4185
+ const data = { ...front };
4186
+ if (data.superseded_by === void 0) delete data.superseded_by;
4187
+ if (data.promoted_to === void 0) delete data.promoted_to;
4188
+ return `---\n${stringify(data)}---\n\n${body.trim()}\n`;
4189
+ }
4190
+ function parseLesson(text, fallbackId = "") {
4191
+ const m = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(text);
4192
+ if (!m) throw new Error("lesson has no YAML frontmatter");
4193
+ const f = parse(m[1]) ?? {};
4194
+ const str = (v) => v === void 0 || v === null ? "" : String(v);
4195
+ const lesson = {
4196
+ id: str(f.id) || fallbackId,
4197
+ title: str(f.title),
4198
+ state: str(f.state),
4199
+ kind: str(f.kind),
4200
+ applies_when: str(f.applies_when),
4201
+ project: str(f.project) || "global",
4202
+ evidence: Array.isArray(f.evidence) ? f.evidence.map(String) : [],
4203
+ created: str(f.created),
4204
+ updated: str(f.updated),
4205
+ body: m[2].trim()
4206
+ };
4207
+ if (f.superseded_by) lesson.superseded_by = str(f.superseded_by);
4208
+ if (Array.isArray(f.promoted_to)) lesson.promoted_to = f.promoted_to.map(String);
4209
+ if (!LESSON_STATES.includes(lesson.state)) throw new Error(`invalid lesson state "${lesson.state}"`);
4210
+ return lesson;
4211
+ }
4212
+ /** Atomic write: temp file in the same directory, then rename. */
4213
+ function writeLesson(l) {
4214
+ mkdirSync(lessonsDir(), { recursive: true });
4215
+ const dest = lessonPath(l.id);
4216
+ const tmp = `${dest}.${process.pid}.tmp`;
4217
+ writeFileSync(tmp, serializeLesson(l));
4218
+ renameSync(tmp, dest);
4219
+ }
4220
+ /** All lessons, oldest first; unreadable files are skipped. */
4221
+ function listLessons(filter = {}) {
4222
+ let files;
4223
+ try {
4224
+ files = readdirSync(lessonsDir()).filter((f) => f.endsWith(".md"));
4225
+ } catch {
4226
+ return [];
4227
+ }
4228
+ const out = [];
4229
+ for (const f of files) try {
4230
+ out.push(parseLesson(readFileSync(join(lessonsDir(), f), "utf8"), basename(f, ".md")));
4231
+ } catch {
4232
+ continue;
4233
+ }
4234
+ return out.filter((l) => (!filter.state || l.state === filter.state) && (!filter.project || l.project === filter.project)).sort((a, b) => a.created.localeCompare(b.created) || a.id.localeCompare(b.id));
4235
+ }
4236
+ function getLesson(id) {
4237
+ if (!/^[a-z0-9][a-z0-9-]*$/.test(id)) return null;
4238
+ const p = lessonPath(id);
4239
+ if (!existsSync(p)) return null;
4240
+ return parseLesson(readFileSync(p, "utf8"), id);
4241
+ }
4242
+ /** Add a candidate lesson; the slug comes from the title, made unique with -2, -3, ... */
4243
+ function addLesson(input) {
4244
+ if (!LESSON_KINDS.includes(input.kind)) throw new Error(`invalid kind "${input.kind}" (${LESSON_KINDS.join("|")})`);
4245
+ const base = slugify(input.title);
4246
+ let id = base;
4247
+ for (let n = 2; existsSync(lessonPath(id)); n++) id = `${base}-${n}`;
4248
+ const now = (/* @__PURE__ */ new Date()).toISOString();
4249
+ const lesson = {
4250
+ id,
4251
+ title: input.title,
4252
+ state: "candidate",
4253
+ kind: input.kind,
4254
+ applies_when: input.applies_when,
4255
+ project: input.project || "global",
4256
+ evidence: input.evidence ?? [],
4257
+ created: now,
4258
+ updated: now,
4259
+ body: input.body ?? ""
4260
+ };
4261
+ writeLesson(lesson);
4262
+ return lesson;
4263
+ }
4264
+ /** Move a lesson to a new state along an allowed transition. */
4265
+ function setState(id, state, opts = {}) {
4266
+ const lesson = getLesson(id);
4267
+ if (!lesson) throw new Error(`lesson not found: ${id}`);
4268
+ if (!TRANSITIONS[lesson.state].includes(state)) throw new Error(`illegal transition ${lesson.state} -> ${state}`);
4269
+ if (state === "superseded") {
4270
+ const by = opts.supersededBy;
4271
+ if (!by) throw new Error("superseding needs supersededBy");
4272
+ if (by === id || getLesson(by)?.state !== "approved") throw new Error(`superseding lesson must exist and be approved: ${by}`);
4273
+ lesson.superseded_by = by;
4274
+ }
4275
+ lesson.state = state;
4276
+ lesson.updated = (/* @__PURE__ */ new Date()).toISOString();
4277
+ writeLesson(lesson);
4278
+ return lesson;
4279
+ }
4280
+ /** Skill descriptions are capped at 1024 chars. */
4281
+ const DESCRIPTION_MAX = 1024;
4282
+ /**
4283
+ * Promote an approved lesson to a project skill: `<projectDir>/.claude/skills/<slug>/SKILL.md`
4284
+ * (and with `agentsDir` also `<projectDir>/.agents/skills/<slug>/SKILL.md`).
4285
+ * Refuses to overwrite an existing SKILL.md unless `force`. Records the written
4286
+ * paths in the lesson's `promoted_to` and returns them.
4287
+ */
4288
+ function promoteLesson(id, opts) {
4289
+ const lesson = getLesson(id);
4290
+ if (!lesson) throw new Error(`lesson not found: ${id}`);
4291
+ if (lesson.state !== "approved") throw new Error(`only approved lessons can be promoted (this one is ${lesson.state})`);
4292
+ const slug = slugify(lesson.title);
4293
+ const frontmatter = `---\n${stringify({
4294
+ name: slug,
4295
+ description: `${lesson.title}. USE WHEN ${lesson.applies_when}.`.slice(0, DESCRIPTION_MAX),
4296
+ provenance: {
4297
+ lesson: lesson.id,
4298
+ evidence: lesson.evidence,
4299
+ promoted: (/* @__PURE__ */ new Date()).toISOString()
4300
+ }
4301
+ })}---\n\n${lesson.body.trim()}\n\nSource: lesson ${lesson.id}\n`;
4302
+ const dirs = [join(opts.projectDir, ".claude", "skills", slug)];
4303
+ if (opts.agentsDir) dirs.push(join(opts.projectDir, ".agents", "skills", slug));
4304
+ const paths = dirs.map((d) => join(d, "SKILL.md"));
4305
+ if (!opts.force) {
4306
+ const existing = paths.filter((p) => existsSync(p));
4307
+ if (existing.length > 0) throw new Error(`skill already exists: ${existing.join(", ")} (use force to overwrite)`);
4308
+ }
4309
+ for (const p of paths) {
4310
+ mkdirSync(dirname(p), { recursive: true });
4311
+ writeFileSync(p, frontmatter);
4312
+ }
4313
+ lesson.promoted_to = paths;
4314
+ lesson.updated = (/* @__PURE__ */ new Date()).toISOString();
4315
+ writeLesson(lesson);
4316
+ return paths;
4317
+ }
4318
+ const CORRECTION = [
4319
+ /^\s*no\b[,.!]/i,
4320
+ /\bdon'?t\b/i,
4321
+ /\bnever\b/i,
4322
+ /\bstop\b/i,
4323
+ /\bwrong\b/i,
4324
+ /\bthat'?s not\b/i,
4325
+ /\bnein\b/i,
4326
+ /\bnicht\b/i,
4327
+ /\bfalsch\b/i,
4328
+ /\bnie\b/i
4329
+ ];
4330
+ function userText(content) {
4331
+ if (typeof content === "string") return content;
4332
+ if (!Array.isArray(content)) return "";
4333
+ return content.filter((p) => !!p && typeof p === "object" && p.type === "text" && typeof p.text === "string").map((p) => p.text).join("\n");
4334
+ }
4335
+ /** Candidate lessons from user messages in a transcript that look like corrections. Deterministic; adds nothing. */
4336
+ function proposeFromTranscript(transcriptPath) {
4337
+ const sessionId = basename(transcriptPath, ".jsonl");
4338
+ const out = [];
4339
+ const seen = /* @__PURE__ */ new Set();
4340
+ for (const line of readFileSync(transcriptPath, "utf8").split("\n")) {
4341
+ if (!line.trim()) continue;
4342
+ let ev;
4343
+ try {
4344
+ ev = JSON.parse(line);
4345
+ } catch {
4346
+ continue;
4347
+ }
4348
+ if (ev.type !== "user" || ev.isMeta) continue;
4349
+ const text = userText(ev.message?.content).trim();
4350
+ if (!text || text.startsWith("<") || !CORRECTION.some((re) => re.test(text))) continue;
4351
+ const title = text.replace(/\s+/g, " ").slice(0, 80);
4352
+ if (seen.has(title)) continue;
4353
+ seen.add(title);
4354
+ out.push({
4355
+ title,
4356
+ kind: "correction",
4357
+ applies_when: "",
4358
+ evidence: [sessionId],
4359
+ body: text.slice(0, 600)
4360
+ });
4361
+ }
4362
+ return out;
4363
+ }
4364
+
4365
+ //#endregion
4366
+ export { setIndexSchedulerTimer as $, readBodyFile as $t, getGitContext as A, jobPaths as At, lastEmbedPass as B, registerQuietRunner as Bt, hasPendingOrProcessingOfType as C, historyDir as Ct, migrateWorkQueue as D, vaultIndexEnabled as Dt, markFailed as E, obsidianEnabled as Et, daemonConfig as F, sessionKeepaliveLedgerSummary as Ft, notificationConfig as G, resolveDaemonPid as Gt, lastIndexPass as H, writeQuiet as Ht, embedInProgress as I, deferIfQuiet as It, setCacheKeepaliveTimer as J, writeContextHandoverCache as Jt, passFailures as K, writeDaemonPidfile as Kt, embedSchedulerTimer as L, describeQuiet as Lt, migrateSummaryCooldowns as M, sweepOrphans as Mt, spawnSummarizer as N, loadSessionKeepaliveState as Nt, contentToText as O, buildWakeupContext as Ot, cacheKeepaliveTimer as P, runSessionKeepaliveTick as Pt, setIndexInProgress as Q, findNotesDir$1 as Qt, indexInProgress as R, nextOccurrence as Rt, getStats as S, findNotesDir as St, markCompleted as T, lessonsIndexEnabled as Tt, lastIndexTime as U, LAUNCHD_LABEL as Ut, lastEmbedTime as V, startQuietWatcher as Vt, lastVaultIndexTime as W, removeDaemonPidfile as Wt, setEmbedInProgress as X, applyContinue as Xt, setDaemonConfig as Y, appendCheckpointToNote as Yt, setEmbedSchedulerTimer as Z, findLatestNote as Zt, NonRetryableError as _, addWorkToSessionNote as _t, lessonsDir as a, setNotificationConfig as at, enqueue as b, getCurrentNotePath as bt, proposeFromTranscript as c, setStartTime as ct, buildPassCommand as d, shutdownRequested as dt, restartRouter as en, setLastEmbedPass as et, cliEntry as f, startTime as ft, migrateKgBackfillState as g, updateTodoContinue as gt, backfillKgFromNotes as h, sessionIdFromTranscript as ht, getLesson as i, setLastVaultIndexTime as it, handleSessionSummary as j, reapJob as jt, findLatestJsonl as k, migrateIdentityFile as kt, setState as l, setStorageBackend as lt, runPassChild as m, vaultIndexInProgress as mt, LESSON_STATES as n, setLastIndexPass as nt, listLessons as o, setRegistryBackend as ot, reexecBackground as p, storageBackend as pt, registryBackend as q, readContextHandoverCache as qt, addLesson as r, setLastIndexTime as rt, promoteLesson as s, setShutdownRequested as st, LESSON_KINDS as t, setLastEmbedTime as tt, PassSpawnError as u, setVaultIndexInProgress as ut, cleanup as v, appendCheckpoint as vt, loadQueue as w, OBSIDIAN_DISABLED_MESSAGE as wt, enqueueCoalesced as x, archiveSessionFilesToSessionsDir as xt, dequeue as y, finalizeSessionNote as yt, indexSchedulerTimer as z, readQuiet as zt };
4367
+ //# sourceMappingURL=lessons-CFVU0cwA.mjs.map
@@ -1,5 +1,5 @@
1
- import { rt as workersYamlPath, z as isLoopbackHostname } from "./config-CST2uq1v.mjs";
2
- import { _ as readLocalConfig } from "./local-tiers-BtdEEe5n.mjs";
1
+ import { rt as workersYamlPath, z as isLoopbackHostname } from "./config-Bz8pAU5Q.mjs";
2
+ import { _ as readLocalConfig } from "./local-tiers-CqwGUcEn.mjs";
3
3
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
 
@@ -109,4 +109,4 @@ function isLocalCandidate(p, name, tierProviders) {
109
109
 
110
110
  //#endregion
111
111
  export { localStatusReport as a, writeLocalStatus as c, localStatusLine as i, tierProviderNames as n, primaryLocal as o, LOCAL_STATUS_REFRESH_MS as r, readLocalStatus as s, isLocalCandidate as t };
112
- //# sourceMappingURL=local-candidate-Cp_bw4kK.mjs.map
112
+ //# sourceMappingURL=local-candidate-DFd4pp-w.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { n as minOf } from "./min-max-DrSRUaWQ.mjs";
2
- import { h as parseServers, v as resolveModelPath } from "./local-tiers-BtdEEe5n.mjs";
2
+ import { h as parseServers, v as resolveModelPath } from "./local-tiers-CqwGUcEn.mjs";
3
3
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
 
@@ -207,4 +207,4 @@ function endpointRegistry(managed, providers, cfg) {
207
207
 
208
208
  //#endregion
209
209
  export { instancesFromProcesses as a, pidAlive as c, reconcileInstances as d, registeredInstances as f, instanceNumber as i, readInstances as l, engineKey as n, localInstancesPath as o, writeInstances as p, instanceEngineKey as r, pickInstance as s, endpointRegistry as t, readLiveInstances as u };
210
- //# sourceMappingURL=local-instances-bdCNNSsL.mjs.map
210
+ //# sourceMappingURL=local-instances-DhF4_sV2.mjs.map
@@ -1,6 +1,6 @@
1
- import "./config-CST2uq1v.mjs";
2
- import "./config-DYbyEe4-.mjs";
3
- import "./local-tiers-BtdEEe5n.mjs";
4
- import { a as instancesFromProcesses, c as pidAlive, d as reconcileInstances, f as registeredInstances, i as instanceNumber, l as readInstances, n as engineKey, o as localInstancesPath, p as writeInstances, r as instanceEngineKey, s as pickInstance, t as endpointRegistry, u as readLiveInstances } from "./local-instances-bdCNNSsL.mjs";
1
+ import "./config-Bz8pAU5Q.mjs";
2
+ import "./config-SlZ-Z52i.mjs";
3
+ import "./local-tiers-CqwGUcEn.mjs";
4
+ import { a as instancesFromProcesses, c as pidAlive, d as reconcileInstances, f as registeredInstances, i as instanceNumber, l as readInstances, n as engineKey, o as localInstancesPath, p as writeInstances, r as instanceEngineKey, s as pickInstance, t as endpointRegistry, u as readLiveInstances } from "./local-instances-DhF4_sV2.mjs";
5
5
 
6
6
  export { endpointRegistry, engineKey, instanceEngineKey, instanceNumber, instancesFromProcesses, localInstancesPath, pickInstance, pidAlive, readInstances, readLiveInstances, reconcileInstances, registeredInstances, writeInstances };
@@ -1,5 +1,5 @@
1
- import { g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { o as expandHome } from "./config-DYbyEe4-.mjs";
1
+ import { _ as paiHomePath } from "./runtime-paths-twfV23YL.mjs";
2
+ import { o as expandHome } from "./config-SlZ-Z52i.mjs";
3
3
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { homedir } from "node:os";
@@ -467,4 +467,4 @@ const shellQuote = shq;
467
467
 
468
468
  //#endregion
469
469
  export { stopLines as C, stopLine as S, tierButtons as T, readLocalConfig as _, LocalTierError as a, splitCommand as b, fetchServedModels as c, installedModelDirs as d, listensOnPort as f, planStart as g, parseServers as h, DEFAULT_RESERVE_GB as i, fmtRss as l, parseLocalConfig as m, DEFAULT_HEALTH as n, defaultLauncher as o, logPathFor as p, DEFAULT_MAX_INSTANCES as r, defaultStrataPython as s, DEFAULT_COMMON_FLAGS as t, healthUrl as u, resolveModelPath as v, strataInfo as w, stopCommandFor as x, shellQuote as y };
470
- //# sourceMappingURL=local-tiers-BtdEEe5n.mjs.map
470
+ //# sourceMappingURL=local-tiers-CqwGUcEn.mjs.map
@@ -1,5 +1,5 @@
1
- import "./config-CST2uq1v.mjs";
2
- import "./config-DYbyEe4-.mjs";
3
- import { C as stopLines, S as stopLine, T as tierButtons, _ as readLocalConfig, a as LocalTierError, b as splitCommand, c as fetchServedModels, d as installedModelDirs, f as listensOnPort, g as planStart, h as parseServers, i as DEFAULT_RESERVE_GB, l as fmtRss, m as parseLocalConfig, n as DEFAULT_HEALTH, o as defaultLauncher, p as logPathFor, r as DEFAULT_MAX_INSTANCES, s as defaultStrataPython, t as DEFAULT_COMMON_FLAGS, u as healthUrl, v as resolveModelPath, w as strataInfo, x as stopCommandFor, y as shellQuote } from "./local-tiers-BtdEEe5n.mjs";
1
+ import "./config-Bz8pAU5Q.mjs";
2
+ import "./config-SlZ-Z52i.mjs";
3
+ import { C as stopLines, S as stopLine, T as tierButtons, _ as readLocalConfig, a as LocalTierError, b as splitCommand, c as fetchServedModels, d as installedModelDirs, f as listensOnPort, g as planStart, h as parseServers, i as DEFAULT_RESERVE_GB, l as fmtRss, m as parseLocalConfig, n as DEFAULT_HEALTH, o as defaultLauncher, p as logPathFor, r as DEFAULT_MAX_INSTANCES, s as defaultStrataPython, t as DEFAULT_COMMON_FLAGS, u as healthUrl, v as resolveModelPath, w as strataInfo, x as stopCommandFor, y as shellQuote } from "./local-tiers-CqwGUcEn.mjs";
4
4
 
5
5
  export { readLocalConfig };
@@ -1,5 +1,5 @@
1
- import { M as readWorkersSection, _ as maskKey, rt as workersYamlPath } from "./config-CST2uq1v.mjs";
2
- import { C as migrateMainConfigToYaml, D as writeYamlFileAtomic, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, i as defaults, p as writeMainConfigRaw, u as paiConfigFilePath, x as userWorkersYamlRaw } from "./config-DYbyEe4-.mjs";
1
+ import { M as readWorkersSection, _ as maskKey, rt as workersYamlPath } from "./config-Bz8pAU5Q.mjs";
2
+ import { C as migrateMainConfigToYaml, D as writeYamlFileAtomic, c as loadConfig, d as paiConfigYamlFilePath, f as readMainConfigRaw, i as defaults, p as writeMainConfigRaw, u as paiConfigFilePath, x as userWorkersYamlRaw } from "./config-SlZ-Z52i.mjs";
3
3
  import { existsSync } from "node:fs";
4
4
  import { Document } from "yaml";
5
5
 
@@ -239,4 +239,4 @@ function unsetConfigValueOp(dottedPath) {
239
239
 
240
240
  //#endregion
241
241
  export { listConfigOp as a, getConfigValueOp as i, formatConfigGetOutput as n, setConfigValueOp as o, formatConfigSource as r, unsetConfigValueOp as s, MainConfigOpsError as t };
242
- //# sourceMappingURL=main-config-ops-BYsK3BxM.mjs.map
242
+ //# sourceMappingURL=main-config-ops-rda08BCD.mjs.map
@@ -1,20 +1,20 @@
1
1
  import { _ as warn, c as ok, i as err, l as renderTable, n as dim, o as header } from "./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 { d as terminalHasName } from "./scope-D8HK6vU7.mjs";
7
- import "./routing-BlD_tKjW.mjs";
8
- import "./tool-errors-DXJ70-sr.mjs";
9
- import "./wait-ChpHKJZV.mjs";
10
- import "./local-tiers-BtdEEe5n.mjs";
11
- import "./caller-identity-Bim8JT-D.mjs";
12
- import "./capacity-CsZMkVyg.mjs";
13
- import "./local-instances-bdCNNSsL.mjs";
14
- import "./local-candidate-Cp_bw4kK.mjs";
15
- import { c as resumeOfferBlock, l as resumeRouteFor, n as launchInDir } from "./launch-UPQBoW2q.mjs";
16
- import { i as switchToSession, n as fetchLiveSessions } from "./aibroker-client-CQPGqLxL.mjs";
17
- import { s as scanSessions, t as fmtAge } from "./session-scan-BmnjSReu.mjs";
2
+ import "./config-Bz8pAU5Q.mjs";
3
+ import "./config-SlZ-Z52i.mjs";
4
+ import "./paths-CypxFTfn.mjs";
5
+ import "./status-Cecau8Ps.mjs";
6
+ import { d as terminalHasName } from "./scope-BTWstJ1B.mjs";
7
+ import "./routing-aJKMIagQ.mjs";
8
+ import "./tool-errors-BFw1gv-z.mjs";
9
+ import "./wait-C5iWILj_.mjs";
10
+ import "./local-tiers-CqwGUcEn.mjs";
11
+ import "./caller-identity-C6Nc96iM.mjs";
12
+ import "./capacity-B2PgKAg4.mjs";
13
+ import "./local-instances-DhF4_sV2.mjs";
14
+ import "./local-candidate-DFd4pp-w.mjs";
15
+ import { c as resumeOfferBlock, l as resumeRouteFor, n as launchInDir } from "./launch-BZT3JDoZ.mjs";
16
+ import { i as switchToSession, n as fetchLiveSessions } from "./aibroker-client-CXsyC7A8.mjs";
17
+ import { s as scanSessions, t as fmtAge } from "./session-scan-CX3MKCNg.mjs";
18
18
  import { createReadStream, existsSync, realpathSync } from "node:fs";
19
19
  import { basename, join } from "node:path";
20
20
  import chalk from "chalk";
@@ -600,7 +600,7 @@ async function openMatch(entry, allSessions, dryRun, resume, auto) {
600
600
  }
601
601
  async function getRegisteredProjects(all = false) {
602
602
  try {
603
- const { getRegistryBackend } = await import("./factory-DeASMV7Z.mjs");
603
+ const { getRegistryBackend } = await import("./factory-DFwez99M.mjs");
604
604
  return await (await getRegistryBackend()).listProjectsWithSessionStats(all ? {} : { status: "active" });
605
605
  } catch {
606
606
  return [];
@@ -784,4 +784,4 @@ async function cmdMain(query, pickN, opts) {
784
784
 
785
785
  //#endregion
786
786
  export { cmdMain };
787
- //# sourceMappingURL=main-resolver-CAC3xfZM.mjs.map
787
+ //# sourceMappingURL=main-resolver-BKwI0I6H.mjs.map
@@ -1,5 +1,5 @@
1
1
  import { h as smartDecodeDir } from "./utils-J2b9y8PC.mjs";
2
- import { l as claudeHomeDir } from "./runtime-paths-WsO9sJFc.mjs";
2
+ import { l as claudeHomeDir } from "./runtime-paths-twfV23YL.mjs";
3
3
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
4
  import { createHash } from "node:crypto";
5
5
  import { join } from "node:path";
@@ -243,4 +243,4 @@ async function migrateFromJson(backend, registryPath = join(claudeHomeDir(), "se
243
243
 
244
244
  //#endregion
245
245
  export { slugify as a, parseSessionFilename as i, decodeEncodedDir as n, migrateFromJson as r, buildEncodedDirMap as t };
246
- //# sourceMappingURL=migrate-DrA_OwlZ.mjs.map
246
+ //# sourceMappingURL=migrate-C2z1YmWC.mjs.map
@@ -1,15 +1,15 @@
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 parseFootprint, B as MODEL_INVENTORY_MAX_AGE_MS, G as fmtMem, H as ProbeHold, J as inventoryRows, K as fmtMemMapped, Q as modelLabel, R as DOWN_AFTER_MISSES, U as computeInventory, V as MODEL_INVENTORY_REFRESH_MS, W as currentInventory, X as liveDeps, Y as inventoryText, Z as modelKind, at as readInventoryInput, ct as writeInventory, et as parseSizeMb, it as readInventory, nt as processTreeMemory, ot as readModelLabels, q as inventoryPath, rt as processTreeRssMb, st as startInventoryRefresh, tt as parseTable, z as INVENTORY_HEADERS } 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";
1
+ import "./config-Bz8pAU5Q.mjs";
2
+ import "./config-SlZ-Z52i.mjs";
3
+ import "./paths-CypxFTfn.mjs";
4
+ import "./status-Cecau8Ps.mjs";
5
+ import "./scope-BTWstJ1B.mjs";
6
+ import { $ as parseFootprint, B as MODEL_INVENTORY_MAX_AGE_MS, G as fmtMem, H as ProbeHold, J as inventoryRows, K as fmtMemMapped, Q as modelLabel, R as DOWN_AFTER_MISSES, U as computeInventory, V as MODEL_INVENTORY_REFRESH_MS, W as currentInventory, X as liveDeps, Y as inventoryText, Z as modelKind, at as readInventoryInput, ct as writeInventory, et as parseSizeMb, it as readInventory, nt as processTreeMemory, ot as readModelLabels, q as inventoryPath, rt as processTreeRssMb, st as startInventoryRefresh, tt as parseTable, z as INVENTORY_HEADERS } from "./routing-aJKMIagQ.mjs";
7
+ import "./tool-errors-BFw1gv-z.mjs";
8
+ import "./wait-C5iWILj_.mjs";
9
+ import "./local-tiers-CqwGUcEn.mjs";
10
+ import "./caller-identity-C6Nc96iM.mjs";
11
+ import "./capacity-B2PgKAg4.mjs";
12
+ import "./local-instances-DhF4_sV2.mjs";
13
+ import "./local-candidate-DFd4pp-w.mjs";
14
14
 
15
15
  export { computeInventory, currentInventory, processTreeRssMb, readInventoryInput, writeInventory };