@codyswann/lisa 4.85.0 → 4.86.1

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 (333) hide show
  1. package/all/copy-overwrite/scripts/lib/completion-proof-content.mjs +63 -22
  2. package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +6 -1
  3. package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +19 -3
  4. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
  5. package/dist/cli/doctor-session-manager-pending.d.ts +17 -0
  6. package/dist/cli/doctor-session-manager-pending.d.ts.map +1 -0
  7. package/dist/cli/doctor-session-manager-pending.js +130 -0
  8. package/dist/cli/doctor-session-manager-pending.js.map +1 -0
  9. package/dist/cli/doctor-session-manager-token.d.ts +69 -0
  10. package/dist/cli/doctor-session-manager-token.d.ts.map +1 -0
  11. package/dist/cli/doctor-session-manager-token.js +264 -0
  12. package/dist/cli/doctor-session-manager-token.js.map +1 -0
  13. package/dist/cli/doctor-session-manager.d.ts +3 -1
  14. package/dist/cli/doctor-session-manager.d.ts.map +1 -1
  15. package/dist/cli/doctor-session-manager.js +168 -146
  16. package/dist/cli/doctor-session-manager.js.map +1 -1
  17. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  18. package/dist/core/lisa-owned-hash-ledger.js +16 -0
  19. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  20. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  21. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  22. package/dist/core/upstream-evidence-manifest.js +168 -26
  23. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  24. package/dist/opencode/plugin-templates/parity-safety-net.sh +19 -3
  25. package/package.json +4 -4
  26. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa/.codex-plugin/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  29. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/SKILL.md +5 -3
  30. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  31. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  32. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +197 -54
  33. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +23 -10
  34. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  35. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  36. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  37. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  38. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  39. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  40. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  41. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  42. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  43. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +39 -11
  44. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  45. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  46. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  47. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  48. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  49. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  50. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  51. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  52. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  53. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  54. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  55. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  56. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  57. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token.mjs +39 -120
  58. package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +82 -19
  59. package/plugins/lisa/commands/session-manager.md +1 -1
  60. package/plugins/lisa/commands/setup/session-manager.md +1 -1
  61. package/plugins/lisa/hooks/parity-safety-net.sh +19 -3
  62. package/plugins/lisa/rules/reference/config-resolution.md +39 -7
  63. package/plugins/lisa/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  64. package/plugins/lisa/skills/lisa-secrets-access/SKILL.md +5 -3
  65. package/plugins/lisa/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  66. package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  67. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +197 -54
  68. package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +23 -10
  69. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  70. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  71. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  72. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  73. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  74. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  75. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  76. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  77. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  78. package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +39 -11
  79. package/plugins/lisa/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  80. package/plugins/lisa/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  81. package/plugins/lisa/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  82. package/plugins/lisa/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  83. package/plugins/lisa/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  84. package/plugins/lisa/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  85. package/plugins/lisa/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  86. package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  87. package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  88. package/plugins/lisa/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  89. package/plugins/lisa/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  90. package/plugins/lisa/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  91. package/plugins/lisa/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  92. package/plugins/lisa/skills/lisa-session-manager/scripts/token.mjs +39 -120
  93. package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +82 -19
  94. package/plugins/lisa-agy/commands/lisa/session-manager.md +1 -1
  95. package/plugins/lisa-agy/commands/lisa/setup/session-manager.md +1 -1
  96. package/plugins/lisa-agy/hooks/parity-safety-net.sh +19 -3
  97. package/plugins/lisa-agy/plugin.json +1 -1
  98. package/plugins/lisa-agy/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  99. package/plugins/lisa-agy/skills/lisa-secrets-access/SKILL.md +5 -3
  100. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  101. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  102. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +197 -54
  103. package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +23 -10
  104. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  105. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  106. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  107. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  108. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  109. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  110. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  111. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  112. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  113. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +39 -11
  114. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  115. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  116. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  117. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  118. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  119. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  120. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  121. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  122. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  123. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  124. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  125. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  126. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  127. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token.mjs +39 -120
  128. package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +82 -19
  129. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  130. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  131. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  132. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  134. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  135. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  136. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  137. package/plugins/lisa-copilot/commands/lisa/session-manager.md +1 -1
  138. package/plugins/lisa-copilot/commands/lisa/setup/session-manager.md +1 -1
  139. package/plugins/lisa-copilot/hooks/parity-safety-net.sh +19 -3
  140. package/plugins/lisa-copilot/rules/reference/config-resolution.md +39 -7
  141. package/plugins/lisa-copilot/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  142. package/plugins/lisa-copilot/skills/lisa-secrets-access/SKILL.md +5 -3
  143. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  144. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  145. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +197 -54
  146. package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +23 -10
  147. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  148. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  149. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  150. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  151. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  152. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  153. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  154. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  155. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  156. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +39 -11
  157. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  158. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  159. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  160. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  161. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  162. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  163. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  164. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  165. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  166. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  167. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  168. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  169. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  170. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token.mjs +39 -120
  171. package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +82 -19
  172. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  173. package/plugins/lisa-cursor/commands/lisa/session-manager.md +1 -1
  174. package/plugins/lisa-cursor/commands/lisa/setup/session-manager.md +1 -1
  175. package/plugins/lisa-cursor/hooks/parity-safety-net.sh +19 -3
  176. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +39 -7
  177. package/plugins/lisa-cursor/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  178. package/plugins/lisa-cursor/skills/lisa-secrets-access/SKILL.md +5 -3
  179. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  180. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  181. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +197 -54
  182. package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +23 -10
  183. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  184. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  185. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  186. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  187. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  188. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  189. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  190. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  191. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  192. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +39 -11
  193. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  194. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  195. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  196. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  197. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  198. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  199. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  200. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  201. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  202. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  203. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  204. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  205. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  206. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token.mjs +39 -120
  207. package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +82 -19
  208. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  209. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  210. package/plugins/lisa-devin/hooks/parity-safety-net.sh +19 -3
  211. package/plugins/lisa-devin/rules/reference/config-resolution.md +39 -7
  212. package/plugins/lisa-devin/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  213. package/plugins/lisa-devin/skills/lisa-secrets-access/SKILL.md +5 -3
  214. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  215. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  216. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +197 -54
  217. package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +23 -10
  218. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  219. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  220. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  221. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  222. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  223. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  224. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  225. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  226. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  227. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +39 -11
  228. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  229. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  230. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  231. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  232. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  233. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  234. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  235. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  236. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  237. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  238. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  239. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  240. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  241. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token.mjs +39 -120
  242. package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +82 -19
  243. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  244. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  245. package/plugins/lisa-expo-agy/plugin.json +1 -1
  246. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  247. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  248. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  249. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  250. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  251. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  252. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  253. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  254. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  255. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  256. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  257. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  258. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  259. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  260. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  261. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  262. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  263. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  264. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  265. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  266. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  267. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  268. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  269. package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
  270. package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
  271. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  272. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  273. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  274. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  275. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  276. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  277. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  278. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  279. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  280. package/plugins/lisa-rails-agy/plugin.json +1 -1
  281. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  282. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  283. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  284. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  285. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  286. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  287. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  288. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  289. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  290. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  291. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  292. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  293. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  294. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  295. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  296. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  297. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  298. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  299. package/plugins/src/base/commands/session-manager.md +1 -1
  300. package/plugins/src/base/commands/setup/session-manager.md +1 -1
  301. package/plugins/src/base/hooks/parity-safety-net.sh +19 -3
  302. package/plugins/src/base/rules/reference/config-resolution.md +39 -7
  303. package/plugins/src/base/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
  304. package/plugins/src/base/skills/lisa-secrets-access/SKILL.md +5 -3
  305. package/plugins/src/base/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
  306. package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
  307. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +197 -54
  308. package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +23 -10
  309. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
  310. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
  311. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
  312. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
  313. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
  314. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
  315. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
  316. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
  317. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
  318. package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +39 -11
  319. package/plugins/src/base/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
  320. package/plugins/src/base/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
  321. package/plugins/src/base/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
  322. package/plugins/src/base/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
  323. package/plugins/src/base/skills/lisa-session-manager/scripts/launch.mjs +69 -60
  324. package/plugins/src/base/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
  325. package/plugins/src/base/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
  326. package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
  327. package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
  328. package/plugins/src/base/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
  329. package/plugins/src/base/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
  330. package/plugins/src/base/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
  331. package/plugins/src/base/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
  332. package/plugins/src/base/skills/lisa-session-manager/scripts/token.mjs +39 -120
  333. package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +82 -19
