@sentropic/cluster-mesh 0.24.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 (610) hide show
  1. package/README.md +5 -0
  2. package/dist/comments/storage-schema.d.ts +1 -1
  3. package/dist/comments/transport-contracts.d.ts +1 -1
  4. package/dist/compile/contract/diagnostics.d.ts +9 -0
  5. package/dist/compile/contract/diagnostics.d.ts.map +1 -0
  6. package/dist/compile/contract/diagnostics.js +82 -0
  7. package/dist/compile/contract/diagnostics.js.map +1 -0
  8. package/dist/compile/contract/encoding.d.ts +12 -0
  9. package/dist/compile/contract/encoding.d.ts.map +1 -0
  10. package/dist/compile/contract/encoding.js +95 -0
  11. package/dist/compile/contract/encoding.js.map +1 -0
  12. package/dist/compile/contract/index.d.ts +9 -0
  13. package/dist/compile/contract/index.d.ts.map +1 -0
  14. package/dist/compile/contract/index.js +9 -0
  15. package/dist/compile/contract/index.js.map +1 -0
  16. package/dist/compile/contract/json.d.ts +3 -0
  17. package/dist/compile/contract/json.d.ts.map +1 -0
  18. package/dist/compile/contract/json.js +75 -0
  19. package/dist/compile/contract/json.js.map +1 -0
  20. package/dist/compile/contract/output.d.ts +5 -0
  21. package/dist/compile/contract/output.d.ts.map +1 -0
  22. package/dist/compile/contract/output.js +57 -0
  23. package/dist/compile/contract/output.js.map +1 -0
  24. package/dist/compile/contract/recipe.d.ts +5 -0
  25. package/dist/compile/contract/recipe.d.ts.map +1 -0
  26. package/dist/compile/contract/recipe.js +86 -0
  27. package/dist/compile/contract/recipe.js.map +1 -0
  28. package/dist/compile/contract/schema.d.ts +26 -0
  29. package/dist/compile/contract/schema.d.ts.map +1 -0
  30. package/dist/compile/contract/schema.js +92 -0
  31. package/dist/compile/contract/schema.js.map +1 -0
  32. package/dist/compile/contract/types.d.ts +166 -0
  33. package/dist/compile/contract/types.d.ts.map +1 -0
  34. package/dist/compile/contract/types.js +21 -0
  35. package/dist/compile/contract/types.js.map +1 -0
  36. package/dist/compile/contract/vectors.d.ts +38 -0
  37. package/dist/compile/contract/vectors.d.ts.map +1 -0
  38. package/dist/compile/contract/vectors.js +29 -0
  39. package/dist/compile/contract/vectors.js.map +1 -0
  40. package/dist/engram-memory/wire-adaptation.d.ts +1 -1
  41. package/dist/engram-memory/wire-adaptation.d.ts.map +1 -1
  42. package/dist/engram-memory/wire-adaptation.js +24 -8
  43. package/dist/engram-memory/wire-adaptation.js.map +1 -1
  44. package/dist/forge/contracts.d.ts +60 -0
  45. package/dist/forge/contracts.d.ts.map +1 -0
  46. package/dist/forge/contracts.js +19 -0
  47. package/dist/forge/contracts.js.map +1 -0
  48. package/dist/forge/custody.d.ts +7 -0
  49. package/dist/forge/custody.d.ts.map +1 -0
  50. package/dist/forge/custody.js +76 -0
  51. package/dist/forge/custody.js.map +1 -0
  52. package/dist/forge/enrollment.d.ts +151 -0
  53. package/dist/forge/enrollment.d.ts.map +1 -0
  54. package/dist/forge/enrollment.js +98 -0
  55. package/dist/forge/enrollment.js.map +1 -0
  56. package/dist/forge/github-api.d.ts +6 -0
  57. package/dist/forge/github-api.d.ts.map +1 -0
  58. package/dist/forge/github-api.js +131 -0
  59. package/dist/forge/github-api.js.map +1 -0
  60. package/dist/forge/hono.d.ts +14 -0
  61. package/dist/forge/hono.d.ts.map +1 -0
  62. package/dist/forge/hono.js +141 -0
  63. package/dist/forge/hono.js.map +1 -0
  64. package/dist/forge/lifecycle.d.ts +108 -0
  65. package/dist/forge/lifecycle.d.ts.map +1 -0
  66. package/dist/forge/lifecycle.js +160 -0
  67. package/dist/forge/lifecycle.js.map +1 -0
  68. package/dist/forge/records.d.ts +70 -0
  69. package/dist/forge/records.d.ts.map +1 -0
  70. package/dist/forge/records.js +2 -0
  71. package/dist/forge/records.js.map +1 -0
  72. package/dist/forge/rotation.d.ts +46 -0
  73. package/dist/forge/rotation.d.ts.map +1 -0
  74. package/dist/forge/rotation.js +62 -0
  75. package/dist/forge/rotation.js.map +1 -0
  76. package/dist/identity/auth-abort.d.ts +9 -0
  77. package/dist/identity/auth-abort.d.ts.map +1 -0
  78. package/dist/identity/auth-abort.js +59 -0
  79. package/dist/identity/auth-abort.js.map +1 -0
  80. package/dist/identity/auth-binding.d.ts +3 -0
  81. package/dist/identity/auth-binding.d.ts.map +1 -0
  82. package/dist/identity/auth-binding.js +87 -0
  83. package/dist/identity/auth-binding.js.map +1 -0
  84. package/dist/identity/auth-boundary.d.ts +11 -0
  85. package/dist/identity/auth-boundary.d.ts.map +1 -0
  86. package/dist/identity/auth-boundary.js +73 -0
  87. package/dist/identity/auth-boundary.js.map +1 -0
  88. package/dist/identity/auth-completion.d.ts +9 -0
  89. package/dist/identity/auth-completion.d.ts.map +1 -0
  90. package/dist/identity/auth-completion.js +24 -0
  91. package/dist/identity/auth-completion.js.map +1 -0
  92. package/dist/identity/auth-credentials.d.ts +5 -0
  93. package/dist/identity/auth-credentials.d.ts.map +1 -0
  94. package/dist/identity/auth-credentials.js +82 -0
  95. package/dist/identity/auth-credentials.js.map +1 -0
  96. package/dist/identity/auth-email.d.ts +8 -0
  97. package/dist/identity/auth-email.d.ts.map +1 -0
  98. package/dist/identity/auth-email.js +104 -0
  99. package/dist/identity/auth-email.js.map +1 -0
  100. package/dist/identity/auth-hono.d.ts +5 -0
  101. package/dist/identity/auth-hono.d.ts.map +1 -0
  102. package/dist/identity/auth-hono.js +10 -0
  103. package/dist/identity/auth-hono.js.map +1 -0
  104. package/dist/identity/auth-proofs.d.ts +11 -0
  105. package/dist/identity/auth-proofs.d.ts.map +1 -0
  106. package/dist/identity/auth-proofs.js +107 -0
  107. package/dist/identity/auth-proofs.js.map +1 -0
  108. package/dist/identity/auth-service-tenant.d.ts +4 -0
  109. package/dist/identity/auth-service-tenant.d.ts.map +1 -0
  110. package/dist/identity/auth-service-tenant.js +54 -0
  111. package/dist/identity/auth-service-tenant.js.map +1 -0
  112. package/dist/identity/auth-sessions.d.ts +8 -0
  113. package/dist/identity/auth-sessions.d.ts.map +1 -0
  114. package/dist/identity/auth-sessions.js +141 -0
  115. package/dist/identity/auth-sessions.js.map +1 -0
  116. package/dist/identity/auth-social.d.ts +4 -0
  117. package/dist/identity/auth-social.d.ts.map +1 -0
  118. package/dist/identity/auth-social.js +82 -0
  119. package/dist/identity/auth-social.js.map +1 -0
  120. package/dist/identity/auth-users.d.ts +9 -0
  121. package/dist/identity/auth-users.d.ts.map +1 -0
  122. package/dist/identity/auth-users.js +116 -0
  123. package/dist/identity/auth-users.js.map +1 -0
  124. package/dist/identity/auth-webauthn.d.ts +22 -0
  125. package/dist/identity/auth-webauthn.d.ts.map +1 -0
  126. package/dist/identity/auth-webauthn.js +108 -0
  127. package/dist/identity/auth-webauthn.js.map +1 -0
  128. package/dist/identity/cascade.d.ts +12 -0
  129. package/dist/identity/cascade.d.ts.map +1 -0
  130. package/dist/identity/cascade.js +19 -0
  131. package/dist/identity/cascade.js.map +1 -0
  132. package/dist/identity/connector-custody.d.ts +85 -0
  133. package/dist/identity/connector-custody.d.ts.map +1 -0
  134. package/dist/identity/connector-custody.js +288 -0
  135. package/dist/identity/connector-custody.js.map +1 -0
  136. package/dist/identity/conversation.d.ts +50 -0
  137. package/dist/identity/conversation.d.ts.map +1 -0
  138. package/dist/identity/conversation.js +102 -0
  139. package/dist/identity/conversation.js.map +1 -0
  140. package/dist/identity/custody-crypto.d.ts +37 -0
  141. package/dist/identity/custody-crypto.d.ts.map +1 -0
  142. package/dist/identity/custody-crypto.js +173 -0
  143. package/dist/identity/custody-crypto.js.map +1 -0
  144. package/dist/identity/decision.d.ts +28 -0
  145. package/dist/identity/decision.d.ts.map +1 -0
  146. package/dist/identity/decision.js +97 -0
  147. package/dist/identity/decision.js.map +1 -0
  148. package/dist/identity/index.d.ts +9 -0
  149. package/dist/identity/index.d.ts.map +1 -0
  150. package/dist/identity/index.js +13 -0
  151. package/dist/identity/index.js.map +1 -0
  152. package/dist/identity/ledger.d.ts +120 -0
  153. package/dist/identity/ledger.d.ts.map +1 -0
  154. package/dist/identity/ledger.js +226 -0
  155. package/dist/identity/ledger.js.map +1 -0
  156. package/dist/identity/postgres.d.ts +13 -0
  157. package/dist/identity/postgres.d.ts.map +1 -0
  158. package/dist/identity/postgres.js +207 -0
  159. package/dist/identity/postgres.js.map +1 -0
  160. package/dist/identity/sqlite.d.ts +14 -0
  161. package/dist/identity/sqlite.d.ts.map +1 -0
  162. package/dist/identity/sqlite.js +193 -0
  163. package/dist/identity/sqlite.js.map +1 -0
  164. package/dist/identity-contracts/access.d.ts +54 -0
  165. package/dist/identity-contracts/access.d.ts.map +1 -0
  166. package/dist/identity-contracts/access.js +168 -0
  167. package/dist/identity-contracts/access.js.map +1 -0
  168. package/dist/identity-contracts/accounts.d.ts +44 -0
  169. package/dist/identity-contracts/accounts.d.ts.map +1 -0
  170. package/dist/identity-contracts/accounts.js +150 -0
  171. package/dist/identity-contracts/accounts.js.map +1 -0
  172. package/dist/identity-contracts/boundary-resolution.d.ts +31 -0
  173. package/dist/identity-contracts/boundary-resolution.d.ts.map +1 -0
  174. package/dist/identity-contracts/boundary-resolution.js +56 -0
  175. package/dist/identity-contracts/boundary-resolution.js.map +1 -0
  176. package/dist/identity-contracts/composition-descriptors.d.ts +17 -0
  177. package/dist/identity-contracts/composition-descriptors.d.ts.map +1 -0
  178. package/dist/identity-contracts/composition-descriptors.js +77 -0
  179. package/dist/identity-contracts/composition-descriptors.js.map +1 -0
  180. package/dist/identity-contracts/custody-auth.d.ts +122 -0
  181. package/dist/identity-contracts/custody-auth.d.ts.map +1 -0
  182. package/dist/identity-contracts/custody-auth.js +2 -0
  183. package/dist/identity-contracts/custody-auth.js.map +1 -0
  184. package/dist/identity-contracts/custody-descriptors.d.ts +18 -0
  185. package/dist/identity-contracts/custody-descriptors.d.ts.map +1 -0
  186. package/dist/identity-contracts/custody-descriptors.js +83 -0
  187. package/dist/identity-contracts/custody-descriptors.js.map +1 -0
  188. package/dist/identity-contracts/custody-errors.d.ts +21 -0
  189. package/dist/identity-contracts/custody-errors.d.ts.map +1 -0
  190. package/dist/identity-contracts/custody-errors.js +80 -0
  191. package/dist/identity-contracts/custody-errors.js.map +1 -0
  192. package/dist/identity-contracts/custody-operations.d.ts +79 -0
  193. package/dist/identity-contracts/custody-operations.d.ts.map +1 -0
  194. package/dist/identity-contracts/custody-operations.js +2 -0
  195. package/dist/identity-contracts/custody-operations.js.map +1 -0
  196. package/dist/identity-contracts/custody.d.ts +587 -0
  197. package/dist/identity-contracts/custody.d.ts.map +1 -0
  198. package/dist/identity-contracts/custody.js +7 -0
  199. package/dist/identity-contracts/custody.js.map +1 -0
  200. package/dist/identity-contracts/descriptors.d.ts +12 -0
  201. package/dist/identity-contracts/descriptors.d.ts.map +1 -0
  202. package/dist/identity-contracts/descriptors.js +57 -0
  203. package/dist/identity-contracts/descriptors.js.map +1 -0
  204. package/dist/identity-contracts/doubles.d.ts +124 -0
  205. package/dist/identity-contracts/doubles.d.ts.map +1 -0
  206. package/dist/identity-contracts/doubles.js +360 -0
  207. package/dist/identity-contracts/doubles.js.map +1 -0
  208. package/dist/identity-contracts/enforcement.d.ts +27 -0
  209. package/dist/identity-contracts/enforcement.d.ts.map +1 -0
  210. package/dist/identity-contracts/enforcement.js +155 -0
  211. package/dist/identity-contracts/enforcement.js.map +1 -0
  212. package/dist/identity-contracts/errors.d.ts +71 -0
  213. package/dist/identity-contracts/errors.d.ts.map +1 -0
  214. package/dist/identity-contracts/errors.js +129 -0
  215. package/dist/identity-contracts/errors.js.map +1 -0
  216. package/dist/identity-contracts/index.d.ts +22 -0
  217. package/dist/identity-contracts/index.d.ts.map +1 -0
  218. package/dist/identity-contracts/index.js +23 -0
  219. package/dist/identity-contracts/index.js.map +1 -0
  220. package/dist/identity-contracts/oauth-reads.d.ts +42 -0
  221. package/dist/identity-contracts/oauth-reads.d.ts.map +1 -0
  222. package/dist/identity-contracts/oauth-reads.js +38 -0
  223. package/dist/identity-contracts/oauth-reads.js.map +1 -0
  224. package/dist/identity-contracts/ports.d.ts +116 -0
  225. package/dist/identity-contracts/ports.d.ts.map +1 -0
  226. package/dist/identity-contracts/ports.js +7 -0
  227. package/dist/identity-contracts/ports.js.map +1 -0
  228. package/dist/identity-contracts/replica-sync.d.ts +89 -0
  229. package/dist/identity-contracts/replica-sync.d.ts.map +1 -0
  230. package/dist/identity-contracts/replica-sync.js +7 -0
  231. package/dist/identity-contracts/replica-sync.js.map +1 -0
  232. package/dist/identity-contracts/resolution.d.ts +56 -0
  233. package/dist/identity-contracts/resolution.d.ts.map +1 -0
  234. package/dist/identity-contracts/resolution.js +87 -0
  235. package/dist/identity-contracts/resolution.js.map +1 -0
  236. package/dist/identity-contracts/service-tenancy.d.ts +43 -0
  237. package/dist/identity-contracts/service-tenancy.d.ts.map +1 -0
  238. package/dist/identity-contracts/service-tenancy.js +75 -0
  239. package/dist/identity-contracts/service-tenancy.js.map +1 -0
  240. package/dist/identity-contracts/tenancy.d.ts +52 -0
  241. package/dist/identity-contracts/tenancy.d.ts.map +1 -0
  242. package/dist/identity-contracts/tenancy.js +171 -0
  243. package/dist/identity-contracts/tenancy.js.map +1 -0
  244. package/dist/identity-contracts/types.d.ts +253 -0
  245. package/dist/identity-contracts/types.d.ts.map +1 -0
  246. package/dist/identity-contracts/types.js +7 -0
  247. package/dist/identity-contracts/types.js.map +1 -0
  248. package/dist/identity-contracts/workspace-deletion.d.ts +56 -0
  249. package/dist/identity-contracts/workspace-deletion.d.ts.map +1 -0
  250. package/dist/identity-contracts/workspace-deletion.js +7 -0
  251. package/dist/identity-contracts/workspace-deletion.js.map +1 -0
  252. package/dist/identity-contracts/workspaces.d.ts +37 -0
  253. package/dist/identity-contracts/workspaces.d.ts.map +1 -0
  254. package/dist/identity-contracts/workspaces.js +118 -0
  255. package/dist/identity-contracts/workspaces.js.map +1 -0
  256. package/dist/identity-stores/index.d.ts +4 -0
  257. package/dist/identity-stores/index.d.ts.map +1 -0
  258. package/dist/identity-stores/index.js +7 -0
  259. package/dist/identity-stores/index.js.map +1 -0
  260. package/dist/identity-stores/tenancy-postgres.d.ts +23 -0
  261. package/dist/identity-stores/tenancy-postgres.d.ts.map +1 -0
  262. package/dist/identity-stores/tenancy-postgres.js +294 -0
  263. package/dist/identity-stores/tenancy-postgres.js.map +1 -0
  264. package/dist/identity-stores/tenancy-schema.d.ts +11 -0
  265. package/dist/identity-stores/tenancy-schema.d.ts.map +1 -0
  266. package/dist/identity-stores/tenancy-schema.js +74 -0
  267. package/dist/identity-stores/tenancy-schema.js.map +1 -0
  268. package/dist/identity-stores/tenancy-sqlite.d.ts +24 -0
  269. package/dist/identity-stores/tenancy-sqlite.d.ts.map +1 -0
  270. package/dist/identity-stores/tenancy-sqlite.js +288 -0
  271. package/dist/identity-stores/tenancy-sqlite.js.map +1 -0
  272. package/dist/index.d.ts +15 -0
  273. package/dist/index.d.ts.map +1 -1
  274. package/dist/index.js +14 -0
  275. package/dist/index.js.map +1 -1
  276. package/dist/integrations/mcp/memory-compose.d.ts +11 -0
  277. package/dist/integrations/mcp/memory-compose.d.ts.map +1 -0
  278. package/dist/integrations/mcp/memory-compose.js +79 -0
  279. package/dist/integrations/mcp/memory-compose.js.map +1 -0
  280. package/dist/integrations/mcp/memory-definition.d.ts +28 -0
  281. package/dist/integrations/mcp/memory-definition.d.ts.map +1 -0
  282. package/dist/integrations/mcp/memory-definition.js +2 -0
  283. package/dist/integrations/mcp/memory-definition.js.map +1 -0
  284. package/dist/integrations/mcp/memory-manifest.d.ts +4 -0
  285. package/dist/integrations/mcp/memory-manifest.d.ts.map +1 -0
  286. package/dist/integrations/mcp/memory-manifest.js +9 -0
  287. package/dist/integrations/mcp/memory-manifest.js.map +1 -0
  288. package/dist/integrations/mcp/memory-transport.d.ts +21 -0
  289. package/dist/integrations/mcp/memory-transport.d.ts.map +1 -0
  290. package/dist/integrations/mcp/memory-transport.js +47 -0
  291. package/dist/integrations/mcp/memory-transport.js.map +1 -0
  292. package/dist/integrations/mcp/memory.d.ts +19 -0
  293. package/dist/integrations/mcp/memory.d.ts.map +1 -0
  294. package/dist/integrations/mcp/memory.js +40 -0
  295. package/dist/integrations/mcp/memory.js.map +1 -0
  296. package/dist/loaders/mcp/index.d.ts +1 -0
  297. package/dist/loaders/mcp/index.d.ts.map +1 -1
  298. package/dist/loaders/mcp/index.js +1 -0
  299. package/dist/loaders/mcp/index.js.map +1 -1
  300. package/dist/loaders/mcp/memory.d.ts +6 -0
  301. package/dist/loaders/mcp/memory.d.ts.map +1 -0
  302. package/dist/loaders/mcp/memory.js +9 -0
  303. package/dist/loaders/mcp/memory.js.map +1 -0
  304. package/dist/loaders/notifications/index.d.ts +5 -0
  305. package/dist/loaders/notifications/index.d.ts.map +1 -0
  306. package/dist/loaders/notifications/index.js +6 -0
  307. package/dist/loaders/notifications/index.js.map +1 -0
  308. package/dist/mcp/stateful-preflight.d.ts +1 -1
  309. package/dist/messaging/email-port.d.ts +49 -0
  310. package/dist/messaging/email-port.d.ts.map +1 -0
  311. package/dist/messaging/email-port.js +92 -0
  312. package/dist/messaging/email-port.js.map +1 -0
  313. package/dist/messaging/index.d.ts +1 -0
  314. package/dist/messaging/index.d.ts.map +1 -1
  315. package/dist/messaging/index.js +1 -0
  316. package/dist/messaging/index.js.map +1 -1
  317. package/dist/modules/catalog.d.ts +7 -4
  318. package/dist/modules/catalog.d.ts.map +1 -1
  319. package/dist/modules/catalog.js +24 -5
  320. package/dist/modules/catalog.js.map +1 -1
  321. package/dist/modules/contracts.d.ts +1 -1
  322. package/dist/modules/contracts.d.ts.map +1 -1
  323. package/dist/modules/contracts.js +3 -0
  324. package/dist/modules/contracts.js.map +1 -1
  325. package/dist/notifications/incident-policy.d.ts +6 -0
  326. package/dist/notifications/incident-policy.d.ts.map +1 -0
  327. package/dist/notifications/incident-policy.js +119 -0
  328. package/dist/notifications/incident-policy.js.map +1 -0
  329. package/dist/notifications/incident-schedule.d.ts +14 -0
  330. package/dist/notifications/incident-schedule.d.ts.map +1 -0
  331. package/dist/notifications/incident-schedule.js +36 -0
  332. package/dist/notifications/incident-schedule.js.map +1 -0
  333. package/dist/notifications/incident-state.d.ts +72 -0
  334. package/dist/notifications/incident-state.d.ts.map +1 -0
  335. package/dist/notifications/incident-state.js +72 -0
  336. package/dist/notifications/incident-state.js.map +1 -0
  337. package/dist/notifications/index.d.ts +9 -0
  338. package/dist/notifications/index.d.ts.map +1 -0
  339. package/dist/notifications/index.js +9 -0
  340. package/dist/notifications/index.js.map +1 -0
  341. package/dist/notifications/ops-job-failure-contract.d.ts +19 -0
  342. package/dist/notifications/ops-job-failure-contract.d.ts.map +1 -0
  343. package/dist/notifications/ops-job-failure-contract.js +183 -0
  344. package/dist/notifications/ops-job-failure-contract.js.map +1 -0
  345. package/dist/notifications/ops-job-failure-types.d.ts +81 -0
  346. package/dist/notifications/ops-job-failure-types.d.ts.map +1 -0
  347. package/dist/notifications/ops-job-failure-types.js +73 -0
  348. package/dist/notifications/ops-job-failure-types.js.map +1 -0
  349. package/dist/notifications/recipients-http.d.ts +66 -0
  350. package/dist/notifications/recipients-http.d.ts.map +1 -0
  351. package/dist/notifications/recipients-http.js +148 -0
  352. package/dist/notifications/recipients-http.js.map +1 -0
  353. package/dist/notifications/recipients.d.ts +50 -0
  354. package/dist/notifications/recipients.d.ts.map +1 -0
  355. package/dist/notifications/recipients.js +59 -0
  356. package/dist/notifications/recipients.js.map +1 -0
  357. package/dist/prompts/registry.d.ts +55 -0
  358. package/dist/prompts/registry.d.ts.map +1 -0
  359. package/dist/prompts/registry.js +76 -0
  360. package/dist/prompts/registry.js.map +1 -0
  361. package/dist/runtime/heavy-phase-queue.d.ts +101 -0
  362. package/dist/runtime/heavy-phase-queue.d.ts.map +1 -0
  363. package/dist/runtime/heavy-phase-queue.js +129 -0
  364. package/dist/runtime/heavy-phase-queue.js.map +1 -0
  365. package/dist/sessions/content-policy.d.ts +55 -0
  366. package/dist/sessions/content-policy.d.ts.map +1 -0
  367. package/dist/sessions/content-policy.js +133 -0
  368. package/dist/sessions/content-policy.js.map +1 -0
  369. package/dist/sessions/registry-admin.d.ts +19 -0
  370. package/dist/sessions/registry-admin.d.ts.map +1 -0
  371. package/dist/sessions/registry-admin.js +42 -0
  372. package/dist/sessions/registry-admin.js.map +1 -0
  373. package/dist/sessions/registry-freshness.d.ts +8 -0
  374. package/dist/sessions/registry-freshness.d.ts.map +1 -0
  375. package/dist/sessions/registry-freshness.js +108 -0
  376. package/dist/sessions/registry-freshness.js.map +1 -0
  377. package/dist/sessions/registry-ingest.d.ts +5 -0
  378. package/dist/sessions/registry-ingest.d.ts.map +1 -0
  379. package/dist/sessions/registry-ingest.js +113 -0
  380. package/dist/sessions/registry-ingest.js.map +1 -0
  381. package/dist/sessions/registry-publish.d.ts +18 -0
  382. package/dist/sessions/registry-publish.d.ts.map +1 -0
  383. package/dist/sessions/registry-publish.js +134 -0
  384. package/dist/sessions/registry-publish.js.map +1 -0
  385. package/dist/sessions/registry-store.d.ts +51 -0
  386. package/dist/sessions/registry-store.d.ts.map +1 -0
  387. package/dist/sessions/registry-store.js +134 -0
  388. package/dist/sessions/registry-store.js.map +1 -0
  389. package/dist/sessions/registry-types.d.ts +180 -0
  390. package/dist/sessions/registry-types.d.ts.map +1 -0
  391. package/dist/sessions/registry-types.js +32 -0
  392. package/dist/sessions/registry-types.js.map +1 -0
  393. package/dist/sessions/registry.d.ts +45 -0
  394. package/dist/sessions/registry.d.ts.map +1 -0
  395. package/dist/sessions/registry.js +74 -0
  396. package/dist/sessions/registry.js.map +1 -0
  397. package/dist/sessions/relay-bind.d.ts +38 -0
  398. package/dist/sessions/relay-bind.d.ts.map +1 -0
  399. package/dist/sessions/relay-bind.js +74 -0
  400. package/dist/sessions/relay-bind.js.map +1 -0
  401. package/dist/sessions/relay-brand.d.ts +2 -0
  402. package/dist/sessions/relay-brand.d.ts.map +1 -0
  403. package/dist/sessions/relay-brand.js +7 -0
  404. package/dist/sessions/relay-brand.js.map +1 -0
  405. package/dist/sessions/relay-capsule.d.ts +50 -0
  406. package/dist/sessions/relay-capsule.d.ts.map +1 -0
  407. package/dist/sessions/relay-capsule.js +72 -0
  408. package/dist/sessions/relay-capsule.js.map +1 -0
  409. package/dist/sessions/relay-chain-failure.d.ts +25 -0
  410. package/dist/sessions/relay-chain-failure.d.ts.map +1 -0
  411. package/dist/sessions/relay-chain-failure.js +23 -0
  412. package/dist/sessions/relay-chain-failure.js.map +1 -0
  413. package/dist/sessions/relay-chain.d.ts +74 -0
  414. package/dist/sessions/relay-chain.d.ts.map +1 -0
  415. package/dist/sessions/relay-chain.js +71 -0
  416. package/dist/sessions/relay-chain.js.map +1 -0
  417. package/dist/sessions/relay-composition.d.ts +8 -0
  418. package/dist/sessions/relay-composition.d.ts.map +1 -0
  419. package/dist/sessions/relay-composition.js +65 -0
  420. package/dist/sessions/relay-composition.js.map +1 -0
  421. package/dist/sessions/relay-credit.d.ts +40 -0
  422. package/dist/sessions/relay-credit.d.ts.map +1 -0
  423. package/dist/sessions/relay-credit.js +68 -0
  424. package/dist/sessions/relay-credit.js.map +1 -0
  425. package/dist/sessions/relay-engine.d.ts +19 -0
  426. package/dist/sessions/relay-engine.d.ts.map +1 -0
  427. package/dist/sessions/relay-engine.js +34 -0
  428. package/dist/sessions/relay-engine.js.map +1 -0
  429. package/dist/sessions/relay-frames.d.ts +28 -0
  430. package/dist/sessions/relay-frames.d.ts.map +1 -0
  431. package/dist/sessions/relay-frames.js +72 -0
  432. package/dist/sessions/relay-frames.js.map +1 -0
  433. package/dist/sessions/relay-lane-client.d.ts +7 -0
  434. package/dist/sessions/relay-lane-client.d.ts.map +1 -0
  435. package/dist/sessions/relay-lane-client.js +137 -0
  436. package/dist/sessions/relay-lane-client.js.map +1 -0
  437. package/dist/sessions/relay-lane-lease.d.ts +20 -0
  438. package/dist/sessions/relay-lane-lease.d.ts.map +1 -0
  439. package/dist/sessions/relay-lane-lease.js +74 -0
  440. package/dist/sessions/relay-lane-lease.js.map +1 -0
  441. package/dist/sessions/relay-lane-record.d.ts +28 -0
  442. package/dist/sessions/relay-lane-record.d.ts.map +1 -0
  443. package/dist/sessions/relay-lane-record.js +28 -0
  444. package/dist/sessions/relay-lane-record.js.map +1 -0
  445. package/dist/sessions/relay-lane-stream.d.ts +13 -0
  446. package/dist/sessions/relay-lane-stream.d.ts.map +1 -0
  447. package/dist/sessions/relay-lane-stream.js +148 -0
  448. package/dist/sessions/relay-lane-stream.js.map +1 -0
  449. package/dist/sessions/relay-routes.d.ts +368 -0
  450. package/dist/sessions/relay-routes.d.ts.map +1 -0
  451. package/dist/sessions/relay-routes.js +46 -0
  452. package/dist/sessions/relay-routes.js.map +1 -0
  453. package/dist/sessions/relay-skeleton.d.ts +4 -0
  454. package/dist/sessions/relay-skeleton.d.ts.map +1 -0
  455. package/dist/sessions/relay-skeleton.js +85 -0
  456. package/dist/sessions/relay-skeleton.js.map +1 -0
  457. package/dist/sessions/relay-types.d.ts +107 -0
  458. package/dist/sessions/relay-types.d.ts.map +1 -0
  459. package/dist/sessions/relay-types.js +2 -0
  460. package/dist/sessions/relay-types.js.map +1 -0
  461. package/dist/sessions/relay-validate.d.ts +8 -0
  462. package/dist/sessions/relay-validate.d.ts.map +1 -0
  463. package/dist/sessions/relay-validate.js +169 -0
  464. package/dist/sessions/relay-validate.js.map +1 -0
  465. package/dist/sessions/relay-wire.d.ts +8 -0
  466. package/dist/sessions/relay-wire.d.ts.map +1 -0
  467. package/dist/sessions/relay-wire.js +37 -0
  468. package/dist/sessions/relay-wire.js.map +1 -0
  469. package/dist/sessions/relay-wiring.d.ts +26 -0
  470. package/dist/sessions/relay-wiring.d.ts.map +1 -0
  471. package/dist/sessions/relay-wiring.js +13 -0
  472. package/dist/sessions/relay-wiring.js.map +1 -0
  473. package/dist/sessions/relay.d.ts +11 -0
  474. package/dist/sessions/relay.d.ts.map +1 -0
  475. package/dist/sessions/relay.js +71 -0
  476. package/dist/sessions/relay.js.map +1 -0
  477. package/dist/storage/descriptor.d.ts +1 -1
  478. package/dist/storage/errors.d.ts +1 -1
  479. package/dist/storage/identity/atomic-deletion.d.ts +4 -0
  480. package/dist/storage/identity/atomic-deletion.d.ts.map +1 -0
  481. package/dist/storage/identity/atomic-deletion.js +235 -0
  482. package/dist/storage/identity/atomic-deletion.js.map +1 -0
  483. package/dist/storage/identity/custody-composition.d.ts +9 -0
  484. package/dist/storage/identity/custody-composition.d.ts.map +1 -0
  485. package/dist/storage/identity/custody-composition.js +31 -0
  486. package/dist/storage/identity/custody-composition.js.map +1 -0
  487. package/dist/storage/identity/custody-delivery-record.d.ts +4 -0
  488. package/dist/storage/identity/custody-delivery-record.d.ts.map +1 -0
  489. package/dist/storage/identity/custody-delivery-record.js +11 -0
  490. package/dist/storage/identity/custody-delivery-record.js.map +1 -0
  491. package/dist/storage/identity/custody-host.d.ts +16 -0
  492. package/dist/storage/identity/custody-host.d.ts.map +1 -0
  493. package/dist/storage/identity/custody-host.js +5 -0
  494. package/dist/storage/identity/custody-host.js.map +1 -0
  495. package/dist/storage/identity/custody-import-deliveries.d.ts +6 -0
  496. package/dist/storage/identity/custody-import-deliveries.d.ts.map +1 -0
  497. package/dist/storage/identity/custody-import-deliveries.js +46 -0
  498. package/dist/storage/identity/custody-import-deliveries.js.map +1 -0
  499. package/dist/storage/identity/custody-import.d.ts +4 -0
  500. package/dist/storage/identity/custody-import.d.ts.map +1 -0
  501. package/dist/storage/identity/custody-import.js +364 -0
  502. package/dist/storage/identity/custody-import.js.map +1 -0
  503. package/dist/storage/identity/custody-journal-postgres.d.ts +125 -0
  504. package/dist/storage/identity/custody-journal-postgres.d.ts.map +1 -0
  505. package/dist/storage/identity/custody-journal-postgres.js +428 -0
  506. package/dist/storage/identity/custody-journal-postgres.js.map +1 -0
  507. package/dist/storage/identity/custody-journal-sqlite.d.ts +121 -0
  508. package/dist/storage/identity/custody-journal-sqlite.d.ts.map +1 -0
  509. package/dist/storage/identity/custody-journal-sqlite.js +345 -0
  510. package/dist/storage/identity/custody-journal-sqlite.js.map +1 -0
  511. package/dist/storage/identity/custody-lifecycle.d.ts +4 -0
  512. package/dist/storage/identity/custody-lifecycle.d.ts.map +1 -0
  513. package/dist/storage/identity/custody-lifecycle.js +42 -0
  514. package/dist/storage/identity/custody-lifecycle.js.map +1 -0
  515. package/dist/storage/identity/custody-postgres.d.ts +96 -0
  516. package/dist/storage/identity/custody-postgres.d.ts.map +1 -0
  517. package/dist/storage/identity/custody-postgres.js +726 -0
  518. package/dist/storage/identity/custody-postgres.js.map +1 -0
  519. package/dist/storage/identity/custody-records.d.ts +17 -0
  520. package/dist/storage/identity/custody-records.d.ts.map +1 -0
  521. package/dist/storage/identity/custody-records.js +260 -0
  522. package/dist/storage/identity/custody-records.js.map +1 -0
  523. package/dist/storage/identity/custody-shared.d.ts +28 -0
  524. package/dist/storage/identity/custody-shared.d.ts.map +1 -0
  525. package/dist/storage/identity/custody-shared.js +24 -0
  526. package/dist/storage/identity/custody-shared.js.map +1 -0
  527. package/dist/storage/identity/custody-sqlite.d.ts +93 -0
  528. package/dist/storage/identity/custody-sqlite.d.ts.map +1 -0
  529. package/dist/storage/identity/custody-sqlite.js +568 -0
  530. package/dist/storage/identity/custody-sqlite.js.map +1 -0
  531. package/dist/storage/identity/custody-tombstone-record.d.ts +3 -0
  532. package/dist/storage/identity/custody-tombstone-record.d.ts.map +1 -0
  533. package/dist/storage/identity/custody-tombstone-record.js +8 -0
  534. package/dist/storage/identity/custody-tombstone-record.js.map +1 -0
  535. package/dist/storage/identity/custody-transaction-guards.d.ts +16 -0
  536. package/dist/storage/identity/custody-transaction-guards.d.ts.map +1 -0
  537. package/dist/storage/identity/custody-transaction-guards.js +64 -0
  538. package/dist/storage/identity/custody-transaction-guards.js.map +1 -0
  539. package/dist/storage/identity/custody-transaction-ports.d.ts +9 -0
  540. package/dist/storage/identity/custody-transaction-ports.d.ts.map +1 -0
  541. package/dist/storage/identity/custody-transaction-ports.js +106 -0
  542. package/dist/storage/identity/custody-transaction-ports.js.map +1 -0
  543. package/dist/storage/identity/deletion-planes.d.ts +10 -0
  544. package/dist/storage/identity/deletion-planes.d.ts.map +1 -0
  545. package/dist/storage/identity/deletion-planes.js +54 -0
  546. package/dist/storage/identity/deletion-planes.js.map +1 -0
  547. package/dist/storage/identity/index.d.ts +18 -0
  548. package/dist/storage/identity/index.d.ts.map +1 -0
  549. package/dist/storage/identity/index.js +22 -0
  550. package/dist/storage/identity/index.js.map +1 -0
  551. package/dist/storage/identity/postgres.d.ts +16 -0
  552. package/dist/storage/identity/postgres.d.ts.map +1 -0
  553. package/dist/storage/identity/postgres.js +345 -0
  554. package/dist/storage/identity/postgres.js.map +1 -0
  555. package/dist/storage/identity/records.d.ts +12 -0
  556. package/dist/storage/identity/records.d.ts.map +1 -0
  557. package/dist/storage/identity/records.js +84 -0
  558. package/dist/storage/identity/records.js.map +1 -0
  559. package/dist/storage/identity/replica-sync.d.ts +4 -0
  560. package/dist/storage/identity/replica-sync.d.ts.map +1 -0
  561. package/dist/storage/identity/replica-sync.js +402 -0
  562. package/dist/storage/identity/replica-sync.js.map +1 -0
  563. package/dist/storage/identity/schema.d.ts +13 -0
  564. package/dist/storage/identity/schema.d.ts.map +1 -0
  565. package/dist/storage/identity/schema.js +418 -0
  566. package/dist/storage/identity/schema.js.map +1 -0
  567. package/dist/storage/identity/sqlite-schema.d.ts +4 -0
  568. package/dist/storage/identity/sqlite-schema.d.ts.map +1 -0
  569. package/dist/storage/identity/sqlite-schema.js +17 -0
  570. package/dist/storage/identity/sqlite-schema.js.map +1 -0
  571. package/dist/storage/identity/sqlite.d.ts +25 -0
  572. package/dist/storage/identity/sqlite.d.ts.map +1 -0
  573. package/dist/storage/identity/sqlite.js +233 -0
  574. package/dist/storage/identity/sqlite.js.map +1 -0
  575. package/dist/storage/identity/stores.d.ts +10 -0
  576. package/dist/storage/identity/stores.d.ts.map +1 -0
  577. package/dist/storage/identity/stores.js +5 -0
  578. package/dist/storage/identity/stores.js.map +1 -0
  579. package/dist/storage/identity/wiring.d.ts +20 -0
  580. package/dist/storage/identity/wiring.d.ts.map +1 -0
  581. package/dist/storage/identity/wiring.js +26 -0
  582. package/dist/storage/identity/wiring.js.map +1 -0
  583. package/dist/storage/identity/workspace-deletion.d.ts +3 -0
  584. package/dist/storage/identity/workspace-deletion.d.ts.map +1 -0
  585. package/dist/storage/identity/workspace-deletion.js +100 -0
  586. package/dist/storage/identity/workspace-deletion.js.map +1 -0
  587. package/dist/storage/postgres/journal.d.ts +1 -1
  588. package/dist/storage/postgres/profiles.d.ts +2 -2
  589. package/dist/storage/postgres/scope.d.ts +1 -1
  590. package/dist/storage/root-facade.d.ts +1 -1
  591. package/dist/storage/root-journal.d.ts +1 -1
  592. package/dist/storage/root-profiles.d.ts +1 -1
  593. package/docs/memory-mcp-candidate.md +46 -0
  594. package/docs/memory-mcp.md +98 -0
  595. package/examples/memory-mcp-stdio.mjs +42 -0
  596. package/package.json +66 -5
  597. package/ui/AdminUsersScreen.svelte +197 -0
  598. package/ui/AdminUsersScreen.svelte.d.ts +4 -0
  599. package/ui/LoginScreen.svelte +15 -0
  600. package/ui/LoginScreen.svelte.d.ts +4 -0
  601. package/ui/MembershipDecisionsScreen.svelte +76 -0
  602. package/ui/MembershipDecisionsScreen.svelte.d.ts +4 -0
  603. package/ui/RegistrationScreen.svelte +15 -0
  604. package/ui/RegistrationScreen.svelte.d.ts +4 -0
  605. package/ui/WorkspaceMembersScreen.svelte +86 -0
  606. package/ui/WorkspaceMembersScreen.svelte.d.ts +4 -0
  607. package/ui/auth-flow.ts +44 -0
  608. package/ui/management-ports.ts +36 -0
  609. package/ui/management-transport.ts +29 -0
  610. package/contracts/engram-memory-neutral-contract-v1.d.ts +0 -367
