@remnic/core 9.69.38 → 9.69.40

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 (656) hide show
  1. package/dist/access-admin-ops-surface.d.ts +16 -14
  2. package/dist/access-admin-ops-surface.js +39 -39
  3. package/dist/access-authorization-probe.d.ts +16 -14
  4. package/dist/access-authorization-probe.js +40 -40
  5. package/dist/access-boundary.d.ts +16 -14
  6. package/dist/access-boundary.js +39 -39
  7. package/dist/access-cli.js +107 -105
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +16 -14
  11. package/dist/access-extraction-force-flush.js +39 -39
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-briefing.d.ts +16 -14
  14. package/dist/access-http-briefing.js +40 -40
  15. package/dist/access-http-lcm-compaction.d.ts +16 -14
  16. package/dist/access-http-lifecycle-flush.d.ts +16 -14
  17. package/dist/access-http-offline-stream.d.ts +16 -14
  18. package/dist/access-http-query.d.ts +2 -2
  19. package/dist/access-http-query.js +41 -41
  20. package/dist/access-http.d.ts +17 -15
  21. package/dist/access-http.js +58 -58
  22. package/dist/access-identity-continuity-surface.d.ts +13 -12
  23. package/dist/access-identity-continuity-surface.js +39 -39
  24. package/dist/access-lcm-surface.d.ts +16 -14
  25. package/dist/access-lcm-surface.js +39 -39
  26. package/dist/access-mcp.d.ts +16 -14
  27. package/dist/access-mcp.js +47 -47
  28. package/dist/access-memory-search-fanout.d.ts +2 -2
  29. package/dist/{access-namespace-preflight-DY4z6L5X.d.ts → access-namespace-preflight-CKBumJ8W.d.ts} +1 -1
  30. package/dist/access-namespace-preflight.d.ts +3 -3
  31. package/dist/access-namespace-preflight.js +39 -39
  32. package/dist/access-observe-transcript.d.ts +13 -12
  33. package/dist/access-observe-write-category.d.ts +1 -1
  34. package/dist/access-observe-write-category.js +2 -2
  35. package/dist/access-observe-write-surface.d.ts +16 -14
  36. package/dist/access-observe-write-surface.js +39 -39
  37. package/dist/access-offline-manifest.d.ts +37 -13
  38. package/dist/access-offline-manifest.js +7 -3
  39. package/dist/access-operations-batch.js +41 -41
  40. package/dist/access-operations.d.ts +16 -14
  41. package/dist/access-operations.js +46 -46
  42. package/dist/access-recall-concurrency.d.ts +16 -14
  43. package/dist/access-recall-concurrency.js +39 -39
  44. package/dist/access-recall-response.d.ts +16 -14
  45. package/dist/access-recall-response.js +39 -39
  46. package/dist/access-recall-surface.d.ts +16 -14
  47. package/dist/access-recall-surface.js +39 -39
  48. package/dist/access-schema.d.ts +5 -3
  49. package/dist/access-schema.js +1 -1
  50. package/dist/{access-service-gBcdRUHY.d.ts → access-service-DJ3qogNt.d.ts} +8 -8
  51. package/dist/access-service-helpers.d.ts +16 -14
  52. package/dist/access-service.d.ts +16 -14
  53. package/dist/access-service.js +39 -39
  54. package/dist/access-surface-catalog.d.ts +16 -14
  55. package/dist/access-surface-catalog.js +41 -41
  56. package/dist/access-wearables-meetings-surface.d.ts +6 -5
  57. package/dist/action-confidence.d.ts +1 -1
  58. package/dist/active-memory-bridge.d.ts +1 -1
  59. package/dist/active-recall.d.ts +1 -1
  60. package/dist/active-recall.js +6 -5
  61. package/dist/active-recall.js.map +1 -1
  62. package/dist/activity/digest.d.ts +1 -1
  63. package/dist/adapters/index.js +4 -4
  64. package/dist/adapters/registry.js +2 -2
  65. package/dist/ambient-provenance.d.ts +1 -1
  66. package/dist/artifact-search.d.ts +1 -1
  67. package/dist/{auto-sync-RP4C6ZPF.js → auto-sync-D6BAPIJV.js} +5 -5
  68. package/dist/background-generation-config.d.ts +1 -1
  69. package/dist/background-generation-config.js +3 -1
  70. package/dist/background-generation.d.ts +1 -1
  71. package/dist/behavior-learner.d.ts +1 -1
  72. package/dist/behavior-signals.d.ts +1 -1
  73. package/dist/bootstrap.d.ts +13 -12
  74. package/dist/briefing-window.d.ts +2 -2
  75. package/dist/briefing.d.ts +2 -2
  76. package/dist/briefing.js +16 -16
  77. package/dist/buffer-surprise-report.d.ts +1 -1
  78. package/dist/buffer-turn-helpers.d.ts +1 -1
  79. package/dist/buffer.d.ts +2 -2
  80. package/dist/buffer.js +5 -5
  81. package/dist/bulk-import/index.d.ts +3 -3
  82. package/dist/calibration.d.ts +3 -2
  83. package/dist/calibration.js +2 -2
  84. package/dist/capabilities.d.ts +1 -1
  85. package/dist/{catalog-CW87xGx8.d.ts → catalog-BHXkBVhg.d.ts} +1 -1
  86. package/dist/causal-behavior.d.ts +1 -1
  87. package/dist/causal-consolidation.d.ts +1 -1
  88. package/dist/causal-consolidation.js +20 -19
  89. package/dist/causal-consolidation.js.map +1 -1
  90. package/dist/causal-trajectory-graph.d.ts +1 -1
  91. package/dist/{chunk-B36GUU6T.js → chunk-23HFXQ5J.js} +36 -3
  92. package/dist/chunk-23HFXQ5J.js.map +1 -0
  93. package/dist/{chunk-YFTNZMGR.js → chunk-27NO2KVB.js} +31 -8
  94. package/dist/chunk-27NO2KVB.js.map +1 -0
  95. package/dist/{chunk-T32B72QX.js → chunk-2SKMZUOW.js} +2 -2
  96. package/dist/{chunk-VHOSM5G4.js → chunk-2SNCQHJZ.js} +2 -2
  97. package/dist/{chunk-VV4ZVUE6.js → chunk-3QEVOQF5.js} +2 -2
  98. package/dist/{chunk-3N3PBBEH.js → chunk-3XPN7AVY.js} +2 -2
  99. package/dist/{chunk-XN6XT6GR.js → chunk-46Z3VGWF.js} +2 -2
  100. package/dist/{chunk-2PTNJTBE.js → chunk-4CMXI55L.js} +2 -2
  101. package/dist/{chunk-2MT4ADLQ.js → chunk-5LYSEZOF.js} +18 -9
  102. package/dist/chunk-5LYSEZOF.js.map +1 -0
  103. package/dist/{chunk-XWLLFKHM.js → chunk-62HFZNCJ.js} +19 -12
  104. package/dist/chunk-62HFZNCJ.js.map +1 -0
  105. package/dist/{chunk-VELCIWJZ.js → chunk-6L2II3KS.js} +22 -11
  106. package/dist/chunk-6L2II3KS.js.map +1 -0
  107. package/dist/{chunk-A6CKMIPK.js → chunk-7D6SER6A.js} +8 -8
  108. package/dist/{chunk-4B3HBIFX.js → chunk-7Z54NXVS.js} +2 -2
  109. package/dist/{chunk-X2NFFBTO.js → chunk-A7GQBJP5.js} +4 -4
  110. package/dist/{chunk-ACY4ZPF7.js → chunk-AEOOGXMQ.js} +10 -5
  111. package/dist/chunk-AEOOGXMQ.js.map +1 -0
  112. package/dist/{chunk-NWMUSKED.js → chunk-BGRTZOJB.js} +3 -3
  113. package/dist/{chunk-ZEGL7YCC.js → chunk-BXIJSPCL.js} +2 -2
  114. package/dist/{chunk-MLWMR2GE.js → chunk-BYQX4IOG.js} +2 -2
  115. package/dist/{chunk-ULDBGA5W.js → chunk-C5R73BON.js} +2 -2
  116. package/dist/{chunk-BD7JTBYP.js → chunk-D7MAYFQP.js} +2 -2
  117. package/dist/{chunk-V6G2PSXA.js → chunk-DAZANIYU.js} +251 -297
  118. package/dist/chunk-DAZANIYU.js.map +1 -0
  119. package/dist/{chunk-BRZWWUCJ.js → chunk-DFVSJFHK.js} +2 -2
  120. package/dist/{chunk-DPMTLJCT.js → chunk-ES5BUPYB.js} +2 -2
  121. package/dist/{chunk-MVAQ2WM3.js → chunk-G2XZFGYN.js} +6 -2
  122. package/dist/chunk-G2XZFGYN.js.map +1 -0
  123. package/dist/{chunk-TNSCIPBQ.js → chunk-G6NQ3L4T.js} +2 -2
  124. package/dist/{chunk-5N4MZLEH.js → chunk-GO5LOHCD.js} +2 -2
  125. package/dist/{chunk-AECJY3GJ.js → chunk-GSSDHAYH.js} +2 -2
  126. package/dist/{chunk-JA2QJOAX.js → chunk-HJUP3K6L.js} +2 -2
  127. package/dist/{chunk-ZKZFFWLV.js → chunk-ICNJ6J46.js} +2 -2
  128. package/dist/{chunk-6EHM2AV7.js → chunk-IMBQFHRV.js} +2 -2
  129. package/dist/{chunk-6PRY6CLC.js → chunk-IOPIGX7Y.js} +1 -1
  130. package/dist/{chunk-TRHBQVVO.js → chunk-IS2IDFJP.js} +14 -14
  131. package/dist/{chunk-R4VAUNNC.js → chunk-J4WGTN2N.js} +2 -2
  132. package/dist/{chunk-JPOX2AJB.js → chunk-J7FVMLBR.js} +2 -2
  133. package/dist/{chunk-BYZKLEWG.js → chunk-JAJIMTFB.js} +6 -6
  134. package/dist/{chunk-OKO57IXB.js → chunk-JOP7W24J.js} +11 -11
  135. package/dist/{chunk-YUW66UAH.js → chunk-JUDT33RX.js} +2 -2
  136. package/dist/{chunk-QHT7MOUF.js → chunk-K4A6UVPB.js} +22 -11
  137. package/dist/chunk-K4A6UVPB.js.map +1 -0
  138. package/dist/{chunk-UQNYPK7G.js → chunk-K4JKAXMO.js} +2 -2
  139. package/dist/{chunk-BV4ZKIZH.js → chunk-K75A5XWU.js} +3 -2
  140. package/dist/{chunk-3CBI2ZSA.js → chunk-KG2OOAFF.js} +20 -12
  141. package/dist/chunk-KG2OOAFF.js.map +1 -0
  142. package/dist/{chunk-M6HBPLBA.js → chunk-KOTG3RXE.js} +2 -2
  143. package/dist/{chunk-CWTCMZGE.js → chunk-KTOXQMW3.js} +119 -3
  144. package/dist/chunk-KTOXQMW3.js.map +1 -0
  145. package/dist/{chunk-OB3XMWX5.js → chunk-KVO2BTA4.js} +2 -2
  146. package/dist/{chunk-CBFYCDYO.js → chunk-KY236SP5.js} +3 -3
  147. package/dist/{chunk-4BCHFSC7.js → chunk-LFVZD5EC.js} +3 -3
  148. package/dist/{chunk-GGAXFTNH.js → chunk-LKFVVN7R.js} +2 -2
  149. package/dist/{chunk-IYKZJVL5.js → chunk-MDIEES23.js} +1 -1
  150. package/dist/chunk-MDIEES23.js.map +1 -0
  151. package/dist/{chunk-4RX5O34R.js → chunk-MJC7UKH7.js} +2 -2
  152. package/dist/{chunk-7S53BPTU.js → chunk-MVG3KXON.js} +69 -22
  153. package/dist/chunk-MVG3KXON.js.map +1 -0
  154. package/dist/chunk-NETQXOPY.js +221 -0
  155. package/dist/chunk-NETQXOPY.js.map +1 -0
  156. package/dist/{chunk-UZZ7SQT3.js → chunk-NVVZPBKI.js} +2 -2
  157. package/dist/{chunk-BLDBT6HZ.js → chunk-PJRKLB4Z.js} +18 -2
  158. package/dist/chunk-PJRKLB4Z.js.map +1 -0
  159. package/dist/{chunk-TTSJ7WUC.js → chunk-PKUJNICO.js} +2 -2
  160. package/dist/{chunk-QMWKENNK.js → chunk-Q4AUIFUA.js} +4 -4
  161. package/dist/{chunk-G43PMSME.js → chunk-QE6YVNP5.js} +7 -7
  162. package/dist/{chunk-WKDFJXW5.js → chunk-QM2SPLKQ.js} +1 -1
  163. package/dist/chunk-QM2SPLKQ.js.map +1 -0
  164. package/dist/{chunk-GT4ZHOKT.js → chunk-QPVNK2VE.js} +2 -2
  165. package/dist/{chunk-K5DA5TRG.js → chunk-QS5Q5RBV.js} +2 -2
  166. package/dist/{chunk-BX4EOMKT.js → chunk-RDLPFM7I.js} +2 -2
  167. package/dist/{chunk-EY5JAWZC.js → chunk-RJQAP333.js} +2 -2
  168. package/dist/{chunk-5AERZWJD.js → chunk-RLU2Y5GV.js} +4 -4
  169. package/dist/chunk-RLU2Y5GV.js.map +1 -0
  170. package/dist/{chunk-2OGTN37H.js → chunk-ROEFLU37.js} +4 -4
  171. package/dist/{chunk-62QIQEUC.js → chunk-SFHLQPBF.js} +25 -25
  172. package/dist/chunk-SK7D34OL.js +68 -0
  173. package/dist/chunk-SK7D34OL.js.map +1 -0
  174. package/dist/{chunk-HVS7TH2Y.js → chunk-SUEOG2S4.js} +2 -2
  175. package/dist/{chunk-74AHCL56.js → chunk-TEMKBSV6.js} +2 -2
  176. package/dist/{chunk-LQNRVPTV.js → chunk-THTF2W7M.js} +151 -118
  177. package/dist/chunk-THTF2W7M.js.map +1 -0
  178. package/dist/{chunk-KDFDXEXZ.js → chunk-TO36VPZI.js} +2 -2
  179. package/dist/{chunk-BJEJUOGM.js → chunk-TZ44E732.js} +44 -6
  180. package/dist/chunk-TZ44E732.js.map +1 -0
  181. package/dist/{chunk-JXN77SGO.js → chunk-U2VDCFXW.js} +1 -1
  182. package/dist/chunk-U2VDCFXW.js.map +1 -0
  183. package/dist/{chunk-3OYSIVOO.js → chunk-UZ6JYPJ6.js} +611 -289
  184. package/dist/chunk-UZ6JYPJ6.js.map +1 -0
  185. package/dist/{chunk-M3MYMWXG.js → chunk-V2ZA4YWE.js} +2 -2
  186. package/dist/{chunk-UIOIDW3L.js → chunk-VHKXRYQN.js} +2 -2
  187. package/dist/{chunk-GAS7KYC7.js → chunk-VKWFNPBH.js} +2 -2
  188. package/dist/{chunk-6H2G7RFT.js → chunk-VNQRRUNS.js} +11 -10
  189. package/dist/chunk-VNQRRUNS.js.map +1 -0
  190. package/dist/{chunk-XGRXQR6T.js → chunk-VQWBUPSJ.js} +2 -2
  191. package/dist/{chunk-TUKGXQ5T.js → chunk-VQYWKCDR.js} +2 -2
  192. package/dist/{chunk-PPQEP4OH.js → chunk-W23JARAQ.js} +2 -2
  193. package/dist/{chunk-YQNNHLCG.js → chunk-WPGR3RW4.js} +2 -2
  194. package/dist/{chunk-474DL7UB.js → chunk-WZYHPAG5.js} +3 -3
  195. package/dist/{chunk-5HYUUFMQ.js → chunk-XCPNH2MG.js} +259 -10
  196. package/dist/chunk-XCPNH2MG.js.map +1 -0
  197. package/dist/{chunk-GQQVEH6V.js → chunk-XM46Y66S.js} +2 -2
  198. package/dist/{chunk-JNSENHV5.js → chunk-YRIFXXMI.js} +3 -3
  199. package/dist/{chunk-TRLOFIQC.js → chunk-YTK5MVNF.js} +2 -2
  200. package/dist/{chunk-VMNCZ627.js → chunk-YTZN2UZO.js} +2 -2
  201. package/dist/chunk-Z4GUX2M6.js +94 -0
  202. package/dist/chunk-Z4GUX2M6.js.map +1 -0
  203. package/dist/{chunk-6ZMNTRU3.js → chunk-ZAEPD4C2.js} +2 -2
  204. package/dist/{chunk-KQW3YGEN.js → chunk-ZRMMXWYI.js} +2 -2
  205. package/dist/{chunk-P4ZAEYKG.js → chunk-ZX3AYNNV.js} +6 -3
  206. package/dist/chunk-ZX3AYNNV.js.map +1 -0
  207. package/dist/{chunk-MCRVQ5YQ.js → chunk-ZZCR2QYL.js} +2 -2
  208. package/dist/{cli-BNg-TAlz.d.ts → cli-BWri5-am.d.ts} +5 -5
  209. package/dist/cli.d.ts +18 -16
  210. package/dist/cli.js +80 -79
  211. package/dist/coding/export-okf-codegraph.d.ts +1 -1
  212. package/dist/coding/export-okf-codegraph.js +15 -15
  213. package/dist/coding/pre-action-gate.d.ts +1 -1
  214. package/dist/compounding/engine.d.ts +2 -2
  215. package/dist/compounding/engine.js +16 -16
  216. package/dist/compounding/preference-consolidator.d.ts +1 -1
  217. package/dist/compression-optimizer.d.ts +1 -1
  218. package/dist/config.d.ts +1 -1
  219. package/dist/config.js +6 -5
  220. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  221. package/dist/connectors/codex-materialize-runner.js +16 -16
  222. package/dist/connectors/codex-materialize.d.ts +1 -1
  223. package/dist/connectors/index.d.ts +1 -1
  224. package/dist/connectors/index.js +16 -16
  225. package/dist/consolidation-provenance-check.d.ts +2 -2
  226. package/dist/consolidation-undo.d.ts +2 -2
  227. package/dist/contradiction/index.d.ts +6 -5
  228. package/dist/converge-config.d.ts +1 -1
  229. package/dist/convergence-refresh.d.ts +2 -2
  230. package/dist/convergence-refresh.js +18 -18
  231. package/dist/conversation-index/backend.d.ts +1 -1
  232. package/dist/conversation-index/chunker.d.ts +1 -1
  233. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  234. package/dist/conversation-index/indexer.d.ts +1 -1
  235. package/dist/conversation-index/search.d.ts +1 -1
  236. package/dist/corpus-watermark.d.ts +1 -1
  237. package/dist/corpus-watermark.js +18 -18
  238. package/dist/cross-lingual-recall.d.ts +1 -1
  239. package/dist/day-summary.d.ts +1 -1
  240. package/dist/deep-recall-http-glue.d.ts +16 -14
  241. package/dist/deep-recall-http-glue.js +2 -2
  242. package/dist/deep-recall-mcp-tools.d.ts +16 -14
  243. package/dist/deep-recall-policy-llm.d.ts +4 -3
  244. package/dist/deep-recall-policy-llm.js +3 -3
  245. package/dist/deep-recall-seeds.d.ts +1 -1
  246. package/dist/delinearize.d.ts +1 -1
  247. package/dist/dependency-propagation-config.d.ts +1 -1
  248. package/dist/{dependency-propagation-delivery-Cq1ekOwV.d.ts → dependency-propagation-delivery-ueZlKTQB.d.ts} +1 -1
  249. package/dist/direct-answer-wiring.d.ts +1 -1
  250. package/dist/direct-answer.d.ts +1 -1
  251. package/dist/embedding-fallback.d.ts +1 -1
  252. package/dist/enrichment/index.d.ts +1 -1
  253. package/dist/entity-origin-fields.d.ts +1 -1
  254. package/dist/entity-retrieval.d.ts +2 -2
  255. package/dist/entity-retrieval.js +16 -16
  256. package/dist/entity-schema.d.ts +1 -1
  257. package/dist/episodic-context.d.ts +1 -1
  258. package/dist/eval-trajectory-contracts.d.ts +1 -1
  259. package/dist/eval-trajectory-store.d.ts +1 -1
  260. package/dist/eval-trajectory.d.ts +1 -1
  261. package/dist/explicit-capture.d.ts +13 -12
  262. package/dist/external-wiki-access.d.ts +16 -14
  263. package/dist/external-wiki-access.js +40 -40
  264. package/dist/external-wiki-collection-registration.d.ts +1 -1
  265. package/dist/external-wiki-collection.d.ts +1 -1
  266. package/dist/external-wiki-mcp-tools.d.ts +16 -14
  267. package/dist/extraction-error-classification.d.ts +14 -3
  268. package/dist/extraction-error-classification.js +5 -3
  269. package/dist/extraction-faithfulness.d.ts +4 -3
  270. package/dist/extraction-faithfulness.js +3 -3
  271. package/dist/extraction-judge-telemetry.d.ts +4 -3
  272. package/dist/extraction-judge-training.d.ts +4 -3
  273. package/dist/extraction-judge.d.ts +4 -3
  274. package/dist/extraction-judge.js +3 -3
  275. package/dist/extraction-liveness.d.ts +1 -1
  276. package/dist/extraction-normalization.d.ts +1 -1
  277. package/dist/extraction-prompt.d.ts +1 -1
  278. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  279. package/dist/extraction-source-grounding.d.ts +1 -1
  280. package/dist/extraction-span-config.d.ts +1 -1
  281. package/dist/extraction-span-materialize.d.ts +1 -1
  282. package/dist/extraction.d.ts +4 -4
  283. package/dist/extraction.js +26 -24
  284. package/dist/fallback-llm-codex-subscription.d.ts +52 -7
  285. package/dist/fallback-llm-codex-subscription.js +17 -1
  286. package/dist/fallback-llm.d.ts +25 -28
  287. package/dist/fallback-llm.js +4 -3
  288. package/dist/{generic-recall-paths-BcySh_f9.d.ts → generic-recall-paths-CpyVmA88.d.ts} +1 -1
  289. package/dist/graph-append-error.d.ts +1 -1
  290. package/dist/graph-dashboard-diff.d.ts +1 -1
  291. package/dist/graph-dashboard-key.d.ts +1 -1
  292. package/dist/graph-dashboard-parser.d.ts +1 -1
  293. package/dist/graph-edge-reinforcement.d.ts +1 -1
  294. package/dist/graph-jsonl.d.ts +1 -1
  295. package/dist/graph-path-reconstruction.d.ts +1 -1
  296. package/dist/graph-path-scoring.d.ts +1 -1
  297. package/dist/graph-snapshot.d.ts +1 -1
  298. package/dist/graph.d.ts +1 -1
  299. package/dist/harmonic-retrieval.js +1 -1
  300. package/dist/importance.d.ts +1 -1
  301. package/dist/importers/index.d.ts +1 -1
  302. package/dist/importers/test-utils.d.ts +1 -1
  303. package/dist/in-flight-reads.d.ts +1 -1
  304. package/dist/{index-DWOb4wz9.d.ts → index-BvUA4S7M.d.ts} +3 -3
  305. package/dist/index.d.ts +80 -40
  306. package/dist/index.js +140 -115
  307. package/dist/intent.d.ts +1 -1
  308. package/dist/lcm/engine.d.ts +1 -1
  309. package/dist/lcm/engine.js +2 -2
  310. package/dist/lcm/index.d.ts +1 -1
  311. package/dist/lcm/index.js +7 -7
  312. package/dist/lcm/tools.d.ts +1 -1
  313. package/dist/lifecycle.d.ts +1 -1
  314. package/dist/live-connectors-runner.d.ts +1 -1
  315. package/dist/local-llm-BsJGulur.d.ts +247 -0
  316. package/dist/local-llm-config.d.ts +4 -1
  317. package/dist/local-llm-config.js +4 -2
  318. package/dist/local-llm-helpers.d.ts +18 -69
  319. package/dist/local-llm-helpers.js +1 -1
  320. package/dist/local-llm.d.ts +3 -170
  321. package/dist/local-llm.js +2 -2
  322. package/dist/local-model-endpoint.d.ts +1 -1
  323. package/dist/location/index.d.ts +3 -3
  324. package/dist/location/index.js +18 -18
  325. package/dist/maintenance/memory-governance.d.ts +1 -1
  326. package/dist/maintenance/memory-governance.js +16 -16
  327. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  328. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +16 -16
  329. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  330. package/dist/maintenance/rebuild-memory-projection.js +17 -17
  331. package/dist/{maintenance-CW9wCzMP.d.ts → maintenance-CYubtIRr.d.ts} +9 -3
  332. package/dist/mcp-memory-inspector-app.d.ts +16 -14
  333. package/dist/memory-action-policy.d.ts +1 -1
  334. package/dist/memory-cache.d.ts +1 -1
  335. package/dist/memory-controller.d.ts +1 -1
  336. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  337. package/dist/memory-projection-store.d.ts +1 -1
  338. package/dist/memory-provenance.d.ts +1 -1
  339. package/dist/memory-snapshot.d.ts +1 -1
  340. package/dist/memory-subject-cli.d.ts +16 -14
  341. package/dist/memory-subject.d.ts +16 -14
  342. package/dist/memory-worth-outcomes.d.ts +2 -2
  343. package/dist/models-json.d.ts +1 -1
  344. package/dist/namespaces/migrate.d.ts +3 -3
  345. package/dist/namespaces/migrate.js +17 -17
  346. package/dist/namespaces/principal.d.ts +1 -1
  347. package/dist/namespaces/search.d.ts +12 -1
  348. package/dist/namespaces/search.js +9 -9
  349. package/dist/namespaces/storage.d.ts +3 -3
  350. package/dist/namespaces/storage.js +16 -16
  351. package/dist/native-knowledge.d.ts +1 -1
  352. package/dist/offline-sync-impression-drain.d.ts +1 -1
  353. package/dist/operator-doctor-corpus.d.ts +1 -1
  354. package/dist/operator-doctor-corpus.js +19 -19
  355. package/dist/operator-doctor-replica.d.ts +1 -1
  356. package/dist/operator-toolkit.d.ts +3 -3
  357. package/dist/operator-toolkit.js +30 -29
  358. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  359. package/dist/orchestration/maintenance.d.ts +4 -4
  360. package/dist/orchestration/maintenance.js +27 -27
  361. package/dist/{orchestrator-DocO0_hw.d.ts → orchestrator-BWDRJ_0d.d.ts} +37 -13
  362. package/dist/orchestrator.d.ts +13 -12
  363. package/dist/orchestrator.js +110 -106
  364. package/dist/patterns-cli.d.ts +1 -1
  365. package/dist/{pipeline-CiYcqqhl.d.ts → pipeline-7JMn2yMH.d.ts} +1 -1
  366. package/dist/policy-runtime.d.ts +1 -1
  367. package/dist/proactive-contention.d.ts +2 -2
  368. package/dist/provenance.d.ts +1 -1
  369. package/dist/{public-http-C0FoTiL_.d.ts → public-http-CJWs3mo9.d.ts} +1 -1
  370. package/dist/{qmd-qXD4vatU.d.ts → qmd-CxCH9G9m.d.ts} +2 -2
  371. package/dist/qmd-preflight.d.ts +2 -2
  372. package/dist/qmd-recall-cache.d.ts +1 -1
  373. package/dist/qmd.d.ts +2 -2
  374. package/dist/qmd.js +2 -2
  375. package/dist/recall-concurrency-config.d.ts +1 -1
  376. package/dist/recall-disclosure-escalation.d.ts +1 -1
  377. package/dist/recall-explain-renderer.d.ts +1 -1
  378. package/dist/recall-explain-renderer.js +3 -3
  379. package/dist/recall-memory-map.d.ts +1 -1
  380. package/dist/recall-navigate-access.d.ts +1 -1
  381. package/dist/recall-navigate-access.js +2 -2
  382. package/dist/recall-navigate-disclosure.d.ts +1 -1
  383. package/dist/recall-navigate-disclosure.js +1 -1
  384. package/dist/recall-navigate.d.ts +1 -1
  385. package/dist/recall-navigate.js +2 -2
  386. package/dist/recall-planner-llm.d.ts +3 -2
  387. package/dist/recall-planner-llm.js +4 -3
  388. package/dist/recall-planner-llm.js.map +1 -1
  389. package/dist/recall-state-view-admission.d.ts +13 -3
  390. package/dist/recall-state-view-admission.js +8 -8
  391. package/dist/recall-state-view-anchors.d.ts +85 -0
  392. package/dist/recall-state-view-anchors.js +21 -0
  393. package/dist/recall-state-view-anchors.js.map +1 -0
  394. package/dist/recall-state-view-inject.js +2 -2
  395. package/dist/recall-state-view-render.js +2 -2
  396. package/dist/recall-state-view-widen.js +2 -2
  397. package/dist/recall-state-view-wire.js +3 -3
  398. package/dist/recall-state-view.d.ts +38 -1
  399. package/dist/recall-state-view.js +11 -3
  400. package/dist/recall-state.d.ts +1 -1
  401. package/dist/recall-tag-filter.d.ts +1 -1
  402. package/dist/recall-timings.d.ts +1 -1
  403. package/dist/recall-xray-cli.d.ts +1 -1
  404. package/dist/recall-xray-cli.js +4 -4
  405. package/dist/recall-xray-renderer.d.ts +1 -1
  406. package/dist/recall-xray-renderer.js +3 -3
  407. package/dist/recall-xray.d.ts +1 -1
  408. package/dist/recall-xray.js +2 -2
  409. package/dist/reconcile/cursor.d.ts +1 -1
  410. package/dist/reconcile/manifest.d.ts +1 -1
  411. package/dist/reconcile/plan.d.ts +1 -1
  412. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  413. package/dist/replay/normalizers/claude.d.ts +1 -1
  414. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  415. package/dist/replay/normalizers/shared.d.ts +1 -1
  416. package/dist/replay/runner.d.ts +1 -1
  417. package/dist/replay/types.d.ts +1 -1
  418. package/dist/replica-divergence.d.ts +1 -1
  419. package/dist/replica-peers-config.d.ts +1 -1
  420. package/dist/resolve-auth-token.d.ts +1 -1
  421. package/dist/resume-bundles.js +7 -6
  422. package/dist/retrieval-agents.d.ts +2 -2
  423. package/dist/retrieval-tiers.d.ts +1 -1
  424. package/dist/routing/engine.d.ts +1 -1
  425. package/dist/routing/store.d.ts +1 -1
  426. package/dist/salvage-envelope.d.ts +1 -1
  427. package/dist/{scope-profiles-BT9rqC3w.d.ts → scope-profiles-BGAUqhBR.d.ts} +1 -1
  428. package/dist/search/embed-helper.d.ts +1 -1
  429. package/dist/search/factory.d.ts +1 -1
  430. package/dist/search/factory.js +8 -8
  431. package/dist/search/index.d.ts +1 -1
  432. package/dist/search/index.js +12 -12
  433. package/dist/search/lancedb-backend.d.ts +1 -1
  434. package/dist/search/lancedb-backend.js +2 -2
  435. package/dist/search/meilisearch-backend.d.ts +1 -1
  436. package/dist/search/meilisearch-backend.js +2 -2
  437. package/dist/search/noop-backend.d.ts +1 -1
  438. package/dist/search/orama-backend.d.ts +1 -1
  439. package/dist/search/orama-backend.js +2 -2
  440. package/dist/search/port.d.ts +2 -2
  441. package/dist/search/port.js +1 -1
  442. package/dist/search/remote-backend.d.ts +1 -1
  443. package/dist/search/remote-backend.js +2 -2
  444. package/dist/{semantic-consolidation-CmZi7thY.d.ts → semantic-consolidation-CCeRD9pV.d.ts} +1 -1
  445. package/dist/semantic-consolidation.d.ts +2 -2
  446. package/dist/semantic-consolidation.js +17 -17
  447. package/dist/semantic-rule-promotion.js +16 -16
  448. package/dist/semantic-rule-verifier.d.ts +1 -1
  449. package/dist/semantic-rule-verifier.js +16 -16
  450. package/dist/{service-CLkA7AQB.d.ts → service-BwpzRduk.d.ts} +2 -2
  451. package/dist/session-observer-bands.d.ts +1 -1
  452. package/dist/session-observer-state.d.ts +1 -1
  453. package/dist/shared-context/manager.d.ts +1 -1
  454. package/dist/signal.d.ts +1 -1
  455. package/dist/source-agent-qualifier.d.ts +1 -1
  456. package/dist/source-agent-qualifier.js +19 -19
  457. package/dist/standup/build.js +16 -16
  458. package/dist/{storage-wvX01lht.d.ts → storage-BprAGBG0.d.ts} +2 -1
  459. package/dist/storage.d.ts +2 -2
  460. package/dist/storage.js +15 -15
  461. package/dist/subject-config.d.ts +1 -1
  462. package/dist/summarizer.d.ts +1 -1
  463. package/dist/summarizer.js +5 -5
  464. package/dist/summary-snapshot.d.ts +1 -1
  465. package/dist/support-passport/index.d.ts +18 -17
  466. package/dist/support-passport/index.js +42 -42
  467. package/dist/task-llm-config.d.ts +16 -0
  468. package/dist/task-llm-config.js +12 -0
  469. package/dist/task-llm-config.js.map +1 -0
  470. package/dist/temporal-supersession.d.ts +2 -2
  471. package/dist/temporal-timeline-recall.d.ts +1 -1
  472. package/dist/temporal-validity.d.ts +1 -1
  473. package/dist/threading.d.ts +1 -1
  474. package/dist/tier-migration.d.ts +2 -2
  475. package/dist/tier-routing.d.ts +1 -1
  476. package/dist/topics.d.ts +1 -1
  477. package/dist/transcript.d.ts +1 -1
  478. package/dist/transfer/export-okf.d.ts +1 -1
  479. package/dist/transfer/export-okf.js +16 -16
  480. package/dist/trust-score-stage.d.ts +1 -1
  481. package/dist/trust-score.d.ts +1 -1
  482. package/dist/{types-Cyr32ABj.d.ts → types-nJV23pa3.d.ts} +1 -1
  483. package/dist/types.d.ts +1 -1
  484. package/dist/types.js +1 -1
  485. package/dist/utility-runtime.d.ts +1 -1
  486. package/dist/verified-recall.js +16 -16
  487. package/dist/who-knows-cli.d.ts +16 -14
  488. package/dist/who-knows-cli.js +17 -17
  489. package/dist/who-knows.d.ts +16 -14
  490. package/dist/who-knows.js +16 -16
  491. package/dist/write-envelope.d.ts +1 -1
  492. package/package.json +2 -2
  493. package/src/access-category-alias.test.ts +93 -0
  494. package/src/access-offline-manifest.ts +52 -2
  495. package/src/access-schema.ts +9 -4
  496. package/src/activity/config.test.ts +61 -0
  497. package/src/activity/config.ts +40 -1
  498. package/src/activity/timeline/analysis-provider.ts +8 -2
  499. package/src/activity/timeline/analysis-run.test.ts +82 -0
  500. package/src/activity/timeline/publish-cli.test.ts +30 -0
  501. package/src/activity/timeline/publish-cli.ts +7 -0
  502. package/src/activity/timeline/query.ts +8 -1
  503. package/src/activity/timeline/regenerate.test.ts +82 -2
  504. package/src/activity/timeline/regenerate.ts +7 -1
  505. package/src/activity/vault-frontmatter.test.ts +99 -1
  506. package/src/activity/vault-frontmatter.ts +131 -0
  507. package/src/activity/vault-publish.ts +6 -0
  508. package/src/activity/vault-publisher.test.ts +172 -0
  509. package/src/activity/vault-publisher.ts +69 -15
  510. package/src/activity/vault-region.test.ts +7 -2
  511. package/src/activity/vault-region.ts +7 -3
  512. package/src/background-generation-config.ts +32 -6
  513. package/src/background-generation.test.ts +10 -1
  514. package/src/cli/timeline-publish-commands.ts +9 -0
  515. package/src/config.test.ts +170 -43
  516. package/src/config.ts +17 -5
  517. package/src/extraction-error-classification.ts +36 -1
  518. package/src/extraction-timeout.test.ts +110 -1
  519. package/src/extraction.test.ts +19 -1
  520. package/src/extraction.ts +23 -21
  521. package/src/fallback-llm-codex-subscription.ts +193 -7
  522. package/src/fallback-llm-parse-failure.test.ts +156 -0
  523. package/src/fallback-llm.test.ts +58 -0
  524. package/src/fallback-llm.ts +187 -186
  525. package/src/index.ts +1 -0
  526. package/src/local-llm-config.ts +11 -10
  527. package/src/local-llm-headers-timeout.test.ts +30 -0
  528. package/src/local-llm-helpers.ts +28 -0
  529. package/src/local-llm.ts +8 -19
  530. package/src/namespaces/search.test.ts +51 -1
  531. package/src/namespaces/search.ts +48 -3
  532. package/src/orchestration/extraction-persist-promotion.test.ts +228 -2
  533. package/src/orchestration/extraction-persist-promotion.ts +17 -14
  534. package/src/orchestration/orchestrator-helpers.test.ts +104 -0
  535. package/src/orchestration/orchestrator-init.ts +366 -106
  536. package/src/orchestration/recall-internal.ts +85 -74
  537. package/src/orchestration/recall-rerank-coordinator.ts +41 -4
  538. package/src/orchestration/recall-search-pipeline.ts +25 -18
  539. package/src/orchestration/recall-state-view-pipeline.test.ts +89 -0
  540. package/src/orchestration/semantic-merge-promotion-payload.ts +62 -6
  541. package/src/orchestration/startup-collection-checks.ts +85 -0
  542. package/src/orchestrator-flush.test.ts +7 -0
  543. package/src/orchestrator-init.test.ts +1539 -0
  544. package/src/orchestrator.ts +7 -0
  545. package/src/qmd.ts +21 -10
  546. package/src/recall-rerank-coordinator.test.ts +153 -0
  547. package/src/recall-state-view-admission.ts +11 -1
  548. package/src/recall-state-view-anchors.ts +163 -0
  549. package/src/recall-state-view-cron-intent.test.ts +268 -0
  550. package/src/recall-state-view-widen.test.ts +14 -5
  551. package/src/recall-state-view-widen.ts +29 -8
  552. package/src/recall-state-view-zero-diff.test.ts +30 -0
  553. package/src/recall-state-view.test.ts +161 -0
  554. package/src/recall-state-view.ts +211 -37
  555. package/src/reconcile-identity-cache.test.ts +82 -1
  556. package/src/search/port.ts +1 -1
  557. package/src/storage/cas-revision-store.test.ts +4 -0
  558. package/src/storage/cas-revision-store.ts +104 -12
  559. package/src/storage-frontmatter-cas.test.ts +19 -17
  560. package/src/summarizer.ts +5 -1
  561. package/src/task-llm-config.test.ts +124 -0
  562. package/src/task-llm-config.ts +88 -0
  563. package/src/testing/subjects/startup-discovery-lifecycle.test.ts +273 -0
  564. package/src/trust-score-recall-paths.test.ts +1 -1
  565. package/src/types.ts +1 -0
  566. package/dist/chunk-255PC37A.js +0 -120
  567. package/dist/chunk-255PC37A.js.map +0 -1
  568. package/dist/chunk-2MT4ADLQ.js.map +0 -1
  569. package/dist/chunk-3CBI2ZSA.js.map +0 -1
  570. package/dist/chunk-3OYSIVOO.js.map +0 -1
  571. package/dist/chunk-5AERZWJD.js.map +0 -1
  572. package/dist/chunk-5HYUUFMQ.js.map +0 -1
  573. package/dist/chunk-6H2G7RFT.js.map +0 -1
  574. package/dist/chunk-7S53BPTU.js.map +0 -1
  575. package/dist/chunk-ACY4ZPF7.js.map +0 -1
  576. package/dist/chunk-B36GUU6T.js.map +0 -1
  577. package/dist/chunk-BJEJUOGM.js.map +0 -1
  578. package/dist/chunk-BLDBT6HZ.js.map +0 -1
  579. package/dist/chunk-CWTCMZGE.js.map +0 -1
  580. package/dist/chunk-IYKZJVL5.js.map +0 -1
  581. package/dist/chunk-JXN77SGO.js.map +0 -1
  582. package/dist/chunk-LQNRVPTV.js.map +0 -1
  583. package/dist/chunk-MVAQ2WM3.js.map +0 -1
  584. package/dist/chunk-P4ZAEYKG.js.map +0 -1
  585. package/dist/chunk-QHT7MOUF.js.map +0 -1
  586. package/dist/chunk-V6G2PSXA.js.map +0 -1
  587. package/dist/chunk-VELCIWJZ.js.map +0 -1
  588. package/dist/chunk-WKDFJXW5.js.map +0 -1
  589. package/dist/chunk-XWLLFKHM.js.map +0 -1
  590. package/dist/chunk-YFTNZMGR.js.map +0 -1
  591. /package/dist/{auto-sync-RP4C6ZPF.js.map → auto-sync-D6BAPIJV.js.map} +0 -0
  592. /package/dist/{chunk-T32B72QX.js.map → chunk-2SKMZUOW.js.map} +0 -0
  593. /package/dist/{chunk-VHOSM5G4.js.map → chunk-2SNCQHJZ.js.map} +0 -0
  594. /package/dist/{chunk-VV4ZVUE6.js.map → chunk-3QEVOQF5.js.map} +0 -0
  595. /package/dist/{chunk-3N3PBBEH.js.map → chunk-3XPN7AVY.js.map} +0 -0
  596. /package/dist/{chunk-XN6XT6GR.js.map → chunk-46Z3VGWF.js.map} +0 -0
  597. /package/dist/{chunk-2PTNJTBE.js.map → chunk-4CMXI55L.js.map} +0 -0
  598. /package/dist/{chunk-A6CKMIPK.js.map → chunk-7D6SER6A.js.map} +0 -0
  599. /package/dist/{chunk-4B3HBIFX.js.map → chunk-7Z54NXVS.js.map} +0 -0
  600. /package/dist/{chunk-X2NFFBTO.js.map → chunk-A7GQBJP5.js.map} +0 -0
  601. /package/dist/{chunk-NWMUSKED.js.map → chunk-BGRTZOJB.js.map} +0 -0
  602. /package/dist/{chunk-ZEGL7YCC.js.map → chunk-BXIJSPCL.js.map} +0 -0
  603. /package/dist/{chunk-MLWMR2GE.js.map → chunk-BYQX4IOG.js.map} +0 -0
  604. /package/dist/{chunk-ULDBGA5W.js.map → chunk-C5R73BON.js.map} +0 -0
  605. /package/dist/{chunk-BD7JTBYP.js.map → chunk-D7MAYFQP.js.map} +0 -0
  606. /package/dist/{chunk-BRZWWUCJ.js.map → chunk-DFVSJFHK.js.map} +0 -0
  607. /package/dist/{chunk-DPMTLJCT.js.map → chunk-ES5BUPYB.js.map} +0 -0
  608. /package/dist/{chunk-TNSCIPBQ.js.map → chunk-G6NQ3L4T.js.map} +0 -0
  609. /package/dist/{chunk-5N4MZLEH.js.map → chunk-GO5LOHCD.js.map} +0 -0
  610. /package/dist/{chunk-AECJY3GJ.js.map → chunk-GSSDHAYH.js.map} +0 -0
  611. /package/dist/{chunk-JA2QJOAX.js.map → chunk-HJUP3K6L.js.map} +0 -0
  612. /package/dist/{chunk-ZKZFFWLV.js.map → chunk-ICNJ6J46.js.map} +0 -0
  613. /package/dist/{chunk-6EHM2AV7.js.map → chunk-IMBQFHRV.js.map} +0 -0
  614. /package/dist/{chunk-6PRY6CLC.js.map → chunk-IOPIGX7Y.js.map} +0 -0
  615. /package/dist/{chunk-TRHBQVVO.js.map → chunk-IS2IDFJP.js.map} +0 -0
  616. /package/dist/{chunk-R4VAUNNC.js.map → chunk-J4WGTN2N.js.map} +0 -0
  617. /package/dist/{chunk-JPOX2AJB.js.map → chunk-J7FVMLBR.js.map} +0 -0
  618. /package/dist/{chunk-BYZKLEWG.js.map → chunk-JAJIMTFB.js.map} +0 -0
  619. /package/dist/{chunk-OKO57IXB.js.map → chunk-JOP7W24J.js.map} +0 -0
  620. /package/dist/{chunk-YUW66UAH.js.map → chunk-JUDT33RX.js.map} +0 -0
  621. /package/dist/{chunk-UQNYPK7G.js.map → chunk-K4JKAXMO.js.map} +0 -0
  622. /package/dist/{chunk-BV4ZKIZH.js.map → chunk-K75A5XWU.js.map} +0 -0
  623. /package/dist/{chunk-M6HBPLBA.js.map → chunk-KOTG3RXE.js.map} +0 -0
  624. /package/dist/{chunk-OB3XMWX5.js.map → chunk-KVO2BTA4.js.map} +0 -0
  625. /package/dist/{chunk-CBFYCDYO.js.map → chunk-KY236SP5.js.map} +0 -0
  626. /package/dist/{chunk-4BCHFSC7.js.map → chunk-LFVZD5EC.js.map} +0 -0
  627. /package/dist/{chunk-GGAXFTNH.js.map → chunk-LKFVVN7R.js.map} +0 -0
  628. /package/dist/{chunk-4RX5O34R.js.map → chunk-MJC7UKH7.js.map} +0 -0
  629. /package/dist/{chunk-UZZ7SQT3.js.map → chunk-NVVZPBKI.js.map} +0 -0
  630. /package/dist/{chunk-TTSJ7WUC.js.map → chunk-PKUJNICO.js.map} +0 -0
  631. /package/dist/{chunk-QMWKENNK.js.map → chunk-Q4AUIFUA.js.map} +0 -0
  632. /package/dist/{chunk-G43PMSME.js.map → chunk-QE6YVNP5.js.map} +0 -0
  633. /package/dist/{chunk-GT4ZHOKT.js.map → chunk-QPVNK2VE.js.map} +0 -0
  634. /package/dist/{chunk-K5DA5TRG.js.map → chunk-QS5Q5RBV.js.map} +0 -0
  635. /package/dist/{chunk-BX4EOMKT.js.map → chunk-RDLPFM7I.js.map} +0 -0
  636. /package/dist/{chunk-EY5JAWZC.js.map → chunk-RJQAP333.js.map} +0 -0
  637. /package/dist/{chunk-2OGTN37H.js.map → chunk-ROEFLU37.js.map} +0 -0
  638. /package/dist/{chunk-62QIQEUC.js.map → chunk-SFHLQPBF.js.map} +0 -0
  639. /package/dist/{chunk-HVS7TH2Y.js.map → chunk-SUEOG2S4.js.map} +0 -0
  640. /package/dist/{chunk-74AHCL56.js.map → chunk-TEMKBSV6.js.map} +0 -0
  641. /package/dist/{chunk-KDFDXEXZ.js.map → chunk-TO36VPZI.js.map} +0 -0
  642. /package/dist/{chunk-M3MYMWXG.js.map → chunk-V2ZA4YWE.js.map} +0 -0
  643. /package/dist/{chunk-UIOIDW3L.js.map → chunk-VHKXRYQN.js.map} +0 -0
  644. /package/dist/{chunk-GAS7KYC7.js.map → chunk-VKWFNPBH.js.map} +0 -0
  645. /package/dist/{chunk-XGRXQR6T.js.map → chunk-VQWBUPSJ.js.map} +0 -0
  646. /package/dist/{chunk-TUKGXQ5T.js.map → chunk-VQYWKCDR.js.map} +0 -0
  647. /package/dist/{chunk-PPQEP4OH.js.map → chunk-W23JARAQ.js.map} +0 -0
  648. /package/dist/{chunk-YQNNHLCG.js.map → chunk-WPGR3RW4.js.map} +0 -0
  649. /package/dist/{chunk-474DL7UB.js.map → chunk-WZYHPAG5.js.map} +0 -0
  650. /package/dist/{chunk-GQQVEH6V.js.map → chunk-XM46Y66S.js.map} +0 -0
  651. /package/dist/{chunk-JNSENHV5.js.map → chunk-YRIFXXMI.js.map} +0 -0
  652. /package/dist/{chunk-TRLOFIQC.js.map → chunk-YTK5MVNF.js.map} +0 -0
  653. /package/dist/{chunk-VMNCZ627.js.map → chunk-YTZN2UZO.js.map} +0 -0
  654. /package/dist/{chunk-6ZMNTRU3.js.map → chunk-ZAEPD4C2.js.map} +0 -0
  655. /package/dist/{chunk-KQW3YGEN.js.map → chunk-ZRMMXWYI.js.map} +0 -0
  656. /package/dist/{chunk-MCRVQ5YQ.js.map → chunk-ZZCR2QYL.js.map} +0 -0
