@mostra/protocol 0.0.0-placeholder → 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 +37 -1
  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 -4
  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,86 @@
1
+ import { ARGUMENT_BIGINT_DIGITS_MAX, AnyFunction, Frame, RemoteError, SerializationError, SerializeMode, UNSERIALIZABLE_CODE, ValueReader, ValueReaderOptions, ValueWriter, ValueWriterOptions, WireError, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
2
+ import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallLine, CallRequest, EphemeralMessage, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, LiveState, LiveUpdate, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunDelta, RunProgress, RunReason, RunRequest, RunState, RunStatus, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, isFinalRunStatus } from "./actions.js";
3
+ import { ARTIFACT_MANIFEST_KEYS, ArtifactFamily, ArtifactLink, ArtifactManifest, DemoSpec, SubmissionPolicy, TerminalSpec } from "./manifest.js";
4
+ import { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary } from "./artifact.js";
5
+ import { ControlsPolicy, DeliveryTarget, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, VersionRef, ViewContext, ViewContextWire, readViewContext } from "./view.js";
6
+ import { AnyBridgeMessage, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, Bridge, BridgeEvent, BridgeHostContext, BridgeImplementation, BridgeMessage, BridgeOptions, BridgePeer, BridgeReceiver, BridgeRejection, BridgeSide, CONTROL_LABEL_MAX, ControlRequest, FieldRegistration, FieldsParams, FlushResult, MCP_APPS_PROTOCOL_VERSION, OPEN_LINK_SCHEMES, SaveState, SubmitBlocker, UiInitializeParams, UiInitializeResult, VersionAvailableParams, connectBridge, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraPage, mostraReady, mostraVersionAvailable, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged } from "./bridge.js";
7
+ import { ArtifactId, CommentId, Cursor, DeliveryId, GeneratedIdKind, Id, IdBody, IdKind, IdPrefix, MutationId, RunId, SubmissionId, ThreadId, TokenId, VersionId, VersionIdKind, ViewId, ViewerId } from "./ids.js";
8
+ import { Actor, DeliveryState, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldScope, FieldState, MutationResult, Rect, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerKind, ViewerSpec, Viewport, WaitCondition, isFieldId } from "./interaction.js";
9
+ import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, FieldsRequest, FollowRequest, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, SubmitRequest } from "./browser.js";
10
+ import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatform, BundlePlatformSchema, BundleSetup, bundleAssetName } from "./bundle.js";
11
+ import { canonicalJson } from "./canonical.js";
12
+ import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
13
+ import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticArea, DiagnosticCode, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
14
+ import { AreaCatalog, DEFAULT_DOCS_BASE, DiagnosticDetails, DiagnosticSpec, docsUrl } from "./diagnostics/spec.js";
15
+ import { A11yDiagnosticCode, a11yDiagnosticCodes } from "./diagnostics/codes/a11y.js";
16
+ import { ActionDiagnosticCode, actionDiagnosticCodes } from "./diagnostics/codes/action.js";
17
+ import { ArtifactDiagnosticCode, artifactDiagnosticCodes } from "./diagnostics/codes/artifact.js";
18
+ import { BuildDiagnosticCode, buildDiagnosticCodes } from "./diagnostics/codes/build.js";
19
+ import { CliDiagnosticCode, cliDiagnosticCodes } from "./diagnostics/codes/cli.js";
20
+ import { ConsoleDiagnosticCode, consoleDiagnosticCodes } from "./diagnostics/codes/console.js";
21
+ import { DepDiagnosticCode, depDiagnosticCodes } from "./diagnostics/codes/dep.js";
22
+ import { EnvDiagnosticCode, envDiagnosticCodes } from "./diagnostics/codes/env.js";
23
+ import { FieldDiagnosticCode, fieldDiagnosticCodes } from "./diagnostics/codes/field.js";
24
+ import { HomeDiagnosticCode, homeDiagnosticCodes } from "./diagnostics/codes/home.js";
25
+ import { HostDiagnosticCode, hostDiagnosticCodes } from "./diagnostics/codes/host.js";
26
+ import { HygieneDiagnosticCode, hygieneDiagnosticCodes } from "./diagnostics/codes/hygiene.js";
27
+ import { LiveDiagnosticCode, liveDiagnosticCodes } from "./diagnostics/codes/live.js";
28
+ import { ManifestDiagnosticCode, manifestDiagnosticCodes } from "./diagnostics/codes/manifest.js";
29
+ import { NetworkDiagnosticCode, networkDiagnosticCodes } from "./diagnostics/codes/network.js";
30
+ import { PlatformDiagnosticCode, platformDiagnosticCodes } from "./diagnostics/codes/platform.js";
31
+ import { PublishDiagnosticCode, publishDiagnosticCodes } from "./diagnostics/codes/publish.js";
32
+ import { RegressionDiagnosticCode, regressionDiagnosticCodes } from "./diagnostics/codes/regression.js";
33
+ import { RuntimeDiagnosticCode, runtimeDiagnosticCodes } from "./diagnostics/codes/runtime.js";
34
+ import { SecretDiagnosticCode, secretDiagnosticCodes } from "./diagnostics/codes/secret.js";
35
+ import { SmokeDiagnosticCode, smokeDiagnosticCodes } from "./diagnostics/codes/smoke.js";
36
+ import { SubmitDiagnosticCode, submitDiagnosticCodes } from "./diagnostics/codes/submit.js";
37
+ import { TargetDiagnosticCode, targetDiagnosticCodes } from "./diagnostics/codes/target.js";
38
+ import { TypeDiagnosticCode, typeDiagnosticCodes } from "./diagnostics/codes/type.js";
39
+ import { VerifyDiagnosticCode, verifyDiagnosticCodes } from "./diagnostics/codes/verify.js";
40
+ import { CreateDiagnosticOptions, KnownDiagnosticCode, createDiagnostic, diagnosticCatalog } from "./diagnostics/codes/index.js";
41
+ import { CSRF_HEADER, Refusal, RequestFacts, RequestIntent, RequestPolicy, checkRequest, headerValue, isJsonContentType, refusal, safeEqual, safePath } from "./hygiene.js";
42
+ import { AnyMethod, MethodDefinition, MethodDirection, defineMethod } from "./method.js";
43
+ import { ArtifactCreateParams, ArtifactCreateResult, artifactCreateMethod } from "./methods/artifact/create.js";
44
+ import { ArtifactGetParams, ArtifactGetResult, artifactGetMethod } from "./methods/artifact/get.js";
45
+ import { ArtifactListFilter, ArtifactListParams, ArtifactListResult, artifactListMethod } from "./methods/artifact/list.js";
46
+ import { ArtifactPublishParams, ArtifactPublishResult, artifactPublishMethod } from "./methods/artifact/publish.js";
47
+ import { ARTIFACT_PROGRESS, ArtifactProgressParams, CompareRequest, CompareResult, DEFAULT_VIEWPORTS, ProbedField, RenderRequest, RenderResult, ScreenshotPolicy, TokenEstimate, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, VerdictAria, VerdictScreenshot, VerifyVerdict, VerifyViewport, ariaSummary, estimateImageTokens, viewportsFor } from "./verify.js";
48
+ import { ArtifactVerifyParams, ArtifactVerifyResult, artifactVerifyMethod } from "./methods/artifact/verify.js";
49
+ import { AddedPackage, DepsAddParams, DepsAddResult, depsAddMethod } from "./methods/deps/add.js";
50
+ import { DEV_NOTIFY, DevEventKind, DevNotifyParams, DevStartParams, DevStartResult, devStartMethod } from "./methods/dev/start.js";
51
+ import { DevStopParams, DevStopResult, devStopMethod } from "./methods/dev/stop.js";
52
+ import { EventsAckParams, EventsAckResult, eventsAckMethod } from "./methods/events/ack.js";
53
+ import { EVENTS_READ_MAX, EventsReadParams, EventsReadResult, eventsReadMethod } from "./methods/events/read.js";
54
+ import { EVENTS_NOTIFY, EventsNotifyParams, EventsSubscribeParams, EventsSubscribeResult, eventsSubscribeMethod } from "./methods/events/subscribe.js";
55
+ import { EventsUnsubscribeParams, EventsUnsubscribeResult, eventsUnsubscribeMethod } from "./methods/events/unsubscribe.js";
56
+ import { GcCompactEvents, GcCompacted, GcCount, GcRunParams, GcRunResult, GcVersion, gcRunMethod } from "./methods/gc/run.js";
57
+ import { hostMethods } from "./methods/index.js";
58
+ import { InstanceCheck, InstanceCheckParams, InstanceCheckResult, instanceCheckMethod } from "./methods/instance/check.js";
59
+ import { HOST_PROTOCOL_REVISIONS, Revision, RevisionNegotiation, negotiateRevision } from "./revision.js";
60
+ import { CLI_CLIENT_NAME, ClientCapabilities, ClientInfo, DependencyPolicy, HomeConfig, InstanceCapabilities, InstanceInfo, MostraInitializeParams, MostraInitializeResult, PortName, mostraInitializeMethod } from "./methods/mostra/initialize.js";
61
+ import { ChildProcessStatus, DeliveryCounts, GatewayStatus, InstanceStatusParams, InstanceStatusResult, WorkerStatus, instanceStatusMethod } from "./methods/instance/status.js";
62
+ import { LivePushParams, LivePushResult, livePushMethod } from "./methods/live/push.js";
63
+ import { MostraShutdownParams, MostraShutdownResult, mostraShutdownMethod } from "./methods/mostra/shutdown.js";
64
+ import { DraftMirror, DraftsMirrorResult, portDraftsMirrorMethod } from "./methods/port/drafts-mirror.js";
65
+ import { PortSecretsGetParams, PortSecretsGetResult, portSecretsGetMethod } from "./methods/port/secrets-get.js";
66
+ import { SubmissionEnvelope, SubmissionsDeliverResult, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
67
+ import { PortTrustedControlsActivatedParams, PortTrustedControlsActivatedResult, portTrustedControlsActivatedMethod } from "./methods/port/trusted-controls-activated.js";
68
+ import { PortTrustedControlsPolicyParams, PortTrustedControlsPolicyResult, portTrustedControlsPolicyMethod } from "./methods/port/trusted-controls-policy.js";
69
+ import { ResultsGetParams, ResultsGetResult, ResultsMarkdown, resultsGetMethod } from "./methods/results/get.js";
70
+ import { SecretDeleteParams, SecretDeleteResult, secretDeleteMethod } from "./methods/secret/delete.js";
71
+ import { SecretEntry, SecretSetParams, SecretSetResult, secretSetMethod } from "./methods/secret/set.js";
72
+ import { SecretListParams, SecretListResult, secretListMethod } from "./methods/secret/list.js";
73
+ import { StateGetParams, StateGetResult, stateGetMethod } from "./methods/state/get.js";
74
+ import { StatePatchParams, StatePatchResult, statePatchMethod } from "./methods/state/patch.js";
75
+ import { CapabilityLink, ViewUrlParams, ViewUrlResult, viewUrlMethod } from "./methods/view/url.js";
76
+ import { ViewDefaultParams, ViewDefaultResult, viewDefaultMethod } from "./methods/view/default.js";
77
+ import { ViewLaunchParams, ViewLaunchResult, viewLaunchMethod } from "./methods/view/launch.js";
78
+ import { ViewRevokeParams, ViewRevokeResult, viewRevokeMethod } from "./methods/view/revoke.js";
79
+ import { ViewRotateParams, ViewRotateResult, viewRotateMethod } from "./methods/view/rotate.js";
80
+ import { WAIT_MAX_MS, WaitParams, WaitResult, waitMethod } from "./methods/wait/wait.js";
81
+ import { ClassifiedMessage, JsonRpcErrorObject, JsonRpcFailure, JsonRpcId, JsonRpcMessage, JsonRpcNotification, JsonRpcParams, JsonRpcRequest, JsonRpcResponse, JsonRpcSuccess, classifyMessage } from "./rpc/messages.js";
82
+ import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
83
+ import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
84
+ import { RpcPeer, RpcPeerOptions, RpcRequestContext, RpcRequestOptions, parseParams } from "./rpc/peer.js";
85
+ import { CallContext, DEFAULT_WORKER_LIMITS, LiveSourceInfo, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ServerStatePatchResult, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerCancelParams, WorkerLimits, WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
86
+ export { type A11yDiagnosticCode, ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, type ActionDiagnosticCode, ActionError, Actor, AddedPackage, type AnyBridgeMessage, type AnyFunction, type AnyMethod, type AreaCatalog, type ArtifactCreateParams, type ArtifactCreateResult, ArtifactDetail, type ArtifactDiagnosticCode, type ArtifactFamily, type ArtifactGetParams, type ArtifactGetResult, ArtifactId, ArtifactLink, type ArtifactListFilter, type ArtifactListParams, type ArtifactListResult, ArtifactManifest, ArtifactProgressParams, type ArtifactPublishParams, type ArtifactPublishResult, ArtifactRef, ArtifactSummary, type ArtifactVerifyParams, type ArtifactVerifyResult, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, type Bridge, type BridgeEvent, type BridgeHostContext, type BridgeImplementation, type BridgeMessage, type BridgeOptions, type BridgePeer, type BridgeReceiver, type BridgeRejection, type BridgeSide, type BuildDiagnosticCode, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, type BundlePlatform, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, type CallContext, type CallLine, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, type ClassifiedMessage, type CliDiagnosticCode, ClientCapabilities, ClientInfo, CommentId, type CompareRequest, type CompareResult, type ConsoleDiagnosticCode, type ControlRequest, ControlsPolicy, type CreateDiagnosticOptions, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, type DeliveryState, DeliveryStatus, type DeliveryTarget, type DemoSpec, type DepDiagnosticCode, DependencyPolicy, type DepsAddParams, type DepsAddResult, type DevEventKind, DevNotifyParams, type DevStartParams, type DevStartResult, type DevStopParams, type DevStopResult, Diagnostic, type DiagnosticArea, type DiagnosticCode, type DiagnosticDetails, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, type DiagnosticSpec, DocumentRevision, DocumentSnapshot, DraftMirror, type DraftsMirrorResult, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, type EnvDiagnosticCode, type EphemeralMessage, EventFilter, EventRecord, EventTypePattern, type EventsAckParams, type EventsAckResult, EventsNotifyParams, type EventsReadParams, type EventsReadResult, type EventsSubscribeParams, type EventsSubscribeResult, type EventsUnsubscribeParams, type EventsUnsubscribeResult, FIELD_ID_MAX_LENGTH, FieldConflict, type FieldDiagnosticCode, FieldOp, type FieldRegistration, type FieldScope, FieldState, type FieldsParams, FieldsRequest, type FlushResult, FollowRequest, type Frame, FrameTicket, GatewayStatus, type GcCompactEvents, type GcCompacted, type GcCount, type GcRunParams, type GcRunResult, type GcVersion, type GeneratedIdKind, HOST_PROTOCOL_REVISIONS, HomeConfig, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type Id, type IdBody, type IdKind, type IdPrefix, InstanceCapabilities, type InstanceCheck, type InstanceCheckParams, type InstanceCheckResult, InstanceInfo, type InstanceStatusParams, type InstanceStatusResult, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, type JsonRpcId, type JsonRpcMessage, JsonRpcNotification, type JsonRpcParams, JsonRpcRequest, type JsonRpcResponse, JsonRpcSuccess, type KnownDiagnosticCode, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, type LiveDiagnosticCode, type LivePushParams, type LivePushResult, LiveRequest, type LiveSourceInfo, type LiveState, type LiveUpdate, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, type ManifestDiagnosticCode, type MethodDefinition, type MethodDirection, type MostraInitializeParams, type MostraInitializeResult, type MostraShutdownParams, type MostraShutdownResult, MutationId, MutationResult, type NetworkDiagnosticCode, OPEN_LINK_SCHEMES, OrphanedField, type PlatformDiagnosticCode, PollResult, PortName, type PortSecretsGetParams, type PortSecretsGetResult, type PortTrustedControlsActivatedParams, type PortTrustedControlsActivatedResult, type PortTrustedControlsPolicyParams, type PortTrustedControlsPolicyResult, type ProbedField, type PublishDiagnosticCode, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, type Rect, type Refusal, type RegressionDiagnosticCode, RemoteError, type RenderRequest, type RenderResult, type RequestFacts, type RequestIntent, type RequestPolicy, ResultComment, Results, type ResultsGetParams, type ResultsGetResult, ResultsMarkdown, Revision, type RevisionNegotiation, RpcError, RpcPeer, type RpcPeerOptions, type RpcRequestContext, type RpcRequestOptions, RunAttachRequest, RunCancelRequest, type RunDelta, RunId, RunProgress, type RunReason, RunRequest, RunState, type RunStatus, type RuntimeDiagnosticCode, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, type SaveState, ScreenshotPolicy, type SecretDeleteParams, type SecretDeleteResult, type SecretDiagnosticCode, SecretEntry, type SecretListParams, type SecretListResult, type SecretSetParams, type SecretSetResult, SerializationError, type SerializeMode, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, type ServerStatePatchResult, ShellSubmitRequest, SignalRequest, type SmokeDiagnosticCode, SourceRef, type StateGetParams, type StateGetResult, type StatePatchParams, type StatePatchResult, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, type SubmissionsDeliverResult, type SubmitBlocker, SubmitChannel, type SubmitDiagnosticCode, SubmitRequest, type TargetDiagnosticCode, type TerminalSpec, ThreadId, type TokenEstimate, TokenId, TrustedControl, type TypeDiagnosticCode, UNSERIALIZABLE_CODE, type UiInitializeParams, type UiInitializeResult, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, type ValueReaderOptions, ValueWriter, type ValueWriterOptions, type VerdictAria, type VerdictScreenshot, type VerifyDiagnosticCode, VerifyVerdict, type VerifyViewport, type VersionAvailableParams, VersionId, type VersionIdKind, VersionRef, VersionSummary, ViewContext, ViewContextWire, type ViewDefaultParams, type ViewDefaultResult, ViewId, type ViewLaunchParams, type ViewLaunchResult, type ViewRevokeParams, type ViewRevokeResult, type ViewRotateParams, type ViewRotateResult, type ViewUrlParams, type ViewUrlResult, Viewer, ViewerId, type ViewerKind, ViewerSpec, type Viewport, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, type WaitParams, type WaitResult, type WireError, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, type WorkerCancelParams, type WorkerLimits, type WorkerLiveParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
package/dist/index.js ADDED
@@ -0,0 +1,86 @@
1
+ import { ArtifactId, CommentId, Cursor, DeliveryId, MutationId, RunId, SubmissionId, ThreadId, TokenId, VersionId, ViewId, ViewerId } from "./ids.js";
2
+ import { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ActionError, Batches, CallRequest, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LiveRequest, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RunAttachRequest, RunCancelRequest, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, isFinalRunStatus } from "./actions.js";
3
+ import { ARTIFACT_MANIFEST_KEYS, ArtifactLink, ArtifactManifest, SubmissionPolicy } from "./manifest.js";
4
+ import { ArtifactDetail, ArtifactRef, ArtifactSummary, PublishReceipt, SourceRef, VersionSummary } from "./artifact.js";
5
+ import { hostDiagnosticCodes } from "./diagnostics/codes/host.js";
6
+ import { DIAGNOSTIC_AREAS, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity } from "./diagnostics/diagnostic.js";
7
+ import { DEFAULT_DOCS_BASE, docsUrl } from "./diagnostics/spec.js";
8
+ import { JSON_RPC_ERROR_CODES, RpcError } from "./rpc/error.js";
9
+ import { JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, classifyMessage } from "./rpc/messages.js";
10
+ import { RpcPeer, parseParams } from "./rpc/peer.js";
11
+ import { ControlsPolicy, REVIEW_SET_ID_PATTERN, SubmitChannel, TrustedControl, VersionRef, ViewContext, ViewContextWire, readViewContext } from "./view.js";
12
+ import { BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, CONTROL_LABEL_MAX, MCP_APPS_PROTOCOL_VERSION, OPEN_LINK_SCHEMES, connectBridge, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraPage, mostraReady, mostraVersionAvailable, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged } from "./bridge.js";
13
+ import { Actor, DeliveryStatus, DocumentRevision, EventFilter, EventRecord, EventTypePattern, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, MutationResult, ResultComment, Results, SIGNAL_NAME_PATTERN, SubmissionSummary, Viewer, ViewerSpec, WaitCondition, isFieldId } from "./interaction.js";
14
+ import { BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, CarryOver, ChooseRequest, DocumentSnapshot, FieldsRequest, FollowRequest, FrameTicket, OrphanedField, PollResult, SIGNAL_PAYLOAD_MAX_BYTES, ShellSubmitRequest, SignalRequest, StreamSnapshot, SubmitRequest } from "./browser.js";
15
+ import { BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, bundleAssetName } from "./bundle.js";
16
+ import { canonicalJson } from "./canonical.js";
17
+ import { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows } from "./capability.js";
18
+ import { a11yDiagnosticCodes } from "./diagnostics/codes/a11y.js";
19
+ import { actionDiagnosticCodes } from "./diagnostics/codes/action.js";
20
+ import { artifactDiagnosticCodes } from "./diagnostics/codes/artifact.js";
21
+ import { buildDiagnosticCodes } from "./diagnostics/codes/build.js";
22
+ import { cliDiagnosticCodes } from "./diagnostics/codes/cli.js";
23
+ import { consoleDiagnosticCodes } from "./diagnostics/codes/console.js";
24
+ import { depDiagnosticCodes } from "./diagnostics/codes/dep.js";
25
+ import { envDiagnosticCodes } from "./diagnostics/codes/env.js";
26
+ import { fieldDiagnosticCodes } from "./diagnostics/codes/field.js";
27
+ import { homeDiagnosticCodes } from "./diagnostics/codes/home.js";
28
+ import { hygieneDiagnosticCodes } from "./diagnostics/codes/hygiene.js";
29
+ import { liveDiagnosticCodes } from "./diagnostics/codes/live.js";
30
+ import { manifestDiagnosticCodes } from "./diagnostics/codes/manifest.js";
31
+ import { networkDiagnosticCodes } from "./diagnostics/codes/network.js";
32
+ import { platformDiagnosticCodes } from "./diagnostics/codes/platform.js";
33
+ import { publishDiagnosticCodes } from "./diagnostics/codes/publish.js";
34
+ import { regressionDiagnosticCodes } from "./diagnostics/codes/regression.js";
35
+ import { runtimeDiagnosticCodes } from "./diagnostics/codes/runtime.js";
36
+ import { secretDiagnosticCodes } from "./diagnostics/codes/secret.js";
37
+ import { smokeDiagnosticCodes } from "./diagnostics/codes/smoke.js";
38
+ import { submitDiagnosticCodes } from "./diagnostics/codes/submit.js";
39
+ import { targetDiagnosticCodes } from "./diagnostics/codes/target.js";
40
+ import { typeDiagnosticCodes } from "./diagnostics/codes/type.js";
41
+ import { verifyDiagnosticCodes } from "./diagnostics/codes/verify.js";
42
+ import { createDiagnostic, diagnosticCatalog } from "./diagnostics/codes/index.js";
43
+ import { CSRF_HEADER, checkRequest, headerValue, isJsonContentType, refusal, safeEqual, safePath } from "./hygiene.js";
44
+ import { defineMethod } from "./method.js";
45
+ import { artifactCreateMethod } from "./methods/artifact/create.js";
46
+ import { artifactGetMethod } from "./methods/artifact/get.js";
47
+ import { artifactListMethod } from "./methods/artifact/list.js";
48
+ import { artifactPublishMethod } from "./methods/artifact/publish.js";
49
+ import { ARTIFACT_PROGRESS, ArtifactProgressParams, DEFAULT_VIEWPORTS, ScreenshotPolicy, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, VerifyVerdict, ariaSummary, estimateImageTokens, viewportsFor } from "./verify.js";
50
+ import { artifactVerifyMethod } from "./methods/artifact/verify.js";
51
+ import { AddedPackage, depsAddMethod } from "./methods/deps/add.js";
52
+ import { DEV_NOTIFY, DevNotifyParams, devStartMethod } from "./methods/dev/start.js";
53
+ import { devStopMethod } from "./methods/dev/stop.js";
54
+ import { eventsAckMethod } from "./methods/events/ack.js";
55
+ import { EVENTS_READ_MAX, eventsReadMethod } from "./methods/events/read.js";
56
+ import { EVENTS_NOTIFY, EventsNotifyParams, eventsSubscribeMethod } from "./methods/events/subscribe.js";
57
+ import { eventsUnsubscribeMethod } from "./methods/events/unsubscribe.js";
58
+ import { gcRunMethod } from "./methods/gc/run.js";
59
+ import { instanceCheckMethod } from "./methods/instance/check.js";
60
+ import { HOST_PROTOCOL_REVISIONS, Revision, negotiateRevision } from "./revision.js";
61
+ import { CLI_CLIENT_NAME, ClientCapabilities, ClientInfo, DependencyPolicy, HomeConfig, InstanceCapabilities, InstanceInfo, PortName, mostraInitializeMethod } from "./methods/mostra/initialize.js";
62
+ import { ChildProcessStatus, DeliveryCounts, GatewayStatus, WorkerStatus, instanceStatusMethod } from "./methods/instance/status.js";
63
+ import { livePushMethod } from "./methods/live/push.js";
64
+ import { mostraShutdownMethod } from "./methods/mostra/shutdown.js";
65
+ import { DraftMirror, portDraftsMirrorMethod } from "./methods/port/drafts-mirror.js";
66
+ import { portSecretsGetMethod } from "./methods/port/secrets-get.js";
67
+ import { SubmissionEnvelope, portSubmissionsDeliverMethod } from "./methods/port/submissions-deliver.js";
68
+ import { portTrustedControlsActivatedMethod } from "./methods/port/trusted-controls-activated.js";
69
+ import { portTrustedControlsPolicyMethod } from "./methods/port/trusted-controls-policy.js";
70
+ import { ResultsMarkdown, resultsGetMethod } from "./methods/results/get.js";
71
+ import { secretDeleteMethod } from "./methods/secret/delete.js";
72
+ import { SecretEntry, secretSetMethod } from "./methods/secret/set.js";
73
+ import { secretListMethod } from "./methods/secret/list.js";
74
+ import { stateGetMethod } from "./methods/state/get.js";
75
+ import { statePatchMethod } from "./methods/state/patch.js";
76
+ import { CapabilityLink, viewUrlMethod } from "./methods/view/url.js";
77
+ import { viewDefaultMethod } from "./methods/view/default.js";
78
+ import { viewLaunchMethod } from "./methods/view/launch.js";
79
+ import { viewRevokeMethod } from "./methods/view/revoke.js";
80
+ import { viewRotateMethod } from "./methods/view/rotate.js";
81
+ import { WAIT_MAX_MS, waitMethod } from "./methods/wait/wait.js";
82
+ import { hostMethods } from "./methods/index.js";
83
+ import { LineSplitter, MAX_LINE_LENGTH, encodeLine } from "./rpc/lines.js";
84
+ import { ARGUMENT_BIGINT_DIGITS_MAX, RemoteError, SerializationError, UNSERIALIZABLE_CODE, ValueReader, ValueWriter, checkArgumentFrames, deserializeAll, fromBase64, serializeAll, toBase64, wireError } from "./serializer.js";
85
+ import { DEFAULT_WORKER_LIMITS, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef } from "./worker.js";
86
+ export { ACTION_ARGS_MAX, ACTION_RESULT_MAX, ALL_SCOPES, ARGUMENT_BIGINT_DIGITS_MAX, ARTIFACT_MANIFEST_KEYS, ARTIFACT_PROGRESS, ActionError, Actor, AddedPackage, ArtifactDetail, ArtifactId, ArtifactLink, ArtifactManifest, ArtifactProgressParams, ArtifactRef, ArtifactSummary, BRIDGE_FIELDS_MAX, BRIDGE_MESSAGES, BRIDGE_TEXT_MAX, BROWSER_PROTOCOL_REVISION, BROWSER_PROTOCOL_REVISIONS, BUNDLE_NAME, BUNDLE_PLATFORMS, BUNDLE_SETUP_MARKER, Batches, BundleAsset, BundleBrowser, BundleFileEntry, BundleFiles, BundleInfo, BundleLinkEntry, BundlePins, BundlePlatformSchema, BundleSetup, CLI_CLIENT_NAME, CONTROL_LABEL_MAX, CSRF_HEADER, CallRequest, CapabilityLink, CapabilityScope, CarryOver, ChildProcessStatus, ChooseRequest, ClientCapabilities, ClientInfo, CommentId, ControlsPolicy, Cursor, DEFAULT_DOCS_BASE, DEFAULT_VIEWPORTS, DEFAULT_WORKER_LIMITS, DEV_NOTIFY, DIAGNOSTIC_AREAS, DeliveryCounts, DeliveryId, DeliveryStatus, DependencyPolicy, DevNotifyParams, Diagnostic, DiagnosticFix, DiagnosticLocation, DiagnosticPhase, DiagnosticSeverity, DocumentRevision, DocumentSnapshot, DraftMirror, Duration, EVENTS_NOTIFY, EVENTS_READ_MAX, EventFilter, EventRecord, EventTypePattern, EventsNotifyParams, FIELD_ID_MAX_LENGTH, FieldConflict, FieldOp, FieldState, FieldsRequest, FollowRequest, FrameTicket, GatewayStatus, HOST_PROTOCOL_REVISIONS, HomeConfig, InstanceCapabilities, InstanceInfo, JSON_RPC_ERROR_CODES, JsonRpcErrorObject, JsonRpcFailure, JsonRpcNotification, JsonRpcRequest, JsonRpcSuccess, LIVE_KEY_PATTERN, LIVE_RING_DEFAULT, LIVE_RING_MAX, LIVE_VALUE_MAX, LineSplitter, LiveRequest, MAX_LINE_LENGTH, MCP_APPS_PROTOCOL_VERSION, MutationId, MutationResult, OPEN_LINK_SCHEMES, OrphanedField, PollResult, PortName, PublishReceipt, REVIEW_SET_ID_PATTERN, RUN_KEY_MAX, RUN_LOG_MAX, RUN_LOG_TRUNCATED, RUN_STATUSES, RemoteError, ResultComment, Results, ResultsMarkdown, Revision, RpcError, RpcPeer, RunAttachRequest, RunCancelRequest, RunId, RunProgress, RunRequest, RunState, SECRET_NAME_PATTERN, SECRET_VALUE_MAX, SIGNAL_NAME_PATTERN, SIGNAL_PAYLOAD_MAX_BYTES, ScreenshotPolicy, SecretEntry, SerializationError, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, ShellSubmitRequest, SignalRequest, SourceRef, StreamSnapshot, SubmissionEnvelope, SubmissionId, SubmissionPolicy, SubmissionSummary, SubmitChannel, SubmitRequest, ThreadId, TokenId, TrustedControl, UNSERIALIZABLE_CODE, VERIFY_PROBE, VERIFY_REPORT, VERIFY_RUNNER_METHODS, ValueReader, ValueWriter, VerifyVerdict, VersionId, VersionRef, VersionSummary, ViewContext, ViewContextWire, ViewId, Viewer, ViewerId, ViewerSpec, WAIT_MAX_MS, WORKER_CHANNEL_REVISION, WORKER_METHODS, WaitCondition, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerStatus, WorkerVersionRef, a11yDiagnosticCodes, actionDiagnosticCodes, ariaSummary, artifactCreateMethod, artifactDiagnosticCodes, artifactGetMethod, artifactListMethod, artifactPublishMethod, artifactVerifyMethod, buildDiagnosticCodes, bundleAssetName, canonicalJson, checkArgumentFrames, checkRequest, classifyMessage, cliDiagnosticCodes, connectBridge, consoleDiagnosticCodes, createDiagnostic, defineMethod, depDiagnosticCodes, depsAddMethod, deserializeAll, devStartMethod, devStopMethod, diagnosticCatalog, docsUrl, durationMs, encodeLine, envDiagnosticCodes, estimateImageTokens, eventsAckMethod, eventsReadMethod, eventsSubscribeMethod, eventsUnsubscribeMethod, fieldDiagnosticCodes, fromBase64, gcRunMethod, headerValue, homeDiagnosticCodes, hostDiagnosticCodes, hostMethods, hygieneDiagnosticCodes, instanceCheckMethod, instanceStatusMethod, isFieldId, isFinalRunStatus, isJsonContentType, liveDiagnosticCodes, livePushMethod, manifestDiagnosticCodes, mostraControlsRequest, mostraFieldFocus, mostraFields, mostraFlush, mostraInitializeMethod, mostraPage, mostraReady, mostraShutdownMethod, mostraVersionAvailable, negotiateRevision, networkDiagnosticCodes, normalizeScopes, parseParams, platformDiagnosticCodes, portDraftsMirrorMethod, portSecretsGetMethod, portSubmissionsDeliverMethod, portTrustedControlsActivatedMethod, portTrustedControlsPolicyMethod, publishDiagnosticCodes, readViewContext, refusal, regressionDiagnosticCodes, resultsGetMethod, runtimeDiagnosticCodes, safeEqual, safePath, scopeAllows, secretDeleteMethod, secretDiagnosticCodes, secretListMethod, secretSetMethod, serializeAll, smokeDiagnosticCodes, stateGetMethod, statePatchMethod, submitDiagnosticCodes, targetDiagnosticCodes, toBase64, typeDiagnosticCodes, uiInitialize, uiInitialized, uiOpenLink, uiSizeChanged, verifyDiagnosticCodes, viewDefaultMethod, viewLaunchMethod, viewRevokeMethod, viewRotateMethod, viewUrlMethod, viewportsFor, waitMethod, wireError };
@@ -0,0 +1,391 @@
1
+ import { ArtifactLink, SubmissionPolicy } from "./manifest.js";
2
+ import { ControlsPolicy, SubmitChannel, TrustedControl } from "./view.js";
3
+ import { Cursor } from "./ids.js";
4
+ import * as z from "zod";
5
+ //#region src/interaction.d.ts
6
+ /** How Mostra knows a viewer (DATA_MODEL §3 `viewer.kind`). */
7
+ export type ViewerKind = "local" | "tailnet" | "token" | "host";
8
+ /**
9
+ * A person who views an artifact (PRODUCT vocabulary). The home's local user is one viewer of kind
10
+ * `local`; a link minted with `viewer` acts as a viewer of kind `token` (D104).
11
+ */
12
+ export interface Viewer {
13
+ /** The viewer's ID. */
14
+ readonly id: string;
15
+ /** How Mostra knows the viewer. */
16
+ readonly kind: ViewerKind;
17
+ /** The display name, when one is known. */
18
+ readonly name?: string;
19
+ /** The host's own key for this person, as given to `view/url` (D104). */
20
+ readonly ref?: string;
21
+ }
22
+ /** The Zod schema of the `Viewer` type. */
23
+ export declare const Viewer: z.ZodType<Viewer>;
24
+ /**
25
+ * The person a capability link acts for (`view/url`'s `viewer`, D104): the host's stable key for
26
+ * them, such as an email or an account ID, and a display name.
27
+ */
28
+ export interface ViewerSpec {
29
+ /** The host's stable key for this person: the same `ref` always names the same viewer. */
30
+ readonly ref: string;
31
+ /** The name people see; updated when given again. */
32
+ readonly name?: string;
33
+ }
34
+ /** The Zod schema of the `ViewerSpec` type. */
35
+ export declare const ViewerSpec: z.ZodType<ViewerSpec>;
36
+ /** Who caused an event or wrote a field (DATA_MODEL §4). */
37
+ export interface Actor {
38
+ /** Who: a viewer, an agent (a protocol client), a host, or Mostra itself. */
39
+ readonly kind: "viewer" | "agent" | "host" | "mostra";
40
+ /** A viewer's ID, or the protocol client's name for agents and hosts. */
41
+ readonly id?: string;
42
+ /** A display name, when one is known. */
43
+ readonly name?: string;
44
+ }
45
+ /** The Zod schema of the `Actor` type. */
46
+ export declare const Actor: z.ZodType<Actor>;
47
+ /** The longest field ID, in UTF-16 code units. */
48
+ export declare const FIELD_ID_MAX_LENGTH = 256;
49
+ /**
50
+ * Whether `id` is a field ID (D52): 1 to 256 characters without control characters; dots separate
51
+ * the parts that nest in results, so none is empty.
52
+ */
53
+ export declare function isFieldId(id: unknown): id is string;
54
+ /** Which document a field belongs to: the viewer's draft, or the artifact's shared state (D63). */
55
+ export type FieldScope = "viewer" | "artifact";
56
+ /**
57
+ * A document revision: the decimal string of a document's monotonic counter (DATA_MODEL §3).
58
+ * `"0"` is a document nothing has written yet.
59
+ */
60
+ export type DocumentRevision = string;
61
+ /** The Zod schema of the `DocumentRevision` type. */
62
+ export declare const DocumentRevision: z.ZodType<DocumentRevision>;
63
+ /**
64
+ * One change to one field. Exactly one of `value` and `delete` is given. The optional metadata
65
+ * travels with the field into results and decides what events redact (D52, D106).
66
+ */
67
+ export interface FieldOp {
68
+ /** The field ID (D52). */
69
+ readonly id: string;
70
+ /** The new value: any JSON value, `null` included. */
71
+ readonly value?: unknown;
72
+ /** Removes the field. */
73
+ readonly delete?: true;
74
+ /** The label people see in results and the shell's blocker list. */
75
+ readonly label?: string;
76
+ /** Whether the shell asks for it before submit. */
77
+ readonly required?: boolean;
78
+ /** Kept in submissions and results, redacted from events and logs (D52). */
79
+ readonly sensitive?: boolean;
80
+ }
81
+ /** The Zod schema of the `FieldOp` type. */
82
+ export declare const FieldOp: z.ZodType<FieldOp>;
83
+ /** A field's current state. */
84
+ export interface FieldState {
85
+ /** The field's value: any JSON value. */
86
+ readonly value: unknown;
87
+ /** The document revision that last wrote it. */
88
+ readonly revision: DocumentRevision;
89
+ /** Who wrote it last. */
90
+ readonly updatedBy?: Actor;
91
+ /** When it was written last. */
92
+ readonly updatedAt: string;
93
+ /** The label people see. */
94
+ readonly label?: string;
95
+ /** Whether the shell asks for it before submit. */
96
+ readonly required?: boolean;
97
+ /** Whether events and logs redact its value (D52). */
98
+ readonly sensitive?: boolean;
99
+ }
100
+ /** The Zod schema of the `FieldState` type. */
101
+ export declare const FieldState: z.ZodType<FieldState>;
102
+ /**
103
+ * A field op that wasn't applied because the field changed after the mutation's base revision
104
+ * (D22, FAILURE_MODEL §5): what the field holds now, so the writer can keep theirs or take it.
105
+ */
106
+ export interface FieldConflict {
107
+ /** The field's ID. */
108
+ readonly id: string;
109
+ /** The revision that last changed the field. */
110
+ readonly revision: DocumentRevision;
111
+ /** Its current value; absent when it was deleted. */
112
+ readonly value?: unknown;
113
+ /** `true` when the field was deleted. */
114
+ readonly deleted?: true;
115
+ /** Who changed it. */
116
+ readonly updatedBy?: Actor;
117
+ /** When it changed. */
118
+ readonly updatedAt?: string;
119
+ }
120
+ /** The Zod schema of the `FieldConflict` type. */
121
+ export declare const FieldConflict: z.ZodType<FieldConflict>;
122
+ /** What a mutation did: the document's revision after it, the ops applied, and the conflicts. */
123
+ export interface MutationResult {
124
+ /** The document's revision after the mutation; unchanged when nothing applied. */
125
+ readonly revision: DocumentRevision;
126
+ /** The field IDs whose ops were applied. */
127
+ readonly applied: readonly string[];
128
+ /** The ops not applied, with what each field holds now. */
129
+ readonly conflicts: readonly FieldConflict[];
130
+ }
131
+ /** The Zod schema of the `MutationResult` type. */
132
+ export declare const MutationResult: z.ZodType<MutationResult>;
133
+ /**
134
+ * One durable event (DATA_MODEL §4). Its cursor is its stable ID and its place in the home-wide
135
+ * order; `seq` orders an artifact's own events without gaps.
136
+ */
137
+ export interface EventRecord {
138
+ /** The event's stable ID and home-wide position. */
139
+ readonly cursor: Cursor;
140
+ /** The artifact, or `null` for a home-wide event. */
141
+ readonly artifactId: string | null;
142
+ /** The artifact's sequence number, or `null` for a home-wide event. */
143
+ readonly seq: number | null;
144
+ /** The type from DATA_MODEL §4's catalog. */
145
+ readonly type: string;
146
+ /** When it was appended. */
147
+ readonly at: string;
148
+ /** Who caused it. */
149
+ readonly actor: Actor;
150
+ /** What caused it: a run, a mutation, a submission. */
151
+ readonly causation?: Readonly<Record<string, string>>;
152
+ /** The event's data; sensitive field values are redacted (D52). */
153
+ readonly payload: Readonly<Record<string, unknown>>;
154
+ }
155
+ /** The Zod schema of the `EventRecord` type. */
156
+ export declare const EventRecord: z.ZodType<EventRecord>;
157
+ /**
158
+ * An event type, or a family of them: `submission.created`, or `submission.*` for every type that
159
+ * starts with `submission.`.
160
+ */
161
+ export type EventTypePattern = string;
162
+ /** The Zod schema of the `EventTypePattern` type. */
163
+ export declare const EventTypePattern: z.ZodType<EventTypePattern>;
164
+ /**
165
+ * Which events a reader wants (IN-08, H-09). Both parts are optional, and an event must pass both.
166
+ * `artifact.compacted` always passes for a matching artifact, so a filtered reader still learns of
167
+ * a compaction (DATA_MODEL §4).
168
+ */
169
+ export interface EventFilter {
170
+ /** Only these artifacts' events; absent: every artifact's, and home-wide ones. */
171
+ readonly artifacts?: readonly string[];
172
+ /** Only these types; absent: every type. */
173
+ readonly types?: readonly EventTypePattern[];
174
+ }
175
+ /** The Zod schema of the `EventFilter` type. */
176
+ export declare const EventFilter: z.ZodType<EventFilter>;
177
+ /**
178
+ * What `wait` waits for (ARCHITECTURE §6, D103): `submitted`, `signal:<name>`, `state:<fieldId>`
179
+ * or `event:<type pattern>`.
180
+ */
181
+ export type WaitCondition = string;
182
+ /** A signal's name: letters, digits, `.`, `_` and `-`, starting with a letter or digit (D106). */
183
+ export declare const SIGNAL_NAME_PATTERN: RegExp;
184
+ /** The Zod schema of the `WaitCondition` type. */
185
+ export declare const WaitCondition: z.ZodType<WaitCondition>;
186
+ /** A delivery's state (FAILURE_MODEL §4). */
187
+ export type DeliveryState = "pending" | "delivered" | "rejected" | "undeliverable";
188
+ /** One submission's delivery to one host (D105). */
189
+ export interface DeliveryStatus {
190
+ /** The delivery's stable ID (`dlv_`), repeated by every redelivery. */
191
+ readonly deliveryId: string;
192
+ /**
193
+ * The host: its client name. Empty for Mostra's built-in adapter, which takes submissions when no
194
+ * host does; client names are never empty, so no host can be mistaken for it (D105).
195
+ */
196
+ readonly owner: string;
197
+ /** Where the delivery stands. */
198
+ readonly state: DeliveryState;
199
+ /** How many times Mostra called the host for it. */
200
+ readonly attempts: number;
201
+ /** The host's reason, for a rejection. */
202
+ readonly reason?: string;
203
+ /**
204
+ * `true` while a pending delivery waits: its host isn't connected, or an attempt failed and it
205
+ * will be retried (D47's "Pending delivery"). Absent while the first attempt is under way.
206
+ */
207
+ readonly waiting?: true;
208
+ /** When its state last changed. */
209
+ readonly updatedAt: string;
210
+ }
211
+ /** The Zod schema of the `DeliveryStatus` type. */
212
+ export declare const DeliveryStatus: z.ZodType<DeliveryStatus>;
213
+ /** A submission as a submit answers it (INTERFACES §4). */
214
+ export interface SubmissionSummary {
215
+ /** The submission's ID. */
216
+ readonly id: string;
217
+ /** When it was made. */
218
+ readonly at: string;
219
+ /** The draft epoch it closed (D103); 1 outside `epochs`. */
220
+ readonly epoch: number;
221
+ /** Where the submit came from (D40). */
222
+ readonly channel: SubmitChannel;
223
+ /** The version the view showed. */
224
+ readonly versionId: string;
225
+ /** That version's number. */
226
+ readonly version: number;
227
+ /** The view it was made from. */
228
+ readonly viewId: string;
229
+ /** Whether a newer version existed when the viewer submitted (H-10). */
230
+ readonly staleView: boolean;
231
+ /** The draft revision it was made from. */
232
+ readonly draftRevision: DocumentRevision;
233
+ /** SHA-256 of the snapshot's canonical JSON (RFC 8785), lowercase hex. */
234
+ readonly digest: string;
235
+ /** Every delivery's state, summed up: the worst of them. */
236
+ readonly delivery: DeliveryState;
237
+ /** Each host's delivery, so a viewer sees which host has it (IN-13). */
238
+ readonly deliveries?: readonly DeliveryStatus[];
239
+ /** `true` when this submit repeated an earlier one and got it back (D22). */
240
+ readonly duplicate?: true;
241
+ }
242
+ /** The Zod schema of the `SubmissionSummary` type. */
243
+ export declare const SubmissionSummary: z.ZodType<SubmissionSummary>;
244
+ /** A rectangle in CSS pixels, relative to its frame. */
245
+ export interface Rect {
246
+ /** Distance from the frame's left edge. */
247
+ readonly x: number;
248
+ /** Distance from the frame's top edge. */
249
+ readonly y: number;
250
+ /** Width. */
251
+ readonly width: number;
252
+ /** Height. */
253
+ readonly height: number;
254
+ }
255
+ /** A viewport: its size in CSS pixels and its device pixel ratio. */
256
+ export interface Viewport {
257
+ /** Width in CSS pixels. */
258
+ readonly width: number;
259
+ /** Height in CSS pixels. */
260
+ readonly height: number;
261
+ /** Device pixel ratio. */
262
+ readonly dpr: number;
263
+ }
264
+ /** One comment thread in results (INTERFACES §8; built by the review layer, WP-20). */
265
+ export interface ResultComment {
266
+ /** The thread's ID. */
267
+ readonly threadId: string;
268
+ /** Whether the thread is open or resolved. */
269
+ readonly status: "open" | "resolved";
270
+ /** The thread's messages, oldest first, each with its author. */
271
+ readonly messages: readonly {
272
+ readonly author: Viewer;
273
+ readonly at: string;
274
+ readonly text: string;
275
+ }[];
276
+ /** Every layer of the anchor that applies (D23). */
277
+ readonly anchor: {
278
+ readonly reviewId?: string;
279
+ /** W3C Web Annotation selectors. */
280
+ readonly selectors?: readonly unknown[];
281
+ readonly rect?: Rect;
282
+ readonly viewport?: Viewport;
283
+ readonly page?: string;
284
+ readonly candidateId?: string;
285
+ readonly terminal?: {
286
+ readonly rows: readonly [number, number];
287
+ readonly cols: readonly [number, number];
288
+ readonly t?: number;
289
+ };
290
+ readonly time?: number;
291
+ readonly slide?: {
292
+ readonly index: number;
293
+ readonly step: number;
294
+ };
295
+ };
296
+ /** The screenshot crop, always stored (D23). */
297
+ readonly crop: {
298
+ readonly path: string;
299
+ readonly width: number;
300
+ readonly height: number;
301
+ };
302
+ }
303
+ /**
304
+ * The complete submission (INTERFACES §8): what `results/get`, `mostra results` and the
305
+ * submissions port carry. Everything in it comes from the immutable submission and the version it
306
+ * names, never from the live draft (IN-06).
307
+ */
308
+ export interface Results {
309
+ /** The artifact, with the metadata of the version the viewer saw. */
310
+ readonly artifact: {
311
+ readonly id: string;
312
+ readonly title: string;
313
+ readonly description?: string;
314
+ readonly family?: string;
315
+ readonly links: readonly ArtifactLink[];
316
+ };
317
+ /** The submission's facts: when, how, by whom, from which version and view, and its delivery. */
318
+ readonly submission: {
319
+ readonly id: string;
320
+ readonly at: string;
321
+ readonly epoch: number;
322
+ /** The same viewer's previous submission, under `epochs` (D103). */
323
+ readonly previous?: string;
324
+ readonly policy: SubmissionPolicy;
325
+ readonly channel: SubmitChannel;
326
+ readonly viewer: Viewer;
327
+ readonly versionId: string;
328
+ readonly version: number;
329
+ readonly viewId: string;
330
+ /** Whether a newer version existed when the viewer submitted (H-10). */
331
+ readonly staleView: boolean;
332
+ /** The newest version's number at the time, when the view was stale. */
333
+ readonly latestVersion?: number;
334
+ readonly draftRevision: DocumentRevision;
335
+ readonly stateRevision?: DocumentRevision;
336
+ readonly digest: string;
337
+ readonly delivery: DeliveryState;
338
+ readonly deliveries: readonly DeliveryStatus[];
339
+ };
340
+ /** The draft's fields by ID, dotted IDs nested (D52). */
341
+ readonly answers: Readonly<Record<string, unknown>>;
342
+ /** Every field in `answers` and `state`, with its label and scope. */
343
+ readonly fields: readonly {
344
+ readonly id: string;
345
+ readonly label?: string;
346
+ readonly required?: boolean;
347
+ readonly sensitive?: boolean;
348
+ readonly scope: FieldScope;
349
+ }[];
350
+ /** Artifact state at `stateRevision`, dotted IDs nested (D63). */
351
+ readonly state?: Readonly<Record<string, unknown>>;
352
+ /** The review sets' choices: the fields `review.<set>.choice` (D65). */
353
+ readonly choices: readonly {
354
+ readonly reviewSetId: string;
355
+ readonly candidateId: string;
356
+ readonly label?: string;
357
+ }[];
358
+ /** Comment threads with their anchors and crops (WP-20). */
359
+ readonly comments: readonly ResultComment[];
360
+ /** Answers a newer version couldn't map (D42). */
361
+ readonly orphaned: readonly {
362
+ readonly id: string;
363
+ readonly label?: string;
364
+ readonly value: unknown;
365
+ readonly fromVersion: number;
366
+ }[];
367
+ /** Action runs started in this view (WP-08). */
368
+ readonly actions: readonly {
369
+ readonly runId: string;
370
+ readonly action: string;
371
+ readonly status: string;
372
+ readonly at: string;
373
+ }[];
374
+ /** Signals raised in this view before the submission: the newest 100, within 1 MiB of payloads. */
375
+ readonly signals: readonly {
376
+ readonly name: string;
377
+ readonly at: string;
378
+ readonly payload?: unknown;
379
+ }[];
380
+ /** How many older signals of the view the limit left out; absent when none. */
381
+ readonly signalsOmitted?: number;
382
+ /** Set when compaction removed events of this view before it submitted, so signals may be missing. */
383
+ readonly signalsCompacted?: true;
384
+ }
385
+ /** The Zod schema of the `ResultComment` type. */
386
+ export declare const ResultComment: z.ZodType<ResultComment>;
387
+ /** The Zod schema of the `Results` type. */
388
+ export declare const Results: z.ZodType<Results>;
389
+ //#endregion
390
+ export { ControlsPolicy, SubmitChannel, TrustedControl };
391
+ //# sourceMappingURL=interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.d.ts","names":[],"sources":["../src/interaction.ts"],"mappings":";;;;;;YAyBY;;;;;iBAMK;;WAEN;;WAEA,MAAM;;WAEN;;WAEA;;;qBAIE,QAAQ,EAAE,QAAQ;;;;;iBAgBd;;WAEN;;WAEA;;;qBAIE,YAAY,EAAE,QAAQ;;iBAWlB;;WAEN;;WAEA;;WAEA;;;qBAIE,OAAO,EAAE,QAAQ;;qBAcjB;;;;;wBAMG,UAAU,cAAc;;YAY5B;;;;;YAMA;;qBAGC,kBAAkB,EAAE,QAAQ;;;;;iBAYxB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE,SAAS,EAAE,QAAQ;;iBAgBf;;WAEN;;WAEA,UAAU;;WAEV,YAAY;;WAEZ;;WAEA;;WAEA;;WAEA;;;qBAIE,YAAY,EAAE,QAAQ;;;;;iBAmBlB;;WAEN;;WAEA,UAAU;;WAEV;;WAEA;;WAEA,YAAY;;WAEZ;;;qBAIE,eAAe,EAAE,QAAQ;;iBAerB;;WAEN,UAAU;;WAEV;;WAEA,oBAAoB;;;qBAIlB,gBAAgB,EAAE,QAAQ;;;;;iBAkBtB;;WAEN,QAAQ;;WAER;;WAEA;;WAEA;;WAEA;;WAEA,OAAO;;WAEP,YAAY,SAAS;;WAErB,SAAS,SAAS;;;qBAIhB,aAAa,EAAE,QAAQ;;;;;YAqBxB;;qBAGC,kBAAkB,EAAE,QAAQ;;;;;;iBAaxB;;WAEN;;WAEA,iBAAiB;;;qBAIf,aAAa,EAAE,QAAQ;;;;;YAexB;;qBAGC,qBAAqB;;qBAGrB,eAAe,EAAE,QAAQ;;YAc1B;;iBAGK;;WAEN;;;;;WAKA;;WAEA,OAAO;;WAEP;;WAEA;;;;;WAKA;;WAEA;;;qBAIE,gBAAgB,EAAE,QAAQ;;iBAgBtB;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;WAET;;WAEA;;WAEA;;WAEA;;WAEA,eAAe;;WAEf;;WAEA,UAAU;;WAEV,sBAAsB;;WAEtB;;;qBAIE,mBAAmB,EAAE,QAAQ;;iBAuBzB;;WAEN;;WAEA;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;aACE,QAAQ;aACR;aACA;;;WAGF;aACE;;aAEA;aACA,OAAO;aACP,WAAW;aACX;aACA;aACA;eACE;eACA;eACA;;aAEF;aACA;eAAmB;eAAwB;;;;WAG7C;aAAiB;aAAuB;aAAwB;;;;;;;;iBAQ1D;;WAEN;aACE;aACA;aACA;aACA;aACA,gBAAgB;;;WAGlB;aACE;aACA;aACA;;aAEA;aACA,QAAQ;aACR,SAAS;aACT,QAAQ;aACR;aACA;aACA;;aAEA;;aAEA;aACA,eAAe;aACf,gBAAgB;aAChB;aACA,UAAU;aACV,qBAAqB;;;WAGvB,SAAS,SAAS;;WAElB;aACE;aACA;aACA;aACA;aACA,OAAO;;;WAGT,QAAQ,SAAS;;WAEjB;aACE;aACA;aACA;;;WAGF,mBAAmB;;WAEnB;aACE;aACA;aACA;aACA;;;WAGF;aACE;aACA;aACA;aACA;;;WAGF;aACE;aACA;aACA;;;WAGF;;WAEA;;;qBAWE,eAAe,EAAE,QAAQ;;qBAkCzB,SAAS,EAAE,QAAQ"}