@mostra/protocol 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +38 -2
  3. package/dist/actions.d.ts +273 -0
  4. package/dist/actions.d.ts.map +1 -0
  5. package/dist/actions.js +154 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/artifact.d.ts +113 -0
  8. package/dist/artifact.d.ts.map +1 -0
  9. package/dist/artifact.js +79 -0
  10. package/dist/artifact.js.map +1 -0
  11. package/dist/bridge.d.ts +295 -0
  12. package/dist/bridge.d.ts.map +1 -0
  13. package/dist/bridge.js +343 -0
  14. package/dist/bridge.js.map +1 -0
  15. package/dist/browser.d.ts +195 -0
  16. package/dist/browser.d.ts.map +1 -0
  17. package/dist/browser.js +156 -0
  18. package/dist/browser.js.map +1 -0
  19. package/dist/bundle.d.ts +155 -0
  20. package/dist/bundle.d.ts.map +1 -0
  21. package/dist/bundle.js +130 -0
  22. package/dist/bundle.js.map +1 -0
  23. package/dist/canonical.d.ts +23 -0
  24. package/dist/canonical.d.ts.map +1 -0
  25. package/dist/canonical.js +45 -0
  26. package/dist/canonical.js.map +1 -0
  27. package/dist/capability.d.ts +38 -0
  28. package/dist/capability.d.ts.map +1 -0
  29. package/dist/capability.js +61 -0
  30. package/dist/capability.js.map +1 -0
  31. package/dist/diagnostics/codes/a11y.d.ts +8 -0
  32. package/dist/diagnostics/codes/a11y.d.ts.map +1 -0
  33. package/dist/diagnostics/codes/a11y.js +30 -0
  34. package/dist/diagnostics/codes/a11y.js.map +1 -0
  35. package/dist/diagnostics/codes/action.d.ts +8 -0
  36. package/dist/diagnostics/codes/action.d.ts.map +1 -0
  37. package/dist/diagnostics/codes/action.js +110 -0
  38. package/dist/diagnostics/codes/action.js.map +1 -0
  39. package/dist/diagnostics/codes/artifact.d.ts +8 -0
  40. package/dist/diagnostics/codes/artifact.d.ts.map +1 -0
  41. package/dist/diagnostics/codes/artifact.js +121 -0
  42. package/dist/diagnostics/codes/artifact.js.map +1 -0
  43. package/dist/diagnostics/codes/build.d.ts +8 -0
  44. package/dist/diagnostics/codes/build.d.ts.map +1 -0
  45. package/dist/diagnostics/codes/build.js +55 -0
  46. package/dist/diagnostics/codes/build.js.map +1 -0
  47. package/dist/diagnostics/codes/cli.d.ts +8 -0
  48. package/dist/diagnostics/codes/cli.d.ts.map +1 -0
  49. package/dist/diagnostics/codes/cli.js +44 -0
  50. package/dist/diagnostics/codes/cli.js.map +1 -0
  51. package/dist/diagnostics/codes/console.d.ts +8 -0
  52. package/dist/diagnostics/codes/console.d.ts.map +1 -0
  53. package/dist/diagnostics/codes/console.js +30 -0
  54. package/dist/diagnostics/codes/console.js.map +1 -0
  55. package/dist/diagnostics/codes/dep.d.ts +8 -0
  56. package/dist/diagnostics/codes/dep.d.ts.map +1 -0
  57. package/dist/diagnostics/codes/dep.js +88 -0
  58. package/dist/diagnostics/codes/dep.js.map +1 -0
  59. package/dist/diagnostics/codes/env.d.ts +8 -0
  60. package/dist/diagnostics/codes/env.d.ts.map +1 -0
  61. package/dist/diagnostics/codes/env.js +132 -0
  62. package/dist/diagnostics/codes/env.js.map +1 -0
  63. package/dist/diagnostics/codes/field.d.ts +8 -0
  64. package/dist/diagnostics/codes/field.d.ts.map +1 -0
  65. package/dist/diagnostics/codes/field.js +99 -0
  66. package/dist/diagnostics/codes/field.js.map +1 -0
  67. package/dist/diagnostics/codes/home.d.ts +8 -0
  68. package/dist/diagnostics/codes/home.d.ts.map +1 -0
  69. package/dist/diagnostics/codes/home.js +132 -0
  70. package/dist/diagnostics/codes/home.js.map +1 -0
  71. package/dist/diagnostics/codes/host.d.ts +8 -0
  72. package/dist/diagnostics/codes/host.d.ts.map +1 -0
  73. package/dist/diagnostics/codes/host.js +176 -0
  74. package/dist/diagnostics/codes/host.js.map +1 -0
  75. package/dist/diagnostics/codes/hygiene.d.ts +8 -0
  76. package/dist/diagnostics/codes/hygiene.d.ts.map +1 -0
  77. package/dist/diagnostics/codes/hygiene.js +154 -0
  78. package/dist/diagnostics/codes/hygiene.js.map +1 -0
  79. package/dist/diagnostics/codes/index.d.ts +51 -0
  80. package/dist/diagnostics/codes/index.d.ts.map +1 -0
  81. package/dist/diagnostics/codes/index.js +72 -0
  82. package/dist/diagnostics/codes/index.js.map +1 -0
  83. package/dist/diagnostics/codes/live.d.ts +8 -0
  84. package/dist/diagnostics/codes/live.d.ts.map +1 -0
  85. package/dist/diagnostics/codes/live.js +30 -0
  86. package/dist/diagnostics/codes/live.js.map +1 -0
  87. package/dist/diagnostics/codes/manifest.d.ts +8 -0
  88. package/dist/diagnostics/codes/manifest.d.ts.map +1 -0
  89. package/dist/diagnostics/codes/manifest.js +44 -0
  90. package/dist/diagnostics/codes/manifest.js.map +1 -0
  91. package/dist/diagnostics/codes/network.d.ts +8 -0
  92. package/dist/diagnostics/codes/network.d.ts.map +1 -0
  93. package/dist/diagnostics/codes/network.js +30 -0
  94. package/dist/diagnostics/codes/network.js.map +1 -0
  95. package/dist/diagnostics/codes/platform.d.ts +8 -0
  96. package/dist/diagnostics/codes/platform.d.ts.map +1 -0
  97. package/dist/diagnostics/codes/platform.js +18 -0
  98. package/dist/diagnostics/codes/platform.js.map +1 -0
  99. package/dist/diagnostics/codes/publish.d.ts +8 -0
  100. package/dist/diagnostics/codes/publish.d.ts.map +1 -0
  101. package/dist/diagnostics/codes/publish.js +44 -0
  102. package/dist/diagnostics/codes/publish.js.map +1 -0
  103. package/dist/diagnostics/codes/regression.d.ts +8 -0
  104. package/dist/diagnostics/codes/regression.d.ts.map +1 -0
  105. package/dist/diagnostics/codes/regression.js +77 -0
  106. package/dist/diagnostics/codes/regression.js.map +1 -0
  107. package/dist/diagnostics/codes/runtime.d.ts +8 -0
  108. package/dist/diagnostics/codes/runtime.d.ts.map +1 -0
  109. package/dist/diagnostics/codes/runtime.js +66 -0
  110. package/dist/diagnostics/codes/runtime.js.map +1 -0
  111. package/dist/diagnostics/codes/secret.d.ts +8 -0
  112. package/dist/diagnostics/codes/secret.d.ts.map +1 -0
  113. package/dist/diagnostics/codes/secret.js +18 -0
  114. package/dist/diagnostics/codes/secret.js.map +1 -0
  115. package/dist/diagnostics/codes/smoke.d.ts +8 -0
  116. package/dist/diagnostics/codes/smoke.d.ts.map +1 -0
  117. package/dist/diagnostics/codes/smoke.js +30 -0
  118. package/dist/diagnostics/codes/smoke.js.map +1 -0
  119. package/dist/diagnostics/codes/submit.d.ts +8 -0
  120. package/dist/diagnostics/codes/submit.d.ts.map +1 -0
  121. package/dist/diagnostics/codes/submit.js +99 -0
  122. package/dist/diagnostics/codes/submit.js.map +1 -0
  123. package/dist/diagnostics/codes/target.d.ts +8 -0
  124. package/dist/diagnostics/codes/target.d.ts.map +1 -0
  125. package/dist/diagnostics/codes/target.js +18 -0
  126. package/dist/diagnostics/codes/target.js.map +1 -0
  127. package/dist/diagnostics/codes/type.d.ts +8 -0
  128. package/dist/diagnostics/codes/type.d.ts.map +1 -0
  129. package/dist/diagnostics/codes/type.js +30 -0
  130. package/dist/diagnostics/codes/type.js.map +1 -0
  131. package/dist/diagnostics/codes/verify.d.ts +8 -0
  132. package/dist/diagnostics/codes/verify.d.ts.map +1 -0
  133. package/dist/diagnostics/codes/verify.js +99 -0
  134. package/dist/diagnostics/codes/verify.js.map +1 -0
  135. package/dist/diagnostics/diagnostic.d.ts +79 -0
  136. package/dist/diagnostics/diagnostic.d.ts.map +1 -0
  137. package/dist/diagnostics/diagnostic.js +131 -0
  138. package/dist/diagnostics/diagnostic.js.map +1 -0
  139. package/dist/diagnostics/spec.d.ts +49 -0
  140. package/dist/diagnostics/spec.d.ts.map +1 -0
  141. package/dist/diagnostics/spec.js +31 -0
  142. package/dist/diagnostics/spec.js.map +1 -0
  143. package/dist/hygiene.d.ts +66 -0
  144. package/dist/hygiene.d.ts.map +1 -0
  145. package/dist/hygiene.js +134 -0
  146. package/dist/hygiene.js.map +1 -0
  147. package/dist/ids.d.ts +119 -0
  148. package/dist/ids.d.ts.map +1 -0
  149. package/dist/ids.js +135 -0
  150. package/dist/ids.js.map +1 -0
  151. package/dist/index.d.ts +86 -0
  152. package/dist/index.js +86 -0
  153. package/dist/interaction.d.ts +391 -0
  154. package/dist/interaction.d.ts.map +1 -0
  155. package/dist/interaction.js +306 -0
  156. package/dist/interaction.js.map +1 -0
  157. package/dist/manifest.d.ts +97 -0
  158. package/dist/manifest.d.ts.map +1 -0
  159. package/dist/manifest.js +101 -0
  160. package/dist/manifest.js.map +1 -0
  161. package/dist/method.d.ts +26 -0
  162. package/dist/method.d.ts.map +1 -0
  163. package/dist/method.js +10 -0
  164. package/dist/method.js.map +1 -0
  165. package/dist/methods/artifact/create.d.ts +29 -0
  166. package/dist/methods/artifact/create.d.ts.map +1 -0
  167. package/dist/methods/artifact/create.js +31 -0
  168. package/dist/methods/artifact/create.js.map +1 -0
  169. package/dist/methods/artifact/get.d.ts +17 -0
  170. package/dist/methods/artifact/get.d.ts.map +1 -0
  171. package/dist/methods/artifact/get.js +21 -0
  172. package/dist/methods/artifact/get.js.map +1 -0
  173. package/dist/methods/artifact/list.d.ts +22 -0
  174. package/dist/methods/artifact/list.d.ts.map +1 -0
  175. package/dist/methods/artifact/list.js +19 -0
  176. package/dist/methods/artifact/list.js.map +1 -0
  177. package/dist/methods/artifact/publish.d.ts +28 -0
  178. package/dist/methods/artifact/publish.d.ts.map +1 -0
  179. package/dist/methods/artifact/publish.js +28 -0
  180. package/dist/methods/artifact/publish.js.map +1 -0
  181. package/dist/methods/artifact/verify.d.ts +29 -0
  182. package/dist/methods/artifact/verify.d.ts.map +1 -0
  183. package/dist/methods/artifact/verify.js +27 -0
  184. package/dist/methods/artifact/verify.js.map +1 -0
  185. package/dist/methods/deps/add.d.ts +43 -0
  186. package/dist/methods/deps/add.d.ts.map +1 -0
  187. package/dist/methods/deps/add.js +40 -0
  188. package/dist/methods/deps/add.js.map +1 -0
  189. package/dist/methods/dev/start.d.ts +52 -0
  190. package/dist/methods/dev/start.d.ts.map +1 -0
  191. package/dist/methods/dev/start.js +56 -0
  192. package/dist/methods/dev/start.js.map +1 -0
  193. package/dist/methods/dev/stop.d.ts +16 -0
  194. package/dist/methods/dev/stop.d.ts.map +1 -0
  195. package/dist/methods/dev/stop.js +21 -0
  196. package/dist/methods/dev/stop.js.map +1 -0
  197. package/dist/methods/events/ack.d.ts +20 -0
  198. package/dist/methods/events/ack.d.ts.map +1 -0
  199. package/dist/methods/events/ack.js +26 -0
  200. package/dist/methods/events/ack.js.map +1 -0
  201. package/dist/methods/events/read.d.ts +40 -0
  202. package/dist/methods/events/read.d.ts.map +1 -0
  203. package/dist/methods/events/read.js +35 -0
  204. package/dist/methods/events/read.js.map +1 -0
  205. package/dist/methods/events/subscribe.d.ts +54 -0
  206. package/dist/methods/events/subscribe.d.ts.map +1 -0
  207. package/dist/methods/events/subscribe.js +44 -0
  208. package/dist/methods/events/subscribe.js.map +1 -0
  209. package/dist/methods/events/unsubscribe.d.ts +16 -0
  210. package/dist/methods/events/unsubscribe.d.ts.map +1 -0
  211. package/dist/methods/events/unsubscribe.js +21 -0
  212. package/dist/methods/events/unsubscribe.js.map +1 -0
  213. package/dist/methods/gc/run.d.ts +76 -0
  214. package/dist/methods/gc/run.d.ts.map +1 -0
  215. package/dist/methods/gc/run.js +56 -0
  216. package/dist/methods/gc/run.js.map +1 -0
  217. package/dist/methods/index.d.ts +6 -0
  218. package/dist/methods/index.d.ts.map +1 -0
  219. package/dist/methods/index.js +78 -0
  220. package/dist/methods/index.js.map +1 -0
  221. package/dist/methods/instance/check.d.ts +30 -0
  222. package/dist/methods/instance/check.d.ts.map +1 -0
  223. package/dist/methods/instance/check.js +34 -0
  224. package/dist/methods/instance/check.js.map +1 -0
  225. package/dist/methods/instance/status.d.ts +102 -0
  226. package/dist/methods/instance/status.d.ts.map +1 -0
  227. package/dist/methods/instance/status.js +83 -0
  228. package/dist/methods/instance/status.js.map +1 -0
  229. package/dist/methods/live/push.d.ts +28 -0
  230. package/dist/methods/live/push.d.ts.map +1 -0
  231. package/dist/methods/live/push.js +35 -0
  232. package/dist/methods/live/push.js.map +1 -0
  233. package/dist/methods/mostra/initialize.d.ts +143 -0
  234. package/dist/methods/mostra/initialize.d.ts.map +1 -0
  235. package/dist/methods/mostra/initialize.js +97 -0
  236. package/dist/methods/mostra/initialize.js.map +1 -0
  237. package/dist/methods/mostra/shutdown.d.ts +14 -0
  238. package/dist/methods/mostra/shutdown.d.ts.map +1 -0
  239. package/dist/methods/mostra/shutdown.js +22 -0
  240. package/dist/methods/mostra/shutdown.js.map +1 -0
  241. package/dist/methods/port/drafts-mirror.d.ts +30 -0
  242. package/dist/methods/port/drafts-mirror.d.ts.map +1 -0
  243. package/dist/methods/port/drafts-mirror.js +33 -0
  244. package/dist/methods/port/drafts-mirror.js.map +1 -0
  245. package/dist/methods/port/secrets-get.d.ts +19 -0
  246. package/dist/methods/port/secrets-get.d.ts.map +1 -0
  247. package/dist/methods/port/secrets-get.js +31 -0
  248. package/dist/methods/port/secrets-get.js.map +1 -0
  249. package/dist/methods/port/submissions-deliver.d.ts +38 -0
  250. package/dist/methods/port/submissions-deliver.d.ts.map +1 -0
  251. package/dist/methods/port/submissions-deliver.js +38 -0
  252. package/dist/methods/port/submissions-deliver.js.map +1 -0
  253. package/dist/methods/port/trusted-controls-activated.d.ts +27 -0
  254. package/dist/methods/port/trusted-controls-activated.d.ts.map +1 -0
  255. package/dist/methods/port/trusted-controls-activated.js +33 -0
  256. package/dist/methods/port/trusted-controls-activated.js.map +1 -0
  257. package/dist/methods/port/trusted-controls-policy.d.ts +21 -0
  258. package/dist/methods/port/trusted-controls-policy.d.ts.map +1 -0
  259. package/dist/methods/port/trusted-controls-policy.js +27 -0
  260. package/dist/methods/port/trusted-controls-policy.js.map +1 -0
  261. package/dist/methods/results/get.d.ts +32 -0
  262. package/dist/methods/results/get.d.ts.map +1 -0
  263. package/dist/methods/results/get.js +36 -0
  264. package/dist/methods/results/get.js.map +1 -0
  265. package/dist/methods/secret/delete.d.ts +22 -0
  266. package/dist/methods/secret/delete.d.ts.map +1 -0
  267. package/dist/methods/secret/delete.js +32 -0
  268. package/dist/methods/secret/delete.js.map +1 -0
  269. package/dist/methods/secret/list.d.ts +21 -0
  270. package/dist/methods/secret/list.d.ts.map +1 -0
  271. package/dist/methods/secret/list.js +29 -0
  272. package/dist/methods/secret/list.js.map +1 -0
  273. package/dist/methods/secret/set.d.ts +37 -0
  274. package/dist/methods/secret/set.d.ts.map +1 -0
  275. package/dist/methods/secret/set.js +41 -0
  276. package/dist/methods/secret/set.js.map +1 -0
  277. package/dist/methods/state/get.d.ts +25 -0
  278. package/dist/methods/state/get.d.ts.map +1 -0
  279. package/dist/methods/state/get.js +29 -0
  280. package/dist/methods/state/get.js.map +1 -0
  281. package/dist/methods/state/patch.d.ts +32 -0
  282. package/dist/methods/state/patch.d.ts.map +1 -0
  283. package/dist/methods/state/patch.js +29 -0
  284. package/dist/methods/state/patch.js.map +1 -0
  285. package/dist/methods/view/default.d.ts +19 -0
  286. package/dist/methods/view/default.d.ts.map +1 -0
  287. package/dist/methods/view/default.js +23 -0
  288. package/dist/methods/view/default.js.map +1 -0
  289. package/dist/methods/view/launch.d.ts +27 -0
  290. package/dist/methods/view/launch.d.ts.map +1 -0
  291. package/dist/methods/view/launch.js +30 -0
  292. package/dist/methods/view/launch.js.map +1 -0
  293. package/dist/methods/view/revoke.d.ts +19 -0
  294. package/dist/methods/view/revoke.d.ts.map +1 -0
  295. package/dist/methods/view/revoke.js +26 -0
  296. package/dist/methods/view/revoke.js.map +1 -0
  297. package/dist/methods/view/rotate.d.ts +21 -0
  298. package/dist/methods/view/rotate.d.ts.map +1 -0
  299. package/dist/methods/view/rotate.js +27 -0
  300. package/dist/methods/view/rotate.js.map +1 -0
  301. package/dist/methods/view/url.d.ts +52 -0
  302. package/dist/methods/view/url.d.ts.map +1 -0
  303. package/dist/methods/view/url.js +43 -0
  304. package/dist/methods/view/url.js.map +1 -0
  305. package/dist/methods/wait/wait.d.ts +37 -0
  306. package/dist/methods/wait/wait.d.ts.map +1 -0
  307. package/dist/methods/wait/wait.js +39 -0
  308. package/dist/methods/wait/wait.js.map +1 -0
  309. package/dist/revision.d.ts +43 -0
  310. package/dist/revision.d.ts.map +1 -0
  311. package/dist/revision.js +69 -0
  312. package/dist/revision.js.map +1 -0
  313. package/dist/rpc/error.d.ts +47 -0
  314. package/dist/rpc/error.d.ts.map +1 -0
  315. package/dist/rpc/error.js +77 -0
  316. package/dist/rpc/error.js.map +1 -0
  317. package/dist/rpc/lines.d.ts +30 -0
  318. package/dist/rpc/lines.d.ts.map +1 -0
  319. package/dist/rpc/lines.js +63 -0
  320. package/dist/rpc/lines.js.map +1 -0
  321. package/dist/rpc/messages.d.ts +92 -0
  322. package/dist/rpc/messages.d.ts.map +1 -0
  323. package/dist/rpc/messages.js +133 -0
  324. package/dist/rpc/messages.js.map +1 -0
  325. package/dist/rpc/peer.d.ts +81 -0
  326. package/dist/rpc/peer.d.ts.map +1 -0
  327. package/dist/rpc/peer.js +208 -0
  328. package/dist/rpc/peer.js.map +1 -0
  329. package/dist/serializer.d.ts +178 -0
  330. package/dist/serializer.d.ts.map +1 -0
  331. package/dist/serializer.js +929 -0
  332. package/dist/serializer.js.map +1 -0
  333. package/dist/verify.d.ts +254 -0
  334. package/dist/verify.d.ts.map +1 -0
  335. package/dist/verify.js +243 -0
  336. package/dist/verify.js.map +1 -0
  337. package/dist/view.d.ts +103 -0
  338. package/dist/view.d.ts.map +1 -0
  339. package/dist/view.js +110 -0
  340. package/dist/view.js.map +1 -0
  341. package/dist/wire-registry.js +11 -0
  342. package/dist/wire-registry.js.map +1 -0
  343. package/dist/worker.d.ts +249 -0
  344. package/dist/worker.d.ts.map +1 -0
  345. package/dist/worker.js +158 -0
  346. package/dist/worker.js.map +1 -0
  347. package/package.json +114 -3
  348. package/schemas/protocol.draft-07.json +5120 -0
  349. package/schemas/protocol.schema.json +4964 -0
  350. package/src/actions.ts +418 -0
  351. package/src/artifact.ts +187 -0
  352. package/src/bridge.ts +618 -0
  353. package/src/browser.ts +374 -0
  354. package/src/bundle.ts +264 -0
  355. package/src/canonical.ts +49 -0
  356. package/src/capability.ts +92 -0
  357. package/src/diagnostics/codes/a11y.ts +41 -0
  358. package/src/diagnostics/codes/action.ts +125 -0
  359. package/src/diagnostics/codes/artifact.ts +137 -0
  360. package/src/diagnostics/codes/build.ts +65 -0
  361. package/src/diagnostics/codes/cli.ts +53 -0
  362. package/src/diagnostics/codes/console.ts +41 -0
  363. package/src/diagnostics/codes/dep.ts +101 -0
  364. package/src/diagnostics/codes/env.ts +149 -0
  365. package/src/diagnostics/codes/field.ts +113 -0
  366. package/src/diagnostics/codes/home.ts +150 -0
  367. package/src/diagnostics/codes/host.ts +197 -0
  368. package/src/diagnostics/codes/hygiene.ts +175 -0
  369. package/src/diagnostics/codes/index.ts +142 -0
  370. package/src/diagnostics/codes/live.ts +41 -0
  371. package/src/diagnostics/codes/manifest.ts +53 -0
  372. package/src/diagnostics/codes/network.ts +41 -0
  373. package/src/diagnostics/codes/platform.ts +30 -0
  374. package/src/diagnostics/codes/publish.ts +53 -0
  375. package/src/diagnostics/codes/regression.ts +89 -0
  376. package/src/diagnostics/codes/runtime.ts +77 -0
  377. package/src/diagnostics/codes/secret.ts +29 -0
  378. package/src/diagnostics/codes/smoke.ts +41 -0
  379. package/src/diagnostics/codes/submit.ts +113 -0
  380. package/src/diagnostics/codes/target.ts +29 -0
  381. package/src/diagnostics/codes/type.ts +41 -0
  382. package/src/diagnostics/codes/verify.ts +113 -0
  383. package/src/diagnostics/diagnostic.ts +240 -0
  384. package/src/diagnostics/spec.ts +90 -0
  385. package/src/hygiene.ts +224 -0
  386. package/src/ids.ts +279 -0
  387. package/src/index.ts +576 -0
  388. package/src/interaction.ts +728 -0
  389. package/src/manifest.ts +206 -0
  390. package/src/method.ts +42 -0
  391. package/src/methods/artifact/create.ts +56 -0
  392. package/src/methods/artifact/get.ts +30 -0
  393. package/src/methods/artifact/list.ts +42 -0
  394. package/src/methods/artifact/publish.ts +46 -0
  395. package/src/methods/artifact/verify.ts +46 -0
  396. package/src/methods/deps/add.ts +72 -0
  397. package/src/methods/dev/start.ts +84 -0
  398. package/src/methods/dev/stop.ts +32 -0
  399. package/src/methods/events/ack.ts +41 -0
  400. package/src/methods/events/read.ts +67 -0
  401. package/src/methods/events/subscribe.ts +91 -0
  402. package/src/methods/events/unsubscribe.ts +35 -0
  403. package/src/methods/gc/run.ts +125 -0
  404. package/src/methods/index.ts +81 -0
  405. package/src/methods/instance/check.ts +61 -0
  406. package/src/methods/instance/status.ts +172 -0
  407. package/src/methods/live/push.ts +54 -0
  408. package/src/methods/mostra/initialize.ts +249 -0
  409. package/src/methods/mostra/shutdown.ts +31 -0
  410. package/src/methods/port/drafts-mirror.ts +52 -0
  411. package/src/methods/port/secrets-get.ts +40 -0
  412. package/src/methods/port/submissions-deliver.ts +70 -0
  413. package/src/methods/port/trusted-controls-activated.ts +51 -0
  414. package/src/methods/port/trusted-controls-policy.ts +38 -0
  415. package/src/methods/results/get.ts +59 -0
  416. package/src/methods/secret/delete.ts +43 -0
  417. package/src/methods/secret/list.ts +40 -0
  418. package/src/methods/secret/set.ts +69 -0
  419. package/src/methods/state/get.ts +44 -0
  420. package/src/methods/state/patch.ts +51 -0
  421. package/src/methods/view/default.ts +32 -0
  422. package/src/methods/view/launch.ts +47 -0
  423. package/src/methods/view/revoke.ts +39 -0
  424. package/src/methods/view/rotate.ts +37 -0
  425. package/src/methods/view/url.ts +84 -0
  426. package/src/methods/wait/wait.ts +58 -0
  427. package/src/revision.ts +101 -0
  428. package/src/rpc/error.ts +107 -0
  429. package/src/rpc/lines.ts +70 -0
  430. package/src/rpc/messages.ts +188 -0
  431. package/src/rpc/peer.ts +341 -0
  432. package/src/serializer.ts +1217 -0
  433. package/src/timers.d.ts +8 -0
  434. package/src/verify.ts +458 -0
  435. package/src/view.ts +200 -0
  436. package/src/web-crypto.d.ts +9 -0
  437. package/src/web-platform.d.ts +35 -0
  438. package/src/wire-registry.ts +14 -0
  439. package/src/worker.ts +374 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.js","names":[],"sources":["../../../src/methods/secret/set.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SECRET_NAME_PATTERN, SECRET_VALUE_MAX } from \"../../actions.ts\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `secret/set` (INTERFACES §6, D44). */\nexport interface SecretSetParams {\n /** Letters, digits, `_`, `.` and `-`, starting with a letter or `_`, at most 128 characters. */\n readonly name: string;\n /** The value, at most 64 KiB of UTF-8. Never returned by any method. */\n readonly value: string;\n /** The artifact the secret belongs to; absent: shared by every artifact of the home. */\n readonly artifact?: ArtifactRef;\n}\n\n/** Where a secret lives. */\nexport interface SecretEntry {\n /** The secret's name. */\n readonly name: string;\n /** `artifact` for one artifact's secret, `home` for one every artifact shares. */\n readonly scope: \"artifact\" | \"home\";\n /** The artifact, for `scope: \"artifact\"`. */\n readonly artifactId?: string;\n /** When it was last set. */\n readonly updatedAt: string;\n}\n\n/** The Zod schema of the `SecretEntry` type. */\nexport const SecretEntry: z.ZodType<SecretEntry> = z\n .object({\n name: z.string(),\n scope: z.enum([\"artifact\", \"home\"]),\n artifactId: z.string().exactOptional(),\n updatedAt: z.string(),\n })\n .register(wireRegistry, {\n id: \"SecretEntry\",\n description: \"A secret's name, scope and when it was set; never its value.\",\n });\n\n/** The result of `secret/set`: the secret, without its value. */\nexport type SecretSetResult = SecretEntry;\n\nconst params: z.ZodType<SecretSetParams> = z\n .object({\n name: z.string().regex(SECRET_NAME_PATTERN),\n // Characters here; the instance also refuses more than 64 KiB of UTF-8.\n value: z.string().min(1).max(SECRET_VALUE_MAX),\n artifact: ArtifactRef.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"SecretSetParams\",\n description: \"A secret's name, value and optional artifact scope.\",\n });\n\n/**\n * `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or\n * for every artifact of the home; server code reads it with `secret(name)`. Setting it again\n * replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger\n * never records anything derived from a secret's value.\n */\nexport const secretSetMethod: MethodDefinition<SecretSetParams, SecretSetResult> = defineMethod({\n method: \"secret/set\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result: SecretEntry,\n});\n"],"mappings":";;;;;;;AA6BA,MAAa,cAAsC,EAChD,OAAO;CACN,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,KAAK,CAAC,YAAY,MAAM,CAAC;CAClC,YAAY,EAAE,OAAO,CAAC,CAAC,cAAc;CACrC,WAAW,EAAE,OAAO;AACtB,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAKH,MAAM,SAAqC,EACxC,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,mBAAmB;CAE1C,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,gBAAgB;CAC7C,UAAU,YAAY,cAAc;AACtC,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,kBAAsE,aAAa;CAC9F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { DocumentRevision, FieldState } from "../../interaction.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/state/get.d.ts