@@ -0,0 +1,86 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import { Alert, Button, Input } from '@sentropic/design-system-svelte';
4
+ import type { IdentityManagementScreenPorts, IdentityWorkspaceMemberView } from './management-ports.js';
5
+ export let ports: IdentityManagementScreenPorts;
6
+ export let workspaceId: string;
7
+ export let refreshVersion = 0;
8
+ const roles = ['viewer', 'commenter', 'editor', 'admin'];
9
+ let items: IdentityWorkspaceMemberView[] = [], email = '', role = 'viewer', error = '', busy = false;
10
+ let mounted = false, requestedKey = '', loadedScope = '', generation = 0;
11
+ $: scopeKey = JSON.stringify([workspaceId, refreshVersion, ports.userId]);
12
+ $: canManage = items.some(member => member.userId === ports.userId && member.role === 'admin');
13
+ $: if (mounted && scopeKey !== requestedKey) { requestedKey = scopeKey; void load(workspaceId); }
14
+ onMount(() => { mounted = true; return () => { mounted = false; generation++; }; });
15
+
16
+ async function load(scope: string) {
17
+ const attempt = ++generation;
18
+ items = []; loadedScope = ''; error = '';
19
+ if (!scope) return;
20
+ busy = true;
21
+ try {
22
+ const result = await ports.transport.listMembers(scope);
23
+ if (attempt === generation && workspaceId === scope) { items = result.items; loadedScope = scope; }
24
+ } catch { if (attempt === generation) error = ports.text('workspaceSettings.errors.loadMembers'); }
25
+ finally { if (attempt === generation) busy = false; }
26
+ }
27
+ async function perform(scope: string, operation: () => Promise<void>, toastKey: string) {
28
+ if (busy || loadedScope !== scope || workspaceId !== scope || !canManage) return;
29
+ busy = true; error = '';
30
+ try {
31
+ await operation();
32
+ ports.notify({ type: 'success', message: ports.text(toastKey) });
33
+ await ports.refreshWorkspaceScope?.();
34
+ if (workspaceId === scope) await load(scope);
35
+ } catch { error = ports.text('identity.actionFailed'); }
36
+ finally { busy = false; }
37
+ }
38
+ async function add() {
39
+ const scope = workspaceId, address = email.trim(), selectedRole = role;
40
+ if (!address) return;
41
+ await perform(scope, () => ports.transport.addMember(scope, address, selectedRole), 'workspaceSettings.toasts.memberAdded');
42
+ }
43
+ async function changeRole(event: Event, member: IdentityWorkspaceMemberView) {
44
+ const select = event.currentTarget;
45
+ if (!(select instanceof HTMLSelectElement) || member.userId === ports.userId) return;
46
+ const selectedRole = select.value, scope = workspaceId;
47
+ select.value = member.role; // Display only committed authority.
48
+ await perform(scope, () => ports.transport.setMemberRole(scope, member.userId, selectedRole), 'workspaceSettings.toasts.roleUpdated');
49
+ }
50
+ async function remove(member: IdentityWorkspaceMemberView) {
51
+ const scope = workspaceId;
52
+ if (member.userId === ports.userId || !await ports.confirm(ports.text('workspaceSettings.confirm.removeMember'))) return;
53
+ await perform(scope, () => ports.transport.removeMember(scope, member.userId), 'workspaceSettings.toasts.memberRemoved');
54
+ }
55
+ </script>
56
+
57
+ <section class="space-y-4 rounded-lg border border-slate-200 bg-white p-4" aria-busy={busy}>
58
+ <h4 class="font-medium">{ports.text('workspaceSettings.members.title')}</h4>
59
+ {#if error}<Alert tone="error" title={error} />{/if}
60
+ {#if canManage}
61
+ <form class="flex flex-wrap items-end gap-2" onsubmit={event => { event.preventDefault(); void add(); }}>
62
+ <Input id="cm-member-email" label={ports.text('common.email')} type="email" bind:value={email} disabled={busy} required />
63
+ <label class="text-sm">{ports.text('common.role')}
64
+ <select class="rounded border border-slate-300 px-3 py-2" bind:value={role} disabled={busy}>
65
+ {#each roles as value}<option value={value}>{ports.text(`roles.${value}`)}</option>{/each}
66
+ </select>
67
+ </label>
68
+ <Button type="submit" disabled={busy || !email.trim()}>{ports.text('common.add')}</Button>
69
+ </form>
70
+ {/if}
71
+ <div class="overflow-x-auto"><table class="min-w-full text-sm">
72
+ <thead><tr><th class="text-left">{ports.text('common.email')}</th><th class="text-left">{ports.text('common.name')}</th><th>{ports.text('common.role')}</th><th></th></tr></thead>
73
+ <tbody>{#each items as member (member.userId)}
74
+ <tr class="border-t border-slate-200">
75
+ <td class="p-2">{member.email ?? '—'}</td><td class="p-2">{member.displayName ?? '—'}</td>
76
+ <td class="p-2"><select class="rounded border border-slate-300 px-3 py-2" value={member.role}
77
+ aria-label={ports.text('common.role')} onchange={event => changeRole(event, member)} disabled={busy || !canManage || member.userId === ports.userId}>
78
+ {#each roles as value}<option value={value}>{ports.text(`roles.${value}`)}</option>{/each}
79
+ </select></td>
80
+ <td class="p-2">{#if canManage && member.userId !== ports.userId}
81
+ <Button type="button" variant="secondary" onclick={() => remove(member)} disabled={busy}>{ports.text('workspaceSettings.members.remove')}</Button>
82
+ {/if}</td>
83
+ </tr>
84
+ {/each}</tbody>
85
+ </table></div>
86
+ </section>
@@ -0,0 +1,4 @@
1
+ import type { SvelteComponent } from 'svelte';
2
+ import type { IdentityManagementScreenPorts } from './management-ports.js';
3
+ declare class WorkspaceMembersScreen extends SvelteComponent<{ ports: IdentityManagementScreenPorts; workspaceId: string; refreshVersion?: number }> {}
4
+ export default WorkspaceMembersScreen;
@@ -0,0 +1,44 @@
1
+ import type { AuthUiLabels, AuthUiSession, AuthUiTransport } from '@sentropic/auth-ui';
2
+
3
+ export interface IdentityAuthPresentation {
4
+ readonly email?: string;
5
+ readonly verificationToken?: string;
6
+ readonly oauthContinuation?: string;
7
+ readonly returnPath?: string;
8
+ }
9
+ export interface IdentityAuthScreenPorts {
10
+ readonly transport: AuthUiTransport;
11
+ readonly labels: AuthUiLabels;
12
+ readonly presentation: IdentityAuthPresentation;
13
+ readonly loginHref: string;
14
+ readonly registerHref: string;
15
+ commitSession(session: AuthUiSession): void | Promise<void>;
16
+ navigate(path: string): void | Promise<void>;
17
+ resumeOAuth(continuation: string): void | Promise<void>;
18
+ }
19
+
20
+ /** Presentation is never authority; the server verifies the sealed continuation. */
21
+ export const registrationScreenTransport = (ports: IdentityAuthScreenPorts): AuthUiTransport => {
22
+ const present = <T>(input: T) => ({ ...input, oauthContinuation: ports.presentation.oauthContinuation });
23
+ return { ...ports.transport,
24
+ createPasskeyRegistrationOptions: input => ports.transport.createPasskeyRegistrationOptions(present(input)),
25
+ verifyPasskeyRegistration: input => ports.transport.verifyPasskeyRegistration(present(input)),
26
+ };
27
+ };
28
+
29
+ export async function completeIdentityAuth(ports: IdentityAuthScreenPorts, session: AuthUiSession): Promise<void> {
30
+ await ports.commitSession(session);
31
+ if (ports.presentation.oauthContinuation) {
32
+ await ports.resumeOAuth(ports.presentation.oauthContinuation);
33
+ return;
34
+ }
35
+ const path = ports.presentation.returnPath;
36
+ let target = '/neutral';
37
+ if (path?.startsWith('/')) {
38
+ try {
39
+ const url = new URL(path, 'https://identity.invalid');
40
+ if (url.origin === 'https://identity.invalid') target = `${url.pathname}${url.search}${url.hash}`;
41
+ } catch { /* Invalid presentation returns to the fixed internal page. */ }
42
+ }
43
+ await ports.navigate(target);
44
+ }
@@ -0,0 +1,36 @@
1
+ export type IdentityScreenText = (key: string, options?: { values?: Record<string, string> }) => string;
2
+ export interface IdentityAdminUserView {
3
+ id: string; email: string | null; displayName: string | null;
4
+ role: 'admin_app' | 'admin_org' | 'editor' | 'guest';
5
+ accountStatus: 'active' | 'pending_admin_approval' | 'approval_expired_readonly' | 'disabled_by_user' | 'disabled_by_admin';
6
+ emailVerified: boolean; approvalDueAt: string | null; approvedAt: string | null; approvedByUserId: string | null;
7
+ disabledAt: string | null; disabledReason: string | null; createdAt: string; updatedAt: string | null;
8
+ workspaceId: string | null; workspaceName: string | null;
9
+ }
10
+ export interface IdentityMembershipView {
11
+ userId: string; tenantId: string; status: string; role: string;
12
+ decidedBy: string | null; decidedAt: string | null; updatedAt: string;
13
+ }
14
+ export interface IdentityWorkspaceMemberView { userId: string; email: string | null; displayName: string | null; role: string }
15
+ export interface IdentityManagementTransport {
16
+ listUsers(status?: string): Promise<{ items: IdentityAdminUserView[] }>;
17
+ approveUser(userId: string, role: IdentityAdminUserView['role']): Promise<void>;
18
+ disableUser(userId: string): Promise<void>;
19
+ reactivateUser(userId: string): Promise<void>;
20
+ deleteUser(userId: string, operationId: string): Promise<{ complete: boolean; operationId: string }>;
21
+ listMemberships(tenantId: string): Promise<{ items: IdentityMembershipView[] }>;
22
+ requestMembership(tenantId: string): Promise<void>;
23
+ decideMembership(tenantId: string, userId: string, decision: 'approve' | 'reject' | 'suspend'): Promise<void>;
24
+ listMembers(workspaceId: string): Promise<{ items: IdentityWorkspaceMemberView[] }>;
25
+ addMember(workspaceId: string, email: string, role: string): Promise<void>;
26
+ setMemberRole(workspaceId: string, userId: string, role: string): Promise<void>;
27
+ removeMember(workspaceId: string, userId: string): Promise<void>;
28
+ }
29
+ export interface IdentityManagementScreenPorts {
30
+ readonly userId: string | null; readonly role: string | null;
31
+ readonly transport: IdentityManagementTransport; readonly text: IdentityScreenText;
32
+ notify(input: { type: 'success' | 'error' | 'info'; message: string }): void;
33
+ confirm(message: string): boolean | Promise<boolean>;
34
+ operationId(): string;
35
+ refreshWorkspaceScope?(): Promise<void>;
36
+ }
@@ -0,0 +1,29 @@
1
+ import type { IdentityManagementTransport } from './management-ports.js';
2
+
3
+ /** Every selector is encoded as data; the current CM domain authorizes each request. */
4
+ export function createIdentityManagementTransport(fetch: (path: string, init?: RequestInit) => Promise<Response>): IdentityManagementTransport {
5
+ const request = async <T>(path: string, method = 'GET', body?: unknown, headers?: Record<string, string>): Promise<T> => {
6
+ const response = await fetch(path, { method,
7
+ headers: { ...(body === undefined ? {} : { 'content-type': 'application/json' }), ...headers },
8
+ ...(body === undefined ? {} : { body: JSON.stringify(body) }) });
9
+ if (!response.ok) throw new Error('identity_request_failed');
10
+ return response.status === 204 ? undefined : await response.json();
11
+ };
12
+ const user = (id: string) => `/admin/users/${encodeURIComponent(id)}`;
13
+ const memberships = (tenantId: string) => `/tenants/${encodeURIComponent(tenantId)}/memberships`;
14
+ const members = (workspaceId: string) => `/workspaces/${encodeURIComponent(workspaceId)}/members`;
15
+ return {
16
+ listUsers: status => request(`/admin/users${status ? `?status=${encodeURIComponent(status)}` : ''}`),
17
+ approveUser: (id, role) => request(`${user(id)}/approve`, 'POST', { role }),
18
+ disableUser: id => request(`${user(id)}/disable`, 'POST', {}),
19
+ reactivateUser: id => request(`${user(id)}/reactivate`, 'POST', {}),
20
+ deleteUser: (id, operationId) => request(user(id), 'DELETE', undefined, { 'idempotency-key': operationId }),
21
+ listMemberships: tenantId => request(memberships(tenantId)),
22
+ requestMembership: tenantId => request(memberships(tenantId), 'POST', {}),
23
+ decideMembership: (tenantId, id, decision) => request(`${memberships(tenantId)}/${encodeURIComponent(id)}/${decision}`, 'POST', {}),
24
+ listMembers: workspaceId => request(members(workspaceId)),
25
+ addMember: (workspaceId, email, role) => request(members(workspaceId), 'POST', { email, role }),
26
+ setMemberRole: (workspaceId, id, role) => request(`${members(workspaceId)}/${encodeURIComponent(id)}`, 'PATCH', { role }),
27
+ removeMember: (workspaceId, id) => request(`${members(workspaceId)}/${encodeURIComponent(id)}`, 'DELETE'),
28
+ };
29
+ }
@@ -1,367 +0,0 @@
1
- export declare const MEMORY_NEUTRAL_CONTRACT: {
2
- readonly name: "engram-memory-neutral-contract";
3
- readonly version: "1.0.0";
4
- readonly declaration: "contracts/engram-memory-neutral-contract-v1.d.ts";
5
- readonly constructor: "openModuleStorageCanonicalMemoryStoreV1";
6
- readonly engramVersion: "0.21.3";
7
- readonly contractVersion: "memory-binding-v1";
8
- readonly contractDigest: "sha256:dd0cccbd6e5e29766fbc9c48351ffe58f5b0a3162152f5ff02da0798c3244fee";
9
- readonly genericContract: {
10
- readonly name: "l3a-generic-module-storage-port";
11
- readonly version: "v4.1";
12
- readonly digest: "c7111c9e7293ee270a0b4dde277f1cfc40fa3c863c3915c6f9ccdd6935c46294";
13
- };
14
- };
15
- export declare const MEMORY_NEUTRAL_HANDLE_METHODS: readonly ["transact", "query", "readAggregate", "readCommitResult", "acquireFence", "checkFence", "releaseFence"];
16
- export declare const MEMORY_NEUTRAL_TRANSACTION_METHODS: readonly ["readAggregate", "readRecords", "readChain", "findIdempotency", "apply"];
17
- export interface NeutralEncodedValue {
18
- readonly format: "utf8";
19
- readonly data: string;
20
- }
21
- export type NeutralChainExpectation = {
22
- readonly kind: "absent";
23
- readonly allocation: string;
24
- } | {
25
- readonly kind: "head";
26
- readonly hash: string;
27
- };
28
- export interface NeutralRecordWrite {
29
- readonly kind: string;
30
- readonly key: string;
31
- readonly value: NeutralEncodedValue;
32
- readonly contentHash: string;
33
- }
34
- export interface NeutralChainAppend {
35
- readonly chain: string;
36
- readonly kind: string;
37
- readonly id: string;
38
- readonly hash: string;
39
- readonly value: NeutralEncodedValue;
40
- readonly expectation: NeutralChainExpectation;
41
- }
42
- export interface NeutralAggregateUpdate {
43
- readonly kind: string;
44
- readonly key: string;
45
- readonly value: NeutralEncodedValue;
46
- readonly version: string;
47
- }
48
- export interface NeutralIndexWrite {
49
- readonly index: string;
50
- readonly key: string;
51
- readonly value: NeutralEncodedValue;
52
- }
53
- /** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
54
- export interface NeutralRelationshipChange {
55
- readonly kind: string;
56
- }
57
- /** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
58
- export interface NeutralBarrierWrite {
59
- readonly kind: string;
60
- }
61
- /** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
62
- export interface NeutralAuthorizedPurgeIntent {
63
- readonly kind: string;
64
- }
65
- export interface NeutralGuard {
66
- readonly kind: "chain-head" | "chain-absent" | "aggregate-version";
67
- readonly chain?: string;
68
- readonly hash?: string;
69
- readonly allocation?: string;
70
- readonly aggregateKind?: string;
71
- readonly aggregateKey?: string;
72
- readonly version?: string;
73
- }
74
- export interface NeutralAtomicUnit {
75
- /** Producer-owned intent: persist and return unchanged with the idempotency entry. */
76
- readonly intentHash: string;
77
- readonly guards: ReadonlyArray<NeutralGuard>;
78
- readonly records: ReadonlyArray<NeutralRecordWrite>;
79
- readonly appends: ReadonlyArray<NeutralChainAppend>;
80
- readonly updates: ReadonlyArray<NeutralAggregateUpdate>;
81
- readonly relationships: ReadonlyArray<NeutralRelationshipChange>;
82
- readonly barriers: ReadonlyArray<NeutralBarrierWrite>;
83
- readonly purgeIntents: ReadonlyArray<NeutralAuthorizedPurgeIntent>;
84
- readonly indexWrites: ReadonlyArray<NeutralIndexWrite>;
85
- readonly moduleResult?: NeutralEncodedValue;
86
- }
87
- export interface NeutralWorkLimits {
88
- readonly maxAppends: number;
89
- readonly maxRecords: number;
90
- readonly maxEncodedBytes: number;
91
- }
92
- export interface NeutralStorageScope {
93
- readonly tenantId: string;
94
- readonly workspaceId: string;
95
- }
96
- export type NeutralGrantLifetime = {
97
- readonly kind: "invocation";
98
- readonly invocationId: string;
99
- } | {
100
- readonly kind: "lease";
101
- readonly expiresAt: string;
102
- };
103
- export interface NeutralScopeGrant {
104
- readonly token: string;
105
- readonly moduleId: string;
106
- readonly scope: NeutralStorageScope;
107
- readonly principalId: string;
108
- readonly operations: ReadonlyArray<string>;
109
- readonly issuer: string;
110
- readonly authorityRevision: string;
111
- readonly policyRevision: string;
112
- readonly lifetime: NeutralGrantLifetime;
113
- }
114
- export interface NeutralProfileClaim {
115
- readonly name: string;
116
- readonly version: string;
117
- readonly digest: string;
118
- }
119
- export interface NeutralModuleDescriptor {
120
- readonly contractVersion: string;
121
- readonly contractDigest: string;
122
- readonly schemaVersions: ReadonlyArray<string>;
123
- readonly requiredProfiles: ReadonlyArray<string>;
124
- readonly optionalProfiles: ReadonlyArray<string>;
125
- readonly chainKinds: ReadonlyArray<string>;
126
- readonly queryNames: ReadonlyArray<string>;
127
- readonly boundaries: ReadonlyArray<string>;
128
- readonly pageLimits: {
129
- readonly maxRecords: number;
130
- readonly maxEncodedBytes: number;
131
- };
132
- }
133
- export interface NeutralFenceProof {
134
- readonly fenceId: string;
135
- readonly epoch: string;
136
- }
137
- export interface NeutralWriterFence {
138
- readonly fenceId: string;
139
- readonly epoch: string;
140
- }
141
- export interface NeutralCommitOptions {
142
- readonly limits: NeutralWorkLimits;
143
- readonly idempotencyKey?: string;
144
- readonly grant: NeutralScopeGrant;
145
- /** Live acquisition identity: verified at entry, after waits, and at final commit validation. */
146
- readonly fence: NeutralWriterFence;
147
- }
148
- export interface NeutralCommitReceipt {
149
- readonly commitId: string;
150
- readonly journalCursor: string;
151
- }
152
- export interface NeutralAggregateRead {
153
- readonly kind: string;
154
- readonly key: string;
155
- readonly version: string;
156
- readonly value: NeutralEncodedValue;
157
- }
158
- export interface NeutralRecordRead {
159
- readonly kind: string;
160
- readonly key: string;
161
- readonly value: NeutralEncodedValue;
162
- readonly contentHash: string;
163
- }
164
- export interface NeutralChainRecord {
165
- readonly id: string;
166
- readonly hash: string;
167
- readonly value: NeutralEncodedValue;
168
- }
169
- export interface NeutralChainPage {
170
- readonly chain: string;
171
- readonly records: ReadonlyArray<NeutralChainRecord>;
172
- }
173
- export interface NeutralIdempotencySelector {
174
- readonly commitIdentity: string;
175
- }
176
- export interface NeutralIdempotencyEntry {
177
- readonly key: string;
178
- readonly intentHash: string;
179
- readonly moduleResult: NeutralEncodedValue;
180
- }
181
- export interface NeutralModuleTransaction {
182
- readAggregate(kind: string, key: string): Promise<NeutralAggregateRead | null>;
183
- readRecords(kind: string, keys: ReadonlyArray<string>): Promise<ReadonlyArray<NeutralRecordRead>>;
184
- readChain(input: {
185
- chain: string;
186
- afterAllocation?: string;
187
- limit: number;
188
- }): Promise<NeutralChainPage>;
189
- findIdempotency(selector: NeutralIdempotencySelector): Promise<NeutralIdempotencyEntry | null>;
190
- apply(unit: NeutralAtomicUnit): Promise<void>;
191
- }
192
- export interface NeutralMemoryHandle {
193
- readonly moduleId: string;
194
- readonly descriptor: NeutralModuleDescriptor;
195
- /** Closed backend class (G5 stays blocked: no Spanner member). */
196
- readonly backend: "memory" | "sqlite" | "postgres";
197
- readonly profiles: ReadonlyArray<NeutralProfileClaim>;
198
- transact<T>(options: NeutralCommitOptions, operation: (transaction: NeutralModuleTransaction) => Promise<T>): Promise<{
199
- readonly value: T;
200
- readonly receipt: NeutralCommitReceipt;
201
- }>;
202
- /** Registered named queries of §4.1 (JCS in, JCS out). */
203
- query(name: string, input: NeutralEncodedValue, grant: NeutralScopeGrant): Promise<NeutralEncodedValue>;
204
- /** Snapshot aggregate read outside a transaction (grant-checked). */
205
- readAggregate(kind: string, key: string, grant: NeutralScopeGrant): Promise<NeutralAggregateRead | null>;
206
- /**
207
- * Scoped, authority- and ownership-checked commit-result recovery (R-G4-7).
208
- * Null when absent. Optional: a port without it degrades post-restart
209
- * original-receipt replay to an explicit refusal (C4 open), never to a
210
- * recomputed substitute.
211
- */
212
- readCommitResult?(commitIdentity: string, grant: NeutralScopeGrant): Promise<NeutralEncodedValue | null>;
213
- /** Canonical-instance acquisition (R-G3-1): refuses a second live holder, never queues. */
214
- acquireFence(input: {
215
- scope: NeutralStorageScope;
216
- store_id: string;
217
- grant: NeutralScopeGrant;
218
- }): Promise<NeutralFenceProof>;
219
- /**
220
- * Freshness proof bound to the acquisition identity (binding §§9.3–9.6):
221
- * throws NeutralStorageError on loss, expiry, revocation, or epoch/fence mismatch.
222
- */
223
- checkFence(grant: NeutralScopeGrant, fence: NeutralWriterFence): Promise<void>;
224
- /** Acquisition-bound release: only the live holder clears the fence; a stale identity never clears a successor. */
225
- releaseFence(fence: NeutralWriterFence): Promise<void>;
226
- }
227
- /**
228
- * Grant-bound scoped surface returned by a binding `bind` call: the grant
229
- * is captured at bind time, so methods carry no per-call grant.
230
- */
231
- export interface NeutralBoundScope {
232
- transact<T>(options: Omit<NeutralCommitOptions, "grant">, operation: (transaction: NeutralModuleTransaction) => Promise<T>): Promise<{
233
- readonly value: T;
234
- readonly receipt: NeutralCommitReceipt;
235
- }>;
236
- query(name: string, input: NeutralEncodedValue): Promise<NeutralEncodedValue>;
237
- readAggregate(kind: string, key: string): Promise<NeutralAggregateRead | null>;
238
- readCommitResult?(commitIdentity: string): Promise<NeutralEncodedValue | null>;
239
- acquireFence(input: {
240
- scope: NeutralStorageScope;
241
- store_id: string;
242
- }): Promise<NeutralFenceProof>;
243
- checkFence(fence: NeutralWriterFence): Promise<void>;
244
- releaseFence(fence: NeutralWriterFence): Promise<void>;
245
- }
246
- /**
247
- * Specified binding interface (binding §6.2, L3a §6.3): the composition
248
- * binds a grant to a scope and receives the scoped surface. The delivered
249
- * generic binding is synchronous while the Postgres binding is
250
- * asynchronous; the constructor awaits either shape and MUST NOT assume
251
- * one. A pre-bound flat NeutralMemoryHandle stays consumable as-is.
252
- */
253
- export interface NeutralModuleStorageBinding {
254
- readonly moduleId: string;
255
- readonly descriptor: NeutralModuleDescriptor;
256
- /** Closed backend class (G5 stays blocked: no Spanner member). */
257
- readonly backend: "memory" | "sqlite" | "postgres";
258
- readonly profiles: ReadonlyArray<NeutralProfileClaim>;
259
- bind(grant: NeutralScopeGrant): NeutralBoundScope | Promise<NeutralBoundScope>;
260
- }
261
- /** Authoritative scope binding for one canonical store (binding §7.2). */
262
- export interface MemoryScopeBindingV1 {
263
- /** The one L3a scope this store serves. */
264
- readonly scope: {
265
- readonly tenantId: string;
266
- readonly workspaceId: string;
267
- };
268
- /** Durable identity of this canonical store and its journal. */
269
- readonly store_id: string;
270
- /**
271
- * Host authority binding one opaque `scope_ref` to the tenant/workspace
272
- * pair it belongs to, or null when unknown. Composition-only: never
273
- * serialized into a memory DTO, a stored value, or a receipt.
274
- */
275
- readonly resolveScope: (scope_ref: string) => {
276
- readonly tenantId: string;
277
- readonly workspaceId: string;
278
- } | null;
279
- }
280
- /** Composition contract of the provisional constructor (amendment §1.2, binding §6.2). */
281
- export interface ModuleStorageMemoryStoreOptionsV1 {
282
- /**
283
- * Host-provisioned neutral port for `moduleId: 'engram-memory'`: either a
284
- * pre-bound flat handle or a grant binding consumed synchronously or
285
- * asynchronously (binding §6.2, L3a §6.3). Engram never constructs a backend.
286
- */
287
- readonly handle: NeutralMemoryHandle | NeutralModuleStorageBinding;
288
- /** Authoritative scope binding for this store (binding §7). */
289
- readonly scope_binding: MemoryScopeBindingV1;
290
- /** Host-issued grant: module `engram-memory`, the bound scope, exactly `['read', 'write']`. */
291
- readonly grant: NeutralScopeGrant;
292
- /** Engram clock: the single time source for `committed_at` sampling and receipts. */
293
- readonly clock: {
294
- now(): string;
295
- };
296
- /** Acquisition deadline for construction. */
297
- readonly deadline_at: string;
298
- /** Optional composition work limits: may raise a qualified bound, never weaken a refusal. */
299
- readonly work_limits?: MemoryWorkLimitsV1;
300
- }
301
- /** Composition work limits: upper bounds only (binding §4.3). */
302
- export interface MemoryWorkLimitsV1 {
303
- readonly maxRecords?: number;
304
- readonly maxEncodedBytes?: number;
305
- /**
306
- * Maintenance expiry batch bounds (binding §4.3): expiry work observed by
307
- * a read commits in units of at most this many appends/records. Absent
308
- * means the descriptor batch defaults below. The declared ceiling is never
309
- * derived from observed work sizes.
310
- */
311
- readonly maintenance_max_appends?: number;
312
- readonly maintenance_max_records?: number;
313
- }
314
- export declare const MEMORY_NEUTRAL_ERROR_MAPPING: {
315
- readonly 'fence-lost': {
316
- readonly code: "FENCE_LOST";
317
- readonly terminal: true;
318
- };
319
- readonly 'fence-conflict': {
320
- readonly code: "FENCE_LOST";
321
- readonly terminal: true;
322
- };
323
- readonly unauthorized: {
324
- readonly code: "UNAUTHORIZED";
325
- readonly terminal: false;
326
- };
327
- readonly 'authorization-expired': {
328
- readonly code: "AUTHORIZATION_EXPIRED";
329
- readonly terminal: false;
330
- };
331
- readonly 'authorization-revoked': {
332
- readonly code: "AUTHORIZATION_REVOKED";
333
- readonly terminal: false;
334
- };
335
- readonly 'capability-unavailable': {
336
- readonly code: "CAPABILITY_UNAVAILABLE";
337
- readonly terminal: false;
338
- };
339
- readonly 'cas-conflict': {
340
- readonly code: "STORE_UNAVAILABLE";
341
- readonly terminal: false;
342
- };
343
- readonly 'digest-conflict': {
344
- readonly code: "DIGEST_CONFLICT";
345
- readonly terminal: false;
346
- };
347
- readonly 'limit-exceeded': {
348
- readonly code: "CAPABILITY_UNAVAILABLE";
349
- readonly terminal: false;
350
- };
351
- readonly 'store-unavailable': {
352
- readonly code: "STORE_UNAVAILABLE";
353
- readonly terminal: false;
354
- };
355
- readonly 'not-found': {
356
- readonly code: "NOT_FOUND";
357
- readonly terminal: false;
358
- };
359
- readonly 'invalid-schema': {
360
- readonly code: "INVALID_SCHEMA";
361
- readonly terminal: false;
362
- };
363
- };
364
- export type NeutralStorageErrorCode = keyof typeof MEMORY_NEUTRAL_ERROR_MAPPING;
365
- export interface NeutralStorageFailure {
366
- readonly code: NeutralStorageErrorCode;
367
- }