@astrale-os/kernel-protocol 0.5.0-beta.5 → 0.5.0-beta.51

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 (451) hide show
  1. package/dist/artifact/index.d.ts +0 -1
  2. package/dist/artifact/index.js +0 -1
  3. package/dist/artifact/ref.d.ts +0 -1
  4. package/dist/artifact/ref.js +0 -1
  5. package/dist/codecs/codec.d.ts +0 -1
  6. package/dist/codecs/codec.js +0 -1
  7. package/dist/codecs/index.d.ts +0 -1
  8. package/dist/codecs/index.js +0 -1
  9. package/dist/codecs/json.d.ts +0 -1
  10. package/dist/codecs/json.js +0 -1
  11. package/dist/codecs/media-types.d.ts +0 -1
  12. package/dist/codecs/media-types.js +0 -1
  13. package/dist/codecs/msgpack.d.ts +0 -1
  14. package/dist/codecs/msgpack.js +1 -5
  15. package/dist/errors/codes.d.ts +0 -1
  16. package/dist/errors/codes.js +0 -1
  17. package/dist/errors/http-status.d.ts +0 -1
  18. package/dist/errors/http-status.js +0 -1
  19. package/dist/errors/index.d.ts +0 -1
  20. package/dist/errors/index.js +0 -1
  21. package/dist/errors/payload.d.ts +0 -1
  22. package/dist/errors/payload.js +3 -3
  23. package/dist/errors/protocol-error.d.ts +0 -1
  24. package/dist/errors/protocol-error.js +4 -3
  25. package/dist/errors/reason.d.ts +0 -1
  26. package/dist/errors/reason.js +0 -1
  27. package/dist/index.d.ts +0 -1
  28. package/dist/index.js +0 -1
  29. package/dist/invocation/admission.d.ts +0 -1
  30. package/dist/invocation/admission.js +2 -6
  31. package/dist/invocation/binary.d.ts +1 -1
  32. package/dist/invocation/binary.js +14 -2
  33. package/dist/invocation/binding-codecs.d.ts +0 -1
  34. package/dist/invocation/binding-codecs.js +0 -1
  35. package/dist/invocation/cancellation.d.ts +0 -1
  36. package/dist/invocation/cancellation.js +0 -1
  37. package/dist/invocation/correlation.d.ts +0 -1
  38. package/dist/invocation/correlation.js +0 -1
  39. package/dist/invocation/delegate.d.ts +0 -1
  40. package/dist/invocation/delegate.js +0 -1
  41. package/dist/invocation/http/binary.d.ts +3 -2
  42. package/dist/invocation/http/binary.js +4 -2
  43. package/dist/invocation/http/index.d.ts +1 -2
  44. package/dist/invocation/http/index.js +1 -2
  45. package/dist/invocation/http/negotiation.d.ts +0 -1
  46. package/dist/invocation/http/negotiation.js +0 -1
  47. package/dist/invocation/http/stream.d.ts +0 -1
  48. package/dist/invocation/http/stream.js +0 -1
  49. package/dist/invocation/http/trace.d.ts +0 -1
  50. package/dist/invocation/http/trace.js +0 -1
  51. package/dist/invocation/idempotency.d.ts +0 -1
  52. package/dist/invocation/idempotency.js +0 -1
  53. package/dist/invocation/identity.d.ts +0 -1
  54. package/dist/invocation/identity.js +0 -1
  55. package/dist/invocation/index.d.ts +2 -3
  56. package/dist/invocation/index.js +2 -3
  57. package/dist/invocation/miss.d.ts +0 -1
  58. package/dist/invocation/miss.js +0 -1
  59. package/dist/invocation/redirect.d.ts +0 -1
  60. package/dist/invocation/redirect.js +0 -1
  61. package/dist/invocation/request.d.ts +0 -1
  62. package/dist/invocation/request.js +0 -1
  63. package/dist/invocation/response.d.ts +0 -1
  64. package/dist/invocation/response.js +0 -1
  65. package/dist/invocation/routing.d.ts +0 -1
  66. package/dist/invocation/routing.js +0 -1
  67. package/dist/invocation/schema.d.ts +1 -2
  68. package/dist/invocation/schema.js +0 -1
  69. package/dist/invocation/service-reason.d.ts +3 -11
  70. package/dist/invocation/service-reason.js +0 -12
  71. package/dist/invocation/stale-route.d.ts +0 -1
  72. package/dist/invocation/stale-route.js +0 -1
  73. package/dist/invocation/stream.d.ts +0 -1
  74. package/dist/invocation/stream.js +0 -1
  75. package/dist/invocation/target.d.ts +2 -3
  76. package/dist/invocation/target.js +17 -3
  77. package/dist/invocation/trace.d.ts +0 -1
  78. package/dist/invocation/trace.js +0 -1
  79. package/dist/invocation/version.d.ts +0 -1
  80. package/dist/invocation/version.js +0 -1
  81. package/dist/invocation/websocket/binary.d.ts +0 -1
  82. package/dist/invocation/websocket/binary.js +2 -2
  83. package/dist/invocation/websocket/index.d.ts +0 -1
  84. package/dist/invocation/websocket/index.js +0 -1
  85. package/dist/invocation/websocket/subprotocol.d.ts +0 -1
  86. package/dist/invocation/websocket/subprotocol.js +0 -1
  87. package/dist/issuer/configuration.d.ts +0 -1
  88. package/dist/issuer/configuration.js +0 -1
  89. package/dist/issuer/error.d.ts +0 -1
  90. package/dist/issuer/error.js +0 -1
  91. package/dist/issuer/exchange.d.ts +0 -1
  92. package/dist/issuer/exchange.js +0 -1
  93. package/dist/issuer/hosted.d.ts +0 -1
  94. package/dist/issuer/hosted.js +0 -1
  95. package/dist/issuer/index.d.ts +0 -1
  96. package/dist/issuer/index.js +0 -1
  97. package/dist/issuer/key-set.d.ts +0 -1
  98. package/dist/issuer/key-set.js +0 -1
  99. package/dist/issuer/paths.d.ts +0 -1
  100. package/dist/issuer/paths.js +0 -1
  101. package/dist/issuer/url.d.ts +0 -1
  102. package/dist/issuer/url.js +0 -1
  103. package/dist/publication/bindings/callable.d.ts +0 -1
  104. package/dist/publication/bindings/callable.js +8 -6
  105. package/dist/publication/bindings/index.d.ts +1 -2
  106. package/dist/publication/bindings/index.js +0 -1
  107. package/dist/publication/bindings/invocation.d.ts +0 -1
  108. package/dist/publication/bindings/invocation.js +0 -1
  109. package/dist/publication/bindings/view.d.ts +7 -1
  110. package/dist/publication/bindings/view.js +111 -3
  111. package/dist/publication/bundle-admission.d.ts +0 -1
  112. package/dist/publication/bundle-admission.js +14 -14
  113. package/dist/publication/bundle-descriptor.d.ts +0 -1
  114. package/dist/publication/bundle-descriptor.js +0 -1
  115. package/dist/publication/bundle-evidence.d.ts +0 -1
  116. package/dist/publication/bundle-evidence.js +0 -1
  117. package/dist/publication/bundle.d.ts +4 -2
  118. package/dist/publication/bundle.js +9 -4
  119. package/dist/publication/content.d.ts +0 -1
  120. package/dist/publication/content.js +0 -1
  121. package/dist/publication/declaration.d.ts +0 -1
  122. package/dist/publication/declaration.js +0 -1
  123. package/dist/publication/delivery/attestation.d.ts +0 -1
  124. package/dist/publication/delivery/attestation.js +0 -1
  125. package/dist/publication/delivery/claims.d.ts +1 -2
  126. package/dist/publication/delivery/claims.js +0 -1
  127. package/dist/publication/delivery/delivery.d.ts +0 -1
  128. package/dist/publication/delivery/delivery.js +0 -1
  129. package/dist/publication/delivery/error.d.ts +0 -1
  130. package/dist/publication/delivery/error.js +0 -1
  131. package/dist/publication/delivery/index.d.ts +0 -1
  132. package/dist/publication/delivery/index.js +0 -1
  133. package/dist/publication/delivery/limits.d.ts +0 -1
  134. package/dist/publication/delivery/limits.js +0 -1
  135. package/dist/publication/delivery/request.d.ts +0 -1
  136. package/dist/publication/delivery/request.js +0 -1
  137. package/dist/publication/delivery-declaration.d.ts +0 -1
  138. package/dist/publication/delivery-declaration.js +0 -1
  139. package/dist/publication/delivery-endpoint.d.ts +0 -1
  140. package/dist/publication/delivery-endpoint.js +0 -1
  141. package/dist/publication/error.d.ts +0 -1
  142. package/dist/publication/error.js +0 -1
  143. package/dist/publication/etag.d.ts +0 -1
  144. package/dist/publication/etag.js +5 -2
  145. package/dist/publication/index.d.ts +4 -5
  146. package/dist/publication/index.js +2 -3
  147. package/dist/publication/legacy-requirements.d.ts +12 -0
  148. package/dist/publication/legacy-requirements.js +23 -0
  149. package/dist/publication/manifest.d.ts +2 -3
  150. package/dist/publication/manifest.js +10 -6
  151. package/dist/publication/publication.d.ts +4 -3
  152. package/dist/publication/publication.js +27 -12
  153. package/dist/publication/reference.d.ts +1 -2
  154. package/dist/publication/reference.js +0 -1
  155. package/dist/publication/requirements.d.ts +15 -8
  156. package/dist/publication/requirements.js +147 -45
  157. package/dist/publication/route.d.ts +0 -1
  158. package/dist/publication/route.js +0 -1
  159. package/dist/publication/schema.d.ts +1 -2
  160. package/dist/publication/schema.js +0 -1
  161. package/dist/routes/admission.d.ts +0 -1
  162. package/dist/routes/admission.js +5 -6
  163. package/dist/routes/binding.d.ts +3 -4
  164. package/dist/routes/binding.js +5 -6
  165. package/dist/routes/collision.d.ts +0 -1
  166. package/dist/routes/collision.js +0 -1
  167. package/dist/routes/compiler.d.ts +2 -3
  168. package/dist/routes/compiler.js +14 -12
  169. package/dist/routes/credential.d.ts +0 -1
  170. package/dist/routes/credential.js +0 -1
  171. package/dist/routes/decode.d.ts +2 -3
  172. package/dist/routes/decode.js +14 -25
  173. package/dist/routes/encode.d.ts +2 -3
  174. package/dist/routes/encode.js +18 -17
  175. package/dist/routes/error-response.d.ts +0 -1
  176. package/dist/routes/error-response.js +0 -1
  177. package/dist/routes/error.d.ts +0 -1
  178. package/dist/routes/error.js +0 -1
  179. package/dist/routes/evidence.d.ts +3 -4
  180. package/dist/routes/evidence.js +15 -14
  181. package/dist/routes/index.d.ts +0 -1
  182. package/dist/routes/index.js +0 -1
  183. package/dist/routes/mapping.d.ts +0 -1
  184. package/dist/routes/mapping.js +0 -1
  185. package/dist/routes/match.d.ts +0 -1
  186. package/dist/routes/match.js +0 -1
  187. package/dist/routes/placement.d.ts +0 -1
  188. package/dist/routes/placement.js +1 -2
  189. package/dist/routes/plan.d.ts +5 -5
  190. package/dist/routes/plan.js +0 -1
  191. package/dist/routes/release-unavailable.d.ts +0 -1
  192. package/dist/routes/release-unavailable.js +0 -1
  193. package/dist/routes/request.d.ts +0 -1
  194. package/dist/routes/request.js +3 -2
  195. package/dist/routes/reservation.d.ts +0 -1
  196. package/dist/routes/reservation.js +7 -2
  197. package/dist/routes/routing.d.ts +0 -1
  198. package/dist/routes/routing.js +0 -1
  199. package/dist/routes/scalar.d.ts +3 -4
  200. package/dist/routes/scalar.js +5 -6
  201. package/dist/routes/select.d.ts +0 -1
  202. package/dist/routes/select.js +0 -1
  203. package/dist/routes/stream.d.ts +0 -1
  204. package/dist/routes/stream.js +0 -1
  205. package/dist/routes/table.d.ts +0 -1
  206. package/dist/routes/table.js +0 -1
  207. package/dist/routes/target.d.ts +0 -1
  208. package/dist/routes/target.js +0 -1
  209. package/dist/routes/template.d.ts +0 -1
  210. package/dist/routes/template.js +0 -1
  211. package/dist/runtime/artifact.d.ts +6 -5
  212. package/dist/runtime/artifact.js +22 -10
  213. package/dist/runtime/index.d.ts +1 -2
  214. package/dist/runtime/index.js +1 -2
  215. package/dist/schema/index.d.ts +0 -1
  216. package/dist/schema/index.js +0 -1
  217. package/dist/schema/installation/codec.d.ts +4 -0
  218. package/dist/schema/installation/codec.js +70 -0
  219. package/dist/schema/installation/index.d.ts +2 -1
  220. package/dist/schema/installation/index.js +1 -1
  221. package/dist/schema/installation/introspection/codec.d.ts +3 -3
  222. package/dist/schema/installation/introspection/codec.js +144 -204
  223. package/dist/schema/installation/introspection/index.d.ts +2 -3
  224. package/dist/schema/installation/introspection/index.js +1 -2
  225. package/dist/schema/installation/introspection/result.d.ts +18 -23
  226. package/dist/schema/installation/introspection/result.js +0 -1
  227. package/dist/schema/installation/result.d.ts +9 -0
  228. package/dist/schema/installation/result.js +1 -0
  229. package/package.json +27 -13
  230. package/dist/artifact/index.d.ts.map +0 -1
  231. package/dist/artifact/index.js.map +0 -1
  232. package/dist/artifact/ref.d.ts.map +0 -1
  233. package/dist/artifact/ref.js.map +0 -1
  234. package/dist/codecs/codec.d.ts.map +0 -1
  235. package/dist/codecs/codec.js.map +0 -1
  236. package/dist/codecs/index.d.ts.map +0 -1
  237. package/dist/codecs/index.js.map +0 -1
  238. package/dist/codecs/json.d.ts.map +0 -1
  239. package/dist/codecs/json.js.map +0 -1
  240. package/dist/codecs/media-types.d.ts.map +0 -1
  241. package/dist/codecs/media-types.js.map +0 -1
  242. package/dist/codecs/msgpack.d.ts.map +0 -1
  243. package/dist/codecs/msgpack.js.map +0 -1
  244. package/dist/errors/codes.d.ts.map +0 -1
  245. package/dist/errors/codes.js.map +0 -1
  246. package/dist/errors/http-status.d.ts.map +0 -1
  247. package/dist/errors/http-status.js.map +0 -1
  248. package/dist/errors/index.d.ts.map +0 -1
  249. package/dist/errors/index.js.map +0 -1
  250. package/dist/errors/payload.d.ts.map +0 -1
  251. package/dist/errors/payload.js.map +0 -1
  252. package/dist/errors/protocol-error.d.ts.map +0 -1
  253. package/dist/errors/protocol-error.js.map +0 -1
  254. package/dist/errors/reason.d.ts.map +0 -1
  255. package/dist/errors/reason.js.map +0 -1
  256. package/dist/index.d.ts.map +0 -1
  257. package/dist/index.js.map +0 -1
  258. package/dist/invocation/admission.d.ts.map +0 -1
  259. package/dist/invocation/admission.js.map +0 -1
  260. package/dist/invocation/binary.d.ts.map +0 -1
  261. package/dist/invocation/binary.js.map +0 -1
  262. package/dist/invocation/binding-codecs.d.ts.map +0 -1
  263. package/dist/invocation/binding-codecs.js.map +0 -1
  264. package/dist/invocation/cancellation.d.ts.map +0 -1
  265. package/dist/invocation/cancellation.js.map +0 -1
  266. package/dist/invocation/correlation.d.ts.map +0 -1
  267. package/dist/invocation/correlation.js.map +0 -1
  268. package/dist/invocation/delegate.d.ts.map +0 -1
  269. package/dist/invocation/delegate.js.map +0 -1
  270. package/dist/invocation/http/binary.d.ts.map +0 -1
  271. package/dist/invocation/http/binary.js.map +0 -1
  272. package/dist/invocation/http/index.d.ts.map +0 -1
  273. package/dist/invocation/http/index.js.map +0 -1
  274. package/dist/invocation/http/negotiation.d.ts.map +0 -1
  275. package/dist/invocation/http/negotiation.js.map +0 -1
  276. package/dist/invocation/http/stream.d.ts.map +0 -1
  277. package/dist/invocation/http/stream.js.map +0 -1
  278. package/dist/invocation/http/trace.d.ts.map +0 -1
  279. package/dist/invocation/http/trace.js.map +0 -1
  280. package/dist/invocation/idempotency.d.ts.map +0 -1
  281. package/dist/invocation/idempotency.js.map +0 -1
  282. package/dist/invocation/identity.d.ts.map +0 -1
  283. package/dist/invocation/identity.js.map +0 -1
  284. package/dist/invocation/index.d.ts.map +0 -1
  285. package/dist/invocation/index.js.map +0 -1
  286. package/dist/invocation/miss.d.ts.map +0 -1
  287. package/dist/invocation/miss.js.map +0 -1
  288. package/dist/invocation/redirect.d.ts.map +0 -1
  289. package/dist/invocation/redirect.js.map +0 -1
  290. package/dist/invocation/request.d.ts.map +0 -1
  291. package/dist/invocation/request.js.map +0 -1
  292. package/dist/invocation/response.d.ts.map +0 -1
  293. package/dist/invocation/response.js.map +0 -1
  294. package/dist/invocation/routing.d.ts.map +0 -1
  295. package/dist/invocation/routing.js.map +0 -1
  296. package/dist/invocation/schema.d.ts.map +0 -1
  297. package/dist/invocation/schema.js.map +0 -1
  298. package/dist/invocation/service-reason.d.ts.map +0 -1
  299. package/dist/invocation/service-reason.js.map +0 -1
  300. package/dist/invocation/stale-route.d.ts.map +0 -1
  301. package/dist/invocation/stale-route.js.map +0 -1
  302. package/dist/invocation/stream.d.ts.map +0 -1
  303. package/dist/invocation/stream.js.map +0 -1
  304. package/dist/invocation/target.d.ts.map +0 -1
  305. package/dist/invocation/target.js.map +0 -1
  306. package/dist/invocation/trace.d.ts.map +0 -1
  307. package/dist/invocation/trace.js.map +0 -1
  308. package/dist/invocation/version.d.ts.map +0 -1
  309. package/dist/invocation/version.js.map +0 -1
  310. package/dist/invocation/websocket/binary.d.ts.map +0 -1
  311. package/dist/invocation/websocket/binary.js.map +0 -1
  312. package/dist/invocation/websocket/index.d.ts.map +0 -1
  313. package/dist/invocation/websocket/index.js.map +0 -1
  314. package/dist/invocation/websocket/subprotocol.d.ts.map +0 -1
  315. package/dist/invocation/websocket/subprotocol.js.map +0 -1
  316. package/dist/issuer/configuration.d.ts.map +0 -1
  317. package/dist/issuer/configuration.js.map +0 -1
  318. package/dist/issuer/error.d.ts.map +0 -1
  319. package/dist/issuer/error.js.map +0 -1
  320. package/dist/issuer/exchange.d.ts.map +0 -1
  321. package/dist/issuer/exchange.js.map +0 -1
  322. package/dist/issuer/hosted.d.ts.map +0 -1
  323. package/dist/issuer/hosted.js.map +0 -1
  324. package/dist/issuer/index.d.ts.map +0 -1
  325. package/dist/issuer/index.js.map +0 -1
  326. package/dist/issuer/key-set.d.ts.map +0 -1
  327. package/dist/issuer/key-set.js.map +0 -1
  328. package/dist/issuer/paths.d.ts.map +0 -1
  329. package/dist/issuer/paths.js.map +0 -1
  330. package/dist/issuer/url.d.ts.map +0 -1
  331. package/dist/issuer/url.js.map +0 -1
  332. package/dist/publication/bindings/callable.d.ts.map +0 -1
  333. package/dist/publication/bindings/callable.js.map +0 -1
  334. package/dist/publication/bindings/index.d.ts.map +0 -1
  335. package/dist/publication/bindings/index.js.map +0 -1
  336. package/dist/publication/bindings/invocation.d.ts.map +0 -1
  337. package/dist/publication/bindings/invocation.js.map +0 -1
  338. package/dist/publication/bindings/view.d.ts.map +0 -1
  339. package/dist/publication/bindings/view.js.map +0 -1
  340. package/dist/publication/bundle-admission.d.ts.map +0 -1
  341. package/dist/publication/bundle-admission.js.map +0 -1
  342. package/dist/publication/bundle-descriptor.d.ts.map +0 -1
  343. package/dist/publication/bundle-descriptor.js.map +0 -1
  344. package/dist/publication/bundle-evidence.d.ts.map +0 -1
  345. package/dist/publication/bundle-evidence.js.map +0 -1
  346. package/dist/publication/bundle.d.ts.map +0 -1
  347. package/dist/publication/bundle.js.map +0 -1
  348. package/dist/publication/content.d.ts.map +0 -1
  349. package/dist/publication/content.js.map +0 -1
  350. package/dist/publication/declaration.d.ts.map +0 -1
  351. package/dist/publication/declaration.js.map +0 -1
  352. package/dist/publication/delivery/attestation.d.ts.map +0 -1
  353. package/dist/publication/delivery/attestation.js.map +0 -1
  354. package/dist/publication/delivery/claims.d.ts.map +0 -1
  355. package/dist/publication/delivery/claims.js.map +0 -1
  356. package/dist/publication/delivery/delivery.d.ts.map +0 -1
  357. package/dist/publication/delivery/delivery.js.map +0 -1
  358. package/dist/publication/delivery/error.d.ts.map +0 -1
  359. package/dist/publication/delivery/error.js.map +0 -1
  360. package/dist/publication/delivery/index.d.ts.map +0 -1
  361. package/dist/publication/delivery/index.js.map +0 -1
  362. package/dist/publication/delivery/limits.d.ts.map +0 -1
  363. package/dist/publication/delivery/limits.js.map +0 -1
  364. package/dist/publication/delivery/request.d.ts.map +0 -1
  365. package/dist/publication/delivery/request.js.map +0 -1
  366. package/dist/publication/delivery-declaration.d.ts.map +0 -1
  367. package/dist/publication/delivery-declaration.js.map +0 -1
  368. package/dist/publication/delivery-endpoint.d.ts.map +0 -1
  369. package/dist/publication/delivery-endpoint.js.map +0 -1
  370. package/dist/publication/error.d.ts.map +0 -1
  371. package/dist/publication/error.js.map +0 -1
  372. package/dist/publication/etag.d.ts.map +0 -1
  373. package/dist/publication/etag.js.map +0 -1
  374. package/dist/publication/index.d.ts.map +0 -1
  375. package/dist/publication/index.js.map +0 -1
  376. package/dist/publication/manifest.d.ts.map +0 -1
  377. package/dist/publication/manifest.js.map +0 -1
  378. package/dist/publication/publication.d.ts.map +0 -1
  379. package/dist/publication/publication.js.map +0 -1
  380. package/dist/publication/reference.d.ts.map +0 -1
  381. package/dist/publication/reference.js.map +0 -1
  382. package/dist/publication/requirements.d.ts.map +0 -1
  383. package/dist/publication/requirements.js.map +0 -1
  384. package/dist/publication/route.d.ts.map +0 -1
  385. package/dist/publication/route.js.map +0 -1
  386. package/dist/publication/schema.d.ts.map +0 -1
  387. package/dist/publication/schema.js.map +0 -1
  388. package/dist/routes/admission.d.ts.map +0 -1
  389. package/dist/routes/admission.js.map +0 -1
  390. package/dist/routes/binding.d.ts.map +0 -1
  391. package/dist/routes/binding.js.map +0 -1
  392. package/dist/routes/collision.d.ts.map +0 -1
  393. package/dist/routes/collision.js.map +0 -1
  394. package/dist/routes/compiler.d.ts.map +0 -1
  395. package/dist/routes/compiler.js.map +0 -1
  396. package/dist/routes/credential.d.ts.map +0 -1
  397. package/dist/routes/credential.js.map +0 -1
  398. package/dist/routes/decode.d.ts.map +0 -1
  399. package/dist/routes/decode.js.map +0 -1
  400. package/dist/routes/encode.d.ts.map +0 -1
  401. package/dist/routes/encode.js.map +0 -1
  402. package/dist/routes/error-response.d.ts.map +0 -1
  403. package/dist/routes/error-response.js.map +0 -1
  404. package/dist/routes/error.d.ts.map +0 -1
  405. package/dist/routes/error.js.map +0 -1
  406. package/dist/routes/evidence.d.ts.map +0 -1
  407. package/dist/routes/evidence.js.map +0 -1
  408. package/dist/routes/index.d.ts.map +0 -1
  409. package/dist/routes/index.js.map +0 -1
  410. package/dist/routes/mapping.d.ts.map +0 -1
  411. package/dist/routes/mapping.js.map +0 -1
  412. package/dist/routes/match.d.ts.map +0 -1
  413. package/dist/routes/match.js.map +0 -1
  414. package/dist/routes/placement.d.ts.map +0 -1
  415. package/dist/routes/placement.js.map +0 -1
  416. package/dist/routes/plan.d.ts.map +0 -1
  417. package/dist/routes/plan.js.map +0 -1
  418. package/dist/routes/release-unavailable.d.ts.map +0 -1
  419. package/dist/routes/release-unavailable.js.map +0 -1
  420. package/dist/routes/request.d.ts.map +0 -1
  421. package/dist/routes/request.js.map +0 -1
  422. package/dist/routes/reservation.d.ts.map +0 -1
  423. package/dist/routes/reservation.js.map +0 -1
  424. package/dist/routes/routing.d.ts.map +0 -1
  425. package/dist/routes/routing.js.map +0 -1
  426. package/dist/routes/scalar.d.ts.map +0 -1
  427. package/dist/routes/scalar.js.map +0 -1
  428. package/dist/routes/select.d.ts.map +0 -1
  429. package/dist/routes/select.js.map +0 -1
  430. package/dist/routes/stream.d.ts.map +0 -1
  431. package/dist/routes/stream.js.map +0 -1
  432. package/dist/routes/table.d.ts.map +0 -1
  433. package/dist/routes/table.js.map +0 -1
  434. package/dist/routes/target.d.ts.map +0 -1
  435. package/dist/routes/target.js.map +0 -1
  436. package/dist/routes/template.d.ts.map +0 -1
  437. package/dist/routes/template.js.map +0 -1
  438. package/dist/runtime/artifact.d.ts.map +0 -1
  439. package/dist/runtime/artifact.js.map +0 -1
  440. package/dist/runtime/index.d.ts.map +0 -1
  441. package/dist/runtime/index.js.map +0 -1
  442. package/dist/schema/index.d.ts.map +0 -1
  443. package/dist/schema/index.js.map +0 -1
  444. package/dist/schema/installation/index.d.ts.map +0 -1
  445. package/dist/schema/installation/index.js.map +0 -1
  446. package/dist/schema/installation/introspection/codec.d.ts.map +0 -1
  447. package/dist/schema/installation/introspection/codec.js.map +0 -1
  448. package/dist/schema/installation/introspection/index.d.ts.map +0 -1
  449. package/dist/schema/installation/introspection/index.js.map +0 -1
  450. package/dist/schema/installation/introspection/result.d.ts.map +0 -1
  451. package/dist/schema/installation/introspection/result.js.map +0 -1
