nodedex 0.1.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 (469) hide show
  1. package/adapters/claude-code-watcher.mjs +336 -0
  2. package/adapters/hermes-statedb-watcher.mjs +234 -0
  3. package/adapters/nodedex-capture-core.mjs +129 -0
  4. package/adapters/nodedex-capture.mjs +169 -0
  5. package/dist/agent-protocol.d.ts +7 -0
  6. package/dist/agent-protocol.d.ts.map +1 -0
  7. package/dist/agent-protocol.js +38 -0
  8. package/dist/agent-protocol.js.map +1 -0
  9. package/dist/api-server.d.ts +5 -0
  10. package/dist/api-server.d.ts.map +1 -0
  11. package/dist/api-server.js +351 -0
  12. package/dist/api-server.js.map +1 -0
  13. package/dist/boot-env.d.ts +2 -0
  14. package/dist/boot-env.d.ts.map +1 -0
  15. package/dist/boot-env.js +12 -0
  16. package/dist/boot-env.js.map +1 -0
  17. package/dist/engine/__tests__/search-core.test.d.ts +2 -0
  18. package/dist/engine/__tests__/search-core.test.d.ts.map +1 -0
  19. package/dist/engine/__tests__/search-core.test.js +139 -0
  20. package/dist/engine/__tests__/search-core.test.js.map +1 -0
  21. package/dist/engine/ai-provider.d.ts +45 -0
  22. package/dist/engine/ai-provider.d.ts.map +1 -0
  23. package/dist/engine/ai-provider.js +5 -0
  24. package/dist/engine/ai-provider.js.map +1 -0
  25. package/dist/engine/embeddings.d.ts +51 -0
  26. package/dist/engine/embeddings.d.ts.map +1 -0
  27. package/dist/engine/embeddings.js +89 -0
  28. package/dist/engine/embeddings.js.map +1 -0
  29. package/dist/engine/providers/__tests__/failure-policy.test.d.ts +2 -0
  30. package/dist/engine/providers/__tests__/failure-policy.test.d.ts.map +1 -0
  31. package/dist/engine/providers/__tests__/failure-policy.test.js +134 -0
  32. package/dist/engine/providers/__tests__/failure-policy.test.js.map +1 -0
  33. package/dist/engine/providers/__tests__/model-caps.test.d.ts +2 -0
  34. package/dist/engine/providers/__tests__/model-caps.test.d.ts.map +1 -0
  35. package/dist/engine/providers/__tests__/model-caps.test.js +38 -0
  36. package/dist/engine/providers/__tests__/model-caps.test.js.map +1 -0
  37. package/dist/engine/providers/__tests__/openai-structured.test.d.ts +2 -0
  38. package/dist/engine/providers/__tests__/openai-structured.test.d.ts.map +1 -0
  39. package/dist/engine/providers/__tests__/openai-structured.test.js +73 -0
  40. package/dist/engine/providers/__tests__/openai-structured.test.js.map +1 -0
  41. package/dist/engine/providers/__tests__/usage-ledger.test.d.ts +2 -0
  42. package/dist/engine/providers/__tests__/usage-ledger.test.d.ts.map +1 -0
  43. package/dist/engine/providers/__tests__/usage-ledger.test.js +108 -0
  44. package/dist/engine/providers/__tests__/usage-ledger.test.js.map +1 -0
  45. package/dist/engine/providers/anthropic.d.ts +17 -0
  46. package/dist/engine/providers/anthropic.d.ts.map +1 -0
  47. package/dist/engine/providers/anthropic.js +125 -0
  48. package/dist/engine/providers/anthropic.js.map +1 -0
  49. package/dist/engine/providers/failure-policy.d.ts +56 -0
  50. package/dist/engine/providers/failure-policy.d.ts.map +1 -0
  51. package/dist/engine/providers/failure-policy.js +120 -0
  52. package/dist/engine/providers/failure-policy.js.map +1 -0
  53. package/dist/engine/providers/gemini.d.ts +22 -0
  54. package/dist/engine/providers/gemini.d.ts.map +1 -0
  55. package/dist/engine/providers/gemini.js +180 -0
  56. package/dist/engine/providers/gemini.js.map +1 -0
  57. package/dist/engine/providers/index.d.ts +8 -0
  58. package/dist/engine/providers/index.d.ts.map +1 -0
  59. package/dist/engine/providers/index.js +67 -0
  60. package/dist/engine/providers/index.js.map +1 -0
  61. package/dist/engine/providers/local.d.ts +12 -0
  62. package/dist/engine/providers/local.d.ts.map +1 -0
  63. package/dist/engine/providers/local.js +46 -0
  64. package/dist/engine/providers/local.js.map +1 -0
  65. package/dist/engine/providers/model-caps.d.ts +6 -0
  66. package/dist/engine/providers/model-caps.d.ts.map +1 -0
  67. package/dist/engine/providers/model-caps.js +49 -0
  68. package/dist/engine/providers/model-caps.js.map +1 -0
  69. package/dist/engine/providers/openai.d.ts +30 -0
  70. package/dist/engine/providers/openai.d.ts.map +1 -0
  71. package/dist/engine/providers/openai.js +309 -0
  72. package/dist/engine/providers/openai.js.map +1 -0
  73. package/dist/engine/providers/usage-ledger.d.ts +69 -0
  74. package/dist/engine/providers/usage-ledger.d.ts.map +1 -0
  75. package/dist/engine/providers/usage-ledger.js +209 -0
  76. package/dist/engine/providers/usage-ledger.js.map +1 -0
  77. package/dist/engine/search-core.d.ts +40 -0
  78. package/dist/engine/search-core.d.ts.map +1 -0
  79. package/dist/engine/search-core.js +109 -0
  80. package/dist/engine/search-core.js.map +1 -0
  81. package/dist/engine/vector-math.d.ts +5 -0
  82. package/dist/engine/vector-math.d.ts.map +1 -0
  83. package/dist/engine/vector-math.js +25 -0
  84. package/dist/engine/vector-math.js.map +1 -0
  85. package/dist/home-env.d.ts +26 -0
  86. package/dist/home-env.d.ts.map +1 -0
  87. package/dist/home-env.js +87 -0
  88. package/dist/home-env.js.map +1 -0
  89. package/dist/mcp-server.d.ts +13 -0
  90. package/dist/mcp-server.d.ts.map +1 -0
  91. package/dist/mcp-server.js +79 -0
  92. package/dist/mcp-server.js.map +1 -0
  93. package/dist/middleware/auth.d.ts +23 -0
  94. package/dist/middleware/auth.d.ts.map +1 -0
  95. package/dist/middleware/auth.js +104 -0
  96. package/dist/middleware/auth.js.map +1 -0
  97. package/dist/middleware/auto-recall.d.ts +7 -0
  98. package/dist/middleware/auto-recall.d.ts.map +1 -0
  99. package/dist/middleware/auto-recall.js +257 -0
  100. package/dist/middleware/auto-recall.js.map +1 -0
  101. package/dist/middleware/auto-reflect.d.ts +4 -0
  102. package/dist/middleware/auto-reflect.d.ts.map +1 -0
  103. package/dist/middleware/auto-reflect.js +5 -0
  104. package/dist/middleware/auto-reflect.js.map +1 -0
  105. package/dist/middleware/reflect/apply-flag-verdict.d.ts +27 -0
  106. package/dist/middleware/reflect/apply-flag-verdict.d.ts.map +1 -0
  107. package/dist/middleware/reflect/apply-flag-verdict.js +57 -0
  108. package/dist/middleware/reflect/apply-flag-verdict.js.map +1 -0
  109. package/dist/middleware/reflect/arc-entity-resolve.d.ts +29 -0
  110. package/dist/middleware/reflect/arc-entity-resolve.d.ts.map +1 -0
  111. package/dist/middleware/reflect/arc-entity-resolve.js +356 -0
  112. package/dist/middleware/reflect/arc-entity-resolve.js.map +1 -0
  113. package/dist/middleware/reflect/arc-inactivity-timer.d.ts +47 -0
  114. package/dist/middleware/reflect/arc-inactivity-timer.d.ts.map +1 -0
  115. package/dist/middleware/reflect/arc-inactivity-timer.js +175 -0
  116. package/dist/middleware/reflect/arc-inactivity-timer.js.map +1 -0
  117. package/dist/middleware/reflect/arc-pipeline.d.ts +33 -0
  118. package/dist/middleware/reflect/arc-pipeline.d.ts.map +1 -0
  119. package/dist/middleware/reflect/arc-pipeline.js +498 -0
  120. package/dist/middleware/reflect/arc-pipeline.js.map +1 -0
  121. package/dist/middleware/reflect/comprehend-pergroup.d.ts +100 -0
  122. package/dist/middleware/reflect/comprehend-pergroup.d.ts.map +1 -0
  123. package/dist/middleware/reflect/comprehend-pergroup.js +610 -0
  124. package/dist/middleware/reflect/comprehend-pergroup.js.map +1 -0
  125. package/dist/middleware/reflect/comprehend.d.ts +237 -0
  126. package/dist/middleware/reflect/comprehend.d.ts.map +1 -0
  127. package/dist/middleware/reflect/comprehend.js +706 -0
  128. package/dist/middleware/reflect/comprehend.js.map +1 -0
  129. package/dist/middleware/reflect/config.d.ts +34 -0
  130. package/dist/middleware/reflect/config.d.ts.map +1 -0
  131. package/dist/middleware/reflect/config.js +131 -0
  132. package/dist/middleware/reflect/config.js.map +1 -0
  133. package/dist/middleware/reflect/context.d.ts +138 -0
  134. package/dist/middleware/reflect/context.d.ts.map +1 -0
  135. package/dist/middleware/reflect/context.js +619 -0
  136. package/dist/middleware/reflect/context.js.map +1 -0
  137. package/dist/middleware/reflect/cost-breakdown.d.ts +69 -0
  138. package/dist/middleware/reflect/cost-breakdown.d.ts.map +1 -0
  139. package/dist/middleware/reflect/cost-breakdown.js +63 -0
  140. package/dist/middleware/reflect/cost-breakdown.js.map +1 -0
  141. package/dist/middleware/reflect/cost-guard.d.ts +102 -0
  142. package/dist/middleware/reflect/cost-guard.d.ts.map +1 -0
  143. package/dist/middleware/reflect/cost-guard.js +243 -0
  144. package/dist/middleware/reflect/cost-guard.js.map +1 -0
  145. package/dist/middleware/reflect/cost-pricing.d.ts +54 -0
  146. package/dist/middleware/reflect/cost-pricing.d.ts.map +1 -0
  147. package/dist/middleware/reflect/cost-pricing.js +148 -0
  148. package/dist/middleware/reflect/cost-pricing.js.map +1 -0
  149. package/dist/middleware/reflect/cross-group-link.d.ts +61 -0
  150. package/dist/middleware/reflect/cross-group-link.d.ts.map +1 -0
  151. package/dist/middleware/reflect/cross-group-link.js +212 -0
  152. package/dist/middleware/reflect/cross-group-link.js.map +1 -0
  153. package/dist/middleware/reflect/dedup-by-source-and-value.d.ts +70 -0
  154. package/dist/middleware/reflect/dedup-by-source-and-value.d.ts.map +1 -0
  155. package/dist/middleware/reflect/dedup-by-source-and-value.js +0 -0
  156. package/dist/middleware/reflect/dedup-by-source-and-value.js.map +1 -0
  157. package/dist/middleware/reflect/describe-roots.d.ts +58 -0
  158. package/dist/middleware/reflect/describe-roots.d.ts.map +1 -0
  159. package/dist/middleware/reflect/describe-roots.js +266 -0
  160. package/dist/middleware/reflect/describe-roots.js.map +1 -0
  161. package/dist/middleware/reflect/flag-reviewer-startup.d.ts +16 -0
  162. package/dist/middleware/reflect/flag-reviewer-startup.d.ts.map +1 -0
  163. package/dist/middleware/reflect/flag-reviewer-startup.js +107 -0
  164. package/dist/middleware/reflect/flag-reviewer-startup.js.map +1 -0
  165. package/dist/middleware/reflect/flag-reviewer.d.ts +69 -0
  166. package/dist/middleware/reflect/flag-reviewer.d.ts.map +1 -0
  167. package/dist/middleware/reflect/flag-reviewer.js +520 -0
  168. package/dist/middleware/reflect/flag-reviewer.js.map +1 -0
  169. package/dist/middleware/reflect/inline-dedup.d.ts +26 -0
  170. package/dist/middleware/reflect/inline-dedup.d.ts.map +1 -0
  171. package/dist/middleware/reflect/inline-dedup.js +131 -0
  172. package/dist/middleware/reflect/inline-dedup.js.map +1 -0
  173. package/dist/middleware/reflect/justify-decisions.d.ts +37 -0
  174. package/dist/middleware/reflect/justify-decisions.d.ts.map +1 -0
  175. package/dist/middleware/reflect/justify-decisions.js +159 -0
  176. package/dist/middleware/reflect/justify-decisions.js.map +1 -0
  177. package/dist/middleware/reflect/nl-accept.d.ts +35 -0
  178. package/dist/middleware/reflect/nl-accept.d.ts.map +1 -0
  179. package/dist/middleware/reflect/nl-accept.js +167 -0
  180. package/dist/middleware/reflect/nl-accept.js.map +1 -0
  181. package/dist/middleware/reflect/pass0.d.ts +20 -0
  182. package/dist/middleware/reflect/pass0.d.ts.map +1 -0
  183. package/dist/middleware/reflect/pass0.js +423 -0
  184. package/dist/middleware/reflect/pass0.js.map +1 -0
  185. package/dist/middleware/reflect/pass1.d.ts +17 -0
  186. package/dist/middleware/reflect/pass1.d.ts.map +1 -0
  187. package/dist/middleware/reflect/pass1.js +241 -0
  188. package/dist/middleware/reflect/pass1.js.map +1 -0
  189. package/dist/middleware/reflect/pass2-quarantine.d.ts +129 -0
  190. package/dist/middleware/reflect/pass2-quarantine.d.ts.map +1 -0
  191. package/dist/middleware/reflect/pass2-quarantine.js +272 -0
  192. package/dist/middleware/reflect/pass2-quarantine.js.map +1 -0
  193. package/dist/middleware/reflect/pass2-seams.d.ts +205 -0
  194. package/dist/middleware/reflect/pass2-seams.d.ts.map +1 -0
  195. package/dist/middleware/reflect/pass2-seams.js +279 -0
  196. package/dist/middleware/reflect/pass2-seams.js.map +1 -0
  197. package/dist/middleware/reflect/pass2-split-orchestrator.d.ts +37 -0
  198. package/dist/middleware/reflect/pass2-split-orchestrator.d.ts.map +1 -0
  199. package/dist/middleware/reflect/pass2-split-orchestrator.js +531 -0
  200. package/dist/middleware/reflect/pass2-split-orchestrator.js.map +1 -0
  201. package/dist/middleware/reflect/pass2.d.ts +17 -0
  202. package/dist/middleware/reflect/pass2.d.ts.map +1 -0
  203. package/dist/middleware/reflect/pass2.js +324 -0
  204. package/dist/middleware/reflect/pass2.js.map +1 -0
  205. package/dist/middleware/reflect/pass2a.d.ts +141 -0
  206. package/dist/middleware/reflect/pass2a.d.ts.map +1 -0
  207. package/dist/middleware/reflect/pass2a.js +404 -0
  208. package/dist/middleware/reflect/pass2a.js.map +1 -0
  209. package/dist/middleware/reflect/pass2b.d.ts +108 -0
  210. package/dist/middleware/reflect/pass2b.d.ts.map +1 -0
  211. package/dist/middleware/reflect/pass2b.js +480 -0
  212. package/dist/middleware/reflect/pass2b.js.map +1 -0
  213. package/dist/middleware/reflect/pass2c.d.ts +113 -0
  214. package/dist/middleware/reflect/pass2c.d.ts.map +1 -0
  215. package/dist/middleware/reflect/pass2c.js +360 -0
  216. package/dist/middleware/reflect/pass2c.js.map +1 -0
  217. package/dist/middleware/reflect/pass3-batch.d.ts +62 -0
  218. package/dist/middleware/reflect/pass3-batch.d.ts.map +1 -0
  219. package/dist/middleware/reflect/pass3-batch.js +139 -0
  220. package/dist/middleware/reflect/pass3-batch.js.map +1 -0
  221. package/dist/middleware/reflect/pass3.d.ts +23 -0
  222. package/dist/middleware/reflect/pass3.d.ts.map +1 -0
  223. package/dist/middleware/reflect/pass3.js +371 -0
  224. package/dist/middleware/reflect/pass3.js.map +1 -0
  225. package/dist/middleware/reflect/pass4-slice.d.ts +25 -0
  226. package/dist/middleware/reflect/pass4-slice.d.ts.map +1 -0
  227. package/dist/middleware/reflect/pass4-slice.js +315 -0
  228. package/dist/middleware/reflect/pass4-slice.js.map +1 -0
  229. package/dist/middleware/reflect/pass4.d.ts +30 -0
  230. package/dist/middleware/reflect/pass4.d.ts.map +1 -0
  231. package/dist/middleware/reflect/pass4.js +193 -0
  232. package/dist/middleware/reflect/pass4.js.map +1 -0
  233. package/dist/middleware/reflect/pass5.d.ts +22 -0
  234. package/dist/middleware/reflect/pass5.d.ts.map +1 -0
  235. package/dist/middleware/reflect/pass5.js +178 -0
  236. package/dist/middleware/reflect/pass5.js.map +1 -0
  237. package/dist/middleware/reflect/pass_judge.d.ts +44 -0
  238. package/dist/middleware/reflect/pass_judge.d.ts.map +1 -0
  239. package/dist/middleware/reflect/pass_judge.js +263 -0
  240. package/dist/middleware/reflect/pass_judge.js.map +1 -0
  241. package/dist/middleware/reflect/pipeline-flags.d.ts +140 -0
  242. package/dist/middleware/reflect/pipeline-flags.d.ts.map +1 -0
  243. package/dist/middleware/reflect/pipeline-flags.js +314 -0
  244. package/dist/middleware/reflect/pipeline-flags.js.map +1 -0
  245. package/dist/middleware/reflect/pipeline.d.ts +237 -0
  246. package/dist/middleware/reflect/pipeline.d.ts.map +1 -0
  247. package/dist/middleware/reflect/pipeline.js +3114 -0
  248. package/dist/middleware/reflect/pipeline.js.map +1 -0
  249. package/dist/middleware/reflect/promptOverride.d.ts +14 -0
  250. package/dist/middleware/reflect/promptOverride.d.ts.map +1 -0
  251. package/dist/middleware/reflect/promptOverride.js +28 -0
  252. package/dist/middleware/reflect/promptOverride.js.map +1 -0
  253. package/dist/middleware/reflect/provenance-check.d.ts +48 -0
  254. package/dist/middleware/reflect/provenance-check.d.ts.map +1 -0
  255. package/dist/middleware/reflect/provenance-check.js +180 -0
  256. package/dist/middleware/reflect/provenance-check.js.map +1 -0
  257. package/dist/middleware/reflect/provenance-reviewer.d.ts +52 -0
  258. package/dist/middleware/reflect/provenance-reviewer.d.ts.map +1 -0
  259. package/dist/middleware/reflect/provenance-reviewer.js +253 -0
  260. package/dist/middleware/reflect/provenance-reviewer.js.map +1 -0
  261. package/dist/middleware/reflect/prune-collapsed-types.d.ts +11 -0
  262. package/dist/middleware/reflect/prune-collapsed-types.d.ts.map +1 -0
  263. package/dist/middleware/reflect/prune-collapsed-types.js +32 -0
  264. package/dist/middleware/reflect/prune-collapsed-types.js.map +1 -0
  265. package/dist/middleware/reflect/recognize-root.d.ts +75 -0
  266. package/dist/middleware/reflect/recognize-root.d.ts.map +1 -0
  267. package/dist/middleware/reflect/recognize-root.js +204 -0
  268. package/dist/middleware/reflect/recognize-root.js.map +1 -0
  269. package/dist/middleware/reflect/render-agent-flag.d.ts +25 -0
  270. package/dist/middleware/reflect/render-agent-flag.d.ts.map +1 -0
  271. package/dist/middleware/reflect/render-agent-flag.js +39 -0
  272. package/dist/middleware/reflect/render-agent-flag.js.map +1 -0
  273. package/dist/middleware/reflect/retrieve-graph-slice.d.ts +54 -0
  274. package/dist/middleware/reflect/retrieve-graph-slice.d.ts.map +1 -0
  275. package/dist/middleware/reflect/retrieve-graph-slice.js +173 -0
  276. package/dist/middleware/reflect/retrieve-graph-slice.js.map +1 -0
  277. package/dist/middleware/reflect/root-relatedness.d.ts +31 -0
  278. package/dist/middleware/reflect/root-relatedness.d.ts.map +1 -0
  279. package/dist/middleware/reflect/root-relatedness.js +92 -0
  280. package/dist/middleware/reflect/root-relatedness.js.map +1 -0
  281. package/dist/middleware/reflect/schema-heal.d.ts +22 -0
  282. package/dist/middleware/reflect/schema-heal.d.ts.map +1 -0
  283. package/dist/middleware/reflect/schema-heal.js +119 -0
  284. package/dist/middleware/reflect/schema-heal.js.map +1 -0
  285. package/dist/middleware/reflect/schema-validator.d.ts +85 -0
  286. package/dist/middleware/reflect/schema-validator.d.ts.map +1 -0
  287. package/dist/middleware/reflect/schema-validator.js +196 -0
  288. package/dist/middleware/reflect/schema-validator.js.map +1 -0
  289. package/dist/middleware/reflect/stage-audit-graph.d.ts +115 -0
  290. package/dist/middleware/reflect/stage-audit-graph.d.ts.map +1 -0
  291. package/dist/middleware/reflect/stage-audit-graph.js +563 -0
  292. package/dist/middleware/reflect/stage-audit-graph.js.map +1 -0
  293. package/dist/middleware/reflect/stage-d-resolve-graph.d.ts +87 -0
  294. package/dist/middleware/reflect/stage-d-resolve-graph.d.ts.map +1 -0
  295. package/dist/middleware/reflect/stage-d-resolve-graph.js +256 -0
  296. package/dist/middleware/reflect/stage-d-resolve-graph.js.map +1 -0
  297. package/dist/middleware/reflect/synthesizeFromSceneCard.d.ts +15 -0
  298. package/dist/middleware/reflect/synthesizeFromSceneCard.d.ts.map +1 -0
  299. package/dist/middleware/reflect/synthesizeFromSceneCard.js +91 -0
  300. package/dist/middleware/reflect/synthesizeFromSceneCard.js.map +1 -0
  301. package/dist/middleware/reflect/types.d.ts +261 -0
  302. package/dist/middleware/reflect/types.d.ts.map +1 -0
  303. package/dist/middleware/reflect/types.js +3 -0
  304. package/dist/middleware/reflect/types.js.map +1 -0
  305. package/dist/middleware/reflect/v2-integrate.d.ts +120 -0
  306. package/dist/middleware/reflect/v2-integrate.d.ts.map +1 -0
  307. package/dist/middleware/reflect/v2-integrate.js +388 -0
  308. package/dist/middleware/reflect/v2-integrate.js.map +1 -0
  309. package/dist/middleware/reflect/v2-judge.d.ts +44 -0
  310. package/dist/middleware/reflect/v2-judge.d.ts.map +1 -0
  311. package/dist/middleware/reflect/v2-judge.js +191 -0
  312. package/dist/middleware/reflect/v2-judge.js.map +1 -0
  313. package/dist/relation-sets.d.ts +2 -0
  314. package/dist/relation-sets.d.ts.map +1 -0
  315. package/dist/relation-sets.js +35 -0
  316. package/dist/relation-sets.js.map +1 -0
  317. package/dist/routes/__tests__/flags.test.d.ts +2 -0
  318. package/dist/routes/__tests__/flags.test.d.ts.map +1 -0
  319. package/dist/routes/__tests__/flags.test.js +257 -0
  320. package/dist/routes/__tests__/flags.test.js.map +1 -0
  321. package/dist/routes/__tests__/models-catalog.test.d.ts +2 -0
  322. package/dist/routes/__tests__/models-catalog.test.d.ts.map +1 -0
  323. package/dist/routes/__tests__/models-catalog.test.js +130 -0
  324. package/dist/routes/__tests__/models-catalog.test.js.map +1 -0
  325. package/dist/routes/__tests__/reflect-pause-drain.test.d.ts +2 -0
  326. package/dist/routes/__tests__/reflect-pause-drain.test.d.ts.map +1 -0
  327. package/dist/routes/__tests__/reflect-pause-drain.test.js +38 -0
  328. package/dist/routes/__tests__/reflect-pause-drain.test.js.map +1 -0
  329. package/dist/routes/__tests__/spend-pause-drain.test.d.ts +2 -0
  330. package/dist/routes/__tests__/spend-pause-drain.test.d.ts.map +1 -0
  331. package/dist/routes/__tests__/spend-pause-drain.test.js +38 -0
  332. package/dist/routes/__tests__/spend-pause-drain.test.js.map +1 -0
  333. package/dist/routes/admin.d.ts +49 -0
  334. package/dist/routes/admin.d.ts.map +1 -0
  335. package/dist/routes/admin.js +471 -0
  336. package/dist/routes/admin.js.map +1 -0
  337. package/dist/routes/blocks.d.ts +4 -0
  338. package/dist/routes/blocks.d.ts.map +1 -0
  339. package/dist/routes/blocks.js +893 -0
  340. package/dist/routes/blocks.js.map +1 -0
  341. package/dist/routes/chat-proxy.d.ts +5 -0
  342. package/dist/routes/chat-proxy.d.ts.map +1 -0
  343. package/dist/routes/chat-proxy.js +225 -0
  344. package/dist/routes/chat-proxy.js.map +1 -0
  345. package/dist/routes/conversations.d.ts +4 -0
  346. package/dist/routes/conversations.d.ts.map +1 -0
  347. package/dist/routes/conversations.js +139 -0
  348. package/dist/routes/conversations.js.map +1 -0
  349. package/dist/routes/flags.d.ts +4 -0
  350. package/dist/routes/flags.d.ts.map +1 -0
  351. package/dist/routes/flags.js +151 -0
  352. package/dist/routes/flags.js.map +1 -0
  353. package/dist/routes/inject.d.ts +4 -0
  354. package/dist/routes/inject.d.ts.map +1 -0
  355. package/dist/routes/inject.js +183 -0
  356. package/dist/routes/inject.js.map +1 -0
  357. package/dist/routes/mcp-http.d.ts +5 -0
  358. package/dist/routes/mcp-http.d.ts.map +1 -0
  359. package/dist/routes/mcp-http.js +94 -0
  360. package/dist/routes/mcp-http.js.map +1 -0
  361. package/dist/routes/quarantine.d.ts +4 -0
  362. package/dist/routes/quarantine.d.ts.map +1 -0
  363. package/dist/routes/quarantine.js +66 -0
  364. package/dist/routes/quarantine.js.map +1 -0
  365. package/dist/routes/recall.d.ts +5 -0
  366. package/dist/routes/recall.d.ts.map +1 -0
  367. package/dist/routes/recall.js +573 -0
  368. package/dist/routes/recall.js.map +1 -0
  369. package/dist/routes/reflect.d.ts +5 -0
  370. package/dist/routes/reflect.d.ts.map +1 -0
  371. package/dist/routes/reflect.js +231 -0
  372. package/dist/routes/reflect.js.map +1 -0
  373. package/dist/routes/session.d.ts +4 -0
  374. package/dist/routes/session.d.ts.map +1 -0
  375. package/dist/routes/session.js +418 -0
  376. package/dist/routes/session.js.map +1 -0
  377. package/dist/routes/state.d.ts +116 -0
  378. package/dist/routes/state.d.ts.map +1 -0
  379. package/dist/routes/state.js +621 -0
  380. package/dist/routes/state.js.map +1 -0
  381. package/dist/routes/usage.d.ts +3 -0
  382. package/dist/routes/usage.d.ts.map +1 -0
  383. package/dist/routes/usage.js +141 -0
  384. package/dist/routes/usage.js.map +1 -0
  385. package/dist/routes/workspace.d.ts +5 -0
  386. package/dist/routes/workspace.d.ts.map +1 -0
  387. package/dist/routes/workspace.js +435 -0
  388. package/dist/routes/workspace.js.map +1 -0
  389. package/dist/server.d.ts +13 -0
  390. package/dist/server.d.ts.map +1 -0
  391. package/dist/server.js +298 -0
  392. package/dist/server.js.map +1 -0
  393. package/dist/store/__tests__/backup.test.d.ts +2 -0
  394. package/dist/store/__tests__/backup.test.d.ts.map +1 -0
  395. package/dist/store/__tests__/backup.test.js +53 -0
  396. package/dist/store/__tests__/backup.test.js.map +1 -0
  397. package/dist/store/__tests__/quality.test.d.ts +2 -0
  398. package/dist/store/__tests__/quality.test.d.ts.map +1 -0
  399. package/dist/store/__tests__/quality.test.js +75 -0
  400. package/dist/store/__tests__/quality.test.js.map +1 -0
  401. package/dist/store/backup.d.ts +14 -0
  402. package/dist/store/backup.d.ts.map +1 -0
  403. package/dist/store/backup.js +95 -0
  404. package/dist/store/backup.js.map +1 -0
  405. package/dist/store/database.d.ts +407 -0
  406. package/dist/store/database.d.ts.map +1 -0
  407. package/dist/store/database.js +2004 -0
  408. package/dist/store/database.js.map +1 -0
  409. package/dist/store/quality.d.ts +25 -0
  410. package/dist/store/quality.d.ts.map +1 -0
  411. package/dist/store/quality.js +48 -0
  412. package/dist/store/quality.js.map +1 -0
  413. package/dist/tools/__tests__/assemble-block-chains.test.d.ts +2 -0
  414. package/dist/tools/__tests__/assemble-block-chains.test.d.ts.map +1 -0
  415. package/dist/tools/__tests__/assemble-block-chains.test.js +118 -0
  416. package/dist/tools/__tests__/assemble-block-chains.test.js.map +1 -0
  417. package/dist/tools/__tests__/filter-roots-by-concepts.test.d.ts +2 -0
  418. package/dist/tools/__tests__/filter-roots-by-concepts.test.d.ts.map +1 -0
  419. package/dist/tools/__tests__/filter-roots-by-concepts.test.js +68 -0
  420. package/dist/tools/__tests__/filter-roots-by-concepts.test.js.map +1 -0
  421. package/dist/tools/__tests__/flag-surface.test.d.ts +2 -0
  422. package/dist/tools/__tests__/flag-surface.test.d.ts.map +1 -0
  423. package/dist/tools/__tests__/flag-surface.test.js +130 -0
  424. package/dist/tools/__tests__/flag-surface.test.js.map +1 -0
  425. package/dist/tools/core.d.ts +5 -0
  426. package/dist/tools/core.d.ts.map +1 -0
  427. package/dist/tools/core.js +962 -0
  428. package/dist/tools/core.js.map +1 -0
  429. package/dist/tools/derive.d.ts +5 -0
  430. package/dist/tools/derive.d.ts.map +1 -0
  431. package/dist/tools/derive.js +182 -0
  432. package/dist/tools/derive.js.map +1 -0
  433. package/dist/tools/flag-surface.d.ts +26 -0
  434. package/dist/tools/flag-surface.d.ts.map +1 -0
  435. package/dist/tools/flag-surface.js +59 -0
  436. package/dist/tools/flag-surface.js.map +1 -0
  437. package/dist/tools/helpers.d.ts +99 -0
  438. package/dist/tools/helpers.d.ts.map +1 -0
  439. package/dist/tools/helpers.js +243 -0
  440. package/dist/tools/helpers.js.map +1 -0
  441. package/dist/tools/projects.d.ts +5 -0
  442. package/dist/tools/projects.d.ts.map +1 -0
  443. package/dist/tools/projects.js +175 -0
  444. package/dist/tools/projects.js.map +1 -0
  445. package/dist/tools/system.d.ts +5 -0
  446. package/dist/tools/system.d.ts.map +1 -0
  447. package/dist/tools/system.js +1361 -0
  448. package/dist/tools/system.js.map +1 -0
  449. package/dist/tools/tasks.d.ts +5 -0
  450. package/dist/tools/tasks.d.ts.map +1 -0
  451. package/dist/tools/tasks.js +289 -0
  452. package/dist/tools/tasks.js.map +1 -0
  453. package/package.json +69 -0
  454. package/scripts/nodedex-entry.mjs +396 -0
  455. package/tui-dist/App.js +185 -0
  456. package/tui-dist/api.js +197 -0
  457. package/tui-dist/cli.js +53 -0
  458. package/tui-dist/components.js +63 -0
  459. package/tui-dist/config.js +242 -0
  460. package/tui-dist/connect-snippets.js +98 -0
  461. package/tui-dist/feed.js +51 -0
  462. package/tui-dist/health.js +465 -0
  463. package/tui-dist/hooks.js +23 -0
  464. package/tui-dist/memory.js +220 -0
  465. package/tui-dist/onboarding.js +498 -0
  466. package/tui-dist/review.js +193 -0
  467. package/tui-dist/servers.js +556 -0
  468. package/tui-dist/smoke.js +15 -0
  469. package/tui-dist/theme.js +106 -0
