@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
@@ -20,7 +20,8 @@
20
20
  * retires).
21
21
  *
22
22
  * The ReferenceRegistry is the host-private reference record (§6.2): raw
23
- * URIs and testimony live here and never in model-visible content. Fetching
23
+ * URIs and testimony live here, and model-visible content shows a uri only
24
+ * as a tool result's link line shows one (shownLinkUri). Fetching
24
25
  * (§6/§7 origin binding, ceilings, redirects) is deliberately not here yet —
25
26
  * the registry is what makes a future host-mediated fetcher and the
26
27
  * code-execution materialization hook possible.
@@ -43,6 +44,10 @@ export interface ReferenceTestimony {
43
44
  disposition?: ReferenceDisposition;
44
45
  rejectedFields: string[];
45
46
  truncatedFields: string[];
47
+ /** Set when the testimony is an MCP resource_link's, which claims no
48
+ * digest, expiry or disposition. A link is registered but never fetched
49
+ * on the side, and its testimony never replaces a record's (register). */
50
+ fromLink?: true;
46
51
  }
47
52
  export type BlockClassification = {
48
53
  kind: 'text';
@@ -53,11 +58,36 @@ export type BlockClassification = {
53
58
  kind: 'reference';
54
59
  testimony: ReferenceTestimony;
55
60
  }
61
+ /** MCP's embedded resource (embeddedResourceContents): each lane shows
62
+ * its contents as it shows the block they make. */
63
+ | {
64
+ kind: 'embedded';
65
+ contents: EmbeddedContents;
66
+ }
56
67
  /** `shown` is what the model-visible lanes put in the block's place. */
57
68
  | {
58
69
  kind: 'invalid';
59
70
  shown: string;
60
71
  };
72
+ /** What an embedded resource's contents are shown as: the ordinary block
73
+ * they make, withheld inline data, or a marker saying why they aren't
74
+ * shown. */
75
+ export type EmbeddedContents = {
76
+ kind: 'block';
77
+ block: {
78
+ type: 'text';
79
+ text: string;
80
+ } | {
81
+ type: 'image' | 'audio';
82
+ data: string;
83
+ mimeType: string;
84
+ };
85
+ } | {
86
+ kind: 'withheld';
87
+ } | {
88
+ kind: 'marker';
89
+ text: string;
90
+ };
61
91
  export declare function classifyBlock(block: unknown): BlockClassification;
62
92
  /** RFC-005 vector 2: an inline-data block claiming bulk disposition (or
63
93
  * smuggling a uri beside its data) is an emitter contradiction — the host
@@ -72,6 +102,26 @@ export declare const AUDIO_NO_MEDIA_TYPE_TEXT = "[Audio not shown: its data arri
72
102
  * inline data, so a plain link isn't enough either. (A tool result's audio
73
103
  * with a link is a reference, as any block with one is there.) */
74
104
  export declare const AUDIO_NO_DATA_TEXT = "[Audio not shown: it arrived with no usable inline data.]";
105
+ /** MCP's embedded resource whose contents are neither text nor a blob, or
106
+ * both. */
107
+ export declare const EMBEDDED_RESOURCE_UNREADABLE_TEXT = "[Resource not shown: its contents arrived as neither text nor data, or as both.]";
108
+ /** MCP's embedded resource whose blob has no media type, so it can't be
109
+ * shown as an image or audio. */
110
+ export declare const EMBEDDED_RESOURCE_NO_MEDIA_TYPE_TEXT = "[Resource not shown: its data arrived without a media type.]";
111
+ /** MCP's embedded resource whose blob is of a type no lane can show: what
112
+ * it was, by its type and size. Made well formed (a lone UTF-16 surrogate
113
+ * becomes U+FFFD), as a stub is (#695), since it names the block's media
114
+ * type, which sanitizeLabel leaves as it is: every lane then shows the same
115
+ * text. */
116
+ export declare function embeddedBinaryText(mimeType: string, blob: string): string;
117
+ /**
118
+ * What the converter (convertBlock, on every lane) shows for a text
119
+ * block whose text isn't a string, which only a nonconformant sender writes,
120
+ * so the agent learns that a block was there. It is the host's word, not the
121
+ * sender's, so it never makes content visible (isVisiblyEmptyConversion in
122
+ * visible-content.ts, which re-exports it).
123
+ */
124
+ export declare const NON_STRING_TEXT_PLACEHOLDER = "[Text not shown: a text part arrived without readable text.]";
75
125
  export declare const REFERENCE_NO_LINK_TEXT = "[Reference not shown: it arrived without a link.]";
76
126
  export declare const REFERENCE_LINK_TOO_LONG_TEXT = "[Reference not shown: its link is longer than this host accepts.]";
77
127
  /** A block of a type the host doesn't show, of no type at all, or no block.
@@ -101,17 +151,120 @@ export declare const EXPIRY_REASON: {
101
151
  * the fetcher's refusal and save_recent_image's all say it: the fetcher dials
102
152
  * only through a server that delivered the reference. */
103
153
  export declare const UNBOUND_REASON = "not tied to any server, so there's nowhere to fetch it from";
104
- /** The fetcher's refusal for a server it has no address to dial, one the
105
- * host doesn't connect to over a network, such as a stdio server, as a
106
- * clause that completes "couldn't fetch <ref>: " and says so of the server;
107
- * the fetcher dials only through a server's address. save_recent_image gives
108
- * it too. A stub can't know it, since only the framework holds its servers'
109
- * configs. */
154
+ /** The refusal for a server the host has no address to dial, one it doesn't
155
+ * connect to over a network, such as a stdio server, as a clause that
156
+ * completes "couldn't fetch <ref>: " and says so of the server: the fetcher
157
+ * dials only through a server's address. A reference's stub, fetch_reference
158
+ * and save_recent_image all give it (dialCheck). */
110
159
  export declare function noAddressReason(serverId: string): string;
111
- /** Strip control characters (C0, DEL, C1) and every bidi control (marks,
112
- * embeddings, overrides, isolates, and the Arabic letter mark), trim the
113
- * whitespace (a BOM included) left at either end, and bound the length.
114
- * Labels are labels — storage naming is host-generated elsewhere (§7.3). */
160
+ /** A server's id as the agent reads it in a stub or a refusal: as a label
161
+ * is, bounded and with its controls removed. */
162
+ export declare function shownServerId(serverId: string): string;
163
+ /**
164
+ * Whether a uri may carry a credential: userinfo, or a query or fragment
165
+ * parameter named on CREDENTIAL_PARAMETERS with a value, a fragment read as
166
+ * `name=value&…` as a query is. A name with no value carries nothing, as an
167
+ * anchor (`#token`) or `?token=` doesn't. A `?` or `;` inside either may
168
+ * separate parameters too, as in a route kept in a fragment
169
+ * (`#/reset?token=…`), so the parameters are read both with and without them
170
+ * as separators, and one with a value in either reading counts. A
171
+ * parameter's value that is itself a uri is read the same way
172
+ * (nestedMayCarry): an absolute one, as an image proxy's `?url=<a
173
+ * percent-encoded signed URL>` is once decoded; a protocol-relative one, or
174
+ * a relative one with a query or fragment, as a login's
175
+ * `?next=%2Freset%3Ftoken%3D…` is; and one encoded again inside the value,
176
+ * as a redirector that encodes an already encoded url leaves it, each read
177
+ * and each decode a level of its own. That goes up to CREDENTIAL_NESTING
178
+ * levels deep, and a uri reached deeper may carry one, since a bound that
179
+ * let the next level through would be the same gap one level down. A uri
180
+ * carried in another encoding, such as base64, isn't read. A uri that
181
+ * doesn't parse, even as a relative reference, may, since its parts can't be
182
+ * read.
183
+ */
184
+ export declare function uriMayCarryCredential(uri: string): boolean;
185
+ /** How the host reaches a server, as far as fetching its references goes:
186
+ * the WebSocket url it dials an MCPL server at, or none: for a server it
187
+ * spawns, such as a stdio one, or a modern MCP server over HTTP, whose
188
+ * results carry no references (RFC-005 governs MCPL peers' alone), or one
189
+ * whose url the transport won't dial. A framework records each of its
190
+ * servers' in the registry (ReferenceRegistry.setServerAddress), where a
191
+ * stub reads it; its fetcher reads the same from the framework's own
192
+ * configs, beside each server's credential. */
193
+ export type ServerAddress = {
194
+ url: string;
195
+ } | 'no-address';
196
+ /** Why a fetch of a reference failed, or would be refused before it dials. */
197
+ export interface Refusal {
198
+ /** What happened, as a clause that completes "couldn't fetch <ref>: ",
199
+ * whatever it's about: fetch_reference's sentence, save_recent_image's,
200
+ * and the eager and script-demand fetches' log lines read it. */
201
+ error: string;
202
+ /** What calling again can do, as a sentence. fetch_reference and
203
+ * save_recent_image show it; the eager and script-demand fetches log the
204
+ * error alone, and a reference's stub never shows it. */
205
+ remedy: string;
206
+ /** How the reference's stub words it, where the clause names parts of the
207
+ * uri the stub never shows. A stub shows this or the clause. */
208
+ inStub?: string;
209
+ }
210
+ export declare const NOTHING_TO_DO = "Calling again won't change that.";
211
+ /** The registry keys a record by its uri, so a fresh reference to the same
212
+ * uri arrives as this very id and refreshes its record. */
213
+ export declare const FRESH_REFERENCE = "Once a fresh reference to it arrives, fetching may work; until then, fetching it again won't.";
214
+ /** A server's address is read from the host's configs as they are at each
215
+ * fetch. */
216
+ export declare const SERVER_BACK = "Calling again won't change that unless whoever runs this host adds that server back.";
217
+ /** ws→http / wss→https with default ports elided, for origin comparison. */
218
+ export declare function normalizedOrigin(url: string): string | null;
219
+ /**
220
+ * The server a fetch of a reference would dial: its servers, in the order
221
+ * they delivered it, the first whose address is on the uri's origin (§6.2).
222
+ * When none is, the first server's refusal (unknown to this host, with no
223
+ * address, or the origin check's), and for a record no server delivered,
224
+ * that it's unbound, which a later delivery of the uri by a server mends.
225
+ */
226
+ export declare function dialServer(record: ReferenceRecord, addressOf: (serverId: string) => ServerAddress | undefined): {
227
+ serverId: string;
228
+ } | {
229
+ refusal: Refusal;
230
+ };
231
+ /**
232
+ * Where a fetch of a reference would dial, or why it would be refused before
233
+ * dialing, whatever the fetch: dialServer's server, then the reference's
234
+ * expiry. A pure function of the record and the servers' addresses: a
235
+ * reference's stub asks it of the registry's (unfetchableReason), and the
236
+ * fetcher's pre-dial check of its own framework's configs, whose credential
237
+ * goes with the address it checks. In a process with one running framework,
238
+ * or with running frameworks that agree on each id they share, the two
239
+ * sources hold the same addresses, so a stub promises the server the fetch
240
+ * dials. A stub reads an expiry with its result's claims, and the fetch with
241
+ * the record's latest testimony, so where one result names a uri both
242
+ * expired and fresh, its stub says expired while a fetch can succeed. A
243
+ * stopped framework's addresses are out of the registry, so its stubs read
244
+ * another running framework's entry for the same id where there is one, and
245
+ * otherwise say the server is unknown, while its configs still resolve it.
246
+ * Where two
247
+ * frameworks configure one id differently, only a stub's words can be wrong,
248
+ * never where a token goes. A fetch's own limits, its budget and ceiling,
249
+ * come after it.
250
+ */
251
+ export declare function dialCheck(record: ReferenceRecord, addressOf: (serverId: string) => ServerAddress | undefined, nowMs?: number,
252
+ /** For a stub or a script's object, the claims of the result it's shown
253
+ * in, which decide where its references name the record's uri, the
254
+ * record's own testimony deciding otherwise (claimedExpiry). A fetch
255
+ * reads the record alone. */
256
+ claims?: ResultClaims): {
257
+ serverId: string;
258
+ } | {
259
+ refusal: Refusal;
260
+ };
261
+ /** Strip control characters (C0, DEL, C1), every bidi control (marks,
262
+ * embeddings, overrides, isolates, and the Arabic letter mark) and the line
263
+ * and paragraph separators (U+2028, U+2029), which a regex reads as line
264
+ * ends, so a label can't start a line of its own, such as one the image
265
+ * ledger would read as a slot. Then trim the whitespace (a BOM included)
266
+ * left at either end, and bound the length. Labels are labels — storage
267
+ * naming is host-generated elsewhere (§7.3). */
115
268
  export declare function sanitizeLabel(s: string, maxChars: number): string;
116
269
  export declare function formatSizeBytes(n: number): string;
117
270
  export interface ReferenceRecord {
@@ -128,6 +281,13 @@ export interface ReferenceRecord {
128
281
  verifiedBytes?: number;
129
282
  verifiedMimeType?: string;
130
283
  digestVerified?: boolean;
284
+ /** Set when the eager default's fetch of it failed, so the eager default
285
+ * doesn't choose it again; fetch_reference still fetches it. A refreshed
286
+ * testimony leaves it set, since a server can re-issue a uri at every
287
+ * result, and it lasts as long as the record. A record fetched later, by a
288
+ * save that landed after the eager pass stopped waiting or by
289
+ * fetch_reference, can carry it too: fetchedPath is read first. */
290
+ eagerFailed?: boolean;
131
291
  }
132
292
  /**
133
293
  * Host-private store of received references. Raw URIs live here and in stubs
@@ -144,7 +304,7 @@ export interface ReferenceRecord {
144
304
  export declare class ReferenceRegistry {
145
305
  private records;
146
306
  /** uri → refId. The uri ALONE is the identity key: a tool result's stubs
147
- * (tool-result-history.ts's, and framework.ts's tryNativeToolResultContent)
307
+ * (tool-result-history.ts's, which both copies of a tool result take)
148
308
  * and a script's demand fetch register with no server context,
149
309
  * while the registrations that know the server carry its id: a tool
150
310
  * result's, before it's shown, whether the agent's dispatch or an
@@ -161,77 +321,251 @@ export declare class ReferenceRegistry {
161
321
  * its own origin, for a uri it delivered. */
162
322
  private byKey;
163
323
  private counter;
324
+ /** Each open journal's copies (openJournal), by uri. */
325
+ private journals;
326
+ /**
327
+ * Keep, until `close`, each record as it stood when this opened: a copy
328
+ * taken the first time a registration names its uri, whatever it changes,
329
+ * or evicts its record, or null where the uri had none then. `before(uri)`
330
+ * gives that copy, or, where no registration has named the uri since, the
331
+ * record as it is, which is the same. A fetch that saves a copy while it's
332
+ * open sets its record's saved path without registering: a record no
333
+ * registration has named since is read with it, and one a registration
334
+ * named first is read as it stood then, saved or not. For a record a fetch
335
+ * saved meanwhile, both readings are of one the host can fetch, since a
336
+ * fetch saves only what passed the checks a link's line reads too, except
337
+ * where two frameworks configure one server id differently, which a stub's
338
+ * words can't tell apart either (setServerAddress). Each
339
+ * open has its own copies, so lanes that overlap keep theirs apart, and
340
+ * closing one lets its copies go.
341
+ */
342
+ openJournal(): RegistryJournal;
343
+ /** Copy a uri's record into each open journal that has none for it yet,
344
+ * a copy of its own for each. */
345
+ private keepFirst;
346
+ /** How many journals are open: none once every lane has closed its own. */
347
+ get journalCount(): number;
164
348
  register(testimony: ReferenceTestimony, serverId?: string): ReferenceRecord;
165
349
  get(refId: string): ReferenceRecord | undefined;
350
+ /** How the host reaches each server, by id, as each framework in the process
351
+ * configured it, which a reference's stub reads (unfetchableReason). A
352
+ * fetch reads its own framework's configs instead, so a server's token only
353
+ * ever goes to the origin its own config names. Keyed by id as a record's
354
+ * servers are: where two frameworks configure one id, the latest entry is
355
+ * in force, and a stub's words can be wrong for the other one's fetch. */
356
+ private addresses;
357
+ /** Record how the host reaches a server, as a framework (`owner`) does for
358
+ * each server it configures. Its entry for the id is then in force. */
359
+ setServerAddress(serverId: string, address: ServerAddress, owner: object): void;
360
+ /** Take back a framework's entry for a server, as it does for a server it
361
+ * removes, and for each of its servers when it stops. Another framework's
362
+ * entry for the id, if any, is in force again; with none, a stub reads the
363
+ * id's references as an unknown server's. After a removal, that framework's
364
+ * fetch refuses them too. A stopped framework keeps its configs, so its
365
+ * fetcher, called before it starts again, can still dial them. */
366
+ forgetServerAddress(serverId: string, owner: object): void;
367
+ serverAddress(serverId: string): ServerAddress | undefined;
166
368
  /** Find the record for a uri. */
167
369
  findByUri(uri: string): ReferenceRecord | undefined;
168
370
  }
169
371
  export declare const referenceRegistry: ReferenceRegistry;
372
+ /** A registry's records as they stood when it opened (openJournal). */
373
+ export interface RegistryJournal {
374
+ before(uri: string): ReferenceRecord | undefined;
375
+ close(): void;
376
+ }
377
+ /**
378
+ * The model's line for a result as a script's link object reads it: the
379
+ * claims that line reads, and each record as it stood when the script lane
380
+ * began to treat the result (a journal's `before`), whatever the treatment
381
+ * has registered, rebound or evicted since, which the line never sees.
382
+ */
383
+ export interface ScriptLine {
384
+ claims: ResultClaims;
385
+ recordBefore(uri: string): ReferenceRecord | undefined;
386
+ }
170
387
  /** A reference's type as its stub shows one, or '' when nothing is left of
171
388
  * it once sanitized (the stub then leaves it out). */
172
389
  export declare function referenceTypeLabel(mimeType: string | undefined): string;
173
390
  /**
174
- * The longest line buildReferenceStub writes, in UTF-16 code units, from its
391
+ * The longest stub buildReferenceStub writes, in UTF-16 code units, from its
175
392
  * own bounds: the longest id the registry mints, then the name, the type with
176
393
  * the largest size it shows, and the origin, each at its bound, and the
177
394
  * longest ending, a saved copy's path, with their separators. The other
178
395
  * endings, the fetch hint and the reasons a fetch would be refused, are
179
396
  * shorter. A line shaped like a stub but longer than this is quoted text the
180
- * writer can't have written, and no image slot (tool-image-ledger.ts).
397
+ * writer can't have written, and no image slot (tool-image-ledger.ts). A
398
+ * tool result's link line (StubOptions.unfetchedLinkUri) isn't shaped like a
399
+ * stub, so it's no slot whatever its length.
181
400
  */
182
401
  export declare const REFERENCE_STUB_MAX_CHARS: number;
402
+ /** How a lane shows a reference beyond its stub. */
403
+ export interface StubOptions {
404
+ /**
405
+ * Show a link (MCP's resource_link) the host can't fetch as its name, uri
406
+ * and type, unless its uri may carry a credential (uriMayCarryCredential).
407
+ * For a tool result's links, whose JSON showed every link's uri before
408
+ * this host read links as references: there the uri is the agent's only
409
+ * handle on a link the host can't fetch, and showing it is §5's MAY for a
410
+ * reference the host's policy classifies as non-capability-bearing. No
411
+ * other lane showed a link's uri, so none shows one now.
412
+ */
413
+ unfetchedLinkUri?: boolean;
414
+ /** The claims of the result this block is shown in (resultClaims), which
415
+ * decide what the stub says where its references name the record's uri,
416
+ * the record's own testimony deciding otherwise. */
417
+ claims?: ResultClaims;
418
+ }
419
+ /**
420
+ * What one tool result's references claim of each uri they name, each uri's
421
+ * testimonies read as one (UriClaims): the strictest claim wins, so a uri any
422
+ * of them marks `disposition: never` is withheld, and one any of them gives
423
+ * an expiry that counts is expired (claimedExpiry), whatever the order of the
424
+ * blocks and whatever the registry evicted while it was read (Ada-1017's
425
+ * call). A decision about a record reads its result's claims where the
426
+ * result's references name its uri, a plain one included, and otherwise the
427
+ * record's own testimony, from an earlier result. A reference naming the uri
428
+ * is that result's word on it, the latest, as the registry keeps it
429
+ * (register() replaces a record's testimony with it until the record is
430
+ * fetched), so an earlier result's `never` or expiry gives way to it
431
+ * (Ada-1017's call). A link claims no disposition or expiry, so it adds
432
+ * nothing here, and a result that names a uri only in links leaves its
433
+ * record's testimony in force.
434
+ */
435
+ export type ResultClaims = ReadonlyMap<string, UriClaims>;
436
+ /**
437
+ * A uri as a link shows it: cleaned as sanitizeLabel cleans a label (controls
438
+ * and bidi marks dropped, surrounding space trimmed; a uri past
439
+ * REFERENCE_LIMITS.uri is no reference, so none is shortened), and well
440
+ * formed, as every copy is before it's shown, a lone surrogate showing as
441
+ * U+FFFD. A `never` is about what a link shows, so it's found by this text
442
+ * (neverShown): a claim of `never` on a uri withholds every link that shows
443
+ * the same text, two uris that clean alike sharing it. Every other claim is about the record,
444
+ * which the fetch reads by its raw uri, so it's kept by the raw uri (Ada-1017,
445
+ * room-203 #202239).
446
+ */
447
+ export declare function shownUri(uri: string): string;
448
+ /** What a result's references say of one uri, read as one. */
449
+ export interface UriClaims {
450
+ /** Whether any of them marks it `disposition: never`. */
451
+ never: boolean;
452
+ /** Whether any of them gives an expiry rejected as a field. */
453
+ rejected: boolean;
454
+ /** Whether any of them gives an expiry that doesn't parse. */
455
+ unparseable: boolean;
456
+ /** The earliest expiry any of them gives, in ms since the epoch, or null. */
457
+ earliestMs: number | null;
458
+ }
459
+ /** A result's claims (ResultClaims), from the testimonies of its references,
460
+ * each read once, as referenceExpiry reads an expiry. */
461
+ export declare function resultClaims(testimonies: Iterable<ReferenceTestimony>, nevers?: Iterable<string>): ResultClaims;
462
+ /** The claims of a content array's references, read from its elements as
463
+ * the array shows them: an element's own fields, such as an image's
464
+ * `_meta`, aren't shown, so a reference inside them doesn't count. */
465
+ export declare function contentClaims(blocks: readonly unknown[]): ResultClaims;
466
+ /** The uri inline content marks `disposition: never`, which counts for that
467
+ * uri's claims (resultClaims) though the block is no reference: inline data
468
+ * beside its uri, the classifier's contradiction, and MCP's embedded
469
+ * resource, whose uri sits under `resource` (Ada-1017, room-203 #206688).
470
+ * Null for any other block. A uri that isn't a non-empty string names
471
+ * nothing a claim is kept for. */
472
+ export declare function inlineNeverUri(block: unknown, c?: BlockClassification): string | null;
473
+ /** Whether a record's uri is withheld: marked `disposition: never` by its
474
+ * result's references, for any uri a link shows as the same text
475
+ * (shownUri), or by its own testimony where none of them names it. */
476
+ export declare function claimedNever(record: ReferenceRecord, claims?: ResultClaims): boolean;
477
+ /** The expiry a record counts, as of `nowMs`: the first of EXPIRY_REASON's
478
+ * cases its claims give (uriClaims), so the order of the blocks doesn't
479
+ * choose the words. Null when none does. */
480
+ export declare function claimedExpiry(record: ReferenceRecord, claims: ResultClaims | undefined, nowMs: number): keyof typeof EXPIRY_REASON | null;
481
+ /**
482
+ * The uri a tool result's link shows, or null where it shows none: a link
483
+ * (fromLink) the host can't fetch, whose uri can't carry a credential, and
484
+ * that no reference withholds with `disposition: never`, keeps its uri, the
485
+ * agent's only handle on it. A `data:` uri holds its content rather than
486
+ * naming where it lies, so it's never shown: a link's line isn't a way for
487
+ * inline data to reach context. A tool result's link line (buildReferenceStub,
488
+ * unfetchedLinkUri) and a script's object for the link
489
+ * (referenceBlockForScript) both ask this, so the model and a script, whose
490
+ * output comes back to the model, see a link's uri alike.
491
+ *
492
+ * The credential check reads the uri as it would be shown, with what
493
+ * sanitizeLabel strips gone, so a uri split by a control character is read
494
+ * as it would read: `ht\u0000tps://user:pass@…` parses as a path, and shows
495
+ * as userinfo. A `disposition: "never"` for the uri keeps it out whatever
496
+ * the link says: any reference's in the same result (claims), for this uri
497
+ * or one shown as the same text, or, where no reference in the result names
498
+ * the uri, the record's.
499
+ */
500
+ export declare function shownLinkUri(t: ReferenceTestimony, record: ReferenceRecord, nowMs?: number, claims?: ResultClaims): string | null;
183
501
  /**
184
- * Build the model-visible stub for a reference. Output length is bounded by
185
- * host constants and independent of every server-supplied field length.
186
- * Under `disposition:"never"` the uri is omitted unconditionally; under
187
- * `ref`/absent it is omitted too — this host's default policy is the opaque
188
- * id everywhere (the safe default of §5), with retrieval via the record.
502
+ * Build the model-visible stub for a reference. Its length is bounded by
503
+ * host constants and independent of every server-supplied field's length:
504
+ * REFERENCE_STUB_MAX_CHARS. Under `disposition:"never"` the uri is omitted
505
+ * unconditionally; under `ref`/absent it is omitted too — this host's default
506
+ * policy is the opaque id everywhere (the safe default of §5), with retrieval
507
+ * via the record. The one exception is a tool result's link the host can't
508
+ * fetch (StubOptions.unfetchedLinkUri), which is no stub but a line of its
509
+ * own, its uri bounded by REFERENCE_LIMITS.uri.
189
510
  */
190
- export declare function buildReferenceStub(t: ReferenceTestimony, provenance?: string, serverId?: string): string;
511
+ export declare function buildReferenceStub(t: ReferenceTestimony, provenance?: string, serverId?: string, options?: StubOptions): string;
191
512
  /**
192
- * Why the fetcher would refuse a reference, as far as its record alone shows,
193
- * for its stub: no server registered for it, which the fetcher checks first,
194
- * or its expiry. Null for a saved copy, which the fetcher serves before any
195
- * check, and when the record shows neither. The fetcher's other refusals rest
196
- * on what a record doesn't hold: whether any of its servers is known to the
197
- * host, has an address and is on the uri's origin, the dialed server's fetch
198
- * budget spent, or a claimed size over the ceiling a fetch is given. The
199
- * fetcher gives those in its own words, and save_recent_image, in the
200
- * framework where it can ask the fetcher, says them too.
513
+ * Why the fetcher would refuse a reference before it dials, whatever the
514
+ * fetch, in its stub's words: the registry's dialCheck, from its record and
515
+ * its servers' addresses. Null for a saved copy, which the fetcher serves
516
+ * before any check, and where a fetch would dial. A fetch's own limits, the
517
+ * server's spent budget or a claimed size over the ceiling it's given, the
518
+ * fetcher gives in its own words, and save_recent_image says them too.
201
519
  */
202
- export declare function unfetchableReason(record: ReferenceRecord, nowMs?: number): string | null;
520
+ export declare function unfetchableReason(record: ReferenceRecord, nowMs?: number, claims?: ResultClaims): string | null;
203
521
  /**
204
522
  * RFC-005 treatment for one MCPL wire block, for the model-visible text
205
523
  * lanes. Returns a replacement string, or null when the block should keep
206
524
  * its existing (inline/text) handling. A reference's stub carries text taken
207
525
  * from the block's own fields, so it's made well formed (a lone UTF-16
208
526
  * surrogate becomes U+FFFD), as the context store would make it: a tool
209
- * result's copies then carry the same text (#695).
527
+ * result's copies then carry the same text (#695). For MCP's embedded
528
+ * resource, it's the text for contents that can't be shown (its marker is
529
+ * well formed where it's made), and null where they can: the caller shows the
530
+ * block they make (classifyBlock's `embedded`).
210
531
  */
211
- export declare function referenceStubOrNull(block: unknown, provenance?: string, serverId?: string): string | null;
532
+ export declare function referenceStubOrNull(block: unknown, provenance?: string, serverId?: string, options?: StubOptions): string | null;
212
533
  /**
213
534
  * RFC-005 treatment for one MCPL wire block, for a script's structured
214
535
  * result, which carries blocks rather than text. It makes the decision
215
536
  * referenceStubOrNull makes for the model's lanes, since what a script prints
216
537
  * comes back to the model, except that a script reads every field, so inline
217
- * data beside a uri of any type but null or absent is withheld, where the
218
- * model's lanes, which show no uri, withhold it beside a string one. A reference becomes the stub's facts as data,
219
- * without its URI: the host's reference id, what the server said about it in
220
- * this block (its labels stripped and bounded as in the stub), and `savedTo`,
221
- * the workspace path its payload was fetched to, or null when it wasn't
222
- * (`fetch_reference` takes the id as `ref_id`). An unsaved reference that
223
- * counts as expired also carries `expired`, the reason the stub gives in
224
- * place of advising fetch_reference. The reference is registered bound to
225
- * `serverId`, the server whose tool returned it, as the model's lanes bind
226
- * a tool result's references, so the fetch its id offers can be made. With
227
- * no `serverId`, as for a module's result, it's registered as the model's
538
+ * data beside a uri of any type but null, absent or empty is withheld, where
539
+ * the model's lanes, which show no uri, withhold it beside a string one that
540
+ * isn't empty. A reference becomes the stub's facts as data: the host's
541
+ * reference id, what the server said about it in this block (its labels
542
+ * stripped and bounded as in the stub), and `savedTo`, the workspace path
543
+ * its payload was fetched to, or null when it wasn't (`fetch_reference`
544
+ * takes the id as `ref_id`). Its uri is left out, except that a link (MCP's
545
+ * resource_link) carries `uri` where the model's line for it shows the uri
546
+ * (shownLinkUri). An unsaved reference that counts as expired also carries
547
+ * `expired`, and one the fetcher would refuse carries `unfetchable`, the
548
+ * words a stub gives in place of advising fetch_reference
549
+ * (unfetchableReason). Both give why a fetch_reference with the object's
550
+ * `refId` would be refused, as the result's references claim it, so a link
551
+ * whose line shows its uri, which the host can't fetch, carries them too: its
552
+ * line has no id to fetch with. The fetch itself reads the record, which
553
+ * keeps the latest testimony registered until it's fetched, and then the one
554
+ * its saved copy was verified against (Ada-1017's call). `claims` are those
555
+ * of everything the script's view shows (scriptViewClaims), so its other
556
+ * references count (ResultClaims). The reference is registered bound to
557
+ * `serverId`, the server whose tool returned it, as the model's lanes bind a
558
+ * tool result's references, so the fetch its id offers can be made. With no
559
+ * `serverId`, as for a module's result, it's registered as the model's
228
560
  * history registers a module's: the record its uri already has, bound where
229
561
  * it arrived (a module's ctx.callTool registers an MCPL peer's references),
230
562
  * or a new one bound to no server. A block the classifier
231
563
  * rejects becomes the notice the model's lanes show, and inline data that
232
- * also claims a bulk disposition, or a uri of any type but null or absent
233
- * (an empty string included), the withheld notice, each as a text block.
564
+ * also claims a bulk disposition, or a uri of any type but null, absent or
565
+ * empty, the withheld notice, each as a text block. MCP's embedded resource
566
+ * becomes the block its contents make, as the model's lanes show it, never
567
+ * its uri.
234
568
  * A text block, or inline data that claims nothing, is returned as sent.
235
569
  */
236
- export declare function referenceBlockForScript(block: unknown, serverId?: string): unknown;
570
+ export declare function referenceBlockForScript(block: unknown, serverId?: string, claims?: ResultClaims, line?: ScriptLine): unknown;
237
571
  //# sourceMappingURL=references.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../src/mcpl/references.ts"],"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