@animalabs/agent-framework 0.26.2 → 0.27.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 (276) hide show
  1. package/README.md +56 -6
  2. package/dist/src/agent.d.ts +263 -22
  3. package/dist/src/agent.d.ts.map +1 -1
  4. package/dist/src/agent.js +531 -54
  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 +1 -2
  8. package/dist/src/api/server.js.map +1 -1
  9. package/dist/src/auto-continue.d.ts +33 -0
  10. package/dist/src/auto-continue.d.ts.map +1 -0
  11. package/dist/src/auto-continue.js +35 -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/framework.d.ts +759 -129
  18. package/dist/src/framework.d.ts.map +1 -1
  19. package/dist/src/framework.js +3482 -928
  20. package/dist/src/framework.js.map +1 -1
  21. package/dist/src/gate/event-gate.d.ts +309 -46
  22. package/dist/src/gate/event-gate.d.ts.map +1 -1
  23. package/dist/src/gate/event-gate.js +2117 -395
  24. package/dist/src/gate/event-gate.js.map +1 -1
  25. package/dist/src/gate/index.d.ts +2 -2
  26. package/dist/src/gate/index.d.ts.map +1 -1
  27. package/dist/src/gate/index.js +1 -1
  28. package/dist/src/gate/index.js.map +1 -1
  29. package/dist/src/gate/recipe-reconcile.d.ts +103 -0
  30. package/dist/src/gate/recipe-reconcile.d.ts.map +1 -0
  31. package/dist/src/gate/recipe-reconcile.js +325 -0
  32. package/dist/src/gate/recipe-reconcile.js.map +1 -0
  33. package/dist/src/gate/types.d.ts +68 -8
  34. package/dist/src/gate/types.d.ts.map +1 -1
  35. package/dist/src/index.d.ts +6 -4
  36. package/dist/src/index.d.ts.map +1 -1
  37. package/dist/src/index.js +5 -2
  38. package/dist/src/index.js.map +1 -1
  39. package/dist/src/mcpl/channel-registry.d.ts +433 -113
  40. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  41. package/dist/src/mcpl/channel-registry.js +1152 -434
  42. package/dist/src/mcpl/channel-registry.js.map +1 -1
  43. package/dist/src/mcpl/conversation-router.d.ts +16 -8
  44. package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
  45. package/dist/src/mcpl/conversation-router.js +29 -15
  46. package/dist/src/mcpl/conversation-router.js.map +1 -1
  47. package/dist/src/mcpl/convert-block.d.ts.map +1 -1
  48. package/dist/src/mcpl/convert-block.js +14 -2
  49. package/dist/src/mcpl/convert-block.js.map +1 -1
  50. package/dist/src/mcpl/hook-orchestrator.d.ts +7 -1
  51. package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
  52. package/dist/src/mcpl/hook-orchestrator.js +32 -7
  53. package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
  54. package/dist/src/mcpl/index.d.ts +5 -1
  55. package/dist/src/mcpl/index.d.ts.map +1 -1
  56. package/dist/src/mcpl/index.js +4 -0
  57. package/dist/src/mcpl/index.js.map +1 -1
  58. package/dist/src/mcpl/inference-router.d.ts +14 -2
  59. package/dist/src/mcpl/inference-router.d.ts.map +1 -1
  60. package/dist/src/mcpl/inference-router.js +73 -28
  61. package/dist/src/mcpl/inference-router.js.map +1 -1
  62. package/dist/src/mcpl/prose-grammar.d.ts +4 -0
  63. package/dist/src/mcpl/prose-grammar.d.ts.map +1 -1
  64. package/dist/src/mcpl/prose-grammar.js +6 -0
  65. package/dist/src/mcpl/prose-grammar.js.map +1 -1
  66. package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
  67. package/dist/src/mcpl/protocol-family.js +3 -0
  68. package/dist/src/mcpl/protocol-family.js.map +1 -1
  69. package/dist/src/mcpl/push-coalescer.d.ts +20 -2
  70. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  71. package/dist/src/mcpl/push-coalescer.js +33 -11
  72. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  73. package/dist/src/mcpl/reference-fetcher.d.ts +63 -42
  74. package/dist/src/mcpl/reference-fetcher.d.ts.map +1 -1
  75. package/dist/src/mcpl/reference-fetcher.js +177 -145
  76. package/dist/src/mcpl/reference-fetcher.js.map +1 -1
  77. package/dist/src/mcpl/references.d.ts +380 -46
  78. package/dist/src/mcpl/references.d.ts.map +1 -1
  79. package/dist/src/mcpl/references.js +736 -77
  80. package/dist/src/mcpl/references.js.map +1 -1
  81. package/dist/src/mcpl/server-connection.d.ts +82 -3
  82. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  83. package/dist/src/mcpl/server-connection.js +132 -7
  84. package/dist/src/mcpl/server-connection.js.map +1 -1
  85. package/dist/src/mcpl/tool-lifecycle.d.ts +11 -0
  86. package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -1
  87. package/dist/src/mcpl/tool-lifecycle.js +21 -0
  88. package/dist/src/mcpl/tool-lifecycle.js.map +1 -1
  89. package/dist/src/mcpl/tool-presence.d.ts +259 -0
  90. package/dist/src/mcpl/tool-presence.d.ts.map +1 -0
  91. package/dist/src/mcpl/tool-presence.js +628 -0
  92. package/dist/src/mcpl/tool-presence.js.map +1 -0
  93. package/dist/src/mcpl/tool-result-normalize.d.ts +9 -3
  94. package/dist/src/mcpl/tool-result-normalize.d.ts.map +1 -1
  95. package/dist/src/mcpl/tool-result-normalize.js +14 -6
  96. package/dist/src/mcpl/tool-result-normalize.js.map +1 -1
  97. package/dist/src/mcpl/tool-signature.d.ts +39 -0
  98. package/dist/src/mcpl/tool-signature.d.ts.map +1 -0
  99. package/dist/src/mcpl/tool-signature.js +292 -0
  100. package/dist/src/mcpl/tool-signature.js.map +1 -0
  101. package/dist/src/mcpl/toolset-host.d.ts +200 -0
  102. package/dist/src/mcpl/toolset-host.d.ts.map +1 -0
  103. package/dist/src/mcpl/toolset-host.js +621 -0
  104. package/dist/src/mcpl/toolset-host.js.map +1 -0
  105. package/dist/src/mcpl/toolsets-module.d.ts +80 -0
  106. package/dist/src/mcpl/toolsets-module.d.ts.map +1 -0
  107. package/dist/src/mcpl/toolsets-module.js +431 -0
  108. package/dist/src/mcpl/toolsets-module.js.map +1 -0
  109. package/dist/src/mcpl/transport.d.ts +2 -2
  110. package/dist/src/mcpl/transport.d.ts.map +1 -1
  111. package/dist/src/mcpl/transport.js +3 -2
  112. package/dist/src/mcpl/transport.js.map +1 -1
  113. package/dist/src/mcpl/types.d.ts +21 -1
  114. package/dist/src/mcpl/types.d.ts.map +1 -1
  115. package/dist/src/mcpl/types.js.map +1 -1
  116. package/dist/src/mcpl/visible-content.d.ts +7 -9
  117. package/dist/src/mcpl/visible-content.d.ts.map +1 -1
  118. package/dist/src/mcpl/visible-content.js +21 -9
  119. package/dist/src/mcpl/visible-content.js.map +1 -1
  120. package/dist/src/module-registry.d.ts +23 -8
  121. package/dist/src/module-registry.d.ts.map +1 -1
  122. package/dist/src/module-registry.js +68 -15
  123. package/dist/src/module-registry.js.map +1 -1
  124. package/dist/src/modules/discord/index.js +1 -1
  125. package/dist/src/modules/discord/index.js.map +1 -1
  126. package/dist/src/modules/history/index.d.ts +2 -1
  127. package/dist/src/modules/history/index.d.ts.map +1 -1
  128. package/dist/src/modules/history/index.js +51 -17
  129. package/dist/src/modules/history/index.js.map +1 -1
  130. package/dist/src/modules/history/semantic.d.ts +108 -6
  131. package/dist/src/modules/history/semantic.d.ts.map +1 -1
  132. package/dist/src/modules/history/semantic.js +273 -57
  133. package/dist/src/modules/history/semantic.js.map +1 -1
  134. package/dist/src/modules/workspace/direct-write.d.ts +181 -0
  135. package/dist/src/modules/workspace/direct-write.d.ts.map +1 -0
  136. package/dist/src/modules/workspace/direct-write.js +384 -0
  137. package/dist/src/modules/workspace/direct-write.js.map +1 -0
  138. package/dist/src/modules/workspace/edit-text.d.ts +26 -12
  139. package/dist/src/modules/workspace/edit-text.d.ts.map +1 -1
  140. package/dist/src/modules/workspace/edit-text.js +58 -28
  141. package/dist/src/modules/workspace/edit-text.js.map +1 -1
  142. package/dist/src/modules/workspace/effects.d.ts +10 -0
  143. package/dist/src/modules/workspace/effects.d.ts.map +1 -1
  144. package/dist/src/modules/workspace/effects.js +1 -1
  145. package/dist/src/modules/workspace/effects.js.map +1 -1
  146. package/dist/src/modules/workspace/index.d.ts +246 -27
  147. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  148. package/dist/src/modules/workspace/index.js +1216 -236
  149. package/dist/src/modules/workspace/index.js.map +1 -1
  150. package/dist/src/modules/workspace/read-page.d.ts +41 -0
  151. package/dist/src/modules/workspace/read-page.d.ts.map +1 -0
  152. package/dist/src/modules/workspace/read-page.js +213 -0
  153. package/dist/src/modules/workspace/read-page.js.map +1 -0
  154. package/dist/src/modules/workspace/result-text.d.ts +67 -0
  155. package/dist/src/modules/workspace/result-text.d.ts.map +1 -0
  156. package/dist/src/modules/workspace/result-text.js +94 -0
  157. package/dist/src/modules/workspace/result-text.js.map +1 -0
  158. package/dist/src/modules/workspace/text.d.ts +29 -12
  159. package/dist/src/modules/workspace/text.d.ts.map +1 -1
  160. package/dist/src/modules/workspace/text.js +35 -33
  161. package/dist/src/modules/workspace/text.js.map +1 -1
  162. package/dist/src/modules/workspace/types.d.ts +41 -17
  163. package/dist/src/modules/workspace/types.d.ts.map +1 -1
  164. package/dist/src/modules/workspace/types.js.map +1 -1
  165. package/dist/src/sent-rows.d.ts +59 -0
  166. package/dist/src/sent-rows.d.ts.map +1 -0
  167. package/dist/src/sent-rows.js +145 -0
  168. package/dist/src/sent-rows.js.map +1 -0
  169. package/dist/src/silent-heartbeat.d.ts +17 -10
  170. package/dist/src/silent-heartbeat.d.ts.map +1 -1
  171. package/dist/src/silent-heartbeat.js.map +1 -1
  172. package/dist/src/stable-hash.d.ts +3 -0
  173. package/dist/src/stable-hash.d.ts.map +1 -0
  174. package/dist/src/stable-hash.js +15 -0
  175. package/dist/src/stable-hash.js.map +1 -0
  176. package/dist/src/stored-injections.d.ts +99 -0
  177. package/dist/src/stored-injections.d.ts.map +1 -0
  178. package/dist/src/stored-injections.js +106 -0
  179. package/dist/src/stored-injections.js.map +1 -0
  180. package/dist/src/text-as-stored.d.ts +4 -3
  181. package/dist/src/text-as-stored.d.ts.map +1 -1
  182. package/dist/src/text-as-stored.js +4 -3
  183. package/dist/src/text-as-stored.js.map +1 -1
  184. package/dist/src/thinking-drops.d.ts +81 -0
  185. package/dist/src/thinking-drops.d.ts.map +1 -0
  186. package/dist/src/thinking-drops.js +103 -0
  187. package/dist/src/thinking-drops.js.map +1 -0
  188. package/dist/src/tool-image-ledger.d.ts +9 -8
  189. package/dist/src/tool-image-ledger.d.ts.map +1 -1
  190. package/dist/src/tool-image-ledger.js +9 -8
  191. package/dist/src/tool-image-ledger.js.map +1 -1
  192. package/dist/src/tool-presentation.d.ts.map +1 -1
  193. package/dist/src/tool-presentation.js +3 -1
  194. package/dist/src/tool-presentation.js.map +1 -1
  195. package/dist/src/tool-result-guard.d.ts +4 -2
  196. package/dist/src/tool-result-guard.d.ts.map +1 -1
  197. package/dist/src/tool-result-guard.js +21 -6
  198. package/dist/src/tool-result-guard.js.map +1 -1
  199. package/dist/src/tool-result-history.d.ts +176 -24
  200. package/dist/src/tool-result-history.d.ts.map +1 -1
  201. package/dist/src/tool-result-history.js +411 -91
  202. package/dist/src/tool-result-history.js.map +1 -1
  203. package/dist/src/tune-out/coordinator.d.ts +17 -9
  204. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  205. package/dist/src/tune-out/coordinator.js +84 -37
  206. package/dist/src/tune-out/coordinator.js.map +1 -1
  207. package/dist/src/types/agent.d.ts +186 -7
  208. package/dist/src/types/agent.d.ts.map +1 -1
  209. package/dist/src/types/events.d.ts +15 -1
  210. package/dist/src/types/events.d.ts.map +1 -1
  211. package/dist/src/types/framework.d.ts +24 -3
  212. package/dist/src/types/framework.d.ts.map +1 -1
  213. package/dist/src/types/module.d.ts +90 -7
  214. package/dist/src/types/module.d.ts.map +1 -1
  215. package/dist/src/types/trace.d.ts +57 -2
  216. package/dist/src/types/trace.d.ts.map +1 -1
  217. package/package.json +4 -3
  218. package/src/agent.ts +593 -60
  219. package/src/api/server.ts +1 -2
  220. package/src/auto-continue.ts +42 -0
  221. package/src/code-execution/isolate/scripts.ts +11 -3
  222. package/src/framework.ts +3601 -967
  223. package/src/gate/event-gate.ts +2315 -389
  224. package/src/gate/index.ts +2 -1
  225. package/src/gate/recipe-reconcile.ts +355 -0
  226. package/src/gate/types.ts +70 -8
  227. package/src/index.ts +7 -4
  228. package/src/mcpl/channel-registry.ts +1220 -467
  229. package/src/mcpl/conversation-router.ts +34 -16
  230. package/src/mcpl/convert-block.ts +14 -1
  231. package/src/mcpl/hook-orchestrator.ts +33 -6
  232. package/src/mcpl/index.ts +6 -1
  233. package/src/mcpl/inference-router.ts +79 -34
  234. package/src/mcpl/prose-grammar.ts +7 -0
  235. package/src/mcpl/protocol-family.ts +2 -0
  236. package/src/mcpl/push-coalescer.ts +51 -13
  237. package/src/mcpl/reference-fetcher.ts +201 -162
  238. package/src/mcpl/references.ts +851 -77
  239. package/src/mcpl/server-connection.ts +145 -7
  240. package/src/mcpl/tool-lifecycle.ts +21 -0
  241. package/src/mcpl/tool-presence.ts +650 -0
  242. package/src/mcpl/tool-result-normalize.ts +18 -6
  243. package/src/mcpl/tool-signature.ts +285 -0
  244. package/src/mcpl/toolset-host.ts +637 -0
  245. package/src/mcpl/toolsets-module.ts +451 -0
  246. package/src/mcpl/transport.ts +3 -2
  247. package/src/mcpl/types.ts +22 -1
  248. package/src/mcpl/visible-content.ts +22 -9
  249. package/src/module-registry.ts +77 -24
  250. package/src/modules/discord/index.ts +1 -1
  251. package/src/modules/history/index.ts +48 -18
  252. package/src/modules/history/semantic.ts +308 -54
  253. package/src/modules/workspace/direct-write.ts +425 -0
  254. package/src/modules/workspace/edit-text.ts +82 -35
  255. package/src/modules/workspace/effects.ts +1 -1
  256. package/src/modules/workspace/index.ts +1274 -241
  257. package/src/modules/workspace/read-page.ts +222 -0
  258. package/src/modules/workspace/result-text.ts +119 -0
  259. package/src/modules/workspace/text.ts +58 -32
  260. package/src/modules/workspace/types.ts +41 -17
  261. package/src/sent-rows.ts +162 -0
  262. package/src/silent-heartbeat.ts +17 -10
  263. package/src/stable-hash.ts +14 -0
  264. package/src/stored-injections.ts +131 -0
  265. package/src/text-as-stored.ts +4 -3
  266. package/src/thinking-drops.ts +141 -0
  267. package/src/tool-image-ledger.ts +9 -8
  268. package/src/tool-presentation.ts +3 -1
  269. package/src/tool-result-guard.ts +19 -6
  270. package/src/tool-result-history.ts +471 -90
  271. package/src/tune-out/coordinator.ts +80 -37
  272. package/src/types/agent.ts +189 -7
  273. package/src/types/events.ts +15 -1
  274. package/src/types/framework.ts +21 -3
  275. package/src/types/module.ts +86 -7
  276. package/src/types/trace.ts +58 -2
