hippo-memory 2.3.0 → 3.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 (2605) hide show
  1. package/README.md +9 -6
  2. package/dist/api/agent-memories.d.ts +21 -0
  3. package/dist/api/agent-memories.js +97 -0
  4. package/dist/api/assemble.d.ts +16 -15
  5. package/dist/api/assemble.js +90 -62
  6. package/dist/api/auth/audit.d.ts +31 -24
  7. package/dist/api/auth/audit.js +49 -27
  8. package/dist/api/auth/auth.d.ts +33 -29
  9. package/dist/api/auth/auth.js +88 -42
  10. package/dist/api/auth/quarantine.d.ts +8 -6
  11. package/dist/api/auth/quarantine.js +14 -9
  12. package/dist/api/auth/session-owners.d.ts +5 -9
  13. package/dist/api/auth/session-owners.js +9 -24
  14. package/dist/api/availability.d.ts +11 -10
  15. package/dist/api/availability.js +24 -24
  16. package/dist/api/callers.d.ts +34 -0
  17. package/dist/api/callers.js +20 -0
  18. package/dist/api/context/context-auto.d.ts +5 -0
  19. package/dist/api/context/context-auto.js +35 -0
  20. package/dist/api/context/context-plan.d.ts +59 -0
  21. package/dist/api/context/context-plan.js +165 -0
  22. package/dist/api/context/context-pools.d.ts +29 -0
  23. package/dist/api/context/context-pools.js +138 -0
  24. package/dist/api/context/context-project.d.ts +15 -0
  25. package/dist/api/context/context-project.js +17 -0
  26. package/dist/api/context/context-render.d.ts +66 -0
  27. package/dist/api/context/context-render.js +285 -0
  28. package/dist/api/context/context-search.d.ts +14 -0
  29. package/dist/api/context/context-search.js +144 -0
  30. package/dist/api/context/context-select.d.ts +21 -0
  31. package/dist/api/context/context-select.js +194 -0
  32. package/dist/api/context/context-task-state.d.ts +23 -0
  33. package/dist/api/context/context-task-state.js +107 -0
  34. package/dist/api/context/context-types.d.ts +116 -0
  35. package/dist/api/context/context-types.js +3 -0
  36. package/dist/api/context/context.d.ts +14 -0
  37. package/dist/api/context/context.js +196 -0
  38. package/dist/api/continuity/continuity-json.d.ts +36 -0
  39. package/dist/api/continuity/continuity-json.js +35 -0
  40. package/dist/api/continuity/continuity.d.ts +15 -0
  41. package/dist/api/continuity/continuity.js +15 -0
  42. package/dist/api/correction-latency.d.ts +5 -5
  43. package/dist/api/correction-latency.js +9 -31
  44. package/dist/api/cursor.d.ts +10 -0
  45. package/dist/api/cursor.js +46 -0
  46. package/dist/api/dashboard/detail.d.ts +29 -0
  47. package/dist/api/dashboard/detail.js +97 -0
  48. package/dist/api/dashboard/live.d.ts +22 -0
  49. package/dist/api/dashboard/live.js +33 -0
  50. package/dist/api/dashboard/overview.d.ts +8 -0
  51. package/dist/api/dashboard/overview.js +180 -0
  52. package/dist/api/dashboard/queries.d.ts +34 -0
  53. package/dist/api/dashboard/queries.js +89 -0
  54. package/dist/api/dashboard/snapshot-clock.d.ts +20 -0
  55. package/dist/api/dashboard/snapshot-clock.js +38 -0
  56. package/dist/api/dashboard/types.d.ts +166 -0
  57. package/dist/api/dashboard/types.js +3 -0
  58. package/dist/api/delivery/delivery-event.d.ts +24 -0
  59. package/dist/api/delivery/delivery-event.js +173 -0
  60. package/dist/api/delivery/delivery-observation.d.ts +56 -0
  61. package/dist/api/delivery/delivery-observation.js +153 -0
  62. package/dist/api/delivery/delivery-recorder.d.ts +105 -0
  63. package/dist/api/delivery/delivery-recorder.js +58 -0
  64. package/dist/api/detached.d.ts +6 -0
  65. package/dist/api/detached.js +16 -0
  66. package/dist/api/embeddings.d.ts +16 -13
  67. package/dist/api/embeddings.js +22 -16
  68. package/dist/api/error-reply.d.ts +2 -2
  69. package/dist/api/error-reply.js +15 -13
  70. package/dist/api/index.d.ts +38 -33
  71. package/dist/api/index.js +22 -17
  72. package/dist/api/infra.d.ts +11 -0
  73. package/dist/api/infra.js +21 -0
  74. package/dist/api/instruction-detect.d.ts +12 -2
  75. package/dist/api/instruction-detect.js +36 -17
  76. package/dist/api/ledger-db.d.ts +53 -20
  77. package/dist/api/ledger-db.js +87 -31
  78. package/dist/api/memories/conflicts.d.ts +34 -16
  79. package/dist/api/memories/conflicts.js +103 -52
  80. package/dist/api/memories/forget.d.ts +29 -17
  81. package/dist/api/memories/forget.js +49 -25
  82. package/dist/api/memories/memories.d.ts +15 -17
  83. package/dist/api/memories/memories.js +26 -23
  84. package/dist/api/memories/outcome.d.ts +11 -13
  85. package/dist/api/memories/outcome.js +13 -21
  86. package/dist/api/memories/pin.d.ts +6 -0
  87. package/dist/api/memories/pin.js +14 -0
  88. package/dist/api/memories/promote.d.ts +18 -20
  89. package/dist/api/memories/promote.js +88 -42
  90. package/dist/api/memories/refine.d.ts +5 -5
  91. package/dist/api/memories/refine.js +8 -4
  92. package/dist/api/memories/remember-local.d.ts +27 -19
  93. package/dist/api/memories/remember-local.js +58 -60
  94. package/dist/api/memories/remember.d.ts +52 -26
  95. package/dist/api/memories/remember.js +124 -44
  96. package/dist/api/memories/session-digest.d.ts +45 -0
  97. package/dist/api/memories/session-digest.js +96 -0
  98. package/dist/api/memories/trace.d.ts +29 -0
  99. package/dist/api/memories/trace.js +53 -0
  100. package/dist/api/objects/drill-down.d.ts +16 -11
  101. package/dist/api/objects/drill-down.js +35 -29
  102. package/dist/api/objects/goals.d.ts +10 -7
  103. package/dist/api/objects/goals.js +4 -3
  104. package/dist/api/objects/graph.d.ts +20 -7
  105. package/dist/api/objects/graph.js +25 -7
  106. package/dist/api/objects/object-kinds.d.ts +44 -0
  107. package/dist/api/objects/object-kinds.js +77 -0
  108. package/dist/api/objects/objects.d.ts +50 -8
  109. package/dist/api/objects/objects.js +65 -8
  110. package/dist/api/objects/predictions.d.ts +11 -9
  111. package/dist/api/objects/predictions.js +20 -15
  112. package/dist/api/objects/projects.d.ts +20 -15
  113. package/dist/api/objects/projects.js +28 -20
  114. package/dist/api/pages.d.ts +9 -0
  115. package/dist/api/pages.js +23 -0
  116. package/dist/api/pilot-arm.d.ts +5 -5
  117. package/dist/api/pilot-arm.js +7 -11
  118. package/dist/api/prompt-hook.d.ts +46 -56
  119. package/dist/api/prompt-hook.js +150 -151
  120. package/dist/api/provenance-coverage.d.ts +5 -5
  121. package/dist/api/provenance-coverage.js +11 -12
  122. package/dist/api/recall/anchoring.d.ts +63 -0
  123. package/dist/api/recall/anchoring.js +112 -0
  124. package/dist/api/recall/bands.d.ts +21 -0
  125. package/dist/api/recall/bands.js +180 -0
  126. package/dist/api/recall/compose.d.ts +62 -0
  127. package/dist/api/recall/compose.js +198 -0
  128. package/dist/api/recall/finish.d.ts +51 -130
  129. package/dist/api/recall/finish.js +76 -248
  130. package/dist/api/recall/last-recalled.d.ts +13 -0
  131. package/dist/api/recall/last-recalled.js +26 -0
  132. package/dist/api/recall/nearest.d.ts +7 -0
  133. package/dist/api/recall/nearest.js +27 -0
  134. package/dist/api/recall/pipeline.d.ts +95 -49
  135. package/dist/api/recall/pipeline.js +50 -382
  136. package/dist/api/recall/profiles.d.ts +31 -0
  137. package/dist/api/recall/profiles.js +32 -0
  138. package/dist/api/recall/rank-search.d.ts +24 -0
  139. package/dist/api/recall/rank-search.js +188 -0
  140. package/dist/api/recall/rank-stages.d.ts +16 -0
  141. package/dist/api/recall/rank-stages.js +228 -0
  142. package/dist/api/recall/recall.d.ts +9 -5
  143. package/dist/api/recall/recall.js +175 -463
  144. package/dist/api/recall/request.d.ts +25 -14
  145. package/dist/api/recall/request.js +94 -66
  146. package/dist/api/recall/rows.d.ts +58 -32
  147. package/dist/api/recall/rows.js +64 -42
  148. package/dist/api/recall/session-rings.d.ts +59 -0
  149. package/dist/api/recall/session-rings.js +87 -0
  150. package/dist/api/recall/types.d.ts +154 -114
  151. package/dist/api/session-end.d.ts +58 -28
  152. package/dist/api/session-end.js +179 -66
  153. package/dist/api/sharing.d.ts +31 -0
  154. package/dist/api/sharing.js +49 -0
  155. package/dist/api/sleep/auto-sleep.d.ts +17 -10
  156. package/dist/api/sleep/auto-sleep.js +57 -21
  157. package/dist/api/sleep/churn.d.ts +20 -0
  158. package/dist/api/sleep/churn.js +44 -0
  159. package/dist/api/sleep/dedup.d.ts +9 -0
  160. package/dist/api/sleep/dedup.js +11 -0
  161. package/dist/api/sleep/dormant.d.ts +17 -19
  162. package/dist/api/sleep/dormant.js +21 -39
  163. package/dist/api/sleep/events.d.ts +15 -0
  164. package/dist/api/sleep/events.js +2 -0
  165. package/dist/api/sleep/learn.d.ts +16 -9
  166. package/dist/api/sleep/learn.js +125 -55
  167. package/dist/api/sleep/sleep-run.d.ts +18 -23
  168. package/dist/api/sleep/sleep-run.js +185 -126
  169. package/dist/api/sleep/sleep.d.ts +25 -23
  170. package/dist/api/sleep/sleep.js +4 -5
  171. package/dist/api/status.d.ts +21 -15
  172. package/dist/api/status.js +57 -22
  173. package/dist/api/store-init.d.ts +4 -6
  174. package/dist/api/store-init.js +4 -7
  175. package/dist/api/summary-parents.d.ts +6 -0
  176. package/dist/api/summary-parents.js +12 -0
  177. package/dist/api/tokens.d.ts +13 -9
  178. package/dist/api/tokens.js +18 -14
  179. package/dist/api/types.d.ts +95 -31
  180. package/dist/api/types.js +42 -14
  181. package/dist/base/config/config-keys.d.ts +6 -0
  182. package/dist/base/config/config-keys.js +140 -0
  183. package/dist/base/config/config-rules.d.ts +29 -0
  184. package/dist/base/config/config-rules.js +81 -0
  185. package/dist/base/config/config.d.ts +202 -0
  186. package/dist/base/config/config.js +104 -0
  187. package/dist/base/config/configured-folder.d.ts +10 -0
  188. package/dist/base/config/configured-folder.js +2 -0
  189. package/dist/base/config/package-root.d.ts +6 -0
  190. package/dist/base/config/package-root.js +8 -0
  191. package/dist/base/embeddings/index-identity.d.ts +23 -0
  192. package/dist/base/embeddings/index-identity.js +33 -0
  193. package/dist/base/embeddings/local.d.ts +14 -0
  194. package/dist/base/embeddings/local.js +55 -0
  195. package/dist/base/errors/api-errors.d.ts +59 -0
  196. package/dist/base/errors/api-errors.js +77 -0
  197. package/dist/base/errors/failed-unit.d.ts +9 -0
  198. package/dist/base/errors/failed-unit.js +13 -0
  199. package/dist/base/errors/http-errors.d.ts +24 -0
  200. package/dist/base/errors/http-errors.js +32 -0
  201. package/dist/base/errors/raw-append-only.d.ts +13 -0
  202. package/dist/base/errors/raw-append-only.js +20 -0
  203. package/dist/base/errors/store-open.d.ts +7 -0
  204. package/dist/base/errors/store-open.js +11 -0
  205. package/dist/base/memory/agent-memory-report.d.ts +57 -0
  206. package/dist/base/memory/agent-memory-report.js +136 -0
  207. package/dist/base/memory/agent-memory-tools.d.ts +44 -0
  208. package/dist/base/memory/agent-memory-tools.js +37 -0
  209. package/dist/base/memory/ambient.d.ts +56 -0
  210. package/dist/base/memory/ambient.js +215 -0
  211. package/dist/base/memory/conflict-wire.d.ts +26 -0
  212. package/dist/base/memory/conflict-wire.js +17 -0
  213. package/dist/base/memory/created-stamp.d.ts +7 -0
  214. package/dist/base/memory/created-stamp.js +19 -0
  215. package/dist/base/memory/dedup-pairs.d.ts +12 -0
  216. package/dist/base/memory/dedup-pairs.js +12 -0
  217. package/dist/base/memory/dormant-revival.d.ts +15 -0
  218. package/dist/base/memory/dormant-revival.js +19 -0
  219. package/dist/base/memory/entry.d.ts +148 -0
  220. package/dist/base/memory/entry.js +243 -0
  221. package/dist/base/memory/eval-switches.d.ts +22 -0
  222. package/dist/base/memory/eval-switches.js +18 -0
  223. package/dist/base/memory/half-life-plan.d.ts +68 -0
  224. package/dist/base/memory/half-life-plan.js +110 -0
  225. package/dist/base/memory/keep-rules.d.ts +19 -0
  226. package/dist/base/memory/keep-rules.js +36 -0
  227. package/dist/base/memory/markdown.d.ts +9 -0
  228. package/dist/base/memory/markdown.js +144 -0
  229. package/dist/base/memory/memory-audit.d.ts +49 -0
  230. package/dist/base/memory/memory-audit.js +142 -0
  231. package/dist/base/memory/memory-facts.d.ts +46 -0
  232. package/dist/base/memory/memory-facts.js +95 -0
  233. package/dist/base/memory/memory-quality.d.ts +50 -0
  234. package/dist/base/memory/memory-quality.js +275 -0
  235. package/dist/base/memory/memory-wire.d.ts +55 -0
  236. package/dist/base/memory/memory-wire.js +93 -0
  237. package/dist/base/memory/merged-row.d.ts +12 -0
  238. package/dist/base/memory/merged-row.js +46 -0
  239. package/dist/base/memory/salience.d.ts +20 -0
  240. package/dist/base/memory/salience.js +109 -0
  241. package/dist/base/memory/strength-bands.d.ts +5 -0
  242. package/dist/base/memory/strength-bands.js +7 -0
  243. package/dist/base/memory/strength.d.ts +82 -0
  244. package/dist/base/memory/strength.js +138 -0
  245. package/dist/base/ports/cross-encoder.d.ts +7 -0
  246. package/dist/base/ports/cross-encoder.js +4 -0
  247. package/dist/base/ports/embedder.d.ts +37 -0
  248. package/dist/base/ports/embedder.js +2 -0
  249. package/dist/base/ports/git.d.ts +30 -0
  250. package/dist/base/ports/git.js +20 -0
  251. package/dist/base/ports/http.d.ts +17 -0
  252. package/dist/base/ports/http.js +3 -0
  253. package/dist/base/ports/infra.d.ts +42 -0
  254. package/dist/base/ports/infra.js +2 -0
  255. package/dist/base/ports/llm.d.ts +44 -0
  256. package/dist/base/ports/llm.js +55 -0
  257. package/dist/base/ports/reranker.d.ts +52 -0
  258. package/dist/base/ports/reranker.js +2 -0
  259. package/dist/base/ports/store/agent-import.d.ts +107 -0
  260. package/dist/base/ports/store/agent-import.js +5 -0
  261. package/dist/base/ports/store/audit.d.ts +89 -0
  262. package/dist/base/ports/store/audit.js +17 -0
  263. package/dist/base/ports/store/capture.d.ts +203 -0
  264. package/dist/base/ports/store/capture.js +23 -0
  265. package/dist/base/ports/store/cards.d.ts +69 -0
  266. package/dist/base/ports/store/cards.js +14 -0
  267. package/dist/base/ports/store/conflicts.d.ts +79 -0
  268. package/dist/base/ports/store/conflicts.js +7 -0
  269. package/dist/base/ports/store/connectors.d.ts +250 -0
  270. package/dist/base/ports/store/connectors.js +22 -0
  271. package/dist/base/ports/store/consolidation.d.ts +246 -0
  272. package/dist/base/ports/store/consolidation.js +19 -0
  273. package/dist/base/ports/store/context-reads.d.ts +172 -0
  274. package/dist/base/ports/store/context-reads.js +15 -0
  275. package/dist/base/ports/store/dashboard-reads.d.ts +152 -0
  276. package/dist/base/ports/store/dashboard-reads.js +6 -0
  277. package/dist/base/ports/store/diagnostics.d.ts +77 -0
  278. package/dist/base/ports/store/diagnostics.js +10 -0
  279. package/dist/base/ports/store/dormant.d.ts +65 -0
  280. package/dist/base/ports/store/dormant.js +18 -0
  281. package/dist/base/ports/store/effects.d.ts +7 -0
  282. package/dist/base/ports/store/effects.js +3 -0
  283. package/dist/base/ports/store/entry-writes.d.ts +97 -0
  284. package/dist/base/ports/store/entry-writes.js +17 -0
  285. package/dist/base/ports/store/folder-files.d.ts +29 -0
  286. package/dist/base/ports/store/folder-files.js +6 -0
  287. package/dist/base/ports/store/goals.d.ts +44 -0
  288. package/dist/base/ports/store/goals.js +11 -0
  289. package/dist/base/ports/store/graph.d.ts +160 -0
  290. package/dist/base/ports/store/graph.js +13 -0
  291. package/dist/base/ports/store/keys.d.ts +120 -0
  292. package/dist/base/ports/store/keys.js +6 -0
  293. package/dist/base/ports/store/learning.d.ts +26 -0
  294. package/dist/base/ports/store/learning.js +8 -0
  295. package/dist/base/ports/store/ledger.d.ts +100 -0
  296. package/dist/base/ports/store/ledger.js +8 -0
  297. package/dist/base/ports/store/objects.d.ts +217 -0
  298. package/dist/base/ports/store/objects.js +10 -0
  299. package/dist/base/ports/store/project-tags.d.ts +118 -0
  300. package/dist/base/ports/store/project-tags.js +11 -0
  301. package/dist/base/ports/store/quarantine.d.ts +75 -0
  302. package/dist/base/ports/store/quarantine.js +8 -0
  303. package/dist/base/ports/store/reach.d.ts +20 -0
  304. package/dist/base/ports/store/reach.js +2 -0
  305. package/dist/base/ports/store/recall-writes.d.ts +93 -0
  306. package/dist/base/ports/store/recall-writes.js +6 -0
  307. package/dist/base/ports/store/rejections.d.ts +134 -0
  308. package/dist/base/ports/store/rejections.js +14 -0
  309. package/dist/base/ports/store/reports.d.ts +139 -0
  310. package/dist/base/ports/store/reports.js +13 -0
  311. package/dist/base/ports/store/sessions.d.ts +203 -0
  312. package/dist/base/ports/store/sessions.js +9 -0
  313. package/dist/base/ports/store/sharing.d.ts +88 -0
  314. package/dist/base/ports/store/sharing.js +15 -0
  315. package/dist/base/ports/store/store-effects.d.ts +272 -0
  316. package/dist/base/ports/store/store-effects.js +87 -0
  317. package/dist/base/ports/store/types.d.ts +142 -0
  318. package/dist/base/ports/store/types.js +10 -0
  319. package/dist/base/ports/store/vectors.d.ts +240 -0
  320. package/dist/base/ports/store/vectors.js +20 -0
  321. package/dist/base/ports/store-groups.d.ts +30 -0
  322. package/dist/base/ports/store-groups.js +2 -0
  323. package/dist/base/ports/store-index.d.ts +11 -0
  324. package/dist/base/ports/store-index.js +2 -0
  325. package/dist/base/ports/store.d.ts +214 -0
  326. package/dist/base/ports/store.js +71 -0
  327. package/dist/base/rank/active-scope.d.ts +4 -0
  328. package/dist/base/rank/active-scope.js +14 -0
  329. package/dist/base/rank/compare.d.ts +47 -0
  330. package/dist/base/rank/compare.js +85 -0
  331. package/dist/base/rank/cosine.d.ts +12 -0
  332. package/dist/base/rank/cosine.js +60 -0
  333. package/dist/base/rank/particle-refresh.d.ts +9 -0
  334. package/dist/base/rank/particle-refresh.js +22 -0
  335. package/dist/base/rank/physics-config.d.ts +37 -0
  336. package/dist/base/rank/physics-config.js +29 -0
  337. package/dist/base/rank/physics.d.ts +110 -0
  338. package/dist/base/rank/physics.js +319 -0
  339. package/dist/base/rank/prompt-recall.d.ts +36 -0
  340. package/dist/base/rank/prompt-recall.js +72 -0
  341. package/dist/base/rank/recall-defaults.d.ts +7 -0
  342. package/dist/base/rank/recall-defaults.js +9 -0
  343. package/dist/base/rank/search-types.d.ts +125 -0
  344. package/dist/base/rank/search-types.js +28 -0
  345. package/dist/base/records/audit-ops.d.ts +3 -0
  346. package/dist/base/records/audit-ops.js +72 -0
  347. package/dist/base/records/audit-report.d.ts +15 -0
  348. package/dist/base/records/audit-report.js +31 -0
  349. package/dist/base/records/card.d.ts +51 -0
  350. package/dist/base/records/card.js +37 -0
  351. package/dist/base/records/entity-name.d.ts +2 -0
  352. package/dist/base/records/entity-name.js +4 -0
  353. package/dist/base/records/failure-log-retention.d.ts +4 -0
  354. package/dist/base/records/failure-log-retention.js +4 -0
  355. package/dist/base/records/failure-repeats.d.ts +17 -0
  356. package/dist/base/records/failure-repeats.js +22 -0
  357. package/dist/base/records/object-types.d.ts +208 -0
  358. package/dist/base/records/object-types.js +7 -0
  359. package/dist/base/records/planning-fallacy.d.ts +33 -0
  360. package/dist/base/records/planning-fallacy.js +3 -0
  361. package/dist/base/records/prediction.d.ts +10 -0
  362. package/dist/base/records/prediction.js +22 -0
  363. package/dist/base/records/rejection-digest.d.ts +7 -0
  364. package/dist/base/records/rejection-digest.js +14 -0
  365. package/dist/base/records/rejection-text.d.ts +16 -0
  366. package/dist/base/records/rejection-text.js +27 -0
  367. package/dist/base/scope/actor.d.ts +2 -0
  368. package/dist/base/scope/actor.js +3 -0
  369. package/dist/base/scope/api-key.d.ts +58 -0
  370. package/dist/base/scope/api-key.js +122 -0
  371. package/dist/base/scope/project-identity.d.ts +44 -0
  372. package/dist/base/scope/project-identity.js +52 -0
  373. package/dist/base/scope/read-admission.d.ts +43 -0
  374. package/dist/base/scope/read-admission.js +52 -0
  375. package/dist/base/scope/recall-scope.d.ts +136 -0
  376. package/dist/base/scope/recall-scope.js +213 -0
  377. package/dist/base/scope/tenant-id.d.ts +6 -0
  378. package/dist/base/scope/tenant-id.js +14 -0
  379. package/dist/base/session/capture-contract.d.ts +82 -0
  380. package/dist/base/session/capture-contract.js +174 -0
  381. package/dist/base/session/compaction-timing.js +10 -0
  382. package/dist/base/session/delivery.d.ts +68 -0
  383. package/dist/base/session/delivery.js +8 -0
  384. package/dist/base/session/handoff.d.ts +56 -0
  385. package/dist/base/session/handoff.js +73 -0
  386. package/dist/base/session/pilot-arm.d.ts +4 -0
  387. package/dist/base/session/pilot-arm.js +12 -0
  388. package/dist/base/session/session-digest-row.d.ts +9 -0
  389. package/dist/base/session/session-digest-row.js +15 -0
  390. package/dist/base/session/session-snapshot.d.ts +16 -0
  391. package/dist/base/session/session-snapshot.js +28 -0
  392. package/dist/base/session/skip-unchanged.d.ts +12 -0
  393. package/dist/base/session/skip-unchanged.js +11 -0
  394. package/dist/base/session/transcript-calls.d.ts +25 -0
  395. package/dist/base/session/transcript-calls.js +10 -0
  396. package/dist/base/session/working-state.d.ts +46 -0
  397. package/dist/base/session/working-state.js +83 -0
  398. package/dist/base/util/agent-files.d.ts +40 -0
  399. package/dist/base/util/agent-files.js +4 -0
  400. package/dist/base/util/agent-homes.d.ts +46 -0
  401. package/dist/base/util/agent-homes.js +44 -0
  402. package/dist/base/util/chunked.d.ts +6 -0
  403. package/dist/base/util/chunked.js +11 -0
  404. package/dist/base/util/code-point-cut.d.ts +4 -0
  405. package/dist/base/util/code-point-cut.js +15 -0
  406. package/dist/base/util/compaction-items.d.ts +30 -0
  407. package/dist/base/util/compaction-items.js +152 -0
  408. package/dist/base/util/crash-handlers.d.ts +19 -0
  409. package/dist/base/util/crash-handlers.js +92 -0
  410. package/dist/base/util/detached-set.d.ts +8 -0
  411. package/dist/base/util/detached-set.js +35 -0
  412. package/dist/base/util/env.d.ts +116 -0
  413. package/dist/base/util/env.js +293 -0
  414. package/dist/base/util/escape.js +11 -0
  415. package/dist/base/util/expected-errors.d.ts +10 -0
  416. package/dist/base/util/expected-errors.js +31 -0
  417. package/dist/base/util/failure-notices.d.ts +15 -0
  418. package/dist/base/util/failure-notices.js +29 -0
  419. package/dist/base/util/format.d.ts +7 -0
  420. package/dist/base/util/format.js +14 -0
  421. package/dist/base/util/home-path.d.ts +6 -0
  422. package/dist/base/util/home-path.js +80 -0
  423. package/dist/base/util/hook-payload.d.ts +12 -0
  424. package/dist/base/util/hook-payload.js +35 -0
  425. package/dist/base/util/json.d.ts +28 -0
  426. package/dist/base/util/json.js +42 -0
  427. package/dist/base/util/keyset.d.ts +14 -0
  428. package/dist/base/util/keyset.js +10 -0
  429. package/dist/base/util/limits.d.ts +20 -0
  430. package/dist/base/util/limits.js +50 -0
  431. package/dist/base/util/log.d.ts +72 -0
  432. package/dist/base/util/log.js +217 -0
  433. package/dist/base/util/lru.d.ts +12 -0
  434. package/dist/base/util/lru.js +33 -0
  435. package/dist/base/util/net.d.ts +16 -0
  436. package/dist/base/util/net.js +49 -0
  437. package/dist/base/util/pages.d.ts +19 -0
  438. package/dist/base/util/pages.js +31 -0
  439. package/dist/base/util/prng.d.ts +9 -0
  440. package/dist/base/util/prng.js +19 -0
  441. package/dist/base/util/request-scope.d.ts +40 -0
  442. package/dist/base/util/request-scope.js +58 -0
  443. package/dist/base/util/same-text.d.ts +28 -0
  444. package/dist/base/util/same-text.js +69 -0
  445. package/dist/base/util/secret-detect.d.ts +40 -0
  446. package/dist/base/util/secret-detect.js +157 -0
  447. package/dist/base/util/serial-queue.d.ts +6 -0
  448. package/dist/base/util/serial-queue.js +23 -0
  449. package/dist/base/util/stats.d.ts +7 -0
  450. package/dist/base/util/stats.js +12 -0
  451. package/dist/base/util/stopwords.d.ts +15 -0
  452. package/dist/base/util/stopwords.js +313 -0
  453. package/dist/base/util/store-blocked.d.ts +24 -0
  454. package/dist/base/util/store-blocked.js +42 -0
  455. package/dist/base/util/stored-json.d.ts +21 -0
  456. package/dist/base/util/stored-json.js +32 -0
  457. package/dist/base/util/tenant.d.ts +8 -0
  458. package/dist/base/util/tenant.js +9 -0
  459. package/dist/base/util/thread-reply.d.ts +18 -0
  460. package/dist/base/util/thread-reply.js +26 -0
  461. package/dist/base/util/time.d.ts +10 -0
  462. package/dist/base/util/time.js +11 -0
  463. package/dist/base/util/token-text.d.ts +22 -0
  464. package/dist/base/util/token-text.js +35 -0
  465. package/dist/base/util/tokenize.d.ts +6 -0
  466. package/dist/base/util/tokenize.js +24 -0
  467. package/dist/base/util/vector-codec.js +15 -0
  468. package/dist/base/util/version.d.ts +17 -0
  469. package/dist/base/util/version.js +32 -0
  470. package/dist/base/util/write-budget.d.ts +23 -0
  471. package/dist/base/util/write-budget.js +21 -0
  472. package/dist/base/util/yaml.d.ts +13 -0
  473. package/dist/base/util/yaml.js +137 -0
  474. package/dist/cli.d.ts +1 -1
  475. package/dist/cli.js +81 -51
  476. package/dist/db/backup.d.ts +2 -1
  477. package/dist/db/backup.js +5 -3
  478. package/dist/db/busy.d.ts +13 -11
  479. package/dist/db/busy.js +44 -21
  480. package/dist/db/connect.d.ts +21 -9
  481. package/dist/db/connect.js +73 -42
  482. package/dist/db/continuity-tables.d.ts +10 -0
  483. package/dist/db/continuity-tables.js +100 -0
  484. package/dist/db/decay-key.d.ts +20 -0
  485. package/dist/db/decay-key.js +24 -0
  486. package/dist/db/fts-index.d.ts +13 -0
  487. package/dist/db/fts-index.js +47 -0
  488. package/dist/db/grant.d.ts +35 -0
  489. package/dist/db/grant.js +78 -0
  490. package/dist/db/held-writes.d.ts +12 -0
  491. package/dist/db/held-writes.js +77 -0
  492. package/dist/db/index.d.ts +8 -6
  493. package/dist/db/index.js +5 -5
  494. package/dist/db/meta.d.ts +23 -2
  495. package/dist/db/meta.js +43 -19
  496. package/dist/db/migrate.d.ts +29 -16
  497. package/dist/db/migrate.js +142 -69
  498. package/dist/db/migrations/index.d.ts +3 -2
  499. package/dist/db/migrations/index.js +13 -2
  500. package/dist/db/migrations/types.d.ts +3 -3
  501. package/dist/db/migrations/v11.js +2 -1
  502. package/dist/db/migrations/v14.js +7 -7
  503. package/dist/db/migrations/v15.js +8 -8
  504. package/dist/db/migrations/v16.js +7 -7
  505. package/dist/db/migrations/v19.js +3 -4
  506. package/dist/db/migrations/v20.js +10 -19
  507. package/dist/db/migrations/v21.js +2 -2
  508. package/dist/db/migrations/v22.js +7 -8
  509. package/dist/db/migrations/v23.js +6 -6
  510. package/dist/db/migrations/v24.js +5 -5
  511. package/dist/db/migrations/v25.js +7 -7
  512. package/dist/db/migrations/v26.js +4 -4
  513. package/dist/db/migrations/v27.js +5 -6
  514. package/dist/db/migrations/v28.js +6 -6
  515. package/dist/db/migrations/v29.js +4 -4
  516. package/dist/db/migrations/v30.js +7 -7
  517. package/dist/db/migrations/v31.js +6 -6
  518. package/dist/db/migrations/v32.js +9 -9
  519. package/dist/db/migrations/v33.js +4 -4
  520. package/dist/db/migrations/v34.js +4 -4
  521. package/dist/db/migrations/v35.js +7 -7
  522. package/dist/db/migrations/v36.js +7 -7
  523. package/dist/db/migrations/v37.js +17 -17
  524. package/dist/db/migrations/v38.js +12 -12
  525. package/dist/db/migrations/v39.js +15 -18
  526. package/dist/db/migrations/v40.js +4 -4
  527. package/dist/db/migrations/v41.js +4 -4
  528. package/dist/db/migrations/v42.js +4 -4
  529. package/dist/db/migrations/v44.js +4 -4
  530. package/dist/db/migrations/v45.js +4 -4
  531. package/dist/db/migrations/v46.js +2 -2
  532. package/dist/db/migrations/v47.js +2 -2
  533. package/dist/db/migrations/v48.js +18 -3
  534. package/dist/db/migrations/v49.js +3 -3
  535. package/dist/db/migrations/v50.js +3 -4
  536. package/dist/db/migrations/v51.js +3 -4
  537. package/dist/db/migrations/v52.js +2 -2
  538. package/dist/db/migrations/v53.js +5 -5
  539. package/dist/db/migrations/v54.js +44 -5
  540. package/dist/db/migrations/v56.js +5 -5
  541. package/dist/db/migrations/v57.d.ts +3 -0
  542. package/dist/db/migrations/v57.js +11 -0
  543. package/dist/db/migrations/v58.d.ts +3 -0
  544. package/dist/db/migrations/v58.js +14 -0
  545. package/dist/db/migrations/v59.d.ts +3 -0
  546. package/dist/db/migrations/v59.js +18 -0
  547. package/dist/db/migrations/v60.d.ts +3 -0
  548. package/dist/db/migrations/v60.js +14 -0
  549. package/dist/db/migrations/v61.d.ts +3 -0
  550. package/dist/db/migrations/v61.js +48 -0
  551. package/dist/db/open.d.ts +26 -47
  552. package/dist/db/open.js +28 -90
  553. package/dist/db/physics-state.d.ts +29 -14
  554. package/dist/db/physics-state.js +57 -38
  555. package/dist/db/raw-archive-mirror-cleanup.d.ts +5 -5
  556. package/dist/db/raw-archive-mirror-cleanup.js +8 -9
  557. package/dist/db/request-stores.d.ts +27 -41
  558. package/dist/db/request-stores.js +96 -86
  559. package/dist/db/required-objects.d.ts +6 -0
  560. package/dist/db/required-objects.js +17 -0
  561. package/dist/db/sql-predicates.d.ts +8 -0
  562. package/dist/db/sql-predicates.js +12 -0
  563. package/dist/db/sql.d.ts +19 -0
  564. package/dist/db/sql.js +23 -0
  565. package/dist/db/sqlite-blocked.d.ts +13 -0
  566. package/dist/db/sqlite-blocked.js +22 -0
  567. package/dist/db/sqlite.d.ts +12 -1
  568. package/dist/db/sqlite.js +4 -4
  569. package/dist/db/statement-cache.d.ts +6 -0
  570. package/dist/db/statement-cache.js +26 -0
  571. package/dist/db/store-runtime.d.ts +52 -0
  572. package/dist/db/store-runtime.js +149 -0
  573. package/dist/db/tables.d.ts +6 -3
  574. package/dist/db/tables.js +9 -10
  575. package/dist/db/vector-graph-build.d.ts +21 -0
  576. package/dist/db/vector-graph-build.js +141 -0
  577. package/dist/db/vector-graph-file.d.ts +51 -0
  578. package/dist/db/vector-graph-file.js +264 -0
  579. package/dist/db/vector-graph-index.d.ts +24 -0
  580. package/dist/db/vector-graph-index.js +260 -0
  581. package/dist/db/vector-graph-reader.d.ts +13 -0
  582. package/dist/db/vector-graph-reader.js +273 -0
  583. package/dist/db/vector-graph-rows.d.ts +79 -0
  584. package/dist/db/vector-graph-rows.js +166 -0
  585. package/dist/db/vector-graph.d.ts +68 -0
  586. package/dist/db/vector-graph.js +289 -0
  587. package/dist/db/vector-match.d.ts +47 -0
  588. package/dist/db/vector-match.js +174 -0
  589. package/dist/db/vector-store.d.ts +30 -31
  590. package/dist/db/vector-store.js +90 -146
  591. package/dist/db/wal-checkpointer.d.ts +13 -7
  592. package/dist/db/wal-checkpointer.js +67 -51
  593. package/dist/domain/agent-memories/apply.d.ts +12 -0
  594. package/dist/domain/agent-memories/apply.js +154 -0
  595. package/dist/domain/agent-memories/claude-code.d.ts +17 -0
  596. package/dist/domain/agent-memories/claude-code.js +188 -0
  597. package/dist/domain/agent-memories/codex.js +70 -0
  598. package/dist/domain/agent-memories/container-steps.d.ts +16 -0
  599. package/dist/domain/agent-memories/container-steps.js +95 -0
  600. package/dist/domain/agent-memories/container-view.d.ts +51 -0
  601. package/dist/domain/agent-memories/container-view.js +86 -0
  602. package/dist/domain/agent-memories/copilot.js +116 -0
  603. package/dist/domain/agent-memories/files.d.ts +14 -0
  604. package/dist/domain/agent-memories/files.js +31 -0
  605. package/dist/domain/agent-memories/folder-store.d.ts +22 -0
  606. package/dist/domain/agent-memories/folder-store.js +54 -0
  607. package/dist/domain/agent-memories/gemini.js +126 -0
  608. package/dist/domain/agent-memories/git.d.ts +10 -0
  609. package/dist/domain/agent-memories/git.js +22 -0
  610. package/dist/domain/agent-memories/handover.d.ts +8 -0
  611. package/dist/domain/agent-memories/handover.js +73 -0
  612. package/dist/domain/agent-memories/keys.d.ts +11 -0
  613. package/dist/domain/agent-memories/keys.js +24 -0
  614. package/dist/domain/agent-memories/legacy.d.ts +19 -0
  615. package/dist/domain/agent-memories/legacy.js +71 -0
  616. package/dist/domain/agent-memories/markdown.d.ts +14 -0
  617. package/dist/domain/agent-memories/markdown.js +135 -0
  618. package/dist/domain/agent-memories/openclaw.js +67 -0
  619. package/dist/domain/agent-memories/plan.d.ts +80 -0
  620. package/dist/domain/agent-memories/plan.js +145 -0
  621. package/dist/domain/agent-memories/project-folds.d.ts +13 -0
  622. package/dist/domain/agent-memories/project-folds.js +42 -0
  623. package/dist/domain/agent-memories/qwen-code.js +59 -0
  624. package/dist/domain/agent-memories/source.d.ts +28 -0
  625. package/dist/domain/agent-memories/source.js +42 -0
  626. package/dist/domain/agent-memories/sync.d.ts +49 -0
  627. package/dist/domain/agent-memories/sync.js +286 -0
  628. package/dist/domain/agent-memories/types.d.ts +62 -0
  629. package/dist/domain/consolidate/conflicts.d.ts +33 -0
  630. package/dist/domain/consolidate/conflicts.js +244 -0
  631. package/dist/domain/consolidate/dag-summary.d.ts +8 -0
  632. package/dist/domain/consolidate/dag-summary.js +38 -0
  633. package/dist/domain/consolidate/dag.d.ts +54 -0
  634. package/dist/domain/consolidate/dag.js +318 -0
  635. package/dist/domain/consolidate/decay.d.ts +18 -0
  636. package/dist/domain/consolidate/decay.js +167 -0
  637. package/dist/domain/consolidate/dedupe.d.ts +42 -0
  638. package/dist/domain/consolidate/dedupe.js +143 -0
  639. package/dist/domain/consolidate/events.d.ts +114 -0
  640. package/dist/domain/consolidate/events.js +3 -0
  641. package/dist/domain/consolidate/flush-units.d.ts +18 -0
  642. package/dist/domain/consolidate/flush-units.js +76 -0
  643. package/dist/domain/consolidate/half-life-migration.d.ts +26 -0
  644. package/dist/domain/consolidate/half-life-migration.js +20 -0
  645. package/dist/domain/consolidate/llm-passes.d.ts +4 -0
  646. package/dist/domain/consolidate/llm-passes.js +275 -0
  647. package/dist/domain/consolidate/memory-value-artifact.d.ts +3 -0
  648. package/dist/domain/consolidate/memory-value-artifact.js +8 -0
  649. package/dist/domain/consolidate/memory-value-weights.d.ts +13 -0
  650. package/dist/domain/consolidate/memory-value-weights.js +24 -0
  651. package/dist/domain/consolidate/memory-value.d.ts +85 -0
  652. package/dist/domain/consolidate/memory-value.js +257 -0
  653. package/dist/domain/consolidate/merge.d.ts +8 -0
  654. package/dist/domain/consolidate/merge.js +308 -0
  655. package/dist/domain/consolidate/overlap-index.d.ts +14 -0
  656. package/dist/domain/consolidate/overlap-index.js +46 -0
  657. package/dist/domain/consolidate/physics-pass.d.ts +7 -0
  658. package/dist/domain/consolidate/physics-pass.js +118 -0
  659. package/dist/domain/consolidate/replay.d.ts +25 -0
  660. package/dist/domain/consolidate/replay.js +98 -0
  661. package/dist/domain/consolidate/run.d.ts +94 -0
  662. package/dist/domain/consolidate/run.js +53 -0
  663. package/dist/domain/consolidate/sleep.d.ts +37 -0
  664. package/dist/domain/consolidate/sleep.js +231 -0
  665. package/dist/domain/consolidate/summary-settle.d.ts +25 -0
  666. package/dist/domain/consolidate/summary-settle.js +65 -0
  667. package/dist/domain/consolidate/survivors.d.ts +57 -0
  668. package/dist/domain/consolidate/survivors.js +150 -0
  669. package/dist/domain/consolidate/tombstones.d.ts +18 -0
  670. package/dist/domain/consolidate/tombstones.js +26 -0
  671. package/dist/domain/consolidate/trace.d.ts +23 -0
  672. package/dist/domain/consolidate/trace.js +57 -0
  673. package/dist/domain/consolidate/traces.d.ts +8 -0
  674. package/dist/domain/consolidate/traces.js +141 -0
  675. package/dist/domain/context/select-policy.d.ts +34 -0
  676. package/dist/domain/context/select-policy.js +89 -0
  677. package/dist/domain/eval/eval-stats.d.ts +172 -0
  678. package/dist/domain/eval/eval-stats.js +286 -0
  679. package/dist/domain/eval/eval-suite-corpus.d.ts +16 -0
  680. package/dist/domain/eval/eval-suite-corpus.js +304 -0
  681. package/dist/domain/eval/eval-suite-fixtures.d.ts +19 -0
  682. package/dist/domain/eval/eval-suite-fixtures.js +140 -0
  683. package/dist/domain/eval/eval-suite.d.ts +62 -0
  684. package/dist/domain/eval/eval-suite.js +186 -0
  685. package/dist/domain/eval/eval.d.ts +108 -0
  686. package/dist/domain/eval/eval.js +177 -0
  687. package/dist/domain/eval/repository-t.js +314 -0
  688. package/dist/domain/graph/extract.d.ts +64 -0
  689. package/dist/domain/graph/extract.js +288 -0
  690. package/dist/domain/graph/recall.d.ts +55 -0
  691. package/dist/domain/graph/recall.js +267 -0
  692. package/dist/domain/graph/stream.d.ts +48 -0
  693. package/dist/domain/graph/stream.js +226 -0
  694. package/dist/domain/graph/view.d.ts +55 -0
  695. package/dist/domain/graph/view.js +176 -0
  696. package/dist/domain/learn/autolearn.d.ts +26 -0
  697. package/dist/domain/learn/autolearn.js +102 -0
  698. package/dist/domain/learn/churn-evidence.d.ts +49 -0
  699. package/dist/domain/learn/churn-evidence.js +208 -0
  700. package/dist/domain/learn/churn-git.d.ts +34 -0
  701. package/dist/domain/learn/churn-git.js +126 -0
  702. package/dist/domain/learn/churn-stale.d.ts +36 -0
  703. package/dist/domain/learn/churn-stale.js +158 -0
  704. package/dist/domain/learn/extract.d.ts +29 -0
  705. package/dist/domain/learn/extract.js +132 -0
  706. package/dist/domain/learn/forward-claim-detector.d.ts +18 -0
  707. package/dist/domain/learn/forward-claim-detector.js +61 -0
  708. package/dist/domain/learn/invalidation.d.ts +40 -0
  709. package/dist/domain/learn/invalidation.js +187 -0
  710. package/dist/domain/learn/session-digest.d.ts +29 -0
  711. package/dist/domain/learn/session-digest.js +170 -0
  712. package/dist/domain/objects/customer-notes.d.ts +34 -0
  713. package/dist/domain/objects/customer-notes.js +50 -0
  714. package/dist/domain/objects/decisions.d.ts +39 -0
  715. package/dist/domain/objects/decisions.js +60 -0
  716. package/dist/domain/objects/descriptor.d.ts +43 -0
  717. package/dist/domain/objects/descriptor.js +5 -0
  718. package/dist/domain/objects/fields.d.ts +10 -0
  719. package/dist/domain/objects/fields.js +29 -0
  720. package/dist/domain/objects/incidents.d.ts +42 -0
  721. package/dist/domain/objects/incidents.js +85 -0
  722. package/dist/domain/objects/lifecycle.d.ts +44 -0
  723. package/dist/domain/objects/lifecycle.js +101 -0
  724. package/dist/domain/objects/policies.d.ts +48 -0
  725. package/dist/domain/objects/policies.js +84 -0
  726. package/dist/domain/objects/processes.d.ts +29 -0
  727. package/dist/domain/objects/processes.js +66 -0
  728. package/dist/domain/objects/project-briefs.d.ts +50 -0
  729. package/dist/domain/objects/project-briefs.js +166 -0
  730. package/dist/domain/objects/skills.d.ts +33 -0
  731. package/dist/domain/objects/skills.js +73 -0
  732. package/dist/domain/predictions/planning-fallacy.d.ts +24 -0
  733. package/dist/domain/predictions/planning-fallacy.js +83 -0
  734. package/dist/domain/rerankers/cross-encoder.d.ts +6 -0
  735. package/dist/domain/rerankers/cross-encoder.js +73 -0
  736. package/dist/domain/rerankers/hosted.d.ts +6 -0
  737. package/dist/domain/rerankers/hosted.js +10 -0
  738. package/dist/domain/rerankers/outage-warning.d.ts +17 -0
  739. package/dist/domain/rerankers/outage-warning.js +36 -0
  740. package/dist/domain/search/as-of.d.ts +10 -0
  741. package/dist/domain/search/as-of.js +22 -0
  742. package/dist/domain/search/bm25-search.d.ts +28 -0
  743. package/dist/domain/search/bm25-search.js +65 -0
  744. package/dist/domain/search/bm25.d.ts +16 -0
  745. package/dist/domain/search/bm25.js +54 -0
  746. package/dist/domain/search/boosts.d.ts +84 -0
  747. package/dist/domain/search/boosts.js +148 -0
  748. package/dist/domain/search/breakdown.d.ts +8 -0
  749. package/dist/domain/search/breakdown.js +22 -0
  750. package/dist/domain/search/detached-work.d.ts +6 -0
  751. package/dist/domain/search/detached-work.js +2 -0
  752. package/dist/domain/search/embed-failures.d.ts +7 -0
  753. package/dist/domain/search/embed-failures.js +36 -0
  754. package/dist/domain/search/embed-index-target.d.ts +13 -0
  755. package/dist/domain/search/embed-index-target.js +224 -0
  756. package/dist/domain/search/embed-memories.d.ts +50 -0
  757. package/dist/domain/search/embed-memories.js +73 -0
  758. package/dist/domain/search/embed-store-target.d.ts +17 -0
  759. package/dist/domain/search/embed-store-target.js +109 -0
  760. package/dist/domain/search/embed-turns.d.ts +3 -0
  761. package/dist/domain/search/embed-turns.js +6 -0
  762. package/dist/domain/search/engine.d.ts +19 -0
  763. package/dist/domain/search/engine.js +14 -0
  764. package/dist/domain/search/explain.d.ts +26 -0
  765. package/dist/domain/search/explain.js +33 -0
  766. package/dist/domain/search/finalize.d.ts +10 -0
  767. package/dist/domain/search/finalize.js +84 -0
  768. package/dist/domain/search/fusion.d.ts +31 -0
  769. package/dist/domain/search/fusion.js +46 -0
  770. package/dist/domain/search/goal-boost.d.ts +32 -0
  771. package/dist/domain/search/goal-boost.js +107 -0
  772. package/dist/domain/search/hybrid-score.d.ts +23 -0
  773. package/dist/domain/search/hybrid-score.js +76 -0
  774. package/dist/domain/search/hybrid.d.ts +130 -0
  775. package/dist/domain/search/hybrid.js +115 -0
  776. package/dist/domain/search/multihop.d.ts +5 -0
  777. package/dist/domain/search/multihop.js +46 -0
  778. package/dist/domain/search/path-context.d.ts +17 -0
  779. package/dist/domain/search/path-context.js +66 -0
  780. package/dist/domain/search/physics-search.d.ts +50 -0
  781. package/dist/domain/search/physics-search.js +216 -0
  782. package/dist/domain/search/rerank.d.ts +21 -0
  783. package/dist/domain/search/rerank.js +77 -0
  784. package/dist/domain/search/rrf.d.ts +22 -0
  785. package/dist/domain/search/rrf.js +42 -0
  786. package/dist/domain/search/temporal.d.ts +15 -0
  787. package/dist/domain/search/temporal.js +51 -0
  788. package/dist/domain/search/vector.d.ts +65 -0
  789. package/dist/domain/search/vector.js +144 -0
  790. package/dist/domain/sharing/global-sync.d.ts +20 -0
  791. package/dist/domain/sharing/global-sync.js +114 -0
  792. package/dist/domain/sharing/project-merge.d.ts +87 -0
  793. package/dist/domain/sharing/project-merge.js +292 -0
  794. package/dist/domain/sharing/search-both.d.ts +85 -0
  795. package/dist/domain/sharing/search-both.js +159 -0
  796. package/dist/domain/sharing/share.d.ts +63 -0
  797. package/dist/domain/sharing/share.js +320 -0
  798. package/dist/domain/sharing/text-keys.d.ts +8 -0
  799. package/dist/domain/sharing/text-keys.js +14 -0
  800. package/dist/domain/trust/quarantine.d.ts +4 -0
  801. package/dist/domain/trust/quarantine.js +4 -0
  802. package/dist/domain/trust/reject-flow.d.ts +37 -0
  803. package/dist/domain/trust/reject-flow.js +52 -0
  804. package/dist/entry/eval-scripts.d.ts +40 -0
  805. package/dist/entry/eval-scripts.js +68 -0
  806. package/dist/entry/eval.d.ts +10 -0
  807. package/dist/entry/eval.js +16 -0
  808. package/dist/entry/folder-search.d.ts +49 -0
  809. package/dist/entry/folder-search.js +88 -0
  810. package/dist/entry/importers.d.ts +16 -0
  811. package/dist/entry/importers.js +47 -0
  812. package/dist/entry/json-hooks.d.ts +3 -2
  813. package/dist/entry/json-hooks.js +2 -3
  814. package/dist/entry/learning.d.ts +7 -0
  815. package/dist/entry/learning.js +10 -0
  816. package/dist/entry/memory.d.ts +32 -0
  817. package/dist/entry/memory.js +51 -0
  818. package/dist/entry/object-saves.d.ts +11 -0
  819. package/dist/entry/object-saves.js +23 -0
  820. package/dist/entry/project-identity.d.ts +2 -1
  821. package/dist/entry/project-identity.js +4 -3
  822. package/dist/entry/search.d.ts +15 -0
  823. package/dist/entry/search.js +18 -0
  824. package/dist/entry/session-text.d.ts +7 -6
  825. package/dist/entry/session-text.js +10 -8
  826. package/dist/entry/sleep.d.ts +23 -0
  827. package/dist/entry/sleep.js +45 -0
  828. package/dist/entry/store-conformance.d.ts +15 -0
  829. package/dist/entry/store-conformance.js +69 -0
  830. package/dist/entry/store-kit.d.ts +46 -48
  831. package/dist/entry/store-kit.js +50 -26
  832. package/dist/entry/testing.d.ts +15 -5
  833. package/dist/entry/testing.js +27 -6
  834. package/dist/entry/wire-kit.d.ts +20 -0
  835. package/dist/entry/wire-kit.js +31 -0
  836. package/dist/extensions/openclaw-plugin/index.js +4 -4
  837. package/dist/host/agent-homes.d.ts +8 -0
  838. package/dist/host/agent-homes.js +25 -0
  839. package/dist/host/atomic-write.d.ts +19 -0
  840. package/dist/host/atomic-write.js +182 -0
  841. package/dist/host/clock.d.ts +5 -0
  842. package/dist/host/clock.js +6 -0
  843. package/dist/host/config-file.d.ts +21 -0
  844. package/dist/host/config-file.js +119 -0
  845. package/dist/host/file-lock.d.ts +28 -0
  846. package/dist/host/file-lock.js +168 -0
  847. package/dist/host/global-store.d.ts +3 -0
  848. package/dist/host/global-store.js +8 -0
  849. package/dist/host/host.d.ts +16 -0
  850. package/dist/host/host.js +39 -0
  851. package/dist/host/json-file.d.ts +6 -0
  852. package/dist/host/json-file.js +15 -0
  853. package/dist/host/key-gitignore.d.ts +4 -0
  854. package/dist/host/key-gitignore.js +58 -0
  855. package/dist/host/kill-tree.d.ts +11 -0
  856. package/dist/host/kill-tree.js +135 -0
  857. package/dist/host/package-version.d.ts +4 -0
  858. package/dist/host/package-version.js +16 -0
  859. package/dist/host/pid-alive.d.ts +4 -0
  860. package/dist/host/pid-alive.js +14 -0
  861. package/dist/host/private-dir.d.ts +8 -0
  862. package/dist/host/private-dir.js +5 -0
  863. package/dist/host/project-identity.d.ts +37 -0
  864. package/dist/host/project-identity.js +187 -0
  865. package/dist/host/project-remote.d.ts +23 -0
  866. package/dist/host/project-remote.js +192 -0
  867. package/dist/host/real-path.d.ts +9 -0
  868. package/dist/host/real-path.js +31 -0
  869. package/dist/host/spawn-argv.d.ts +17 -0
  870. package/dist/host/spawn-argv.js +105 -0
  871. package/dist/host/stream-tee.d.ts +4 -0
  872. package/dist/host/stream-tee.js +38 -0
  873. package/dist/host/windows-acl.d.ts +5 -0
  874. package/dist/host/windows-acl.js +29 -0
  875. package/dist/index.d.ts +6 -77
  876. package/dist/index.js +6 -80
  877. package/dist/infra/agent-files.d.ts +3 -0
  878. package/dist/infra/agent-files.js +101 -0
  879. package/dist/infra/anthropic-llm.d.ts +9 -0
  880. package/dist/infra/anthropic-llm.js +95 -0
  881. package/dist/infra/compaction-spool.d.ts +27 -0
  882. package/dist/infra/compaction-spool.js +71 -0
  883. package/dist/infra/cross-encoder.d.ts +34 -0
  884. package/dist/infra/cross-encoder.js +44 -0
  885. package/dist/infra/embedding-provider.d.ts +23 -0
  886. package/dist/infra/embedding-provider.js +281 -0
  887. package/dist/infra/eval-switches.d.ts +27 -0
  888. package/dist/infra/eval-switches.js +59 -0
  889. package/dist/infra/git-runner.d.ts +5 -0
  890. package/dist/infra/git-runner.js +47 -0
  891. package/dist/infra/http-retry.d.ts +46 -0
  892. package/dist/infra/http-retry.js +195 -0
  893. package/dist/infra/http.d.ts +6 -0
  894. package/dist/infra/http.js +10 -0
  895. package/dist/infra/judgment.d.ts +26 -0
  896. package/dist/infra/judgment.js +128 -0
  897. package/dist/infra/local-embedder.d.ts +64 -0
  898. package/dist/infra/local-embedder.js +146 -0
  899. package/dist/infra/machine.d.ts +6 -0
  900. package/dist/infra/machine.js +23 -0
  901. package/dist/infra/ports.d.ts +11 -0
  902. package/dist/infra/ports.js +37 -0
  903. package/dist/infra/rerankers/clef.d.ts +31 -0
  904. package/dist/infra/rerankers/clef.js +180 -0
  905. package/dist/infra/rerankers/endpoint.d.ts +21 -0
  906. package/dist/infra/rerankers/endpoint.js +31 -0
  907. package/dist/infra/rerankers/index.d.ts +7 -0
  908. package/dist/infra/rerankers/index.js +31 -0
  909. package/dist/infra/rerankers/jev.d.ts +20 -0
  910. package/dist/infra/rerankers/jev.js +113 -0
  911. package/dist/infra/rerankers/llm.d.ts +10 -0
  912. package/dist/infra/rerankers/llm.js +96 -0
  913. package/dist/infra/spool-claims.d.ts +42 -0
  914. package/dist/infra/spool-claims.js +65 -0
  915. package/dist/infra/spool-counts.d.ts +12 -0
  916. package/dist/infra/spool-counts.js +48 -0
  917. package/dist/infra/spool-files.d.ts +85 -0
  918. package/dist/infra/spool-files.js +100 -0
  919. package/dist/infra/spool-import.d.ts +15 -0
  920. package/dist/infra/spool-import.js +92 -0
  921. package/dist/infra/spool-record.d.ts +19 -0
  922. package/dist/infra/spool-record.js +46 -0
  923. package/dist/infra/spool-recovery.d.ts +19 -0
  924. package/dist/infra/spool-recovery.js +88 -0
  925. package/dist/infra/transcript-calls.d.ts +5 -0
  926. package/dist/infra/transcript-calls.js +54 -0
  927. package/dist/infra/transcript-tail.d.ts +14 -0
  928. package/dist/infra/transcript-tail.js +43 -0
  929. package/dist/infra/transformers.d.ts +29 -0
  930. package/dist/infra/transformers.js +83 -0
  931. package/dist/server.d.ts +28 -25
  932. package/dist/server.js +32 -38
  933. package/dist/store/rules/audit-rows.d.ts +30 -0
  934. package/dist/store/rules/audit-rows.js +11 -0
  935. package/dist/store/rules/copies.d.ts +12 -0
  936. package/dist/store/rules/copies.js +26 -0
  937. package/dist/store/rules/graph-delta.d.ts +52 -0
  938. package/dist/store/rules/graph-delta.js +92 -0
  939. package/dist/store/rules/half-life.d.ts +8 -0
  940. package/dist/store/rules/half-life.js +27 -0
  941. package/dist/store/rules/order.d.ts +51 -0
  942. package/dist/store/rules/order.js +54 -0
  943. package/dist/store/rules/request-ids.d.ts +3 -0
  944. package/dist/store/rules/request-ids.js +5 -0
  945. package/dist/store/rules/windows.d.ts +10 -0
  946. package/dist/store/rules/windows.js +12 -0
  947. package/dist/store/sqlite/audit/audit-event.d.ts +18 -0
  948. package/dist/store/sqlite/audit/audit-event.js +31 -0
  949. package/dist/store/sqlite/audit/audit-maintenance.d.ts +4 -0
  950. package/dist/store/sqlite/audit/audit-maintenance.js +288 -0
  951. package/dist/store/sqlite/audit/audit.d.ts +23 -0
  952. package/dist/store/sqlite/audit/audit.js +131 -0
  953. package/dist/store/sqlite/capture/captures.d.ts +4 -0
  954. package/dist/store/sqlite/capture/captures.js +56 -0
  955. package/dist/store/sqlite/capture/compaction-hooks.d.ts +4 -0
  956. package/dist/store/sqlite/capture/compaction-hooks.js +221 -0
  957. package/dist/store/sqlite/capture/compaction-rows.d.ts +93 -0
  958. package/dist/store/sqlite/capture/compaction-rows.js +84 -0
  959. package/dist/store/sqlite/capture/compactions-record.d.ts +89 -0
  960. package/dist/store/sqlite/capture/compactions-record.js +268 -0
  961. package/dist/store/sqlite/capture/compactions.d.ts +4 -0
  962. package/dist/store/sqlite/capture/compactions.js +59 -0
  963. package/dist/store/sqlite/capture/failure-log.d.ts +12 -0
  964. package/dist/store/sqlite/capture/failure-log.js +113 -0
  965. package/dist/store/sqlite/capture/gated-write.d.ts +13 -0
  966. package/dist/store/sqlite/capture/gated-write.js +33 -0
  967. package/dist/store/sqlite/connectors/connector-events.d.ts +4 -0
  968. package/dist/store/sqlite/connectors/connector-events.js +53 -0
  969. package/dist/store/sqlite/connectors/connector-writes.d.ts +6 -0
  970. package/dist/store/sqlite/connectors/connector-writes.js +65 -0
  971. package/dist/store/sqlite/connectors/dlq.d.ts +21 -0
  972. package/dist/store/sqlite/connectors/dlq.js +85 -0
  973. package/dist/store/sqlite/connectors/event-log.d.ts +20 -0
  974. package/dist/store/sqlite/connectors/event-log.js +26 -0
  975. package/dist/store/sqlite/connectors/events.d.ts +11 -0
  976. package/dist/store/sqlite/connectors/events.js +57 -0
  977. package/dist/store/sqlite/connectors/github.d.ts +32 -0
  978. package/dist/store/sqlite/connectors/github.js +102 -0
  979. package/dist/store/sqlite/connectors/quarantine.d.ts +17 -0
  980. package/dist/store/sqlite/connectors/quarantine.js +157 -0
  981. package/dist/store/sqlite/connectors/replay.d.ts +6 -0
  982. package/dist/store/sqlite/connectors/replay.js +21 -0
  983. package/dist/store/sqlite/connectors/slack.d.ts +23 -0
  984. package/dist/store/sqlite/connectors/slack.js +82 -0
  985. package/dist/store/sqlite/consolidation/consolidation-summaries.d.ts +19 -0
  986. package/dist/store/sqlite/consolidation/consolidation-summaries.js +155 -0
  987. package/dist/store/sqlite/consolidation/consolidation.d.ts +5 -0
  988. package/dist/store/sqlite/consolidation/consolidation.js +140 -0
  989. package/dist/store/sqlite/consolidation/sleep-scans.d.ts +9 -0
  990. package/dist/store/sqlite/consolidation/sleep-scans.js +77 -0
  991. package/dist/store/sqlite/dormant/dormant-rows.d.ts +52 -0
  992. package/dist/store/sqlite/dormant/dormant-rows.js +169 -0
  993. package/dist/store/sqlite/dormant/dormant.d.ts +12 -0
  994. package/dist/store/sqlite/dormant/dormant.js +142 -0
  995. package/dist/store/sqlite/entries/delete-and-batch.d.ts +56 -0
  996. package/dist/store/sqlite/entries/delete-and-batch.js +479 -0
  997. package/dist/store/sqlite/entries/entry-filter.d.ts +20 -0
  998. package/dist/store/sqlite/entries/entry-filter.js +97 -0
  999. package/dist/store/sqlite/entries/entry-mentions.d.ts +10 -0
  1000. package/dist/store/sqlite/entries/entry-mentions.js +90 -0
  1001. package/dist/store/sqlite/entries/entry-reads.d.ts +106 -0
  1002. package/dist/store/sqlite/entries/entry-reads.js +264 -0
  1003. package/dist/store/sqlite/entries/entry-row.d.ts +34 -0
  1004. package/dist/store/sqlite/entries/entry-row.js +209 -0
  1005. package/dist/store/sqlite/entries/entry-writes.d.ts +128 -0
  1006. package/dist/store/sqlite/entries/entry-writes.js +510 -0
  1007. package/dist/store/sqlite/entries/index-and-stats.d.ts +35 -0
  1008. package/dist/store/sqlite/entries/index-and-stats.js +98 -0
  1009. package/dist/store/sqlite/entries/raw-archive.d.ts +20 -0
  1010. package/dist/store/sqlite/entries/raw-archive.js +115 -0
  1011. package/dist/store/sqlite/entries/set-aside.d.ts +14 -0
  1012. package/dist/store/sqlite/entries/set-aside.js +39 -0
  1013. package/dist/store/sqlite/entries/summary-dirty.d.ts +10 -0
  1014. package/dist/store/sqlite/entries/summary-dirty.js +47 -0
  1015. package/dist/store/sqlite/fixtures.d.ts +37 -0
  1016. package/dist/store/sqlite/fixtures.js +65 -0
  1017. package/dist/store/sqlite/folder-files/due-mirrors.d.ts +12 -0
  1018. package/dist/store/sqlite/folder-files/due-mirrors.js +80 -0
  1019. package/dist/store/sqlite/folder-files/folder-files.d.ts +4 -0
  1020. package/dist/store/sqlite/folder-files/folder-files.js +30 -0
  1021. package/dist/store/sqlite/folder-files/mirrors.d.ts +49 -0
  1022. package/dist/store/sqlite/folder-files/mirrors.js +323 -0
  1023. package/dist/store/sqlite/graph/dag-reads.d.ts +4 -0
  1024. package/dist/store/sqlite/graph/dag-reads.js +162 -0
  1025. package/dist/store/sqlite/graph/graph-delta.d.ts +5 -0
  1026. package/dist/store/sqlite/graph/graph-delta.js +72 -0
  1027. package/dist/store/sqlite/graph/graph-queue.d.ts +18 -0
  1028. package/dist/store/sqlite/graph/graph-queue.js +71 -0
  1029. package/dist/store/sqlite/graph/graph-reads.d.ts +4 -0
  1030. package/dist/store/sqlite/graph/graph-reads.js +236 -0
  1031. package/dist/store/sqlite/graph/graph-rebuild.d.ts +4 -0
  1032. package/dist/store/sqlite/graph/graph-rebuild.js +80 -0
  1033. package/dist/store/sqlite/graph/graph-rows.d.ts +78 -0
  1034. package/dist/store/sqlite/graph/graph-rows.js +66 -0
  1035. package/dist/store/sqlite/graph/graph-writes.d.ts +56 -0
  1036. package/dist/store/sqlite/graph/graph-writes.js +254 -0
  1037. package/dist/store/sqlite/index.d.ts +16 -0
  1038. package/dist/store/sqlite/index.js +18 -0
  1039. package/dist/store/sqlite/keys/auth.d.ts +43 -0
  1040. package/dist/store/sqlite/keys/auth.js +141 -0
  1041. package/dist/store/sqlite/keys/keys.d.ts +4 -0
  1042. package/dist/store/sqlite/keys/keys.js +102 -0
  1043. package/dist/store/sqlite/learning/learning.d.ts +5 -0
  1044. package/dist/store/sqlite/learning/learning.js +21 -0
  1045. package/dist/store/sqlite/learning/lesson-writes.d.ts +4 -0
  1046. package/dist/store/sqlite/learning/lesson-writes.js +43 -0
  1047. package/dist/store/sqlite/learning/planning-fallacy-evidence.d.ts +7 -0
  1048. package/dist/store/sqlite/learning/planning-fallacy-evidence.js +52 -0
  1049. package/dist/store/sqlite/learning/prediction-baserate.d.ts +10 -0
  1050. package/dist/store/sqlite/learning/prediction-baserate.js +84 -0
  1051. package/dist/store/sqlite/learning/predictions.d.ts +15 -0
  1052. package/dist/store/sqlite/learning/predictions.js +256 -0
  1053. package/dist/store/sqlite/ledger/delivery-ledger.d.ts +19 -0
  1054. package/dist/store/sqlite/ledger/delivery-ledger.js +277 -0
  1055. package/dist/store/sqlite/ledger/ledger.d.ts +8 -0
  1056. package/dist/store/sqlite/ledger/ledger.js +171 -0
  1057. package/dist/store/sqlite/ledger/token-ledger-rows.d.ts +70 -0
  1058. package/dist/store/sqlite/ledger/token-ledger-rows.js +66 -0
  1059. package/dist/store/sqlite/ledger/token-ledger.d.ts +38 -0
  1060. package/dist/store/sqlite/ledger/token-ledger.js +155 -0
  1061. package/dist/store/sqlite/maintenance/agent-import-steps.d.ts +15 -0
  1062. package/dist/store/sqlite/maintenance/agent-import-steps.js +225 -0
  1063. package/dist/store/sqlite/maintenance/agent-import-stores.d.ts +17 -0
  1064. package/dist/store/sqlite/maintenance/agent-import-stores.js +41 -0
  1065. package/dist/store/sqlite/maintenance/agent-import.d.ts +6 -0
  1066. package/dist/store/sqlite/maintenance/agent-import.js +48 -0
  1067. package/dist/store/sqlite/maintenance/diagnostics.d.ts +4 -0
  1068. package/dist/store/sqlite/maintenance/diagnostics.js +79 -0
  1069. package/dist/store/sqlite/maintenance/import-files.d.ts +18 -0
  1070. package/dist/store/sqlite/maintenance/import-files.js +17 -0
  1071. package/dist/store/sqlite/maintenance/project-tags.d.ts +6 -0
  1072. package/dist/store/sqlite/maintenance/project-tags.js +182 -0
  1073. package/dist/store/sqlite/recall/ambient.d.ts +8 -0
  1074. package/dist/store/sqlite/recall/ambient.js +89 -0
  1075. package/dist/store/sqlite/recall/candidates.d.ts +56 -0
  1076. package/dist/store/sqlite/recall/candidates.js +417 -0
  1077. package/dist/store/sqlite/recall/fts-phrase.d.ts +5 -0
  1078. package/dist/store/sqlite/recall/fts-phrase.js +10 -0
  1079. package/dist/store/sqlite/recall/last-recall.d.ts +14 -0
  1080. package/dist/store/sqlite/recall/last-recall.js +59 -0
  1081. package/dist/store/sqlite/recall/recall-trace.d.ts +29 -0
  1082. package/dist/store/sqlite/recall/recall-trace.js +110 -0
  1083. package/dist/store/sqlite/recall/search-rows.d.ts +22 -0
  1084. package/dist/store/sqlite/recall/search-rows.js +259 -0
  1085. package/dist/store/sqlite/records/card-rows.d.ts +51 -0
  1086. package/dist/store/sqlite/records/card-rows.js +66 -0
  1087. package/dist/store/sqlite/records/card-runs.d.ts +34 -0
  1088. package/dist/store/sqlite/records/card-runs.js +253 -0
  1089. package/dist/store/sqlite/records/cards.d.ts +4 -0
  1090. package/dist/store/sqlite/records/cards.js +148 -0
  1091. package/dist/store/sqlite/records/object-rows.d.ts +142 -0
  1092. package/dist/store/sqlite/records/object-rows.js +237 -0
  1093. package/dist/store/sqlite/records/object-writes.d.ts +18 -0
  1094. package/dist/store/sqlite/records/object-writes.js +258 -0
  1095. package/dist/store/sqlite/records/objects.d.ts +4 -0
  1096. package/dist/store/sqlite/records/objects.js +116 -0
  1097. package/dist/store/sqlite/reports/dashboard-functions.d.ts +47 -0
  1098. package/dist/store/sqlite/reports/dashboard-functions.js +256 -0
  1099. package/dist/store/sqlite/reports/dashboard-lists.d.ts +16 -0
  1100. package/dist/store/sqlite/reports/dashboard-lists.js +241 -0
  1101. package/dist/store/sqlite/reports/dashboard-reads.d.ts +7 -0
  1102. package/dist/store/sqlite/reports/dashboard-reads.js +201 -0
  1103. package/dist/store/sqlite/reports/dashboard-sql.d.ts +7 -0
  1104. package/dist/store/sqlite/reports/dashboard-sql.js +19 -0
  1105. package/dist/store/sqlite/reports/reports.d.ts +4 -0
  1106. package/dist/store/sqlite/reports/reports.js +98 -0
  1107. package/dist/store/sqlite/review/conflicts.d.ts +26 -0
  1108. package/dist/store/sqlite/review/conflicts.js +441 -0
  1109. package/dist/store/sqlite/review/rejection.d.ts +42 -0
  1110. package/dist/store/sqlite/review/rejection.js +99 -0
  1111. package/dist/store/sqlite/review/rejections.d.ts +6 -0
  1112. package/dist/store/sqlite/review/rejections.js +253 -0
  1113. package/dist/store/sqlite/runtime/bound.d.ts +21 -0
  1114. package/dist/store/sqlite/runtime/bound.js +44 -0
  1115. package/dist/store/sqlite/runtime/commit-watch.d.ts +4 -0
  1116. package/dist/store/sqlite/runtime/commit-watch.js +57 -0
  1117. package/dist/store/sqlite/runtime/error-codec.d.ts +20 -0
  1118. package/dist/store/sqlite/runtime/error-codec.js +104 -0
  1119. package/dist/store/sqlite/runtime/executor-counts.js +12 -0
  1120. package/dist/store/sqlite/runtime/executor.d.ts +52 -0
  1121. package/dist/store/sqlite/runtime/executor.js +384 -0
  1122. package/dist/store/sqlite/runtime/grant.d.ts +22 -0
  1123. package/dist/store/sqlite/runtime/grant.js +9 -0
  1124. package/dist/store/sqlite/runtime/handle-clock.d.ts +9 -0
  1125. package/dist/store/sqlite/runtime/handle-clock.js +18 -0
  1126. package/dist/store/sqlite/runtime/handles.d.ts +20 -0
  1127. package/dist/store/sqlite/runtime/handles.js +104 -0
  1128. package/dist/store/sqlite/runtime/held-connection.d.ts +11 -0
  1129. package/dist/store/sqlite/runtime/held-connection.js +58 -0
  1130. package/dist/store/sqlite/runtime/hippo-db-stores.d.ts +7 -0
  1131. package/dist/store/sqlite/runtime/hippo-db-stores.js +12 -0
  1132. package/dist/store/sqlite/runtime/keyset.d.ts +48 -0
  1133. package/dist/store/sqlite/runtime/keyset.js +74 -0
  1134. package/dist/store/sqlite/runtime/open.d.ts +55 -0
  1135. package/dist/store/sqlite/runtime/open.js +180 -0
  1136. package/dist/store/sqlite/runtime/port-errors.d.ts +10 -0
  1137. package/dist/store/sqlite/runtime/port-errors.js +25 -0
  1138. package/dist/store/sqlite/runtime/request-scope.d.ts +16 -0
  1139. package/dist/store/sqlite/runtime/request-scope.js +40 -0
  1140. package/dist/store/sqlite/runtime/rows.d.ts +125 -0
  1141. package/dist/store/sqlite/runtime/rows.js +249 -0
  1142. package/dist/store/sqlite/runtime/rule-sql.d.ts +32 -0
  1143. package/dist/store/sqlite/runtime/rule-sql.js +102 -0
  1144. package/dist/store/sqlite/runtime/server-runtime.d.ts +46 -0
  1145. package/dist/store/sqlite/runtime/server-runtime.js +70 -0
  1146. package/dist/store/sqlite/runtime/tenant-lookup.d.ts +12 -0
  1147. package/dist/store/sqlite/runtime/tenant-lookup.js +20 -0
  1148. package/dist/store/sqlite/runtime/tenant-wire.d.ts +15 -0
  1149. package/dist/store/sqlite/runtime/tenant-wire.js +37 -0
  1150. package/dist/store/sqlite/runtime/tenant.d.ts +16 -0
  1151. package/dist/store/sqlite/runtime/tenant.js +22 -0
  1152. package/dist/store/sqlite/runtime/vector-pack.d.ts +17 -0
  1153. package/dist/store/sqlite/runtime/vector-pack.js +41 -0
  1154. package/dist/store/sqlite/runtime/worker-entry.js +10 -0
  1155. package/dist/store/sqlite/runtime/worker-jobs.d.ts +6 -0
  1156. package/dist/store/sqlite/runtime/worker-jobs.js +181 -0
  1157. package/dist/store/sqlite/runtime/worker-ops.d.ts +78 -0
  1158. package/dist/store/sqlite/runtime/worker-ops.js +37 -0
  1159. package/dist/store/sqlite/runtime/worker-store.d.ts +30 -0
  1160. package/dist/store/sqlite/runtime/worker-store.js +172 -0
  1161. package/dist/store/sqlite/sessions/goals.d.ts +30 -0
  1162. package/dist/store/sqlite/sessions/goals.js +282 -0
  1163. package/dist/store/sqlite/sessions/handoffs.d.ts +36 -0
  1164. package/dist/store/sqlite/sessions/handoffs.js +245 -0
  1165. package/dist/store/sqlite/sessions/session-mirrors.d.ts +5 -0
  1166. package/dist/store/sqlite/sessions/session-mirrors.js +87 -0
  1167. package/dist/store/sqlite/sessions/sessions.d.ts +14 -0
  1168. package/dist/store/sqlite/sessions/sessions.js +316 -0
  1169. package/dist/store/sqlite/sessions/task-snapshots.d.ts +16 -0
  1170. package/dist/store/sqlite/sessions/task-snapshots.js +93 -0
  1171. package/dist/store/sqlite/sharing/copy-rows.d.ts +25 -0
  1172. package/dist/store/sqlite/sharing/copy-rows.js +69 -0
  1173. package/dist/store/sqlite/sharing/promotion.d.ts +4 -0
  1174. package/dist/store/sqlite/sharing/promotion.js +8 -0
  1175. package/dist/store/sqlite/sharing/sharing.d.ts +4 -0
  1176. package/dist/store/sqlite/sharing/sharing.js +20 -0
  1177. package/dist/store/sqlite/store.d.ts +32 -25
  1178. package/dist/store/sqlite/store.js +217 -307
  1179. package/dist/store/sqlite/vectors/embed-lock.d.ts +8 -0
  1180. package/dist/store/sqlite/vectors/embed-lock.js +22 -0
  1181. package/dist/store/sqlite/vectors/embedding-index.d.ts +4 -0
  1182. package/dist/store/sqlite/vectors/embedding-index.js +111 -0
  1183. package/dist/store/sqlite/vectors/vector-graph-file.d.ts +5 -0
  1184. package/dist/store/sqlite/vectors/vector-graph-file.js +10 -0
  1185. package/dist/store/sqlite/vectors/vector-index.d.ts +62 -0
  1186. package/dist/store/sqlite/vectors/vector-index.js +223 -0
  1187. package/dist/store/sqlite/vectors/vector-reads.d.ts +23 -0
  1188. package/dist/store/sqlite/vectors/vector-reads.js +48 -0
  1189. package/dist/surface/capture/caller-session.d.ts +20 -0
  1190. package/dist/surface/capture/caller-session.js +65 -0
  1191. package/dist/surface/capture/capture-error.d.ts +22 -0
  1192. package/dist/surface/capture/capture-error.js +63 -0
  1193. package/dist/surface/capture/codex-patch.d.ts +13 -0
  1194. package/dist/surface/capture/codex-patch.js +81 -0
  1195. package/dist/surface/capture/codex-session.js +83 -0
  1196. package/dist/surface/capture/command.d.ts +74 -0
  1197. package/dist/surface/capture/command.js +259 -0
  1198. package/dist/surface/capture/compact-resume-caller.d.ts +11 -0
  1199. package/dist/surface/capture/compact-resume-caller.js +48 -0
  1200. package/dist/surface/capture/compact.d.ts +35 -0
  1201. package/dist/surface/capture/compact.js +316 -0
  1202. package/dist/surface/capture/compaction-items-caller.d.ts +19 -0
  1203. package/dist/surface/capture/compaction-items-caller.js +39 -0
  1204. package/dist/surface/capture/compaction-record.d.ts +42 -0
  1205. package/dist/surface/capture/compaction-record.js +215 -0
  1206. package/dist/surface/capture/copilot-transcript.d.ts +26 -0
  1207. package/dist/surface/capture/copilot-transcript.js +60 -0
  1208. package/dist/surface/capture/extract.d.ts +11 -0
  1209. package/dist/surface/capture/extract.js +193 -0
  1210. package/dist/surface/capture/failure-caller.d.ts +22 -0
  1211. package/dist/surface/capture/failure-caller.js +106 -0
  1212. package/dist/surface/capture/failure-reading.d.ts +54 -0
  1213. package/dist/surface/capture/failure-reading.js +111 -0
  1214. package/dist/surface/capture/handoff-evidence.d.ts +5 -0
  1215. package/dist/surface/capture/handoff-evidence.js +38 -0
  1216. package/dist/surface/capture/pre-compact-caller.d.ts +16 -0
  1217. package/dist/surface/capture/pre-compact-caller.js +52 -0
  1218. package/dist/surface/capture/session-digest.d.ts +42 -0
  1219. package/dist/surface/capture/session-digest.js +372 -0
  1220. package/dist/surface/capture/session-end-caller.d.ts +25 -0
  1221. package/dist/surface/capture/session-end-caller.js +45 -0
  1222. package/dist/surface/capture/session-texts.d.ts +21 -0
  1223. package/dist/surface/capture/session-texts.js +65 -0
  1224. package/dist/surface/capture/session-worker.d.ts +21 -0
  1225. package/dist/surface/capture/session-worker.js +262 -0
  1226. package/dist/surface/capture/share-scrub.d.ts +4 -0
  1227. package/dist/surface/capture/share-scrub.js +9 -0
  1228. package/dist/surface/capture/transcript.d.ts +46 -0
  1229. package/dist/surface/capture/transcript.js +245 -0
  1230. package/dist/surface/capture/working-state.d.ts +7 -0
  1231. package/dist/surface/capture/working-state.js +95 -0
  1232. package/dist/surface/cli/api-context.d.ts +72 -0
  1233. package/dist/surface/cli/api-context.js +219 -0
  1234. package/dist/surface/cli/audit-prune.d.ts +4 -0
  1235. package/dist/surface/cli/audit-prune.js +15 -0
  1236. package/dist/surface/cli/audit.d.ts +3 -0
  1237. package/dist/surface/cli/audit.js +184 -0
  1238. package/dist/surface/cli/auth.d.ts +3 -0
  1239. package/dist/surface/cli/auth.js +191 -0
  1240. package/dist/surface/cli/briefs.d.ts +2 -0
  1241. package/dist/surface/cli/briefs.js +72 -0
  1242. package/dist/surface/cli/card.d.ts +5 -0
  1243. package/dist/surface/cli/card.js +342 -0
  1244. package/dist/surface/cli/cli-runtime.d.ts +8 -0
  1245. package/dist/surface/cli/cli-runtime.js +27 -0
  1246. package/dist/surface/cli/client.d.ts +60 -0
  1247. package/dist/surface/cli/client.js +183 -0
  1248. package/dist/surface/cli/compact-resume-payload.d.ts +11 -0
  1249. package/dist/surface/cli/compact-resume-payload.js +42 -0
  1250. package/dist/surface/cli/conflicts.d.ts +4 -0
  1251. package/dist/surface/cli/conflicts.js +110 -0
  1252. package/dist/surface/cli/context.d.ts +3 -0
  1253. package/dist/surface/cli/context.js +247 -0
  1254. package/dist/surface/cli/continuity.d.ts +5 -0
  1255. package/dist/surface/cli/continuity.js +200 -0
  1256. package/dist/surface/cli/copilot-report.d.ts +4 -0
  1257. package/dist/surface/cli/copilot-report.js +115 -0
  1258. package/dist/surface/cli/curate-held.d.ts +9 -0
  1259. package/dist/surface/cli/curate-held.js +136 -0
  1260. package/dist/surface/cli/curate.d.ts +5 -0
  1261. package/dist/surface/cli/curate.js +162 -0
  1262. package/dist/surface/cli/dag.d.ts +5 -0
  1263. package/dist/surface/cli/dag.js +204 -0
  1264. package/dist/surface/cli/daily-runner.d.ts +3 -0
  1265. package/dist/surface/cli/daily-runner.js +111 -0
  1266. package/dist/surface/cli/dashboard-banner.d.ts +15 -0
  1267. package/dist/surface/cli/dashboard-banner.js +42 -0
  1268. package/dist/surface/cli/decisions.d.ts +3 -0
  1269. package/dist/surface/cli/decisions.js +110 -0
  1270. package/dist/surface/cli/dlq-replay.d.ts +4 -0
  1271. package/dist/surface/cli/dlq-replay.js +17 -0
  1272. package/dist/surface/cli/doctor-store-checks.d.ts +9 -0
  1273. package/dist/surface/cli/doctor-store-checks.js +285 -0
  1274. package/dist/surface/cli/doctor.d.ts +53 -0
  1275. package/dist/surface/cli/doctor.js +232 -0
  1276. package/dist/surface/cli/eval.d.ts +7 -0
  1277. package/dist/surface/cli/eval.js +322 -0
  1278. package/dist/surface/cli/exit.d.ts +12 -0
  1279. package/dist/surface/cli/exit.js +22 -0
  1280. package/dist/surface/cli/explain.d.ts +3 -0
  1281. package/dist/surface/cli/explain.js +198 -0
  1282. package/dist/surface/cli/flag-defaults.d.ts +11 -0
  1283. package/dist/surface/cli/flag-defaults.js +13 -0
  1284. package/dist/surface/cli/flag-values.d.ts +57 -0
  1285. package/dist/surface/cli/flag-values.js +173 -0
  1286. package/dist/surface/cli/flags.d.ts +16 -0
  1287. package/dist/surface/cli/flags.js +42 -0
  1288. package/dist/surface/cli/github.d.ts +15 -0
  1289. package/dist/surface/cli/github.js +174 -0
  1290. package/dist/surface/cli/goals.d.ts +3 -0
  1291. package/dist/surface/cli/goals.js +178 -0
  1292. package/dist/surface/cli/graph-page-client.d.ts +2 -0
  1293. package/dist/surface/cli/graph-page-client.js +98 -0
  1294. package/dist/surface/cli/graph-page.d.ts +15 -0
  1295. package/dist/surface/cli/graph-page.js +152 -0
  1296. package/dist/surface/cli/graph.d.ts +3 -0
  1297. package/dist/surface/cli/graph.js +92 -0
  1298. package/dist/surface/cli/handoff.d.ts +3 -0
  1299. package/dist/surface/cli/handoff.js +127 -0
  1300. package/dist/surface/cli/hook-runtime.d.ts +59 -0
  1301. package/dist/surface/cli/hook-runtime.js +162 -0
  1302. package/dist/surface/cli/hook.d.ts +3 -0
  1303. package/dist/surface/cli/hook.js +221 -0
  1304. package/dist/surface/cli/hooks/capture-error.d.ts +5 -0
  1305. package/dist/surface/cli/hooks/capture-error.js +42 -0
  1306. package/dist/surface/cli/hooks/capture.d.ts +3 -0
  1307. package/dist/surface/cli/hooks/capture.js +53 -0
  1308. package/dist/surface/cli/hooks/codex-run.d.ts +3 -0
  1309. package/dist/surface/cli/hooks/codex-run.js +143 -0
  1310. package/dist/surface/cli/hooks/codex-session-end-worker.d.ts +3 -0
  1311. package/dist/surface/cli/hooks/codex-session-end-worker.js +98 -0
  1312. package/dist/surface/cli/hooks/compact-resume.d.ts +3 -0
  1313. package/dist/surface/cli/hooks/compact-resume.js +81 -0
  1314. package/dist/surface/cli/hooks/post-compact.d.ts +4 -0
  1315. package/dist/surface/cli/hooks/post-compact.js +37 -0
  1316. package/dist/surface/cli/hooks/pre-compact.d.ts +3 -0
  1317. package/dist/surface/cli/hooks/pre-compact.js +46 -0
  1318. package/dist/surface/cli/hooks/session-end-worker.d.ts +3 -0
  1319. package/dist/surface/cli/hooks/session-end-worker.js +85 -0
  1320. package/dist/surface/cli/hooks/session-end.d.ts +6 -0
  1321. package/dist/surface/cli/hooks/session-end.js +162 -0
  1322. package/dist/surface/cli/incidents.d.ts +3 -0
  1323. package/dist/surface/cli/incidents.js +97 -0
  1324. package/dist/surface/cli/init.js +394 -0
  1325. package/dist/surface/cli/install-steps.d.ts +17 -0
  1326. package/dist/surface/cli/install-steps.js +156 -0
  1327. package/dist/surface/cli/json-list.d.ts +4 -0
  1328. package/dist/surface/cli/json-list.js +17 -0
  1329. package/dist/surface/cli/last-sleep.d.ts +10 -0
  1330. package/dist/surface/cli/last-sleep.js +75 -0
  1331. package/dist/surface/cli/learn.d.ts +4 -0
  1332. package/dist/surface/cli/learn.js +94 -0
  1333. package/dist/surface/cli/maintenance.d.ts +6 -0
  1334. package/dist/surface/cli/maintenance.js +192 -0
  1335. package/dist/surface/cli/memory-import.d.ts +3 -0
  1336. package/dist/surface/cli/memory-import.js +252 -0
  1337. package/dist/surface/cli/memory-writes.d.ts +65 -0
  1338. package/dist/surface/cli/memory-writes.js +173 -0
  1339. package/dist/surface/cli/notes.d.ts +2 -0
  1340. package/dist/surface/cli/notes.js +40 -0
  1341. package/dist/surface/cli/object-verbs.d.ts +42 -0
  1342. package/dist/surface/cli/object-verbs.js +64 -0
  1343. package/dist/surface/cli/open-browser.js +37 -0
  1344. package/dist/surface/cli/output.js +8 -0
  1345. package/dist/surface/cli/owner-validation.d.ts +19 -0
  1346. package/dist/surface/cli/owner-validation.js +34 -0
  1347. package/dist/surface/cli/playbooks.d.ts +4 -0
  1348. package/dist/surface/cli/playbooks.js +189 -0
  1349. package/dist/surface/cli/predictions.d.ts +3 -0
  1350. package/dist/surface/cli/predictions.js +177 -0
  1351. package/dist/surface/cli/print.d.ts +24 -0
  1352. package/dist/surface/cli/print.js +91 -0
  1353. package/dist/surface/cli/projects.d.ts +3 -0
  1354. package/dist/surface/cli/projects.js +127 -0
  1355. package/dist/surface/cli/quality-repair-once.d.ts +4 -0
  1356. package/dist/surface/cli/quality-repair-once.js +42 -0
  1357. package/dist/surface/cli/recall-block.d.ts +46 -0
  1358. package/dist/surface/cli/recall-block.js +173 -0
  1359. package/dist/surface/cli/recall-flags.d.ts +32 -0
  1360. package/dist/surface/cli/recall-flags.js +141 -0
  1361. package/dist/surface/cli/recall.d.ts +9 -0
  1362. package/dist/surface/cli/recall.js +143 -0
  1363. package/dist/surface/cli/refine-llm.d.ts +35 -0
  1364. package/dist/surface/cli/refine-llm.js +134 -0
  1365. package/dist/surface/cli/rejections.d.ts +5 -0
  1366. package/dist/surface/cli/rejections.js +105 -0
  1367. package/dist/surface/cli/remember.d.ts +4 -0
  1368. package/dist/surface/cli/remember.js +223 -0
  1369. package/dist/surface/cli/run-watched.d.ts +15 -0
  1370. package/dist/surface/cli/run-watched.js +57 -0
  1371. package/dist/surface/cli/scheduler.d.ts +26 -0
  1372. package/dist/surface/cli/scheduler.js +145 -0
  1373. package/dist/surface/cli/serve.d.ts +5 -0
  1374. package/dist/surface/cli/serve.js +103 -0
  1375. package/dist/surface/cli/server-nearest.d.ts +5 -0
  1376. package/dist/surface/cli/server-nearest.js +45 -0
  1377. package/dist/surface/cli/session.d.ts +3 -0
  1378. package/dist/surface/cli/session.js +157 -0
  1379. package/dist/surface/cli/setup.d.ts +3 -0
  1380. package/dist/surface/cli/setup.js +180 -0
  1381. package/dist/surface/cli/shared.d.ts +34 -0
  1382. package/dist/surface/cli/shared.js +72 -0
  1383. package/dist/surface/cli/slack.d.ts +3 -0
  1384. package/dist/surface/cli/slack.js +128 -0
  1385. package/dist/surface/cli/sleep-render.d.ts +7 -0
  1386. package/dist/surface/cli/sleep-render.js +80 -0
  1387. package/dist/surface/cli/sleep.d.ts +6 -0
  1388. package/dist/surface/cli/sleep.js +147 -0
  1389. package/dist/surface/cli/status.d.ts +18 -0
  1390. package/dist/surface/cli/status.js +386 -0
  1391. package/dist/surface/cli/stdin.d.ts +23 -0
  1392. package/dist/surface/cli/stdin.js +112 -0
  1393. package/dist/surface/cli/support-bundle.d.ts +12 -0
  1394. package/dist/surface/cli/support-bundle.js +357 -0
  1395. package/dist/surface/cli/trace.d.ts +3 -0
  1396. package/dist/surface/cli/trace.js +196 -0
  1397. package/dist/surface/cli/transfer.d.ts +7 -0
  1398. package/dist/surface/cli/transfer.js +150 -0
  1399. package/dist/surface/cli/usage.js +82 -0
  1400. package/dist/surface/cli/verb-row.d.ts +46 -0
  1401. package/dist/surface/cli/verb-row.js +13 -0
  1402. package/dist/surface/cli/verbs/health.js +306 -0
  1403. package/dist/surface/cli/verbs/memory.js +315 -0
  1404. package/dist/surface/cli/verbs/objects.js +319 -0
  1405. package/dist/surface/cli/verbs/sessions.js +413 -0
  1406. package/dist/surface/cli/verbs.d.ts +93 -0
  1407. package/dist/surface/cli/verbs.js +19 -0
  1408. package/dist/surface/cli/versioned-verbs.d.ts +48 -0
  1409. package/dist/surface/cli/versioned-verbs.js +93 -0
  1410. package/dist/surface/connectors/dlq.d.ts +79 -0
  1411. package/dist/surface/connectors/dlq.js +88 -0
  1412. package/dist/surface/connectors/github/backfill.d.ts +28 -0
  1413. package/dist/surface/connectors/github/backfill.js +247 -0
  1414. package/dist/surface/connectors/github/deletion.d.ts +22 -0
  1415. package/dist/surface/connectors/github/deletion.js +19 -0
  1416. package/dist/surface/connectors/github/dlq.d.ts +33 -0
  1417. package/dist/surface/connectors/github/dlq.js +61 -0
  1418. package/dist/surface/connectors/github/ingest.d.ts +27 -0
  1419. package/dist/surface/connectors/github/ingest.js +65 -0
  1420. package/dist/surface/connectors/github/octokit-client.d.ts +25 -0
  1421. package/dist/surface/connectors/github/octokit-client.js +87 -0
  1422. package/dist/surface/connectors/github/ratelimit.d.ts +13 -0
  1423. package/dist/surface/connectors/github/ratelimit.js +24 -0
  1424. package/dist/surface/connectors/github/scope.d.ts +5 -0
  1425. package/dist/surface/connectors/github/scope.js +10 -0
  1426. package/dist/surface/connectors/github/signature.d.ts +27 -0
  1427. package/dist/surface/connectors/github/signature.js +41 -0
  1428. package/dist/surface/connectors/github/transform.d.ts +7 -0
  1429. package/dist/surface/connectors/github/transform.js +67 -0
  1430. package/dist/surface/connectors/github/types.d.ts +82 -0
  1431. package/dist/surface/connectors/github/types.js +91 -0
  1432. package/dist/surface/connectors/github/webhook.d.ts +11 -0
  1433. package/dist/surface/connectors/github/webhook.js +287 -0
  1434. package/dist/surface/connectors/hmac.d.ts +8 -0
  1435. package/dist/surface/connectors/hmac.js +17 -0
  1436. package/dist/surface/connectors/ingest.d.ts +25 -0
  1437. package/dist/surface/connectors/ingest.js +35 -0
  1438. package/dist/surface/connectors/previous-secret.d.ts +18 -0
  1439. package/dist/surface/connectors/previous-secret.js +51 -0
  1440. package/dist/surface/connectors/slack/backfill.d.ts +30 -0
  1441. package/dist/surface/connectors/slack/backfill.js +47 -0
  1442. package/dist/surface/connectors/slack/deletion.d.ts +16 -0
  1443. package/dist/surface/connectors/slack/deletion.js +25 -0
  1444. package/dist/surface/connectors/slack/dlq.d.ts +23 -0
  1445. package/dist/surface/connectors/slack/dlq.js +101 -0
  1446. package/dist/surface/connectors/slack/ingest.d.ts +15 -0
  1447. package/dist/surface/connectors/slack/ingest.js +20 -0
  1448. package/dist/surface/connectors/slack/scope.d.ts +10 -0
  1449. package/dist/surface/connectors/slack/scope.js +7 -0
  1450. package/dist/surface/connectors/slack/signature.d.ts +24 -0
  1451. package/dist/surface/connectors/slack/signature.js +32 -0
  1452. package/dist/surface/connectors/slack/transform.d.ts +16 -0
  1453. package/dist/surface/connectors/slack/transform.js +34 -0
  1454. package/dist/surface/connectors/slack/types.d.ts +33 -0
  1455. package/dist/surface/connectors/slack/types.js +22 -0
  1456. package/dist/surface/connectors/slack/web-client.js +67 -0
  1457. package/dist/surface/connectors/slack/webhook.d.ts +8 -0
  1458. package/dist/surface/connectors/slack/webhook.js +232 -0
  1459. package/dist/surface/connectors/slack/workspaces.d.ts +11 -0
  1460. package/dist/surface/connectors/slack/workspaces.js +13 -0
  1461. package/dist/surface/connectors/tenant-route.d.ts +12 -0
  1462. package/dist/surface/connectors/tenant-route.js +9 -0
  1463. package/dist/surface/dashboard/dashboard-actions.d.ts +25 -0
  1464. package/dist/surface/dashboard/dashboard-actions.js +88 -0
  1465. package/dist/surface/dashboard/dashboard-page.d.ts +11 -0
  1466. package/dist/surface/dashboard/dashboard-page.js +64 -0
  1467. package/dist/surface/dashboard/dashboard-params.d.ts +26 -0
  1468. package/dist/surface/dashboard/dashboard-params.js +128 -0
  1469. package/dist/surface/dashboard/dashboard.d.ts +15 -0
  1470. package/dist/surface/dashboard/dashboard.js +74 -0
  1471. package/dist/surface/dashboard/static-file.d.ts +31 -0
  1472. package/dist/surface/dashboard/static-file.js +134 -0
  1473. package/dist/surface/entry-infra.d.ts +14 -0
  1474. package/dist/surface/entry-infra.js +19 -0
  1475. package/dist/surface/hooks-install/codex-wrapper.d.ts +18 -0
  1476. package/dist/surface/hooks-install/codex-wrapper.js +282 -0
  1477. package/dist/surface/hooks-install/copilot.d.ts +9 -0
  1478. package/dist/surface/hooks-install/copilot.js +166 -0
  1479. package/dist/surface/hooks-install/detect.d.ts +14 -0
  1480. package/dist/surface/hooks-install/detect.js +97 -0
  1481. package/dist/surface/hooks-install/instructions.d.ts +7 -0
  1482. package/dist/surface/hooks-install/instructions.js +15 -0
  1483. package/dist/surface/hooks-install/json-hooks.d.ts +21 -0
  1484. package/dist/surface/hooks-install/json-hooks.js +90 -0
  1485. package/dist/surface/hooks-install/opencode.d.ts +6 -0
  1486. package/dist/surface/hooks-install/opencode.js +50 -0
  1487. package/dist/surface/hooks-install/rules/claude-hooks.d.ts +15 -0
  1488. package/dist/surface/hooks-install/rules/claude-hooks.js +172 -0
  1489. package/dist/surface/hooks-install/rules/codex-hooks.d.ts +9 -0
  1490. package/dist/surface/hooks-install/rules/codex-hooks.js +59 -0
  1491. package/dist/surface/hooks-install/rules/codex-wrapper.d.ts +67 -0
  1492. package/dist/surface/hooks-install/rules/codex-wrapper.js +127 -0
  1493. package/dist/surface/hooks-install/rules/copilot.d.ts +115 -0
  1494. package/dist/surface/hooks-install/rules/copilot.js +206 -0
  1495. package/dist/surface/hooks-install/rules/hook-blocks.d.ts +27 -0
  1496. package/dist/surface/hooks-install/rules/hook-blocks.js +151 -0
  1497. package/dist/surface/hooks-install/rules/hook-handlers.d.ts +18 -0
  1498. package/dist/surface/hooks-install/rules/hook-handlers.js +63 -0
  1499. package/dist/surface/hooks-install/rules/install-plan.d.ts +17 -0
  1500. package/dist/surface/hooks-install/rules/install-plan.js +37 -0
  1501. package/dist/surface/hooks-install/rules/json-hooks.d.ts +59 -0
  1502. package/dist/surface/hooks-install/rules/json-hooks.js +100 -0
  1503. package/dist/surface/hooks-install/rules/opencode.d.ts +27 -0
  1504. package/dist/surface/hooks-install/rules/opencode.js +115 -0
  1505. package/dist/surface/hooks-install/rules/shared.d.ts +43 -0
  1506. package/dist/surface/hooks-install/rules/shared.js +47 -0
  1507. package/dist/surface/http/http-util.d.ts +46 -0
  1508. package/dist/surface/http/http-util.js +126 -0
  1509. package/dist/surface/importers/core.d.ts +75 -0
  1510. package/dist/surface/importers/core.js +129 -0
  1511. package/dist/surface/importers/markdown-parse.d.ts +27 -0
  1512. package/dist/surface/importers/markdown-parse.js +109 -0
  1513. package/dist/surface/importers/markdown.d.ts +3 -0
  1514. package/dist/surface/importers/markdown.js +87 -0
  1515. package/dist/surface/importers/sources.d.ts +7 -0
  1516. package/dist/surface/importers/sources.js +208 -0
  1517. package/dist/surface/importers/vault.d.ts +15 -0
  1518. package/dist/surface/importers/vault.js +303 -0
  1519. package/dist/surface/mcp/admin-tools.d.ts +8 -0
  1520. package/dist/surface/mcp/admin-tools.js +117 -0
  1521. package/dist/surface/mcp/framing.d.ts +22 -0
  1522. package/dist/surface/mcp/framing.js +69 -0
  1523. package/dist/surface/mcp/json-rpc.d.ts +30 -0
  1524. package/dist/surface/mcp/json-rpc.js +17 -0
  1525. package/dist/surface/mcp/memory-tools.d.ts +5 -0
  1526. package/dist/surface/mcp/memory-tools.js +59 -0
  1527. package/dist/surface/mcp/protocol.d.ts +119 -0
  1528. package/dist/surface/mcp/protocol.js +100 -0
  1529. package/dist/surface/mcp/recall-tools.d.ts +6 -0
  1530. package/dist/surface/mcp/recall-tools.js +111 -0
  1531. package/dist/surface/mcp/request.d.ts +16 -0
  1532. package/dist/surface/mcp/request.js +187 -0
  1533. package/dist/surface/mcp/server.d.ts +8 -0
  1534. package/dist/surface/mcp/server.js +35 -0
  1535. package/dist/surface/mcp/shared-gate.d.ts +5 -0
  1536. package/dist/surface/mcp/shared-gate.js +24 -0
  1537. package/dist/surface/mcp/stdio.d.ts +8 -0
  1538. package/dist/surface/mcp/stdio.js +262 -0
  1539. package/dist/surface/mcp/tool-args.d.ts +35 -0
  1540. package/dist/surface/mcp/tool-args.js +118 -0
  1541. package/dist/surface/mcp/tool-recall.d.ts +15 -0
  1542. package/dist/surface/mcp/tool-recall.js +145 -0
  1543. package/dist/surface/mcp/tool-text.d.ts +28 -0
  1544. package/dist/surface/mcp/tool-text.js +145 -0
  1545. package/dist/surface/mcp/tools.js +306 -0
  1546. package/dist/surface/open-store.d.ts +15 -0
  1547. package/dist/surface/open-store.js +40 -0
  1548. package/dist/surface/render/recall-text.d.ts +33 -0
  1549. package/dist/surface/render/recall-text.js +47 -0
  1550. package/dist/surface/render/sleep-events.d.ts +6 -0
  1551. package/dist/surface/render/sleep-events.js +141 -0
  1552. package/dist/surface/server/api-key.d.ts +33 -0
  1553. package/dist/surface/server/api-key.js +112 -0
  1554. package/dist/surface/server/auth.d.ts +49 -0
  1555. package/dist/surface/server/auth.js +370 -0
  1556. package/dist/surface/server/boot.d.ts +15 -0
  1557. package/dist/surface/server/boot.js +346 -0
  1558. package/dist/surface/server/client-ip.d.ts +34 -0
  1559. package/dist/surface/server/client-ip.js +148 -0
  1560. package/dist/surface/server/cursor.d.ts +25 -0
  1561. package/dist/surface/server/cursor.js +26 -0
  1562. package/dist/surface/server/dashboard-listener.d.ts +31 -0
  1563. package/dist/surface/server/dashboard-listener.js +110 -0
  1564. package/dist/surface/server/dashboard-reader-thread.d.ts +2 -0
  1565. package/dist/surface/server/dashboard-reader-thread.js +104 -0
  1566. package/dist/surface/server/dashboard-reader.d.ts +74 -0
  1567. package/dist/surface/server/dashboard-reader.js +79 -0
  1568. package/dist/surface/server/dashboard-routes.d.ts +27 -0
  1569. package/dist/surface/server/dashboard-routes.js +74 -0
  1570. package/dist/surface/server/dashboard-session.d.ts +33 -0
  1571. package/dist/surface/server/dashboard-session.js +96 -0
  1572. package/dist/surface/server/dashboard-types.d.ts +32 -0
  1573. package/dist/surface/server/dashboard-types.js +4 -0
  1574. package/dist/surface/server/deadline.d.ts +12 -0
  1575. package/dist/surface/server/deadline.js +45 -0
  1576. package/dist/surface/server/defaults.js +6 -0
  1577. package/dist/surface/server/failure-replies.d.ts +12 -0
  1578. package/dist/surface/server/failure-replies.js +114 -0
  1579. package/dist/surface/server/failure-reply.d.ts +13 -0
  1580. package/dist/surface/server/failure-reply.js +24 -0
  1581. package/dist/surface/server/key-check-bounds.d.ts +18 -0
  1582. package/dist/surface/server/key-check-bounds.js +128 -0
  1583. package/dist/surface/server/lifecycle.d.ts +13 -0
  1584. package/dist/surface/server/lifecycle.js +54 -0
  1585. package/dist/surface/server/local-key.d.ts +20 -0
  1586. package/dist/surface/server/local-key.js +61 -0
  1587. package/dist/surface/server/loopback.d.ts +8 -0
  1588. package/dist/surface/server/loopback.js +27 -0
  1589. package/dist/surface/server/mcp-http.d.ts +9 -0
  1590. package/dist/surface/server/mcp-http.js +239 -0
  1591. package/dist/surface/server/prompt-hook-context.d.ts +4 -0
  1592. package/dist/surface/server/prompt-hook-context.js +32 -0
  1593. package/dist/surface/server/rate-limit.d.ts +30 -0
  1594. package/dist/surface/server/rate-limit.js +93 -0
  1595. package/dist/surface/server/rate-limits.d.ts +11 -0
  1596. package/dist/surface/server/rate-limits.js +74 -0
  1597. package/dist/surface/server/ready.d.ts +9 -0
  1598. package/dist/surface/server/ready.js +34 -0
  1599. package/dist/surface/server/request.d.ts +56 -0
  1600. package/dist/surface/server/request.js +218 -0
  1601. package/dist/surface/server/route-checks.d.ts +11 -0
  1602. package/dist/surface/server/route-checks.js +55 -0
  1603. package/dist/surface/server/route-lookup.d.ts +28 -0
  1604. package/dist/surface/server/route-lookup.js +44 -0
  1605. package/dist/surface/server/route-table.d.ts +62 -0
  1606. package/dist/surface/server/route-table.js +375 -0
  1607. package/dist/surface/server/routes/admin.d.ts +9 -0
  1608. package/dist/surface/server/routes/admin.js +186 -0
  1609. package/dist/surface/server/routes/customer-notes.d.ts +3 -0
  1610. package/dist/surface/server/routes/customer-notes.js +29 -0
  1611. package/dist/surface/server/routes/decisions.d.ts +3 -0
  1612. package/dist/surface/server/routes/decisions.js +46 -0
  1613. package/dist/surface/server/routes/incidents.d.ts +3 -0
  1614. package/dist/surface/server/routes/incidents.js +46 -0
  1615. package/dist/surface/server/routes/kind-routes.d.ts +26 -0
  1616. package/dist/surface/server/routes/kind-routes.js +32 -0
  1617. package/dist/surface/server/routes/memories.d.ts +13 -0
  1618. package/dist/surface/server/routes/memories.js +159 -0
  1619. package/dist/surface/server/routes/object-routes.d.ts +37 -0
  1620. package/dist/surface/server/routes/object-routes.js +83 -0
  1621. package/dist/surface/server/routes/policies.d.ts +3 -0
  1622. package/dist/surface/server/routes/policies.js +47 -0
  1623. package/dist/surface/server/routes/predictions.d.ts +3 -0
  1624. package/dist/surface/server/routes/predictions.js +119 -0
  1625. package/dist/surface/server/routes/processes.d.ts +3 -0
  1626. package/dist/surface/server/routes/processes.js +53 -0
  1627. package/dist/surface/server/routes/project-briefs.d.ts +3 -0
  1628. package/dist/surface/server/routes/project-briefs.js +42 -0
  1629. package/dist/surface/server/routes/recall.d.ts +6 -0
  1630. package/dist/surface/server/routes/recall.js +107 -0
  1631. package/dist/surface/server/routes/skills.d.ts +3 -0
  1632. package/dist/surface/server/routes/skills.js +37 -0
  1633. package/dist/surface/server/routes/vectors.d.ts +3 -0
  1634. package/dist/surface/server/routes/vectors.js +76 -0
  1635. package/dist/surface/server/server-detect.d.ts +55 -0
  1636. package/dist/surface/server/server-detect.js +317 -0
  1637. package/dist/surface/server/sleep-child.js +82 -0
  1638. package/dist/surface/server/sleep-offload.d.ts +42 -0
  1639. package/dist/surface/server/sleep-offload.js +141 -0
  1640. package/dist/surface/server/tls.d.ts +15 -0
  1641. package/dist/surface/server/tls.js +53 -0
  1642. package/dist/surface/server/types.d.ts +240 -0
  1643. package/dist/surface/server/validation.d.ts +56 -0
  1644. package/dist/surface/server/validation.js +154 -0
  1645. package/dist/surface/testing-kit.d.ts +2 -0
  1646. package/dist/surface/testing-kit.js +5 -0
  1647. package/dist-ui/assets/index-DWo8WuPW.js +33 -0
  1648. package/dist-ui/index.html +1 -1
  1649. package/extensions/openclaw-plugin/index.ts +5 -5
  1650. package/extensions/openclaw-plugin/openclaw.plugin.json +1 -1
  1651. package/extensions/openclaw-plugin/package.json +1 -1
  1652. package/openclaw.plugin.json +1 -1
  1653. package/package.json +15 -8
  1654. package/dist/agent-memories/apply.d.ts +0 -40
  1655. package/dist/agent-memories/apply.js +0 -275
  1656. package/dist/agent-memories/claude-code.d.ts +0 -20
  1657. package/dist/agent-memories/claude-code.js +0 -189
  1658. package/dist/agent-memories/codex.js +0 -47
  1659. package/dist/agent-memories/copilot.js +0 -111
  1660. package/dist/agent-memories/files.d.ts +0 -37
  1661. package/dist/agent-memories/files.js +0 -90
  1662. package/dist/agent-memories/folder-store.d.ts +0 -17
  1663. package/dist/agent-memories/folder-store.js +0 -44
  1664. package/dist/agent-memories/gemini.js +0 -104
  1665. package/dist/agent-memories/git.d.ts +0 -8
  1666. package/dist/agent-memories/git.js +0 -11
  1667. package/dist/agent-memories/keys.d.ts +0 -9
  1668. package/dist/agent-memories/keys.js +0 -21
  1669. package/dist/agent-memories/legacy.d.ts +0 -20
  1670. package/dist/agent-memories/legacy.js +0 -69
  1671. package/dist/agent-memories/markdown.d.ts +0 -13
  1672. package/dist/agent-memories/markdown.js +0 -123
  1673. package/dist/agent-memories/openclaw.js +0 -45
  1674. package/dist/agent-memories/plan.d.ts +0 -78
  1675. package/dist/agent-memories/plan.js +0 -133
  1676. package/dist/agent-memories/project-folds.d.ts +0 -10
  1677. package/dist/agent-memories/project-folds.js +0 -35
  1678. package/dist/agent-memories/qwen-code.js +0 -50
  1679. package/dist/agent-memories/report.d.ts +0 -56
  1680. package/dist/agent-memories/report.js +0 -123
  1681. package/dist/agent-memories/source.d.ts +0 -22
  1682. package/dist/agent-memories/source.js +0 -41
  1683. package/dist/agent-memories/sync.d.ts +0 -40
  1684. package/dist/agent-memories/sync.js +0 -402
  1685. package/dist/agent-memories/types.d.ts +0 -40
  1686. package/dist/api/busy.d.ts +0 -2
  1687. package/dist/api/busy.js +0 -2
  1688. package/dist/api/cli-surface.d.ts +0 -6
  1689. package/dist/api/cli-surface.js +0 -6
  1690. package/dist/api/config-of.d.ts +0 -5
  1691. package/dist/api/config-of.js +0 -6
  1692. package/dist/api/context-auto.d.ts +0 -6
  1693. package/dist/api/context-auto.js +0 -41
  1694. package/dist/api/context-render.d.ts +0 -52
  1695. package/dist/api/context-render.js +0 -213
  1696. package/dist/api/context-select.d.ts +0 -65
  1697. package/dist/api/context-select.js +0 -321
  1698. package/dist/api/context-types.d.ts +0 -109
  1699. package/dist/api/context-types.js +0 -3
  1700. package/dist/api/context.d.ts +0 -16
  1701. package/dist/api/context.js +0 -506
  1702. package/dist/api/continuity.d.ts +0 -50
  1703. package/dist/api/continuity.js +0 -64
  1704. package/dist/api/objects/cards.d.ts +0 -39
  1705. package/dist/api/objects/cards.js +0 -50
  1706. package/dist/api/recall/render.d.ts +0 -39
  1707. package/dist/api/recall/render.js +0 -60
  1708. package/dist/capture/caller-session.d.ts +0 -19
  1709. package/dist/capture/caller-session.js +0 -57
  1710. package/dist/capture/capture-error.d.ts +0 -14
  1711. package/dist/capture/capture-error.js +0 -67
  1712. package/dist/capture/codex-patch.d.ts +0 -12
  1713. package/dist/capture/codex-patch.js +0 -78
  1714. package/dist/capture/command.d.ts +0 -46
  1715. package/dist/capture/command.js +0 -214
  1716. package/dist/capture/compact-resume-caller.d.ts +0 -11
  1717. package/dist/capture/compact-resume-caller.js +0 -42
  1718. package/dist/capture/compact.d.ts +0 -27
  1719. package/dist/capture/compact.js +0 -247
  1720. package/dist/capture/compaction-items-caller.d.ts +0 -16
  1721. package/dist/capture/compaction-items-caller.js +0 -31
  1722. package/dist/capture/compaction-record.d.ts +0 -31
  1723. package/dist/capture/compaction-record.js +0 -124
  1724. package/dist/capture/compaction-spool.d.ts +0 -56
  1725. package/dist/capture/compaction-spool.js +0 -514
  1726. package/dist/capture/copilot-transcript.d.ts +0 -26
  1727. package/dist/capture/copilot-transcript.js +0 -57
  1728. package/dist/capture/extract.d.ts +0 -12
  1729. package/dist/capture/extract.js +0 -188
  1730. package/dist/capture/failure-caller.d.ts +0 -21
  1731. package/dist/capture/failure-caller.js +0 -90
  1732. package/dist/capture/failure-reading.d.ts +0 -49
  1733. package/dist/capture/failure-reading.js +0 -95
  1734. package/dist/capture/handoff-evidence.d.ts +0 -5
  1735. package/dist/capture/handoff-evidence.js +0 -31
  1736. package/dist/capture/pre-compact-caller.d.ts +0 -16
  1737. package/dist/capture/pre-compact-caller.js +0 -47
  1738. package/dist/capture/session-digest.d.ts +0 -85
  1739. package/dist/capture/session-digest.js +0 -550
  1740. package/dist/capture/session-end-caller.d.ts +0 -24
  1741. package/dist/capture/session-end-caller.js +0 -43
  1742. package/dist/capture/session-texts.d.ts +0 -18
  1743. package/dist/capture/session-texts.js +0 -57
  1744. package/dist/capture/session-worker.d.ts +0 -15
  1745. package/dist/capture/session-worker.js +0 -236
  1746. package/dist/capture/share-scrub.d.ts +0 -3
  1747. package/dist/capture/share-scrub.js +0 -8
  1748. package/dist/capture/transcript.d.ts +0 -47
  1749. package/dist/capture/transcript.js +0 -208
  1750. package/dist/capture/working-state.d.ts +0 -29
  1751. package/dist/capture/working-state.js +0 -161
  1752. package/dist/cli/api-context.d.ts +0 -15
  1753. package/dist/cli/api-context.js +0 -49
  1754. package/dist/cli/audit-prune.d.ts +0 -3
  1755. package/dist/cli/audit-prune.js +0 -14
  1756. package/dist/cli/audit.d.ts +0 -3
  1757. package/dist/cli/audit.js +0 -187
  1758. package/dist/cli/auth.d.ts +0 -3
  1759. package/dist/cli/auth.js +0 -176
  1760. package/dist/cli/briefs.d.ts +0 -2
  1761. package/dist/cli/briefs.js +0 -77
  1762. package/dist/cli/card.d.ts +0 -4
  1763. package/dist/cli/card.js +0 -325
  1764. package/dist/cli/client.d.ts +0 -40
  1765. package/dist/cli/client.js +0 -171
  1766. package/dist/cli/compact-resume-payload.d.ts +0 -11
  1767. package/dist/cli/compact-resume-payload.js +0 -47
  1768. package/dist/cli/context.d.ts +0 -3
  1769. package/dist/cli/context.js +0 -235
  1770. package/dist/cli/continuity.d.ts +0 -7
  1771. package/dist/cli/continuity.js +0 -446
  1772. package/dist/cli/curate.d.ts +0 -16
  1773. package/dist/cli/curate.js +0 -518
  1774. package/dist/cli/dag.d.ts +0 -5
  1775. package/dist/cli/dag.js +0 -203
  1776. package/dist/cli/decisions.d.ts +0 -3
  1777. package/dist/cli/decisions.js +0 -116
  1778. package/dist/cli/eval.d.ts +0 -3
  1779. package/dist/cli/eval.js +0 -221
  1780. package/dist/cli/exit.d.ts +0 -9
  1781. package/dist/cli/exit.js +0 -19
  1782. package/dist/cli/explain.d.ts +0 -3
  1783. package/dist/cli/explain.js +0 -172
  1784. package/dist/cli/flag-values.d.ts +0 -30
  1785. package/dist/cli/flag-values.js +0 -121
  1786. package/dist/cli/flags.d.ts +0 -15
  1787. package/dist/cli/flags.js +0 -34
  1788. package/dist/cli/github.d.ts +0 -20
  1789. package/dist/cli/github.js +0 -196
  1790. package/dist/cli/goals.d.ts +0 -3
  1791. package/dist/cli/goals.js +0 -180
  1792. package/dist/cli/graph.d.ts +0 -3
  1793. package/dist/cli/graph.js +0 -87
  1794. package/dist/cli/hook-runtime.d.ts +0 -53
  1795. package/dist/cli/hook-runtime.js +0 -137
  1796. package/dist/cli/incidents.d.ts +0 -3
  1797. package/dist/cli/incidents.js +0 -112
  1798. package/dist/cli/init.js +0 -358
  1799. package/dist/cli/install-steps.d.ts +0 -17
  1800. package/dist/cli/install-steps.js +0 -133
  1801. package/dist/cli/last-sleep.d.ts +0 -11
  1802. package/dist/cli/last-sleep.js +0 -78
  1803. package/dist/cli/maintenance.d.ts +0 -6
  1804. package/dist/cli/maintenance.js +0 -193
  1805. package/dist/cli/notes.d.ts +0 -2
  1806. package/dist/cli/notes.js +0 -44
  1807. package/dist/cli/object-verbs.d.ts +0 -40
  1808. package/dist/cli/object-verbs.js +0 -63
  1809. package/dist/cli/open-browser.js +0 -35
  1810. package/dist/cli/output.js +0 -7
  1811. package/dist/cli/owner-validation.d.ts +0 -18
  1812. package/dist/cli/owner-validation.js +0 -33
  1813. package/dist/cli/playbooks.d.ts +0 -4
  1814. package/dist/cli/playbooks.js +0 -204
  1815. package/dist/cli/predictions.d.ts +0 -3
  1816. package/dist/cli/predictions.js +0 -170
  1817. package/dist/cli/print.d.ts +0 -15
  1818. package/dist/cli/print.js +0 -85
  1819. package/dist/cli/projects.d.ts +0 -3
  1820. package/dist/cli/projects.js +0 -118
  1821. package/dist/cli/quality-repair-once.d.ts +0 -3
  1822. package/dist/cli/quality-repair-once.js +0 -38
  1823. package/dist/cli/recall.d.ts +0 -3
  1824. package/dist/cli/recall.js +0 -470
  1825. package/dist/cli/refine-llm.d.ts +0 -46
  1826. package/dist/cli/refine-llm.js +0 -138
  1827. package/dist/cli/remember.d.ts +0 -5
  1828. package/dist/cli/remember.js +0 -435
  1829. package/dist/cli/scheduler.d.ts +0 -25
  1830. package/dist/cli/scheduler.js +0 -113
  1831. package/dist/cli/serve.d.ts +0 -5
  1832. package/dist/cli/serve.js +0 -89
  1833. package/dist/cli/session-hooks.d.ts +0 -14
  1834. package/dist/cli/session-hooks.js +0 -635
  1835. package/dist/cli/setup.d.ts +0 -5
  1836. package/dist/cli/setup.js +0 -553
  1837. package/dist/cli/shared.d.ts +0 -25
  1838. package/dist/cli/shared.js +0 -130
  1839. package/dist/cli/slack.d.ts +0 -3
  1840. package/dist/cli/slack.js +0 -134
  1841. package/dist/cli/sleep-render.d.ts +0 -6
  1842. package/dist/cli/sleep-render.js +0 -67
  1843. package/dist/cli/sleep.d.ts +0 -5
  1844. package/dist/cli/sleep.js +0 -122
  1845. package/dist/cli/status.d.ts +0 -15
  1846. package/dist/cli/status.js +0 -361
  1847. package/dist/cli/stdin.d.ts +0 -22
  1848. package/dist/cli/stdin.js +0 -110
  1849. package/dist/cli/transfer.d.ts +0 -10
  1850. package/dist/cli/transfer.js +0 -439
  1851. package/dist/cli/usage.js +0 -81
  1852. package/dist/cli/verb-row.d.ts +0 -34
  1853. package/dist/cli/verb-row.js +0 -6
  1854. package/dist/cli/verbs/health.js +0 -234
  1855. package/dist/cli/verbs/memory.js +0 -238
  1856. package/dist/cli/verbs/objects.js +0 -263
  1857. package/dist/cli/verbs/sessions.js +0 -314
  1858. package/dist/cli/verbs.d.ts +0 -81
  1859. package/dist/cli/verbs.js +0 -7
  1860. package/dist/cli/versioned-verbs.d.ts +0 -52
  1861. package/dist/cli/versioned-verbs.js +0 -89
  1862. package/dist/connectors/dlq.d.ts +0 -80
  1863. package/dist/connectors/dlq.js +0 -69
  1864. package/dist/connectors/github/backfill.d.ts +0 -28
  1865. package/dist/connectors/github/backfill.js +0 -220
  1866. package/dist/connectors/github/deletion.d.ts +0 -23
  1867. package/dist/connectors/github/deletion.js +0 -20
  1868. package/dist/connectors/github/dlq.d.ts +0 -32
  1869. package/dist/connectors/github/dlq.js +0 -52
  1870. package/dist/connectors/github/ingest.d.ts +0 -28
  1871. package/dist/connectors/github/ingest.js +0 -63
  1872. package/dist/connectors/github/octokit-client.d.ts +0 -25
  1873. package/dist/connectors/github/octokit-client.js +0 -80
  1874. package/dist/connectors/github/ratelimit.d.ts +0 -13
  1875. package/dist/connectors/github/ratelimit.js +0 -24
  1876. package/dist/connectors/github/scope.d.ts +0 -6
  1877. package/dist/connectors/github/scope.js +0 -11
  1878. package/dist/connectors/github/signature.d.ts +0 -27
  1879. package/dist/connectors/github/signature.js +0 -43
  1880. package/dist/connectors/github/tenant-routing.d.ts +0 -13
  1881. package/dist/connectors/github/tenant-routing.js +0 -23
  1882. package/dist/connectors/github/transform.d.ts +0 -7
  1883. package/dist/connectors/github/transform.js +0 -72
  1884. package/dist/connectors/github/types.d.ts +0 -83
  1885. package/dist/connectors/github/types.js +0 -92
  1886. package/dist/connectors/github/webhook.d.ts +0 -7
  1887. package/dist/connectors/github/webhook.js +0 -257
  1888. package/dist/connectors/ingest.d.ts +0 -12
  1889. package/dist/connectors/ingest.js +0 -28
  1890. package/dist/connectors/slack/backfill.d.ts +0 -29
  1891. package/dist/connectors/slack/backfill.js +0 -45
  1892. package/dist/connectors/slack/deletion.d.ts +0 -16
  1893. package/dist/connectors/slack/deletion.js +0 -27
  1894. package/dist/connectors/slack/dlq.d.ts +0 -20
  1895. package/dist/connectors/slack/dlq.js +0 -84
  1896. package/dist/connectors/slack/ingest.d.ts +0 -17
  1897. package/dist/connectors/slack/ingest.js +0 -20
  1898. package/dist/connectors/slack/scope.d.ts +0 -10
  1899. package/dist/connectors/slack/scope.js +0 -7
  1900. package/dist/connectors/slack/signature.d.ts +0 -17
  1901. package/dist/connectors/slack/signature.js +0 -28
  1902. package/dist/connectors/slack/tenant-routing.d.ts +0 -7
  1903. package/dist/connectors/slack/tenant-routing.js +0 -21
  1904. package/dist/connectors/slack/transform.d.ts +0 -16
  1905. package/dist/connectors/slack/transform.js +0 -34
  1906. package/dist/connectors/slack/types.d.ts +0 -37
  1907. package/dist/connectors/slack/types.js +0 -22
  1908. package/dist/connectors/slack/web-client.js +0 -63
  1909. package/dist/connectors/slack/webhook.d.ts +0 -7
  1910. package/dist/connectors/slack/webhook.js +0 -182
  1911. package/dist/connectors/slack/workspaces.d.ts +0 -17
  1912. package/dist/connectors/slack/workspaces.js +0 -14
  1913. package/dist/connectors/store.d.ts +0 -8
  1914. package/dist/connectors/store.js +0 -2
  1915. package/dist/consolidate/conflicts.d.ts +0 -10
  1916. package/dist/consolidate/conflicts.js +0 -177
  1917. package/dist/consolidate/dag-summary.d.ts +0 -8
  1918. package/dist/consolidate/dag-summary.js +0 -42
  1919. package/dist/consolidate/dag.d.ts +0 -48
  1920. package/dist/consolidate/dag.js +0 -298
  1921. package/dist/consolidate/decay.d.ts +0 -12
  1922. package/dist/consolidate/decay.js +0 -132
  1923. package/dist/consolidate/dedupe.d.ts +0 -45
  1924. package/dist/consolidate/dedupe.js +0 -116
  1925. package/dist/consolidate/flush-units.d.ts +0 -11
  1926. package/dist/consolidate/flush-units.js +0 -66
  1927. package/dist/consolidate/half-life-migration.d.ts +0 -44
  1928. package/dist/consolidate/half-life-migration.js +0 -119
  1929. package/dist/consolidate/llm-passes.d.ts +0 -3
  1930. package/dist/consolidate/llm-passes.js +0 -166
  1931. package/dist/consolidate/memory-value-weights.d.ts +0 -12
  1932. package/dist/consolidate/memory-value-weights.js +0 -21
  1933. package/dist/consolidate/memory-value.d.ts +0 -65
  1934. package/dist/consolidate/memory-value.js +0 -188
  1935. package/dist/consolidate/merge.d.ts +0 -10
  1936. package/dist/consolidate/merge.js +0 -232
  1937. package/dist/consolidate/overlap-index.d.ts +0 -13
  1938. package/dist/consolidate/overlap-index.js +0 -45
  1939. package/dist/consolidate/physics-pass.d.ts +0 -10
  1940. package/dist/consolidate/physics-pass.js +0 -81
  1941. package/dist/consolidate/replay.d.ts +0 -16
  1942. package/dist/consolidate/replay.js +0 -103
  1943. package/dist/consolidate/run.d.ts +0 -67
  1944. package/dist/consolidate/run.js +0 -40
  1945. package/dist/consolidate/sleep.d.ts +0 -21
  1946. package/dist/consolidate/sleep.js +0 -189
  1947. package/dist/consolidate/trace.d.ts +0 -24
  1948. package/dist/consolidate/trace.js +0 -58
  1949. package/dist/consolidate/traces.d.ts +0 -4
  1950. package/dist/consolidate/traces.js +0 -152
  1951. package/dist/core/ablation.d.ts +0 -31
  1952. package/dist/core/ablation.js +0 -71
  1953. package/dist/core/active-scope.d.ts +0 -9
  1954. package/dist/core/active-scope.js +0 -31
  1955. package/dist/core/agent-memory-tools.d.ts +0 -35
  1956. package/dist/core/agent-memory-tools.js +0 -21
  1957. package/dist/core/ambient.d.ts +0 -47
  1958. package/dist/core/ambient.js +0 -188
  1959. package/dist/core/api-errors.d.ts +0 -49
  1960. package/dist/core/api-errors.js +0 -63
  1961. package/dist/core/capture-contract.d.ts +0 -67
  1962. package/dist/core/capture-contract.js +0 -170
  1963. package/dist/core/card.d.ts +0 -50
  1964. package/dist/core/card.js +0 -29
  1965. package/dist/core/compaction-timing.js +0 -9
  1966. package/dist/core/compare.d.ts +0 -48
  1967. package/dist/core/compare.js +0 -86
  1968. package/dist/core/config.d.ts +0 -161
  1969. package/dist/core/config.js +0 -372
  1970. package/dist/core/cosine.d.ts +0 -6
  1971. package/dist/core/cosine.js +0 -22
  1972. package/dist/core/handoff.d.ts +0 -54
  1973. package/dist/core/handoff.js +0 -84
  1974. package/dist/core/markdown.d.ts +0 -6
  1975. package/dist/core/markdown.js +0 -115
  1976. package/dist/core/memory-audit.d.ts +0 -17
  1977. package/dist/core/memory-audit.js +0 -65
  1978. package/dist/core/memory-quality.d.ts +0 -44
  1979. package/dist/core/memory-quality.js +0 -227
  1980. package/dist/core/memory.d.ts +0 -246
  1981. package/dist/core/memory.js +0 -436
  1982. package/dist/core/merged-row.d.ts +0 -12
  1983. package/dist/core/merged-row.js +0 -43
  1984. package/dist/core/object-types.d.ts +0 -189
  1985. package/dist/core/object-types.js +0 -4
  1986. package/dist/core/package-root.d.ts +0 -5
  1987. package/dist/core/package-root.js +0 -7
  1988. package/dist/core/particle-refresh.d.ts +0 -8
  1989. package/dist/core/particle-refresh.js +0 -22
  1990. package/dist/core/physics-config.d.ts +0 -37
  1991. package/dist/core/physics-config.js +0 -29
  1992. package/dist/core/physics.d.ts +0 -102
  1993. package/dist/core/physics.js +0 -354
  1994. package/dist/core/prediction.d.ts +0 -3
  1995. package/dist/core/prediction.js +0 -6
  1996. package/dist/core/project-identity.d.ts +0 -83
  1997. package/dist/core/project-identity.js +0 -276
  1998. package/dist/core/project-remote.d.ts +0 -16
  1999. package/dist/core/project-remote.js +0 -166
  2000. package/dist/core/prompt-recall.d.ts +0 -38
  2001. package/dist/core/prompt-recall.js +0 -80
  2002. package/dist/core/raw-append-only.d.ts +0 -5
  2003. package/dist/core/raw-append-only.js +0 -7
  2004. package/dist/core/recall-scope.d.ts +0 -91
  2005. package/dist/core/recall-scope.js +0 -165
  2006. package/dist/core/rejection-digest.d.ts +0 -7
  2007. package/dist/core/rejection-digest.js +0 -13
  2008. package/dist/core/salience.d.ts +0 -18
  2009. package/dist/core/salience.js +0 -96
  2010. package/dist/core/search-types.d.ts +0 -106
  2011. package/dist/core/search-types.js +0 -15
  2012. package/dist/core/session-digest-row.d.ts +0 -5
  2013. package/dist/core/session-digest-row.js +0 -6
  2014. package/dist/dashboard/dashboard-actions.d.ts +0 -20
  2015. package/dist/dashboard/dashboard-actions.js +0 -100
  2016. package/dist/dashboard/dashboard-params.d.ts +0 -45
  2017. package/dist/dashboard/dashboard-params.js +0 -127
  2018. package/dist/dashboard/dashboard-queries.d.ts +0 -20
  2019. package/dist/dashboard/dashboard-queries.js +0 -346
  2020. package/dist/dashboard/dashboard-snapshot.d.ts +0 -139
  2021. package/dist/dashboard/dashboard-snapshot.js +0 -312
  2022. package/dist/dashboard/dashboard-types.d.ts +0 -164
  2023. package/dist/dashboard/dashboard-types.js +0 -3
  2024. package/dist/dashboard/dashboard.d.ts +0 -9
  2025. package/dist/dashboard/dashboard.js +0 -427
  2026. package/dist/db/continuity.d.ts +0 -11
  2027. package/dist/db/continuity.js +0 -206
  2028. package/dist/doctor.d.ts +0 -40
  2029. package/dist/doctor.js +0 -452
  2030. package/dist/embeddings/local.d.ts +0 -66
  2031. package/dist/embeddings/local.js +0 -150
  2032. package/dist/embeddings/provider.d.ts +0 -52
  2033. package/dist/embeddings/provider.js +0 -310
  2034. package/dist/embeddings/transformers.d.ts +0 -38
  2035. package/dist/embeddings/transformers.js +0 -106
  2036. package/dist/entry/sqlite-handles.d.ts +0 -10
  2037. package/dist/entry/sqlite-handles.js +0 -9
  2038. package/dist/eval/eval-stats.d.ts +0 -172
  2039. package/dist/eval/eval-stats.js +0 -283
  2040. package/dist/eval/eval-suite.d.ts +0 -73
  2041. package/dist/eval/eval-suite.js +0 -570
  2042. package/dist/eval/eval.d.ts +0 -91
  2043. package/dist/eval/eval.js +0 -173
  2044. package/dist/eval/judgment.d.ts +0 -25
  2045. package/dist/eval/judgment.js +0 -138
  2046. package/dist/eval/repository-t.js +0 -290
  2047. package/dist/graph/delta.d.ts +0 -12
  2048. package/dist/graph/delta.js +0 -101
  2049. package/dist/graph/extract.d.ts +0 -69
  2050. package/dist/graph/extract.js +0 -279
  2051. package/dist/graph/recall.d.ts +0 -50
  2052. package/dist/graph/recall.js +0 -260
  2053. package/dist/graph/stream.d.ts +0 -50
  2054. package/dist/graph/stream.js +0 -186
  2055. package/dist/graph/view.d.ts +0 -63
  2056. package/dist/graph/view.js +0 -298
  2057. package/dist/hooks/codex-session.js +0 -77
  2058. package/dist/hooks/codex-wrapper.d.ts +0 -57
  2059. package/dist/hooks/codex-wrapper.js +0 -294
  2060. package/dist/hooks/copilot.d.ts +0 -94
  2061. package/dist/hooks/copilot.js +0 -312
  2062. package/dist/hooks/hook-blocks.d.ts +0 -27
  2063. package/dist/hooks/hook-blocks.js +0 -154
  2064. package/dist/hooks/json-hooks.d.ts +0 -48
  2065. package/dist/hooks/json-hooks.js +0 -445
  2066. package/dist/hooks/opencode.d.ts +0 -12
  2067. package/dist/hooks/opencode.js +0 -157
  2068. package/dist/hooks/shared.d.ts +0 -62
  2069. package/dist/hooks/shared.js +0 -134
  2070. package/dist/importers/core.d.ts +0 -44
  2071. package/dist/importers/core.js +0 -111
  2072. package/dist/importers/markdown-parse.d.ts +0 -28
  2073. package/dist/importers/markdown-parse.js +0 -107
  2074. package/dist/importers/markdown.d.ts +0 -3
  2075. package/dist/importers/markdown.js +0 -81
  2076. package/dist/importers/sources.d.ts +0 -7
  2077. package/dist/importers/sources.js +0 -194
  2078. package/dist/importers/vault.d.ts +0 -5
  2079. package/dist/importers/vault.js +0 -277
  2080. package/dist/learn/autolearn.d.ts +0 -52
  2081. package/dist/learn/autolearn.js +0 -205
  2082. package/dist/learn/churn-git.d.ts +0 -25
  2083. package/dist/learn/churn-git.js +0 -139
  2084. package/dist/learn/extract.d.ts +0 -20
  2085. package/dist/learn/extract.js +0 -132
  2086. package/dist/learn/forward-claim-detector.d.ts +0 -24
  2087. package/dist/learn/forward-claim-detector.js +0 -81
  2088. package/dist/learn/invalidation.d.ts +0 -72
  2089. package/dist/learn/invalidation.js +0 -446
  2090. package/dist/learn/roots.d.ts +0 -3
  2091. package/dist/learn/roots.js +0 -5
  2092. package/dist/mcp/admin-tools.d.ts +0 -8
  2093. package/dist/mcp/admin-tools.js +0 -107
  2094. package/dist/mcp/format.d.ts +0 -27
  2095. package/dist/mcp/format.js +0 -140
  2096. package/dist/mcp/framing.d.ts +0 -21
  2097. package/dist/mcp/framing.js +0 -62
  2098. package/dist/mcp/memory-tools.d.ts +0 -5
  2099. package/dist/mcp/memory-tools.js +0 -70
  2100. package/dist/mcp/protocol.d.ts +0 -84
  2101. package/dist/mcp/protocol.js +0 -62
  2102. package/dist/mcp/recall-tools.d.ts +0 -6
  2103. package/dist/mcp/recall-tools.js +0 -234
  2104. package/dist/mcp/request.d.ts +0 -9
  2105. package/dist/mcp/request.js +0 -166
  2106. package/dist/mcp/server.d.ts +0 -10
  2107. package/dist/mcp/server.js +0 -35
  2108. package/dist/mcp/session-state.d.ts +0 -12
  2109. package/dist/mcp/session-state.js +0 -29
  2110. package/dist/mcp/shared-gate.d.ts +0 -5
  2111. package/dist/mcp/shared-gate.js +0 -23
  2112. package/dist/mcp/stdio.d.ts +0 -7
  2113. package/dist/mcp/stdio.js +0 -206
  2114. package/dist/mcp/tool-args.d.ts +0 -24
  2115. package/dist/mcp/tool-args.js +0 -87
  2116. package/dist/mcp/tools.js +0 -320
  2117. package/dist/objects/customer-notes.d.ts +0 -46
  2118. package/dist/objects/customer-notes.js +0 -77
  2119. package/dist/objects/decisions.d.ts +0 -49
  2120. package/dist/objects/decisions.js +0 -69
  2121. package/dist/objects/descriptor.d.ts +0 -52
  2122. package/dist/objects/descriptor.js +0 -5
  2123. package/dist/objects/fields.d.ts +0 -18
  2124. package/dist/objects/fields.js +0 -25
  2125. package/dist/objects/incidents.d.ts +0 -43
  2126. package/dist/objects/incidents.js +0 -95
  2127. package/dist/objects/lifecycle.d.ts +0 -23
  2128. package/dist/objects/lifecycle.js +0 -94
  2129. package/dist/objects/policies.d.ts +0 -56
  2130. package/dist/objects/policies.js +0 -99
  2131. package/dist/objects/processes.d.ts +0 -49
  2132. package/dist/objects/processes.js +0 -97
  2133. package/dist/objects/project-briefs.d.ts +0 -62
  2134. package/dist/objects/project-briefs.js +0 -187
  2135. package/dist/objects/skills.d.ts +0 -49
  2136. package/dist/objects/skills.js +0 -105
  2137. package/dist/postinstall.d.ts +0 -2
  2138. package/dist/postinstall.js +0 -96
  2139. package/dist/predictions/planning-fallacy.d.ts +0 -65
  2140. package/dist/predictions/planning-fallacy.js +0 -76
  2141. package/dist/rerankers/clef.d.ts +0 -31
  2142. package/dist/rerankers/clef.js +0 -178
  2143. package/dist/rerankers/cross-encoder.d.ts +0 -34
  2144. package/dist/rerankers/cross-encoder.js +0 -105
  2145. package/dist/rerankers/index.d.ts +0 -4
  2146. package/dist/rerankers/index.js +0 -26
  2147. package/dist/rerankers/jev.d.ts +0 -18
  2148. package/dist/rerankers/jev.js +0 -112
  2149. package/dist/rerankers/llm.d.ts +0 -9
  2150. package/dist/rerankers/llm.js +0 -88
  2151. package/dist/rerankers/outage-warning.d.ts +0 -10
  2152. package/dist/rerankers/outage-warning.js +0 -34
  2153. package/dist/rerankers/remote.d.ts +0 -6
  2154. package/dist/rerankers/remote.js +0 -28
  2155. package/dist/rerankers/types.d.ts +0 -45
  2156. package/dist/search/as-of.d.ts +0 -10
  2157. package/dist/search/as-of.js +0 -22
  2158. package/dist/search/bm25-search.d.ts +0 -16
  2159. package/dist/search/bm25-search.js +0 -57
  2160. package/dist/search/bm25.d.ts +0 -15
  2161. package/dist/search/bm25.js +0 -54
  2162. package/dist/search/boosts.d.ts +0 -56
  2163. package/dist/search/boosts.js +0 -117
  2164. package/dist/search/breakdown.d.ts +0 -7
  2165. package/dist/search/breakdown.js +0 -21
  2166. package/dist/search/embed-memories.d.ts +0 -17
  2167. package/dist/search/embed-memories.js +0 -415
  2168. package/dist/search/engine.d.ts +0 -11
  2169. package/dist/search/engine.js +0 -14
  2170. package/dist/search/explain.d.ts +0 -25
  2171. package/dist/search/explain.js +0 -32
  2172. package/dist/search/finalize.d.ts +0 -8
  2173. package/dist/search/finalize.js +0 -53
  2174. package/dist/search/fusion.d.ts +0 -27
  2175. package/dist/search/fusion.js +0 -42
  2176. package/dist/search/goal-boost.d.ts +0 -30
  2177. package/dist/search/goal-boost.js +0 -100
  2178. package/dist/search/hybrid-score.d.ts +0 -23
  2179. package/dist/search/hybrid-score.js +0 -76
  2180. package/dist/search/hybrid.d.ts +0 -73
  2181. package/dist/search/hybrid.js +0 -78
  2182. package/dist/search/multihop.d.ts +0 -12
  2183. package/dist/search/multihop.js +0 -42
  2184. package/dist/search/path-context.d.ts +0 -18
  2185. package/dist/search/path-context.js +0 -44
  2186. package/dist/search/physics-search.d.ts +0 -40
  2187. package/dist/search/physics-search.js +0 -199
  2188. package/dist/search/rerank.d.ts +0 -11
  2189. package/dist/search/rerank.js +0 -74
  2190. package/dist/search/rrf.d.ts +0 -24
  2191. package/dist/search/rrf.js +0 -43
  2192. package/dist/search/temporal.d.ts +0 -15
  2193. package/dist/search/temporal.js +0 -48
  2194. package/dist/search/vector.d.ts +0 -50
  2195. package/dist/search/vector.js +0 -126
  2196. package/dist/server/auth.d.ts +0 -41
  2197. package/dist/server/auth.js +0 -323
  2198. package/dist/server/boot.d.ts +0 -8
  2199. package/dist/server/boot.js +0 -421
  2200. package/dist/server/client-ip.d.ts +0 -25
  2201. package/dist/server/client-ip.js +0 -132
  2202. package/dist/server/cursor.d.ts +0 -30
  2203. package/dist/server/cursor.js +0 -65
  2204. package/dist/server/deadline.d.ts +0 -14
  2205. package/dist/server/deadline.js +0 -46
  2206. package/dist/server/defaults.js +0 -5
  2207. package/dist/server/key-check-bounds.d.ts +0 -9
  2208. package/dist/server/key-check-bounds.js +0 -54
  2209. package/dist/server/lifecycle.d.ts +0 -11
  2210. package/dist/server/lifecycle.js +0 -50
  2211. package/dist/server/mcp-http.d.ts +0 -9
  2212. package/dist/server/mcp-http.js +0 -238
  2213. package/dist/server/rate-limit.d.ts +0 -33
  2214. package/dist/server/rate-limit.js +0 -82
  2215. package/dist/server/ready.d.ts +0 -7
  2216. package/dist/server/ready.js +0 -41
  2217. package/dist/server/request.d.ts +0 -43
  2218. package/dist/server/request.js +0 -177
  2219. package/dist/server/route-checks.d.ts +0 -10
  2220. package/dist/server/route-checks.js +0 -47
  2221. package/dist/server/route-table.d.ts +0 -18
  2222. package/dist/server/route-table.js +0 -650
  2223. package/dist/server/routes/admin.d.ts +0 -9
  2224. package/dist/server/routes/admin.js +0 -177
  2225. package/dist/server/routes/customer-notes.d.ts +0 -7
  2226. package/dist/server/routes/customer-notes.js +0 -43
  2227. package/dist/server/routes/decisions.d.ts +0 -7
  2228. package/dist/server/routes/decisions.js +0 -68
  2229. package/dist/server/routes/incidents.d.ts +0 -7
  2230. package/dist/server/routes/incidents.js +0 -70
  2231. package/dist/server/routes/memories.d.ts +0 -10
  2232. package/dist/server/routes/memories.js +0 -140
  2233. package/dist/server/routes/object-routes.d.ts +0 -38
  2234. package/dist/server/routes/object-routes.js +0 -71
  2235. package/dist/server/routes/policies.d.ts +0 -8
  2236. package/dist/server/routes/policies.js +0 -65
  2237. package/dist/server/routes/predictions.d.ts +0 -7
  2238. package/dist/server/routes/predictions.js +0 -134
  2239. package/dist/server/routes/processes.d.ts +0 -7
  2240. package/dist/server/routes/processes.js +0 -80
  2241. package/dist/server/routes/project-briefs.d.ts +0 -8
  2242. package/dist/server/routes/project-briefs.js +0 -57
  2243. package/dist/server/routes/recall.d.ts +0 -8
  2244. package/dist/server/routes/recall.js +0 -147
  2245. package/dist/server/routes/skills.d.ts +0 -8
  2246. package/dist/server/routes/skills.js +0 -59
  2247. package/dist/server/server-detect.d.ts +0 -50
  2248. package/dist/server/server-detect.js +0 -216
  2249. package/dist/server/sleep-child.js +0 -44
  2250. package/dist/server/sleep-offload.d.ts +0 -29
  2251. package/dist/server/sleep-offload.js +0 -101
  2252. package/dist/server/tls.d.ts +0 -14
  2253. package/dist/server/tls.js +0 -44
  2254. package/dist/server/types.d.ts +0 -144
  2255. package/dist/server/types.js +0 -2
  2256. package/dist/server/validation.d.ts +0 -19
  2257. package/dist/server/validation.js +0 -91
  2258. package/dist/sharing/global-store.d.ts +0 -13
  2259. package/dist/sharing/global-store.js +0 -35
  2260. package/dist/sharing/global-sync.d.ts +0 -8
  2261. package/dist/sharing/global-sync.js +0 -83
  2262. package/dist/sharing/project-merge.d.ts +0 -83
  2263. package/dist/sharing/project-merge.js +0 -284
  2264. package/dist/sharing/search-both.d.ts +0 -64
  2265. package/dist/sharing/search-both.js +0 -152
  2266. package/dist/sharing/share.d.ts +0 -44
  2267. package/dist/sharing/share.js +0 -251
  2268. package/dist/store/ambient.d.ts +0 -16
  2269. package/dist/store/ambient.js +0 -91
  2270. package/dist/store/audit-event.d.ts +0 -17
  2271. package/dist/store/audit-event.js +0 -31
  2272. package/dist/store/audit.d.ts +0 -79
  2273. package/dist/store/audit.js +0 -258
  2274. package/dist/store/auth.d.ts +0 -143
  2275. package/dist/store/auth.js +0 -334
  2276. package/dist/store/busy.d.ts +0 -9
  2277. package/dist/store/busy.js +0 -16
  2278. package/dist/store/candidates.d.ts +0 -89
  2279. package/dist/store/candidates.js +0 -324
  2280. package/dist/store/capture-write.d.ts +0 -18
  2281. package/dist/store/capture-write.js +0 -36
  2282. package/dist/store/card-detail.d.ts +0 -15
  2283. package/dist/store/card-detail.js +0 -23
  2284. package/dist/store/cards.d.ts +0 -77
  2285. package/dist/store/cards.js +0 -432
  2286. package/dist/store/compaction-caller.d.ts +0 -19
  2287. package/dist/store/compaction-caller.js +0 -30
  2288. package/dist/store/compactions-record.d.ts +0 -121
  2289. package/dist/store/compactions-record.js +0 -481
  2290. package/dist/store/compactions.d.ts +0 -78
  2291. package/dist/store/compactions.js +0 -115
  2292. package/dist/store/conflicts.d.ts +0 -70
  2293. package/dist/store/conflicts.js +0 -507
  2294. package/dist/store/connectors/dlq.d.ts +0 -22
  2295. package/dist/store/connectors/dlq.js +0 -84
  2296. package/dist/store/connectors/event-log.d.ts +0 -122
  2297. package/dist/store/connectors/event-log.js +0 -25
  2298. package/dist/store/connectors/github.d.ts +0 -85
  2299. package/dist/store/connectors/github.js +0 -139
  2300. package/dist/store/connectors/slack.d.ts +0 -61
  2301. package/dist/store/connectors/slack.js +0 -132
  2302. package/dist/store/dashboard-reads.d.ts +0 -31
  2303. package/dist/store/dashboard-reads.js +0 -111
  2304. package/dist/store/delete-and-batch.d.ts +0 -72
  2305. package/dist/store/delete-and-batch.js +0 -394
  2306. package/dist/store/delivery-recorder.d.ts +0 -150
  2307. package/dist/store/delivery-recorder.js +0 -303
  2308. package/dist/store/descendant-page.d.ts +0 -13
  2309. package/dist/store/descendant-page.js +0 -118
  2310. package/dist/store/diagnostics.d.ts +0 -48
  2311. package/dist/store/diagnostics.js +0 -45
  2312. package/dist/store/doctor-reads.d.ts +0 -17
  2313. package/dist/store/doctor-reads.js +0 -27
  2314. package/dist/store/dormant.d.ts +0 -113
  2315. package/dist/store/dormant.js +0 -269
  2316. package/dist/store/embeddings/index.d.ts +0 -30
  2317. package/dist/store/embeddings/index.js +0 -62
  2318. package/dist/store/entry-reads.d.ts +0 -146
  2319. package/dist/store/entry-reads.js +0 -506
  2320. package/dist/store/entry-row.d.ts +0 -27
  2321. package/dist/store/entry-row.js +0 -216
  2322. package/dist/store/entry-writes.d.ts +0 -85
  2323. package/dist/store/entry-writes.js +0 -267
  2324. package/dist/store/failure-log-at.d.ts +0 -8
  2325. package/dist/store/failure-log-at.js +0 -16
  2326. package/dist/store/failure-log.d.ts +0 -64
  2327. package/dist/store/failure-log.js +0 -91
  2328. package/dist/store/gated-write.d.ts +0 -11
  2329. package/dist/store/gated-write.js +0 -28
  2330. package/dist/store/goals.d.ts +0 -97
  2331. package/dist/store/goals.js +0 -261
  2332. package/dist/store/graph-apply.d.ts +0 -21
  2333. package/dist/store/graph-apply.js +0 -75
  2334. package/dist/store/graph-queue.d.ts +0 -16
  2335. package/dist/store/graph-queue.js +0 -75
  2336. package/dist/store/graph-reads.d.ts +0 -46
  2337. package/dist/store/graph-reads.js +0 -246
  2338. package/dist/store/graph-rows.d.ts +0 -183
  2339. package/dist/store/graph-rows.js +0 -62
  2340. package/dist/store/graph-view-rows.d.ts +0 -13
  2341. package/dist/store/graph-view-rows.js +0 -76
  2342. package/dist/store/graph-writes.d.ts +0 -39
  2343. package/dist/store/graph-writes.js +0 -232
  2344. package/dist/store/half-life.d.ts +0 -35
  2345. package/dist/store/half-life.js +0 -75
  2346. package/dist/store/handoffs.d.ts +0 -32
  2347. package/dist/store/handoffs.js +0 -237
  2348. package/dist/store/index-and-stats.d.ts +0 -42
  2349. package/dist/store/index-and-stats.js +0 -164
  2350. package/dist/store/index.d.ts +0 -6
  2351. package/dist/store/index.js +0 -4
  2352. package/dist/store/key-audit.d.ts +0 -7
  2353. package/dist/store/key-audit.js +0 -26
  2354. package/dist/store/key-writes.d.ts +0 -17
  2355. package/dist/store/key-writes.js +0 -63
  2356. package/dist/store/ledger-turn.d.ts +0 -29
  2357. package/dist/store/ledger-turn.js +0 -70
  2358. package/dist/store/mirrors.d.ts +0 -37
  2359. package/dist/store/mirrors.js +0 -373
  2360. package/dist/store/narrow.d.ts +0 -6
  2361. package/dist/store/narrow.js +0 -11
  2362. package/dist/store/open.d.ts +0 -20
  2363. package/dist/store/open.js +0 -200
  2364. package/dist/store/pilot-arm.d.ts +0 -13
  2365. package/dist/store/pilot-arm.js +0 -54
  2366. package/dist/store/planning-fallacy-evidence.d.ts +0 -14
  2367. package/dist/store/planning-fallacy-evidence.js +0 -55
  2368. package/dist/store/port/agent-import.d.ts +0 -62
  2369. package/dist/store/port/agent-import.js +0 -2
  2370. package/dist/store/port/consolidation.d.ts +0 -129
  2371. package/dist/store/port/consolidation.js +0 -2
  2372. package/dist/store/port/learning.d.ts +0 -19
  2373. package/dist/store/port/learning.js +0 -2
  2374. package/dist/store/port/local-files.d.ts +0 -18
  2375. package/dist/store/port/local-files.js +0 -2
  2376. package/dist/store/port/promotion.d.ts +0 -20
  2377. package/dist/store/port/promotion.js +0 -3
  2378. package/dist/store/port-groups.d.ts +0 -160
  2379. package/dist/store/port-groups.js +0 -2
  2380. package/dist/store/port.d.ts +0 -697
  2381. package/dist/store/port.js +0 -19
  2382. package/dist/store/predictions.d.ts +0 -104
  2383. package/dist/store/predictions.js +0 -358
  2384. package/dist/store/project-tags.d.ts +0 -65
  2385. package/dist/store/project-tags.js +0 -78
  2386. package/dist/store/quality-repair.d.ts +0 -31
  2387. package/dist/store/quality-repair.js +0 -226
  2388. package/dist/store/quarantine.d.ts +0 -33
  2389. package/dist/store/quarantine.js +0 -123
  2390. package/dist/store/raw-archive.d.ts +0 -15
  2391. package/dist/store/raw-archive.js +0 -81
  2392. package/dist/store/recall-trace.d.ts +0 -121
  2393. package/dist/store/recall-trace.js +0 -314
  2394. package/dist/store/rejected-values.d.ts +0 -60
  2395. package/dist/store/rejected-values.js +0 -177
  2396. package/dist/store/rejection-probe.d.ts +0 -4
  2397. package/dist/store/rejection-probe.js +0 -19
  2398. package/dist/store/rejection.d.ts +0 -38
  2399. package/dist/store/rejection.js +0 -81
  2400. package/dist/store/report-reads.d.ts +0 -7
  2401. package/dist/store/report-reads.js +0 -30
  2402. package/dist/store/rows.d.ts +0 -163
  2403. package/dist/store/rows.js +0 -169
  2404. package/dist/store/rule-sql.d.ts +0 -18
  2405. package/dist/store/rule-sql.js +0 -69
  2406. package/dist/store/search-rows.d.ts +0 -57
  2407. package/dist/store/search-rows.js +0 -227
  2408. package/dist/store/sessions.d.ts +0 -82
  2409. package/dist/store/sessions.js +0 -315
  2410. package/dist/store/set-aside.d.ts +0 -14
  2411. package/dist/store/set-aside.js +0 -36
  2412. package/dist/store/sqlite/agent-import.d.ts +0 -3
  2413. package/dist/store/sqlite/agent-import.js +0 -77
  2414. package/dist/store/sqlite/cards-group.d.ts +0 -6
  2415. package/dist/store/sqlite/cards-group.js +0 -37
  2416. package/dist/store/sqlite/commit-watch.d.ts +0 -4
  2417. package/dist/store/sqlite/commit-watch.js +0 -29
  2418. package/dist/store/sqlite/conflicts-group.d.ts +0 -6
  2419. package/dist/store/sqlite/conflicts-group.js +0 -18
  2420. package/dist/store/sqlite/connector-events-group.d.ts +0 -6
  2421. package/dist/store/sqlite/connector-events-group.js +0 -58
  2422. package/dist/store/sqlite/connector-writes-group.d.ts +0 -7
  2423. package/dist/store/sqlite/connector-writes-group.js +0 -72
  2424. package/dist/store/sqlite/consolidation-group.d.ts +0 -4
  2425. package/dist/store/sqlite/consolidation-group.js +0 -64
  2426. package/dist/store/sqlite/dag-reads-group.d.ts +0 -3
  2427. package/dist/store/sqlite/dag-reads-group.js +0 -45
  2428. package/dist/store/sqlite/dormant-group.d.ts +0 -6
  2429. package/dist/store/sqlite/dormant-group.js +0 -29
  2430. package/dist/store/sqlite/entry-writes-group.d.ts +0 -21
  2431. package/dist/store/sqlite/entry-writes-group.js +0 -193
  2432. package/dist/store/sqlite/error-codec.d.ts +0 -19
  2433. package/dist/store/sqlite/error-codec.js +0 -84
  2434. package/dist/store/sqlite/executor-counts.js +0 -12
  2435. package/dist/store/sqlite/executor.d.ts +0 -34
  2436. package/dist/store/sqlite/executor.js +0 -331
  2437. package/dist/store/sqlite/global-promote.d.ts +0 -5
  2438. package/dist/store/sqlite/global-promote.js +0 -48
  2439. package/dist/store/sqlite/goals-group.d.ts +0 -6
  2440. package/dist/store/sqlite/goals-group.js +0 -23
  2441. package/dist/store/sqlite/graph-reads-group.d.ts +0 -6
  2442. package/dist/store/sqlite/graph-reads-group.js +0 -19
  2443. package/dist/store/sqlite/held-connection.d.ts +0 -17
  2444. package/dist/store/sqlite/held-connection.js +0 -68
  2445. package/dist/store/sqlite/last-recall-group.d.ts +0 -15
  2446. package/dist/store/sqlite/last-recall-group.js +0 -62
  2447. package/dist/store/sqlite/learning-group.d.ts +0 -4
  2448. package/dist/store/sqlite/learning-group.js +0 -17
  2449. package/dist/store/sqlite/maintenance-groups.d.ts +0 -6
  2450. package/dist/store/sqlite/maintenance-groups.js +0 -61
  2451. package/dist/store/sqlite/object-rows.d.ts +0 -105
  2452. package/dist/store/sqlite/object-rows.js +0 -250
  2453. package/dist/store/sqlite/objects-group.d.ts +0 -21
  2454. package/dist/store/sqlite/objects-group.js +0 -375
  2455. package/dist/store/sqlite/predictions-group.d.ts +0 -6
  2456. package/dist/store/sqlite/predictions-group.js +0 -30
  2457. package/dist/store/sqlite/promotion-group.d.ts +0 -3
  2458. package/dist/store/sqlite/promotion-group.js +0 -10
  2459. package/dist/store/sqlite/quarantine-group.d.ts +0 -6
  2460. package/dist/store/sqlite/quarantine-group.js +0 -40
  2461. package/dist/store/sqlite/reports-group.d.ts +0 -6
  2462. package/dist/store/sqlite/reports-group.js +0 -33
  2463. package/dist/store/sqlite/request-scope.d.ts +0 -6
  2464. package/dist/store/sqlite/request-scope.js +0 -18
  2465. package/dist/store/sqlite/sessions-group.d.ts +0 -6
  2466. package/dist/store/sqlite/sessions-group.js +0 -46
  2467. package/dist/store/sqlite/vector-pack.d.ts +0 -18
  2468. package/dist/store/sqlite/vector-pack.js +0 -47
  2469. package/dist/store/sqlite/vector-reads-group.d.ts +0 -3
  2470. package/dist/store/sqlite/vector-reads-group.js +0 -24
  2471. package/dist/store/sqlite/worker-entry.js +0 -8
  2472. package/dist/store/sqlite/worker-jobs.d.ts +0 -6
  2473. package/dist/store/sqlite/worker-jobs.js +0 -128
  2474. package/dist/store/sqlite/worker-ops.d.ts +0 -140
  2475. package/dist/store/sqlite/worker-ops.js +0 -96
  2476. package/dist/store/sqlite/worker-store.d.ts +0 -9
  2477. package/dist/store/sqlite/worker-store.js +0 -89
  2478. package/dist/store/summaries.d.ts +0 -43
  2479. package/dist/store/summaries.js +0 -237
  2480. package/dist/store/summary-dirty.d.ts +0 -5
  2481. package/dist/store/summary-dirty.js +0 -33
  2482. package/dist/store/tenant-lookup.d.ts +0 -21
  2483. package/dist/store/tenant-lookup.js +0 -23
  2484. package/dist/store/tenant.d.ts +0 -12
  2485. package/dist/store/tenant.js +0 -29
  2486. package/dist/store/token-ledger-rows.d.ts +0 -61
  2487. package/dist/store/token-ledger-rows.js +0 -72
  2488. package/dist/store/token-ledger.d.ts +0 -124
  2489. package/dist/store/token-ledger.js +0 -204
  2490. package/dist/store/tombstone-checks.d.ts +0 -15
  2491. package/dist/store/tombstone-checks.js +0 -40
  2492. package/dist/store/usage-reports.d.ts +0 -7
  2493. package/dist/store/usage-reports.js +0 -19
  2494. package/dist/store/vector-index.d.ts +0 -49
  2495. package/dist/store/vector-index.js +0 -188
  2496. package/dist/store/working-memory.d.ts +0 -50
  2497. package/dist/store/working-memory.js +0 -123
  2498. package/dist/support-bundle.d.ts +0 -12
  2499. package/dist/support-bundle.js +0 -315
  2500. package/dist/trust/quarantine.d.ts +0 -3
  2501. package/dist/trust/quarantine.js +0 -4
  2502. package/dist/trust/reject-flow.d.ts +0 -32
  2503. package/dist/trust/reject-flow.js +0 -73
  2504. package/dist/util/agent-homes.d.ts +0 -15
  2505. package/dist/util/agent-homes.js +0 -34
  2506. package/dist/util/anthropic-messages.d.ts +0 -39
  2507. package/dist/util/anthropic-messages.js +0 -86
  2508. package/dist/util/atomic-write.d.ts +0 -9
  2509. package/dist/util/atomic-write.js +0 -153
  2510. package/dist/util/chunked.d.ts +0 -3
  2511. package/dist/util/chunked.js +0 -10
  2512. package/dist/util/compaction-items.d.ts +0 -21
  2513. package/dist/util/compaction-items.js +0 -90
  2514. package/dist/util/crash-handlers.d.ts +0 -17
  2515. package/dist/util/crash-handlers.js +0 -81
  2516. package/dist/util/env.d.ts +0 -119
  2517. package/dist/util/env.js +0 -209
  2518. package/dist/util/escape.js +0 -10
  2519. package/dist/util/format.d.ts +0 -5
  2520. package/dist/util/format.js +0 -10
  2521. package/dist/util/home-path.d.ts +0 -6
  2522. package/dist/util/home-path.js +0 -75
  2523. package/dist/util/hook-payload.d.ts +0 -10
  2524. package/dist/util/hook-payload.js +0 -39
  2525. package/dist/util/http-retry.d.ts +0 -41
  2526. package/dist/util/http-retry.js +0 -151
  2527. package/dist/util/http-util.d.ts +0 -70
  2528. package/dist/util/http-util.js +0 -147
  2529. package/dist/util/json.d.ts +0 -20
  2530. package/dist/util/json.js +0 -28
  2531. package/dist/util/keyset.d.ts +0 -13
  2532. package/dist/util/keyset.js +0 -9
  2533. package/dist/util/limits.d.ts +0 -7
  2534. package/dist/util/limits.js +0 -16
  2535. package/dist/util/log.d.ts +0 -48
  2536. package/dist/util/log.js +0 -123
  2537. package/dist/util/net.d.ts +0 -5
  2538. package/dist/util/net.js +0 -19
  2539. package/dist/util/real-path.d.ts +0 -4
  2540. package/dist/util/real-path.js +0 -16
  2541. package/dist/util/request-scope.d.ts +0 -42
  2542. package/dist/util/request-scope.js +0 -66
  2543. package/dist/util/same-text.d.ts +0 -26
  2544. package/dist/util/same-text.js +0 -49
  2545. package/dist/util/secret-detect.d.ts +0 -50
  2546. package/dist/util/secret-detect.js +0 -165
  2547. package/dist/util/spawn-argv.d.ts +0 -11
  2548. package/dist/util/spawn-argv.js +0 -66
  2549. package/dist/util/sql.d.ts +0 -3
  2550. package/dist/util/sql.js +0 -6
  2551. package/dist/util/sqlite-blocked.d.ts +0 -29
  2552. package/dist/util/sqlite-blocked.js +0 -47
  2553. package/dist/util/stored-json.d.ts +0 -12
  2554. package/dist/util/stored-json.js +0 -12
  2555. package/dist/util/stream-tee.d.ts +0 -4
  2556. package/dist/util/stream-tee.js +0 -38
  2557. package/dist/util/time.d.ts +0 -6
  2558. package/dist/util/time.js +0 -7
  2559. package/dist/util/token-text.d.ts +0 -15
  2560. package/dist/util/token-text.js +0 -20
  2561. package/dist/util/tokenize.d.ts +0 -4
  2562. package/dist/util/tokenize.js +0 -24
  2563. package/dist/util/transcript-tail.d.ts +0 -12
  2564. package/dist/util/transcript-tail.js +0 -52
  2565. package/dist/util/vector-codec.js +0 -15
  2566. package/dist/util/version.d.ts +0 -16
  2567. package/dist/util/version.js +0 -31
  2568. package/dist/util/write-budget.d.ts +0 -20
  2569. package/dist/util/write-budget.js +0 -18
  2570. package/dist/util/yaml.d.ts +0 -13
  2571. package/dist/util/yaml.js +0 -131
  2572. package/dist-ui/assets/index-CHlkKdFC.js +0 -33
  2573. package/scripts/postinstall.cjs +0 -18
  2574. /package/dist/{core → base/session}/compaction-timing.d.ts +0 -0
  2575. /package/dist/{util → base/util}/capped-json.d.ts +0 -0
  2576. /package/dist/{util → base/util}/capped-json.js +0 -0
  2577. /package/dist/{util → base/util}/ellipsize.d.ts +0 -0
  2578. /package/dist/{util → base/util}/ellipsize.js +0 -0
  2579. /package/dist/{util → base/util}/escape.d.ts +0 -0
  2580. /package/dist/{util → base/util}/session-id.d.ts +0 -0
  2581. /package/dist/{util → base/util}/session-id.js +0 -0
  2582. /package/dist/{util → base/util}/vector-codec.d.ts +0 -0
  2583. /package/dist/{agent-memories → domain/agent-memories}/codex.d.ts +0 -0
  2584. /package/dist/{agent-memories → domain/agent-memories}/copilot.d.ts +0 -0
  2585. /package/dist/{agent-memories → domain/agent-memories}/gemini.d.ts +0 -0
  2586. /package/dist/{agent-memories → domain/agent-memories}/openclaw.d.ts +0 -0
  2587. /package/dist/{agent-memories → domain/agent-memories}/qwen-code.d.ts +0 -0
  2588. /package/dist/{agent-memories → domain/agent-memories}/types.js +0 -0
  2589. /package/dist/{eval → domain/eval}/repository-t.d.ts +0 -0
  2590. /package/dist/store/sqlite/{executor-counts.d.ts → runtime/executor-counts.d.ts} +0 -0
  2591. /package/dist/store/sqlite/{worker-entry.d.ts → runtime/worker-entry.d.ts} +0 -0
  2592. /package/dist/{hooks → surface/capture}/codex-session.d.ts +0 -0
  2593. /package/dist/{cli → surface/cli}/init.d.ts +0 -0
  2594. /package/dist/{cli → surface/cli}/open-browser.d.ts +0 -0
  2595. /package/dist/{cli → surface/cli}/output.d.ts +0 -0
  2596. /package/dist/{cli → surface/cli}/usage.d.ts +0 -0
  2597. /package/dist/{cli → surface/cli}/verbs/health.d.ts +0 -0
  2598. /package/dist/{cli → surface/cli}/verbs/memory.d.ts +0 -0
  2599. /package/dist/{cli → surface/cli}/verbs/objects.d.ts +0 -0
  2600. /package/dist/{cli → surface/cli}/verbs/sessions.d.ts +0 -0
  2601. /package/dist/{connectors → surface/connectors}/slack/web-client.d.ts +0 -0
  2602. /package/dist/{mcp → surface/mcp}/tools.d.ts +0 -0
  2603. /package/dist/{server → surface/server}/defaults.d.ts +0 -0
  2604. /package/dist/{server → surface/server}/sleep-child.d.ts +0 -0
  2605. /package/dist/{rerankers → surface/server}/types.js +0 -0