@@ -362,45 +362,86 @@ export function validateObligations(record, scope, claims) {
362
362
  );
363
363
  }
364
364
 
365
- /** Use the same canonical parser/integrity implementation as the TS writer. */
365
+ /**
366
+ * Whether one usage entry is the canonical Verify entry for this work item.
367
+ * @param {any} entry Parsed usage entry, if any.
368
+ * @param {string} ref Work-item reference.
369
+ * @param {any} context Provider context.
370
+ * @returns {boolean} True when the flow and artifact identity both match.
371
+ */
372
+ function isVerifyEntryFor(entry, ref, context) {
373
+ const identity = String(entry?.artifactRef ?? "").replace(/^github:/, "");
374
+ const linear =
375
+ context.provider === "linear" &&
376
+ identity === `linear:${context.scope.split("/")[0]}/${ref}`;
377
+ return (
378
+ ["lisa-verify", "verify"].includes(entry?.flow) &&
379
+ (linear ||
380
+ identity === ref ||
381
+ identity === `https://github.com/${ref.replace("#", "/issues/")}`)
382
+ );
383
+ }
384
+
385
+ /**
386
+ * Use the same canonical parser/integrity implementation as the TS writer.
387
+ *
388
+ * Every comment on the work item is read, from any author. A `## Lisa Usage`
389
+ * section that is malformed or fails its integrity check therefore cannot be
390
+ * allowed to fail the whole authorization: one stray or hand-edited comment
391
+ * would otherwise turn a completed item into `invalid-proof`
392
+ * (CodySwannGT/lisa#4564). Such a section contributes no entries and is
393
+ * skipped, and an expected id is satisfied when ANY intact section carries the
394
+ * matching Verify entry, so a later conflicting copy cannot shadow it. Nothing
395
+ * is accepted that was not accepted before: every expected id still needs an
396
+ * intact, well-formed section holding the Verify entry for this exact item.
397
+ */
366
398
  export function validateVerifyUsage(documents, ref, expectedIds, context) {
367
399
  requireProof(
368
400
  Array.isArray(expectedIds) && expectedIds.length > 0,
369
401
  "Canonical Verify usage is missing."
370
402
  );
371
403
  const found = new Map();
372
- for (const document of documents) {
373
- const usage = section(document, "Lisa Usage");
404
+ let skipped = 0;
405
+ for (const [index, document] of documents.entries()) {
406
+ let usage;
407
+ try {
408
+ usage = section(document, "Lisa Usage");
409
+ } catch (error) {
410
+ // documents[0] is the work-item body; a duplicate heading there stays
411
+ // fatal. In a comment it is one more stray section to skip.
412
+ if (index === 0) throw error;
413
+ skipped += 1;
414
+ continue;
415
+ }
374
416
  if (!usage) continue;
375
417
  const canonical = `## Lisa Usage\n${usage}\n`;
376
418
  let parsed;
377
419
  try {
378
420
  parsed = parseLisaUsageSection(canonical);
379
421
  } catch {
380
- requireProof(
381
- false,
382
- "The current canonical Verify usage section is malformed."
383
- );
422
+ skipped += 1;
423
+ continue;
384
424
  }
385
425
  if (!parsed.range) continue;
386
- requireProof(
387
- verifyLisaUsageSectionIntegrity(canonical).ok,
388
- "The canonical usage ledger failed its stored-surface integrity check."
389
- );
390
- for (const entry of parsed.entries) found.set(entry.entryId, entry);
426
+ if (!verifyLisaUsageSectionIntegrity(canonical).ok) {
427
+ skipped += 1;
428
+ continue;
429
+ }
430
+ for (const entry of parsed.entries) {
431
+ if (!found.has(entry.entryId)) found.set(entry.entryId, []);
432
+ found.get(entry.entryId).push(entry);
433
+ }
391
434
  }
435
+ const note =
436
+ skipped > 0
437
+ ? ` ${skipped} malformed or integrity-failing usage section(s) were ignored.`
438
+ : "";
392
439
  for (const id of expectedIds) {
393
- const entry = found.get(id);
394
- const identity = String(entry?.artifactRef ?? "").replace(/^github:/, "");
395
- const linear =
396
- context.provider === "linear" &&
397
- identity === `linear:${context.scope.split("/")[0]}/${ref}`;
398
440
  requireProof(
399
- ["lisa-verify", "verify"].includes(entry?.flow) &&
400
- (linear ||
401
- identity === ref ||
402
- identity === `https://github.com/${ref.replace("#", "/issues/")}`),
403
- `Canonical Verify usage entry ${id} is absent or belongs to another work item.`
441
+ (found.get(id) ?? []).some(entry =>
442
+ isVerifyEntryFor(entry, ref, context)
443
+ ),
444
+ `Canonical Verify usage entry ${id} is absent or belongs to another work item.${note}`
404
445
  );
405
446
  // acceptedAt/lifecycleSources attest the later native terminal event. They
406
447
  // are deliberately not prerequisites of the transition they describe.
@@ -19,8 +19,13 @@ const ENTRY = fileURLToPath(import.meta.url);
19
19
  const PRELOAD = fileURLToPath(
20
20
  new URL("./npm-update-hook-preload.mjs", import.meta.url)
21
21
  );
22
+ // Byte-for-byte the `-e` payload of `rails-prepush` in
23
+ // rails/copy-overwrite/lefthook.yml. `hookEntry` matches it exactly, so any
24
+ // edit to that lefthook command must be mirrored here; the regression test
25
+ // `npm-update-hosted-hook-rails-inline.test.ts` reads the lefthook file and
26
+ // fails when the two drift (CodySwannGT/lisa#4564).
22
27
  const RAILS_INLINE =
23
- 'try { const { main } = await import("./scripts/lisa-rails-prepush.mjs"); process.exitCode = await main(process.argv.slice(1)); } catch { console.error("Managed Rails push tooling is unavailable or damaged. Run full Lisa apply and retry; raw bootstrap errors are withheld."); process.exitCode = 1; }';
28
+ 'try { const { main } = await import("./scripts/lisa-rails-prepush.mjs"); const rc = await main(process.argv.slice(1)); if (rc !== 0) console.error(`Rails pre-push refused (exit ${rc}). Retry the same git push command and inspect rails-prepush output for scanner and work-item details.`); process.exitCode = rc; } catch { console.error("Managed Rails push tooling is unavailable or damaged. Run full Lisa apply and retry; raw bootstrap errors are withheld."); process.exitCode = 1; }';
24
29
 
25
30
  /** Context carries no token; the broker independently retains its immutable read subject in parent memory. */
26
31
  export function hostedHookContext(file) {
@@ -3475,12 +3475,28 @@ if [ -f "$rules_file" ]; then
3475
3475
  # here — before the remaining rules ran, and with an exit status that is
3476
3476
  # not a refusal. The `||` puts the pipeline in a condition context, where
3477
3477
  # a non-zero status is expected rather than fatal.
3478
- # Consume the whole input: grep -q can close an early match while printf
3479
- # is still writing, making pipefail report SIGPIPE instead of the match.
3478
+ # A here-string, never a pipe. With `printf | grep` under pipefail, a grep
3479
+ # that stops at its first match (`-q`, and GNU grep whose stdout is
3480
+ # /dev/null, which it treats as `-q`) closes the pipe while printf is still
3481
+ # writing; printf takes SIGPIPE and the pipeline reports 141 instead of
3482
+ # grep's 0. 141 lands in the `*)` arm below and a rule that MATCHED was
3483
+ # reported as an invalid regex and not enforced (CodySwannGT/lisa#4564).
3484
+ # A here-string has no writer process, so the status is grep's alone.
3485
+ #
3486
+ # The here-string is staged by the shell (a pipe, or a temp file for a
3487
+ # large body or on Bash 3.2), and that staging can fail: no temp space,
3488
+ # a file-size limit. A failed redirection on a bare `grep … <<<` returns
3489
+ # 1, the same status as "no match", so the rule would silently pass. The
3490
+ # brace group separates the two: grep's own status is captured INSIDE it,
3491
+ # so the group itself only fails when the redirection could not be set up.
3480
3492
  rule_status=0
3481
- printf '%s' "$custom_command_str" | grep -Ei -- "$rule" >/dev/null || rule_status=$?
3493
+ { grep -qEi -- "$rule" || rule_status=$?; } <<<"$custom_command_str" \
3494
+ || rule_status=unstaged
3482
3495
  case "$rule_status" in
3483
3496
  0) block "matched a project custom safety rule (${rules_file##*/}): $rule" ;;
3497
+ # Fail closed: the rule could not be evaluated at all, which is not the
3498
+ # same thing as the rule not matching.
3499
+ unstaged) block "could not stage the command to check project custom safety rule (${rules_file##*/}): $rule" ;;
3484
3500
  1) ;; # no match
3485
3501
  # grep exits 2 on a malformed ERE. Treated as no-match before, so a typo
3486
3502
  # in a project's rules file silently disabled that rule — a guard the
@@ -103,7 +103,7 @@
103
103
  "children": []
104
104
  },