@@ -25,14 +25,21 @@
25
25
  * Autofetch policy (host default, not protocol): eager only below
26
26
  * DEFAULT_EAGER_FETCH_MAX_BYTES from the connection origin — anything under
27
27
  * that threshold the server could legitimately have inlined, so eager
28
- * materialization is never worse than the status quo. Everything larger is
29
- * fetched on demand (the fetch_reference tool, or the code-execution result
30
- * hook, where a script receiving a result is the strongest available signal
31
- * that the bytes are wanted). Per-server budgets cap cumulative appetite.
28
+ * materialization is never worse than the status quo for a reference whose
29
+ * claim is true. A fetch the eager default starts reads no further than the
30
+ * first chunk past its server's eager limit (autofetch.maxBytes, this
31
+ * default when that's unset), whatever size the server claims; one it joins
32
+ * is its starter's, whose success answers it too. The eager default doesn't
33
+ * choose a reference again once its fetch of it failed. Everything larger
34
+ * is fetched on demand (the fetch_reference tool, or the code-execution
35
+ * result hook, where a script receiving a result is the strongest available
36
+ * signal that the bytes are wanted). Per-server budgets cap cumulative
37
+ * appetite.
32
38
  */
33
39
  import { createHash } from 'node:crypto';
34
40
  import { boundedForLog, describeCause } from './errors.js';