@@ -1,5 +1,4 @@
1
1
  import { log } from "./logger.js";
2
- import path from "node:path";
3
2
  import type { AgentPersonaModelConfig, GatewayConfig, ModelProviderConfig, PluginConfig } from "./types.js";
4
3
  import { extractJsonCandidates } from "./json-extract.js";
5
4
  import {
@@ -10,25 +9,38 @@ import {
10
9
  import {
11
10
  resolveProviderApiKey,
12
11
  getGatewayRuntimeAuthForModel,
13
- type GetRuntimeAuthForModelFn,
14
- type ResolveApiKeyFn,
15
12
  } from "./resolve-provider-secret.js";
16
13
  import {
17
14
  CODEX_SUBSCRIPTION_PROVIDER_ID,
18
15
  codexSubscriptionBuiltinProviderConfig,
19
- getCodexSubscriptionRunnerForOwner,
20
16
  } from "./providers/codex-subscription.js";
21
17
  import { loadModelsJsonProviders } from "./models-json.js";
22
18
  import {
23
19
  abortReason,
20
+ classifyThrownProviderError,
21
+ defaultOpenClawWorkspaceDir,
22
+ extractResponsesOutputText,
23
+ fallbackLlmRuntimeContextFromConfig,
24
24
  isTerminalCodexSubscriptionError,
25
+ isTimeoutError,
26
+ isUnsupportedJsonSchemaError,
27
+ normalizeRuntimePath,
25
28
  raceFallbackLlmDeadline,
29
+ readGatewayWorkspaceDir,
26
30
  tryCodexSubscriptionProvider,
27
31
  withCodexRuntimeShutdown,
32
+ type FallbackLlmRuntimeContext,
33
+ type StructuredParseFailure,
34
+ type StructuredParseResult,
35
+ } from "./fallback-llm-codex-subscription.js";
36
+
37
+ export {
38
+ fallbackLlmRuntimeContextFromConfig,
39
+ type FallbackLlmRuntimeContext,
40
+ type StructuredParseFailure,
41
+ type StructuredParseFailureReason,
42
+ type StructuredParseResult,
28
43
  } from "./fallback-llm-codex-subscription.js";
29
- import type { CodexCliFallbackRunner } from "./cli-fallback.js";
30
- import { resolveHomeDir } from "./runtime/env.js";
31
- import { expandTildePath } from "./utils/path.js";
32
44
 
33
45
  export interface FallbackLlmOptions {
34
46
  temperature?: number;
@@ -53,6 +65,13 @@ export interface FallbackLlmOptions {
53
65
  agentId?: string;
54
66
  /** Reject a transport-successful response and continue through the configured model chain. */
55
67
  acceptResponse?: (response: FallbackLlmResponse) => boolean;
68
+ /**
69
+ * Optional out-box for the terminal failure cause (issue #2891): when every
70
+ * model in the chain fails, the last thrown provider error is recorded here
71
+ * so callers can classify it (e.g. HTTP 429 → rate-limited) in memory
72
+ * instead of seeing only null. Never logged.
73
+ */
74
+ failureDiag?: { lastError?: unknown };
56
75
  }
57
76
 
58
77
  export interface FallbackLlmAvailabilityOptions {
@@ -87,36 +106,9 @@ export interface FallbackLlmResponse {
87
106
  };
88
107
  }
89
108
 
90
- export interface FallbackLlmRuntimeContext {
91
- agentDir?: string;
92
- getRuntimeAuthForModel?: GetRuntimeAuthForModelFn | null;
93
- resolveApiKeyForProvider?: ResolveApiKeyFn | null;
94
- workspaceDir?: string;
95
- /** Per-runtime Codex child owner. Shutdown must terminate only this runner. */
96
- codexSubscriptionRunner?: CodexCliFallbackRunner;
97
- }
98
-
99
- export function fallbackLlmRuntimeContextFromConfig(
100
- config: Pick<
101
- GatewayBackedRuntimeConfig,
102
- "providerApiKeyResolver" | "runtimeAuthForModelResolver" | "workspaceDir"
103
- >,
104
- overrides: FallbackLlmRuntimeContext = {},
105
- ): FallbackLlmRuntimeContext {
106
- return {
107
- workspaceDir: config.workspaceDir,
108
- resolveApiKeyForProvider: config.providerApiKeyResolver,
109
- getRuntimeAuthForModel: config.runtimeAuthForModelResolver,
110
- codexSubscriptionRunner: getCodexSubscriptionRunnerForOwner(config),
111
- ...overrides,
112
- };
113
- }
114
-
115
- type GatewayBackedRuntimeConfig = {
116
- providerApiKeyResolver?: ResolveApiKeyFn | null;
117
- runtimeAuthForModelResolver?: GetRuntimeAuthForModelFn | null;
118
- workspaceDir?: string;
119
- };
109
+ type ChatCompletionOutcome =
110
+ | { ok: true; response: FallbackLlmResponse }
111
+ | { ok: false; failure: Omit<StructuredParseFailure, "result"> };
120
112
 
121
113
  interface ModelRef {
122
114
  providerId: string;
@@ -125,22 +117,6 @@ interface ModelRef {
125
117
  modelString: string;
126
118
  }
127
119
 
128
- function isUnsupportedJsonSchemaError(error: unknown): boolean {
129
- const message = error instanceof Error ? error.message : String(error);
130
- // Require an HTTP status plus explicit schema/format context. A bare
131
- // "unsupported" (e.g. "'temperature' is unsupported with this model") must
132
- // NOT trigger the schema-stripping retry, or we pay a duplicate request
133
- // for unrelated provider errors.
134
- if (!/\b(?:400|404|422)\b/.test(message)) {
135
- return false;
136
- }
137
- if (/(?:response[_ ]?format|json[_ ]?schema|structured[_ ]?output)/i.test(message)) {
138
- return true;
139
- }
140
- // "unsupported" only counts when adjacent to schema/format terminology.
141
- return /\bunsupported\b[\s\S]{0,40}\b(?:schema|format)\b/i.test(message);
142
- }
143
-
144
120
  const PROVIDER_ALIASES: Record<string, readonly string[]> = {
145
121
  "openai-codex": ["codex"],
146
122
  codex: ["openai-codex"],
@@ -152,16 +128,7 @@ const LEGACY_PROVIDER_IDS = new Set(["openai-codex", "claude-cli"]);
152
128
  const MANAGED_SECRETREF_MARKER = ["secretref", "managed"].join("-");
153
129
  const PROVIDER_API_KEY_FIELD = ["api", "Key"].join("") as keyof ModelProviderConfig;
154
130
 
155
- /**
156
- * Built-in provider fallbacks for providers that are commonly configured via
157
- * OAuth or gateway-managed auth rather than an explicit apiKey in
158
- * openclaw.json. These entries let resolveProviderConfig() succeed so the
159
- * chain proceeds to tryModel() → resolveRuntimeAuth(), which is where the
160
- * gateway's native OAuth token exchange happens.
161
- *
162
- * Without these, OAuth-only providers like `openai` are rejected with
163
- * "provider not found" before runtime auth is ever attempted.
164
- */
131
+ /** Built-in OAuth/managed-auth providers so resolveProviderConfig reaches runtime auth. */
165
132
  const BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {
166
133
  anthropic: {
167
134
  baseUrl: "https://api.anthropic.com/v1",
@@ -182,9 +149,10 @@ const BUILT_IN_PROVIDER_FALLBACKS: Record<string, ModelProviderConfig> = {
182
149
  };
183
150
 
184
151
  /**
185
- * Generic fallback LLM client that uses the gateway's default AI configuration
186
- * and walks through the full fallback chain (primary + fallbacks).
187
- * Supports OpenAI and Anthropic API formats.
152
+ * Gateway/task LLM client. In `modelSource: "gateway"` this is the primary
153
+ * configured path (taskModelChain / agent persona), not a secondary recovery
154
+ * client. The class name stays `FallbackLlmClient` because it is imported
155
+ * widely; prefer the `TaskLlmClient` alias in new code. Issue #2967.
188
156
  */
189
157
  export class FallbackLlmClient {
190
158
  private gatewayConfig: GatewayConfig | undefined;
@@ -224,6 +192,18 @@ export class FallbackLlmClient {
224
192
  messages: Array<{ role: "system" | "user" | "assistant"; content: string }>,
225
193
  options: FallbackLlmOptions = {},
226
194
  ): Promise<FallbackLlmResponse | null> {
195
+ const outcome = await this.completeChat(messages, options);
196
+ return outcome.ok ? outcome.response : null;
197
+ }
198
+
199
+ /**
200
+ * Same transport walk as chatCompletion, but tagged so structured parse can
201
+ * tell timeout / empty / HTTP error apart instead of collapsing them to null.
202
+ */
203
+ private async completeChat(
204
+ messages: Array<{ role: "system" | "user" | "assistant"; content: string }>,
205
+ options: FallbackLlmOptions = {},
206
+ ): Promise<ChatCompletionOutcome> {
227
207
  const models = this.getModelChain(
228
208
  options.agentId,
229
209
  options.model,
@@ -231,28 +211,52 @@ export class FallbackLlmClient {
231
211
  options.includeDefaultModelFallback,
232
212
  );
233
213
  if (models.length === 0) {
234
- log.warn("fallback LLM: no models configured in gateway");
235
- return null;
214
+ log.warn("task LLM: no models configured in gateway");
215
+ return { ok: false, failure: { failureReason: "no_models", errorClass: "no_models" } };
236
216
  }
237
217
  options = withCodexRuntimeShutdown(options, this.runtimeContext.codexSubscriptionRunner);
238
218
 
219
+ let lastFailure: Omit<StructuredParseFailure, "result"> = {
220
+ failureReason: "http_error",
221
+ errorClass: "network",
222
+ };
223
+
224
+ const recordFailure = (
225
+ failure: Omit<StructuredParseFailure, "result">,
226
+ attemptedModel?: string,
227
+ ): void => {
228
+ lastFailure = attemptedModel ? { ...failure, attemptedModel } : failure;
229
+ };
230
+
231
+ const throwIfCallerAborted = (signal: AbortSignal | undefined): void => {
232
+ if (!signal?.aborted) return;
233
+ const reason = abortReason(signal);
234
+ if (isTimeoutError(reason) && !options.signal?.aborted) {
235
+ recordFailure({ failureReason: "timeout", errorClass: "timeout" });
236
+ return;
237
+ }
238
+ throw reason;
239
+ };
240
+
239
241
  const runChain = async (
240
242
  initialOptions: FallbackLlmOptions,
241
243
  ): Promise<FallbackLlmResponse | null> => {
242
244
  let runOptions = initialOptions;
243
245
  let lastRejectedResponse: FallbackLlmResponse | null = null;
246
+ let lastError: unknown;
244
247
  let terminalError: unknown;
245
248
  // Try each model in the chain
246
249
  for (let i = 0; i < models.length; i++) {
247
250
  if (runOptions.signal?.aborted) {
248
- throw abortReason(runOptions.signal);
251
+ throwIfCallerAborted(runOptions.signal);
252
+ if (lastFailure.failureReason === "timeout") return null;
249
253
  }
250
254
  const model = models[i];
251
255
  const isFallback = i > 0;
252
256
 
253
257
  try {
254
258
  const result = await this.tryModel(model, messages, runOptions);
255
- if (result) {
259
+ if (result?.content) {
256
260
  const response = {
257
261
  content: result.content,
258
262
  modelUsed: model.modelString,
@@ -260,26 +264,29 @@ export class FallbackLlmClient {
260
264
  };
261
265
  if (runOptions.acceptResponse && !runOptions.acceptResponse(response)) {
262
266
  lastRejectedResponse = response;
263
- log.debug(`fallback LLM: ${model.modelString} returned rejected output, trying next...`);
267
+ log.debug(`task LLM: ${model.modelString} returned rejected output, trying next...`);
264
268
  continue;
265
269
  }
266
270
  if (isFallback) {
267
- log.debug(`fallback LLM: succeeded using ${model.modelString} (fallback ${i})`);
271
+ log.debug(`task LLM: succeeded using ${model.modelString} (fallback ${i})`);
268
272
  }
269
273
  return response;
270
274
  }
275
+ recordFailure({ failureReason: "empty", errorClass: "empty" }, model.modelString);
271
276
  } catch (err) {
272
277
  if (isTerminalCodexSubscriptionError(err) && runOptions.signal?.aborted) {
273
278
  throw err;
274
279
  }
275
280
  if (runOptions.signal?.aborted) {
276
- throw abortReason(runOptions.signal);
281
+ throwIfCallerAborted(runOptions.signal);
282
+ if (lastFailure.failureReason === "timeout") return null;
277
283
  }
284
+ lastError = err;
278
285
  if (
279
286
  (runOptions.jsonSchema || runOptions.responsesJsonSchema) &&
280
287
  isUnsupportedJsonSchemaError(err)
281
288
  ) {
282
- log.debug(`fallback LLM: ${model.modelString} rejected native JSON schema; retrying without it`);
289
+ log.debug(`task LLM: ${model.modelString} rejected native JSON schema; retrying without it`);
283
290
  // Degrade to prompt-only for the REST of the chain too, so an
284
291
  // N-model chain where every provider rejects structured output
285
292
  // costs N+1 requests instead of 2N.
@@ -290,7 +297,7 @@ export class FallbackLlmClient {
290
297
  };
291
298
  try {
292
299
  const result = await this.tryModel(model, messages, runOptions);
293
- if (result) {
300
+ if (result?.content) {
294
301
  const response = {
295
302
  content: result.content,
296
303
  modelUsed: model.modelString,
@@ -300,21 +307,28 @@ export class FallbackLlmClient {
300
307
  return response;
301
308
  }
302
309
  lastRejectedResponse = response;
303
- log.debug(`fallback LLM: ${model.modelString} unstructured retry output rejected by acceptResponse, trying next model...`);
310
+ log.debug(`task LLM: ${model.modelString} unstructured retry output rejected by acceptResponse, trying next model...`);
304
311
  continue;
305
312
  }
313
+ recordFailure({ failureReason: "empty", errorClass: "empty" }, model.modelString);
306
314
  } catch (retryError) {
307
315
  if (isTerminalCodexSubscriptionError(retryError) && runOptions.signal?.aborted) {
308
316
  throw retryError;
309
317
  }
310
- if (runOptions.signal?.aborted) throw abortReason(runOptions.signal);
318
+ if (runOptions.signal?.aborted) {
319
+ throwIfCallerAborted(runOptions.signal);
320
+ if (lastFailure.failureReason === "timeout") return null;
321
+ }
322
+ lastError = retryError;
323
+ const retryClassified = classifyThrownProviderError(retryError);
324
+ recordFailure(retryClassified, model.modelString);
311
325
  const retryErrorMsg = runOptions.redactProviderErrors
312
326
  ? "provider error details redacted"
313
327
  : retryError instanceof Error
314
328
  ? retryError.message
315
329
  : String(retryError);
316
330
  log.debug(
317
- `fallback LLM: ${model.modelString} unstructured retry failed (${retryErrorMsg})`,
331
+ `task LLM: ${model.modelString} unstructured retry failed (${retryErrorMsg})`,
318
332
  );
319
333
  if (isTerminalCodexSubscriptionError(retryError)) {
320
334
  terminalError = retryError;
@@ -322,12 +336,14 @@ export class FallbackLlmClient {
322
336
  }
323
337
  continue;
324
338
  }
339
+ const classified = classifyThrownProviderError(err);
340
+ recordFailure(classified, model.modelString);
325
341
  const errorMsg = runOptions.redactProviderErrors
326
342
  ? "provider error details redacted"
327
343
  : err instanceof Error
328
344
  ? err.message
329
345
  : String(err);
330
- log.debug(`fallback LLM: ${model.modelString} failed (${errorMsg}), trying next...`);
346
+ log.debug(`task LLM: ${model.modelString} failed (${errorMsg}), trying next...`);
331
347
  if (isTerminalCodexSubscriptionError(err)) {
332
348
  terminalError = err;
333
349
  }
@@ -335,7 +351,10 @@ export class FallbackLlmClient {
335
351
  }
336
352
  }
337
353
 
338
- log.warn(`fallback LLM: all ${models.length} models in chain failed`);
354
+ log.warn(`task LLM: all ${models.length} models in chain failed`);
355
+ if (options.failureDiag && lastError !== undefined && !lastRejectedResponse) {
356
+ options.failureDiag.lastError = lastError;
357
+ }
339
358
  // A terminal typed provider failure must reach the caller when the
340
359
  // chain is exhausted — the documented timeout/re-login guidance
341
360
  // depends on it (issue #2833).
@@ -345,10 +364,15 @@ export class FallbackLlmClient {
345
364
  return lastRejectedResponse;
346
365
  };
347
366
 
367
+ const toOutcome = (response: FallbackLlmResponse | null): ChatCompletionOutcome => {
368
+ if (response) return { ok: true, response };
369
+ return { ok: false, failure: lastFailure };
370
+ };
371
+
348
372
  if (typeof options.timeoutMs === "number") {
349
373
  if (options.timeoutMs <= 0) {
350
- log.warn("fallback LLM: timed out before request started");
351
- return null;
374
+ log.warn("task LLM: timed out before request started");
375
+ return { ok: false, failure: { failureReason: "timeout", errorClass: "timeout" } };
352
376
  }
353
377
  const controller = new AbortController();
354
378
  const onCallerAbort = (): void => {
@@ -368,19 +392,26 @@ export class FallbackLlmClient {
368
392
  },
369
393
  );
370
394
  try {
395
+ const timeoutError = Object.assign(
396
+ new Error(`task LLM timed out after ${options.timeoutMs}ms`),
397
+ { name: "TimeoutError" },
398
+ );
371
399
  const outcome = await raceFallbackLlmDeadline(guarded, options.timeoutMs, () => {
372
- log.warn(`fallback LLM: timed out after ${options.timeoutMs}ms`);
373
- controller.abort(
374
- new Error(`fallback LLM timed out after ${options.timeoutMs}ms`),
375
- );
400
+ log.warn(`task LLM: timed out after ${options.timeoutMs}ms`);
401
+ recordFailure({ failureReason: "timeout", errorClass: "timeout" });
402
+ controller.abort(timeoutError);
403
+ if (options.failureDiag) options.failureDiag.lastError = timeoutError;
376
404
  });
377
- return outcome.timedOut ? null : outcome.value;
405
+ if (outcome.timedOut) {
406
+ return { ok: false, failure: { failureReason: "timeout", errorClass: "timeout" } };
407
+ }
408
+ return toOutcome(outcome.value);
378
409
  } finally {
379
410
  options.signal?.removeEventListener("abort", onCallerAbort);
380
411
  }
381
412
  }
382
413
 
383
- return await runChain(options);
414
+ return toOutcome(await runChain(options));
384
415
  }
385
416
 
386
417
  /**
@@ -404,13 +435,10 @@ export class FallbackLlmClient {
404
435
  messages: Array<{ role: "system" | "user" | "assistant"; content: string }>,
405
436
  schema: { parse: (data: unknown) => T },
406
437
  options: FallbackLlmOptions = {},
407
- ): Promise<
408
- | { result: T; modelUsed: string }
409
- | { result: null; failureReason: "no_models" | "empty" | "http_error" }
410
- > {
411
- let response: FallbackLlmResponse | null;
438
+ ): Promise<StructuredParseResult<T>> {
439
+ let outcome: ChatCompletionOutcome;
412
440
  try {
413
- response = await this.chatCompletion(messages, options);
441
+ outcome = await this.completeChat(messages, options);
414
442
  } catch (err) {
415
443
  // Caller aborts must propagate (e.g. recall planner cancellation) — do
416
444
  // not swallow them as a provider failure, or abort-driven callers lose
@@ -418,38 +446,65 @@ export class FallbackLlmClient {
418
446
  // Terminal codex-subscription failures propagate for the same reason:
419
447
  // their TimeoutError/auth guidance is the documented contract.
420
448
  if (options.signal?.aborted || isTerminalCodexSubscriptionError(err)) throw err;
421
- log.warn("fallback LLM: chatCompletion threw during structured parse:", err);
422
- return { result: null, failureReason: "http_error" };
449
+ if (isTimeoutError(err)) {
450
+ return { result: null, failureReason: "timeout", errorClass: "timeout" };
451
+ }
452
+ log.warn("task LLM: chatCompletion threw during structured parse:", err);
453
+ return { result: null, ...classifyThrownProviderError(err) };
423
454
  }
424
- if (!response?.content) {
425
- // chatCompletion returns null both when no models are configured
426
- // (auth/config) and when every configured model errored (transient).
427
- // Disambiguate via the resolved model chain so the retry layer can pick
428
- // the right failure class.
429
- const hasModels =
430
- this.getModelChain(
431
- options.agentId,
432
- options.model,
433
- options.modelChain,
434
- options.includeDefaultModelFallback,
435
- ).length > 0;
436
- return { result: null, failureReason: hasModels ? "http_error" : "no_models" };
455
+ if (!outcome.ok) {
456
+ return { result: null, ...outcome.failure };
457
+ }
458
+ const response = outcome.response;
459
+ if (!response.content) {
460
+ return {
461
+ result: null,
462
+ failureReason: "empty",
463
+ attemptedModel: response.modelUsed,
464
+ errorClass: "empty",
465
+ };
437
466
  }
438
467
 
439
468
  try {
440
469
  const candidates = extractJsonCandidates(response.content);
470
+ let sawJson = false;
471
+ let sawSchemaReject = false;
441
472
  for (const c of candidates) {
473
+ let parsed: unknown;
474
+ try {
475
+ parsed = JSON.parse(c);
476
+ sawJson = true;
477
+ } catch {
478
+ continue;
479
+ }
442
480
  try {
443
- const parsed = JSON.parse(c);
444
481
  return { result: schema.parse(parsed), modelUsed: response.modelUsed };
445
482
  } catch {
446
- // keep trying other candidates
483
+ sawSchemaReject = true;
447
484
  }
448
485
  }
449
- return { result: null, failureReason: "empty" };
486
+ if (sawSchemaReject) {
487
+ return {
488
+ result: null,
489
+ failureReason: "schema_rejection",
490
+ attemptedModel: response.modelUsed,
491
+ errorClass: "schema_rejection",
492
+ };
493
+ }
494
+ return {
495
+ result: null,
496
+ failureReason: "empty",
497
+ attemptedModel: response.modelUsed,
498
+ errorClass: "empty",
499
+ };
450
500
  } catch (err) {
451
- log.warn("fallback LLM: failed to parse structured output:", err);
452
- return { result: null, failureReason: "empty" };
501
+ log.warn("task LLM: failed to parse structured output:", err);
502
+ return {
503
+ result: null,
504
+ failureReason: "empty",
505
+ attemptedModel: response.modelUsed,
506
+ errorClass: "empty",
507
+ };
453
508
  }
454
509
  }
455
510
 
@@ -476,9 +531,9 @@ export class FallbackLlmClient {
476
531
 
477
532
  if (modelChainOverride?.primary) {
478
533
  modelConfig = modelChainOverride;
479
- log.debug("fallback LLM: using explicit model chain override");
534
+ log.debug("task LLM: using explicit model chain override");
480
535
  } else if (modelChainOverride) {
481
- log.warn("fallback LLM: ignoring explicit model chain override without primary model");
536
+ log.warn("task LLM: ignoring explicit model chain override without primary model");
482
537
  }
483
538
 
484
539
  if (!modelConfig && agentId) {
@@ -487,10 +542,10 @@ export class FallbackLlmClient {
487
542
  );
488
543
  if (persona?.model) {
489
544
  modelConfig = persona.model;
490
- log.debug(`fallback LLM: using agent persona "${agentId}" model chain`);
545
+ log.debug(`task LLM: using agent persona "${agentId}" model chain`);
491
546
  } else {
492
547
  log.warn(
493
- `fallback LLM: agent persona "${agentId}" not found or has no model config, falling back to defaults`,
548
+ `task LLM: agent persona "${agentId}" not found or has no model config, falling back to defaults`,
494
549
  );
495
550
  }
496
551
  }
@@ -552,7 +607,7 @@ export class FallbackLlmClient {
552
607
  chain.push(defaultRef);
553
608
  modelStrings.push(trimmed); // keep dedupe correct for later default fallbacks
554
609
  log.debug(
555
- `fallback LLM: appended gateway default model "${trimmed}" as implicit last resort`,
610
+ `task LLM: appended gateway default model "${trimmed}" as implicit last resort`,
556
611
  );
557
612
  }
558
613
  }
@@ -571,7 +626,7 @@ export class FallbackLlmClient {
571
626
  // Parse "provider/model" format (e.g., "openai/gpt-5.5", "anthropic/claude-opus-4-6")
572
627
  const parts = modelString.split("/");
573
628
  if (parts.length < 2) {
574
- log.warn(`fallback LLM: invalid model format: ${modelString}`);
629
+ log.warn(`task LLM: invalid model format: ${modelString}`);
575
630
  return null;
576
631
  }
577
632
 
@@ -586,7 +641,7 @@ export class FallbackLlmClient {
586
641
  const providerConfig = resolvedProvider?.config;
587
642
  if (!providerConfig) {
588
643
  log.warn(
589
- `fallback LLM: provider not found: ${requestedProviderId} ` +
644
+ `task LLM: provider not found: ${requestedProviderId} ` +
590
645
  `(tried: ${this.providerResolutionCandidates(requestedProviderId).join(", ")})`,
591
646
  );
592
647
  return null;
@@ -613,7 +668,7 @@ export class FallbackLlmClient {
613
668
  const config = providers[candidate];
614
669
  if (config) {
615
670
  if (candidate !== providerId) {
616
- log.debug(`fallback LLM: provider "${providerId}" resolved via alias "${candidate}"`);
671
+ log.debug(`task LLM: provider "${providerId}" resolved via alias "${candidate}"`);
617
672
  }
618
673
  return { providerId: candidate, config };
619
674
  }
@@ -622,17 +677,17 @@ export class FallbackLlmClient {
622
677
  const config = this.resolveFromModelsJson(candidate);
623
678
  if (config) {
624
679
  if (candidate !== providerId) {
625
- log.debug(`fallback LLM: provider "${providerId}" resolved via models.json alias "${candidate}"`);
680
+ log.debug(`task LLM: provider "${providerId}" resolved via models.json alias "${candidate}"`);
626
681
  }
627
682
  return { providerId: candidate, config };
628
683
  }
629
684
  const builtInConfig = BUILT_IN_PROVIDER_FALLBACKS[candidate];
630
685
  if (builtInConfig) {
631
686
  if (candidate === providerId) {
632
- log.debug(`fallback LLM: provider "${providerId}" resolved from built-in defaults`);
687
+ log.debug(`task LLM: provider "${providerId}" resolved from built-in defaults`);
633
688
  return { providerId, config: builtInConfig };
634
689
  }
635
- log.debug(`fallback LLM: provider "${providerId}" resolved via built-in alias "${candidate}"`);
690
+ log.debug(`task LLM: provider "${providerId}" resolved via built-in alias "${candidate}"`);
636
691
  return { providerId: candidate, config: builtInConfig };
637
692
  }
638
693
  }
@@ -654,7 +709,7 @@ export class FallbackLlmClient {
654
709
  const allProviders = loadModelsJsonProviders();
655
710
  const config = allProviders[providerId];
656
711
  if (config) {
657
- log.debug(`fallback LLM: resolved provider "${providerId}" from models.json (api: ${config.api ?? "default"})`);
712
+ log.debug(`task LLM: resolved provider "${providerId}" from models.json (api: ${config.api ?? "default"})`);
658
713
  return config;
659
714
  }
660
715
  return null;
@@ -761,13 +816,13 @@ export class FallbackLlmClient {
761
816
 
762
817
  if (result?.apiKey || result?.baseUrl) {
763
818
  log.debug(
764
- `fallback LLM: resolved runtime auth for "${model.modelString}" (source: ${result.source ?? "unknown"}, mode: ${result.mode ?? "unknown"})`,
819
+ `task LLM: resolved runtime auth for "${model.modelString}" (source: ${result.source ?? "unknown"}, mode: ${result.mode ?? "unknown"})`,
765
820
  );
766
821
  return { apiKey: result.apiKey, baseUrl: result.baseUrl };
767
822
  }
768
823
  } catch (err) {
769
824
  log.debug(
770
- `fallback LLM: gateway runtime auth failed for "${model.modelString}": ${err instanceof Error ? err.message : String(err)}`,
825
+ `task LLM: gateway runtime auth failed for "${model.modelString}": ${err instanceof Error ? err.message : String(err)}`,
771
826
  );
772
827
  }
773
828
  return null;
@@ -848,7 +903,7 @@ export class FallbackLlmClient {
848
903
 
849
904
  if (!response.ok) {
850
905
  const error = await response.text();
851
- throw new Error(`OpenAI API error: ${response.status} ${error}`);
906
+ throw Object.assign(new Error(`OpenAI API error: ${response.status} ${error}`), { status: response.status });
852
907
  }
853
908
 
854
909
  const data = (await response.json()) as {
@@ -920,7 +975,7 @@ export class FallbackLlmClient {
920
975
 
921
976
  if (!response.ok) {
922
977
  const error = await response.text();
923
- throw new Error(`Ollama API error: ${response.status} ${error}`);
978
+ throw Object.assign(new Error(`Ollama API error: ${response.status} ${error}`), { status: response.status });
924
979
  }
925
980
 
926
981
  const data = (await response.json()) as {
@@ -1018,7 +1073,7 @@ export class FallbackLlmClient {
1018
1073
 
1019
1074
  if (!response.ok) {
1020
1075
  const error = await response.text();
1021
- throw new Error(`OpenAI Responses API error: ${response.status} ${error}`);
1076
+ throw Object.assign(new Error(`OpenAI Responses API error: ${response.status} ${error}`), { status: response.status });
1022
1077
  }
1023
1078
 
1024
1079
  const data = (await response.json()) as {
@@ -1110,7 +1165,7 @@ export class FallbackLlmClient {
1110
1165
 
1111
1166
  if (!response.ok) {
1112
1167
  const error = await response.text();
1113
- throw new Error(`Anthropic API error: ${response.status} ${error}`);
1168
+ throw Object.assign(new Error(`Anthropic API error: ${response.status} ${error}`), { status: response.status });
1114
1169
  }
1115
1170
 
1116
1171
  const data = (await response.json()) as {
@@ -1142,57 +1197,3 @@ export class FallbackLlmClient {
1142
1197
  }
1143
1198
  }
1144
1199
 
1145
- function normalizeRuntimePath(value: unknown): string | undefined {
1146
- if (typeof value !== "string") return undefined;
1147
- const trimmed = value.trim();
1148
- return trimmed.length > 0 ? expandTildePath(trimmed) : undefined;
1149
- }
1150
-
1151
- function readGatewayWorkspaceDir(gatewayConfig: GatewayConfig | undefined): string | undefined {
1152
- if (!gatewayConfig || typeof gatewayConfig !== "object") return undefined;
1153
- const raw = gatewayConfig as Record<string, unknown>;
1154
- return (
1155
- normalizeRuntimePath(raw.workspaceDir) ??
1156
- normalizeRuntimePath(raw.workspacePath) ??
1157
- normalizeRuntimePath(raw.workspace)
1158
- );
1159
- }
1160
-
1161
- function defaultOpenClawWorkspaceDir(): string {
1162
- return path.join(resolveHomeDir(), ".openclaw", "workspace");
1163
- }
1164
-
1165
- function extractResponsesOutputText(data: {
1166
- output_text?: string;
1167
- output?: Array<{
1168
- type?: string;
1169
- text?: string;
1170
- content?: Array<{
1171
- type?: string;
1172
- text?: string;
1173
- }>;
1174
- }>;
1175
- }): string | null {
1176
- if (typeof data.output_text === "string" && data.output_text.trim().length > 0) {
1177
- return data.output_text;
1178
- }
1179
-
1180
- const chunks: string[] = [];
1181
- for (const item of data.output ?? []) {
1182
- if (typeof item.text === "string" && item.text.trim().length > 0) {
1183
- chunks.push(item.text);
1184
- }
1185
- for (const part of item.content ?? []) {
1186
- if (
1187
- (part.type === "output_text" || part.type === "text") &&
1188
- typeof part.text === "string" &&
1189
- part.text.trim().length > 0
1190
- ) {
1191
- chunks.push(part.text);
1192
- }
1193
- }
1194
- }
1195
-
1196
- const joined = chunks.join("\n").trim();
1197
- return joined.length > 0 ? joined : null;
1198
- }