@nxuss/lemma 1.43.0 → 1.45.0

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 (388) hide show
  1. package/README.md +26 -8
  2. package/bin/brain-ingest.js +48 -13
  3. package/bin/cloud.js +228 -0
  4. package/dist/cjs/cli/hostHooks.d.ts +44 -7
  5. package/dist/cjs/cli/hostHooks.d.ts.map +1 -1
  6. package/dist/cjs/cli/hostHooks.js +201 -11
  7. package/dist/cjs/cli/hostHooks.js.map +1 -1
  8. package/dist/cjs/cli/lemma-proxy.d.ts.map +1 -1
  9. package/dist/cjs/cli/lemma-proxy.js +13 -16
  10. package/dist/cjs/cli/lemma-proxy.js.map +1 -1
  11. package/dist/cjs/cloud/CloudBrainClient.d.ts +52 -0
  12. package/dist/cjs/cloud/CloudBrainClient.d.ts.map +1 -0
  13. package/dist/cjs/cloud/CloudBrainClient.js +161 -0
  14. package/dist/cjs/cloud/CloudBrainClient.js.map +1 -0
  15. package/dist/cjs/cloud/CloudConfig.d.ts +41 -0
  16. package/dist/cjs/cloud/CloudConfig.d.ts.map +1 -0
  17. package/dist/cjs/cloud/CloudConfig.js +133 -0
  18. package/dist/cjs/cloud/CloudConfig.js.map +1 -0
  19. package/dist/cjs/cloud/CloudEntitlement.d.ts +55 -0
  20. package/dist/cjs/cloud/CloudEntitlement.d.ts.map +1 -0
  21. package/dist/cjs/cloud/CloudEntitlement.js +174 -0
  22. package/dist/cjs/cloud/CloudEntitlement.js.map +1 -0
  23. package/dist/cjs/cloud/billing/stripeApi.d.ts +43 -0
  24. package/dist/cjs/cloud/billing/stripeApi.d.ts.map +1 -0
  25. package/dist/cjs/cloud/billing/stripeApi.js +116 -0
  26. package/dist/cjs/cloud/billing/stripeApi.js.map +1 -0
  27. package/dist/cjs/cloud/billing/stripeWebhook.d.ts +35 -0
  28. package/dist/cjs/cloud/billing/stripeWebhook.d.ts.map +1 -0
  29. package/dist/cjs/cloud/billing/stripeWebhook.js +190 -0
  30. package/dist/cjs/cloud/billing/stripeWebhook.js.map +1 -0
  31. package/dist/cjs/cloud/console/ConsoleStore.d.ts +111 -0
  32. package/dist/cjs/cloud/console/ConsoleStore.d.ts.map +1 -0
  33. package/dist/cjs/cloud/console/ConsoleStore.js +172 -0
  34. package/dist/cjs/cloud/console/ConsoleStore.js.map +1 -0
  35. package/dist/cjs/cloud/console/consoleRouter.d.ts +68 -0
  36. package/dist/cjs/cloud/console/consoleRouter.d.ts.map +1 -0
  37. package/dist/cjs/cloud/console/consoleRouter.js +301 -0
  38. package/dist/cjs/cloud/console/consoleRouter.js.map +1 -0
  39. package/dist/cjs/cloud/console/mailer.d.ts +22 -0
  40. package/dist/cjs/cloud/console/mailer.d.ts.map +1 -0
  41. package/dist/cjs/cloud/console/mailer.js +35 -0
  42. package/dist/cjs/cloud/console/mailer.js.map +1 -0
  43. package/dist/cjs/cloud/identity/PlanPolicy.d.ts +42 -6
  44. package/dist/cjs/cloud/identity/PlanPolicy.d.ts.map +1 -1
  45. package/dist/cjs/cloud/identity/PlanPolicy.js +102 -22
  46. package/dist/cjs/cloud/identity/PlanPolicy.js.map +1 -1
  47. package/dist/cjs/cloud/identity/RateLimiter.d.ts +21 -1
  48. package/dist/cjs/cloud/identity/RateLimiter.d.ts.map +1 -1
  49. package/dist/cjs/cloud/identity/RateLimiter.js +59 -2
  50. package/dist/cjs/cloud/identity/RateLimiter.js.map +1 -1
  51. package/dist/cjs/cloud/identity/TenantResolver.d.ts +6 -1
  52. package/dist/cjs/cloud/identity/TenantResolver.d.ts.map +1 -1
  53. package/dist/cjs/cloud/identity/TenantResolver.js +1 -1
  54. package/dist/cjs/cloud/identity/TenantResolver.js.map +1 -1
  55. package/dist/cjs/cloud/identity/authenticateV2.d.ts.map +1 -1
  56. package/dist/cjs/cloud/identity/authenticateV2.js +7 -4
  57. package/dist/cjs/cloud/identity/authenticateV2.js.map +1 -1
  58. package/dist/cjs/cloud/identity/identityStore.d.ts +96 -10
  59. package/dist/cjs/cloud/identity/identityStore.d.ts.map +1 -1
  60. package/dist/cjs/cloud/identity/identityStore.js +203 -4
  61. package/dist/cjs/cloud/identity/identityStore.js.map +1 -1
  62. package/dist/cjs/cloud/metering/PostgresLedgerStore.d.ts +18 -0
  63. package/dist/cjs/cloud/metering/PostgresLedgerStore.d.ts.map +1 -0
  64. package/dist/cjs/cloud/metering/PostgresLedgerStore.js +56 -0
  65. package/dist/cjs/cloud/metering/PostgresLedgerStore.js.map +1 -0
  66. package/dist/cjs/cloud/metering/UsageLedger.d.ts +74 -0
  67. package/dist/cjs/cloud/metering/UsageLedger.d.ts.map +1 -1
  68. package/dist/cjs/cloud/metering/UsageLedger.js +122 -17
  69. package/dist/cjs/cloud/metering/UsageLedger.js.map +1 -1
  70. package/dist/cjs/cloud/metering/index.d.ts +1 -0
  71. package/dist/cjs/cloud/metering/index.d.ts.map +1 -1
  72. package/dist/cjs/cloud/metering/index.js +1 -0
  73. package/dist/cjs/cloud/metering/index.js.map +1 -1
  74. package/dist/cjs/cloud/store/FileBrainStore.d.ts +6 -1
  75. package/dist/cjs/cloud/store/FileBrainStore.d.ts.map +1 -1
  76. package/dist/cjs/cloud/store/FileBrainStore.js +8 -0
  77. package/dist/cjs/cloud/store/FileBrainStore.js.map +1 -1
  78. package/dist/cjs/cloud/store/PostgresBrainStore.d.ts +11 -1
  79. package/dist/cjs/cloud/store/PostgresBrainStore.d.ts.map +1 -1
  80. package/dist/cjs/cloud/store/PostgresBrainStore.js +32 -0
  81. package/dist/cjs/cloud/store/PostgresBrainStore.js.map +1 -1
  82. package/dist/cjs/cloud/store/memorySummary.d.ts +29 -0
  83. package/dist/cjs/cloud/store/memorySummary.d.ts.map +1 -0
  84. package/dist/cjs/cloud/store/memorySummary.js +66 -0
  85. package/dist/cjs/cloud/store/memorySummary.js.map +1 -0
  86. package/dist/cjs/cloud/v2/app.d.ts.map +1 -1
  87. package/dist/cjs/cloud/v2/app.js +6 -0
  88. package/dist/cjs/cloud/v2/app.js.map +1 -1
  89. package/dist/cjs/cloud/v2/inputGuard.d.ts +23 -0
  90. package/dist/cjs/cloud/v2/inputGuard.d.ts.map +1 -0
  91. package/dist/cjs/cloud/v2/inputGuard.js +71 -0
  92. package/dist/cjs/cloud/v2/inputGuard.js.map +1 -0
  93. package/dist/cjs/cloud/v2/routes/admin.d.ts +24 -0
  94. package/dist/cjs/cloud/v2/routes/admin.d.ts.map +1 -0
  95. package/dist/cjs/cloud/v2/routes/admin.js +344 -0
  96. package/dist/cjs/cloud/v2/routes/admin.js.map +1 -0
  97. package/dist/cjs/cloud/v2/routes/entitlement.d.ts +13 -0
  98. package/dist/cjs/cloud/v2/routes/entitlement.d.ts.map +1 -0
  99. package/dist/cjs/cloud/v2/routes/entitlement.js +24 -0
  100. package/dist/cjs/cloud/v2/routes/entitlement.js.map +1 -0
  101. package/dist/cjs/cloud/v2/routes/index.d.ts +14 -1
  102. package/dist/cjs/cloud/v2/routes/index.d.ts.map +1 -1
  103. package/dist/cjs/cloud/v2/routes/index.js +36 -0
  104. package/dist/cjs/cloud/v2/routes/index.js.map +1 -1
  105. package/dist/cjs/cloud/v2/routes/memories.d.ts +21 -2
  106. package/dist/cjs/cloud/v2/routes/memories.d.ts.map +1 -1
  107. package/dist/cjs/cloud/v2/routes/memories.js +77 -0
  108. package/dist/cjs/cloud/v2/routes/memories.js.map +1 -1
  109. package/dist/cjs/cloud/v2/routes/recall.d.ts +1 -0
  110. package/dist/cjs/cloud/v2/routes/recall.d.ts.map +1 -1
  111. package/dist/cjs/cloud/v2/routes/recall.js +4 -0
  112. package/dist/cjs/cloud/v2/routes/recall.js.map +1 -1
  113. package/dist/cjs/cloud/v2/routes/tenant.d.ts +36 -0
  114. package/dist/cjs/cloud/v2/routes/tenant.d.ts.map +1 -0
  115. package/dist/cjs/cloud/v2/routes/tenant.js +65 -0
  116. package/dist/cjs/cloud/v2/routes/tenant.js.map +1 -0
  117. package/dist/cjs/cloud/v2/routes/usage.d.ts +1 -1
  118. package/dist/cjs/cloud/v2/routes/usage.d.ts.map +1 -1
  119. package/dist/cjs/cloud/v2/routes/verify.d.ts +1 -0
  120. package/dist/cjs/cloud/v2/routes/verify.d.ts.map +1 -1
  121. package/dist/cjs/cloud/v2/routes/verify.js +4 -0
  122. package/dist/cjs/cloud/v2/routes/verify.js.map +1 -1
  123. package/dist/cjs/cloud/v2/server.d.ts +9 -3
  124. package/dist/cjs/cloud/v2/server.d.ts.map +1 -1
  125. package/dist/cjs/cloud/v2/server.js +36 -2
  126. package/dist/cjs/cloud/v2/server.js.map +1 -1
  127. package/dist/cjs/cloud/v2/usageRecorder.d.ts +19 -0
  128. package/dist/cjs/cloud/v2/usageRecorder.d.ts.map +1 -0
  129. package/dist/cjs/cloud/v2/usageRecorder.js +42 -0
  130. package/dist/cjs/cloud/v2/usageRecorder.js.map +1 -0
  131. package/dist/cjs/contracts/api-v2.types.d.ts +92 -2
  132. package/dist/cjs/contracts/api-v2.types.d.ts.map +1 -1
  133. package/dist/cjs/contracts/store.d.ts +37 -0
  134. package/dist/cjs/contracts/store.d.ts.map +1 -1
  135. package/dist/cjs/mcp/index.js +7 -1
  136. package/dist/cjs/mcp/index.js.map +1 -1
  137. package/dist/cjs/mcp/tools/memory.d.ts.map +1 -1
  138. package/dist/cjs/mcp/tools/memory.js +74 -4
  139. package/dist/cjs/mcp/tools/memory.js.map +1 -1
  140. package/dist/cjs/mcp/tools/misc.d.ts.map +1 -1
  141. package/dist/cjs/mcp/tools/misc.js +2 -1
  142. package/dist/cjs/mcp/tools/misc.js.map +1 -1
  143. package/dist/cjs/mcp/tools/workspace.d.ts.map +1 -1
  144. package/dist/cjs/mcp/tools/workspace.js +4 -1
  145. package/dist/cjs/mcp/tools/workspace.js.map +1 -1
  146. package/dist/cjs/mcp/tools.d.ts +10 -0
  147. package/dist/cjs/mcp/tools.d.ts.map +1 -1
  148. package/dist/cjs/mcp/tools.js +47 -12
  149. package/dist/cjs/mcp/tools.js.map +1 -1
  150. package/dist/cjs/proxy/KeyManager.d.ts.map +1 -1
  151. package/dist/cjs/proxy/KeyManager.js +5 -0
  152. package/dist/cjs/proxy/KeyManager.js.map +1 -1
  153. package/dist/cjs/subconscious/CloudBrain.d.ts +77 -0
  154. package/dist/cjs/subconscious/CloudBrain.d.ts.map +1 -0
  155. package/dist/cjs/subconscious/CloudBrain.js +347 -0
  156. package/dist/cjs/subconscious/CloudBrain.js.map +1 -0
  157. package/dist/cjs/subconscious/HostRecall.d.ts.map +1 -1
  158. package/dist/cjs/subconscious/HostRecall.js +11 -4
  159. package/dist/cjs/subconscious/HostRecall.js.map +1 -1
  160. package/dist/cjs/subconscious/ProjectIdentity.d.ts +9 -0
  161. package/dist/cjs/subconscious/ProjectIdentity.d.ts.map +1 -0
  162. package/dist/cjs/subconscious/ProjectIdentity.js +63 -0
  163. package/dist/cjs/subconscious/ProjectIdentity.js.map +1 -0
  164. package/dist/cjs/subconscious/TeamBrain.d.ts +9 -3
  165. package/dist/cjs/subconscious/TeamBrain.d.ts.map +1 -1
  166. package/dist/cjs/subconscious/TeamBrain.js +39 -5
  167. package/dist/cjs/subconscious/TeamBrain.js.map +1 -1
  168. package/dist/cjs/utils/FixCapture.d.ts +7 -5
  169. package/dist/cjs/utils/FixCapture.d.ts.map +1 -1
  170. package/dist/cjs/utils/FixCapture.js +64 -32
  171. package/dist/cjs/utils/FixCapture.js.map +1 -1
  172. package/dist/cjs/utils/NoTerminal.d.ts +27 -0
  173. package/dist/cjs/utils/NoTerminal.d.ts.map +1 -0
  174. package/dist/cjs/utils/NoTerminal.js +37 -0
  175. package/dist/cjs/utils/NoTerminal.js.map +1 -0
  176. package/dist/cjs/utils/OpenCodeSession.d.ts +70 -0
  177. package/dist/cjs/utils/OpenCodeSession.d.ts.map +1 -0
  178. package/dist/cjs/utils/OpenCodeSession.js +154 -0
  179. package/dist/cjs/utils/OpenCodeSession.js.map +1 -0
  180. package/dist/cjs/utils/ProLicense.d.ts.map +1 -1
  181. package/dist/cjs/utils/ProLicense.js +11 -3
  182. package/dist/cjs/utils/ProLicense.js.map +1 -1
  183. package/dist/cjs/utils/SessionCapture.d.ts +31 -7
  184. package/dist/cjs/utils/SessionCapture.d.ts.map +1 -1
  185. package/dist/cjs/utils/SessionCapture.js +185 -32
  186. package/dist/cjs/utils/SessionCapture.js.map +1 -1
  187. package/dist/cjs/utils/StopNudge.d.ts +8 -0
  188. package/dist/cjs/utils/StopNudge.d.ts.map +1 -0
  189. package/dist/cjs/utils/StopNudge.js +93 -0
  190. package/dist/cjs/utils/StopNudge.js.map +1 -0
  191. package/dist/cjs/utils/TestAutofixInterceptor.d.ts.map +1 -1
  192. package/dist/cjs/utils/TestAutofixInterceptor.js +2 -0
  193. package/dist/cjs/utils/TestAutofixInterceptor.js.map +1 -1
  194. package/dist/esm/cli/hostHooks.d.ts +44 -7
  195. package/dist/esm/cli/hostHooks.d.ts.map +1 -1
  196. package/dist/esm/cli/hostHooks.js +199 -10
  197. package/dist/esm/cli/hostHooks.js.map +1 -1
  198. package/dist/esm/cli/lemma-proxy.d.ts.map +1 -1
  199. package/dist/esm/cli/lemma-proxy.js +14 -17
  200. package/dist/esm/cli/lemma-proxy.js.map +1 -1
  201. package/dist/esm/cloud/CloudBrainClient.d.ts +52 -0
  202. package/dist/esm/cloud/CloudBrainClient.d.ts.map +1 -0
  203. package/dist/esm/cloud/CloudBrainClient.js +153 -0
  204. package/dist/esm/cloud/CloudBrainClient.js.map +1 -0
  205. package/dist/esm/cloud/CloudConfig.d.ts +41 -0
  206. package/dist/esm/cloud/CloudConfig.d.ts.map +1 -0
  207. package/dist/esm/cloud/CloudConfig.js +118 -0
  208. package/dist/esm/cloud/CloudConfig.js.map +1 -0
  209. package/dist/esm/cloud/CloudEntitlement.d.ts +55 -0
  210. package/dist/esm/cloud/CloudEntitlement.d.ts.map +1 -0
  211. package/dist/esm/cloud/CloudEntitlement.js +159 -0
  212. package/dist/esm/cloud/CloudEntitlement.js.map +1 -0
  213. package/dist/esm/cloud/billing/stripeApi.d.ts +43 -0
  214. package/dist/esm/cloud/billing/stripeApi.d.ts.map +1 -0
  215. package/dist/esm/cloud/billing/stripeApi.js +108 -0
  216. package/dist/esm/cloud/billing/stripeApi.js.map +1 -0
  217. package/dist/esm/cloud/billing/stripeWebhook.d.ts +35 -0
  218. package/dist/esm/cloud/billing/stripeWebhook.d.ts.map +1 -0
  219. package/dist/esm/cloud/billing/stripeWebhook.js +181 -0
  220. package/dist/esm/cloud/billing/stripeWebhook.js.map +1 -0
  221. package/dist/esm/cloud/console/ConsoleStore.d.ts +111 -0
  222. package/dist/esm/cloud/console/ConsoleStore.d.ts.map +1 -0
  223. package/dist/esm/cloud/console/ConsoleStore.js +161 -0
  224. package/dist/esm/cloud/console/ConsoleStore.js.map +1 -0
  225. package/dist/esm/cloud/console/consoleRouter.d.ts +68 -0
  226. package/dist/esm/cloud/console/consoleRouter.d.ts.map +1 -0
  227. package/dist/esm/cloud/console/consoleRouter.js +290 -0
  228. package/dist/esm/cloud/console/consoleRouter.js.map +1 -0
  229. package/dist/esm/cloud/console/mailer.d.ts +22 -0
  230. package/dist/esm/cloud/console/mailer.d.ts.map +1 -0
  231. package/dist/esm/cloud/console/mailer.js +30 -0
  232. package/dist/esm/cloud/console/mailer.js.map +1 -0
  233. package/dist/esm/cloud/identity/PlanPolicy.d.ts +42 -6
  234. package/dist/esm/cloud/identity/PlanPolicy.d.ts.map +1 -1
  235. package/dist/esm/cloud/identity/PlanPolicy.js +100 -21
  236. package/dist/esm/cloud/identity/PlanPolicy.js.map +1 -1
  237. package/dist/esm/cloud/identity/RateLimiter.d.ts +21 -1
  238. package/dist/esm/cloud/identity/RateLimiter.d.ts.map +1 -1
  239. package/dist/esm/cloud/identity/RateLimiter.js +57 -2
  240. package/dist/esm/cloud/identity/RateLimiter.js.map +1 -1
  241. package/dist/esm/cloud/identity/TenantResolver.d.ts +6 -1
  242. package/dist/esm/cloud/identity/TenantResolver.d.ts.map +1 -1
  243. package/dist/esm/cloud/identity/TenantResolver.js +1 -1
  244. package/dist/esm/cloud/identity/TenantResolver.js.map +1 -1
  245. package/dist/esm/cloud/identity/authenticateV2.d.ts.map +1 -1
  246. package/dist/esm/cloud/identity/authenticateV2.js +7 -4
  247. package/dist/esm/cloud/identity/authenticateV2.js.map +1 -1
  248. package/dist/esm/cloud/identity/identityStore.d.ts +96 -10
  249. package/dist/esm/cloud/identity/identityStore.d.ts.map +1 -1
  250. package/dist/esm/cloud/identity/identityStore.js +199 -3
  251. package/dist/esm/cloud/identity/identityStore.js.map +1 -1
  252. package/dist/esm/cloud/metering/PostgresLedgerStore.d.ts +18 -0
  253. package/dist/esm/cloud/metering/PostgresLedgerStore.d.ts.map +1 -0
  254. package/dist/esm/cloud/metering/PostgresLedgerStore.js +52 -0
  255. package/dist/esm/cloud/metering/PostgresLedgerStore.js.map +1 -0
  256. package/dist/esm/cloud/metering/UsageLedger.d.ts +74 -0
  257. package/dist/esm/cloud/metering/UsageLedger.d.ts.map +1 -1
  258. package/dist/esm/cloud/metering/UsageLedger.js +119 -16
  259. package/dist/esm/cloud/metering/UsageLedger.js.map +1 -1
  260. package/dist/esm/cloud/metering/index.d.ts +1 -0
  261. package/dist/esm/cloud/metering/index.d.ts.map +1 -1
  262. package/dist/esm/cloud/metering/index.js +1 -0
  263. package/dist/esm/cloud/metering/index.js.map +1 -1
  264. package/dist/esm/cloud/store/FileBrainStore.d.ts +6 -1
  265. package/dist/esm/cloud/store/FileBrainStore.d.ts.map +1 -1
  266. package/dist/esm/cloud/store/FileBrainStore.js +8 -0
  267. package/dist/esm/cloud/store/FileBrainStore.js.map +1 -1
  268. package/dist/esm/cloud/store/PostgresBrainStore.d.ts +11 -1
  269. package/dist/esm/cloud/store/PostgresBrainStore.d.ts.map +1 -1
  270. package/dist/esm/cloud/store/PostgresBrainStore.js +32 -0
  271. package/dist/esm/cloud/store/PostgresBrainStore.js.map +1 -1
  272. package/dist/esm/cloud/store/memorySummary.d.ts +29 -0
  273. package/dist/esm/cloud/store/memorySummary.d.ts.map +1 -0
  274. package/dist/esm/cloud/store/memorySummary.js +60 -0
  275. package/dist/esm/cloud/store/memorySummary.js.map +1 -0
  276. package/dist/esm/cloud/v2/app.d.ts.map +1 -1
  277. package/dist/esm/cloud/v2/app.js +6 -0
  278. package/dist/esm/cloud/v2/app.js.map +1 -1
  279. package/dist/esm/cloud/v2/inputGuard.d.ts +23 -0
  280. package/dist/esm/cloud/v2/inputGuard.d.ts.map +1 -0
  281. package/dist/esm/cloud/v2/inputGuard.js +63 -0
  282. package/dist/esm/cloud/v2/inputGuard.js.map +1 -0
  283. package/dist/esm/cloud/v2/routes/admin.d.ts +24 -0
  284. package/dist/esm/cloud/v2/routes/admin.d.ts.map +1 -0
  285. package/dist/esm/cloud/v2/routes/admin.js +337 -0
  286. package/dist/esm/cloud/v2/routes/admin.js.map +1 -0
  287. package/dist/esm/cloud/v2/routes/entitlement.d.ts +13 -0
  288. package/dist/esm/cloud/v2/routes/entitlement.d.ts.map +1 -0
  289. package/dist/esm/cloud/v2/routes/entitlement.js +21 -0
  290. package/dist/esm/cloud/v2/routes/entitlement.js.map +1 -0
  291. package/dist/esm/cloud/v2/routes/index.d.ts +14 -1
  292. package/dist/esm/cloud/v2/routes/index.d.ts.map +1 -1
  293. package/dist/esm/cloud/v2/routes/index.js +37 -1
  294. package/dist/esm/cloud/v2/routes/index.js.map +1 -1
  295. package/dist/esm/cloud/v2/routes/memories.d.ts +21 -2
  296. package/dist/esm/cloud/v2/routes/memories.d.ts.map +1 -1
  297. package/dist/esm/cloud/v2/routes/memories.js +75 -0
  298. package/dist/esm/cloud/v2/routes/memories.js.map +1 -1
  299. package/dist/esm/cloud/v2/routes/recall.d.ts +1 -0
  300. package/dist/esm/cloud/v2/routes/recall.d.ts.map +1 -1
  301. package/dist/esm/cloud/v2/routes/recall.js +5 -1
  302. package/dist/esm/cloud/v2/routes/recall.js.map +1 -1
  303. package/dist/esm/cloud/v2/routes/tenant.d.ts +36 -0
  304. package/dist/esm/cloud/v2/routes/tenant.d.ts.map +1 -0
  305. package/dist/esm/cloud/v2/routes/tenant.js +61 -0
  306. package/dist/esm/cloud/v2/routes/tenant.js.map +1 -0
  307. package/dist/esm/cloud/v2/routes/usage.d.ts +1 -1
  308. package/dist/esm/cloud/v2/routes/usage.d.ts.map +1 -1
  309. package/dist/esm/cloud/v2/routes/verify.d.ts +1 -0
  310. package/dist/esm/cloud/v2/routes/verify.d.ts.map +1 -1
  311. package/dist/esm/cloud/v2/routes/verify.js +5 -1
  312. package/dist/esm/cloud/v2/routes/verify.js.map +1 -1
  313. package/dist/esm/cloud/v2/server.d.ts +9 -3
  314. package/dist/esm/cloud/v2/server.d.ts.map +1 -1
  315. package/dist/esm/cloud/v2/server.js +36 -3
  316. package/dist/esm/cloud/v2/server.js.map +1 -1
  317. package/dist/esm/cloud/v2/usageRecorder.d.ts +19 -0
  318. package/dist/esm/cloud/v2/usageRecorder.d.ts.map +1 -0
  319. package/dist/esm/cloud/v2/usageRecorder.js +37 -0
  320. package/dist/esm/cloud/v2/usageRecorder.js.map +1 -0
  321. package/dist/esm/contracts/api-v2.types.d.ts +92 -2
  322. package/dist/esm/contracts/api-v2.types.d.ts.map +1 -1
  323. package/dist/esm/contracts/store.d.ts +37 -0
  324. package/dist/esm/contracts/store.d.ts.map +1 -1
  325. package/dist/esm/mcp/index.js +8 -2
  326. package/dist/esm/mcp/index.js.map +1 -1
  327. package/dist/esm/mcp/tools/memory.d.ts.map +1 -1
  328. package/dist/esm/mcp/tools/memory.js +74 -4
  329. package/dist/esm/mcp/tools/memory.js.map +1 -1
  330. package/dist/esm/mcp/tools/misc.d.ts.map +1 -1
  331. package/dist/esm/mcp/tools/misc.js +2 -1
  332. package/dist/esm/mcp/tools/misc.js.map +1 -1
  333. package/dist/esm/mcp/tools/workspace.d.ts.map +1 -1
  334. package/dist/esm/mcp/tools/workspace.js +4 -1
  335. package/dist/esm/mcp/tools/workspace.js.map +1 -1
  336. package/dist/esm/mcp/tools.d.ts +10 -0
  337. package/dist/esm/mcp/tools.d.ts.map +1 -1
  338. package/dist/esm/mcp/tools.js +46 -12
  339. package/dist/esm/mcp/tools.js.map +1 -1
  340. package/dist/esm/proxy/KeyManager.d.ts.map +1 -1
  341. package/dist/esm/proxy/KeyManager.js +5 -0
  342. package/dist/esm/proxy/KeyManager.js.map +1 -1
  343. package/dist/esm/subconscious/CloudBrain.d.ts +77 -0
  344. package/dist/esm/subconscious/CloudBrain.d.ts.map +1 -0
  345. package/dist/esm/subconscious/CloudBrain.js +330 -0
  346. package/dist/esm/subconscious/CloudBrain.js.map +1 -0
  347. package/dist/esm/subconscious/HostRecall.d.ts.map +1 -1
  348. package/dist/esm/subconscious/HostRecall.js +11 -4
  349. package/dist/esm/subconscious/HostRecall.js.map +1 -1
  350. package/dist/esm/subconscious/ProjectIdentity.d.ts +9 -0
  351. package/dist/esm/subconscious/ProjectIdentity.d.ts.map +1 -0
  352. package/dist/esm/subconscious/ProjectIdentity.js +56 -0
  353. package/dist/esm/subconscious/ProjectIdentity.js.map +1 -0
  354. package/dist/esm/subconscious/TeamBrain.d.ts +9 -3
  355. package/dist/esm/subconscious/TeamBrain.d.ts.map +1 -1
  356. package/dist/esm/subconscious/TeamBrain.js +39 -7
  357. package/dist/esm/subconscious/TeamBrain.js.map +1 -1
  358. package/dist/esm/utils/FixCapture.d.ts +7 -5
  359. package/dist/esm/utils/FixCapture.d.ts.map +1 -1
  360. package/dist/esm/utils/FixCapture.js +64 -33
  361. package/dist/esm/utils/FixCapture.js.map +1 -1
  362. package/dist/esm/utils/NoTerminal.d.ts +27 -0
  363. package/dist/esm/utils/NoTerminal.d.ts.map +1 -0
  364. package/dist/esm/utils/NoTerminal.js +33 -0
  365. package/dist/esm/utils/NoTerminal.js.map +1 -0
  366. package/dist/esm/utils/OpenCodeSession.d.ts +70 -0
  367. package/dist/esm/utils/OpenCodeSession.d.ts.map +1 -0
  368. package/dist/esm/utils/OpenCodeSession.js +146 -0
  369. package/dist/esm/utils/OpenCodeSession.js.map +1 -0
  370. package/dist/esm/utils/ProLicense.d.ts.map +1 -1
  371. package/dist/esm/utils/ProLicense.js +11 -3
  372. package/dist/esm/utils/ProLicense.js.map +1 -1
  373. package/dist/esm/utils/SessionCapture.d.ts +31 -7
  374. package/dist/esm/utils/SessionCapture.d.ts.map +1 -1
  375. package/dist/esm/utils/SessionCapture.js +185 -32
  376. package/dist/esm/utils/SessionCapture.js.map +1 -1
  377. package/dist/esm/utils/StopNudge.d.ts +8 -0
  378. package/dist/esm/utils/StopNudge.d.ts.map +1 -0
  379. package/dist/esm/utils/StopNudge.js +86 -0
  380. package/dist/esm/utils/StopNudge.js.map +1 -0
  381. package/dist/esm/utils/TestAutofixInterceptor.d.ts.map +1 -1
  382. package/dist/esm/utils/TestAutofixInterceptor.js +2 -0
  383. package/dist/esm/utils/TestAutofixInterceptor.js.map +1 -1
  384. package/lemma-proxy.cjs +5 -0
  385. package/package.json +2 -1
  386. package/sdks/crewai/dist/ts/src/client.d.ts +5 -1
  387. package/sdks/crewai/dist/ts/src/client.js +8 -0
  388. package/sdks/crewai/dist/ts/src/types.d.ts +32 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@nxuss/lemma.svg?color=orange&style=flat-square)](https://www.npmjs.com/package/@nxuss/lemma)
4
4
  ![License](https://img.shields.io/npm/l/@nxuss/lemma.svg?color=blue&style=flat-square)
5
- ![MCP](https://img.shields.io/badge/MCP-91%20tools-ff69b4?style=flat-square)
5
+ ![MCP](https://img.shields.io/badge/MCP-92%20tools-ff69b4?style=flat-square)
6
6
  ![Local-first](https://img.shields.io/badge/local--first-no%20cloud%20required-success?style=flat-square)
7
7
 
8
8
  **A memory your AI agent can verify, and a context window that only holds what matters.**
@@ -43,23 +43,26 @@ in a local index (BM25, no embeddings service, no cloud). Every memory is tied t
43
43
  symbols it's about, so when the code changes it comes back **stale** instead of confidently
44
44
  wrong — and a memory with no evidence is labelled as such, never sold as a verified answer.
45
45
 
46
- **↪ Work that survives the session (Pro).** A session that edited code leaves a hand-off built from the
47
- transcript and git, with no model tokens: the task exactly as it was given, the files changed, the last test
48
- run. The next session's briefing points at it, so "continue where we left off" has something to continue from.
46
+ **↪ Work that survives the session (Pro, Claude Code and OpenCode).** A session that edited code leaves a hand-off
47
+ built from the transcript and git, with no model tokens: the task exactly as it was given, the files changed, the last
48
+ test run, and what each subagent did (its description, the files it edited, its last run), so an orchestrator that
49
+ delegated everything still leaves one. The next session's briefing points at it, so "continue where we left off" has
50
+ something to continue from.
49
51
  An agent's own note tends to keep function names and drop their parameter lists; the hand-off keeps the plan
50
52
  verbatim. In our benchmark (a plan said only in the first session, graded by hidden tests) agents with Lemma
51
53
  finished it in 3 of 3 runs, Claude Code's built-in memory in 1 of 3 and another agent-memory tool in 0 of 3 (3-run
52
54
  cells, one model, our own benchmark: a lead, not a proof). It costs more per task, not less, because the agent
53
55
  does the work the others skip.
54
56
 
55
- **↪ …and the compaction (Pro, Claude Code only).** When Claude Code compacts a long conversation, a `PreCompact` hook
57
+ **↪ …and the compaction (Pro, Claude Code and OpenCode).** When Claude Code compacts a long conversation, a `PreCompact` hook
56
58
  saves the same hand-off first, and the `SessionStart` that follows puts its content (the plan exactly as it was given,
57
59
  the files, the last run) back in context, not a pointer to it. The agent has the plan in front of it without going
58
60
  back to the session transcript: in `bench/compaction` the agents with the hook finished the task in 15 of 15 runs
59
61
  (Sonnet and Haiku), the Haiku ones without a single trip back to the transcript, and where the transcript could not be
60
62
  read it was 5 of 5 against 2 of 5 without the hook (n=5 per arm). It never blocks the compaction: it prints nothing,
61
- always exits 0 and takes about 0.1 s on a 1.5 MB transcript. Claude Code only; the other clients have no
62
- pre-compaction event, so nothing is installed for them.
63
+ always exits 0 and takes about 0.1 s on a 1.5 MB transcript. OpenCode gets the same hand-off through its plugin's
64
+ compaction hook, added to the compaction prompt (verified live; the benchmark numbers above are Claude Code's). Codex
65
+ and Cursor have no pre-compaction event, so nothing is installed for them.
63
66
 
64
67
  **✍️ It fills itself.** A test, build or lint command that goes red → green is saved as
65
68
  `fix: <the error>` with the diff that fixed it. Commits become memories. Next time the same
@@ -125,6 +128,21 @@ it adds a `SessionStart` briefing and a prompt-time recall too, and pre-approves
125
128
  memory tools so using them never costs a permission prompt. Existing hooks are kept; `--no-hooks`
126
129
  skips them. Health check: `lemma doctor`.
127
130
 
131
+ What each client gets beyond the MCP tools:
132
+
133
+ | | Claude Code | OpenCode | Codex | Cursor |
134
+ | :--- | :---: | :---: | :---: | :---: |
135
+ | 🧠 notes when a native read, edit or failing test touches a memory | ✅ | ✅ | ✅ | ✅ |
136
+ | red → green fix captured from the native shell | ✅ | ✅ | ✅ | ✅ |
137
+ | briefing at session start | ✅ | ✅ (plugin) | — | — |
138
+ | hand-off between sessions, with subagents (Pro) | ✅ | ✅ (plugin) | — | — |
139
+ | hand-off put back after a compaction (Pro) | ✅ | ✅ (plugin) | — | — |
140
+ | warning when a native tool prints a credential | ✅ | ✅ | ✅ | ✅ |
141
+
142
+ Windsurf and Kiro get the MCP server and the agent rules only. OpenCode's MCP server is registered in
143
+ `~/.config/opencode/opencode.json` (or the `.jsonc` you use); an older `lemma init` wrote `~/.opencode.json`, which
144
+ OpenCode does not read, so run `lemma init` again.
145
+
128
146
  ### After an upgrade
129
147
 
130
148
  After `npm install -g @nxuss/lemma` and reconnecting the MCP server, a project that already ran
@@ -133,7 +151,7 @@ After `npm install -g @nxuss/lemma` and reconnecting the MCP server, a project t
133
151
  | | Comes with the upgrade | Needs `lemma init` again |
134
152
  | :--- | :---: | :---: |
135
153
  | New and fixed tool behaviour (freshness checks, the diff shown on a STALE memory, the hand-off logic) | ✅ | |
136
- | Missing Claude Code hooks (`SessionStart`, prompt recall, the note before an edit, `SessionEnd`, `PreCompact`), added at the next MCP start | ✅ | |
154
+ | Missing Claude Code hooks (`SessionStart`, prompt recall, the note before an edit, `SessionEnd`, `PreCompact`, `Stop`), added at the next MCP start | ✅ | |
137
155
  | Agent rules in `CLAUDE.md` / `AGENTS.md` (when to search, store and leave a hand-off) | | ✅ |
138
156
  | Pre-approved read and memory tool permissions (otherwise the agent is asked each time) | | ✅ |
139
157
  | Hooks and config for Codex, Cursor, OpenCode, Windsurf and Kiro | | ✅ |
@@ -15,11 +15,15 @@
15
15
  *
16
16
  * Usage: lemma-brain-ingest [projectRoot] [--commits [--max N]] [--changelog] [--team-pull]
17
17
  * lemma-brain-ingest --hook-result [--host=claude|codex|cursor|opencode] < payload.json
18
- * lemma-brain-ingest --hook-failure < payload.json (PostToolUseFailure: only the leak warning)
18
+ * lemma-brain-ingest --hook-failure < payload.json (PostToolUseFailure: a failing Bash run, handled like --hook-result)
19
19
  * lemma-brain-ingest --prompt-submit < payload.json
20
20
  * lemma-brain-ingest --pre-tool < payload.json
21
21
  * lemma-brain-ingest --session-end < payload.json
22
22
  * lemma-brain-ingest --pre-compact < payload.json (PreCompact: saves the hand-off; prints nothing, never blocks)
23
+ * lemma-brain-ingest --stop < payload.json (Stop: once per session, asks the agent to leave the team what the code cannot show)
24
+ * lemma-brain-ingest --opencode-idle < snapshot.json (OpenCode session.idle: saves/refreshes the hand-off; prints nothing)
25
+ * lemma-brain-ingest --opencode-compacting < snapshot.json (OpenCode compaction: saves the hand-off, prints it for the context)
26
+ * lemma-brain-ingest --session-start --host=opencode (prints the briefing as plain text)
23
27
  *
24
28
  * --team-pull Import the repo's shared memories from .lemma-brain/ (post-merge/post-checkout).
25
29
  * --hook-result Read a host PostToolUse hook payload on stdin (Claude Code shape) and:
@@ -87,8 +91,10 @@ async function hookResult(args) {
87
91
  } catch {
88
92
  return;
89
93
  }
90
- // PostToolUseFailure (a command that exited non-zero) carries the output in `error`, with no tool_response. It only
91
- // feeds the leak warning: a failing run that dumps its environment is the likeliest way a secret reaches the model.
94
+ // PostToolUseFailure (a command that exited non-zero) carries the output in `error`, with no tool_response. Claude Code
95
+ // sends EVERY failing Bash run here and never to PostToolUse, so this path must do all PostToolUse does: when it only
96
+ // fed the leak warning, the red half of a red → green fix was never recorded (no fix memory was ever captured from a
97
+ // native test run) and a failure matching a recorded fix was never recalled.
92
98
  const failure = args.includes('--hook-failure');
93
99
  if (failure) {
94
100
  if (!raw || typeof raw.error !== 'string' || raw.tool_name !== 'Bash') return;
@@ -98,13 +104,6 @@ async function hookResult(args) {
98
104
  const recalled = [];
99
105
  let root;
100
106
  for (const payload of normalizeHostPayload(host, raw)) {
101
- if (failure) {
102
- try {
103
- const leak = leakNote(payload, payload.cwd);
104
- if (leak && !notes.includes(leak)) notes.push(leak);
105
- } catch { /* a warning failing must not fail the hook */ }
106
- continue;
107
- }
108
107
  try {
109
108
  const res = recordHookPayload(payload, payload.cwd);
110
109
  if (res && res.captured) console.error(res.note.trim());
@@ -171,7 +170,7 @@ async function preTool() {
171
170
 
172
171
  // SessionStart hook (Claude Code): the Brain's briefing and the Lemma playbook, in context
173
172
  // before the first prompt — no tool call for the agent to remember or skip.
174
- async function sessionStart() {
173
+ async function sessionStart(args = []) {
175
174
  const dist = path.join(__dirname, '..', 'dist', 'cjs');
176
175
  let sessionRecall, compactRecall, formatHostOutput;
177
176
  try {
@@ -197,7 +196,9 @@ async function sessionStart() {
197
196
  }
198
197
  // After a compaction the hand-off's content goes back in; any other start (or no hand-off) is the usual briefing.
199
198
  const recall = (payload.source === 'compact' && compactRecall(payload, payload.cwd)) || sessionRecall(payload, payload.cwd);
200
- const out = formatHostOutput('claude', recall ? recall.text : '', 'SessionStart');
199
+ const { parseHost } = require(path.join(dist, 'subconscious', 'HostAdapters.js'));
200
+ const host = parseHost((args.find((a) => a.startsWith('--host=')) || '').slice('--host='.length) || undefined);
201
+ const out = formatHostOutput(host, recall ? recall.text : '', 'SessionStart');
201
202
  if (out) process.stdout.write(out);
202
203
  await reportOffered(dist, payload.cwd, [recall]);
203
204
  }
@@ -229,11 +230,45 @@ async function preCompact() {
229
230
  }
230
231
  }
231
232
 
233
+ // Stop hook (Claude Code): runs at the end of EVERY agent response, so the cheap checks come first and
234
+ // anything that goes wrong lets the agent stop. The only output is a block decision, once per session.
235
+ async function stop() {
236
+ try {
237
+ const dist = path.join(__dirname, '..', 'dist', 'cjs');
238
+ const payload = JSON.parse(readStdin()) || {};
239
+ const { cloudConfigStatus } = require(path.join(dist, 'cloud', 'CloudBrainClient.js'));
240
+ if (process.env.LEMMA_STOP_NUDGE !== '1' && !cloudConfigStatus(process.env).config) return;
241
+ const { stopNudge } = require(path.join(dist, 'utils', 'StopNudge.js'));
242
+ const decision = stopNudge(payload);
243
+ if (decision.block) process.stdout.write(JSON.stringify({ decision: 'block', reason: decision.reason }));
244
+ } catch {
245
+ // no build, no payload, no transcript: the agent just stops
246
+ }
247
+ }
248
+
249
+ // OpenCode plugin (session.idle / experimental.session.compacting): the session snapshot from the SDK
250
+ // becomes the same hand-off a Claude Code session leaves (see OpenCodeSession). Idle prints nothing;
251
+ // compacting prints the hand-off for the plugin to add to the compaction context. Never fails loudly.
252
+ async function openCode(compacting) {
253
+ try {
254
+ const dist = path.join(__dirname, '..', 'dist', 'cjs');
255
+ const snap = JSON.parse(readStdin());
256
+ const { captureOpenCodeSession } = require(path.join(dist, 'utils', 'OpenCodeSession.js'));
257
+ const res = captureOpenCodeSession(snap, { compacting });
258
+ if (compacting && res.text) process.stdout.write(res.text);
259
+ } catch {
260
+ // no build, no snapshot: the session goes on untouched
261
+ }
262
+ }
263
+
232
264
  async function main() {
233
265
  const args = process.argv.slice(2);
266
+ if (args.includes('--opencode-idle')) return openCode(false);
267
+ if (args.includes('--opencode-compacting')) return openCode(true);
268
+ if (args.includes('--stop')) return stop();
234
269
  if (args.includes('--pre-compact')) return preCompact();
235
270
  if (args.includes('--session-end')) return sessionEnd();
236
- if (args.includes('--session-start')) return sessionStart();
271
+ if (args.includes('--session-start')) return sessionStart(args);
237
272
  if (args.includes('--prompt-submit')) return promptSubmit();
238
273
  if (args.includes('--pre-tool')) return preTool();
239
274
  if (args.includes('--hook-result') || args.includes('--hook-failure')) return hookResult(args);
package/bin/cloud.js ADDED
@@ -0,0 +1,228 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * lemma cloud — connect this machine to your team's Brain on Lemma Cloud.
6
+ *
7
+ * lemma cloud login [--url URL] [--key-stdin | --key KEY] [--no-autoshare] [--no-verify]
8
+ * lemma cloud logout
9
+ * lemma cloud status
10
+ * lemma cloud link --url URL write the committed, secret-free .lemma-cloud.json
11
+ *
12
+ * The key is stored in ~/.lemma/cloud.json (owner-only) bound to the URL it was issued for; the
13
+ * repo marker only ever supplies a default URL. This file prints a key NEVER, not even masked
14
+ * beyond its last four characters, and `login` verifies it against the server before saving.
15
+ */
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+ const { execFileSync } = require('child_process');
20
+
21
+ const D = '\x1b[2m', G = '\x1b[32m', Y = '\x1b[33m', RED = '\x1b[31m', B = '\x1b[1m', R = '\x1b[0m';
22
+
23
+ function load() {
24
+ const attempt = (base, ext) => ({
25
+ cfg: require(path.join(base, 'CloudConfig' + ext)),
26
+ client: require(path.join(base, 'CloudBrainClient' + ext)),
27
+ ent: require(path.join(base, 'CloudEntitlement' + ext)),
28
+ });
29
+ try {
30
+ return attempt(path.join(__dirname, '..', 'dist', 'cjs', 'cloud'), '');
31
+ } catch {
32
+ // Same fallback as lemma-proxy.cjs: a source checkout that has not been built yet.
33
+ try {
34
+ process.env.TS_NODE_PROJECT = process.env.TS_NODE_PROJECT || path.join(__dirname, '..', 'tsconfig.cjs.json');
35
+ require('ts-node/register/transpile-only');
36
+ return attempt(path.join(__dirname, '..', 'src', 'cloud'), '.ts');
37
+ } catch {
38
+ console.error('lemma cloud needs the compiled package (dist/cjs). Run `npm run build`, or reinstall @nxuss/lemma.');
39
+ process.exit(1);
40
+ }
41
+ }
42
+ }
43
+
44
+ function repoRoot() {
45
+ try {
46
+ return execFileSync('git', ['rev-parse', '--show-toplevel'], { stdio: ['ignore', 'pipe', 'ignore'], encoding: 'utf8' }).trim() || process.cwd();
47
+ } catch {
48
+ return process.cwd();
49
+ }
50
+ }
51
+
52
+ function parse(argv) {
53
+ const out = { _: [], flags: {} };
54
+ for (let i = 0; i < argv.length; i++) {
55
+ const a = argv[i];
56
+ if (a === '--url' || a === '--key') out.flags[a.slice(2)] = argv[++i];
57
+ else if (a.startsWith('--url=')) out.flags.url = a.slice(6);
58
+ else if (a.startsWith('--key=')) out.flags.key = a.slice(6);
59
+ else if (a.startsWith('--')) out.flags[a.slice(2)] = true;
60
+ else out._.push(a);
61
+ }
62
+ return out;
63
+ }
64
+
65
+ const host = (url) => { try { return new URL(url).host; } catch { return String(url); } };
66
+ const mask = (key) => `${key.slice(0, key.indexOf('_', 3) + 1)}…${key.slice(-4)}`;
67
+ const fail = (msg) => { console.error(`${RED}✗${R} ${msg}`); return 1; };
68
+
69
+ function promptHidden(question) {
70
+ return new Promise((resolve) => {
71
+ const rl = require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: true });
72
+ process.stdout.write(question);
73
+ rl._writeToOutput = () => {}; // do not echo the key
74
+ rl.question('', (answer) => { rl.close(); process.stdout.write('\n'); resolve(answer.trim()); });
75
+ });
76
+ }
77
+
78
+ async function readKey(flags) {
79
+ if (flags['key-stdin']) return fs.readFileSync(0, 'utf8').trim();
80
+ if (typeof flags.key === 'string') {
81
+ console.error(`${Y}!${R} --key puts the key in your shell history; prefer \`--key-stdin\` or the prompt.`);
82
+ return flags.key.trim();
83
+ }
84
+ if (process.env.LEMMA_CLOUD_KEY) return process.env.LEMMA_CLOUD_KEY.trim();
85
+ if (process.stdin.isTTY) return promptHidden('Your Lemma Cloud key (input hidden): ');
86
+ return '';
87
+ }
88
+
89
+ async function login(flags) {
90
+ const { cfg, client, ent } = load();
91
+ const marker = cfg.readMarker(repoRoot());
92
+ const url = (typeof flags.url === 'string' && flags.url) || process.env.LEMMA_CLOUD_URL || (marker && marker.url) || '';
93
+ if (!url) return fail('No URL. Pass --url https://…, or run this inside a repo that has a .lemma-cloud.json.');
94
+ const key = await readKey(flags);
95
+ if (!key) return fail('No key. Ask your Lemma Cloud admin for yours, then pass --key-stdin or run this in a terminal.');
96
+
97
+ // Validate with the same rules the MCP applies, using only these two values (never the saved file).
98
+ const checked = client.cloudConfigStatus({ LEMMA_CLOUD_URL: url, LEMMA_CLOUD_KEY: key });
99
+ if (!checked.config) return fail(checked.problem);
100
+
101
+ // The entitlement call doubles as the key check. A server from before that endpoint answers 404:
102
+ // then the old check (usage) still proves the key, and there is simply no plan to report.
103
+ let answer = null;
104
+ if (!flags['no-verify']) {
105
+ const api = new client.CloudBrainClient({ ...checked.config, timeoutMs: 8000 });
106
+ try {
107
+ try {
108
+ answer = await api.entitlement();
109
+ } catch (err) {
110
+ if (!err || err.status !== 404) throw err;
111
+ await api.usage();
112
+ }
113
+ } catch (err) {
114
+ if (err && err.status === 401) return fail(`${host(url)} rejected that key (wrong, or revoked). Nothing was saved.`);
115
+ const why = err && err.message ? err.message : 'unknown error';
116
+ return fail(`Could not verify the key against ${host(url)}: ${why}. Nothing was saved (use --no-verify to save it anyway).`);
117
+ }
118
+ }
119
+
120
+ const baseUrl = checked.config.baseUrl.replace(/\/v2$/, '');
121
+ const autoshare = !flags['no-autoshare'];
122
+ const file = cfg.writeUserConfig({ url: baseUrl, key, autoshare });
123
+ // A different account or server must not inherit the previous one's answer.
124
+ ent.clearEntitlement();
125
+ if (answer && typeof answer.plan === 'string' && typeof answer.includesPro === 'boolean') ent.recordEntitlement(checked.config, answer);
126
+ console.log(`${G}✓${R} Connected to ${B}${host(baseUrl)}${R}${flags['no-verify'] ? ` ${D}(not verified)${R}` : ''}.`);
127
+ console.log(` Saved to ${file} ${D}(readable only by you)${R}`);
128
+ console.log(autoshare
129
+ ? ` Memories you store are ${B}shared with your team${R} automatically (secrets are redacted first). Turn that off with: lemma cloud login --no-autoshare`
130
+ : ` Sharing is off: nothing leaves your machine unless you call cloud_push. Teammates' memories still show up in search.`);
131
+ if (answer && answer.includesPro === true) {
132
+ console.log(` Plan ${B}${answer.plan}${R}: this seat also unlocks ${B}Lemma Pro${R} on this machine. Pro tools show up in new sessions; a session already open gets them when it reconnects.`);
133
+ } else if (answer && typeof answer.plan === 'string') {
134
+ console.log(` Plan ${B}${answer.plan}${R}: Pro tools are not included.`);
135
+ }
136
+ console.log(` ${D}Active now, including in sessions already running: nothing to restart or reconnect.${R}`);
137
+ if (process.env.LEMMA_CLOUD_URL || process.env.LEMMA_CLOUD_KEY) {
138
+ console.log(`${Y}!${R} LEMMA_CLOUD_URL / LEMMA_CLOUD_KEY are set in this shell and override the saved connection.`);
139
+ }
140
+ return 0;
141
+ }
142
+
143
+ function logout() {
144
+ const { cfg, ent } = load();
145
+ const removed = cfg.removeUserConfig();
146
+ ent.clearEntitlement();
147
+ console.log(removed ? `${G}✓${R} Disconnected: removed ${cfg.userConfigPath()}` : 'Nothing to remove: this machine was not logged in.');
148
+ if (process.env.LEMMA_CLOUD_KEY) console.log(`${Y}!${R} LEMMA_CLOUD_KEY is still set in this shell.`);
149
+ return 0;
150
+ }
151
+
152
+ async function status() {
153
+ const { cfg, client, ent } = load();
154
+ const s = client.cloudConfigStatus(process.env);
155
+ const marker = cfg.readMarker(repoRoot());
156
+ if (!s.config) {
157
+ if (s.problem) return fail(`Lemma Cloud is configured but not usable: ${s.problem}`);
158
+ console.log('Not connected. Run `lemma cloud login`.');
159
+ if (marker) console.log(`${D}This repo's team is at ${cfg.markerHost(marker)}.${R}`);
160
+ return 0;
161
+ }
162
+ const c = s.config;
163
+ console.log(`${B}Lemma Cloud${R}`);
164
+ console.log(` server ${host(c.baseUrl)}`);
165
+ console.log(` key ${mask(c.apiKey)} ${D}(from ${c.source === 'file' ? cfg.userConfigPath() : 'environment variables'})${R}`);
166
+ console.log(` sharing ${client.autoShareFor(s, process.env) ? 'automatic (every memory you store)' : 'off (cloud_push shares one on request)'}`);
167
+ try {
168
+ await new client.CloudBrainClient({ ...c, timeoutMs: 6000 }).usage();
169
+ console.log(` reachable ${G}yes${R}, key accepted`);
170
+ } catch (err) {
171
+ console.log(` reachable ${RED}no${R}: ${err && err.status === 401 ? 'the server rejected this key (revoked or wrong)' : err && err.message ? err.message : 'unknown error'}`);
172
+ }
173
+ // Refreshing here keeps `status` truthful about Pro: it records what the server says now.
174
+ const r = await ent.refreshEntitlement(c, process.env);
175
+ const pro = ent.cloudGrantsPro(process.env);
176
+ const plan = r.plan ? ` ${D}(plan ${r.plan})${R}` : '';
177
+ if (r.state === 'revoked') console.log(` pro ${RED}off${R}: the server rejected this key, so this seat no longer includes Pro`);
178
+ else if (r.state === 'not-included') console.log(` pro not included${plan}`);
179
+ else if (r.state === 'unsupported') console.log(` pro ${D}unknown: this server predates seat-based Pro${R}`);
180
+ else if (pro) console.log(` pro ${G}included${R}${plan}${r.state === 'unreachable' ? ` ${D}(last answer; the server could not be asked now)${R}` : ''}`);
181
+ else console.log(` pro ${D}not confirmed (the server could not be asked)${R}`);
182
+ if (marker && host(marker.url) !== host(c.baseUrl)) {
183
+ console.log(`${Y}!${R} This repo's team lives at ${cfg.markerHost(marker)}, but you are connected to ${host(c.baseUrl)}.`);
184
+ }
185
+ return 0;
186
+ }
187
+
188
+ function link(flags) {
189
+ const { cfg } = load();
190
+ const url = (typeof flags.url === 'string' && flags.url) || process.env.LEMMA_CLOUD_URL || '';
191
+ if (!url) return fail('Pass --url https://… (the address of your team\'s Lemma Cloud).');
192
+ const root = repoRoot();
193
+ const file = cfg.writeMarker(root, url);
194
+ if (!cfg.readMarker(root)) {
195
+ fs.unlinkSync(file);
196
+ return fail('That URL is not valid for the marker (it must be https, or http://localhost, with no credentials).');
197
+ }
198
+ console.log(`${G}✓${R} Wrote ${path.relative(process.cwd(), file) || cfg.MARKER_FILE}. Commit it: it holds no secret, only the address.`);
199
+ console.log(` Teammates then run ${B}lemma cloud login${R} once and need nothing else.`);
200
+ return 0;
201
+ }
202
+
203
+ const HELP = `lemma cloud — your team's Brain on Lemma Cloud
204
+
205
+ login [--url URL] [--key-stdin] [--no-autoshare] [--no-verify]
206
+ logout
207
+ status
208
+ link --url URL write .lemma-cloud.json (commit it; no secret inside)
209
+ `;
210
+
211
+ async function main(argv = process.argv.slice(3)) {
212
+ const { _: pos, flags } = parse(argv);
213
+ switch (pos[0]) {
214
+ case 'login': return login(flags);
215
+ case 'logout': return logout();
216
+ case 'status': return status();
217
+ case 'link': return link(flags);
218
+ default:
219
+ console.log(HELP);
220
+ return pos[0] ? 1 : 0;
221
+ }
222
+ }
223
+
224
+ module.exports = { main };
225
+
226
+ if (require.main === module) {
227
+ main(process.argv.slice(2)).then((code) => process.exit(code), (e) => { console.error(e && e.message ? e.message : e); process.exit(1); });
228
+ }
@@ -38,8 +38,15 @@ export declare const CLAUDE_SESSION_END_HOOK_COMMAND = "command -v lemma-brain-i
38
38
  */
39
39
  export declare const CLAUDE_PRE_COMPACT_HOOK_COMMAND = "command -v lemma-brain-ingest >/dev/null 2>&1 && lemma-brain-ingest --pre-compact || true";
40
40
  /**
41
- * PostToolUseFailure (Bash): Claude Code sends a command that exits non-zero here and NOT to PostToolUse, so
42
- * a failing run that dumps its environment never reached the leak warning. Only the warning is wired to it.
41
+ * Stop: once per session, when a fix is done and the team shares memories (Lemma Cloud connected), asks the
42
+ * agent to leave what the code cannot show — see StopNudge. Inert for anyone who is not on a team, and it
43
+ * answers with a decision only that one time, so it cannot loop.
44
+ */
45
+ export declare const CLAUDE_STOP_HOOK_COMMAND = "command -v lemma-brain-ingest >/dev/null 2>&1 && lemma-brain-ingest --stop || true";
46
+ /**
47
+ * PostToolUseFailure (Bash): Claude Code sends a command that exits non-zero here and NOT to PostToolUse, so a
48
+ * failing test run never reached FixCapture (no red, so no red → green fix memory), the recall of a recorded fix,
49
+ * or the leak warning. The handler treats it exactly like PostToolUse.
43
50
  */
44
51
  export declare const CLAUDE_FAILURE_HOOK_COMMAND = "command -v lemma-brain-ingest >/dev/null 2>&1 && lemma-brain-ingest --hook-failure || true";
45
52
  export declare const CLAUDE_FAILURE_MATCHER = "Bash";
@@ -68,12 +75,42 @@ export declare function installCodexHooks(home?: string): HookInstallOutcome;
68
75
  /** Cursor format: `{ version: 1, hooks: { <event>: [{ command, matcher? }] } }`. */
69
76
  export declare function installCursorHooks(home?: string): HookInstallOutcome;
70
77
  /**
71
- * OpenCode has no hook protocol, so the hook is a plugin: it forwards each finished tool call
72
- * to `lemma-brain-ingest --host=opencode` and appends the note it prints (if any) to the tool's
73
- * output — the only place a plugin can put text the model reads. Arguments are taken from
74
- * tool.execute.before, keyed by call id, because the after-hook's input doesn't carry them.
78
+ * OpenCode has no hook protocol, so the hook is a plugin:
79
+ * - each finished tool call goes to `lemma-brain-ingest --host=opencode`, and the note it prints (if
80
+ * any) is appended to the tool's output, the only place a plugin can put text the model reads.
81
+ * Arguments are taken from tool.execute.before, keyed by call id: the after-hook's input lacks them.
82
+ * - session.idle (OpenCode has no session end) sends the session and its subagents' child sessions to
83
+ * `--opencode-idle`, which saves the hand-off (see OpenCodeSession); experimental.session.compacting
84
+ * does the same and adds the hand-off to the compaction context, so the plan survives it.
85
+ * - experimental.chat.system.transform adds the session briefing (what `SessionStart` gives Claude
86
+ * Code) to the system prompt, computed once per session and repeated on every step so the prompt
87
+ * stays the same between steps. Subagent sessions get none of this: they are the parent's work.
88
+ * The session is NOT fetched from the SDK on every turn: measured on real sessions, one message's
89
+ * `summary.diffs` held 99.7 MB and whole sessions 170-207 MB, all of which `client.session.messages`
90
+ * returns. The plugin keeps its own trimmed log from the bus events it already receives
91
+ * (message.updated, message.part.updated, session.created/updated). A session it joined midway (opened with
92
+ * -s / --continue) is not fetched either: no SDK query can leave that one message out. Its hand-off then
93
+ * covers what this process saw, and the previous process's hand-off carries the plan and the files over
94
+ * (SessionCapture's continuation). Only session.get, which is small, is asked for, to tell a subagent.
95
+ * The idle/compaction/briefing calls are async (a spawnSync would freeze OpenCode's UI meanwhile) and
96
+ * every hook swallows its errors: Lemma must never be the reason a session fails.
97
+ */
98
+ export declare const OPENCODE_PLUGIN = "// managed by `lemma init` \u2014 delete this file to disable Lemma Brain recall in OpenCode\nimport { spawn, spawnSync } from \"node:child_process\";\n\nconst MAX_TEXT = 8000;\nconst OUTPUT_HEAD = 1500;\nconst OUTPUT_TAIL = 4500;\nconst MAX_PARTS = 4000;\nconst INPUT_KEYS = [\"filePath\", \"file_path\", \"path\", \"command\", \"description\", \"subagent_type\", \"patchText\", \"searchContent\", \"replaceContent\", \"patches\"];\n\nconst clip = (s, n) => (typeof s === \"string\" && s.length > n ? s.slice(0, n) : s);\nconst ends = (s) => (typeof s === \"string\" && s.length > OUTPUT_HEAD + OUTPUT_TAIL ? s.slice(0, OUTPUT_HEAD) + \"\\n\u2026\\n\" + s.slice(-OUTPUT_TAIL) : s);\n\n// What Lemma reads of a part (see OpenCodeSession): nothing else crosses the process boundary.\nfunction slimPart(p) {\n if (!p || typeof p !== \"object\") return null;\n if (p.type === \"text\") return p.synthetic || typeof p.text !== \"string\" ? null : { type: \"text\", text: clip(p.text, MAX_TEXT) };\n if (p.type === \"patch\") return Array.isArray(p.files) ? { type: \"patch\", files: p.files.slice(0, 50) } : null;\n if (p.type !== \"tool\" || typeof p.tool !== \"string\") return null;\n const st = p.state || {};\n const raw = st.input && typeof st.input === \"object\" ? st.input : {};\n const input = {};\n for (const k of INPUT_KEYS) if (raw[k] !== undefined) input[k] = typeof raw[k] === \"string\" ? clip(raw[k], 20000) : raw[k];\n const meta = st.metadata || {};\n return { type: \"tool\", tool: p.tool, callID: p.callID, state: { status: st.status, input, output: ends(typeof st.output === \"string\" ? st.output : \"\"), error: clip(st.error, 2000), time: st.time, metadata: { sessionId: meta.sessionId, exit: meta.exit } } };\n}\n\nexport const LemmaBrainRecall = async ({ client, directory }) => {\n const argsByCall = new Map();\n const sessions = new Map(); // id -> { parentID, title, agent, joined, messages: Map(msgId -> { info, parts: Map(partId -> slim) }) }\n const briefings = new Map();\n const ingest = (args, payload, timeoutMs) => new Promise((resolve) => {\n let out = \"\";\n let done = false;\n const finish = () => { if (!done) { done = true; clearTimeout(timer); resolve(out.trim()); } };\n const child = spawn(\"lemma-brain-ingest\", args, { stdio: [\"pipe\", \"pipe\", \"ignore\"] });\n const timer = setTimeout(() => { try { child.kill(); } catch {} finish(); }, timeoutMs);\n child.stdout.on(\"data\", (d) => { out += d; });\n child.on(\"error\", finish);\n child.on(\"close\", finish);\n child.stdin.on(\"error\", () => {});\n child.stdin.end(JSON.stringify(payload));\n });\n const session = (id) => {\n if (!sessions.has(id)) sessions.set(id, { parentID: undefined, title: undefined, agent: undefined, joined: false, messages: new Map(), parts: 0 });\n return sessions.get(id);\n };\n const learn = (info) => {\n if (!info || typeof info.id !== \"string\") return;\n const s = session(info.id);\n s.parentID = info.parentID || null;\n s.title = info.title;\n s.agent = info.agent;\n };\n const message = (s, info) => {\n const m = s.messages.get(info.id) || { info: {}, parts: new Map() };\n // A part can arrive before its message: the placeholder's role and time are corrected here.\n m.info = { role: info.role, time: { created: info.time && info.time.created } };\n s.messages.set(info.id, m);\n return m;\n };\n const addPart = (s, messageID, part) => {\n const slim = slimPart(part);\n if (!slim || !messageID) return;\n const m = s.messages.get(messageID) || (s.messages.set(messageID, { info: { role: \"assistant\", time: {} }, parts: new Map() }), s.messages.get(messageID));\n if (!m.parts.has(part.id)) s.parts++;\n m.parts.set(part.id || String(m.parts.size), slim);\n // A runaway session keeps its first parts (the task) and its latest ones (the work at hand).\n if (s.parts > MAX_PARTS) {\n const ids = [...s.messages.keys()];\n for (const id of ids.slice(2, Math.max(2, ids.length - 300))) { s.parts -= s.messages.get(id).parts.size; s.messages.delete(id); if (s.parts <= MAX_PARTS * 0.8) break; }\n }\n };\n // A session this process did not see start (opened with -s / --continue): only ask whether it is a subagent.\n const join = async (id) => {\n const s = session(id);\n if (s.joined) return s;\n s.joined = true;\n try {\n if (s.parentID === undefined) learn(((await client.session.get({ path: { id } })).data) || { id });\n } catch { /* unknown parent: treated as a main session */ }\n return s;\n };\n const isSubagent = async (id) => !!(await join(id)).parentID;\n const plain = (s) => [...s.messages.values()].sort((a, b) => (a.info.time.created || 0) - (b.info.time.created || 0)).map((m) => ({ info: m.info, parts: [...m.parts.values()] }));\n const snapshot = async (id) => {\n const s = await join(id);\n const kids = [];\n for (const [kid, k] of sessions) if (k.parentID === id) kids.push({ session: { id: kid, title: k.title, agent: k.agent }, messages: plain(k) });\n return { sessionID: id, directory, messages: plain(s), children: kids };\n };\n return {\n \"tool.execute.before\": async (input, output) => {\n if (!input || !input.callID) return;\n argsByCall.set(input.callID, (output && output.args) || {});\n if (argsByCall.size > 200) argsByCall.delete(argsByCall.keys().next().value);\n },\n \"tool.execute.after\": async (input, output) => {\n try {\n const args = argsByCall.get(input.callID) || input.args || {};\n argsByCall.delete(input.callID);\n if (!output || typeof output.output !== \"string\") return;\n const payload = { tool: input.tool, sessionID: input.sessionID, args, output: output.output, metadata: output.metadata || {}, directory };\n const r = spawnSync(\"lemma-brain-ingest\", [\"--hook-result\", \"--host=opencode\"], { input: JSON.stringify(payload), encoding: \"utf8\", timeout: 5000 });\n const note = typeof r.stdout === \"string\" ? r.stdout.trim() : \"\";\n if (note) output.output += \"\\n\\n\" + note;\n } catch {\n // A recall hint must never be the reason a tool call fails.\n }\n },\n event: async ({ event }) => {\n try {\n if (!event || !event.properties) return;\n const props = event.properties;\n if (event.type === \"session.created\" || event.type === \"session.updated\") {\n learn(props.info);\n if (event.type === \"session.created\" && props.info) session(props.info.id).joined = true; // seen from its start\n return;\n }\n if (event.type === \"message.updated\" && props.info && props.info.sessionID) { message(session(props.info.sessionID), props.info); return; }\n if (event.type === \"message.part.updated\" && props.part && props.part.sessionID) { addPart(session(props.part.sessionID), props.part.messageID, props.part); return; }\n if (event.type !== \"session.idle\") return;\n const id = props.sessionID;\n if (!id || (await isSubagent(id))) return;\n await ingest([\"--opencode-idle\", \"--host=opencode\"], await snapshot(id), 15000);\n } catch {\n // the hand-off is a courtesy; the session is never held up by it\n }\n },\n \"experimental.session.compacting\": async (input, output) => {\n try {\n if (!input || !input.sessionID || (await isSubagent(input.sessionID))) return;\n const text = await ingest([\"--opencode-compacting\", \"--host=opencode\"], await snapshot(input.sessionID), 15000);\n if (text && output && Array.isArray(output.context)) output.context.push(text);\n } catch {\n // the compaction goes ahead without the hand-off\n }\n },\n \"experimental.chat.system.transform\": async (input, output) => {\n try {\n const id = input && input.sessionID;\n if (!id || !output || !Array.isArray(output.system)) return;\n if (!briefings.has(id)) {\n briefings.set(id, (await isSubagent(id)) ? \"\" : await ingest([\"--session-start\", \"--host=opencode\"], { cwd: directory, session_id: id, host: \"opencode\" }, 5000));\n }\n const text = briefings.get(id);\n if (text) output.system.push(text);\n } catch {\n // no briefing this time\n }\n },\n };\n};\n";
99
+ /** What `lemma init` registers as OpenCode's MCP server: OpenCode's local-server shape (`type`, argv array). */
100
+ export declare const OPENCODE_MCP_ENTRY: {
101
+ type: string;
102
+ command: string[];
103
+ enabled: boolean;
104
+ };
105
+ /**
106
+ * Register Lemma's MCP server where OpenCode reads it: `~/.config/opencode/opencode.json` (or the
107
+ * `.jsonc` beside it, when that is the one in use). `lemma init` used to write `~/.opencode.json`, a path
108
+ * OpenCode no longer reads, in the old `{command, args}` shape, so outside a repo with its own
109
+ * opencode.json OpenCode had no Lemma tools at all (`opencode mcp list`: "No MCP servers configured").
110
+ * An existing `mcp.lemma` is kept as it is (it may point at a local build on purpose); a file that is
111
+ * not plain JSON (a .jsonc with comments) is left alone and the caller gets the snippet to add.
75
112
  */
76
- export declare const OPENCODE_PLUGIN = "// managed by `lemma init` \u2014 delete this file to disable Lemma Brain recall in OpenCode\nimport { spawnSync } from \"node:child_process\";\n\nexport const LemmaBrainRecall = async ({ directory }) => {\n const argsByCall = new Map();\n return {\n \"tool.execute.before\": async (input, output) => {\n if (!input || !input.callID) return;\n argsByCall.set(input.callID, (output && output.args) || {});\n if (argsByCall.size > 200) argsByCall.delete(argsByCall.keys().next().value);\n },\n \"tool.execute.after\": async (input, output) => {\n try {\n const args = argsByCall.get(input.callID) || input.args || {};\n argsByCall.delete(input.callID);\n if (!output || typeof output.output !== \"string\") return;\n const payload = { tool: input.tool, sessionID: input.sessionID, args, output: output.output, metadata: output.metadata || {}, directory };\n const r = spawnSync(\"lemma-brain-ingest\", [\"--hook-result\", \"--host=opencode\"], { input: JSON.stringify(payload), encoding: \"utf8\", timeout: 5000 });\n const note = typeof r.stdout === \"string\" ? r.stdout.trim() : \"\";\n if (note) output.output += \"\\n\\n\" + note;\n } catch {\n // A recall hint must never be the reason a tool call fails.\n }\n },\n };\n};\n";
113
+ export declare function registerOpenCodeMcp(home?: string): HookInstallOutcome;
77
114
  export declare function installOpenCodePlugin(home?: string): HookInstallOutcome;
78
115
  export interface HostHookReport {
79
116
  host: 'Claude Code' | 'Codex' | 'Cursor' | 'OpenCode';
@@ -1 +1 @@
1
- {"version":3,"file":"hostHooks.d.ts","sourceRoot":"","sources":["../../../src/cli/hostHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAeH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAGvE;AAED,eAAO,MAAM,mBAAmB,QAAwB,CAAC;AACzD,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B,gGAA4E,CAAC;AACpH,uGAAuG;AACvG,eAAO,MAAM,4BAA4B,2FAA8E,CAAC;AACxH,eAAO,MAAM,uBAAuB,sCAAsC,CAAC;AAC3E,4FAA4F;AAC5F,eAAO,MAAM,2BAA2B,gGAA6E,CAAC;AACtH,sGAAsG;AACtG,eAAO,MAAM,+BAA+B,8FAAiF,CAAC;AAC9H;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,8FAAiF,CAAC;AAC9H;;;GAGG;AACH,eAAO,MAAM,2BAA2B,+FAA6E,CAAC;AACtH,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,mBAAmB,gDAAgD,CAAC;AACjF,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAChE,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAWD,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA6FD,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAsB,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,kBAAkB,CA4B3H;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAEjF;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAkClF;AAID;;;;;GAKG;AACH,eAAO,MAAM,eAAe,szCA0B3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAYrF;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtD,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,EAAE,IAAI,GAAE,MAAqB,GAAG,cAAc,EAAE,CAO3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,kBAAkB,GAAG,IAAI,CAWxF"}
1
+ {"version":3,"file":"hostHooks.d.ts","sourceRoot":"","sources":["../../../src/cli/hostHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAgBH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAGvE;AAED,eAAO,MAAM,mBAAmB,QAAwB,CAAC;AACzD,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B,gGAA4E,CAAC;AACpH,uGAAuG;AACvG,eAAO,MAAM,4BAA4B,2FAA8E,CAAC;AACxH,eAAO,MAAM,uBAAuB,sCAAsC,CAAC;AAC3E,4FAA4F;AAC5F,eAAO,MAAM,2BAA2B,gGAA6E,CAAC;AACtH,sGAAsG;AACtG,eAAO,MAAM,+BAA+B,8FAAiF,CAAC;AAC9H;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,8FAAiF,CAAC;AAC9H;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,uFAA0E,CAAC;AAChH;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,+FAA6E,CAAC;AACtH,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,mBAAmB,gDAAgD,CAAC;AACjF,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAChE,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAWD,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA6FD,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAsB,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,kBAAkB,CA8B3H;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAEjF;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAkClF;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe,suQAwJ3B,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,kBAAkB;;;;CAAkF,CAAC;AAElH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAsBnF;AAED,wBAAgB,qBAAqB,CAAC,IAAI,GAAE,MAAqB,GAAG,kBAAkB,CAYrF;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACtD,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,EAAE,IAAI,GAAE,MAAqB,GAAG,cAAc,EAAE,CAO3G;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,kBAAkB,GAAG,IAAI,CAWxF"}