@sentropic/cluster-mesh 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/dist/comments/storage-schema.d.ts +1 -1
  2. package/dist/comments/transport-contracts.d.ts +1 -1
  3. package/dist/compile/contract/diagnostics.d.ts +9 -0
  4. package/dist/compile/contract/diagnostics.d.ts.map +1 -0
  5. package/dist/compile/contract/diagnostics.js +82 -0
  6. package/dist/compile/contract/diagnostics.js.map +1 -0
  7. package/dist/compile/contract/encoding.d.ts +12 -0
  8. package/dist/compile/contract/encoding.d.ts.map +1 -0
  9. package/dist/compile/contract/encoding.js +95 -0
  10. package/dist/compile/contract/encoding.js.map +1 -0
  11. package/dist/compile/contract/index.d.ts +9 -0
  12. package/dist/compile/contract/index.d.ts.map +1 -0
  13. package/dist/compile/contract/index.js +9 -0
  14. package/dist/compile/contract/index.js.map +1 -0
  15. package/dist/compile/contract/json.d.ts +3 -0
  16. package/dist/compile/contract/json.d.ts.map +1 -0
  17. package/dist/compile/contract/json.js +75 -0
  18. package/dist/compile/contract/json.js.map +1 -0
  19. package/dist/compile/contract/output.d.ts +5 -0
  20. package/dist/compile/contract/output.d.ts.map +1 -0
  21. package/dist/compile/contract/output.js +57 -0
  22. package/dist/compile/contract/output.js.map +1 -0
  23. package/dist/compile/contract/recipe.d.ts +5 -0
  24. package/dist/compile/contract/recipe.d.ts.map +1 -0
  25. package/dist/compile/contract/recipe.js +86 -0
  26. package/dist/compile/contract/recipe.js.map +1 -0
  27. package/dist/compile/contract/schema.d.ts +26 -0
  28. package/dist/compile/contract/schema.d.ts.map +1 -0
  29. package/dist/compile/contract/schema.js +92 -0
  30. package/dist/compile/contract/schema.js.map +1 -0
  31. package/dist/compile/contract/types.d.ts +166 -0
  32. package/dist/compile/contract/types.d.ts.map +1 -0
  33. package/dist/compile/contract/types.js +21 -0
  34. package/dist/compile/contract/types.js.map +1 -0
  35. package/dist/compile/contract/vectors.d.ts +38 -0
  36. package/dist/compile/contract/vectors.d.ts.map +1 -0
  37. package/dist/compile/contract/vectors.js +29 -0
  38. package/dist/compile/contract/vectors.js.map +1 -0
  39. package/dist/forge/contracts.d.ts +60 -0
  40. package/dist/forge/contracts.d.ts.map +1 -0
  41. package/dist/forge/contracts.js +19 -0
  42. package/dist/forge/contracts.js.map +1 -0
  43. package/dist/forge/custody.d.ts +7 -0
  44. package/dist/forge/custody.d.ts.map +1 -0
  45. package/dist/forge/custody.js +76 -0
  46. package/dist/forge/custody.js.map +1 -0
  47. package/dist/forge/enrollment.d.ts +151 -0
  48. package/dist/forge/enrollment.d.ts.map +1 -0
  49. package/dist/forge/enrollment.js +98 -0
  50. package/dist/forge/enrollment.js.map +1 -0
  51. package/dist/forge/github-api.d.ts +6 -0
  52. package/dist/forge/github-api.d.ts.map +1 -0
  53. package/dist/forge/github-api.js +131 -0
  54. package/dist/forge/github-api.js.map +1 -0
  55. package/dist/forge/hono.d.ts +14 -0
  56. package/dist/forge/hono.d.ts.map +1 -0
  57. package/dist/forge/hono.js +141 -0
  58. package/dist/forge/hono.js.map +1 -0
  59. package/dist/forge/lifecycle.d.ts +108 -0
  60. package/dist/forge/lifecycle.d.ts.map +1 -0
  61. package/dist/forge/lifecycle.js +160 -0
  62. package/dist/forge/lifecycle.js.map +1 -0
  63. package/dist/forge/records.d.ts +70 -0
  64. package/dist/forge/records.d.ts.map +1 -0
  65. package/dist/forge/records.js +2 -0
  66. package/dist/forge/records.js.map +1 -0
  67. package/dist/forge/rotation.d.ts +46 -0
  68. package/dist/forge/rotation.d.ts.map +1 -0
  69. package/dist/forge/rotation.js +62 -0
  70. package/dist/forge/rotation.js.map +1 -0
  71. package/dist/identity/auth-abort.d.ts +9 -0
  72. package/dist/identity/auth-abort.d.ts.map +1 -0
  73. package/dist/identity/auth-abort.js +59 -0
  74. package/dist/identity/auth-abort.js.map +1 -0
  75. package/dist/identity/auth-binding.d.ts +3 -0
  76. package/dist/identity/auth-binding.d.ts.map +1 -0
  77. package/dist/identity/auth-binding.js +87 -0
  78. package/dist/identity/auth-binding.js.map +1 -0
  79. package/dist/identity/auth-boundary.d.ts +11 -0
  80. package/dist/identity/auth-boundary.d.ts.map +1 -0
  81. package/dist/identity/auth-boundary.js +73 -0
  82. package/dist/identity/auth-boundary.js.map +1 -0
  83. package/dist/identity/auth-completion.d.ts +9 -0
  84. package/dist/identity/auth-completion.d.ts.map +1 -0
  85. package/dist/identity/auth-completion.js +24 -0
  86. package/dist/identity/auth-completion.js.map +1 -0
  87. package/dist/identity/auth-credentials.d.ts +5 -0
  88. package/dist/identity/auth-credentials.d.ts.map +1 -0
  89. package/dist/identity/auth-credentials.js +82 -0
  90. package/dist/identity/auth-credentials.js.map +1 -0
  91. package/dist/identity/auth-email.d.ts +8 -0
  92. package/dist/identity/auth-email.d.ts.map +1 -0
  93. package/dist/identity/auth-email.js +104 -0
  94. package/dist/identity/auth-email.js.map +1 -0
  95. package/dist/identity/auth-hono.d.ts +5 -0
  96. package/dist/identity/auth-hono.d.ts.map +1 -0
  97. package/dist/identity/auth-hono.js +10 -0
  98. package/dist/identity/auth-hono.js.map +1 -0
  99. package/dist/identity/auth-proofs.d.ts +11 -0
  100. package/dist/identity/auth-proofs.d.ts.map +1 -0
  101. package/dist/identity/auth-proofs.js +107 -0
  102. package/dist/identity/auth-proofs.js.map +1 -0
  103. package/dist/identity/auth-service-tenant.d.ts +4 -0
  104. package/dist/identity/auth-service-tenant.d.ts.map +1 -0
  105. package/dist/identity/auth-service-tenant.js +54 -0
  106. package/dist/identity/auth-service-tenant.js.map +1 -0
  107. package/dist/identity/auth-sessions.d.ts +8 -0
  108. package/dist/identity/auth-sessions.d.ts.map +1 -0
  109. package/dist/identity/auth-sessions.js +141 -0
  110. package/dist/identity/auth-sessions.js.map +1 -0
  111. package/dist/identity/auth-social.d.ts +4 -0
  112. package/dist/identity/auth-social.d.ts.map +1 -0
  113. package/dist/identity/auth-social.js +82 -0
  114. package/dist/identity/auth-social.js.map +1 -0
  115. package/dist/identity/auth-users.d.ts +9 -0
  116. package/dist/identity/auth-users.d.ts.map +1 -0
  117. package/dist/identity/auth-users.js +116 -0
  118. package/dist/identity/auth-users.js.map +1 -0
  119. package/dist/identity/auth-webauthn.d.ts +22 -0
  120. package/dist/identity/auth-webauthn.d.ts.map +1 -0
  121. package/dist/identity/auth-webauthn.js +108 -0
  122. package/dist/identity/auth-webauthn.js.map +1 -0
  123. package/dist/identity/cascade.d.ts +12 -0
  124. package/dist/identity/cascade.d.ts.map +1 -0
  125. package/dist/identity/cascade.js +19 -0
  126. package/dist/identity/cascade.js.map +1 -0
  127. package/dist/identity/connector-custody.d.ts +85 -0
  128. package/dist/identity/connector-custody.d.ts.map +1 -0
  129. package/dist/identity/connector-custody.js +288 -0
  130. package/dist/identity/connector-custody.js.map +1 -0
  131. package/dist/identity/conversation.d.ts +50 -0
  132. package/dist/identity/conversation.d.ts.map +1 -0
  133. package/dist/identity/conversation.js +102 -0
  134. package/dist/identity/conversation.js.map +1 -0
  135. package/dist/identity/custody-crypto.d.ts +37 -0
  136. package/dist/identity/custody-crypto.d.ts.map +1 -0
  137. package/dist/identity/custody-crypto.js +173 -0
  138. package/dist/identity/custody-crypto.js.map +1 -0
  139. package/dist/identity/decision.d.ts +28 -0
  140. package/dist/identity/decision.d.ts.map +1 -0
  141. package/dist/identity/decision.js +97 -0
  142. package/dist/identity/decision.js.map +1 -0
  143. package/dist/identity/index.d.ts +9 -0
  144. package/dist/identity/index.d.ts.map +1 -0
  145. package/dist/identity/index.js +13 -0
  146. package/dist/identity/index.js.map +1 -0
  147. package/dist/identity/ledger.d.ts +120 -0
  148. package/dist/identity/ledger.d.ts.map +1 -0
  149. package/dist/identity/ledger.js +226 -0
  150. package/dist/identity/ledger.js.map +1 -0
  151. package/dist/identity/postgres.d.ts +13 -0
  152. package/dist/identity/postgres.d.ts.map +1 -0
  153. package/dist/identity/postgres.js +207 -0
  154. package/dist/identity/postgres.js.map +1 -0
  155. package/dist/identity/sqlite.d.ts +14 -0
  156. package/dist/identity/sqlite.d.ts.map +1 -0
  157. package/dist/identity/sqlite.js +193 -0
  158. package/dist/identity/sqlite.js.map +1 -0
  159. package/dist/identity-contracts/accounts.d.ts.map +1 -1
  160. package/dist/identity-contracts/accounts.js +4 -3
  161. package/dist/identity-contracts/accounts.js.map +1 -1
  162. package/dist/identity-contracts/boundary-resolution.d.ts +31 -0
  163. package/dist/identity-contracts/boundary-resolution.d.ts.map +1 -0
  164. package/dist/identity-contracts/boundary-resolution.js +56 -0
  165. package/dist/identity-contracts/boundary-resolution.js.map +1 -0
  166. package/dist/identity-contracts/composition-descriptors.d.ts +17 -0
  167. package/dist/identity-contracts/composition-descriptors.d.ts.map +1 -0
  168. package/dist/identity-contracts/composition-descriptors.js +77 -0
  169. package/dist/identity-contracts/composition-descriptors.js.map +1 -0
  170. package/dist/identity-contracts/custody-auth.d.ts +122 -0
  171. package/dist/identity-contracts/custody-auth.d.ts.map +1 -0
  172. package/dist/identity-contracts/custody-auth.js +2 -0
  173. package/dist/identity-contracts/custody-auth.js.map +1 -0
  174. package/dist/identity-contracts/custody-descriptors.d.ts +18 -0
  175. package/dist/identity-contracts/custody-descriptors.d.ts.map +1 -0
  176. package/dist/identity-contracts/custody-descriptors.js +83 -0
  177. package/dist/identity-contracts/custody-descriptors.js.map +1 -0
  178. package/dist/identity-contracts/custody-errors.d.ts +21 -0
  179. package/dist/identity-contracts/custody-errors.d.ts.map +1 -0
  180. package/dist/identity-contracts/custody-errors.js +80 -0
  181. package/dist/identity-contracts/custody-errors.js.map +1 -0
  182. package/dist/identity-contracts/custody-operations.d.ts +79 -0
  183. package/dist/identity-contracts/custody-operations.d.ts.map +1 -0
  184. package/dist/identity-contracts/custody-operations.js +2 -0
  185. package/dist/identity-contracts/custody-operations.js.map +1 -0
  186. package/dist/identity-contracts/custody.d.ts +587 -0
  187. package/dist/identity-contracts/custody.d.ts.map +1 -0
  188. package/dist/identity-contracts/custody.js +7 -0
  189. package/dist/identity-contracts/custody.js.map +1 -0
  190. package/dist/identity-contracts/doubles.d.ts +11 -2
  191. package/dist/identity-contracts/doubles.d.ts.map +1 -1
  192. package/dist/identity-contracts/doubles.js +20 -0
  193. package/dist/identity-contracts/doubles.js.map +1 -1
  194. package/dist/identity-contracts/index.d.ts +10 -0
  195. package/dist/identity-contracts/index.d.ts.map +1 -1
  196. package/dist/identity-contracts/index.js +10 -0
  197. package/dist/identity-contracts/index.js.map +1 -1
  198. package/dist/identity-contracts/oauth-reads.d.ts +42 -0
  199. package/dist/identity-contracts/oauth-reads.d.ts.map +1 -0
  200. package/dist/identity-contracts/oauth-reads.js +38 -0
  201. package/dist/identity-contracts/oauth-reads.js.map +1 -0
  202. package/dist/identity-contracts/replica-sync.d.ts +89 -0
  203. package/dist/identity-contracts/replica-sync.d.ts.map +1 -0
  204. package/dist/identity-contracts/replica-sync.js +7 -0
  205. package/dist/identity-contracts/replica-sync.js.map +1 -0
  206. package/dist/identity-contracts/service-tenancy.d.ts +43 -0
  207. package/dist/identity-contracts/service-tenancy.d.ts.map +1 -0
  208. package/dist/identity-contracts/service-tenancy.js +75 -0
  209. package/dist/identity-contracts/service-tenancy.js.map +1 -0
  210. package/dist/identity-contracts/workspace-deletion.d.ts +56 -0
  211. package/dist/identity-contracts/workspace-deletion.d.ts.map +1 -0
  212. package/dist/identity-contracts/workspace-deletion.js +7 -0
  213. package/dist/identity-contracts/workspace-deletion.js.map +1 -0
  214. package/dist/identity-stores/index.d.ts +4 -0
  215. package/dist/identity-stores/index.d.ts.map +1 -0
  216. package/dist/identity-stores/index.js +7 -0
  217. package/dist/identity-stores/index.js.map +1 -0
  218. package/dist/identity-stores/tenancy-postgres.d.ts +23 -0
  219. package/dist/identity-stores/tenancy-postgres.d.ts.map +1 -0
  220. package/dist/identity-stores/tenancy-postgres.js +294 -0
  221. package/dist/identity-stores/tenancy-postgres.js.map +1 -0
  222. package/dist/identity-stores/tenancy-schema.d.ts +11 -0
  223. package/dist/identity-stores/tenancy-schema.d.ts.map +1 -0
  224. package/dist/identity-stores/tenancy-schema.js +74 -0
  225. package/dist/identity-stores/tenancy-schema.js.map +1 -0
  226. package/dist/identity-stores/tenancy-sqlite.d.ts +24 -0
  227. package/dist/identity-stores/tenancy-sqlite.d.ts.map +1 -0
  228. package/dist/identity-stores/tenancy-sqlite.js +288 -0
  229. package/dist/identity-stores/tenancy-sqlite.js.map +1 -0
  230. package/dist/index.d.ts +14 -0
  231. package/dist/index.d.ts.map +1 -1
  232. package/dist/index.js +13 -0
  233. package/dist/index.js.map +1 -1
  234. package/dist/loaders/notifications/index.d.ts +5 -0
  235. package/dist/loaders/notifications/index.d.ts.map +1 -0
  236. package/dist/loaders/notifications/index.js +6 -0
  237. package/dist/loaders/notifications/index.js.map +1 -0
  238. package/dist/mcp/stateful-preflight.d.ts +1 -1
  239. package/dist/messaging/email-port.d.ts +49 -0
  240. package/dist/messaging/email-port.d.ts.map +1 -0
  241. package/dist/messaging/email-port.js +92 -0
  242. package/dist/messaging/email-port.js.map +1 -0
  243. package/dist/messaging/index.d.ts +1 -0
  244. package/dist/messaging/index.d.ts.map +1 -1
  245. package/dist/messaging/index.js +1 -0
  246. package/dist/messaging/index.js.map +1 -1
  247. package/dist/modules/catalog.d.ts +5 -4
  248. package/dist/modules/catalog.d.ts.map +1 -1
  249. package/dist/modules/catalog.js +10 -5
  250. package/dist/modules/catalog.js.map +1 -1
  251. package/dist/modules/contracts.d.ts +1 -1
  252. package/dist/modules/contracts.d.ts.map +1 -1
  253. package/dist/modules/contracts.js +1 -0
  254. package/dist/modules/contracts.js.map +1 -1
  255. package/dist/notifications/incident-policy.d.ts +6 -0
  256. package/dist/notifications/incident-policy.d.ts.map +1 -0
  257. package/dist/notifications/incident-policy.js +119 -0
  258. package/dist/notifications/incident-policy.js.map +1 -0
  259. package/dist/notifications/incident-schedule.d.ts +14 -0
  260. package/dist/notifications/incident-schedule.d.ts.map +1 -0
  261. package/dist/notifications/incident-schedule.js +36 -0
  262. package/dist/notifications/incident-schedule.js.map +1 -0
  263. package/dist/notifications/incident-state.d.ts +72 -0
  264. package/dist/notifications/incident-state.d.ts.map +1 -0
  265. package/dist/notifications/incident-state.js +72 -0
  266. package/dist/notifications/incident-state.js.map +1 -0
  267. package/dist/notifications/index.d.ts +9 -0
  268. package/dist/notifications/index.d.ts.map +1 -0
  269. package/dist/notifications/index.js +9 -0
  270. package/dist/notifications/index.js.map +1 -0
  271. package/dist/notifications/ops-job-failure-contract.d.ts +19 -0
  272. package/dist/notifications/ops-job-failure-contract.d.ts.map +1 -0
  273. package/dist/notifications/ops-job-failure-contract.js +183 -0
  274. package/dist/notifications/ops-job-failure-contract.js.map +1 -0
  275. package/dist/notifications/ops-job-failure-types.d.ts +81 -0
  276. package/dist/notifications/ops-job-failure-types.d.ts.map +1 -0
  277. package/dist/notifications/ops-job-failure-types.js +73 -0
  278. package/dist/notifications/ops-job-failure-types.js.map +1 -0
  279. package/dist/notifications/recipients-http.d.ts +66 -0
  280. package/dist/notifications/recipients-http.d.ts.map +1 -0
  281. package/dist/notifications/recipients-http.js +148 -0
  282. package/dist/notifications/recipients-http.js.map +1 -0
  283. package/dist/notifications/recipients.d.ts +50 -0
  284. package/dist/notifications/recipients.d.ts.map +1 -0
  285. package/dist/notifications/recipients.js +59 -0
  286. package/dist/notifications/recipients.js.map +1 -0
  287. package/dist/prompts/registry.d.ts +55 -0
  288. package/dist/prompts/registry.d.ts.map +1 -0
  289. package/dist/prompts/registry.js +76 -0
  290. package/dist/prompts/registry.js.map +1 -0
  291. package/dist/runtime/heavy-phase-queue.d.ts +101 -0
  292. package/dist/runtime/heavy-phase-queue.d.ts.map +1 -0
  293. package/dist/runtime/heavy-phase-queue.js +129 -0
  294. package/dist/runtime/heavy-phase-queue.js.map +1 -0
  295. package/dist/sessions/content-policy.d.ts +55 -0
  296. package/dist/sessions/content-policy.d.ts.map +1 -0
  297. package/dist/sessions/content-policy.js +133 -0
  298. package/dist/sessions/content-policy.js.map +1 -0
  299. package/dist/sessions/registry-admin.d.ts +19 -0
  300. package/dist/sessions/registry-admin.d.ts.map +1 -0
  301. package/dist/sessions/registry-admin.js +42 -0
  302. package/dist/sessions/registry-admin.js.map +1 -0
  303. package/dist/sessions/registry-freshness.d.ts +8 -0
  304. package/dist/sessions/registry-freshness.d.ts.map +1 -0
  305. package/dist/sessions/registry-freshness.js +108 -0
  306. package/dist/sessions/registry-freshness.js.map +1 -0
  307. package/dist/sessions/registry-ingest.d.ts +5 -0
  308. package/dist/sessions/registry-ingest.d.ts.map +1 -0
  309. package/dist/sessions/registry-ingest.js +113 -0
  310. package/dist/sessions/registry-ingest.js.map +1 -0
  311. package/dist/sessions/registry-publish.d.ts +18 -0
  312. package/dist/sessions/registry-publish.d.ts.map +1 -0
  313. package/dist/sessions/registry-publish.js +134 -0
  314. package/dist/sessions/registry-publish.js.map +1 -0
  315. package/dist/sessions/registry-store.d.ts +51 -0
  316. package/dist/sessions/registry-store.d.ts.map +1 -0
  317. package/dist/sessions/registry-store.js +134 -0
  318. package/dist/sessions/registry-store.js.map +1 -0
  319. package/dist/sessions/registry-types.d.ts +180 -0
  320. package/dist/sessions/registry-types.d.ts.map +1 -0
  321. package/dist/sessions/registry-types.js +32 -0
  322. package/dist/sessions/registry-types.js.map +1 -0
  323. package/dist/sessions/registry.d.ts +45 -0
  324. package/dist/sessions/registry.d.ts.map +1 -0
  325. package/dist/sessions/registry.js +74 -0
  326. package/dist/sessions/registry.js.map +1 -0
  327. package/dist/sessions/relay-bind.d.ts +38 -0
  328. package/dist/sessions/relay-bind.d.ts.map +1 -0
  329. package/dist/sessions/relay-bind.js +74 -0
  330. package/dist/sessions/relay-bind.js.map +1 -0
  331. package/dist/sessions/relay-brand.d.ts +2 -0
  332. package/dist/sessions/relay-brand.d.ts.map +1 -0
  333. package/dist/sessions/relay-brand.js +7 -0
  334. package/dist/sessions/relay-brand.js.map +1 -0
  335. package/dist/sessions/relay-capsule.d.ts +50 -0
  336. package/dist/sessions/relay-capsule.d.ts.map +1 -0
  337. package/dist/sessions/relay-capsule.js +72 -0
  338. package/dist/sessions/relay-capsule.js.map +1 -0
  339. package/dist/sessions/relay-chain-failure.d.ts +25 -0
  340. package/dist/sessions/relay-chain-failure.d.ts.map +1 -0
  341. package/dist/sessions/relay-chain-failure.js +23 -0
  342. package/dist/sessions/relay-chain-failure.js.map +1 -0
  343. package/dist/sessions/relay-chain.d.ts +74 -0
  344. package/dist/sessions/relay-chain.d.ts.map +1 -0
  345. package/dist/sessions/relay-chain.js +71 -0
  346. package/dist/sessions/relay-chain.js.map +1 -0
  347. package/dist/sessions/relay-composition.d.ts +8 -0
  348. package/dist/sessions/relay-composition.d.ts.map +1 -0
  349. package/dist/sessions/relay-composition.js +65 -0
  350. package/dist/sessions/relay-composition.js.map +1 -0
  351. package/dist/sessions/relay-credit.d.ts +40 -0
  352. package/dist/sessions/relay-credit.d.ts.map +1 -0
  353. package/dist/sessions/relay-credit.js +68 -0
  354. package/dist/sessions/relay-credit.js.map +1 -0
  355. package/dist/sessions/relay-engine.d.ts +19 -0
  356. package/dist/sessions/relay-engine.d.ts.map +1 -0
  357. package/dist/sessions/relay-engine.js +34 -0
  358. package/dist/sessions/relay-engine.js.map +1 -0
  359. package/dist/sessions/relay-frames.d.ts +28 -0
  360. package/dist/sessions/relay-frames.d.ts.map +1 -0
  361. package/dist/sessions/relay-frames.js +72 -0
  362. package/dist/sessions/relay-frames.js.map +1 -0
  363. package/dist/sessions/relay-lane-client.d.ts +7 -0
  364. package/dist/sessions/relay-lane-client.d.ts.map +1 -0
  365. package/dist/sessions/relay-lane-client.js +137 -0
  366. package/dist/sessions/relay-lane-client.js.map +1 -0
  367. package/dist/sessions/relay-lane-lease.d.ts +20 -0
  368. package/dist/sessions/relay-lane-lease.d.ts.map +1 -0
  369. package/dist/sessions/relay-lane-lease.js +74 -0
  370. package/dist/sessions/relay-lane-lease.js.map +1 -0
  371. package/dist/sessions/relay-lane-record.d.ts +28 -0
  372. package/dist/sessions/relay-lane-record.d.ts.map +1 -0
  373. package/dist/sessions/relay-lane-record.js +28 -0
  374. package/dist/sessions/relay-lane-record.js.map +1 -0
  375. package/dist/sessions/relay-lane-stream.d.ts +13 -0
  376. package/dist/sessions/relay-lane-stream.d.ts.map +1 -0
  377. package/dist/sessions/relay-lane-stream.js +148 -0
  378. package/dist/sessions/relay-lane-stream.js.map +1 -0
  379. package/dist/sessions/relay-routes.d.ts +368 -0
  380. package/dist/sessions/relay-routes.d.ts.map +1 -0
  381. package/dist/sessions/relay-routes.js +46 -0
  382. package/dist/sessions/relay-routes.js.map +1 -0
  383. package/dist/sessions/relay-skeleton.d.ts +4 -0
  384. package/dist/sessions/relay-skeleton.d.ts.map +1 -0
  385. package/dist/sessions/relay-skeleton.js +85 -0
  386. package/dist/sessions/relay-skeleton.js.map +1 -0
  387. package/dist/sessions/relay-types.d.ts +107 -0
  388. package/dist/sessions/relay-types.d.ts.map +1 -0
  389. package/dist/sessions/relay-types.js +2 -0
  390. package/dist/sessions/relay-types.js.map +1 -0
  391. package/dist/sessions/relay-validate.d.ts +8 -0
  392. package/dist/sessions/relay-validate.d.ts.map +1 -0
  393. package/dist/sessions/relay-validate.js +169 -0
  394. package/dist/sessions/relay-validate.js.map +1 -0
  395. package/dist/sessions/relay-wire.d.ts +8 -0
  396. package/dist/sessions/relay-wire.d.ts.map +1 -0
  397. package/dist/sessions/relay-wire.js +37 -0
  398. package/dist/sessions/relay-wire.js.map +1 -0
  399. package/dist/sessions/relay-wiring.d.ts +26 -0
  400. package/dist/sessions/relay-wiring.d.ts.map +1 -0
  401. package/dist/sessions/relay-wiring.js +13 -0
  402. package/dist/sessions/relay-wiring.js.map +1 -0
  403. package/dist/sessions/relay.d.ts +11 -0
  404. package/dist/sessions/relay.d.ts.map +1 -0
  405. package/dist/sessions/relay.js +71 -0
  406. package/dist/sessions/relay.js.map +1 -0
  407. package/dist/storage/descriptor.d.ts +1 -1
  408. package/dist/storage/errors.d.ts +1 -1
  409. package/dist/storage/identity/atomic-deletion.d.ts +4 -0
  410. package/dist/storage/identity/atomic-deletion.d.ts.map +1 -0
  411. package/dist/storage/identity/atomic-deletion.js +235 -0
  412. package/dist/storage/identity/atomic-deletion.js.map +1 -0
  413. package/dist/storage/identity/custody-composition.d.ts +9 -0
  414. package/dist/storage/identity/custody-composition.d.ts.map +1 -0
  415. package/dist/storage/identity/custody-composition.js +31 -0
  416. package/dist/storage/identity/custody-composition.js.map +1 -0
  417. package/dist/storage/identity/custody-delivery-record.d.ts +4 -0
  418. package/dist/storage/identity/custody-delivery-record.d.ts.map +1 -0
  419. package/dist/storage/identity/custody-delivery-record.js +11 -0
  420. package/dist/storage/identity/custody-delivery-record.js.map +1 -0
  421. package/dist/storage/identity/custody-host.d.ts +16 -0
  422. package/dist/storage/identity/custody-host.d.ts.map +1 -0
  423. package/dist/storage/identity/custody-host.js +5 -0
  424. package/dist/storage/identity/custody-host.js.map +1 -0
  425. package/dist/storage/identity/custody-import-deliveries.d.ts +6 -0
  426. package/dist/storage/identity/custody-import-deliveries.d.ts.map +1 -0
  427. package/dist/storage/identity/custody-import-deliveries.js +46 -0
  428. package/dist/storage/identity/custody-import-deliveries.js.map +1 -0
  429. package/dist/storage/identity/custody-import.d.ts +4 -0
  430. package/dist/storage/identity/custody-import.d.ts.map +1 -0
  431. package/dist/storage/identity/custody-import.js +364 -0
  432. package/dist/storage/identity/custody-import.js.map +1 -0
  433. package/dist/storage/identity/custody-journal-postgres.d.ts +125 -0
  434. package/dist/storage/identity/custody-journal-postgres.d.ts.map +1 -0
  435. package/dist/storage/identity/custody-journal-postgres.js +428 -0
  436. package/dist/storage/identity/custody-journal-postgres.js.map +1 -0
  437. package/dist/storage/identity/custody-journal-sqlite.d.ts +121 -0
  438. package/dist/storage/identity/custody-journal-sqlite.d.ts.map +1 -0
  439. package/dist/storage/identity/custody-journal-sqlite.js +345 -0
  440. package/dist/storage/identity/custody-journal-sqlite.js.map +1 -0
  441. package/dist/storage/identity/custody-lifecycle.d.ts +4 -0
  442. package/dist/storage/identity/custody-lifecycle.d.ts.map +1 -0
  443. package/dist/storage/identity/custody-lifecycle.js +42 -0
  444. package/dist/storage/identity/custody-lifecycle.js.map +1 -0
  445. package/dist/storage/identity/custody-postgres.d.ts +96 -0
  446. package/dist/storage/identity/custody-postgres.d.ts.map +1 -0
  447. package/dist/storage/identity/custody-postgres.js +726 -0
  448. package/dist/storage/identity/custody-postgres.js.map +1 -0
  449. package/dist/storage/identity/custody-records.d.ts +17 -0
  450. package/dist/storage/identity/custody-records.d.ts.map +1 -0
  451. package/dist/storage/identity/custody-records.js +260 -0
  452. package/dist/storage/identity/custody-records.js.map +1 -0
  453. package/dist/storage/identity/custody-shared.d.ts +28 -0
  454. package/dist/storage/identity/custody-shared.d.ts.map +1 -0
  455. package/dist/storage/identity/custody-shared.js +24 -0
  456. package/dist/storage/identity/custody-shared.js.map +1 -0
  457. package/dist/storage/identity/custody-sqlite.d.ts +93 -0
  458. package/dist/storage/identity/custody-sqlite.d.ts.map +1 -0
  459. package/dist/storage/identity/custody-sqlite.js +568 -0
  460. package/dist/storage/identity/custody-sqlite.js.map +1 -0
  461. package/dist/storage/identity/custody-tombstone-record.d.ts +3 -0
  462. package/dist/storage/identity/custody-tombstone-record.d.ts.map +1 -0
  463. package/dist/storage/identity/custody-tombstone-record.js +8 -0
  464. package/dist/storage/identity/custody-tombstone-record.js.map +1 -0
  465. package/dist/storage/identity/custody-transaction-guards.d.ts +16 -0
  466. package/dist/storage/identity/custody-transaction-guards.d.ts.map +1 -0
  467. package/dist/storage/identity/custody-transaction-guards.js +64 -0
  468. package/dist/storage/identity/custody-transaction-guards.js.map +1 -0
  469. package/dist/storage/identity/custody-transaction-ports.d.ts +9 -0
  470. package/dist/storage/identity/custody-transaction-ports.d.ts.map +1 -0
  471. package/dist/storage/identity/custody-transaction-ports.js +106 -0
  472. package/dist/storage/identity/custody-transaction-ports.js.map +1 -0
  473. package/dist/storage/identity/deletion-planes.d.ts +10 -0
  474. package/dist/storage/identity/deletion-planes.d.ts.map +1 -0
  475. package/dist/storage/identity/deletion-planes.js +54 -0
  476. package/dist/storage/identity/deletion-planes.js.map +1 -0
  477. package/dist/storage/identity/index.d.ts +18 -0
  478. package/dist/storage/identity/index.d.ts.map +1 -0
  479. package/dist/storage/identity/index.js +22 -0
  480. package/dist/storage/identity/index.js.map +1 -0
  481. package/dist/storage/identity/postgres.d.ts +16 -0
  482. package/dist/storage/identity/postgres.d.ts.map +1 -0
  483. package/dist/storage/identity/postgres.js +345 -0
  484. package/dist/storage/identity/postgres.js.map +1 -0
  485. package/dist/storage/identity/records.d.ts +12 -0
  486. package/dist/storage/identity/records.d.ts.map +1 -0
  487. package/dist/storage/identity/records.js +84 -0
  488. package/dist/storage/identity/records.js.map +1 -0
  489. package/dist/storage/identity/replica-sync.d.ts +4 -0
  490. package/dist/storage/identity/replica-sync.d.ts.map +1 -0
  491. package/dist/storage/identity/replica-sync.js +402 -0
  492. package/dist/storage/identity/replica-sync.js.map +1 -0
  493. package/dist/storage/identity/schema.d.ts +13 -0
  494. package/dist/storage/identity/schema.d.ts.map +1 -0
  495. package/dist/storage/identity/schema.js +418 -0
  496. package/dist/storage/identity/schema.js.map +1 -0
  497. package/dist/storage/identity/sqlite-schema.d.ts +4 -0
  498. package/dist/storage/identity/sqlite-schema.d.ts.map +1 -0
  499. package/dist/storage/identity/sqlite-schema.js +17 -0
  500. package/dist/storage/identity/sqlite-schema.js.map +1 -0
  501. package/dist/storage/identity/sqlite.d.ts +25 -0
  502. package/dist/storage/identity/sqlite.d.ts.map +1 -0
  503. package/dist/storage/identity/sqlite.js +233 -0
  504. package/dist/storage/identity/sqlite.js.map +1 -0
  505. package/dist/storage/identity/stores.d.ts +10 -0
  506. package/dist/storage/identity/stores.d.ts.map +1 -0
  507. package/dist/storage/identity/stores.js +5 -0
  508. package/dist/storage/identity/stores.js.map +1 -0
  509. package/dist/storage/identity/wiring.d.ts +20 -0
  510. package/dist/storage/identity/wiring.d.ts.map +1 -0
  511. package/dist/storage/identity/wiring.js +26 -0
  512. package/dist/storage/identity/wiring.js.map +1 -0
  513. package/dist/storage/identity/workspace-deletion.d.ts +3 -0
  514. package/dist/storage/identity/workspace-deletion.d.ts.map +1 -0
  515. package/dist/storage/identity/workspace-deletion.js +100 -0
  516. package/dist/storage/identity/workspace-deletion.js.map +1 -0
  517. package/dist/storage/postgres/journal.d.ts +1 -1
  518. package/dist/storage/postgres/profiles.d.ts +2 -2
  519. package/dist/storage/postgres/scope.d.ts +1 -1
  520. package/dist/storage/root-facade.d.ts +1 -1
  521. package/dist/storage/root-journal.d.ts +1 -1
  522. package/dist/storage/root-profiles.d.ts +1 -1
  523. package/package.json +56 -4
  524. package/ui/AdminUsersScreen.svelte +197 -0
  525. package/ui/AdminUsersScreen.svelte.d.ts +4 -0
  526. package/ui/LoginScreen.svelte +15 -0
  527. package/ui/LoginScreen.svelte.d.ts +4 -0
  528. package/ui/MembershipDecisionsScreen.svelte +76 -0
  529. package/ui/MembershipDecisionsScreen.svelte.d.ts +4 -0
  530. package/ui/RegistrationScreen.svelte +15 -0
  531. package/ui/RegistrationScreen.svelte.d.ts +4 -0
  532. package/ui/WorkspaceMembersScreen.svelte +86 -0
  533. package/ui/WorkspaceMembersScreen.svelte.d.ts +4 -0
  534. package/ui/auth-flow.ts +44 -0
  535. package/ui/management-ports.ts +36 -0
  536. package/ui/management-transport.ts +29 -0
  537. package/contracts/engram-memory-neutral-contract-v1.d.ts +0 -367
