@diffra-ai/durable 0.0.0-stage → 0.2.2

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 (411) hide show
  1. package/CHANGELOG.md +440 -0
  2. package/README.md +1153 -2
  3. package/dist/codemode/codemode.d.ts +174 -0
  4. package/dist/codemode/codemode.d.ts.map +1 -0
  5. package/dist/codemode/codemode.js +884 -0
  6. package/dist/codemode/codemode.js.map +1 -0
  7. package/dist/codemode/describe.d.ts +38 -0
  8. package/dist/codemode/describe.d.ts.map +1 -0
  9. package/dist/codemode/describe.js +127 -0
  10. package/dist/codemode/describe.js.map +1 -0
  11. package/dist/codemode/index.d.ts +3 -0
  12. package/dist/codemode/index.d.ts.map +1 -0
  13. package/dist/codemode/index.js +3 -0
  14. package/dist/codemode/index.js.map +1 -0
  15. package/dist/codemode/models.d.ts +29 -0
  16. package/dist/codemode/models.d.ts.map +1 -0
  17. package/dist/codemode/models.js +242 -0
  18. package/dist/codemode/models.js.map +1 -0
  19. package/dist/codemode/output.d.ts +43 -0
  20. package/dist/codemode/output.d.ts.map +1 -0
  21. package/dist/codemode/output.js +168 -0
  22. package/dist/codemode/output.js.map +1 -0
  23. package/dist/documents.d.ts +66 -0
  24. package/dist/documents.d.ts.map +1 -0
  25. package/dist/documents.js +98 -0
  26. package/dist/documents.js.map +1 -0
  27. package/dist/entries.d.ts +31 -0
  28. package/dist/entries.d.ts.map +1 -0
  29. package/dist/entries.js +31 -0
  30. package/dist/entries.js.map +1 -0
  31. package/dist/env/decode.d.ts +16 -0
  32. package/dist/env/decode.d.ts.map +1 -0
  33. package/dist/env/decode.js +28 -0
  34. package/dist/env/decode.js.map +1 -0
  35. package/dist/env/index.d.ts +308 -0
  36. package/dist/env/index.d.ts.map +1 -0
  37. package/dist/env/index.js +49 -0
  38. package/dist/env/index.js.map +1 -0
  39. package/dist/env/line-scan.d.ts +13 -0
  40. package/dist/env/line-scan.d.ts.map +1 -0
  41. package/dist/env/line-scan.js +147 -0
  42. package/dist/env/line-scan.js.map +1 -0
  43. package/dist/env/node-watch.d.ts +29 -0
  44. package/dist/env/node-watch.d.ts.map +1 -0
  45. package/dist/env/node-watch.js +487 -0
  46. package/dist/env/node-watch.js.map +1 -0
  47. package/dist/env/node.d.ts +56 -0
  48. package/dist/env/node.d.ts.map +1 -0
  49. package/dist/env/node.js +1185 -0
  50. package/dist/env/node.js.map +1 -0
  51. package/dist/errors.d.ts +48 -0
  52. package/dist/errors.d.ts.map +1 -0
  53. package/dist/errors.js +76 -0
  54. package/dist/errors.js.map +1 -0
  55. package/dist/harness/agent.d.ts +46 -0
  56. package/dist/harness/agent.d.ts.map +1 -0
  57. package/dist/harness/agent.js +334 -0
  58. package/dist/harness/agent.js.map +1 -0
  59. package/dist/harness/compaction.d.ts +68 -0
  60. package/dist/harness/compaction.d.ts.map +1 -0
  61. package/dist/harness/compaction.js +431 -0
  62. package/dist/harness/compaction.js.map +1 -0
  63. package/dist/harness/context.d.ts +84 -0
  64. package/dist/harness/context.d.ts.map +1 -0
  65. package/dist/harness/context.js +301 -0
  66. package/dist/harness/context.js.map +1 -0
  67. package/dist/harness/define.d.ts +25 -0
  68. package/dist/harness/define.d.ts.map +1 -0
  69. package/dist/harness/define.js +32 -0
  70. package/dist/harness/define.js.map +1 -0
  71. package/dist/harness/generation.d.ts +117 -0
  72. package/dist/harness/generation.d.ts.map +1 -0
  73. package/dist/harness/generation.js +1098 -0
  74. package/dist/harness/generation.js.map +1 -0
  75. package/dist/harness/harness.d.ts +22 -0
  76. package/dist/harness/harness.d.ts.map +1 -0
  77. package/dist/harness/harness.js +438 -0
  78. package/dist/harness/harness.js.map +1 -0
  79. package/dist/harness/inbox.d.ts +84 -0
  80. package/dist/harness/inbox.d.ts.map +1 -0
  81. package/dist/harness/inbox.js +135 -0
  82. package/dist/harness/inbox.js.map +1 -0
  83. package/dist/harness/json.d.ts +26 -0
  84. package/dist/harness/json.d.ts.map +1 -0
  85. package/dist/harness/json.js +51 -0
  86. package/dist/harness/json.js.map +1 -0
  87. package/dist/harness/live.d.ts +285 -0
  88. package/dist/harness/live.d.ts.map +1 -0
  89. package/dist/harness/live.js +257 -0
  90. package/dist/harness/live.js.map +1 -0
  91. package/dist/harness/parks.d.ts +23 -0
  92. package/dist/harness/parks.d.ts.map +1 -0
  93. package/dist/harness/parks.js +52 -0
  94. package/dist/harness/parks.js.map +1 -0
  95. package/dist/harness/partial-changes.d.ts +54 -0
  96. package/dist/harness/partial-changes.d.ts.map +1 -0
  97. package/dist/harness/partial-changes.js +163 -0
  98. package/dist/harness/partial-changes.js.map +1 -0
  99. package/dist/harness/prompt.d.ts +27 -0
  100. package/dist/harness/prompt.d.ts.map +1 -0
  101. package/dist/harness/prompt.js +131 -0
  102. package/dist/harness/prompt.js.map +1 -0
  103. package/dist/harness/provider.d.ts +16 -0
  104. package/dist/harness/provider.d.ts.map +1 -0
  105. package/dist/harness/provider.js +33 -0
  106. package/dist/harness/provider.js.map +1 -0
  107. package/dist/harness/registry-reader.d.ts +11 -0
  108. package/dist/harness/registry-reader.d.ts.map +1 -0
  109. package/dist/harness/registry-reader.js +25 -0
  110. package/dist/harness/registry-reader.js.map +1 -0
  111. package/dist/harness/registry.d.ts +6 -0
  112. package/dist/harness/registry.d.ts.map +1 -0
  113. package/dist/harness/registry.js +101 -0
  114. package/dist/harness/registry.js.map +1 -0
  115. package/dist/harness/scheduler.d.ts +195 -0
  116. package/dist/harness/scheduler.d.ts.map +1 -0
  117. package/dist/harness/scheduler.js +3073 -0
  118. package/dist/harness/scheduler.js.map +1 -0
  119. package/dist/harness/submissions.d.ts +44 -0
  120. package/dist/harness/submissions.d.ts.map +1 -0
  121. package/dist/harness/submissions.js +265 -0
  122. package/dist/harness/submissions.js.map +1 -0
  123. package/dist/harness/task-graph.d.ts +75 -0
  124. package/dist/harness/task-graph.d.ts.map +1 -0
  125. package/dist/harness/task-graph.js +224 -0
  126. package/dist/harness/task-graph.js.map +1 -0
  127. package/dist/harness/telemetry.d.ts +307 -0
  128. package/dist/harness/telemetry.d.ts.map +1 -0
  129. package/dist/harness/telemetry.js +140 -0
  130. package/dist/harness/telemetry.js.map +1 -0
  131. package/dist/harness/tool.d.ts +106 -0
  132. package/dist/harness/tool.d.ts.map +1 -0
  133. package/dist/harness/tool.js +1182 -0
  134. package/dist/harness/tool.js.map +1 -0
  135. package/dist/harness/transcript.d.ts +72 -0
  136. package/dist/harness/transcript.d.ts.map +1 -0
  137. package/dist/harness/transcript.js +264 -0
  138. package/dist/harness/transcript.js.map +1 -0
  139. package/dist/harness/types.d.ts +1146 -0
  140. package/dist/harness/types.d.ts.map +1 -0
  141. package/dist/harness/types.js +2 -0
  142. package/dist/harness/types.js.map +1 -0
  143. package/dist/harness/usage.d.ts +19 -0
  144. package/dist/harness/usage.d.ts.map +1 -0
  145. package/dist/harness/usage.js +57 -0
  146. package/dist/harness/usage.js.map +1 -0
  147. package/dist/harness/util.d.ts +25 -0
  148. package/dist/harness/util.d.ts.map +1 -0
  149. package/dist/harness/util.js +76 -0
  150. package/dist/harness/util.js.map +1 -0
  151. package/dist/harness/view.d.ts +69 -0
  152. package/dist/harness/view.d.ts.map +1 -0
  153. package/dist/harness/view.js +265 -0
  154. package/dist/harness/view.js.map +1 -0
  155. package/dist/ids.d.ts +6 -0
  156. package/dist/ids.d.ts.map +1 -0
  157. package/dist/ids.js +9 -0
  158. package/dist/ids.js.map +1 -0
  159. package/dist/images/cloudflare.d.ts +4 -0
  160. package/dist/images/cloudflare.d.ts.map +1 -0
  161. package/dist/images/cloudflare.js +9 -0
  162. package/dist/images/cloudflare.js.map +1 -0
  163. package/dist/images/exif.d.ts +3 -0
  164. package/dist/images/exif.d.ts.map +1 -0
  165. package/dist/images/exif.js +71 -0
  166. package/dist/images/exif.js.map +1 -0
  167. package/dist/images/fit.d.ts +41 -0
  168. package/dist/images/fit.d.ts.map +1 -0
  169. package/dist/images/fit.js +108 -0
  170. package/dist/images/fit.js.map +1 -0
  171. package/dist/images/index.d.ts +18 -0
  172. package/dist/images/index.d.ts.map +1 -0
  173. package/dist/images/index.js +125 -0
  174. package/dist/images/index.js.map +1 -0
  175. package/dist/images/node-worker.d.ts +19 -0
  176. package/dist/images/node-worker.d.ts.map +1 -0
  177. package/dist/images/node-worker.js +17 -0
  178. package/dist/images/node-worker.js.map +1 -0
  179. package/dist/images/node.d.ts +21 -0
  180. package/dist/images/node.d.ts.map +1 -0
  181. package/dist/images/node.js +121 -0
  182. package/dist/images/node.js.map +1 -0
  183. package/dist/index.d.ts +29 -0
  184. package/dist/index.d.ts.map +1 -0
  185. package/dist/index.js +23 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/search.d.ts +29 -0
  188. package/dist/search.d.ts.map +1 -0
  189. package/dist/search.js +148 -0
  190. package/dist/search.js.map +1 -0
  191. package/dist/session/cached-storage.d.ts +72 -0
  192. package/dist/session/cached-storage.d.ts.map +1 -0
  193. package/dist/session/cached-storage.js +269 -0
  194. package/dist/session/cached-storage.js.map +1 -0
  195. package/dist/session/conversation-tails.d.ts +33 -0
  196. package/dist/session/conversation-tails.d.ts.map +1 -0
  197. package/dist/session/conversation-tails.js +101 -0
  198. package/dist/session/conversation-tails.js.map +1 -0
  199. package/dist/session/forks.d.ts +10 -0
  200. package/dist/session/forks.d.ts.map +1 -0
  201. package/dist/session/forks.js +42 -0
  202. package/dist/session/forks.js.map +1 -0
  203. package/dist/session/keys.d.ts +69 -0
  204. package/dist/session/keys.d.ts.map +1 -0
  205. package/dist/session/keys.js +161 -0
  206. package/dist/session/keys.js.map +1 -0
  207. package/dist/session/session.d.ts +287 -0
  208. package/dist/session/session.d.ts.map +1 -0
  209. package/dist/session/session.js +1701 -0
  210. package/dist/session/session.js.map +1 -0
  211. package/dist/session/transaction.d.ts +205 -0
  212. package/dist/session/transaction.d.ts.map +1 -0
  213. package/dist/session/transaction.js +1059 -0
  214. package/dist/session/transaction.js.map +1 -0
  215. package/dist/session/writer.d.ts +74 -0
  216. package/dist/session/writer.d.ts.map +1 -0
  217. package/dist/session/writer.js +294 -0
  218. package/dist/session/writer.js.map +1 -0
  219. package/dist/signals.d.ts +180 -0
  220. package/dist/signals.d.ts.map +1 -0
  221. package/dist/signals.js +236 -0
  222. package/dist/signals.js.map +1 -0
  223. package/dist/storage/indexeddb.d.ts +69 -0
  224. package/dist/storage/indexeddb.d.ts.map +1 -0
  225. package/dist/storage/indexeddb.js +883 -0
  226. package/dist/storage/indexeddb.js.map +1 -0
  227. package/dist/storage/jsonl/index.d.ts +2 -0
  228. package/dist/storage/jsonl/index.d.ts.map +1 -0
  229. package/dist/storage/jsonl/index.js +2 -0
  230. package/dist/storage/jsonl/index.js.map +1 -0
  231. package/dist/storage/jsonl/node.d.ts +6 -0
  232. package/dist/storage/jsonl/node.d.ts.map +1 -0
  233. package/dist/storage/jsonl/node.js +8 -0
  234. package/dist/storage/jsonl/node.js.map +1 -0
  235. package/dist/storage/jsonl/storage.d.ts +206 -0
  236. package/dist/storage/jsonl/storage.d.ts.map +1 -0
  237. package/dist/storage/jsonl/storage.js +799 -0
  238. package/dist/storage/jsonl/storage.js.map +1 -0
  239. package/dist/storage/memory.d.ts +68 -0
  240. package/dist/storage/memory.d.ts.map +1 -0
  241. package/dist/storage/memory.js +761 -0
  242. package/dist/storage/memory.js.map +1 -0
  243. package/dist/storage/scan.d.ts +18 -0
  244. package/dist/storage/scan.d.ts.map +1 -0
  245. package/dist/storage/scan.js +29 -0
  246. package/dist/storage/scan.js.map +1 -0
  247. package/dist/storage/sqlite/cloudflare.d.ts +9 -0
  248. package/dist/storage/sqlite/cloudflare.d.ts.map +1 -0
  249. package/dist/storage/sqlite/cloudflare.js +11 -0
  250. package/dist/storage/sqlite/cloudflare.js.map +1 -0
  251. package/dist/storage/sqlite/commit.d.ts +52 -0
  252. package/dist/storage/sqlite/commit.d.ts.map +1 -0
  253. package/dist/storage/sqlite/commit.js +371 -0
  254. package/dist/storage/sqlite/commit.js.map +1 -0
  255. package/dist/storage/sqlite/database.d.ts +2 -0
  256. package/dist/storage/sqlite/database.d.ts.map +1 -0
  257. package/dist/storage/sqlite/database.js +2 -0
  258. package/dist/storage/sqlite/database.js.map +1 -0
  259. package/dist/storage/sqlite/index.d.ts +4 -0
  260. package/dist/storage/sqlite/index.d.ts.map +1 -0
  261. package/dist/storage/sqlite/index.js +3 -0
  262. package/dist/storage/sqlite/index.js.map +1 -0
  263. package/dist/storage/sqlite/migrations.d.ts +12 -0
  264. package/dist/storage/sqlite/migrations.d.ts.map +1 -0
  265. package/dist/storage/sqlite/migrations.js +121 -0
  266. package/dist/storage/sqlite/migrations.js.map +1 -0
  267. package/dist/storage/sqlite/node.d.ts +8 -0
  268. package/dist/storage/sqlite/node.d.ts.map +1 -0
  269. package/dist/storage/sqlite/node.js +12 -0
  270. package/dist/storage/sqlite/node.js.map +1 -0
  271. package/dist/storage/sqlite/rows.d.ts +33 -0
  272. package/dist/storage/sqlite/rows.d.ts.map +1 -0
  273. package/dist/storage/sqlite/rows.js +53 -0
  274. package/dist/storage/sqlite/rows.js.map +1 -0
  275. package/dist/storage/sqlite/schema.d.ts +45 -0
  276. package/dist/storage/sqlite/schema.d.ts.map +1 -0
  277. package/dist/storage/sqlite/schema.js +50 -0
  278. package/dist/storage/sqlite/schema.js.map +1 -0
  279. package/dist/storage/sqlite/statements.d.ts +13 -0
  280. package/dist/storage/sqlite/statements.d.ts.map +1 -0
  281. package/dist/storage/sqlite/statements.js +88 -0
  282. package/dist/storage/sqlite/statements.js.map +1 -0
  283. package/dist/storage/sqlite/storage.d.ts +86 -0
  284. package/dist/storage/sqlite/storage.d.ts.map +1 -0
  285. package/dist/storage/sqlite/storage.js +534 -0
  286. package/dist/storage/sqlite/storage.js.map +1 -0
  287. package/dist/storage/store/commit.d.ts +33 -0
  288. package/dist/storage/store/commit.d.ts.map +1 -0
  289. package/dist/storage/store/commit.js +286 -0
  290. package/dist/storage/store/commit.js.map +1 -0
  291. package/dist/storage/store/documents.d.ts +43 -0
  292. package/dist/storage/store/documents.d.ts.map +1 -0
  293. package/dist/storage/store/documents.js +102 -0
  294. package/dist/storage/store/documents.js.map +1 -0
  295. package/dist/storage/store/index.d.ts +2 -0
  296. package/dist/storage/store/index.d.ts.map +1 -0
  297. package/dist/storage/store/index.js +2 -0
  298. package/dist/storage/store/index.js.map +1 -0
  299. package/dist/storage/store/queries.d.ts +49 -0
  300. package/dist/storage/store/queries.d.ts.map +1 -0
  301. package/dist/storage/store/queries.js +93 -0
  302. package/dist/storage/store/queries.js.map +1 -0
  303. package/dist/storage/store/storage.d.ts +60 -0
  304. package/dist/storage/store/storage.d.ts.map +1 -0
  305. package/dist/storage/store/storage.js +438 -0
  306. package/dist/storage/store/storage.js.map +1 -0
  307. package/dist/storage/store/tables.d.ts +54 -0
  308. package/dist/storage/store/tables.d.ts.map +1 -0
  309. package/dist/storage/store/tables.js +108 -0
  310. package/dist/storage/store/tables.js.map +1 -0
  311. package/dist/tasks.d.ts +6 -0
  312. package/dist/tasks.d.ts.map +1 -0
  313. package/dist/tasks.js +5 -0
  314. package/dist/tasks.js.map +1 -0
  315. package/dist/testing/assertions.d.ts +5 -0
  316. package/dist/testing/assertions.d.ts.map +1 -0
  317. package/dist/testing/assertions.js +25 -0
  318. package/dist/testing/assertions.js.map +1 -0
  319. package/dist/testing/commit-writes.d.ts +5 -0
  320. package/dist/testing/commit-writes.d.ts.map +1 -0
  321. package/dist/testing/commit-writes.js +12 -0
  322. package/dist/testing/commit-writes.js.map +1 -0
  323. package/dist/testing/env-conformance.d.ts +7 -0
  324. package/dist/testing/env-conformance.d.ts.map +1 -0
  325. package/dist/testing/env-conformance.js +531 -0
  326. package/dist/testing/env-conformance.js.map +1 -0
  327. package/dist/testing/index.d.ts +8 -0
  328. package/dist/testing/index.d.ts.map +1 -0
  329. package/dist/testing/index.js +7 -0
  330. package/dist/testing/index.js.map +1 -0
  331. package/dist/testing/runner.d.ts +12 -0
  332. package/dist/testing/runner.d.ts.map +1 -0
  333. package/dist/testing/runner.js +23 -0
  334. package/dist/testing/runner.js.map +1 -0
  335. package/dist/testing/storage-benchmark.d.ts +41 -0
  336. package/dist/testing/storage-benchmark.d.ts.map +1 -0
  337. package/dist/testing/storage-benchmark.js +351 -0
  338. package/dist/testing/storage-benchmark.js.map +1 -0
  339. package/dist/testing/storage-conformance.d.ts +4 -0
  340. package/dist/testing/storage-conformance.d.ts.map +1 -0
  341. package/dist/testing/storage-conformance.js +1554 -0
  342. package/dist/testing/storage-conformance.js.map +1 -0
  343. package/dist/testing/types.d.ts +39 -0
  344. package/dist/testing/types.d.ts.map +1 -0
  345. package/dist/testing/types.js +2 -0
  346. package/dist/testing/types.js.map +1 -0
  347. package/dist/timers.d.ts +21 -0
  348. package/dist/timers.d.ts.map +1 -0
  349. package/dist/timers.js +72 -0
  350. package/dist/timers.js.map +1 -0
  351. package/dist/tool-search/index.d.ts +2 -0
  352. package/dist/tool-search/index.d.ts.map +1 -0
  353. package/dist/tool-search/index.js +2 -0
  354. package/dist/tool-search/index.js.map +1 -0
  355. package/dist/tool-search/tool-search.d.ts +17 -0
  356. package/dist/tool-search/tool-search.d.ts.map +1 -0
  357. package/dist/tool-search/tool-search.js +96 -0
  358. package/dist/tool-search/tool-search.js.map +1 -0
  359. package/dist/tools/bash.d.ts +55 -0
  360. package/dist/tools/bash.d.ts.map +1 -0
  361. package/dist/tools/bash.js +139 -0
  362. package/dist/tools/bash.js.map +1 -0
  363. package/dist/tools/edit-diff.d.ts +89 -0
  364. package/dist/tools/edit-diff.d.ts.map +1 -0
  365. package/dist/tools/edit-diff.js +386 -0
  366. package/dist/tools/edit-diff.js.map +1 -0
  367. package/dist/tools/edit.d.ts +18 -0
  368. package/dist/tools/edit.d.ts.map +1 -0
  369. package/dist/tools/edit.js +117 -0
  370. package/dist/tools/edit.js.map +1 -0
  371. package/dist/tools/env.d.ts +5 -0
  372. package/dist/tools/env.d.ts.map +1 -0
  373. package/dist/tools/env.js +7 -0
  374. package/dist/tools/env.js.map +1 -0
  375. package/dist/tools/file-mutation-queue.d.ts +9 -0
  376. package/dist/tools/file-mutation-queue.d.ts.map +1 -0
  377. package/dist/tools/file-mutation-queue.js +52 -0
  378. package/dist/tools/file-mutation-queue.js.map +1 -0
  379. package/dist/tools/image-processor.d.ts +57 -0
  380. package/dist/tools/image-processor.d.ts.map +1 -0
  381. package/dist/tools/image-processor.js +49 -0
  382. package/dist/tools/image-processor.js.map +1 -0
  383. package/dist/tools/image.d.ts +20 -0
  384. package/dist/tools/image.d.ts.map +1 -0
  385. package/dist/tools/image.js +178 -0
  386. package/dist/tools/image.js.map +1 -0
  387. package/dist/tools/index.d.ts +46 -0
  388. package/dist/tools/index.d.ts.map +1 -0
  389. package/dist/tools/index.js +23 -0
  390. package/dist/tools/index.js.map +1 -0
  391. package/dist/tools/path-utils.d.ts +5 -0
  392. package/dist/tools/path-utils.d.ts.map +1 -0
  393. package/dist/tools/path-utils.js +26 -0
  394. package/dist/tools/path-utils.js.map +1 -0
  395. package/dist/tools/read.d.ts +30 -0
  396. package/dist/tools/read.d.ts.map +1 -0
  397. package/dist/tools/read.js +239 -0
  398. package/dist/tools/read.js.map +1 -0
  399. package/dist/tools/write.d.ts +10 -0
  400. package/dist/tools/write.d.ts.map +1 -0
  401. package/dist/tools/write.js +31 -0
  402. package/dist/tools/write.js.map +1 -0
  403. package/dist/truncate.d.ts +65 -0
  404. package/dist/truncate.d.ts.map +1 -0
  405. package/dist/truncate.js +124 -0
  406. package/dist/truncate.js.map +1 -0
  407. package/dist/types.d.ts +1244 -0
  408. package/dist/types.d.ts.map +1 -0
  409. package/dist/types.js +3 -0
  410. package/dist/types.js.map +1 -0
  411. package/package.json +179 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,GAAG,EACH,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,OAAO,EACP,KAAK,EACL,MAAM,EACN,kBAAkB,EAClB,eAAe,E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AAE,SAAS,CAAC;KAC3B,CAAC,CAAC;IACH;;;;;;;;;;;OAWG;IACH,SAAS,CACR,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,GACd,UAAU,CAAC,mBAAmB,CAAC,CAAC;CACnC;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,aAAa,CACZ,UAAU,EAAE;QACX,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;QAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;QACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;QACtC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;QAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAC/B,EACD,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,GACd,UAAU,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/harness/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n\tApi,\n\tAssistantMessage,\n\tCacheRetention,\n\tClientIdentity,\n\tMessage,\n\tModel,\n\tModels,\n\tModelThinkingLevel,\n\tThinkingBudgets,\n\tTool,\n\tToolCall,\n\tToolResultMessage,\n\tTransport,\n\tUsage,\n\tUserMessage,\n} from \"@diffra-ai/ai\";\nimport type { Context } from \"@diffra-ai/chord/context\";\nimport type { JsonValue } from \"@diffra-ai/chord/json\";\nimport type { WatchHandle } from \"@diffra-ai/chord/watch\";\nimport type { Static } from \"@diffra-ai/schema\";\nimport type { TelemetryContext } from \"@diffra-ai/telemetry\";\nimport type { ExecutionEnv, ShellOutputSkip, ShellOutputWindow } from \"../env/index.ts\";\nimport type { SignalKey, SignalResult, SignalState, SignalToken } from \"../signals.ts\";\nimport type {\n\tCommitOptions,\n\tConversationId,\n\tConversationOwnership,\n\tConversationRecord,\n\tCursor,\n\tDocumentObserver,\n\tDocumentReader,\n\tEntry,\n\tEntryDraft,\n\tEntryId,\n\tEntryQuery,\n\tEntryRecord,\n\tJoinPolicy,\n\tJsonObject,\n\tObservation,\n\tObserver,\n\tPage,\n\tReport,\n\tSession,\n\tSetTimer,\n\tSubmissionId,\n\tSubmissionNotify,\n\tSubmissionRecord,\n\tTask,\n\tTaskId,\n\tTaskOptions,\n\tTaskRecord,\n\tTaskState,\n\tTx,\n\tTypedEntry,\n\tWakeReason,\n} from \"../types.ts\";\nimport type { TaskGraph, TaskGraphWatch } from \"./task-graph.ts\";\nimport type { UsageState } from \"./usage.ts\";\nimport type { ConversationView, ConversationWindow } from \"./view.ts\";\n\n/** Provider and model ID resolved through diffra-ai `Models`. */\nexport type ModelRef = {\n\treadonly provider: string;\n\treadonly modelId: string;\n};\n\nexport type UserInput = UserMessage[\"content\"];\n\n/**\n * The entry an input is placed as, instead of `diffra.user`: an application kind, and data the transcript shows, such as its\n * author. Its model message is still the input's user message.\n */\nexport type InputEntry = { readonly kind: string; readonly data?: JsonValue };\n\n/**\n * Host submission: user input that may start a run, a passive entry write, or a continue: a run without a new user\n * message, for an idle conversation whose context the model still owes an answer (it ends in a user message or tool\n * results, for example after a run that ended without an answer).\n */\nexport type SubmissionDraft = {\n\treadonly requestId?: string;\n\t/**\n\t * When the submission settles, deliver `SubmissionSettled` (the settled record) to `notify.taskId` under\n\t * `notify.key`, in the settling commit; a delivery the task refuses (`closed`, `not_found`) fails nothing. A\n\t * submission that settles before the task sleeps on the key wakes the sleep at once.\n\t */\n\treadonly notify?: SubmissionNotify;\n} & (\n\t| {\n\t\t\treadonly type: \"input\";\n\t\t\treadonly content: UserInput;\n\t\t\treadonly whenBusy?: \"steer\" | \"followUp\" | \"reject\";\n\t\t\t/**\n\t\t\t * `reject`: an idle conversation (no run) rejects the input with `ConversationIdle` and writes nothing, so the input\n\t\t\t * never starts a run of its own. With `whenBusy: \"steer\"` it steers the current run or is refused; a run that\n\t\t\t * answered and waits for its `afterRun` tasks is still busy, and such an input queues and starts the next run.\n\t\t\t */\n\t\t\treadonly whenIdle?: \"reject\";\n\t\t\t/**\n\t\t\t * What `Conversation.abort()` and abort cascades do with the input while it is queued: `withdraw` (default)\n\t\t\t * settles it `unanswered` with reason `aborted`; `keep` leaves it queued, as a failed run leaves its queue under\n\t\t\t * `afterFailedRun: \"keep\"`, so the next input places it and that run answers it. For input its sender cannot\n\t\t\t * take back, such as another agent's message. `Submission.abort()` withdraws it either way.\n\t\t\t */\n\t\t\treadonly onAbort?: \"withdraw\" | \"keep\";\n\t\t\t/** Place the input as this entry; default `diffra.user` without data. The kind must not start with `diffra.`. */\n\t\t\treadonly entry?: InputEntry;\n\t }\n\t| {\n\t\t\treadonly type: \"write\";\n\t\t\treadonly entry: EntryDraft;\n\t\t\treadonly content?: never;\n\t\t\treadonly whenBusy?: never;\n\t\t\treadonly whenIdle?: never;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * Start a run on the context as it is, without a user message. Only when idle: a busy conversation rejects it with\n\t\t\t * `ConversationBusy`, and it never queues. Items kept in `diffra.inbox` are placed first and join the run. A context\n\t\t\t * with nothing to answer (empty, or ending in an answer, also a text answer cut off at its output limit) ends the\n\t\t\t * run without a request, `unanswered` with `nothing_to_answer`. A cut-off answer with tool calls is continued:\n\t\t\t * its calls never ran, and the context ends in their error results (`missing_result`).\n\t\t\t */\n\t\t\treadonly type: \"continue\";\n\t\t\treadonly content?: never;\n\t\t\treadonly entry?: never;\n\t\t\treadonly whenBusy?: never;\n\t\t\treadonly whenIdle?: never;\n\t }\n);\n\nexport type InputSubmissionDraft = Extract<SubmissionDraft, { readonly type: \"input\" }>;\n\nexport type SettledSubmissionRecord = SubmissionRecord & {\n\treadonly status: \"done\" | \"unanswered\";\n};\n\n/** Awaitable host object for one durably admitted submission. */\nexport interface Submission {\n\treadonly id: SubmissionId;\n\tstatus(context: Context): Promise<SubmissionRecord>;\n\twait(context: Context): Promise<SettledSubmissionRecord>;\n\tabort(context: Context): Promise<\"aborted\" | \"already_placed\" | \"settled\">;\n}\n\nexport type SettledTask<R> = TaskRecord<JsonValue, JsonValue, R> & {\n\treadonly state: Extract<TaskState<JsonValue, R>, { readonly status: \"terminal\" }>;\n};\n\n/** Erased executable task definition stored in the registry. */\nexport type AnyTask = {\n\treadonly definition: {\n\t\treadonly name: string;\n\t\treadonly version: number;\n\t\treadonly initial: unknown;\n\t\treadonly phases: Readonly<Record<string, unknown>>;\n\t\treadonly abort: unknown;\n\t\treadonly migrate?: unknown;\n\t\treadonly hooks?: object;\n\t};\n};\n\n/** Options of `Conversation.abort()`. */\nexport type ConversationAbortOptions = {\n\t/**\n\t * Cross background boundaries: mark every live task reached ignoring the background flag when the abort is admitted,\n\t * withdraw the queued inputs of every conversation reached, and wait until those tasks are terminal and the\n\t * conversation is ordinarily idle. Background work created afterwards is neither marked nor awaited.\n\t */\n\treadonly background?: boolean;\n};\n\n/** Hook handler map declared by a task definition. */\nexport type HooksOf<K> = K extends Task<infer _I, infer _S, infer _R, infer H> ? H : never;\n\n/**\n * Invocation-bound conversation operations for tasks and tools. Rejects after the invocation ends. `submit` and `admit`\n * take any submission, as `Conversation.submit()` and `Conversation.admit()`: a subagent's conversation is an ordinary\n * one, so a tool may also continue it, and a task may admit a submission in the same commit as its own writes\n * (`runtime.commit()`); entries the admission appends there carry the task's `byTaskId`. `admit` also rejects once the\n * invocation is aborted.\n */\nexport interface ConversationHandle {\n\treadonly id: ConversationId;\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission>;\n\tadmit(tx: Tx, submission: SubmissionDraft): Promise<SubmissionId>;\n\t/** `Conversation.abort()`: withdraw queued inputs, abort the ordinary ownership scope, and wait until it is idle. */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/** Resolve when the conversation's ordinary ownership scope has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n}\n\n/** Post-tools controls requested by a tool result. */\nexport type ToolControl = {\n\treadonly addTools?: readonly string[];\n\t/** End the run without another model request when every result of the round sets it to `true`; `false` is a no-op. */\n\treadonly terminate?: boolean;\n\t/**\n\t * Start a new context with this text as its user message, as `reset(handoff)` writes, and continue the run there.\n\t * The last handoff in call order wins.\n\t */\n\treadonly handoff?: string;\n};\n\n/** Remark about a call for the model and the UI, such as truncation or a spill path; never part of the tool's data. */\nexport type ToolDiagnostic = {\n\treadonly severity: \"info\" | \"warn\" | \"error\";\n\treadonly message: string;\n\treadonly code?: string;\n};\n\n/**\n * What a tool returns, on three channels: `output` for the model, `structuredOutput` for programs that call the tool\n * (`executeTool()` callers, code mode scripts), and `details` for UIs.\n */\nexport type ToolExecutionResult<TDetails extends JsonValue = JsonValue> = {\n\t/** For the model. Omitted: the retained `output()` text. */\n\treadonly output?: ToolResultMessage[\"content\"];\n\t/**\n\t * For programs. Required unless `isError` when the tool declares `structuredOutputSchema`, and validated against it;\n\t * not allowed without one, where programs get the output itself (`NestedToolExecutionResult.structuredOutput`).\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError?: boolean;\n\t/** Omitted: the last `details()` value becomes the details. */\n\treadonly details?: TDetails;\n\t/** Added after those recorded through `api.diagnostic()`. */\n\treadonly diagnostics?: readonly ToolDiagnostic[];\n\t/** Spend of the execution itself, such as a model call; stored on the result and in `diffra.usage.tools`. */\n\treadonly usage?: Usage;\n\treadonly control?: ToolControl;\n\t/** A result is no park (`ToolPark`): only parks have a `kind`. */\n\treadonly kind?: never;\n};\n\n/**\n * Result of a nested call, as `executeTool()` returns it. Programs read `structuredOutput`; the output for the model\n * is not kept, and `control` does not apply.\n */\nexport type NestedToolExecutionResult = {\n\t/** The nested call's tool task. */\n\treadonly taskId: TaskId;\n\t/**\n\t * The tool's value for programs. A tool with `structuredOutputSchema`: its validated `structuredOutput`, also on an\n\t * error result that has one; absent otherwise, and an error's text is then in an error diagnostic. A tool without:\n\t * its bounded output, success or error, as a string for one text item, an `ImageContent` for one image, `\"\"` for\n\t * none, and the content list otherwise. Absent on an error result the Harness wrote itself (unavailable, invalid,\n\t * blocked, interrupted, aborted); `diagnostics` say what went wrong.\n\t */\n\treadonly structuredOutput?: JsonValue;\n\treadonly isError: boolean;\n\treadonly details?: JsonValue;\n\treadonly diagnostics: readonly ToolDiagnostic[];\n\treadonly usage?: Usage;\n\t/** Execution time of the attempt that produced the result; absent when it never executed. */\n\treadonly durationMs?: number;\n};\n\n/**\n * What `execute()` returns instead of a result to park the call (spec suspendable §4): kind `sleep` until `until`, for\n * `signals`, or both; or kind `wait` for tasks the call's task owns (`on`). The call holds no invocation meanwhile,\n * then runs `execute()` again with the same arguments, `api.wake` saying why, and `api.checkpoint` set to `checkpoint`.\n */\nexport type ToolPark<C extends JsonValue = JsonValue> = NoResultFields &\n\t(\n\t\t| {\n\t\t\t\treadonly kind: \"sleep\";\n\t\t\t\treadonly checkpoint?: C;\n\t\t\t\treadonly until?: number;\n\t\t\t\treadonly signals?: readonly SignalKey<unknown>[];\n\t\t }\n\t\t| {\n\t\t\t\treadonly kind: \"wait\";\n\t\t\t\treadonly checkpoint?: C;\n\t\t\t\treadonly on: readonly TaskId[];\n\t\t\t\treadonly policy: JoinPolicy;\n\t\t }\n\t);\n\n/** A park carries no result field, so code reading a result's fields reads none from a park. */\ntype NoResultFields = { readonly [K in Exclude<keyof ToolExecutionResult, \"kind\">]?: never };\n\n/** Whether the tools of one round run at once or one after another in call order. */\nexport type ToolExecutionMode = \"parallel\" | \"sequential\";\n\n/** How many queued items of one mode a boundary places: the first, or all of them. */\nexport type QueueMode = \"all\" | \"one-at-a-time\";\n\n/**\n * Operations available to one tool invocation. A plain object, so a wrapper can spread it. Every operation rejects after\n * the invocation ends.\n */\nexport interface ToolExecutionApi<TDetails extends JsonValue = JsonValue, C extends JsonValue = JsonValue>\n\textends DocumentObserver,\n\t\tDocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\treadonly callId: string;\n\t/** Why this run started after a park; undefined on a fresh call, and in `cancel`. */\n\treadonly wake: WakeReason | undefined;\n\t/** What the call last parked with; undefined on a fresh call or after a park without one. */\n\treadonly checkpoint: C | undefined;\n\t/** The tool task's phase snapshot. */\n\treadonly registry: RegistrySnapshot;\n\t/** The calling conversation's agent, as the tool task's phase resolved it. */\n\tagent(context: Context): Promise<Agent>;\n\t/** The current `HarnessOptions.models`, read at each access: the catalog, credentials, and request transforms. */\n\treadonly models: Models;\n\t/** Built by `HarnessOptions.env` for this call; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/** The Harness clock (`HarnessOptions.now`), for times a rerun after a restart compares against. */\n\tnow(): number;\n\t/**\n\t * Append running output; it becomes the result's `output` when the result omits it. `skipped` counts output\n\t * omitted before the chunk, as reported by an environment given `outputWindow` (`ShellOutputInfo.skipped`).\n\t */\n\toutput(chunk: string | Uint8Array, skipped?: ShellOutputSkip): void;\n\t/**\n\t * The tail this call's output keeps and the pace of its progress commits, for `ShellExecOptions.window`; `undefined`\n\t * when the tool keeps the head of its output, which cannot accept skips. A wrapper that replaces `output` and\n\t * transforms text must also replace this with `undefined`, so skipped text cannot bypass its transform.\n\t */\n\treadonly outputWindow: ShellOutputWindow | undefined;\n\t/**\n\t * The output retained so far, as the model will see it when the result omits `output`, and whether earlier output was\n\t * dropped; for a tool that also returns that text in its `structuredOutput`.\n\t */\n\tretainedOutput(): { readonly text: string; readonly truncated: boolean };\n\t/** Record a model-visible remark about this call. */\n\tdiagnostic(diagnostic: ToolDiagnostic): void;\n\t/** Replace running details; the last value becomes the result details when the result omits `details`. */\n\tdetails(value: TDetails, context: Context): Promise<void>;\n\t/** A commit of this call's task; `options` may defer storing it (`CommitPersistence`). */\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context, options?: CommitOptions): Promise<T>;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n\t/** A signal key's committed state in this call's task, as `TaskRuntime.readSignal()`. */\n\treadSignal<T>(token: SignalToken<T>, key: string, context: Context): Promise<SignalState<T> | undefined>;\n\t/**\n\t * Create a task in one commit. A child task of a tool that is not replay-safe defaults to `abandonOnRestart`: the\n\t * tool never resumes after a restart, so nothing awaits the child then. With a `key`, validated like a nested call's,\n\t * the task is recorded under it in the same commit, and a later call with the key, in this run, a rerun, or a run\n\t * after a wake, returns that task; another task kind, other input, or a key a nested call uses throws. After a wake\n\t * (`wake` set) a key is required.\n\t */\n\tcreateTask<I, S extends { phase: string }, R, H extends object>(\n\t\ttask: Task<I, S, R, H>,\n\t\tinput: I,\n\t\toptions: Omit<TaskOptions, \"conversationId\"> & { readonly key?: string },\n\t\tcontext: Context,\n\t): Promise<TaskId<R>>;\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Invocation-bound handle of an existing conversation, such as one this tool created in `commit()`. */\n\tconversation(id: ConversationId, context: Context): Promise<ConversationHandle | undefined>;\n\t/**\n\t * Run tool `name` as a nested call of this one and wait for its result. The nested call is its own `diffra.tool` task,\n\t * owned by this call: it resolves the tool among the conversation's tools, validates, runs the `ToolTask` hooks (which\n\t * see `call.parent`), applies output limits and the tool's replay policy, and reports progress in `diffra.live.nestedTools`.\n\t * Its result returns here instead of entering the transcript. A call that is blocked, invalid, throws, is interrupted,\n\t * or is aborted returns an `isError` result.\n\t *\n\t * The nested call's key names it within this call; its call ID is `<callId>/<key>`. By default the key is the call's\n\t * position among this invocation's nested calls, `1`, `2`, ... An explicit `key` must be non-empty, without `/`, not\n\t * `__proto__`, and not a positive integer, so it never collides with a default one. After a wake (`wake` set) the\n\t * same position may mean another call, so a key is required. A rerun of a replay-safe tool\n\t * that makes a call with a used key, by calling in the same order or by passing the same `key`, gets that nested call\n\t * back, finished or still running, instead of starting another. A nested call a crash interrupted before its result\n\t * committed follows its own replay policy, so this is not exactly-once execution. Reusing a key with another tool or\n\t * other arguments throws. A tool that is not replay-safe never reruns: after a restart, its unfinished nested calls\n\t * are abandoned (`TaskOptions.abandonOnRestart`) before they run again.\n\t *\n\t * `progress: false` commits no running output, details, or diagnostics to the nested call's slot, only its status;\n\t * the result still carries its details and diagnostics, and a schema-less tool's output as `structuredOutput`. An\n\t * interrupted or aborted call's result is built from its slot, so it then has none of them. Either way, programs never\n\t * get the partial output of an interrupted or aborted call.\n\t *\n\t * Nested calls run as soon as they are made, whatever their `executionMode`; the caller decides what runs at once by\n\t * what it awaits. Cancelling `context` stops only the wait; the nested call runs on. When this call settles, nested\n\t * calls it left running are aborted first. A nested result's `usage` is already counted under its tool; a result\n\t * that passes it on counts it again. Rejects, instead of returning a result, once `execute()` has returned, when this\n\t * call is aborted, or when the Harness closes.\n\t *\n\t * Awaiting a nested call holds this call's invocation for as long as it takes, also while it is parked; a tool that\n\t * starts calls with `wait: false` and parks on their tasks (`{ kind: \"wait\", on }`) lets the Session go idle instead.\n\t */\n\texecuteTool(\n\t\tname: string,\n\t\targs: JsonObject,\n\t\tcontext: Context,\n\t\toptions?: { readonly key?: string; readonly progress?: boolean; readonly wait?: true },\n\t): Promise<NestedToolExecutionResult>;\n\t/** As above, but returns once the nested call is started or found, with a handle to its result. */\n\texecuteTool(\n\t\tname: string,\n\t\targs: JsonObject,\n\t\tcontext: Context,\n\t\toptions: { readonly key?: string; readonly progress?: boolean; readonly wait: false },\n\t): Promise<NestedToolCall>;\n}\n\n/** A nested call started without waiting for it (`executeTool()` with `wait: false`). */\nexport type NestedToolCall = {\n\t/** The nested call's tool task, for a park's `wait.on`. */\n\treadonly taskId: TaskId;\n\t/** The stored result once the nested call is terminal; otherwise waits for it. */\n\tresult(context: Context): Promise<NestedToolExecutionResult>;\n};\n\n/**\n * The arguments type of a tool with parameter schema `TParameters`: diffra-schema's `Static<TParameters>` (the builders'\n * type, TypeBox's for the common TypeBox kinds, else `unknown`), and `any` for `ToolRegistration<any>`.\n */\nexport type ToolArgs<TParameters> = IsAny<TParameters> extends true ? any : Static<TParameters>;\n\n// `0 extends 1 & T` is resolved too early for a `T` constrained to `object`; this form waits for the argument.\ntype IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;\n\n/**\n * Executable tool registered in a registry. Only diffra-ai `Tool` fields enter the transcript. `args` are typed by\n * `parameters` (any JSON Schema object; see {@link ToolArgs}), which the Harness validates them against before\n * `execute()`; `defineTool()` infers both generics.\n */\nexport type ToolRegistration<\n\tTParameters extends object = object,\n\tTDetails extends JsonValue = JsonValue,\n\tC extends JsonValue = JsonValue,\n> = Tool<TParameters> & {\n\t/** Whether an interrupted execution may rerun on recovery. Default `unsafe`. */\n\treadonly replay?: \"safe\" | \"unsafe\";\n\t/** Default: the settings' `toolExecution`. One sequential call makes its whole round sequential. */\n\treadonly executionMode?: ToolExecutionMode;\n\t/**\n\t * Repair arguments models commonly get wrong before validation, such as a JSON string where an array belongs. Must be\n\t * pure and must not mutate `args`: it runs again when a call is retried before its intent is recorded. Its result is\n\t * still validated against `parameters`.\n\t */\n\tprepareArguments?(args: unknown): ToolArgs<TParameters>;\n\t/**\n\t * Schema of `structuredOutput`, which programs that call the tool receive. Omitted: they receive the result's bounded\n\t * output, success or error, as `NestedToolExecutionResult.structuredOutput` describes.\n\t */\n\treadonly structuredOutputSchema?: object;\n\t/**\n\t * Who may call the tool: the model, other tools through `executeTool()`, or both (default). A code mode tool is\n\t * `[\"model\"]`, so scripts cannot start scripts; tools behind code mode, such as MCP tools, can be `[\"tools\"]`, so the\n\t * model is never offered them.\n\t */\n\treadonly callers?: readonly (\"model\" | \"tools\")[];\n\t/**\n\t * Not offered to the model until loaded: the model gets the tool only when `modelTools` names it, in its array or its\n\t * `add`, which `control.addTools` (from a tool such as `tool_search`) writes. Other tools can call it any time.\n\t */\n\treadonly deferred?: true;\n\treadonly outputLimits?: {\n\t\treadonly maxBytes?: number;\n\t\treadonly maxLines?: number;\n\t\treadonly retain?: \"head\" | \"tail\";\n\t};\n\t/** A result, or a park (`ToolPark`): the call runs `execute()` again once woken. */\n\texecute(\n\t\targs: ToolArgs<TParameters>,\n\t\tapi: ToolExecutionApi<TDetails, C>,\n\t\tcontext: Context,\n\t): Promise<ToolExecutionResult<TDetails> | ToolPark<C>>;\n\t/**\n\t * Clean up the external work of a call that parked, when it is aborted while no code of the tool runs (spec\n\t * suspendable §4.2): `api.checkpoint` is the last park's, `api.wake` undefined, and it starts no nested calls or\n\t * tasks. May run more than once, so idempotent. A throw is reported and the call still ends.\n\t */\n\tcancel?(args: ToolArgs<TParameters>, api: ToolExecutionApi<TDetails, C>, context: Context): Promise<void>;\n};\n\n/** Input to system prompt section rendering for one request preparation. */\nexport type PromptInput<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly conversationId: ConversationId;\n\t/** The request's resolution; `agent.tools` are the tools offered in this request. */\n\treadonly agent: Agent<Tool>;\n\t/** Built by `HarnessOptions.env` for this preparation; `undefined` without an environment. */\n\treadonly env: ExecutionEnv | undefined;\n\t/** Sections already in effect after replaying the active transcript. */\n\treadonly shown: Readonly<Record<string, string>>;\n\t/** Committed document reads. */\n\treadonly read: DocumentReader;\n};\n\n/** One system prompt section; the agent's sections render in order before each request. */\nexport type PromptSection<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly key: string;\n\trender(input: PromptInput<Tool>, context: Context): string | undefined | Promise<string | undefined>;\n\t/** Default true: wrap the text as `<key>\\n...\\n</key>`. */\n\treadonly tag?: boolean;\n};\n\n/** Built by `hook()`; matches tasks by name. */\nexport type HookRegistration = { readonly task: string; readonly handlers: object };\n\n/** Built by `wrapTool()` and `wrapSection()`; targets a tool name or a section key. Wrappers are pure. */\nexport type Wrap<Tool extends ToolRegistration = ToolRegistration> =\n\t| { readonly kind: \"tool\"; readonly tool: string; wrap(tool: Tool): Tool }\n\t| { readonly kind: \"section\"; readonly section: string; wrap(section: PromptSection<Tool>): PromptSection<Tool> };\n\n/** Named bundle of code; installed in a registry and selected by conversations by name. */\n/**\n * A named group of tools for code mode: the extension that brings the tools declares it. `description` is one line,\n * shown in the `codemode` prompt section; `instructions` is the longer how-to, returned only by `describeNamespace()`;\n * `searchTools()` searches both.\n */\nexport type ToolNamespace = { readonly name: string; readonly description: string; readonly instructions?: string };\n\nexport interface Extension<Tool extends ToolRegistration = ToolRegistration> {\n\treadonly name: string;\n\t/**\n\t * The code-mode namespace of this extension's tools (a tool named by several extensions belongs to the first). The\n\t * `codemode` section lists it while the extension is selected, also before it has any tools.\n\t */\n\treadonly namespace?: ToolNamespace;\n\treadonly tools?: readonly Tool[];\n\treadonly sections?: readonly PromptSection<Tool>[];\n\treadonly hooks?: readonly HookRegistration[];\n\t/** Apply where this extension is selected, in order. */\n\treadonly wraps?: readonly Wrap<Tool>[];\n\t/** Resolved by name for every task, whichever conversations select this extension. */\n\treadonly tasks?: readonly AnyTask[];\n}\n\n/** Immutable view of one published registry state. */\nexport interface RegistrySnapshot<Tool extends ToolRegistration = ToolRegistration> {\n\tinstalled(): readonly Extension<Tool>[];\n\textension(name: string): Extension<Tool> | undefined;\n\t/** Every installed tool with its extension, in install order. Names may repeat across extensions. */\n\ttools(): readonly { readonly extension: Extension<Tool>; readonly tool: Tool }[];\n\tsections(): readonly { readonly extension: Extension<Tool>; readonly section: PromptSection<Tool> }[];\n\t/** Built-in and installed task definitions. */\n\ttasks(): readonly AnyTask[];\n\ttask(name: string): AnyTask | undefined;\n}\n\n/** Read side of a registry consumed by a Harness. */\nexport interface RegistryReader<Tool extends ToolRegistration = ToolRegistration> {\n\t/** Immutable view of the whole current registry. */\n\tsnapshot(): RegistrySnapshot<Tool>;\n\t/** Called synchronously after every publication; wakes the scheduler to reconsider blocked tasks. */\n\tsubscribe(listener: () => void): () => void;\n}\n\n/** Application-owned registry of extensions. */\nexport interface Registry<Tool extends ToolRegistration = ToolRegistration> extends RegistryReader<Tool> {\n\t/** Install `extension`, or replace the installed extension with its name in place. Publishes at once. */\n\tinstall(extension: Extension<Tool>): void;\n\t/** Remove the installed extension with `extension.name`, whichever object it is. A later install appends. */\n\tuninstall(extension: Extension): void;\n}\n\n/** Stored choices of one conversation; names, not objects. Unset fields follow the host. */\nexport type AgentState = {\n\tmodel?: ModelRef;\n\tthinkingLevel?: ModelThinkingLevel;\n\t/** An array selects exactly these extensions, in order. An object edits the host default selection. */\n\textensions?: string[] | { add?: string[]; remove?: string[] };\n\t/** Filters the selected extensions' tools: the enabled tools. An array enables exactly these, in order. */\n\ttools?: string[] | { remove: string[] };\n\t/**\n\t * Filters the enabled tools the model may call (`callers` includes `model`): the tools offered to it. Never widens:\n\t * other tools can still call the ones it leaves out.\n\t * - Unset: every such tool except deferred ones.\n\t * - An array: exactly these, in order, deferred ones too.\n\t * - An object: every such tool except deferred ones and those in `remove`, in registry order, followed by the\n\t * deferred tools in `add` that are not in `remove`, in `add` order. Names of tools that are not deferred or not\n\t * registered have no effect in `add`.\n\t */\n\tmodelTools?: string[] | { remove?: string[]; add?: string[] };\n\t/** Rendered after every extension section, as the section `instructions`. */\n\tinstructions?: string;\n\t/** Directory within the environment's file system, passed to `HarnessOptions.env`. */\n\tcwd?: string;\n\t/**\n\t * Tool rounds one run takes at most (`diffra.live.run.turns`): the round that reaches it runs its tools, then the run ends\n\t * `unanswered` with `turn_limit`. An integer, `1` or more; unset, no limit. Task-owned children and forks inherit it.\n\t */\n\tmaxTurns?: number;\n\t/**\n\t * This conversation's compaction settings over the harness's, field by field: its `modelOverrides` entry, then the\n\t * harness's, then its own fields, then the harness-wide policy. Its `enabled: false` also beats the harness's model\n\t * override. Task-owned children and forks inherit it.\n\t */\n\tcompaction?: CompactionSettings;\n};\n\n/** A change to `diffra.agent`: a given field replaces the stored one, `null` clears it, `undefined` changes nothing. */\nexport type AgentChange = {\n\treadonly model?: ModelRef | null;\n\treadonly thinkingLevel?: ModelThinkingLevel | null;\n\treadonly extensions?:\n\t\t| readonly Extension[]\n\t\t| { readonly add?: readonly Extension[]; readonly remove?: readonly Extension[] }\n\t\t| null;\n\treadonly tools?: readonly ToolRegistration[] | { readonly remove: readonly ToolRegistration[] } | null;\n\t/** Replaces the stored filter as a whole; tools loaded with `control.addTools` are in its `add`. */\n\treadonly modelTools?:\n\t\t| readonly ToolRegistration[]\n\t\t| { readonly remove?: readonly ToolRegistration[]; readonly add?: readonly ToolRegistration[] }\n\t\t| null;\n\treadonly instructions?: string | null;\n\treadonly cwd?: string | null;\n\t/** `configure()` throws a `RangeError` unless it is an integer `1` or more (or `null`). */\n\treadonly maxTurns?: number | null;\n\t/** Replaces the stored settings as a whole; `configure()` throws a `RangeError` unless every token count is an integer `0` or more. */\n\treadonly compaction?: CompactionSettings | null;\n};\n\n/** A conversation's agent resolved against a registry snapshot and the settings. */\nexport type Agent<Tool extends ToolRegistration = ToolRegistration> = {\n\treadonly model?: ModelRef;\n\treadonly thinkingLevel: ModelThinkingLevel;\n\treadonly extensions: readonly Extension<Tool>[];\n\t/** The tools a request offers, in order: enabled, callable by the model, and selected by `modelTools`. */\n\treadonly tools: readonly Tool[];\n\t/** The tools nested calls (`executeTool()`) resolve among, in order: enabled and callable by tools. */\n\treadonly callable: readonly Tool[];\n\t/** Enabled deferred tools the model may call and is not offered yet, in registry order: what `tool_search` loads. */\n\treadonly deferred: readonly Tool[];\n\t/** Extension sections, then `instructions` when set. */\n\treadonly sections: readonly PromptSection<Tool>[];\n\treadonly instructions?: string;\n\treadonly cwd?: string;\n\t/**\n\t * Tool rounds one run takes at most (`diffra.live.run.turns`): the round that reaches it runs its tools, then the run ends\n\t * `unanswered` with `turn_limit`. An integer, `1` or more; unset, no limit. Task-owned children and forks inherit it.\n\t */\n\treadonly maxTurns?: number;\n\t/** This conversation's compaction settings over the harness's (`AgentState.compaction`). */\n\treadonly compaction?: CompactionSettings;\n};\n\n/**\n * Runs inside the creating commit, after the creation hook and the `agent` change. The conversation creation is already\n * a table write, so table reads here throw `ReadAfterWrite`; document access remains available.\n */\nexport type ConversationInit = (tx: Tx, conversationId: ConversationId) => void | Promise<void>;\n\nexport type ConversationCreateOptions = {\n\treadonly ownership: ConversationOwnership;\n\t/** Applied in the creating commit after the creation hook's copy, before `init`. */\n\treadonly agent?: AgentChange;\n\treadonly init?: ConversationInit;\n};\n\n/** Curated diffra-ai request options; absent fields use diffra-ai defaults. */\nexport type ConversationStreamOptions = {\n\ttransport?: Transport;\n\ttimeoutMs?: number;\n\t/** WebSocket connection/open handshake timeout; stream idleness uses `timeoutMs`. */\n\twebsocketConnectTimeoutMs?: number;\n\t/** Custom token budgets for thinking levels on token-based providers. */\n\tthinkingBudgets?: ThinkingBudgets;\n\t/** Provider/SDK retries inside one request attempt. */\n\tmaxRetries?: number;\n\tmaxRetryDelayMs?: number;\n\theaders?: Record<string, string>;\n\tmetadata?: JsonObject;\n\tcacheRetention?: CacheRetention;\n\tdeferred?: boolean | { window?: \"15m\" | \"1h\" | \"24h\" };\n};\n\n/** Durable generation attempt retries; the JSON shape of diffra-ai `RetryPolicy`. */\nexport type ConversationRetryPolicy = {\n\tenabled: boolean;\n\tmaxRetries: number;\n\tbaseDelayMs: number;\n\tmaxAgentDelayMs?: number;\n};\n\n/** Automatic compaction thresholds (spec §8.7); manual compaction ignores `enabled`. */\nexport type CompactionPolicy = {\n\t/** Threshold and overflow compaction. */\n\tenabled: boolean;\n\t/** Room kept free for the answer: generation blocks to compact above `contextWindow - reserveTokens`. */\n\treserveTokens: number;\n\t/** Approximate size of the recent context a summary keeps verbatim. */\n\tkeepRecentTokens: number;\n\t/** Background compaction starts `backgroundTokens` below the blocking threshold; `0` disables it. */\n\tbackgroundTokens: number;\n};\n\n/**\n * Compaction settings of the harness (`HarnessSettings.compaction`) or of one conversation (`AgentState.compaction`).\n * `modelOverrides` is keyed by exact `\"provider/modelId\"`; each field it sets replaces the general one for that model,\n * so small- and large-window models can share a harness.\n */\nexport type CompactionSettings = Partial<CompactionPolicy> & {\n\treadonly modelOverrides?: Readonly<Record<string, Partial<CompactionPolicy>>>;\n};\n\n/**\n * How often running progress is committed, and how long it may wait in memory before it is stored. Progress commits are\n * deferred (`CommitPersistence`): watches see each at once, and Storage gets them together, at the run's next phase\n * boundary or after `persistWithinMs`. A host can commit less often, so live answers and tool output appear in larger steps.\n */\nexport type ProgressPolicy = {\n\t/** Minimum pause between commits of the answer being generated. */\n\tpartialIntervalMs: number;\n\t/** Minimum pause between commits of running tool output; large commits also pause in proportion to their size. */\n\toutputIntervalMs: number;\n\t/**\n\t * How long these commits, and other deferred commits without their own `withinMs`, may stay in memory before they are\n\t * stored (`CommitPersistence`); a crash loses at most about this much of an answer or of tool output. Default 1,000;\n\t * `Infinity` stores them only at the next commit that reads or writes their document and at close.\n\t */\n\tpersistWithinMs: number;\n};\n\n/** Why a compaction runs: `compact()`, a threshold in generation preparation, or a context overflow. */\nexport type CompactionReason = \"manual\" | \"threshold\" | \"overflow\";\n\n/**\n * `entryId` of a blocking compaction's summary, or the `submissionId` of a conversation-owned compaction's summary\n * write; both absent when nothing was compacted.\n */\nexport type CompactionResult = { entryId?: EntryId; submissionId?: SubmissionId };\n\n/** Harness-wide run policy. Read at every resolution and never copied; getters are fine. Synchronous: some readers run on the Session line. */\nexport type HarnessSettings = {\n\t/** Default extension selection; absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream?: ConversationStreamOptions;\n\treadonly retry?: Partial<ConversationRetryPolicy>;\n\treadonly compaction?: CompactionSettings;\n\treadonly progress?: Partial<ProgressPolicy>;\n\treadonly toolExecution?: ToolExecutionMode;\n\treadonly steeringMode?: QueueMode;\n\treadonly followUpMode?: QueueMode;\n\t/**\n\t * How long an inactive conversation keeps its last context read in memory, so its next run reads only newer entries.\n\t * Inactive: idle, or with all its live work parked (sleeping, waiting, or holding an outcome). Active conversations\n\t * always keep it; `0` drops it once the conversation is inactive.\n\t */\n\treadonly contextRetentionMs?: number;\n\t/**\n\t * How long a loaded document that no watch observes stays in memory after its last read or write;\n\t * the next access loads it from Storage. Observed documents always stay. Default ten minutes; `0` drops one right\n\t * after use; `Infinity` keeps them. Anything else that is not a number of milliseconds means the default.\n\t */\n\treadonly documentRetentionMs?: number;\n\t/**\n\t * What a run that fails (`model_error`, `no_model`, `interrupted`, `restart_limit`, `nothing_to_answer`,\n\t * `turn_limit`) does with the inputs queued behind it: `keep` leaves them queued until the next input or queued write, `continue` starts the\n\t * next run with them, as an answer would, and `withdraw` settles them `unanswered` with reason `run_failed`. Default\n\t * `keep`.\n\t */\n\treadonly afterFailedRun?: AfterFailedRun;\n\t/**\n\t * How many times in a row a task may be cut off by a crash, eviction, or reset (a close does not count) without\n\t * changing its state before it ends instead of running again: a tool call with an error result, a compaction failed\n\t * into `diffra.live.compactionFailure`, a run with `diffra.live.runFailure` reason `restart_limit`, any other task `faulted`\n\t * with detail `{ reason: \"restart_limit\" }`. A generation's request or poll the host died during is a failed attempt\n\t * under `retry` first; the limit bounds it only when charging that attempt keeps being cut off. Default 5;\n\t * `Infinity` never ends a task for it.\n\t */\n\treadonly restartLimit?: number;\n};\n\n/**\n * What a failed run does with the inputs queued behind it (`HarnessSettings.afterFailedRun`): a run that ends with\n * `model_error`, `no_model`, `interrupted`, `restart_limit`, `nothing_to_answer`, or `turn_limit`.\n */\nexport type AfterFailedRun = \"keep\" | \"continue\" | \"withdraw\";\n\n/** Resolved settings: every field over its built-in default, object fields merged. */\nexport type Settings = {\n\t/** Absent: every installed extension, in install order. */\n\treadonly extensions?: readonly Extension[];\n\treadonly stream: ConversationStreamOptions;\n\treadonly retry: ConversationRetryPolicy;\n\t/** Harness-wide policy over the defaults; per-model overrides apply where the model is known. */\n\treadonly compaction: CompactionPolicy & Pick<CompactionSettings, \"modelOverrides\">;\n\treadonly progress: ProgressPolicy;\n\treadonly toolExecution: ToolExecutionMode;\n\treadonly steeringMode: QueueMode;\n\treadonly followUpMode: QueueMode;\n\treadonly contextRetentionMs: number;\n\treadonly documentRetentionMs: number;\n\treadonly afterFailedRun: AfterFailedRun;\n\treadonly restartLimit: number;\n};\n\n/** What `HarnessOptions.env` builds an environment for. */\nexport type EnvTarget = {\n\treadonly conversationId: ConversationId;\n\t/** The conversation's agent `cwd`. */\n\treadonly cwd?: string;\n\treadonly read: DocumentReader;\n};\n\nexport type HarnessOptions<Tool extends ToolRegistration = ToolRegistration> = {\n\t/** Host-owned adapter for content-free admission/phase telemetry; propagation and metrics are optional. */\n\treadonly telemetry?: TelemetryContext;\n\t/**\n\t * diffra-ai model access used by generation, compaction, hooks and tools: a `Models`, or a function returning the current\n\t * one, called at each use, so a host can replace its model configuration without reopening the Harness.\n\t */\n\treadonly models: Models | (() => Models);\n\t/**\n\t * How model requests identify the app to providers, merged field by field over `DEFAULT_HARNESS_IDENTITY`\n\t * (`{ attribution: DIFFRA_ATTRIBUTION }`, provider attribution to diffra). It applies to every request through the Harness's\n\t * models, including hooks and tools, and overrides the identity the `Models` was created with; a request's own\n\t * `identity` overrides it. Pass `{ attribution: null }` to send no attribution headers.\n\t */\n\treadonly identity?: ClientIdentity;\n\treadonly registry: RegistryReader<Tool>;\n\t/** Run settings, or a function returning the current ones; read at each use either way. */\n\treadonly settings?: HarnessSettings | (() => HarnessSettings | undefined);\n\t/** Builds a conversation's environment at each use. Never called on the Session line; may be async. */\n\treadonly env?: (target: EnvTarget, context: Context) => ExecutionEnv | undefined | Promise<ExecutionEnv | undefined>;\n\t/**\n\t * Runs in every commit that creates or forks a conversation, raw `tx.createConversation()` included, after the\n\t * built-in `diffra.*` documents and before the conveniences apply `agent` and run `init`. A fork already has its copies.\n\t * Table reads throw `ReadAfterWrite`, as in `init`; a throw fails the creating commit.\n\t */\n\treadonly conversationCreated?: (tx: Tx, conversation: ConversationRecord) => void | Promise<void>;\n\t/**\n\t * The Harness clock, epoch milliseconds; default `Date.now`. Sleeping tasks store deadlines on it, so every process\n\t * that opens the same storage must use the same clock.\n\t */\n\treadonly now?: () => number;\n\t/**\n\t * Arms the timers of the Session, the scheduler, and its tasks: pacing progress commits, freeing idle memory\n\t * (`background`), and, without `onWake`, resuming sleeping tasks; and the timers of `TaskRuntime.setTimer()`. The\n\t * Node.js environment, file watcher, and image worker keep their own timers. Default `setTimeout`, with background\n\t * timers unreferenced, or declined in Cloudflare Workers and where they cannot be unreferenced. Tests can pass fake\n\t * timers; a host can keep timers off a process that should hibernate.\n\t */\n\treadonly setTimer?: SetTimer;\n\t/**\n\t * Wakes the process for sleeping tasks instead of a `setTimer` timer. Without it, while scheduling runs, a timer that\n\t * keeps the process alive resumes sleeping tasks when they are due. With it, the Harness arms no timer for them: it\n\t * calls `onWake` after open and whenever `Harness.wake()` changes, and the host arms its own wakeup, such as a\n\t * Durable Object alarm, and calls `resume()` when it fires. Called in a microtask the Session line never waits for,\n\t * after the commit that changed the value was adopted, so a host arms a recovery wakeup before calls that can start\n\t * work. It may call `wake()` and `resume()`, and must not block. A throw is reported, and the value is offered again\n\t * at the next change.\n\t */\n\treadonly onWake?: (wake: Wake) => void;\n\t/**\n\t * Receives failures that do not fail the calling operation, such as a throwing hook or listener, a task that faulted,\n\t * and the error that fails the Session, once: one `Report`, the `error` and what happened (`kind` and the fields of\n\t * its `ReportInfo`). A host can tell a failed Session (`storage_failed`, often a platform reset) from a faulted task\n\t * (`task_faulted`). Its own throw or rejection is dropped.\n\t */\n\treadonly onReport?: (report: Report) => void;\n\t/**\n\t * Open for reading only, as a viewer of a session that another process drives, for example a synced copy on a device\n\t * that only shows it. Open recovers nothing: a `running` task stays as committed. Every commit with writes rejects\n\t * with `ReadOnlySession` before it reaches Storage, and so does `resume()` and every call that enables scheduling;\n\t * the Harness stays usable for reads and watches. `wake()` is always inactive, and `onWake` is never called. Reopen\n\t * without it to write.\n\t */\n\treadonly readOnly?: boolean;\n};\n\n/**\n * When a Session next needs a running process (`Harness.wake()`). `active`: some task can run now or is running, or a\n * reconcile pass such as open's recovery has not landed yet, so a process that dies must be woken again soon, for\n * example by a recovery alarm. `at`: the earliest sleep not yet due,\n * when there is one. Neither: nothing needs a process until new work is submitted. Tasks blocked on a missing or\n * unmigratable definition, `completing` tasks, and waits on live tasks do not count; the work they wait for does.\n */\nexport type Wake = { readonly active: boolean; readonly at?: number };\n\n/** Live task and what the scheduler would do with it under the current registry. */\nexport type TaskInspection = {\n\treadonly record: TaskRecord<JsonValue, JsonValue, JsonValue>;\n\treadonly state: /** An invocation is active. */\n\t\t| { readonly kind: \"running\" }\n\t\t/** The next scheduling pass reserves it; `migrates` when its definition is newer and has `migrate`. */\n\t\t| { readonly kind: \"pending\"; readonly migrates: boolean }\n\t\t/**\n\t\t * Waits for these live tasks: the live part of its `on`, or, when abort-marked, its live ordinary owned work, which\n\t\t * must end before its abort handler starts.\n\t\t */\n\t\t| { readonly kind: \"waiting\"; readonly on: readonly TaskId[] }\n\t\t/** Sleeps until the Harness clock reaches `until`, if set, or a signal it sleeps on arrives. */\n\t\t| { readonly kind: \"sleeping\"; readonly until?: number }\n\t\t/** Outcome held until its ordinary owned work drains. */\n\t\t| { readonly kind: \"completing\" }\n\t\t/** Cannot run here: no registered definition can take it (aborting it settles it as `orphaned`). */\n\t\t| {\n\t\t\t\treadonly kind: \"blocked\";\n\t\t\t\treadonly reason: \"missing_task\" | \"task_too_old\" | \"migration_failed\";\n\t\t\t\treadonly error?: unknown;\n\t\t };\n};\n\n/** Point-in-time view of live work: unfinished tasks and submissions, read on the Session line. */\nexport type HarnessInspection = {\n\treadonly scheduling: \"paused\" | \"running\" | \"closing\";\n\treadonly tasks: readonly TaskInspection[];\n\t/** Queued and placed submissions, in ID order. */\n\treadonly submissions: readonly SubmissionRecord[];\n};\n\n/** Raw active transcript and derived model context. */\nexport type ContextView = {\n\t/** Newest applicable head marker, if any. */\n\treadonly head: EntryRecord | undefined;\n\t/** Raw active entries: the head marker followed by non-head entries from its head through the tail. */\n\treadonly entries: readonly EntryRecord[];\n\t/** Per entry of `entries`, its model messages after edits and excluded stop reasons, before tool result ordering. */\n\treadonly contributions: readonly (readonly Message[])[];\n\t/** Model context for the next provider request. */\n\treadonly messages: readonly Message[];\n};\n\n/** Stateless handle for one conversation, bound to the Harness that returned it. Compare handles by `id`. */\nexport interface Conversation {\n\treadonly id: ConversationId;\n\n\t/** Resolved with the current registry snapshot and settings. */\n\tagent(context: Context): Promise<Agent>;\n\t/** `configure()` in its own commit. */\n\tconfigure(change: AgentChange, context: Context): Promise<void>;\n\n\t/**\n\t * Durably admit user input, a passive entry write, or a continue. A busy conversation, or one with queued items,\n\t * queues input and writes that affect model context in `diffra.inbox`; `whenBusy: \"reject\"` rejects input with\n\t * `ConversationBusy` instead and writes nothing. An idle conversation rejects `whenIdle: \"reject\"` input with\n\t * `ConversationIdle` and writes nothing. A write of only `kind` and `data` (no `model`, `head`, or `edits`)\n\t * is appended at once, even mid-run, as it changes nothing the model sees. A continue starts a run on the context as\n\t * it is, after placing queued items; a busy conversation rejects it with `ConversationBusy`, as it never queues.\n\t */\n\tsubmit(submission: SubmissionDraft, context: Context): Promise<Submission>;\n\t/**\n\t * Admit a submission inside the caller's commit `tx` (`Harness.commit()`, `Conversation.commit()`, a task's\n\t * `runtime.commit()`), with the same rules, and return its ID: the admission is stored with that commit, or not at all\n\t * when the callback throws later or the commit fails. Call it before the commit's first table write (`appendEntry()`,\n\t * `createTask()`, `createSubmission()`, another admission): otherwise it throws `ReadAfterWrite`, on every path.\n\t * Documents may be read and written before and after it. A rejection (`ConversationBusy`, `ConversationIdle`) throws\n\t * before any write, so the callback may catch it. Do not call `Submission` or other Harness reads inside the callback:\n\t * they wait for the commit holding the line. Its `diffra.durable.submit` span covers the admission only, so its `result`\n\t * is provisional. Throws for a transaction of another Session.\n\t */\n\tadmit(tx: Tx, submission: SubmissionDraft): Promise<SubmissionId>;\n\t/**\n\t * Admit a write of a `diffra.reset` entry that starts a new context, carrying `handoff` as a user message when given.\n\t * Resolves after admission; while busy, it is placed at the next boundary.\n\t */\n\treset(handoff: string | undefined, context: Context): Promise<void>;\n\t/**\n\t * Admit a manual compaction task and return its ID. It summarizes while the conversation keeps working and places its\n\t * summary through a write submission: at once when idle, otherwise at the next boundary (spec §8.7).\n\t */\n\tcompact(instructions: string | undefined, context: Context): Promise<TaskId<CompactionResult>>;\n\n\t/** Session commit whose `tx.createTask()` defaults to this conversation; `options` as for `Session.commit()`. */\n\tcommit<T>(change: (tx: Tx) => T | Promise<T>, context: Context, options?: CommitOptions): Promise<T>;\n\t/**\n\t * Committed raw active transcript and model context. With `at`, the context as of that visible entry: the same view\n\t * `fork(at)` would start with, without creating a conversation.\n\t */\n\tcontext(context: Context, options?: { readonly at?: EntryId }): Promise<ContextView>;\n\t/** Fork-aware history of this conversation, newest first unless `query.order` is `ascending`. */\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>>;\n\tfork(at: EntryId, options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\t/**\n\t * Withdraw queued inputs (queued writes stay), mark every live non-background task of the ordinary ownership scope,\n\t * signal them, and resolve once the scope is idle. Background subtrees survive unless `background` is set.\n\t */\n\tabort(context: Context, options?: ConversationAbortOptions): Promise<void>;\n\t/**\n\t * Resolve when the ordinary ownership scope has no live non-background task: this conversation and the conversations\n\t * owned, transitively, by its non-background tasks.\n\t */\n\twaitForIdle(context: Context): Promise<void>;\n\t/**\n\t * The structural view (spec §9.3) as a serialized watch; commits made while its listener runs arrive folded. Its\n\t * `entries` are a window over the transcript, as `window` says: the newest 50 by default, then appends, dropping the\n\t * oldest past 100. Built on the same mount as `Harness.observeConversation()`.\n\t */\n\twatch(context: Context, window?: ConversationWindow): Promise<ConversationWatch>;\n}\n\nexport type ConversationWatch = WatchHandle<ConversationView>;\n\n/** Durable agent harness over one Session. */\nexport interface Harness extends Session {\n\t/**\n\t * Enable task scheduling. Idempotent; throws after close, and `ReadOnlySession` on a read-only Harness. Calls that\n\t * ask for progress enable it too: `Conversation.submit()`, `Conversation.compact()`, `Conversation.abort()`,\n\t * `Submission.wait()`, `waitForTask()`, `Harness.waitForIdle()`, and `Conversation.waitForIdle()`. Read-only viewers\n\t * never do.\n\t */\n\tresume(): void;\n\t/**\n\t * When this Session next needs a running process, from the scheduler's memory: `active` while some task can run now\n\t * or is running, `at` for the earliest sleep. Answers also while scheduling is paused. A host that wakes the\n\t * process itself, such as a Durable Object alarm, arms from it and calls `resume()` when woken; see\n\t * `HarnessOptions.onWake`.\n\t */\n\twake(): Wake;\n\n\t/** Return the reserved root conversation, creating it with `agent` and `init` in one commit when absent. */\n\troot(\n\t\tcontext: Context,\n\t\toptions?: { readonly agent?: AgentChange; readonly init?: ConversationInit },\n\t): Promise<Conversation>;\n\tconversation(id: ConversationId, context: Context): Promise<Conversation | undefined>;\n\tcreateConversation(options: ConversationCreateOptions, context: Context): Promise<Conversation>;\n\n\tgetTask<R>(id: TaskId<R>, context: Context): Promise<TaskRecord<JsonValue, JsonValue, R> | undefined>;\n\t/** Live tasks and unsettled submissions. Writes nothing and runs no task code. */\n\tinspect(context: Context): Promise<HarnessInspection>;\n\t/** Reacquire a submission, for example after reopen. */\n\tsubmission(id: SubmissionId, context: Context): Promise<Submission | undefined>;\n\t/** `not_found` for an unknown submission or one of another conversation than `conversationId`. */\n\tabortSubmission(\n\t\tid: SubmissionId,\n\t\tcontext: Context,\n\t\tconversationId?: ConversationId,\n\t): Promise<\"aborted\" | \"already_placed\" | \"settled\" | \"not_found\">;\n\t/**\n\t * Commit the abort mark, signal and join an active run invocation, and schedule the abort invocation. A task whose\n\t * definition cannot take it settles as `orphaned` instead.\n\t */\n\tabortTask(id: TaskId, context: Context): Promise<\"marked\" | \"terminal\">;\n\t/**\n\t * `tx.signal()` in a commit of its own: deliver `value` to task `taskId` under `key`. Enables scheduling, so a host\n\t * arms its recovery wakeup first, as before `submit()`. Checks nothing about the caller.\n\t */\n\tsignal<T>(taskId: TaskId, token: SignalToken<T>, key: string, value: T, context: Context): Promise<SignalResult>;\n\t/** Resolve with the terminal receipt; cancelling `context` cancels only this wait. */\n\twaitForTask<R>(id: TaskId<R>, context: Context): Promise<SettledTask<R>>;\n\t/** Resolve when the ordinary ownership scope of every ownerless conversation has no live non-background task. */\n\twaitForIdle(context: Context): Promise<void>;\n\t/** Session total: every conversation's `diffra.usage` summed. */\n\tusage(context: Context): Promise<UsageState>;\n\t/**\n\t * Every live task with its owner edge, status, and owned conversations (spec §9.4), as a serialized watch; commits\n\t * made while its listener runs arrive folded.\n\t */\n\twatchTaskGraph(context: Context): Promise<TaskGraphWatch>;\n\t/**\n\t * Attach a synchronous `Observer` to a conversation's structural view (spec §9.3), atomically on the Session line,\n\t * for adapters: `advance` gets each next revision with its operations as memory adopts the commit, inside Storage's\n\t * `adopt` for a stored one and before it is stored for a deferred one, so it only records it. `window` as for\n\t * `Conversation.watch()`; each observer has its own. `context` governs only the attachment.\n\t */\n\tobserveConversation(\n\t\tid: ConversationId,\n\t\tobserver: Observer<ConversationView>,\n\t\tcontext: Context,\n\t\twindow?: ConversationWindow,\n\t): Promise<Observation<ConversationView>>;\n\t/**\n\t * Attach a synchronous `Observer` to the task graph (spec §9.4), as `observeConversation()` does to a view. A\n\t * `blocked` reason that changes without a commit (a registry change, a failed migration) advances it on the Session\n\t * line outside any commit and `adopt`, with the background context.\n\t */\n\tobserveTaskGraph(observer: Observer<TaskGraph>, context: Context): Promise<Observation<TaskGraph>>;\n}\n\n/**\n * What a hook may use: committed reads and the asking task's memos, which hooks and the task share. Hooks run off the\n * Session line, so reads see what is committed when they run; a hook rerun after a crash may see more.\n */\nexport interface HookApi extends DocumentReader {\n\treadonly taskId: TaskId;\n\treadonly conversationId: ConversationId;\n\t/** The current `HarnessOptions.models`, read at each access. */\n\treadonly models: Models;\n\tmemo<T extends JsonValue>(name: string, context: Context): Promise<T | undefined>;\n\tmemo<T extends JsonValue>(name: string, candidate: T, context: Context): Promise<T>;\n\t/** A signal key's committed state in the asking task, as `TaskRuntime.readSignal()`. */\n\treadSignal<T>(token: SignalToken<T>, key: string, context: Context): Promise<SignalState<T> | undefined>;\n\t/** The Harness clock. */\n\tnow(): number;\n\t/** Committed entry visible from the task's conversation, as `TaskRuntime.entry()`. */\n\tentry(id: EntryId, context: Context): Promise<EntryRecord | undefined>;\n\t/** Undefined when the entry is absent, not visible, or has another kind. */\n\tentry<D extends JsonValue>(token: Entry<D>, id: EntryId, context: Context): Promise<TypedEntry<D> | undefined>;\n\t/** Committed raw history of the task's conversation, as `TaskRuntime.entries()`. */\n\tentries(\n\t\tquery: Omit<EntryQuery, \"conversationId\">,\n\t\tlimit: number,\n\t\tcursor: Cursor | undefined,\n\t\tcontext: Context,\n\t): Promise<Page<EntryRecord, Cursor>>;\n}\n\nexport type HookResult<T> = T | undefined | Promise<T | undefined>;\n\n/** Hooks of the built-in generation task. */\nexport interface GenerationHooks {\n\t/** Before every request attempt, including recovery; the result is used for that request only. */\n\tbeforeRequest(\n\t\trequest: { readonly messages: readonly Message[] },\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly messages: readonly Message[] }>;\n\t/**\n\t * After diffra-ai builds the provider request body, before it is sent; the result replaces the body for that request only.\n\t * Runs again whenever diffra-ai rebuilds the body, such as a retry within one attempt. The body is in the provider API's\n\t * own format (`request.model.api`), so a hook checks the API before changing it.\n\t */\n\tbeforeProviderRequest(\n\t\trequest: { readonly model: Model<Api>; readonly payload: unknown },\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly payload: unknown }>;\n\t/** Every terminal provider message, before classification. */\n\tafterResponse(message: AssistantMessage, api: HookApi, context: Context): void | Promise<void>;\n\t/**\n\t * A final answer; the first result wins. Kind `continue` appends a user message and continues the run. `tasks` decide\n\t * whether the answer stands (spec suspendable §6): the answer is appended, the run's inputs stay open\n\t * (`LiveRun.yield`), the tasks run as the generation's children, and the first in creation order that completes with\n\t * a `YieldDecision` holding `continue` provides the continuation; without one the run ends with the answer.\n\t */\n\tonYield(\n\t\tanswer: AssistantMessage,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<\n\t\t| { readonly kind: \"continue\"; readonly continue: UserInput }\n\t\t| { readonly kind: \"tasks\"; readonly tasks: readonly HookTask[] }\n\t>;\n\t/**\n\t * After every tool of the round is terminal; `results` are the round's result entries in call order. Requested tasks\n\t * of every hook, concatenated in extension order, run as the generation's children before the round ends; one that\n\t * completes with `{ terminate: true }` (`AfterToolsDecision`) ends the run as a round whose calls all asked to\n\t * terminate. A task answers the run otherwise by submitting a steer in its terminal commit.\n\t */\n\tafterTools(\n\t\tassistant: EntryId,\n\t\tresults: readonly EntryId[],\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly tasks: readonly HookTask[] }>;\n\t/**\n\t * After a run answered, its answer committed and its inputs settled `done`: a final answer, or a `terminate` round;\n\t * not when an `onYield` continuation is taken, and never after a failure or an abort. The requested tasks of every\n\t * hook are created together as children of the generation, which keeps the run, and the conversation busy, until\n\t * they are terminal; then queued items are placed and the run ends (spec §8.3). A crash before they are created asks\n\t * again; once created, never again for this run.\n\t */\n\tafterRun(run: RunSummary, api: HookApi, context: Context): HookResult<{ readonly tasks: readonly HookTask[] }>;\n}\n\n/** How a run ended, for `afterRun` hooks. Read the run's history with `api.entries({ minEntryId: first, maxEntryId: last })`. */\nexport type RunSummary = {\n\t/** A final answer, or a tool round whose every call asked to `terminate`. */\n\treadonly reason: \"answer\" | \"terminate\";\n\t/**\n\t * The run's first entry (`LiveRun.first`): the first one the boundary that started it placed, for a continue the failed\n\t * run's it continues, otherwise its first tool-calling answer; the answer itself for a run that has none of these.\n\t */\n\treadonly first: EntryId;\n\t/** The answer, or the terminating round's tool-calling answer, whose results follow it. */\n\treadonly answer: EntryId;\n\t/** The run's last entry: the answer; for a `terminate` round its newest result, or the reset of its handoff. */\n\treadonly last: EntryId;\n};\n\n/** A task a hook (`afterTools`, `onYield`, `afterRun`) asks for, built by `hookTask()`. */\nexport type HookTask = { readonly task: AnyTask; readonly input: JsonValue };\n\n/** What an `onYield` task completes with to continue the run instead of letting its answer stand. */\nexport type YieldDecision = { readonly continue?: UserInput };\n\n/** What an `afterTools` task completes with to end the run after this round. */\nexport type AfterToolsDecision = { readonly terminate?: true };\n\n/** A call as tool hooks see it; `parent` is set for a nested call, one a running tool made through `executeTool()`. */\nexport type ToolHookCall = ToolCall & {\n\treadonly parent?: { readonly taskId: TaskId; readonly callId: string };\n};\n\n/** What a `beforeTool` hook sleeps for: a deadline, signals, or both. */\nexport type GateSleep = { readonly until?: number; readonly signals?: readonly SignalKey<unknown>[] };\n\n/** Hooks of the built-in tool task, for model-issued and nested calls. */\nexport interface ToolHooks {\n\t/**\n\t * Before intent; `arguments` replace the call's arguments, and the first `block` or `sleep` stops the chain. A throw\n\t * blocks. A `sleep` parks the call before it runs (spec suspendable §5): every wake, and every registry change, runs\n\t * the whole `call` phase again, so a gate reads the key it waited on with `api.readSignal()` and passes, blocks, or\n\t * sleeps on a new key. A sleep that breaks a rule ends the call `invalid_park`.\n\t */\n\tbeforeTool(\n\t\tcall: ToolHookCall,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{\n\t\treadonly arguments?: JsonObject;\n\t\treadonly block?: string;\n\t\treadonly sleep?: GateSleep;\n\t}>;\n\t/**\n\t * Before the result is committed; replaces the result. Runs on every result the tool task writes: an executed\n\t * call's, and the error results the Harness writes itself, told apart by their diagnostic code: a tool that does not\n\t * resolve (`tool_unavailable`), invalid arguments (`invalid_arguments`, with `call.arguments` as the model sent\n\t * them), a block (`blocked`), and, rebuilt from the call's partial output, an interruption (`interrupted`), the\n\t * restart limit (`restart_limit`), and an abort (`aborted`, `abandoned`). Once the task was cut off more than\n\t * `settings.restartLimit` times the hooks no longer run, since they may be what cuts it off, nor in the last attempt\n\t * the scheduler gives an abort handler (restarts at the limit minus one). A result's `structuredOutput` is dropped\n\t * when the Harness wrote it (a nested call a hook turns into a success gets the bounded output as a schema-less tool's\n\t * does), and its `control` applies only to a call that completes (not to an interrupted, cut-off, or aborted one).\n\t * An abort's hooks run inside the abort handler, which cannot be aborted: a slow hook delays `Conversation.abort()`.\n\t */\n\tafterTool(\n\t\tcall: ToolHookCall,\n\t\tresult: ToolExecutionResult,\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<ToolExecutionResult>;\n}\n\n/** Hooks of the built-in compaction task. */\nexport interface CompactionHooks {\n\t/**\n\t * After range selection, before summarizing; the first decision wins. `entries` are the active entries the summary\n\t * replaces, the head marker first, and `messages` their model context, the summarizer's source; `firstKept` is the\n\t * first entry kept verbatim.\n\t */\n\tbeforeCompact(\n\t\tcompaction: {\n\t\t\treadonly reason: CompactionReason;\n\t\t\treadonly entries: readonly EntryRecord[];\n\t\t\treadonly messages: readonly Message[];\n\t\t\treadonly firstKept: EntryId;\n\t\t\treadonly instructions?: string;\n\t\t},\n\t\tapi: HookApi,\n\t\tcontext: Context,\n\t): HookResult<{ readonly kind: \"decline\" } | { readonly kind: \"summary\"; readonly summary: string }>;\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import type { Usage } from "@diffra-ai/ai";
