@animalabs/agent-framework 0.26.2 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/README.md +99 -8
  2. package/dist/src/agent.d.ts +291 -23
  3. package/dist/src/agent.d.ts.map +1 -1
  4. package/dist/src/agent.js +596 -61
  5. package/dist/src/agent.js.map +1 -1
  6. package/dist/src/api/server.d.ts.map +1 -1
  7. package/dist/src/api/server.js +5 -4
  8. package/dist/src/api/server.js.map +1 -1
  9. package/dist/src/auto-continue.d.ts +34 -0
  10. package/dist/src/auto-continue.d.ts.map +1 -0
  11. package/dist/src/auto-continue.js +36 -0
  12. package/dist/src/auto-continue.js.map +1 -0
  13. package/dist/src/code-execution/isolate/scripts.d.ts +11 -0
  14. package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
  15. package/dist/src/code-execution/isolate/scripts.js +5 -1
  16. package/dist/src/code-execution/isolate/scripts.js.map +1 -1
  17. package/dist/src/cut-off-round.d.ts +24 -0
  18. package/dist/src/cut-off-round.d.ts.map +1 -0
  19. package/dist/src/cut-off-round.js +87 -0
  20. package/dist/src/cut-off-round.js.map +1 -0
  21. package/dist/src/framework.d.ts +1038 -193
  22. package/dist/src/framework.d.ts.map +1 -1
  23. package/dist/src/framework.js +5967 -1514
  24. package/dist/src/framework.js.map +1 -1
  25. package/dist/src/gate/event-gate.d.ts +405 -46
  26. package/dist/src/gate/event-gate.d.ts.map +1 -1
  27. package/dist/src/gate/event-gate.js +2646 -399
  28. package/dist/src/gate/event-gate.js.map +1 -1
  29. package/dist/src/gate/index.d.ts +3 -2
  30. package/dist/src/gate/index.d.ts.map +1 -1
  31. package/dist/src/gate/index.js +2 -1
  32. package/dist/src/gate/index.js.map +1 -1
  33. package/dist/src/gate/recipe-reconcile.d.ts +103 -0
  34. package/dist/src/gate/recipe-reconcile.d.ts.map +1 -0
  35. package/dist/src/gate/recipe-reconcile.js +325 -0
  36. package/dist/src/gate/recipe-reconcile.js.map +1 -0
  37. package/dist/src/gate/reply-judge.d.ts +116 -0
  38. package/dist/src/gate/reply-judge.d.ts.map +1 -0
  39. package/dist/src/gate/reply-judge.js +467 -0
  40. package/dist/src/gate/reply-judge.js.map +1 -0
  41. package/dist/src/gate/types.d.ts +229 -8
  42. package/dist/src/gate/types.d.ts.map +1 -1
  43. package/dist/src/heartbeat/heartbeat.d.ts +184 -0
  44. package/dist/src/heartbeat/heartbeat.d.ts.map +1 -0
  45. package/dist/src/heartbeat/heartbeat.js +752 -0
  46. package/dist/src/heartbeat/heartbeat.js.map +1 -0
  47. package/dist/src/heartbeat/reminder-time.d.ts +5 -0
  48. package/dist/src/heartbeat/reminder-time.d.ts.map +1 -0
  49. package/dist/src/heartbeat/reminder-time.js +107 -0
  50. package/dist/src/heartbeat/reminder-time.js.map +1 -0
  51. package/dist/src/index.d.ts +10 -4
  52. package/dist/src/index.d.ts.map +1 -1
  53. package/dist/src/index.js +7 -2
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/mcpl/capability-mask.d.ts.map +1 -1
  56. package/dist/src/mcpl/capability-mask.js +3 -2
  57. package/dist/src/mcpl/capability-mask.js.map +1 -1
  58. package/dist/src/mcpl/channel-registry.d.ts +433 -113
  59. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  60. package/dist/src/mcpl/channel-registry.js +1154 -435
  61. package/dist/src/mcpl/channel-registry.js.map +1 -1
  62. package/dist/src/mcpl/conversation-router.d.ts +16 -8
  63. package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
  64. package/dist/src/mcpl/conversation-router.js +29 -15
  65. package/dist/src/mcpl/conversation-router.js.map +1 -1
  66. package/dist/src/mcpl/convert-block.d.ts.map +1 -1
  67. package/dist/src/mcpl/convert-block.js +14 -2
  68. package/dist/src/mcpl/convert-block.js.map +1 -1
  69. package/dist/src/mcpl/hook-orchestrator.d.ts +7 -1
  70. package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
  71. package/dist/src/mcpl/hook-orchestrator.js +32 -7
  72. package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
  73. package/dist/src/mcpl/inbound-source.d.ts +26 -10
  74. package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
  75. package/dist/src/mcpl/inbound-source.js +40 -69
  76. package/dist/src/mcpl/inbound-source.js.map +1 -1
  77. package/dist/src/mcpl/index.d.ts +5 -1
  78. package/dist/src/mcpl/index.d.ts.map +1 -1
  79. package/dist/src/mcpl/index.js +4 -0
  80. package/dist/src/mcpl/index.js.map +1 -1
  81. package/dist/src/mcpl/inference-router.d.ts +14 -2
  82. package/dist/src/mcpl/inference-router.d.ts.map +1 -1
  83. package/dist/src/mcpl/inference-router.js +73 -28
  84. package/dist/src/mcpl/inference-router.js.map +1 -1
  85. package/dist/src/mcpl/prose-grammar.d.ts +4 -0
  86. package/dist/src/mcpl/prose-grammar.d.ts.map +1 -1
  87. package/dist/src/mcpl/prose-grammar.js +6 -0
  88. package/dist/src/mcpl/prose-grammar.js.map +1 -1
  89. package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
  90. package/dist/src/mcpl/protocol-family.js +3 -0
  91. package/dist/src/mcpl/protocol-family.js.map +1 -1
  92. package/dist/src/mcpl/push-coalescer.d.ts +20 -2
  93. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  94. package/dist/src/mcpl/push-coalescer.js +33 -11
  95. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  96. package/dist/src/mcpl/reference-fetcher.d.ts +63 -42
  97. package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
  98. package/dist/src/mcpl/reference-fetcher.js +177 -145
  99. package/dist/src/mcpl/reference-fetcher.js.map +1 -1
  100. package/dist/src/mcpl/references.d.ts +380 -46
  101. package/dist/src/mcpl/references.d.ts.map +1 -1
  102. package/dist/src/mcpl/references.js +736 -77
  103. package/dist/src/mcpl/references.js.map +1 -1
  104. package/dist/src/mcpl/server-connection.d.ts +93 -4
  105. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  106. package/dist/src/mcpl/server-connection.js +176 -11
  107. package/dist/src/mcpl/server-connection.js.map +1 -1
  108. package/dist/src/mcpl/tags.d.ts +9 -2
  109. package/dist/src/mcpl/tags.d.ts.map +1 -1
  110. package/dist/src/mcpl/tags.js +12 -2
  111. package/dist/src/mcpl/tags.js.map +1 -1
  112. package/dist/src/mcpl/tool-lifecycle.d.ts +11 -0
  113. package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
  114. package/dist/src/mcpl/tool-lifecycle.js +21 -0
  115. package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
  116. package/dist/src/mcpl/tool-presence.d.ts +311 -0
  117. package/dist/src/mcpl/tool-presence.d.ts.map +1 -0
  118. package/dist/src/mcpl/tool-presence.js +697 -0
  119. package/dist/src/mcpl/tool-presence.js.map +1 -0
  120. package/dist/src/mcpl/tool-result-normalize.d.ts +9 -3
  121. package/dist/src/mcpl/tool-result-normalize.d.ts.map +1 -1
  122. package/dist/src/mcpl/tool-result-normalize.js +14 -6
  123. package/dist/src/mcpl/tool-result-normalize.js.map +1 -1
  124. package/dist/src/mcpl/tool-signature.d.ts +46 -0
  125. package/dist/src/mcpl/tool-signature.d.ts.map +1 -0
  126. package/dist/src/mcpl/tool-signature.js +321 -0
  127. package/dist/src/mcpl/tool-signature.js.map +1 -0
  128. package/dist/src/mcpl/toolset-host.d.ts +251 -0
  129. package/dist/src/mcpl/toolset-host.d.ts.map +1 -0
  130. package/dist/src/mcpl/toolset-host.js +720 -0
  131. package/dist/src/mcpl/toolset-host.js.map +1 -0
  132. package/dist/src/mcpl/toolsets-module.d.ts +83 -0
  133. package/dist/src/mcpl/toolsets-module.d.ts.map +1 -0
  134. package/dist/src/mcpl/toolsets-module.js +523 -0
  135. package/dist/src/mcpl/toolsets-module.js.map +1 -0
  136. package/dist/src/mcpl/transport.d.ts +2 -2
  137. package/dist/src/mcpl/transport.d.ts.map +1 -1
  138. package/dist/src/mcpl/transport.js +3 -2
  139. package/dist/src/mcpl/transport.js.map +1 -1
  140. package/dist/src/mcpl/types.d.ts +24 -2
  141. package/dist/src/mcpl/types.d.ts.map +1 -1
  142. package/dist/src/mcpl/types.js.map +1 -1
  143. package/dist/src/mcpl/visible-content.d.ts +7 -9
  144. package/dist/src/mcpl/visible-content.d.ts.map +1 -1
  145. package/dist/src/mcpl/visible-content.js +21 -9
  146. package/dist/src/mcpl/visible-content.js.map +1 -1
  147. package/dist/src/module-registry.d.ts +27 -9
  148. package/dist/src/module-registry.d.ts.map +1 -1
  149. package/dist/src/module-registry.js +77 -17
  150. package/dist/src/module-registry.js.map +1 -1
  151. package/dist/src/modules/discord/index.js +1 -1
  152. package/dist/src/modules/discord/index.js.map +1 -1
  153. package/dist/src/modules/history/index.d.ts +2 -1
  154. package/dist/src/modules/history/index.d.ts.map +1 -1
  155. package/dist/src/modules/history/index.js +73 -28
  156. package/dist/src/modules/history/index.js.map +1 -1
  157. package/dist/src/modules/history/semantic.d.ts +108 -6
  158. package/dist/src/modules/history/semantic.d.ts.map +1 -1
  159. package/dist/src/modules/history/semantic.js +273 -57
  160. package/dist/src/modules/history/semantic.js.map +1 -1
  161. package/dist/src/modules/workspace/answers.d.ts +22 -0
  162. package/dist/src/modules/workspace/answers.d.ts.map +1 -0
  163. package/dist/src/modules/workspace/answers.js +123 -0
  164. package/dist/src/modules/workspace/answers.js.map +1 -0
  165. package/dist/src/modules/workspace/branch-intent.d.ts +5 -3
  166. package/dist/src/modules/workspace/branch-intent.d.ts.map +1 -1
  167. package/dist/src/modules/workspace/branch-intent.js +6 -2
  168. package/dist/src/modules/workspace/branch-intent.js.map +1 -1
  169. package/dist/src/modules/workspace/direct-write.d.ts +184 -0
  170. package/dist/src/modules/workspace/direct-write.d.ts.map +1 -0
  171. package/dist/src/modules/workspace/direct-write.js +417 -0
  172. package/dist/src/modules/workspace/direct-write.js.map +1 -0
  173. package/dist/src/modules/workspace/disk-agreement.d.ts +33 -11
  174. package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
  175. package/dist/src/modules/workspace/disk-agreement.js +48 -17
  176. package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
  177. package/dist/src/modules/workspace/edit-text.d.ts +27 -12
  178. package/dist/src/modules/workspace/edit-text.d.ts.map +1 -1
  179. package/dist/src/modules/workspace/edit-text.js +61 -29
  180. package/dist/src/modules/workspace/edit-text.js.map +1 -1
  181. package/dist/src/modules/workspace/effects.d.ts +10 -0
  182. package/dist/src/modules/workspace/effects.d.ts.map +1 -1
  183. package/dist/src/modules/workspace/effects.js +21 -14
  184. package/dist/src/modules/workspace/effects.js.map +1 -1
  185. package/dist/src/modules/workspace/index.d.ts +308 -78
  186. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  187. package/dist/src/modules/workspace/index.js +2103 -720
  188. package/dist/src/modules/workspace/index.js.map +1 -1
  189. package/dist/src/modules/workspace/observe.d.ts +75 -63
  190. package/dist/src/modules/workspace/observe.d.ts.map +1 -1
  191. package/dist/src/modules/workspace/observe.js +366 -180
  192. package/dist/src/modules/workspace/observe.js.map +1 -1
  193. package/dist/src/modules/workspace/read-page.d.ts +41 -0
  194. package/dist/src/modules/workspace/read-page.d.ts.map +1 -0
  195. package/dist/src/modules/workspace/read-page.js +219 -0
  196. package/dist/src/modules/workspace/read-page.js.map +1 -0
  197. package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
  198. package/dist/src/modules/workspace/reconcile.js +26 -16
  199. package/dist/src/modules/workspace/reconcile.js.map +1 -1
  200. package/dist/src/modules/workspace/result-text.d.ts +68 -0
  201. package/dist/src/modules/workspace/result-text.d.ts.map +1 -0
  202. package/dist/src/modules/workspace/result-text.js +94 -0
  203. package/dist/src/modules/workspace/result-text.js.map +1 -0
  204. package/dist/src/modules/workspace/sync.d.ts +9 -0
  205. package/dist/src/modules/workspace/sync.d.ts.map +1 -1
  206. package/dist/src/modules/workspace/sync.js +14 -0
  207. package/dist/src/modules/workspace/sync.js.map +1 -1
  208. package/dist/src/modules/workspace/text.d.ts +29 -12
  209. package/dist/src/modules/workspace/text.d.ts.map +1 -1
  210. package/dist/src/modules/workspace/text.js +35 -33
  211. package/dist/src/modules/workspace/text.js.map +1 -1
  212. package/dist/src/modules/workspace/types.d.ts +137 -60
  213. package/dist/src/modules/workspace/types.d.ts.map +1 -1
  214. package/dist/src/modules/workspace/types.js.map +1 -1
  215. package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
  216. package/dist/src/modules/workspace/watcher.js +8 -3
  217. package/dist/src/modules/workspace/watcher.js.map +1 -1
  218. package/dist/src/prose-drafts.d.ts +4 -3
  219. package/dist/src/prose-drafts.d.ts.map +1 -1
  220. package/dist/src/prose-drafts.js +3 -2
  221. package/dist/src/prose-drafts.js.map +1 -1
  222. package/dist/src/reasoning-loss-notice.d.ts +23 -0
  223. package/dist/src/reasoning-loss-notice.d.ts.map +1 -0
  224. package/dist/src/reasoning-loss-notice.js +50 -0
  225. package/dist/src/reasoning-loss-notice.js.map +1 -0
  226. package/dist/src/reasoning-loss.d.ts +24 -0
  227. package/dist/src/reasoning-loss.d.ts.map +1 -0
  228. package/dist/src/reasoning-loss.js +102 -0
  229. package/dist/src/reasoning-loss.js.map +1 -0
  230. package/dist/src/send-tools.d.ts +3 -2
  231. package/dist/src/send-tools.d.ts.map +1 -1
  232. package/dist/src/send-tools.js +3 -2
  233. package/dist/src/send-tools.js.map +1 -1
  234. package/dist/src/sent-rows.d.ts +59 -0
  235. package/dist/src/sent-rows.d.ts.map +1 -0
  236. package/dist/src/sent-rows.js +145 -0
  237. package/dist/src/sent-rows.js.map +1 -0
  238. package/dist/src/silent-heartbeat.d.ts +17 -10
  239. package/dist/src/silent-heartbeat.d.ts.map +1 -1
  240. package/dist/src/silent-heartbeat.js.map +1 -1
  241. package/dist/src/stable-hash.d.ts +3 -0
  242. package/dist/src/stable-hash.d.ts.map +1 -0
  243. package/dist/src/stable-hash.js +15 -0
  244. package/dist/src/stable-hash.js.map +1 -0
  245. package/dist/src/stored-injections.d.ts +99 -0
  246. package/dist/src/stored-injections.d.ts.map +1 -0
  247. package/dist/src/stored-injections.js +106 -0
  248. package/dist/src/stored-injections.js.map +1 -0
  249. package/dist/src/text-as-stored.d.ts +4 -3
  250. package/dist/src/text-as-stored.d.ts.map +1 -1
  251. package/dist/src/text-as-stored.js +4 -3
  252. package/dist/src/text-as-stored.js.map +1 -1
  253. package/dist/src/thinking-drops.d.ts +74 -0
  254. package/dist/src/thinking-drops.d.ts.map +1 -0
  255. package/dist/src/thinking-drops.js +96 -0
  256. package/dist/src/thinking-drops.js.map +1 -0
  257. package/dist/src/tool-args.d.ts +12 -0
  258. package/dist/src/tool-args.d.ts.map +1 -1
  259. package/dist/src/tool-args.js +35 -1
  260. package/dist/src/tool-args.js.map +1 -1
  261. package/dist/src/tool-image-ledger.d.ts +9 -8
  262. package/dist/src/tool-image-ledger.d.ts.map +1 -1
  263. package/dist/src/tool-image-ledger.js +9 -8
  264. package/dist/src/tool-image-ledger.js.map +1 -1
  265. package/dist/src/tool-presentation.d.ts.map +1 -1
  266. package/dist/src/tool-presentation.js +3 -1
  267. package/dist/src/tool-presentation.js.map +1 -1
  268. package/dist/src/tool-result-guard.d.ts +12 -6
  269. package/dist/src/tool-result-guard.d.ts.map +1 -1
  270. package/dist/src/tool-result-guard.js +44 -17
  271. package/dist/src/tool-result-guard.js.map +1 -1
  272. package/dist/src/tool-result-history.d.ts +176 -24
  273. package/dist/src/tool-result-history.d.ts.map +1 -1
  274. package/dist/src/tool-result-history.js +411 -91
  275. package/dist/src/tool-result-history.js.map +1 -1
  276. package/dist/src/tune-out/coordinator.d.ts +17 -9
  277. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  278. package/dist/src/tune-out/coordinator.js +84 -37
  279. package/dist/src/tune-out/coordinator.js.map +1 -1
  280. package/dist/src/tune-out/tools.d.ts +4 -1
  281. package/dist/src/tune-out/tools.d.ts.map +1 -1
  282. package/dist/src/types/agent.d.ts +217 -7
  283. package/dist/src/types/agent.d.ts.map +1 -1
  284. package/dist/src/types/events.d.ts +33 -9
  285. package/dist/src/types/events.d.ts.map +1 -1
  286. package/dist/src/types/framework.d.ts +39 -3
  287. package/dist/src/types/framework.d.ts.map +1 -1
  288. package/dist/src/types/module.d.ts +95 -9
  289. package/dist/src/types/module.d.ts.map +1 -1
  290. package/dist/src/types/trace.d.ts +91 -3
  291. package/dist/src/types/trace.d.ts.map +1 -1
  292. package/package.json +5 -4
  293. package/src/agent.ts +661 -67
  294. package/src/api/server.ts +5 -4
  295. package/src/auto-continue.ts +43 -0
  296. package/src/code-execution/isolate/scripts.ts +11 -3
  297. package/src/cut-off-round.ts +98 -0
  298. package/src/framework.ts +6168 -1540
  299. package/src/gate/event-gate.ts +2895 -405
  300. package/src/gate/index.ts +10 -1
  301. package/src/gate/recipe-reconcile.ts +355 -0
  302. package/src/gate/reply-judge.ts +512 -0
  303. package/src/gate/types.ts +234 -9
  304. package/src/heartbeat/heartbeat.ts +804 -0
  305. package/src/heartbeat/reminder-time.ts +107 -0
  306. package/src/index.ts +11 -4
  307. package/src/mcpl/capability-mask.ts +3 -2
  308. package/src/mcpl/channel-registry.ts +1222 -468
  309. package/src/mcpl/conversation-router.ts +34 -16
  310. package/src/mcpl/convert-block.ts +14 -1
  311. package/src/mcpl/hook-orchestrator.ts +33 -6
  312. package/src/mcpl/inbound-source.ts +42 -69
  313. package/src/mcpl/index.ts +6 -1
  314. package/src/mcpl/inference-router.ts +79 -34
  315. package/src/mcpl/prose-grammar.ts +7 -0
  316. package/src/mcpl/protocol-family.ts +2 -0
  317. package/src/mcpl/push-coalescer.ts +51 -13
  318. package/src/mcpl/reference-fetcher.ts +201 -162
  319. package/src/mcpl/references.ts +851 -77
  320. package/src/mcpl/server-connection.ts +189 -11
  321. package/src/mcpl/tags.ts +13 -2
  322. package/src/mcpl/tool-lifecycle.ts +21 -0
  323. package/src/mcpl/tool-presence.ts +716 -0
  324. package/src/mcpl/tool-result-normalize.ts +18 -6
  325. package/src/mcpl/tool-signature.ts +316 -0
  326. package/src/mcpl/toolset-host.ts +727 -0
  327. package/src/mcpl/toolsets-module.ts +545 -0
  328. package/src/mcpl/transport.ts +3 -2
  329. package/src/mcpl/types.ts +25 -2
  330. package/src/mcpl/visible-content.ts +22 -9
  331. package/src/module-registry.ts +85 -26
  332. package/src/modules/discord/index.ts +1 -1
  333. package/src/modules/history/index.ts +70 -30
  334. package/src/modules/history/semantic.ts +308 -54
  335. package/src/modules/workspace/answers.ts +133 -0
  336. package/src/modules/workspace/branch-intent.ts +10 -5
  337. package/src/modules/workspace/direct-write.ts +460 -0
  338. package/src/modules/workspace/disk-agreement.ts +52 -21
  339. package/src/modules/workspace/edit-text.ts +84 -35
  340. package/src/modules/workspace/effects.ts +22 -13
  341. package/src/modules/workspace/index.ts +2142 -723
  342. package/src/modules/workspace/observe.ts +381 -177
  343. package/src/modules/workspace/read-page.ts +228 -0
  344. package/src/modules/workspace/reconcile.ts +27 -15
  345. package/src/modules/workspace/result-text.ts +121 -0
  346. package/src/modules/workspace/sync.ts +16 -0
  347. package/src/modules/workspace/text.ts +58 -32
  348. package/src/modules/workspace/types.ts +137 -60
  349. package/src/modules/workspace/watcher.ts +8 -3
  350. package/src/prose-drafts.ts +4 -3
  351. package/src/reasoning-loss-notice.ts +62 -0
  352. package/src/reasoning-loss.ts +120 -0
  353. package/src/send-tools.ts +3 -2
  354. package/src/sent-rows.ts +162 -0
  355. package/src/silent-heartbeat.ts +17 -10
  356. package/src/stable-hash.ts +14 -0
  357. package/src/stored-injections.ts +131 -0
  358. package/src/text-as-stored.ts +4 -3
  359. package/src/thinking-drops.ts +135 -0
  360. package/src/tool-args.ts +34 -1
  361. package/src/tool-image-ledger.ts +9 -8
  362. package/src/tool-presentation.ts +3 -1
  363. package/src/tool-result-guard.ts +45 -17
  364. package/src/tool-result-history.ts +471 -90
  365. package/src/tune-out/coordinator.ts +80 -37
  366. package/src/tune-out/tools.ts +4 -1
  367. package/src/types/agent.ts +220 -7
  368. package/src/types/events.ts +33 -9
  369. package/src/types/framework.ts +36 -3
  370. package/src/types/module.ts +91 -9
  371. package/src/types/trace.ts +94 -3
