@remnic/core 9.69.56 → 9.69.57

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 (2714) hide show
  1. package/dist/abort-error.d.ts +5 -6
  2. package/dist/abort-error.d.ts.map +1 -0
  3. package/dist/abstraction-nodes.d.ts +12 -13
  4. package/dist/abstraction-nodes.d.ts.map +1 -0
  5. package/dist/access-admin-ops-surface.d.ts +20 -153
  6. package/dist/access-admin-ops-surface.d.ts.map +1 -0
  7. package/dist/access-admin-ops-surface.js +65 -60
  8. package/dist/access-audit.d.ts +6 -10
  9. package/dist/access-audit.d.ts.map +1 -0
  10. package/dist/access-audit.js +2 -2
  11. package/dist/access-authorization-probe.d.ts +7 -152
  12. package/dist/access-authorization-probe.d.ts.map +1 -0
  13. package/dist/access-authorization-probe.js +66 -61
  14. package/dist/access-boundary.d.ts +156 -145
  15. package/dist/access-boundary.d.ts.map +1 -0
  16. package/dist/access-boundary.js +65 -60
  17. package/dist/access-citation-namespace.d.ts +3 -3
  18. package/dist/access-citation-namespace.d.ts.map +1 -0
  19. package/dist/access-citation.d.ts +6 -7
  20. package/dist/access-citation.d.ts.map +1 -0
  21. package/dist/access-cli.d.ts +7 -7
  22. package/dist/access-cli.d.ts.map +1 -0
  23. package/dist/access-cli.js +157 -152
  24. package/dist/access-cli.js.map +1 -1
  25. package/dist/access-coding-context-resolution.d.ts +4 -23
  26. package/dist/access-coding-context-resolution.d.ts.map +1 -0
  27. package/dist/access-errors.d.ts +57 -5
  28. package/dist/access-errors.d.ts.map +1 -0
  29. package/dist/access-errors.js +13 -3
  30. package/dist/access-extraction-force-flush.d.ts +5 -150
  31. package/dist/access-extraction-force-flush.d.ts.map +1 -0
  32. package/dist/access-extraction-force-flush.js +65 -60
  33. package/dist/access-health-types.d.ts +7 -30
  34. package/dist/access-health-types.d.ts.map +1 -0
  35. package/dist/access-http-briefing.d.ts +5 -150
  36. package/dist/access-http-briefing.d.ts.map +1 -0
  37. package/dist/access-http-briefing.js +66 -61
  38. package/dist/access-http-lcm-compaction.d.ts +12 -156
  39. package/dist/access-http-lcm-compaction.d.ts.map +1 -0
  40. package/dist/access-http-lifecycle-flush.d.ts +6 -150
  41. package/dist/access-http-lifecycle-flush.d.ts.map +1 -0
  42. package/dist/access-http-offline-stream.d.ts +6 -151
  43. package/dist/access-http-offline-stream.d.ts.map +1 -0
  44. package/dist/access-http-query.d.ts +6 -26
  45. package/dist/access-http-query.d.ts.map +1 -0
  46. package/dist/access-http-query.js +67 -62
  47. package/dist/access-http.d.ts +22 -189
  48. package/dist/access-http.d.ts.map +1 -0
  49. package/dist/access-http.js +93 -89
  50. package/dist/access-idempotency.d.ts +5 -5
  51. package/dist/access-idempotency.d.ts.map +1 -0
  52. package/dist/access-identity-continuity-surface.d.ts +4 -115
  53. package/dist/access-identity-continuity-surface.d.ts.map +1 -0
  54. package/dist/access-identity-continuity-surface.js +65 -60
  55. package/dist/access-lcm-surface.d.ts +5 -151
  56. package/dist/access-lcm-surface.d.ts.map +1 -0
  57. package/dist/access-lcm-surface.js +65 -60
  58. package/dist/access-mcp-admin-tools.d.ts +4 -5
  59. package/dist/access-mcp-admin-tools.d.ts.map +1 -0
  60. package/dist/access-mcp-output-schemas.d.ts +2 -3
  61. package/dist/access-mcp-output-schemas.d.ts.map +1 -0
  62. package/dist/access-mcp-output-schemas.js +1 -1
  63. package/dist/access-mcp-shared-context-tools.d.ts +3 -150
  64. package/dist/access-mcp-shared-context-tools.d.ts.map +1 -0
  65. package/dist/access-mcp-sse.d.ts +3 -5
  66. package/dist/access-mcp-sse.d.ts.map +1 -0
  67. package/dist/access-mcp-tool-names.d.ts +9 -10
  68. package/dist/access-mcp-tool-names.d.ts.map +1 -0
  69. package/dist/access-mcp.d.ts +178 -145
  70. package/dist/access-mcp.d.ts.map +1 -0
  71. package/dist/access-mcp.js +80 -76
  72. package/dist/access-memory-search-fanout.d.ts +18 -37
  73. package/dist/access-memory-search-fanout.d.ts.map +1 -0
  74. package/dist/access-memory-search-fanout.js +2 -2
  75. package/dist/access-namespace-preflight.d.ts +18 -22
  76. package/dist/access-namespace-preflight.d.ts.map +1 -0
  77. package/dist/access-namespace-preflight.js +65 -60
  78. package/dist/access-observe-helpers.d.ts +4 -5
  79. package/dist/access-observe-helpers.d.ts.map +1 -0
  80. package/dist/access-observe-transcript.d.ts +5 -115
  81. package/dist/access-observe-transcript.d.ts.map +1 -0
  82. package/dist/access-observe-write-category.d.ts +5 -42
  83. package/dist/access-observe-write-category.d.ts.map +1 -0
  84. package/dist/access-observe-write-category.js +7 -7
  85. package/dist/access-observe-write-surface.d.ts +6 -151
  86. package/dist/access-observe-write-surface.d.ts.map +1 -0
  87. package/dist/access-observe-write-surface.js +65 -60
  88. package/dist/access-offline-manifest.d.ts +10 -124
  89. package/dist/access-offline-manifest.d.ts.map +1 -0
  90. package/dist/access-offline-manifest.js +7 -7
  91. package/dist/access-operations-batch.d.ts +12 -2
  92. package/dist/access-operations-batch.d.ts.map +1 -0
  93. package/dist/access-operations-batch.js +69 -66
  94. package/dist/access-operations.d.ts +66 -188
  95. package/dist/access-operations.d.ts.map +1 -0
  96. package/dist/access-operations.js +76 -73
  97. package/dist/access-recall-concurrency.d.ts +11 -156
  98. package/dist/access-recall-concurrency.d.ts.map +1 -0
  99. package/dist/access-recall-concurrency.js +65 -60
  100. package/dist/access-recall-diagnostics.d.ts +64 -0
  101. package/dist/access-recall-diagnostics.d.ts.map +1 -0
  102. package/dist/access-recall-diagnostics.js +26 -0
  103. package/dist/access-recall-response.d.ts +7 -151
  104. package/dist/access-recall-response.d.ts.map +1 -0
  105. package/dist/access-recall-response.js +65 -60
  106. package/dist/access-recall-surface.d.ts +11 -152
  107. package/dist/access-recall-surface.d.ts.map +1 -0
  108. package/dist/access-recall-surface.js +65 -60
  109. package/dist/access-schema.d.ts +203 -221
  110. package/dist/access-schema.d.ts.map +1 -0
  111. package/dist/access-schema.js +3 -3
  112. package/dist/access-service-helpers.d.ts +33 -145
  113. package/dist/access-service-helpers.d.ts.map +1 -0
  114. package/dist/access-service.d.ts +1825 -145
  115. package/dist/access-service.d.ts.map +1 -0
  116. package/dist/access-service.js +65 -60
  117. package/dist/access-surface-catalog.d.ts +7 -154
  118. package/dist/access-surface-catalog.d.ts.map +1 -0
  119. package/dist/access-surface-catalog.js +69 -62
  120. package/dist/access-surface-catalog.js.map +1 -1
  121. package/dist/access-token-capabilities.d.ts +19 -22
  122. package/dist/access-token-capabilities.d.ts.map +1 -0
  123. package/dist/access-token-capabilities.js +2 -2
  124. package/dist/access-wearables-meetings-surface.d.ts +14 -54
  125. package/dist/access-wearables-meetings-surface.d.ts.map +1 -0
  126. package/dist/action-confidence.d.ts +19 -40
  127. package/dist/action-confidence.d.ts.map +1 -0
  128. package/dist/active-context-config.d.ts +7 -8
  129. package/dist/active-context-config.d.ts.map +1 -0
  130. package/dist/active-context-transform.d.ts +31 -33
  131. package/dist/active-context-transform.d.ts.map +1 -0
  132. package/dist/active-memory-bridge.d.ts +10 -28
  133. package/dist/active-memory-bridge.d.ts.map +1 -0
  134. package/dist/active-recall.d.ts +11 -30
  135. package/dist/active-recall.d.ts.map +1 -0
  136. package/dist/active-recall.js +23 -23
  137. package/dist/activity/config.d.ts +24 -0
  138. package/dist/activity/config.d.ts.map +1 -0
  139. package/dist/activity/digest.d.ts +15 -35
  140. package/dist/activity/digest.d.ts.map +1 -0
  141. package/dist/activity/dwell.d.ts +14 -0
  142. package/dist/activity/dwell.d.ts.map +1 -0
  143. package/dist/activity/from-ms.d.ts +7 -0
  144. package/dist/activity/from-ms.d.ts.map +1 -0
  145. package/dist/activity/heading-level.d.ts +15 -0
  146. package/dist/activity/heading-level.d.ts.map +1 -0
  147. package/dist/activity/heading-title.d.ts +15 -0
  148. package/dist/activity/heading-title.d.ts.map +1 -0
  149. package/dist/activity/index.d.ts +46 -0
  150. package/dist/activity/index.d.ts.map +1 -0
  151. package/dist/activity/journal-extract.d.ts +68 -0
  152. package/dist/activity/journal-extract.d.ts.map +1 -0
  153. package/dist/activity/journal-heading.d.ts +26 -0
  154. package/dist/activity/journal-heading.d.ts.map +1 -0
  155. package/dist/activity/journal-path.d.ts +9 -0
  156. package/dist/activity/journal-path.d.ts.map +1 -0
  157. package/dist/activity/journal-read.d.ts +31 -0
  158. package/dist/activity/journal-read.d.ts.map +1 -0
  159. package/dist/activity/journal-section.d.ts +17 -0
  160. package/dist/activity/journal-section.d.ts.map +1 -0
  161. package/dist/activity/journal-source.d.ts +25 -0
  162. package/dist/activity/journal-source.d.ts.map +1 -0
  163. package/dist/activity/journal-state.d.ts +21 -0
  164. package/dist/activity/journal-state.d.ts.map +1 -0
  165. package/dist/activity/journal-state.lock-worker.d.ts +2 -0
  166. package/dist/activity/journal-state.lock-worker.d.ts.map +1 -0
  167. package/dist/activity/journal-strip.d.ts +6 -0
  168. package/dist/activity/journal-strip.d.ts.map +1 -0
  169. package/dist/activity/journal-vault-prereq.d.ts +23 -0
  170. package/dist/activity/journal-vault-prereq.d.ts.map +1 -0
  171. package/dist/activity/journal-vault-provenance.d.ts +12 -0
  172. package/dist/activity/journal-vault-provenance.d.ts.map +1 -0
  173. package/dist/activity/journal-vault-read.d.ts +32 -0
  174. package/dist/activity/journal-vault-read.d.ts.map +1 -0
  175. package/dist/activity/journal.d.ts +29 -0
  176. package/dist/activity/journal.d.ts.map +1 -0
  177. package/dist/activity/memory-gen.d.ts +71 -0
  178. package/dist/activity/memory-gen.d.ts.map +1 -0
  179. package/dist/activity/pipeline.d.ts +44 -0
  180. package/dist/activity/pipeline.d.ts.map +1 -0
  181. package/dist/activity/privacy-delete-plan.d.ts +22 -0
  182. package/dist/activity/privacy-delete-plan.d.ts.map +1 -0
  183. package/dist/activity/privacy-enabled.d.ts +16 -0
  184. package/dist/activity/privacy-enabled.d.ts.map +1 -0
  185. package/dist/activity/privacy-gate-resolve.d.ts +17 -0
  186. package/dist/activity/privacy-gate-resolve.d.ts.map +1 -0
  187. package/dist/activity/privacy-keys.d.ts +8 -0
  188. package/dist/activity/privacy-keys.d.ts.map +1 -0
  189. package/dist/activity/privacy-redact.d.ts +13 -0
  190. package/dist/activity/privacy-redact.d.ts.map +1 -0
  191. package/dist/activity/privacy-status.d.ts +30 -0
  192. package/dist/activity/privacy-status.d.ts.map +1 -0
  193. package/dist/activity/privacy-window.d.ts +15 -0
  194. package/dist/activity/privacy-window.d.ts.map +1 -0
  195. package/dist/activity/privacy.d.ts +17 -0
  196. package/dist/activity/privacy.d.ts.map +1 -0
  197. package/dist/activity/reindex.d.ts +23 -0
  198. package/dist/activity/reindex.d.ts.map +1 -0
  199. package/dist/activity/retain-days.d.ts +8 -0
  200. package/dist/activity/retain-days.d.ts.map +1 -0
  201. package/dist/activity/runner.d.ts +100 -0
  202. package/dist/activity/runner.d.ts.map +1 -0
  203. package/dist/activity/scheduler.d.ts +90 -0
  204. package/dist/activity/scheduler.d.ts.map +1 -0
  205. package/dist/activity/source-client.d.ts +24 -0
  206. package/dist/activity/source-client.d.ts.map +1 -0
  207. package/dist/activity/store.d.ts +53 -0
  208. package/dist/activity/store.d.ts.map +1 -0
  209. package/dist/activity/sync-registration.d.ts +83 -0
  210. package/dist/activity/sync-registration.d.ts.map +1 -0
  211. package/dist/activity/timeline/analysis-batch-empty.d.ts +8 -0
  212. package/dist/activity/timeline/analysis-batch-empty.d.ts.map +1 -0
  213. package/dist/activity/timeline/analysis-batch.d.ts +12 -0
  214. package/dist/activity/timeline/analysis-batch.d.ts.map +1 -0
  215. package/dist/activity/timeline/analysis-claim.d.ts +14 -0
  216. package/dist/activity/timeline/analysis-claim.d.ts.map +1 -0
  217. package/dist/activity/timeline/analysis-dup.d.ts +8 -0
  218. package/dist/activity/timeline/analysis-dup.d.ts.map +1 -0
  219. package/dist/activity/timeline/analysis-empty.d.ts +8 -0
  220. package/dist/activity/timeline/analysis-empty.d.ts.map +1 -0
  221. package/dist/activity/timeline/analysis-evidence.d.ts +12 -0
  222. package/dist/activity/timeline/analysis-evidence.d.ts.map +1 -0
  223. package/dist/activity/timeline/analysis-failure.d.ts +19 -0
  224. package/dist/activity/timeline/analysis-failure.d.ts.map +1 -0
  225. package/dist/activity/timeline/analysis-max.d.ts +8 -0
  226. package/dist/activity/timeline/analysis-max.d.ts.map +1 -0
  227. package/dist/activity/timeline/analysis-metadata.d.ts +30 -0
  228. package/dist/activity/timeline/analysis-metadata.d.ts.map +1 -0
  229. package/dist/activity/timeline/analysis-order.d.ts +8 -0
  230. package/dist/activity/timeline/analysis-order.d.ts.map +1 -0
  231. package/dist/activity/timeline/analysis-overlap.d.ts +8 -0
  232. package/dist/activity/timeline/analysis-overlap.d.ts.map +1 -0
  233. package/dist/activity/timeline/analysis-prompt.d.ts +13 -0
  234. package/dist/activity/timeline/analysis-prompt.d.ts.map +1 -0
  235. package/dist/activity/timeline/analysis-provider.d.ts +84 -0
  236. package/dist/activity/timeline/analysis-provider.d.ts.map +1 -0
  237. package/dist/activity/timeline/analysis-run.d.ts +40 -0
  238. package/dist/activity/timeline/analysis-run.d.ts.map +1 -0
  239. package/dist/activity/timeline/analysis.d.ts +63 -0
  240. package/dist/activity/timeline/analysis.d.ts.map +1 -0
  241. package/dist/activity/timeline/build.d.ts +50 -0
  242. package/dist/activity/timeline/build.d.ts.map +1 -0
  243. package/dist/activity/timeline/categories.d.ts +27 -0
  244. package/dist/activity/timeline/categories.d.ts.map +1 -0
  245. package/dist/activity/timeline/classify.d.ts +20 -0
  246. package/dist/activity/timeline/classify.d.ts.map +1 -0
  247. package/dist/activity/timeline/corrections.d.ts +37 -0
  248. package/dist/activity/timeline/corrections.d.ts.map +1 -0
  249. package/dist/activity/timeline/index.d.ts +35 -0
  250. package/dist/activity/timeline/index.d.ts.map +1 -0
  251. package/dist/activity/timeline/journal-recap-persist.d.ts +14 -0
  252. package/dist/activity/timeline/journal-recap-persist.d.ts.map +1 -0
  253. package/dist/activity/timeline/journal-recap.d.ts +21 -0
  254. package/dist/activity/timeline/journal-recap.d.ts.map +1 -0
  255. package/dist/activity/timeline/publish-cli.d.ts +17 -0
  256. package/dist/activity/timeline/publish-cli.d.ts.map +1 -0
  257. package/dist/activity/timeline/query.d.ts +86 -0
  258. package/dist/activity/timeline/query.d.ts.map +1 -0
  259. package/dist/activity/timeline/recap-card-count.d.ts +7 -0
  260. package/dist/activity/timeline/recap-card-count.d.ts.map +1 -0
  261. package/dist/activity/timeline/recap-card-id.d.ts +14 -0
  262. package/dist/activity/timeline/recap-card-id.d.ts.map +1 -0
  263. package/dist/activity/timeline/recap-date.d.ts +15 -0
  264. package/dist/activity/timeline/recap-date.d.ts.map +1 -0
  265. package/dist/activity/timeline/recap-empty.d.ts +8 -0
  266. package/dist/activity/timeline/recap-empty.d.ts.map +1 -0
  267. package/dist/activity/timeline/recap-export-range.d.ts +55 -0
  268. package/dist/activity/timeline/recap-export-range.d.ts.map +1 -0
  269. package/dist/activity/timeline/recap-export.d.ts +48 -0
  270. package/dist/activity/timeline/recap-export.d.ts.map +1 -0
  271. package/dist/activity/timeline/recap-fallback.d.ts +47 -0
  272. package/dist/activity/timeline/recap-fallback.d.ts.map +1 -0
  273. package/dist/activity/timeline/recap-id.d.ts +8 -0
  274. package/dist/activity/timeline/recap-id.d.ts.map +1 -0
  275. package/dist/activity/timeline/recap-markdown.d.ts +15 -0
  276. package/dist/activity/timeline/recap-markdown.d.ts.map +1 -0
  277. package/dist/activity/timeline/recap-merge-edits.d.ts +24 -0
  278. package/dist/activity/timeline/recap-merge-edits.d.ts.map +1 -0
  279. package/dist/activity/timeline/recap-sort-key.d.ts +9 -0
  280. package/dist/activity/timeline/recap-sort-key.d.ts.map +1 -0
  281. package/dist/activity/timeline/recap-tz.d.ts +15 -0
  282. package/dist/activity/timeline/recap-tz.d.ts.map +1 -0
  283. package/dist/activity/timeline/recap-window.d.ts +19 -0
  284. package/dist/activity/timeline/recap-window.d.ts.map +1 -0
  285. package/dist/activity/timeline/regenerate.d.ts +84 -0
  286. package/dist/activity/timeline/regenerate.d.ts.map +1 -0
  287. package/dist/activity/timeline/types.d.ts +98 -0
  288. package/dist/activity/timeline/types.d.ts.map +1 -0
  289. package/dist/activity/timeline/week-config-hash.d.ts +13 -0
  290. package/dist/activity/timeline/week-config-hash.d.ts.map +1 -0
  291. package/dist/activity/timeline/week-count.d.ts +7 -0
  292. package/dist/activity/timeline/week-count.d.ts.map +1 -0
  293. package/dist/activity/timeline/week-dashboard.d.ts +79 -0
  294. package/dist/activity/timeline/week-dashboard.d.ts.map +1 -0
  295. package/dist/activity/timeline/week-days.d.ts +6 -0
  296. package/dist/activity/timeline/week-days.d.ts.map +1 -0
  297. package/dist/activity/timeline/week-export.d.ts +27 -0
  298. package/dist/activity/timeline/week-export.d.ts.map +1 -0
  299. package/dist/activity/timeline/week-iso.d.ts +16 -0
  300. package/dist/activity/timeline/week-iso.d.ts.map +1 -0
  301. package/dist/activity/timeline/week-monday.d.ts +3 -0
  302. package/dist/activity/timeline/week-monday.d.ts.map +1 -0
  303. package/dist/activity/timeline/week-previous.d.ts +39 -0
  304. package/dist/activity/timeline/week-previous.d.ts.map +1 -0
  305. package/dist/activity/timeline/week-range.d.ts +10 -0
  306. package/dist/activity/timeline/week-range.d.ts.map +1 -0
  307. package/dist/activity/timeline/week-recurring.d.ts +21 -0
  308. package/dist/activity/timeline/week-recurring.d.ts.map +1 -0
  309. package/dist/activity/timeline/week-snapshot.d.ts +17 -0
  310. package/dist/activity/timeline/week-snapshot.d.ts.map +1 -0
  311. package/dist/activity/timeline/week-span.d.ts +2 -0
  312. package/dist/activity/timeline/week-span.d.ts.map +1 -0
  313. package/dist/activity/timeline/week-sunday.d.ts +3 -0
  314. package/dist/activity/timeline/week-sunday.d.ts.map +1 -0
  315. package/dist/activity/timeline/weekly-persist.d.ts +18 -0
  316. package/dist/activity/timeline/weekly-persist.d.ts.map +1 -0
  317. package/dist/activity/timeline/weekly.d.ts +42 -0
  318. package/dist/activity/timeline/weekly.d.ts.map +1 -0
  319. package/dist/activity/to-ms.d.ts +7 -0
  320. package/dist/activity/to-ms.d.ts.map +1 -0
  321. package/dist/activity/types.d.ts +208 -0
  322. package/dist/activity/types.d.ts.map +1 -0
  323. package/dist/activity/vault-begin.d.ts +8 -0
  324. package/dist/activity/vault-begin.d.ts.map +1 -0
  325. package/dist/activity/vault-body-trim.d.ts +7 -0
  326. package/dist/activity/vault-body-trim.d.ts.map +1 -0
  327. package/dist/activity/vault-dry-run.d.ts +13 -0
  328. package/dist/activity/vault-dry-run.d.ts.map +1 -0
  329. package/dist/activity/vault-end.d.ts +8 -0
  330. package/dist/activity/vault-end.d.ts.map +1 -0
  331. package/dist/activity/vault-frontmatter.d.ts +41 -0
  332. package/dist/activity/vault-frontmatter.d.ts.map +1 -0
  333. package/dist/activity/vault-insert.d.ts +24 -0
  334. package/dist/activity/vault-insert.d.ts.map +1 -0
  335. package/dist/activity/vault-join.d.ts +2 -0
  336. package/dist/activity/vault-join.d.ts.map +1 -0
  337. package/dist/activity/vault-marker.d.ts +12 -0
  338. package/dist/activity/vault-marker.d.ts.map +1 -0
  339. package/dist/activity/vault-name-trim.d.ts +7 -0
  340. package/dist/activity/vault-name-trim.d.ts.map +1 -0
  341. package/dist/activity/vault-path.d.ts +20 -0
  342. package/dist/activity/vault-path.d.ts.map +1 -0
  343. package/dist/activity/vault-publish.d.ts +71 -0
  344. package/dist/activity/vault-publish.d.ts.map +1 -0
  345. package/dist/activity/vault-publisher.d.ts +58 -0
  346. package/dist/activity/vault-publisher.d.ts.map +1 -0
  347. package/dist/activity/vault-region-pair.d.ts +17 -0
  348. package/dist/activity/vault-region-pair.d.ts.map +1 -0
  349. package/dist/activity/vault-region.d.ts +24 -0
  350. package/dist/activity/vault-region.d.ts.map +1 -0
  351. package/dist/activity/vault-status.d.ts +32 -0
  352. package/dist/activity/vault-status.d.ts.map +1 -0
  353. package/dist/activity/vault-suffix.d.ts +7 -0
  354. package/dist/activity/vault-suffix.d.ts.map +1 -0
  355. package/dist/activity/vault-wikilink.d.ts +2 -0
  356. package/dist/activity/vault-wikilink.d.ts.map +1 -0
  357. package/dist/activity/window-order.d.ts +17 -0
  358. package/dist/activity/window-order.d.ts.map +1 -0
  359. package/dist/adapters/claude-code.d.ts +3 -5
  360. package/dist/adapters/claude-code.d.ts.map +1 -0
  361. package/dist/adapters/codex.d.ts +3 -5
  362. package/dist/adapters/codex.d.ts.map +1 -0
  363. package/dist/adapters/grok.d.ts +23 -0
  364. package/dist/adapters/grok.d.ts.map +1 -0
  365. package/dist/adapters/hermes.d.ts +3 -5
  366. package/dist/adapters/hermes.d.ts.map +1 -0
  367. package/dist/adapters/index.d.ts +9 -51
  368. package/dist/adapters/index.d.ts.map +1 -0
  369. package/dist/adapters/index.js +4 -4
  370. package/dist/adapters/opencode.d.ts +22 -0
  371. package/dist/adapters/opencode.d.ts.map +1 -0
  372. package/dist/adapters/registry.d.ts +3 -5
  373. package/dist/adapters/registry.d.ts.map +1 -0
  374. package/dist/adapters/registry.js +2 -2
  375. package/dist/adapters/replit.d.ts +3 -5
  376. package/dist/adapters/replit.d.ts.map +1 -0
  377. package/dist/adapters/types.d.ts +5 -6
  378. package/dist/adapters/types.d.ts.map +1 -0
  379. package/dist/admin/admin-surfaces.d.ts +362 -0
  380. package/dist/admin/admin-surfaces.d.ts.map +1 -0
  381. package/dist/ambient-provenance.d.ts +10 -30
  382. package/dist/ambient-provenance.d.ts.map +1 -0
  383. package/dist/archive-mutation-version.d.ts +8 -9
  384. package/dist/archive-mutation-version.d.ts.map +1 -0
  385. package/dist/artifact-search.d.ts +5 -25
  386. package/dist/artifact-search.d.ts.map +1 -0
  387. package/dist/auto-sync-CWSZDLLW.js +1 -1
  388. package/dist/background-generation-config.d.ts +3 -4
  389. package/dist/background-generation-config.d.ts.map +1 -0
  390. package/dist/background-generation.d.ts +5 -24
  391. package/dist/background-generation.d.ts.map +1 -0
  392. package/dist/behavior-learner.d.ts +6 -25
  393. package/dist/behavior-learner.d.ts.map +1 -0
  394. package/dist/behavior-signals.d.ts +5 -24
  395. package/dist/behavior-signals.d.ts.map +1 -0
  396. package/dist/binary-lifecycle/backend.d.ts +46 -0
  397. package/dist/binary-lifecycle/backend.d.ts.map +1 -0
  398. package/dist/binary-lifecycle/index.d.ts +13 -0
  399. package/dist/binary-lifecycle/index.d.ts.map +1 -0
  400. package/dist/binary-lifecycle/manifest.d.ts +22 -0
  401. package/dist/binary-lifecycle/manifest.d.ts.map +1 -0
  402. package/dist/binary-lifecycle/pipeline.d.ts +33 -0
  403. package/dist/binary-lifecycle/pipeline.d.ts.map +1 -0
  404. package/dist/binary-lifecycle/scanner.d.ts +21 -0
  405. package/dist/binary-lifecycle/scanner.d.ts.map +1 -0
  406. package/dist/binary-lifecycle/types.d.ts +70 -0
  407. package/dist/binary-lifecycle/types.d.ts.map +1 -0
  408. package/dist/bootstrap.d.ts +6 -115
  409. package/dist/bootstrap.d.ts.map +1 -0
  410. package/dist/bounded-jsonl-state.d.ts +5 -5
  411. package/dist/bounded-jsonl-state.d.ts.map +1 -0
  412. package/dist/boxes.d.ts +9 -9
  413. package/dist/boxes.d.ts.map +1 -0
  414. package/dist/briefing-window.d.ts +8 -40
  415. package/dist/briefing-window.d.ts.map +1 -0
  416. package/dist/briefing.d.ts +28 -61
  417. package/dist/briefing.d.ts.map +1 -0
  418. package/dist/briefing.js +14 -14
  419. package/dist/buffer-surprise-report.d.ts +6 -26
  420. package/dist/buffer-surprise-report.d.ts.map +1 -0
  421. package/dist/buffer-surprise.d.ts +5 -6
  422. package/dist/buffer-surprise.d.ts.map +1 -0
  423. package/dist/buffer-turn-helpers.d.ts +32 -18
  424. package/dist/buffer-turn-helpers.d.ts.map +1 -0
  425. package/dist/buffer.d.ts +9 -41
  426. package/dist/buffer.d.ts.map +1 -0
  427. package/dist/buffer.js +3 -3
  428. package/dist/bulk-import/index.d.ts +4 -44
  429. package/dist/bulk-import/index.d.ts.map +1 -0
  430. package/dist/bulk-import/pipeline.d.ts +30 -0
  431. package/dist/bulk-import/pipeline.d.ts.map +1 -0
  432. package/dist/bulk-import/registry.d.ts +23 -0
  433. package/dist/bulk-import/registry.d.ts.map +1 -0
  434. package/dist/bulk-import/types.d.ts +83 -0
  435. package/dist/bulk-import/types.d.ts.map +1 -0
  436. package/dist/calibration.d.ts +14 -37
  437. package/dist/calibration.d.ts.map +1 -0
  438. package/dist/capabilities.d.ts +64 -84
  439. package/dist/capabilities.d.ts.map +1 -0
  440. package/dist/capsule-cli.d.ts +23 -24
  441. package/dist/capsule-cli.d.ts.map +1 -0
  442. package/dist/capsule-crypto-7FJQINUR.js +18 -0
  443. package/dist/causal-behavior.d.ts +9 -38
  444. package/dist/causal-behavior.d.ts.map +1 -0
  445. package/dist/causal-behavior.js +2 -2
  446. package/dist/causal-chain.d.ts +13 -17
  447. package/dist/causal-chain.d.ts.map +1 -0
  448. package/dist/causal-chain.js +2 -2
  449. package/dist/causal-consolidation.d.ts +10 -29
  450. package/dist/causal-consolidation.d.ts.map +1 -0
  451. package/dist/causal-consolidation.js +17 -17
  452. package/dist/causal-retrieval.d.ts +6 -11
  453. package/dist/causal-retrieval.d.ts.map +1 -0
  454. package/dist/causal-retrieval.js +2 -2
  455. package/dist/causal-trajectory-graph.d.ts +7 -29
  456. package/dist/causal-trajectory-graph.d.ts.map +1 -0
  457. package/dist/causal-trajectory-graph.js +2 -2
  458. package/dist/causal-trajectory.d.ts +23 -25
  459. package/dist/causal-trajectory.d.ts.map +1 -0
  460. package/dist/causal-trajectory.js +1 -1
  461. package/dist/census-validation.d.ts +5 -6
  462. package/dist/census-validation.d.ts.map +1 -0
  463. package/dist/chat/chat-cli.d.ts +38 -0
  464. package/dist/chat/chat-cli.d.ts.map +1 -0
  465. package/dist/chat/chat-config.d.ts +25 -0
  466. package/dist/chat/chat-config.d.ts.map +1 -0
  467. package/dist/chat/chat-engine.d.ts +82 -0
  468. package/dist/chat/chat-engine.d.ts.map +1 -0
  469. package/dist/chat/chat-executor.d.ts +26 -0
  470. package/dist/chat/chat-executor.d.ts.map +1 -0
  471. package/dist/chat/chat-factory.d.ts +46 -0
  472. package/dist/chat/chat-factory.d.ts.map +1 -0
  473. package/dist/chat/chat-http.d.ts +83 -0
  474. package/dist/chat/chat-http.d.ts.map +1 -0
  475. package/dist/chat/chat-llm.d.ts +77 -0
  476. package/dist/chat/chat-llm.d.ts.map +1 -0
  477. package/dist/chat/chat-session.d.ts +118 -0
  478. package/dist/chat/chat-session.d.ts.map +1 -0
  479. package/dist/chat/chat-system-prompt.d.ts +23 -0
  480. package/dist/chat/chat-system-prompt.d.ts.map +1 -0
  481. package/dist/chat/chat-tools.d.ts +22 -0
  482. package/dist/chat/chat-tools.d.ts.map +1 -0
  483. package/dist/chat/chat-types.d.ts +134 -0
  484. package/dist/chat/chat-types.d.ts.map +1 -0
  485. package/dist/chunk-2CBWEIS4.js +1286 -0
  486. package/dist/chunk-2JQZSQXI.js +81 -0
  487. package/dist/chunk-2KHIBLO5.js +33 -0
  488. package/dist/chunk-2KHIBLO5.js.map +1 -0
  489. package/dist/chunk-2NLLXCJG.js +112 -0
  490. package/dist/chunk-2WMXZYMS.js +25 -0
  491. package/dist/chunk-34ZGBAGE.js +61 -0
  492. package/dist/chunk-36S7UHAW.js +623 -0
  493. package/dist/chunk-3JLWSFTV.js +801 -0
  494. package/dist/chunk-3MUKQQ7A.js +157 -0
  495. package/dist/chunk-3MUKQQ7A.js.map +1 -0
  496. package/dist/chunk-3RZOLUZT.js +140 -0
  497. package/dist/chunk-3SL52JKD.js +160 -0
  498. package/dist/chunk-4ALOINQ4.js +18512 -0
  499. package/dist/chunk-4ALOINQ4.js.map +1 -0
  500. package/dist/chunk-4QEZS7PK.js +502 -0
  501. package/dist/chunk-52VL6LCY.js +648 -0
  502. package/dist/chunk-52VL6LCY.js.map +1 -0
  503. package/dist/chunk-5HFVWYHL.js +111 -0
  504. package/dist/chunk-5HFVWYHL.js.map +1 -0
  505. package/dist/chunk-5QRYGLZN.js +35 -0
  506. package/dist/chunk-5R3C5LEZ.js +263 -0
  507. package/dist/chunk-634UKELB.js +77 -0
  508. package/dist/chunk-64JK4TL7.js +801 -0
  509. package/dist/chunk-6E5GYDIE.js +141 -0
  510. package/dist/chunk-6ISP2EN2.js +51 -0
  511. package/dist/chunk-6RD7MSIO.js +212 -0
  512. package/dist/chunk-6UDLN4IA.js +70 -0
  513. package/dist/chunk-754XN6LX.js +256 -0
  514. package/dist/chunk-7H2LEYYJ.js +256 -0
  515. package/dist/chunk-A7AISUJI.js +103 -0
  516. package/dist/chunk-AULKCNZW.js +727 -0
  517. package/dist/chunk-B7SSU55V.js +1686 -0
  518. package/dist/chunk-BICNRVEC.js +224 -0
  519. package/dist/chunk-BJI2D4SU.js +53 -0
  520. package/dist/chunk-BQB5ZMYO.js +28 -0
  521. package/dist/chunk-BSDBDFKZ.js +168 -0
  522. package/dist/chunk-BSDBDFKZ.js.map +1 -0
  523. package/dist/chunk-C5CPYMLX.js +315 -0
  524. package/dist/chunk-C6LRFPZL.js +4007 -0
  525. package/dist/chunk-C6LRFPZL.js.map +1 -0
  526. package/dist/chunk-CS2JO77A.js +95 -0
  527. package/dist/chunk-DTABICJ3.js +549 -0
  528. package/dist/chunk-DXODYQ7J.js +319 -0
  529. package/dist/chunk-DXODYQ7J.js.map +1 -0
  530. package/dist/chunk-E6UNM67F.js +432 -0
  531. package/dist/chunk-ENUI3IO7.js +271 -0
  532. package/dist/chunk-FF2XYADH.js +1084 -0
  533. package/dist/chunk-FF6N7BXC.js +389 -0
  534. package/dist/chunk-FNQEXI3D.js +22 -0
  535. package/dist/chunk-FNQEXI3D.js.map +1 -0
  536. package/dist/chunk-FSXD6Y4H.js +203 -0
  537. package/dist/chunk-GK6NOQE6.js +3400 -0
  538. package/dist/chunk-GRSFFLUY.js +43 -0
  539. package/dist/chunk-GWK7FEUL.js +761 -0
  540. package/dist/chunk-GWQVMKUJ.js +218 -0
  541. package/dist/chunk-H7O5L2IQ.js +3560 -0
  542. package/dist/chunk-H7O5L2IQ.js.map +1 -0
  543. package/dist/chunk-HKHZWJ3E.js +63 -0
  544. package/dist/chunk-IAZPYX6W.js +182 -0
  545. package/dist/chunk-IG747LRN.js +189 -0
  546. package/dist/chunk-IK63WA5A.js +30 -0
  547. package/dist/chunk-IRGQYQQ7.js +143 -0
  548. package/dist/chunk-IRGQYQQ7.js.map +1 -0
  549. package/dist/chunk-IUD6NLNM.js +24 -0
  550. package/dist/chunk-JSJZ2NXS.js +9782 -0
  551. package/dist/chunk-JUOJGZPV.js +566 -0
  552. package/dist/chunk-KA4U5GQN.js +960 -0
  553. package/dist/chunk-KQAFEZQX.js +264 -0
  554. package/dist/chunk-L4WBADKG.js +72 -0
  555. package/dist/chunk-LAL4B37X.js +275 -0
  556. package/dist/chunk-LELJRLPY.js +253 -0
  557. package/dist/chunk-LMMQKZK3.js +403 -0
  558. package/dist/chunk-LQ23DMTT.js +74 -0
  559. package/dist/chunk-LV6ZB6CA.js +285 -0
  560. package/dist/chunk-M5IJP3YW.js +5505 -0
  561. package/dist/chunk-MMMYRC7Q.js +606 -0
  562. package/dist/chunk-MMMYRC7Q.js.map +1 -0
  563. package/dist/chunk-MWZMVLXL.js +415 -0
  564. package/dist/chunk-MZUQVWVC.js +72 -0
  565. package/dist/chunk-MZUQVWVC.js.map +1 -0
  566. package/dist/chunk-N4VCHRLD.js +29 -0
  567. package/dist/chunk-NKXHCCLB.js +879 -0
  568. package/dist/chunk-NVCWA4QC.js +112 -0
  569. package/dist/chunk-ONWVMYHX.js +122 -0
  570. package/dist/chunk-P6P35FY4.js +54 -0
  571. package/dist/chunk-P7M22CYB.js +346 -0
  572. package/dist/chunk-QMWKENNK.js +111 -0
  573. package/dist/chunk-QOPB6KE3.js +1530 -0
  574. package/dist/chunk-RBULO7DO.js +223 -0
  575. package/dist/chunk-RDESQOEE.js +1008 -0
  576. package/dist/chunk-RMF763SX.js +115 -0
  577. package/dist/chunk-RN6ZCNM5.js +321 -0
  578. package/dist/chunk-S2OBXHMN.js +11341 -0
  579. package/dist/chunk-S3JPD4N7.js +216 -0
  580. package/dist/chunk-SF6RFI5Z.js +165 -0
  581. package/dist/chunk-SJV3AOZ2.js +2453 -0
  582. package/dist/chunk-SLULR4GC.js +202 -0
  583. package/dist/chunk-TFXXMTHV.js +1476 -0
  584. package/dist/chunk-TYP7GYRI.js +216 -0
  585. package/dist/chunk-TYZK56OA.js +2440 -0
  586. package/dist/chunk-VLDVNZQE.js +921 -0
  587. package/dist/chunk-W6YK672C.js +511 -0
  588. package/dist/chunk-X2NFFBTO.js +576 -0
  589. package/dist/chunk-X45KZOT2.js +1917 -0
  590. package/dist/chunk-X7Y7WX73.js +249 -0
  591. package/dist/chunk-XIXM6G7I.js +43 -0
  592. package/dist/chunk-XLXYARWC.js +210 -0
  593. package/dist/chunk-XVW52M6I.js +223 -0
  594. package/dist/chunk-YHU5XUF4.js +342 -0
  595. package/dist/chunk-YRH3C2OJ.js +73 -0
  596. package/dist/chunk-YXQE67A7.js +137 -0
  597. package/dist/chunk-ZHUVMSHI.js +731 -0
  598. package/dist/chunk-ZHXSOMYH.js +297 -0
  599. package/dist/chunk-ZIEZJMFW.js +768 -0
  600. package/dist/chunk-ZMT4ZVJU.js +31013 -0
  601. package/dist/chunk-ZMT4ZVJU.js.map +1 -0
  602. package/dist/chunk-ZOASYXBS.js +629 -0
  603. package/dist/chunk-ZOASYXBS.js.map +1 -0
  604. package/dist/chunk-ZSEFGDCI.js +98 -0
  605. package/dist/chunk-ZX5N5D6M.js +65 -0
  606. package/dist/chunking.d.ts +9 -10
  607. package/dist/chunking.d.ts.map +1 -0
  608. package/dist/citations.d.ts +8 -9
  609. package/dist/citations.d.ts.map +1 -0
  610. package/dist/cli/creation-ledger-commands.d.ts +24 -0
  611. package/dist/cli/creation-ledger-commands.d.ts.map +1 -0
  612. package/dist/cli/deep-recall-commands.d.ts +19 -0
  613. package/dist/cli/deep-recall-commands.d.ts.map +1 -0
  614. package/dist/cli/harmonic-search.d.ts +12 -0
  615. package/dist/cli/harmonic-search.d.ts.map +1 -0
  616. package/dist/cli/meetings-commands.d.ts +16 -0
  617. package/dist/cli/meetings-commands.d.ts.map +1 -0
  618. package/dist/cli/memory-browse-commands.d.ts +11 -0
  619. package/dist/cli/memory-browse-commands.d.ts.map +1 -0
  620. package/dist/cli/okf-commands.d.ts +5 -0
  621. package/dist/cli/okf-commands.d.ts.map +1 -0
  622. package/dist/cli/recall-navigation-commands.d.ts +11 -0
  623. package/dist/cli/recall-navigation-commands.d.ts.map +1 -0
  624. package/dist/cli/research-status-commands.d.ts +26 -0
  625. package/dist/cli/research-status-commands.d.ts.map +1 -0
  626. package/dist/cli/skills-commands.d.ts +14 -0
  627. package/dist/cli/skills-commands.d.ts.map +1 -0
  628. package/dist/cli/timeline-publish-commands.d.ts +11 -0
  629. package/dist/cli/timeline-publish-commands.d.ts.map +1 -0
  630. package/dist/cli-fallback.d.ts +13 -14
  631. package/dist/cli-fallback.d.ts.map +1 -0
  632. package/dist/cli.d.ts +1036 -165
  633. package/dist/cli.d.ts.map +1 -0
  634. package/dist/cli.js +120 -116
  635. package/dist/coding/action-gate.d.ts +176 -0
  636. package/dist/coding/action-gate.d.ts.map +1 -0
  637. package/dist/coding/architecture-card.d.ts +135 -0
  638. package/dist/coding/architecture-card.d.ts.map +1 -0
  639. package/dist/coding/architecture-surfaces.d.ts +166 -0
  640. package/dist/coding/architecture-surfaces.d.ts.map +1 -0
  641. package/dist/coding/codegraph-runtime.d.ts +321 -0
  642. package/dist/coding/codegraph-runtime.d.ts.map +1 -0
  643. package/dist/coding/codegraph-surfaces.d.ts +191 -0
  644. package/dist/coding/codegraph-surfaces.d.ts.map +1 -0
  645. package/dist/coding/coding-graph-types.d.ts +16 -17
  646. package/dist/coding/coding-graph-types.d.ts.map +1 -0
  647. package/dist/coding/coding-knowledge-config.d.ts +69 -0
  648. package/dist/coding/coding-knowledge-config.d.ts.map +1 -0
  649. package/dist/coding/coding-namespace.d.ts +214 -0
  650. package/dist/coding/coding-namespace.d.ts.map +1 -0
  651. package/dist/coding/decision-records.d.ts +120 -0
  652. package/dist/coding/decision-records.d.ts.map +1 -0
  653. package/dist/coding/decision-surfaces.d.ts +143 -0
  654. package/dist/coding/decision-surfaces.d.ts.map +1 -0
  655. package/dist/coding/export-okf-codegraph.d.ts +9 -28
  656. package/dist/coding/export-okf-codegraph.d.ts.map +1 -0
  657. package/dist/coding/export-okf-codegraph.js +13 -13
  658. package/dist/coding/git-context.d.ts +92 -0
  659. package/dist/coding/git-context.d.ts.map +1 -0
  660. package/dist/coding/optional-coding-graph.d.ts +9 -10
  661. package/dist/coding/optional-coding-graph.d.ts.map +1 -0
  662. package/dist/coding/pre-action-gate.d.ts +58 -18
  663. package/dist/coding/pre-action-gate.d.ts.map +1 -0
  664. package/dist/coding/pre-action-gate.js +2 -2
  665. package/dist/coding/review-context.d.ts +147 -0
  666. package/dist/coding/review-context.d.ts.map +1 -0
  667. package/dist/coding/session-delta-surfaces.d.ts +138 -0
  668. package/dist/coding/session-delta-surfaces.d.ts.map +1 -0
  669. package/dist/coding/session-delta.d.ts +201 -0
  670. package/dist/coding/session-delta.d.ts.map +1 -0
  671. package/dist/coding/structural-context.d.ts +194 -0
  672. package/dist/coding/structural-context.d.ts.map +1 -0
  673. package/dist/coding/structural-subprocess-provider.d.ts +50 -0
  674. package/dist/coding/structural-subprocess-provider.d.ts.map +1 -0
  675. package/dist/commitment-ledger.d.ts +13 -14
  676. package/dist/commitment-ledger.d.ts.map +1 -0
  677. package/dist/compat/checks.d.ts +3 -5
  678. package/dist/compat/checks.d.ts.map +1 -0
  679. package/dist/compat/codex-cli-fallback.d.ts +15 -1
  680. package/dist/compat/codex-cli-fallback.d.ts.map +1 -0
  681. package/dist/compat/codex-thread-key.d.ts +15 -1
  682. package/dist/compat/codex-thread-key.d.ts.map +1 -0
  683. package/dist/compat/types.d.ts +7 -8
  684. package/dist/compat/types.d.ts.map +1 -0
  685. package/dist/compounding/engine.d.ts +11 -44
  686. package/dist/compounding/engine.d.ts.map +1 -0
  687. package/dist/compounding/engine.js +14 -14
  688. package/dist/compounding/preference-consolidator.d.ts +10 -37
  689. package/dist/compounding/preference-consolidator.d.ts.map +1 -0
  690. package/dist/compression-optimizer.d.ts +10 -29
  691. package/dist/compression-optimizer.d.ts.map +1 -0
  692. package/dist/config-discovery.d.ts +4 -5
  693. package/dist/config-discovery.d.ts.map +1 -0
  694. package/dist/config-qmd.d.ts +7 -8
  695. package/dist/config-qmd.d.ts.map +1 -0
  696. package/dist/config-record.d.ts +2 -3
  697. package/dist/config-record.d.ts.map +1 -0
  698. package/dist/config-security.d.ts +2 -3
  699. package/dist/config-security.d.ts.map +1 -0
  700. package/dist/config.d.ts +7 -26
  701. package/dist/config.d.ts.map +1 -0
  702. package/dist/config.js +23 -23
  703. package/dist/connectors/codex-marketplace.d.ts +124 -0
  704. package/dist/connectors/codex-marketplace.d.ts.map +1 -0
  705. package/dist/connectors/codex-materialize-runner.d.ts +7 -27
  706. package/dist/connectors/codex-materialize-runner.d.ts.map +1 -0
  707. package/dist/connectors/codex-materialize-runner.js +14 -14
  708. package/dist/connectors/codex-materialize.d.ts +23 -41
  709. package/dist/connectors/codex-materialize.d.ts.map +1 -0
  710. package/dist/connectors/coerce.d.ts +73 -0
  711. package/dist/connectors/coerce.d.ts.map +1 -0
  712. package/dist/connectors/droid-mcp.d.ts +122 -0
  713. package/dist/connectors/droid-mcp.d.ts.map +1 -0
  714. package/dist/connectors/hermes-shim.d.ts +135 -0
  715. package/dist/connectors/hermes-shim.d.ts.map +1 -0
  716. package/dist/connectors/index.d.ts +42 -247
  717. package/dist/connectors/index.d.ts.map +1 -0
  718. package/dist/connectors/index.js +20 -20
  719. package/dist/connectors/label.d.ts +19 -0
  720. package/dist/connectors/label.d.ts.map +1 -0
  721. package/dist/connectors/live/framework.d.ts +169 -0
  722. package/dist/connectors/live/framework.d.ts.map +1 -0
  723. package/dist/connectors/live/github.d.ts +156 -0
  724. package/dist/connectors/live/github.d.ts.map +1 -0
  725. package/dist/connectors/live/gmail.d.ts +253 -0
  726. package/dist/connectors/live/gmail.d.ts.map +1 -0
  727. package/dist/connectors/live/google-drive.d.ts +198 -0
  728. package/dist/connectors/live/google-drive.d.ts.map +1 -0
  729. package/dist/connectors/live/index.d.ts +20 -0
  730. package/dist/connectors/live/index.d.ts.map +1 -0
  731. package/dist/connectors/live/notion.d.ts +146 -0
  732. package/dist/connectors/live/notion.d.ts.map +1 -0
  733. package/dist/connectors/live/registry.d.ts +53 -0
  734. package/dist/connectors/live/registry.d.ts.map +1 -0
  735. package/dist/connectors/live/state-store.d.ts +120 -0
  736. package/dist/connectors/live/state-store.d.ts.map +1 -0
  737. package/dist/connectors/live/transient-errors.d.ts +45 -0
  738. package/dist/connectors/live/transient-errors.d.ts.map +1 -0
  739. package/dist/connectors/materialize-paths.d.ts +15 -0
  740. package/dist/connectors/materialize-paths.d.ts.map +1 -0
  741. package/dist/connectors/materialize-skills.d.ts +52 -0
  742. package/dist/connectors/materialize-skills.d.ts.map +1 -0
  743. package/dist/connectors/paths.d.ts +78 -0
  744. package/dist/connectors/paths.d.ts.map +1 -0
  745. package/dist/connectors/prime-agent.d.ts +13 -0
  746. package/dist/connectors/prime-agent.d.ts.map +1 -0
  747. package/dist/connectors-cli.d.ts +170 -2
  748. package/dist/connectors-cli.d.ts.map +1 -0
  749. package/dist/console/state.d.ts +154 -0
  750. package/dist/console/state.d.ts.map +1 -0
  751. package/dist/console/trace.d.ts +199 -0
  752. package/dist/console/trace.d.ts.map +1 -0
  753. package/dist/console/tui.d.ts +106 -0
  754. package/dist/console/tui.d.ts.map +1 -0
  755. package/dist/consolidation-operator.d.ts +8 -9
  756. package/dist/consolidation-operator.d.ts.map +1 -0
  757. package/dist/consolidation-provenance-check.d.ts +5 -40
  758. package/dist/consolidation-provenance-check.d.ts.map +1 -0
  759. package/dist/consolidation-undo.d.ts +10 -44
  760. package/dist/consolidation-undo.d.ts.map +1 -0
  761. package/dist/content-hash.d.ts +6 -7
  762. package/dist/content-hash.d.ts.map +1 -0
  763. package/dist/context-summary.d.ts +8 -9
  764. package/dist/context-summary.d.ts.map +1 -0
  765. package/dist/contradiction/contradiction-judge.d.ts +65 -0
  766. package/dist/contradiction/contradiction-judge.d.ts.map +1 -0
  767. package/dist/contradiction/contradiction-review.d.ts +117 -0
  768. package/dist/contradiction/contradiction-review.d.ts.map +1 -0
  769. package/dist/contradiction/contradiction-scan.d.ts +74 -0
  770. package/dist/contradiction/contradiction-scan.d.ts.map +1 -0
  771. package/dist/contradiction/index.d.ts +12 -41
  772. package/dist/contradiction/index.d.ts.map +1 -0
  773. package/dist/contradiction/index.js +11 -11
  774. package/dist/contradiction/resolution.d.ts +57 -0
  775. package/dist/contradiction/resolution.d.ts.map +1 -0
  776. package/dist/contradiction-config.d.ts +5 -6
  777. package/dist/contradiction-config.d.ts.map +1 -0
  778. package/dist/converge-config.d.ts +9 -28
  779. package/dist/converge-config.d.ts.map +1 -0
  780. package/dist/convergence-refresh.d.ts +5 -40
  781. package/dist/convergence-refresh.d.ts.map +1 -0
  782. package/dist/convergence-refresh.js +16 -16
  783. package/dist/conversation-index/backend.d.ts +12 -31
  784. package/dist/conversation-index/backend.d.ts.map +1 -0
  785. package/dist/conversation-index/chunker.d.ts +4 -23
  786. package/dist/conversation-index/chunker.d.ts.map +1 -0
  787. package/dist/conversation-index/cleanup.d.ts +2 -3
  788. package/dist/conversation-index/cleanup.d.ts.map +1 -0
  789. package/dist/conversation-index/faiss-adapter.d.ts +63 -22
  790. package/dist/conversation-index/faiss-adapter.d.ts.map +1 -0
  791. package/dist/conversation-index/indexer.d.ts +9 -31
  792. package/dist/conversation-index/indexer.d.ts.map +1 -0
  793. package/dist/conversation-index/search.d.ts +10 -22
  794. package/dist/conversation-index/search.d.ts.map +1 -0
  795. package/dist/corpus-read-cancellation.d.ts +3 -4
  796. package/dist/corpus-read-cancellation.d.ts.map +1 -0
  797. package/dist/corpus-watermark.d.ts +19 -40
  798. package/dist/corpus-watermark.d.ts.map +1 -0
  799. package/dist/corpus-watermark.js +18 -18
  800. package/dist/correction/correction-access-wiring.d.ts +129 -0
  801. package/dist/correction/correction-access-wiring.d.ts.map +1 -0
  802. package/dist/correction/correction-contract.d.ts +220 -0
  803. package/dist/correction/correction-contract.d.ts.map +1 -0
  804. package/dist/correction/correction-executor.d.ts +174 -0
  805. package/dist/correction/correction-executor.d.ts.map +1 -0
  806. package/dist/correction/correction-planner.d.ts +162 -0
  807. package/dist/correction/correction-planner.d.ts.map +1 -0
  808. package/dist/correction/correction-service.d.ts +124 -0
  809. package/dist/correction/correction-service.d.ts.map +1 -0
  810. package/dist/correction/index.d.ts +23 -0
  811. package/dist/correction/index.d.ts.map +1 -0
  812. package/dist/correction/passive-capture.d.ts +107 -0
  813. package/dist/correction/passive-capture.d.ts.map +1 -0
  814. package/dist/correction/passive-correction-detector.d.ts +60 -0
  815. package/dist/correction/passive-correction-detector.d.ts.map +1 -0
  816. package/dist/correction/passive-correction-notifications.d.ts +36 -0
  817. package/dist/correction/passive-correction-notifications.d.ts.map +1 -0
  818. package/dist/cross-lingual-recall.d.ts +10 -29
  819. package/dist/cross-lingual-recall.d.ts.map +1 -0
  820. package/dist/cross-namespace-budget.d.ts +9 -10
  821. package/dist/cross-namespace-budget.d.ts.map +1 -0
  822. package/dist/cue-anchors.d.ts +11 -12
  823. package/dist/cue-anchors.d.ts.map +1 -0
  824. package/dist/curation/index.d.ts +98 -0
  825. package/dist/curation/index.d.ts.map +1 -0
  826. package/dist/dashboard-runtime.d.ts +4 -5
  827. package/dist/dashboard-runtime.d.ts.map +1 -0
  828. package/dist/day-summary.d.ts +5 -24
  829. package/dist/day-summary.d.ts.map +1 -0
  830. package/dist/dedup/connector-scope.d.ts +28 -0
  831. package/dist/dedup/connector-scope.d.ts.map +1 -0
  832. package/dist/dedup/index.d.ts +78 -0
  833. package/dist/dedup/index.d.ts.map +1 -0
  834. package/dist/dedup/merge-content.d.ts +24 -0
  835. package/dist/dedup/merge-content.d.ts.map +1 -0
  836. package/dist/dedup/merge-count.d.ts +7 -0
  837. package/dist/dedup/merge-count.d.ts.map +1 -0
  838. package/dist/dedup/merge-decision.d.ts +26 -0
  839. package/dist/dedup/merge-decision.d.ts.map +1 -0
  840. package/dist/dedup/merge-dup.d.ts +8 -0
  841. package/dist/dedup/merge-dup.d.ts.map +1 -0
  842. package/dist/dedup/merge-empty.d.ts +15 -0
  843. package/dist/dedup/merge-empty.d.ts.map +1 -0
  844. package/dist/dedup/merge-id.d.ts +8 -0
  845. package/dist/dedup/merge-id.d.ts.map +1 -0
  846. package/dist/dedup/merge-judge.d.ts +33 -0
  847. package/dist/dedup/merge-judge.d.ts.map +1 -0
  848. package/dist/dedup/merge-min-score.d.ts +2 -0
  849. package/dist/dedup/merge-min-score.d.ts.map +1 -0
  850. package/dist/dedup/merge-on-write-wire.d.ts +17 -0
  851. package/dist/dedup/merge-on-write-wire.d.ts.map +1 -0
  852. package/dist/dedup/merge-on-write.d.ts +32 -0
  853. package/dist/dedup/merge-on-write.d.ts.map +1 -0
  854. package/dist/dedup/merge-pair.d.ts +8 -0
  855. package/dist/dedup/merge-pair.d.ts.map +1 -0
  856. package/dist/dedup/merge-provenance.d.ts +43 -0
  857. package/dist/dedup/merge-provenance.d.ts.map +1 -0
  858. package/dist/dedup/merge-score.d.ts +7 -0
  859. package/dist/dedup/merge-score.d.ts.map +1 -0
  860. package/dist/dedup/merge-self.d.ts +13 -0
  861. package/dist/dedup/merge-self.d.ts.map +1 -0
  862. package/dist/dedup/merge-threshold.d.ts +13 -0
  863. package/dist/dedup/merge-threshold.d.ts.map +1 -0
  864. package/dist/dedup/merge-tie.d.ts +8 -0
  865. package/dist/dedup/merge-tie.d.ts.map +1 -0
  866. package/dist/dedup/merge-unique.d.ts +7 -0
  867. package/dist/dedup/merge-unique.d.ts.map +1 -0
  868. package/dist/dedup/merge-verdict.d.ts +19 -0
  869. package/dist/dedup/merge-verdict.d.ts.map +1 -0
  870. package/dist/dedup/merge.d.ts +122 -0
  871. package/dist/dedup/merge.d.ts.map +1 -0
  872. package/dist/dedup/novelty-gate.d.ts +60 -0
  873. package/dist/dedup/novelty-gate.d.ts.map +1 -0
  874. package/dist/dedup/semantic.d.ts +86 -0
  875. package/dist/dedup/semantic.d.ts.map +1 -0
  876. package/dist/deep-recall-config.d.ts +7 -8
  877. package/dist/deep-recall-config.d.ts.map +1 -0
  878. package/dist/deep-recall-config.js +2 -2
  879. package/dist/deep-recall-http-glue.d.ts +5 -151
  880. package/dist/deep-recall-http-glue.d.ts.map +1 -0
  881. package/dist/deep-recall-http-glue.js +6 -6
  882. package/dist/deep-recall-mcp-tools.d.ts +3 -150
  883. package/dist/deep-recall-mcp-tools.d.ts.map +1 -0
  884. package/dist/deep-recall-policy-llm.d.ts +6 -30
  885. package/dist/deep-recall-policy-llm.d.ts.map +1 -0
  886. package/dist/deep-recall-renderer.d.ts +3 -9
  887. package/dist/deep-recall-renderer.d.ts.map +1 -0
  888. package/dist/deep-recall-seeds.d.ts +7 -30
  889. package/dist/deep-recall-seeds.d.ts.map +1 -0
  890. package/dist/deep-recall.d.ts +15 -17
  891. package/dist/deep-recall.d.ts.map +1 -0
  892. package/dist/delinearize.d.ts +5 -25
  893. package/dist/delinearize.d.ts.map +1 -0
  894. package/dist/dependency-propagation-config.d.ts +3 -22
  895. package/dist/dependency-propagation-config.d.ts.map +1 -0
  896. package/dist/deterministic-order.d.ts +3 -4
  897. package/dist/deterministic-order.d.ts.map +1 -0
  898. package/dist/direct-answer-wiring.d.ts +8 -28
  899. package/dist/direct-answer-wiring.d.ts.map +1 -0
  900. package/dist/direct-answer.d.ts +10 -30
  901. package/dist/direct-answer.d.ts.map +1 -0
  902. package/dist/directory-sidecars.d.ts +17 -18
  903. package/dist/directory-sidecars.d.ts.map +1 -0
  904. package/dist/embedding-fallback.d.ts +6 -25
  905. package/dist/embedding-fallback.d.ts.map +1 -0
  906. package/dist/emit-legacy-tools.d.ts +3 -4
  907. package/dist/emit-legacy-tools.d.ts.map +1 -0
  908. package/dist/enrichment/audit.d.ts +27 -0
  909. package/dist/enrichment/audit.d.ts.map +1 -0
  910. package/dist/enrichment/index.d.ts +8 -177
  911. package/dist/enrichment/index.d.ts.map +1 -0
  912. package/dist/enrichment/pipeline.d.ts +15 -0
  913. package/dist/enrichment/pipeline.d.ts.map +1 -0
  914. package/dist/enrichment/provider-registry.d.ts +28 -0
  915. package/dist/enrichment/provider-registry.d.ts.map +1 -0
  916. package/dist/enrichment/types.d.ts +65 -0
  917. package/dist/enrichment/types.d.ts.map +1 -0
  918. package/dist/enrichment/web-search-provider.d.ts +26 -0
  919. package/dist/enrichment/web-search-provider.d.ts.map +1 -0
  920. package/dist/entity-id-normalization.d.ts +3 -4
  921. package/dist/entity-id-normalization.d.ts.map +1 -0
  922. package/dist/entity-origin-fields.d.ts +6 -24
  923. package/dist/entity-origin-fields.d.ts.map +1 -0
  924. package/dist/entity-recall-cancellation.d.ts +6 -7
  925. package/dist/entity-recall-cancellation.d.ts.map +1 -0
  926. package/dist/entity-retrieval-boundaries.d.ts +2 -3
  927. package/dist/entity-retrieval-boundaries.d.ts.map +1 -0
  928. package/dist/entity-retrieval-i18n.d.ts +5 -6
  929. package/dist/entity-retrieval-i18n.d.ts.map +1 -0
  930. package/dist/entity-retrieval.d.ts +8 -41
  931. package/dist/entity-retrieval.d.ts.map +1 -0
  932. package/dist/entity-retrieval.js +14 -14
  933. package/dist/entity-schema.d.ts +9 -28
  934. package/dist/entity-schema.d.ts.map +1 -0
  935. package/dist/episodic-context.d.ts +10 -30
  936. package/dist/episodic-context.d.ts.map +1 -0
  937. package/dist/eval-trajectory-contracts.d.ts +48 -68
  938. package/dist/eval-trajectory-contracts.d.ts.map +1 -0
  939. package/dist/eval-trajectory-store.d.ts +7 -28
  940. package/dist/eval-trajectory-store.d.ts.map +1 -0
  941. package/dist/eval-trajectory.d.ts +9 -30
  942. package/dist/eval-trajectory.d.ts.map +1 -0
  943. package/dist/evals.d.ts +29 -30
  944. package/dist/evals.d.ts.map +1 -0
  945. package/dist/event-order-query.d.ts +2 -3
  946. package/dist/event-order-query.d.ts.map +1 -0
  947. package/dist/event-order-recall.d.ts +6 -8
  948. package/dist/event-order-recall.d.ts.map +1 -0
  949. package/dist/event-time.d.ts +7 -8
  950. package/dist/event-time.d.ts.map +1 -0
  951. package/dist/evidence-pack.d.ts +7 -8
  952. package/dist/evidence-pack.d.ts.map +1 -0
  953. package/dist/experience/session-experience-config.d.ts +19 -0
  954. package/dist/experience/session-experience-config.d.ts.map +1 -0
  955. package/dist/experience/session-experience-mining.d.ts +31 -0
  956. package/dist/experience/session-experience-mining.d.ts.map +1 -0
  957. package/dist/experience/session-experience-recall.d.ts +19 -0
  958. package/dist/experience/session-experience-recall.d.ts.map +1 -0
  959. package/dist/experience/session-experience.d.ts +74 -0
  960. package/dist/experience/session-experience.d.ts.map +1 -0
  961. package/dist/explicit-capture.d.ts +20 -128
  962. package/dist/explicit-capture.d.ts.map +1 -0
  963. package/dist/explicit-capture.js +1 -1
  964. package/dist/explicit-cue-recall.d.ts +17 -19
  965. package/dist/explicit-cue-recall.d.ts.map +1 -0
  966. package/dist/external-wiki-access.d.ts +4 -152
  967. package/dist/external-wiki-access.d.ts.map +1 -0
  968. package/dist/external-wiki-access.js +66 -61
  969. package/dist/external-wiki-cli.d.ts +4 -5
  970. package/dist/external-wiki-cli.d.ts.map +1 -0
  971. package/dist/external-wiki-collection-registration.d.ts +7 -27
  972. package/dist/external-wiki-collection-registration.d.ts.map +1 -0
  973. package/dist/external-wiki-collection.d.ts +9 -29
  974. package/dist/external-wiki-collection.d.ts.map +1 -0
  975. package/dist/external-wiki-config.d.ts +3 -4
  976. package/dist/external-wiki-config.d.ts.map +1 -0
  977. package/dist/external-wiki-guard.d.ts +6 -7
  978. package/dist/external-wiki-guard.d.ts.map +1 -0
  979. package/dist/external-wiki-mcp-tools.d.ts +3 -149
  980. package/dist/external-wiki-mcp-tools.d.ts.map +1 -0
  981. package/dist/external-wiki-search.d.ts +12 -13
  982. package/dist/external-wiki-search.d.ts.map +1 -0
  983. package/dist/external-wiki.d.ts +12 -13
  984. package/dist/external-wiki.d.ts.map +1 -0
  985. package/dist/extraction-error-classification.d.ts +5 -24
  986. package/dist/extraction-error-classification.d.ts.map +1 -0
  987. package/dist/extraction-evidence-class.d.ts +13 -33
  988. package/dist/extraction-evidence-class.d.ts.map +1 -0
  989. package/dist/extraction-evidence-class.js +2 -2
  990. package/dist/extraction-faithfulness.d.ts +23 -46
  991. package/dist/extraction-faithfulness.d.ts.map +1 -0
  992. package/dist/extraction-judge-telemetry.d.ts +9 -36
  993. package/dist/extraction-judge-telemetry.d.ts.map +1 -0
  994. package/dist/extraction-judge-training.d.ts +9 -36
  995. package/dist/extraction-judge-training.d.ts.map +1 -0
  996. package/dist/extraction-judge.d.ts +20 -44
  997. package/dist/extraction-judge.d.ts.map +1 -0
  998. package/dist/extraction-liveness.d.ts +161 -18
  999. package/dist/extraction-liveness.d.ts.map +1 -0
  1000. package/dist/extraction-normalization.d.ts +7 -26
  1001. package/dist/extraction-normalization.d.ts.map +1 -0
  1002. package/dist/extraction-prompt.d.ts +14 -34
  1003. package/dist/extraction-prompt.d.ts.map +1 -0
  1004. package/dist/extraction-redaction-rules.d.ts +6 -7
  1005. package/dist/extraction-redaction-rules.d.ts.map +1 -0
  1006. package/dist/extraction-source-grounding-helpers.d.ts +31 -32
  1007. package/dist/extraction-source-grounding-helpers.d.ts.map +1 -0
  1008. package/dist/extraction-source-grounding-rules.d.ts +6 -25
  1009. package/dist/extraction-source-grounding-rules.d.ts.map +1 -0
  1010. package/dist/extraction-source-grounding.d.ts +7 -25
  1011. package/dist/extraction-source-grounding.d.ts.map +1 -0
  1012. package/dist/extraction-source-grounding.js +3 -3
  1013. package/dist/extraction-span-bench.d.ts +3 -4
  1014. package/dist/extraction-span-bench.d.ts.map +1 -0
  1015. package/dist/extraction-span-clip.d.ts +5 -6
  1016. package/dist/extraction-span-clip.d.ts.map +1 -0
  1017. package/dist/extraction-span-config.d.ts +40 -18
  1018. package/dist/extraction-span-config.d.ts.map +1 -0
  1019. package/dist/extraction-span-contains.d.ts +2 -3
  1020. package/dist/extraction-span-contains.d.ts.map +1 -0
  1021. package/dist/extraction-span-fallback.d.ts +5 -6
  1022. package/dist/extraction-span-fallback.d.ts.map +1 -0
  1023. package/dist/extraction-span-gap.d.ts +2 -3
  1024. package/dist/extraction-span-gap.d.ts.map +1 -0
  1025. package/dist/extraction-span-gate.d.ts +7 -8
  1026. package/dist/extraction-span-gate.d.ts.map +1 -0
  1027. package/dist/extraction-span-join.d.ts +5 -6
  1028. package/dist/extraction-span-join.d.ts.map +1 -0
  1029. package/dist/extraction-span-length.d.ts +2 -3
  1030. package/dist/extraction-span-length.d.ts.map +1 -0
  1031. package/dist/extraction-span-materialize.d.ts +18 -37
  1032. package/dist/extraction-span-materialize.d.ts.map +1 -0
  1033. package/dist/extraction-span-materialize.js +2 -2
  1034. package/dist/extraction-span-overlap.d.ts +2 -3
  1035. package/dist/extraction-span-overlap.d.ts.map +1 -0
  1036. package/dist/extraction-span-provenance.d.ts +4 -5
  1037. package/dist/extraction-span-provenance.d.ts.map +1 -0
  1038. package/dist/extraction-span-shift.d.ts +2 -3
  1039. package/dist/extraction-span-shift.d.ts.map +1 -0
  1040. package/dist/extraction-span-slice.d.ts +2 -3
  1041. package/dist/extraction-span-slice.d.ts.map +1 -0
  1042. package/dist/extraction-span-source-hash.d.ts +5 -6
  1043. package/dist/extraction-span-source-hash.d.ts.map +1 -0
  1044. package/dist/extraction-span-tokens.d.ts +4 -5
  1045. package/dist/extraction-span-tokens.d.ts.map +1 -0
  1046. package/dist/extraction-span-validate.d.ts +5 -6
  1047. package/dist/extraction-span-validate.d.ts.map +1 -0
  1048. package/dist/extraction-span-wire.d.ts +5 -25
  1049. package/dist/extraction-span-wire.d.ts.map +1 -0
  1050. package/dist/extraction-span.d.ts +4 -5
  1051. package/dist/extraction-span.d.ts.map +1 -0
  1052. package/dist/extraction.d.ts +11 -44
  1053. package/dist/extraction.d.ts.map +1 -0
  1054. package/dist/extraction.js +26 -26
  1055. package/dist/faithfulness-config.d.ts +3 -4
  1056. package/dist/faithfulness-config.d.ts.map +1 -0
  1057. package/dist/fallback-llm-codex-subscription.d.ts +23 -42
  1058. package/dist/fallback-llm-codex-subscription.d.ts.map +1 -0
  1059. package/dist/fallback-llm.d.ts +9 -30
  1060. package/dist/fallback-llm.d.ts.map +1 -0
  1061. package/dist/focused-list-recall.d.ts +5 -8
  1062. package/dist/focused-list-recall.d.ts.map +1 -0
  1063. package/dist/graph-append-error.d.ts +3 -27
  1064. package/dist/graph-append-error.d.ts.map +1 -0
  1065. package/dist/graph-dashboard-diff.d.ts +5 -28
  1066. package/dist/graph-dashboard-diff.d.ts.map +1 -0
  1067. package/dist/graph-dashboard-key.d.ts +3 -26
  1068. package/dist/graph-dashboard-key.d.ts.map +1 -0
  1069. package/dist/graph-dashboard-parser.d.ts +6 -29
  1070. package/dist/graph-dashboard-parser.d.ts.map +1 -0
  1071. package/dist/graph-edge-decay-ROSUPDX3.js +30 -0
  1072. package/dist/graph-edge-reinforcement.d.ts +12 -36
  1073. package/dist/graph-edge-reinforcement.d.ts.map +1 -0
  1074. package/dist/graph-events.d.ts +13 -16
  1075. package/dist/graph-events.d.ts.map +1 -0
  1076. package/dist/graph-jsonl.d.ts +8 -31
  1077. package/dist/graph-jsonl.d.ts.map +1 -0
  1078. package/dist/graph-jsonl.js +3 -3
  1079. package/dist/graph-path-reconstruction.d.ts +22 -22
  1080. package/dist/graph-path-reconstruction.d.ts.map +1 -0
  1081. package/dist/graph-path-scoring-config.d.ts +3 -4
  1082. package/dist/graph-path-scoring-config.d.ts.map +1 -0
  1083. package/dist/graph-path-scoring.d.ts +8 -30
  1084. package/dist/graph-path-scoring.d.ts.map +1 -0
  1085. package/dist/graph-recall.d.ts +7 -10
  1086. package/dist/graph-recall.d.ts.map +1 -0
  1087. package/dist/graph-retrieval.d.ts +19 -20
  1088. package/dist/graph-retrieval.d.ts.map +1 -0
  1089. package/dist/graph-snapshot.d.ts +14 -38
  1090. package/dist/graph-snapshot.d.ts.map +1 -0
  1091. package/dist/graph-snapshot.js +3 -3
  1092. package/dist/graph-write-lock.d.ts +7 -10
  1093. package/dist/graph-write-lock.d.ts.map +1 -0
  1094. package/dist/graph.d.ts +325 -22
  1095. package/dist/graph.d.ts.map +1 -0
  1096. package/dist/graph.js +2 -2
  1097. package/dist/harmonic-construction.d.ts +11 -13
  1098. package/dist/harmonic-construction.d.ts.map +1 -0
  1099. package/dist/harmonic-retrieval.d.ts +10 -12
  1100. package/dist/harmonic-retrieval.d.ts.map +1 -0
  1101. package/dist/harmonic-retrieval.js +1 -1
  1102. package/dist/himem.d.ts +3 -4
  1103. package/dist/himem.d.ts.map +1 -0
  1104. package/dist/host-embedding-provider.d.ts +7 -8
  1105. package/dist/host-embedding-provider.d.ts.map +1 -0
  1106. package/dist/http-retry.d.ts +9 -10
  1107. package/dist/http-retry.d.ts.map +1 -0
  1108. package/dist/hygiene.d.ts +4 -5
  1109. package/dist/hygiene.d.ts.map +1 -0
  1110. package/dist/identity-continuity.d.ts +9 -11
  1111. package/dist/identity-continuity.d.ts.map +1 -0
  1112. package/dist/importance.d.ts +6 -26
  1113. package/dist/importance.d.ts.map +1 -0
  1114. package/dist/importers/base.d.ts +261 -0
  1115. package/dist/importers/base.d.ts.map +1 -0
  1116. package/dist/importers/index.d.ts +3 -280
  1117. package/dist/importers/index.d.ts.map +1 -0
  1118. package/dist/importers/test-utils.d.ts +5 -24
  1119. package/dist/importers/test-utils.d.ts.map +1 -0
  1120. package/dist/in-flight-reads.d.ts +10 -29
  1121. package/dist/in-flight-reads.d.ts.map +1 -0
  1122. package/dist/included-memories.d.ts +6 -7
  1123. package/dist/included-memories.d.ts.map +1 -0
  1124. package/dist/index.d.ts +185 -9836
  1125. package/dist/index.d.ts.map +1 -0
  1126. package/dist/index.js +275 -229
  1127. package/dist/inline-script.d.ts +2 -3
  1128. package/dist/inline-script.d.ts.map +1 -0
  1129. package/dist/intent.d.ts +7 -26
  1130. package/dist/intent.d.ts.map +1 -0
  1131. package/dist/json-extract.d.ts +3 -4
  1132. package/dist/json-extract.d.ts.map +1 -0
  1133. package/dist/json-store.d.ts +9 -9
  1134. package/dist/json-store.d.ts.map +1 -0
  1135. package/dist/lcm/archive.d.ts +11 -13
  1136. package/dist/lcm/archive.d.ts.map +1 -0
  1137. package/dist/lcm/dag.d.ts +5 -7
  1138. package/dist/lcm/dag.d.ts.map +1 -0
  1139. package/dist/lcm/engine.d.ts +10 -32
  1140. package/dist/lcm/engine.d.ts.map +1 -0
  1141. package/dist/lcm/engine.js +4 -4
  1142. package/dist/lcm/evidence-identity.d.ts +20 -0
  1143. package/dist/lcm/evidence-identity.d.ts.map +1 -0
  1144. package/dist/lcm/index.d.ts +9 -52
  1145. package/dist/lcm/index.d.ts.map +1 -0
  1146. package/dist/lcm/index.js +13 -13
  1147. package/dist/lcm/queue.d.ts +7 -10
  1148. package/dist/lcm/queue.d.ts.map +1 -0
  1149. package/dist/lcm/recall.d.ts +8 -13
  1150. package/dist/lcm/recall.d.ts.map +1 -0
  1151. package/dist/lcm/schema.d.ts +5 -8
  1152. package/dist/lcm/schema.d.ts.map +1 -0
  1153. package/dist/lcm/summarizer.d.ts +7 -11
  1154. package/dist/lcm/summarizer.d.ts.map +1 -0
  1155. package/dist/lcm/tools.d.ts +4 -30
  1156. package/dist/lcm/tools.d.ts.map +1 -0
  1157. package/dist/lcm-fallback-read.d.ts +4 -5
  1158. package/dist/lcm-fallback-read.d.ts.map +1 -0
  1159. package/dist/lifecycle/seed-graduation-config-types.d.ts +21 -0
  1160. package/dist/lifecycle/seed-graduation-config-types.d.ts.map +1 -0
  1161. package/dist/lifecycle/seed-graduation.d.ts +97 -0
  1162. package/dist/lifecycle/seed-graduation.d.ts.map +1 -0
  1163. package/dist/lifecycle/tombstones.d.ts +389 -0
  1164. package/dist/lifecycle/tombstones.d.ts.map +1 -0
  1165. package/dist/lifecycle.d.ts +14 -33
  1166. package/dist/lifecycle.d.ts.map +1 -0
  1167. package/dist/live-connectors-runner.d.ts +11 -29
  1168. package/dist/live-connectors-runner.d.ts.map +1 -0
  1169. package/dist/local-llm-config.d.ts +5 -7
  1170. package/dist/local-llm-config.d.ts.map +1 -0
  1171. package/dist/local-llm-config.js +1 -1
  1172. package/dist/local-llm-helpers.d.ts +102 -20
  1173. package/dist/local-llm-helpers.d.ts.map +1 -0
  1174. package/dist/local-llm-transport.d.ts +4 -6
  1175. package/dist/local-llm-transport.d.ts.map +1 -0
  1176. package/dist/local-llm.d.ts +145 -20
  1177. package/dist/local-llm.d.ts.map +1 -0
  1178. package/dist/local-model-endpoint.d.ts +10 -29
  1179. package/dist/local-model-endpoint.d.ts.map +1 -0
  1180. package/dist/location/access-operations.d.ts +9 -0
  1181. package/dist/location/access-operations.d.ts.map +1 -0
  1182. package/dist/location/backfill.d.ts +57 -0
  1183. package/dist/location/backfill.d.ts.map +1 -0
  1184. package/dist/location/cli.d.ts +67 -0
  1185. package/dist/location/cli.d.ts.map +1 -0
  1186. package/dist/location/config.d.ts +11 -0
  1187. package/dist/location/config.d.ts.map +1 -0
  1188. package/dist/location/http-glue.d.ts +20 -0
  1189. package/dist/location/http-glue.d.ts.map +1 -0
  1190. package/dist/location/index.d.ts +21 -534
  1191. package/dist/location/index.d.ts.map +1 -0
  1192. package/dist/location/index.js +17 -17
  1193. package/dist/location/intervals.d.ts +61 -0
  1194. package/dist/location/intervals.d.ts.map +1 -0
  1195. package/dist/location/matching.d.ts +124 -0
  1196. package/dist/location/matching.d.ts.map +1 -0
  1197. package/dist/location/mcp-tools.d.ts +12 -0
  1198. package/dist/location/mcp-tools.d.ts.map +1 -0
  1199. package/dist/location/parse-companions.d.ts +7 -0
  1200. package/dist/location/parse-companions.d.ts.map +1 -0
  1201. package/dist/location/pipeline.d.ts +44 -0
  1202. package/dist/location/pipeline.d.ts.map +1 -0
  1203. package/dist/location/provider-setup.d.ts +33 -0
  1204. package/dist/location/provider-setup.d.ts.map +1 -0
  1205. package/dist/location/registry.d.ts +15 -0
  1206. package/dist/location/registry.d.ts.map +1 -0
  1207. package/dist/location/scheduler.d.ts +48 -0
  1208. package/dist/location/scheduler.d.ts.map +1 -0
  1209. package/dist/location/store.d.ts +95 -0
  1210. package/dist/location/store.d.ts.map +1 -0
  1211. package/dist/location/surfaces.d.ts +76 -0
  1212. package/dist/location/surfaces.d.ts.map +1 -0
  1213. package/dist/location/tagging.d.ts +116 -0
  1214. package/dist/location/tagging.d.ts.map +1 -0
  1215. package/dist/location/types.d.ts +109 -0
  1216. package/dist/location/types.d.ts.map +1 -0
  1217. package/dist/logger.d.ts +7 -8
  1218. package/dist/logger.d.ts.map +1 -0
  1219. package/dist/maintenance/archive-observations.d.ts +5 -5
  1220. package/dist/maintenance/archive-observations.d.ts.map +1 -0
  1221. package/dist/maintenance/atomic-file.d.ts +4 -5
  1222. package/dist/maintenance/atomic-file.d.ts.map +1 -0
  1223. package/dist/maintenance/backup-stamp.d.ts +2 -3
  1224. package/dist/maintenance/backup-stamp.d.ts.map +1 -0
  1225. package/dist/maintenance/day-summary-cron.d.ts +20 -0
  1226. package/dist/maintenance/day-summary-cron.d.ts.map +1 -0
  1227. package/dist/maintenance/dreams-ledger.d.ts +172 -0
  1228. package/dist/maintenance/dreams-ledger.d.ts.map +1 -0
  1229. package/dist/maintenance/first-start-migration.d.ts +61 -0
  1230. package/dist/maintenance/first-start-migration.d.ts.map +1 -0
  1231. package/dist/maintenance/forget.d.ts +59 -0
  1232. package/dist/maintenance/forget.d.ts.map +1 -0
  1233. package/dist/maintenance/graph-edge-decay.d.ts +122 -0
  1234. package/dist/maintenance/graph-edge-decay.d.ts.map +1 -0
  1235. package/dist/maintenance/memory-governance-cron.d.ts +9 -10
  1236. package/dist/maintenance/memory-governance-cron.d.ts.map +1 -0
  1237. package/dist/maintenance/memory-governance.d.ts +25 -43
  1238. package/dist/maintenance/memory-governance.d.ts.map +1 -0
  1239. package/dist/maintenance/memory-governance.js +14 -14
  1240. package/dist/maintenance/migrate-observations.d.ts +4 -5
  1241. package/dist/maintenance/migrate-observations.d.ts.map +1 -0
  1242. package/dist/maintenance/namespace-maintenance-fanout.d.ts +132 -0
  1243. package/dist/maintenance/namespace-maintenance-fanout.d.ts.map +1 -0
  1244. package/dist/maintenance/namespace-planner.d.ts +96 -0
  1245. package/dist/maintenance/namespace-planner.d.ts.map +1 -0
  1246. package/dist/maintenance/observation-ledger-utils.d.ts +5 -6
  1247. package/dist/maintenance/observation-ledger-utils.d.ts.map +1 -0
  1248. package/dist/maintenance/pattern-reinforcement.d.ts +129 -0
  1249. package/dist/maintenance/pattern-reinforcement.d.ts.map +1 -0
  1250. package/dist/maintenance/projection-support.d.ts +76 -0
  1251. package/dist/maintenance/projection-support.d.ts.map +1 -0
  1252. package/dist/maintenance/purge.d.ts +85 -0
  1253. package/dist/maintenance/purge.d.ts.map +1 -0
  1254. package/dist/maintenance/rebuild-memory-lifecycle-ledger-cli.d.ts +24 -0
  1255. package/dist/maintenance/rebuild-memory-lifecycle-ledger-cli.d.ts.map +1 -0
  1256. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +11 -43
  1257. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts.map +1 -0
  1258. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -14
  1259. package/dist/maintenance/rebuild-memory-projection.d.ts +14 -72
  1260. package/dist/maintenance/rebuild-memory-projection.d.ts.map +1 -0
  1261. package/dist/maintenance/rebuild-memory-projection.js +15 -15
  1262. package/dist/maintenance/rebuild-observations.d.ts +4 -5
  1263. package/dist/maintenance/rebuild-observations.d.ts.map +1 -0
  1264. package/dist/maintenance/tier-stats.d.ts +59 -0
  1265. package/dist/maintenance/tier-stats.d.ts.map +1 -0
  1266. package/dist/mcp-memory-inspector-app.d.ts +15 -158
  1267. package/dist/mcp-memory-inspector-app.d.ts.map +1 -0
  1268. package/dist/mcp-read-only-tools.d.ts +2 -3
  1269. package/dist/mcp-read-only-tools.d.ts.map +1 -0
  1270. package/dist/mcp-read-only-tools.js +1 -1
  1271. package/dist/meetings/build-scheduler.d.ts +43 -0
  1272. package/dist/meetings/build-scheduler.d.ts.map +1 -0
  1273. package/dist/meetings/build.d.ts +137 -0
  1274. package/dist/meetings/build.d.ts.map +1 -0
  1275. package/dist/meetings/cli.d.ts +37 -0
  1276. package/dist/meetings/cli.d.ts.map +1 -0
  1277. package/dist/meetings/config.d.ts +18 -0
  1278. package/dist/meetings/config.d.ts.map +1 -0
  1279. package/dist/meetings/day-source.d.ts +103 -0
  1280. package/dist/meetings/day-source.d.ts.map +1 -0
  1281. package/dist/meetings/detect.d.ts +33 -0
  1282. package/dist/meetings/detect.d.ts.map +1 -0
  1283. package/dist/meetings/errors.d.ts +10 -0
  1284. package/dist/meetings/errors.d.ts.map +1 -0
  1285. package/dist/meetings/fuse.d.ts +30 -0
  1286. package/dist/meetings/fuse.d.ts.map +1 -0
  1287. package/dist/meetings/http-glue.d.ts +37 -0
  1288. package/dist/meetings/http-glue.d.ts.map +1 -0
  1289. package/dist/meetings/index.d.ts +20 -0
  1290. package/dist/meetings/index.d.ts.map +1 -0
  1291. package/dist/meetings/mcp-tools.d.ts +10 -0
  1292. package/dist/meetings/mcp-tools.d.ts.map +1 -0
  1293. package/dist/meetings/memory-gen.d.ts +157 -0
  1294. package/dist/meetings/memory-gen.d.ts.map +1 -0
  1295. package/dist/meetings/memory-generator.d.ts +113 -0
  1296. package/dist/meetings/memory-generator.d.ts.map +1 -0
  1297. package/dist/meetings/service.d.ts +80 -0
  1298. package/dist/meetings/service.d.ts.map +1 -0
  1299. package/dist/meetings/store.d.ts +121 -0
  1300. package/dist/meetings/store.d.ts.map +1 -0
  1301. package/dist/meetings/summary-extractor.d.ts +96 -0
  1302. package/dist/meetings/summary-extractor.d.ts.map +1 -0
  1303. package/dist/meetings/types.d.ts +155 -0
  1304. package/dist/meetings/types.d.ts.map +1 -0
  1305. package/dist/memory-action-policy.d.ts +6 -25
  1306. package/dist/memory-action-policy.d.ts.map +1 -0
  1307. package/dist/memory-age.d.ts +16 -17
  1308. package/dist/memory-age.d.ts.map +1 -0
  1309. package/dist/memory-browse-http-glue.d.ts +5 -151
  1310. package/dist/memory-browse-http-glue.d.ts.map +1 -0
  1311. package/dist/memory-browse-http-glue.js +2 -2
  1312. package/dist/memory-browse-mcp-tools.d.ts +3 -150
  1313. package/dist/memory-browse-mcp-tools.d.ts.map +1 -0
  1314. package/dist/memory-browse-operations.d.ts +11 -2
  1315. package/dist/memory-browse-operations.d.ts.map +1 -0
  1316. package/dist/memory-browse-operations.js +66 -61
  1317. package/dist/memory-browse.d.ts +16 -36
  1318. package/dist/memory-browse.d.ts.map +1 -0
  1319. package/dist/memory-browse.js +4 -4
  1320. package/dist/memory-cache.d.ts +27 -46
  1321. package/dist/memory-cache.d.ts.map +1 -0
  1322. package/dist/memory-controller.d.ts +29 -50
  1323. package/dist/memory-controller.d.ts.map +1 -0
  1324. package/dist/memory-corpus-version.d.ts +3 -4
  1325. package/dist/memory-corpus-version.d.ts.map +1 -0
  1326. package/dist/memory-extension/claude-code-publisher.d.ts +18 -0
  1327. package/dist/memory-extension/claude-code-publisher.d.ts.map +1 -0
  1328. package/dist/memory-extension/codex-publisher.d.ts +22 -0
  1329. package/dist/memory-extension/codex-publisher.d.ts.map +1 -0
  1330. package/dist/memory-extension/hermes-publisher.d.ts +18 -0
  1331. package/dist/memory-extension/hermes-publisher.d.ts.map +1 -0
  1332. package/dist/memory-extension/index.d.ts +57 -0
  1333. package/dist/memory-extension/index.d.ts.map +1 -0
  1334. package/dist/memory-extension/shared-instructions.d.ts +30 -0
  1335. package/dist/memory-extension/shared-instructions.d.ts.map +1 -0
  1336. package/dist/memory-extension/types.d.ts +88 -0
  1337. package/dist/memory-extension/types.d.ts.map +1 -0
  1338. package/dist/memory-extension-host/host-discovery.d.ts +38 -0
  1339. package/dist/memory-extension-host/host-discovery.d.ts.map +1 -0
  1340. package/dist/memory-extension-host/index.d.ts +7 -0
  1341. package/dist/memory-extension-host/index.d.ts.map +1 -0
  1342. package/dist/memory-extension-host/render-extensions-block.d.ts +23 -0
  1343. package/dist/memory-extension-host/render-extensions-block.d.ts.map +1 -0
  1344. package/dist/memory-extension-host/types.d.ts +20 -0
  1345. package/dist/memory-extension-host/types.d.ts.map +1 -0
  1346. package/dist/memory-lifecycle-ledger-utils.d.ts +19 -38
  1347. package/dist/memory-lifecycle-ledger-utils.d.ts.map +1 -0
  1348. package/dist/memory-projection-format.d.ts +3 -4
  1349. package/dist/memory-projection-format.d.ts.map +1 -0
  1350. package/dist/memory-projection-mutations.d.ts +3 -4
  1351. package/dist/memory-projection-mutations.d.ts.map +1 -0
  1352. package/dist/memory-projection-store.d.ts +35 -54
  1353. package/dist/memory-projection-store.d.ts.map +1 -0
  1354. package/dist/memory-provenance.d.ts +10 -29
  1355. package/dist/memory-provenance.d.ts.map +1 -0
  1356. package/dist/memory-snapshot.d.ts +3 -22
  1357. package/dist/memory-snapshot.d.ts.map +1 -0
  1358. package/dist/memory-subject-cli.d.ts +9 -156
  1359. package/dist/memory-subject-cli.d.ts.map +1 -0
  1360. package/dist/memory-subject.d.ts +132 -145
  1361. package/dist/memory-subject.d.ts.map +1 -0
  1362. package/dist/memory-worth-bench.d.ts +4 -5
  1363. package/dist/memory-worth-bench.d.ts.map +1 -0
  1364. package/dist/memory-worth-filter.d.ts +8 -11
  1365. package/dist/memory-worth-filter.d.ts.map +1 -0
  1366. package/dist/memory-worth-outcomes.d.ts +11 -45
  1367. package/dist/memory-worth-outcomes.d.ts.map +1 -0
  1368. package/dist/memory-worth.d.ts +4 -5
  1369. package/dist/memory-worth.d.ts.map +1 -0
  1370. package/dist/message-parts/index.d.ts +15 -16
  1371. package/dist/message-parts/index.d.ts.map +1 -0
  1372. package/dist/migrate/from-engram.d.ts +6 -7
  1373. package/dist/migrate/from-engram.d.ts.map +1 -0
  1374. package/dist/model-registry.d.ts +3 -4
  1375. package/dist/model-registry.d.ts.map +1 -0
  1376. package/dist/models-json.d.ts +5 -24
  1377. package/dist/models-json.d.ts.map +1 -0
  1378. package/dist/namespaces/catalog.d.ts +473 -0
  1379. package/dist/namespaces/catalog.d.ts.map +1 -0
  1380. package/dist/namespaces/identity.d.ts +5 -0
  1381. package/dist/namespaces/identity.d.ts.map +1 -0
  1382. package/dist/namespaces/migrate.d.ts +11 -46
  1383. package/dist/namespaces/migrate.d.ts.map +1 -0
  1384. package/dist/namespaces/migrate.js +15 -15
  1385. package/dist/namespaces/path.d.ts +3 -0
  1386. package/dist/namespaces/path.d.ts.map +1 -0
  1387. package/dist/namespaces/principal.d.ts +9 -28
  1388. package/dist/namespaces/principal.d.ts.map +1 -0
  1389. package/dist/namespaces/scope-profile-config.d.ts +5 -0
  1390. package/dist/namespaces/scope-profile-config.d.ts.map +1 -0
  1391. package/dist/namespaces/scope-profiles.d.ts +46 -0
  1392. package/dist/namespaces/scope-profiles.d.ts.map +1 -0
  1393. package/dist/namespaces/search.d.ts +10 -28
  1394. package/dist/namespaces/search.d.ts.map +1 -0
  1395. package/dist/namespaces/search.js +5 -5
  1396. package/dist/namespaces/storage.d.ts +8 -41
  1397. package/dist/namespaces/storage.d.ts.map +1 -0
  1398. package/dist/namespaces/storage.js +14 -14
  1399. package/dist/native-binding-hint.d.ts +3 -4
  1400. package/dist/native-binding-hint.d.ts.map +1 -0
  1401. package/dist/native-knowledge.d.ts +15 -34
  1402. package/dist/native-knowledge.d.ts.map +1 -0
  1403. package/dist/negative.d.ts +3 -4
  1404. package/dist/negative.d.ts.map +1 -0
  1405. package/dist/network/tailscale.d.ts +7 -8
  1406. package/dist/network/tailscale.d.ts.map +1 -0
  1407. package/dist/network/webdav.d.ts +9 -10
  1408. package/dist/network/webdav.d.ts.map +1 -0
  1409. package/dist/objective-state-writers.d.ts +8 -9
  1410. package/dist/objective-state-writers.d.ts.map +1 -0
  1411. package/dist/objective-state.d.ts +15 -16
  1412. package/dist/objective-state.d.ts.map +1 -0
  1413. package/dist/offline-sync-exclude-globs.d.ts +3 -4
  1414. package/dist/offline-sync-exclude-globs.d.ts.map +1 -0
  1415. package/dist/offline-sync-file-io.d.ts +8 -9
  1416. package/dist/offline-sync-file-io.d.ts.map +1 -0
  1417. package/dist/offline-sync-impression-drain.d.ts +8 -26
  1418. package/dist/offline-sync-impression-drain.d.ts.map +1 -0
  1419. package/dist/offline-sync-impression-drain.js +2 -2
  1420. package/dist/offline-sync.d.ts +57 -58
  1421. package/dist/offline-sync.d.ts.map +1 -0
  1422. package/dist/okf/cli.d.ts +10 -0
  1423. package/dist/okf/cli.d.ts.map +1 -0
  1424. package/dist/okf/config.d.ts +11 -0
  1425. package/dist/okf/config.d.ts.map +1 -0
  1426. package/dist/okf/index-files.d.ts +7 -0
  1427. package/dist/okf/index-files.d.ts.map +1 -0
  1428. package/dist/okf/lint.d.ts +12 -0
  1429. package/dist/okf/lint.d.ts.map +1 -0
  1430. package/dist/okf/render.d.ts +29 -0
  1431. package/dist/okf/render.d.ts.map +1 -0
  1432. package/dist/okf/sweep.d.ts +9 -0
  1433. package/dist/okf/sweep.d.ts.map +1 -0
  1434. package/dist/okf/type-mapping.d.ts +30 -0
  1435. package/dist/okf/type-mapping.d.ts.map +1 -0
  1436. package/dist/onboarding/index.d.ts +63 -0
  1437. package/dist/onboarding/index.d.ts.map +1 -0
  1438. package/dist/openai-chat-compat.d.ts +6 -7
  1439. package/dist/openai-chat-compat.d.ts.map +1 -0
  1440. package/dist/operator-doctor-corpus.d.ts +8 -29
  1441. package/dist/operator-doctor-corpus.d.ts.map +1 -0
  1442. package/dist/operator-doctor-corpus.js +21 -21
  1443. package/dist/operator-doctor-replica.d.ts +8 -29
  1444. package/dist/operator-doctor-replica.d.ts.map +1 -0
  1445. package/dist/operator-doctor-replica.js +4 -4
  1446. package/dist/operator-doctor-types.d.ts +2 -3
  1447. package/dist/operator-doctor-types.d.ts.map +1 -0
  1448. package/dist/operator-toolkit.d.ts +43 -75
  1449. package/dist/operator-toolkit.d.ts.map +1 -0
  1450. package/dist/operator-toolkit.js +37 -37
  1451. package/dist/opik-exporter.d.ts +6 -8
  1452. package/dist/opik-exporter.d.ts.map +1 -0
  1453. package/dist/orchestration/compression-guideline-coordinator.d.ts +6 -40
  1454. package/dist/orchestration/compression-guideline-coordinator.d.ts.map +1 -0
  1455. package/dist/orchestration/consolidation-run.d.ts +93 -0
  1456. package/dist/orchestration/consolidation-run.d.ts.map +1 -0
  1457. package/dist/orchestration/contradiction-linking-coordinator.d.ts +102 -0
  1458. package/dist/orchestration/contradiction-linking-coordinator.d.ts.map +1 -0
  1459. package/dist/orchestration/conversation-index-coordinator.d.ts +99 -0
  1460. package/dist/orchestration/conversation-index-coordinator.d.ts.map +1 -0
  1461. package/dist/orchestration/dependency-propagation-delivery.d.ts +129 -0
  1462. package/dist/orchestration/dependency-propagation-delivery.d.ts.map +1 -0
  1463. package/dist/orchestration/dependency-propagation-queue-state.d.ts +15 -0
  1464. package/dist/orchestration/dependency-propagation-queue-state.d.ts.map +1 -0
  1465. package/dist/orchestration/dependency-propagation-recovery-replay.d.ts +49 -0
  1466. package/dist/orchestration/dependency-propagation-recovery-replay.d.ts.map +1 -0
  1467. package/dist/orchestration/dependency-propagation-replay-reconciliation.d.ts +25 -0
  1468. package/dist/orchestration/dependency-propagation-replay-reconciliation.d.ts.map +1 -0
  1469. package/dist/orchestration/dependency-propagation.d.ts +64 -0
  1470. package/dist/orchestration/dependency-propagation.d.ts.map +1 -0
  1471. package/dist/orchestration/dependency-revalidation.d.ts +45 -0
  1472. package/dist/orchestration/dependency-revalidation.d.ts.map +1 -0
  1473. package/dist/orchestration/entity-synthesis-coordinator.d.ts +64 -0
  1474. package/dist/orchestration/entity-synthesis-coordinator.d.ts.map +1 -0
  1475. package/dist/orchestration/episodic-context-section.d.ts +30 -0
  1476. package/dist/orchestration/episodic-context-section.d.ts.map +1 -0
  1477. package/dist/orchestration/extraction-anchor-snapshot.d.ts +20 -0
  1478. package/dist/orchestration/extraction-anchor-snapshot.d.ts.map +1 -0
  1479. package/dist/orchestration/extraction-envelope.d.ts +40 -0
  1480. package/dist/orchestration/extraction-envelope.d.ts.map +1 -0
  1481. package/dist/orchestration/extraction-injection-gate.d.ts +51 -0
  1482. package/dist/orchestration/extraction-injection-gate.d.ts.map +1 -0
  1483. package/dist/orchestration/extraction-origin-context.d.ts +19 -0
  1484. package/dist/orchestration/extraction-origin-context.d.ts.map +1 -0
  1485. package/dist/orchestration/extraction-persist-deps.d.ts +76 -0
  1486. package/dist/orchestration/extraction-persist-deps.d.ts.map +1 -0
  1487. package/dist/orchestration/extraction-persist-promotion.d.ts +203 -0
  1488. package/dist/orchestration/extraction-persist-promotion.d.ts.map +1 -0
  1489. package/dist/orchestration/extraction-persist.d.ts +19 -0
  1490. package/dist/orchestration/extraction-persist.d.ts.map +1 -0
  1491. package/dist/orchestration/extraction-queue-coordinator.d.ts +103 -0
  1492. package/dist/orchestration/extraction-queue-coordinator.d.ts.map +1 -0
  1493. package/dist/orchestration/extraction-run-helpers.d.ts +123 -0
  1494. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -0
  1495. package/dist/orchestration/extraction-run.d.ts +174 -0
  1496. package/dist/orchestration/extraction-run.d.ts.map +1 -0
  1497. package/dist/orchestration/extraction-shutdown.d.ts +6 -0
  1498. package/dist/orchestration/extraction-shutdown.d.ts.map +1 -0
  1499. package/dist/orchestration/extraction-watermark.d.ts +28 -0
  1500. package/dist/orchestration/extraction-watermark.d.ts.map +1 -0
  1501. package/dist/orchestration/generic-recall-paths.d.ts +36 -0
  1502. package/dist/orchestration/generic-recall-paths.d.ts.map +1 -0
  1503. package/dist/orchestration/graph-path-state-loader.d.ts +15 -0
  1504. package/dist/orchestration/graph-path-state-loader.d.ts.map +1 -0
  1505. package/dist/orchestration/graph-recall-coordinator.d.ts +107 -0
  1506. package/dist/orchestration/graph-recall-coordinator.d.ts.map +1 -0
  1507. package/dist/orchestration/harmonic-construction-persist.d.ts +58 -0
  1508. package/dist/orchestration/harmonic-construction-persist.d.ts.map +1 -0
  1509. package/dist/orchestration/lifecycle-policy-coordinator.d.ts +81 -0
  1510. package/dist/orchestration/lifecycle-policy-coordinator.d.ts.map +1 -0
  1511. package/dist/orchestration/maintenance.d.ts +229 -37
  1512. package/dist/orchestration/maintenance.d.ts.map +1 -0
  1513. package/dist/orchestration/maintenance.js +25 -25
  1514. package/dist/orchestration/namespace-read-fanout.d.ts +95 -0
  1515. package/dist/orchestration/namespace-read-fanout.d.ts.map +1 -0
  1516. package/dist/orchestration/orchestrator-helpers.d.ts +408 -0
  1517. package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -0
  1518. package/dist/orchestration/orchestrator-init.d.ts +124 -0
  1519. package/dist/orchestration/orchestrator-init.d.ts.map +1 -0
  1520. package/dist/orchestration/orchestrator-namespace-scope.d.ts +19 -0
  1521. package/dist/orchestration/orchestrator-namespace-scope.d.ts.map +1 -0
  1522. package/dist/orchestration/persistence-index.d.ts +141 -0
  1523. package/dist/orchestration/persistence-index.d.ts.map +1 -0
  1524. package/dist/orchestration/projection-rebuild-schedule.d.ts +21 -0
  1525. package/dist/orchestration/projection-rebuild-schedule.d.ts.map +1 -0
  1526. package/dist/orchestration/qmd-result-resolver.d.ts +75 -0
  1527. package/dist/orchestration/qmd-result-resolver.d.ts.map +1 -0
  1528. package/dist/orchestration/recall-background-writes.d.ts +3 -0
  1529. package/dist/orchestration/recall-background-writes.d.ts.map +1 -0
  1530. package/dist/orchestration/recall-entry.d.ts +78 -0
  1531. package/dist/orchestration/recall-entry.d.ts.map +1 -0
  1532. package/dist/orchestration/recall-internal-deps.d.ts +311 -0
  1533. package/dist/orchestration/recall-internal-deps.d.ts.map +1 -0
  1534. package/dist/orchestration/recall-internal.d.ts +30 -0
  1535. package/dist/orchestration/recall-internal.d.ts.map +1 -0
  1536. package/dist/orchestration/recall-introspection.d.ts +108 -0
  1537. package/dist/orchestration/recall-introspection.d.ts.map +1 -0
  1538. package/dist/orchestration/recall-profile-storage.d.ts +20 -0
  1539. package/dist/orchestration/recall-profile-storage.d.ts.map +1 -0
  1540. package/dist/orchestration/recall-recognition-index.d.ts +23 -0
  1541. package/dist/orchestration/recall-recognition-index.d.ts.map +1 -0
  1542. package/dist/orchestration/recall-recognition-search.d.ts +7 -0
  1543. package/dist/orchestration/recall-recognition-search.d.ts.map +1 -0
  1544. package/dist/orchestration/recall-rerank-coordinator.d.ts +126 -0
  1545. package/dist/orchestration/recall-rerank-coordinator.d.ts.map +1 -0
  1546. package/dist/orchestration/recall-result-formatter.d.ts +128 -0
  1547. package/dist/orchestration/recall-result-formatter.d.ts.map +1 -0
  1548. package/dist/orchestration/recall-search-pipeline.d.ts +284 -0
  1549. package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -0
  1550. package/dist/orchestration/recall-search-prefilter.d.ts +31 -0
  1551. package/dist/orchestration/recall-search-prefilter.d.ts.map +1 -0
  1552. package/dist/orchestration/recall-section-coordinator.d.ts +92 -0
  1553. package/dist/orchestration/recall-section-coordinator.d.ts.map +1 -0
  1554. package/dist/orchestration/self-deps.d.ts +27 -0
  1555. package/dist/orchestration/self-deps.d.ts.map +1 -0
  1556. package/dist/orchestration/semantic-consolidation-coordinator.d.ts +64 -0
  1557. package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -0
  1558. package/dist/orchestration/semantic-merge-commit-effects.d.ts +193 -0
  1559. package/dist/orchestration/semantic-merge-commit-effects.d.ts.map +1 -0
  1560. package/dist/orchestration/semantic-merge-persist.d.ts +318 -0
  1561. package/dist/orchestration/semantic-merge-persist.d.ts.map +1 -0
  1562. package/dist/orchestration/semantic-merge-promotion-payload.d.ts +132 -0
  1563. package/dist/orchestration/semantic-merge-promotion-payload.d.ts.map +1 -0
  1564. package/dist/orchestration/session-context.d.ts +225 -0
  1565. package/dist/orchestration/session-context.d.ts.map +1 -0
  1566. package/dist/orchestration/startup-collection-checks.d.ts +23 -0
  1567. package/dist/orchestration/startup-collection-checks.d.ts.map +1 -0
  1568. package/dist/orchestration/tier-migration-coordinator.d.ts +65 -0
  1569. package/dist/orchestration/tier-migration-coordinator.d.ts.map +1 -0
  1570. package/dist/orchestration/turn-ingestion.d.ts +227 -0
  1571. package/dist/orchestration/turn-ingestion.d.ts.map +1 -0
  1572. package/dist/orchestration/update-localization.d.ts +37 -0
  1573. package/dist/orchestration/update-localization.d.ts.map +1 -0
  1574. package/dist/orchestration/workspace-ops.d.ts +154 -0
  1575. package/dist/orchestration/workspace-ops.d.ts.map +1 -0
  1576. package/dist/orchestration/xray-capture-queue.d.ts +17 -0
  1577. package/dist/orchestration/xray-capture-queue.d.ts.map +1 -0
  1578. package/dist/orchestrator.d.ts +867 -109
  1579. package/dist/orchestrator.d.ts.map +1 -0
  1580. package/dist/orchestrator.js +157 -152
  1581. package/dist/page-versioning.d.ts +16 -17
  1582. package/dist/page-versioning.d.ts.map +1 -0
  1583. package/dist/patterns-cli.d.ts +20 -40
  1584. package/dist/patterns-cli.d.ts.map +1 -0
  1585. package/dist/peers/index.d.ts +17 -327
  1586. package/dist/peers/index.d.ts.map +1 -0
  1587. package/dist/peers/migrate-from-identity-anchor.d.ts +119 -0
  1588. package/dist/peers/migrate-from-identity-anchor.d.ts.map +1 -0
  1589. package/dist/peers/profile-reasoner.d.ts +204 -0
  1590. package/dist/peers/profile-reasoner.d.ts.map +1 -0
  1591. package/dist/peers/storage.d.ts +163 -0
  1592. package/dist/peers/storage.d.ts.map +1 -0
  1593. package/dist/peers/types.d.ts +125 -0
  1594. package/dist/peers/types.d.ts.map +1 -0
  1595. package/dist/plugin-entry-resolver.d.ts +3 -4
  1596. package/dist/plugin-entry-resolver.d.ts.map +1 -0
  1597. package/dist/plugin-id.d.ts +4 -5
  1598. package/dist/plugin-id.d.ts.map +1 -0
  1599. package/dist/policy-runtime.d.ts +7 -26
  1600. package/dist/policy-runtime.d.ts.map +1 -0
  1601. package/dist/preferences/drift-config.d.ts +27 -0
  1602. package/dist/preferences/drift-config.d.ts.map +1 -0
  1603. package/dist/preferences/drift-recall.d.ts +74 -0
  1604. package/dist/preferences/drift-recall.d.ts.map +1 -0
  1605. package/dist/preferences/drift-types.d.ts +59 -0
  1606. package/dist/preferences/drift-types.d.ts.map +1 -0
  1607. package/dist/preferences/index.d.ts +12 -0
  1608. package/dist/preferences/index.d.ts.map +1 -0
  1609. package/dist/preferences/preference-drift.d.ts +144 -0
  1610. package/dist/preferences/preference-drift.d.ts.map +1 -0
  1611. package/dist/prioritized-embed.d.ts +3 -4
  1612. package/dist/prioritized-embed.d.ts.map +1 -0
  1613. package/dist/proactive-contention.d.ts +4 -24
  1614. package/dist/proactive-contention.d.ts.map +1 -0
  1615. package/dist/procedural/library-maintenance.d.ts +102 -0
  1616. package/dist/procedural/library-maintenance.d.ts.map +1 -0
  1617. package/dist/procedural/maintenance-config.d.ts +9 -0
  1618. package/dist/procedural/maintenance-config.d.ts.map +1 -0
  1619. package/dist/procedural/procedure-miner.d.ts +20 -0
  1620. package/dist/procedural/procedure-miner.d.ts.map +1 -0
  1621. package/dist/procedural/procedure-recall.d.ts +30 -0
  1622. package/dist/procedural/procedure-recall.d.ts.map +1 -0
  1623. package/dist/procedural/procedure-stats.d.ts +68 -0
  1624. package/dist/procedural/procedure-stats.d.ts.map +1 -0
  1625. package/dist/procedural/procedure-types.d.ts +26 -0
  1626. package/dist/procedural/procedure-types.d.ts.map +1 -0
  1627. package/dist/procedural/reinforcement-core.d.ts +39 -0
  1628. package/dist/procedural/reinforcement-core.d.ts.map +1 -0
  1629. package/dist/procedural/skill-io.d.ts +70 -0
  1630. package/dist/procedural/skill-io.d.ts.map +1 -0
  1631. package/dist/procedural/skill-projection.d.ts +98 -0
  1632. package/dist/procedural/skill-projection.d.ts.map +1 -0
  1633. package/dist/profiling.d.ts +10 -11
  1634. package/dist/profiling.d.ts.map +1 -0
  1635. package/dist/projection/index.d.ts +62 -0
  1636. package/dist/projection/index.d.ts.map +1 -0
  1637. package/dist/provenance.d.ts +13 -33
  1638. package/dist/provenance.d.ts.map +1 -0
  1639. package/dist/provenance.js +2 -2
  1640. package/dist/providers/codex-subscription.d.ts +115 -0
  1641. package/dist/providers/codex-subscription.d.ts.map +1 -0
  1642. package/dist/qmd-preflight.d.ts +31 -21
  1643. package/dist/qmd-preflight.d.ts.map +1 -0
  1644. package/dist/qmd-recall-cache.d.ts +11 -30
  1645. package/dist/qmd-recall-cache.d.ts.map +1 -0
  1646. package/dist/qmd-status.d.ts +10 -11
  1647. package/dist/qmd-status.d.ts.map +1 -0
  1648. package/dist/qmd.d.ts +325 -21
  1649. package/dist/qmd.d.ts.map +1 -0
  1650. package/dist/reasoning-trace-recall.d.ts +7 -8
  1651. package/dist/reasoning-trace-recall.d.ts.map +1 -0
  1652. package/dist/reasoning-trace-types.d.ts +9 -10
  1653. package/dist/reasoning-trace-types.d.ts.map +1 -0
  1654. package/dist/recall-audit-anomaly.d.ts +11 -15
  1655. package/dist/recall-audit-anomaly.d.ts.map +1 -0
  1656. package/dist/recall-audit.d.ts +6 -8
  1657. package/dist/recall-audit.d.ts.map +1 -0
  1658. package/dist/recall-composition-decision.d.ts +9 -12
  1659. package/dist/recall-composition-decision.d.ts.map +1 -0
  1660. package/dist/recall-concurrency-config.d.ts +3 -22
  1661. package/dist/recall-concurrency-config.d.ts.map +1 -0
  1662. package/dist/recall-context-composition.d.ts +21 -22
  1663. package/dist/recall-context-composition.d.ts.map +1 -0
  1664. package/dist/recall-deep-access.d.ts +9 -12
  1665. package/dist/recall-deep-access.d.ts.map +1 -0
  1666. package/dist/recall-deep-budget-left.d.ts +2 -3
  1667. package/dist/recall-deep-budget-left.d.ts.map +1 -0
  1668. package/dist/recall-deep-budget.d.ts +2 -3
  1669. package/dist/recall-deep-budget.d.ts.map +1 -0
  1670. package/dist/recall-deep-expand-select.d.ts +4 -5
  1671. package/dist/recall-deep-expand-select.d.ts.map +1 -0
  1672. package/dist/recall-deep-expand.d.ts +2 -3
  1673. package/dist/recall-deep-expand.d.ts.map +1 -0
  1674. package/dist/recall-deep-frontier.d.ts +4 -5
  1675. package/dist/recall-deep-frontier.d.ts.map +1 -0
  1676. package/dist/recall-deep-policy.d.ts +5 -6
  1677. package/dist/recall-deep-policy.d.ts.map +1 -0
  1678. package/dist/recall-deep-query.d.ts +3 -4
  1679. package/dist/recall-deep-query.d.ts.map +1 -0
  1680. package/dist/recall-deep-refine.d.ts +2 -3
  1681. package/dist/recall-deep-refine.d.ts.map +1 -0
  1682. package/dist/recall-deep-render.d.ts +3 -6
  1683. package/dist/recall-deep-render.d.ts.map +1 -0
  1684. package/dist/recall-deep-rewrite.d.ts +4 -5
  1685. package/dist/recall-deep-rewrite.d.ts.map +1 -0
  1686. package/dist/recall-deep-step-count.d.ts +2 -3
  1687. package/dist/recall-deep-step-count.d.ts.map +1 -0
  1688. package/dist/recall-deep-stop-reason.d.ts +5 -6
  1689. package/dist/recall-deep-stop-reason.d.ts.map +1 -0
  1690. package/dist/recall-deep-stop.d.ts +6 -7
  1691. package/dist/recall-deep-stop.d.ts.map +1 -0
  1692. package/dist/recall-deep-trace-empty.d.ts +2 -3
  1693. package/dist/recall-deep-trace-empty.d.ts.map +1 -0
  1694. package/dist/recall-deep-working-set.d.ts +2 -3
  1695. package/dist/recall-deep-working-set.d.ts.map +1 -0
  1696. package/dist/recall-deep.d.ts +11 -12
  1697. package/dist/recall-deep.d.ts.map +1 -0
  1698. package/dist/recall-disclosure-escalation.d.ts +9 -29
  1699. package/dist/recall-disclosure-escalation.d.ts.map +1 -0
  1700. package/dist/recall-explain-renderer.d.ts +12 -38
  1701. package/dist/recall-explain-renderer.d.ts.map +1 -0
  1702. package/dist/recall-explain-renderer.js +3 -3
  1703. package/dist/recall-handles.d.ts +23 -24
  1704. package/dist/recall-handles.d.ts.map +1 -0
  1705. package/dist/recall-memory-map.d.ts +8 -27
  1706. package/dist/recall-memory-map.d.ts.map +1 -0
  1707. package/dist/recall-mmr.d.ts +13 -14
  1708. package/dist/recall-mmr.d.ts.map +1 -0
  1709. package/dist/recall-navigate-access.d.ts +6 -27
  1710. package/dist/recall-navigate-access.d.ts.map +1 -0
  1711. package/dist/recall-navigate-access.js +2 -2
  1712. package/dist/recall-navigate-action.d.ts +5 -5
  1713. package/dist/recall-navigate-action.d.ts.map +1 -0
  1714. package/dist/recall-navigate-budget.d.ts +3 -4
  1715. package/dist/recall-navigate-budget.d.ts.map +1 -0
  1716. package/dist/recall-navigate-cost.d.ts +2 -3
  1717. package/dist/recall-navigate-cost.d.ts.map +1 -0
  1718. package/dist/recall-navigate-depth.d.ts +2 -3
  1719. package/dist/recall-navigate-depth.d.ts.map +1 -0
  1720. package/dist/recall-navigate-disclosure.d.ts +5 -25
  1721. package/dist/recall-navigate-disclosure.d.ts.map +1 -0
  1722. package/dist/recall-navigate-disclosure.js +2 -2
  1723. package/dist/recall-navigate-link.d.ts +5 -5
  1724. package/dist/recall-navigate-link.d.ts.map +1 -0
  1725. package/dist/recall-navigate-max-children.d.ts +2 -3
  1726. package/dist/recall-navigate-max-children.d.ts.map +1 -0
  1727. package/dist/recall-navigate-node.d.ts +3 -4
  1728. package/dist/recall-navigate-node.d.ts.map +1 -0
  1729. package/dist/recall-navigate-path.d.ts +2 -3
  1730. package/dist/recall-navigate-path.d.ts.map +1 -0
  1731. package/dist/recall-navigate-render.d.ts +3 -4
  1732. package/dist/recall-navigate-render.d.ts.map +1 -0
  1733. package/dist/recall-navigate-traverse.d.ts +5 -6
  1734. package/dist/recall-navigate-traverse.d.ts.map +1 -0
  1735. package/dist/recall-navigate-window.d.ts +5 -6
  1736. package/dist/recall-navigate-window.d.ts.map +1 -0
  1737. package/dist/recall-navigate.d.ts +13 -33
  1738. package/dist/recall-navigate.d.ts.map +1 -0
  1739. package/dist/recall-navigate.js +2 -2
  1740. package/dist/recall-navigation-config.d.ts +7 -8
  1741. package/dist/recall-navigation-config.d.ts.map +1 -0
  1742. package/dist/recall-navigation-http-glue.d.ts +5 -151
  1743. package/dist/recall-navigation-http-glue.d.ts.map +1 -0
  1744. package/dist/recall-navigation-http-glue.js +2 -2
  1745. package/dist/recall-navigation-mcp-tools.d.ts +3 -150
  1746. package/dist/recall-navigation-mcp-tools.d.ts.map +1 -0
  1747. package/dist/recall-navigation-operations.d.ts +11 -2
  1748. package/dist/recall-navigation-operations.d.ts.map +1 -0
  1749. package/dist/recall-navigation-operations.js +66 -61
  1750. package/dist/recall-navigation-renderer.d.ts +4 -28
  1751. package/dist/recall-navigation-renderer.d.ts.map +1 -0
  1752. package/dist/recall-navigation.d.ts +13 -34
  1753. package/dist/recall-navigation.d.ts.map +1 -0
  1754. package/dist/recall-navigation.js +65 -60
  1755. package/dist/recall-pipeline-stages.d.ts +6 -9
  1756. package/dist/recall-pipeline-stages.d.ts.map +1 -0
  1757. package/dist/recall-planner-i18n.d.ts +13 -14
  1758. package/dist/recall-planner-i18n.d.ts.map +1 -0
  1759. package/dist/recall-planner-llm.d.ts +8 -30
  1760. package/dist/recall-planner-llm.d.ts.map +1 -0
  1761. package/dist/recall-qos.d.ts +13 -15
  1762. package/dist/recall-qos.d.ts.map +1 -0
  1763. package/dist/recall-query-policy.d.ts +9 -10
  1764. package/dist/recall-query-policy.d.ts.map +1 -0
  1765. package/dist/recall-recognition-tier.d.ts +27 -28
  1766. package/dist/recall-recognition-tier.d.ts.map +1 -0
  1767. package/dist/recall-state-view-admission.d.ts +7 -26
  1768. package/dist/recall-state-view-admission.d.ts.map +1 -0
  1769. package/dist/recall-state-view-admission.js +3 -3
  1770. package/dist/recall-state-view-anchors.d.ts +10 -29
  1771. package/dist/recall-state-view-anchors.d.ts.map +1 -0
  1772. package/dist/recall-state-view-current.d.ts +4 -5
  1773. package/dist/recall-state-view-current.d.ts.map +1 -0
  1774. package/dist/recall-state-view-inject.d.ts +3 -7
  1775. package/dist/recall-state-view-inject.d.ts.map +1 -0
  1776. package/dist/recall-state-view-kind.d.ts +5 -5
  1777. package/dist/recall-state-view-kind.d.ts.map +1 -0
  1778. package/dist/recall-state-view-label.d.ts +3 -6
  1779. package/dist/recall-state-view-label.d.ts.map +1 -0
  1780. package/dist/recall-state-view-packet.d.ts +7 -9
  1781. package/dist/recall-state-view-packet.d.ts.map +1 -0
  1782. package/dist/recall-state-view-render.d.ts +4 -7
  1783. package/dist/recall-state-view-render.d.ts.map +1 -0
  1784. package/dist/recall-state-view-successor.d.ts +3 -4
  1785. package/dist/recall-state-view-successor.d.ts.map +1 -0
  1786. package/dist/recall-state-view-superseded.d.ts +3 -4
  1787. package/dist/recall-state-view-superseded.d.ts.map +1 -0
  1788. package/dist/recall-state-view-transition.d.ts +4 -5
  1789. package/dist/recall-state-view-transition.d.ts.map +1 -0
  1790. package/dist/recall-state-view-widen.d.ts +3 -6
  1791. package/dist/recall-state-view-widen.d.ts.map +1 -0
  1792. package/dist/recall-state-view-wire.d.ts +3 -6
  1793. package/dist/recall-state-view-wire.d.ts.map +1 -0
  1794. package/dist/recall-state-view-zero-diff.d.ts +4 -5
  1795. package/dist/recall-state-view-zero-diff.d.ts.map +1 -0
  1796. package/dist/recall-state-view.d.ts +16 -17
  1797. package/dist/recall-state-view.d.ts.map +1 -0
  1798. package/dist/recall-state.d.ts +17 -35
  1799. package/dist/recall-state.d.ts.map +1 -0
  1800. package/dist/recall-tag-filter.d.ts +10 -33
  1801. package/dist/recall-tag-filter.d.ts.map +1 -0
  1802. package/dist/recall-timings.d.ts +10 -29
  1803. package/dist/recall-timings.d.ts.map +1 -0
  1804. package/dist/recall-tokenization.d.ts +7 -8
  1805. package/dist/recall-tokenization.d.ts.map +1 -0
  1806. package/dist/recall-why-cli.d.ts +25 -0
  1807. package/dist/recall-why-cli.d.ts.map +1 -0
  1808. package/dist/recall-why-cli.js +9 -0
  1809. package/dist/recall-why-cli.js.map +1 -0
  1810. package/dist/recall-why-renderer.d.ts +25 -0
  1811. package/dist/recall-why-renderer.d.ts.map +1 -0
  1812. package/dist/recall-why-renderer.js +18 -0
  1813. package/dist/recall-why-renderer.js.map +1 -0
  1814. package/dist/recall-why-service.d.ts +49 -0
  1815. package/dist/recall-why-service.d.ts.map +1 -0
  1816. package/dist/recall-why-service.js +46 -0
  1817. package/dist/recall-why-service.js.map +1 -0
  1818. package/dist/recall-why.d.ts +175 -0
  1819. package/dist/recall-why.d.ts.map +1 -0
  1820. package/dist/recall-why.js +25 -0
  1821. package/dist/recall-why.js.map +1 -0
  1822. package/dist/recall-xray-cli.d.ts +7 -31
  1823. package/dist/recall-xray-cli.d.ts.map +1 -0
  1824. package/dist/recall-xray-cli.js +4 -4
  1825. package/dist/recall-xray-renderer.d.ts +9 -33
  1826. package/dist/recall-xray-renderer.d.ts.map +1 -0
  1827. package/dist/recall-xray-renderer.js +3 -3
  1828. package/dist/recall-xray.d.ts +19 -39
  1829. package/dist/recall-xray.d.ts.map +1 -0
  1830. package/dist/recall-xray.js +2 -2
  1831. package/dist/reconcile/cursor.d.ts +15 -37
  1832. package/dist/reconcile/cursor.d.ts.map +1 -0
  1833. package/dist/reconcile/manifest.d.ts +19 -40
  1834. package/dist/reconcile/manifest.d.ts.map +1 -0
  1835. package/dist/reconcile/manifest.js +2 -2
  1836. package/dist/reconcile/plan.d.ts +22 -42
  1837. package/dist/reconcile/plan.d.ts.map +1 -0
  1838. package/dist/reconstruct.d.ts +2 -3
  1839. package/dist/reconstruct.d.ts.map +1 -0
  1840. package/dist/relay/mission-access.d.ts +28 -0
  1841. package/dist/relay/mission-access.d.ts.map +1 -0
  1842. package/dist/relay/mission-fixture.d.ts +11 -0
  1843. package/dist/relay/mission-fixture.d.ts.map +1 -0
  1844. package/dist/relay/mission.d.ts +3952 -0
  1845. package/dist/relay/mission.d.ts.map +1 -0
  1846. package/dist/release-changelog.d.ts +3 -4
  1847. package/dist/release-changelog.d.ts.map +1 -0
  1848. package/dist/relevance.d.ts +3 -3
  1849. package/dist/relevance.d.ts.map +1 -0
  1850. package/dist/replay/normalizers/chatgpt.d.ts +3 -23
  1851. package/dist/replay/normalizers/chatgpt.d.ts.map +1 -0
  1852. package/dist/replay/normalizers/claude.d.ts +3 -23
  1853. package/dist/replay/normalizers/claude.d.ts.map +1 -0
  1854. package/dist/replay/normalizers/openclaw.d.ts +3 -23
  1855. package/dist/replay/normalizers/openclaw.d.ts.map +1 -0
  1856. package/dist/replay/normalizers/shared.d.ts +6 -25
  1857. package/dist/replay/normalizers/shared.d.ts.map +1 -0
  1858. package/dist/replay/runner.d.ts +10 -30
  1859. package/dist/replay/runner.d.ts.map +1 -0
  1860. package/dist/replay/types.d.ts +18 -37
  1861. package/dist/replay/types.d.ts.map +1 -0
  1862. package/dist/replica-divergence.d.ts +24 -45
  1863. package/dist/replica-divergence.d.ts.map +1 -0
  1864. package/dist/replica-divergence.js +3 -3
  1865. package/dist/replica-peers-config.d.ts +50 -18
  1866. package/dist/replica-peers-config.d.ts.map +1 -0
  1867. package/dist/rerank.d.ts +8 -9
  1868. package/dist/rerank.d.ts.map +1 -0
  1869. package/dist/resolution-CHNISQJB.js +36 -0
  1870. package/dist/resolution-CHNISQJB.js.map +1 -0
  1871. package/dist/resolve-auth-token.d.ts +9 -27
  1872. package/dist/resolve-auth-token.d.ts.map +1 -0
  1873. package/dist/resolve-provider-secret.d.ts +10 -11
  1874. package/dist/resolve-provider-secret.d.ts.map +1 -0
  1875. package/dist/response-guidance-recall.d.ts +5 -8
  1876. package/dist/response-guidance-recall.d.ts.map +1 -0
  1877. package/dist/resume-bundles.d.ts +9 -10
  1878. package/dist/resume-bundles.d.ts.map +1 -0
  1879. package/dist/resume-bundles.js +24 -24
  1880. package/dist/retrieval-agents.d.ts +14 -36
  1881. package/dist/retrieval-agents.d.ts.map +1 -0
  1882. package/dist/retrieval-tiers.d.ts +4 -24
  1883. package/dist/retrieval-tiers.d.ts.map +1 -0
  1884. package/dist/retrieval.d.ts +5 -6
  1885. package/dist/retrieval.d.ts.map +1 -0
  1886. package/dist/review/frontmatter.d.ts +6 -0
  1887. package/dist/review/frontmatter.d.ts.map +1 -0
  1888. package/dist/review/index.d.ts +81 -0
  1889. package/dist/review/index.d.ts.map +1 -0
  1890. package/dist/review/review-deck-http-base.d.ts +10 -0
  1891. package/dist/review/review-deck-http-base.d.ts.map +1 -0
  1892. package/dist/review/review-deck-mutation.d.ts +51 -0
  1893. package/dist/review/review-deck-mutation.d.ts.map +1 -0
  1894. package/dist/review/review-deck-snapshot.d.ts +10 -0
  1895. package/dist/review/review-deck-snapshot.d.ts.map +1 -0
  1896. package/dist/review/review-deck-surface.d.ts +33 -0
  1897. package/dist/review/review-deck-surface.d.ts.map +1 -0
  1898. package/dist/review/review-deck.d.ts +107 -0
  1899. package/dist/review/review-deck.d.ts.map +1 -0
  1900. package/dist/routing/engine.d.ts +12 -31
  1901. package/dist/routing/engine.d.ts.map +1 -0
  1902. package/dist/routing/store.d.ts +3 -23
  1903. package/dist/routing/store.d.ts.map +1 -0
  1904. package/dist/runtime/better-sqlite.d.ts +9 -10
  1905. package/dist/runtime/better-sqlite.d.ts.map +1 -0
  1906. package/dist/runtime/child-process.d.ts +5 -5
  1907. package/dist/runtime/child-process.d.ts.map +1 -0
  1908. package/dist/runtime/daemon-health.d.ts +2 -0
  1909. package/dist/runtime/daemon-health.d.ts.map +1 -0
  1910. package/dist/runtime/env.d.ts +5 -6
  1911. package/dist/runtime/env.d.ts.map +1 -0
  1912. package/dist/runtime/http-transport.d.ts +3 -4
  1913. package/dist/runtime/http-transport.d.ts.map +1 -0
  1914. package/dist/salvage-envelope.d.ts +3 -23
  1915. package/dist/salvage-envelope.d.ts.map +1 -0
  1916. package/dist/sanitize.d.ts +5 -7
  1917. package/dist/sanitize.d.ts.map +1 -0
  1918. package/dist/schemas.d.ts +205 -207
  1919. package/dist/schemas.d.ts.map +1 -0
  1920. package/dist/scopes/scope-plan.d.ts +258 -0
  1921. package/dist/scopes/scope-plan.d.ts.map +1 -0
  1922. package/dist/sdk-compat.d.ts +4 -5
  1923. package/dist/sdk-compat.d.ts.map +1 -0
  1924. package/dist/search/abort.d.ts +5 -0
  1925. package/dist/search/abort.d.ts.map +1 -0
  1926. package/dist/search/document-scanner.d.ts +3 -4
  1927. package/dist/search/document-scanner.d.ts.map +1 -0
  1928. package/dist/search/embed-helper.d.ts +8 -26
  1929. package/dist/search/embed-helper.d.ts.map +1 -0
  1930. package/dist/search/factory.d.ts +10 -31
  1931. package/dist/search/factory.d.ts.map +1 -0
  1932. package/dist/search/factory.js +4 -4
  1933. package/dist/search/index.d.ts +11 -32
  1934. package/dist/search/index.d.ts.map +1 -0
  1935. package/dist/search/index.js +10 -10
  1936. package/dist/search/lancedb-backend.d.ts +5 -26
  1937. package/dist/search/lancedb-backend.d.ts.map +1 -0
  1938. package/dist/search/meilisearch-backend.d.ts +4 -24
  1939. package/dist/search/meilisearch-backend.d.ts.map +1 -0
  1940. package/dist/search/noop-backend.d.ts +3 -23
  1941. package/dist/search/noop-backend.d.ts.map +1 -0
  1942. package/dist/search/orama-backend.d.ts +6 -27
  1943. package/dist/search/orama-backend.d.ts.map +1 -0
  1944. package/dist/search/orama-cjk-tokenizer.d.ts +53 -0
  1945. package/dist/search/orama-cjk-tokenizer.d.ts.map +1 -0
  1946. package/dist/search/port.d.ts +10 -29
  1947. package/dist/search/port.d.ts.map +1 -0
  1948. package/dist/search/remote-backend.d.ts +4 -24
  1949. package/dist/search/remote-backend.d.ts.map +1 -0
  1950. package/dist/secure-store/cipher.d.ts +127 -0
  1951. package/dist/secure-store/cipher.d.ts.map +1 -0
  1952. package/dist/secure-store/cli-handlers.d.ts +134 -0
  1953. package/dist/secure-store/cli-handlers.d.ts.map +1 -0
  1954. package/dist/secure-store/cli-renderer.d.ts +16 -0
  1955. package/dist/secure-store/cli-renderer.d.ts.map +1 -0
  1956. package/dist/secure-store/header.d.ts +137 -0
  1957. package/dist/secure-store/header.d.ts.map +1 -0
  1958. package/dist/secure-store/index.d.ts +23 -899
  1959. package/dist/secure-store/index.d.ts.map +1 -0
  1960. package/dist/secure-store/kdf.d.ts +101 -0
  1961. package/dist/secure-store/kdf.d.ts.map +1 -0
  1962. package/dist/secure-store/keyring.d.ts +58 -0
  1963. package/dist/secure-store/keyring.d.ts.map +1 -0
  1964. package/dist/secure-store/metadata.d.ts +104 -0
  1965. package/dist/secure-store/metadata.d.ts.map +1 -0
  1966. package/dist/secure-store/passphrase-reader.d.ts +40 -0
  1967. package/dist/secure-store/passphrase-reader.d.ts.map +1 -0
  1968. package/dist/secure-store/secure-fs.d.ts +227 -0
  1969. package/dist/secure-store/secure-fs.d.ts.map +1 -0
  1970. package/dist/security/audit-memory-cli.d.ts +9 -0
  1971. package/dist/security/audit-memory-cli.d.ts.map +1 -0
  1972. package/dist/security/audit-memory.d.ts +48 -0
  1973. package/dist/security/audit-memory.d.ts.map +1 -0
  1974. package/dist/security/injection-screen.d.ts +19 -0
  1975. package/dist/security/injection-screen.d.ts.map +1 -0
  1976. package/dist/security/origin-authority.d.ts +30 -0
  1977. package/dist/security/origin-authority.d.ts.map +1 -0
  1978. package/dist/security/types.d.ts +13 -0
  1979. package/dist/security/types.d.ts.map +1 -0
  1980. package/dist/semantic-chunking.d.ts +13 -16
  1981. package/dist/semantic-chunking.d.ts.map +1 -0
  1982. package/dist/semantic-consolidation.d.ts +126 -22
  1983. package/dist/semantic-consolidation.d.ts.map +1 -0
  1984. package/dist/semantic-consolidation.js +15 -15
  1985. package/dist/semantic-merge-config.d.ts +2 -3
  1986. package/dist/semantic-merge-config.d.ts.map +1 -0
  1987. package/dist/semantic-rule-promotion.d.ts +7 -7
  1988. package/dist/semantic-rule-promotion.d.ts.map +1 -0
  1989. package/dist/semantic-rule-promotion.js +14 -14
  1990. package/dist/semantic-rule-verifier.d.ts +6 -25
  1991. package/dist/semantic-rule-verifier.d.ts.map +1 -0
  1992. package/dist/semantic-rule-verifier.js +14 -14
  1993. package/dist/session-identity.d.ts +10 -11
  1994. package/dist/session-identity.d.ts.map +1 -0
  1995. package/dist/session-integrity.d.ts +14 -15
  1996. package/dist/session-integrity.d.ts.map +1 -0
  1997. package/dist/session-namespace-bindings.d.ts +10 -11
  1998. package/dist/session-namespace-bindings.d.ts.map +1 -0
  1999. package/dist/session-observer-bands.d.ts +4 -23
  2000. package/dist/session-observer-bands.d.ts.map +1 -0
  2001. package/dist/session-observer-state.d.ts +6 -25
  2002. package/dist/session-observer-state.d.ts.map +1 -0
  2003. package/dist/session-summaries/adapters.d.ts +5 -0
  2004. package/dist/session-summaries/adapters.d.ts.map +1 -0
  2005. package/dist/session-summaries/index.d.ts +7 -0
  2006. package/dist/session-summaries/index.d.ts.map +1 -0
  2007. package/dist/session-summaries/redaction.d.ts +8 -0
  2008. package/dist/session-summaries/redaction.d.ts.map +1 -0
  2009. package/dist/session-summaries/types.d.ts +113 -0
  2010. package/dist/session-summaries/types.d.ts.map +1 -0
  2011. package/dist/session-toggles.d.ts +4 -4
  2012. package/dist/session-toggles.d.ts.map +1 -0
  2013. package/dist/session-transcript-migration.d.ts +9 -10
  2014. package/dist/session-transcript-migration.d.ts.map +1 -0
  2015. package/dist/shared-context/authority-precedence.d.ts +22 -0
  2016. package/dist/shared-context/authority-precedence.d.ts.map +1 -0
  2017. package/dist/shared-context/authority.d.ts +18 -0
  2018. package/dist/shared-context/authority.d.ts.map +1 -0
  2019. package/dist/shared-context/claim-key.d.ts +14 -0
  2020. package/dist/shared-context/claim-key.d.ts.map +1 -0
  2021. package/dist/shared-context/contradictions.d.ts +20 -0
  2022. package/dist/shared-context/contradictions.d.ts.map +1 -0
  2023. package/dist/shared-context/curation-lint.d.ts +23 -0
  2024. package/dist/shared-context/curation-lint.d.ts.map +1 -0
  2025. package/dist/shared-context/envelope-actor.d.ts +14 -0
  2026. package/dist/shared-context/envelope-actor.d.ts.map +1 -0
  2027. package/dist/shared-context/envelope-at.d.ts +19 -0
  2028. package/dist/shared-context/envelope-at.d.ts.map +1 -0
  2029. package/dist/shared-context/envelope-id.d.ts +14 -0
  2030. package/dist/shared-context/envelope-id.d.ts.map +1 -0
  2031. package/dist/shared-context/envelope-io.d.ts +100 -0
  2032. package/dist/shared-context/envelope-io.d.ts.map +1 -0
  2033. package/dist/shared-context/envelope-required.d.ts +14 -0
  2034. package/dist/shared-context/envelope-required.d.ts.map +1 -0
  2035. package/dist/shared-context/envelope-ttl.d.ts +12 -0
  2036. package/dist/shared-context/envelope-ttl.d.ts.map +1 -0
  2037. package/dist/shared-context/governance.d.ts +28 -0
  2038. package/dist/shared-context/governance.d.ts.map +1 -0
  2039. package/dist/shared-context/iso-instant.d.ts +19 -0
  2040. package/dist/shared-context/iso-instant.d.ts.map +1 -0
  2041. package/dist/shared-context/manager.d.ts +21 -48
  2042. package/dist/shared-context/manager.d.ts.map +1 -0
  2043. package/dist/shared-context/provenance.d.ts +18 -0
  2044. package/dist/shared-context/provenance.d.ts.map +1 -0
  2045. package/dist/shared-context/staleness.d.ts +18 -0
  2046. package/dist/shared-context/staleness.d.ts.map +1 -0
  2047. package/dist/shared-context/supersession-chain.d.ts +41 -0
  2048. package/dist/shared-context/supersession-chain.d.ts.map +1 -0
  2049. package/dist/shared-context/trajectories.d.ts +24 -0
  2050. package/dist/shared-context/trajectories.d.ts.map +1 -0
  2051. package/dist/shared-context/write-output-controls.d.ts +4 -5
  2052. package/dist/shared-context/write-output-controls.d.ts.map +1 -0
  2053. package/dist/signal.d.ts +4 -23
  2054. package/dist/signal.d.ts.map +1 -0
  2055. package/dist/skills-registry.d.ts +4 -5
  2056. package/dist/skills-registry.d.ts.map +1 -0
  2057. package/dist/source-agent-qualifier.d.ts +8 -27
  2058. package/dist/source-agent-qualifier.d.ts.map +1 -0
  2059. package/dist/source-agent-qualifier.js +23 -23
  2060. package/dist/source-attribution.d.ts +20 -21
  2061. package/dist/source-attribution.d.ts.map +1 -0
  2062. package/dist/spaces/index.d.ts +148 -0
  2063. package/dist/spaces/index.d.ts.map +1 -0
  2064. package/dist/standing-memory-block.d.ts +25 -26
  2065. package/dist/standing-memory-block.d.ts.map +1 -0
  2066. package/dist/standup/access-operations.d.ts +2 -0
  2067. package/dist/standup/access-operations.d.ts.map +1 -0
  2068. package/dist/standup/build.d.ts +6 -7
  2069. package/dist/standup/build.d.ts.map +1 -0
  2070. package/dist/standup/build.js +15 -15
  2071. package/dist/standup/http-glue.d.ts +4 -0
  2072. package/dist/standup/http-glue.d.ts.map +1 -0
  2073. package/dist/standup/mcp-tools.d.ts +3 -0
  2074. package/dist/standup/mcp-tools.d.ts.map +1 -0
  2075. package/dist/storage/cas-revision-host.d.ts +34 -0
  2076. package/dist/storage/cas-revision-host.d.ts.map +1 -0
  2077. package/dist/storage/cas-revision-store.d.ts +176 -0
  2078. package/dist/storage/cas-revision-store.d.ts.map +1 -0
  2079. package/dist/storage/citation-hash-source.d.ts +3 -0
  2080. package/dist/storage/citation-hash-source.d.ts.map +1 -0
  2081. package/dist/storage/committed-invalidation.d.ts +9 -0
  2082. package/dist/storage/committed-invalidation.d.ts.map +1 -0
  2083. package/dist/storage/content-hash-index.d.ts +269 -0
  2084. package/dist/storage/content-hash-index.d.ts.map +1 -0
  2085. package/dist/storage/context-transform-ledger.d.ts +10 -0
  2086. package/dist/storage/context-transform-ledger.d.ts.map +1 -0
  2087. package/dist/storage/deletion-revision-store.d.ts +79 -0
  2088. package/dist/storage/deletion-revision-store.d.ts.map +1 -0
  2089. package/dist/storage/entity-alias-config.d.ts +2 -0
  2090. package/dist/storage/entity-alias-config.d.ts.map +1 -0
  2091. package/dist/storage/entity-canonical-id-lock.d.ts +4 -0
  2092. package/dist/storage/entity-canonical-id-lock.d.ts.map +1 -0
  2093. package/dist/storage/entity-canonical-id-migration-adapter.d.ts +24 -0
  2094. package/dist/storage/entity-canonical-id-migration-adapter.d.ts.map +1 -0
  2095. package/dist/storage/entity-canonical-id-migration-runner.d.ts +16 -0
  2096. package/dist/storage/entity-canonical-id-migration-runner.d.ts.map +1 -0
  2097. package/dist/storage/entity-canonical-id-migration.d.ts +44 -0
  2098. package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -0
  2099. package/dist/storage/entity-canonical-id-references.d.ts +173 -0
  2100. package/dist/storage/entity-canonical-id-references.d.ts.map +1 -0
  2101. package/dist/storage/entity-id-safety.d.ts +2 -0
  2102. package/dist/storage/entity-id-safety.d.ts.map +1 -0
  2103. package/dist/storage/entity-ref-repair.d.ts +45 -0
  2104. package/dist/storage/entity-ref-repair.d.ts.map +1 -0
  2105. package/dist/storage/entity-store.d.ts +131 -0
  2106. package/dist/storage/entity-store.d.ts.map +1 -0
  2107. package/dist/storage/entity-timeline.d.ts +34 -0
  2108. package/dist/storage/entity-timeline.d.ts.map +1 -0
  2109. package/dist/storage/identity-continuity-store.d.ts +40 -0
  2110. package/dist/storage/identity-continuity-store.d.ts.map +1 -0
  2111. package/dist/storage/memory-frontmatter-metadata.d.ts +4 -0
  2112. package/dist/storage/memory-frontmatter-metadata.d.ts.map +1 -0
  2113. package/dist/storage/memory-lifecycle-ledger-access.d.ts +194 -0
  2114. package/dist/storage/memory-lifecycle-ledger-access.d.ts.map +1 -0
  2115. package/dist/storage/memory-migration-serialization.d.ts +5 -0
  2116. package/dist/storage/memory-migration-serialization.d.ts.map +1 -0
  2117. package/dist/storage/memory-read-store.d.ts +193 -0
  2118. package/dist/storage/memory-read-store.d.ts.map +1 -0
  2119. package/dist/storage/profile-header.d.ts +16 -0
  2120. package/dist/storage/profile-header.d.ts.map +1 -0
  2121. package/dist/storage/questions-file.d.ts +11 -0
  2122. package/dist/storage/questions-file.d.ts.map +1 -0
  2123. package/dist/storage/secure-line-reader.d.ts +53 -0
  2124. package/dist/storage/secure-line-reader.d.ts.map +1 -0
  2125. package/dist/storage/supersession-audit.d.ts +7 -0
  2126. package/dist/storage/supersession-audit.d.ts.map +1 -0
  2127. package/dist/storage/supersession-side-effects.d.ts +51 -0
  2128. package/dist/storage/supersession-side-effects.d.ts.map +1 -0
  2129. package/dist/storage/tombstone-blocked-capture-index.d.ts +93 -0
  2130. package/dist/storage/tombstone-blocked-capture-index.d.ts.map +1 -0
  2131. package/dist/storage/tombstone-blocked-capture-mutation.d.ts +53 -0
  2132. package/dist/storage/tombstone-blocked-capture-mutation.d.ts.map +1 -0
  2133. package/dist/storage/tombstone-blocked-capture-sync.d.ts +96 -0
  2134. package/dist/storage/tombstone-blocked-capture-sync.d.ts.map +1 -0
  2135. package/dist/storage/tombstone-migration-sources.d.ts +24 -0
  2136. package/dist/storage/tombstone-migration-sources.d.ts.map +1 -0
  2137. package/dist/storage/windowed-memory-read.d.ts +28 -0
  2138. package/dist/storage/windowed-memory-read.d.ts.map +1 -0
  2139. package/dist/storage-contract/harness.d.ts +59 -0
  2140. package/dist/storage-contract/harness.d.ts.map +1 -0
  2141. package/dist/storage-guards.d.ts +6 -7
  2142. package/dist/storage-guards.d.ts.map +1 -0
  2143. package/dist/storage-paths.d.ts +8 -9
  2144. package/dist/storage-paths.d.ts.map +1 -0
  2145. package/dist/storage.d.ts +1362 -33
  2146. package/dist/storage.d.ts.map +1 -0
  2147. package/dist/storage.js +15 -15
  2148. package/dist/store-contract.d.ts +9 -10
  2149. package/dist/store-contract.d.ts.map +1 -0
  2150. package/dist/structured-attributes.d.ts +6 -7
  2151. package/dist/structured-attributes.d.ts.map +1 -0
  2152. package/dist/subject-config.d.ts +4 -24
  2153. package/dist/subject-config.d.ts.map +1 -0
  2154. package/dist/summarizer.d.ts +7 -27
  2155. package/dist/summarizer.d.ts.map +1 -0
  2156. package/dist/summarizer.js +3 -3
  2157. package/dist/summary-snapshot.d.ts +6 -25
  2158. package/dist/summary-snapshot.d.ts.map +1 -0
  2159. package/dist/support-passport/access-http-base.d.ts +20 -0
  2160. package/dist/support-passport/access-http-base.d.ts.map +1 -0
  2161. package/dist/support-passport/access-http.d.ts +64 -0
  2162. package/dist/support-passport/access-http.d.ts.map +1 -0
  2163. package/dist/support-passport/access-operations.d.ts +197 -0
  2164. package/dist/support-passport/access-operations.d.ts.map +1 -0
  2165. package/dist/support-passport/access-service-base.d.ts +86 -0
  2166. package/dist/support-passport/access-service-base.d.ts.map +1 -0
  2167. package/dist/support-passport/access-surface.d.ts +118 -0
  2168. package/dist/support-passport/access-surface.d.ts.map +1 -0
  2169. package/dist/support-passport/card-projection.d.ts +83 -0
  2170. package/dist/support-passport/card-projection.d.ts.map +1 -0
  2171. package/dist/support-passport/card-replacement.d.ts +21 -0
  2172. package/dist/support-passport/card-replacement.d.ts.map +1 -0
  2173. package/dist/support-passport/card-service.d.ts +65 -0
  2174. package/dist/support-passport/card-service.d.ts.map +1 -0
  2175. package/dist/support-passport/card-state.d.ts +28 -0
  2176. package/dist/support-passport/card-state.d.ts.map +1 -0
  2177. package/dist/support-passport/config.d.ts +4 -0
  2178. package/dist/support-passport/config.d.ts.map +1 -0
  2179. package/dist/support-passport/contracts.d.ts +165 -0
  2180. package/dist/support-passport/contracts.d.ts.map +1 -0
  2181. package/dist/support-passport/errors.d.ts +7 -0
  2182. package/dist/support-passport/errors.d.ts.map +1 -0
  2183. package/dist/support-passport/generated-batch.d.ts +47 -0
  2184. package/dist/support-passport/generated-batch.d.ts.map +1 -0
  2185. package/dist/support-passport/grant-contracts.d.ts +443 -0
  2186. package/dist/support-passport/grant-contracts.d.ts.map +1 -0
  2187. package/dist/support-passport/grant-service.d.ts +48 -0
  2188. package/dist/support-passport/grant-service.d.ts.map +1 -0
  2189. package/dist/support-passport/grant-store.d.ts +84 -0
  2190. package/dist/support-passport/grant-store.d.ts.map +1 -0
  2191. package/dist/support-passport/index.d.ts +17 -571
  2192. package/dist/support-passport/index.d.ts.map +1 -0
  2193. package/dist/support-passport/index.js +75 -70
  2194. package/dist/support-passport/mcp-tools.d.ts +16 -0
  2195. package/dist/support-passport/mcp-tools.d.ts.map +1 -0
  2196. package/dist/support-passport/model-adapter.d.ts +90 -0
  2197. package/dist/support-passport/model-adapter.d.ts.map +1 -0
  2198. package/dist/support-passport/model-audit.d.ts +115 -0
  2199. package/dist/support-passport/model-audit.d.ts.map +1 -0
  2200. package/dist/support-passport/model-bridge.d.ts +105 -0
  2201. package/dist/support-passport/model-bridge.d.ts.map +1 -0
  2202. package/dist/support-passport/model-contracts.d.ts +219 -0
  2203. package/dist/support-passport/model-contracts.d.ts.map +1 -0
  2204. package/dist/support-passport/model-service.d.ts +58 -0
  2205. package/dist/support-passport/model-service.d.ts.map +1 -0
  2206. package/dist/support-passport/offline-sync-guard.d.ts +46 -0
  2207. package/dist/support-passport/offline-sync-guard.d.ts.map +1 -0
  2208. package/dist/support-passport/owner-lock.d.ts +16 -0
  2209. package/dist/support-passport/owner-lock.d.ts.map +1 -0
  2210. package/dist/support-passport/private-file.d.ts +16 -0
  2211. package/dist/support-passport/private-file.d.ts.map +1 -0
  2212. package/dist/support-passport/public-http.d.ts +23 -0
  2213. package/dist/support-passport/public-http.d.ts.map +1 -0
  2214. package/dist/surfaces/dreams.d.ts +4 -5
  2215. package/dist/surfaces/dreams.d.ts.map +1 -0
  2216. package/dist/surfaces/heartbeat.d.ts +4 -5
  2217. package/dist/surfaces/heartbeat.d.ts.map +1 -0
  2218. package/dist/sync/index.d.ts +69 -0
  2219. package/dist/sync/index.d.ts.map +1 -0
  2220. package/dist/targeted-fact-recall.d.ts +5 -8
  2221. package/dist/targeted-fact-recall.d.ts.map +1 -0
  2222. package/dist/task-llm-config.d.ts +4 -5
  2223. package/dist/task-llm-config.d.ts.map +1 -0
  2224. package/dist/taxonomy/default-taxonomy.d.ts +7 -0
  2225. package/dist/taxonomy/default-taxonomy.d.ts.map +1 -0
  2226. package/dist/taxonomy/index.d.ts +11 -0
  2227. package/dist/taxonomy/index.d.ts.map +1 -0
  2228. package/dist/taxonomy/resolver-doc-generator.d.ts +17 -0
  2229. package/dist/taxonomy/resolver-doc-generator.d.ts.map +1 -0
  2230. package/dist/taxonomy/resolver.d.ts +25 -0
  2231. package/dist/taxonomy/resolver.d.ts.map +1 -0
  2232. package/dist/taxonomy/taxonomy-loader.d.ts +38 -0
  2233. package/dist/taxonomy/taxonomy-loader.d.ts.map +1 -0
  2234. package/dist/taxonomy/types.d.ts +49 -0
  2235. package/dist/taxonomy/types.d.ts.map +1 -0
  2236. package/dist/telemetry-transcript.d.ts +6 -7
  2237. package/dist/telemetry-transcript.d.ts.map +1 -0
  2238. package/dist/temporal-index-batch.d.ts +30 -1
  2239. package/dist/temporal-index-batch.d.ts.map +1 -0
  2240. package/dist/temporal-index-compat.d.ts +7 -267
  2241. package/dist/temporal-index-compat.d.ts.map +1 -0
  2242. package/dist/temporal-index.d.ts +230 -1
  2243. package/dist/temporal-index.d.ts.map +1 -0
  2244. package/dist/temporal-supersession.d.ts +14 -34
  2245. package/dist/temporal-supersession.d.ts.map +1 -0
  2246. package/dist/temporal-timeline-recall.d.ts +5 -24
  2247. package/dist/temporal-timeline-recall.d.ts.map +1 -0
  2248. package/dist/temporal-validity.d.ts +7 -27
  2249. package/dist/temporal-validity.d.ts.map +1 -0
  2250. package/dist/testing/lifecycle-matrix.d.ts +11 -12
  2251. package/dist/testing/lifecycle-matrix.d.ts.map +1 -0
  2252. package/dist/testing/orchestrator-lite.d.ts +80 -0
  2253. package/dist/testing/orchestrator-lite.d.ts.map +1 -0
  2254. package/dist/testing/subjects/meetings-namespace-harness.d.ts +32 -0
  2255. package/dist/testing/subjects/meetings-namespace-harness.d.ts.map +1 -0
  2256. package/dist/testing/tmp-dir.d.ts +9 -0
  2257. package/dist/testing/tmp-dir.d.ts.map +1 -0
  2258. package/dist/thread-key.d.ts +2 -3
  2259. package/dist/thread-key.d.ts.map +1 -0
  2260. package/dist/threading.d.ts +3 -23
  2261. package/dist/threading.d.ts.map +1 -0
  2262. package/dist/tier-migration.d.ts +10 -43
  2263. package/dist/tier-migration.d.ts.map +1 -0
  2264. package/dist/tier-routing.d.ts +8 -27
  2265. package/dist/tier-routing.d.ts.map +1 -0
  2266. package/dist/tmt.d.ts +18 -19
  2267. package/dist/tmt.d.ts.map +1 -0
  2268. package/dist/token-estimate.d.ts +2 -3
  2269. package/dist/token-estimate.d.ts.map +1 -0
  2270. package/dist/tokens.d.ts +15 -19
  2271. package/dist/tokens.d.ts.map +1 -0
  2272. package/dist/tokens.js +3 -3
  2273. package/dist/tool-scoped-memory.d.ts +7 -8
  2274. package/dist/tool-scoped-memory.d.ts.map +1 -0
  2275. package/dist/topics.d.ts +4 -24
  2276. package/dist/topics.d.ts.map +1 -0
  2277. package/dist/training-export/converter.d.ts +18 -0
  2278. package/dist/training-export/converter.d.ts.map +1 -0
  2279. package/dist/training-export/date-parse.d.ts +38 -0
  2280. package/dist/training-export/date-parse.d.ts.map +1 -0
  2281. package/dist/training-export/index.d.ts +10 -0
  2282. package/dist/training-export/index.d.ts.map +1 -0
  2283. package/dist/training-export/registry.d.ts +27 -0
  2284. package/dist/training-export/registry.d.ts.map +1 -0
  2285. package/dist/training-export/types.d.ts +29 -0
  2286. package/dist/training-export/types.d.ts.map +1 -0
  2287. package/dist/transcript.d.ts +5 -24
  2288. package/dist/transcript.d.ts.map +1 -0
  2289. package/dist/transfer/autodetect.d.ts +3 -4
  2290. package/dist/transfer/autodetect.d.ts.map +1 -0
  2291. package/dist/transfer/backup.d.ts +3 -4
  2292. package/dist/transfer/backup.d.ts.map +1 -0
  2293. package/dist/transfer/backup.js +2 -2
  2294. package/dist/transfer/capsule-crypto.d.ts +168 -0
  2295. package/dist/transfer/capsule-crypto.d.ts.map +1 -0
  2296. package/dist/transfer/capsule-export.d.ts +6 -9
  2297. package/dist/transfer/capsule-export.d.ts.map +1 -0
  2298. package/dist/transfer/capsule-export.js +2 -2
  2299. package/dist/transfer/capsule-fork.d.ts +117 -0
  2300. package/dist/transfer/capsule-fork.d.ts.map +1 -0
  2301. package/dist/transfer/capsule-import.d.ts +10 -13
  2302. package/dist/transfer/capsule-import.d.ts.map +1 -0
  2303. package/dist/transfer/capsule-import.js +2 -2
  2304. package/dist/transfer/capsule-merge.d.ts +124 -0
  2305. package/dist/transfer/capsule-merge.d.ts.map +1 -0
  2306. package/dist/transfer/conflict-policy.d.ts +5 -0
  2307. package/dist/transfer/conflict-policy.d.ts.map +1 -0
  2308. package/dist/transfer/constants.d.ts +4 -5
  2309. package/dist/transfer/constants.d.ts.map +1 -0
  2310. package/dist/transfer/exclusions.d.ts +8 -0
  2311. package/dist/transfer/exclusions.d.ts.map +1 -0
  2312. package/dist/transfer/export-json.d.ts +3 -4
  2313. package/dist/transfer/export-json.d.ts.map +1 -0
  2314. package/dist/transfer/export-md.d.ts +4 -5
  2315. package/dist/transfer/export-md.d.ts.map +1 -0
  2316. package/dist/transfer/export-okf.d.ts +11 -31
  2317. package/dist/transfer/export-okf.d.ts.map +1 -0
  2318. package/dist/transfer/export-okf.js +14 -14
  2319. package/dist/transfer/export-sqlite.d.ts +3 -4
  2320. package/dist/transfer/export-sqlite.d.ts.map +1 -0
  2321. package/dist/transfer/fs-utils.d.ts +20 -21
  2322. package/dist/transfer/fs-utils.d.ts.map +1 -0
  2323. package/dist/transfer/import-json.d.ts +6 -7
  2324. package/dist/transfer/import-json.d.ts.map +1 -0
  2325. package/dist/transfer/import-md.d.ts +5 -6
  2326. package/dist/transfer/import-md.d.ts.map +1 -0
  2327. package/dist/transfer/import-sqlite.d.ts +5 -6
  2328. package/dist/transfer/import-sqlite.d.ts.map +1 -0
  2329. package/dist/transfer/integrity.d.ts +8 -0
  2330. package/dist/transfer/integrity.d.ts.map +1 -0
  2331. package/dist/transfer/sqlite-schema.d.ts +3 -4
  2332. package/dist/transfer/sqlite-schema.d.ts.map +1 -0
  2333. package/dist/transfer/types.d.ts +114 -116
  2334. package/dist/transfer/types.d.ts.map +1 -0
  2335. package/dist/trust-score-stage.d.ts +21 -40
  2336. package/dist/trust-score-stage.d.ts.map +1 -0
  2337. package/dist/trust-score.d.ts +15 -34
  2338. package/dist/trust-score.d.ts.map +1 -0
  2339. package/dist/trust-zones.d.ts +29 -30
  2340. package/dist/trust-zones.d.ts.map +1 -0
  2341. package/dist/types-continuity.d.ts +10 -11
  2342. package/dist/types-continuity.d.ts.map +1 -0
  2343. package/dist/types.d.ts +3500 -18
  2344. package/dist/types.d.ts.map +1 -0
  2345. package/dist/types.js +1 -1
  2346. package/dist/user-message-cleaning.d.ts +3 -4
  2347. package/dist/user-message-cleaning.d.ts.map +1 -0
  2348. package/dist/user-model.d.ts +17 -18
  2349. package/dist/user-model.d.ts.map +1 -0
  2350. package/dist/utility-learner.d.ts +10 -12
  2351. package/dist/utility-learner.d.ts.map +1 -0
  2352. package/dist/utility-runtime.d.ts +6 -27
  2353. package/dist/utility-runtime.d.ts.map +1 -0
  2354. package/dist/utility-telemetry.d.ts +12 -13
  2355. package/dist/utility-telemetry.d.ts.map +1 -0
  2356. package/dist/utils/category-dir.d.ts +45 -0
  2357. package/dist/utils/category-dir.d.ts.map +1 -0
  2358. package/dist/utils/errno.d.ts +4 -0
  2359. package/dist/utils/errno.d.ts.map +1 -0
  2360. package/dist/utils/iso-timestamp.d.ts +18 -0
  2361. package/dist/utils/iso-timestamp.d.ts.map +1 -0
  2362. package/dist/utils/path-containment.d.ts +50 -0
  2363. package/dist/utils/path-containment.d.ts.map +1 -0
  2364. package/dist/utils/path.d.ts +2 -3
  2365. package/dist/utils/path.d.ts.map +1 -0
  2366. package/dist/utils/script-aware-text.d.ts +27 -0
  2367. package/dist/utils/script-aware-text.d.ts.map +1 -0
  2368. package/dist/utils/serialize-mutations.d.ts +6 -7
  2369. package/dist/utils/serialize-mutations.d.ts.map +1 -0
  2370. package/dist/utils/yaml-scalar.d.ts +9 -0
  2371. package/dist/utils/yaml-scalar.d.ts.map +1 -0
  2372. package/dist/verified-recall.d.ts +5 -7
  2373. package/dist/verified-recall.d.ts.map +1 -0
  2374. package/dist/verified-recall.js +14 -14
  2375. package/dist/version-utils.d.ts +3 -4
  2376. package/dist/version-utils.d.ts.map +1 -0
  2377. package/dist/wearables/auto-sync.d.ts +63 -0
  2378. package/dist/wearables/auto-sync.d.ts.map +1 -0
  2379. package/dist/wearables/cleanup.d.ts +39 -0
  2380. package/dist/wearables/cleanup.d.ts.map +1 -0
  2381. package/dist/wearables/cli.d.ts +24 -0
  2382. package/dist/wearables/cli.d.ts.map +1 -0
  2383. package/dist/wearables/config.d.ts +22 -0
  2384. package/dist/wearables/config.d.ts.map +1 -0
  2385. package/dist/wearables/corrections.d.ts +46 -0
  2386. package/dist/wearables/corrections.d.ts.map +1 -0
  2387. package/dist/wearables/day-store.d.ts +152 -0
  2388. package/dist/wearables/day-store.d.ts.map +1 -0
  2389. package/dist/wearables/errors.d.ts +19 -0
  2390. package/dist/wearables/errors.d.ts.map +1 -0
  2391. package/dist/wearables/fusion/cluster.d.ts +70 -0
  2392. package/dist/wearables/fusion/cluster.d.ts.map +1 -0
  2393. package/dist/wearables/fusion/fuse.d.ts +40 -0
  2394. package/dist/wearables/fusion/fuse.d.ts.map +1 -0
  2395. package/dist/wearables/fusion/index.d.ts +16 -0
  2396. package/dist/wearables/fusion/index.d.ts.map +1 -0
  2397. package/dist/wearables/fusion/reconcile.d.ts +52 -0
  2398. package/dist/wearables/fusion/reconcile.d.ts.map +1 -0
  2399. package/dist/wearables/fusion/reconstruct.d.ts +37 -0
  2400. package/dist/wearables/fusion/reconstruct.d.ts.map +1 -0
  2401. package/dist/wearables/fusion/store.d.ts +131 -0
  2402. package/dist/wearables/fusion/store.d.ts.map +1 -0
  2403. package/dist/wearables/fusion/types.d.ts +219 -0
  2404. package/dist/wearables/fusion/types.d.ts.map +1 -0
  2405. package/dist/wearables/http-glue.d.ts +12 -0
  2406. package/dist/wearables/http-glue.d.ts.map +1 -0
  2407. package/dist/wearables/index.d.ts +23 -0
  2408. package/dist/wearables/index.d.ts.map +1 -0
  2409. package/dist/wearables/mcp-tools.d.ts +12 -0
  2410. package/dist/wearables/mcp-tools.d.ts.map +1 -0
  2411. package/dist/wearables/memory-gen.d.ts +139 -0
  2412. package/dist/wearables/memory-gen.d.ts.map +1 -0
  2413. package/dist/wearables/pipeline.d.ts +81 -0
  2414. package/dist/wearables/pipeline.d.ts.map +1 -0
  2415. package/dist/wearables/redaction.d.ts +75 -0
  2416. package/dist/wearables/redaction.d.ts.map +1 -0
  2417. package/dist/wearables/registry.d.ts +47 -0
  2418. package/dist/wearables/registry.d.ts.map +1 -0
  2419. package/dist/wearables/service.d.ts +225 -0
  2420. package/dist/wearables/service.d.ts.map +1 -0
  2421. package/dist/wearables/speakers.d.ts +83 -0
  2422. package/dist/wearables/speakers.d.ts.map +1 -0
  2423. package/dist/wearables/sync-state.d.ts +52 -0
  2424. package/dist/wearables/sync-state.d.ts.map +1 -0
  2425. package/dist/wearables/text-language.d.ts +41 -0
  2426. package/dist/wearables/text-language.d.ts.map +1 -0
  2427. package/dist/wearables/trust.d.ts +93 -0
  2428. package/dist/wearables/trust.d.ts.map +1 -0
  2429. package/dist/wearables/types.d.ts +389 -0
  2430. package/dist/wearables/types.d.ts.map +1 -0
  2431. package/dist/whitespace.d.ts +7 -8
  2432. package/dist/whitespace.d.ts.map +1 -0
  2433. package/dist/who-knows-cli.d.ts +8 -155
  2434. package/dist/who-knows-cli.d.ts.map +1 -0
  2435. package/dist/who-knows-cli.js +16 -16
  2436. package/dist/who-knows.d.ts +97 -145
  2437. package/dist/who-knows.d.ts.map +1 -0
  2438. package/dist/who-knows.js +15 -15
  2439. package/dist/work/board.d.ts +8 -10
  2440. package/dist/work/board.d.ts.map +1 -0
  2441. package/dist/work/boundary.d.ts +5 -6
  2442. package/dist/work/boundary.d.ts.map +1 -0
  2443. package/dist/work/storage.d.ts +4 -6
  2444. package/dist/work/storage.d.ts.map +1 -0
  2445. package/dist/work/types.d.ts +11 -12
  2446. package/dist/work/types.d.ts.map +1 -0
  2447. package/dist/work-product-ledger.d.ts +12 -13
  2448. package/dist/work-product-ledger.d.ts.map +1 -0
  2449. package/dist/write-envelope.d.ts +23 -42
  2450. package/dist/write-envelope.d.ts.map +1 -0
  2451. package/dist/write-quarantine.d.ts +8 -9
  2452. package/dist/write-quarantine.d.ts.map +1 -0
  2453. package/dist/write-rate-limiter.d.ts +4 -4
  2454. package/dist/write-rate-limiter.d.ts.map +1 -0
  2455. package/package.json +2 -2
  2456. package/scripts/build-with-heap.mjs +40 -19
  2457. package/src/access-boundary.ts +1 -0
  2458. package/src/access-errors.test.ts +182 -0
  2459. package/src/access-errors.ts +252 -1
  2460. package/src/access-http.ts +36 -103
  2461. package/src/access-mcp-output-schemas.ts +1 -0
  2462. package/src/access-mcp.ts +21 -2
  2463. package/src/access-operations-batch.ts +8 -0
  2464. package/src/access-recall-diagnostics.ts +236 -0
  2465. package/src/access-service.ts +6 -0
  2466. package/src/access-surface-catalog.ts +2 -0
  2467. package/src/index.ts +11 -0
  2468. package/src/mcp-read-only-tools.ts +1 -0
  2469. package/src/orchestration/orchestrator-helpers.ts +7 -0
  2470. package/src/orchestration/recall-internal.ts +1 -1
  2471. package/src/recall-degradation-sink.test.ts +144 -0
  2472. package/src/recall-why-cli.ts +59 -0
  2473. package/src/recall-why-renderer.ts +142 -0
  2474. package/src/recall-why-service.test.ts +306 -0
  2475. package/src/recall-why-service.ts +218 -0
  2476. package/src/recall-why.test.ts +511 -0
  2477. package/src/recall-why.ts +568 -0
  2478. package/src/types.ts +1 -0
  2479. package/dist/access-namespace-preflight-U9RAdxqZ.d.ts +0 -146
  2480. package/dist/access-service-CUNM5RfA.d.ts +0 -4700
  2481. package/dist/capsule-crypto-YO5QJ6L3.js +0 -18
  2482. package/dist/catalog-BuMyYPUn.d.ts +0 -473
  2483. package/dist/chunk-27MKMTBY.js +0 -342
  2484. package/dist/chunk-2HJKAVAS.js +0 -216
  2485. package/dist/chunk-2QZJ4P27.js +0 -203
  2486. package/dist/chunk-2SIKTXWX.js +0 -502
  2487. package/dist/chunk-2Z24E5W2.js +0 -22
  2488. package/dist/chunk-2Z24E5W2.js.map +0 -1
  2489. package/dist/chunk-3R23DDD3.js +0 -9782
  2490. package/dist/chunk-3S6URXEH.js +0 -63
  2491. package/dist/chunk-43IQRLEF.js +0 -256
  2492. package/dist/chunk-4UVJ6EIT.js +0 -22
  2493. package/dist/chunk-4UVJ6EIT.js.map +0 -1
  2494. package/dist/chunk-5FAGCOZD.js +0 -761
  2495. package/dist/chunk-75YZ5VAI.js +0 -140
  2496. package/dist/chunk-7IRZK6MM.js +0 -256
  2497. package/dist/chunk-7QVYVSEH.js +0 -285
  2498. package/dist/chunk-7RGX7BMF.js +0 -103
  2499. package/dist/chunk-7RKAE6Y4.js +0 -727
  2500. package/dist/chunk-AH44WTLJ.js +0 -415
  2501. package/dist/chunk-AHVJ6GLL.js +0 -95
  2502. package/dist/chunk-AIVRD66I.js +0 -511
  2503. package/dist/chunk-AQ55YKEV.js +0 -29
  2504. package/dist/chunk-AQWGCHIV.js +0 -263
  2505. package/dist/chunk-ARRKSBQU.js +0 -72
  2506. package/dist/chunk-AYHNTYVG.js +0 -43
  2507. package/dist/chunk-BSCNBIF4.js +0 -24
  2508. package/dist/chunk-BXLOS5AJ.js +0 -112
  2509. package/dist/chunk-BXOPUJ3W.js +0 -801
  2510. package/dist/chunk-CEO4DONG.js +0 -28
  2511. package/dist/chunk-CVILPI77.js +0 -432
  2512. package/dist/chunk-D2N3PMAE.js +0 -51
  2513. package/dist/chunk-D7VT2LED.js +0 -253
  2514. package/dist/chunk-DAOMWGO2.js +0 -65
  2515. package/dist/chunk-DGS34QSY.js +0 -141
  2516. package/dist/chunk-DI52XAKG.js +0 -223
  2517. package/dist/chunk-DQEMWVMT.js +0 -249
  2518. package/dist/chunk-DZP2XMZC.js +0 -1084
  2519. package/dist/chunk-EVQ33D3N.js +0 -731
  2520. package/dist/chunk-FPB5LQWW.js +0 -71
  2521. package/dist/chunk-FPB5LQWW.js.map +0 -1
  2522. package/dist/chunk-FROKVQQY.js +0 -3997
  2523. package/dist/chunk-FROKVQQY.js.map +0 -1
  2524. package/dist/chunk-G7S37WD4.js +0 -801
  2525. package/dist/chunk-GRDRVYXJ.js +0 -1917
  2526. package/dist/chunk-H6WOFMOV.js +0 -346
  2527. package/dist/chunk-HMDYSGY6.js +0 -54
  2528. package/dist/chunk-HNHIHXSD.js +0 -879
  2529. package/dist/chunk-HWLIMQE2.js +0 -165
  2530. package/dist/chunk-IWO6QXWJ.js +0 -224
  2531. package/dist/chunk-IYNCJKBM.js +0 -3602
  2532. package/dist/chunk-IYNCJKBM.js.map +0 -1
  2533. package/dist/chunk-J54B5DGD.js +0 -1530
  2534. package/dist/chunk-JMZQS6OS.js +0 -81
  2535. package/dist/chunk-K4KE5MYE.js +0 -648
  2536. package/dist/chunk-K4KE5MYE.js.map +0 -1
  2537. package/dist/chunk-KH2D26LQ.js +0 -2440
  2538. package/dist/chunk-KIGC55FQ.js +0 -5505
  2539. package/dist/chunk-KQVBR7BC.js +0 -1286
  2540. package/dist/chunk-L63GFNKL.js +0 -403
  2541. package/dist/chunk-LIAKZGOY.js +0 -25
  2542. package/dist/chunk-LVFI5LG7.js +0 -576
  2543. package/dist/chunk-MTWD4KMM.js +0 -223
  2544. package/dist/chunk-MWVYHNSU.js +0 -623
  2545. package/dist/chunk-MZWSOLMT.js +0 -189
  2546. package/dist/chunk-NNEWBRUL.js +0 -271
  2547. package/dist/chunk-NPX6WMFJ.js +0 -1686
  2548. package/dist/chunk-O7OVWKT4.js +0 -768
  2549. package/dist/chunk-PLJ2MQFT.js +0 -182
  2550. package/dist/chunk-Q4AUIFUA.js +0 -111
  2551. package/dist/chunk-QWQB7TOB.js +0 -11341
  2552. package/dist/chunk-QZ4U67KO.js +0 -98
  2553. package/dist/chunk-RMMVQQA6.js +0 -70
  2554. package/dist/chunk-RSMNPYBM.js +0 -61
  2555. package/dist/chunk-RUUJXAGT.js +0 -122
  2556. package/dist/chunk-S45INSV3.js +0 -389
  2557. package/dist/chunk-SCXURCVT.js +0 -218
  2558. package/dist/chunk-SGUDMW2K.js +0 -3400
  2559. package/dist/chunk-SLGD36MM.js +0 -53
  2560. package/dist/chunk-SMBWBEE7.js +0 -73
  2561. package/dist/chunk-SPFNGHHP.js +0 -115
  2562. package/dist/chunk-SPWNCGSM.js +0 -77
  2563. package/dist/chunk-SZ7IVZGD.js +0 -112
  2564. package/dist/chunk-TJNDFNCU.js +0 -597
  2565. package/dist/chunk-TJNDFNCU.js.map +0 -1
  2566. package/dist/chunk-TQT4AOPO.js +0 -321
  2567. package/dist/chunk-TTFJQ5B5.js +0 -43
  2568. package/dist/chunk-U2SK45U3.js +0 -1476
  2569. package/dist/chunk-UCH2RWFX.js +0 -216
  2570. package/dist/chunk-UDJMJNBK.js +0 -549
  2571. package/dist/chunk-UJBIWY5M.js +0 -212
  2572. package/dist/chunk-ULQVG6G3.js +0 -275
  2573. package/dist/chunk-VDX2J7OX.js +0 -264
  2574. package/dist/chunk-VGO57TU7.js +0 -960
  2575. package/dist/chunk-VUV472VH.js +0 -1008
  2576. package/dist/chunk-VVX5PZFS.js +0 -297
  2577. package/dist/chunk-WH7RINGG.js +0 -315
  2578. package/dist/chunk-WUJD4CHZ.js +0 -137
  2579. package/dist/chunk-X7WAM3IY.js +0 -30
  2580. package/dist/chunk-XPFJSUOR.js +0 -921
  2581. package/dist/chunk-XVZA6VXC.js +0 -160
  2582. package/dist/chunk-XZRZJHBW.js +0 -31013
  2583. package/dist/chunk-XZRZJHBW.js.map +0 -1
  2584. package/dist/chunk-Y4G6LHJW.js +0 -35
  2585. package/dist/chunk-Y7LZ5V7N.js +0 -202
  2586. package/dist/chunk-YEIKOBOW.js +0 -628
  2587. package/dist/chunk-YEIKOBOW.js.map +0 -1
  2588. package/dist/chunk-YIIW2OH2.js +0 -566
  2589. package/dist/chunk-ZBYVR5W4.js +0 -18504
  2590. package/dist/chunk-ZBYVR5W4.js.map +0 -1
  2591. package/dist/chunk-ZN7SMKAK.js +0 -210
  2592. package/dist/chunk-ZP73EM2X.js +0 -74
  2593. package/dist/chunk-ZXQPAYCS.js +0 -2453
  2594. package/dist/cli-CCc34xV7.d.ts +0 -1136
  2595. package/dist/conflict-policy-DyJ2wd-h.d.ts +0 -4
  2596. package/dist/connectors-cli-2iaQ5tX2.d.ts +0 -263
  2597. package/dist/dependency-propagation-delivery-BrhPjAHQ.d.ts +0 -41
  2598. package/dist/faiss-adapter-BHecI1fF.d.ts +0 -73
  2599. package/dist/framework-CNDn2164.d.ts +0 -170
  2600. package/dist/generic-recall-paths-C0J1Oxb7.d.ts +0 -23
  2601. package/dist/graph-DRkl22KE.d.ts +0 -347
  2602. package/dist/graph-edge-decay-MKIRZ762.js +0 -30
  2603. package/dist/index-B735x-tK.d.ts +0 -284
  2604. package/dist/local-llm-BkkEK9rn.d.ts +0 -247
  2605. package/dist/maintenance-CLBIvVxg.d.ts +0 -749
  2606. package/dist/orchestrator-iexgVLow.d.ts +0 -2701
  2607. package/dist/pipeline-DvtDtyo9.d.ts +0 -32
  2608. package/dist/public-http-UWVcqMcb.d.ts +0 -25
  2609. package/dist/qmd-CBYBJ6HW.d.ts +0 -353
  2610. package/dist/resolution-LXFQQ4AE.js +0 -36
  2611. package/dist/scope-profiles-BN1Dgfha.d.ts +0 -30
  2612. package/dist/semantic-BalR6EXU.d.ts +0 -87
  2613. package/dist/semantic-consolidation-D--qe0eE.d.ts +0 -180
  2614. package/dist/service-VealHeqO.d.ts +0 -846
  2615. package/dist/storage-BhS9gUx3.d.ts +0 -166
  2616. package/dist/storage-CMm-3aD3.d.ts +0 -2421
  2617. package/dist/tagging-BjsNFKWz.d.ts +0 -240
  2618. package/dist/types-B1VHaf2w.d.ts +0 -126
  2619. package/dist/types-DJhqDJUV.d.ts +0 -50
  2620. package/dist/types-Du6VdoAg.d.ts +0 -5482
  2621. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → access-recall-diagnostics.js.map} +0 -0
  2622. /package/dist/{graph-edge-decay-MKIRZ762.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  2623. /package/dist/{chunk-KQVBR7BC.js.map → chunk-2CBWEIS4.js.map} +0 -0
  2624. /package/dist/{chunk-JMZQS6OS.js.map → chunk-2JQZSQXI.js.map} +0 -0
  2625. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
  2626. /package/dist/{chunk-LIAKZGOY.js.map → chunk-2WMXZYMS.js.map} +0 -0
  2627. /package/dist/{chunk-RSMNPYBM.js.map → chunk-34ZGBAGE.js.map} +0 -0
  2628. /package/dist/{chunk-MWVYHNSU.js.map → chunk-36S7UHAW.js.map} +0 -0
  2629. /package/dist/{chunk-G7S37WD4.js.map → chunk-3JLWSFTV.js.map} +0 -0
  2630. /package/dist/{chunk-75YZ5VAI.js.map → chunk-3RZOLUZT.js.map} +0 -0
  2631. /package/dist/{chunk-XVZA6VXC.js.map → chunk-3SL52JKD.js.map} +0 -0
  2632. /package/dist/{chunk-2SIKTXWX.js.map → chunk-4QEZS7PK.js.map} +0 -0
  2633. /package/dist/{chunk-Y4G6LHJW.js.map → chunk-5QRYGLZN.js.map} +0 -0
  2634. /package/dist/{chunk-AQWGCHIV.js.map → chunk-5R3C5LEZ.js.map} +0 -0
  2635. /package/dist/{chunk-SPWNCGSM.js.map → chunk-634UKELB.js.map} +0 -0
  2636. /package/dist/{chunk-BXOPUJ3W.js.map → chunk-64JK4TL7.js.map} +0 -0
  2637. /package/dist/{chunk-DGS34QSY.js.map → chunk-6E5GYDIE.js.map} +0 -0
  2638. /package/dist/{chunk-D2N3PMAE.js.map → chunk-6ISP2EN2.js.map} +0 -0
  2639. /package/dist/{chunk-UJBIWY5M.js.map → chunk-6RD7MSIO.js.map} +0 -0
  2640. /package/dist/{chunk-RMMVQQA6.js.map → chunk-6UDLN4IA.js.map} +0 -0
  2641. /package/dist/{chunk-7IRZK6MM.js.map → chunk-754XN6LX.js.map} +0 -0
  2642. /package/dist/{chunk-43IQRLEF.js.map → chunk-7H2LEYYJ.js.map} +0 -0
  2643. /package/dist/{chunk-7RGX7BMF.js.map → chunk-A7AISUJI.js.map} +0 -0
  2644. /package/dist/{chunk-7RKAE6Y4.js.map → chunk-AULKCNZW.js.map} +0 -0
  2645. /package/dist/{chunk-NPX6WMFJ.js.map → chunk-B7SSU55V.js.map} +0 -0
  2646. /package/dist/{chunk-IWO6QXWJ.js.map → chunk-BICNRVEC.js.map} +0 -0
  2647. /package/dist/{chunk-SLGD36MM.js.map → chunk-BJI2D4SU.js.map} +0 -0
  2648. /package/dist/{chunk-CEO4DONG.js.map → chunk-BQB5ZMYO.js.map} +0 -0
  2649. /package/dist/{chunk-WH7RINGG.js.map → chunk-C5CPYMLX.js.map} +0 -0
  2650. /package/dist/{chunk-AHVJ6GLL.js.map → chunk-CS2JO77A.js.map} +0 -0
  2651. /package/dist/{chunk-UDJMJNBK.js.map → chunk-DTABICJ3.js.map} +0 -0
  2652. /package/dist/{chunk-CVILPI77.js.map → chunk-E6UNM67F.js.map} +0 -0
  2653. /package/dist/{chunk-NNEWBRUL.js.map → chunk-ENUI3IO7.js.map} +0 -0
  2654. /package/dist/{chunk-DZP2XMZC.js.map → chunk-FF2XYADH.js.map} +0 -0
  2655. /package/dist/{chunk-S45INSV3.js.map → chunk-FF6N7BXC.js.map} +0 -0
  2656. /package/dist/{chunk-2QZJ4P27.js.map → chunk-FSXD6Y4H.js.map} +0 -0
  2657. /package/dist/{chunk-SGUDMW2K.js.map → chunk-GK6NOQE6.js.map} +0 -0
  2658. /package/dist/{chunk-TTFJQ5B5.js.map → chunk-GRSFFLUY.js.map} +0 -0
  2659. /package/dist/{chunk-5FAGCOZD.js.map → chunk-GWK7FEUL.js.map} +0 -0
  2660. /package/dist/{chunk-SCXURCVT.js.map → chunk-GWQVMKUJ.js.map} +0 -0
  2661. /package/dist/{chunk-3S6URXEH.js.map → chunk-HKHZWJ3E.js.map} +0 -0
  2662. /package/dist/{chunk-PLJ2MQFT.js.map → chunk-IAZPYX6W.js.map} +0 -0
  2663. /package/dist/{chunk-MZWSOLMT.js.map → chunk-IG747LRN.js.map} +0 -0
  2664. /package/dist/{chunk-X7WAM3IY.js.map → chunk-IK63WA5A.js.map} +0 -0
  2665. /package/dist/{chunk-BSCNBIF4.js.map → chunk-IUD6NLNM.js.map} +0 -0
  2666. /package/dist/{chunk-3R23DDD3.js.map → chunk-JSJZ2NXS.js.map} +0 -0
  2667. /package/dist/{chunk-YIIW2OH2.js.map → chunk-JUOJGZPV.js.map} +0 -0
  2668. /package/dist/{chunk-VGO57TU7.js.map → chunk-KA4U5GQN.js.map} +0 -0
  2669. /package/dist/{chunk-VDX2J7OX.js.map → chunk-KQAFEZQX.js.map} +0 -0
  2670. /package/dist/{chunk-ARRKSBQU.js.map → chunk-L4WBADKG.js.map} +0 -0
  2671. /package/dist/{chunk-ULQVG6G3.js.map → chunk-LAL4B37X.js.map} +0 -0
  2672. /package/dist/{chunk-D7VT2LED.js.map → chunk-LELJRLPY.js.map} +0 -0
  2673. /package/dist/{chunk-L63GFNKL.js.map → chunk-LMMQKZK3.js.map} +0 -0
  2674. /package/dist/{chunk-ZP73EM2X.js.map → chunk-LQ23DMTT.js.map} +0 -0
  2675. /package/dist/{chunk-7QVYVSEH.js.map → chunk-LV6ZB6CA.js.map} +0 -0
  2676. /package/dist/{chunk-KIGC55FQ.js.map → chunk-M5IJP3YW.js.map} +0 -0
  2677. /package/dist/{chunk-AH44WTLJ.js.map → chunk-MWZMVLXL.js.map} +0 -0
  2678. /package/dist/{chunk-AQ55YKEV.js.map → chunk-N4VCHRLD.js.map} +0 -0
  2679. /package/dist/{chunk-HNHIHXSD.js.map → chunk-NKXHCCLB.js.map} +0 -0
  2680. /package/dist/{chunk-SZ7IVZGD.js.map → chunk-NVCWA4QC.js.map} +0 -0
  2681. /package/dist/{chunk-RUUJXAGT.js.map → chunk-ONWVMYHX.js.map} +0 -0
  2682. /package/dist/{chunk-HMDYSGY6.js.map → chunk-P6P35FY4.js.map} +0 -0
  2683. /package/dist/{chunk-H6WOFMOV.js.map → chunk-P7M22CYB.js.map} +0 -0
  2684. /package/dist/{chunk-Q4AUIFUA.js.map → chunk-QMWKENNK.js.map} +0 -0
  2685. /package/dist/{chunk-J54B5DGD.js.map → chunk-QOPB6KE3.js.map} +0 -0
  2686. /package/dist/{chunk-DI52XAKG.js.map → chunk-RBULO7DO.js.map} +0 -0
  2687. /package/dist/{chunk-VUV472VH.js.map → chunk-RDESQOEE.js.map} +0 -0
  2688. /package/dist/{chunk-SPFNGHHP.js.map → chunk-RMF763SX.js.map} +0 -0
  2689. /package/dist/{chunk-TQT4AOPO.js.map → chunk-RN6ZCNM5.js.map} +0 -0
  2690. /package/dist/{chunk-QWQB7TOB.js.map → chunk-S2OBXHMN.js.map} +0 -0
  2691. /package/dist/{chunk-UCH2RWFX.js.map → chunk-S3JPD4N7.js.map} +0 -0
  2692. /package/dist/{chunk-HWLIMQE2.js.map → chunk-SF6RFI5Z.js.map} +0 -0
  2693. /package/dist/{chunk-ZXQPAYCS.js.map → chunk-SJV3AOZ2.js.map} +0 -0
  2694. /package/dist/{chunk-Y7LZ5V7N.js.map → chunk-SLULR4GC.js.map} +0 -0
  2695. /package/dist/{chunk-U2SK45U3.js.map → chunk-TFXXMTHV.js.map} +0 -0
  2696. /package/dist/{chunk-2HJKAVAS.js.map → chunk-TYP7GYRI.js.map} +0 -0
  2697. /package/dist/{chunk-KH2D26LQ.js.map → chunk-TYZK56OA.js.map} +0 -0
  2698. /package/dist/{chunk-XPFJSUOR.js.map → chunk-VLDVNZQE.js.map} +0 -0
  2699. /package/dist/{chunk-AIVRD66I.js.map → chunk-W6YK672C.js.map} +0 -0
  2700. /package/dist/{chunk-LVFI5LG7.js.map → chunk-X2NFFBTO.js.map} +0 -0
  2701. /package/dist/{chunk-GRDRVYXJ.js.map → chunk-X45KZOT2.js.map} +0 -0
  2702. /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
  2703. /package/dist/{chunk-AYHNTYVG.js.map → chunk-XIXM6G7I.js.map} +0 -0
  2704. /package/dist/{chunk-ZN7SMKAK.js.map → chunk-XLXYARWC.js.map} +0 -0
  2705. /package/dist/{chunk-MTWD4KMM.js.map → chunk-XVW52M6I.js.map} +0 -0
  2706. /package/dist/{chunk-27MKMTBY.js.map → chunk-YHU5XUF4.js.map} +0 -0
  2707. /package/dist/{chunk-SMBWBEE7.js.map → chunk-YRH3C2OJ.js.map} +0 -0
  2708. /package/dist/{chunk-WUJD4CHZ.js.map → chunk-YXQE67A7.js.map} +0 -0
  2709. /package/dist/{chunk-EVQ33D3N.js.map → chunk-ZHUVMSHI.js.map} +0 -0
  2710. /package/dist/{chunk-VVX5PZFS.js.map → chunk-ZHXSOMYH.js.map} +0 -0
  2711. /package/dist/{chunk-O7OVWKT4.js.map → chunk-ZIEZJMFW.js.map} +0 -0
  2712. /package/dist/{chunk-QZ4U67KO.js.map → chunk-ZSEFGDCI.js.map} +0 -0
  2713. /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
  2714. /package/dist/{resolution-LXFQQ4AE.js.map → graph-edge-decay-ROSUPDX3.js.map} +0 -0
@@ -0,0 +1,3400 @@
1
+ import {
2
+ buildTokenEntry,
3
+ commitTokenEntry,
4
+ generateToken,
5
+ loadTokenStore,
6
+ revokeToken,
7
+ saveTokenStore
8
+ } from "./chunk-754XN6LX.js";
9
+ import {
10
+ getConnectorsDir,
11
+ getRegistryPath
12
+ } from "./chunk-ADXCCZL2.js";
13
+ import {
14
+ coerceBool,
15
+ coerceInstallExtension
16
+ } from "./chunk-PQVCH2AE.js";
17
+ import {
18
+ httpProtocolForHost
19
+ } from "./chunk-C5C7IJ4Q.js";
20
+ import {
21
+ resolveConversationContextCapabilities
22
+ } from "./chunk-JUOZ62Y7.js";
23
+ import {
24
+ launchProcessSync
25
+ } from "./chunk-ZEFVK7XC.js";
26
+ import {
27
+ expandTildePath
28
+ } from "./chunk-6KH5NLQS.js";
29
+ import {
30
+ mergeEnv,
31
+ readEnvVar,
32
+ resolveHomeDir
33
+ } from "./chunk-P2QRMMVQ.js";
34
+ import {
35
+ log
36
+ } from "./chunk-3WCASNQZ.js";
37
+
38
+ // src/connectors/index.ts
39
+ import fs4 from "fs";
40
+ import path4 from "path";
41
+ import os2 from "os";
42
+ import { createRequire } from "module";
43
+ import { fileURLToPath } from "url";
44
+
45
+ // src/runtime/daemon-health.ts
46
+ var HEALTH_EXIT_OK = 0;
47
+ var HEALTH_EXIT_UNAUTHORIZED = 2;
48
+ function checkDaemonHealth(host, port, authToken, allowInsecureHttp = false) {
49
+ try {
50
+ const safePort = Math.trunc(Number(port));
51
+ if (!Number.isFinite(safePort) || safePort < 1 || safePort > 65535) return false;
52
+ const bareHost = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
53
+ const script = [
54
+ "const env = process['env'];",
55
+ "const protocol = env.REMNIC_HEALTH_PROTOCOL;",
56
+ "if (protocol !== 'http' && protocol !== 'https') process.exit(1);",
57
+ "const transport = require(protocol);",
58
+ "const headers = {};",
59
+ "if (env.REMNIC_HEALTH_TOKEN) headers['authorization'] = 'Bearer ' + env.REMNIC_HEALTH_TOKEN;",
60
+ "const req = transport.get({",
61
+ " host: env.REMNIC_HEALTH_HOST,",
62
+ " port: parseInt(env.REMNIC_HEALTH_PORT, 10),",
63
+ " path: '/engram/v1/health', headers, timeout: 3000,",
64
+ "}, (res) => { process.exit(res.statusCode === 200 ? 0 : res.statusCode === 401 ? 2 : 1); });",
65
+ "req.on('error', () => process.exit(1));",
66
+ "req.on('timeout', () => { req.destroy(); process.exit(1); });"
67
+ ].join("\n");
68
+ const env = mergeEnv({
69
+ REMNIC_HEALTH_HOST: bareHost,
70
+ REMNIC_HEALTH_PORT: String(safePort),
71
+ REMNIC_HEALTH_PROTOCOL: httpProtocolForHost(host, allowInsecureHttp)
72
+ });
73
+ if (authToken) env.REMNIC_HEALTH_TOKEN = authToken;
74
+ const launchOptions = { timeout: 4e3, env };
75
+ const result = launchProcessSync(process.execPath, ["-e", script], launchOptions);
76
+ if (result.status === HEALTH_EXIT_OK) return true;
77
+ if (result.status !== HEALTH_EXIT_UNAUTHORIZED) return false;
78
+ console.error("[remnic/connectors] health probe got 401 \u2014 retrying after token cache TTL...");
79
+ launchProcessSync(process.execPath, ["-e", "setTimeout(() => {}, 6000)"], { timeout: 7e3, env: {} });
80
+ const retry = launchProcessSync(process.execPath, ["-e", script], launchOptions);
81
+ return retry.status === HEALTH_EXIT_OK;
82
+ } catch {
83
+ return false;
84
+ }
85
+ }
86
+
87
+ // src/connectors/hermes-shim.ts
88
+ import fs from "fs";
89
+ import path from "path";
90
+ var HERMES_SHIM_MARKER = "generated by `remnic connectors install hermes`";
91
+ function resolveHermesRoot() {
92
+ const envHome = readEnvVar("HERMES_HOME");
93
+ if (typeof envHome === "string" && envHome.trim().length > 0) {
94
+ const expanded = path.resolve(expandTildePath(envHome.trim()));
95
+ try {
96
+ const stat = fs.lstatSync(expanded);
97
+ if (stat.isSymbolicLink()) {
98
+ throw new Error(`HERMES_HOME must not be a symbolic link: ${expanded}`);
99
+ }
100
+ if (!stat.isDirectory()) {
101
+ throw new Error(`HERMES_HOME is not a directory: ${expanded}`);
102
+ }
103
+ } catch (err) {
104
+ if (err.code !== "ENOENT") {
105
+ throw err;
106
+ }
107
+ }
108
+ return expanded;
109
+ }
110
+ if (process.platform === "win32") {
111
+ const localAppData = (readEnvVar("LOCALAPPDATA") ?? "").trim();
112
+ const base = localAppData.length > 0 ? path.resolve(localAppData) : path.join(resolveHomeDir(), "AppData", "Local");
113
+ return resolveDefaultRoot(path.join(base, "hermes"));
114
+ }
115
+ return resolveDefaultRoot(path.resolve(resolveHomeDir(), ".hermes"));
116
+ }
117
+ function resolveDefaultRoot(candidate) {
118
+ try {
119
+ return fs.realpathSync.native(candidate);
120
+ } catch {
121
+ return candidate;
122
+ }
123
+ }
124
+ function hermesShimPath() {
125
+ return path.join(resolveHermesRoot(), "plugins", "remnic", "__init__.py");
126
+ }
127
+ function writePlainFileAtomicSync(filePath, data) {
128
+ const dir = path.dirname(filePath);
129
+ const base = path.basename(filePath);
130
+ const tmpPath = path.join(dir, `.${base}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`);
131
+ let wroteTemp = false;
132
+ try {
133
+ fs.writeFileSync(tmpPath, data, { mode: 420, flag: "wx" });
134
+ wroteTemp = true;
135
+ fs.renameSync(tmpPath, filePath);
136
+ try {
137
+ fs.chmodSync(filePath, 420);
138
+ } catch {
139
+ }
140
+ } catch (err) {
141
+ if (wroteTemp) {
142
+ try {
143
+ fs.unlinkSync(tmpPath);
144
+ } catch {
145
+ }
146
+ }
147
+ throw err;
148
+ }
149
+ }
150
+ function assertShimComponentsNotSymlinked(shimPath) {
151
+ const remnicDir = path.dirname(shimPath);
152
+ const pluginsDir = path.dirname(remnicDir);
153
+ for (const component of [pluginsDir, remnicDir, shimPath]) {
154
+ let isLink = false;
155
+ try {
156
+ isLink = fs.lstatSync(component).isSymbolicLink();
157
+ } catch {
158
+ continue;
159
+ }
160
+ if (isLink) {
161
+ throw new Error(`refusing to operate through a symbolic link: ${component}`);
162
+ }
163
+ }
164
+ }
165
+ function materializeHermesShim(shimPath) {
166
+ assertShimComponentsNotSymlinked(shimPath);
167
+ if (fs.existsSync(shimPath)) {
168
+ let existing;
169
+ try {
170
+ existing = fs.readFileSync(shimPath, "utf8");
171
+ } catch (readErr) {
172
+ throw new Error(
173
+ `cannot read existing shim at ${shimPath}: ${readErr instanceof Error ? readErr.message : String(readErr)}`
174
+ );
175
+ }
176
+ if (!existing.includes(HERMES_SHIM_MARKER)) {
177
+ return {
178
+ note: `Hermes plugin shim already exists and was NOT generated by Remnic \u2014 left untouched: ${shimPath}. If the provider is not discovered, ensure that file imports remnic_hermes.register AND contains the literal text register_memory_provider (or MemoryProvider) \u2014 Hermes' discovery text-scan skips the directory without it.`,
179
+ wrote: false
180
+ };
181
+ }
182
+ }
183
+ fs.mkdirSync(path.dirname(shimPath), { recursive: true });
184
+ const content = [
185
+ `"""Remnic memory provider shim for Hermes Agent (${HERMES_SHIM_MARKER}).`,
186
+ "",
187
+ "Hermes memory-provider discovery calls register(collector);",
188
+ "collector.register_memory_provider() receives the provider.",
189
+ `"""`,
190
+ "",
191
+ "from remnic_hermes import register # noqa: F401 (register() loads Hermes config itself)",
192
+ ""
193
+ ].join("\n");
194
+ writePlainFileAtomicSync(shimPath, content);
195
+ return { note: `Materialized Hermes plugin shim: ${shimPath}`, wrote: true };
196
+ }
197
+ function reconcileHermesShim(priorPersistedPath) {
198
+ const notes = [];
199
+ let target = null;
200
+ let materialized = false;
201
+ let createdNew = false;
202
+ try {
203
+ target = hermesShimPath();
204
+ const existedBefore = fs.existsSync(target);
205
+ const result = materializeHermesShim(target);
206
+ notes.push(result.note);
207
+ materialized = result.wrote;
208
+ createdNew = result.wrote && !existedBefore;
209
+ } catch (shimErr) {
210
+ const shimPathHint = target ?? "<hermesRoot>/plugins/remnic/__init__.py";
211
+ notes.push(
212
+ `Note: could not materialize the Hermes plugin shim (${shimErr instanceof Error ? shimErr.message : String(shimErr)}). Create ${shimPathHint} manually with exactly these two lines:
213
+ """Remnic memory provider shim. Calls collector.register_memory_provider()."""
214
+ from remnic_hermes import register`
215
+ );
216
+ }
217
+ if (!materialized || target === null) {
218
+ return {
219
+ notes,
220
+ persistPath: priorPersistedPath,
221
+ materializedAt: null,
222
+ createdNew: false,
223
+ priorCleanedAt: null
224
+ };
225
+ }
226
+ const confirmedTarget = target;
227
+ let priorCleanedAt = null;
228
+ if (priorPersistedPath !== null && !sameShimTarget(priorPersistedPath, confirmedTarget)) {
229
+ try {
230
+ const stale = removeHermesShim([priorPersistedPath]);
231
+ if (stale.notes.length > 0) {
232
+ notes.push(`Cleaned prior-install shim: ${stale.notes.join("; ")}`);
233
+ }
234
+ priorCleanedAt = stale.removedPaths.includes(priorPersistedPath) ? priorPersistedPath : null;
235
+ } catch {
236
+ notes.push(
237
+ `Note: could not clean the prior-install Hermes plugin shim at ${priorPersistedPath} \u2014 remove it manually if present.`
238
+ );
239
+ }
240
+ }
241
+ return { notes, persistPath: target, materializedAt: target, createdNew, priorCleanedAt };
242
+ }
243
+ function sameShimTarget(leftPath, rightPath) {
244
+ return resolveShimTarget(leftPath) === resolveShimTarget(rightPath);
245
+ }
246
+ function resolveShimTarget(candidate) {
247
+ try {
248
+ return fs.realpathSync.native(candidate);
249
+ } catch {
250
+ return path.resolve(candidate);
251
+ }
252
+ }
253
+ function removeHermesShim(candidatePaths) {
254
+ const notes = [];
255
+ const removedPaths = [];
256
+ for (const shimPath of new Set(candidatePaths)) {
257
+ if (!isPlausibleHermesShimPath(shimPath)) {
258
+ continue;
259
+ }
260
+ try {
261
+ assertShimComponentsNotSymlinked(shimPath);
262
+ } catch {
263
+ notes.push(`Hermes plugin shim left untouched (symlinked path component): ${shimPath}`);
264
+ continue;
265
+ }
266
+ if (!fs.existsSync(shimPath)) {
267
+ continue;
268
+ }
269
+ let content;
270
+ try {
271
+ content = fs.readFileSync(shimPath, "utf8");
272
+ } catch {
273
+ notes.push(`Hermes plugin shim left untouched (unreadable): ${shimPath}`);
274
+ continue;
275
+ }
276
+ if (!content.includes(HERMES_SHIM_MARKER)) {
277
+ notes.push(`Hermes plugin shim left untouched (not Remnic-generated): ${shimPath}`);
278
+ continue;
279
+ }
280
+ try {
281
+ fs.unlinkSync(shimPath);
282
+ } catch (unlinkErr) {
283
+ notes.push(
284
+ `Hermes plugin shim could not be removed (${unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr)}): ${shimPath} \u2014 remove it manually or re-run after fixing permissions.`
285
+ );
286
+ continue;
287
+ }
288
+ removedPaths.push(shimPath);
289
+ try {
290
+ fs.rmdirSync(path.dirname(shimPath));
291
+ } catch {
292
+ }
293
+ notes.push(`Removed Hermes plugin shim: ${shimPath}`);
294
+ }
295
+ return { removedPaths, notes };
296
+ }
297
+ function isPlausibleHermesShimPath(candidate) {
298
+ if (typeof candidate !== "string" || candidate.length === 0 || !path.isAbsolute(candidate)) {
299
+ return false;
300
+ }
301
+ const dir = path.dirname(candidate);
302
+ return path.basename(candidate) === "__init__.py" && path.basename(dir) === "remnic" && path.basename(path.dirname(dir)) === "plugins";
303
+ }
304
+ function isPlausibleHermesConfigPath(candidate) {
305
+ if (typeof candidate !== "string" || candidate.length === 0 || !path.isAbsolute(candidate)) {
306
+ return false;
307
+ }
308
+ if (path.basename(candidate) !== "config.yaml") {
309
+ return false;
310
+ }
311
+ const dir = path.dirname(candidate);
312
+ const dirName = path.basename(dir).toLowerCase();
313
+ if (dirName === ".hermes" || dirName === "hermes") {
314
+ return true;
315
+ }
316
+ if (path.basename(path.dirname(dir)) === "profiles") {
317
+ return true;
318
+ }
319
+ if (["plugins", "profiles"].some((sibling) => {
320
+ try {
321
+ return fs.statSync(path.join(dir, sibling)).isDirectory();
322
+ } catch {
323
+ return false;
324
+ }
325
+ })) {
326
+ return true;
327
+ }
328
+ try {
329
+ const stat = fs.statSync(candidate);
330
+ if (!stat.isFile() || stat.size > 1024 * 1024) {
331
+ return false;
332
+ }
333
+ return /^remnic:/m.test(fs.readFileSync(candidate, "utf8"));
334
+ } catch {
335
+ return false;
336
+ }
337
+ }
338
+ function survivingMarkerShims(candidates, excludeTarget) {
339
+ const survivors = [];
340
+ for (const candidate of new Set(candidates)) {
341
+ if (!isPlausibleHermesShimPath(candidate)) {
342
+ continue;
343
+ }
344
+ if (excludeTarget !== null && sameShimTarget(candidate, excludeTarget)) {
345
+ continue;
346
+ }
347
+ if (survivors.some((kept) => sameShimTarget(kept, candidate))) {
348
+ continue;
349
+ }
350
+ let carriesMarker = false;
351
+ try {
352
+ carriesMarker = fs.readFileSync(candidate, "utf8").includes(HERMES_SHIM_MARKER);
353
+ } catch {
354
+ carriesMarker = false;
355
+ }
356
+ if (carriesMarker) {
357
+ survivors.push(candidate);
358
+ }
359
+ }
360
+ return survivors;
361
+ }
362
+ function assertConfigComponentsNotSymlinked(cfgPath) {
363
+ const dir = path.dirname(cfgPath);
364
+ const components = [cfgPath, dir];
365
+ const grandparent = path.dirname(dir);
366
+ if (path.basename(grandparent) === "profiles") {
367
+ components.push(grandparent);
368
+ }
369
+ for (const component of components) {
370
+ let isLink = false;
371
+ try {
372
+ isLink = fs.lstatSync(component).isSymbolicLink();
373
+ } catch {
374
+ continue;
375
+ }
376
+ if (isLink) {
377
+ throw new Error(`refusing to operate through a symbolic link: ${component}`);
378
+ }
379
+ }
380
+ }
381
+
382
+ // src/connectors/droid-mcp.ts
383
+ import fs2 from "fs";
384
+ import path2 from "path";
385
+ import os from "os";
386
+ var DROID_CONNECTOR_MANIFEST = {
387
+ id: "droid",
388
+ name: "Factory Droid",
389
+ version: "1.0.0",
390
+ description: "Factory Droid \u2014 AI software engineering agent; memory via HTTP MCP with bearer auth",
391
+ capabilities: {
392
+ observe: true,
393
+ recall: true,
394
+ store: true,
395
+ search: true,
396
+ entities: true,
397
+ realtimeSync: true,
398
+ batch: true,
399
+ maxBudgetChars: 32e3,
400
+ connectionType: "mcp"
401
+ },
402
+ configSchema: {
403
+ mcpServerUrl: "URL of the MCP Remnic: server (default: http://127.0.0.1:4318/mcp)",
404
+ namespace: "Optional namespace"
405
+ },
406
+ homepage: "https://factory.ai",
407
+ author: "Remnic",
408
+ tags: ["official", "ai", "droid", "factory"],
409
+ requiresToken: true
410
+ };
411
+ function droidInstallStep(authToken, resolvedConfig, requiresToken, tokenEntry, priorTokenStore, saveTokenStoreFn) {
412
+ try {
413
+ const result = writeDroidMcpEntry(authToken, resolvedConfig);
414
+ return { ok: true, rollback: result.rollback, mcpPath: result.mcpPath };
415
+ } catch (droidErr) {
416
+ const errMsg = droidErr instanceof Error ? droidErr.message : String(droidErr);
417
+ let tokenSuffix = "";
418
+ if (requiresToken && tokenEntry !== null && priorTokenStore !== null) {
419
+ try {
420
+ saveTokenStoreFn(priorTokenStore);
421
+ tokenSuffix = " Token has been rolled back.";
422
+ } catch (e) {
423
+ tokenSuffix = ` Token rollback FAILED (${e instanceof Error ? e.message : String(e)}) \u2014 manually inspect ~/.remnic/tokens.json and reinstall.`;
424
+ }
425
+ }
426
+ return {
427
+ ok: false,
428
+ errorMessage: `Droid install aborted: ~/.factory/mcp.json write failed \u2014 ${errMsg}.${tokenSuffix} Resolve the write permission issue on ~/.factory/, then reinstall.`
429
+ };
430
+ }
431
+ }
432
+ function readDroidMcpProvenance(configPath) {
433
+ let mcpConfigPath = null;
434
+ let registryParseFailed = false;
435
+ if (!fs2.existsSync(configPath)) {
436
+ return { mcpConfigPath: null, registryParseFailed: false };
437
+ }
438
+ try {
439
+ const stored = JSON.parse(fs2.readFileSync(configPath, "utf8"));
440
+ if (typeof stored.factoryMcpPath === "string" && stored.factoryMcpPath.length > 0) {
441
+ mcpConfigPath = stored.factoryMcpPath;
442
+ }
443
+ } catch {
444
+ registryParseFailed = true;
445
+ }
446
+ if (mcpConfigPath === null && !registryParseFailed) {
447
+ try {
448
+ mcpConfigPath = resolveFactoryMcpPath();
449
+ } catch {
450
+ }
451
+ }
452
+ return { mcpConfigPath, registryParseFailed };
453
+ }
454
+ function writeSecretFileSync(filePath, data) {
455
+ const dir = path2.dirname(filePath);
456
+ const base = path2.basename(filePath);
457
+ const tmpPath = path2.join(
458
+ dir,
459
+ `.${base}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
460
+ );
461
+ let wroteTemp = false;
462
+ try {
463
+ fs2.writeFileSync(tmpPath, data, { mode: 384, flag: "wx" });
464
+ wroteTemp = true;
465
+ try {
466
+ fs2.chmodSync(tmpPath, 384);
467
+ } catch {
468
+ }
469
+ fs2.renameSync(tmpPath, filePath);
470
+ try {
471
+ fs2.chmodSync(filePath, 384);
472
+ } catch {
473
+ }
474
+ } catch (err) {
475
+ if (wroteTemp) {
476
+ try {
477
+ fs2.unlinkSync(tmpPath);
478
+ } catch {
479
+ }
480
+ }
481
+ throw err;
482
+ }
483
+ }
484
+ function writeDroidMcpEntry(authToken, resolvedConfig) {
485
+ const mcpPath = resolveFactoryMcpPath();
486
+ const priorContent = readFactoryMcpIfExists(mcpPath);
487
+ const mcpConfig = upsertFactoryMcpRemnicEntry(priorContent, authToken, resolvedConfig);
488
+ fs2.mkdirSync(path2.dirname(mcpPath), { recursive: true });
489
+ const rollback = () => {
490
+ try {
491
+ if (priorContent === null) {
492
+ if (fs2.existsSync(mcpPath)) fs2.unlinkSync(mcpPath);
493
+ } else {
494
+ writeSecretFileSync(mcpPath, priorContent);
495
+ }
496
+ } catch {
497
+ }
498
+ };
499
+ try {
500
+ writeSecretFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2));
501
+ } catch (writeErr) {
502
+ try {
503
+ rollback();
504
+ } catch {
505
+ }
506
+ throw writeErr;
507
+ }
508
+ return { mcpPath, rollback };
509
+ }
510
+ function removeDroidMcpEntry(mcpPath) {
511
+ const expectedSuffix = path2.join(".factory", "mcp.json");
512
+ if (!path2.isAbsolute(mcpPath) || !mcpPath.endsWith(expectedSuffix)) {
513
+ throw new Error(
514
+ `MCP config path ${JSON.stringify(mcpPath)} failed safety validation (must be absolute and end with "${expectedSuffix}"). Refusing to modify \u2014 remove the "remnic" entry manually if it exists.`
515
+ );
516
+ }
517
+ const priorContent = readFactoryMcpIfExists(mcpPath);
518
+ if (priorContent === null) return null;
519
+ const updated = removeFactoryMcpRemnicEntry(priorContent);
520
+ if (updated === null) return null;
521
+ writeSecretFileSync(mcpPath, JSON.stringify(updated, null, 2));
522
+ return `Removed remnic entry from Droid MCP config: ${mcpPath}`;
523
+ }
524
+ function droidMcpDoctorCheck(savedPath) {
525
+ const mcpPath = savedPath ?? resolveFactoryMcpPath();
526
+ if (savedPath !== void 0) {
527
+ const expectedSuffix = path2.join(".factory", "mcp.json");
528
+ if (!path2.isAbsolute(savedPath) || !savedPath.endsWith(expectedSuffix)) {
529
+ return { name: "Droid MCP config", ok: false, detail: `Unsafe path in droid.json: ${savedPath}` };
530
+ }
531
+ }
532
+ try {
533
+ const raw = fs2.readFileSync(mcpPath, "utf8");
534
+ const parsed = JSON.parse(raw);
535
+ const servers = parsed.mcpServers;
536
+ if (typeof servers !== "object" || servers === null || !("remnic" in servers)) {
537
+ return { name: "Droid MCP config", ok: false, detail: `remnic entry missing in ${mcpPath} \u2014 run \`remnic connectors install droid\`` };
538
+ }
539
+ const remnic = servers.remnic;
540
+ if (remnic.type !== "http" || typeof remnic.url !== "string") {
541
+ return { name: "Droid MCP config", ok: false, detail: `remnic entry malformed in ${mcpPath}` };
542
+ }
543
+ const headers = remnic.headers;
544
+ const hasAuth = headers && typeof headers["Authorization"] === "string" && headers["Authorization"].startsWith("Bearer ");
545
+ return {
546
+ name: "Droid MCP config",
547
+ ok: !!hasAuth,
548
+ detail: hasAuth ? `remnic entry present in ${mcpPath}` : `remnic entry missing Authorization header in ${mcpPath} \u2014 run \`remnic connectors install droid\``
549
+ };
550
+ } catch {
551
+ return { name: "Droid MCP config", ok: false, detail: `Cannot read ${mcpPath} \u2014 run \`remnic connectors install droid\`` };
552
+ }
553
+ }
554
+ function resolveFactoryMcpPath() {
555
+ const envHome = readEnvVar("HOME");
556
+ const home = envHome && envHome.length > 0 ? envHome : os.homedir();
557
+ return path2.resolve(home, ".factory", "mcp.json");
558
+ }
559
+ function readFactoryMcpIfExists(mcpPath) {
560
+ try {
561
+ if (!fs2.existsSync(mcpPath)) return null;
562
+ return fs2.readFileSync(mcpPath, "utf8");
563
+ } catch {
564
+ return null;
565
+ }
566
+ }
567
+ var REMNIC_DEFAULT_MCP_URL = "http://127.0.0.1:4318/mcp";
568
+ function upsertFactoryMcpRemnicEntry(priorContent, authToken, resolvedConfig) {
569
+ let config;
570
+ if (priorContent !== null) {
571
+ try {
572
+ const parsed = JSON.parse(priorContent);
573
+ if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
574
+ config = parsed;
575
+ } else {
576
+ console.warn("[remnic/connectors] ~/.factory/mcp.json contained non-object JSON; starting fresh.");
577
+ config = {};
578
+ }
579
+ } catch {
580
+ throw new Error(
581
+ "~/.factory/mcp.json contains malformed JSON and cannot be parsed. Fix the file manually before reinstalling, or use --force to overwrite (this will lose existing MCP server entries)."
582
+ );
583
+ }
584
+ } else {
585
+ config = {};
586
+ }
587
+ if (typeof config.mcpServers !== "object" || config.mcpServers === null || Array.isArray(config.mcpServers)) {
588
+ config.mcpServers = {};
589
+ }
590
+ const servers = config.mcpServers;
591
+ const mcpUrl = typeof resolvedConfig.mcpServerUrl === "string" && resolvedConfig.mcpServerUrl.length > 0 ? resolvedConfig.mcpServerUrl : REMNIC_DEFAULT_MCP_URL;
592
+ const remnicEntry = { type: "http", url: mcpUrl };
593
+ const REMNIC_MANAGED_HEADERS = /* @__PURE__ */ new Set(["Authorization", "X-Engram-Namespace"]);
594
+ const headers = {};
595
+ if (typeof servers.remnic === "object" && servers.remnic !== null && typeof servers.remnic.headers === "object" && servers.remnic.headers !== null) {
596
+ const priorHeaders = servers.remnic.headers;
597
+ for (const [key, value] of Object.entries(priorHeaders)) {
598
+ if (!REMNIC_MANAGED_HEADERS.has(key) && typeof value === "string") {
599
+ headers[key] = value;
600
+ }
601
+ }
602
+ }
603
+ if (authToken && authToken.length > 0) {
604
+ headers["Authorization"] = `Bearer ${authToken}`;
605
+ }
606
+ const namespace = typeof resolvedConfig.namespace === "string" && resolvedConfig.namespace.length > 0 ? resolvedConfig.namespace : void 0;
607
+ if (namespace) {
608
+ headers["X-Engram-Namespace"] = namespace;
609
+ }
610
+ if (Object.keys(headers).length > 0) {
611
+ remnicEntry.headers = headers;
612
+ }
613
+ servers.remnic = remnicEntry;
614
+ return config;
615
+ }
616
+ function removeFactoryMcpRemnicEntry(priorContent) {
617
+ let config;
618
+ try {
619
+ const parsed = JSON.parse(priorContent);
620
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
621
+ return null;
622
+ }
623
+ config = parsed;
624
+ } catch {
625
+ return null;
626
+ }
627
+ if (typeof config.mcpServers !== "object" || config.mcpServers === null) {
628
+ return null;
629
+ }
630
+ const servers = config.mcpServers;
631
+ if (!("remnic" in servers)) {
632
+ return null;
633
+ }
634
+ delete servers.remnic;
635
+ return config;
636
+ }
637
+
638
+ // src/connectors/prime-agent.ts
639
+ var PRIME_AGENT_CONNECTOR_MANIFEST = {
640
+ id: "prime-agent",
641
+ name: "Prime Agent",
642
+ version: "1.0.0",
643
+ description: "Prime Agent \u2014 Pi-fork coding agent; native extension for recall, observe, MCP tools, and compaction coordination",
644
+ capabilities: {
645
+ observe: true,
646
+ recall: true,
647
+ store: true,
648
+ search: true,
649
+ entities: true,
650
+ realtimeSync: true,
651
+ batch: true,
652
+ maxBudgetChars: 32e3,
653
+ connectionType: "http"
654
+ },
655
+ configSchema: {
656
+ remnicDaemonUrl: "URL of the Remnic daemon (default: http://127.0.0.1:4318)",
657
+ namespace: "Optional namespace",
658
+ installExtension: "Install the Prime Agent extension into ~/.prime/agent/extensions/remnic (default: true)"
659
+ },
660
+ author: "Remnic",
661
+ tags: ["official", "ai", "prime-agent", "pi", "coding-agent"],
662
+ requiresToken: true
663
+ };
664
+
665
+ // src/connectors/codex-marketplace.ts
666
+ import fs3 from "fs";
667
+ import path3 from "path";
668
+ var MARKETPLACE_SCHEMA_VERSION = 1;
669
+ var MARKETPLACE_MANIFEST_FILENAME = "marketplace.json";
670
+ var VALID_INSTALL_TYPES = /* @__PURE__ */ new Set(["github", "git", "local", "url"]);
671
+ function generateMarketplaceManifest(options) {
672
+ const version = options?.packageVersion ?? readPackageVersion() ?? "0.0.0";
673
+ return {
674
+ version: MARKETPLACE_SCHEMA_VERSION,
675
+ name: "remnic",
676
+ description: "Remnic: Local-first AI memory with semantic search and consolidation",
677
+ plugins: [
678
+ {
679
+ name: "remnic",
680
+ version,
681
+ description: "Persistent memory plugin for Codex CLI",
682
+ repository: "joshuaswarren/remnic",
683
+ installType: "github",
684
+ entry: "packages/plugin-codex",
685
+ configSchema: "openclaw.plugin.json"
686
+ }
687
+ ]
688
+ };
689
+ }
690
+ function validateMarketplaceManifest(manifest) {
691
+ const validation = checkMarketplaceManifest(manifest);
692
+ if (!validation.valid) {
693
+ throw new Error(
694
+ `Invalid marketplace manifest: ${validation.errors.join("; ")}`
695
+ );
696
+ }
697
+ return manifest;
698
+ }
699
+ function checkMarketplaceManifest(manifest) {
700
+ const errors = [];
701
+ if (typeof manifest !== "object" || manifest === null) {
702
+ return { valid: false, errors: ["manifest must be a non-null object"] };
703
+ }
704
+ const obj = manifest;
705
+ if (obj.version !== MARKETPLACE_SCHEMA_VERSION) {
706
+ errors.push(`version must be ${MARKETPLACE_SCHEMA_VERSION}, got ${JSON.stringify(obj.version)}`);
707
+ }
708
+ if (typeof obj.name !== "string" || obj.name.trim().length === 0) {
709
+ errors.push("name must be a non-empty string");
710
+ }
711
+ if (typeof obj.description !== "string" || obj.description.trim().length === 0) {
712
+ errors.push("description must be a non-empty string");
713
+ }
714
+ if (!Array.isArray(obj.plugins)) {
715
+ errors.push("plugins must be an array");
716
+ } else if (obj.plugins.length === 0) {
717
+ errors.push("plugins must contain at least one entry");
718
+ } else {
719
+ for (let i = 0; i < obj.plugins.length; i++) {
720
+ const plugin = obj.plugins[i];
721
+ const prefix = `plugins[${i}]`;
722
+ if (typeof plugin !== "object" || plugin === null) {
723
+ errors.push(`${prefix} must be a non-null object`);
724
+ continue;
725
+ }
726
+ if (typeof plugin.name !== "string" || plugin.name.trim().length === 0) {
727
+ errors.push(`${prefix}.name must be a non-empty string`);
728
+ }
729
+ if (typeof plugin.version !== "string" || plugin.version.trim().length === 0) {
730
+ errors.push(`${prefix}.version must be a non-empty string`);
731
+ }
732
+ if (typeof plugin.description !== "string" || plugin.description.trim().length === 0) {
733
+ errors.push(`${prefix}.description must be a non-empty string`);
734
+ }
735
+ if (typeof plugin.repository !== "string" || plugin.repository.trim().length === 0) {
736
+ errors.push(`${prefix}.repository must be a non-empty string`);
737
+ }
738
+ if (typeof plugin.installType !== "string" || !VALID_INSTALL_TYPES.has(plugin.installType)) {
739
+ errors.push(
740
+ `${prefix}.installType must be one of: ${[...VALID_INSTALL_TYPES].join(", ")}; got ${JSON.stringify(plugin.installType)}`
741
+ );
742
+ }
743
+ if ("manifestUrl" in plugin && plugin.manifestUrl !== void 0) {
744
+ if (typeof plugin.manifestUrl !== "string" || plugin.manifestUrl.trim().length === 0) {
745
+ errors.push(`${prefix}.manifestUrl must be a non-empty string when provided`);
746
+ }
747
+ }
748
+ if ("entry" in plugin && plugin.entry !== void 0) {
749
+ if (typeof plugin.entry !== "string" || plugin.entry.trim().length === 0) {
750
+ errors.push(`${prefix}.entry must be a non-empty string when provided`);
751
+ }
752
+ }
753
+ if ("configSchema" in plugin && plugin.configSchema !== void 0) {
754
+ if (typeof plugin.configSchema !== "string" || plugin.configSchema.trim().length === 0) {
755
+ errors.push(`${prefix}.configSchema must be a non-empty string when provided`);
756
+ }
757
+ }
758
+ }
759
+ }
760
+ return { valid: errors.length === 0, errors };
761
+ }
762
+ async function writeMarketplaceManifest(outputDir, manifest) {
763
+ const validation = checkMarketplaceManifest(manifest);
764
+ if (!validation.valid) {
765
+ throw new Error(
766
+ `Refusing to write invalid manifest: ${validation.errors.join("; ")}`
767
+ );
768
+ }
769
+ fs3.mkdirSync(outputDir, { recursive: true });
770
+ const destPath = path3.join(outputDir, MARKETPLACE_MANIFEST_FILENAME);
771
+ const tmpPath = `${destPath}.tmp.${process.pid}`;
772
+ const content = JSON.stringify(manifest, null, 2) + "\n";
773
+ fs3.writeFileSync(tmpPath, content);
774
+ fs3.renameSync(tmpPath, destPath);
775
+ }
776
+ async function installFromMarketplace(source, sourceType, config, logger) {
777
+ const _log = logger ?? {
778
+ info: (msg) => log.info(`[marketplace] ${msg}`),
779
+ warn: (msg) => log.warn(`[marketplace] ${msg}`),
780
+ debug: (msg) => log.debug(`[marketplace] ${msg}`)
781
+ };
782
+ if (!resolveConversationContextCapabilities(config).codexMarketplace) {
783
+ return {
784
+ ok: false,
785
+ message: "Codex marketplace is disabled in config (codexMarketplaceEnabled: false)",
786
+ source,
787
+ sourceType,
788
+ pluginsFound: [],
789
+ errors: ["marketplace_disabled"]
790
+ };
791
+ }
792
+ try {
793
+ const manifest = await resolveManifest(source, sourceType, _log);
794
+ const pluginNames = manifest.plugins.map((p) => p.name);
795
+ _log.info(`marketplace install: found ${pluginNames.length} plugin(s) from ${sourceType}://${source}`);
796
+ return {
797
+ ok: true,
798
+ message: `Successfully resolved ${pluginNames.length} plugin(s) from marketplace: ${pluginNames.join(", ")}`,
799
+ source,
800
+ sourceType,
801
+ pluginsFound: pluginNames,
802
+ errors: []
803
+ };
804
+ } catch (err) {
805
+ const errMsg = err instanceof Error ? err.message : String(err);
806
+ _log.warn(`marketplace install failed: ${errMsg}`);
807
+ return {
808
+ ok: false,
809
+ message: `Failed to install from marketplace: ${errMsg}`,
810
+ source,
811
+ sourceType,
812
+ pluginsFound: [],
813
+ errors: [errMsg]
814
+ };
815
+ }
816
+ }
817
+ async function resolveManifest(source, sourceType, logger) {
818
+ switch (sourceType) {
819
+ case "local":
820
+ return resolveLocal(source, logger);
821
+ case "url":
822
+ return resolveUrl(source, logger);
823
+ case "github":
824
+ return resolveGithub(source, logger);
825
+ case "git":
826
+ return resolveGit(source, logger);
827
+ default: {
828
+ const _ = sourceType;
829
+ throw new Error(`Invalid source type: ${String(_)}`);
830
+ }
831
+ }
832
+ }
833
+ function resolveLocal(dirPath, logger) {
834
+ const manifestPath = path3.join(dirPath, MARKETPLACE_MANIFEST_FILENAME);
835
+ if (!fs3.existsSync(manifestPath)) {
836
+ throw new Error(`marketplace.json not found at ${manifestPath}`);
837
+ }
838
+ logger.debug?.(`reading local marketplace manifest: ${manifestPath}`);
839
+ const raw = fs3.readFileSync(manifestPath, "utf-8");
840
+ let parsed;
841
+ try {
842
+ parsed = JSON.parse(raw);
843
+ } catch {
844
+ throw new Error(`Invalid JSON in ${manifestPath}`);
845
+ }
846
+ if (typeof parsed !== "object" || parsed === null) {
847
+ throw new Error(`marketplace.json at ${manifestPath} is not a valid object`);
848
+ }
849
+ return validateMarketplaceManifest(parsed);
850
+ }
851
+ async function resolveUrl(url, logger) {
852
+ logger.debug?.(`fetching marketplace manifest from URL: ${url}`);
853
+ let parsedUrl;
854
+ try {
855
+ parsedUrl = new URL(url);
856
+ } catch {
857
+ throw new Error(`Invalid URL: ${url}`);
858
+ }
859
+ if (parsedUrl.protocol !== "https:" && parsedUrl.protocol !== "http:") {
860
+ throw new Error(`Unsupported URL protocol: ${parsedUrl.protocol} (use https or http)`);
861
+ }
862
+ const response = await fetch(url);
863
+ if (!response.ok) {
864
+ throw new Error(`HTTP ${response.status} fetching ${url}`);
865
+ }
866
+ const body = await response.json();
867
+ return validateMarketplaceManifest(body);
868
+ }
869
+ async function resolveGithub(repo, logger) {
870
+ if (!/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/u.test(repo)) {
871
+ throw new Error(`Invalid GitHub repo format: "${repo}" (expected owner/repo)`);
872
+ }
873
+ const rawUrl = `https://raw.githubusercontent.com/${repo}/HEAD/${MARKETPLACE_MANIFEST_FILENAME}`;
874
+ logger.debug?.(`fetching marketplace manifest from GitHub: ${rawUrl}`);
875
+ return resolveUrl(rawUrl, logger);
876
+ }
877
+ async function resolveGit(gitUrl, logger) {
878
+ const ghMatch = gitUrl.match(
879
+ /^(?:https?:\/\/)?github\.com\/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+?)(?:\.git)?$/u
880
+ );
881
+ if (ghMatch?.[1]) {
882
+ logger.debug?.(`git URL looks like GitHub \u2014 delegating to github resolver`);
883
+ return resolveGithub(ghMatch[1], logger);
884
+ }
885
+ throw new Error(
886
+ `Git URL resolution requires a GitHub-format URL for now. Got: ${gitUrl}. Use --type github or --type url instead.`
887
+ );
888
+ }
889
+ function readPackageVersion() {
890
+ const candidates = [
891
+ path3.resolve(import.meta.dirname ?? ".", "../../../.."),
892
+ path3.resolve(import.meta.dirname ?? ".", "../../../../.."),
893
+ path3.resolve(import.meta.dirname ?? ".", "..")
894
+ ];
895
+ for (const candidate of candidates) {
896
+ const pkgPath = path3.join(candidate, "package.json");
897
+ try {
898
+ if (!fs3.existsSync(pkgPath)) continue;
899
+ const raw = fs3.readFileSync(pkgPath, "utf-8");
900
+ const parsed = JSON.parse(raw);
901
+ if (typeof parsed === "object" && parsed !== null && typeof parsed.version === "string") {
902
+ return parsed.version;
903
+ }
904
+ } catch {
905
+ }
906
+ }
907
+ return void 0;
908
+ }
909
+
910
+ // src/connectors/index.ts
911
+ var BUILTIN_CONNECTORS = [
912
+ {
913
+ id: "claude-code",
914
+ name: "Claude Code",
915
+ version: "1.0.0",
916
+ description: "Anthropic's Claude Code CLI \u2014 direct memory access via MCP",
917
+ capabilities: {
918
+ observe: true,
919
+ recall: true,
920
+ store: true,
921
+ search: true,
922
+ entities: true,
923
+ realtimeSync: true,
924
+ batch: false,
925
+ maxBudgetChars: 32e3,
926
+ connectionType: "mcp"
927
+ },
928
+ configSchema: {
929
+ mcpServerUrl: "URL of the MCP Remnic server",
930
+ namespace: "Optional namespace (default: 'default')"
931
+ },
932
+ homepage: "https://claude.ai/code",
933
+ author: "Anthropic",
934
+ tags: ["official", "ai", "claude"],
935
+ requiresToken: true
936
+ },
937
+ {
938
+ id: "codex-cli",
939
+ name: "Codex CLI",
940
+ version: "1.0.0",
941
+ description: "OpenAI Codex CLI \u2014 memory via MCP tool",
942
+ capabilities: {
943
+ observe: true,
944
+ recall: true,
945
+ store: true,
946
+ search: false,
947
+ entities: false,
948
+ realtimeSync: false,
949
+ batch: true,
950
+ maxBudgetChars: 8e3,
951
+ connectionType: "mcp"
952
+ },
953
+ configSchema: {
954
+ mcpServerUrl: "URL of the MCP Remnic server",
955
+ namespace: "Optional namespace"
956
+ },
957
+ homepage: "https://openai.com/codex",
958
+ author: "OpenAI",
959
+ tags: ["official", "ai", "codex"],
960
+ requiresToken: true
961
+ },
962
+ {
963
+ id: "cursor",
964
+ name: "Cursor IDE",
965
+ version: "1.0.0",
966
+ description: "Cursor IDE \u2014 memory via config file + tool calls",
967
+ capabilities: {
968
+ observe: false,
969
+ recall: true,
970
+ store: false,
971
+ search: true,
972
+ entities: false,
973
+ realtimeSync: false,
974
+ batch: false,
975
+ maxBudgetChars: 32e3,
976
+ connectionType: "embedded"
977
+ },
978
+ configSchema: {
979
+ memoryDir: "Path to Remnic memory directory"
980
+ },
981
+ homepage: "https://cursor.com",
982
+ author: "Cursor Inc.",
983
+ tags: ["official", "ide"]
984
+ },
985
+ {
986
+ id: "cline",
987
+ name: "Cline",
988
+ version: "1.0.0",
989
+ description: "VS Code Cline extension \u2014 memory via MCP",
990
+ capabilities: {
991
+ observe: true,
992
+ recall: true,
993
+ store: true,
994
+ search: false,
995
+ entities: false,
996
+ realtimeSync: false,
997
+ batch: true,
998
+ maxBudgetChars: 8e3,
999
+ connectionType: "mcp"
1000
+ },
1001
+ configSchema: {
1002
+ mcpServerUrl: "URL of the MCP Remnic server",
1003
+ namespace: "Optional namespace"
1004
+ },
1005
+ homepage: "https://github.com/cline/cline",
1006
+ author: "Cline",
1007
+ tags: ["community", "vscode"]
1008
+ },
1009
+ {
1010
+ id: "github-copilot",
1011
+ name: "GitHub Copilot",
1012
+ version: "1.0.0",
1013
+ description: "GitHub Copilot \u2014 memory via MCP server",
1014
+ capabilities: {
1015
+ observe: false,
1016
+ recall: true,
1017
+ store: false,
1018
+ search: true,
1019
+ entities: false,
1020
+ realtimeSync: false,
1021
+ batch: false,
1022
+ maxBudgetChars: 16e3,
1023
+ connectionType: "mcp"
1024
+ },
1025
+ configSchema: {
1026
+ mcpServerUrl: "URL of the MCP Remnic server"
1027
+ },
1028
+ homepage: "https://github.com/features/copilot",
1029
+ author: "GitHub",
1030
+ tags: ["official", "ai", "github"]
1031
+ },
1032
+ {
1033
+ id: "roo-code",
1034
+ name: "Roo Code",
1035
+ version: "1.0.0",
1036
+ description: "Roo Code \u2014 memory via MCP",
1037
+ capabilities: {
1038
+ observe: true,
1039
+ recall: true,
1040
+ store: true,
1041
+ search: false,
1042
+ entities: false,
1043
+ realtimeSync: false,
1044
+ batch: true,
1045
+ maxBudgetChars: 16e3,
1046
+ connectionType: "mcp"
1047
+ },
1048
+ configSchema: {
1049
+ mcpServerUrl: "URL of the MCP Remnic server",
1050
+ namespace: "Optional namespace"
1051
+ },
1052
+ homepage: "https://roocode.com",
1053
+ author: "Roo Code",
1054
+ tags: ["community", "vscode"]
1055
+ },
1056
+ {
1057
+ id: "windsurf",
1058
+ name: "Windsurf",
1059
+ version: "1.0.0",
1060
+ description: "Windsurf IDE \u2014 memory via MCP",
1061
+ capabilities: {
1062
+ observe: true,
1063
+ recall: true,
1064
+ store: true,
1065
+ search: true,
1066
+ entities: false,
1067
+ realtimeSync: false,
1068
+ batch: false,
1069
+ maxBudgetChars: 32e3,
1070
+ connectionType: "mcp"
1071
+ },
1072
+ configSchema: {
1073
+ mcpServerUrl: "URL of the MCP Remnic server"
1074
+ },
1075
+ homepage: "https://windsurf.com",
1076
+ author: "Codeium",
1077
+ tags: ["official", "ide"]
1078
+ },
1079
+ {
1080
+ id: "amp",
1081
+ name: "Amp",
1082
+ version: "1.0.0",
1083
+ description: "Amp coding agent \u2014 memory via MCP",
1084
+ capabilities: {
1085
+ observe: true,
1086
+ recall: true,
1087
+ store: true,
1088
+ search: true,
1089
+ entities: false,
1090
+ realtimeSync: false,
1091
+ batch: false,
1092
+ maxBudgetChars: 32e3,
1093
+ connectionType: "mcp"
1094
+ },
1095
+ configSchema: {
1096
+ mcpServerUrl: "URL of the MCP Remnic server"
1097
+ },
1098
+ homepage: "https://ampcode.com",
1099
+ author: "Sourcegraph",
1100
+ tags: ["official", "ai"]
1101
+ },
1102
+ {
1103
+ id: "pi",
1104
+ name: "Pi Coding Agent",
1105
+ version: "1.0.0",
1106
+ description: "Pi Coding Agent \u2014 native extension for recall, observe, MCP tools, and compaction coordination",
1107
+ capabilities: {
1108
+ observe: true,
1109
+ recall: true,
1110
+ store: true,
1111
+ search: true,
1112
+ entities: true,
1113
+ realtimeSync: true,
1114
+ batch: true,
1115
+ maxBudgetChars: 32e3,
1116
+ connectionType: "http"
1117
+ },
1118
+ configSchema: {
1119
+ remnicDaemonUrl: "URL of the Remnic daemon (default: http://127.0.0.1:4318)",
1120
+ namespace: "Optional namespace",
1121
+ installExtension: "Install the Pi extension into ~/.pi/agent/extensions/remnic (default: true)"
1122
+ },
1123
+ homepage: "https://pi.dev",
1124
+ author: "Remnic",
1125
+ tags: ["official", "ai", "pi", "coding-agent"],
1126
+ requiresToken: true
1127
+ },
1128
+ {
1129
+ id: "omp",
1130
+ name: "Oh My Pi (omp)",
1131
+ version: "1.0.0",
1132
+ description: "Oh My Pi (omp) \u2014 Pi-fork coding agent; native extension for recall, observe, MCP tools, and compaction coordination",
1133
+ capabilities: {
1134
+ observe: true,
1135
+ recall: true,
1136
+ store: true,
1137
+ search: true,
1138
+ entities: true,
1139
+ realtimeSync: true,
1140
+ batch: true,
1141
+ maxBudgetChars: 32e3,
1142
+ connectionType: "http"
1143
+ },
1144
+ configSchema: {
1145
+ remnicDaemonUrl: "URL of the Remnic daemon (default: http://127.0.0.1:4318)",
1146
+ namespace: "Optional namespace",
1147
+ installExtension: "Install the omp extension into ~/.omp/agent/extensions/remnic (default: true)"
1148
+ },
1149
+ homepage: "https://omp.sh",
1150
+ author: "Remnic",
1151
+ tags: ["official", "ai", "omp", "pi", "coding-agent"],
1152
+ requiresToken: true
1153
+ },
1154
+ PRIME_AGENT_CONNECTOR_MANIFEST,
1155
+ {
1156
+ id: "replit",
1157
+ name: "Replit Agent",
1158
+ version: "1.0.0",
1159
+ description: "Replit Agent \u2014 memory via HTTP API (reduced capabilities)",
1160
+ capabilities: {
1161
+ observe: true,
1162
+ recall: true,
1163
+ store: true,
1164
+ search: false,
1165
+ entities: false,
1166
+ realtimeSync: false,
1167
+ batch: false,
1168
+ maxBudgetChars: 8e3,
1169
+ connectionType: "http"
1170
+ },
1171
+ configSchema: {
1172
+ apiUrl: "URL of the Remnic HTTP API",
1173
+ authToken: "Bearer token for authentication"
1174
+ },
1175
+ homepage: "https://replit.com",
1176
+ author: "Replit",
1177
+ tags: ["official", "cloud"],
1178
+ requiresToken: true
1179
+ },
1180
+ {
1181
+ id: "generic-mcp",
1182
+ name: "Generic MCP Client",
1183
+ version: "1.0.0",
1184
+ description: "Any MCP-compatible client \u2014 connect via standard MCP protocol",
1185
+ capabilities: {
1186
+ observe: true,
1187
+ recall: true,
1188
+ store: true,
1189
+ search: true,
1190
+ entities: true,
1191
+ realtimeSync: true,
1192
+ batch: true,
1193
+ maxBudgetChars: 64e3,
1194
+ connectionType: "mcp"
1195
+ },
1196
+ configSchema: {
1197
+ mcpServerUrl: "URL of the MCP Remnic server",
1198
+ namespace: "Optional namespace",
1199
+ authToken: "Bearer token for authentication"
1200
+ },
1201
+ homepage: "https://github.com/joshuaswarren/remnic",
1202
+ author: "Remnic",
1203
+ tags: ["generic", "mcp"],
1204
+ requiresToken: true
1205
+ },
1206
+ {
1207
+ id: "weclone",
1208
+ name: "WeClone Avatar",
1209
+ version: "1.0.0",
1210
+ description: "Memory-aware OpenAI-compatible proxy for deployed WeClone avatars \u2014 injects Remnic recall into chat completions and buffers turns via observe",
1211
+ capabilities: {
1212
+ observe: true,
1213
+ recall: true,
1214
+ store: false,
1215
+ search: false,
1216
+ entities: false,
1217
+ realtimeSync: false,
1218
+ batch: false,
1219
+ maxBudgetChars: 32e3,
1220
+ connectionType: "http"
1221
+ },
1222
+ configSchema: {
1223
+ wecloneApiUrl: "Base URL of the WeClone OpenAI-compatible API (e.g. http://localhost:8000/v1)",
1224
+ proxyPort: "Local port where the memory proxy will listen (default 8100)",
1225
+ remnicDaemonUrl: "URL of the Remnic daemon exposing /engram/v1/recall and /engram/v1/observe",
1226
+ sessionStrategy: "Per-caller session mapping strategy: 'caller-id' | 'single'",
1227
+ wecloneModelName: "Optional fine-tuned model name passed through to WeClone"
1228
+ },
1229
+ homepage: "https://github.com/xming521/weclone",
1230
+ author: "Remnic",
1231
+ tags: ["official", "ai", "weclone", "proxy"],
1232
+ requiresToken: true
1233
+ },
1234
+ {
1235
+ id: "hermes",
1236
+ name: "Hermes Agent",
1237
+ version: "1.0.0",
1238
+ description: "Hermes Agent MemoryProvider \u2014 automatic recall/observe on every turn via Python plugin protocol",
1239
+ capabilities: {
1240
+ observe: true,
1241
+ recall: true,
1242
+ store: true,
1243
+ search: true,
1244
+ entities: false,
1245
+ realtimeSync: true,
1246
+ batch: false,
1247
+ maxBudgetChars: 32e3,
1248
+ connectionType: "http"
1249
+ },
1250
+ configSchema: {
1251
+ host: "Remnic daemon host (default: 127.0.0.1)",
1252
+ port: "Remnic daemon port (default: 4318)",
1253
+ profile: "Hermes profile name (default: default)"
1254
+ },
1255
+ homepage: "https://github.com/joshuaswarren/remnic/tree/main/packages/plugin-hermes",
1256
+ author: "Remnic",
1257
+ tags: ["official", "python", "hermes"],
1258
+ requiresToken: true
1259
+ },
1260
+ DROID_CONNECTOR_MANIFEST
1261
+ ];
1262
+ var CONNECTOR_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
1263
+ function isValidConnectorId(connectorId) {
1264
+ return typeof connectorId === "string" && CONNECTOR_ID_PATTERN.test(connectorId);
1265
+ }
1266
+ function isConnectorManifest(value) {
1267
+ return typeof value === "object" && value !== null && !Array.isArray(value) && isValidConnectorId(value.id);
1268
+ }
1269
+ function loadRegistry() {
1270
+ const regPath = getRegistryPath();
1271
+ if (!fs4.existsSync(regPath)) {
1272
+ const registry = {
1273
+ connectors: BUILTIN_CONNECTORS,
1274
+ registryPath: regPath
1275
+ };
1276
+ saveRegistry(registry);
1277
+ return registry;
1278
+ }
1279
+ try {
1280
+ const raw = fs4.readFileSync(regPath, "utf8");
1281
+ const parsed = JSON.parse(raw);
1282
+ if (typeof parsed !== "object" || parsed === null || !Array.isArray(parsed.connectors)) {
1283
+ throw new Error("invalid registry schema");
1284
+ }
1285
+ const builtinIds = new Set(BUILTIN_CONNECTORS.map((b) => b.id));
1286
+ const customOnly = parsed.connectors.filter(
1287
+ (c) => isConnectorManifest(c) && !builtinIds.has(c.id)
1288
+ );
1289
+ const merged = [...BUILTIN_CONNECTORS, ...customOnly];
1290
+ return {
1291
+ connectors: merged,
1292
+ registryPath: regPath
1293
+ };
1294
+ } catch {
1295
+ return {
1296
+ connectors: BUILTIN_CONNECTORS,
1297
+ registryPath: regPath
1298
+ };
1299
+ }
1300
+ }
1301
+ function saveRegistry(registry) {
1302
+ const regPath = registry.registryPath;
1303
+ fs4.mkdirSync(path4.dirname(regPath), { recursive: true });
1304
+ fs4.writeFileSync(regPath, JSON.stringify({ connectors: registry.connectors }, null, 2));
1305
+ }
1306
+ function listConnectors() {
1307
+ const registry = loadRegistry();
1308
+ const connectorsDir = getConnectorsDir();
1309
+ const installedIds = /* @__PURE__ */ new Set();
1310
+ if (fs4.existsSync(connectorsDir)) {
1311
+ for (const entry of fs4.readdirSync(connectorsDir)) {
1312
+ if (entry.endsWith(".json")) {
1313
+ try {
1314
+ const config = JSON.parse(
1315
+ fs4.readFileSync(path4.join(connectorsDir, entry), "utf8")
1316
+ );
1317
+ if (isValidConnectorId(config.connectorId)) {
1318
+ installedIds.add(config.connectorId);
1319
+ }
1320
+ } catch {
1321
+ }
1322
+ }
1323
+ }
1324
+ }
1325
+ const available = registry.connectors.map((manifest) => ({
1326
+ ...manifest,
1327
+ installed: installedIds.has(manifest.id)
1328
+ }));
1329
+ const installed = [];
1330
+ for (const id of installedIds) {
1331
+ const configPath = path4.join(connectorsDir, `${id}.json`);
1332
+ try {
1333
+ const raw = JSON.parse(fs4.readFileSync(configPath, "utf8"));
1334
+ const { token: _redacted, ...config } = raw;
1335
+ installed.push({
1336
+ connectorId: id,
1337
+ config,
1338
+ status: "installed",
1339
+ installedAt: raw.installedAt
1340
+ });
1341
+ } catch {
1342
+ }
1343
+ }
1344
+ return { installed, available };
1345
+ }
1346
+ function getConnectorToken(connectorId) {
1347
+ if (!isValidConnectorId(connectorId)) {
1348
+ return void 0;
1349
+ }
1350
+ try {
1351
+ return loadTokenStore().tokens.find((t) => t.connector === connectorId)?.token;
1352
+ } catch {
1353
+ return void 0;
1354
+ }
1355
+ }
1356
+ function readSavedConnectorConfig(configPath) {
1357
+ if (!fs4.existsSync(configPath)) return {};
1358
+ try {
1359
+ const parsed = JSON.parse(fs4.readFileSync(configPath, "utf8"));
1360
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
1361
+ const {
1362
+ connectorId: _connectorId,
1363
+ installedAt: _installedAt,
1364
+ token: _token,
1365
+ ...config
1366
+ } = parsed;
1367
+ return config;
1368
+ } catch {
1369
+ return {};
1370
+ }
1371
+ }
1372
+ function removeClearedSavedConnectorConfig(savedConnectorConfig, rawUserConfig) {
1373
+ const merged = { ...savedConnectorConfig };
1374
+ for (const [key, value] of Object.entries(rawUserConfig)) {
1375
+ if (value === void 0 || value === null || value === "") {
1376
+ delete merged[key];
1377
+ }
1378
+ }
1379
+ return merged;
1380
+ }
1381
+ function compactConnectorConfigOverrides(rawUserConfig) {
1382
+ const safeUserConfig = {};
1383
+ for (const [key, value] of Object.entries(rawUserConfig)) {
1384
+ if (value === void 0 || value === null || value === "") continue;
1385
+ safeUserConfig[key] = value;
1386
+ }
1387
+ return safeUserConfig;
1388
+ }
1389
+ function installConnector(options) {
1390
+ if (!isValidConnectorId(options.connectorId)) {
1391
+ return {
1392
+ connectorId: options.connectorId,
1393
+ status: "error",
1394
+ message: `Invalid connector ID ${JSON.stringify(options.connectorId)}. Connector IDs must match [A-Za-z0-9][A-Za-z0-9._-]*.`
1395
+ };
1396
+ }
1397
+ const registry = loadRegistry();
1398
+ const manifest = registry.connectors.find((c) => c.id === options.connectorId);
1399
+ if (!manifest) {
1400
+ return {
1401
+ connectorId: options.connectorId,
1402
+ status: "error",
1403
+ message: `Unknown connector: ${options.connectorId}`
1404
+ };
1405
+ }
1406
+ const existing = listConnectors().installed.find(
1407
+ (c) => c.connectorId === options.connectorId
1408
+ );
1409
+ if (existing && !options.force) {
1410
+ let backfillNote = "";
1411
+ if (options.connectorId === "hermes") {
1412
+ try {
1413
+ const hermesJsonPath = path4.join(getConnectorsDir(), "hermes.json");
1414
+ let parsed = null;
1415
+ try {
1416
+ const parsedRaw = JSON.parse(fs4.readFileSync(hermesJsonPath, "utf8"));
1417
+ if (parsedRaw !== null && typeof parsedRaw === "object" && !Array.isArray(parsedRaw)) {
1418
+ parsed = parsedRaw;
1419
+ }
1420
+ } catch {
1421
+ }
1422
+ const priorRaw = parsed?.pluginShimPath;
1423
+ const priorPersisted = typeof priorRaw === "string" && priorRaw.length > 0 ? priorRaw : null;
1424
+ const profileRaw = parsed?.profile;
1425
+ let currentConfigPath = null;
1426
+ let activeConfigHasBlock = false;
1427
+ let configResolutionError = null;
1428
+ try {
1429
+ currentConfigPath = hermesConfigPath(
1430
+ typeof profileRaw === "string" && profileRaw.length > 0 ? profileRaw : "default"
1431
+ );
1432
+ activeConfigHasBlock = fs4.existsSync(currentConfigPath) && /^remnic:/m.test(fs4.readFileSync(currentConfigPath, "utf8"));
1433
+ } catch (resolveErr) {
1434
+ configResolutionError = resolveErr instanceof Error ? resolveErr.message : String(resolveErr);
1435
+ activeConfigHasBlock = false;
1436
+ }
1437
+ if (!activeConfigHasBlock) {
1438
+ backfillNote = configResolutionError ? ` Note: could not resolve the active Hermes home (${configResolutionError}) \u2014 skipped the shim backfill. Fix the HERMES_HOME/profile configuration and re-run.` : " Note: the active Hermes home's config.yaml has no remnic: block \u2014 skipped the shim backfill so Hermes cannot discover an unconfigured provider. If Hermes was installed under a different HERMES_HOME, re-run with --force to rewrite the config (and token) and migrate the shim under the current home.";
1439
+ return {
1440
+ connectorId: options.connectorId,
1441
+ status: "already_installed",
1442
+ message: `Already installed. Use --force to reinstall.${backfillNote}`
1443
+ };
1444
+ }
1445
+ const outcome = reconcileHermesShim(priorPersisted);
1446
+ if (outcome.notes.length > 0) {
1447
+ backfillNote = ` ${outcome.notes.join(" ")}`;
1448
+ }
1449
+ let configProvenanceAdded = false;
1450
+ if (parsed !== null && currentConfigPath !== null && (typeof parsed.hermesConfigPath !== "string" || parsed.hermesConfigPath.length === 0)) {
1451
+ parsed.hermesConfigPath = currentConfigPath;
1452
+ configProvenanceAdded = true;
1453
+ }
1454
+ let shimPriorsChanged = false;
1455
+ const cleanedInheritedBackfillShims = [];
1456
+ if (parsed !== null) {
1457
+ const shimPriorCandidates = [];
1458
+ if (priorPersisted !== null) {
1459
+ shimPriorCandidates.push(priorPersisted);
1460
+ }
1461
+ if (Array.isArray(parsed.priorPluginShimPaths)) {
1462
+ for (const entry of parsed.priorPluginShimPaths) {
1463
+ if (typeof entry === "string" && entry.length > 0) {
1464
+ shimPriorCandidates.push(entry);
1465
+ }
1466
+ }
1467
+ }
1468
+ if (outcome.materializedAt !== null && shimPriorCandidates.length > 0) {
1469
+ const cleanupTargets = shimPriorCandidates.filter(
1470
+ (candidate) => outcome.persistPath === null || !sameShimTarget(candidate, outcome.persistPath)
1471
+ );
1472
+ if (cleanupTargets.length > 0) {
1473
+ try {
1474
+ const cleaned = removeHermesShim(cleanupTargets);
1475
+ cleanedInheritedBackfillShims.push(...cleaned.removedPaths);
1476
+ } catch {
1477
+ }
1478
+ }
1479
+ }
1480
+ const survivingShims = survivingMarkerShims(shimPriorCandidates, outcome.persistPath);
1481
+ const persistedShimPriors = Array.isArray(parsed.priorPluginShimPaths) ? parsed.priorPluginShimPaths : null;
1482
+ shimPriorsChanged = persistedShimPriors === null ? survivingShims.length > 0 : persistedShimPriors.length !== survivingShims.length || survivingShims.some((entry, index) => persistedShimPriors[index] !== entry);
1483
+ if (survivingShims.length > 0) {
1484
+ parsed.priorPluginShimPaths = survivingShims;
1485
+ } else {
1486
+ delete parsed.priorPluginShimPaths;
1487
+ }
1488
+ }
1489
+ const shimPathChanged = parsed !== null && outcome.persistPath !== null && parsed.pluginShimPath !== outcome.persistPath;
1490
+ if (parsed !== null && (shimPathChanged || configProvenanceAdded || shimPriorsChanged)) {
1491
+ if (outcome.persistPath !== null) {
1492
+ parsed.pluginShimPath = outcome.persistPath;
1493
+ }
1494
+ try {
1495
+ writeSecretFileSync2(hermesJsonPath, JSON.stringify(parsed, null, 2));
1496
+ } catch (persistErr) {
1497
+ const rollbackFailures = [];
1498
+ if (outcome.materializedAt !== null && outcome.createdNew && (priorPersisted === null || !sameShimTarget(outcome.materializedAt, priorPersisted))) {
1499
+ try {
1500
+ removeHermesShim([outcome.materializedAt]);
1501
+ } catch {
1502
+ rollbackFailures.push(`remove ${outcome.materializedAt} manually`);
1503
+ }
1504
+ }
1505
+ if (outcome.priorCleanedAt !== null) {
1506
+ try {
1507
+ materializeHermesShim(outcome.priorCleanedAt);
1508
+ } catch {
1509
+ rollbackFailures.push(`restore the shim at ${outcome.priorCleanedAt} manually`);
1510
+ }
1511
+ }
1512
+ for (const cleanedPath of cleanedInheritedBackfillShims) {
1513
+ if (outcome.priorCleanedAt !== null && sameShimTarget(cleanedPath, outcome.priorCleanedAt)) {
1514
+ continue;
1515
+ }
1516
+ try {
1517
+ materializeHermesShim(cleanedPath);
1518
+ } catch {
1519
+ rollbackFailures.push(`restore the shim at ${cleanedPath} manually`);
1520
+ }
1521
+ }
1522
+ const persistMsg = persistErr instanceof Error ? persistErr.message : String(persistErr);
1523
+ backfillNote = rollbackFailures.length === 0 ? ` Note: could not persist the shim path (${persistMsg}); shim changes were rolled back.` : ` Note: could not persist the shim path (${persistMsg}) and rollback was incomplete \u2014 ${rollbackFailures.join("; ")}.`;
1524
+ }
1525
+ }
1526
+ } catch {
1527
+ }
1528
+ }
1529
+ return {
1530
+ connectorId: options.connectorId,
1531
+ status: "already_installed",
1532
+ message: `Already installed. Use --force to reinstall.${backfillNote}`
1533
+ };
1534
+ }
1535
+ const configDir = getConnectorsDir();
1536
+ fs4.mkdirSync(configDir, { recursive: true });
1537
+ const configPath = path4.join(configDir, `${options.connectorId}.json`);
1538
+ const savedConnectorConfig = existing ? readSavedConnectorConfig(configPath) : {};
1539
+ let hermesSavedProfile;
1540
+ let hermesSavedHost;
1541
+ let hermesSavedPort;
1542
+ let hermesSavedAllowInsecureHttp;
1543
+ let hermesResolvedProfile;
1544
+ let hermesResolvedHost;
1545
+ let hermesResolvedPort;
1546
+ let hermesResolvedAllowInsecureHttp = false;
1547
+ if (options.connectorId === "hermes") {
1548
+ if (fs4.existsSync(configPath)) {
1549
+ try {
1550
+ const prev = JSON.parse(fs4.readFileSync(configPath, "utf8"));
1551
+ if (prev?.profile != null) {
1552
+ try {
1553
+ hermesSavedProfile = sanitizeHermesProfile(String(prev.profile));
1554
+ } catch {
1555
+ }
1556
+ }
1557
+ if (prev?.host != null) {
1558
+ try {
1559
+ hermesSavedHost = sanitizeHermesHost(String(prev.host));
1560
+ } catch {
1561
+ }
1562
+ }
1563
+ if (prev?.port != null) {
1564
+ try {
1565
+ const coercedPort = Number(String(prev.port));
1566
+ hermesSavedPort = sanitizeHermesPort(coercedPort);
1567
+ } catch {
1568
+ }
1569
+ }
1570
+ if (prev?.allow_insecure_http != null) {
1571
+ hermesSavedAllowInsecureHttp = coerceBool(prev.allow_insecure_http, "allow_insecure_http");
1572
+ }
1573
+ } catch {
1574
+ }
1575
+ }
1576
+ hermesResolvedProfile = hermesSavedProfile ?? "default";
1577
+ hermesResolvedHost = hermesSavedHost ?? "127.0.0.1";
1578
+ hermesResolvedAllowInsecureHttp = hermesSavedAllowInsecureHttp ?? false;
1579
+ if (options.config?.port !== void 0) {
1580
+ try {
1581
+ hermesResolvedPort = sanitizeHermesPort(Number(String(options.config.port)));
1582
+ } catch (err) {
1583
+ return {
1584
+ connectorId: options.connectorId,
1585
+ status: "error",
1586
+ message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
1587
+ };
1588
+ }
1589
+ }
1590
+ if (hermesResolvedPort === void 0) {
1591
+ hermesResolvedPort = hermesSavedPort ?? 4318;
1592
+ }
1593
+ if (options.config?.profile !== void 0) {
1594
+ try {
1595
+ hermesResolvedProfile = sanitizeHermesProfile(String(options.config.profile));
1596
+ } catch (err) {
1597
+ return {
1598
+ connectorId: options.connectorId,
1599
+ status: "error",
1600
+ message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
1601
+ };
1602
+ }
1603
+ }
1604
+ if (options.config?.host !== void 0) {
1605
+ try {
1606
+ hermesResolvedHost = sanitizeHermesHost(String(options.config.host));
1607
+ } catch (err) {
1608
+ return {
1609
+ connectorId: options.connectorId,
1610
+ status: "error",
1611
+ message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
1612
+ };
1613
+ }
1614
+ }
1615
+ if (options.config?.allow_insecure_http !== void 0) {
1616
+ const allowInsecureHttp = coerceBool(options.config.allow_insecure_http, "allow_insecure_http");
1617
+ if (allowInsecureHttp === void 0) {
1618
+ return {
1619
+ connectorId: options.connectorId,
1620
+ status: "error",
1621
+ message: "Invalid Hermes config: allow_insecure_http must be true or false"
1622
+ };
1623
+ }
1624
+ hermesResolvedAllowInsecureHttp = allowInsecureHttp;
1625
+ }
1626
+ }
1627
+ const nonHermesPriorTokenStore = options.connectorId !== "hermes" && manifest.requiresToken ? loadTokenStore() : null;
1628
+ let tokenEntry = null;
1629
+ if (options.connectorId === "hermes") {
1630
+ try {
1631
+ tokenEntry = buildTokenEntry(options.connectorId);
1632
+ } catch {
1633
+ }
1634
+ } else if (manifest.requiresToken) {
1635
+ try {
1636
+ tokenEntry = generateToken(options.connectorId);
1637
+ } catch {
1638
+ if (nonHermesPriorTokenStore !== null) {
1639
+ try {
1640
+ saveTokenStore(nonHermesPriorTokenStore);
1641
+ } catch {
1642
+ }
1643
+ }
1644
+ }
1645
+ }
1646
+ if (options.connectorId !== "hermes" && manifest.requiresToken && tokenEntry === null) {
1647
+ return {
1648
+ connectorId: options.connectorId,
1649
+ status: "error",
1650
+ message: `${manifest.name} install aborted: token generation failed. Run \`remnic token generate ${options.connectorId}\` to create the token, then reinstall.`
1651
+ };
1652
+ }
1653
+ const { token: _callerToken, ...rawUserConfig } = options.config ?? {};
1654
+ const savedConnectorConfigForMerge = removeClearedSavedConnectorConfig(savedConnectorConfig, rawUserConfig);
1655
+ const safeUserConfig = compactConnectorConfigOverrides(rawUserConfig);
1656
+ const resolvedConfig = {
1657
+ ...savedConnectorConfigForMerge,
1658
+ ...safeUserConfig,
1659
+ connectorId: options.connectorId,
1660
+ installedAt: (/* @__PURE__ */ new Date()).toISOString(),
1661
+ // For hermes, always overlay the sanitized/coerced resolved values so that
1662
+ // the connector JSON always has a numeric port and validated profile/host.
1663
+ // This also ensures options.config string values (from --config=port=5555)
1664
+ // are replaced with their sanitized numeric equivalents (Fix 2 root cause).
1665
+ ...hermesResolvedProfile !== void 0 ? {
1666
+ profile: hermesResolvedProfile,
1667
+ host: hermesResolvedHost,
1668
+ port: hermesResolvedPort,
1669
+ allow_insecure_http: hermesResolvedAllowInsecureHttp
1670
+ } : {}
1671
+ };
1672
+ if (options.connectorId === "hermes") {
1673
+ const rawProfile = hermesResolvedProfile;
1674
+ const hermesHost = hermesResolvedHost;
1675
+ const hermesPort = hermesResolvedPort;
1676
+ let hermesProfile;
1677
+ try {
1678
+ hermesProfile = sanitizeHermesProfile(rawProfile);
1679
+ } catch (err) {
1680
+ return {
1681
+ connectorId: options.connectorId,
1682
+ status: "error",
1683
+ message: `Hermes install aborted: ${err instanceof Error ? err.message : String(err)}`
1684
+ };
1685
+ }
1686
+ if (!tokenEntry) {
1687
+ return {
1688
+ connectorId: options.connectorId,
1689
+ status: "error",
1690
+ message: "Hermes install aborted: token store unavailable. Run `remnic token generate hermes` then reinstall to complete setup."
1691
+ };
1692
+ }
1693
+ {
1694
+ const envHermesHome = readEnvVar("HERMES_HOME");
1695
+ if (typeof envHermesHome === "string" && envHermesHome.trim().length > 0) {
1696
+ try {
1697
+ fs4.mkdirSync(path4.dirname(hermesConfigPath(hermesProfile)), { recursive: true });
1698
+ } catch {
1699
+ }
1700
+ }
1701
+ }
1702
+ let yamlResult;
1703
+ try {
1704
+ yamlResult = upsertHermesConfig({
1705
+ profile: hermesProfile,
1706
+ host: hermesHost,
1707
+ port: hermesPort,
1708
+ token: tokenEntry.token,
1709
+ allowInsecureHttp: hermesResolvedAllowInsecureHttp
1710
+ });
1711
+ } catch (err) {
1712
+ return {
1713
+ connectorId: options.connectorId,
1714
+ status: "error",
1715
+ message: `Hermes install aborted: config.yaml write failed \u2014 ${err instanceof Error ? err.message : String(err)}`
1716
+ };
1717
+ }
1718
+ if (!yamlResult.updated) {
1719
+ return {
1720
+ connectorId: options.connectorId,
1721
+ status: "error",
1722
+ message: `Hermes install aborted: ${yamlResult.reason ?? "config.yaml not written"}. Create the Hermes profile directory first, then reinstall.`
1723
+ };
1724
+ }
1725
+ const priorTokenStore = loadTokenStore();
1726
+ let committed = false;
1727
+ try {
1728
+ commitTokenEntry(tokenEntry);
1729
+ committed = true;
1730
+ } catch (commitErr) {
1731
+ let tokensRolledBack = true;
1732
+ let tokensRollbackErrMsg = "";
1733
+ try {
1734
+ saveTokenStore(priorTokenStore);
1735
+ } catch (tokenRestoreErr) {
1736
+ tokensRolledBack = false;
1737
+ tokensRollbackErrMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
1738
+ }
1739
+ let yamlRolledBack = true;
1740
+ let yamlRollbackErrMsg = "";
1741
+ try {
1742
+ if (yamlResult.priorContent === null) {
1743
+ fs4.unlinkSync(yamlResult.configPath);
1744
+ } else if (typeof yamlResult.priorContent === "string") {
1745
+ writeSecretFileSync2(yamlResult.configPath, yamlResult.priorContent);
1746
+ }
1747
+ } catch (yamlRestoreErr) {
1748
+ yamlRolledBack = false;
1749
+ yamlRollbackErrMsg = yamlRestoreErr instanceof Error ? yamlRestoreErr.message : String(yamlRestoreErr);
1750
+ }
1751
+ const commitErrMsg = commitErr instanceof Error ? commitErr.message : String(commitErr);
1752
+ let message;
1753
+ if (tokensRolledBack && yamlRolledBack) {
1754
+ message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. config.yaml and tokens.json restored to prior state. Resolve the tokens.json access issue, then reinstall.`;
1755
+ } else if (!yamlRolledBack && tokensRolledBack) {
1756
+ message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. tokens.json restored but config.yaml rollback ALSO failed (${yamlRollbackErrMsg}). Hermes daemon may be in an inconsistent state: config references a stale token. Manually inspect ${yamlResult.configPath} and reinstall.`;
1757
+ } else if (yamlRolledBack && !tokensRolledBack) {
1758
+ message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. config.yaml restored but tokens.json rollback ALSO failed (${tokensRollbackErrMsg}). Hermes daemon may be in an inconsistent state: tokens.json is corrupt or incomplete. Manually inspect ~/.remnic/tokens.json and reinstall.`;
1759
+ } else {
1760
+ message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. BOTH rollbacks failed: config.yaml rollback failed (${yamlRollbackErrMsg}); tokens.json rollback failed (${tokensRollbackErrMsg}). Hermes daemon is likely in an inconsistent state. Manually inspect ${yamlResult.configPath} and ~/.remnic/tokens.json, then reinstall.`;
1761
+ }
1762
+ return {
1763
+ connectorId: options.connectorId,
1764
+ status: "error",
1765
+ message
1766
+ };
1767
+ }
1768
+ const priorShimPathRaw = savedConnectorConfig.pluginShimPath;
1769
+ const shimOutcome = reconcileHermesShim(
1770
+ typeof priorShimPathRaw === "string" && priorShimPathRaw.length > 0 ? priorShimPathRaw : null
1771
+ );
1772
+ if (shimOutcome.persistPath !== null) {
1773
+ resolvedConfig.pluginShimPath = shimOutcome.persistPath;
1774
+ }
1775
+ const cleanedInheritedShims = [];
1776
+ {
1777
+ const shimPriorCandidates = [];
1778
+ if (typeof priorShimPathRaw === "string" && priorShimPathRaw.length > 0) {
1779
+ shimPriorCandidates.push(priorShimPathRaw);
1780
+ }
1781
+ const inheritedShimPriorsRaw = savedConnectorConfig.priorPluginShimPaths;
1782
+ if (Array.isArray(inheritedShimPriorsRaw)) {
1783
+ for (const entry of inheritedShimPriorsRaw) {
1784
+ if (typeof entry === "string" && entry.length > 0) {
1785
+ shimPriorCandidates.push(entry);
1786
+ }
1787
+ }
1788
+ }
1789
+ if (shimOutcome.materializedAt !== null && shimPriorCandidates.length > 0) {
1790
+ const cleanupTargets = shimPriorCandidates.filter(
1791
+ (candidate) => shimOutcome.persistPath === null || !sameShimTarget(candidate, shimOutcome.persistPath)
1792
+ );
1793
+ if (cleanupTargets.length > 0) {
1794
+ try {
1795
+ const cleaned = removeHermesShim(cleanupTargets);
1796
+ cleanedInheritedShims.push(...cleaned.removedPaths);
1797
+ } catch {
1798
+ }
1799
+ }
1800
+ }
1801
+ const survivingShims = survivingMarkerShims(shimPriorCandidates, shimOutcome.persistPath);
1802
+ if (survivingShims.length > 0) {
1803
+ resolvedConfig.priorPluginShimPaths = survivingShims;
1804
+ } else {
1805
+ delete resolvedConfig.priorPluginShimPaths;
1806
+ }
1807
+ }
1808
+ resolvedConfig.hermesConfigPath = yamlResult.configPath;
1809
+ const hermesPriorNotes = [];
1810
+ const priorConfigPathRaw = savedConnectorConfig.hermesConfigPath;
1811
+ const priorConfigPath = typeof priorConfigPathRaw === "string" && priorConfigPathRaw.length > 0 ? priorConfigPathRaw : null;
1812
+ const priorConfigDiffers = priorConfigPath !== null && !sameHermesConfigTarget(priorConfigPath, yamlResult.configPath);
1813
+ const hermesPriorConfigMutations = [];
1814
+ if (priorConfigDiffers && priorConfigPath !== null && shimOutcome.materializedAt === null) {
1815
+ let fallbackDetail = "";
1816
+ if (isPlausibleHermesConfigPath(priorConfigPath)) {
1817
+ try {
1818
+ const beforeRefresh = fs4.readFileSync(priorConfigPath, "utf8");
1819
+ const refresh = upsertHermesConfigAt(priorConfigPath, {
1820
+ host: hermesHost,
1821
+ port: hermesPort,
1822
+ token: tokenEntry.token,
1823
+ allowInsecureHttp: hermesResolvedAllowInsecureHttp
1824
+ });
1825
+ if (refresh.updated) {
1826
+ hermesPriorConfigMutations.push({ mutatedPath: priorConfigPath, priorContent: beforeRefresh });
1827
+ }
1828
+ fallbackDetail = refresh.updated ? " Its remnic: block was refreshed with the newly-issued token so it keeps working." : ` Note: its token could not be refreshed (${refresh.reason ?? "config not writable"}) \u2014 re-run install with HERMES_HOME pointing there to restore daemon auth.`;
1829
+ } catch (refreshErr) {
1830
+ fallbackDetail = ` Note: its token could not be refreshed (${refreshErr instanceof Error ? refreshErr.message : String(refreshErr)}) \u2014 re-run install with HERMES_HOME pointing there to restore daemon auth.`;
1831
+ }
1832
+ } else {
1833
+ fallbackDetail = " Note: its token was rotated by this install \u2014 re-run install with HERMES_HOME pointing there to restore daemon auth.";
1834
+ }
1835
+ hermesPriorNotes.push(
1836
+ `Note: left the prior-install Hermes config in place at ${priorConfigPath} \u2014 no Remnic shim could be written under the current Hermes home, so the prior installation remains the working fallback.${fallbackDetail} Resolve the shim collision/failure above and re-run with --force to complete the migration.`
1837
+ );
1838
+ }
1839
+ {
1840
+ const candidates = [];
1841
+ if (priorConfigDiffers && priorConfigPath !== null) {
1842
+ candidates.push(priorConfigPath);
1843
+ }
1844
+ const inheritedArrayRaw = savedConnectorConfig.priorHermesConfigPaths;
1845
+ if (Array.isArray(inheritedArrayRaw)) {
1846
+ for (const entry of inheritedArrayRaw) {
1847
+ if (typeof entry === "string" && entry.length > 0) {
1848
+ candidates.push(entry);
1849
+ }
1850
+ }
1851
+ }
1852
+ const inheritedLegacyRaw = savedConnectorConfig.priorHermesConfigPath;
1853
+ if (typeof inheritedLegacyRaw === "string" && inheritedLegacyRaw.length > 0) {
1854
+ candidates.push(inheritedLegacyRaw);
1855
+ }
1856
+ if (shimOutcome.materializedAt !== null) {
1857
+ for (const candidate of candidates) {
1858
+ if (sameHermesConfigTarget(candidate, yamlResult.configPath)) {
1859
+ continue;
1860
+ }
1861
+ if (!isPlausibleHermesConfigPath(candidate)) {
1862
+ continue;
1863
+ }
1864
+ try {
1865
+ const beforeCleanup = fs4.readFileSync(candidate, "utf8");
1866
+ const cleanup = removeHermesConfigFile(candidate);
1867
+ if (cleanup.updated) {
1868
+ hermesPriorConfigMutations.push({ mutatedPath: candidate, priorContent: beforeCleanup });
1869
+ hermesPriorNotes.push(`Cleaned remnic: block from prior-install Hermes config: ${candidate}`);
1870
+ }
1871
+ } catch {
1872
+ hermesPriorNotes.push(
1873
+ `Note: could not clean the remnic: block from the prior-install Hermes config at ${candidate} \u2014 remove it manually.`
1874
+ );
1875
+ }
1876
+ }
1877
+ }
1878
+ const survivingPriors = [];
1879
+ for (const candidate of candidates) {
1880
+ if (sameHermesConfigTarget(candidate, yamlResult.configPath)) {
1881
+ continue;
1882
+ }
1883
+ if (survivingPriors.some((kept) => sameHermesConfigTarget(kept, candidate))) {
1884
+ continue;
1885
+ }
1886
+ let blockSurvives = false;
1887
+ try {
1888
+ blockSurvives = /^remnic:/m.test(fs4.readFileSync(candidate, "utf8"));
1889
+ } catch {
1890
+ blockSurvives = false;
1891
+ }
1892
+ if (blockSurvives) {
1893
+ survivingPriors.push(candidate);
1894
+ }
1895
+ }
1896
+ if (survivingPriors.length > 0) {
1897
+ resolvedConfig.priorHermesConfigPaths = survivingPriors;
1898
+ } else {
1899
+ delete resolvedConfig.priorHermesConfigPaths;
1900
+ }
1901
+ delete resolvedConfig.priorHermesConfigPath;
1902
+ }
1903
+ try {
1904
+ writeSecretFileSync2(configPath, JSON.stringify(resolvedConfig, null, 2));
1905
+ } catch (writeErr) {
1906
+ let tokenRollbackFailed = false;
1907
+ let tokenRollbackMsg = "token store restored to pre-install snapshot";
1908
+ try {
1909
+ saveTokenStore(priorTokenStore);
1910
+ } catch (tokenRestoreErr) {
1911
+ tokenRollbackFailed = true;
1912
+ tokenRollbackMsg = `token rollback failed: ${tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr)}`;
1913
+ }
1914
+ let yamlRollbackMsg = "config.yaml restored";
1915
+ try {
1916
+ if (yamlResult.priorContent === null) {
1917
+ let unlinkSucceeded = false;
1918
+ let unlinkErr;
1919
+ try {
1920
+ fs4.unlinkSync(yamlResult.configPath);
1921
+ unlinkSucceeded = true;
1922
+ } catch (err) {
1923
+ unlinkErr = err;
1924
+ }
1925
+ if (unlinkSucceeded) {
1926
+ yamlRollbackMsg = "config.yaml removed (was newly created)";
1927
+ } else {
1928
+ const unlinkMsg = unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr);
1929
+ yamlRollbackMsg = `config.yaml rollback failed: could not remove newly-created file \u2014 ${unlinkMsg}`;
1930
+ }
1931
+ } else if (typeof yamlResult.priorContent === "string") {
1932
+ writeSecretFileSync2(yamlResult.configPath, yamlResult.priorContent);
1933
+ yamlRollbackMsg = "config.yaml restored to prior content";
1934
+ }
1935
+ } catch (yamlRollbackErr) {
1936
+ yamlRollbackMsg = `config.yaml rollback failed: ${yamlRollbackErr instanceof Error ? yamlRollbackErr.message : String(yamlRollbackErr)}`;
1937
+ }
1938
+ let shimRollbackMsg = "no shim changes to roll back";
1939
+ const shimRollbackFailures = [];
1940
+ const priorPersisted = typeof priorShimPathRaw === "string" && priorShimPathRaw.length > 0 ? priorShimPathRaw : null;
1941
+ if (shimOutcome.materializedAt !== null && shimOutcome.createdNew && (priorPersisted === null || !sameShimTarget(shimOutcome.materializedAt, priorPersisted))) {
1942
+ try {
1943
+ removeHermesShim([shimOutcome.materializedAt]);
1944
+ } catch (err) {
1945
+ shimRollbackFailures.push(
1946
+ `could not remove the newly-written shim at ${shimOutcome.materializedAt} (${err instanceof Error ? err.message : String(err)})`
1947
+ );
1948
+ }
1949
+ }
1950
+ if (shimOutcome.priorCleanedAt !== null) {
1951
+ try {
1952
+ materializeHermesShim(shimOutcome.priorCleanedAt);
1953
+ } catch (err) {
1954
+ shimRollbackFailures.push(
1955
+ `could not restore the prior shim at ${shimOutcome.priorCleanedAt} (${err instanceof Error ? err.message : String(err)})`
1956
+ );
1957
+ }
1958
+ }
1959
+ for (const cleanedPath of cleanedInheritedShims) {
1960
+ if (shimOutcome.priorCleanedAt !== null && sameShimTarget(cleanedPath, shimOutcome.priorCleanedAt)) {
1961
+ continue;
1962
+ }
1963
+ try {
1964
+ materializeHermesShim(cleanedPath);
1965
+ } catch (err) {
1966
+ shimRollbackFailures.push(
1967
+ `could not restore the prior shim at ${cleanedPath} (${err instanceof Error ? err.message : String(err)})`
1968
+ );
1969
+ }
1970
+ }
1971
+ if (shimOutcome.materializedAt !== null || shimOutcome.priorCleanedAt !== null || cleanedInheritedShims.length > 0) {
1972
+ shimRollbackMsg = shimRollbackFailures.length === 0 ? "plugin shim changes rolled back" : `plugin shim rollback incomplete: ${shimRollbackFailures.join("; ")}`;
1973
+ }
1974
+ let priorConfigRollbackMsg = "no prior-config changes to roll back";
1975
+ if (hermesPriorConfigMutations.length > 0) {
1976
+ const priorConfigRollbackFailures = [];
1977
+ for (const mutation of [...hermesPriorConfigMutations].reverse()) {
1978
+ try {
1979
+ writeSecretFileSync2(mutation.mutatedPath, mutation.priorContent);
1980
+ } catch (restoreErr) {
1981
+ priorConfigRollbackFailures.push(
1982
+ `could not restore ${mutation.mutatedPath} (${restoreErr instanceof Error ? restoreErr.message : String(restoreErr)})`
1983
+ );
1984
+ }
1985
+ }
1986
+ priorConfigRollbackMsg = priorConfigRollbackFailures.length === 0 ? "prior-install config(s) restored" : `prior-install config rollback incomplete: ${priorConfigRollbackFailures.join("; ")}`;
1987
+ }
1988
+ const urgentSuffix = tokenRollbackFailed ? ` tokens.json may be in an inconsistent state \u2014 manually restore hermes token with 'remnic token generate hermes'.` : "";
1989
+ return {
1990
+ connectorId: options.connectorId,
1991
+ status: "error",
1992
+ message: `Hermes install aborted: connector config write failed \u2014 connector directory may not be writable. Rollback: ${tokenRollbackMsg}; ${yamlRollbackMsg}; ${shimRollbackMsg}; ${priorConfigRollbackMsg}.${urgentSuffix} Resolve the permission issue, then reinstall.`
1993
+ };
1994
+ }
1995
+ const notes = [];
1996
+ notes.push(`Updated Hermes config: ${yamlResult.configPath}`);
1997
+ notes.push(...shimOutcome.notes);
1998
+ notes.push(...hermesPriorNotes);
1999
+ notes.push(
2000
+ "Next step: set `memory.provider: remnic` (and `memory_enabled: true`) in your Hermes config.yaml to activate the provider."
2001
+ );
2002
+ if (hermesProfile === "default") {
2003
+ const legacyDefaultConfigPath = hermesDefaultProfileConfigPath();
2004
+ if (!sameHermesConfigTarget(yamlResult.configPath, legacyDefaultConfigPath)) {
2005
+ try {
2006
+ const legacyDefaultCleanResult = removeHermesConfigFile(legacyDefaultConfigPath);
2007
+ if (legacyDefaultCleanResult.updated) {
2008
+ notes.push(`Cleaned stale remnic: block from legacy default profile: ${legacyDefaultConfigPath}`);
2009
+ }
2010
+ } catch {
2011
+ notes.push("Note: could not clean stale remnic: block from legacy default profile");
2012
+ }
2013
+ }
2014
+ }
2015
+ let oldProfileResolvesToDifferentFile = false;
2016
+ if (hermesSavedProfile !== void 0) {
2017
+ try {
2018
+ oldProfileResolvesToDifferentFile = !sameHermesConfigTarget(hermesConfigPath(hermesSavedProfile), hermesConfigPath(hermesProfile));
2019
+ } catch {
2020
+ oldProfileResolvesToDifferentFile = false;
2021
+ }
2022
+ }
2023
+ if (oldProfileResolvesToDifferentFile) {
2024
+ try {
2025
+ const oldCleanResult = removeHermesConfig({ profile: hermesSavedProfile });
2026
+ if (oldCleanResult.updated) {
2027
+ notes.push(`Cleaned stale remnic: block from previous profile: ${oldCleanResult.configPath}`);
2028
+ }
2029
+ } catch {
2030
+ notes.push(`Note: could not clean stale remnic: block from previous profile "${hermesSavedProfile}"`);
2031
+ }
2032
+ }
2033
+ if (committed && tokenEntry) {
2034
+ const daemonOk = checkDaemonHealth(
2035
+ hermesHost,
2036
+ hermesPort,
2037
+ tokenEntry.token,
2038
+ hermesResolvedAllowInsecureHttp
2039
+ );
2040
+ if (daemonOk) {
2041
+ notes.push("Daemon health check: OK");
2042
+ } else {
2043
+ notes.push(
2044
+ `Daemon not reachable at ${hermesHost}:${hermesPort} \u2014 start with: remnic daemon start`
2045
+ );
2046
+ }
2047
+ }
2048
+ const suffix = notes.length > 0 ? `
2049
+ ${notes.join("\n ")}` : "";
2050
+ return {
2051
+ connectorId: options.connectorId,
2052
+ status: "installed",
2053
+ configPath,
2054
+ message: `Installed ${manifest.name} v${manifest.version}${suffix}`
2055
+ };
2056
+ }
2057
+ let extensionMessage = "";
2058
+ let extensionInstalled = false;
2059
+ let extensionHandle = null;
2060
+ if (options.connectorId === "codex-cli") {
2061
+ const coerced = coerceInstallExtension(resolvedConfig.installExtension);
2062
+ if (coerced !== void 0) {
2063
+ resolvedConfig.installExtension = coerced;
2064
+ }
2065
+ const shouldInstall = resolvedConfig.installExtension !== false;
2066
+ resolvedConfig.installExtension = shouldInstall;
2067
+ const codexHomeOverride = typeof resolvedConfig.codexHome === "string" && resolvedConfig.codexHome.length > 0 ? resolvedConfig.codexHome : null;
2068
+ const resolvedCodexHome = resolveCodexHome(codexHomeOverride);
2069
+ resolvedConfig.codexHome = resolvedCodexHome;
2070
+ if (shouldInstall) {
2071
+ try {
2072
+ const extensionSourceOverride = typeof resolvedConfig.extensionSourceDir === "string" && resolvedConfig.extensionSourceDir.length > 0 ? resolvedConfig.extensionSourceDir : null;
2073
+ const extResult = installCodexMemoryExtension({
2074
+ codexHome: resolvedCodexHome,
2075
+ sourceDir: extensionSourceOverride
2076
+ });
2077
+ extensionMessage = ` (memory extension: ${extResult.remnicExtensionDir})`;
2078
+ extensionInstalled = true;
2079
+ extensionHandle = extResult;
2080
+ } catch (err) {
2081
+ const errMsg = err instanceof Error ? err.message : "unknown error";
2082
+ let extensionErrTokenRolledBack = false;
2083
+ let extensionErrTokenRollbackMsg = "";
2084
+ if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
2085
+ try {
2086
+ saveTokenStore(nonHermesPriorTokenStore);
2087
+ extensionErrTokenRolledBack = true;
2088
+ } catch (tokenRestoreErr) {
2089
+ extensionErrTokenRolledBack = false;
2090
+ extensionErrTokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
2091
+ }
2092
+ }
2093
+ const tokenRollbackSuffix = manifest.requiresToken ? extensionErrTokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${extensionErrTokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
2094
+ return {
2095
+ connectorId: options.connectorId,
2096
+ status: "error",
2097
+ message: `Memory extension install failed \u2014 ${errMsg}.${tokenRollbackSuffix} Resolve the issue, then reinstall.`
2098
+ };
2099
+ }
2100
+ } else {
2101
+ extensionMessage = " (memory extension: skipped via installExtension=false)";
2102
+ }
2103
+ }
2104
+ let weCloneProxyHandleRollback = null;
2105
+ if (options.connectorId === "weclone") {
2106
+ try {
2107
+ let proxyConfigPath = null;
2108
+ if (existing && fs4.existsSync(configPath)) {
2109
+ try {
2110
+ const savedRegistryConfig = JSON.parse(fs4.readFileSync(configPath, "utf8"));
2111
+ if (typeof savedRegistryConfig.proxyConfigPath === "string" && savedRegistryConfig.proxyConfigPath.length > 0) {
2112
+ proxyConfigPath = savedRegistryConfig.proxyConfigPath;
2113
+ }
2114
+ } catch {
2115
+ }
2116
+ }
2117
+ if (proxyConfigPath === null) {
2118
+ proxyConfigPath = resolveWeCloneProxyConfigPath();
2119
+ }
2120
+ const prior = readWeCloneProxyConfigIfExists(proxyConfigPath);
2121
+ const proxyConfig = buildWeCloneProxyConfig({
2122
+ userConfig: safeUserConfig,
2123
+ priorConfig: prior ? safeParseJson(prior) : null,
2124
+ authToken: tokenEntry?.token
2125
+ });
2126
+ fs4.mkdirSync(path4.dirname(proxyConfigPath), { recursive: true });
2127
+ weCloneProxyHandleRollback = () => {
2128
+ try {
2129
+ if (prior === null) {
2130
+ if (fs4.existsSync(proxyConfigPath)) {
2131
+ fs4.unlinkSync(proxyConfigPath);
2132
+ }
2133
+ } else {
2134
+ writeSecretFileSync2(proxyConfigPath, prior);
2135
+ }
2136
+ } catch {
2137
+ }
2138
+ };
2139
+ try {
2140
+ writeSecretFileSync2(
2141
+ proxyConfigPath,
2142
+ JSON.stringify(proxyConfig, null, 2)
2143
+ );
2144
+ } catch (writeErr) {
2145
+ try {
2146
+ weCloneProxyHandleRollback();
2147
+ } catch {
2148
+ }
2149
+ weCloneProxyHandleRollback = null;
2150
+ throw writeErr;
2151
+ }
2152
+ resolvedConfig.proxyConfigPath = proxyConfigPath;
2153
+ resolvedConfig.proxyPort = proxyConfig.proxyPort;
2154
+ resolvedConfig.wecloneApiUrl = proxyConfig.wecloneApiUrl;
2155
+ resolvedConfig.remnicDaemonUrl = proxyConfig.remnicDaemonUrl;
2156
+ resolvedConfig.sessionStrategy = proxyConfig.sessionStrategy;
2157
+ } catch (weCloneErr) {
2158
+ let tokenRolledBack = false;
2159
+ let tokenRollbackMsg = "";
2160
+ if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
2161
+ try {
2162
+ saveTokenStore(nonHermesPriorTokenStore);
2163
+ tokenRolledBack = true;
2164
+ } catch (tokenRestoreErr) {
2165
+ tokenRolledBack = false;
2166
+ tokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
2167
+ }
2168
+ }
2169
+ const tokenSuffix = manifest.requiresToken && tokenEntry !== null ? tokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${tokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
2170
+ return {
2171
+ connectorId: options.connectorId,
2172
+ status: "error",
2173
+ message: `WeClone install aborted: proxy config write failed \u2014 ${weCloneErr instanceof Error ? weCloneErr.message : String(weCloneErr)}.${tokenSuffix} Resolve the write permission issue on ~/.remnic/connectors/, then reinstall.`
2174
+ };
2175
+ }
2176
+ }
2177
+ let droidMcpRollback = null;
2178
+ if (options.connectorId === "droid") {
2179
+ const stepResult = droidInstallStep(
2180
+ tokenEntry?.token,
2181
+ resolvedConfig,
2182
+ manifest.requiresToken ?? false,
2183
+ tokenEntry,
2184
+ nonHermesPriorTokenStore,
2185
+ saveTokenStore
2186
+ );
2187
+ if (!stepResult.ok) {
2188
+ return { connectorId: options.connectorId, status: "error", message: stepResult.errorMessage };
2189
+ }
2190
+ droidMcpRollback = stepResult.rollback;
2191
+ resolvedConfig.factoryMcpPath = stepResult.mcpPath;
2192
+ }
2193
+ const INTERNAL_KEYS_DENYLIST = [
2194
+ "extensionSourceDir"
2195
+ // test-only override for the plugin-codex source path
2196
+ ];
2197
+ for (const key of INTERNAL_KEYS_DENYLIST) {
2198
+ delete resolvedConfig[key];
2199
+ }
2200
+ try {
2201
+ writeSecretFileSync2(configPath, JSON.stringify(resolvedConfig, null, 2));
2202
+ } catch (writeErr) {
2203
+ let configWriteTokenRolledBack = false;
2204
+ let configWriteTokenRollbackMsg = "";
2205
+ if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
2206
+ try {
2207
+ saveTokenStore(nonHermesPriorTokenStore);
2208
+ configWriteTokenRolledBack = true;
2209
+ } catch (tokenRestoreErr) {
2210
+ configWriteTokenRolledBack = false;
2211
+ configWriteTokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
2212
+ }
2213
+ }
2214
+ if (extensionInstalled && extensionHandle !== null) {
2215
+ try {
2216
+ extensionHandle.rollback();
2217
+ } catch {
2218
+ console.warn(
2219
+ "[remnic/connectors] installConnector: config write failed and extension rollback also failed \u2014 manual cleanup of memories_extensions/remnic may be required."
2220
+ );
2221
+ }
2222
+ }
2223
+ if (weCloneProxyHandleRollback !== null) {
2224
+ try {
2225
+ weCloneProxyHandleRollback();
2226
+ } catch {
2227
+ }
2228
+ }
2229
+ if (droidMcpRollback !== null) {
2230
+ try {
2231
+ droidMcpRollback();
2232
+ } catch {
2233
+ }
2234
+ }
2235
+ const configWriteTokenSuffix = manifest.requiresToken && tokenEntry !== null ? configWriteTokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${configWriteTokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
2236
+ return {
2237
+ connectorId: options.connectorId,
2238
+ status: "error",
2239
+ message: `${manifest.name} install aborted: connector config write failed \u2014 ${writeErr instanceof Error ? writeErr.message : String(writeErr)}.${configWriteTokenSuffix} Resolve the write permission issue, then reinstall.`
2240
+ };
2241
+ }
2242
+ if (extensionInstalled && extensionHandle !== null) {
2243
+ extensionHandle.commit();
2244
+ }
2245
+ return {
2246
+ connectorId: options.connectorId,
2247
+ status: "installed",
2248
+ configPath,
2249
+ message: `Installed ${manifest.name} v${manifest.version}${extensionMessage}`
2250
+ };
2251
+ }
2252
+ function removeConnector(connectorId) {
2253
+ const configDir = getConnectorsDir();
2254
+ if (!isValidConnectorId(connectorId)) {
2255
+ return {
2256
+ connectorId,
2257
+ configPath: configDir,
2258
+ status: "skipped",
2259
+ reason: "invalid-connector-id",
2260
+ message: `Removal aborted: invalid connector ID ${JSON.stringify(connectorId)}. Connector IDs must match [A-Za-z0-9][A-Za-z0-9._-]*.`
2261
+ };
2262
+ }
2263
+ const configPath = path4.join(configDir, `${connectorId}.json`);
2264
+ let codexHomeOverride = null;
2265
+ let savedInstallExtension = void 0;
2266
+ let configParsed = false;
2267
+ if (connectorId === "codex-cli" && fs4.existsSync(configPath)) {
2268
+ try {
2269
+ const parsed = JSON.parse(fs4.readFileSync(configPath, "utf8"));
2270
+ configParsed = true;
2271
+ if (typeof parsed.codexHome === "string" && parsed.codexHome.length > 0) {
2272
+ codexHomeOverride = parsed.codexHome;
2273
+ }
2274
+ const coerced = coerceInstallExtension(parsed.installExtension);
2275
+ if (coerced !== void 0) {
2276
+ savedInstallExtension = coerced;
2277
+ }
2278
+ } catch {
2279
+ console.debug(
2280
+ "[remnic/connectors] removeConnector: codex-cli.json parse failed \u2014 skipping extension removal to avoid touching unverified paths"
2281
+ );
2282
+ }
2283
+ }
2284
+ let savedHermesShimPath = null;
2285
+ let savedHermesConfigPath = null;
2286
+ const savedPriorHermesConfigPaths = [];
2287
+ const savedPriorHermesShimPaths = [];
2288
+ if (connectorId === "hermes" && fs4.existsSync(configPath)) {
2289
+ try {
2290
+ const parsedRaw = JSON.parse(fs4.readFileSync(configPath, "utf8"));
2291
+ if (parsedRaw === null || typeof parsedRaw !== "object" || Array.isArray(parsedRaw)) {
2292
+ throw new Error("hermes.json is not a JSON object");
2293
+ }
2294
+ const parsed = parsedRaw;
2295
+ if (typeof parsed.pluginShimPath === "string" && parsed.pluginShimPath.length > 0) {
2296
+ savedHermesShimPath = parsed.pluginShimPath;
2297
+ }
2298
+ if (Array.isArray(parsed.priorPluginShimPaths)) {
2299
+ for (const entry of parsed.priorPluginShimPaths) {
2300
+ if (typeof entry === "string" && entry.length > 0) {
2301
+ savedPriorHermesShimPaths.push(entry);
2302
+ }
2303
+ }
2304
+ }
2305
+ if (typeof parsed.hermesConfigPath === "string" && parsed.hermesConfigPath.length > 0) {
2306
+ savedHermesConfigPath = parsed.hermesConfigPath;
2307
+ }
2308
+ if (Array.isArray(parsed.priorHermesConfigPaths)) {
2309
+ for (const entry of parsed.priorHermesConfigPaths) {
2310
+ if (typeof entry === "string" && entry.length > 0) {
2311
+ savedPriorHermesConfigPaths.push(entry);
2312
+ }
2313
+ }
2314
+ }
2315
+ if (typeof parsed.priorHermesConfigPath === "string" && parsed.priorHermesConfigPath.length > 0) {
2316
+ savedPriorHermesConfigPaths.push(parsed.priorHermesConfigPath);
2317
+ }
2318
+ } catch {
2319
+ return {
2320
+ connectorId,
2321
+ configPath,
2322
+ status: "error",
2323
+ message: `Removal aborted: ${configPath} is malformed and cannot be parsed. It records where the Hermes plugin shim was installed; removing the connector without it could orphan the shim. Fix or delete the file (and remove any plugins/remnic/__init__.py under your Hermes home manually), then re-run removal.`
2324
+ };
2325
+ }
2326
+ }
2327
+ if (!fs4.existsSync(configPath)) {
2328
+ let staleTokenRevoked = false;
2329
+ try {
2330
+ staleTokenRevoked = revokeToken(connectorId);
2331
+ } catch {
2332
+ }
2333
+ const message = staleTokenRevoked ? `${connectorId} is not installed. Removed stale token entry for ${connectorId}.` : "Not installed";
2334
+ return {
2335
+ connectorId,
2336
+ configPath,
2337
+ status: "not_found",
2338
+ message
2339
+ };
2340
+ }
2341
+ let storedProfile = "default";
2342
+ if (connectorId === "hermes") {
2343
+ try {
2344
+ const stored = JSON.parse(fs4.readFileSync(configPath, "utf8"));
2345
+ if (typeof stored?.profile === "string") storedProfile = stored.profile;
2346
+ } catch {
2347
+ }
2348
+ }
2349
+ let weCloneProxyConfigPath = null;
2350
+ let weCloneRegistryParseFailed = false;
2351
+ if (connectorId === "weclone") {
2352
+ try {
2353
+ const stored = JSON.parse(fs4.readFileSync(configPath, "utf8"));
2354
+ if (typeof stored.proxyConfigPath === "string" && stored.proxyConfigPath.length > 0) {
2355
+ weCloneProxyConfigPath = stored.proxyConfigPath;
2356
+ }
2357
+ } catch {
2358
+ weCloneRegistryParseFailed = true;
2359
+ }
2360
+ if (weCloneProxyConfigPath === null && !weCloneRegistryParseFailed) {
2361
+ try {
2362
+ weCloneProxyConfigPath = resolveWeCloneProxyConfigPath();
2363
+ } catch {
2364
+ }
2365
+ }
2366
+ }
2367
+ let droidMcpConfigPath = null;
2368
+ let droidRegistryParseFailed = false;
2369
+ if (connectorId === "droid") {
2370
+ const prov = readDroidMcpProvenance(configPath);
2371
+ droidMcpConfigPath = prov.mcpConfigPath;
2372
+ droidRegistryParseFailed = prov.registryParseFailed;
2373
+ }
2374
+ if (connectorId === "droid" && droidRegistryParseFailed) {
2375
+ console.warn(`[remnic/connectors] removeConnector: droid.json malformed \u2014 aborting. Fix or delete ${configPath} manually and retry.`);
2376
+ return { connectorId, configPath, message: "Removal aborted: droid.json is malformed. Registry config left in place.", status: "skipped", reason: "config-parse-failed" };
2377
+ }
2378
+ if (connectorId === "weclone" && weCloneRegistryParseFailed) {
2379
+ console.warn(
2380
+ "[remnic/connectors] removeConnector: weclone.json is malformed \u2014 aborting removal to preserve provenance. Fix or delete " + configPath + " manually and retry."
2381
+ );
2382
+ return {
2383
+ connectorId,
2384
+ configPath,
2385
+ message: "Removal aborted: weclone.json is malformed. Registry config left in place for inspection; proxy config NOT removed.",
2386
+ status: "skipped",
2387
+ reason: "config-parse-failed"
2388
+ };
2389
+ }
2390
+ if (connectorId === "codex-cli" && fs4.existsSync(configPath) && !configParsed) {
2391
+ console.warn(
2392
+ "[remnic/connectors] removeConnector: codex-cli.json is malformed \u2014 aborting removal to preserve provenance. Fix or delete " + configPath + " manually and retry."
2393
+ );
2394
+ return {
2395
+ connectorId,
2396
+ configPath,
2397
+ message: "Removal aborted: codex-cli.json is malformed. Config file left in place for inspection.",
2398
+ status: "skipped",
2399
+ reason: "config-parse-failed"
2400
+ };
2401
+ }
2402
+ let extensionMessage = "";
2403
+ if (connectorId === "codex-cli") {
2404
+ if (savedInstallExtension === false) {
2405
+ extensionMessage = " (memory extension: skipped \u2014 installExtension=false)";
2406
+ } else if (savedInstallExtension !== true || codexHomeOverride === null) {
2407
+ extensionMessage = " (memory extension: skipped \u2014 no install provenance in saved config)";
2408
+ } else {
2409
+ const extResult = removeCodexMemoryExtension({ codexHome: codexHomeOverride });
2410
+ extensionMessage = extResult.removed ? ` (memory extension removed: ${extResult.remnicExtensionDir})` : " (no memory extension present)";
2411
+ }
2412
+ }
2413
+ if (connectorId === "hermes") {
2414
+ const preflightCandidates = [];
2415
+ try {
2416
+ preflightCandidates.push(...hermesConfigCleanupPaths(storedProfile));
2417
+ } catch {
2418
+ }
2419
+ if (savedHermesConfigPath !== null && isPlausibleHermesConfigPath(savedHermesConfigPath)) {
2420
+ preflightCandidates.push(savedHermesConfigPath);
2421
+ }
2422
+ preflightCandidates.push(...savedPriorHermesConfigPaths.filter(isPlausibleHermesConfigPath));
2423
+ const uniqueCandidates = [];
2424
+ for (const candidate of preflightCandidates) {
2425
+ if (!uniqueCandidates.some((kept) => sameHermesConfigTarget(kept, candidate))) {
2426
+ uniqueCandidates.push(candidate);
2427
+ }
2428
+ }
2429
+ const blocked = [];
2430
+ for (const candidate of uniqueCandidates) {
2431
+ let needsCleanup = false;
2432
+ try {
2433
+ needsCleanup = /^remnic:/m.test(fs4.readFileSync(candidate, "utf8"));
2434
+ } catch {
2435
+ needsCleanup = false;
2436
+ }
2437
+ if (!needsCleanup) {
2438
+ continue;
2439
+ }
2440
+ try {
2441
+ assertConfigComponentsNotSymlinked(candidate);
2442
+ } catch {
2443
+ blocked.push(`${candidate} (symlinked path component)`);
2444
+ continue;
2445
+ }
2446
+ try {
2447
+ fs4.accessSync(candidate, fs4.constants.W_OK);
2448
+ fs4.accessSync(path4.dirname(candidate), fs4.constants.W_OK);
2449
+ } catch {
2450
+ blocked.push(`${candidate} (not writable)`);
2451
+ }
2452
+ }
2453
+ if (blocked.length > 0) {
2454
+ return {
2455
+ connectorId,
2456
+ configPath,
2457
+ status: "error",
2458
+ message: `Hermes remove aborted: the following config.yaml path(s) hold a remnic: block but cannot be cleaned: ${blocked.join(", ")}. The connector registry entry, provenance, and token were left untouched \u2014 fix the permissions or resolve the symlink and re-run removal.`
2459
+ };
2460
+ }
2461
+ }
2462
+ try {
2463
+ fs4.unlinkSync(configPath);
2464
+ } catch (unlinkErr) {
2465
+ const sanitizedErr = unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr);
2466
+ return {
2467
+ connectorId,
2468
+ configPath,
2469
+ status: "error",
2470
+ message: `${connectorId} remove aborted: could not delete connector file (${sanitizedErr}). Token and any connector-specific state were not modified.`
2471
+ };
2472
+ }
2473
+ const notes = [];
2474
+ let tokenRevoked = true;
2475
+ try {
2476
+ revokeToken(connectorId);
2477
+ } catch (revokeErr) {
2478
+ tokenRevoked = false;
2479
+ const revokeMsg = revokeErr instanceof Error ? revokeErr.message : String(revokeErr);
2480
+ notes.push(`Warning: token revocation failed \u2014 ${revokeMsg}. The token for ${connectorId} may still be present in tokens.json.`);
2481
+ }
2482
+ let weCloneProxyDeleteFailed = null;
2483
+ if (connectorId === "weclone") {
2484
+ if (weCloneProxyConfigPath === null) {
2485
+ notes.push(
2486
+ "WeClone proxy config cleanup skipped: no persisted path found in saved config (likely a legacy install predating proxyConfigPath provenance)."
2487
+ );
2488
+ } else {
2489
+ const expectedSuffix = path4.join("connectors", "weclone.json");
2490
+ const isSafePath = path4.isAbsolute(weCloneProxyConfigPath) && weCloneProxyConfigPath.endsWith(expectedSuffix);
2491
+ if (!isSafePath) {
2492
+ weCloneProxyDeleteFailed = `Proxy config path ${JSON.stringify(weCloneProxyConfigPath)} failed safety validation (must be absolute and end with "${expectedSuffix}"). Refusing to delete \u2014 remove the file manually if it exists.`;
2493
+ } else {
2494
+ try {
2495
+ if (fs4.existsSync(weCloneProxyConfigPath)) {
2496
+ fs4.unlinkSync(weCloneProxyConfigPath);
2497
+ notes.push(`Removed WeClone proxy config: ${weCloneProxyConfigPath}`);
2498
+ }
2499
+ } catch (err) {
2500
+ weCloneProxyDeleteFailed = err instanceof Error ? err.message : String(err);
2501
+ }
2502
+ }
2503
+ }
2504
+ }
2505
+ if (weCloneProxyDeleteFailed !== null && weCloneProxyConfigPath !== null) {
2506
+ const tokenStatus = tokenRevoked ? "the registry config was deleted and the token was revoked" : "the registry config was deleted but TOKEN REVOCATION ALSO FAILED \u2014 inspect ~/.remnic/tokens.json and revoke manually";
2507
+ return {
2508
+ connectorId,
2509
+ configPath,
2510
+ status: "error",
2511
+ message: `WeClone remove partially succeeded: ${tokenStatus}, but the proxy config at ${weCloneProxyConfigPath} could not be deleted (${weCloneProxyDeleteFailed}). Manually remove that file \u2014 it may still contain a Remnic daemon bearer token.`
2512
+ };
2513
+ }
2514
+ let droidMcpDeleteFailed = null;
2515
+ if (connectorId === "droid") {
2516
+ if (droidMcpConfigPath === null) {
2517
+ notes.push("Droid MCP config cleanup skipped: no persisted path found (legacy install).");
2518
+ } else {
2519
+ try {
2520
+ const note = removeDroidMcpEntry(droidMcpConfigPath);
2521
+ if (note) notes.push(note);
2522
+ } catch (err) {
2523
+ droidMcpDeleteFailed = err instanceof Error ? err.message : String(err);
2524
+ }
2525
+ }
2526
+ }
2527
+ if (droidMcpDeleteFailed !== null && droidMcpConfigPath !== null) {
2528
+ const ts = tokenRevoked ? "token was revoked" : "TOKEN REVOCATION ALSO FAILED \u2014 inspect ~/.remnic/tokens.json and revoke manually";
2529
+ return { connectorId, configPath, status: "error", message: `Droid remove partially succeeded: registry config deleted, ${ts}, but the MCP config at ${droidMcpConfigPath} could not be updated (${droidMcpDeleteFailed}). Manually remove the "remnic" entry.` };
2530
+ }
2531
+ if (connectorId === "hermes") {
2532
+ try {
2533
+ const shimCandidates = [];
2534
+ if (savedHermesShimPath !== null) {
2535
+ shimCandidates.push(savedHermesShimPath);
2536
+ }
2537
+ shimCandidates.push(...savedPriorHermesShimPaths);
2538
+ try {
2539
+ shimCandidates.push(hermesShimPath());
2540
+ } catch {
2541
+ }
2542
+ const shimResult = removeHermesShim(shimCandidates);
2543
+ if (shimResult.notes.length > 0) {
2544
+ notes.push(shimResult.notes.join("; "));
2545
+ }
2546
+ } catch (shimErr) {
2547
+ notes.push(
2548
+ `Hermes plugin shim cleanup skipped: ${shimErr instanceof Error ? shimErr.message : String(shimErr)}`
2549
+ );
2550
+ }
2551
+ try {
2552
+ const yamlResult = removeHermesConfig({
2553
+ profile: storedProfile,
2554
+ extraConfigPaths: [
2555
+ ...savedHermesConfigPath !== null ? [savedHermesConfigPath] : [],
2556
+ ...savedPriorHermesConfigPaths
2557
+ ]
2558
+ });
2559
+ if (yamlResult.updated) {
2560
+ notes.push(`Removed remnic: block from Hermes config: ${yamlResult.configPath}`);
2561
+ } else if (yamlResult.reason?.startsWith("Hermes config cleanup partially failed:")) {
2562
+ const tokenStatus = tokenRevoked ? "the connector registry config was deleted and the token was revoked" : "the connector registry config was deleted but TOKEN REVOCATION ALSO FAILED \u2014 inspect ~/.remnic/tokens.json and revoke manually";
2563
+ const shimSuffix = notes.length > 0 ? ` Completed cleanup: ${notes.join("; ")}.` : "";
2564
+ return {
2565
+ connectorId,
2566
+ configPath,
2567
+ status: "error",
2568
+ message: `Hermes remove partially succeeded: ${tokenStatus}, but ${yamlResult.reason}. Updated paths: ${yamlResult.configPath}. Manually remove any stale remnic: block and token material from the failed Hermes config path.` + shimSuffix
2569
+ };
2570
+ } else if (yamlResult.skipped) {
2571
+ notes.push(`Hermes config cleanup skipped: ${yamlResult.reason}`);
2572
+ }
2573
+ } catch (err) {
2574
+ notes.push(
2575
+ `Hermes config cleanup skipped: ${err instanceof Error ? err.message : String(err)}`
2576
+ );
2577
+ }
2578
+ }
2579
+ const suffix = notes.length > 0 ? `
2580
+ ${notes.join("\n ")}` : "";
2581
+ return {
2582
+ connectorId,
2583
+ configPath,
2584
+ status: "removed",
2585
+ message: `Removed${extensionMessage}${suffix}`
2586
+ };
2587
+ }
2588
+ function sanitizeHermesProfile(profile) {
2589
+ if (typeof profile !== "string" || profile.length === 0) {
2590
+ throw new Error("Hermes profile name must be a non-empty string");
2591
+ }
2592
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)) {
2593
+ throw new Error(
2594
+ `Invalid Hermes profile name: ${JSON.stringify(profile)} \u2014 must match [A-Za-z0-9][A-Za-z0-9._-]*`
2595
+ );
2596
+ }
2597
+ if (profile.includes("..")) {
2598
+ throw new Error(`Invalid Hermes profile name: ${JSON.stringify(profile)} \u2014 must not contain ".."`);
2599
+ }
2600
+ return profile;
2601
+ }
2602
+ function hermesConfigPath(profile) {
2603
+ const safeProfile = sanitizeHermesProfile(profile);
2604
+ const hermesRoot = resolveHermesRoot();
2605
+ const rootConfigPath = path4.join(hermesRoot, "config.yaml");
2606
+ const profilesRoot = path4.join(hermesRoot, "profiles");
2607
+ if (safeProfile === "default") {
2608
+ const defaultProfileDir = path4.join(profilesRoot, safeProfile);
2609
+ if (isFile(rootConfigPath) || !fs4.existsSync(rootConfigPath) && !isDirectory(defaultProfileDir)) {
2610
+ return rootConfigPath;
2611
+ }
2612
+ }
2613
+ const cfgPath = path4.resolve(profilesRoot, safeProfile, "config.yaml");
2614
+ const rel = path4.relative(profilesRoot, cfgPath);
2615
+ if (rel.startsWith("..") || path4.isAbsolute(rel)) {
2616
+ throw new Error(
2617
+ `Invalid Hermes profile path: resolved outside ${profilesRoot}`
2618
+ );
2619
+ }
2620
+ return cfgPath;
2621
+ }
2622
+ function isDirectory(filePath) {
2623
+ try {
2624
+ return fs4.statSync(filePath).isDirectory();
2625
+ } catch {
2626
+ return false;
2627
+ }
2628
+ }
2629
+ function isFile(filePath) {
2630
+ try {
2631
+ return fs4.statSync(filePath).isFile();
2632
+ } catch {
2633
+ return false;
2634
+ }
2635
+ }
2636
+ function hermesConfigTarget(filePath) {
2637
+ try {
2638
+ return fs4.realpathSync.native(filePath);
2639
+ } catch {
2640
+ return path4.resolve(filePath);
2641
+ }
2642
+ }
2643
+ function sameHermesConfigTarget(leftPath, rightPath) {
2644
+ return hermesConfigTarget(leftPath) === hermesConfigTarget(rightPath);
2645
+ }
2646
+ function hermesDefaultProfileConfigPath() {
2647
+ return path4.join(resolveHermesRoot(), "profiles", "default", "config.yaml");
2648
+ }
2649
+ function hermesConfigCleanupPaths(profile) {
2650
+ const cfgPath = hermesConfigPath(profile);
2651
+ const safeProfile = sanitizeHermesProfile(profile);
2652
+ if (safeProfile !== "default") {
2653
+ return [cfgPath];
2654
+ }
2655
+ return [.../* @__PURE__ */ new Set([cfgPath, hermesDefaultProfileConfigPath()])];
2656
+ }
2657
+ function sanitizeHermesHost(host) {
2658
+ if (typeof host !== "string" || host.length === 0) {
2659
+ throw new Error("Hermes host must be a non-empty string");
2660
+ }
2661
+ if (host.length > 253) {
2662
+ throw new Error(`Hermes host too long (max 253 chars): ${JSON.stringify(host.slice(0, 32))}\u2026`);
2663
+ }
2664
+ if (host.startsWith("[")) {
2665
+ if (!host.endsWith("]")) {
2666
+ throw new Error(
2667
+ `Invalid Hermes host: ${JSON.stringify(host)} \u2014 unbalanced brackets in IPv6 literal`
2668
+ );
2669
+ }
2670
+ const inner = host.slice(1, -1);
2671
+ if (inner.length === 0 || !/^[0-9A-Fa-f:]+$/.test(inner)) {
2672
+ throw new Error(
2673
+ `Invalid Hermes host: ${JSON.stringify(host)} \u2014 bracketed IPv6 literal must contain only hex digits and colons`
2674
+ );
2675
+ }
2676
+ return host;
2677
+ }
2678
+ if (host.includes(":")) {
2679
+ throw new Error(
2680
+ `Invalid Hermes host: ${JSON.stringify(host)} \u2014 host must not include a port; supply the port separately with --config port=<n>`
2681
+ );
2682
+ }
2683
+ if (!/^[A-Za-z0-9._\-]+$/.test(host)) {
2684
+ throw new Error(
2685
+ `Invalid Hermes host: ${JSON.stringify(host)} \u2014 must be a plain hostname or IP literal`
2686
+ );
2687
+ }
2688
+ return host;
2689
+ }
2690
+ function sanitizeHermesPort(port) {
2691
+ const numeric = Number(port);
2692
+ if (!Number.isInteger(numeric)) {
2693
+ throw new Error(
2694
+ `Invalid Hermes port "${port}": must be a positive integer`
2695
+ );
2696
+ }
2697
+ if (numeric < 1 || numeric > 65535) {
2698
+ throw new Error(`Invalid Hermes port: ${JSON.stringify(port)} \u2014 must be an integer in [1, 65535]`);
2699
+ }
2700
+ return numeric;
2701
+ }
2702
+ function writeSecretFileSync2(filePath, data) {
2703
+ const dir = path4.dirname(filePath);
2704
+ const base = path4.basename(filePath);
2705
+ const tmpPath = path4.join(
2706
+ dir,
2707
+ `.${base}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`
2708
+ );
2709
+ let wroteTemp = false;
2710
+ try {
2711
+ fs4.writeFileSync(tmpPath, data, { mode: 384, flag: "wx" });
2712
+ wroteTemp = true;
2713
+ try {
2714
+ fs4.chmodSync(tmpPath, 384);
2715
+ } catch {
2716
+ }
2717
+ fs4.renameSync(tmpPath, filePath);
2718
+ try {
2719
+ fs4.chmodSync(filePath, 384);
2720
+ } catch {
2721
+ }
2722
+ } catch (err) {
2723
+ if (wroteTemp) {
2724
+ try {
2725
+ fs4.unlinkSync(tmpPath);
2726
+ } catch {
2727
+ }
2728
+ }
2729
+ throw err;
2730
+ }
2731
+ }
2732
+ function upsertHermesConfig(opts) {
2733
+ return upsertHermesConfigAt(hermesConfigPath(opts.profile), opts);
2734
+ }
2735
+ function upsertHermesConfigAt(cfgPath, opts) {
2736
+ assertConfigComponentsNotSymlinked(cfgPath);
2737
+ const profileDir = path4.dirname(cfgPath);
2738
+ const safeHost = sanitizeHermesHost(opts.host);
2739
+ const safePort = sanitizeHermesPort(opts.port);
2740
+ const allowInsecureHttp = opts.allowInsecureHttp ?? false;
2741
+ if (!/^[A-Za-z0-9_]+$/.test(opts.token)) {
2742
+ throw new Error("Invalid Hermes token: contains non-alphanumeric characters");
2743
+ }
2744
+ if (!isDirectory(profileDir)) {
2745
+ return {
2746
+ updated: false,
2747
+ skipped: true,
2748
+ reason: `Hermes profile directory not found: ${profileDir}`,
2749
+ configPath: cfgPath
2750
+ };
2751
+ }
2752
+ const block = [
2753
+ "remnic:",
2754
+ ` host: "${safeHost}"`,
2755
+ ` port: ${safePort}`,
2756
+ ` token: "${opts.token}"`,
2757
+ ` allow_insecure_http: ${allowInsecureHttp}`
2758
+ ].join("\n");
2759
+ if (!fs4.existsSync(cfgPath)) {
2760
+ writeSecretFileSync2(cfgPath, block + "\n");
2761
+ return { updated: true, skipped: false, configPath: cfgPath, priorContent: null };
2762
+ }
2763
+ const raw = fs4.readFileSync(cfgPath, "utf8");
2764
+ const hasRemnicBlock = /^remnic:/m.test(raw);
2765
+ if (!hasRemnicBlock) {
2766
+ const separator = raw.endsWith("\n") ? "\n" : "\n\n";
2767
+ writeSecretFileSync2(cfgPath, raw + separator + block + "\n");
2768
+ return { updated: true, skipped: false, configPath: cfgPath, priorContent: raw };
2769
+ }
2770
+ const splitLines = raw.split("\n");
2771
+ if (splitLines.length > 0 && splitLines[splitLines.length - 1] === "") {
2772
+ splitLines.pop();
2773
+ }
2774
+ const lines = splitLines;
2775
+ const newLines = [];
2776
+ let inRemnicBlock = false;
2777
+ let blockWritten = false;
2778
+ const written = { host: false, port: false, token: false, allowInsecureHttp: false };
2779
+ for (let i = 0; i < lines.length; i++) {
2780
+ const line = lines[i];
2781
+ if (/^remnic:/.test(line)) {
2782
+ inRemnicBlock = true;
2783
+ newLines.push(line);
2784
+ continue;
2785
+ }
2786
+ if (inRemnicBlock) {
2787
+ if (line.length > 0 && !/^\s/.test(line)) {
2788
+ if (!written.host) newLines.push(` host: "${safeHost}"`);
2789
+ if (!written.port) newLines.push(` port: ${safePort}`);
2790
+ if (!written.token) newLines.push(` token: "${opts.token}"`);
2791
+ if (!written.allowInsecureHttp) newLines.push(` allow_insecure_http: ${allowInsecureHttp}`);
2792
+ blockWritten = true;
2793
+ inRemnicBlock = false;
2794
+ newLines.push(line);
2795
+ continue;
2796
+ }
2797
+ if (/^\s+host:/.test(line)) {
2798
+ newLines.push(` host: "${safeHost}"`);
2799
+ written.host = true;
2800
+ } else if (/^\s+port:/.test(line)) {
2801
+ newLines.push(` port: ${safePort}`);
2802
+ written.port = true;
2803
+ } else if (/^\s+token:/.test(line)) {
2804
+ newLines.push(` token: "${opts.token}"`);
2805
+ written.token = true;
2806
+ } else if (/^\s+allow_insecure_http:/.test(line)) {
2807
+ newLines.push(` allow_insecure_http: ${allowInsecureHttp}`);
2808
+ written.allowInsecureHttp = true;
2809
+ } else {
2810
+ newLines.push(line);
2811
+ }
2812
+ continue;
2813
+ }
2814
+ newLines.push(line);
2815
+ }
2816
+ if (inRemnicBlock && !blockWritten) {
2817
+ if (!written.host) newLines.push(` host: "${safeHost}"`);
2818
+ if (!written.port) newLines.push(` port: ${safePort}`);
2819
+ if (!written.token) newLines.push(` token: "${opts.token}"`);
2820
+ if (!written.allowInsecureHttp) newLines.push(` allow_insecure_http: ${allowInsecureHttp}`);
2821
+ }
2822
+ writeSecretFileSync2(cfgPath, newLines.join("\n") + "\n");
2823
+ return { updated: true, skipped: false, configPath: cfgPath, priorContent: raw };
2824
+ }
2825
+ function removeHermesConfig(opts) {
2826
+ let envCfgPaths;
2827
+ let envResolutionError = null;
2828
+ try {
2829
+ envCfgPaths = [...hermesConfigCleanupPaths(opts.profile)];
2830
+ } catch (err) {
2831
+ envCfgPaths = [];
2832
+ envResolutionError = err instanceof Error ? err.message : String(err);
2833
+ }
2834
+ const cfgPaths = [];
2835
+ for (const candidate of envCfgPaths) {
2836
+ if (!cfgPaths.some((existing) => sameHermesConfigTarget(existing, candidate))) {
2837
+ cfgPaths.push(candidate);
2838
+ }
2839
+ }
2840
+ for (const extra of opts.extraConfigPaths ?? []) {
2841
+ if (isPlausibleHermesConfigPath(extra) && !cfgPaths.some((existing) => sameHermesConfigTarget(existing, extra))) {
2842
+ cfgPaths.push(extra);
2843
+ }
2844
+ }
2845
+ if (cfgPaths.length === 0) {
2846
+ return {
2847
+ updated: false,
2848
+ skipped: true,
2849
+ reason: envResolutionError ? `Hermes config cleanup failed: ${envResolutionError}` : "Hermes config.yaml not found",
2850
+ configPath: "<unresolved>"
2851
+ };
2852
+ }
2853
+ const results = cfgPaths.map((cfgPath) => {
2854
+ try {
2855
+ return removeHermesConfigFile(cfgPath);
2856
+ } catch (err) {
2857
+ return {
2858
+ updated: false,
2859
+ skipped: true,
2860
+ reason: `Hermes config cleanup failed: ${err instanceof Error ? err.message : String(err)}`,
2861
+ configPath: cfgPath
2862
+ };
2863
+ }
2864
+ });
2865
+ const updated = results.filter((result) => result.updated);
2866
+ const cleanupFailures = results.filter((result) => result.reason?.startsWith("Hermes config cleanup failed:"));
2867
+ if (updated.length > 0) {
2868
+ const updatedPaths = updated.map((result) => result.configPath).join(", ");
2869
+ if (cleanupFailures.length > 0) {
2870
+ const failedPaths = cleanupFailures.map((result) => result.configPath).join(", ");
2871
+ return {
2872
+ updated: false,
2873
+ skipped: true,
2874
+ reason: `Hermes config cleanup partially failed: updated ${updatedPaths}; failed ${failedPaths}`,
2875
+ configPath: `${updatedPaths}; failed: ${failedPaths}`
2876
+ };
2877
+ }
2878
+ return {
2879
+ updated: true,
2880
+ skipped: false,
2881
+ configPath: updatedPaths
2882
+ };
2883
+ }
2884
+ const cleanupFailure = cleanupFailures[0];
2885
+ if (cleanupFailure) {
2886
+ return cleanupFailure;
2887
+ }
2888
+ const existingWithoutBlock = results.find((result) => result.reason !== "Hermes config.yaml not found");
2889
+ const fallbackResult = existingWithoutBlock ?? results[0];
2890
+ if (fallbackResult) {
2891
+ return fallbackResult;
2892
+ }
2893
+ return {
2894
+ updated: false,
2895
+ skipped: true,
2896
+ reason: "Hermes config.yaml not found",
2897
+ configPath: cfgPaths[0] ?? "<unresolved>"
2898
+ };
2899
+ }
2900
+ function removeHermesConfigFile(cfgPath) {
2901
+ try {
2902
+ assertConfigComponentsNotSymlinked(cfgPath);
2903
+ } catch (err) {
2904
+ return {
2905
+ updated: false,
2906
+ skipped: true,
2907
+ reason: `Hermes config cleanup skipped: ${err instanceof Error ? err.message : String(err)}`,
2908
+ configPath: cfgPath
2909
+ };
2910
+ }
2911
+ if (!fs4.existsSync(cfgPath)) {
2912
+ return {
2913
+ updated: false,
2914
+ skipped: true,
2915
+ reason: "Hermes config.yaml not found",
2916
+ configPath: cfgPath
2917
+ };
2918
+ }
2919
+ const raw = fs4.readFileSync(cfgPath, "utf8");
2920
+ if (!/^remnic:/m.test(raw)) {
2921
+ return {
2922
+ updated: false,
2923
+ skipped: true,
2924
+ reason: "No remnic: block found in config.yaml",
2925
+ configPath: cfgPath
2926
+ };
2927
+ }
2928
+ const lines = raw.split("\n");
2929
+ const newLines = [];
2930
+ let inRemnicBlock = false;
2931
+ for (const line of lines) {
2932
+ if (/^remnic:/.test(line)) {
2933
+ inRemnicBlock = true;
2934
+ continue;
2935
+ }
2936
+ if (inRemnicBlock) {
2937
+ if (line.length > 0 && !/^\s/.test(line)) {
2938
+ inRemnicBlock = false;
2939
+ newLines.push(line);
2940
+ }
2941
+ continue;
2942
+ }
2943
+ newLines.push(line);
2944
+ }
2945
+ while (newLines.length > 0 && newLines[newLines.length - 1]?.trim() === "") {
2946
+ newLines.pop();
2947
+ }
2948
+ writeSecretFileSync2(cfgPath, newLines.length > 0 ? newLines.join("\n") + "\n" : "");
2949
+ return { updated: true, skipped: false, configPath: cfgPath };
2950
+ }
2951
+ async function doctorConnector(connectorId) {
2952
+ const installed = listConnectors().installed;
2953
+ const instance = installed.find((c) => c.connectorId === connectorId);
2954
+ if (!instance) {
2955
+ return {
2956
+ connectorId,
2957
+ checks: [{ name: "Installed", ok: false, detail: "Not installed" }],
2958
+ healthy: false
2959
+ };
2960
+ }
2961
+ const configPath = path4.join(getConnectorsDir(), `${connectorId}.json`);
2962
+ const checks = [];
2963
+ checks.push({
2964
+ name: "Config file",
2965
+ ok: fs4.existsSync(configPath),
2966
+ detail: configPath
2967
+ });
2968
+ try {
2969
+ const raw = fs4.readFileSync(configPath, "utf8");
2970
+ JSON.parse(raw);
2971
+ checks.push({ name: "Config valid", ok: true, detail: "OK" });
2972
+ } catch (e) {
2973
+ checks.push({ name: "Config valid", ok: false, detail: String(e) });
2974
+ }
2975
+ const mcpUrl = instance.config.mcpServerUrl;
2976
+ if (mcpUrl) {
2977
+ try {
2978
+ const controller = new AbortController();
2979
+ const timeoutId = setTimeout(() => controller.abort(), 3e3);
2980
+ const response = await fetch(mcpUrl, { signal: controller.signal });
2981
+ clearTimeout(timeoutId);
2982
+ checks.push({ name: "MCP server", ok: response.ok, detail: mcpUrl });
2983
+ } catch (e) {
2984
+ checks.push({
2985
+ name: "MCP server",
2986
+ ok: false,
2987
+ detail: `Cannot reach ${mcpUrl}: ${e instanceof Error ? e.message : "unknown"}`
2988
+ });
2989
+ }
2990
+ }
2991
+ const memoryDir = instance.config.memoryDir;
2992
+ if (memoryDir) {
2993
+ if (fs4.existsSync(memoryDir)) {
2994
+ checks.push({ name: "Memory directory", ok: true, detail: memoryDir });
2995
+ } else {
2996
+ checks.push({ name: "Memory directory", ok: false, detail: `Not found: ${memoryDir}` });
2997
+ }
2998
+ }
2999
+ if (connectorId === "droid") {
3000
+ checks.push(droidMcpDoctorCheck(instance.config.factoryMcpPath));
3001
+ }
3002
+ const healthy = checks.every((c) => c.ok);
3003
+ return { connectorId, checks, healthy };
3004
+ }
3005
+ var CODEX_MEMORIES_SUBDIR = "memories";
3006
+ var CODEX_EXTENSIONS_SUBDIR = "memories_extensions";
3007
+ var REMNIC_EXTENSION_DIR_NAME = "remnic";
3008
+ function resolveCodexHome(override) {
3009
+ if (override && typeof override === "string" && override.trim().length > 0) {
3010
+ return path4.resolve(override.trim());
3011
+ }
3012
+ const envHome = readEnvVar("CODEX_HOME");
3013
+ if (envHome && envHome.trim().length > 0) {
3014
+ return path4.resolve(envHome.trim());
3015
+ }
3016
+ const home = readEnvVar("HOME") || readEnvVar("USERPROFILE") || resolveHomeDir();
3017
+ return path4.resolve(home, ".codex");
3018
+ }
3019
+ function resolveCodexMemoryExtensionPaths(codexHomeOverride) {
3020
+ const codexHome = resolveCodexHome(codexHomeOverride);
3021
+ const memoriesDir = path4.join(codexHome, CODEX_MEMORIES_SUBDIR);
3022
+ const extensionsRoot = path4.join(path4.dirname(memoriesDir), CODEX_EXTENSIONS_SUBDIR);
3023
+ const remnicExtensionDir = path4.join(extensionsRoot, REMNIC_EXTENSION_DIR_NAME);
3024
+ return { codexHome, memoriesDir, extensionsRoot, remnicExtensionDir };
3025
+ }
3026
+ function locatePluginCodexExtensionSource(override) {
3027
+ if (override && typeof override === "string" && override.trim().length > 0) {
3028
+ const resolved = path4.resolve(override.trim());
3029
+ if (fs4.existsSync(resolved) && fs4.statSync(resolved).isDirectory()) {
3030
+ return resolved;
3031
+ }
3032
+ throw new Error(`Codex extension source directory not found: ${resolved}`);
3033
+ }
3034
+ const EXTENSION_SUBPATH = path4.join("memories_extensions", "remnic");
3035
+ const WORKSPACE_RELATIVE_PATH = path4.join(
3036
+ "packages",
3037
+ "plugin-codex",
3038
+ "memories_extensions",
3039
+ "remnic"
3040
+ );
3041
+ const searched = [];
3042
+ try {
3043
+ const moduleDir = path4.dirname(fileURLToPath(import.meta.url));
3044
+ const bundledCandidate = path4.join(moduleDir, "codex");
3045
+ searched.push(bundledCandidate);
3046
+ if (fs4.existsSync(bundledCandidate) && fs4.statSync(bundledCandidate).isDirectory()) {
3047
+ return bundledCandidate;
3048
+ }
3049
+ const distConnectorsCandidate = path4.join(moduleDir, "connectors", "codex");
3050
+ searched.push(distConnectorsCandidate);
3051
+ if (fs4.existsSync(distConnectorsCandidate) && fs4.statSync(distConnectorsCandidate).isDirectory()) {
3052
+ return distConnectorsCandidate;
3053
+ }
3054
+ } catch {
3055
+ }
3056
+ try {
3057
+ const requireFromHere = createRequire(import.meta.url);
3058
+ const pluginPkgJsonPath = requireFromHere.resolve("@remnic/plugin-codex/package.json");
3059
+ const pluginPkgRoot = path4.dirname(pluginPkgJsonPath);
3060
+ const candidate = path4.join(pluginPkgRoot, EXTENSION_SUBPATH);
3061
+ searched.push(candidate);
3062
+ if (fs4.existsSync(candidate) && fs4.statSync(candidate).isDirectory()) {
3063
+ return candidate;
3064
+ }
3065
+ } catch {
3066
+ }
3067
+ try {
3068
+ const moduleDir = path4.dirname(fileURLToPath(import.meta.url));
3069
+ let dir = moduleDir;
3070
+ for (let depth = 0; depth < 8; depth += 1) {
3071
+ const candidate = path4.join(
3072
+ dir,
3073
+ "node_modules",
3074
+ "@remnic",
3075
+ "plugin-codex",
3076
+ EXTENSION_SUBPATH
3077
+ );
3078
+ searched.push(candidate);
3079
+ if (fs4.existsSync(candidate) && fs4.statSync(candidate).isDirectory()) {
3080
+ return candidate;
3081
+ }
3082
+ const parent = path4.dirname(dir);
3083
+ if (parent === dir) break;
3084
+ dir = parent;
3085
+ }
3086
+ } catch {
3087
+ }
3088
+ const anchors = [];
3089
+ try {
3090
+ anchors.push(path4.dirname(fileURLToPath(import.meta.url)));
3091
+ } catch {
3092
+ }
3093
+ anchors.push(process.cwd());
3094
+ for (const anchor of anchors) {
3095
+ let dir = anchor;
3096
+ for (let depth = 0; depth < 12; depth += 1) {
3097
+ const candidate = path4.join(dir, WORKSPACE_RELATIVE_PATH);
3098
+ searched.push(candidate);
3099
+ if (fs4.existsSync(candidate) && fs4.statSync(candidate).isDirectory()) {
3100
+ return candidate;
3101
+ }
3102
+ const parent = path4.dirname(dir);
3103
+ if (parent === dir) break;
3104
+ dir = parent;
3105
+ }
3106
+ }
3107
+ throw new Error(
3108
+ "Could not locate the plugin-codex memories_extensions/remnic source directory.\nPaths searched:\n" + searched.map((p) => ` - ${p}`).join("\n") + "\nInstall @remnic/plugin-codex or pass sourceDir explicitly."
3109
+ );
3110
+ }
3111
+ function copyDirRecursiveSync(src, dest) {
3112
+ let count = 0;
3113
+ fs4.mkdirSync(dest, { recursive: true });
3114
+ const entries = fs4.readdirSync(src, { withFileTypes: true });
3115
+ for (const entry of entries) {
3116
+ const from = path4.join(src, entry.name);
3117
+ const to = path4.join(dest, entry.name);
3118
+ if (entry.isDirectory()) {
3119
+ count += copyDirRecursiveSync(from, to);
3120
+ } else if (entry.isFile()) {
3121
+ fs4.copyFileSync(from, to);
3122
+ count += 1;
3123
+ }
3124
+ }
3125
+ return count;
3126
+ }
3127
+ function installCodexMemoryExtension(options = {}) {
3128
+ const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
3129
+ const sourceDir = locatePluginCodexExtensionSource(options.sourceDir ?? null);
3130
+ fs4.mkdirSync(paths.extensionsRoot, { recursive: true });
3131
+ const tmpPrefix = `.${REMNIC_EXTENSION_DIR_NAME}.tmp-`;
3132
+ const STALE_TMP_THRESHOLD_MS = 10 * 60 * 1e3;
3133
+ const now = Date.now();
3134
+ try {
3135
+ const existingEntries = fs4.readdirSync(paths.extensionsRoot);
3136
+ for (const entry of existingEntries) {
3137
+ if (!entry.startsWith(tmpPrefix)) continue;
3138
+ const stalePath = path4.join(paths.extensionsRoot, entry);
3139
+ try {
3140
+ const stat = fs4.statSync(stalePath);
3141
+ const ageMs = now - stat.mtimeMs;
3142
+ if (ageMs < STALE_TMP_THRESHOLD_MS) {
3143
+ continue;
3144
+ }
3145
+ fs4.rmSync(stalePath, { recursive: true, force: true });
3146
+ } catch {
3147
+ }
3148
+ }
3149
+ } catch {
3150
+ }
3151
+ const tmpName = `${tmpPrefix}${process.pid}-${Date.now()}`;
3152
+ const tmpDir = path4.join(paths.extensionsRoot, tmpName);
3153
+ let filesCopied = 0;
3154
+ let commitFn = () => {
3155
+ };
3156
+ let rollbackFn = () => {
3157
+ };
3158
+ try {
3159
+ filesCopied = copyDirRecursiveSync(sourceDir, tmpDir);
3160
+ const backupDir = `${paths.remnicExtensionDir}.bak-${Date.now()}`;
3161
+ const hadExisting = fs4.existsSync(paths.remnicExtensionDir);
3162
+ if (hadExisting) {
3163
+ fs4.renameSync(paths.remnicExtensionDir, backupDir);
3164
+ }
3165
+ try {
3166
+ fs4.renameSync(tmpDir, paths.remnicExtensionDir);
3167
+ } catch (renameErr) {
3168
+ if (hadExisting) {
3169
+ try {
3170
+ fs4.renameSync(backupDir, paths.remnicExtensionDir);
3171
+ } catch {
3172
+ }
3173
+ }
3174
+ throw renameErr;
3175
+ }
3176
+ commitFn = () => {
3177
+ if (hadExisting) {
3178
+ try {
3179
+ fs4.rmSync(backupDir, { recursive: true, force: true });
3180
+ } catch {
3181
+ }
3182
+ }
3183
+ };
3184
+ rollbackFn = () => {
3185
+ if (hadExisting) {
3186
+ try {
3187
+ if (fs4.existsSync(paths.remnicExtensionDir)) {
3188
+ fs4.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
3189
+ }
3190
+ fs4.renameSync(backupDir, paths.remnicExtensionDir);
3191
+ } catch {
3192
+ }
3193
+ } else {
3194
+ try {
3195
+ if (fs4.existsSync(paths.remnicExtensionDir)) {
3196
+ fs4.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
3197
+ }
3198
+ } catch {
3199
+ }
3200
+ }
3201
+ };
3202
+ } catch (err) {
3203
+ if (fs4.existsSync(tmpDir)) {
3204
+ try {
3205
+ fs4.rmSync(tmpDir, { recursive: true, force: true });
3206
+ } catch {
3207
+ }
3208
+ }
3209
+ throw err;
3210
+ }
3211
+ const instructionsPath = path4.join(paths.remnicExtensionDir, "instructions.md");
3212
+ return {
3213
+ ...paths,
3214
+ instructionsPath,
3215
+ filesCopied,
3216
+ commit: commitFn,
3217
+ rollback: rollbackFn
3218
+ };
3219
+ }
3220
+ function removeCodexMemoryExtension(options = {}) {
3221
+ const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
3222
+ let removed = false;
3223
+ if (fs4.existsSync(paths.remnicExtensionDir)) {
3224
+ fs4.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
3225
+ removed = true;
3226
+ }
3227
+ return { ...paths, removed };
3228
+ }
3229
+ var WECLONE_PROXY_CONFIG_DIRNAME = ".remnic";
3230
+ var WECLONE_PROXY_CONFIG_FILENAME = "weclone.json";
3231
+ function resolveWeCloneProxyConfigPath() {
3232
+ const remnicHome = readEnvVar("REMNIC_HOME");
3233
+ const override = remnicHome && remnicHome.length > 0 ? remnicHome : readEnvVar("ENGRAM_HOME");
3234
+ if (override && override.length > 0) {
3235
+ return path4.resolve(expandTildePath(override), "connectors", WECLONE_PROXY_CONFIG_FILENAME);
3236
+ }
3237
+ const envHome = readEnvVar("HOME");
3238
+ const home = envHome && envHome.length > 0 ? envHome : os2.homedir();
3239
+ return path4.resolve(
3240
+ home,
3241
+ WECLONE_PROXY_CONFIG_DIRNAME,
3242
+ "connectors",
3243
+ WECLONE_PROXY_CONFIG_FILENAME
3244
+ );
3245
+ }
3246
+ function readWeCloneProxyConfigIfExists(configPath) {
3247
+ try {
3248
+ if (!fs4.existsSync(configPath)) return null;
3249
+ return fs4.readFileSync(configPath, "utf8");
3250
+ } catch {
3251
+ return null;
3252
+ }
3253
+ }
3254
+ function safeParseJson(raw) {
3255
+ try {
3256
+ const parsed = JSON.parse(raw);
3257
+ if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
3258
+ return parsed;
3259
+ }
3260
+ return null;
3261
+ } catch {
3262
+ return null;
3263
+ }
3264
+ }
3265
+ var WECLONE_DEFAULTS = {
3266
+ wecloneApiUrl: "http://localhost:8000/v1",
3267
+ wecloneModelName: "weclone-avatar",
3268
+ proxyPort: 8100,
3269
+ remnicDaemonUrl: "http://localhost:4318",
3270
+ sessionStrategy: "single",
3271
+ memoryInjection: {
3272
+ maxTokens: 1500,
3273
+ position: "system-append",
3274
+ template: "[Memory Context]\n{memories}\n[End Memory Context]"
3275
+ }
3276
+ };
3277
+ function resolveStringField(userConfig, priorConfig, key, fallback) {
3278
+ const fromUser = userConfig[key];
3279
+ if (typeof fromUser === "string" && fromUser.length > 0) return fromUser;
3280
+ if (priorConfig) {
3281
+ const fromPrior = priorConfig[key];
3282
+ if (typeof fromPrior === "string" && fromPrior.length > 0) return fromPrior;
3283
+ }
3284
+ return fallback;
3285
+ }
3286
+ function coercePort(value) {
3287
+ if (typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 65535) {
3288
+ return value;
3289
+ }
3290
+ if (typeof value === "string" && value.length > 0) {
3291
+ const n = Number(value);
3292
+ if (Number.isInteger(n) && n >= 1 && n <= 65535) return n;
3293
+ }
3294
+ return null;
3295
+ }
3296
+ function resolvePort(userConfig, priorConfig, fallback) {
3297
+ const fromUser = coercePort(userConfig.proxyPort);
3298
+ if (fromUser !== null) return fromUser;
3299
+ if (priorConfig) {
3300
+ const fromPrior = coercePort(priorConfig.proxyPort);
3301
+ if (fromPrior !== null) return fromPrior;
3302
+ }
3303
+ return fallback;
3304
+ }
3305
+ function resolveSessionStrategy(userConfig, priorConfig) {
3306
+ const valid = /* @__PURE__ */ new Set(["caller-id", "single"]);
3307
+ const fromUser = userConfig.sessionStrategy;
3308
+ if (typeof fromUser === "string" && valid.has(fromUser)) {
3309
+ return fromUser;
3310
+ }
3311
+ if (priorConfig) {
3312
+ const fromPrior = priorConfig.sessionStrategy;
3313
+ if (typeof fromPrior === "string" && valid.has(fromPrior)) {
3314
+ return fromPrior;
3315
+ }
3316
+ }
3317
+ return WECLONE_DEFAULTS.sessionStrategy;
3318
+ }
3319
+ function buildWeCloneProxyConfig(args) {
3320
+ const { userConfig, priorConfig, authToken } = args;
3321
+ const wecloneApiUrl = resolveStringField(
3322
+ userConfig,
3323
+ priorConfig,
3324
+ "wecloneApiUrl",
3325
+ WECLONE_DEFAULTS.wecloneApiUrl
3326
+ );
3327
+ const wecloneModelName = resolveStringField(
3328
+ userConfig,
3329
+ priorConfig,
3330
+ "wecloneModelName",
3331
+ WECLONE_DEFAULTS.wecloneModelName
3332
+ );
3333
+ const remnicDaemonUrl = resolveStringField(
3334
+ userConfig,
3335
+ priorConfig,
3336
+ "remnicDaemonUrl",
3337
+ WECLONE_DEFAULTS.remnicDaemonUrl
3338
+ );
3339
+ const proxyPort = resolvePort(
3340
+ userConfig,
3341
+ priorConfig,
3342
+ WECLONE_DEFAULTS.proxyPort
3343
+ );
3344
+ const sessionStrategy = resolveSessionStrategy(userConfig, priorConfig);
3345
+ const memoryInjection = {
3346
+ ...WECLONE_DEFAULTS.memoryInjection,
3347
+ ...priorConfig && typeof priorConfig.memoryInjection === "object" && priorConfig.memoryInjection !== null && !Array.isArray(priorConfig.memoryInjection) ? priorConfig.memoryInjection : {},
3348
+ ...typeof userConfig.memoryInjection === "object" && userConfig.memoryInjection !== null && !Array.isArray(userConfig.memoryInjection) ? userConfig.memoryInjection : {}
3349
+ };
3350
+ const config = {
3351
+ wecloneApiUrl,
3352
+ wecloneModelName,
3353
+ proxyPort,
3354
+ remnicDaemonUrl,
3355
+ sessionStrategy,
3356
+ memoryInjection
3357
+ };
3358
+ if (authToken && authToken.length > 0) {
3359
+ config.remnicAuthToken = authToken;
3360
+ } else if (typeof userConfig.remnicAuthToken === "string" && userConfig.remnicAuthToken.length > 0) {
3361
+ config.remnicAuthToken = userConfig.remnicAuthToken;
3362
+ } else if (priorConfig && typeof priorConfig.remnicAuthToken === "string" && priorConfig.remnicAuthToken.length > 0) {
3363
+ config.remnicAuthToken = priorConfig.remnicAuthToken;
3364
+ }
3365
+ return config;
3366
+ }
3367
+
3368
+ export {
3369
+ DROID_CONNECTOR_MANIFEST,
3370
+ resolveFactoryMcpPath,
3371
+ upsertFactoryMcpRemnicEntry,
3372
+ removeFactoryMcpRemnicEntry,
3373
+ MARKETPLACE_SCHEMA_VERSION,
3374
+ MARKETPLACE_MANIFEST_FILENAME,
3375
+ generateMarketplaceManifest,
3376
+ validateMarketplaceManifest,
3377
+ checkMarketplaceManifest,
3378
+ writeMarketplaceManifest,
3379
+ installFromMarketplace,
3380
+ BUILTIN_CONNECTORS,
3381
+ CONNECTOR_ID_PATTERN,
3382
+ isValidConnectorId,
3383
+ loadRegistry,
3384
+ saveRegistry,
3385
+ listConnectors,
3386
+ getConnectorToken,
3387
+ installConnector,
3388
+ removeConnector,
3389
+ upsertHermesConfig,
3390
+ removeHermesConfig,
3391
+ doctorConnector,
3392
+ resolveCodexHome,
3393
+ resolveCodexMemoryExtensionPaths,
3394
+ locatePluginCodexExtensionSource,
3395
+ installCodexMemoryExtension,
3396
+ removeCodexMemoryExtension,
3397
+ resolveWeCloneProxyConfigPath,
3398
+ buildWeCloneProxyConfig
3399
+ };
3400
+ //# sourceMappingURL=chunk-GK6NOQE6.js.map