@@ -0,0 +1,70 @@
1
+ import { installReceipt } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
2
+ import { acceptDomainInfo } from './introspection/index.js';
3
+ export const MEDIA_TYPE = 'application/vnd.astrale.schema-installation.v1+msgpack';
4
+ export async function encode(result) {
5
+ const { pack } = await import('msgpackr/pack');
6
+ return new Uint8Array(pack(accept(result)));
7
+ }
8
+ export async function decode(bytes, maximumBytes) {
9
+ if (!(bytes instanceof Uint8Array) ||
10
+ !Number.isSafeInteger(maximumBytes) ||
11
+ maximumBytes < 1 ||
12
+ bytes.byteLength > maximumBytes) {
13
+ throw new TypeError('Schema installation evidence is invalid or exceeds its bound.');
14
+ }
15
+ const { unpack } = await import('msgpackr');
16
+ let value;
17
+ try {
18
+ value = unpack(bytes);
19
+ }
20
+ catch (cause) {
21
+ throw new TypeError('Schema installation evidence is malformed.', { cause });
22
+ }
23
+ return accept(value);
24
+ }
25
+ function accept(input) {
26
+ const value = record(input);
27
+ if (value.changed === true) {
28
+ exact(value, ['changed', 'receipt']);
29
+ const receipt = installReceipt.parse(value.receipt);
30
+ if (receipt.transitions.some((transition) => transition.intent.operation !== receipt.operation)) {
31
+ throw new TypeError('Schema installation Transition belongs to another operation.');
32
+ }
33
+ uniqueOrigins(receipt.transitions.map((transition) => transition.intent.origin), 'Schema installation Transitions');
34
+ return Object.freeze({
35
+ changed: true,
36
+ receipt,
37
+ });
38
+ }
39
+ if (value.changed === false) {
40
+ exact(value, ['changed', 'domains']);
41
+ if (!Array.isArray(value.domains) || value.domains.length === 0) {
42
+ throw new TypeError('Schema installation unchanged Domains are empty.');
43
+ }
44
+ const domains = value.domains.map(acceptDomainInfo);
45
+ uniqueOrigins(domains.map((domain) => domain.origin), 'Schema installation unchanged Domains');
46
+ return Object.freeze({
47
+ changed: false,
48
+ domains: Object.freeze(domains),
49
+ });
50
+ }
51
+ throw new TypeError('Schema installation result kind is invalid.');
52
+ }
53
+ function uniqueOrigins(origins, label) {
54
+ if (new Set(origins).size !== origins.length) {
55
+ throw new TypeError(`${label} contain duplicate origins.`);
56
+ }
57
+ }
58
+ function record(input) {
59
+ if (input === null || typeof input !== 'object' || Array.isArray(input)) {
60
+ throw new TypeError('Schema installation result is invalid.');
61
+ }
62
+ return input;
63
+ }
64
+ function exact(input, expected) {
65
+ const keys = Object.keys(input).sort();
66
+ const wanted = [...expected].sort();
67
+ if (keys.length !== wanted.length || keys.some((key, index) => key !== wanted[index])) {
68
+ throw new TypeError('Schema installation result fields are invalid.');
69
+ }
70
+ }
@@ -1,2 +1,3 @@
1
+ export { MEDIA_TYPE, decode, encode } from './codec.js';
1
2
  export * as introspection from './introspection/index.js';