@@ -0,0 +1,219 @@
1
+ import { answerText, fieldLine, sectionLead, sectionText, textAnswer } from './result-text.js';
2
+ import { MAX_LINE_CHARS, numberedLine, safeCut } from './text.js';
3
+ import { didNothing } from './answers.js';
4
+ /**
5
+ * One page of a read, held to the result limit as its text measures it: a
6
+ * model reads the page's text (result-text.ts), and what passes the caller's
7
+ * limit doesn't reach it whole. A model's result spills into a file, cut, and
8
+ * a script gets ResultTooLarge in its place. So a page stops before its text
9
+ * would pass the limit, and its note says where to continue. A script's
10
+ * answer carries the page's fields, its content among them, beside its text,
11
+ * and the limit counts the text alone. A script's limit counts each character
12
+ * at the six bytes it takes at most in the answer, and no character but a
13
+ * control character takes more than three, so the text and the fields
14
+ * together pass what the script takes only on a page of more than half that
15
+ * limit (about 3.7 million characters at the default 128 MiB of script
16
+ * memory) holding control characters.
17
+ */
18
+ /** How many lines a read shows when it isn't given a limit. */
19
+ export const DEFAULT_READ_LINE_LIMIT = 2000;
20
+ /** What a read says about the text it shows, besides the lines themselves. */
21
+ export function textNotes(file) {
22
+ const notes = [];
23
+ if (file.crlfEnds > 0) {
24
+ // A line whose own text ends in a CR shows its line end's CR too (fileText).
25
+ const kept = file.crKept > 0
26
+ ? `, except on ${file.crKept} ${file.crKept === 1 ? 'line whose own text ends in a CR, which shows' : 'lines whose own text ends in a CR, which show'} both CRs`
27
+ : '';
28
+ notes.push(file.lfEnds > 0
29
+ ? `Line ends are mixed, ${file.crlfEnds} CRLF and ${file.lfEnds} LF, and a CRLF end is shown without its CR${kept}. An edit matches text as read shows it, and keeps each line's end.`
30
+ : `Line ends are CRLF, shown without the CR${kept}. An edit matches text as read shows it, and keeps the CRLF ends.`);
31
+ }
32
+ if (file.bom)
33
+ notes.push('The file starts with a UTF-8 BOM, which isn\'t shown. An edit keeps it.');
34
+ if (!file.utf8)
35
+ notes.push(NOT_UTF8);
36
+ return notes;
37
+ }
38
+ const NOT_UTF8 = 'The file isn\'t valid UTF-8: each invalid byte sequence shows as U+FFFD. Edit refuses this file, and write replaces it whole.';
39
+ const joined = (notes) => {
40
+ const kept = notes.filter((n) => n !== null);
41
+ return kept.length > 0 ? kept.join(' ') : undefined;
42
+ };
43
+ /** A page's text: its fields, one to a line in their order, and then its content under its label. */
44
+ function pageText(page) {
45
+ const header = Object.entries(page)
46
+ .filter((entry) => entry[0] !== 'content' && entry[1] !== undefined)
47
+ .map(([key, value]) => fieldLine(key, value));
48
+ return answerText(header, [sectionText('content', page.content)]);
49
+ }
50
+ /** A page as read answers it: its text for the model, and its fields for a script. */
51
+ const pageAnswer = (page) => textAnswer(pageText(page), page);
52
+ /**
53
+ * Lines from `offset` (1-based), at most `limit` of them, each numbered and a
54
+ * long one cut with the offsetChars and limitChars that read the rest. The
55
+ * page is the longest whose text fits within `maxChars`; where none fits
56
+ * with its first line as a page shows it, that line is cut shorter, at the
57
+ * most the page has room for. Where the page's last line is cut, its note
58
+ * names where that line's rest starts and how long it is, since reading on in
59
+ * order starts there: before the next line, or, on the page that ends the
60
+ * file, before the file is read whole. A page whose own fields and least
61
+ * content pass `maxChars` still moves on, and passes it. With no `maxChars`,
62
+ * for a call made in process, which takes the data itself, the page holds to
63
+ * `limit` alone and shows every line whole.
64
+ */
65
+ export function linePage(path, file, offset, limit, maxChars, extraNotes = []) {
66
+ const { lines, starts } = file;
67
+ const total = lines.length;
68
+ const first = offset - 1;
69
+ const notes = [...textNotes(file), ...extraNotes];
70
+ if (first >= total) {
71
+ // Nothing to show: an empty file, or an offset past the last line. No
72
+ // range is claimed, and the line count says where the file ends.
73
+ const note = joined([
74
+ // Reading an empty file from its start is reading it whole.
75
+ first > 0 ? `Line ${first + 1} is past the end: the file has ${total} line${total === 1 ? '' : 's'}.` : null,
76
+ ...notes,
77
+ ]);
78
+ return pageAnswer({ path, totalLines: total, ...(note !== undefined ? { note } : {}), content: '' });
79
+ }
80
+ const last = Math.min(first + limit, total);
81
+ const shown = (i, maxLineChars = MAX_LINE_CHARS) => numberedLine(lines[i], i + 1, maxLineChars, (cut) => `read the rest with offsetChars=${starts[i] + cut} and limitChars=${lines[i].length - cut}`);
82
+ // Where the rest of line i starts in the stored text, shown at most
83
+ // maxLineChars long, as its marker says; null for a line shown whole.
84
+ const restOf = (i, maxLineChars) => lines[i].length > maxLineChars ? starts[i] + safeCut(lines[i], maxLineChars) : null;
85
+ // The rest's length is what's left of the line as a page shows it, so a
86
+ // character read of it ends where the line does.
87
+ const cutLine = (to, rest) => `Line ${to} is cut: read its rest with offsetChars=${rest} and limitChars=${starts[to - 1] + lines[to - 1].length - rest}`;
88
+ const limitNote = (to, rest) => `Truncated at ${limit} lines (file has ${total}).${rest === null ? '' : ` ${cutLine(to, rest)}.`} Use offset/limit to read more.`;
89
+ const budgetNote = (to, rest) => `Stopped at line ${to} to stay within the ${maxChars}-character result limit (file has ${total}). `
90
+ + (rest === null ? `Continue with offset=${to + 1}.` : `${cutLine(to, rest)}, then continue with offset=${to + 1}.`);
91
+ const page = (to, content, note) => ({
92
+ path, totalLines: total, fromLine: first + 1, toLine: to, ...(note !== undefined ? { note } : {}), content,
93
+ });
94
+ if (maxChars === undefined) {
95
+ const whole = lines.slice(first, last).map((line, k) => numberedLine(line, first + k + 1, Infinity)).join('\n');
96
+ return pageAnswer(page(last, whole, joined([last < total ? limitNote(last, null) : null, ...notes])));
97
+ }
98
+ // The note of the page that ends at line `to`, its last line shown at most
99
+ // lastMax long: the page that ends where it was asked to, at the file's end
100
+ // or the line limit, says so, and any other says it stopped for the limit.
101
+ const noteAt = (to, lastMax = MAX_LINE_CHARS) => {
102
+ const rest = restOf(to - 1, lastMax);
103
+ const endNote = to < total ? limitNote(to, rest) : rest === null ? null : `${cutLine(to, rest)}.`;
104
+ return joined([to === last ? endNote : budgetNote(to, rest), ...notes]);
105
+ };
106
+ // A page's text's length: its fields' and note's, measured with no content,
107
+ // and its content's, under the content's label. A page here has a line.
108
+ const lengthAt = (to, contentChars, note) => pageText(page(to, '', note)).length + sectionLead('content') + contentChars;
109
+ // The page is the longest that fits. Its length isn't monotone in its
110
+ // lines: the page that ends the file carries no stop note, the one at the
111
+ // line limit a shorter one than a stop, and one whose last line is cut a
112
+ // longer one. But every page carries `notes` and a longer page shows more,
113
+ // so once a page passes the limit with those alone, no longer one fits.
114
+ const shownLines = [];
115
+ let contentChars = 0;
116
+ let best = 0;
117
+ for (let i = first; i < last; i++) {
118
+ const line = shown(i);
119
+ shownLines.push(line);
120
+ // Each line after the first comes after a line feed.
121
+ contentChars += line.length + (i > first ? 1 : 0);
122
+ if (lengthAt(i + 1, contentChars, noteAt(i + 1)) <= maxChars)
123
+ best = shownLines.length;
124
+ else if (lengthAt(i + 1, contentChars, joined(notes)) > maxChars)
125
+ break;
126
+ }
127
+ if (best > 0) {
128
+ shownLines.length = best;
129
+ return pageAnswer(page(first + best, shownLines.join('\n'), noteAt(first + best)));
130
+ }
131
+ // No page fits with its first line as a page shows it: the loop tried that
132
+ // page first, since a read's limit is at least 1, and it is pageWith(top).
133
+ // So the line is cut shorter, at the most the page has room for, and ends
134
+ // the page: its note names where the line's rest starts and how long it is,
135
+ // since that comes next. Each cut is measured on the page itself, since its
136
+ // note names the cut. Every cut below `top` shows a marker. A longer cut
137
+ // adds a character of text at least, and the offsets only grow, but the
138
+ // rest's length is in the marker and in the note, so where it loses a digit
139
+ // the page loses two characters: it can be one character shorter than the
140
+ // page a cut before. The search takes the page as growing with the cut.
141
+ // Such a dip is one cut, and the next is many cuts away, so the longest cut
142
+ // that fits is the one the search finds or, past a dip, at most two cuts
143
+ // further, four code units at most, and those are tried too.
144
+ const pageWith = (chars) => page(first + 1, shown(first, chars), noteAt(first + 1, chars));
145
+ const fitsAt = (chars) => pageText(pageWith(chars)).length <= maxChars;
146
+ const top = Math.min(lines[first].length, MAX_LINE_CHARS);
147
+ let fits = 0;
148
+ let over = top;
149
+ while (over - fits > 1) {
150
+ const mid = Math.floor((fits + over) / 2);
151
+ if (fitsAt(mid))
152
+ fits = mid;
153
+ else
154
+ over = mid;
155
+ }
156
+ // The search ends with `fits + 1` measured as too long, or as `top`.
157
+ const found = fits;
158
+ for (let chars = found + 2; chars <= found + 4 && chars < top; chars++)
159
+ if (fitsAt(chars))
160
+ fits = chars;
161
+ return pageAnswer(pageWith(fits));
162
+ }
163
+ const splitsPair = (text, at) => at > 0 && at < text.length
164
+ && text.charCodeAt(at - 1) >= 0xd800 && text.charCodeAt(at - 1) <= 0xdbff
165
+ && text.charCodeAt(at) >= 0xdc00 && text.charCodeAt(at) <= 0xdfff;
166
+ /**
167
+ * Raw text from `offsetChars`, at most `limitChars` code units (one more to
168
+ * keep a surrogate pair whole), stopped sooner where its page's text would
169
+ * pass `maxChars`, if there is one.
170
+ */
171
+ export function characterPage(path, file, offsetChars, limitChars, maxChars, extraNotes = []) {
172
+ const text = file.raw;
173
+ const start = Math.min(offsetChars, text.length);
174
+ if (splitsPair(text, start)) {
175
+ return {
176
+ success: false,
177
+ isError: true,
178
+ error: didNothing('read', `"offsetChars" ${start} falls between the two halves of a surrogate pair, one character in UTF-16. `
179
+ + `Give ${start - 1} or ${start + 1}; a page's nextOffsetChars never splits one.`),
180
+ };
181
+ }
182
+ let end = start + Math.min(limitChars, text.length - start);
183
+ if (splitsPair(text, end))
184
+ end++;
185
+ const notes = [...(file.utf8 ? [] : [NOT_UTF8]), ...extraNotes];
186
+ // A page that stops short of what it was asked for gives what's left of
187
+ // that as limitChars, so a reader that follows its notes ends where it
188
+ // asked to: at a cut line's end, for the rest a line page's note names.
189
+ const stoppedNote = (to, left) => `Stopped at character ${to} to stay within the ${maxChars}-character result limit; read the rest of what you asked for with offsetChars=${to} and limitChars=${left}.`;
190
+ const page = (to, note) => ({
191
+ path,
192
+ totalChars: text.length,
193
+ offsetChars: start,
194
+ nextOffsetChars: to < text.length ? to : null,
195
+ ...(note !== undefined ? { note } : {}),
196
+ content: text.slice(start, to),
197
+ });
198
+ const whole = page(end, joined(notes));
199
+ if (maxChars === undefined || pageText(whole).length <= maxChars)
200
+ return pageAnswer(whole);
201
+ // As many characters as fit beside the rest of the page, which takes the
202
+ // most with the largest offset it could stop at and the most left. A page
203
+ // moves by whole characters, a surrogate pair at once, so it never stops
204
+ // inside one.
205
+ const overhead = pageText({ ...page(end, joined([stoppedNote(end, end - start), ...notes])), nextOffsetChars: end, content: '' }).length + sectionLead('content');
206
+ const step = (at) => (splitsPair(text, at + 1) ? 2 : 1);
207
+ let to = Math.min(end, start + Math.max(0, maxChars - overhead));
208
+ if (splitsPair(text, to))
209
+ to--;
210
+ // A page always moves on, by one character at least, though a limit too
211
+ // small for the page's own fields and its first character then passes it:
212
+ // with room for one code unit, a surrogate pair is still taken whole. Where
213
+ // that reaches the page's own end, it holds all it was asked for, so it
214
+ // names no stop.
215
+ if (to === start)
216
+ to = Math.min(end, start + step(start));
217
+ return pageAnswer(page(to, joined([to < end ? stoppedNote(to, end - to) : null, ...notes])));
218
+ }
219
+ //# sourceMappingURL=read-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-page.js","sourceRoot":"","sources":["../../../../src/modules/workspace/read-page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAiB,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AAEH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QACtB,6EAA6E;QAC7E,MAAM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AAE,MAAM,EAAE,CAAC;IAC3B;;;kCAG8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,6EAA6E,CAAC;AAEpH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,UAAU,CAAC,CAwgBrB"}
@@ -38,8 +38,10 @@
38
38
  * a wrong adoption.