105
105
  "lib/completion-proof-content.mjs": {
106
- "sha256": "78b34223d054913c2e900830070cbb1fb2dc267423ec458ae76553ceed0d38c6",
106
+ "sha256": "679702f6e3cce3919e01c79fe5016d3215f15b067bcab2fb9eeffb0350e7c64f",
107
107
  "staticImports": [
108
108
  "lib/completion-proof-shape.mjs",
109
109
  "lib/usage-ledger-integrity.mjs",
@@ -733,7 +733,7 @@
733
733
  "children": []
734
734
  },
735
735
  "lib/npm-update-hosted-hook.mjs": {
736
- "sha256": "0e9cf3bf55b9b979d22553f01ad4d17c0a85058b2b87657bd3126b9034e9f8c1",
736
+ "sha256": "801b41f0f3f455c08b4e86a64f076190a5f245492959a154d70b897dd0d60a31",
737
737
  "staticImports": [
738
738
  "lib/npm-update-contract.mjs",
739
739
  "lib/npm-update-invariants.mjs",
@@ -0,0 +1,17 @@
1
+ import { type Finding } from "./doctor-session-manager-trust.js";
2
+ /** What the pending-human scan adds to the check. */
3
+ export interface PendingHumanReport {
4
+ /** One line listing the waiting items, or undefined when there are none. */
5
+ readonly note: string | undefined;
6
+ readonly findings: readonly Finding[];
7
+ }
8
+ /**
9
+ * List the items pending a human and warn about unmarked ones.
10
+ * @param targetPath - Project root
11
+ * @param block - Merged `sessionManager` block
12
+ * @param read - Text reader
13
+ * @param now - Clock
14
+ * @returns The note and findings
15
+ */
16
+ export declare function pendingHumanReport(targetPath: string, block: Record<string, unknown>, read: (file: string) => Promise<string>, now: () => Date): Promise<PendingHumanReport>;
17
+ //# sourceMappingURL=doctor-session-manager-pending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-session-manager-pending.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-session-manager-pending.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,mCAAmC,CAAC;AAgB3C,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;CACvC;AA0ED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EACvC,GAAG,EAAE,MAAM,IAAI,GACd,OAAO,CAAC,kBAAkB,CAAC,CAgC7B"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Items waiting on a human, for the session-manager doctor check
3
+ * (CodySwannGT/lisa#4555, part 3).
4
+ *
5
+ * The manager marks an item that needs a person and keeps dispatching others.
6
+ * Doctor lists what is waiting so an operator sees it without the tracker, and
7
+ * warns about one failure only it can see from outside: a question recorded in
8
+ * the ledger more than one cycle `interval` ago whose tracker mark was never
9
+ * read back (`markedAt: null`). The manager records the question before it
10
+ * writes the mark, so this is a cycle that crashed or was stopped mid-way and
11
+ * has not finished the job since, and nobody on the tracker knows the item is
12
+ * waiting.
13
+ *
14
+ * Only the ref, kind and age are printed, never the question text: it came
15
+ * from a worker or a ticket and could carry anything.
16
+ */
17
+ import * as path from "node:path";
18
+ import { isRecord, readJson, } from "./doctor-session-manager-trust.js";
19
+ /** The cycle interval when `sessionManager.interval` is absent. */
20
+ const DEFAULT_INTERVAL_MS = 5 * 60_000;
21
+ const MINUTE_MS = 60_000;
22
+ const HOUR_MS = 60 * MINUTE_MS;
23
+ const DAY_MS = 24 * HOUR_MS;
24
+ const UNIT_MS = {
25
+ s: 1000,
26
+ m: MINUTE_MS,
27
+ h: HOUR_MS,
28
+ d: DAY_MS,
29
+ };
30
+ /**
31
+ * Parse a cycle interval such as `5m`; anything else is the default.
32
+ * @param value - `sessionManager.interval`
33
+ * @returns Interval in milliseconds
34
+ */
35
+ function intervalMs(value) {
36
+ const match = typeof value === "string" ? /^(\d+)([smhd])$/.exec(value) : null;
37
+ if (!match)
38
+ return DEFAULT_INTERVAL_MS;
39
+ return Number(match[1]) * (UNIT_MS[match[2] ?? "m"] ?? MINUTE_MS);
40
+ }
41
+ /**
42
+ * A short age such as `3h` or `20m`.
43
+ * @param ms - Age in milliseconds
44
+ * @returns Age text
45
+ */
46
+ function age(ms) {
47
+ if (ms >= DAY_MS)
48
+ return `${Math.floor(ms / DAY_MS)}d`;
49
+ if (ms >= HOUR_MS)
50
+ return `${Math.floor(ms / HOUR_MS)}h`;
51
+ return `${Math.max(0, Math.floor(ms / MINUTE_MS))}m`;
52
+ }
53
+ /**
54
+ * The waiting items in a parsed ledger, oldest first.
55
+ * @param ledger - Parsed ledger.json
56
+ * @param now - Current time in ms
57
+ * @returns Waiting items
58
+ */
59
+ function waitingItems(ledger, now) {
60
+ const items = isRecord(ledger.items) ? ledger.items : {};
61
+ const rows = Object.entries(items).flatMap(([ref, item]) => {
62
+ const question = isRecord(item) ? item.pendingQuestion : undefined;
63
+ if (!isRecord(question))
64
+ return [];
65
+ const asked = Date.parse(String(question.askedAt ?? ""));
66
+ return [
67
+ {
68
+ ref,
69
+ kind: typeof question.kind === "string" ? question.kind : "worker-question",
70
+ ageMs: Number.isNaN(asked) ? 0 : now - asked,
71
+ marked: typeof question.markedAt === "string",
72
+ },
73
+ ];
74
+ });
75
+ return [...rows].sort((a, b) => b.ageMs - a.ageMs);
76
+ }
77
+ /**
78
+ * Why the ledger could not be loaded: unparseable JSON, or a read that
79
+ * failed (permissions, a directory in its place), told apart so the
80
+ * operator fixes the right thing. Only the error code is shown.
81
+ * @param error - What reading or parsing threw
82
+ * @returns Phrase completing "<file> …"
83
+ */
84
+ function ledgerProblem(error) {
85
+ if (error instanceof SyntaxError)
86
+ return "is not valid JSON";
87
+ const code = isRecord(error) && typeof error.code === "string" ? error.code : undefined;
88
+ return code === undefined
89
+ ? "could not be read"
90
+ : `could not be read (${code})`;
91
+ }
92
+ /**
93
+ * List the items pending a human and warn about unmarked ones.
94
+ * @param targetPath - Project root
95
+ * @param block - Merged `sessionManager` block
96
+ * @param read - Text reader
97
+ * @param now - Clock
98
+ * @returns The note and findings
99
+ */
100
+ export async function pendingHumanReport(targetPath, block, read, now) {
101
+ const file = path.join(targetPath, ".lisa", "session-manager", "ledger.json");
102
+ const loaded = await readJson(read, file).then(value => ({ ledger: value, problem: undefined }), (error) => ({ ledger: undefined, problem: ledgerProblem(error) }));
103
+ if (loaded.problem !== undefined) {
104
+ return {
105
+ note: undefined,
106
+ findings: [
107
+ {
108
+ status: "warn",
109
+ text: `${file} ${loaded.problem}, so doctor cannot list the items waiting on a human; the manager also refuses it until it is repaired`,
110
+ },
111
+ ],
112
+ };
113
+ }
114
+ const ledger = loaded.ledger;
115
+ const waiting = ledger === undefined ? [] : waitingItems(ledger, now().getTime());
116
+ if (waiting.length === 0)
117
+ return { note: undefined, findings: [] };
118
+ const limit = intervalMs(block.interval);
119
+ const unmarked = waiting.filter(item => !item.marked && item.ageMs > limit);
120
+ return {
121
+ note: `${waiting.length} pending a human: ${waiting
122
+ .map(item => `${item.ref} (${item.kind}, ${age(item.ageMs)})`)
123
+ .join(", ")}`,
124
+ findings: unmarked.map(item => ({
125
+ status: "warn",
126
+ text: `${item.ref} has waited ${age(item.ageMs)} for a human but was never marked human-needed on the tracker, so nobody there knows; check the manager is running (session-manager.mjs status) and let its next cycle mark it`,
127
+ })),
128
+ };
129
+ }
130
+ //# sourceMappingURL=doctor-session-manager-pending.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-session-manager-pending.js","sourceRoot":"","sources":["../../src/cli/doctor-session-manager-pending.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,69 @@
1
+ import { type Finding } from "./doctor-session-manager-trust.js";
2
+ /** Resolved inputs the Telegram findings read. */
3
+ export interface TelegramContext {
4
+ readonly claudeDir: string;
5
+ readonly sharedDir: string;
6
+ readonly env: NodeJS.ProcessEnv;
7
+ readonly read: (file: string) => Promise<string>;
8
+ readonly statFile: (file: string) => Promise<{
9
+ readonly mode: number;
10
+ }>;
11
+ /** The configured secrets provider, or undefined when none (or `env`). */
12
+ readonly secretsProvider: string | undefined;
13
+ /** The provider secret name for this manager. */
14
+ readonly secretName: string;
15
+ }
16
+ /**
17
+ * The provider secret name for a manager: `TELEGRAM_BOT_TOKEN_<NAME>` with
18
+ * the name upper-snaked. Must agree with the session-manager CLI's
19
+ * `telegramSecretName` (token-store.mjs); a test pins the two together.
20
+ * @param managerName - `sessionManager.name`
21
+ * @returns Secret name
22
+ */
23
+ export declare function telegramSecretNameFor(managerName: unknown): string;
24
+ /**
25
+ * The secrets provider the session-manager CLI will use for this project, or
26
+ * undefined when it uses none (`env`, or no provider at all). Decided exactly
27
+ * the way the CLI's `loadTokenSecrets` does through `lisa-secrets-access`'s
28
+ * `readConfig`: only the committed `.lisa.config.json` counts (the local
29
+ * override is never read for `secrets`), its `secrets.provider` defaulting
30
+ * to `env`; with no committed file at all, the environment fallback
31
+ * (`LISA_TENANT` or `LISA_SECRETS_NAMESPACE` names a tenant, and
32
+ * `LISA_PROVIDER` / `LISA_SECRETS_PROVIDER` its provider, default
33
+ * `bitwarden`). A test pins this to the CLI. Known gap: with no config file
34
+ * at the root the CLI also looks under `LISA_PROJECT_DIR` /
35
+ * `CLAUDE_PROJECT_DIR`; doctor only looks at the project it was pointed at.
36
+ * @param targetPath - Project root
37
+ * @param read - Text reader
38
+ * @param env - Doctor's environment
39
+ * @returns Provider name, or undefined for none
40
+ */
41
+ export declare function secretsProviderAt(targetPath: string, read: (file: string) => Promise<string>, env: NodeJS.ProcessEnv): Promise<string | undefined>;
42
+ /**
43
+ * Resolve the configured state dir to an absolute path, expanding `~`.
44
+ * @param raw - Configured `notify.stateDir`
45
+ * @param home - Home directory
46
+ * @param projectRoot - Base for a relative path
47
+ * @returns Absolute path, or undefined when unset
48
+ */
49
+ export declare function resolveStateDir(raw: unknown, home: string, projectRoot: string): string | undefined;
50
+ /**
51
+ * The plaintext-token findings that hold with no notification channel too
52
+ * (the spec's "doctor flags any plaintext token file it finds"): an exported
53
+ * `TELEGRAM_BOT_TOKEN*` variable, by name only, and a token file in the
54
+ * shared Telegram state dir, by existence only (never read). The Telegram
55
+ * requirements themselves (state dir, plugin scope, `TELEGRAM_STATE_DIR`)
56
+ * are skipped, since no bot is configured.
57
+ * @param ctx - The shared dir, environment and mode reader
58
+ * @returns Findings
59
+ */
60
+ export declare function plaintextTokenFindings(ctx: Pick<TelegramContext, "sharedDir" | "env" | "statFile">): Promise<readonly Finding[]>;
61
+ /**
62
+ * Every Telegram finding: the state dir and its token file, the user-scope
63
+ * plugin and shared default dir, and exported Telegram variables.
64
+ * @param ctx - Resolved inputs
65
+ * @param stateDir - Absolute state dir, or undefined when unset
66
+ * @returns Findings
67
+ */
68
+ export declare function telegramFindings(ctx: TelegramContext, stateDir: string | undefined): Promise<readonly Finding[]>;
69
+ //# sourceMappingURL=doctor-session-manager-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-session-manager-token.d.ts","sourceRoot":"","sources":["../../src/cli/doctor-session-manager-token.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,KAAK,OAAO,EAIb,MAAM,mCAAmC,CAAC;AAY3C,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxE,0EAA0E;IAC1E,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAKlE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EACvC,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU7B;AAyBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAMpB;AAuID;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,KAAK,GAAG,UAAU,CAAC,GAC3D,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAa7B;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,eAAe,EACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAM7B"}