@@ -0,0 +1,237 @@
1
+ import type { Pass2Item, PipelineCheckpoint } from "./types.js";
2
+ import type { LLMProvider } from "../../engine/ai-provider.js";
3
+ export declare function pipelineV2Enabled(): boolean;
4
+ /** Bounded inline retry budget for the v2 ARC path — applied at BOTH failure sites:
5
+ * the front-half (COMPREHEND failed / SEAM-1 invalid / threw) AND the back-half
6
+ * (Pass 3 returned a re-queue checkpoint = items dropped). On exhaustion the arc
7
+ * FAILS CLEAN: turns are left re-extractable (never marked extracted with unsaved
8
+ * residue) and — v2-only — it NEVER auto-falls to v1. A fresh COMPREHEND / a
9
+ * resume-from-pass3 re-run recovers LLM-variance failures; the cap stops a
10
+ * deterministic fault from looping. Default 2 (→ up to 3 attempts total); set 0 to
11
+ * fail clean on the first failure. NODEDEX_ARC_MAX_RETRIES. */
12
+ export declare function arcMaxRetries(): number;
13
+ export declare function v2LazyCaptureEnabled(): boolean;
14
+ export declare const COMPREHEND_LINK_RELS: ReadonlySet<string>;
15
+ /** One typed knowledge block inside a group. Designed to convert 1:1 to a
16
+ * Pass2Item. `local_id` is an arc-local handle for within-group linking — NOT a
17
+ * graph id; the canonical strict label is assigned later by LLM 2. */
18
+ export interface ComprehendBlock {
19
+ local_id: string;
20
+ type: string;
21
+ unique: Record<string, string>;
22
+ schema?: Record<string, string>;
23
+ essence: string;
24
+ concepts?: string[];
25
+ provisional_name?: string;
26
+ provenance: string;
27
+ keep_reason?: string;
28
+ type_reasoning?: string;
29
+ uncertain?: boolean;
30
+ }
31
+ /** A causal link COMPREHEND READ from the prose. `from` is the block that HOLDS
32
+ * the relation (the source); `to` is the target. Both are local_ids. */
33
+ export interface ComprehendLink {
34
+ from: string;
35
+ to: string;
36
+ type: string;
37
+ reasoning?: string;
38
+ }
39
+ /** A coherent thread the conversation actually had (the roaster-choice
40
+ * discussion, the sourcing thread). A group ≈ a chain and feeds the
41
+ * {project}/{concept} label dims (chain_id-from-groups, build step 5). */
42
+ export interface ComprehendGroup {
43
+ group_id: string;
44
+ topic: string;
45
+ provisional_project?: string;
46
+ blocks: ComprehendBlock[];
47
+ within_group_links: ComprehendLink[];
48
+ }
49
+ export interface ComprehendResult {
50
+ groups: ComprehendGroup[];
51
+ reasoning?: string;
52
+ }
53
+ export type ComprehendIssueSeverity = "error" | "warning";
54
+ export interface ComprehendValidationIssue {
55
+ severity: ComprehendIssueSeverity;
56
+ message: string;
57
+ group_id?: string;
58
+ local_id?: string;
59
+ }
60
+ export interface ComprehendValidation {
61
+ valid: boolean;
62
+ errors: ComprehendValidationIssue[];
63
+ warnings: ComprehendValidationIssue[];
64
+ }
65
+ export declare function validateComprehendResult(result: unknown): ComprehendValidation;
66
+ /** Bucket COMPREHEND validation WARNINGS for a quieter, honest log line. Most fire on
67
+ * the raw draft and are REPAIRED DOWNSTREAM — unique{} shape by Pass 2b fill, dangling
68
+ * within-group links dropped at convert, a decision's missing based_on by JUSTIFY — so
69
+ * counting them raw made a clean arc look alarming ("warnings=35"). `notable` is the few
70
+ * worth a glance (missing essence, unknown type, a group with no topic/root). Pure. */
71
+ export declare function summarizeWarnings(warnings: ComprehendValidationIssue[]): string;
72
+ export interface ComprehendConversion {
73
+ items: Pass2Item[];
74
+ /** qualified item id (`{group_id}::{local_id}`) → group_id. Carries the grouping
75
+ * forward so chain_id can be stamped from groups (build step 5) instead of
76
+ * re-derived. */
77
+ groupByItemId: Record<string, string>;
78
+ }
79
+ /**
80
+ * Distribute ONE link onto the SOURCE item's existing causal field by relation
81
+ * type — the single source of truth for the link→field mapping. Used by the
82
+ * within-group converter AND the cross-group linker (cross-group-link.ts) so they
83
+ * never drift on which field a relation lands in. Caller must pre-validate that
84
+ * `type` ∈ COMPREHEND_LINK_RELS and that `toId` resolves to a real item.
85
+ */
86
+ export declare function applyLinkToPass2Item(from: Pass2Item, type: string, toId: string, reasoning?: string): void;
87
+ /**
88
+ * A project name is a single label DIMENSION ({project}_{entity}_{type}_{concept}),
89
+ * so it MUST be hyphens-only — an underscore would fake a dimension boundary and
90
+ * make Pass 3 fork a DUPLICATE root (the hyphenated project_creates root vs the
91
+ * verbatim underscore block label). COMPREHEND occasionally emits underscores
92
+ * (e.g. "backend_api_service"); the other passes enforce hyphens via a PROMPT
93
+ * instruction (pass0/pass3), which COMPREHEND doesn't carry — so we enforce it
94
+ * deterministically here, where item.project is born. Lossless for already-valid
95
+ * names; undefined in → undefined out (no project). (Run 9 big-arc bug.)
96
+ */
97
+ export declare function normalizeProjectName(p: string | undefined): string | undefined;
98
+ /** The most common normalized provisional_project across an arc's groups — the arc's
99
+ * ROOT to inherit when an individual group's guess is missing. Groups in one arc
100
+ * usually belong to ONE root, so inheriting the dominant guess keeps clusters together
101
+ * rather than fragmenting (each empty group otherwise becoming its own topic-named
102
+ * root). undefined only when NO group named a project. Pure / testable. */
103
+ export declare function dominantProvisionalProject(groups: ComprehendGroup[]): string | undefined;
104
+ /**
105
+ * Flatten the grouped fragment into Pass2Item[], distributing each within-group
106
+ * link onto the SOURCE item's existing causal field by relation type. local_ids
107
+ * are GROUP-SCOPED → qualified to `{group_id}::{local_id}` for global uniqueness;
108
+ * links resolve within their own group. Pure + defensive: skips links whose
109
+ * endpoints don't resolve (the validator reports those as errors; the converter
110
+ * must not throw on them).
111
+ *
112
+ * NOTE: `project` is set to the group's PROVISIONAL project. LLM 2 / the
113
+ * recognizer overrides it with the canonical root before WRITE.
114
+ */
115
+ export declare function comprehendResultToPass2Items(result: ComprehendResult): ComprehendConversion;
116
+ export declare function comprehendResultToCheckpoint(result: ComprehendResult): PipelineCheckpoint;
117
+ export declare const COMPREHEND_PROMPT = "You read ONE complete work session between a user and an AI agent, and transcribe\nits already-structured story into the memory schema. Read the whole session first,\nthen write.\n\nDecide EVERYTHING by reasoning about MEANING in this session's context \u2014 what role\neach piece played in what actually happened here. Never decide by matching surface\nwords, phrasings, or connectors. The same meaning appears in countless wordings\nacross domains; you are reading for the structure beneath the words.\n\n\u2500\u2500 STATE CONVENTION \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\"State\" = text in the TRANSCRIPT below. Your training knowledge and \"what's\ncommonly known\" are NOT state. Every block must quote a verbatim excerpt from the\ntranscript as its provenance. If it is not in the transcript, do not write it.\nFamiliarity \u2260 recorded.\n\n\u2500\u2500 WHAT TO KEEP (reason per candidate, from this session) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nKeep the irreplaceable RESIDUE of this session \u2014 what was DECIDED, TRIED-AND-\nABANDONED, CONSTRAINED, OBSERVED, or STATED here \u2014 together with the REASONING.\n\nThe spine question, per candidate:\n \"Could a competent model \u2014 given the project context but WITHOUT having lived\n this session \u2014 already produce this?\"\n YES \u2192 it is knowledge the model already carries \u2192 do not emit.\n NO \u2192 it exists only because this session happened \u2192 emit it.\n\nAsymmetric cost: anything that exists ONLY because this session happened is\nunrecoverable once dropped \u2014 not just a decision / dead_end / constraint, but also a\nsession-specific observation, measurement, or stated value. Only what the model\nALREADY carries regenerates for free; a value measured or stated here is not that.\nWhen unsure \u2192 keep.\n\nConsulting the agent's own memory is not such a happening. A statement whose subject\nis that MEMORY itself \u2014 that what is already stored is complete, was reviewed, or that\nreading it changed nothing \u2014 is not residue, even though the reading occurred this\nsession; reading memory is not an action in the work. Emit only what the work produced\nabout ITS subject, never the agent's reading of what it had already stored.\n\nA conclusion's EVIDENCE is residue too \u2014 the observation, measurement, or result it\nis reasoned from. Keep it as its own block and ground the conclusion to it\n(based_on / supports); a conclusion saved without what it rests on is\nhalf the record. Keep that evidence EVEN when nothing links to it yet \u2014 a later\nsession grounds it; never drop a session-specific observation for lack of a link.\n\nDo not emit:\n \u2022 an option that was only RAISED in thought \u2014 never chosen, entered, or acted on.\n \u2022 a bare sequence of steps carrying no reason that nothing rests on \u2014 the WHEN with\n no WHY. (A step or value a conclusion is reasoned from is not bare \u2014 keep it.)\n\nIf the same claim appears more than once in the session (e.g. restated in a recap),\nwrite it once, using its most complete statement.\n\nIf the session holds no residue at all \u2014 pure procedure, scaffolding, or chatter \u2014\nwrite nothing. An empty result is correct when nothing here could only have come\nfrom this session.\n\nEvery block carries keep_reason: one line, from the session, naming what makes it\nresidue (it was chosen / entered-then-abandoned / imposed / measured / asserted by\na party), or why you kept it when it was borderline.\n\nEvery block also carries type_reasoning: one line stating why THIS type's epistemic\nrole fits \u2014 what distinguishes it from the neighbouring types, judged by the role the\nblock plays for a future reader, not by surface wording. Decide this before you commit\nthe type.\n\n\u2500\u2500 STEP 1 \u2014 SEGMENT into GROUPS (clusters under a root) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nFIRST split the session into GROUPS. A group is one coherent sub-thread \u2014 a single\nproblem worked, question pursued, or thing decided. KEEP DISTINCT SUB-THREADS AS\nSEPARATE GROUPS even when they belong to the same overall project; one sub-thread\nscattered across the session is one group. Judge by what the participants were\ntrying to do, not by topic words. Do NOT collapse several sub-threads into one big\ngroup \u2014 keep them fine-grained.\n\nTHEN assign each group a provisional_project \u2014 the ONE overarching ROOT it belongs\nto. The ROOT is the project; the GROUP is a CLUSTER under it; ONE root has MANY\nclusters. Sub-threads of the same overall effort SHARE a root but STAY SEPARATE\nGROUPS \u2014 same root, several clusters; do NOT merge them into one group.\n \u2022 Use a DIFFERENT provisional_project ONLY for a genuinely separate topic \u2014 a\n real context-switch or an unrelated tangent.\n \u2022 A separate root must have a NAMEABLE SUBJECT: you must be able to say what the\n group's work is ABOUT without referring to the speaker's own remembering,\n reasoning, or composing of replies in this conversation. Recalling, weighing,\n and planning how to respond are the MEANS of every conversation, never a topic\n of their own \u2014 claims born of that procedure belong under the root of the work\n they serve (and only those that pass the residue test above).\n \u2022 When unsure whether two groups share a root, prefer the SAME root \u2014 splitting\n one topic across many roots (fragmentation) is worse than a slightly-broad root.\n \u2022 NAME the root with the most SPECIFIC identifier the session gives the SUBJECT the\n work is ABOUT \u2014 named as specifically as the session itself names it. NEVER a\n generic category word, a placeholder, or the group_id. If nothing that specific is\n named, use the clearest phrase for what the work is about \u2014 never a bare\n \"group\"/number. lowercase, hyphens only, no underscores. provisional_project must\n always be filled.\nThis is provisional; cross-SESSION matching to existing roots happens later.\n\n\u2500\u2500 STEP 2 \u2014 within each group, write TYPED blocks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nA type is the agent's RELATIONSHIP to the knowledge, not its subject matter \u2014 the\nsame type spans every domain. For each piece of residue, reason about which\nrelationship fits, then FILL THAT TYPE'S unique{} FIELDS \u2014 this is the block's\nstructured identity and is REQUIRED, never empty. Put the actual content there\n(the choice + reason, the value, the limit, the approach + why it failed), in the\nsession's own language. essence is only a one-line SUMMARY of those fields \u2014 it\ndoes not replace them. A block whose unique{} is empty is incomplete; fill every\nfield of the type that the session supports. One passage can carry several\nrelationships \u2192 several blocks.\n\nCORE relationships (consider these first):\n decision {choice, reason, alternatives_rejected} \u2014 the participants CLOSED a\n fork: a path was committed to, adopted, or acted on. The decision is\n the path TAKEN; a path they CLOSED OFF is a dead_end (below), not a\n decision \u2014 even when one passage both settles the choice and rules out\n the alternative. A path one participant PUT FORWARD for another to\n accept leaves the fork open \u2014 that is a blueprint (below), not a\n decision, no matter how strongly it was urged. To type decision you\n must be able to point at WHERE the fork closed, not just where a path\n was proposed. Justify it: link based_on >=1 fact/constraint (Step 3).\n dead_end {approach, reason, alternative} \u2014 an approach CLOSED OFF for a stated\n reason, so a future reader should not re-open it. Covers one tried then\n abandoned AND one evaluated and definitively rejected before trying. A\n path merely floated with no verdict is NOT a dead_end \u2014 the close-off\n must be definite and reasoned.\n constraint {limit, reason, source} \u2014 a boundary that bounds EVERY option and that\n the participants must work within. May be imposed from outside OR set by\n the participants as a fixed limit; what makes it a constraint is that it\n GOVERNS the other choices rather than being one of them.\n fact {value, why_matters} \u2014 a specific observed value or concrete state.\n insight {observation, implication} \u2014 a realization drawn from combining things.\n blueprint {purpose, status, trigger_to_implement} \u2014 a planned or proposed path\n whose outcome is not yet settled: a plan adopted but not yet executed,\n OR a path put forward that no one has yet accepted. The fork is still\n open; when it later closes, a decision supersedes this.\n preference {lean, over, condition} \u2014 a standing lean that shapes future choices,\n short of a committed decision.\n question {question, why_matters} \u2014 left genuinely open, with no path forward.\n\nWhen the level of commitment is unclear, type the LESS-committed role (blueprint\nover decision, preference over constraint): the residue is still captured, and a\nlater session promotes it (a decision supersedes its blueprint). A false decision\nmisleads every future reader into treating an open fork as closed.\n\nOTHER roles, with their REQUIRED fields (fill these exact field names), when none of\nthe above fits:\n hypothesis {proposal, evidence_against} \u2014 a claim offered as possibly true but\n NOT yet verified: reasoned TOWARD, not asserted as established. What it\n rests on is recorded as its OWN block and linked (based_on), not\n restated here; evidence_against is only what would weigh against it.\n entity {name, role} \u2014 a thing the work REFERS TO by name, not a claim about it;\n identity is the name, role is the part it plays in the work.\n task {status, description, owner} \u2014 work still TO BE DONE, tracked by its state\n of completion and who holds it.\n event {what_happened, outcome, date} \u2014 a thing that OCCURRED at a point in time,\n as opposed to a standing truth that simply holds.\n note {} \u2014 no field schema; the catch-all, only when no sharper role fits.\nIf a genuinely distinct epistemic role STILL fits none of these, name the type and\ninclude schema{} (field -> what it captures).\n\nEach block also carries: essence (one sentence, <=120 chars \u2014 what it is and why\nit matters), concepts (a few terms naming what it is about), provisional_name (a\nshort slug for the thing \u2014 provisional, not a final label), provenance, keep_reason.\n\n\u2500\u2500 STEP 3 \u2014 WIRE the relationships WITHIN each group \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nWhere the session shows one block standing in a real relationship to another \u2014\none thing led to another, justified it, replaced it, answered it, elaborates it,\nprovides evidence for it, or conflicts with it \u2014 record that link. Infer it from\nwhat happened, whether or not any connecting word is present.\n\nEach link is {from, to, type}, where \"from\" holds the relationship. Choose the\ntype whose MEANING matches:\n prompted_by \u2014 from happened as a consequence of to (to is the trigger)\n based_on \u2014 from is a conclusion grounded in to (evidence)\n extends \u2014 from is a more specific case of to (broader)\n supersedes \u2014 from replaces an earlier to\n resolves \u2014 from answers the open question to\n supports \u2014 from is evidence for the proposal to\n contradicts \u2014 from and to conflict\n related_to \u2014 from and to are associated, with no sharper relationship\n derived_from \u2014 from was reasoned out from to\n affects \u2014 from has an impact on to\n\nReach for the SHARPEST relation the meaning supports. related_to and affects are the\nWEAKEST \u2014 a last resort, used ONLY when no grounding, consequence, replacement, or\nanswer actually holds.\n\nEvery block sits in a HISTORY \u2014 wire each way it connects BACKWARD to what came\nbefore, not only its evidence:\n - what it was REASONED FROM: the observation, measurement, or result a later\n realization, boundary, choice, or lean rests on (based_on / supports / derived_from);\n - what it REPLACED: an earlier approach, value, or state this makes obsolete. The\n earlier block stays as history and MUST be linked FROM the newer one (supersedes) \u2014\n never leave a superseded block standing as if nothing replaced it;\n - what TRIGGERED it: the event, failure, or need it arose as a consequence of\n (prompted_by);\n - the open QUESTION it answers (resolves).\nThe trap to avoid, for ANY block type: a block that REPLACED or was TRIGGERED BY\nanother, but is wired only to its supporting evidence, leaves that other block\nORPHANED \u2014 you recorded why it is justified but dropped what it displaced or\nresponded to. Both are how the state was reached; wire both.\n\nThe link type MUST be exactly one of these ten relations \u2014 never invent one, and\nnever use a block's unique{} field name as a link type. A detail that belongs to a\nsingle block (a decision's rejected alternatives, a constraint's source, and the\nlike) is recorded INSIDE that block's own fields \u2014 never as a link, and never as a\nseparate block created only so something can link to it.\n\nEvery decision \u2014 and every hypothesis or insight that rests on a finding \u2014 needs >=1\nbased_on to the observation it is reasoned from. If that evidence is genuinely not in\nthis session, mark the block uncertain \u2014 never supply the evidence yourself.\n\nStay within this session: do not assign final names, do not match against any\nexisting memory, do not link across groups. Those are later stages.";
118
+ export declare const COMPREHEND_SCHEMA: {
119
+ type: string;
120
+ properties: {
121
+ groups: {
122
+ type: string;
123
+ items: {
124
+ type: string;
125
+ properties: {
126
+ group_id: {
127
+ type: string;
128
+ };
129
+ topic: {
130
+ type: string;
131
+ };
132
+ provisional_project: {
133
+ type: string;
134
+ };
135
+ blocks: {
136
+ type: string;
137
+ items: {
138
+ type: string;
139
+ properties: {
140
+ local_id: {
141
+ type: string;
142
+ };
143
+ type: {
144
+ type: string;
145
+ };
146
+ unique: {
147
+ type: string;
148
+ description: string;
149
+ };
150
+ schema: {
151
+ type: string;
152
+ };
153
+ essence: {
154
+ type: string;
155
+ };
156
+ concepts: {
157
+ type: string;
158
+ items: {
159
+ type: string;
160
+ };
161
+ };
162
+ provisional_name: {
163
+ type: string;
164
+ };
165
+ provenance: {
166
+ type: string;
167
+ };
168
+ keep_reason: {
169
+ type: string;
170
+ };
171
+ type_reasoning: {
172
+ type: string;
173
+ };
174
+ uncertain: {
175
+ type: string;
176
+ };
177
+ };
178
+ required: string[];
179
+ };
180
+ };
181
+ within_group_links: {
182
+ type: string;
183
+ items: {
184
+ type: string;
185
+ properties: {
186
+ from: {
187
+ type: string;
188
+ };
189
+ to: {
190
+ type: string;
191
+ };
192
+ type: {
193
+ type: string;
194
+ };
195
+ reasoning: {
196
+ type: string;
197
+ };
198
+ };
199
+ required: string[];
200
+ };
201
+ };
202
+ };
203
+ required: string[];
204
+ };
205
+ };
206
+ reasoning: {
207
+ type: string;
208
+ };
209
+ };
210
+ required: string[];
211
+ };
212
+ /** Single source for all three COMPREHEND-path callers (here, per-group, cross-link). */
213
+ export declare function comprehendModel(): string | undefined;
214
+ export interface ComprehendCallResult {
215
+ result: ComprehendResult | null;
216
+ validation: ComprehendValidation | null;
217
+ rateLimited: boolean;
218
+ creditExhausted?: boolean;
219
+ model?: string;
220
+ attempts?: Array<{
221
+ model: string;
222
+ outcome: string;
223
+ }>;
224
+ usage?: {
225
+ input: number;
226
+ thinking: number;
227
+ output: number;
228
+ };
229
+ }
230
+ /**
231
+ * Run the single COMPREHEND read over a session transcript. Graph-blind: input is
232
+ * the raw transcript ONLY (the caller assembles user+agent turns — the all-sources
233
+ * lesson). Validates via SEAM 1 but does not throw or mutate global token stats —
234
+ * the caller decides retry/quarantine and attributes cost.
235
+ */
236
+ export declare function callComprehendLLM(provider: LLMProvider, transcript: string, thinkingBudget?: number): Promise<ComprehendCallResult>;
237
+ //# sourceMappingURL=comprehend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comprehend.d.ts","sourceRoot":"","sources":["../../../src/middleware/reflect/comprehend.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK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