@astrale-os/kernel-client 0.6.0-beta.4 → 0.6.0-beta.41

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 (461) hide show
  1. package/dist/auth/auth.d.ts +3 -4
  2. package/dist/auth/auth.js +0 -1
  3. package/dist/auth/authorization.d.ts +2 -3
  4. package/dist/auth/authorization.js +3 -4
  5. package/dist/auth/credential.d.ts +1 -2
  6. package/dist/auth/credential.js +5 -6
  7. package/dist/auth/identity.d.ts +6 -9
  8. package/dist/auth/identity.js +4 -5
  9. package/dist/auth/index.d.ts +1 -2
  10. package/dist/auth/index.js +0 -1
  11. package/dist/auth/provision.d.ts +0 -1
  12. package/dist/auth/provision.js +2 -3
  13. package/dist/client/admission.d.ts +0 -1
  14. package/dist/client/admission.js +0 -1
  15. package/dist/client/client.d.ts +0 -1
  16. package/dist/client/client.js +0 -1
  17. package/dist/client/credential.d.ts +0 -1
  18. package/dist/client/credential.js +0 -1
  19. package/dist/client/index.d.ts +0 -1
  20. package/dist/client/index.js +0 -1
  21. package/dist/client/request.d.ts +1 -2
  22. package/dist/client/request.js +1 -2
  23. package/dist/client/result.d.ts +3 -4
  24. package/dist/client/result.js +3 -1
  25. package/dist/client/routing-control.d.ts +0 -1
  26. package/dist/client/routing-control.js +0 -1
  27. package/dist/errors/client-error.d.ts +0 -1
  28. package/dist/errors/client-error.js +2 -1
  29. package/dist/errors/index.d.ts +7 -7
  30. package/dist/errors/index.js +7 -7
  31. package/dist/errors/miss-error.d.ts +0 -1
  32. package/dist/errors/miss-error.js +0 -1
  33. package/dist/errors/protocol-error.d.ts +0 -1
  34. package/dist/errors/protocol-error.js +0 -1
  35. package/dist/errors/response-error.d.ts +2 -2
  36. package/dist/errors/response-error.js +1 -2
  37. package/dist/errors/session-error.d.ts +9 -0
  38. package/dist/errors/session-error.js +9 -0
  39. package/dist/errors/stale-route-error.d.ts +0 -1
  40. package/dist/errors/stale-route-error.js +0 -1
  41. package/dist/errors/transport-error.d.ts +18 -6
  42. package/dist/errors/transport-error.js +11 -7
  43. package/dist/graph/domain/binding.d.ts +22 -0
  44. package/dist/graph/domain/binding.js +123 -0
  45. package/dist/graph/domain/domain.typecheck.d.ts +1 -0
  46. package/dist/graph/domain/domain.typecheck.js +139 -0
  47. package/dist/graph/domain/index.d.ts +3 -0
  48. package/dist/graph/domain/index.js +1 -0
  49. package/dist/graph/domain/model.d.ts +18 -0
  50. package/dist/graph/domain/model.js +1 -0
  51. package/dist/graph/domain/page.d.ts +23 -0
  52. package/dist/graph/domain/page.js +42 -0
  53. package/dist/graph/domain/project.d.ts +8 -0
  54. package/dist/graph/domain/project.js +120 -0
  55. package/dist/graph/domain/provenance.d.ts +6 -0
  56. package/dist/graph/domain/provenance.js +11 -0
  57. package/dist/graph/errors.d.ts +2 -3
  58. package/dist/graph/errors.js +2 -2
  59. package/dist/graph/expectation.d.ts +3 -0
  60. package/dist/graph/expectation.js +6 -0
  61. package/dist/graph/graph.d.ts +12 -8
  62. package/dist/graph/graph.js +0 -1
  63. package/dist/graph/index.d.ts +2 -2
  64. package/dist/graph/index.js +1 -1
  65. package/dist/graph/mutation.d.ts +2 -4
  66. package/dist/graph/mutation.js +12 -4
  67. package/dist/graph/page/index.d.ts +0 -1
  68. package/dist/graph/page/index.js +0 -1
  69. package/dist/graph/page/neighbors.d.ts +4 -5
  70. package/dist/graph/page/neighbors.js +6 -7
  71. package/dist/graph/page/page.d.ts +5 -2
  72. package/dist/graph/page/page.js +0 -1
  73. package/dist/graph/page-contract.d.ts +1 -2
  74. package/dist/graph/page-contract.js +0 -1
  75. package/dist/graph/provenance.d.ts +14 -0
  76. package/dist/graph/provenance.js +42 -0
  77. package/dist/graph/query.d.ts +0 -1
  78. package/dist/graph/query.js +21 -13
  79. package/dist/graph/read.d.ts +3 -4
  80. package/dist/graph/read.js +1 -2
  81. package/dist/index.d.ts +1 -2
  82. package/dist/index.js +1 -2
  83. package/dist/pacer/batcher/batcher.d.ts +0 -1
  84. package/dist/pacer/batcher/batcher.js +0 -1
  85. package/dist/pacer/batcher/defaults.d.ts +0 -1
  86. package/dist/pacer/batcher/defaults.js +0 -1
  87. package/dist/pacer/batcher/index.d.ts +0 -1
  88. package/dist/pacer/batcher/index.js +0 -1
  89. package/dist/pacer/index.d.ts +0 -1
  90. package/dist/pacer/index.js +0 -1
  91. package/dist/pacer/limiter/defaults.d.ts +0 -1
  92. package/dist/pacer/limiter/defaults.js +0 -1
  93. package/dist/pacer/limiter/index.d.ts +0 -1
  94. package/dist/pacer/limiter/index.js +0 -1
  95. package/dist/pacer/limiter/limiter.d.ts +0 -1
  96. package/dist/pacer/limiter/limiter.js +0 -1
  97. package/dist/pacer/queue/defaults.d.ts +0 -1
  98. package/dist/pacer/queue/defaults.js +0 -1
  99. package/dist/pacer/queue/index.d.ts +0 -1
  100. package/dist/pacer/queue/index.js +0 -1
  101. package/dist/pacer/queue/queue.d.ts +0 -1
  102. package/dist/pacer/queue/queue.js +0 -1
  103. package/dist/pacer/retry/defaults.d.ts +0 -1
  104. package/dist/pacer/retry/defaults.js +0 -1
  105. package/dist/pacer/retry/index.d.ts +0 -1
  106. package/dist/pacer/retry/index.js +0 -1
  107. package/dist/pacer/retry/retry.d.ts +0 -1
  108. package/dist/pacer/retry/retry.js +0 -1
  109. package/dist/pool/index.d.ts +0 -1
  110. package/dist/pool/index.js +0 -1
  111. package/dist/pool/pool.d.ts +0 -1
  112. package/dist/pool/pool.js +0 -1
  113. package/dist/pool/target.d.ts +0 -1
  114. package/dist/pool/target.js +0 -1
  115. package/dist/schema/admission.d.ts +9 -7
  116. package/dist/schema/admission.js +6 -12
  117. package/dist/schema/contracts.d.ts +6 -16
  118. package/dist/schema/contracts.js +0 -1
  119. package/dist/schema/index.d.ts +2 -3
  120. package/dist/schema/index.js +1 -2
  121. package/dist/schema/introspection.d.ts +1 -2
  122. package/dist/schema/introspection.js +7 -4
  123. package/dist/schema/operation.d.ts +0 -1
  124. package/dist/schema/operation.js +2 -3
  125. package/dist/schema/schema.d.ts +11 -10
  126. package/dist/schema/schema.js +60 -13
  127. package/dist/session/bound.d.ts +45 -0
  128. package/dist/session/bound.js +89 -0
  129. package/dist/session/context/control.d.ts +0 -1
  130. package/dist/session/context/control.js +0 -1
  131. package/dist/session/context/index.d.ts +0 -1
  132. package/dist/session/context/index.js +0 -1
  133. package/dist/session/context/limits.d.ts +0 -1
  134. package/dist/session/context/limits.js +0 -1
  135. package/dist/session/context/operation.d.ts +0 -1
  136. package/dist/session/context/operation.js +19 -17
  137. package/dist/session/context/policy.d.ts +1 -2
  138. package/dist/session/context/policy.js +2 -3
  139. package/dist/session/discovery/bundle.d.ts +0 -1
  140. package/dist/session/discovery/bundle.js +6 -6
  141. package/dist/session/discovery/discovery.d.ts +1 -2
  142. package/dist/session/discovery/discovery.js +0 -1
  143. package/dist/session/discovery/index.d.ts +1 -2
  144. package/dist/session/discovery/index.js +0 -1
  145. package/dist/session/discovery/publication.d.ts +1 -2
  146. package/dist/session/discovery/publication.js +6 -5
  147. package/dist/session/discovery/snapshot.d.ts +1 -2
  148. package/dist/session/discovery/snapshot.js +0 -1
  149. package/dist/session/discovery/transport.d.ts +6 -0
  150. package/dist/session/discovery/transport.js +13 -0
  151. package/dist/session/index.d.ts +6 -4
  152. package/dist/session/index.js +3 -2
  153. package/dist/session/reference.d.ts +36 -0
  154. package/dist/session/reference.js +74 -0
  155. package/dist/session/routing/auth.d.ts +1 -2
  156. package/dist/session/routing/auth.js +1 -2
  157. package/dist/session/routing/cache.d.ts +28 -8
  158. package/dist/session/routing/cache.js +216 -28
  159. package/dist/session/routing/dispatch.d.ts +3 -7
  160. package/dist/session/routing/dispatch.js +32 -25
  161. package/dist/session/routing/envelope.d.ts +2 -1
  162. package/dist/session/routing/envelope.js +14 -10
  163. package/dist/session/routing/expectation.d.ts +6 -0
  164. package/dist/session/routing/expectation.js +1 -0
  165. package/dist/session/routing/index.d.ts +2 -3
  166. package/dist/session/routing/index.js +1 -2
  167. package/dist/session/routing/request.d.ts +1 -2
  168. package/dist/session/routing/request.js +1 -2
  169. package/dist/session/session.d.ts +17 -10
  170. package/dist/session/session.js +54 -38
  171. package/dist/session/session.typecheck.d.ts +0 -1
  172. package/dist/session/session.typecheck.js +23 -3
  173. package/dist/session/views/catalog.d.ts +2 -3
  174. package/dist/session/views/catalog.js +15 -7
  175. package/dist/session/views/index.d.ts +0 -1
  176. package/dist/session/views/index.js +0 -1
  177. package/dist/session/views/resolve.d.ts +0 -1
  178. package/dist/session/views/resolve.js +4 -3
  179. package/dist/store/entity-index.d.ts +0 -1
  180. package/dist/store/entity-index.js +0 -1
  181. package/dist/store/index.d.ts +0 -1
  182. package/dist/store/index.js +0 -1
  183. package/dist/store/memory.d.ts +2 -2
  184. package/dist/store/memory.js +24 -13
  185. package/dist/store/mutation.d.ts +0 -1
  186. package/dist/store/mutation.js +0 -1
  187. package/dist/store/observe.d.ts +0 -1
  188. package/dist/store/observe.js +0 -1
  189. package/dist/store/optimistic.d.ts +0 -1
  190. package/dist/store/optimistic.js +0 -1
  191. package/dist/store/query-key.d.ts +2 -2
  192. package/dist/store/query-key.js +7 -3
  193. package/dist/store/shape.d.ts +3 -2
  194. package/dist/store/shape.js +3 -2
  195. package/dist/store/store.d.ts +2 -4
  196. package/dist/store/store.js +5 -4
  197. package/dist/store/store.typecheck.d.ts +0 -1
  198. package/dist/store/store.typecheck.js +3 -9
  199. package/dist/transport/auto/decision.d.ts +0 -1
  200. package/dist/transport/auto/decision.js +0 -1
  201. package/dist/transport/auto/fallback.d.ts +0 -1
  202. package/dist/transport/auto/fallback.js +8 -10
  203. package/dist/transport/auto/index.d.ts +0 -1
  204. package/dist/transport/auto/index.js +0 -1
  205. package/dist/transport/auto/transport.d.ts +0 -1
  206. package/dist/transport/auto/transport.js +5 -6
  207. package/dist/transport/auto/warning.d.ts +0 -1
  208. package/dist/transport/auto/warning.js +5 -3
  209. package/dist/transport/deadline.d.ts +0 -1
  210. package/dist/transport/deadline.js +0 -1
  211. package/dist/transport/failure.d.ts +7 -0
  212. package/dist/transport/failure.js +9 -0
  213. package/dist/transport/http/byte-stream.d.ts +17 -0
  214. package/dist/transport/http/byte-stream.js +86 -0
  215. package/dist/transport/http/index.d.ts +0 -1
  216. package/dist/transport/http/index.js +0 -1
  217. package/dist/transport/http/response.d.ts +2 -2
  218. package/dist/transport/http/response.js +2 -2
  219. package/dist/transport/http/stream.d.ts +2 -2
  220. package/dist/transport/http/stream.js +8 -8
  221. package/dist/transport/http/transport.d.ts +0 -1
  222. package/dist/transport/http/transport.js +40 -18
  223. package/dist/transport/index.d.ts +0 -1
  224. package/dist/transport/index.js +0 -1
  225. package/dist/transport/transport.d.ts +0 -1
  226. package/dist/transport/transport.js +0 -1
  227. package/dist/transport/websocket/connection.d.ts +2 -2
  228. package/dist/transport/websocket/connection.js +17 -27
  229. package/dist/transport/websocket/exchange.d.ts +1 -2
  230. package/dist/transport/websocket/exchange.js +6 -10
  231. package/dist/transport/websocket/index.d.ts +0 -1
  232. package/dist/transport/websocket/index.js +0 -1
  233. package/dist/transport/websocket/transport.d.ts +0 -1
  234. package/dist/transport/websocket/transport.js +9 -21
  235. package/package.json +21 -18
  236. package/dist/auth/auth.d.ts.map +0 -1
  237. package/dist/auth/auth.js.map +0 -1
  238. package/dist/auth/authorization.d.ts.map +0 -1
  239. package/dist/auth/authorization.js.map +0 -1
  240. package/dist/auth/credential.d.ts.map +0 -1
  241. package/dist/auth/credential.js.map +0 -1
  242. package/dist/auth/identity.d.ts.map +0 -1
  243. package/dist/auth/identity.js.map +0 -1
  244. package/dist/auth/index.d.ts.map +0 -1
  245. package/dist/auth/index.js.map +0 -1
  246. package/dist/auth/provision.d.ts.map +0 -1
  247. package/dist/auth/provision.js.map +0 -1
  248. package/dist/client/admission.d.ts.map +0 -1
  249. package/dist/client/admission.js.map +0 -1
  250. package/dist/client/client.d.ts.map +0 -1
  251. package/dist/client/client.js.map +0 -1
  252. package/dist/client/credential.d.ts.map +0 -1
  253. package/dist/client/credential.js.map +0 -1
  254. package/dist/client/index.d.ts.map +0 -1
  255. package/dist/client/index.js.map +0 -1
  256. package/dist/client/request.d.ts.map +0 -1
  257. package/dist/client/request.js.map +0 -1
  258. package/dist/client/result.d.ts.map +0 -1
  259. package/dist/client/result.js.map +0 -1
  260. package/dist/client/routing-control.d.ts.map +0 -1
  261. package/dist/client/routing-control.js.map +0 -1
  262. package/dist/domain/binding.d.ts +0 -24
  263. package/dist/domain/binding.d.ts.map +0 -1
  264. package/dist/domain/binding.js +0 -69
  265. package/dist/domain/binding.js.map +0 -1
  266. package/dist/domain/callable.d.ts +0 -25
  267. package/dist/domain/callable.d.ts.map +0 -1
  268. package/dist/domain/callable.js +0 -70
  269. package/dist/domain/callable.js.map +0 -1
  270. package/dist/domain/domain.typecheck.d.ts +0 -2
  271. package/dist/domain/domain.typecheck.d.ts.map +0 -1
  272. package/dist/domain/domain.typecheck.js +0 -69
  273. package/dist/domain/domain.typecheck.js.map +0 -1
  274. package/dist/domain/index.d.ts +0 -4
  275. package/dist/domain/index.d.ts.map +0 -1
  276. package/dist/domain/index.js +0 -2
  277. package/dist/domain/index.js.map +0 -1
  278. package/dist/domain/node.d.ts +0 -10
  279. package/dist/domain/node.d.ts.map +0 -1
  280. package/dist/domain/node.js +0 -6
  281. package/dist/domain/node.js.map +0 -1
  282. package/dist/errors/client-error.d.ts.map +0 -1
  283. package/dist/errors/client-error.js.map +0 -1
  284. package/dist/errors/index.d.ts.map +0 -1
  285. package/dist/errors/index.js.map +0 -1
  286. package/dist/errors/miss-error.d.ts.map +0 -1
  287. package/dist/errors/miss-error.js.map +0 -1
  288. package/dist/errors/protocol-error.d.ts.map +0 -1
  289. package/dist/errors/protocol-error.js.map +0 -1
  290. package/dist/errors/response-error.d.ts.map +0 -1
  291. package/dist/errors/response-error.js.map +0 -1
  292. package/dist/errors/stale-route-error.d.ts.map +0 -1
  293. package/dist/errors/stale-route-error.js.map +0 -1
  294. package/dist/errors/transport-error.d.ts.map +0 -1
  295. package/dist/errors/transport-error.js.map +0 -1
  296. package/dist/graph/errors.d.ts.map +0 -1
  297. package/dist/graph/errors.js.map +0 -1
  298. package/dist/graph/graph.d.ts.map +0 -1
  299. package/dist/graph/graph.js.map +0 -1
  300. package/dist/graph/index.d.ts.map +0 -1
  301. package/dist/graph/index.js.map +0 -1
  302. package/dist/graph/mutation.d.ts.map +0 -1
  303. package/dist/graph/mutation.js.map +0 -1
  304. package/dist/graph/page/index.d.ts.map +0 -1
  305. package/dist/graph/page/index.js.map +0 -1
  306. package/dist/graph/page/neighbors.d.ts.map +0 -1
  307. package/dist/graph/page/neighbors.js.map +0 -1
  308. package/dist/graph/page/page.d.ts.map +0 -1
  309. package/dist/graph/page/page.js.map +0 -1
  310. package/dist/graph/page-contract.d.ts.map +0 -1
  311. package/dist/graph/page-contract.js.map +0 -1
  312. package/dist/graph/query.d.ts.map +0 -1
  313. package/dist/graph/query.js.map +0 -1
  314. package/dist/graph/read.d.ts.map +0 -1
  315. package/dist/graph/read.js.map +0 -1
  316. package/dist/index.d.ts.map +0 -1
  317. package/dist/index.js.map +0 -1
  318. package/dist/pacer/batcher/batcher.d.ts.map +0 -1
  319. package/dist/pacer/batcher/batcher.js.map +0 -1
  320. package/dist/pacer/batcher/defaults.d.ts.map +0 -1
  321. package/dist/pacer/batcher/defaults.js.map +0 -1
  322. package/dist/pacer/batcher/index.d.ts.map +0 -1
  323. package/dist/pacer/batcher/index.js.map +0 -1
  324. package/dist/pacer/index.d.ts.map +0 -1
  325. package/dist/pacer/index.js.map +0 -1
  326. package/dist/pacer/limiter/defaults.d.ts.map +0 -1
  327. package/dist/pacer/limiter/defaults.js.map +0 -1
  328. package/dist/pacer/limiter/index.d.ts.map +0 -1
  329. package/dist/pacer/limiter/index.js.map +0 -1
  330. package/dist/pacer/limiter/limiter.d.ts.map +0 -1
  331. package/dist/pacer/limiter/limiter.js.map +0 -1
  332. package/dist/pacer/queue/defaults.d.ts.map +0 -1
  333. package/dist/pacer/queue/defaults.js.map +0 -1
  334. package/dist/pacer/queue/index.d.ts.map +0 -1
  335. package/dist/pacer/queue/index.js.map +0 -1
  336. package/dist/pacer/queue/queue.d.ts.map +0 -1
  337. package/dist/pacer/queue/queue.js.map +0 -1
  338. package/dist/pacer/retry/defaults.d.ts.map +0 -1
  339. package/dist/pacer/retry/defaults.js.map +0 -1
  340. package/dist/pacer/retry/index.d.ts.map +0 -1
  341. package/dist/pacer/retry/index.js.map +0 -1
  342. package/dist/pacer/retry/retry.d.ts.map +0 -1
  343. package/dist/pacer/retry/retry.js.map +0 -1
  344. package/dist/pool/index.d.ts.map +0 -1
  345. package/dist/pool/index.js.map +0 -1
  346. package/dist/pool/pool.d.ts.map +0 -1
  347. package/dist/pool/pool.js.map +0 -1
  348. package/dist/pool/target.d.ts.map +0 -1
  349. package/dist/pool/target.js.map +0 -1
  350. package/dist/schema/admission.d.ts.map +0 -1
  351. package/dist/schema/admission.js.map +0 -1
  352. package/dist/schema/contracts.d.ts.map +0 -1
  353. package/dist/schema/contracts.js.map +0 -1
  354. package/dist/schema/index.d.ts.map +0 -1
  355. package/dist/schema/index.js.map +0 -1
  356. package/dist/schema/introspection.d.ts.map +0 -1
  357. package/dist/schema/introspection.js.map +0 -1
  358. package/dist/schema/operation.d.ts.map +0 -1
  359. package/dist/schema/operation.js.map +0 -1
  360. package/dist/schema/schema.d.ts.map +0 -1
  361. package/dist/schema/schema.js.map +0 -1
  362. package/dist/session/context/control.d.ts.map +0 -1
  363. package/dist/session/context/control.js.map +0 -1
  364. package/dist/session/context/index.d.ts.map +0 -1
  365. package/dist/session/context/index.js.map +0 -1
  366. package/dist/session/context/limits.d.ts.map +0 -1
  367. package/dist/session/context/limits.js.map +0 -1
  368. package/dist/session/context/operation.d.ts.map +0 -1
  369. package/dist/session/context/operation.js.map +0 -1
  370. package/dist/session/context/policy.d.ts.map +0 -1
  371. package/dist/session/context/policy.js.map +0 -1
  372. package/dist/session/discovery/bundle.d.ts.map +0 -1
  373. package/dist/session/discovery/bundle.js.map +0 -1
  374. package/dist/session/discovery/discovery.d.ts.map +0 -1
  375. package/dist/session/discovery/discovery.js.map +0 -1
  376. package/dist/session/discovery/index.d.ts.map +0 -1
  377. package/dist/session/discovery/index.js.map +0 -1
  378. package/dist/session/discovery/publication.d.ts.map +0 -1
  379. package/dist/session/discovery/publication.js.map +0 -1
  380. package/dist/session/discovery/snapshot.d.ts.map +0 -1
  381. package/dist/session/discovery/snapshot.js.map +0 -1
  382. package/dist/session/index.d.ts.map +0 -1
  383. package/dist/session/index.js.map +0 -1
  384. package/dist/session/routing/auth.d.ts.map +0 -1
  385. package/dist/session/routing/auth.js.map +0 -1
  386. package/dist/session/routing/bound.d.ts +0 -7
  387. package/dist/session/routing/bound.d.ts.map +0 -1
  388. package/dist/session/routing/bound.js +0 -2
  389. package/dist/session/routing/bound.js.map +0 -1
  390. package/dist/session/routing/cache.d.ts.map +0 -1
  391. package/dist/session/routing/cache.js.map +0 -1
  392. package/dist/session/routing/dispatch.d.ts.map +0 -1
  393. package/dist/session/routing/dispatch.js.map +0 -1
  394. package/dist/session/routing/envelope.d.ts.map +0 -1
  395. package/dist/session/routing/envelope.js.map +0 -1
  396. package/dist/session/routing/index.d.ts.map +0 -1
  397. package/dist/session/routing/index.js.map +0 -1
  398. package/dist/session/routing/request.d.ts.map +0 -1
  399. package/dist/session/routing/request.js.map +0 -1
  400. package/dist/session/session.d.ts.map +0 -1
  401. package/dist/session/session.js.map +0 -1
  402. package/dist/session/session.typecheck.d.ts.map +0 -1
  403. package/dist/session/session.typecheck.js.map +0 -1
  404. package/dist/session/views/catalog.d.ts.map +0 -1
  405. package/dist/session/views/catalog.js.map +0 -1
  406. package/dist/session/views/index.d.ts.map +0 -1
  407. package/dist/session/views/index.js.map +0 -1
  408. package/dist/session/views/resolve.d.ts.map +0 -1
  409. package/dist/session/views/resolve.js.map +0 -1
  410. package/dist/store/entity-index.d.ts.map +0 -1
  411. package/dist/store/entity-index.js.map +0 -1
  412. package/dist/store/index.d.ts.map +0 -1
  413. package/dist/store/index.js.map +0 -1
  414. package/dist/store/memory.d.ts.map +0 -1
  415. package/dist/store/memory.js.map +0 -1
  416. package/dist/store/mutation.d.ts.map +0 -1
  417. package/dist/store/mutation.js.map +0 -1
  418. package/dist/store/observe.d.ts.map +0 -1
  419. package/dist/store/observe.js.map +0 -1
  420. package/dist/store/optimistic.d.ts.map +0 -1
  421. package/dist/store/optimistic.js.map +0 -1
  422. package/dist/store/query-key.d.ts.map +0 -1
  423. package/dist/store/query-key.js.map +0 -1
  424. package/dist/store/shape.d.ts.map +0 -1
  425. package/dist/store/shape.js.map +0 -1
  426. package/dist/store/store.d.ts.map +0 -1
  427. package/dist/store/store.js.map +0 -1
  428. package/dist/store/store.typecheck.d.ts.map +0 -1
  429. package/dist/store/store.typecheck.js.map +0 -1
  430. package/dist/transport/auto/decision.d.ts.map +0 -1
  431. package/dist/transport/auto/decision.js.map +0 -1
  432. package/dist/transport/auto/fallback.d.ts.map +0 -1
  433. package/dist/transport/auto/fallback.js.map +0 -1
  434. package/dist/transport/auto/index.d.ts.map +0 -1
  435. package/dist/transport/auto/index.js.map +0 -1
  436. package/dist/transport/auto/transport.d.ts.map +0 -1
  437. package/dist/transport/auto/transport.js.map +0 -1
  438. package/dist/transport/auto/warning.d.ts.map +0 -1
  439. package/dist/transport/auto/warning.js.map +0 -1
  440. package/dist/transport/deadline.d.ts.map +0 -1
  441. package/dist/transport/deadline.js.map +0 -1
  442. package/dist/transport/http/index.d.ts.map +0 -1
  443. package/dist/transport/http/index.js.map +0 -1
  444. package/dist/transport/http/response.d.ts.map +0 -1
  445. package/dist/transport/http/response.js.map +0 -1
  446. package/dist/transport/http/stream.d.ts.map +0 -1
  447. package/dist/transport/http/stream.js.map +0 -1
  448. package/dist/transport/http/transport.d.ts.map +0 -1
  449. package/dist/transport/http/transport.js.map +0 -1
  450. package/dist/transport/index.d.ts.map +0 -1
  451. package/dist/transport/index.js.map +0 -1
  452. package/dist/transport/transport.d.ts.map +0 -1
  453. package/dist/transport/transport.js.map +0 -1
  454. package/dist/transport/websocket/connection.d.ts.map +0 -1
  455. package/dist/transport/websocket/connection.js.map +0 -1
  456. package/dist/transport/websocket/exchange.d.ts.map +0 -1
  457. package/dist/transport/websocket/exchange.js.map +0 -1
  458. package/dist/transport/websocket/index.d.ts.map +0 -1
  459. package/dist/transport/websocket/index.js.map +0 -1
  460. package/dist/transport/websocket/transport.d.ts.map +0 -1
  461. package/dist/transport/websocket/transport.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { invocation as invocationProtocol, publication as publications, } from '@astrale-os/kernel-protocol';