35
- import { EXPIRY_REASON, noAddressReason, referenceExpiry, REFERENCE_LIMITS, sanitizeLabel, UNBOUND_REASON } from './references.js';
41
+ import { dialCheck, dialServer, FRESH_REFERENCE, NOTHING_TO_DO, REFERENCE_LIMITS, sanitizeLabel, shownServerId } from './references.js';
42
+ export { normalizedOrigin } from './references.js';
36
43
  /** Per-fetch hard ceiling on actual bytes. A call can lower it for itself
37
44
  * (fetch_reference's max_bytes, which it clamps to this); nothing raises it. */
38
45
  export const DEFAULT_FETCH_MAX_BYTES = 256 * 1024 * 1024;
@@ -42,16 +49,17 @@ export const DEFAULT_EAGER_FETCH_MAX_BYTES = 256 * 1024;
42
49
  * through a server reads counts against that server's, whether or not it's
43
50
  * kept. */
44
51
  export const DEFAULT_MAX_TOTAL_BYTES = 1024 * 1024 * 1024;
52
+ /** How long a caller waits for a fetch, its save included, unless it asks
53
+ * for another time. */
45
54
  const FETCH_TIMEOUT_MS = 60_000;
55
+ /** How long the eager default waits for one reference. */
46
56
  const EAGER_FETCH_TIMEOUT_MS = 10_000;
