@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,33 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactId, ViewerId } from "../../ids.js";
3
+ import { DocumentRevision } from "../../interaction.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/port/drafts-mirror.ts
7
+ /** The Zod schema of the `DraftMirror` type. */
8
+ const DraftMirror = z.object({
9
+ kind: z.literal("draft"),
10
+ artifactId: ArtifactId.schema,
11
+ viewerId: ViewerId.schema,
12
+ epoch: z.int().min(1),
13
+ revision: DocumentRevision,
14
+ fields: z.record(z.string(), z.unknown())
15
+ }).register(wireRegistry, {
16
+ id: "DraftMirror",
17
+ description: "A viewer's draft mirrored to a host: always kind draft, never a submission."
18
+ });
19
+ /**
20
+ * `port/drafts.mirror`: Mostra sends the latest revision of a viewer's draft to a host that
21
+ * registered the drafts port, best effort (D105). Mostra's ledger stays canonical (D58).
22
+ */
23
+ const portDraftsMirrorMethod = defineMethod({
24
+ method: "port/drafts.mirror",
25
+ direction: "instance-to-host",
26
+ mutating: false,
27
+ params: DraftMirror,
28
+ result: z.unknown()
29
+ });
30
+ //#endregion
31
+ export { DraftMirror, portDraftsMirrorMethod };
32
+
33
+ //# sourceMappingURL=drafts-mirror.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drafts-mirror.js","names":[],"sources":["../../../src/methods/port/drafts-mirror.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, ViewerId } from \"../../ids.ts\";\nimport { DocumentRevision } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** A viewer's draft, mirrored to a host as it changes (INTERFACES §7, D105). */\nexport interface DraftMirror {\n /** Always `draft`: a mirror is never a submission (IN-06). */\n readonly kind: \"draft\";\n /** The artifact. */\n readonly artifactId: string;\n /** Whose draft it is. */\n readonly viewerId: string;\n /** The draft's epoch (D103). */\n readonly epoch: number;\n /** The draft's revision; a later mirror has a higher one. */\n readonly revision: DocumentRevision;\n /** Every field of the draft by ID. */\n readonly fields: Readonly<Record<string, unknown>>;\n}\n\n/** The result of `port/drafts.mirror`. */\nexport type DraftsMirrorResult = unknown;\n\n/** The Zod schema of the `DraftMirror` type. */\nexport const DraftMirror: z.ZodType<DraftMirror> = z\n .object({\n kind: z.literal(\"draft\"),\n artifactId: ArtifactId.schema,\n viewerId: ViewerId.schema,\n epoch: z.int().min(1),\n revision: DocumentRevision,\n fields: z.record(z.string(), z.unknown()),\n })\n .register(wireRegistry, {\n id: \"DraftMirror\",\n description: \"A viewer's draft mirrored to a host: always kind draft, never a submission.\",\n });\n\n/**\n * `port/drafts.mirror`: Mostra sends the latest revision of a viewer's draft to a host that\n * registered the drafts port, best effort (D105). Mostra's ledger stays canonical (D58).\n */\nexport const portDraftsMirrorMethod: MethodDefinition<DraftMirror, DraftsMirrorResult> =\n defineMethod({\n method: \"port/drafts.mirror\",\n direction: \"instance-to-host\",\n mutating: false,\n params: DraftMirror,\n result: z.unknown(),\n });\n"],"mappings":";;;;;;;AA0BA,MAAa,cAAsC,EAChD,OAAO;CACN,MAAM,EAAE,QAAQ,OAAO;CACvB,YAAY,WAAW;CACvB,UAAU,SAAS;CACnB,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACpB,UAAU;CACV,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC1C,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;AAMH,MAAa,yBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV,QAAQ;CACR,QAAQ,EAAE,QAAQ;AACpB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { MethodDefinition } from "../../method.js";
2
+ //#region src/methods/port/secrets-get.d.ts
3
+ /** The params of `port/secrets.get` (INTERFACES §7, D44). */
4
+ export interface PortSecretsGetParams {
5
+ /** The artifact whose server code asks. */
6
+ readonly artifactId: string;
7
+ /** The secret's name. */
8
+ readonly name: string;
9
+ }
10
+ /** The result of `port/secrets.get`: the value, or `null` when the host has none. */
11
+ export type PortSecretsGetResult = string | null;
12
+ /**
13
+ * `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its
14
+ * artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's
15
+ * own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.
16
+ */
17
+ export declare const portSecretsGetMethod: MethodDefinition<PortSecretsGetParams, PortSecretsGetResult>;
18
+ //#endregion
19
+ //# sourceMappingURL=secrets-get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-get.d.ts","names":[],"sources":["../../../src/methods/port/secrets-get.ts"],"mappings":";;;iBAKiB;;WAEN;;WAEA;;;YAIC;;;;;;qBAmBC,sBAAsB,iBAAiB,sBAAsB"}
@@ -0,0 +1,31 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { defineMethod } from "../../method.js";
3
+ import * as z from "zod";
4
+ //#region src/methods/port/secrets-get.ts
5
+ const params = z.object({
6
+ artifactId: z.string(),
7
+ name: z.string()
8
+ }).register(wireRegistry, {
9
+ id: "PortSecretsGetParams",
10
+ description: "The artifact and the name of the secret its server code asks for."
11
+ });
12
+ const result = z.string().nullable().register(wireRegistry, {
13
+ id: "PortSecretsGetResult",
14
+ description: "The secret's value, or null when the host has none."
15
+ });
16
+ /**
17
+ * `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its
18
+ * artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's
19
+ * own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.
20
+ */
21
+ const portSecretsGetMethod = defineMethod({
22
+ method: "port/secrets.get",
23
+ direction: "instance-to-host",
24
+ mutating: false,
25
+ params,
26
+ result
27
+ });
28
+ //#endregion
29
+ export { portSecretsGetMethod };
30
+
31
+ //# sourceMappingURL=secrets-get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-get.js","names":[],"sources":["../../../src/methods/port/secrets-get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/secrets.get` (INTERFACES §7, D44). */\nexport interface PortSecretsGetParams {\n /** The artifact whose server code asks. */\n readonly artifactId: string;\n /** The secret's name. */\n readonly name: string;\n}\n\n/** The result of `port/secrets.get`: the value, or `null` when the host has none. */\nexport type PortSecretsGetResult = string | null;\n\nconst params: z.ZodType<PortSecretsGetParams> = z\n .object({ artifactId: z.string(), name: z.string() })\n .register(wireRegistry, {\n id: \"PortSecretsGetParams\",\n description: \"The artifact and the name of the secret its server code asks for.\",\n });\n\nconst result: z.ZodType<PortSecretsGetResult> = z.string().nullable().register(wireRegistry, {\n id: \"PortSecretsGetResult\",\n description: \"The secret's value, or null when the host has none.\",\n});\n\n/**\n * `port/secrets.get`: Mostra asks the host that registered the `secrets` port for a secret its\n * artifact's server code reads (D44), with 30 seconds to answer. `null` falls back to the home's\n * own store; a failure or a timeout fails the read with `MOSTRA_SECRET_MISSING`.\n */\nexport const portSecretsGetMethod: MethodDefinition<PortSecretsGetParams, PortSecretsGetResult> =\n defineMethod({\n method: \"port/secrets.get\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;AAeA,MAAM,SAA0C,EAC7C,OAAO;CAAE,YAAY,EAAE,OAAO;CAAG,MAAM,EAAE,OAAO;AAAE,CAAC,CAAC,CACpD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAA0C,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,cAAc;CAC3F,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;AAOD,MAAa,uBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Results } from "../../interaction.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import * as z from "zod";
4
+ //#region src/methods/port/submissions-deliver.d.ts
5
+ /** One submission delivered to a host (INTERFACES §7, D105). */
6
+ export interface SubmissionEnvelope {
7
+ /** Always `submission`: a draft never arrives through this port (IN-06). */
8
+ readonly kind: "submission";
9
+ /** Stable across redeliveries: treat a repeated ID as the same delivery (H-03). */
10
+ readonly deliveryId: string;
11
+ /** The submission. */
12
+ readonly submissionId: string;
13
+ /** Its artifact. */
14
+ readonly artifactId: string;
15
+ /** 1 for the first attempt; more after retries and restarts. */
16
+ readonly attempt: number;
17
+ /** The complete submission (INTERFACES §8), built from the immutable submission alone. */
18
+ readonly results: Results;
19
+ }
20
+ /** What a host answers a delivery. */
21
+ export type SubmissionsDeliverResult = {
22
+ readonly accepted: true;
23
+ } | {
24
+ readonly accepted: false;
25
+ /** `duplicate` (already held), `undeliverable` (terminal, shown to the viewer), or the host's own. */
26
+ readonly reason: string;
27
+ /** `true` keeps the delivery pending and retries it with backoff. */
28
+ readonly retry: boolean;
29
+ };
30
+ /** The Zod schema of the `SubmissionEnvelope` type. */
31
+ export declare const SubmissionEnvelope: z.ZodType<SubmissionEnvelope>;
32
+ /**
33
+ * `port/submissions.deliver`: Mostra delivers one submission to the host that registered the
34
+ * submissions port, after the submission is durable (IN-12), one at a time in submission order.
35
+ */
36
+ export declare const portSubmissionsDeliverMethod: MethodDefinition<SubmissionEnvelope, SubmissionsDeliverResult>;
37
+ //#endregion
38
+ //# sourceMappingURL=submissions-deliver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submissions-deliver.d.ts","names":[],"sources":["../../../src/methods/port/submissions-deliver.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,SAAS;;;YAIR;WACG;;WAEA;;WAEA;;WAEA;;;qBAIF,oBAAoB,EAAE,QAAQ;;;;;qBA0B9B,8BAA8B,iBACzC,oBACA"}
@@ -0,0 +1,38 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactId, DeliveryId, SubmissionId } from "../../ids.js";
3
+ import { Results } from "../../interaction.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/port/submissions-deliver.ts
7
+ /** The Zod schema of the `SubmissionEnvelope` type. */
8
+ const SubmissionEnvelope = z.object({
9
+ kind: z.literal("submission"),
10
+ deliveryId: DeliveryId.schema,
11
+ submissionId: SubmissionId.schema,
12
+ artifactId: ArtifactId.schema,
13
+ attempt: z.int().min(1),
14
+ results: Results
15
+ }).register(wireRegistry, {
16
+ id: "SubmissionEnvelope",
17
+ description: "One submission delivered to a host: delivery ID, attempt and the complete results."
18
+ });
19
+ const result = z.union([z.object({ accepted: z.literal(true) }), z.object({
20
+ accepted: z.literal(false),
21
+ reason: z.string().min(1),
22
+ retry: z.boolean()
23
+ })]).register(wireRegistry, { id: "PortSubmissionsDeliverResult" });
24
+ /**
25
+ * `port/submissions.deliver`: Mostra delivers one submission to the host that registered the
26
+ * submissions port, after the submission is durable (IN-12), one at a time in submission order.
27
+ */
28
+ const portSubmissionsDeliverMethod = defineMethod({
29
+ method: "port/submissions.deliver",
30
+ direction: "instance-to-host",
31
+ mutating: false,
32
+ params: SubmissionEnvelope,
33
+ result
34
+ });
35
+ //#endregion
36
+ export { SubmissionEnvelope, portSubmissionsDeliverMethod };
37
+
38
+ //# sourceMappingURL=submissions-deliver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submissions-deliver.js","names":[],"sources":["../../../src/methods/port/submissions-deliver.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, DeliveryId, SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** One submission delivered to a host (INTERFACES §7, D105). */\nexport interface SubmissionEnvelope {\n /** Always `submission`: a draft never arrives through this port (IN-06). */\n readonly kind: \"submission\";\n /** Stable across redeliveries: treat a repeated ID as the same delivery (H-03). */\n readonly deliveryId: string;\n /** The submission. */\n readonly submissionId: string;\n /** Its artifact. */\n readonly artifactId: string;\n /** 1 for the first attempt; more after retries and restarts. */\n readonly attempt: number;\n /** The complete submission (INTERFACES §8), built from the immutable submission alone. */\n readonly results: Results;\n}\n\n/** What a host answers a delivery. */\nexport type SubmissionsDeliverResult =\n | { readonly accepted: true }\n | {\n readonly accepted: false;\n /** `duplicate` (already held), `undeliverable` (terminal, shown to the viewer), or the host's own. */\n readonly reason: string;\n /** `true` keeps the delivery pending and retries it with backoff. */\n readonly retry: boolean;\n };\n\n/** The Zod schema of the `SubmissionEnvelope` type. */\nexport const SubmissionEnvelope: z.ZodType<SubmissionEnvelope> = z\n .object({\n kind: z.literal(\"submission\"),\n deliveryId: DeliveryId.schema,\n submissionId: SubmissionId.schema,\n artifactId: ArtifactId.schema,\n attempt: z.int().min(1),\n results: Results,\n })\n .register(wireRegistry, {\n id: \"SubmissionEnvelope\",\n description:\n \"One submission delivered to a host: delivery ID, attempt and the complete results.\",\n });\n\nconst result: z.ZodType<SubmissionsDeliverResult> = z\n .union([\n z.object({ accepted: z.literal(true) }),\n z.object({ accepted: z.literal(false), reason: z.string().min(1), retry: z.boolean() }),\n ])\n .register(wireRegistry, { id: \"PortSubmissionsDeliverResult\" });\n\n/**\n * `port/submissions.deliver`: Mostra delivers one submission to the host that registered the\n * submissions port, after the submission is durable (IN-12), one at a time in submission order.\n */\nexport const portSubmissionsDeliverMethod: MethodDefinition<\n SubmissionEnvelope,\n SubmissionsDeliverResult\n> = defineMethod({\n method: \"port/submissions.deliver\",\n direction: \"instance-to-host\",\n mutating: false,\n params: SubmissionEnvelope,\n result,\n});\n"],"mappings":";;;;;;;AAkCA,MAAa,qBAAoD,EAC9D,OAAO;CACN,MAAM,EAAE,QAAQ,YAAY;CAC5B,YAAY,WAAW;CACvB,cAAc,aAAa;CAC3B,YAAY,WAAW;CACvB,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;CACtB,SAAS;AACX,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;AAEH,MAAM,SAA8C,EACjD,MAAM,CACL,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,GACtC,EAAE,OAAO;CAAE,UAAU,EAAE,QAAQ,KAAK;CAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,OAAO,EAAE,QAAQ;AAAE,CAAC,CACxF,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,+BAA+B,CAAC;;;;;AAMhE,MAAa,+BAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV,QAAQ;CACR;AACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { TrustedControl } from "../../view.js";
2
+ import { Viewer } from "../../interaction.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ //#region src/methods/port/trusted-controls-activated.d.ts
5
+ /** The params of `port/trustedControls.activated` (INTERFACES §7): a person used a trusted control. */
6
+ export interface PortTrustedControlsActivatedParams {
7
+ /** The artifact. */
8
+ readonly artifactId: string;
9
+ /** The control: `submit` or `choose`. */
10
+ readonly control: TrustedControl;
11
+ /** Who used it. */
12
+ readonly viewer: Viewer;
13
+ /** The view it was used in. */
14
+ readonly viewId: string;
15
+ /** What it did: the submission it made, or the review set and candidate it chose. */
16
+ readonly detail?: Readonly<Record<string, string>>;
17
+ }
18
+ /** The result of `port/trustedControls.activated`; its content is ignored. */
19
+ export type PortTrustedControlsActivatedResult = unknown;
20
+ /**
21
+ * `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the
22
+ * host that registered the `trustedControls` port, best effort and never retried (D108). The
23
+ * change itself is durable already; this call only lets a host react at once.
24
+ */
25
+ export declare const portTrustedControlsActivatedMethod: MethodDefinition<PortTrustedControlsActivatedParams, PortTrustedControlsActivatedResult>;
26
+ //#endregion
27
+ //# sourceMappingURL=trusted-controls-activated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-controls-activated.d.ts","names":[],"sources":["../../../src/methods/port/trusted-controls-activated.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA,SAAS;;WAET,QAAQ;;WAER;;WAEA,SAAS,SAAS;;;YAIjB;;;;;;qBAoBC,oCAAoC,iBAC/C,oCACA"}
@@ -0,0 +1,33 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactId, ViewId } from "../../ids.js";
3
+ import { TrustedControl } from "../../view.js";
4
+ import { Viewer } from "../../interaction.js";
5
+ import { defineMethod } from "../../method.js";
6
+ import * as z from "zod";
7
+ //#region src/methods/port/trusted-controls-activated.ts
8
+ const params = z.object({
9
+ artifactId: ArtifactId.schema,
10
+ control: TrustedControl,
11
+ viewer: Viewer,
12
+ viewId: ViewId.schema,
13
+ detail: z.record(z.string(), z.string()).exactOptional()
14
+ }).register(wireRegistry, {
15
+ id: "PortTrustedControlsActivatedParams",
16
+ description: "A trusted control a person used: the artifact, control, viewer, view and detail."
17
+ });
18
+ /**
19
+ * `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the
20
+ * host that registered the `trustedControls` port, best effort and never retried (D108). The
21
+ * change itself is durable already; this call only lets a host react at once.
22
+ */
23
+ const portTrustedControlsActivatedMethod = defineMethod({
24
+ method: "port/trustedControls.activated",
25
+ direction: "instance-to-host",
26
+ mutating: false,
27
+ params,
28
+ result: z.unknown()
29
+ });
30
+ //#endregion
31
+ export { portTrustedControlsActivatedMethod };
32
+
33
+ //# sourceMappingURL=trusted-controls-activated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-controls-activated.js","names":[],"sources":["../../../src/methods/port/trusted-controls-activated.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactId, ViewId } from \"../../ids.ts\";\nimport { TrustedControl, Viewer } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/trustedControls.activated` (INTERFACES §7): a person used a trusted control. */\nexport interface PortTrustedControlsActivatedParams {\n /** The artifact. */\n readonly artifactId: string;\n /** The control: `submit` or `choose`. */\n readonly control: TrustedControl;\n /** Who used it. */\n readonly viewer: Viewer;\n /** The view it was used in. */\n readonly viewId: string;\n /** What it did: the submission it made, or the review set and candidate it chose. */\n readonly detail?: Readonly<Record<string, string>>;\n}\n\n/** The result of `port/trustedControls.activated`; its content is ignored. */\nexport type PortTrustedControlsActivatedResult = unknown;\n\nconst params: z.ZodType<PortTrustedControlsActivatedParams> = z\n .object({\n artifactId: ArtifactId.schema,\n control: TrustedControl,\n viewer: Viewer,\n viewId: ViewId.schema,\n detail: z.record(z.string(), z.string()).exactOptional(),\n })\n .register(wireRegistry, {\n id: \"PortTrustedControlsActivatedParams\",\n description: \"A trusted control a person used: the artifact, control, viewer, view and detail.\",\n });\n\n/**\n * `port/trustedControls.activated`: after a trusted control's change commits, Mostra tells the\n * host that registered the `trustedControls` port, best effort and never retried (D108). The\n * change itself is durable already; this call only lets a host react at once.\n */\nexport const portTrustedControlsActivatedMethod: MethodDefinition<\n PortTrustedControlsActivatedParams,\n PortTrustedControlsActivatedResult\n> = defineMethod({\n method: \"port/trustedControls.activated\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result: z.unknown(),\n});\n"],"mappings":";;;;;;;AAuBA,MAAM,SAAwD,EAC3D,OAAO;CACN,YAAY,WAAW;CACvB,SAAS;CACT,QAAQ;CACR,QAAQ,OAAO;CACf,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc;AACzD,CAAC,CAAC,CACD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;AAOH,MAAa,qCAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ,EAAE,QAAQ;AACpB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ArtifactSummary } from "../../artifact.js";
2
+ import { ControlsPolicy } from "../../view.js";
3
+ import "../../interaction.js";
4
+ import { MethodDefinition } from "../../method.js";
5
+ //#region src/methods/port/trusted-controls-policy.d.ts
6
+ /** The params of `port/trustedControls.policy` (INTERFACES §7). */
7
+ export interface PortTrustedControlsPolicyParams {
8
+ /** The artifact a frame is about to show, with the metadata of its latest version. */
9
+ readonly artifact: ArtifactSummary;
10
+ }
11
+ /** The result of `port/trustedControls.policy`: the channels and controls for the view (D108). */
12
+ export type PortTrustedControlsPolicyResult = ControlsPolicy;
13
+ /**
14
+ * `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port
15
+ * which submit channels a new view of an artifact accepts and which trusted controls its shell
16
+ * renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view
17
+ * to the shell channel.
18
+ */
19
+ export declare const portTrustedControlsPolicyMethod: MethodDefinition<PortTrustedControlsPolicyParams, PortTrustedControlsPolicyResult>;
20
+ //#endregion
21
+ //# sourceMappingURL=trusted-controls-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-controls-policy.d.ts","names":[],"sources":["../../../src/methods/port/trusted-controls-policy.ts"],"mappings":";;;;;;iBAOiB;;WAEN,UAAU;;;YAIT,kCAAkC;;;;;;;qBAejC,iCAAiC,iBAC5C,iCACA"}
@@ -0,0 +1,27 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactSummary } from "../../artifact.js";
3
+ import { ControlsPolicy } from "../../view.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/port/trusted-controls-policy.ts
7
+ const params = z.object({ artifact: ArtifactSummary }).register(wireRegistry, {
8
+ id: "PortTrustedControlsPolicyParams",
9
+ description: "The artifact a frame is about to show, for its host's controls policy."
10
+ });
11
+ /**
12
+ * `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port
13
+ * which submit channels a new view of an artifact accepts and which trusted controls its shell
14
+ * renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view
15
+ * to the shell channel.
16
+ */
17
+ const portTrustedControlsPolicyMethod = defineMethod({
18
+ method: "port/trustedControls.policy",
19
+ direction: "instance-to-host",
20
+ mutating: false,
21
+ params,
22
+ result: ControlsPolicy
23
+ });
24
+ //#endregion
25
+ export { portTrustedControlsPolicyMethod };
26
+
27
+ //# sourceMappingURL=trusted-controls-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-controls-policy.js","names":[],"sources":["../../../src/methods/port/trusted-controls-policy.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactSummary } from \"../../artifact.ts\";\nimport { ControlsPolicy } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `port/trustedControls.policy` (INTERFACES §7). */\nexport interface PortTrustedControlsPolicyParams {\n /** The artifact a frame is about to show, with the metadata of its latest version. */\n readonly artifact: ArtifactSummary;\n}\n\n/** The result of `port/trustedControls.policy`: the channels and controls for the view (D108). */\nexport type PortTrustedControlsPolicyResult = ControlsPolicy;\n\nconst params: z.ZodType<PortTrustedControlsPolicyParams> = z\n .object({ artifact: ArtifactSummary })\n .register(wireRegistry, {\n id: \"PortTrustedControlsPolicyParams\",\n description: \"The artifact a frame is about to show, for its host's controls policy.\",\n });\n\n/**\n * `port/trustedControls.policy`: Mostra asks the host that registered the `trustedControls` port\n * which submit channels a new view of an artifact accepts and which trusted controls its shell\n * renders (D108). Asked once per frame load, with 5 seconds to answer; a failure narrows the view\n * to the shell channel.\n */\nexport const portTrustedControlsPolicyMethod: MethodDefinition<\n PortTrustedControlsPolicyParams,\n PortTrustedControlsPolicyResult\n> = defineMethod({\n method: \"port/trustedControls.policy\",\n direction: \"instance-to-host\",\n mutating: false,\n params,\n result: ControlsPolicy,\n});\n"],"mappings":";;;;;;AAeA,MAAM,SAAqD,EACxD,OAAO,EAAE,UAAU,gBAAgB,CAAC,CAAC,CACrC,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;;;AAQH,MAAa,kCAGT,aAAa;CACf,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA,QAAQ;AACV,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { Results } from "../../interaction.js";
3
+ import { MethodDefinition } from "../../method.js";
4
+ import * as z from "zod";
5
+ //#region src/methods/results/get.d.ts
6
+ /** The params of `results/get` (INTERFACES §6, §8). */
7
+ export interface ResultsGetParams {
8
+ /** The artifact whose submission to read. */
9
+ readonly artifact: ArtifactRef;
10
+ /** The submission to read; absent: the artifact's latest. */
11
+ readonly submission?: string;
12
+ /** `json` (the default): the Results structure; `md`: Markdown for agents to read. */
13
+ readonly format?: "json" | "md";
14
+ }
15
+ /** Results rendered as Markdown (ROUND-2 §1.1). */
16
+ export interface ResultsMarkdown {
17
+ /** The submission rendered. */
18
+ readonly submissionId: string;
19
+ /** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */
20
+ readonly markdown: string;
21
+ }
22
+ /** The result of `results/get`: the Results structure, or its Markdown for `format: "md"`. */
23
+ export type ResultsGetResult = Results | ResultsMarkdown;
24
+ /** The Zod schema of the `ResultsMarkdown` type. */
25
+ export declare const ResultsMarkdown: z.ZodType<ResultsMarkdown>;
26
+ /**
27
+ * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
28
+ * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
29
+ */
30
+ export declare const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult>;
31
+ //#endregion
32
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","names":[],"sources":["../../../src/methods/results/get.ts"],"mappings":";;;;;;iBAQiB;;WAEN,UAAU;;WAEV;;WAEA;;;iBAIM;;WAEN;;WAEA;;;YAIC,mBAAmB,UAAU;;qBAW5B,iBAAiB,EAAE,QAAQ;;;;;qBAe3B,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,36 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SubmissionId } from "../../ids.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { Results } from "../../interaction.js";
5
+ import { defineMethod } from "../../method.js";
6
+ import * as z from "zod";
7
+ //#region src/methods/results/get.ts
8
+ const params = z.object({
9
+ artifact: ArtifactRef,
10
+ submission: SubmissionId.schema.exactOptional(),
11
+ format: z.enum(["json", "md"]).exactOptional()
12
+ }).register(wireRegistry, { id: "ResultsGetParams" });
13
+ /** The Zod schema of the `ResultsMarkdown` type. */
14
+ const ResultsMarkdown = z.object({
15
+ submissionId: SubmissionId.schema,
16
+ markdown: z.string()
17
+ }).register(wireRegistry, {
18
+ id: "ResultsMarkdown",
19
+ description: "A submission's results as Markdown for agents."
20
+ });
21
+ const result = z.union([Results, ResultsMarkdown]).register(wireRegistry, { id: "ResultsGetResult" });
22
+ /**
23
+ * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with
24
+ * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.
25
+ */
26
+ const resultsGetMethod = defineMethod({
27
+ method: "results/get",
28
+ direction: "client-to-instance",
29
+ mutating: false,
30
+ params,
31
+ result
32
+ });
33
+ //#endregion
34
+ export { ResultsMarkdown, resultsGetMethod };
35
+
36
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","names":[],"sources":["../../../src/methods/results/get.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { ArtifactRef } from \"../../artifact.ts\";\nimport { SubmissionId } from \"../../ids.ts\";\nimport { Results } from \"../../interaction.ts\";\nimport { defineMethod, type MethodDefinition } from \"../../method.ts\";\nimport { wireRegistry } from \"../../wire-registry.ts\";\n\n/** The params of `results/get` (INTERFACES §6, §8). */\nexport interface ResultsGetParams {\n /** The artifact whose submission to read. */\n readonly artifact: ArtifactRef;\n /** The submission to read; absent: the artifact's latest. */\n readonly submission?: string;\n /** `json` (the default): the Results structure; `md`: Markdown for agents to read. */\n readonly format?: \"json\" | \"md\";\n}\n\n/** Results rendered as Markdown (ROUND-2 §1.1). */\nexport interface ResultsMarkdown {\n /** The submission rendered. */\n readonly submissionId: string;\n /** The Markdown: a header with IDs, answers by label, choices, comments, actions, signals, orphans. */\n readonly markdown: string;\n}\n\n/** The result of `results/get`: the Results structure, or its Markdown for `format: \"md\"`. */\nexport type ResultsGetResult = Results | ResultsMarkdown;\n\nconst params: z.ZodType<ResultsGetParams> = z\n .object({\n artifact: ArtifactRef,\n submission: SubmissionId.schema.exactOptional(),\n format: z.enum([\"json\", \"md\"]).exactOptional(),\n })\n .register(wireRegistry, { id: \"ResultsGetParams\" });\n\n/** The Zod schema of the `ResultsMarkdown` type. */\nexport const ResultsMarkdown: z.ZodType<ResultsMarkdown> = z\n .object({ submissionId: SubmissionId.schema, markdown: z.string() })\n .register(wireRegistry, {\n id: \"ResultsMarkdown\",\n description: \"A submission's results as Markdown for agents.\",\n });\n\nconst result: z.ZodType<ResultsGetResult> = z\n .union([Results, ResultsMarkdown])\n .register(wireRegistry, { id: \"ResultsGetResult\" });\n\n/**\n * `results/get`: the complete submission (INTERFACES §8), as JSON or as Markdown. Fails with\n * `MOSTRA_SUBMIT_NOT_FOUND` when the artifact has no such submission yet.\n */\nexport const resultsGetMethod: MethodDefinition<ResultsGetParams, ResultsGetResult> = defineMethod({\n method: \"results/get\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;;AA4BA,MAAM,SAAsC,EACzC,OAAO;CACN,UAAU;CACV,YAAY,aAAa,OAAO,cAAc;CAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,cAAc;AAC/C,CAAC,CAAC,CACD,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;AAGpD,MAAa,kBAA8C,EACxD,OAAO;CAAE,cAAc,aAAa;CAAQ,UAAU,EAAE,OAAO;AAAE,CAAC,CAAC,CACnE,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAsC,EACzC,MAAM,CAAC,SAAS,eAAe,CAAC,CAAC,CACjC,SAAS,cAAc,EAAE,IAAI,mBAAmB,CAAC;;;;;AAMpD,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ //#region src/methods/secret/delete.d.ts
4
+ /** The params of `secret/delete` (INTERFACES §6). */
5
+ export interface SecretDeleteParams {
6
+ /** The secret's name. */
7
+ readonly name: string;
8
+ /** The artifact whose own secret to delete; absent: the home's shared one. */
9
+ readonly artifact?: ArtifactRef;
10
+ }
11
+ /** The result of `secret/delete`. */
12
+ export interface SecretDeleteResult {
13
+ /** Whether a secret was there to delete. */
14
+ readonly deleted: boolean;
15
+ }
16
+ /**
17
+ * `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds
18
+ * with `deleted: false`, so the method is idempotent and takes no `requestId`.
19
+ */
20
+ export declare const secretDeleteMethod: MethodDefinition<SecretDeleteParams, SecretDeleteResult>;
21
+ //#endregion
22
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","names":[],"sources":["../../../src/methods/secret/delete.ts"],"mappings":";;;;iBAOiB;;WAEN;;WAEA,WAAW;;;iBAIL;;WAEN;;;;;;qBAkBE,oBAAoB,iBAAiB,oBAAoB"}
@@ -0,0 +1,32 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SECRET_NAME_PATTERN } from "../../actions.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/secret/delete.ts
7
+ const params = z.object({
8
+ name: z.string().regex(SECRET_NAME_PATTERN),
9
+ artifact: ArtifactRef.exactOptional()
10
+ }).register(wireRegistry, {
11
+ id: "SecretDeleteParams",
12
+ description: "The secret to delete."
13
+ });
14
+ const result = z.object({ deleted: z.boolean() }).register(wireRegistry, {
15
+ id: "SecretDeleteResult",
16
+ description: "Whether a secret was deleted."
17
+ });
18
+ /**
19
+ * `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds
20
+ * with `deleted: false`, so the method is idempotent and takes no `requestId`.
21
+ */
22
+ const secretDeleteMethod = defineMethod({
23
+ method: "secret/delete",
24
+ direction: "client-to-instance",
25
+ mutating: false,
26
+ params,
27
+ result
28
+ });
29
+ //#endregion
30
+ export { secretDeleteMethod };
31
+
32
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","names":[],"sources":["../../../src/methods/secret/delete.ts"],"sourcesContent":["import * as z from \"zod\";\nimport { SECRET_NAME_PATTERN } 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/delete` (INTERFACES §6). */\nexport interface SecretDeleteParams {\n /** The secret's name. */\n readonly name: string;\n /** The artifact whose own secret to delete; absent: the home's shared one. */\n readonly artifact?: ArtifactRef;\n}\n\n/** The result of `secret/delete`. */\nexport interface SecretDeleteResult {\n /** Whether a secret was there to delete. */\n readonly deleted: boolean;\n}\n\nconst params: z.ZodType<SecretDeleteParams> = z\n .object({ name: z.string().regex(SECRET_NAME_PATTERN), artifact: ArtifactRef.exactOptional() })\n .register(wireRegistry, { id: \"SecretDeleteParams\", description: \"The secret to delete.\" });\n\nconst result: z.ZodType<SecretDeleteResult> = z\n .object({ deleted: z.boolean() })\n .register(wireRegistry, {\n id: \"SecretDeleteResult\",\n description: \"Whether a secret was deleted.\",\n });\n\n/**\n * `secret/delete`: removes a secret from the home's store. Deleting one that isn't there succeeds\n * with `deleted: false`, so the method is idempotent and takes no `requestId`.\n */\nexport const secretDeleteMethod: MethodDefinition<SecretDeleteParams, SecretDeleteResult> =\n defineMethod({\n method: \"secret/delete\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n });\n"],"mappings":";;;;;;AAoBA,MAAM,SAAwC,EAC3C,OAAO;CAAE,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,mBAAmB;CAAG,UAAU,YAAY,cAAc;AAAE,CAAC,CAAC,CAC9F,SAAS,cAAc;CAAE,IAAI;CAAsB,aAAa;AAAwB,CAAC;AAE5F,MAAM,SAAwC,EAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAChC,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;;;;;AAMH,MAAa,qBACX,aAAa;CACX,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import { SecretEntry } from "./set.js";
4
+ //#region src/methods/secret/list.d.ts
5
+ /** The params of `secret/list` (INTERFACES §6). */
6
+ export interface SecretListParams {
7
+ /** Also list this artifact's own secrets; the home's shared ones are always listed. */
8
+ readonly artifact?: ArtifactRef;
9
+ }
10
+ /** The result of `secret/list`: names and scopes, never values. */
11
+ export interface SecretListResult {
12
+ /** The secrets, home ones first. */
13
+ readonly secrets: readonly SecretEntry[];
14
+ }
15
+ /**
16
+ * `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is
17
+ * named, with their scopes; a value is never returned (D44).
18
+ */
19
+ export declare const secretListMethod: MethodDefinition<SecretListParams, SecretListResult>;
20
+ //#endregion
21
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","names":[],"sources":["../../../src/methods/secret/list.ts"],"mappings":";;;;;iBAOiB;;WAEN,WAAW;;;iBAIL;;WAEN,kBAAkB;;;;;;qBAkBhB,kBAAkB,iBAAiB,kBAAkB"}
@@ -0,0 +1,29 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { ArtifactRef } from "../../artifact.js";
3
+ import { defineMethod } from "../../method.js";
4
+ import { SecretEntry } from "./set.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/secret/list.ts
7
+ const params = z.object({ artifact: ArtifactRef.exactOptional() }).register(wireRegistry, {
8
+ id: "SecretListParams",
9
+ description: "The artifact whose secrets to list."
10
+ });
11
+ const result = z.object({ secrets: z.array(SecretEntry).readonly() }).register(wireRegistry, {
12
+ id: "SecretListResult",
13
+ description: "Secrets by name and scope."
14
+ });
15
+ /**
16
+ * `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is
17
+ * named, with their scopes; a value is never returned (D44).
18
+ */
19
+ const secretListMethod = defineMethod({
20
+ method: "secret/list",
21
+ direction: "client-to-instance",
22
+ mutating: false,
23
+ params,
24
+ result
25
+ });
26
+ //#endregion
27
+ export { secretListMethod };
28
+
29
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","names":[],"sources":["../../../src/methods/secret/list.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 { SecretEntry } from \"./set.ts\";\n\n/** The params of `secret/list` (INTERFACES §6). */\nexport interface SecretListParams {\n /** Also list this artifact's own secrets; the home's shared ones are always listed. */\n readonly artifact?: ArtifactRef;\n}\n\n/** The result of `secret/list`: names and scopes, never values. */\nexport interface SecretListResult {\n /** The secrets, home ones first. */\n readonly secrets: readonly SecretEntry[];\n}\n\nconst params: z.ZodType<SecretListParams> = z\n .object({ artifact: ArtifactRef.exactOptional() })\n .register(wireRegistry, {\n id: \"SecretListParams\",\n description: \"The artifact whose secrets to list.\",\n });\n\nconst result: z.ZodType<SecretListResult> = z\n .object({ secrets: z.array(SecretEntry).readonly() })\n .register(wireRegistry, { id: \"SecretListResult\", description: \"Secrets by name and scope.\" });\n\n/**\n * `secret/list`: the names of the home's shared secrets, and of an artifact's own when one is\n * named, with their scopes; a value is never returned (D44).\n */\nexport const secretListMethod: MethodDefinition<SecretListParams, SecretListResult> = defineMethod({\n method: \"secret/list\",\n direction: \"client-to-instance\",\n mutating: false,\n params,\n result,\n});\n"],"mappings":";;;;;;AAkBA,MAAM,SAAsC,EACzC,OAAO,EAAE,UAAU,YAAY,cAAc,EAAE,CAAC,CAAC,CACjD,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,SAAsC,EACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CACpD,SAAS,cAAc;CAAE,IAAI;CAAoB,aAAa;AAA6B,CAAC;;;;;AAM/F,MAAa,mBAAyE,aAAa;CACjG,QAAQ;CACR,WAAW;CACX,UAAU;CACV;CACA;AACF,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { ArtifactRef } from "../../artifact.js";
2
+ import { MethodDefinition } from "../../method.js";
3
+ import * as z from "zod";
4
+ //#region src/methods/secret/set.d.ts
5
+ /** The params of `secret/set` (INTERFACES §6, D44). */
6
+ export interface SecretSetParams {
7
+ /** Letters, digits, `_`, `.` and `-`, starting with a letter or `_`, at most 128 characters. */
8
+ readonly name: string;
9
+ /** The value, at most 64 KiB of UTF-8. Never returned by any method. */
10
+ readonly value: string;
11
+ /** The artifact the secret belongs to; absent: shared by every artifact of the home. */
12
+ readonly artifact?: ArtifactRef;
13
+ }
14
+ /** Where a secret lives. */
15
+ export interface SecretEntry {
16
+ /** The secret's name. */
17
+ readonly name: string;
18
+ /** `artifact` for one artifact's secret, `home` for one every artifact shares. */
19
+ readonly scope: "artifact" | "home";
20
+ /** The artifact, for `scope: "artifact"`. */
21
+ readonly artifactId?: string;
22
+ /** When it was last set. */
23
+ readonly updatedAt: string;
24
+ }
25
+ /** The Zod schema of the `SecretEntry` type. */
26
+ export declare const SecretEntry: z.ZodType<SecretEntry>;
27
+ /** The result of `secret/set`: the secret, without its value. */
28
+ export type SecretSetResult = SecretEntry;
29
+ /**
30
+ * `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or
31
+ * for every artifact of the home; server code reads it with `secret(name)`. Setting it again
32
+ * replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger
33
+ * never records anything derived from a secret's value.
34
+ */
35
+ export declare const secretSetMethod: MethodDefinition<SecretSetParams, SecretSetResult>;
36
+ //#endregion
37
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","names":[],"sources":["../../../src/methods/secret/set.ts"],"mappings":";;;;;iBAOiB;;WAEN;;WAEA;;WAEA,WAAW;;;iBAIL;;WAEN;;WAEA;;WAEA;;WAEA;;;qBAIE,aAAa,EAAE,QAAQ;;YAaxB,kBAAkB;;;;;;;qBAoBjB,iBAAiB,iBAAiB,iBAAiB"}
@@ -0,0 +1,41 @@
1
+ import { wireRegistry } from "../../wire-registry.js";
2
+ import { SECRET_NAME_PATTERN, SECRET_VALUE_MAX } from "../../actions.js";
3
+ import { ArtifactRef } from "../../artifact.js";
4
+ import { defineMethod } from "../../method.js";
5
+ import * as z from "zod";
6
+ //#region src/methods/secret/set.ts
7
+ /** The Zod schema of the `SecretEntry` type. */
8
+ const SecretEntry = z.object({
9
+ name: z.string(),
10
+ scope: z.enum(["artifact", "home"]),
11
+ artifactId: z.string().exactOptional(),
12
+ updatedAt: z.string()
13
+ }).register(wireRegistry, {
14
+ id: "SecretEntry",
15
+ description: "A secret's name, scope and when it was set; never its value."
16
+ });
17
+ const params = z.object({
18
+ name: z.string().regex(SECRET_NAME_PATTERN),
19
+ value: z.string().min(1).max(SECRET_VALUE_MAX),
20
+ artifact: ArtifactRef.exactOptional()
21
+ }).register(wireRegistry, {
22
+ id: "SecretSetParams",
23
+ description: "A secret's name, value and optional artifact scope."
24
+ });
25
+ /**
26
+ * `secret/set`: stores a named secret in the home's owner-only store (D44), for one artifact or
27
+ * for every artifact of the home; server code reads it with `secret(name)`. Setting it again
28
+ * replaces the value. Setting is idempotent by nature, so it takes no `requestId`: the ledger
29
+ * never records anything derived from a secret's value.
30
+ */
31
+ const secretSetMethod = defineMethod({
32
+ method: "secret/set",
33
+ direction: "client-to-instance",
34
+ mutating: false,
35
+ params,
36
+ result: SecretEntry
37
+ });
38
+ //#endregion
39
+ export { SecretEntry, secretSetMethod };
40
+
41
+ //# sourceMappingURL=set.js.map