1
+ import * as invocationProtocol from '@astrale-os/kernel-protocol/invocation';
2
2
  import { acceptCall, dispatchTrace, isAdmittedMissError, isAdmittedStaleRouteError, } from '../../client/index.js';
3
3
  import { ClientError, ResponseError } from '../../errors/index.js';
4
4
  import { runSessionOperation, sessionTransportOptions, allowEndpoint } from '../context/index.js';
5
5
  import { resolveAuth } from './auth.js';
6
- import { selectEnvelope } from './envelope.js';
6
+ import { selectEnvelope, selectEnvelopeTarget } from './envelope.js';
7
7
  export class SessionDispatcher {
8
8
  state;
9
9
  constructor(state) {
@@ -15,8 +15,8 @@ export class SessionDispatcher {
15
15
  // Authority is resolved before warm lookup so changed credentials or delegation cannot reuse a
16
16
  // carrier minted for a different caller partition.
17
17
  const auth = await resolveAuth(this.state.auth, call, operation);
18
- const source = await this.sourceKernel(operation);
19
- const cacheKey = await this.state.cache.key(source.issuer, call, auth, expected);
18
+ const source = this.state.kernel;
19
+ const cacheKey = await this.state.cache.key(source, call, auth, expected);
20
20
  const dispatch = Object.freeze({
21
21
  call,
22
22
  auth,
@@ -24,7 +24,16 @@ export class SessionDispatcher {
24
24
  cacheKey,
25
25
  ...(expected === undefined ? {} : { expected }),
26
26
  });
27
- const learned = this.state.cache.get(cacheKey);
27
+ let learned = await this.state.cache.get(cacheKey, auth.credential);
28
+ if (learned !== undefined) {
29
+ try {
30
+ requireCachedRoute(learned, source, expected, this.state.envelopeTransport, this.state.websocketAvailable, this.state.policy);
31
+ }
32
+ catch {
33
+ this.state.cache.delete(cacheKey);
34
+ learned = undefined;
35
+ }
36
+ }
28
37
  if (learned !== undefined) {
29
38
  return this.dispatchDestinationWithRecovery(learned, dispatch, options, operation);
30
39
  }
@@ -39,23 +48,23 @@ export class SessionDispatcher {
39
48
  ...sessionTransportOptions(operation, options.idempotencyKey),
40
49
  ...(state.auth.delegate === undefined ? {} : { delegate: state.auth.delegate }),
41
50
  ...(routing === undefined ? {} : { routing }),
42
- ...(state.expected === undefined ? {} : { schema: state.expected.schema }),
51
+ ...(state.expected === undefined ? {} : { schema: { revision: state.expected.revision } }),
43
52
  }));
44
53
  }
45
54
  async followSource(result, state, options, operation) {
46
55
  if (result.kind !== 'redirect')
47
56
  return result;
48
57
  const redirect = result.redirect;
49
- if (redirect.route.via.issuer !== state.source.issuer) {
58
+ if (redirect.route.via.issuer !== state.source) {
50
59
  throw new ClientError('Redirect issuer differs from the session-pinned source Kernel identity.');
51
60
  }
52
61
  requireExpectedPublication(redirect.route, state.expected);
53
- const learned = this.state.cache.learn(state.cacheKey, redirect.route, redirect.credential);
62
+ const learned = await this.state.cache.learn(state.cacheKey, redirect.route, redirect.credential, state.auth.credential);
54
63
  return this.dispatchDestinationWithRecovery(learned, state, options, operation, redirect.trace);
55
64
  }
56
65
  async dispatchDestinationWithRecovery(learned, state, options, operation, trace) {
57
66
  try {
58
- return await this.dispatchDestination(learned, state.call, options, operation, state.expected, trace);
67
+ return await this.dispatchDestination(learned, state.call, options, operation, state.source, state.expected, trace);
59
68
  }
60
69
  catch (cause) {
61
70
  const stale = isAdmittedStaleRouteError(cause);
@@ -79,8 +88,8 @@ export class SessionDispatcher {
79
88
  return this.followSource(refreshed, state, options, operation);
80
89
  }
81
90
  }
82
- async dispatchDestination(learned, call, options, operation, expected, trace) {
83
- if (learned.route.via.issuer !== (await this.sourceKernel(operation)).issuer) {
91
+ async dispatchDestination(learned, call, options, operation, source, expected, trace) {
92
+ if (learned.route.via.issuer !== source) {
84
93
  throw new ClientError('Learned route issuer differs from the session-pinned source Kernel.');
85
94
  }
86
95
  requireExpectedPublication(learned.route, expected);
@@ -97,13 +106,13 @@ export class SessionDispatcher {
97
106
  }
98
107
  return result;
99
108
  }
100
- async sourceKernel(operation) {
101
- const snapshot = await this.state.discovery.snapshot(operation);
102
- if (snapshot.kernel !== this.state.kernel) {
103
- throw new ClientError('Session discovery returned another Kernel identity.');
104
- }
105
- return Object.freeze({ issuer: snapshot.publication.identity.issuer });
109
+ }
110
+ function requireCachedRoute(learned, source, expected, envelopeTransport, websocketAvailable, policy) {
111
+ if (learned.route.via.issuer !== source) {
112
+ throw new ClientError('Learned route issuer differs from the session-pinned source Kernel.');
106
113
  }
114
+ requireExpectedPublication(learned.route, expected);
115
+ selectEnvelopeTarget(learned.route.endpoint, envelopeTransport, websocketAvailable, policy);
107
116
  }
108
117
  function isRouteCompatibilityConflict(input) {
109
118
  if (!(input instanceof ResponseError))
@@ -113,19 +122,15 @@ function isRouteCompatibilityConflict(input) {
113
122
  message: input.message,
114
123
  ...(input.data === undefined ? {} : { data: input.data }),
115
124
  });
116
- return (failure?.data.code === invocationProtocol.SCHEMA_UPGRADE_REQUIRED ||
125
+ return (failure?.data.code === invocationProtocol.SCHEMA_REVISION_MISMATCH ||
117
126
  failure?.data.code === invocationProtocol.SERVICE_TRUST_REQUIRED);
118
127
  }
119
128
  function requireExpectedPublication(route, expected) {
120
129
  if (expected === undefined)
121
130
  return;
122
- if (expected.publication === undefined) {
123
- throw new ClientError('A local bound installation cannot resolve to a remote route.');
124
- }
125
131
  const actual = route.via.publication;
126
- const relation = publications.compareReferences(actual, expected.publication);
127
- if (relation !== 'exact' && relation !== 'same-schema') {
128
- throw new ClientError('Resolved route does not match the bound installed Publication.');
132
+ if (actual.origin !== expected.origin || actual.revision !== expected.revision) {
133
+ throw new ClientError('Resolved route does not match the expected Schema revision.');
129
134
  }
130
135
  }
131
136
  export function requireResultKind(expected, result) {
@@ -133,9 +138,11 @@ export function requireResultKind(expected, result) {
133
138
  return result;
134
139
  if (result.kind === 'stream')
135
140
  void result.stream.cancel(`Expected ${expected} result.`);
141
+ if (result.kind === 'binary' && !(result.value.body instanceof Uint8Array)) {
142
+ void result.value.body[Symbol.asyncIterator]().return?.();
143
+ }
136
144
  throw new ClientError(`Function returned ${result.kind}; ${expected} was required.`);
137
145
  }
138
146
  function authenticated(client, credential) {
139
147
  return credential === undefined ? client : client.as(credential);
140
148
  }
141
- //# sourceMappingURL=dispatch.js.map
@@ -11,4 +11,5 @@ export interface EnvelopeSelection {
11
11
  readonly destination: ClientTarget;
12
12
  }
13
13
  export declare function selectEnvelope(endpoints: publication.InvocationEndpoints, preference: SessionEnvelopeTransport, websocketAvailable: boolean, pool: ClientPoolCapability, policy: Readonly<SessionPolicy>): EnvelopeSelection;
14
- //# sourceMappingURL=envelope.d.ts.map
14
+ /** Resolve and admit one route endpoint without acquiring a transport Client. */
15
+ export declare function selectEnvelopeTarget(endpoints: publication.InvocationEndpoints, preference: SessionEnvelopeTransport, websocketAvailable: boolean, policy: Readonly<SessionPolicy>): ClientTarget;
@@ -1,6 +1,19 @@
1
1
  import { ClientError } from '../../errors/index.js';
2
2
  import { allowEndpoint } from '../context/index.js';
3
3
  export function selectEnvelope(endpoints, preference, websocketAvailable, pool, policy) {
4
+ const destination = selectEnvelopeTarget(endpoints, preference, websocketAvailable, policy);
5
+ const client = pool.clientFor(destination);
6
+ if (client === null ||
7
+ typeof client !== 'object' ||
8
+ typeof client.dispatch !== 'function' ||
9
+ typeof client.as !== 'function' ||
10
+ typeof client.close !== 'function') {
11
+ throw new TypeError('Session client pool capability returned an invalid Client.');
12
+ }
13
+ return Object.freeze({ client, destination });
14
+ }
15
+ /** Resolve and admit one route endpoint without acquiring a transport Client. */
16
+ export function selectEnvelopeTarget(endpoints, preference, websocketAvailable, policy) {
4
17
  let destination;
5
18
  if (preference === 'websocket') {
6
19
  if (endpoints.websocket === undefined) {
@@ -23,14 +36,5 @@ export function selectEnvelope(endpoints, preference, websocketAvailable, pool,
23
36
  allowEndpoint(endpoints.http, policy);
24
37
  destination = Object.freeze({ transport: 'http', url: endpoints.http });
25
38
  }
26
- const client = pool.clientFor(destination);
27
- if (client === null ||
28
- typeof client !== 'object' ||
29
- typeof client.dispatch !== 'function' ||
30
- typeof client.as !== 'function' ||
31
- typeof client.close !== 'function') {
32
- throw new TypeError('Session client pool capability returned an invalid Client.');
33
- }
34
- return Object.freeze({ client, destination });
39
+ return destination;
35
40
  }
36
- //# sourceMappingURL=envelope.js.map
@@ -0,0 +1,6 @@
1
+ import type { Key, Revision } from '@astrale-os/kernel-dsl/v1';
2
+ /** Private static-consumer expectation carried only by ClientSession.invoke. */
3
+ export interface SchemaExpectation {
4
+ readonly origin: Key.Origin;
5
+ readonly revision: Revision;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  export { admitSessionAuth, resolveAuth, type Auth, type EffectiveAuth, type SessionAuth, } from './auth.js';
2
- export type { BoundTarget } from './bound.js';
3
- export { RouteCache, type LearnedRoute } from './cache.js';
2
+ export type { SchemaExpectation } from './expectation.js';
3
+ export { RouteCache, type LearnedRoute, type PersistedRoute, type SessionRouteArtifact, type SessionRouteStore, } from './cache.js';
4
4
  export { requireResultKind, SessionDispatcher, type SessionDispatcherOptions } from './dispatch.js';
5
5
  export { type ClientPoolCapability, type EnvelopeSelection } from './envelope.js';
6
6
  export { admitEnvelopeTransport, admitRequestOptions, type SessionEnvelopeTransport, type SessionRequestOptions, } from './request.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,5 @@
1
1
  export { admitSessionAuth, resolveAuth, } from './auth.js';
2
- export { RouteCache } from './cache.js';
2
+ export { RouteCache, } from './cache.js';
3
3
  export { requireResultKind, SessionDispatcher } from './dispatch.js';
4
4
  export {} from './envelope.js';
5
5
  export { admitEnvelopeTransport, admitRequestOptions, } from './request.js';
6
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { invocation } from '@astrale-os/kernel-protocol';
1
+ import type * as invocation from '@astrale-os/kernel-protocol/invocation';
2
2
  import type { SessionControlOptions } from '../context/index.js';
3
3
  export type SessionEnvelopeTransport = 'auto' | 'http' | 'websocket';
4
4
  export interface SessionRequestOptions extends SessionControlOptions {
@@ -6,4 +6,3 @@ export interface SessionRequestOptions extends SessionControlOptions {
6
6
  }
7
7
  export declare function admitRequestOptions(input?: SessionRequestOptions): Readonly<SessionRequestOptions>;
8
8
  export declare function admitEnvelopeTransport(input: SessionEnvelopeTransport): SessionEnvelopeTransport;
9
- //# sourceMappingURL=request.d.ts.map
@@ -1,4 +1,4 @@
1
- import { invocation as invocationProtocol } from '@astrale-os/kernel-protocol';
1
+ import * as invocationProtocol from '@astrale-os/kernel-protocol/invocation';
2
2
  import { admitControlOptions } from '../context/index.js';
3
3
  export function admitRequestOptions(input = {}) {
4
4
  if (input === null || typeof input !== 'object' || Array.isArray(input)) {
@@ -23,4 +23,3 @@ export function admitEnvelopeTransport(input) {
23
23
  }
24
24
  return input;
25
25
  }
26
- //# sourceMappingURL=request.js.map
@@ -1,15 +1,17 @@
1
- import type { IssuerId } from '@astrale-os/kernel-core/auth';
1
+ import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
2
2
  import type { PathLike } from '@astrale-os/kernel-core/path';
3
- import type { Key } from '@astrale-os/kernel-dsl/v1';
3
+ import type { Domain } from '@astrale-os/kernel-dsl/v1/domain';
4
4
  import type { Call, Input, Result } from '../client/index.js';
5
+ import type { DomainBinding, GraphApi } from '../graph/index.js';
5
6
  import type { ClientFactory, ClientPool as ClientPoolType } from '../pool/index.js';
6
- import type { ReadyInstallation, SchemaApi } from '../schema/index.js';
7
+ import type { SchemaApi } from '../schema/index.js';
7
8
  import type { ClientWarning } from '../transport/auto/index.js';
8
9
  import type { Fetch } from '../transport/http/index.js';
9
10
  import type { WebSocketConstructor } from '../transport/websocket/index.js';
10
11
  import type { SessionControlOptions, SessionPolicy } from './context/index.js';
11
12
  import type { SessionSnapshot } from './discovery/index.js';
12
- import type { SessionAuth, BoundTarget, SessionEnvelopeTransport, SessionRequestOptions } from './routing/index.js';
13
+ import type { CallableReference, InputOfReference, OutputOfReference } from './reference.js';
14
+ import type { SessionRouteStore, SessionAuth, SessionEnvelopeTransport, SessionRequestOptions } from './routing/index.js';
13
15
  import type { ViewCatalog } from './views/index.js';
14
16
  export interface ClientSessionOptions {
15
17
  /** Exact canonical source Kernel identity; its invocation and discovery endpoints are derived. */
@@ -19,6 +21,8 @@ export interface ClientSessionOptions {
19
21
  readonly pool?: Pick<ClientPoolType, 'clientFor'>;
20
22
  readonly websocket?: WebSocketConstructor;
21
23
  readonly auth?: SessionAuth;
24
+ /** Optional caller-owned persistence for bounded confidential route artifacts. */
25
+ readonly routeStore?: SessionRouteStore;
22
26
  readonly policy: SessionPolicy;
23
27
  readonly envelopeTransport?: SessionEnvelopeTransport;
24
28
  readonly onWarning?: (warning: ClientWarning) => void;
@@ -26,16 +30,17 @@ export interface ClientSessionOptions {
26
30
  readonly maximumBundleBytes?: number;
27
31
  readonly maximumResponseBytes?: number;
28
32
  readonly timeoutMs?: number;
33
+ readonly schemaLifecycleTimeoutMs?: number;
29
34
  }
30
- export type ConnectOptions = Omit<ClientSessionOptions, 'policy'> & {
35
+ export type ConnectOptions = Omit<ClientSessionOptions, 'kernel' | 'policy'> & {
36
+ readonly url: string;
31
37
  readonly policy?: SessionPolicy;
32
38
  };
33
- /** Package-private exact-Publication dispatch used by Domain bindings. */
34
- export declare function dispatchBound(session: ClientSession, call: Call, expected: BoundTarget, options?: SessionRequestOptions): Promise<Result>;
35
39
  /** Caller-owned discovery and redirect-following conversation with one exact source Kernel. */
36
40
  export declare class ClientSession {
37
41
  readonly kernel: IssuerId;
38
42
  readonly schema: SchemaApi;
43
+ readonly graph: GraphApi;
39
44
  private readonly ownedPool?;
40
45
  private readonly discovery;
41
46
  private readonly dispatcher;
@@ -45,17 +50,19 @@ export declare class ClientSession {
45
50
  private readonly admitTargetViews;
46
51
  private closed;
47
52
  constructor(options: ClientSessionOptions);
53
+ /** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
54
+ bind<const DomainValue extends Domain>(domain: DomainValue): DomainBinding<DomainValue>;
48
55
  snapshot(options?: SessionControlOptions): Promise<SessionSnapshot>;
49
56
  viewsFor(target: PathLike, options?: SessionControlOptions): Promise<ViewCatalog>;
50
- installed(origin: Key.Origin, options?: SessionControlOptions): Promise<ReadyInstallation>;
51
57
  dispatch(call: Call, options?: SessionRequestOptions): Promise<Result>;
52
58
  call(call: Call, options?: SessionRequestOptions): Promise<Input>;
59
+ invoke<const Reference extends CallableReference>(reference: Reference, input: InputOfReference<Reference>, options?: SessionRequestOptions): Promise<OutputOfReference<Reference>>;
53
60
  stream(call: Call, options?: SessionRequestOptions): Promise<import("../client/result.js").Stream>;
54
- binary(call: Call, options?: SessionRequestOptions): Promise<import("@astrale-os/kernel-core/domain").BinaryResult>;
61
+ binary(call: Call, options?: SessionRequestOptions): Promise<import("@astrale-os/kernel-core/callable").BinaryOutput>;
55
62
  close(): void;
56
63
  private requireOpen;
64
+ private invokeDomainMethod;
57
65
  private operation;
58
66
  }
59
67
  /** Open one caller-owned conversation with a Kernel using secure defaults. */
60
68
  export declare function connect(options: ConnectOptions): ClientSession;
61
- //# sourceMappingURL=session.d.ts.map
@@ -1,27 +1,24 @@
1
+ import { Path } from '@astrale-os/kernel-core/path';
1
2
  import { Client } from '../client/index.js';
2
- import { ClientError } from '../errors/index.js';
3
+ import { SessionError } from '../errors/index.js';
4
+ import { createDomainBinding } from '../graph/domain/binding.js';
5
+ import { createGraph } from '../graph/index.js';
3
6
  import { ClientPool } from '../pool/index.js';
4
- import { createSchema } from '../schema/index.js';
7
+ import { createSchema, DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS } from '../schema/index.js';
5
8
  import { AutoTransport } from '../transport/auto/index.js';
6
9
  import { HttpTransport } from '../transport/http/index.js';
7
10
  import { WebSocketTransport } from '../transport/websocket/index.js';
8
11
  import { admitControlOptions, admitPolicy, createSessionOperation, DEFAULT_MAXIMUM_BUNDLE_BYTES, DEFAULT_MAXIMUM_PUBLICATION_BYTES, DEFAULT_MAXIMUM_RESPONSE_BYTES, DEFAULT_TIMEOUT_MS, admitKernel, kernelInvocationEndpoint, platformDuration, positive, } from './context/index.js';
9
12
  import { createSessionDiscovery } from './discovery/index.js';
13
+ import { admitReference } from './reference.js';
10
14
  import { admitEnvelopeTransport, admitRequestOptions, admitSessionAuth, requireResultKind, RouteCache, SessionDispatcher, } from './routing/index.js';
11
15
  import { resolveViewsFor, targetViewCatalog } from './views/index.js';
12
16
  const DEFAULT_SESSION_POLICY = Object.freeze({ maximumRouteAgeMs: 60_000 });
13
- const boundDispatch = new WeakMap();
14
- /** Package-private exact-Publication dispatch used by Domain bindings. */
15
- export function dispatchBound(session, call, expected, options) {
16
- const dispatch = boundDispatch.get(session);
17
- if (dispatch === undefined)
18
- throw new TypeError('Bound dispatch requires an owned ClientSession.');
19
- return dispatch(call, expected, options);
20
- }
21
17
  /** Caller-owned discovery and redirect-following conversation with one exact source Kernel. */
22
18
  export class ClientSession {
23
19
  kernel;
24
20
  schema;
21
+ graph;
25
22
  ownedPool;
26
23
  discovery;
27
24
  dispatcher;
@@ -49,11 +46,12 @@ export class ClientSession {
49
46
  const maximumBundleBytes = positive(options.maximumBundleBytes ?? DEFAULT_MAXIMUM_BUNDLE_BYTES, 'maximumBundleBytes');
50
47
  const maximumResponseBytes = positive(options.maximumResponseBytes ?? DEFAULT_MAXIMUM_RESPONSE_BYTES, 'maximumResponseBytes');
51
48
  const timeoutMs = platformDuration(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, 'timeoutMs');
49
+ const schemaLifecycleTimeoutMs = platformDuration(options.schemaLifecycleTimeoutMs ?? DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS, 'schemaLifecycleTimeoutMs');
52
50
  this.timeoutMs = timeoutMs;
53
51
  const websocketAvailable = options.client !== undefined ||
54
52
  options.pool !== undefined ||
55
53
  options.websocket !== undefined ||
56
- typeof globalThis.WebSocket === 'function';
54
+ typeof WebSocket === 'function';
57
55
  const client = options.client ??
58
56
  defaultClientFactory({
59
57
  fetch: fetchImpl,
@@ -80,7 +78,7 @@ export class ClientSession {
80
78
  requireOpen: () => this.requireOpen(),
81
79
  acquisitionOperation: () => this.operation(undefined),
82
80
  });
83
- this.routes = new RouteCache(policy.maximumRouteAgeMs);
81
+ this.routes = new RouteCache(policy.maximumRouteAgeMs, undefined, options.routeStore);
84
82
  this.dispatcher = new SessionDispatcher({
85
83
  kernel: this.kernel,
86
84
  sourceEndpoint,
@@ -90,17 +88,18 @@ export class ClientSession {
90
88
  cache: this.routes,
91
89
  policy,
92
90
  envelopeTransport: admitEnvelopeTransport(options.envelopeTransport ?? 'http'),
93
- discovery: this.discovery,
94
91
  requireOpen: () => this.requireOpen(),
95
92
  });
96
93
  this.schema = createSchema((request, options) => this.dispatch(request, options), {
97
94
  maximumPublicationBytes,
98
95
  maximumBundleBytes,
96
+ lifecycleTimeoutMs: schemaLifecycleTimeoutMs,
99
97
  });
100
- boundDispatch.set(this, (request, expected, options) => {
101
- const admitted = admitRequestOptions(options);
102
- return this.dispatcher.dispatch(request, admitted, this.operation(admitted), expected);
103
- });
98
+ this.graph = createGraph((call, options) => this.call(call, options));
99
+ }
100
+ /** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
101
+ bind(domain) {
102
+ return createDomainBinding(domain, this.graph, (node, method, input) => this.invokeDomainMethod(domain, node, method, input));
104
103
  }
105
104
  snapshot(options) {
106
105
  return this.discovery.snapshot(this.operation(admitControlOptions(options)));
@@ -109,23 +108,6 @@ export class ClientSession {
109
108
  this.requireOpen();
110
109
  return resolveViewsFor(async (call, operation) => requireResultKind('value', await this.dispatcher.dispatch(call, {}, operation)).value, this.admitTargetViews, target, this.operation(admitControlOptions(options)));
111
110
  }
112
- async installed(origin, options) {
113
- const result = await this.schema.introspect({
114
- from: { kind: 'installation', origin },
115
- select: {
116
- state: true,
117
- target: true,
118
- source: true,
119
- bundle: true,
120
- readiness: true,
121
- capabilities: true,
122
- },
123
- }, options);
124
- if (result?.state !== 'ready' || result.readiness === null) {
125
- throw new ClientError(`Domain ${origin} is not ready on this Kernel.`);
126
- }
127
- return result;
128
- }
129
111
  dispatch(call, options) {
130
112
  const admitted = admitRequestOptions(options);
131
113
  return this.dispatcher.dispatch(call, admitted, this.operation(admitted));
@@ -134,6 +116,21 @@ export class ClientSession {
134
116
  const result = await this.dispatch(call, options);
135
117
  return requireResultKind('value', result).value;
136
118
  }
119
+ async invoke(reference, input, options) {
120
+ const admittedReference = admitReference(reference);
121
+ const admittedOptions = admitRequestOptions(options);
122
+ const expected = Object.freeze({
123
+ origin: admittedReference.origin,
124
+ revision: admittedReference.revision,
125
+ });
126
+ const result = await this.dispatcher.dispatch({ target: admittedReference.target, input }, admittedOptions, this.operation(admittedOptions), expected);
127
+ const narrowed = requireResultKind(admittedReference.outputMode, result);
128
+ return (narrowed.kind === 'value'
129
+ ? narrowed.value
130
+ : narrowed.kind === 'stream'
131
+ ? narrowed.stream
132
+ : narrowed.value);
133
+ }
137
134
  async stream(call, options) {
138
135
  const result = await this.dispatch(call, options);
139
136
  return requireResultKind('stream', result).stream;
@@ -146,14 +143,29 @@ export class ClientSession {
146
143
  if (this.closed)
147
144
  return;
148
145
  this.closed = true;
149
- this.lifecycle.abort(new ClientError('ClientSession is closed.'));
146
+ this.lifecycle.abort(new SessionError('ClientSession is closed.', { failure: 'closed' }));
150
147
  this.ownedPool?.close();
151
148
  this.routes.clear();
152
149
  this.discovery.clear();
153
150
  }
154
151
  requireOpen() {
155
152
  if (this.closed)
156
- throw new ClientError('ClientSession is closed.');
153
+ throw new SessionError('ClientSession is closed.', { failure: 'closed' });
154
+ }
155
+ invokeDomainMethod(domain, node, method, input) {
156
+ const diagnostics = method.validateInput(input);
157
+ if (diagnostics.length > 0)
158
+ throw new TypeError(`Method ${method.key} input is invalid.`);
159
+ const owner = domain.closure.find(({ origin }) => origin === method.owner.ref.origin);
160
+ if (owner === undefined)
161
+ throw new TypeError(`Method owner ${method.owner.ref.origin} is absent.`);
162
+ return this.invoke({
163
+ origin: owner.origin,
164
+ revision: owner.revision,
165
+ callable: method.key,
166
+ target: Path.instanceMethod(Path.id(node.id), method.name),
167
+ outputMode: method.output.mode,
168
+ }, input);
157
169
  }
158
170
  operation(options) {
159
171
  this.requireOpen();
@@ -162,8 +174,13 @@ export class ClientSession {
162
174
  }
163
175
  /** Open one caller-owned conversation with a Kernel using secure defaults. */
164
176
  export function connect(options) {
177
+ if (options === null || typeof options !== 'object') {
178
+ throw new TypeError('Connect options are invalid.');
179
+ }
180
+ const { url, ...rest } = options;
165
181
  return new ClientSession({
166
- ...options,
182
+ ...rest,
183
+ kernel: url,
167
184
  policy: options.policy ?? DEFAULT_SESSION_POLICY,
168
185
  });
169
186
  }
@@ -222,4 +239,3 @@ function defaultClientFactory(options) {
222
239
  }
223
240
  };
224
241
  }
225
- //# sourceMappingURL=session.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=session.typecheck.d.ts.map
@@ -1,4 +1,7 @@
1
- import { ClientSession } from './index.js';
1
+ import { NodeId } from '@astrale-os/kernel-core/graph/node';
2
+ import { Path } from '@astrale-os/kernel-core/path';
3
+ import { defineSchema, method, nodeClass, schema } from '@astrale-os/kernel-dsl/v1';
4
+ import { ClientSession, reference } from './index.js';
2
5
  void new ClientSession(options);
3
6
  void auth;
4
7
  void control;
@@ -6,5 +9,22 @@ void envelope;
6
9
  void policy;
7
10
  void request;
8
11
  void snapshot;
9
- void {};
10
- //# sourceMappingURL=session.typecheck.js.map
12
+ const dynamicReference = reference(dynamicDomain, dynamicMethod)(Path.id(NodeId('dynamic-node')));
13
+ void session.invoke(dynamicReference, dynamicInput);
14
+ const dynamicInputIsClientInput = true;
15
+ const dynamicOutputIsUnknown = true;
16
+ void dynamicInputIsClientInput;
17
+ void dynamicOutputIsUnknown;
18
+ const abstractMethod = method({
19
+ auth: 'authenticated',
20
+ input: { type: 'null' },
21
+ output: { type: 'null' },
22
+ inheritance: 'abstract',
23
+ });
24
+ const abstractDomain = schema.resolve(defineSchema('client.reference.typecheck', {
25
+ classes: {
26
+ AbstractItem: nodeClass({ abstract: true, methods: { abstractMethod } }),
27
+ },
28
+ }));
29
+ // @ts-expect-error Abstract Methods are declarations and cannot become Client references.
30
+ reference(abstractDomain, abstractDomain.classes.AbstractItem.methods.abstractMethod);
@@ -1,9 +1,9 @@
1
1
  import type { Key, bundle } from '@astrale-os/kernel-dsl/v1';
2
2
  import type { publication } from '@astrale-os/kernel-protocol';
3
- import { syscalls } from '@astrale-os/kernel-core/schema';
3
+ import { type ResolvedView } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
4
+ export type { ResolvedView } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
4
5
  import type { SessionPolicy } from '../context/index.js';
5
6
  /** One verified View declaration joined with its owning Publication and provenance. */
6
- export type ResolvedView = syscalls.view.ResolvedView;
7
7
  /** Immutable canonical-key-ordered inventory of Views resolved under one Session revision. */
8
8
  export interface ViewCatalog {
9
9
  readonly entrypoint?: ResolvedView;
@@ -13,4 +13,3 @@ export declare function rootViewCatalog(publication: publication.Publication, ar
13
13
  export declare function catalogFromKeys(root: ViewCatalog, keys: readonly Key.View[]): ViewCatalog;
14
14
  /** Re-admit one Runtime-resolved heterogeneous View catalog at the Client trust boundary. */
15
15
  export declare function targetViewCatalog(input: unknown, policy: Readonly<SessionPolicy>): ViewCatalog;
16
- //# sourceMappingURL=catalog.d.ts.map
@@ -1,20 +1,22 @@
1
- import { syscalls } from '@astrale-os/kernel-core/schema';
2
- import { Key as ViewKey, Ref } from '@astrale-os/kernel-dsl/v1';
1
+ import { acceptViewResolution, } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
2
+ import { Key as ViewKey } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import { ClientError } from '../../errors/index.js';
4
4
  import { allowEndpoint } from '../context/index.js';
5
5
  export function rootViewCatalog(publication, artifact, policy) {
6
6
  const views = publication.bindings.views
7
7
  .map((binding) => {
8
8
  allowEndpoint(binding.href, policy);
9
- const declaration = artifact.root.views[Ref.member(ViewKey.ref(binding.view))];
9
+ const declaration = artifact.root.views[viewName(binding.view)];
10
10
  if (declaration === undefined) {
11
11
  throw new ClientError('Published View has no verified root declaration.');
12
12
  }
13
+ const { ref: _ref, ...viewDeclaration } = declaration;
13
14
  return Object.freeze({
14
15
  key: binding.view,
15
- declaration,
16
+ declaration: Object.freeze(viewDeclaration),
16
17
  href: binding.href,
17
18
  handshake: binding.handshake,
19
+ ...(binding.iframe === undefined ? {} : { iframe: binding.iframe }),
18
20
  issuer: publication.identity.issuer,
19
21
  etag: publication.etag,
20
22
  revision: publication.schema.revision,
@@ -25,7 +27,7 @@ export function rootViewCatalog(publication, artifact, policy) {
25
27
  const entrypointRef = publication.manifest?.entrypoint;
26
28
  const entrypoint = entrypointRef === undefined
27
29
  ? undefined
28
- : catalogViews.find(({ key }) => key === ViewKey.of(publication.origin, entrypointRef));
30
+ : catalogViews.find(({ key }) => key === ViewKey.of(entrypointRef));
29
31
  if (entrypointRef !== undefined && entrypoint === undefined) {
30
32
  throw new ClientError('Published View entrypoint has no verified Publication binding.');
31
33
  }
@@ -48,7 +50,7 @@ export function catalogFromKeys(root, keys) {
48
50
  export function targetViewCatalog(input, policy) {
49
51
  let resolution;
50
52
  try {
51
- resolution = syscalls.view.acceptResolution(input);
53
+ resolution = acceptViewResolution(input);
52
54
  }
53
55
  catch (cause) {
54
56
  throw new ClientError('Resolved View catalog is invalid.', { cause });
@@ -60,4 +62,10 @@ export function targetViewCatalog(input, policy) {
60
62
  function compareKeys(left, right) {
61
63
  return left < right ? -1 : left > right ? 1 : 0;
62
64
  }
63
- //# sourceMappingURL=catalog.js.map
65
+ function viewName(input) {
66
+ const coordinate = input.slice(input.indexOf(':') + 1);
67
+ const match = /^view\.([A-Za-z][A-Za-z0-9_]*)$/u.exec(coordinate);
68
+ if (match === null)
69
+ throw new ClientError('Published View key is invalid.');
70
+ return match[1];
71
+ }
@@ -1,3 +1,2 @@
1
1
  export { catalogFromKeys, rootViewCatalog, targetViewCatalog, type ResolvedView, type ViewCatalog, } from './catalog.js';
2
2
  export { resolveViewsFor, type ViewCatalogAdmission, type ViewInvoker } from './resolve.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { catalogFromKeys, rootViewCatalog, targetViewCatalog, } from './catalog.js';
2
2
  export { resolveViewsFor } from './resolve.js';
3
- //# sourceMappingURL=index.js.map
@@ -9,4 +9,3 @@ export type ViewCatalogAdmission = (input: unknown) => ViewCatalog;
9
9
  * its heterogeneous installed-Publication projection.
10
10
  */
11
11
  export declare function resolveViewsFor(invoke: ViewInvoker, admitCatalog: ViewCatalogAdmission, target: PathLike, operation: SessionOperation): Promise<ViewCatalog>;
12
- //# sourceMappingURL=resolve.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { Path } from '@astrale-os/kernel-core/path';
2
- import { K } from '@astrale-os/kernel-core/schema';
2
+ import { view } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
3
3
  import { call } from '../../client/index.js';
4
4
  /**
5
5
  * Invoke Runtime-owned target View resolution through the canonical source Kernel call, then admit
@@ -7,6 +7,7 @@ import { call } from '../../client/index.js';
7
7
  */
8
8
  export async function resolveViewsFor(invoke, admitCatalog, target, operation) {
9
9
  const path = Path.from(target).raw;
10
- return admitCatalog(await invoke(call(K.View.resolve.path, { target: path }), operation));
10
+ const owner = Path.project(view.resolve.owner);
11
+ const targetView = Path.staticMethod(owner, view.resolve.name);
12
+ return admitCatalog(await invoke(call(targetView, { target: path }), operation));
11
13
  }
12
- //# sourceMappingURL=resolve.js.map
@@ -20,4 +20,3 @@ export declare class EntityIndex {
20
20
  clear(): void;
21
21
  }
22
22
  export declare function edgeIdentity(key: EdgeKey): string;
23
- //# sourceMappingURL=entity-index.d.ts.map