@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
@@ -0,0 +1,46 @@
1
+ import "./utils-J2b9y8PC.mjs";
2
+ import "./migrate-C2z1YmWC.mjs";
3
+ import "./config-Bz8pAU5Q.mjs";
4
+ import "./config-SlZ-Z52i.mjs";
5
+ import "./paths-CypxFTfn.mjs";
6
+ import "./worktree-O_kU6Q3y.mjs";
7
+ import "./status-Cecau8Ps.mjs";
8
+ import "./pool-9EsbKD-U.mjs";
9
+ import "./registrable-Dxs4oKIj.mjs";
10
+ import "./pai-marker-D6OoVbM_.mjs";
11
+ import "./helpers-CRuBUas3.mjs";
12
+ import "./reranker-CqCbpGnX.mjs";
13
+ import "./scope-BTWstJ1B.mjs";
14
+ import "./routing-aJKMIagQ.mjs";
15
+ import "./tool-errors-BFw1gv-z.mjs";
16
+ import "./wait-C5iWILj_.mjs";
17
+ import "./local-tiers-CqwGUcEn.mjs";
18
+ import "./caller-identity-C6Nc96iM.mjs";
19
+ import "./capacity-B2PgKAg4.mjs";
20
+ import "./local-instances-DhF4_sV2.mjs";
21
+ import "./local-candidate-DFd4pp-w.mjs";
22
+ import "./factory-CYwa0jYj.mjs";
23
+ import "./postgres-BL5oBBgY.mjs";
24
+ import "./embedding-gate-iq0oQEkF.mjs";
25
+ import "./embeddings-BVq3esBF.mjs";
26
+ import "./router-D2476pOp.mjs";
27
+ import "./detect-DLjeYwnt.mjs";
28
+ import "./scan-CNMcltOX.mjs";
29
+ import "./launch-Bn2Zf90h.mjs";
30
+ import "./run-DE9Q0ldN.mjs";
31
+ import "./controls-rIItFeIJ.mjs";
32
+ import "./endreason-C2-hYK0_.mjs";
33
+ import "./render-jPpMrudf.mjs";
34
+ import "./operator-Br6GeswF.mjs";
35
+ import "./kill-tree-DPiMscaY.mjs";
36
+ import "./pool-cli-Db0uDwB9.mjs";
37
+ import "./pane-audit-DLYy9-4g.mjs";
38
+ import "./ipc-client-CmagIFLh.mjs";
39
+ import "./embed-pass-CN1D8MXl.mjs";
40
+ import "./session-usage-CCmPFFa6.mjs";
41
+ import "./lessons-CFVU0cwA.mjs";
42
+ import { t as serve } from "./daemon-SoUvPUOf.mjs";
43
+ import "./auto-route-YaEGVrFl.mjs";
44
+ import "./zettelkasten-FFhQFESJ.mjs";
45
+
46
+ export { serve };
@@ -1,39 +1,40 @@
1
- import { g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
1
+ import { _ as paiHomePath } from "./runtime-paths-twfV23YL.mjs";
2
2
  import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
3
- import { Et as appendLedger, M as readWorkersSection, t as ANTHROPIC_NATIVE } from "./config-CST2uq1v.mjs";
4
- import { f as readMainConfigRaw, i as defaults, p as writeMainConfigRaw, u as paiConfigFilePath, y as shippedMainDefaults } from "./config-DYbyEe4-.mjs";
5
- import { c as slotCurrentPath, i as ledgerPath, r as eventsPath, u as workersLogDir } from "./paths-DS5VQKoR.mjs";
6
- import { f as gcWorktreesThrottled, w as worktreesDir } from "./worktree-BY--Rgmy.mjs";
7
- import { B as loadStatusConfig, C as nowStamp, G as writeSectionToForge, I as PROJECT_CONFIG_REL, L as formatStale, b as loadStatusesCached, h as isChatPane, k as saveStatus, s as alive, v as loadStatus, z as listStale } from "./status-COtzewKV.mjs";
8
- import { a as unregistrableReason } from "./registrable-CXBBpUcz.mjs";
3
+ import { Et as appendLedger, M as readWorkersSection, t as ANTHROPIC_NATIVE } from "./config-Bz8pAU5Q.mjs";
4
+ import { f as readMainConfigRaw, i as defaults, p as writeMainConfigRaw, u as paiConfigFilePath, y as shippedMainDefaults } from "./config-SlZ-Z52i.mjs";
5
+ import { c as slotCurrentPath, i as ledgerPath, r as eventsPath, u as workersLogDir } from "./paths-CypxFTfn.mjs";
6
+ import { f as gcWorktreesThrottled, w as worktreesDir } from "./worktree-O_kU6Q3y.mjs";
7
+ import { B as listStale, C as nowStamp, K as writeSectionToForge, L as PROJECT_CONFIG_REL, R as formatStale, V as loadStatusConfig, b as loadStatusesCached, h as isChatPane, k as saveStatus, s as alive, v as loadStatus } from "./status-Cecau8Ps.mjs";
8
+ import { a as unregistrableReason } from "./registrable-Dxs4oKIj.mjs";
9
9
  import { c as yieldToEventLoop, f as fileContentHash, l as buildOutline, n as chunkId, u as chunkMarkdown } from "./helpers-CRuBUas3.mjs";
10
10
  import { n as TITLE_STOP_WORDS, t as STOP_WORDS } from "./stop-words-DSEYQdNe.mjs";
11
11
  import { i as populateSlugs, t as applyRecencyBoost } from "./search-RSyeQqj1.mjs";
12
12
  import { n as rerankResults } from "./reranker-CqCbpGnX.mjs";
13
- import { i as itermUuid, r as itermForClaudeSession } from "./scope-D8HK6vU7.mjs";
14
- import { Tn as startLocalStatusRefresh, st as startInventoryRefresh } from "./routing-BlD_tKjW.mjs";
13
+ import { i as itermUuid, r as itermForClaudeSession } from "./scope-BTWstJ1B.mjs";
14
+ import { Tn as startLocalStatusRefresh, st as startInventoryRefresh } from "./routing-aJKMIagQ.mjs";
15
15
  import { n as minOf, t as maxOf } from "./min-max-DrSRUaWQ.mjs";
16
- import { C as toolErrorSigTag, S as summarizeToolInput, T as toolErrorText, a as SAME_WORKER_WINDOW_MS, b as readToolErrors, c as classifyToolError, d as detectToolErrors, s as benignNote, u as detectRunningWorkerErrors, w as toolErrorSummary } from "./tool-errors-DXJ70-sr.mjs";
17
- import { b as killProcessTree } from "./wait-ChpHKJZV.mjs";
18
- import { a as buildsDir, b as stallMinutes, c as listBuilds, l as listBuildsSync, u as patchTicket } from "./caller-identity-Bim8JT-D.mjs";
16
+ import { C as toolErrorSigTag, S as summarizeToolInput, T as toolErrorText, a as SAME_WORKER_WINDOW_MS, b as readToolErrors, c as classifyToolError, d as detectToolErrors, s as benignNote, u as detectRunningWorkerErrors, w as toolErrorSummary } from "./tool-errors-BFw1gv-z.mjs";
17
+ import { b as killProcessTree } from "./wait-C5iWILj_.mjs";
18
+ import { a as buildsDir, b as stallMinutes, c as listBuilds, l as listBuildsSync, u as patchTicket } from "./caller-identity-C6Nc96iM.mjs";
19
19
  import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
20
- import { d as getBackendOutage, n as createRegistryBackend, r as createStorageBackend } from "./factory-BV0MQA3T.mjs";
21
- import { c as resolveFromModule, n as embedChunksWithBackend } from "./postgres-C-T5OWer.mjs";
22
- import { a as requireQueryEmbedding, c as getConfiguredBackend, h as mismatchReason, m as bindingMatches, n as embedQuery } from "./embedding-gate-CTAk8STe.mjs";
20
+ import { d as getBackendOutage, n as createRegistryBackend, r as createStorageBackend } from "./factory-CYwa0jYj.mjs";
21
+ import { c as resolveFromModule, n as embedChunksWithBackend } from "./postgres-BL5oBBgY.mjs";
22
+ import { a as requireQueryEmbedding, c as getConfiguredBackend, h as mismatchReason, m as bindingMatches, n as embedQuery } from "./embedding-gate-iq0oQEkF.mjs";
23
23
  import { i as deserializeEmbedding, n as configureEmbeddingModel, r as cosineSimilarity$1 } from "./embeddings-BVq3esBF.mjs";
24
- import { n as routeNotification } from "./router-CQSc3lk3.mjs";
25
- import { r as formatDetectionJson, t as detectProject } from "./detect-CHuxFrLy.mjs";
26
- import { i as performScan } from "./scan-C3uotg_f.mjs";
27
- import { r as sendToSession, t as callAiBroker } from "./aibroker-client-CQPGqLxL.mjs";
28
- import { E as probeRouter, F as startHandover, M as routerSwapArgs, N as runRouterTick, O as routerIsStale, P as spawnRouter, j as routerRunningPid, l as runMessenger, t as runWorker } from "./run-AZVwceiU.mjs";
29
- import { a as localIdleTick, et as closeEndedPanes, g as sweepRuns, gt as workerEnded, pt as paneMayClose, st as loadRegistry, xt as truncateLines } from "./controls-OiVVbe-f.mjs";
30
- import { l as isPaneRunId, n as auditTick, r as closeFinishedPanes } from "./pane-audit-wv9UkyCe.mjs";
31
- import { a as EMBED_PASS_BATCH_SIZE, c as liveYieldCheck, d as runEmbedCycle, i as DEFAULT_EMBED_RESUME_MINUTES, n as DEFAULT_EMBED_MAX_LOAD, r as DEFAULT_EMBED_MAX_MINUTES, t as DEFAULT_EMBED_CYCLE_MAX_MINUTES, u as recordEmbedPass } from "./embed-pass-DtVF2fOV.mjs";
32
- import { o as logWorkersConfigShadowsOnce } from "./session-usage-oycSdiD3.mjs";
33
- import { $ as setStartTime, A as indexSchedulerTimer, At as startQuietWatcher, B as setDaemonConfig, Ct as runSessionKeepaliveTick, D as embedInProgress, E as daemonConfig, F as lastVaultIndexTime, Ft as writeDaemonPidfile, G as setLastEmbedPass, H as setEmbedSchedulerTimer, I as notificationConfig, It as readContextHandoverCache, J as setLastIndexTime, K as setLastEmbedTime, L as passFailures, Lt as writeContextHandoverCache, M as lastEmbedTime, N as lastIndexPass, Nt as removeDaemonPidfile, O as embedSchedulerTimer, P as lastIndexTime, Q as setShutdownRequested, R as registryBackend, S as handleSessionSummary, T as cacheKeepaliveTimer, Tt as deferIfQuiet, U as setIndexInProgress, Ut as restartRouter, V as setEmbedInProgress, W as setIndexSchedulerTimer, X as setNotificationConfig, Y as setLastVaultIndexTime, Z as setRegistryBackend, _ as markFailed, _t as buildWakeupContext, a as runPassChild, at as vaultIndexInProgress, b as findLatestJsonl, c as NonRetryableError, ct as addWorkToSessionNote, d as enqueue, dt as getCurrentNotePath, et as setStorageBackend, f as enqueueCoalesced, ft as archiveSessionFilesToSessionsDir, g as markCompleted, gt as vaultIndexEnabled, h as loadQueue, ht as obsidianEnabled, it as storageBackend, j as lastEmbedPass, k as indexInProgress, kt as registerQuietRunner, l as cleanup, lt as appendCheckpoint, m as hasPendingOrProcessingOfType, n as buildPassCommand, nt as shutdownRequested, o as backfillKgFromNotes, ot as sessionIdFromTranscript, p as getStats, pt as findNotesDir, q as setLastIndexPass, r as cliEntry, rt as startTime, st as updateTodoContinue, t as PassSpawnError, tt as setVaultIndexInProgress, u as dequeue, ut as finalizeSessionNote, w as spawnSummarizer, x as getGitContext, xt as sweepOrphans, y as contentToText$2, z as setCacheKeepaliveTimer } from "./indexer-backend-B2vtFl38.mjs";
34
- import { r as saveQueryResult } from "./query-feedback-DN52N9C5.mjs";
35
- import { n as formatAutoRouteJson, r as detectTopicShift, t as autoRoute } from "./auto-route-DUYr57rs.mjs";
36
- import { a as zettelThemes, c as zettelExplore, i as zettelHealth, n as zettelGodNotes, o as zettelConverse, r as zettelSuggest, s as zettelSurprise, t as zettelCommunities } from "./zettelkasten-LoH9RBiN.mjs";
24
+ import { n as routeNotification } from "./router-D2476pOp.mjs";
25
+ import { r as formatDetectionJson, t as detectProject } from "./detect-DLjeYwnt.mjs";
26
+ import { i as performScan } from "./scan-CNMcltOX.mjs";
27
+ import { r as sendToSession, t as callAiBroker } from "./aibroker-client-CXsyC7A8.mjs";
28
+ import { E as probeRouter, F as startHandover, M as routerSwapArgs, N as runRouterTick, O as routerIsStale, P as spawnRouter, j as routerRunningPid, l as runMessenger, t as runWorker } from "./run-DE9Q0ldN.mjs";
29
+ import { a as localIdleTick, et as closeEndedPanes, g as sweepRuns, gt as workerEnded, pt as paneMayClose, st as loadRegistry } from "./controls-rIItFeIJ.mjs";
30
+ import { Y as truncateLines } from "./render-jPpMrudf.mjs";
31
+ import { l as isPaneRunId, n as auditTick, r as closeFinishedPanes } from "./pane-audit-DLYy9-4g.mjs";
32
+ import { a as EMBED_PASS_BATCH_SIZE, c as liveYieldCheck, d as runEmbedCycle, i as DEFAULT_EMBED_RESUME_MINUTES, n as DEFAULT_EMBED_MAX_LOAD, r as DEFAULT_EMBED_MAX_MINUTES, t as DEFAULT_EMBED_CYCLE_MAX_MINUTES, u as recordEmbedPass } from "./embed-pass-CN1D8MXl.mjs";
33
+ import { o as logWorkersConfigShadowsOnce } from "./session-usage-CCmPFFa6.mjs";
34
+ import { $ as setIndexSchedulerTimer, A as getGitContext, B as lastEmbedPass, Bt as registerQuietRunner, C as hasPendingOrProcessingOfType, Dt as vaultIndexEnabled, E as markFailed, Et as obsidianEnabled, F as daemonConfig, G as notificationConfig, H as lastIndexPass, I as embedInProgress, It as deferIfQuiet, J as setCacheKeepaliveTimer, Jt as writeContextHandoverCache, K as passFailures, Kt as writeDaemonPidfile, L as embedSchedulerTimer, Mt as sweepOrphans, N as spawnSummarizer, O as contentToText$2, Ot as buildWakeupContext, P as cacheKeepaliveTimer, Pt as runSessionKeepaliveTick, Q as setIndexInProgress, R as indexInProgress, S as getStats, St as findNotesDir, T as markCompleted, Tt as lessonsIndexEnabled, U as lastIndexTime, V as lastEmbedTime, Vt as startQuietWatcher, W as lastVaultIndexTime, Wt as removeDaemonPidfile, X as setEmbedInProgress, Y as setDaemonConfig, Z as setEmbedSchedulerTimer, _ as NonRetryableError, _t as addWorkToSessionNote, a as lessonsDir, at as setNotificationConfig, b as enqueue, bt as getCurrentNotePath, ct as setStartTime, d as buildPassCommand, dt as shutdownRequested, en as restartRouter, et as setLastEmbedPass, f as cliEntry, ft as startTime, gt as updateTodoContinue, h as backfillKgFromNotes, ht as sessionIdFromTranscript, i as getLesson, it as setLastVaultIndexTime, j as handleSessionSummary, k as findLatestJsonl, lt as setStorageBackend, m as runPassChild, mt as vaultIndexInProgress, n as LESSON_STATES, nt as setLastIndexPass, o as listLessons, ot as setRegistryBackend, pt as storageBackend, q as registryBackend, qt as readContextHandoverCache, rt as setLastIndexTime, st as setShutdownRequested, tt as setLastEmbedTime, u as PassSpawnError, ut as setVaultIndexInProgress, v as cleanup, vt as appendCheckpoint, w as loadQueue, x as enqueueCoalesced, xt as archiveSessionFilesToSessionsDir, y as dequeue, yt as finalizeSessionNote, z as indexSchedulerTimer } from "./lessons-CFVU0cwA.mjs";
35
+ import { r as saveQueryResult } from "./query-feedback-BWl2HRwN.mjs";
36
+ import { n as formatAutoRouteJson, r as detectTopicShift, t as autoRoute } from "./auto-route-YaEGVrFl.mjs";
37
+ import { a as zettelThemes, c as zettelExplore, i as zettelHealth, n as zettelGodNotes, o as zettelConverse, r as zettelSuggest, s as zettelSurprise, t as zettelCommunities } from "./zettelkasten-FFhQFESJ.mjs";
37
38
  import { appendFileSync, chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, statSync, unlinkSync, utimesSync, writeFileSync } from "node:fs";
38
39
  import { basename, dirname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
39
40
  import { setPriority } from "node:os";
@@ -735,12 +736,12 @@ async function checkLoops(logDir, statuses, sent, deps = {}) {
735
736
  throw err;
736
737
  }
737
738
  }, say = async (logDir, id, text) => {
738
- const { sayToWorker } = await import("./operator-Bpxq_WB5.mjs");
739
+ const { sayToWorker } = await import("./operator-Bmv5tiHQ.mjs");
739
740
  return sayToWorker(logDir, id, text);
740
741
  }, kill = (pid) => {
741
742
  process.kill(pid, "SIGTERM");
742
743
  }, killChildren = async (logDir, id) => {
743
- const { killTree } = await import("./kill-tree-CXZ0WfVf.mjs");
744
+ const { killTree } = await import("./kill-tree-Dxei6qlR.mjs");
744
745
  return killTree(logDir, id, {
745
746
  skipRoot: true,
746
747
  by: "loop-guard",
@@ -2824,11 +2825,24 @@ async function runIndex() {
2824
2825
  setIndexInProgress(false);
2825
2826
  }
2826
2827
  }
2828
+ /** Synthetic project id of the lessons chunks (the vault uses 999 when unregistered). */
2829
+ const LESSONS_PROJECT_ID = 998;
2830
+ /** Index `<PAI home>/lessons` so memory search finds approved and candidate lessons. */
2831
+ async function runLessonsIndex() {
2832
+ const dir = lessonsDir();
2833
+ if (!lessonsIndexEnabled() || !existsSync(dir)) return;
2834
+ try {
2835
+ await indexVault(storageBackend, LESSONS_PROJECT_ID, dir);
2836
+ } catch (e) {
2837
+ process.stderr.write(`[pai-daemon] Lessons index error: ${e instanceof Error ? e.message : String(e)}\n`);
2838
+ }
2839
+ }
2827
2840
  /**
2828
2841
  * Run a vault index pass. Guards against overlapping runs with vaultIndexInProgress.
2829
2842
  * Skips if no vaultPath is configured, or if project index/embed is in progress.
2830
2843
  */
2831
2844
  async function runVaultIndex() {
2845
+ await runLessonsIndex();
2832
2846
  if (!daemonConfig.vaultPath || !vaultIndexEnabled()) return;
2833
2847
  if (vaultIndexInProgress) {
2834
2848
  process.stderr.write("[pai-daemon] Vault index already in progress, skipping.\n");
@@ -4860,6 +4874,39 @@ async function toolMemoryWakeup(registry, params) {
4860
4874
  }
4861
4875
  }
4862
4876
 
4877
+ //#endregion
4878
+ //#region src/mcp/tools/lessons.ts
4879
+ /**
4880
+ * MCP tool handler: memory_lessons
4881
+ *
4882
+ * Read-only access to the review-gated lessons; approved ones by default.
4883
+ */
4884
+ const text = (t, isError = false) => ({
4885
+ content: [{
4886
+ type: "text",
4887
+ text: t
4888
+ }],
4889
+ ...isError ? { isError } : {}
4890
+ });
4891
+ async function toolMemoryLessons(params) {
4892
+ try {
4893
+ if (params.action === "get") {
4894
+ if (!params.id) return text("id is required for action=get", true);
4895
+ const l = getLesson(params.id);
4896
+ return l ? text(JSON.stringify(l, null, 2)) : text(`Lesson not found: ${params.id}`, true);
4897
+ }
4898
+ const state = params.state ?? "approved";
4899
+ if (!LESSON_STATES.includes(state)) return text(`Unknown state: ${state}`, true);
4900
+ const ls = listLessons({
4901
+ state,
4902
+ project: params.project
4903
+ });
4904
+ return text(ls.length ? JSON.stringify(ls, null, 2) : `No ${state} lessons.`);
4905
+ } catch (e) {
4906
+ return text(`memory_lessons error: ${e instanceof Error ? e.message : String(e)}`, true);
4907
+ }
4908
+ }
4909
+
4863
4910
  //#endregion
4864
4911
  //#region src/memory/taxonomy.ts
4865
4912
  /**
@@ -6026,6 +6073,7 @@ async function dispatchTool(method, params) {
6026
6073
  case "project_health": return toolProjectHealth(registryBackend, p);
6027
6074
  case "project_todo": return toolProjectTodo(registryBackend, p);
6028
6075
  case "memory_wakeup": return toolMemoryWakeup(registryBackend, p);
6076
+ case "memory_lessons": return toolMemoryLessons(p);
6029
6077
  case "memory_taxonomy": return toolMemoryTaxonomy(registryBackend, storageBackend, p);
6030
6078
  case "topic_check": return detectTopicShift(registryBackend, storageBackend, p);
6031
6079
  case "session_auto_route": return toolSessionRoute(registryBackend, storageBackend, p);
@@ -6870,4 +6918,4 @@ async function serve(config) {
6870
6918
 
6871
6919
  //#endregion
6872
6920
  export { serve as t };
6873
- //# sourceMappingURL=daemon-C1dycZ3W.mjs.map
6921
+ //# sourceMappingURL=daemon-SoUvPUOf.mjs.map
@@ -1,44 +1,44 @@
1
1
  #!/usr/bin/env node
2
2
  import "../utils-J2b9y8PC.mjs";
3
- import { g as paiHomePath } from "../runtime-paths-WsO9sJFc.mjs";
4
- import { Dt as ledgerSummary, M as readWorkersSection, a as MODEL_CAPABILITIES, f as escalationCloud, m as isLocalProvider, n as CAPABILITY_NAME_RE, p as getProviderOrNative } from "../config-CST2uq1v.mjs";
5
- import { S as MainConfigError, c as loadConfig, n as CONFIG_FILE } from "../config-DYbyEe4-.mjs";
6
- import { i as ledgerPath, u as workersLogDir } from "../paths-DS5VQKoR.mjs";
7
- import "../worktree-BY--Rgmy.mjs";
8
- import { A as setWorkerLabel, C as nowStamp, O as reconcileStatuses, g as isLive, o as ageOf, v as loadStatus, y as loadStatuses } from "../status-COtzewKV.mjs";
9
- import "../pool-BZ94nFuq.mjs";
3
+ import { _ as paiHomePath } from "../runtime-paths-twfV23YL.mjs";
4
+ import { Dt as ledgerSummary, M as readWorkersSection, a as MODEL_CAPABILITIES, f as escalationCloud, m as isLocalProvider, n as CAPABILITY_NAME_RE, p as getProviderOrNative } from "../config-Bz8pAU5Q.mjs";
5
+ import { S as MainConfigError, c as loadConfig, n as CONFIG_FILE } from "../config-SlZ-Z52i.mjs";
6
+ import { i as ledgerPath, u as workersLogDir } from "../paths-CypxFTfn.mjs";
7
+ import "../worktree-O_kU6Q3y.mjs";
8
+ import { C as nowStamp, O as reconcileStatuses, g as isLive, j as setWorkerLabel, o as ageOf, v as loadStatus, y as loadStatuses } from "../status-Cecau8Ps.mjs";
9
+ import "../pool-9EsbKD-U.mjs";
10
10
  import "../helpers-CRuBUas3.mjs";
11
11
  import { t as dropItermBundleId } from "../env-BE8mrsxr.mjs";
12
- import "../scope-D8HK6vU7.mjs";
13
- import { Ft as clearSessionRoute, J as inventoryRows, Kt as sessionRoutesPatch, W as currentInventory, _n as currentLocalStatus, cn as detectSessionName, dn as getProfile, fn as profilesPath, mn as updateProfile, xn as probeLoopback, z as INVENTORY_HEADERS } from "../routing-BlD_tKjW.mjs";
14
- import "../tool-errors-DXJ70-sr.mjs";
15
- import "../wait-ChpHKJZV.mjs";
16
- import "../local-tiers-BtdEEe5n.mjs";
17
- import { a as buildsDir, c as listBuilds, i as buildNext, p as renderBuildQueue, v as poolSlots } from "../caller-identity-Bim8JT-D.mjs";
18
- import { i as effectiveCap, l as reorderQueue, s as queueRows } from "../capacity-CsZMkVyg.mjs";
19
- import "../local-instances-bdCNNSsL.mjs";
20
- import { a as localStatusReport } from "../local-candidate-Cp_bw4kK.mjs";
21
- import "../factory-BV0MQA3T.mjs";
22
- import "../postgres-C-T5OWer.mjs";
23
- import "../embedding-gate-CTAk8STe.mjs";
12
+ import "../scope-BTWstJ1B.mjs";
13
+ import { Ft as clearSessionRoute, J as inventoryRows, Kt as sessionRoutesPatch, W as currentInventory, _n as currentLocalStatus, cn as detectSessionName, dn as getProfile, fn as profilesPath, mn as updateProfile, xn as probeLoopback, z as INVENTORY_HEADERS } from "../routing-aJKMIagQ.mjs";
14
+ import "../tool-errors-BFw1gv-z.mjs";
15
+ import "../wait-C5iWILj_.mjs";
16
+ import "../local-tiers-CqwGUcEn.mjs";
17
+ import { a as buildsDir, c as listBuilds, i as buildNext, p as renderBuildQueue, v as poolSlots } from "../caller-identity-C6Nc96iM.mjs";
18
+ import { i as effectiveCap, p as reorderQueue, s as queueRows } from "../capacity-B2PgKAg4.mjs";
19
+ import "../local-instances-DhF4_sV2.mjs";
20
+ import { a as localStatusReport } from "../local-candidate-DFd4pp-w.mjs";
21
+ import "../factory-CYwa0jYj.mjs";
22
+ import "../postgres-BL5oBBgY.mjs";
23
+ import "../embedding-gate-iq0oQEkF.mjs";
24
24
  import "../embeddings-BVq3esBF.mjs";
25
- import "../router-CQSc3lk3.mjs";
26
- import "../launch-DpQPZGsT.mjs";
27
- import { H as testProvider, a as resolveWorkers, c as reportOriginWithHost, f as dirtyPaths, i as liveResolveCtx, t as runWorker, u as startDetached } from "../run-AZVwceiU.mjs";
28
- import { A as tail, B as loadPlanStatus, C as readRunLog, D as resumeState, E as requestPlanStop, F as runLogPath, G as planRunId, Gt as handoffFromInside, J as queueLockPath, L as fmtElapsed, M as dirtyConflicts, P as loadPlan, S as planStopPath, X as sinceText, Y as readRunLock, b as idleText, j as PlanError, q as planLockPath, qt as readInbox, w as renderSchedule, x as planStatus } from "../controls-OiVVbe-f.mjs";
29
- import { a as endLabel } from "../endreason-BqyyU7BH.mjs";
30
- import { D as deadlineLabel } from "../render-Cz3BWIBO.mjs";
31
- import { r as sayToWorker } from "../operator-DrwWItVt.mjs";
32
- import "../kill-tree-CcpsRLCZ.mjs";
33
- import "../pool-cli-B1eKySeN.mjs";
34
- import { t as runChain } from "../chain-Dzz6xcKH.mjs";
35
- import { C as schedulerLines, E as resolveSpecPath, S as withTarget, T as readSpecPrompt, _ as issueClaims, a as branchDiff, d as loadSettings, f as move, g as issueClaim, i as projectChecks, l as QueueStore, n as initProject, o as realQueueDeps, p as queueStatePath, r as isGitProject, s as acceptItems, t as formatCheck, u as again, v as issueStale, w as schedulerView, x as resolveTarget, y as providerCaps } from "../project-setup-pIPHZaXf.mjs";
36
- import "../pane-audit-wv9UkyCe.mjs";
37
- import { d as psOutput, f as replayOutput } from "../viewer-BgGRqXfD.mjs";
38
- import { i as fallbackStatusText, n as fallbackOn, r as fallbackStatus, t as fallbackOff } from "../fallback-Bj2cyVk_.mjs";
39
- import { _ as unsetCapabilityPreference, a as describeCapabilities, b as useProvider, c as modelPrefsText, d as setCapabilityPreference, f as setClass, g as setWorkersEnabled, h as setProviderModel, l as removeProvider, m as setProviderEnabled, o as describeModels, p as setProviderCap, r as classTargetText, s as describeProviders, t as addProvider, u as resolveProviderName, v as unsetClass, y as updateProvider } from "../providers-Dzx5GAUI.mjs";
40
- import { a as listConfigOp, i as getConfigValueOp, o as setConfigValueOp, s as unsetConfigValueOp, t as MainConfigOpsError } from "../main-config-ops-BYsK3BxM.mjs";
41
- import { n as PaiClient } from "../ipc-client-CnYEF31R.mjs";
25
+ import "../router-D2476pOp.mjs";
26
+ import "../launch-Bn2Zf90h.mjs";
27
+ import { H as testProvider, a as resolveWorkers, c as reportOriginWithHost, f as dirtyPaths, i as liveResolveCtx, t as runWorker, u as startDetached } from "../run-DE9Q0ldN.mjs";
28
+ import { A as tail, B as loadPlanStatus, C as readRunLog, D as resumeState, E as requestPlanStop, F as runLogPath, G as planRunId, Ht as handoffFromInside, J as queueLockPath, L as fmtElapsed, M as dirtyConflicts, P as loadPlan, S as planStopPath, Wt as readInbox, X as sinceText, Y as readRunLock, b as idleText, j as PlanError, q as planLockPath, w as renderSchedule, x as planStatus } from "../controls-rIItFeIJ.mjs";
29
+ import { a as endLabel } from "../endreason-C2-hYK0_.mjs";
30
+ import { D as deadlineLabel } from "../render-jPpMrudf.mjs";
31
+ import { r as sayToWorker } from "../operator-Br6GeswF.mjs";
32
+ import "../kill-tree-DPiMscaY.mjs";
33
+ import "../pool-cli-Db0uDwB9.mjs";
34
+ import { t as runChain } from "../chain-CtK49-Ma.mjs";
35
+ import { C as schedulerLines, E as resolveSpecPath, S as withTarget, T as readSpecPrompt, _ as issueClaims, a as branchDiff, d as loadSettings, f as move, g as issueClaim, i as projectChecks, l as QueueStore, n as initProject, o as realQueueDeps, p as queueStatePath, r as isGitProject, s as acceptItems, t as formatCheck, u as again, v as issueStale, w as schedulerView, x as resolveTarget, y as providerCaps } from "../project-setup-DHxdJjEc.mjs";
36
+ import "../pane-audit-DLYy9-4g.mjs";
37
+ import { d as psOutput, f as replayOutput } from "../viewer-DvBg6N22.mjs";
38
+ import { _ as unsetCapabilityPreference, a as describeCapabilities, b as useProvider, c as modelPrefsText, d as setCapabilityPreference, f as setClass, g as setWorkersEnabled, h as setProviderModel, l as removeProvider, m as setProviderEnabled, o as describeModels, p as setProviderCap, r as classTargetText, s as describeProviders, t as addProvider, u as resolveProviderName, v as unsetClass, y as updateProvider } from "../providers-BNV7CzC-.mjs";
39
+ import { a as listConfigOp, i as getConfigValueOp, o as setConfigValueOp, s as unsetConfigValueOp, t as MainConfigOpsError } from "../main-config-ops-rda08BCD.mjs";
40
+ import { n as PaiClient } from "../ipc-client-CmagIFLh.mjs";
41
+ import { i as fallbackStatusText, n as fallbackOn, r as fallbackStatus, t as fallbackOff } from "../fallback-CwPSCrX8.mjs";
42
42
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
43
43
  import { basename, dirname, join, resolve } from "node:path";
44
44
  import { stringify } from "yaml";
@@ -6310,7 +6310,7 @@ function workerModel(args, configPath) {
6310
6310
  * into the session's own terminal through AIBroker.
6311
6311
  */
6312
6312
  async function realSessionProfileDeps() {
6313
- const { sendToSession } = await import("../aibroker-client-BxzeEHPF.mjs");
6313
+ const { sendToSession } = await import("../aibroker-client-ChB7gSxV.mjs");
6314
6314
  return {
6315
6315
  path: profilesPath(),
6316
6316
  env: process.env,
@@ -6582,7 +6582,7 @@ function realDelegationDeps() {
6582
6582
  return {
6583
6583
  async resolveProject(project) {
6584
6584
  if (existsSync(project)) return resolve(project);
6585
- const { getProject } = await import("../helpers-WV8tdQHM.mjs");
6585
+ const { getProject } = await import("../helpers-DyHKAwrW.mjs");
6586
6586
  const row = await getProject(project);
6587
6587
  if (!row) throw new Error(`no project "${project}" is registered`);
6588
6588
  return row.root_path;
@@ -7282,6 +7282,17 @@ async function startShim() {
7282
7282
  project: string().optional().describe("Project slug or absolute root path. Omit to auto-detect from the current working directory."),
7283
7283
  token_budget: number().int().min(100).max(4e3).optional().describe("Maximum tokens for the L1 essential story block. Default: 800 (~3200 chars).")
7284
7284
  }, async (args) => proxyTool("memory_wakeup", args));
7285
+ server.tool("memory_lessons", "Read the curated, review-gated lessons (corrections, gotchas, conventions). Lists approved lessons by default; read-only.", {
7286
+ action: _enum(["list", "get"]).describe("list: lessons filtered by state/project; get: one lesson by id."),
7287
+ state: _enum([
7288
+ "candidate",
7289
+ "approved",
7290
+ "rejected",
7291
+ "superseded"
7292
+ ]).optional().describe("State filter for list. Default: approved."),
7293
+ project: string().optional().describe("Project slug or \"global\" filter for list."),
7294
+ id: string().optional().describe("Lesson id (required for get).")
7295
+ }, async (args) => proxyTool("memory_lessons", args));
7285
7296
  server.tool("memory_taxonomy", [
7286
7297
  "Return the SHAPE of stored memory without requiring a search query.",
7287
7298
  "",
@@ -0,0 +1,10 @@
1
+ import "./config-SlZ-Z52i.mjs";
2
+ import "./helpers-CRuBUas3.mjs";
3
+ import "./factory-CYwa0jYj.mjs";
4
+ import "./postgres-BL5oBBgY.mjs";
5
+ import "./embedding-gate-iq0oQEkF.mjs";
6
+ import "./embeddings-BVq3esBF.mjs";
7
+ import "./router-D2476pOp.mjs";
8
+ import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "./detect-DLjeYwnt.mjs";
9
+
10
+ export { detectProject };
@@ -1,4 +1,4 @@
1
- import { i as getRegistryBackend } from "./factory-BV0MQA3T.mjs";
1
+ import { i as getRegistryBackend } from "./factory-CYwa0jYj.mjs";
2
2
  import { resolve } from "node:path";
3
3
 
4
4
  //#region src/cli/impl/detect.ts
@@ -92,4 +92,4 @@ function formatDetectionJson(d) {
92
92
 
93
93
  //#endregion
94
94
  export { formatDetection as n, formatDetectionJson as r, detectProject as t };
95
- //# sourceMappingURL=detect-CHuxFrLy.mjs.map
95
+ //# sourceMappingURL=detect-DLjeYwnt.mjs.map
@@ -1,8 +1,8 @@
1
- import { g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
1
+ import { _ as paiHomePath } from "./runtime-paths-twfV23YL.mjs";
2
2
  import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
3
- import { M as readWorkersSection, m as isLocalProvider } from "./config-CST2uq1v.mjs";
4
- import { u as workersLogDir } from "./paths-DS5VQKoR.mjs";
5
- import { g as isLive, y as loadStatuses } from "./status-COtzewKV.mjs";
3
+ import { M as readWorkersSection, m as isLocalProvider } from "./config-Bz8pAU5Q.mjs";
4
+ import { u as workersLogDir } from "./paths-CypxFTfn.mjs";
5
+ import { g as isLive, y as loadStatuses } from "./status-Cecau8Ps.mjs";
6
6
  import { readFileSync } from "node:fs";
7
7
  import { loadavg } from "node:os";
8
8
 
@@ -161,4 +161,4 @@ async function runEmbedCycle(d) {
161
161
 
162
162
  //#endregion
163
163
  export { EMBED_PASS_BATCH_SIZE as a, liveYieldCheck as c, runEmbedCycle as d, DEFAULT_EMBED_RESUME_MINUTES as i, readEmbedPasses as l, DEFAULT_EMBED_MAX_LOAD as n, formatEmbedStatus as o, DEFAULT_EMBED_MAX_MINUTES as r, lastRecordedEmbedPass as s, DEFAULT_EMBED_CYCLE_MAX_MINUTES as t, recordEmbedPass as u };
164
- //# sourceMappingURL=embed-pass-DtVF2fOV.mjs.map
164
+ //# sourceMappingURL=embed-pass-CN1D8MXl.mjs.map
@@ -1,5 +1,5 @@
1
- import "./config-DYbyEe4-.mjs";
2
- import { a as requireQueryEmbedding, i as measureThroughput, n as embedQuery, r as gateBackend, t as QUERY_PREFIX } from "./embedding-gate-CTAk8STe.mjs";
1
+ import "./config-SlZ-Z52i.mjs";
2
+ import { a as requireQueryEmbedding, i as measureThroughput, n as embedQuery, r as gateBackend, t as QUERY_PREFIX } from "./embedding-gate-iq0oQEkF.mjs";
3
3
  import "./embeddings-BVq3esBF.mjs";
4
4
 
5
5
  export { embedQuery, gateBackend };
@@ -1,5 +1,5 @@
1
- import { g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { c as loadConfig, i as defaults } from "./config-DYbyEe4-.mjs";
1
+ import { _ as paiHomePath } from "./runtime-paths-twfV23YL.mjs";
2
+ import { c as loadConfig, i as defaults } from "./config-SlZ-Z52i.mjs";
3
3
  import { t as LOCAL_PROBE_TIMEOUT_MS } from "./timeouts-1MLooEBB.mjs";
4
4
  import { n as configureEmbeddingModel, o as generateEmbeddings, t as EMBEDDING_DIM } from "./embeddings-BVq3esBF.mjs";
5
5
  import { createReadStream, createWriteStream, existsSync, mkdirSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -420,4 +420,4 @@ async function measureThroughput(backend, texts) {
420
420
 
421
421
  //#endregion
422
422
  export { requireQueryEmbedding as a, getConfiguredBackend as c, OLLAMA_ID as d, ollamaDefaultUrl as f, mismatchReason as h, measureThroughput as i, provisionOllama as l, bindingMatches as m, embedQuery as n, createBackend as o, LEGACY_EMBEDDING_BINDING as p, gateBackend as r, detectBackends as s, QUERY_PREFIX as t, OLLAMA_DEFAULT_MODEL as u };
423
- //# sourceMappingURL=embedding-gate-CTAk8STe.mjs.map
423
+ //# sourceMappingURL=embedding-gate-iq0oQEkF.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { t as writeFileAtomic } from "./atomic-file-BorMa4T3.mjs";
2
- import { Et as appendLedger } from "./config-CST2uq1v.mjs";
3
- import { r as eventsPath } from "./paths-DS5VQKoR.mjs";
4
- import { D as pidAlive } from "./status-COtzewKV.mjs";
2
+ import { Et as appendLedger } from "./config-Bz8pAU5Q.mjs";
3
+ import { r as eventsPath } from "./paths-CypxFTfn.mjs";
4
+ import { D as pidAlive } from "./status-Cecau8Ps.mjs";
5
5
  import { appendFileSync, existsSync, readFileSync, unlinkSync } from "node:fs";
6
6
  import { join } from "node:path";
7
7
  import { execFileSync } from "node:child_process";
@@ -151,4 +151,4 @@ function appendStopEvent(logDir, id, stop) {
151
151
 
152
152
  //#endregion
153
153
  export { endLabel as a, endFields as i, callerDescription as n, parentInfo as o, decideEndReason as r, requestKill as s, appendStopEvent as t };
154
- //# sourceMappingURL=endreason-BqyyU7BH.mjs.map
154
+ //# sourceMappingURL=endreason-C2-hYK0_.mjs.map
@@ -1,13 +1,13 @@
1
- import { _ as resolvePaiFile, d as defaultPaiHomeDir, g as paiHomePath } from "./runtime-paths-WsO9sJFc.mjs";
2
- import { A as DEFAULT_PG_CONNECTION_TIMEOUT_MS, N as postgresConnectionString, c as loadConfig } from "./config-DYbyEe4-.mjs";
1
+ import { _ as paiHomePath, d as defaultPaiHomeDir, v as resolvePaiFile } from "./runtime-paths-twfV23YL.mjs";
2
+ import { A as DEFAULT_PG_CONNECTION_TIMEOUT_MS, N as postgresConnectionString, c as loadConfig } from "./config-SlZ-Z52i.mjs";
3
3
  import { a as parseSessionTitleChunk, c as yieldToEventLoop, f as fileContentHash, h as sha256File, i as isPathTooBroadForContentScan, n as chunkId, o as walkContentFiles, r as detectTier, s as walkMdFiles, t as INDEX_YIELD_EVERY, u as chunkMarkdown } from "./helpers-CRuBUas3.mjs";
4
4
  import { t as STOP_WORDS } from "./stop-words-DSEYQdNe.mjs";
5
5
  import { n as buildFtsQuery, r as isQuerySyntaxError } from "./search-RSyeQqj1.mjs";
6
6
  import { n as minOf, t as maxOf } from "./min-max-DrSRUaWQ.mjs";
7
- import { a as entityContentId, t as PostgresBackend } from "./postgres-C-T5OWer.mjs";
8
- import { p as LEGACY_EMBEDDING_BINDING } from "./embedding-gate-CTAk8STe.mjs";
7
+ import { a as entityContentId, t as PostgresBackend } from "./postgres-BL5oBBgY.mjs";
8
+ import { p as LEGACY_EMBEDDING_BINDING } from "./embedding-gate-iq0oQEkF.mjs";
9
9
  import { i as deserializeEmbedding, r as cosineSimilarity } from "./embeddings-BVq3esBF.mjs";
10
- import { n as routeNotification } from "./router-CQSc3lk3.mjs";
10
+ import { n as routeNotification } from "./router-D2476pOp.mjs";
11
11
  import { existsSync, mkdirSync, readFileSync, statSync } from "node:fs";
12
12
  import { basename, dirname, join, relative } from "node:path";
13
13
  import pg from "pg";
@@ -2915,4 +2915,4 @@ async function closeStorage() {
2915
2915
 
2916
2916
  //#endregion
2917
2917
  export { getStorageBackend as a, MergeError as c, getBackendOutage as d, humanDuration as f, getRegistryBackend as i, federationDbPath as l, createRegistryBackend as n, oldRegistryPath as o, createStorageBackend as r, registryDbPath as s, closeStorage as t, oldFederationPath as u };
2918
- //# sourceMappingURL=factory-BV0MQA3T.mjs.map
2918
+ //# sourceMappingURL=factory-CYwa0jYj.mjs.map
@@ -0,0 +1,9 @@
1
+ import "./config-SlZ-Z52i.mjs";
2
+ import "./helpers-CRuBUas3.mjs";
3
+ import { a as getStorageBackend, i as getRegistryBackend, n as createRegistryBackend, r as createStorageBackend, t as closeStorage } from "./factory-CYwa0jYj.mjs";
4
+ import "./postgres-BL5oBBgY.mjs";
5
+ import "./embedding-gate-iq0oQEkF.mjs";
6
+ import "./embeddings-BVq3esBF.mjs";
7
+ import "./router-D2476pOp.mjs";
8
+
9
+ export { createStorageBackend, getRegistryBackend };