2
- //# sourceMappingURL=index.d.ts.map
3
+ export type { InstallResult } from './result.js';
@@ -1,2 +1,2 @@
1
+ export { MEDIA_TYPE, decode, encode } from './codec.js';
1
2
  export * as introspection from './introspection/index.js';
2
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import type { introspection } from '@astrale-os/kernel-core/schema';
2
- import type { Limits, ResultFor } from './result.js';
3
- export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-introspection.v1+msgpack';
2
+ import type { DomainInfo, Limits, ResultFor } from './result.js';
3
+ export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-introspection.v2+msgpack';
4
4
  export declare function encode<Input extends introspection.Introspection>(input: Input, result: ResultFor<Input>): Promise<Uint8Array>;
5
5
  export declare function decode<Input extends introspection.Introspection>(input: Input, bytes: Uint8Array, limits: Limits): Promise<ResultFor<Input>>;
6
- //# sourceMappingURL=codec.d.ts.map
6
+ export declare function acceptDomainInfo(input: unknown): DomainInfo;
@@ -1,24 +1,35 @@
1
- import { bundle } from '@astrale-os/kernel-dsl/v1';
2
- import * as artifact from '../../../artifact/index.js';
3
- import { json } from '../../../codecs/index.js';
1
+ import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import * as bundle from '@astrale-os/kernel-dsl/v1/bundle/transport';
3
+ import { revision as schemaRevision } from '@astrale-os/kernel-dsl/v1/schema/revision';
4
+ import { admitCallableBinding, admitViewBinding } from '../../../publication/bindings/index.js';
4
5
  import * as publication from '../../../publication/index.js';