2
+ import type { Draft } from "@diffra-ai/chord/delta";
3
+ import { type JsonRepresentation } from "@diffra-ai/chord/json";
4
+ import type { ConversationId, Tx } from "../types.ts";
5
+ /** Ledger of one conversation's own spend: its entries, and compaction summarization attempts, which have none. */
6
+ export type UsageState = {
7
+ /** Assistant entries and summarization attempts, keyed `provider/modelId`. */
8
+ models: Record<string, JsonRepresentation<Usage>>;
9
+ /** Tool results, keyed by tool name; their usage has no model identity. */
10
+ tools: Record<string, JsonRepresentation<Usage>>;
11
+ };
12
+ export declare const UsageDoc: import("../types.ts").ConversationDocToken<UsageState>;
13
+ /** Add `usage` to one bucket of the conversation's `diffra.usage`, in the commit that records the response. */
14
+ export declare function recordUsage(tx: Tx, conversationId: ConversationId, bucket: keyof UsageState, key: string, usage: Usage): Promise<void>;
15
+ /** Add every counter of `usage` to `total`; optional counters are added once either side reports them. */
16
+ export declare function addUsage(total: Draft<Usage> | Usage, usage: Usage): void;
17
+ /** Add every bucket of `state` into `sum`. */
18
+ export declare function addUsageState(sum: UsageState, state: Readonly<UsageState>): void;
19
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/harness/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAY,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtD,mHAAmH;AACnH,MAAM,MAAM,UAAU,GAAG;IACxB,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,QAAQ,wDAQnB,CAAC;AAEH,+GAA+G;AAC/G,wBAAsB,WAAW,CAChC,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,UAAU,EACxB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,GACV,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,0GAA0G;AAC1G,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAaxE;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAchF"}
@@ -0,0 +1,57 @@
1
+ import { copyJson } from "@diffra-ai/chord/json";
2
+ import { defineDoc } from "../documents.js";
3
+ export const UsageDoc = defineDoc({
4
+ kind: "diffra.usage",
5
+ version: 1,
6
+ scope: "conversation",
7
+ history: "latest",
8
+ fork: "initial",
9
+ initial: () => ({ models: {}, tools: {} }),
10
+ checkpointWhen: () => true,
11
+ });
12
+ /** Add `usage` to one bucket of the conversation's `diffra.usage`, in the commit that records the response. */
13
+ export async function recordUsage(tx, conversationId, bucket, key, usage) {
14
+ const totals = (await tx.doc(UsageDoc, conversationId))[bucket];
15
+ // Own keys only: a tool may be called `toString`.
16
+ const total = Object.hasOwn(totals, key) ? totals[key] : undefined;
17
+ // Providers may leave optional counters `undefined`; drafts take strict JSON.
18
+ if (total === undefined)
19
+ totals[key] = copyJson(usage, { omitUndefinedProperties: true });
20
+ else
21
+ addUsage(total, usage);
22
+ }
23
+ /** Add every counter of `usage` to `total`; optional counters are added once either side reports them. */
24
+ export function addUsage(total, usage) {
25
+ total.input += usage.input;
26
+ total.output += usage.output;
27
+ total.cacheRead += usage.cacheRead;
28
+ total.cacheWrite += usage.cacheWrite;
29
+ total.totalTokens += usage.totalTokens;
30
+ if (usage.cacheWrite1h !== undefined)
31
+ total.cacheWrite1h = (total.cacheWrite1h ?? 0) + usage.cacheWrite1h;
32
+ if (usage.reasoning !== undefined)
33
+ total.reasoning = (total.reasoning ?? 0) + usage.reasoning;
34
+ total.cost.input += usage.cost.input;
35
+ total.cost.output += usage.cost.output;
36
+ total.cost.cacheRead += usage.cost.cacheRead;
37
+ total.cost.cacheWrite += usage.cost.cacheWrite;
38
+ total.cost.total += usage.cost.total;
39
+ }
40
+ /** Add every bucket of `state` into `sum`. */
41
+ export function addUsageState(sum, state) {
42
+ for (const bucket of ["models", "tools"]) {
43
+ for (const [key, usage] of Object.entries(state[bucket])) {
44
+ const total = Object.hasOwn(sum[bucket], key) ? sum[bucket][key] : undefined;
45
+ // Define rather than assign: assigning a tool named `__proto__` would set the prototype.
46
+ if (total !== undefined)
47
+ addUsage(total, usage);
48
+ else
49
+ Object.defineProperty(sum[bucket], key, {
50
+ value: structuredClone(usage),
51
+ enumerable: true,
52
+ writable: true,
53
+ });
54
+ }
55
+ }
56
+ }
57
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/harness/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAA2B,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAa;IAC7C,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC1C,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI;CAC1B,CAAC,CAAC;AAEH,+GAA+G;AAC/G,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,EAAM,EACN,cAA8B,EAC9B,MAAwB,EACxB,GAAW,EACX,KAAY;IAEZ,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAChE,kDAAkD;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,8EAA8E;IAC9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;AAED,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAAC,GAAe,EAAE,KAA2B;IACzE,KAAK,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAU,EAAE,CAAC;QACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC7E,yFAAyF;YACzF,IAAI,KAAK,KAAK,SAAS;gBAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;;gBAE/C,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE;oBACvC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC;oBAC7B,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,IAAI;iBACd,CAAC,CAAC;QACL,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { Usage } from \"@diffra-ai/ai\";\nimport type { Draft } from \"@diffra-ai/chord/delta\";\nimport { copyJson, type JsonRepresentation } from \"@diffra-ai/chord/json\";\nimport { defineDoc } from \"../documents.ts\";\nimport type { ConversationId, Tx } from \"../types.ts\";\n\n/** Ledger of one conversation's own spend: its entries, and compaction summarization attempts, which have none. */\nexport type UsageState = {\n\t/** Assistant entries and summarization attempts, keyed `provider/modelId`. */\n\tmodels: Record<string, JsonRepresentation<Usage>>;\n\t/** Tool results, keyed by tool name; their usage has no model identity. */\n\ttools: Record<string, JsonRepresentation<Usage>>;\n};\n\nexport const UsageDoc = defineDoc<UsageState>({\n\tkind: \"diffra.usage\",\n\tversion: 1,\n\tscope: \"conversation\",\n\thistory: \"latest\",\n\tfork: \"initial\",\n\tinitial: () => ({ models: {}, tools: {} }),\n\tcheckpointWhen: () => true,\n});\n\n/** Add `usage` to one bucket of the conversation's `diffra.usage`, in the commit that records the response. */\nexport async function recordUsage(\n\ttx: Tx,\n\tconversationId: ConversationId,\n\tbucket: keyof UsageState,\n\tkey: string,\n\tusage: Usage,\n): Promise<void> {\n\tconst totals = (await tx.doc(UsageDoc, conversationId))[bucket];\n\t// Own keys only: a tool may be called `toString`.\n\tconst total = Object.hasOwn(totals, key) ? totals[key] : undefined;\n\t// Providers may leave optional counters `undefined`; drafts take strict JSON.\n\tif (total === undefined)\n\t\ttotals[key] = copyJson(usage, { omitUndefinedProperties: true }) as JsonRepresentation<Usage>;\n\telse addUsage(total, usage);\n}\n\n/** Add every counter of `usage` to `total`; optional counters are added once either side reports them. */\nexport function addUsage(total: Draft<Usage> | Usage, usage: Usage): void {\n\ttotal.input += usage.input;\n\ttotal.output += usage.output;\n\ttotal.cacheRead += usage.cacheRead;\n\ttotal.cacheWrite += usage.cacheWrite;\n\ttotal.totalTokens += usage.totalTokens;\n\tif (usage.cacheWrite1h !== undefined) total.cacheWrite1h = (total.cacheWrite1h ?? 0) + usage.cacheWrite1h;\n\tif (usage.reasoning !== undefined) total.reasoning = (total.reasoning ?? 0) + usage.reasoning;\n\ttotal.cost.input += usage.cost.input;\n\ttotal.cost.output += usage.cost.output;\n\ttotal.cost.cacheRead += usage.cost.cacheRead;\n\ttotal.cost.cacheWrite += usage.cost.cacheWrite;\n\ttotal.cost.total += usage.cost.total;\n}\n\n/** Add every bucket of `state` into `sum`. */\nexport function addUsageState(sum: UsageState, state: Readonly<UsageState>): void {\n\tfor (const bucket of [\"models\", \"tools\"] as const) {\n\t\tfor (const [key, usage] of Object.entries(state[bucket])) {\n\t\t\tconst total = Object.hasOwn(sum[bucket], key) ? sum[bucket][key] : undefined;\n\t\t\t// Define rather than assign: assigning a tool named `__proto__` would set the prototype.\n\t\t\tif (total !== undefined) addUsage(total, usage);\n\t\t\telse\n\t\t\t\tObject.defineProperty(sum[bucket], key, {\n\t\t\t\t\tvalue: structuredClone(usage),\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t});\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { Context } from "@diffra-ai/chord/context";
2
+ import type { ConversationId, Cursor, EntryQuery, Page } from "../types.ts";
3
+ /** Pending waits by key. Each settles once: through `resolve`, `rejectAll`, or cancellation of its context. */
4
+ export declare class Waiters<K, T> {
5
+ #private;
6
+ add(key: K, context: Context): Promise<T>;
7
+ keys(): K[];
8
+ resolve(key: K, value: T): void;
9
+ rejectAll(error: unknown): void;
10
+ }
11
+ /** Every item of a paginated scan, in page order. */
12
+ export declare function scanAll<T>(scan: (cursor: Cursor | undefined) => Promise<Page<T, Cursor>>): Promise<T[]>;
13
+ /** What a closed Harness rejects with: `SessionFailed` with the cause when it closed because the Session failed. */
14
+ export declare function closedError(session: {
15
+ readonly failure: {
16
+ readonly error: unknown;
17
+ } | undefined;
18
+ }): Error;
19
+ /** `{ extension }` when the extension is known. */
20
+ export declare function optionalExtension(extension: string | undefined): {
21
+ readonly extension?: string;
22
+ };
23
+ /** The scan of conversation `conversationId`'s history that `query` asks for, without fields an untyped caller added. */
24
+ export declare function conversationEntries(conversationId: ConversationId, query: Omit<EntryQuery, "conversationId">): EntryQuery;
25
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/harness/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE5E,+GAA+G;AAC/G,qBAAa,OAAO,CAAC,CAAC,EAAE,CAAC;;IAGxB,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAuBxC;IAED,IAAI,IAAI,CAAC,EAAE,CAEV;IAED,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAI9B;IAED,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAI9B;CACD;AAED,qDAAqD;AACrD,wBAAsB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAS7G;AAED,oHAAoH;AACpH,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,CAGzG;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAEhG;AAED,yHAAyH;AACzH,wBAAgB,mBAAmB,CAClC,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,GACvC,UAAU,CAOZ"}
@@ -0,0 +1,76 @@
1
+ import { SessionFailed } from "../errors.js";
2
+ /** Pending waits by key. Each settles once: through `resolve`, `rejectAll`, or cancellation of its context. */
3
+ export class Waiters {
4
+ #sets = new Map();
5
+ add(key, context) {
6
+ const signal = context.abortSignal;
7
+ const waiter = Promise.withResolvers();
8
+ // Callers may hand the promise out only after later awaits (a job's result on the line): handled now, so a
9
+ // rejection before then is not reported unhandled. The caller still gets it.
10
+ waiter.promise.catch(() => { });
11
+ if (signal?.aborted) {
12
+ waiter.reject(signal.reason);
13
+ return waiter.promise;
14
+ }
15
+ const set = this.#sets.get(key) ?? new Set();
16
+ this.#sets.set(key, set.add(waiter));
17
+ if (signal !== undefined) {
18
+ const onAbort = () => {
19
+ set.delete(waiter);
20
+ if (set.size === 0 && this.#sets.get(key) === set)
21
+ this.#sets.delete(key);
22
+ waiter.reject(signal.reason);
23
+ };
24
+ signal.addEventListener("abort", onAbort, { once: true });
25
+ const detach = () => signal.removeEventListener("abort", onAbort);
26
+ waiter.promise.then(detach, detach);
27
+ }
28
+ return waiter.promise;
29
+ }
30
+ keys() {
31
+ return [...this.#sets.keys()];
32
+ }
33
+ resolve(key, value) {
34
+ const set = this.#sets.get(key);
35
+ this.#sets.delete(key);
36
+ for (const waiter of set ?? [])
37
+ waiter.resolve(value);
38
+ }
39
+ rejectAll(error) {
40
+ const sets = [...this.#sets.values()];
41
+ this.#sets.clear();
42
+ for (const set of sets)
43
+ for (const waiter of set)
44
+ waiter.reject(error);
45
+ }
46
+ }
47
+ /** Every item of a paginated scan, in page order. */
48
+ export async function scanAll(scan) {
49
+ const items = [];
50
+ let cursor;
51
+ do {
52
+ const page = await scan(cursor);
53
+ items.push(...page.items);
54
+ cursor = page.next;
55
+ } while (cursor !== undefined);
56
+ return items;
57
+ }
58
+ /** What a closed Harness rejects with: `SessionFailed` with the cause when it closed because the Session failed. */
59
+ export function closedError(session) {
60
+ const failure = session.failure;
61
+ return failure === undefined ? new Error("Harness is closed") : new SessionFailed(failure.error);
62
+ }
63
+ /** `{ extension }` when the extension is known. */
64
+ export function optionalExtension(extension) {
65
+ return extension === undefined ? {} : { extension };
66
+ }
67
+ /** The scan of conversation `conversationId`'s history that `query` asks for, without fields an untyped caller added. */
68
+ export function conversationEntries(conversationId, query) {
69
+ return {
70
+ conversationId,
71
+ ...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),
72
+ ...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),
73
+ ...(query.order === undefined ? {} : { order: query.order }),
74
+ };
75
+ }
76
+ //# source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I,CAAC,KAAK,CAAC,CAAC;QAC1B,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAE;IAC/B,OAAO,KAAK,CAAC;AACd,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,WAAW,CAAC,OAAsE;IACjG,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAClG,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,iBAAiB,CAAC,SAA6B;IAC9D,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;AACrD,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,mBAAmB,CAClC,cAA8B,EAC9B,KAAyC;IAEzC,OAAO;QACN,cAAc;QACd,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC3E,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC3E,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;KAC5D,CAAC;AACH,CAAC","sourcesContent":["import type { Context } from \"@diffra-ai/chord/context\";\nimport { SessionFailed } from \"../errors.ts\";\nimport type { ConversationId, Cursor, EntryQuery, Page } from \"../types.ts\";\n\n/** Pending waits by key. Each settles once: through `resolve`, `rejectAll`, or cancellation of its context. */\nexport class Waiters<K, T> {\n\treadonly #sets = new Map<K, Set<PromiseWithResolvers<T>>>();\n\n\tadd(key: K, context: Context): Promise<T> {\n\t\tconst signal = context.abortSignal;\n\t\tconst waiter = Promise.withResolvers<T>();\n\t\t// Callers may hand the promise out only after later awaits (a job's result on the line): handled now, so a\n\t\t// rejection before then is not reported unhandled. The caller still gets it.\n\t\twaiter.promise.catch(() => {});\n\t\tif (signal?.aborted) {\n\t\t\twaiter.reject(signal.reason);\n\t\t\treturn waiter.promise;\n\t\t}\n\t\tconst set = this.#sets.get(key) ?? new Set();\n\t\tthis.#sets.set(key, set.add(waiter));\n\t\tif (signal !== undefined) {\n\t\t\tconst onAbort = (): void => {\n\t\t\t\tset.delete(waiter);\n\t\t\t\tif (set.size === 0 && this.#sets.get(key) === set) this.#sets.delete(key);\n\t\t\t\twaiter.reject(signal.reason);\n\t\t\t};\n\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\tconst detach = (): void => signal.removeEventListener(\"abort\", onAbort);\n\t\t\twaiter.promise.then(detach, detach);\n\t\t}\n\t\treturn waiter.promise;\n\t}\n\n\tkeys(): K[] {\n\t\treturn [...this.#sets.keys()];\n\t}\n\n\tresolve(key: K, value: T): void {\n\t\tconst set = this.#sets.get(key);\n\t\tthis.#sets.delete(key);\n\t\tfor (const waiter of set ?? []) waiter.resolve(value);\n\t}\n\n\trejectAll(error: unknown): void {\n\t\tconst sets = [...this.#sets.values()];\n\t\tthis.#sets.clear();\n\t\tfor (const set of sets) for (const waiter of set) waiter.reject(error);\n\t}\n}\n\n/** Every item of a paginated scan, in page order. */\nexport async function scanAll<T>(scan: (cursor: Cursor | undefined) => Promise<Page<T, Cursor>>): Promise<T[]> {\n\tconst items: T[] = [];\n\tlet cursor: Cursor | undefined;\n\tdo {\n\t\tconst page = await scan(cursor);\n\t\titems.push(...page.items);\n\t\tcursor = page.next;\n\t} while (cursor !== undefined);\n\treturn items;\n}\n\n/** What a closed Harness rejects with: `SessionFailed` with the cause when it closed because the Session failed. */\nexport function closedError(session: { readonly failure: { readonly error: unknown } | undefined }): Error {\n\tconst failure = session.failure;\n\treturn failure === undefined ? new Error(\"Harness is closed\") : new SessionFailed(failure.error);\n}\n\n/** `{ extension }` when the extension is known. */\nexport function optionalExtension(extension: string | undefined): { readonly extension?: string } {\n\treturn extension === undefined ? {} : { extension };\n}\n\n/** The scan of conversation `conversationId`'s history that `query` asks for, without fields an untyped caller added. */\nexport function conversationEntries(\n\tconversationId: ConversationId,\n\tquery: Omit<EntryQuery, \"conversationId\">,\n): EntryQuery {\n\treturn {\n\t\tconversationId,\n\t\t...(query.minEntryId === undefined ? {} : { minEntryId: query.minEntryId }),\n\t\t...(query.maxEntryId === undefined ? {} : { maxEntryId: query.maxEntryId }),\n\t\t...(query.order === undefined ? {} : { order: query.order }),\n\t};\n}\n"]}
@@ -0,0 +1,69 @@
1
+ import { type Context } from "@diffra-ai/chord/context";
2
+ import { type WatchCall, type WatchEnd, type WatchHandle } from "@diffra-ai/chord/watch";
3
+ import { type SessionImpl } from "../session/session.ts";
4
+ import type { ConversationId, ConversationRecord, EntryId, EntryRecord, JsonObject, Observation, Observer } from "../types.ts";
5
+ /** Structural view of one conversation: a window over its transcript and its built-in documents (spec §9.3). */
6
+ export type ConversationView = {
7
+ readonly conversation: ConversationRecord;
8
+ /**
9
+ * A window over the transcript, its fork-aware history (`Conversation.entries()`), in entry ID order. Head markers
10
+ * such as compaction summaries sit where they were written; their `head` tells where the entries they summarize end.
11
+ */
12
+ readonly entries: readonly EntryRecord[];
13
+ /** ID of the entry just before the window; absent when the window starts the transcript. */
14
+ readonly before?: EntryId;
15
+ /** Built-in conversation documents keyed by kind; absent documents are absent. */
16
+ readonly docs: Readonly<Record<string, JsonObject>>;
17
+ };
18
+ /**
19
+ * Which entries a view's window holds (spec §9.3). The window holds between `min` and `max` entries: it starts with
20
+ * the newest `min` entries, takes appends, and once it would hold more than `max`, drops its oldest in one splice down
21
+ * to `min`. With `from`, it starts at `from` instead when at most `max` entries are at or after it.
22
+ */
23
+ export type ConversationWindow = {
24
+ /**
25
+ * Where the first value's window starts, inclusive, such as right after the newest entry a client has
26
+ * (`ConversationTranscript.resume`). It selects only that first value: every entry committed after the attachment is
27
+ * appended, whatever its ID. A `from` past the newest entry starts the window empty, with `before` the newest entry.
28
+ */
29
+ readonly from?: EntryId;
30
+ /** Default 50; an integer, at least 1. */
31
+ readonly min?: number;
32
+ /** Default `2 * min`; an integer, at least `min`. */
33
+ readonly max?: number;
34
+ };
35
+ /** Receives each next revision of one observer's window, and the Session's close. */
36
+ export type ViewObserver = {
37
+ advance(call: WatchCall<ConversationView>, context: Context): void;
38
+ /** The Session closed (`ended`), or failed (`failed`). */
39
+ end(end: WatchEnd): void;
40
+ };
41
+ /** The view mounts of a Harness, for adapters built on them. */
42
+ export declare function conversationViews(harness: object): ConversationViews;
43
+ /**
44
+ * The Harness's conversation view mounts: at most one per conversation, built on the Session line by its first
45
+ * observer and dropped with its last. Each mount advances from the Session's commits as memory adopts them, deferred ones
46
+ * (`CommitPersistence`) before they are stored, and hands each observer the next revision of its own window.
47
+ */
48
+ export declare class ConversationViews {
49
+ #private;
50
+ constructor(session: SessionImpl);
51
+ /** Report an observer's listener error through the Harness. */
52
+ report(error: unknown): void;
53
+ /**
54
+ * Attach a synchronous observer of the view (`Harness.observeConversation()`), behind `guardObserver()`; `context`
55
+ * governs only the attachment.
56
+ */
57
+ observe(id: ConversationId, observer: Observer<ConversationView>, context: Context, window?: ConversationWindow): Promise<Observation<ConversationView>>;
58
+ /** A serialized watch of the view, an observer of its mount; aborting `context` ends it `aborted`. */
59
+ watch(id: ConversationId, context: Context, window?: ConversationWindow): Promise<WatchHandle<ConversationView>>;
60
+ /**
61
+ * Register an observer created from its window's first revision, atomically on the Session line: it sees every later
62
+ * publication and nothing earlier. `release` drops it, and the mount with its last observer.
63
+ */
64
+ attach<O extends ViewObserver>(id: ConversationId, window: ConversationWindow | undefined, create: (value: ConversationView, release: () => void) => O, context: Context): Promise<{
65
+ observer: O;
66
+ detach: () => void;
67
+ }>;
68
+ }
69
+ //# sourceMappingURL=view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/harness/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,0BAA0B,CAAC;AAG5E,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAON,KAAK,WAAW,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEX,cAAc,EACd,kBAAkB,EAGlB,OAAO,EAEP,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EAER,MAAM,aAAa,CAAC;AAQrB,gHAAgH;AAChH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAKF,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG;IAC1B,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,g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