47
57
  // What calling again can do, as each failure's remedy says it. The fetcher
48
58
  // doesn't know where a reference came from (a tool result, a push, a channel
49
59
  // message), so none names a tool, and fetch_reference's max_bytes is named
50
- // only where a larger one can fetch it.
51
- const NOTHING_TO_DO = "Calling again won't change that.";
52
- /** The registry keys a record by its uri, so a fresh reference to the same
53
- * uri arrives as this very id and refreshes its record. */
54
- const FRESH_REFERENCE = "Once a fresh reference to it arrives, fetching may work; until then, fetching it again won't.";
60
+ // only where a larger one can fetch it. The refusals before dialing that a
61
+ // stub shares come from references.ts (dialServer, dialCheck) with their
62
+ // remedies (NOTHING_TO_DO, FRESH_REFERENCE, SERVER_BACK).
55
63
  const TRY_LATER = 'Trying again later may work.';
56
64
  /** A request that failed before an answer: a refused or reset connection
57
65
  * can clear, and a cause that repeats on every try (a port fetch refuses, a
@@ -68,10 +76,28 @@ const BUDGET = "The budget doesn't renew on its own, so calling again won't chan
68
76
  /** The host's own ceiling: fetch_reference clamps max_bytes to it, and no
69
77
  * config sets another. */
70
78
  const HOST_CEILING = "No max_bytes or setting lifts that limit, so calling again won't change it.";
71
- /** The resolver reads the host's server configs as they are at each fetch. */
72
- const SERVER_BACK = "Calling again won't change that unless whoever runs this host adds that server back.";
73
79
  const refused = (error, remedy) => ({ refusal: { error, remedy } });
74
80
  const fail = (error, remedy) => ({ ok: false, error, remedy });