@@ -0,0 +1,74 @@
1
+ // CHAIN-BIND reference evaluators (RC2.contract r3, vectors/state-transitions.json
2
+ // family CHAIN-BIND) plus the pinned inner-TLS bind context. Pure functions.
3
+ import { createHash } from 'node:crypto';
4
+ import { jcsCanonicalize } from './relay-wire.js';
5
+ export const RELAY_INNER_ALPN = 'cluster-mesh.session-relay.inner.v1';
6
+ export const RELAY_TLS_EXPORTER_LABEL = 'EXPORTER-cluster-mesh-session-relay-v1';
7
+ export const RELAY_TLS_EXPORTER_BYTES = 32;
8
+ export const RELAY_BIND_MIN_BYTES = 1;
9
+ export const RELAY_BIND_MAX_BYTES = 8192;
10
+ // bindGuard: the inner TLS leg is accepted only with the pinned ALPN, matching
11
+ // SPKI pins and installation role, a valid Bind signature, the exporter-derived
12
+ // context, matching circuit coordinates, no early HTTP/2, no second Bind, strict
13
+ // UTF-8, JCS encoding, no duplicate or unknown keys, and a 4-byte-length-prefixed
14
+ // body of 1..8192 bytes whose declared length equals the actual body length.
15
+ export function chainBindGuard(input) {
16
+ if (input.alpn !== RELAY_INNER_ALPN)
17
+ return 'close-before-handler';
18
+ if (!input.spkiMatches || !input.signerRoleMatches || !input.signatureValid)
19
+ return 'close-before-handler';
20
+ if (!input.exporterMatches || !input.coordinatesMatch)
21
+ return 'close-before-handler';
22
+ if (input.earlyHttp2 || input.secondBind)
23
+ return 'close-before-handler';
24
+ if (!input.strictUtf8 || !input.jcs || input.duplicateKeys || input.unknownKeys)
25
+ return 'close-before-handler';
26
+ if (input.length < RELAY_BIND_MIN_BYTES || input.length > RELAY_BIND_MAX_BYTES)
27
+ return 'close-before-handler';
28
+ if (input.length !== input.bodyLength)
29
+ return 'close-before-handler';
30
+ return 'allow-model';
31
+ }
32
+ export const RELAY_BIND_SERVER_CONSTRUCTION = 'non-listening-tls-createServer-emit-connection-secureConnection';
33
+ export const RELAY_BIND_CLIENT_CONSTRUCTION = 'tls-connect-over-circuit-then-h2-createConnection-same-socket';
34
+ // Canonical event order for the exact Node construction: Opened, inner TLS
35
+ // handshake (tls-complete), exporter derivation, Bind read+verify, B writes
36
+ // Bind, drains, receives Bound, hands the same socket to HTTP/2; then the
37
+ // mirror image on A, first handler, clean end.
38
+ export const RELAY_BIND_EVENT_ORDER = [
39
+ 'opened', 'tls-complete', 'exporter', 'bind-read-verified',
40
+ 'B-bind-write-callback', 'B-bind-drain', 'bound-received', 'B-h2-handoff',
41
+ 'A-bound-write-callback', 'A-bound-drain', 'A-h2-handoff',
42
+ 'first-handler', 'response-clean-end',
43
+ ];
44
+ // socketConstruction: only the exact Node construction is accepted —
45
+ // tls.connect({socket}) on the client, a non-listening tls.createServer that
46
+ // emits "connection" on the server, then http2.connect/h2Server.emit("connection")
47
+ // over the same bound socket, 32-byte exporter context, no second TLS layer, no
48
+ // session resumption, and the canonical event order.
49
+ export function chainSocketConstruction(input) {
50
+ if (input.serverConstruction !== RELAY_BIND_SERVER_CONSTRUCTION)
51
+ return 'close-before-handler';
52
+ if (input.clientConstruction !== RELAY_BIND_CLIENT_CONSTRUCTION)
53
+ return 'close-before-handler';
54
+ if (input.alpn !== RELAY_INNER_ALPN)
55
+ return 'close-before-handler';
56
+ if (input.contextBytes !== RELAY_TLS_EXPORTER_BYTES)
57
+ return 'close-before-handler';
58
+ if (input.secondTls || input.sessionReused)
59
+ return 'close-before-handler';
60
+ if (input.events.length !== RELAY_BIND_EVENT_ORDER.length)
61
+ return 'close-before-handler';
62
+ for (let i = 0; i < RELAY_BIND_EVENT_ORDER.length; i += 1) {
63
+ if (input.events[i] !== RELAY_BIND_EVENT_ORDER[i])
64
+ return 'close-before-handler';
65
+ }
66
+ return 'allow-model';
67
+ }
68
+ // Bind context: raw SHA-256 (32 bytes) of the JCS-canonicalized Bind body minus
69
+ // the tlsExporter / issuer / kid fields.
70
+ export function relayBindContextSha256(bindBody) {
71
+ const { tlsExporter: _tlsExporter, issuer: _issuer, kid: _kid, ...rest } = bindBody;
72
+ return new Uint8Array(createHash('sha256').update(jcsCanonicalize(rest), 'utf8').digest());
73
+ }
74
+ //# sourceMappingURL=relay-bind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-bind.js","sourceRoot":"","sources":["../../src/sessions/relay-bind.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,qCAAqC,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GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;IACpF,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SESSION_RELAY_LANE_CLIENT_BRAND: unique symbol;
2
+ //# sourceMappingURL=relay-brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-brand.d.ts","sourceRoot":"","sources":["../../src/sessions/relay-brand.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,+BAA+B,EAAE,OAAO,MAAqD,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Runtime brand for SessionRelayLaneClientV1. This module is deliberately NOT
2
+ // re-exported from the packed entry point (src/sessions/relay.ts): consumers of
3
+ // the packed package can check a client with isSessionRelayLaneClient but can
4
+ // never mint one — a clientRef string or deserialized JSON never carries the
5
+ // symbol. Only trusted host composition inside mesh creates branded clients.
6
+ export const SESSION_RELAY_LANE_CLIENT_BRAND = Symbol('sentropic:SessionRelayLaneClientV1');
7
+ //# sourceMappingURL=relay-brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-brand.js","sourceRoot":"","sources":["../../src/sessions/relay-brand.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,+BAA+B,GAAkB,MAAM,CAAC,oCAAoC,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ export declare const RELAY_CAPSULE_NODE_PINS: {
2
+ readonly 'v22.22.1': {
3
+ readonly checksFile: "checks/node-22.22.1.json";
4
+ readonly sha256: "cbaa3f54562b644a149e0fa35561680ade4d8c98da57c7ba48b47bd4968f90ae";
5
+ };
6
+ readonly 'v24.18.0': {
7
+ readonly checksFile: "checks/node-24.18.0.json";
8
+ readonly sha256: "631545808bac67c980166ee86ca949de9e0b1e8472346122fbc8e6d2052ca7f1";
9
+ };
10
+ };
11
+ export type RelayCapsuleNodePin = (typeof RELAY_CAPSULE_NODE_PINS)[keyof typeof RELAY_CAPSULE_NODE_PINS];
12
+ export interface CapsuleRuntimePin {
13
+ readonly node: string;
14
+ readonly openssl: string;
15
+ readonly pinned: boolean;
16
+ readonly checksSha256: string | null;
17
+ }
18
+ export declare function capsuleRuntimePin(): CapsuleRuntimePin;
19
+ export declare const RELAY_INNER_TLS_CLIENT_PIN: {
20
+ readonly ALPNProtocols: readonly ["cluster-mesh.session-relay.inner.v1"];
21
+ readonly minVersion: "TLSv1.3";
22
+ readonly maxVersion: "TLSv1.3";
23
+ readonly maxEarlyDataSize: 0;
24
+ readonly rejectUnauthorized: true;
25
+ };
26
+ export declare const RELAY_INNER_TLS_SERVER_PIN: {
27
+ readonly ALPNProtocols: readonly ["cluster-mesh.session-relay.inner.v1"];
28
+ readonly minVersion: "TLSv1.3";
29
+ readonly maxVersion: "TLSv1.3";
30
+ readonly sessionTickets: false;
31
+ };
32
+ export declare const RELAY_INNER_H2_CLIENT_SETTINGS_PIN: {
33
+ readonly enablePush: false;
34
+ readonly enableConnectProtocol: false;
35
+ readonly maxConcurrentStreams: 8;
36
+ readonly maxHeaderListSize: 8192;
37
+ };
38
+ export declare const RELAY_CAPSULE_LIMITS: {
39
+ readonly alpn: "cluster-mesh.session-relay.inner.v1";
40
+ readonly tlsExporterLabel: "EXPORTER-cluster-mesh-session-relay-v1";
41
+ readonly tlsExporterContextBytes: 32;
42
+ readonly queueMaxEvents: 8;
43
+ readonly queueMaxEncodedBytes: 131072;
44
+ readonly dataMaxEncoded: 24576;
45
+ readonly dataMaxDecoded: 16384;
46
+ readonly recordMaxBytes: 8192;
47
+ readonly bindMinBytes: 1;
48
+ readonly bindMaxBytes: 8192;
49
+ };
50
+ //# sourceMappingURL=relay-capsule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-capsule.d.ts","sourceRoot":"","sources":["../../src/sessions/relay-capsule.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,uBAAuB;;;;;;;;;CAS1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAID,wBAAgB,iBAAiB,IAAI,iBAAiB,CASrD;AAOD,eAAO,MAAM,0BAA0B;;;;;;CAM7B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AAGX,eAAO,MAAM,kCAAkC;;;;;CAKrC,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;;;;;;;;;CAWvB,CAAC"}
@@ -0,0 +1,72 @@
1
+ // L-5 capsule runtime pins — PACKED (re-exported from ./sessions/relay): h2a
2
+ // needs them for the capsule lock and for node-socket-constructions vector
3
+ // parity; h2a constructs no TLS itself. CHAIN-BIND receipts exist for Node
4
+ // v22.22.1 / v24.18.0 (checks/*.json, sha256 pinned below from RC2.contract r3,
5
+ // MANIFEST.sha256 6245d3ae…). The capsule runtime is NAMED at runtime
6
+ // (capsuleRuntimePin) so h2a can assert host parity when it differs.
7
+ // TLS 1.3 only, no 0-RTT, no resumption; HTTP/2 client SETTINGS pinned.
8
+ import { RELAY_BIND_MAX_BYTES, RELAY_BIND_MIN_BYTES, RELAY_INNER_ALPN, RELAY_TLS_EXPORTER_BYTES, RELAY_TLS_EXPORTER_LABEL, } from './relay-bind.js';
9
+ import { RELAY_LINK_MAX_FRAMES, RELAY_LINK_MAX_PAYLOAD_BYTES } from './relay-credit.js';
10
+ import { RELAY_DATA_MAX_DECODED, RELAY_DATA_MAX_ENCODED } from './relay-frames.js';
11
+ import { RELAY_RECORD_MAX_BYTES } from './relay-wire.js';
12
+ export const RELAY_CAPSULE_NODE_PINS = {
13
+ 'v22.22.1': {
14
+ checksFile: 'checks/node-22.22.1.json',
15
+ sha256: 'cbaa3f54562b644a149e0fa35561680ade4d8c98da57c7ba48b47bd4968f90ae',
16
+ },
17
+ 'v24.18.0': {
18
+ checksFile: 'checks/node-24.18.0.json',
19
+ sha256: '631545808bac67c980166ee86ca949de9e0b1e8472346122fbc8e6d2052ca7f1',
20
+ },
21
+ };
22
+ // Name the capsule runtime so h2a can assert host parity; pinned=true only for
23
+ // the receipt-backed Node versions above.
24
+ export function capsuleRuntimePin() {
25
+ const node = process.version;
26
+ const pin = RELAY_CAPSULE_NODE_PINS[node];
27
+ return {
28
+ node,
29
+ openssl: process.versions.openssl,
30
+ pinned: Boolean(pin),
31
+ checksSha256: pin?.sha256 ?? null,
32
+ };
33
+ }
34
+ // Exact pinned TLS option objects for the inner lane connection. TLS 1.3 only
35
+ // (min=max), ALPN exactly the inner label; no 0-RTT (maxEarlyDataSize: 0); no
36
+ // resumption — the client never supplies/caches a session and the server runs
37
+ // a no-ticket context (isSessionReused() must stay false, see the
38
+ // socketConstruction vector).
39
+ export const RELAY_INNER_TLS_CLIENT_PIN = {
40
+ ALPNProtocols: [RELAY_INNER_ALPN],
41
+ minVersion: 'TLSv1.3',
42
+ maxVersion: 'TLSv1.3',
43
+ maxEarlyDataSize: 0,
44
+ rejectUnauthorized: true,
45
+ };
46
+ export const RELAY_INNER_TLS_SERVER_PIN = {
47
+ ALPNProtocols: [RELAY_INNER_ALPN],
48
+ minVersion: 'TLSv1.3',
49
+ maxVersion: 'TLSv1.3',
50
+ sessionTickets: false,
51
+ };
52
+ // Exact pinned HTTP/2 client SETTINGS for the inner lane stream.
53
+ export const RELAY_INNER_H2_CLIENT_SETTINGS_PIN = {
54
+ enablePush: false,
55
+ enableConnectProtocol: false,
56
+ maxConcurrentStreams: 8,
57
+ maxHeaderListSize: 8192,
58
+ };
59
+ // Aggregate of every frozen numeric/label cap the capsule lock joins.
60
+ export const RELAY_CAPSULE_LIMITS = {
61
+ alpn: RELAY_INNER_ALPN,
62
+ tlsExporterLabel: RELAY_TLS_EXPORTER_LABEL,
63
+ tlsExporterContextBytes: RELAY_TLS_EXPORTER_BYTES,
64
+ queueMaxEvents: RELAY_LINK_MAX_FRAMES,
65
+ queueMaxEncodedBytes: RELAY_LINK_MAX_PAYLOAD_BYTES,
66
+ dataMaxEncoded: RELAY_DATA_MAX_ENCODED,
67
+ dataMaxDecoded: RELAY_DATA_MAX_DECODED,
68
+ recordMaxBytes: RELAY_RECORD_MAX_BYTES,
69
+ bindMinBytes: RELAY_BIND_MIN_BYTES,
70
+ bindMaxBytes: RELAY_BIND_MAX_BYTES,
71
+ };
72
+ //# sourceMappingURL=relay-capsule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-capsule.js","sourceRoot":"","sources":["../../src/sessions/relay-capsule.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,gFAAgF;AAChF,sEAAsE;AACtE,qEAAqE;AACrE,wEAAwE;AACxE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU,EAAE;QACV,UAAU,EAAE,0BAA0B;QACtC,MAAM,EAAE,kEAAkE;KAC3E;IACD,UAAU,EAAE;QACV,UAAU,E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Ac,EAAE,sBAAsB;IACtC,cAAc,EAAE,sBAAsB;IACtC,YAAY,EAAE,oBAAoB;IAClC,YAAY,EAAE,oBAAoB;CAC1B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { RelayErrorCode } from './registry-types.js';
2
+ import type { RelayRecord } from './relay-chain.js';
3
+ export type ChainFailureDecision = RelayErrorCode | 'paired-close-floor-preserved-model' | 'failure-propagation-refused';
4
+ export interface PairFailureInput {
5
+ readonly before: {
6
+ readonly consumedGeneration: number;
7
+ readonly unrelatedCircuit: string;
8
+ readonly upstream: RelayRecord;
9
+ readonly downstream: RelayRecord;
10
+ };
11
+ readonly after: {
12
+ readonly upstream: string;
13
+ readonly downstream: string;
14
+ readonly upstreamClose: RelayRecord;
15
+ readonly downstreamClose: RelayRecord;
16
+ readonly volatileBytes: number;
17
+ readonly tlsResumable: boolean;
18
+ readonly endpointSuccess: boolean;
19
+ readonly consumedGeneration: number;
20
+ readonly unrelatedCircuit: string;
21
+ };
22
+ readonly cause: string;
23
+ }
24
+ export declare function chainPairFailure(input: PairFailureInput): ChainFailureDecision;
25
+ //# sourceMappingURL=relay-chain-failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-chain-failure.d.ts","sourceRoot":"","sources":["../../src/sessions/relay-chain-failure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,oCAAoC,GAAG,6BAA6B,CAAC;AAEzH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAA;KAAE,CAAC;IAC9J,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC;QACpC,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC;QACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;QAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;QACpC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAID,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,oBAAoB,CAW9E"}
@@ -0,0 +1,23 @@
1
+ // pairFailure: on failure both legs close with a Close on their own tunnel/generation;
2
+ // no volatile bytes, TLS resumption, false success, floor rollback, unrelated closes.
3
+ export function chainPairFailure(input) {
4
+ const { before, after } = input;
5
+ if (after.upstream !== 'closed' || after.downstream !== 'closed')
6
+ return 'failure-propagation-refused';
7
+ if (after.upstreamClose.tunnelId !== before.upstream.tunnelId || after.upstreamClose.linkGeneration !== before.upstream.linkGeneration)
8
+ return 'failure-propagation-refused';
9
+ if (after.downstreamClose.tunnelId !== before.downstream.tunnelId || after.downstreamClose.linkGeneration !== before.downstream.linkGeneration)
10
+ return 'failure-propagation-refused';
11
+ if (after.volatileBytes !== 0)
12
+ return 'failure-propagation-refused';
13
+ if (after.tlsResumable)
14
+ return 'failure-propagation-refused';
15
+ if (after.endpointSuccess)
16
+ return 'failure-propagation-refused';
17
+ if (after.consumedGeneration !== before.consumedGeneration)
18
+ return 'failure-propagation-refused';
19
+ if (after.unrelatedCircuit !== before.unrelatedCircuit)
20
+ return 'failure-propagation-refused';
21
+ return 'paired-close-floor-preserved-model';
22
+ }
23
+ //# sourceMappingURL=relay-chain-failure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-chain-failure.js","sourceRoot":"","sources":["../../src/sessions/relay-chain-failure.ts"],"names":[],"mappings":"AAsBA,uFAAuF;AACvF,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,KAAuB;IACtD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAChC,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ;QAAE,OAAO,6BAA6B,CAAC;IACvG,IAAI,KAAK,CAAC,aAAa,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,KAAK,CAAC,aAAa,CAAC,cAAc,KAAK,MAAM,CAAC,QAAQ,CAAC,cAAc;QAAE,OAAO,6BAA6B,CAAC;IAC7K,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ,KAAK,MAAM,CAAC,UAAU,CAAC,QAAQ,IAAI,KAAK,CAAC,eAAe,CAAC,cAAc,KAAK,MAAM,CAAC,UAAU,CAAC,cAAc;QAAE,OAAO,6BAA6B,CAAC;IACrL,IAAI,KAAK,CAAC,aAAa,KAAK,CAAC;QAAE,OAAO,6BAA6B,CAAC;IACpE,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,6BAA6B,CAAC;IAC7D,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,6BAA6B,CAAC;IAChE,IAAI,KAAK,CAAC,kBAAkB,KAAK,MAAM,CAAC,kBAAkB;QAAE,OAAO,6BAA6B,CAAC;IACjG,IAAI,KAAK,CAAC,gBAAgB,KAAK,MAAM,CAAC,gBAAgB;QAAE,OAAO,6BAA6B,CAAC;IAC7F,OAAO,oCAAoC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,74 @@
1
+ import type { RelayErrorCode } from './registry-types.js';
2
+ export type ChainDecision = 'allow' | RelayErrorCode | 'paired-opened-model' | 'paired-awaiting-downstream' | 'paired-close-floor-preserved-model' | 'failure-propagation-refused';
3
+ export interface PathCheckInput {
4
+ readonly path: readonly string[];
5
+ readonly hopIndex: number;
6
+ readonly visited: readonly string[];
7
+ readonly sender: string;
8
+ readonly receiver: string;
9
+ readonly approved: boolean;
10
+ readonly distributed: boolean;
11
+ readonly revocationCaughtUp: boolean;
12
+ readonly reservationConsumed: boolean;
13
+ readonly competingPair: boolean;
14
+ }
15
+ export declare const RELAY_MAX_LINKS = 3;
16
+ export declare function chainPathCheck(input: PathCheckInput): ChainDecision;
17
+ export interface FrameCheckInput {
18
+ readonly frame: {
19
+ readonly kind?: string;
20
+ } & Record<string, unknown>;
21
+ readonly state: {
22
+ readonly opened?: boolean;
23
+ } & Record<string, unknown>;
24
+ }
25
+ export declare function chainFrameCheck(input: FrameCheckInput): ChainDecision;
26
+ export interface RelayRecord extends Record<string, unknown> {
27
+ readonly format?: string;
28
+ readonly kind?: string;
29
+ readonly tunnelId?: string;
30
+ readonly linkGeneration?: number;
31
+ readonly hopIndex?: number;
32
+ readonly visitedInstanceIds?: readonly string[];
33
+ readonly adjacentGrantRef?: unknown;
34
+ readonly peerProofRef?: unknown;
35
+ }
36
+ interface PreparedRecord {
37
+ readonly path: readonly string[];
38
+ readonly circuitId: string;
39
+ readonly lane: string;
40
+ readonly upstream: {
41
+ readonly tunnelId: string;
42
+ readonly linkGeneration: number;
43
+ readonly grantRef: unknown;
44
+ readonly peerProofRef: unknown;
45
+ };
46
+ readonly downstream: {
47
+ readonly tunnelId: string;
48
+ readonly linkGeneration: number;
49
+ readonly grantRef: unknown;
50
+ readonly peerProofRef: unknown;
51
+ };
52
+ readonly descriptorDigest: string;
53
+ readonly preparationId: string;
54
+ readonly routeId: string;
55
+ readonly routeRevision: number;
56
+ readonly routeGeneration: number;
57
+ readonly sessionRef: unknown;
58
+ readonly endpointAdmissionRefs: unknown;
59
+ }
60
+ export interface OpenPairInput {
61
+ readonly preparedCoordinatesVerified: boolean;
62
+ readonly reservationUnused: boolean;
63
+ readonly competingPair: boolean;
64
+ readonly incoming: RelayRecord;
65
+ readonly outgoing: RelayRecord;
66
+ readonly prepared: PreparedRecord;
67
+ readonly downstreamReady: boolean;
68
+ readonly upstreamReady: boolean;
69
+ readonly downstreamOpened: RelayRecord | null;
70
+ readonly upstreamOpened: RelayRecord | null;
71
+ }
72
+ export declare function chainOpenPair(input: OpenPairInput): ChainDecision;
73
+ export {};
74
+ //# sourceMappingURL=relay-chain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-chain.d.ts","sourceRoot":"","sources":["../../src/sessions/relay-chain.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,cAAc,GAAG,qBAAqB,GAAG,4BAA4B,GAAG,oCAAoC,GAAG,6BAA6B,CAAC;AAEnL,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAGD,eAAO,MAAM,eAAe,IAAI,CAAC;AAKjC,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CASnE;AAED,MAAM,WAA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// the adjacent nodes; no repeated instance (loop); ≤ RELAY_MAX_LINKS links; approved
5
+ // and fully distributed (else scope); consumed reservation / competing pair = stale.
6
+ export function chainPathCheck(input) {
7
+ const { path, hopIndex, visited, sender, receiver } = input;
8
+ if (visited.length !== hopIndex + 1 || !visited.every((v, i) => v === path[i]))
9
+ return 'relay_route_conflict';
10
+ if (sender !== path[hopIndex] || receiver !== path[hopIndex + 1])
11
+ return 'relay_route_conflict';
12
+ if (new Set(path).size !== path.length || visited.includes(receiver))
13
+ return 'relay_loop';
14
+ if (path.length - 1 > RELAY_MAX_LINKS)
15
+ return 'relay_hop_limit';
16
+ if (!input.approved || !input.distributed)
17
+ return 'relay_scope_refused';
18
+ if (input.reservationConsumed || input.competingPair)
19
+ return 'relay_stale_generation';
20
+ return 'allow';
21
+ }
22
+ // frameCheck: no Data (or Credit) before Opened on the link.
23
+ export function chainFrameCheck(input) {
24
+ if ((input.frame.kind === 'data' || input.frame.kind === 'credit') && input.state.opened === false) {
25
+ return 'relay_protocol_refused';
26
+ }
27
+ return 'allow';
28
+ }
29
+ const eq = (a, b) => JSON.stringify(a) === JSON.stringify(b);
30
+ // openPair: only tunnelId, linkGeneration, hopIndex, visitedInstanceIds,
31
+ // adjacentGrantRef and peerProofRef change on the downstream leg. A foreign
32
+ // adjacent grant is a scope refusal; other mismatches are route conflicts; an
33
+ // upstream Opened before the downstream leg is ready is a protocol violation.
34
+ export function chainOpenPair(input) {
35
+ if (input.competingPair || !input.reservationUnused)
36
+ return 'relay_stale_generation';
37
+ const { incoming, outgoing, prepared } = input;
38
+ const shared = ['descriptorDigest', 'preparationId', 'routeId', 'routeRevision', 'routeGeneration', 'sessionRef', 'circuitId', 'lane', 'endpointAdmissionRefs'];
39
+ for (const key of shared) {
40
+ if (!eq(incoming[key], prepared[key]))
41
+ return 'relay_route_conflict';
42
+ }
43
+ if (!eq(incoming.adjacentGrantRef, prepared.upstream.grantRef) || !eq(incoming.peerProofRef, prepared.upstream.peerProofRef)) {
44
+ return 'relay_scope_refused';
45
+ }
46
+ if (!eq(outgoing.adjacentGrantRef, prepared.downstream.grantRef))
47
+ return 'relay_scope_refused';
48
+ const expected = {
49
+ ...incoming,
50
+ tunnelId: prepared.downstream.tunnelId,
51
+ linkGeneration: prepared.downstream.linkGeneration,
52
+ hopIndex: (incoming.hopIndex ?? 0) + 1,
53
+ visitedInstanceIds: [...(incoming.visitedInstanceIds ?? []), prepared.path[(incoming.hopIndex ?? 0) + 1]],
54
+ adjacentGrantRef: prepared.downstream.grantRef,
55
+ peerProofRef: prepared.downstream.peerProofRef,
56
+ };
57
+ for (const key of Object.keys(expected)) {
58
+ if (!eq(outgoing[key], expected[key]))
59
+ return 'relay_route_conflict';
60
+ }
61
+ if (input.upstreamOpened && input.upstreamReady && !input.downstreamReady)
62
+ return 'relay_protocol_refused';
63
+ if (input.upstreamOpened && input.upstreamOpened.tunnelId !== incoming.tunnelId)
64
+ return 'relay_route_conflict';
65
+ if (input.downstreamOpened && input.downstreamOpened.tunnelId !== outgoing.tunnelId)
66
+ return 'relay_route_conflict';
67
+ if (input.upstreamReady && input.downstreamReady && input.upstreamOpened && input.downstreamOpened)
68
+ return 'paired-opened-model';
69
+ return 'paired-awaiting-downstream';
70
+ }
71
+ //# sourceMappingURL=relay-chain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-chain.js","sourceRoot":"","sources":["../../src/sessions/relay-chain.ts"],"names":[],"mappings":"AAmBA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC,qFAAqF;AACrF,qFAAqF;AACrF,qFAAqF;AACrF,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC5D,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAA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AAC,GAAG,CAAC,CAAC,CAAC;QACzG,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ;QAC9C,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY;KAC/C,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,sBAAsB,CAAC;IACvE,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,eAAe;QAAE,OAAO,wBAAwB,CAAC;IAC3G,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;QAAE,OAAO,sBAAsB,CAAC;IAC/G,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,gBAAgB,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;QAAE,OAAO,sBAAsB,CAAC;IACnH,IAAI,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO,qBAAqB,CAAC;IACjI,OAAO,4BAA4B,CAAC;AACtC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SessionRelayHostCompositionV1 } from './relay-types.js';
2
+ /** Keys trusted host composition may supply (exhaustive, exact-key checked). */
3
+ export declare const SESSION_RELAY_HOST_COMPOSITION_KEYS: readonly string[];
4
+ /** What stays inside mesh — never a host argument (see relay-wiring, internal). */
5
+ export declare const SESSION_RELAY_MESH_INTERNAL: readonly string[];
6
+ export declare function validateHostComposition(composition: unknown): string | null;
7
+ export declare function hostSuppliedComposition(composition: SessionRelayHostCompositionV1): SessionRelayHostCompositionV1;
8
+ //# sourceMappingURL=relay-composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-composition.d.ts","sourceRoot":"","sources":["../../src/sessions/relay-composition.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEtE,gFAAgF;AAChF,eAAO,MAAM,mCAAmC,EAAE,SAAS,MAAM,EAIhE,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAaxD,CAAC;AAKF,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA2B3E;AAKD,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,6BAA6B,GAAG,6BAA6B,CAMjH"}
@@ -0,0 +1,65 @@
1
+ /** Keys trusted host composition may supply (exhaustive, exact-key checked). */
2
+ export const SESSION_RELAY_HOST_COMPOSITION_KEYS = [
3
+ 'processBindingRef',
4
+ 'sourceCredentials',
5
+ 'now',
6
+ ];
7
+ /** What stays inside mesh — never a host argument (see relay-wiring, internal). */
8
+ export const SESSION_RELAY_MESH_INTERNAL = [
9
+ 'endpointRegistry',
10
+ 'installationSigner',
11
+ 'workloadSigner',
12
+ 'grantResolver',
13
+ 'tlsPins',
14
+ 'spkiPins',
15
+ 'socketFactory',
16
+ 'http2Factory',
17
+ 'url',
18
+ 'wirePrefix',
19
+ 'adjacentGrantRef',
20
+ 'endpointAdmissionRefs',
21
+ ];
22
+ // validateHostComposition returns a defect string or null. Shape defects are
23
+ // reported to the port, which converts them to TypeError (invalid JS API use),
24
+ // never to a typed relay refusal.
25
+ export function validateHostComposition(composition) {
26
+ if (typeof composition !== 'object' || composition === null || Array.isArray(composition)) {
27
+ return 'composition must be a single named object';
28
+ }
29
+ const keys = Object.keys(composition);
30
+ for (const key of keys) {
31
+ if (!SESSION_RELAY_HOST_COMPOSITION_KEYS.includes(key)) {
32
+ return `unlisted composition key: ${key}`;
33
+ }
34
+ }
35
+ for (const key of SESSION_RELAY_HOST_COMPOSITION_KEYS) {
36
+ if (!keys.includes(key))
37
+ return `missing composition key: ${key}`;
38
+ }
39
+ const c = composition;
40
+ const pbr = c.processBindingRef;
41
+ if (typeof pbr !== 'object' || pbr === null
42
+ || typeof pbr.id !== 'string'
43
+ || typeof pbr.revision !== 'number'
44
+ || typeof pbr.digest !== 'string') {
45
+ return 'processBindingRef must be { id: string, revision: number, digest: string }';
46
+ }
47
+ const sc = c.sourceCredentials;
48
+ if (typeof sc !== 'object' || sc === null || typeof sc.resolve !== 'function') {
49
+ return 'sourceCredentials must be an immutable provider with resolve()';
50
+ }
51
+ if (typeof c.now !== 'function')
52
+ return 'now must be a function';
53
+ return null;
54
+ }
55
+ // splitComposition: the host-supplied half of a connect call. The mesh-internal
56
+ // half is only ever obtained from the registered wiring seam (relay-wiring),
57
+ // never from the caller.
58
+ export function hostSuppliedComposition(composition) {
59
+ return {
60
+ processBindingRef: composition.processBindingRef,
61
+ sourceCredentials: composition.sourceCredentials,
62
+ now: composition.now,
63
+ };
64
+ }
65
+ //# sourceMappingURL=relay-composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-composition.js","sourceRoot":"","sources":["../../src/sessions/relay-composition.ts"],"names":[],"mappings":"AAQA,gFAAgF;AAChF,MAAM,CAAC,MAAM,mCAAmC,GAAsB;IACpE,mBAAmB;IACnB,mBAAmB;IACnB,KAAK;CACN,CAAC;AAEF,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAsB;IAC5D,kBAAkB;IAClB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,UAAU;IACV,eAAe;IACf,cAAc;IACd,KAAK;IACL,YAAY;IACZ,kBAAkB;IAClB,uBAAuB;CACxB,CAAC;AAEF,6EAA6E;AAC7E,+EAA+E;AAC/E,kCAAkC;AAClC,MAAM,UAAU,uBAAuB,CAAC,WAAoB;IAC1D,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,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BAAuB,CAAC,WAA0C;IAChF,OAAO;QACL,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;QAChD,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;QAChD,GAAG,EAAE,WAAW,CAAC,GAAG;KACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,40 @@
1
+ import type { RelayErrorCode } from './registry-types.js';
2
+ export type FrameDecision = 'allow' | RelayErrorCode | 'duplicate-no-grant';
3
+ export type TransferDecision = 'independent-credit-and-transfer-model' | 'premature-uncharge' | 'frame-map-required' | 'reservation-accounting-refused' | RelayErrorCode;
4
+ export declare const RELAY_LINK_MAX_FRAMES = 8;
5
+ export declare const RELAY_LINK_MAX_PAYLOAD_BYTES = 131072;
6
+ export interface CreditFrame {
7
+ readonly circuitId: string;
8
+ readonly tunnelId: string;
9
+ readonly lane: string;
10
+ readonly direction: string;
11
+ readonly linkGeneration: number;
12
+ readonly creditRevision: number;
13
+ readonly receivedThroughFrame: number;
14
+ readonly receivedThroughOffset: number;
15
+ readonly sendLimitFrame: number;
16
+ readonly sendLimitOffset: number;
17
+ }
18
+ export interface CreditState extends CreditFrame {
19
+ readonly lastCredit: CreditFrame | null;
20
+ readonly frameEnds: readonly (readonly [number, number])[];
21
+ readonly opened: boolean;
22
+ }
23
+ export declare function chainCreditCheck(credit: CreditFrame, state: CreditState): FrameDecision;
24
+ export interface CreditTransferInput {
25
+ readonly upstream: CreditFrame;
26
+ readonly downstream: CreditFrame;
27
+ readonly queueBefore: number;
28
+ readonly reservedBefore: number;
29
+ readonly queueAfter: number;
30
+ readonly reservedAfter: number;
31
+ readonly totalBefore: number;
32
+ readonly totalAfter: number;
33
+ readonly upstreamNewCapacity: number;
34
+ readonly downstreamReceiptValidated: boolean;
35
+ readonly reservedAfterReceipt: number;
36
+ readonly copiedDownstreamCredit: boolean;
37
+ readonly downstreamReceipt?: CreditFrame;
38
+ }
39
+ export declare function chainCreditTransfer(input: CreditTransferInput): TransferDecision;
40
+ //# sourceMappingURL=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