@@ -0,0 +1,11 @@
1
+ import type { RerankerFn } from '../base/ports/reranker.js';
2
+ import type { ConfiguredFolder } from '../base/config/configured-folder.js';
3
+ import type { GlobalTargetGroup, StoreWith } from '../base/ports/store.js';
4
+ import type { Context } from './types.js';
5
+ /** The reranker `name` picks from the Context's registry; a blank name picks none and an unknown
6
+ * one throws. */
7
+ export declare function rerankerOf(ctx: Pick<Context, 'infra'>, name: string | null | undefined): RerankerFn | null;
8
+ /** The reach's global write target with an embedder filled in: the host's own, else the
9
+ * context's. */
10
+ export declare function globalTargetOf(ctx: Pick<Context, 'reach' | 'infra'>): ConfiguredFolder<StoreWith<GlobalTargetGroup>> | undefined;
11
+ //# sourceMappingURL=infra.d.ts.map
@@ -0,0 +1,21 @@
1
+ /** The reranker `name` picks from the Context's registry; a blank name picks none and an unknown
2
+ * one throws. */
3
+ export function rerankerOf(ctx, name) {
4
+ if (!name)
5
+ return null;
6
+ const lookup = ctx.infra.reranker;
7
+ if (lookup === undefined) {
8
+ throw new Error(`Unknown reranker: ${name}. This Context's infra names no rerankers`);
9
+ }
10
+ return lookup(name);
11
+ }
12
+ /** The reach's global write target with an embedder filled in: the host's own, else the
13
+ * context's. */
14
+ export function globalTargetOf(ctx) {
15
+ const target = ctx.reach?.globalTarget;
16
+ return (target && {
17
+ ...target,
18
+ embedderFor: target.embedderFor ?? ctx.infra.embedderFor,
19
+ });
20
+ }
21
+ //# sourceMappingURL=infra.js.map
@@ -1,7 +1,17 @@
1
1
  /**
2
- * Prompt-injection detection for untrusted memory content. Same shape
3
- * as secret-detect.ts; leaf module, no store/api/shared imports.
2
+ * Prompt-injection detection for untrusted memory content: a heuristic that patterns can miss,
3
+ * never the boundary. The boundary is the frame every untrusted row prints in
4
+ * (api/context/context-render.ts). Leaf module, no store/api imports.
4
5
  */