81
+ /** A timeout, naming the timeout that ran out: its starter's, when the
82
+ * fetch is aborted at its deadline, or a caller's own, when its wait ends
83
+ * while the fetch or its save goes on. */
84
+ function tookLonger(timeoutMs) {
85
+ const seconds = timeoutMs / 1000;
86
+ return fail(`it took longer than ${seconds} second${seconds === 1 ? '' : 's'}`, TRY_LATER);
87
+ }
88
+ /** The two endings that name a call's own byte ceiling, as a function of it,
89
+ * so a caller that joined a fetch is told its own ceiling, not its
90
+ * starter's. */
91
+ const claimOver = (claimed) => (ceiling) => `it claims ${claimed} bytes, over the ${ceiling} bytes this call allows`;
92
+ const readPast = (received) => (ceiling) => `the download had reached ${received} bytes, past the ${ceiling} bytes this call allows, so it was stopped and nothing was kept`;
93
+ /** What the promise settles to, or undefined if the deadline, on the
94
+ * monotonic clock, comes first. */
95
+ function settledBy(promise, deadline) {
96
+ return new Promise((resolve, reject) => {
97
+ const timer = setTimeout(() => resolve(undefined), Math.max(0, deadline - performance.now()));
98
+ promise.finally(() => clearTimeout(timer)).then(resolve, reject);
99
+ });
100
+ }
75
101
  /** What calling again can do about a server's HTTP status. A later try can
76
102
  * work after a timeout, a conflict or lock the server's state can clear, a
77
103
  * request it calls too early, a rate limit or a server's passing trouble,
@@ -156,27 +182,6 @@ const EXT_BY_MIME = new Map(Object.entries({
156
182
  'video/mp4': 'mp4', 'application/json': 'json', 'text/plain': 'txt',
157
183
  'application/pdf': 'pdf', 'application/zip': 'zip',
158
184
  }));
159
- /** A server's address as it's configured, its scheme and host, for a
160
- * clause: never its userinfo, path or query. URL's own origin is 'null' for
161
- * a scheme that isn't special, which normalizedOrigin accepts. The caller
162
- * has already parsed it. */
163
- function configuredOrigin(url) {
164
- const u = new URL(url);
165
- return `${u.protocol}//${u.host}`;
166
- }
167
- /** ws→http / wss→https with default ports elided, for origin comparison. */
168
- export function normalizedOrigin(url) {
169
- try {
170
- const u = new URL(url);
171
- const scheme = u.protocol === 'ws:' ? 'http:' : u.protocol === 'wss:' ? 'https:' : u.protocol;
172
- const defaultPort = scheme === 'https:' ? '443' : '80';
173
- const port = u.port === '' || u.port === defaultPort ? '' : `:${u.port}`;
174
- return `${scheme}//${u.hostname.toLowerCase()}${port}`;
175
- }
176
- catch {
177
- return null;
178
- }
179
- }
180
185
  export class ReferenceFetcher {
181
186
  resolveServer;
182
187
  saveFile;
@@ -186,73 +191,97 @@ export class ReferenceFetcher {
186
191
  * others have taken. */
187
192
  totals = new Map();
188
193
  inFlight = new Map();
189
- constructor(resolveServer,
194
+ constructor(
195
+ /** A server's address, credential and limits, by id, from the
196
+ * framework's own config: the origin a fetch is checked against and the
197
+ * token it carries come from one answer. */
198
+ resolveServer,
190
199
  /** Persist the payload; returns a mount-prefixed path or null when no
191
200
  * writable mount without an include exists. File name is host-generated (§7.3). */
192
201
  saveFile) {
193
202
  this.resolveServer = resolveServer;
194
203
  this.saveFile = saveFile;
195
204
  }
196
- /** Would the eager (autofetch) default fetch this record? Not one the fetch
197
- * would refuse before dialing, asked as the eager fetch asks it, with the
198
- * default ceiling, so such a record takes no eager slot; and only one whose
199
- * claimed size is within the eager limit of the server it dials. For one
200
- * whose fetch is already under way, which the eager fetch would join as
201
- * fetch() does, only the server and its eager limit enter: the expiry,
202
- * the budget and the ceiling were checked when that fetch began. */
205
+ /** The server a check (dialServer or dialCheck) chose, with its credential
206
+ * and limits from the same resolver answer whose address the check read:
207
+ * each server's resolution is read once here, so the origin the check
208
+ * passes and the token the fetch sends come from one answer, whatever a
209
+ * resolver answers the next time it's asked. */
210
+ chosen(check) {
211
+ const resolutions = new Map();
212
+ const addressOf = (serverId) => {
213
+ if (!resolutions.has(serverId))
214
+ resolutions.set(serverId, this.resolveServer(serverId));
215
+ const resolution = resolutions.get(serverId);
216
+ return resolution === undefined || resolution === 'no-address' ? resolution : { url: resolution.url };
217
+ };
218
+ const server = check(addressOf);
219
+ if ('refusal' in server)
220
+ return server;
221
+ // The check chose only a server whose address it read as a url, so that
222
+ // server's resolution is a binding.
223
+ return { serverId: server.serverId, binding: resolutions.get(server.serverId) };
224
+ }
225
+ /** The server a fetch of a record dials (§6.2), with its credential and
226
+ * limits, or why none can be. */
227
+ serverFor(record) {
228
+ return this.chosen((addressOf) => dialServer(record, addressOf));
229
+ }
230
+ /** Would the eager (autofetch) default fetch this record? Not one whose
231
+ * eager fetch already failed; not one the fetch would refuse before
232
+ * dialing, asked with the default ceiling, so such a record takes no eager
233
+ * slot; and only one whose claimed size is within the eager limit of the
234
+ * server it dials. For one whose fetch is already under way, which the
235
+ * eager fetch would join as fetch() does, only the server and its eager
236
+ * limit enter: the expiry, the budget and the ceiling were checked when
237
+ * that fetch began. */
203
238
  isEagerEligible(record) {
204
- if (record.fetchedPath)
239
+ if (record.fetchedPath || record.eagerFailed)
205
240
  return false;
206
241
  const check = this.inFlight.has(record.refId) ? this.serverFor(record) : this.beforeDial(record);
207
242
  if ('refusal' in check)
208
243
  return false;
209
- const cap = check.binding.autofetch?.maxBytes ?? DEFAULT_EAGER_FETCH_MAX_BYTES;
210
- return record.testimony.sizeBytes !== undefined && record.testimony.sizeBytes <= cap;
244
+ return record.testimony.sizeBytes !== undefined && record.testimony.sizeBytes <= this.eagerLimit(check.binding);
211
245
  }
212
- /** The server to dial for a record (§6.2): the first, in the order they
213
- * delivered it, whose address is on the uri's origin. When none is, the
214
- * first server's refusal (unknown to this host, with no address to dial,
215
- * or the origin check's), and for a record no server delivered, that it's
216
- * unbound. */
217
- serverFor(record) {
218
- let refusal;
219
- for (const serverId of record.serverIds) {
220
- const binding = this.resolveServer(serverId);
221
- if (!binding) {
222
- refusal ??= refused(`this host no longer has the "${serverId}" server it came from`, SERVER_BACK);
223
- continue;
224
- }
225
- if (binding === 'no-address') {
226
- refusal ??= refused(noAddressReason(serverId), NOTHING_TO_DO);
227
- continue;
228
- }
229
- const offOrigin = this.originCheck(record, binding, serverId);
230
- if (offOrigin === null)
231
- return { serverId, binding };
232
- refusal ??= offOrigin;
233
- }
234
- // A later delivery of the same uri by a server binds this record.
235
- return refusal ?? refused(`it's ${UNBOUND_REASON}`, FRESH_REFERENCE);
246
+ /** The eager default's fetch. One it starts reads no further than the first
247
+ * chunk past the server's eager limit, whatever size the reference claims;
248
+ * one it joins reads under its starter's ceiling, and that fetch's success
249
+ * answers it too (fetch()). It waits no longer than
250
+ * EAGER_FETCH_TIMEOUT_MS. One that fails is remembered on the record, so
251
+ * the eager default doesn't choose that reference again; fetch_reference
252
+ * still fetches it. */
253
+ async fetchEager(record) {
254
+ const server = this.serverFor(record);
255
+ const maxBytes = this.eagerLimit('refusal' in server ? undefined : server.binding);
256
+ const outcome = await this.fetch(record, { maxBytes, timeoutMs: EAGER_FETCH_TIMEOUT_MS });
257
+ if (!outcome.ok)
258
+ record.eagerFailed = true;
259
+ return outcome;
260
+ }
261
+ /** This server's eager limit: its autofetch.maxBytes,
262
+ * DEFAULT_EAGER_FETCH_MAX_BYTES when that's unset. Eligibility holds a
263
+ * claim to it, and a fetch the eager default starts stops reading at the
264
+ * first chunk past it. The host's own ceiling, which every fetch checks
265
+ * first, still holds past a larger one. */
266
+ eagerLimit(binding) {
267
+ return binding?.autofetch?.maxBytes ?? DEFAULT_EAGER_FETCH_MAX_BYTES;
236
268
  }
237
269
  /** Every check the fetch makes before it dials, in its order: the server
238
270
  * (none, unknown, no address, an address of its own or the reference's
239
271
  * that doesn't parse, a reference address carrying a user name or
240
- * password, a scheme other than http: or https:, off the uri's origin),
241
- * the expiry, a claimed size over the host's own ceiling, the server's
242
- * spent budget, a claimed size over a call's ceiling. For a record with no
243
- * saved copy and no fetch under way, the fetch, `refusal()` and the eager
244
- * check all ask this, so what save_recent_image says is the reason the
245
- * fetch would refuse with, and no eager slot goes to a fetch that would be
246
- * refused. */
272
+ * password, a scheme other than http: or https:, off the uri's origin)
273
+ * and the expiry, which dialCheck makes as a reference's stub does; then
274
+ * a claimed size over the host's own ceiling, the server's spent budget,
275
+ * a claimed size over a call's ceiling. For a record with no saved copy
276
+ * and no fetch under way, the fetch, `refusal()` and the eager check all
277
+ * ask this, so what save_recent_image says is the reason the fetch would
278
+ * refuse with, and no eager slot goes to a fetch that would be refused. */
247
279
  beforeDial(record, opts) {
248
- const server = this.serverFor(record);
280
+ const server = this.chosen((addressOf) => dialCheck(record, addressOf));
249
281
  if ('refusal' in server)
250
282
  return server;
251
283
  const { serverId, binding } = server;
252
284
  const t = record.testimony;
253
- const expiry = referenceExpiry(t);
254
- if (expiry)
255
- return refused(`the reference is ${EXPIRY_REASON[expiry]}`, FRESH_REFERENCE);
256
285
  const ceiling = opts?.maxBytes ?? DEFAULT_FETCH_MAX_BYTES;
257
286
  // A claim past the host's own ceiling is refused first: nothing lifts
258
287
  // it, not even a budget whoever runs the host raises.
@@ -265,19 +294,26 @@ export class ReferenceFetcher {
265
294
  const budget = binding.autofetch?.maxTotalBytes ?? DEFAULT_MAX_TOTAL_BYTES;
266
295
  const used = this.totals.get(serverId) ?? 0;
267
296
  if (used >= budget) {
268
- return refused(`this host's fetch budget for the "${serverId}" server is used up (${used} of ${budget} bytes)`, BUDGET);
297
+ return refused(`this host's fetch budget for the "${shownServerId(serverId)}" server is used up (${used} of ${budget} bytes)`, BUDGET);
269
298
  }
270
299
  // Vector 4: a claim already over the ceiling refuses without dialing. One
271
300
  // that's also over what's left of the budget is told about the budget,
272
301
  // which no max_bytes lifts. A claim over what's left but within the
273
302
  // ceiling still dials, and the budget stops it at its first chunk past.
303
+ // Both refusals here are reached only through the call's own ceiling, so
304
+ // each is that ceiling's ending: a caller whose ceiling holds the claim
305
+ // would dial, and one that joined this call's fetch does (fetch()).
274
306
  if (t.sizeBytes !== undefined && t.sizeBytes > ceiling) {
275
307
  if (t.sizeBytes > budget - used) {
276
- return refused(`it claims ${t.sizeBytes} bytes, more than the ${budget - used} bytes left of this host's fetch budget for the "${serverId}" server`, BUDGET);
308
+ return {
309
+ ...refused(`it claims ${t.sizeBytes} bytes, more than the ${budget - used} bytes left of this host's fetch budget for the "${shownServerId(serverId)}" server`, BUDGET),
310
+ byCeiling: true,
311
+ };
277
312
  }
278
313
  // Within what's left of the budget and the host's ceiling, so a
279
314
  // ceiling of the call's own is what a larger max_bytes lifts.
280
- return refused(`it claims ${t.sizeBytes} bytes, over the ${ceiling} bytes this call allows`, `Pass max_bytes of at least ${t.sizeBytes} to fetch it.`);
315
+ const atCeiling = claimOver(t.sizeBytes);
316
+ return { ...refused(atCeiling(ceiling), `Pass max_bytes of at least ${t.sizeBytes} to fetch it.`), byCeiling: true, atCeiling };
281
317
  }
282
318
  return { serverId, binding, ceiling, budget };
283
319
  }
@@ -292,66 +328,63 @@ export class ReferenceFetcher {
292
328
  const check = this.beforeDial(record);
293
329
  return 'refusal' in check ? check.refusal : null;
294
330
  }
295
- /** §6.1/§7.1 policy check; returns a refusal or null. */
296
- originCheck(record, binding, serverId) {
297
- const refOrigin = normalizedOrigin(record.testimony.uri);
298
- if (!refOrigin)
299
- return refused("its address doesn't parse as a URL", NOTHING_TO_DO);
300
- // A server's address that doesn't parse leaves nothing to dial. The
301
- // framework's resolver gives only an address its transport dials, so this
302
- // guards other resolvers.
303
- const dialedOrigin = normalizedOrigin(binding.url);
304
- if (!dialedOrigin) {
305
- return refused(`the "${serverId}" server's address doesn't parse as a URL, so there's nowhere to fetch it from`, "Calling again won't change that unless whoever runs this host corrects the server's address.");
306
- }
307
- const refUrl = new URL(record.testimony.uri);
308
- // A user name or password in the uri is a credential embedded in it,
309
- // which RFC-005 §6.1 forbids a server to mint and lets a host refuse
310
- // (vector 6). This host neither sends nor repeats it: fetch refuses such
311
- // a url with a message that holds it whole.
312
- if (refUrl.username !== '' || refUrl.password !== '') {
313
- return refused("its address carries a user name or password, which this host doesn't send", NOTHING_TO_DO);
314
- }
315
- // The uri's own scheme, not its origin's: an origin reads ws: as http:
316
- // and wss: as https:, and fetch refuses a ws: or wss: uri ('unknown
317
- // scheme') before connecting, which would read as a failed request a
318
- // later try can mend.
319
- const scheme = refUrl.protocol;
320
- if (scheme !== 'https:' && scheme !== 'http:') {
321
- return refused(`its address uses ${scheme}, and this host fetches only http: and https: addresses`, NOTHING_TO_DO);
322
- }
323
- // Origins compare with their schemes, so this also refuses an http:
324
- // reference from a server dialed over TLS (wss://).
325
- if (refOrigin !== dialedOrigin) {
326
- return refused(`it points to ${refOrigin}, not to the "${serverId}" server's own address (${configuredOrigin(binding.url)}), ` +
327
- 'and this host fetches only from the server itself', NOTHING_TO_DO);
331
+ /** Fetch a reference to workspace storage. Idempotent per record. Callers
332
+ * of one record share the fetch in flight, each under its own bounds: it
333
+ * waits no longer than its own timeout, counted from its call and covering
334
+ * the save. When the fetch it joined stopped on its starter's byte ceiling
335
+ * and its own is wider, it fetches again under its own. When that fetch
336
+ * stopped at its starter's deadline, it fetches again only if it has more
337
+ * time left than that starter's whole timeout, since a fresh fetch with no
338
+ * more time than one that ran out unanswered would likely be stopped too;
339
+ * otherwise it takes that ending. (A refetch's flight had less than its
340
+ * starter's timeout, so this errs toward not dialing.) A fetch that
341
+ * succeeds answers every caller waiting on it, whatever its own ceiling. A
342
+ * save still running when a caller stops waiting goes on, and the record
343
+ * is marked fetched when it lands. */
344
+ async fetch(record, opts) {
345
+ const ceiling = opts?.maxBytes ?? DEFAULT_FETCH_MAX_BYTES;
346
+ const timeoutMs = opts?.timeoutMs ?? FETCH_TIMEOUT_MS;
347
+ const deadline = performance.now() + timeoutMs;
348
+ for (;;) {
349
+ if (record.fetchedPath) {
350
+ return { ok: true, path: record.fetchedPath, bytes: record.verifiedBytes,
351
+ mimeType: record.verifiedMimeType, digestVerified: record.digestVerified };
352
+ }
353
+ const flight = this.inFlight.get(record.refId) ?? this.start(record, ceiling, deadline, timeoutMs);
354
+ const ended = await settledBy(flight.ended, deadline);
355
+ if (ended === undefined)
356
+ return tookLonger(timeoutMs);
357
+ const { stoppedBy, atCeiling, ...outcome } = ended;
358
+ if (stoppedBy === 'ceiling') {
359
+ if (ceiling > flight.ceiling)
360
+ continue;
361
+ return (atCeiling ? { ...outcome, error: atCeiling(ceiling) } : outcome);
362
+ }
363
+ if (stoppedBy === 'deadline' && deadline - performance.now() > flight.timeoutMs)
364
+ continue;
365
+ return outcome;
328
366
  }
329
- return null;
330
367
  }
331
- /** Fetch a reference to workspace storage. Idempotent per record; concurrent
332
- * callers share one in-flight fetch. */
333
- fetch(record, opts) {
334
- if (record.fetchedPath) {
335
- return Promise.resolve({ ok: true, path: record.fetchedPath, bytes: record.verifiedBytes,
336
- mimeType: record.verifiedMimeType, digestVerified: record.digestVerified });
337
- }
338
- const existing = this.inFlight.get(record.refId);
339
- if (existing)
340
- return existing;
341
- const p = this.doFetch(record, opts).finally(() => this.inFlight.delete(record.refId));
342
- this.inFlight.set(record.refId, p);
343
- return p;
368
+ start(record, ceiling, deadline, timeoutMs) {
369
+ const flight = {
370
+ ceiling,
371
+ timeoutMs,
372
+ ended: this.doFetch(record, ceiling, deadline, timeoutMs).finally(() => this.inFlight.delete(record.refId)),
373
+ };
374
+ this.inFlight.set(record.refId, flight);
375
+ return flight;
344
376
  }
345
- async doFetch(record, opts) {
377
+ async doFetch(record, ceiling, deadline, timeoutMs) {
346
378
  const t = record.testimony;
347
- const check = this.beforeDial(record, opts);
348
- if ('refusal' in check)
349
- return { ok: false, ...check.refusal };
350
- const { serverId, binding, ceiling, budget } = check;
351
- const server = `the "${serverId}" server`;
352
- const timeoutMs = opts?.timeoutMs ?? FETCH_TIMEOUT_MS;
379
+ const check = this.beforeDial(record, { maxBytes: ceiling });
380
+ if ('refusal' in check) {
381
+ const refusal = fail(check.refusal.error, check.refusal.remedy);
382
+ return check.byCeiling ? { ...refusal, stoppedBy: 'ceiling', atCeiling: check.atCeiling } : refusal;
383
+ }
384
+ const { serverId, binding, budget } = check;
385
+ const server = `the "${shownServerId(serverId)}" server`;
353
386
  const controller = new AbortController();
354
- const timer = setTimeout(() => controller.abort(), timeoutMs);
387
+ const timer = setTimeout(() => controller.abort(), Math.max(0, deadline - performance.now()));
355
388
  try {
356
389
  const headers = {};
357
390
  if (binding.token)
@@ -393,8 +426,8 @@ export class ReferenceFetcher {
393
426
  }
394
427
  if (received > ceiling) {
395
428
  controller.abort();
396
- return fail(`the download had reached ${received} bytes, past the ${ceiling} bytes this call allows, ` +
397
- 'so it was stopped and nothing was kept', largerMaxBytes(received, budget - total, server));
429
+ const atCeiling = readPast(received);
430
+ return { ...fail(atCeiling(ceiling), largerMaxBytes(received, budget - total, server)), stoppedBy: 'ceiling', atCeiling };
398
431
  }
399
432
  const buf = Buffer.from(value);
400
433
  hash.update(buf);
@@ -444,11 +477,11 @@ export class ReferenceFetcher {
444
477
  }
445
478
  catch (e) {
446
479
  // The timer is the only abort that throws: the budget and the ceiling
447
- // abort the download and return at once.
448
- if (e?.name === 'AbortError') {
449
- const seconds = timeoutMs / 1000;
450
- return fail(`it took longer than ${seconds} second${seconds === 1 ? '' : 's'}`, TRY_LATER);
451
- }
480
+ // abort the download and return at once. It fires at the starter's
481
+ // deadline, and a caller with more time left than the starter's whole
482
+ // timeout fetches again (fetch()).
483
+ if (e?.name === 'AbortError')
484
+ return { ...tookLonger(timeoutMs), stoppedBy: 'deadline' };
452
485
  return fail(`the request to ${server} failed: ${boundedForLog(whyFetchFailed(e))}`, REQUEST_FAILED);
453
486
  }
454
487
  finally {
@@ -456,5 +489,4 @@ export class ReferenceFetcher {
456
489
  }
457
490
  }
458
491
  }
459
- export { EAGER_FETCH_TIMEOUT_MS };
460
492
  //# sourceMappingURL=reference-fetcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reference-fetcher.js","sourceRoot":"","sources":["../../../src/mcpl/reference-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,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