39
39
  */
40
40
  import { candidateOf, sameCandidate, sameRootIdentity, } from './disk-agreement.js';
41
- import { IGNORED, OTHER_MOUNT, ROOT_REPLACED, fingerprintVouches, ignoreBeneath, inOtherMount, locateRoot, looksBinary, observePath, passedOverAt, passedOverBetween, provenAbsent, readHead, readPath, sniffImageMime, walkScope, withinIncludes, } from './observe.js';
41
+ import { storedBytes } from './sync.js';
42
+ import { IGNORED, NOT_A_DIRECTORY, OTHER_MOUNT, ROOT_REPLACED, fingerprintVouches, ignoreBeneath, inOtherMount, locateRoot, looksBinary, observePath, passedOverAt, passedOverBetween, provenAbsent, readHead, readPath, sniffImageMime, walkScope, withinIncludes, } from './observe.js';
42
43
  import { EffectFailed, chainOf, chmodContained, narrowedTo, syncDirectories, unlinkContained, writeContained } from './effects.js';
44
+ import { errnoWords } from './answers.js';
43
45
  const ABSENT = { kind: 'absent' };
44
46
  export const WALK_CAP = 5000;
45
47
  function diskCandidate(d) {
@@ -218,7 +220,7 @@ function inTheWay(reason, deletion) {
218
220
  }
219
221
  // A deletion below a file finds nothing there to unlink, so only a write
220
222
  // meets this one.
221
- if (reason === 'a parent path is not a directory') {
223
+ if (reason === NOT_A_DIRECTORY) {
222
224
  return 'disk has a file or a symlink where this path needs a directory, and no push writes below one, forced or not — ' +
223
225
  'move or remove it on disk and materialize again, or write the file under another path';
224
226
  }
@@ -237,7 +239,7 @@ function inTheWay(reason, deletion) {
237
239
  * to pass.
238
240
  */
239
241
  function forcedWay(note, deletion, forced) {
240
- if (note === 'cannot open (EACCES)')
242
+ if (note === `cannot open (${errnoWords('EACCES')})`)
241
243
  return `, or, if disk lets the workspace ${deletion ? 'unlink' : 'write'} the file, ${forced}`;
242
244
  return '';
243
245
  }
@@ -638,8 +640,8 @@ async function gather(store, agreement, mount, scope, opts) {
638
640
  }
639
641
  else if (!opts.named) {
640
642
  const slash = path.lastIndexOf('/');
641
- const above = slash < 0 ? undefined : passedOverAt(path.slice(0, slash), mount.view.ignore, mount.view.others);
642
- const own = above === undefined && !walk ? passedOverAt(path, mount.view.ignore, mount.view.others) : undefined;
643
+ const above = slash < 0 ? undefined : passedOverAt(path.slice(0, slash), mount.view.ignore, mount.view.others, true);
644
+ const own = above === undefined && !walk ? passedOverAt(path, mount.view.ignore, mount.view.others, false) : undefined;
643
645
  byDesign = above ?? own;
644
646
  }
645
647
  else if (scope.kind === 'dir') {
@@ -746,9 +748,13 @@ export async function reconcilePass(store, agreement, mount, scope, opts = {}) {
746
748
  planned.push({ path, verdict, d, s, p, bi });
747
749
  }
748
750
  // The evidence about to be recorded describes the root it was gathered
749
- // under, which is recorded first (once per mount), so no crash can leave
750
- // evidence without its root.
751
- if (gathered.rootIdentity && planned.some((x) => x.verdict.adopt !== undefined || x.verdict.p !== undefined)) {
751
+ // under, which is recorded first, so no crash can leave evidence without
752
+ // its root. Once a root is recorded, every pass that found it offers it,
753
+ // evidence or none: the same root on a new device, or with its first
754
+ // birth time, is recorded again (recordRootIdentity writes nothing
755
+ // otherwise), and a quiet mount's passes are where an old record learns
756
+ // its birth time.
757
+ if (gathered.rootIdentity && (agreement.rootIdentity(mount.name) !== undefined || planned.some((x) => x.verdict.adopt !== undefined || x.verdict.p !== undefined))) {
752
758
  agreement.recordRootIdentity(mount.name, gathered.rootIdentity);
753
759
  }
754
760
  // 1. Intents for adoptions, durable before any tree commit.
@@ -1015,12 +1021,12 @@ export async function pushPaths(store, agreement, mount, paths, opts = {}) {
1015
1021
  continue;
1016
1022
  }
1017
1023
  const priorP = p && (p.kind === 'absent' || p.kind === 'content') ? p : null;
1018
- const blob = store.getBlob(s.hash);
1024
+ const stored = storedBytes(store, s.hash);
1019
1025
  const forcedMode = mount.modesObserved && s.mode !== undefined && s.mode !== (d.kind === 'file' ? d.mode : undefined) ? s.mode : undefined;
1020
1026
  const agreedMode = priorP?.kind === 'content' ? priorP.mode : undefined;
1021
- if (blob) {
1027
+ if ('bytes' in stored) {
1022
1028
  plans.push({
1023
- path, kind: 'write', blob, hash: s.hash, prior: priorP, before: agreement.get(mount.name, path), expect,
1029
+ path, kind: 'write', blob: stored.bytes, hash: s.hash, prior: priorP, before: agreement.get(mount.name, path), expect,
1024
1030
  ...(forcedMode !== undefined ? { apply: forcedMode } : {}),
1025
1031
  ...(forcedMode !== undefined && d.kind === 'file' && agreedMode !== d.mode ? { overDisk: true } : {}),
1026
1032
  ...(s.mode !== undefined ? { storeMode: s.mode } : {}),
@@ -1031,7 +1037,7 @@ export async function pushPaths(store, agreement, mount, paths, opts = {}) {
1031
1037
  });
1032
1038
  }
1033
1039
  else
1034
- result.skipped.push({ path, reason: 'the workspace copy is missing from the store' });
1040
+ result.skipped.push({ path, reason: unstoredCopy(stored) });
1035
1041
  continue;
1036
1042
  }
1037
1043
  if (v.mode === 'adopt' && s && d.kind === 'file') {
@@ -1057,7 +1063,7 @@ export async function pushPaths(store, agreement, mount, paths, opts = {}) {
1057
1063
  }
1058
1064
  // Whatever the verdict learned about disk (an agreement, a resolved
1059
1065
  // intent) is recorded before anything is pushed over it, and the root it
1060
- // was learned under before that (once per mount), as a pass does.
1066
+ // was learned under before that, as a pass does.
1061
1067
  if (v.p !== undefined)
1062
1068
  agreement.recordRootIdentity(mount.name, root.identity);
1063
1069
  if (v.p === 'forget')
@@ -1192,11 +1198,12 @@ export async function pushPaths(store, agreement, mount, paths, opts = {}) {
1192
1198
  plans.push({ path, kind: 'unlink', prior, before: agreement.get(mount.name, path), expect });
1193
1199
  continue;
1194
1200
  }
1195
- const blob = store.getBlob(s.hash);
1196
- if (!blob) {
1197
- result.skipped.push({ path, reason: 'the workspace copy is missing from the store' });
1201
+ const stored = storedBytes(store, s.hash);
1202
+ if (!('bytes' in stored)) {
1203
+ result.skipped.push({ path, reason: unstoredCopy(stored) });
1198
1204
  continue;
1199
1205
  }
1206
+ const blob = stored.bytes;
1200
1207
  // The store's mode goes to disk with its bytes where the file is new,
1201
1208
  // the push is forced, or disk still has the mode they last agreed on. A
1202
1209
  // push that completes our own unconfirmed one, whose bytes landed, is a
@@ -1421,4 +1428,7 @@ export async function pushPaths(store, agreement, mount, paths, opts = {}) {
1421
1428
  agreement.maybeCheckpoint();
1422
1429
  return result;
1423
1430
  }
1431
+ function unstoredCopy(stored) {
1432
+ return 'missing' in stored ? 'the workspace copy is missing from the store' : `the workspace copy is unreadable in the store (${stored.unreadable})`;
1433
+ }
1424
1434
  //# sourceMappingURL=reconcile.js.map