6
+ /** What a member's flagged row in a shared scope carries: it is kept, and prints framed as
7
+ * untrusted. */
8
+ export declare const INSTRUCTION_LIKE_TAG = "instruction-like";
9
+ /** What every untrusted write (connector text) carries, so it prints framed whatever the
10
+ * detector said of it. */
11
+ export declare const UNTRUSTED_ORIGIN_TAG = "untrusted-origin";
12
+ /** The tags connector rows written before UNTRUSTED_ORIGIN_TAG carry, so an upgraded store
13
+ * frames them too. */
14
+ export declare const CONNECTOR_SOURCE_TAGS: readonly string[];
5
15
  export interface InstructionDetection {
6
16
  flagged: boolean;
7
17
  reason: string | null;
@@ -1,7 +1,17 @@
1
1
  /**
2
- * Prompt-injection detection for untrusted memory content. Same shape
3
- * as secret-detect.ts; leaf module, no store/api/shared imports.
2
+ * Prompt-injection detection for untrusted memory content: a heuristic that patterns can miss,
3
+ * never the boundary. The boundary is the frame every untrusted row prints in
4
+ * (api/context/context-render.ts). Leaf module, no store/api imports.
4
5
  */
6
+ /** What a member's flagged row in a shared scope carries: it is kept, and prints framed as
7
+ * untrusted. */
8
+ export const INSTRUCTION_LIKE_TAG = 'instruction-like';
9
+ /** What every untrusted write (connector text) carries, so it prints framed whatever the
10
+ * detector said of it. */
11
+ export const UNTRUSTED_ORIGIN_TAG = 'untrusted-origin';
12
+ /** The tags connector rows written before UNTRUSTED_ORIGIN_TAG carry, so an upgraded store
13
+ * frames them too. */
14
+ export const CONNECTOR_SOURCE_TAGS = ['source:slack', 'source:github'];
5
15
  const INSTRUCTION_PATTERNS = [
6
16
  {
7
17
  name: 'override-instructions',
@@ -11,13 +21,17 @@ const INSTRUCTION_PATTERNS = [
11
21
  name: 'role-reassignment',
12
22
  re: /\b(?:you are now|act as|pretend to be)\b[^.\n]{0,40}\b(?:an?\s+)?(?:ai|assistant|agent|system)\b/i,
13
23
  },
14
- { name: 'chat-role-markup', re: /<\|im_start\|>|<\|system\|>|\[INST\]|<\/?system>|###\s*system\s*:/i },
24
+ {
25
+ name: 'chat-role-markup',
26
+ re: /<\|im_start\|>|<\|system\|>|\[INST\]|<\/?system>|###\s*system\s*:/i,
27
+ },
15
28
  {
16
29
  name: 'system-prompt-reference',
17
30
  re: new RegExp(String.raw `\b(?:(?:override|ignore|bypass|replace|reveal)\b[^.\n]{0,40}\b(?:system prompt|developer message)|` +
18
31
  String.raw `(?:system prompt|developer message)\b[^.\n]{0,40}\b(?:override|ignore|bypass|replace|reveal))\b`, 'i'),
19
32
  },
20
- // "always"/"never" alone (ordinary PR prose) doesn't flag without an agent-facing target nearby too.
33
+ // "always"/"never" alone (ordinary PR prose) doesn't flag without an agent-facing target nearby
34
+ // too.
21
35
  {
22
36
  name: 'standing-order',
23
37
  re: new RegExp(String.raw `\b(?:from now on|whenever you|always|never)\b[^.\n]{0,50}\b(?:you must|` +
@@ -39,11 +53,14 @@ const INSTRUCTION_PATTERNS = [
39
53
  },
40
54
  { name: 'unicode-tag-chars', re: /[\u{E0000}-\u{E007F}]/u },
41
55
  ];
42
- // A stray zero-width char has legitimate uses (ZWJ); only a run of 3+ adjacent ones reads as smuggling.
56
+ // A stray zero-width char has legitimate uses (ZWJ); only a run of 3+ adjacent ones reads as
57
+ // smuggling.
43
58
  const ZERO_WIDTH_RUN_RE = /[\u200B-\u200F\u2060-\u2064]{3,}/;
44
- // Reorders what is drawn without changing a byte a pattern reads, and ordinary right-to-left prose never needs one.
59
+ // Reorders what is drawn without changing a byte a pattern reads, and ordinary right-to-left prose
60
+ // never needs one.
45
61
  const BIDI_CONTROL_RE = /[\u202A-\u202E\u2066-\u2069]/;
46
- // A renderer draws a reference as the character it names: decimal, hex, or one of the five names XML defines.
62
+ // A renderer draws a reference as the character it names: decimal, hex, or one of the five names
63
+ // XML defines.
47
64
  const CHARACTER_REFERENCE_RE = /&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(amp|lt|gt|quot|apos));/g;
48
65
  const NAMED_REFERENCES = new Map([
49
66
  ['amp', '&'],
@@ -52,11 +69,11 @@ const NAMED_REFERENCES = new Map([
52
69
  ['quot', '"'],
53
70
  ['apos', "'"],
54
71
  ]);
55
- // Drawn with no width, so one inside a word splits it for a pattern and not for a reader: soft hyphen, joiners,
56
- // zero-width and bidi format characters.
72
+ // Drawn with no width, so one inside a word splits it for a pattern and not for a reader: soft
73
+ // hyphen, joiners, zero-width and bidi format characters.
57
74
  const INVISIBLE_RE = /[\u034F\u00AD\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/g;
58
- // Cyrillic, then Greek, letters drawn like a c e i j o p s x y; closed at those, so Russian or Greek prose folds into
59
- // no phrase a pattern names.
75
+ // Cyrillic, then Greek, letters drawn like a c e i j o p s x y; closed at those, so Russian or
76
+ // Greek prose folds into no phrase a pattern names.
60
77
  const LOOKALIKES = new Map([
61
78
  ['\u0430', 'a'],
62
79
  ['\u0441', 'c'],
@@ -96,18 +113,20 @@ const LOOKALIKES = new Map([
96
113
  ['\u03A5', 'Y'],
97
114
  ]);
98
115
  const GREEK_OR_CYRILLIC_RE = /[\u0370-\u03FF\u0400-\u04FF]/g;
99
- // A line break stays: it is the sentence bound the patterns rely
100
- // on where a list or a chat message ends a line with no full stop.
116
+ // A line break stays: it is the sentence bound the patterns rely on where a list or a chat message
117
+ // ends a line with no full stop.
101
118
  const SPACE_RUN_RE = /[^\S\n]+/g;
102
119
  function referencedCharacter(reference, decimal, hex, name) {
103
120
  if (name !== undefined)
104
121
  return NAMED_REFERENCES.get(name) ?? reference;
105
122
  const code = decimal !== undefined ? Number.parseInt(decimal, 10) : Number.parseInt(hex ?? '', 16);
106
- // NUL, half a surrogate pair and a number past Unicode name no character, so the reference is read as written.
123
+ // NUL, half a surrogate pair and a number past Unicode name no character, so the reference is
124
+ // read as written.
107
125
  const drawn = code > 0 && code <= 0x10ffff && (code < 0xd800 || code > 0xdfff);
108
126
  return drawn ? String.fromCodePoint(code) : reference;
109
127
  }
110
- /** `content` as a reader or a model takes it in. For matching only: what is stored is never this. */
128
+ /** `content` as a reader or a model takes it in. For matching only: what is stored is never
129
+ * this. */
111
130
  function screeningForm(content) {
112
131
  return (content
113
132
  .replace(CHARACTER_REFERENCE_RE, referencedCharacter)
@@ -125,8 +144,8 @@ function matchedPattern(text) {
125
144
  return null;
126
145
  }
127
146
  export function detectInstruction(content) {
128
- // The text as written goes first: a phrase in plain sight is named before any smuggling rule, and the screening form
129
- // only adds flags.
147
+ // The text as written goes first: a phrase in plain sight is named before any smuggling rule, and
148
+ // the screening form only adds flags.
130
149
  const plain = matchedPattern(content);
131
150
  if (plain !== null)
132
151
  return { flagged: true, reason: plain };
@@ -1,21 +1,54 @@
1
- import { type LedgerTurn } from '../store/ledger-turn.js';
2
- import { type HippoStore, type StoreReach } from '../store/port.js';
3
- import type { LastSent, TokenSurface, TokenUse } from '../store/token-ledger.js';
4
- /** The slice of a call's store reach that picks the ledger; a shared store has no `global`. */
5
- export type LedgerReach = Pick<StoreReach, 'hasLocal' | 'global'>;
6
- /** The ledger is SQLite-only: a local store needs a reach that says so and a SQLite store; no reach books nowhere. */
7
- export declare function ledgerReachOf(ctx: {
8
- readonly reach?: StoreReach;
9
- readonly store?: HippoStore;
10
- }, shared?: boolean): LedgerReach;
11
- /** `hippoRoot` when the call has a store of its own, else the global store (the prompt hook fires where none is). */
12
- export declare function ledgerRoot(hippoRoot: string, reach: LedgerReach): string | null;
13
- /** Runs `call` on ledgerRoot's store root; undefined on any failure, since a ledger failure must not break recall. */
14
- export declare function onLedgerRoot<T>(hippoRoot: string, reach: LedgerReach, call: (root: string) => T): T | undefined;
15
- /** Books one row in ledgerRoot's store, best-effort. */
16
- export declare function bookTokenUse(hippoRoot: string, use: TokenUse, reach: LedgerReach): void;
17
- /** Books a turn's rows and then its delivery event on one connection of ledgerRoot's store, best-effort. */
18
- export declare function bookLedgerTurn(hippoRoot: string, turn: LedgerTurn, reach: LedgerReach): void;
19
- /** What the session last sent on `surface` in ledgerRoot's store; undefined with no ledger or a failed read. */
20
- export declare function ledgerLastSent(hippoRoot: string, tenantId: string, sessionId: string | null | undefined, surface: TokenSurface, reach: LedgerReach): LastSent | null | undefined;
1
+ import type { LedgerTurn } from '../base/ports/store.js';
2
+ import type { TokenSurface, TokenUse } from '../base/ports/store/ledger.js';
3
+ import type { LastSent } from '../base/session/skip-unchanged.js';
4
+ import type { Context, GlobalInReach, LedgerHome } from './types.js';
5
+ import { type DeliveryFault, type DeliveryRecorder } from './delivery/delivery-recorder.js';
6
+ import type { DeliveryEventInput, DeliveryEventType } from '../base/session/delivery.js';
7
+ import type { HookRuntime } from '../base/session/capture-contract.js';
8
+ /** Where a call's ledger can sit: its own store, else the operator's global one; a shared store
9
+ * has no `global`. */
10
+ export interface LedgerReach {
11
+ readonly local?: LedgerHome;
12
+ readonly global?: GlobalInReach;
13
+ }
14
+ /** Only a store that keeps a ledger has one, and a local one needs a reach that says the caller
15
+ * has a store. */
16
+ export declare function ledgerReachOf(ctx: Pick<Context, 'reach'>, shared?: boolean): LedgerReach;
17
+ /** The call's own store, else the global store (the prompt hook fires where none is); null with
18
+ * neither. */
19
+ export declare function ledgerHome(reach: LedgerReach): LedgerHome | null;
20
+ /** Books one row in ledgerHome's store, best-effort. */
21
+ export declare function bookTokenUse(use: TokenUse, reach: LedgerReach): Promise<void>;
22
+ /** Books a turn's rows and then its delivery event on one connection of ledgerHome's store,
23
+ * best-effort. */
24
+ export declare function bookLedgerTurn(turn: LedgerTurn, reach: LedgerReach): Promise<void>;
25
+ /** bookLedgerTurn where each row is its own attempt: a row that fails is noted and the rest
26
+ * still land. */
27
+ export declare function bookLedgerTurnPerRow(turn: Omit<LedgerTurn, 'perRow'>, reach: LedgerReach): Promise<void>;
28
+ /** What the session last sent on `surface` in ledgerHome's store; null with no ledger, no row or
29
+ * a failed read. */
30
+ export declare function ledgerLastSent(tenantId: string, sessionId: string | null | undefined, surface: TokenSurface, reach: LedgerReach): Promise<LastSent | null>;
31
+ /** What a hook's delivery row says about the call it records. */
32
+ export interface DeliveryStart {
33
+ stdinText: string | undefined;
34
+ runtime: HookRuntime;
35
+ eventType?: DeliveryEventType;
36
+ /** The host's own session id from its environment, used when the payload names none. */
37
+ envSessionId: string | undefined;
38
+ /** Passed through to the recorder; only tests set it. */
39
+ fault?: DeliveryFault;
40
+ }
41
+ /** A delivery recorder for a hook on `ctx`'s store when the ledger store enables one, else null;
42
+ * never throws. */
43
+ export declare function startDeliveryRecorder(ctx: Context, start: DeliveryStart): Promise<DeliveryRecorder | null>;
44
+ /** A recorder for `hippo capture-error`, only when the failure log and the ledger are one store,
45
+ * so `failure_id` never points into another. */
46
+ export declare function startToolFailureRecorder(ctx: Context, start: Omit<DeliveryStart, 'eventType'>): Promise<DeliveryRecorder | null>;
47
+ /** The recorder's event for a turn to write after its rows; undefined with no recorder, a second
48
+ * take or a failure. */
49
+ export declare function takeDelivery(rec: DeliveryRecorder | null): DeliveryEventInput | undefined;
50
+ /** Writes the recorder's event; a second flush is a no-op. A recorder started before the request
51
+ * that flushes it passes that request's `ctx`, so the write takes the request's handle and lock
52
+ * wait. */
53
+ export declare function flushDeliveryRecorder(rec: DeliveryRecorder | null, ctx?: Pick<Context, 'reach' | 'store' | 'config'>): Promise<void>;
21
54
  //# sourceMappingURL=ledger-db.d.ts.map
@@ -1,47 +1,103 @@
1
- // The store the token ledger writes to for a caller's root; context, recall and the session hooks share it.
2
- import { errorMessage, log, errorFields } from '../util/log.js';
3
- import { lastSentOnSurface, noteLedgerRowSkipped, recordLedgerTurn, recordTokensAt, } from '../store/ledger-turn.js';
4
- import { hasGroup } from '../store/port.js';
5
- /** The ledger is SQLite-only: a local store needs a reach that says so and a SQLite store; no reach books nowhere. */
1
+ import { createDeliveryRecorder, } from './delivery/delivery-recorder.js';
2
+ import { errorMessage, log, errorFields } from '../base/util/log.js';
3
+ function homeOf(global) {
4
+ return {
5
+ ledger: global.store.ledger,
6
+ folderFiles: global.store.folderFiles,
7
+ config: global.config,
8
+ };
9
+ }
10
+ /** Only a store that keeps a ledger has one, and a local one needs a reach that says the caller
11
+ * has a store. */
6
12
  export function ledgerReachOf(ctx, shared) {
7
- const hasLocal = ctx.reach?.hasLocal === true && (ctx.store === undefined || hasGroup(ctx.store, 'localFiles'));
8
- return shared === true ? { hasLocal } : { hasLocal, global: ctx.reach?.global };
13
+ const local = ctx.reach?.hasLocal === true ? ctx.reach.ledger : undefined;
14
+ return shared === true ? { local } : { local, global: ctx.reach?.global };
15
+ }
16
+ /** The call's own store, else the global store (the prompt hook fires where none is); null with
17
+ * neither. */
18
+ export function ledgerHome(reach) {
19
+ if (reach.local !== undefined)
20
+ return reach.local;
21
+ const { global } = reach;
22
+ return global === undefined ? null : homeOf(global);
23
+ }
24
+ /** Books one row in ledgerHome's store, best-effort. */
25
+ export async function bookTokenUse(use, reach) {
26
+ await ledgerHome(reach)?.ledger.recordTurn({ uses: [use] });
27
+ }
28
+ /** Books a turn's rows and then its delivery event on one connection of ledgerHome's store,
29
+ * best-effort. */
30
+ export async function bookLedgerTurn(turn, reach) {
31
+ await ledgerHome(reach)?.ledger.recordTurn(turn);
32
+ }
33
+ /** bookLedgerTurn where each row is its own attempt: a row that fails is noted and the rest
34
+ * still land. */
35
+ export async function bookLedgerTurnPerRow(turn, reach) {
36
+ await ledgerHome(reach)?.ledger.recordTurn({ ...turn, perRow: true });
9
37
  }
10
- /** `hippoRoot` when the call has a store of its own, else the global store (the prompt hook fires where none is). */
11
- export function ledgerRoot(hippoRoot, reach) {
12
- return reach.hasLocal ? hippoRoot : (reach.global?.root ?? null);
38
+ /** What the session last sent on `surface` in ledgerHome's store; null with no ledger, no row or
39
+ * a failed read. */
40
+ export async function ledgerLastSent(tenantId, sessionId, surface, reach) {
41
+ return (await ledgerHome(reach)?.ledger.lastSent(tenantId, sessionId, surface)) ?? null;
13
42
  }
14
- /** Runs `call` on ledgerRoot's store root; undefined on any failure, since a ledger failure must not break recall. */
15
- export function onLedgerRoot(hippoRoot, reach, call) {
16
- let root = null;
43
+ /** A delivery recorder for a hook on `ctx`'s store when the ledger store enables one, else null;
44
+ * never throws. */
45
+ export async function startDeliveryRecorder(ctx, start) {
17
46
  try {
18
- root = ledgerRoot(hippoRoot, reach);
47
+ // The same store the token ledger writes to, so its config governs both.
48
+ const reach = ledgerReachOf(ctx);
49
+ const home = ledgerHome(reach);
50
+ if (home === null || !home.config.deliveryLedger.enabled)
51
+ return null;
52
+ return createDeliveryRecorder({
53
+ ledger: home.ledger,
54
+ storeHash: (await home.folderFiles.home()).hash,
55
+ // ledgerHome falls back to the global store only when the primary is not initialized.
56
+ writeStore: home !== reach.local || ctx.reach?.isGlobal === true ? 'global' : 'local',
57
+ tenantId: ctx.tenantId,
58
+ stdinText: start.stdinText,
59
+ envSessionId: start.envSessionId,
60
+ runtime: start.runtime === 'copilot' ? 'copilot' : undefined,
61
+ eventType: start.eventType,
62
+ fault: start.fault,
63
+ now: ctx.infra.clock(),
64
+ });
19
65
  }
20
66
  catch (error) {
21
- // An unreadable store root means no ledger write; the ledger must never break context or recall.
22
- log.debug(`token ledger skipped, store root unreadable: ${errorMessage(error)}`, errorFields(error));
23
- return undefined;
67
+ log.warn(`delivery ledger skipped: ${errorMessage(error)}`, errorFields(error));
68
+ return null;
24
69
  }
25
- if (root === null)
70
+ }
71
+ /** A recorder for `hippo capture-error`, only when the failure log and the ledger are one store,
72
+ * so `failure_id` never points into another. */
73
+ export async function startToolFailureRecorder(ctx, start) {
74
+ const reach = ledgerReachOf(ctx);
75
+ // ledgerHome is the call's own store only when it is the local one.
76
+ if (reach.local === undefined)
77
+ return null;
78
+ return startDeliveryRecorder(ctx, { ...start, eventType: 'tool-failure' });
79
+ }
80
+ /** The recorder's event for a turn to write after its rows; undefined with no recorder, a second
81
+ * take or a failure. */
82
+ export function takeDelivery(rec) {
83
+ if (rec === null)
26
84
  return undefined;
27
85
  try {
28
- return call(root);
86
+ return rec.takeEvent() ?? undefined;
29
87
  }
30
88
  catch (error) {
31
- noteLedgerRowSkipped(error);
89
+ log.error(`delivery ledger write failed: ${errorMessage(error)}`, errorFields(error));
32
90
  return undefined;
33
91
  }
34
92
  }
35
- /** Books one row in ledgerRoot's store, best-effort. */
36
- export function bookTokenUse(hippoRoot, use, reach) {
37
- onLedgerRoot(hippoRoot, reach, (root) => recordTokensAt(root, use));
38
- }
39
- /** Books a turn's rows and then its delivery event on one connection of ledgerRoot's store, best-effort. */
40
- export function bookLedgerTurn(hippoRoot, turn, reach) {
41
- onLedgerRoot(hippoRoot, reach, (root) => recordLedgerTurn(root, turn));
42
- }
43
- /** What the session last sent on `surface` in ledgerRoot's store; undefined with no ledger or a failed read. */
44
- export function ledgerLastSent(hippoRoot, tenantId, sessionId, surface, reach) {
45
- return onLedgerRoot(hippoRoot, reach, (root) => lastSentOnSurface(root, tenantId, sessionId, surface));
93
+ /** Writes the recorder's event; a second flush is a no-op. A recorder started before the request
94
+ * that flushes it passes that request's `ctx`, so the write takes the request's handle and lock
95
+ * wait. */
96
+ export async function flushDeliveryRecorder(rec, ctx) {
97
+ const event = takeDelivery(rec);
98
+ if (rec === null || event === undefined)
99
+ return;
100
+ const ledger = (ctx === undefined ? undefined : ledgerHome(ledgerReachOf(ctx))?.ledger) ?? rec.ledger;
101
+ await ledger.recordTurn({ uses: [], delivery: event });
46
102
  }
47
103
  //# sourceMappingURL=ledger-db.js.map
@@ -1,11 +1,24 @@
1
- import type { MemoryConflict } from '../../store/rows.js';
1
+ import type { MemoryConflict } from '../../base/ports/store/conflicts.js';
2
2
  import type { CallerProject } from '../prompt-hook.js';
3
+ import type { KeysetPosition } from '../../base/util/keyset.js';
3
4
  import { type ContextWith } from '../types.js';
4
5
  import type { TenantReach } from './memories.js';
5
- export interface ResolveMemoryConflictOpts {
6
+ /** A page of a conflict list: `limit` (default DEFAULT_LIST_LIMIT, at most MAX_LIST_LIMIT) and
7
+ * the position the previous page ended on. */
8
+ export interface ConflictPageOptions {
9
+ limit?: number;
10
+ after?: KeysetPosition;
11
+ }
12
+ export interface ConflictPage {
13
+ conflicts: MemoryConflict[];
14
+ /** Where the next page starts, or null after the last; a filtered page can be short and still
15
+ * go on. */
16
+ next: KeysetPosition | null;
17
+ }
18
+ export interface ResolveMemoryConflictOptions {
6
19
  /** One of the conflict's two memories; the other is the loser. */
7
20
  keepId: string;
8
- /** Delete the loser instead of halving its half-life. */
21
+ /** Delete the loser instead of weakening its half-life. */
9
22
  forget?: boolean;
10
23
  /** Tombstone the loser's value as well, which removes it whatever `forget` says. */
11
24
  rejectLoser?: boolean;
@@ -17,17 +30,22 @@ export interface ResolveMemoryConflictResult {
17
30
  keptId: string;
18
31
  loserId: string;
19
32
  }
20
- /**
21
- * Keeps `keepId` and weakens, deletes or rejects the other side of an open conflict in the caller's tenant, auditing as
22
- * `ctx.actor`.
23
- * NotFound: missing, untouchable or no longer live. Conflict: already resolved. BadRequest: `keepId` outside the pair.
24
- */
25
- export declare function resolveMemoryConflict(ctx: ContextWith<'conflicts'>, conflictId: number, opts: ResolveMemoryConflictOpts): Promise<ResolveMemoryConflictResult>;
26
- /** Open conflicts whose two rows the caller may touch; with `project`, only pairs it could also recall:
27
- * its repo or user-global, and no scope it was not asked for. */
28
- export declare function listOpenConflicts(ctx: ContextWith<'conflicts'>, project?: CallerProject): Promise<MemoryConflict[]>;
29
- /**
30
- * Conflicts with `status` ('*' for any) in reach, with no scope filter: the host's own view, so the host admin only.
31
- */
32
- export declare function listConflicts(ctx: ContextWith<'conflicts'>, status: string, reach?: TenantReach): Promise<MemoryConflict[]>;
33
+ /** Conflict `conflictId` in the caller's tenant, any status; null when missing or a row of it is
34
+ * out of reach. */
35
+ export declare function conflictGet(ctx: ContextWith<'conflicts'>, conflictId: number): Promise<MemoryConflict | null>;
36
+ /** Keeps `keepId` and weakens, deletes or rejects the other side, auditing as `ctx.actor`.
37
+ * NotFound: missing, untouchable or no longer live. Forbidden: a loser to remove the caller may
38
+ * not change. Conflict: already resolved. BadRequest: `keepId` outside the pair. */
39
+ export declare function conflictResolve(ctx: ContextWith<'conflicts'>, conflictId: number, opts: ResolveMemoryConflictOptions): Promise<ResolveMemoryConflictResult>;
40
+ /** One page of open conflicts whose two rows the caller may touch; with `project`, only pairs it could also recall: its
41
+ * repo or user-global, and no scope it was not asked for. */
42
+ export declare function conflictListOpen(ctx: ContextWith<'conflicts'>, opts?: ConflictPageOptions & {
43
+ project?: CallerProject;
44
+ }): Promise<ConflictPage>;
45
+ /** One page of conflicts with `status` ('*' for any) in reach, with no scope filter: the host's
46
+ * own view, so the host admin only. */
47
+ export declare function conflictList(ctx: ContextWith<'conflicts'>, status: string, reach?: TenantReach, opts?: ConflictPageOptions): Promise<ConflictPage>;
48
+ /** Each page a paged list answers from `start`, the largest page at a time, for the verbs that
49
+ * print every conflict. */
50
+ export declare function conflictPages(read: (page: ConflictPageOptions) => Promise<ConflictPage>, start?: KeysetPosition): AsyncGenerator<ConflictPage>;
33
51
  //# sourceMappingURL=conflicts.d.ts.map
@@ -1,67 +1,118 @@
1
- // Conflict resolution for every front end, so the reach, status, pair and liveness checks live in one place.
2
- import { BadRequestError, ConflictError, NotFoundError } from '../../core/api-errors.js';
3
- import { chunked } from '../../util/chunked.js';
4
- import { passesScopeFilterForRecall, personalScopeOf } from '../../core/recall-scope.js';
5
- import { classifyOriginProject } from '../../core/project-identity.js';
6
- import { isQuarantineScope } from '../../trust/quarantine.js';
1
+ // Conflict listing and resolution for every front end, so the reach, status, pair and liveness
2
+ // rules live here.
3
+ import { BadRequestError, ConflictError, NotFoundError } from '../../base/errors/api-errors.js';
4
+ import { assertWriteRight, canReadScope, passesScopeFilterForRecall, personalScopeOf, scopeReaderOf, } from '../../base/scope/recall-scope.js';
5
+ import { conflictLoserFate } from '../../domain/consolidate/conflicts.js';
6
+ import { classifyOriginProject } from '../../base/scope/project-identity.js';
7
+ import { isQuarantineScope } from '../../domain/trust/quarantine.js';
8
+ import { MAX_LIST_LIMIT } from '../../base/util/limits.js';
9
+ import { keysetPages, pageLimit } from '../pages.js';
10
+ import { ALL_TENANTS } from '../../base/util/tenant.js';
7
11
  import { requireHostAdmin } from '../types.js';
8
- function isLive(entry) {
9
- return (!entry.superseded_by && (entry.kind === 'raw' || entry.kind === 'distilled') && !isQuarantineScope(entry.scope));
12
+ function isLive(member) {
13
+ return (member !== null &&
14
+ !member.supersededBy &&
15
+ (member.kind === 'raw' || member.kind === 'distilled') &&
16
+ !isQuarantineScope(member.scope));
10
17
  }
11
- /**
12
- * Keeps `keepId` and weakens, deletes or rejects the other side of an open conflict in the caller's tenant, auditing as
13
- * `ctx.actor`.
14
- * NotFound: missing, untouchable or no longer live. Conflict: already resolved. BadRequest: `keepId` outside the pair.
15
- */
16
- export async function resolveMemoryConflict(ctx, conflictId, opts) {
17
- // Read with every status, so a resolved conflict answers 409 while one holding another person's personal row stays a
18
- // 404.
19
- const touchable = await ctx.store.conflicts.listTouchable(ctx.tenantId, '*', ctx.actor);
20
- const conflict = touchable.find((c) => c.id === conflictId);
21
- if (!conflict)
18
+ /** A row the caller could not read hides its whole pair. */
19
+ function touchable(actor, row) {
20
+ return [row.a, row.b].every((member) => member !== null && canReadScope(actor, member.scope));
21
+ }
22
+ async function touchableConflict(ctx, conflictId) {
23
+ const row = await ctx.store.conflicts.get(ctx.tenantId, conflictId);
24
+ return row !== null && touchable(ctx.actor, row) ? row : null;
25
+ }
26
+ /** Conflict `conflictId` in the caller's tenant, any status; null when missing or a row of it is
27
+ * out of reach. */
28
+ export async function conflictGet(ctx, conflictId) {
29
+ return (await touchableConflict(ctx, conflictId))?.conflict ?? null;
30
+ }
31
+ /** Keeps `keepId` and weakens, deletes or rejects the other side, auditing as `ctx.actor`.
32
+ * NotFound: missing, untouchable or no longer live. Forbidden: a loser to remove the caller may
33
+ * not change. Conflict: already resolved. BadRequest: `keepId` outside the pair. */
34
+ export async function conflictResolve(ctx, conflictId, opts) {
35
+ // Any status, so a resolved conflict answers 409 while one holding another person's personal row
36
+ // stays a 404.
37
+ const row = await touchableConflict(ctx, conflictId);
38
+ if (!row)
22
39
  throw new NotFoundError(`conflict not found: ${conflictId}`);
23
- if (conflict.status !== 'open')
40
+ if (row.conflict.status !== 'open') {
24
41
  throw new ConflictError(`conflict ${conflictId} is already resolved`);
25
- const pair = [conflict.memory_a_id, conflict.memory_b_id];
26
- if (!pair.includes(opts.keepId)) {
27
- throw new BadRequestError(`keep must be one of the two memories in conflict ${conflictId}: ${pair.join(', ')}`);
28
42
  }
29
- if ((await ctx.store.entriesByIds(pair, ctx.tenantId)).filter(isLive).length < pair.length) {
43
+ const { keep, loser } = sidesOf(row, opts.keepId);
44
+ if (!isLive(row.a) || !isLive(row.b)) {
30
45
  throw new NotFoundError(`conflict ${conflictId} names a memory that is superseded, archived or quarantined`);
31
46
  }
32
- const resolved = await ctx.store.conflicts.resolve(ctx.tenantId, { conflictId, keepId: opts.keepId, forgetLoser: opts.forget === true }, {
33
- rejectLoserValue: opts.rejectLoser === true,
34
- reason: opts.reason,
35
- rejectedBy: ctx.actor.subject,
47
+ const reason = opts.reason ?? `resolveConflict ${conflictId}: kept ${keep.id}`;
48
+ const fate = conflictLoserFate(opts, loser, personalScopeOf(ctx.actor));
49
+ if (fate.kind !== 'weaken')
50
+ await assertMayRemove(ctx, conflictId, loser.id);
51
+ const resolved = await ctx.store.conflicts.resolve(ctx.tenantId, {
52
+ conflictId,
53
+ keep,
54
+ loser,
55
+ fate,
56
+ actor: ctx.actor.subject,
57
+ reason,
58
+ at: ctx.infra.clock().toISOString(),
36
59
  });
37
- // Every check passed above, so null here is another resolver getting there first.
38
- if (resolved === null)
60
+ // Every check passed above, so false here is another resolver, or a scope change, getting there
61
+ // first.
62
+ if (!resolved)
39
63
  throw new ConflictError(`conflict ${conflictId} is already resolved`);
40
- return { conflictId, keptId: opts.keepId, loserId: resolved.loserId };
64
+ return { conflictId, keptId: keep.id, loserId: loser.id };
65
+ }
66
+ /** Removing the loser is a forget, so it takes forget's write rights; a loser out of reach is a
67
+ * missing conflict. */
68
+ async function assertMayRemove(ctx, conflictId, loserId) {
69
+ const [loser] = await ctx.store.entriesByIds([loserId], ctx.tenantId);
70
+ assertWriteRight(scopeReaderOf(ctx.actor), loser, loserId, `conflict not found: ${conflictId}`);
41
71
  }
42
- /** Open conflicts whose two rows the caller may touch; with `project`, only pairs it could also recall:
43
- * its repo or user-global, and no scope it was not asked for. */
44
- export async function listOpenConflicts(ctx, project) {
45
- const touchable = await ctx.store.conflicts.listTouchable(ctx.tenantId, 'open', ctx.actor);
46
- if (!project)
47
- return touchable;
72
+ /** `keepId`'s side and the other one, with the scopes the store must still find at write time. */
73
+ function sidesOf(row, keepId) {
74
+ const { conflict } = row;
75
+ const a = { id: conflict.memoryAId, scope: row.a?.scope ?? null };
76
+ const b = { id: conflict.memoryBId, scope: row.b?.scope ?? null };
77
+ if (keepId === a.id)
78
+ return { keep: a, loser: b };
79
+ if (keepId === b.id)
80
+ return { keep: b, loser: a };
81
+ throw new BadRequestError(`keep must be one of the two memories in conflict ${conflict.id}: ${a.id}, ${b.id}`);
82
+ }
83
+ /** One page of open conflicts whose two rows the caller may touch; with `project`, only pairs it could also recall: its
84
+ * repo or user-global, and no scope it was not asked for. */
85
+ export async function conflictListOpen(ctx, opts = {}) {
86
+ const { project } = opts;
87
+ const page = await ctx.store.conflicts.list({
88
+ tenantId: ctx.tenantId,
89
+ status: 'open',
90
+ limit: pageLimit(opts.limit),
91
+ after: opts.after,
92
+ });
48
93
  const own = personalScopeOf(ctx.actor);
49
- const ids = [...new Set(touchable.flatMap((c) => [c.memory_a_id, c.memory_b_id]))];
50
- // entriesByIds reads at most one chunk of ids per call.
51
- const chunks = await Promise.all(chunked(ids).map((chunk) => ctx.store.entriesByIds(chunk, ctx.tenantId)));
52
- const rows = new Map(chunks.flat().map((row) => [row.id, row]));
53
- const shown = (id) => {
54
- const row = rows.get(id);
55
- return row !== undefined && classifyOriginProject(row.origin_project, project) !== 'cross-project'
56
- && passesScopeFilterForRecall(row.scope ?? null, undefined, own);
57
- };
58
- return touchable.filter((c) => shown(c.memory_a_id) && shown(c.memory_b_id));
94
+ const recallable = (member) => !project ||
95
+ (member !== null &&
96
+ classifyOriginProject(member.originProject, project) !== 'cross-project' &&
97
+ passesScopeFilterForRecall(member.scope, undefined, own));
98
+ const shown = (row) => touchable(ctx.actor, row) && recallable(row.a) && recallable(row.b);
99
+ return { conflicts: page.rows.filter(shown).map((row) => row.conflict), next: page.next };
59
100
  }
60
- /**
61
- * Conflicts with `status` ('*' for any) in reach, with no scope filter: the host's own view, so the host admin only.
62
- */
63
- export async function listConflicts(ctx, status, reach = {}) {
101
+ /** One page of conflicts with `status` ('*' for any) in reach, with no scope filter: the host's
102
+ * own view, so the host admin only. */
103
+ export async function conflictList(ctx, status, reach = {}, opts = {}) {
64
104
  requireHostAdmin(ctx, 'Listing conflicts past the scope check');
65
- return ctx.store.conflicts.list(reach.everyTenant ? null : ctx.tenantId, status);
105
+ const page = await ctx.store.conflicts.list({
106
+ tenantId: reach.everyTenant ? ALL_TENANTS : ctx.tenantId,
107
+ status,
108
+ limit: pageLimit(opts.limit),
109
+ after: opts.after,
110
+ });
111
+ return { conflicts: page.rows.map((row) => row.conflict), next: page.next };
112
+ }
113
+ /** Each page a paged list answers from `start`, the largest page at a time, for the verbs that
114
+ * print every conflict. */
115
+ export function conflictPages(read, start) {
116
+ return keysetPages((after) => read({ limit: MAX_LIST_LIMIT, after }), start);
66
117
  }
67
118
  //# sourceMappingURL=conflicts.js.map