5
+ /** The params of `state/get` (INTERFACES §6, D63). */
6
+ export interface StateGetParams {
7
+ /** The artifact whose shared state to read. */
8
+ readonly artifact: ArtifactRef;
9
+ /** Only these field IDs; absent: every field. */
10
+ readonly ids?: readonly string[];
11
+ }
12
+ /** The result of `state/get`: the artifact state's revision and its fields by ID. */
13
+ export interface StateGetResult {
14
+ /** The state's revision; pass it as `baseRevision` to `state/patch` for compare-and-set. */
15
+ readonly revision: DocumentRevision;
16
+ /** The fields by ID. */
17
+ readonly fields: Readonly<Record<string, FieldState>>;
18
+ }
19
+ /**
20
+ * `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each
21
+ * field's value, revision and last writer.
22
+ */
23
+ export declare const stateGetMethod: MethodDefinition<StateGetParams, StateGetResult>;
24
+ //#endregion
25
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/state/get.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;WAEV;;;iBAIM;;WAEN,UAAU;;WAEV,QAAQ,SAAS,eAAe;;;;;;qBAkB9B,gBAAgB,iBAAiB,gBAAgB"}
@@ -0,0 +1,29 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { DocumentRevision, FieldState } from "../../interaction.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/state/get.ts
7
+ const params = z.object({
8
+ artifact: ArtifactRef,
9
+ ids: z.array(z.string().min(1).max(256)).max(1e4).readonly().exactOptional()
10
+ }).register(wireRegistry, { id: "StateGetParams" });
11
+ const result = z.object({
12
+ revision: DocumentRevision,
13
+ fields: z.record(z.string(), FieldState)
14
+ }).register(wireRegistry, { id: "StateGetResult" });
15
+ /**
16
+ * `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each
17
+ * field's value, revision and last writer.
18
+ */
19
+ const stateGetMethod = defineMethod({
20
+ method: "state/get",
21
+ direction: "client-to-instance",
22
+ mutating: false,
23
+ params,
24
+ result
25
+ });
26
+ //#endregion
27
+ export { stateGetMethod };
28
+
29
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/state/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { DocumentRevision, FieldState } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `state/get` (INTERFACES §6, D63). */\nexport interface StateGetParams {\n /** The artifact whose shared state to read. */\n readonly artifact: ArtifactRef;\n /** Only these field IDs; absent: every field. */\n readonly ids?: readonly string[];\n}\n\n/** The result of `state/get`: the artifact state's revision and its fields by ID. */\nexport interface StateGetResult {\n /** The state's revision; pass it as `baseRevision` to `state/patch` for compare-and-set. */\n readonly revision: DocumentRevision;\n /** The fields by ID. */\n readonly fields: Readonly<Record<string, FieldState>>;\n}\n\nconst params: z.ZodType<StateGetParams> = z\n .object({\n artifact: ArtifactRef,\n ids: z.array(z.string().min(1).max(256)).max(10_000).readonly().exactOptional(),\n })\n .register(wireRegistry, { id: \"StateGetParams\" });\n\nconst result: z.ZodType<StateGetResult> = z\n .object({ revision: DocumentRevision, fields: z.record(z.string(), FieldState) })\n .register(wireRegistry, { id: \"StateGetResult\" });\n\n/**\n * `state/get`: reads an artifact's shared state (its artifact-scoped fields, D63) with each\n * field's value, revision and last writer.\n */\nexport const stateGetMethod: MethodDefinition<StateGetParams, StateGetResult> = defineMethod({\n method: \"state/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAsBA,MAAM,SAAoC,EACvC,OAAO;CACN,UAAU;CACV,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAAM,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;AAChF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;AAElD,MAAM,SAAoC,EACvC,OAAO;CAAE,UAAU;CAAkB,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU;AAAE,CAAC,CAAC,CAChF,SAAS,cAAc,EAAE,IAAI,iBAAiB,CAAC;;;;;AAMlD,MAAa,iBAAmE,aAAa;CAC3F,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { DocumentRevision, FieldOp, MutationResult } from "../../interaction.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/state/patch.d.ts
5
+ /** The params of `state/patch` (INTERFACES §6, D63, D106). */
6
+ export interface StatePatchParams {
7
+ /** The artifact whose shared state to write. */
8
+ readonly artifact: ArtifactRef;
9
+ /** The field changes, applied together under one revision. */
10
+ readonly ops: readonly FieldOp[];
11
+ /**
12
+ * The state revision the caller last read. A field changed after it is a conflict and keeps its
13
+ * value; the other ops apply. Absent: every op applies, whatever changed in between.
14
+ */
15
+ readonly baseRevision?: DocumentRevision;
16
+ /**
17
+ * The change's ID, the idempotency key of this method (H-03): a retry with the same ID and
18
+ * contents returns the recorded result.
19
+ */
20
+ readonly mutationId: string;
21
+ /** Who writes: `agent` (the default) or `host`, recorded as each field's last writer. */
22
+ readonly as?: "agent" | "host";
23
+ }
24
+ /** The result of `state/patch`. */
25
+ export type StatePatchResult = MutationResult;
26
+ /**
27
+ * `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,
28
+ * through the same path as viewers' edits (D63). Changes append `state.changed`.
29
+ */
30
+ export declare const statePatchMethod: MethodDefinition<StatePatchParams, StatePatchResult>;
31
+ //#endregion
32
+ //# sourceMappingURL=patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.d.ts","names":[],"sources":["../../../src/methods/state/patch.ts"],"mappings":";;;;;iBAQiB;;WAEN,UAAU;;WAEV,cAAc;;;;;WAKd,eAAe;;;;;WAKf;;WAEA;;;YAIC,mBAAmB;;;;;qBAgBlB,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,29 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { MutationId } from "../../ids.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { DocumentRevision, FieldOp, MutationResult } from "../../interaction.js";
5
+ import { defineMethod } from "../../method.js";
6
+ import * as z from "zod";
7
+ //#region src/methods/state/patch.ts
8
+ const params = z.object({
9
+ artifact: ArtifactRef,
10
+ ops: z.array(FieldOp).min(1).max(1e3).readonly(),
11
+ baseRevision: DocumentRevision.exactOptional(),
12
+ mutationId: MutationId.schema,
13
+ as: z.enum(["agent", "host"]).exactOptional()
14
+ }).register(wireRegistry, { id: "StatePatchParams" });
15
+ /**
16
+ * `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,
17
+ * through the same path as viewers' edits (D63). Changes append `state.changed`.
18
+ */
19
+ const statePatchMethod = defineMethod({
20
+ method: "state/patch",
21
+ direction: "client-to-instance",
22
+ mutating: true,
23
+ params,
24
+ result: MutationResult
25
+ });
26
+ //#endregion
27
+ export { statePatchMethod };
28
+
29
+ //# sourceMappingURL=patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.js","names":[],"sources":["../../../src/methods/state/patch.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { MutationId } from \"../../ids.ts\";\nimport { DocumentRevision, FieldOp, MutationResult } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `state/patch` (INTERFACES §6, D63, D106). */\nexport interface StatePatchParams {\n /** The artifact whose shared state to write. */\n readonly artifact: ArtifactRef;\n /** The field changes, applied together under one revision. */\n readonly ops: readonly FieldOp[];\n /**\n * The state revision the caller last read. A field changed after it is a conflict and keeps its\n * value; the other ops apply. Absent: every op applies, whatever changed in between.\n */\n readonly baseRevision?: DocumentRevision;\n /**\n * The change's ID, the idempotency key of this method (H-03): a retry with the same ID and\n * contents returns the recorded result.\n */\n readonly mutationId: string;\n /** Who writes: `agent` (the default) or `host`, recorded as each field's last writer. */\n readonly as?: \"agent\" | \"host\";\n}\n\n/** The result of `state/patch`. */\nexport type StatePatchResult = MutationResult;\n\nconst params: z.ZodType<StatePatchParams> = z\n .object({\n artifact: ArtifactRef,\n ops: z.array(FieldOp).min(1).max(1000).readonly(),\n baseRevision: DocumentRevision.exactOptional(),\n mutationId: MutationId.schema,\n as: z.enum([\"agent\", \"host\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"StatePatchParams\" });\n\n/**\n * `state/patch`: writes an artifact's shared state with compare-and-set and per-field conflicts,\n * through the same path as viewers' edits (D63). Changes append `state.changed`.\n */\nexport const statePatchMethod: MethodDefinition<StatePatchParams, StatePatchResult> = defineMethod({\n method: \"state/patch\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: MutationResult,\n});\n"],"mappings":";;;;;;;AA8BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAI,CAAC,CAAC,SAAS;CAChD,cAAc,iBAAiB,cAAc;CAC7C,YAAY,WAAW;CACvB,IAAI,EAAE,KAAK,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,cAAc;AAC9C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { CapabilityLink } from "./url.js";
4
+ //#region src/methods/view/default.d.ts
5
+ /** The params of `view/default` (INTERFACES §6, D140). */
6
+ export interface ViewDefaultParams {
7
+ /** The artifact whose default link to return. */
8
+ readonly artifact: ArtifactRef;
9
+ }
10
+ /** The result of `view/default`: the artifact's default link (D97 item 3). */
11
+ export type ViewDefaultResult = CapabilityLink;
12
+ /**
13
+ * `view/default`: the artifact's default link, the one every publish receipt carries (D97 item
14
+ * 3), without minting a new token. When the default link was revoked, it mints a new default (the
15
+ * old token stays revoked). `view/url` always mints a separate link.
16
+ */
17
+ export declare const viewDefaultMethod: MethodDefinition<ViewDefaultParams, ViewDefaultResult>;
18
+ //#endregion
19
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.d.ts","names":[],"sources":["../../../src/methods/view/default.ts"],"mappings":";;;;;iBAOiB;;WAEN,UAAU;;;YAIT,oBAAoB;;;;;;qBAWnB,mBAAmB,iBAAiB,mBAAmB"}
@@ -0,0 +1,23 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { CapabilityLink } from "./url.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/view/default.ts
7
+ const params = z.object({ artifact: ArtifactRef }).register(wireRegistry, { id: "ViewDefaultParams" });
8
+ /**
9
+ * `view/default`: the artifact's default link, the one every publish receipt carries (D97 item
10
+ * 3), without minting a new token. When the default link was revoked, it mints a new default (the
11
+ * old token stays revoked). `view/url` always mints a separate link.
12
+ */
13
+ const viewDefaultMethod = defineMethod({
14
+ method: "view/default",
15
+ direction: "client-to-instance",
16
+ mutating: true,
17
+ params,
18
+ result: CapabilityLink
19
+ });
20
+ //#endregion
21
+ export { viewDefaultMethod };
22
+
23
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.js","names":[],"sources":["../../../src/methods/view/default.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { CapabilityLink } from \"./url.ts\";\n\n/** The params of `view/default` (INTERFACES §6, D140). */\nexport interface ViewDefaultParams {\n /** The artifact whose default link to return. */\n readonly artifact: ArtifactRef;\n}\n\n/** The result of `view/default`: the artifact's default link (D97 item 3). */\nexport type ViewDefaultResult = CapabilityLink;\n\nconst params: z.ZodType<ViewDefaultParams> = z\n .object({ artifact: ArtifactRef })\n .register(wireRegistry, { id: \"ViewDefaultParams\" });\n\n/**\n * `view/default`: the artifact's default link, the one every publish receipt carries (D97 item\n * 3), without minting a new token. When the default link was revoked, it mints a new default (the\n * old token stays revoked). `view/url` always mints a separate link.\n */\nexport const viewDefaultMethod: MethodDefinition<ViewDefaultParams, ViewDefaultResult> =\n defineMethod({\n method: \"view/default\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: CapabilityLink,\n });\n"],"mappings":";;;;;;AAeA,MAAM,SAAuC,EAC1C,OAAO,EAAE,UAAU,YAAY,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,oBAAoB,CAAC;;;;;;AAOrD,MAAa,oBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { MethodDefinition } from "../../method.js";
2
+ //#region src/methods/view/launch.d.ts
3
+ /** The params of `view/launch` (INTERFACES §6, D140 item 15). */
4
+ export interface ViewLaunchParams {
5
+ /** The link whose session the launch URL opens: a `CapabilityLink.tokenId`. */
6
+ readonly tokenId: string;
7
+ }
8
+ /** The result of `view/launch`. */
9
+ export interface ViewLaunchResult {
10
+ /**
11
+ * `http://<url host>:<shell port>/a/<artifactId>[/v/<number>]#l=<ticket>`: a URL to hand a
12
+ * browser on its command line. The shell exchanges the single-use ticket for the session the
13
+ * link would give; the link's secret is never in it.
14
+ */
15
+ readonly url: string;
16
+ /** When the ticket stops working, 60 s after it was minted (RFC 3339, UTC). */
17
+ readonly expiresAt: string;
18
+ }
19
+ /**
20
+ * `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without
21
+ * the link's secret on a command line other local users can read. The ticket is single-use,
22
+ * lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes
23
+ * no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.
24
+ */
25
+ export declare const viewLaunchMethod: MethodDefinition<ViewLaunchParams, ViewLaunchResult>;
26
+ //#endregion
27
+ //# sourceMappingURL=launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch.d.ts","names":[],"sources":["../../../src/methods/view/launch.ts"],"mappings":";;;iBAMiB;;WAEN;;;iBAIM;;;;;;WAMN;;WAEA;;;;;;;;qBAoBE,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,30 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { TokenId } from "../../ids.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import * as z from "zod";
5
+ //#region src/methods/view/launch.ts
6
+ const params = z.object({ tokenId: TokenId.schema }).register(wireRegistry, { id: "ViewLaunchParams" });
7
+ const result = z.object({
8
+ url: z.string().min(1),
9
+ expiresAt: z.iso.datetime()
10
+ }).register(wireRegistry, {
11
+ id: "ViewLaunchResult",
12
+ description: "A one-time launch URL for a browser."
13
+ });
14
+ /**
15
+ * `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without
16
+ * the link's secret on a command line other local users can read. The ticket is single-use,
17
+ * lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes
18
+ * no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.
19
+ */
20
+ const viewLaunchMethod = defineMethod({
21
+ method: "view/launch",
22
+ direction: "client-to-instance",
23
+ mutating: true,
24
+ params,
25
+ result
26
+ });
27
+ //#endregion
28
+ export { viewLaunchMethod };
29
+
30
+ //# sourceMappingURL=launch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch.js","names":[],"sources":["../../../src/methods/view/launch.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `view/launch` (INTERFACES §6, D140 item 15). */\nexport interface ViewLaunchParams {\n /** The link whose session the launch URL opens: a `CapabilityLink.tokenId`. */\n readonly tokenId: string;\n}\n\n/** The result of `view/launch`. */\nexport interface ViewLaunchResult {\n /**\n * `http://<url host>:<shell port>/a/<artifactId>[/v/<number>]#l=<ticket>`: a URL to hand a\n * browser on its command line. The shell exchanges the single-use ticket for the session the\n * link would give; the link's secret is never in it.\n */\n readonly url: string;\n /** When the ticket stops working, 60 s after it was minted (RFC 3339, UTC). */\n readonly expiresAt: string;\n}\n\nconst params: z.ZodType<ViewLaunchParams> = z\n .object({ tokenId: TokenId.schema })\n .register(wireRegistry, { id: \"ViewLaunchParams\" });\n\nconst result: z.ZodType<ViewLaunchResult> = z\n .object({ url: z.string().min(1), expiresAt: z.iso.datetime() })\n .register(wireRegistry, {\n id: \"ViewLaunchResult\",\n description: \"A one-time launch URL for a browser.\",\n });\n\n/**\n * `view/launch`: a one-time launch URL for a link (D140 item 15), so a browser opens it without\n * the link's secret on a command line other local users can read. The ticket is single-use,\n * lives 60 s and carries 130 bits, like a frame ticket; it is never recorded, so the method takes\n * no `requestId`. A revoked or expired link is `MOSTRA_HYGIENE_TOKEN_REVOKED`.\n */\nexport const viewLaunchMethod: MethodDefinition<ViewLaunchParams, ViewLaunchResult> = defineMethod({\n method: \"view/launch\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;AAuBA,MAAM,SAAsC,EACzC,OAAO,EAAE,SAAS,QAAQ,OAAO,CAAC,CAAC,CACnC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO;CAAE,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,WAAW,EAAE,IAAI,SAAS;AAAE,CAAC,CAAC,CAC/D,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { MethodDefinition } from "../../method.js";
2
+ //#region src/methods/view/revoke.d.ts
3
+ /** The params of `view/revoke` (INTERFACES §6, D97). */
4
+ export interface ViewRevokeParams {
5
+ /** The token whose link stops working. */
6
+ readonly tokenId: string;
7
+ /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */
8
+ readonly requestId?: string;
9
+ }
10
+ /** The result of `view/revoke`. */
11
+ export type ViewRevokeResult = Record<string, never>;
12
+ /**
13
+ * `view/revoke`: ends a capability link and every session opened with it; both answer 410 from
14
+ * then on (HY-03). Revoking a revoked token succeeds; an unknown token is
15
+ * `MOSTRA_HYGIENE_TOKEN_INVALID`.
16
+ */
17
+ export declare const viewRevokeMethod: MethodDefinition<ViewRevokeParams, ViewRevokeResult>;
18
+ //#endregion
19
+ //# sourceMappingURL=revoke.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revoke.d.ts","names":[],"sources":["../../../src/methods/view/revoke.ts"],"mappings":";;;iBAMiB;;WAEN;;WAEA;;;YAIC,mBAAmB;;;;;;qBAkBlB,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,26 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { TokenId } from "../../ids.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import * as z from "zod";
5
+ //#region src/methods/view/revoke.ts
6
+ const params = z.object({
7
+ tokenId: TokenId.schema,
8
+ requestId: z.string().min(1).exactOptional()
9
+ }).register(wireRegistry, { id: "ViewRevokeParams" });
10
+ const result = z.object({}).register(wireRegistry, { id: "ViewRevokeResult" });
11
+ /**
12
+ * `view/revoke`: ends a capability link and every session opened with it; both answer 410 from
13
+ * then on (HY-03). Revoking a revoked token succeeds; an unknown token is
14
+ * `MOSTRA_HYGIENE_TOKEN_INVALID`.
15
+ */
16
+ const viewRevokeMethod = defineMethod({
17
+ method: "view/revoke",
18
+ direction: "client-to-instance",
19
+ mutating: true,
20
+ params,
21
+ result
22
+ });
23
+ //#endregion
24
+ export { viewRevokeMethod };
25
+
26
+ //# sourceMappingURL=revoke.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revoke.js","names":[],"sources":["../../../src/methods/view/revoke.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `view/revoke` (INTERFACES §6, D97). */\nexport interface ViewRevokeParams {\n /** The token whose link stops working. */\n readonly tokenId: string;\n /** Makes retries idempotent: a repeated `requestId` returns the recorded result (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `view/revoke`. */\nexport type ViewRevokeResult = Record<string, never>;\n\nconst params: z.ZodType<ViewRevokeParams> = z\n .object({\n tokenId: TokenId.schema,\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ViewRevokeParams\" });\n\nconst result: z.ZodType<ViewRevokeResult> = z\n .object({})\n .register(wireRegistry, { id: \"ViewRevokeResult\" });\n\n/**\n * `view/revoke`: ends a capability link and every session opened with it; both answer 410 from\n * then on (HY-03). Revoking a revoked token succeeds; an unknown token is\n * `MOSTRA_HYGIENE_TOKEN_INVALID`.\n */\nexport const viewRevokeMethod: MethodDefinition<ViewRevokeParams, ViewRevokeResult> = defineMethod({\n method: \"view/revoke\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result,\n});\n"],"mappings":";;;;;AAgBA,MAAM,SAAsC,EACzC,OAAO;CACN,SAAS,QAAQ;CACjB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;AAEpD,MAAM,SAAsC,EACzC,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;;AAOpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { MethodDefinition } from "../../method.js";
2
+ import { CapabilityLink } from "./url.js";
3
+ //#region src/methods/view/rotate.d.ts
4
+ /** The params of `view/rotate` (D97). */
5
+ export interface ViewRotateParams {
6
+ /** The token to replace. */
7
+ readonly tokenId: string;
8
+ /** Makes retries idempotent: a repeated `requestId` returns the same new link (H-03). */
9
+ readonly requestId?: string;
10
+ }
11
+ /** The result of `view/rotate`: the new link. */
12
+ export type ViewRotateResult = CapabilityLink;
13
+ /**
14
+ * `view/rotate`: replaces a capability link in one step. The new link has the same artifact,
15
+ * scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's
16
+ * default link makes the new one its default. A revoked or expired token can't be rotated
17
+ * (`MOSTRA_HYGIENE_TOKEN_REVOKED`).
18
+ */
19
+ export declare const viewRotateMethod: MethodDefinition<ViewRotateParams, ViewRotateResult>;
20
+ //#endregion
21
+ //# sourceMappingURL=rotate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.d.ts","names":[],"sources":["../../../src/methods/view/rotate.ts"],"mappings":";;;;iBAOiB;;WAEN;;WAEA;;;YAIC,mBAAmB;;;;;;;qBAelB,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,27 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { TokenId } from "../../ids.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { CapabilityLink } from "./url.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/view/rotate.ts
7
+ const params = z.object({
8
+ tokenId: TokenId.schema,
9
+ requestId: z.string().min(1).exactOptional()
10
+ }).register(wireRegistry, { id: "ViewRotateParams" });
11
+ /**
12
+ * `view/rotate`: replaces a capability link in one step. The new link has the same artifact,
13
+ * scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's
14
+ * default link makes the new one its default. A revoked or expired token can't be rotated
15
+ * (`MOSTRA_HYGIENE_TOKEN_REVOKED`).
16
+ */
17
+ const viewRotateMethod = defineMethod({
18
+ method: "view/rotate",
19
+ direction: "client-to-instance",
20
+ mutating: true,
21
+ params,
22
+ result: CapabilityLink
23
+ });
24
+ //#endregion
25
+ export { viewRotateMethod };
26
+
27
+ //# sourceMappingURL=rotate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.js","names":[],"sources":["../../../src/methods/view/rotate.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { TokenId } from \"../../ids.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\nimport { CapabilityLink } from \"./url.ts\";\n\n/** The params of `view/rotate` (D97). */\nexport interface ViewRotateParams {\n /** The token to replace. */\n readonly tokenId: string;\n /** Makes retries idempotent: a repeated `requestId` returns the same new link (H-03). */\n readonly requestId?: string;\n}\n\n/** The result of `view/rotate`: the new link. */\nexport type ViewRotateResult = CapabilityLink;\n\nconst params: z.ZodType<ViewRotateParams> = z\n .object({\n tokenId: TokenId.schema,\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ViewRotateParams\" });\n\n/**\n * `view/rotate`: replaces a capability link in one step. The new link has the same artifact,\n * scopes and expiry; the old one and its sessions answer 410 from then on. Rotating the artifact's\n * default link makes the new one its default. A revoked or expired token can't be rotated\n * (`MOSTRA_HYGIENE_TOKEN_REVOKED`).\n */\nexport const viewRotateMethod: MethodDefinition<ViewRotateParams, ViewRotateResult> = defineMethod({\n method: \"view/rotate\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: CapabilityLink,\n});\n"],"mappings":";;;;;;AAiBA,MAAM,SAAsC,EACzC,OAAO;CACN,SAAS,QAAQ;CACjB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;;;AAQpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { Viewer, ViewerSpec } from "../../interaction.js";
3
+ import { CapabilityScope, Duration } from "../../capability.js";
4
+ import { MethodDefinition } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/view/url.d.ts
7
+ /** The params of `view/url` (INTERFACES §6, D97). */
8
+ export interface ViewUrlParams {
9
+ /** The artifact the link opens. */
10
+ readonly artifact: ArtifactRef;
11
+ /**
12
+ * The version the link opens, by number or ID. Without it the link opens the artifact's latest
13
+ * version whenever it is used.
14
+ */
15
+ readonly version?: number | string;
16
+ /** What the link allows (D97). Default: every scope. `view` is always included. */
17
+ readonly scopes?: readonly CapabilityScope[];
18
+ /** How long the link works, such as `24h` or `7d`. Default: until it is revoked (D63). */
19
+ readonly ttl?: Duration;
20
+ /**
21
+ * The person the link acts for (D104): its sessions draft, submit and sign as that viewer, so
22
+ * `once` per-viewer gives each person one submission. Absent: the home's local user.
23
+ */
24
+ readonly viewer?: ViewerSpec;
25
+ /** Makes retries idempotent: a repeated `requestId` returns the same link (H-03). */
26
+ readonly requestId?: string;
27
+ }
28
+ /** A capability link: what `view/url` and `view/rotate` return. */
29
+ export interface CapabilityLink {
30
+ /** The capability URL. Holding it is the authorization (D06); share it like a password. */
31
+ readonly url: string;
32
+ /** The token's ID, for `view/rotate` and `view/revoke`. Never a secret. */
33
+ readonly tokenId: string;
34
+ /** The scopes the link carries, `view` included. */
35
+ readonly scopes: readonly CapabilityScope[];
36
+ /** When the link stops working; absent when it works until revoked. */
37
+ readonly expiresAt?: string;
38
+ /** The viewer the link acts for, when it was minted with one (D104). */
39
+ readonly viewer?: Viewer;
40
+ }
41
+ /** The result of `view/url`. */
42
+ export type ViewUrlResult = CapabilityLink;
43
+ /** The Zod schema of the `CapabilityLink` type. */
44
+ export declare const CapabilityLink: z.ZodType<CapabilityLink>;
45
+ /**
46
+ * `view/url`: mints a new capability link to an artifact, with the scopes and lifetime asked for.
47
+ * Each call mints a separate token that `view/revoke` ends on its own; the artifact's default link
48
+ * is the publish receipt's `url`.
49
+ */
50
+ export declare const viewUrlMethod: MethodDefinition<ViewUrlParams, ViewUrlResult>;
51
+ //#endregion
52
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","names":[],"sources":["../../../src/methods/view/url.ts"],"mappings":";;;;;;;iBASiB;;WAEN,UAAU;;;;;WAKV;;WAEA,kBAAkB;;WAElB,MAAM;;;;;WAKN,SAAS;;WAET;;;iBAIM;;WAEN;;WAEA;;WAEA,iBAAiB;;WAEjB;;WAEA,SAAS;;;YAIR,gBAAgB;;qBAGf,gBAAgB,EAAE,QAAQ;;;;;;qBA6B1B,eAAe,iBAAiB,eAAe"}
@@ -0,0 +1,43 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { TokenId, VersionId } from "../../ids.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { Viewer, ViewerSpec } from "../../interaction.js";
5
+ import { CapabilityScope, Duration } from "../../capability.js";
6
+ import { defineMethod } from "../../method.js";
7
+ import * as z from "zod";
8
+ //#region src/methods/view/url.ts
9
+ /** The Zod schema of the `CapabilityLink` type. */
10
+ const CapabilityLink = z.object({
11
+ url: z.string().min(1),
12
+ tokenId: TokenId.schema,
13
+ scopes: z.array(CapabilityScope).readonly(),
14
+ expiresAt: z.iso.datetime().exactOptional(),
15
+ viewer: Viewer.exactOptional()
16
+ }).register(wireRegistry, {
17
+ id: "CapabilityLink",
18
+ description: "A capability URL with its token ID, scopes and expiry."
19
+ });
20
+ const params = z.object({
21
+ artifact: ArtifactRef,
22
+ version: z.union([z.int().min(1), VersionId.schema]).exactOptional(),
23
+ scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),
24
+ ttl: Duration.exactOptional(),
25
+ viewer: ViewerSpec.exactOptional(),
26
+ requestId: z.string().min(1).exactOptional()
27
+ }).register(wireRegistry, { id: "ViewUrlParams" });
28
+ /**
29
+ * `view/url`: mints a new capability link to an artifact, with the scopes and lifetime asked for.
30
+ * Each call mints a separate token that `view/revoke` ends on its own; the artifact's default link
31
+ * is the publish receipt's `url`.
32
+ */
33
+ const viewUrlMethod = defineMethod({
34
+ method: "view/url",
35
+ direction: "client-to-instance",
36
+ mutating: true,
37
+ params,
38
+ result: CapabilityLink
39
+ });
40
+ //#endregion
41
+ export { CapabilityLink, viewUrlMethod };
42
+
43
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","names":[],"sources":["../../../src/methods/view/url.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { CapabilityScope, Duration } from \"../../capability.ts\";\nimport { TokenId, VersionId } from \"../../ids.ts\";\nimport { Viewer, ViewerSpec } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `view/url` (INTERFACES §6, D97). */\nexport interface ViewUrlParams {\n /** The artifact the link opens. */\n readonly artifact: ArtifactRef;\n /**\n * The version the link opens, by number or ID. Without it the link opens the artifact's latest\n * version whenever it is used.\n */\n readonly version?: number | string;\n /** What the link allows (D97). Default: every scope. `view` is always included. */\n readonly scopes?: readonly CapabilityScope[];\n /** How long the link works, such as `24h` or `7d`. Default: until it is revoked (D63). */\n readonly ttl?: Duration;\n /**\n * The person the link acts for (D104): its sessions draft, submit and sign as that viewer, so\n * `once` per-viewer gives each person one submission. Absent: the home's local user.\n */\n readonly viewer?: ViewerSpec;\n /** Makes retries idempotent: a repeated `requestId` returns the same link (H-03). */\n readonly requestId?: string;\n}\n\n/** A capability link: what `view/url` and `view/rotate` return. */\nexport interface CapabilityLink {\n /** The capability URL. Holding it is the authorization (D06); share it like a password. */\n readonly url: string;\n /** The token's ID, for `view/rotate` and `view/revoke`. Never a secret. */\n readonly tokenId: string;\n /** The scopes the link carries, `view` included. */\n readonly scopes: readonly CapabilityScope[];\n /** When the link stops working; absent when it works until revoked. */\n readonly expiresAt?: string;\n /** The viewer the link acts for, when it was minted with one (D104). */\n readonly viewer?: Viewer;\n}\n\n/** The result of `view/url`. */\nexport type ViewUrlResult = CapabilityLink;\n\n/** The Zod schema of the `CapabilityLink` type. */\nexport const CapabilityLink: z.ZodType<CapabilityLink> = z\n .object({\n url: z.string().min(1),\n tokenId: TokenId.schema,\n scopes: z.array(CapabilityScope).readonly(),\n expiresAt: z.iso.datetime().exactOptional(),\n viewer: Viewer.exactOptional(),\n })\n .register(wireRegistry, {\n id: \"CapabilityLink\",\n description: \"A capability URL with its token ID, scopes and expiry.\",\n });\n\nconst params: z.ZodType<ViewUrlParams> = z\n .object({\n artifact: ArtifactRef,\n version: z.union([z.int().min(1), VersionId.schema]).exactOptional(),\n scopes: z.array(CapabilityScope).min(1).readonly().exactOptional(),\n ttl: Duration.exactOptional(),\n viewer: ViewerSpec.exactOptional(),\n requestId: z.string().min(1).exactOptional(),\n })\n .register(wireRegistry, { id: \"ViewUrlParams\" });\n\n/**\n * `view/url`: mints a new capability link to an artifact, with the scopes and lifetime asked for.\n * Each call mints a separate token that `view/revoke` ends on its own; the artifact's default link\n * is the publish receipt's `url`.\n */\nexport const viewUrlMethod: MethodDefinition<ViewUrlParams, ViewUrlResult> = defineMethod({\n method: \"view/url\",\n direction: \"client-to-instance\",\n mutating: true,\n params,\n result: CapabilityLink,\n});\n"],"mappings":";;;;;;;;;AAgDA,MAAa,iBAA4C,EACtD,OAAO;CACN,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACrB,SAAS,QAAQ;CACjB,QAAQ,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS;CAC1C,WAAW,EAAE,IAAI,SAAS,CAAC,CAAC,cAAc;CAC1C,QAAQ,OAAO,cAAc;AAC/B,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAmC,EACtC,OAAO;CACN,UAAU;CACV,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,UAAU,MAAM,CAAC,CAAC,CAAC,cAAc;CACnE,QAAQ,EAAE,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,cAAc;CACjE,KAAK,SAAS,cAAc;CAC5B,QAAQ,WAAW,cAAc;CACjC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc;AAC7C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,gBAAgB,CAAC;;;;;;AAOjD,MAAa,gBAAgE,aAAa;CACxF,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { EventRecord, WaitCondition } from "../../interaction.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/wait/wait.d.ts
5
+ /** The longest `wait`, in milliseconds: the longest timer JavaScript keeps (about 24.8 days). */
6
+ export declare const WAIT_MAX_MS = 2147483647;
7
+ /** The params of `wait` (INTERFACES §6, ARCHITECTURE §6, D103). */
8
+ export interface WaitParams {
9
+ /** The artifact to wait on. */
10
+ readonly artifact: ArtifactRef;
11
+ /** `submitted`, `signal:<name>`, `state:<fieldId>` or `event:<type>`. */
12
+ readonly until: WaitCondition;
13
+ /**
14
+ * Wait for what happens after this cursor (edge-triggered conditions, and `submitted` under
15
+ * `epochs`). Default: the cursor of the artifact's latest publish.
16
+ */
17
+ readonly after?: string;
18
+ /** How long to block, in milliseconds; 0 checks once. */
19
+ readonly timeoutMs: number;
20
+ }
21
+ /** The result of `wait`. */
22
+ export type WaitResult = {
23
+ readonly status: "satisfied";
24
+ readonly event: EventRecord;
25
+ readonly cursor: string;
26
+ } | {
27
+ readonly status: "still_waiting";
28
+ readonly cursor: string;
29
+ };
30
+ /**
31
+ * `wait`: blocks until a condition holds or the timeout passes (IN-10). `satisfied` carries the
32
+ * event that met it; `still_waiting` carries the newest cursor examined, so a later wait from it
33
+ * misses nothing.
34
+ */
35
+ export declare const waitMethod: MethodDefinition<WaitParams, WaitResult>;
36
+ //#endregion
37
+ //# sourceMappingURL=wait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.d.ts","names":[],"sources":["../../../src/methods/wait/wait.ts"],"mappings":";;;;;qBAQa;;iBAGI;;WAEN,UAAU;;WAEV,OAAO;;;;;WAKP;;WAEA;;;YAIC;WACG;WAA8B,OAAO;WAAsB;;WAC3D;WAAkC;;;;;;;qBAuBpC,YAAY,iBAAiB,YAAY"}
@@ -0,0 +1,39 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { Cursor } from "../../ids.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { EventRecord, WaitCondition } from "../../interaction.js";
5
+ import { defineMethod } from "../../method.js";
6
+ import * as z from "zod";
7
+ //#region src/methods/wait/wait.ts
8
+ /** The longest `wait`, in milliseconds: the longest timer JavaScript keeps (about 24.8 days). */
9
+ const WAIT_MAX_MS = 2147483647;
10
+ const params = z.object({
11
+ artifact: ArtifactRef,
12
+ until: WaitCondition,
13
+ after: Cursor.schema.exactOptional(),
14
+ timeoutMs: z.int().min(0).max(WAIT_MAX_MS)
15
+ }).register(wireRegistry, { id: "WaitParams" });
16
+ const result = z.discriminatedUnion("status", [z.object({
17
+ status: z.literal("satisfied"),
18
+ event: EventRecord,
19
+ cursor: Cursor.schema
20
+ }), z.object({
21
+ status: z.literal("still_waiting"),
22
+ cursor: Cursor.schema
23
+ })]).register(wireRegistry, { id: "WaitResult" });
24
+ /**
25
+ * `wait`: blocks until a condition holds or the timeout passes (IN-10). `satisfied` carries the
26
+ * event that met it; `still_waiting` carries the newest cursor examined, so a later wait from it
27
+ * misses nothing.
28
+ */
29
+ const waitMethod = defineMethod({
30
+ method: "wait",
31
+ direction: "client-to-instance",
32
+ mutating: false,
33
+ params,
34
+ result
35
+ });
36
+ //#endregion
37
+ export { WAIT_MAX_MS, waitMethod };
38
+
39
+ //# sourceMappingURL=wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.js","names":[],"sources":["../../../src/methods/wait/wait.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { Cursor } from \"../../ids.ts\";\nimport { EventRecord, WaitCondition } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The longest `wait`, in milliseconds: the longest timer JavaScript keeps (about 24.8 days). */\nexport const WAIT_MAX_MS = 2_147_483_647;\n\n/** The params of `wait` (INTERFACES §6, ARCHITECTURE §6, D103). */\nexport interface WaitParams {\n /** The artifact to wait on. */\n readonly artifact: ArtifactRef;\n /** `submitted`, `signal:<name>`, `state:<fieldId>` or `event:<type>`. */\n readonly until: WaitCondition;\n /**\n * Wait for what happens after this cursor (edge-triggered conditions, and `submitted` under\n * `epochs`). Default: the cursor of the artifact's latest publish.\n */\n readonly after?: string;\n /** How long to block, in milliseconds; 0 checks once. */\n readonly timeoutMs: number;\n}\n\n/** The result of `wait`. */\nexport type WaitResult =\n | { readonly status: \"satisfied\"; readonly event: EventRecord; readonly cursor: string }\n | { readonly status: \"still_waiting\"; readonly cursor: string };\n\nconst params: z.ZodType<WaitParams> = z\n .object({\n artifact: ArtifactRef,\n until: WaitCondition,\n after: Cursor.schema.exactOptional(),\n timeoutMs: z.int().min(0).max(WAIT_MAX_MS),\n })\n .register(wireRegistry, { id: \"WaitParams\" });\n\nconst result: z.ZodType<WaitResult> = z\n .discriminatedUnion(\"status\", [\n z.object({ status: z.literal(\"satisfied\"), event: EventRecord, cursor: Cursor.schema }),\n z.object({ status: z.literal(\"still_waiting\"), cursor: Cursor.schema }),\n ])\n .register(wireRegistry, { id: \"WaitResult\" });\n\n/**\n * `wait`: blocks until a condition holds or the timeout passes (IN-10). `satisfied` carries the\n * event that met it; `still_waiting` carries the newest cursor examined, so a later wait from it\n * misses nothing.\n */\nexport const waitMethod: MethodDefinition<WaitParams, WaitResult> = defineMethod({\n method: \"wait\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;;;AAQA,MAAa,cAAc;AAsB3B,MAAM,SAAgC,EACnC,OAAO;CACN,UAAU;CACV,OAAO;CACP,OAAO,OAAO,OAAO,cAAc;CACnC,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW;AAC3C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;AAE9C,MAAM,SAAgC,EACnC,mBAAmB,UAAU,CAC5B,EAAE,OAAO;CAAE,QAAQ,EAAE,QAAQ,WAAW;CAAG,OAAO;CAAa,QAAQ,OAAO;AAAO,CAAC,GACtF,EAAE,OAAO;CAAE,QAAQ,EAAE,QAAQ,eAAe;CAAG,QAAQ,OAAO;AAAO,CAAC,CACxE,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,aAAa,CAAC;;;;;;AAO9C,MAAa,aAAuD,aAAa;CAC/E,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}