5
- import * as runtime from '../../../runtime/index.js';
6
- export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.v1+msgpack';
6
+ export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.v2+msgpack';
7
+ const encodedBundles = new WeakMap();
8
+ const admittedBundles = new Map();
9
+ const MAXIMUM_ADMITTED_BUNDLES = 128;
7
10
  export async function encode(input, result) {
8
- const fields = selected(input);
9
- const wire = result === null ? null : encodeResult(fields, result);
10
- const { pack } = await import(/* @vite-ignore */ 'msgpackr/pack');
11
+ const request = admitRequest(input);
12
+ const wire = request.kind === 'bundle'
13
+ ? encodeDomainBundle(result)
14
+ : encodeDomainInfo(result);
15
+ proveRequestedOrigin(request, result);
16
+ const { pack } = await import('msgpackr/pack');
11
17
  return new Uint8Array(pack(wire));
12
18
  }
13
19
  export async function decode(input, bytes, limits) {
20
+ const request = admitRequest(input);
14
21
  if (!(bytes instanceof Uint8Array))
15
22
  invalid('Schema introspection evidence must be binary.');
16
23
  admitLimit(limits.maximumPublicationBytes, 'Publication');
17
- admitLimit(limits.maximumBundleBytes, 'Bundle');
18
- if (bytes.byteLength > limits.maximumPublicationBytes + limits.maximumBundleBytes + 2_048) {
24
+ if (request.kind === 'bundle')
25
+ admitLimit(limits.maximumBundleBytes, 'Bundle');
26
+ const maximumEvidenceBytes = limits.maximumPublicationBytes +
27
+ (request.kind === 'bundle' ? limits.maximumBundleBytes : 0) +
28
+ 4_096;
29
+ if (bytes.byteLength > maximumEvidenceBytes) {
19
30
  invalid('Schema introspection evidence exceeds its declared bounds.');
20
31
  }
21
- const { unpack } = await import(/* @vite-ignore */ 'msgpackr/unpack');
32
+ const { unpack } = await import('msgpackr');
22
33
  let decoded;
23
34
  try {
24
35
  decoded = unpack(bytes);
@@ -26,202 +37,147 @@ export async function decode(input, bytes, limits) {
26
37
  catch (cause) {
27
38
  throw new TypeError('Schema introspection evidence is malformed.', { cause });
28
39
  }
29
- if (decoded === null)
30
- return null;
31
- if (!isRecord(decoded))
32
- invalid('Schema introspection result must be an object or null.');
33
- const fields = selected(input);
34
- exact(decoded, fields, 'Schema introspection result');
35
- return decodeResult(fields, decoded, limits);
36
- }
37
- function encodeResult(fields, result) {
38
- exact(result, fields, 'Schema introspection result');
39
- const source = fields.includes('source') ? encodeSource(result.source) : undefined;
40
- const output = {};
41
- for (const field of fields) {
42
- switch (field) {
43
- case 'state':
44
- output.state = state(result.state);
45
- break;
46
- case 'target':
47
- output.target = digest(result.target, 'Installation target');
48
- break;
49
- case 'source':
50
- output.source = source;
51
- break;
52
- case 'bundle':
53
- output.bundle = encodeBundle(result.bundle, result.source);
54
- break;
55
- case 'readiness':
56
- output.readiness =
57
- result.readiness === null ? null : digest(result.readiness, 'Installation readiness');
58
- break;
59
- case 'capabilities':
60
- output.capabilities = capabilities(result.capabilities);
61
- break;
62
- }
63
- }
64
- return Object.freeze(output);
65
- }
66
- function decodeResult(fields, input, limits) {
67
- const source = fields.includes('source') ? decodeSource(input.source, limits) : undefined;
68
- const output = {};
69
- for (const field of fields) {
70
- switch (field) {
71
- case 'state':
72
- output.state = state(input.state);
73
- break;
74
- case 'target':
75
- output.target = digest(input.target, 'Installation target');
76
- break;
77
- case 'source':
78
- output.source = source;
79
- break;
80
- case 'bundle':
81
- output.bundle = decodeBundle(input.bundle, source, limits.maximumBundleBytes);
82
- break;
83
- case 'readiness':
84
- output.readiness =
85
- input.readiness === null ? null : digest(input.readiness, 'Installation readiness');
86
- break;
87
- case 'capabilities':
88
- output.capabilities = capabilities(input.capabilities);
89
- break;
90
- }
40
+ const result = (request.kind === 'bundle'
41
+ ? decodeDomainBundle(decoded, limits.maximumBundleBytes)
42
+ : acceptDomainInfo(decoded));
43
+ proveRequestedOrigin(request, result);
44
+ return result;
45
+ }
46
+ function proveRequestedOrigin(request, result) {
47
+ const origin = request.kind === 'bundle'
48
+ ? result.domain.origin
49
+ : result.origin;
50
+ if (origin !== request.origin)
51
+ invalid('Schema introspection evidence does not match the requested origin.');
52
+ }
53
+ function encodeDomainBundle(input) {
54
+ exact(input, ['bundle', 'domain'], 'Domain Bundle result');
55
+ const admittedDomain = acceptDomainInfo(input.domain);
56
+ const domain = encodeDomainInfo(admittedDomain);
57
+ proveBundle(input.bundle, admittedDomain);
58
+ const encoded = encodedBundles.get(input.bundle) ?? bundle.encode(input.bundle);
59
+ if (!encodedBundles.has(input.bundle))
60
+ encodedBundles.set(input.bundle, encoded);
61
+ return Object.freeze({ domain, bundle: encoded });
62
+ }
63
+ function decodeDomainBundle(input, maximum) {
64
+ const value = record(input, 'Domain Bundle result');
65
+ exact(value, ['bundle', 'domain'], 'Domain Bundle result');
66
+ const domain = acceptDomainInfo(value.domain);
67
+ const encoded = boundedBytes(value.bundle, maximum, 'Bundle');
68
+ const cached = admittedBundles.get(domain.generation);
69
+ if (cached !== undefined && sameBytes(cached.bytes, encoded)) {
70
+ return Object.freeze({ domain, bundle: cached.bundle });
91
71
  }
92
- if (output.state === 'ready' && Object.hasOwn(output, 'readiness') && output.readiness === null) {
93
- invalid('A ready Installation requires readiness evidence.');
72
+ let admitted;
73
+ try {
74
+ admitted = bundle.decode(encoded);
94
75
  }
95
- return Object.freeze(output);
96
- }
97
- function encodeSource(input) {
98
- if (input?.kind === 'builtin') {
99
- return Object.freeze({
100
- kind: 'builtin',
101
- bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Builtin schema Bundle'),
102
- });
76
+ catch (cause) {
77
+ throw new TypeError('Installed Domain Bundle is invalid.', { cause });
78
+ }
79
+ proveBundle(admitted, domain);
80
+ admittedBundles.delete(domain.generation);
81
+ admittedBundles.set(domain.generation, Object.freeze({ bytes: encoded, bundle: admitted }));
82
+ if (admittedBundles.size > MAXIMUM_ADMITTED_BUNDLES) {
83
+ admittedBundles.delete(admittedBundles.keys().next().value);
84
+ }
85
+ return Object.freeze({ domain, bundle: admitted });
86
+ }
87
+ function sameBytes(left, right) {
88
+ if (left.byteLength !== right.byteLength)
89
+ return false;
90
+ for (let index = 0; index < left.byteLength; index += 1) {
91
+ if (left[index] !== right[index])
92
+ return false;
93
+ }
94
+ return true;
95
+ }
96
+ function encodeDomainInfo(input) {
97
+ return acceptDomainInfo(input);
98
+ }
99
+ export function acceptDomainInfo(input) {
100
+ const value = record(input, 'Domain info');
101
+ exact(value, ['bindings', 'capabilities', 'generation', 'origin', 'publication', 'readiness', 'revision'], 'Domain info');
102
+ if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
103
+ invalid('Domain info origin is invalid.');
104
+ }
105
+ if (typeof value.revision !== 'string' || !patterns.revision.test(value.revision)) {
106
+ invalid('Domain info revision is invalid.');
107
+ }
108
+ const origin = value.origin;
109
+ const revision = value.revision;
110
+ const published = publicationReference(value.publication, origin, revision);
111
+ return Object.freeze({
112
+ origin,
113
+ revision,
114
+ generation: digest(value.generation, 'Domain generation'),
115
+ publication: published,
116
+ readiness: digest(value.readiness, 'Domain readiness'),
117
+ capabilities: capabilities(value.capabilities),
118
+ bindings: bindings(value.bindings, origin),
119
+ });
120
+ }
121
+ function publicationReference(input, origin, revision) {
122
+ if (input === null)
123
+ return null;
124
+ let admitted;
125
+ try {
126
+ admitted = publication.acceptReference(input);
103
127
  }
104
- if (input?.kind === 'local') {
105
- return Object.freeze({
106
- kind: 'local',
107
- artifact: ref(input.artifact, runtime.MEDIA_TYPE, 'Local Runtime Artifact'),
108
- bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
109
- });
128
+ catch (cause) {
129
+ throw new TypeError('Domain Publication metadata is invalid.', { cause });
110
130
  }
111
- if (input?.kind === 'remote') {
112
- return Object.freeze({
113
- kind: 'remote',
114
- publication: publication.encode(publication.accept(input.publication)),
115
- });
131
+ if (admitted.origin !== origin || admitted.revision !== revision) {
132
+ invalid('Domain Publication metadata does not match its Schema coordinate.');
116
133
  }
117
- return invalid('Installation source is invalid.');
134
+ return admitted;
118
135
  }
119
- function decodeSource(input, limits) {
120
- if (!isRecord(input))
121
- invalid('Installation source is invalid.');
122
- if (input.kind === 'builtin') {
123
- exact(input, ['bundle', 'kind'], 'Builtin installation source');
124
- return Object.freeze({
125
- kind: 'builtin',
126
- bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Builtin schema Bundle'),
127
- });
136
+ function bindings(input, origin) {
137
+ const value = record(input, 'Domain bindings');
138
+ exact(value, ['callables', 'views'], 'Domain bindings');
139
+ if (!Array.isArray(value.callables) || !Array.isArray(value.views)) {
140
+ invalid('Domain bindings are invalid.');
128
141
  }
129
- if (input.kind === 'local') {
130
- exact(input, ['artifact', 'bundle', 'kind'], 'Local installation source');
142
+ try {
131
143
  return Object.freeze({
132
- kind: 'local',
133
- artifact: ref(input.artifact, runtime.MEDIA_TYPE, 'Local Runtime Artifact'),
134
- bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
144
+ callables: Object.freeze(value.callables.map((entry) => admitCallableBinding(entry, origin))),
145
+ views: Object.freeze(value.views.map((entry) => admitViewBinding(entry, origin))),
135
146
  });
136
147
  }
137
- if (input.kind === 'remote') {
138
- exact(input, ['kind', 'publication'], 'Remote installation source');
139
- const encoded = boundedBytes(input.publication, limits.maximumPublicationBytes, 'Publication');
140
- let admitted;
141
- try {
142
- admitted = publication.accept(json.decode(encoded));
143
- }
144
- catch (cause) {
145
- throw new TypeError('Remote installed Publication is invalid.', { cause });
146
- }
147
- if (!equal(encoded, publication.encode(admitted))) {
148
- invalid('Remote installed Publication is not canonical.');
149
- }
150
- return Object.freeze({ kind: 'remote', publication: admitted });
151
- }
152
- return invalid('Installation source kind is invalid.');
153
- }
154
- function encodeBundle(input, source) {
155
- if (source === undefined || input === undefined)
156
- invalid('Bundle source evidence is missing.');
157
- const admitted = source.kind === 'remote'
158
- ? publication.acceptBundle(source.publication, input)
159
- : bundle.accept(input);
160
- const encoded = bundle.encode(admitted);
161
- if (source.kind !== 'remote' &&
162
- !same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
163
- invalid('Local schema Bundle does not match its source Ref.');
164
- }
165
- return encoded;
166
- }
167
- function decodeBundle(input, source, maximum) {
168
- const encoded = boundedBytes(input, maximum, 'Bundle');
169
- let admitted;
170
- try {
171
- admitted =
172
- source.kind === 'remote'
173
- ? publication.decodeBundle(source.publication, encoded)
174
- : bundle.decode(encoded);
175
- }
176
148
  catch (cause) {
177
- throw new TypeError('Installed schema Bundle is invalid.', { cause });
178
- }
179
- if (!equal(encoded, bundle.encode(admitted)))
180
- invalid('Installed schema Bundle is not canonical.');
181
- if (source.kind !== 'remote' &&
182
- !same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
183
- invalid('Local schema Bundle does not match its source Ref.');
149
+ throw new TypeError('Domain bindings are invalid.', { cause });
184
150
  }
185
- return admitted;
186
151
  }
187
- function selected(input) {
188
- if (input === null ||
189
- typeof input !== 'object' ||
190
- input.from?.kind !== 'installation' ||
191
- input.select === null ||
192
- typeof input.select !== 'object') {
193
- invalid('Schema introspection request is invalid.');
194
- }
195
- const allowed = ['state', 'target', 'source', 'bundle', 'readiness', 'capabilities'];
196
- const fields = Object.keys(input.select);
197
- if (fields.length === 0 ||
198
- fields.some((field) => !allowed.includes(field) ||
199
- input.select[field] !== true) ||
200
- (input.select.bundle === true && input.select.source !== true)) {
201
- invalid('Schema introspection selection is invalid.');
152
+ function proveBundle(input, domain) {
153
+ if (input.root.origin !== domain.origin || schemaRevision(input.root) !== domain.revision) {
154
+ invalid('Installed Bundle root does not match the ready Domain coordinate.');
202
155
  }
203
- return Object.freeze(allowed.filter((field) => input.select[field] === true));
204
156
  }
205
157
  function capabilities(input) {
206
- if (!isRecord(input))
207
- invalid('Installation capabilities are invalid.');
208
- exact(input, ['materialized', 'requested'], 'Installation capabilities');
158
+ const value = record(input, 'Domain capabilities');
159
+ exact(value, ['materialized', 'requested'], 'Domain capabilities');
209
160
  try {
210
- const requested = publication.admitRequirements({ capabilities: input.requested }).capabilities;
161
+ const requested = publication.admitRequirements({ capabilities: value.requested }).capabilities;
211
162
  const materialized = publication.admitRequirements({
212
- capabilities: input.materialized,
163
+ capabilities: value.materialized,
213
164
  }).capabilities;
214
165
  return Object.freeze({ requested, materialized });
215
166
  }
216
167
  catch (cause) {
217
- throw new TypeError('Installation capabilities are invalid.', { cause });
168
+ throw new TypeError('Domain capabilities are invalid.', { cause });
218
169
  }
219
170
  }
220
- function state(input) {
221
- if (input !== 'installed' && input !== 'ready' && input !== 'removing') {
222
- invalid('Installation state is invalid.');
171
+ function admitRequest(input) {
172
+ const value = record(input, 'Schema introspection request');
173
+ exact(value, ['kind', 'origin'], 'Schema introspection request');
174
+ if (value.kind !== 'inspect' && value.kind !== 'bundle') {
175
+ invalid('Schema introspection kind is invalid.');
223
176
  }
224
- return input;
177
+ if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
178
+ invalid('Schema introspection origin is invalid.');
179
+ }
180
+ return Object.freeze({ kind: value.kind, origin: value.origin });
225
181
  }
226
182
  function digest(input, label) {
227
183
  if (typeof input !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input)) {
@@ -229,21 +185,6 @@ function digest(input, label) {
229
185
  }
230
186
  return input;
231
187
  }
232
- function ref(input, mediaType, label) {
233
- let admitted;
234
- try {
235
- admitted = artifact.accept(input);
236
- }
237
- catch (cause) {
238
- throw new TypeError(`${label} Ref is invalid.`, { cause });
239
- }
240
- if (admitted.mediaType !== mediaType)
241
- invalid(`${label} media type is invalid.`);
242
- return admitted;
243
- }
244
- function same(left, right) {
245
- return (left.digest === right.digest && left.mediaType === right.mediaType && left.size === right.size);
246
- }
247
188
  function boundedBytes(input, maximum, label) {
248
189
  if (!(input instanceof Uint8Array) || input.byteLength === 0 || input.byteLength > maximum) {
249
190
  invalid(`${label} evidence is invalid or exceeds its bound.`);
@@ -254,6 +195,12 @@ function admitLimit(input, label) {
254
195
  if (!Number.isSafeInteger(input) || input < 1)
255
196
  invalid(`${label} evidence bound is invalid.`);
256
197
  }
198
+ function record(input, label) {
199
+ if (input === null || typeof input !== 'object' || Array.isArray(input)) {
200
+ invalid(`${label} is invalid.`);
201
+ }
202
+ return input;
203
+ }
257
204
  function exact(input, expected, label) {
258
205
  const keys = Object.keys(input).sort();
259
206
  const wanted = [...expected].sort();
@@ -261,13 +208,6 @@ function exact(input, expected, label) {
261
208
  invalid(`${label} fields are invalid.`);
262
209
  }
263
210
  }
264
- function equal(left, right) {
265
- return left.byteLength === right.byteLength && left.every((byte, index) => byte === right[index]);
266
- }
267
- function isRecord(input) {
268
- return input !== null && typeof input === 'object' && !Array.isArray(input);
269
- }
270
211
  function invalid(message) {
271
212
  throw new TypeError(message);
272
213
  }
273
- //# sourceMappingURL=codec.js.map
@@ -1,3 +1,2 @@
1
- export { MEDIA_TYPE, decode, encode } from './codec.js';
2
- export type { Digest, Installation, Limits, ResultFor, Source } from './result.js';
3
- //# sourceMappingURL=index.d.ts.map
1
+ export { MEDIA_TYPE, acceptDomainInfo, decode, encode } from './codec.js';
2
+ export type { Digest, DomainBundle, DomainInfo, Limits, ResultFor } from './result.js';
@@ -1,2 +1 @@
1
- export { MEDIA_TYPE, decode, encode } from './codec.js';
2
- //# sourceMappingURL=index.js.map
1
+ export { MEDIA_TYPE, acceptDomainInfo, decode, encode } from './codec.js';
@@ -1,34 +1,29 @@
1
1
  import type { introspection } from '@astrale-os/kernel-core/schema';
2
- import type { bundle } from '@astrale-os/kernel-dsl/v1';
3
- import type { Ref } from '../../../artifact/index.js';
4
- import type { Publication } from '../../../publication/index.js';
5
- import type { PublicationRequirements } from '../../../publication/index.js';
2
+ import type { bundle, Key, Revision } from '@astrale-os/kernel-dsl/v1';
3
+ import type { Publication, PublicationRef, PublicationRequirements } from '../../../publication/index.js';
6
4
  export type Digest = `sha256:${string}`;
7
- export type Source = {
8
- readonly kind: 'builtin';
9
- readonly bundle: Ref;
10
- } | {
11
- readonly kind: 'local';
12
- readonly artifact: Ref;
13
- readonly bundle: Ref;
14
- } | {
15
- readonly kind: 'remote';
16
- readonly publication: Publication;
17
- };
18
- export interface Installation {
19
- readonly state: 'installed' | 'ready' | 'removing';
20
- readonly target: Digest;
21
- readonly source: Source;
22
- readonly bundle: bundle.Bundle;
23
- readonly readiness: Digest | null;
5
+ /** Lightweight proof of one exact ready installed Domain generation. */
6
+ export interface DomainInfo {
7
+ readonly origin: Key.Origin;
8
+ readonly revision: Revision;
9
+ readonly generation: Digest;
10
+ readonly publication: PublicationRef | null;
11
+ readonly readiness: Digest;
24
12
  readonly capabilities: {
25
13
  readonly requested: PublicationRequirements['capabilities'];
26
14
  readonly materialized: PublicationRequirements['capabilities'];
27
15
  };
16
+ readonly bindings: Publication['bindings'];
17
+ }
18
+ /** Explicit complete Bundle observed coherently with its ready Domain generation. */
19
+ export interface DomainBundle {
20
+ readonly domain: DomainInfo;
21
+ readonly bundle: bundle.Bundle;
28
22
  }
29
- export type ResultFor<Input extends introspection.Introspection> = Pick<Installation, Extract<keyof Input['select'], keyof Installation>> | null;
23
+ export type ResultFor<Input extends introspection.Introspection> = Input extends {
24
+ readonly kind: 'bundle';
25
+ } ? DomainBundle : DomainInfo;
30
26
  export interface Limits {
31
27
  readonly maximumPublicationBytes: number;
32
28
  readonly maximumBundleBytes: number;
33
29
  }
34
- //# sourceMappingURL=result.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=result.js.map
@@ -0,0 +1,9 @@
1
+ import type { InstallReceipt } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
2
+ import type { DomainInfo } from './introspection/index.js';
3
+ export type InstallResult = {
4
+ readonly changed: true;
5
+ readonly receipt: InstallReceipt;
6
+ } | {
7
+ readonly changed: false;
8
+ readonly domains: readonly [DomainInfo, ...DomainInfo[]];
9
+ };
@@ -0,0 +1 @@
1
+ export {};