@cosmicdrift/kumiko-samples 0.385.0 → 0.387.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 (395) hide show
  1. package/LICENSE +21 -57
  2. package/README.md +1 -1
  3. package/package.json +2 -2
  4. package/packages/bundled-features/package.json +2 -2
  5. package/packages/bundled-features/src/agent-tools/tool-catalog.ts +1 -1
  6. package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +0 -2
  7. package/packages/bundled-features/src/audit/screens.ts +1 -1
  8. package/packages/bundled-features/src/auth-email-password/auth-user-row.ts +10 -10
  9. package/packages/bundled-features/src/auth-email-password/feature.ts +6 -6
  10. package/packages/bundled-features/src/auth-email-password/handlers/change-password.write.ts +3 -3
  11. package/packages/bundled-features/src/auth-email-password/handlers/confirm-token-flow.ts +5 -5
  12. package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +1 -1
  13. package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +18 -18
  14. package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +12 -12
  15. package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
  16. package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +24 -26
  17. package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +1 -1
  18. package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
  19. package/packages/bundled-features/src/auth-email-password/handlers/signup-confirm.write.ts +34 -37
  20. package/packages/bundled-features/src/auth-email-password/handlers/signup-request.write.ts +6 -7
  21. package/packages/bundled-features/src/auth-email-password/handlers/switch-tenant-mfa-gate.write.ts +1 -5
  22. package/packages/bundled-features/src/auth-email-password/index.ts +5 -5
  23. package/packages/bundled-features/src/auth-email-password/lockout-store.ts +1 -1
  24. package/packages/bundled-features/src/auth-email-password/seeding.ts +63 -66
  25. package/packages/bundled-features/src/auth-email-password/signup-token-store.ts +8 -8
  26. package/packages/bundled-features/src/auth-email-password/testing.ts +3 -3
  27. package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +57 -57
  28. package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +14 -14
  29. package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +15 -16
  30. package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +11 -12
  31. package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +1 -1
  32. package/packages/bundled-features/src/auth-email-password/web/constants.ts +3 -3
  33. package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +14 -14
  34. package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +11 -11
  35. package/packages/bundled-features/src/auth-email-password/web/index.ts +5 -5
  36. package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +17 -17
  37. package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +3 -4
  38. package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +16 -17
  39. package/packages/bundled-features/src/auth-email-password/web/session.tsx +34 -34
  40. package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +3 -3
  41. package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +14 -14
  42. package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +26 -27
  43. package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +12 -13
  44. package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +17 -18
  45. package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +11 -12
  46. package/packages/bundled-features/src/auth-foundation/boot-checks.ts +4 -4
  47. package/packages/bundled-features/src/auth-foundation/resolve-anonymous-access.ts +4 -4
  48. package/packages/bundled-features/src/auth-foundation/types.ts +2 -2
  49. package/packages/bundled-features/src/auth-mfa/handlers/disable.write.ts +3 -3
  50. package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +4 -4
  51. package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm.write.ts +2 -2
  52. package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
  53. package/packages/bundled-features/src/auth-mfa/handlers/reencrypt.job.ts +1 -1
  54. package/packages/bundled-features/src/auth-mfa/handlers/regenerate-recovery.write.ts +5 -5
  55. package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
  56. package/packages/bundled-features/src/auth-mfa/token-secrets.ts +1 -1
  57. package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +2 -2
  58. package/packages/bundled-features/src/auth-mfa/web/i18n.ts +3 -3
  59. package/packages/bundled-features/src/auth-mfa/web/index.ts +4 -4
  60. package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +17 -16
  61. package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +6 -6
  62. package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +10 -11
  63. package/packages/bundled-features/src/billing-foundation/entities.ts +27 -27
  64. package/packages/bundled-features/src/billing-foundation/events.ts +22 -21
  65. package/packages/bundled-features/src/billing-foundation/feature.ts +42 -43
  66. package/packages/bundled-features/src/billing-foundation/get-subscription-for-tenant.ts +3 -5
  67. package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +18 -17
  68. package/packages/bundled-features/src/billing-foundation/handlers/create-portal-session.write.ts +11 -12
  69. package/packages/bundled-features/src/billing-foundation/handlers/list-subscriptions.query.ts +4 -4
  70. package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +20 -20
  71. package/packages/bundled-features/src/billing-foundation/projection.ts +38 -37
  72. package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +3 -3
  73. package/packages/bundled-features/src/billing-foundation/tenant-destroy-hook.ts +7 -8
  74. package/packages/bundled-features/src/billing-foundation/types.ts +64 -65
  75. package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +4 -4
  76. package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +1 -1
  77. package/packages/bundled-features/src/cap-counter/aggregate-id.ts +8 -9
  78. package/packages/bundled-features/src/cap-counter/constants.ts +11 -12
  79. package/packages/bundled-features/src/cap-counter/enforce-cap.ts +64 -67
  80. package/packages/bundled-features/src/cap-counter/entity.ts +29 -29
  81. package/packages/bundled-features/src/cap-counter/feature.ts +34 -35
  82. package/packages/bundled-features/src/cap-counter/handlers/increment-rolling.write.ts +31 -31
  83. package/packages/bundled-features/src/cap-counter/handlers/mark-soft-warned.write.ts +4 -5
  84. package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +1 -1
  85. package/packages/bundled-features/src/cap-counter/with-cap-enforcement.ts +3 -5
  86. package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -3
  87. package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +1 -1
  88. package/packages/bundled-features/src/channel-email/smtp-transport.ts +34 -31
  89. package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +3 -4
  90. package/packages/bundled-features/src/compliance-profiles/feature.ts +15 -16
  91. package/packages/bundled-features/src/compliance-profiles/handlers/for-tenant.query.ts +3 -6
  92. package/packages/bundled-features/src/compliance-profiles/handlers/list-profiles.query.ts +5 -5
  93. package/packages/bundled-features/src/compliance-profiles/handlers/needs-profile.query.ts +4 -4
  94. package/packages/bundled-features/src/compliance-profiles/handlers/set-profile.write.ts +13 -14
  95. package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +9 -11
  96. package/packages/bundled-features/src/compliance-profiles/resolve-for-tenant.ts +7 -7
  97. package/packages/bundled-features/src/compliance-profiles/schema/profile-selection.ts +18 -23
  98. package/packages/bundled-features/src/compliance-profiles/seeding.ts +14 -15
  99. package/packages/bundled-features/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +3 -3
  100. package/packages/bundled-features/src/compliance-profiles-ops/index.ts +2 -2
  101. package/packages/bundled-features/src/config/handlers/readiness.query.ts +7 -7
  102. package/packages/bundled-features/src/config/handlers/reencrypt.job.ts +4 -5
  103. package/packages/bundled-features/src/config/handlers/set.write.ts +4 -4
  104. package/packages/bundled-features/src/config/resolver.ts +4 -4
  105. package/packages/bundled-features/src/config/table.ts +10 -10
  106. package/packages/bundled-features/src/config/write-helpers.ts +1 -1
  107. package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +13 -12
  108. package/packages/bundled-features/src/custom-fields/aggregate-id.ts +16 -17
  109. package/packages/bundled-features/src/custom-fields/entity.ts +49 -47
  110. package/packages/bundled-features/src/custom-fields/events.ts +7 -8
  111. package/packages/bundled-features/src/custom-fields/feature.ts +70 -72
  112. package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +9 -8
  113. package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +28 -26
  114. package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +6 -7
  115. package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +12 -13
  116. package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +25 -28
  117. package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +6 -6
  118. package/packages/bundled-features/src/custom-fields/lib/field-access.ts +2 -2
  119. package/packages/bundled-features/src/custom-fields/lib/parse-serialized-field.ts +1 -1
  120. package/packages/bundled-features/src/custom-fields/lib/quota.ts +1 -1
  121. package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +10 -12
  122. package/packages/bundled-features/src/custom-fields/run-retention.ts +3 -3
  123. package/packages/bundled-features/src/custom-fields/schemas.ts +14 -14
  124. package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +2 -5
  125. package/packages/bundled-features/src/custom-fields/web/constants.ts +2 -2
  126. package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +26 -26
  127. package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +65 -67
  128. package/packages/bundled-features/src/custom-fields/wire-user-data-rights.ts +3 -3
  129. package/packages/bundled-features/src/data-retention/_internal/parse-override.ts +2 -3
  130. package/packages/bundled-features/src/data-retention/feature.ts +11 -18
  131. package/packages/bundled-features/src/data-retention/handlers/policy-for.query.ts +6 -6
  132. package/packages/bundled-features/src/data-retention/keep-for.ts +17 -17
  133. package/packages/bundled-features/src/data-retention/override-schema.ts +13 -15
  134. package/packages/bundled-features/src/data-retention/presets.ts +18 -23
  135. package/packages/bundled-features/src/data-retention/resolve-for-tenant.ts +1 -1
  136. package/packages/bundled-features/src/data-retention/resolve-tenant-preset.ts +17 -16
  137. package/packages/bundled-features/src/data-retention/resolver.ts +33 -32
  138. package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +71 -58
  139. package/packages/bundled-features/src/data-retention/schema/tenant-retention-override.ts +13 -11
  140. package/packages/bundled-features/src/delivery/feature.ts +3 -3
  141. package/packages/bundled-features/src/delivery/handlers/log.query.ts +1 -1
  142. package/packages/bundled-features/src/delivery/tables.ts +9 -8
  143. package/packages/bundled-features/src/delivery/unsubscribe.ts +4 -4
  144. package/packages/bundled-features/src/delivery/upsert-preference.ts +3 -4
  145. package/packages/bundled-features/src/document-ingest-foundation/entity.ts +5 -5
  146. package/packages/bundled-features/src/document-ingest-foundation/events.ts +2 -2
  147. package/packages/bundled-features/src/document-ingest-foundation/feature.ts +2 -2
  148. package/packages/bundled-features/src/document-ingest-foundation/pages.ts +1 -1
  149. package/packages/bundled-features/src/document-ingest-foundation/tenant-destroy-hook.ts +4 -4
  150. package/packages/bundled-features/src/feature-toggles/compose-tier-resolver.ts +1 -1
  151. package/packages/bundled-features/src/feature-toggles/feature.ts +1 -1
  152. package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +1 -1
  153. package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +5 -5
  154. package/packages/bundled-features/src/feature-toggles/toggle-runtime.ts +1 -1
  155. package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +1 -1
  156. package/packages/bundled-features/src/feature-toggles/web/constants.ts +1 -1
  157. package/packages/bundled-features/src/file-derivatives/feature.ts +2 -2
  158. package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
  159. package/packages/bundled-features/src/file-derivatives/presets.ts +1 -1
  160. package/packages/bundled-features/src/file-foundation/feature.ts +6 -6
  161. package/packages/bundled-features/src/file-provider-inmemory/feature.ts +16 -16
  162. package/packages/bundled-features/src/file-provider-s3/feature.ts +16 -16
  163. package/packages/bundled-features/src/file-provider-s3/lib/s3-provider.ts +6 -6
  164. package/packages/bundled-features/src/files/feature.ts +6 -6
  165. package/packages/bundled-features/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +5 -5
  166. package/packages/bundled-features/src/files-tenant-data/hooks.ts +24 -26
  167. package/packages/bundled-features/src/files-tenant-data/index.ts +1 -1
  168. package/packages/bundled-features/src/folders/feature.ts +1 -1
  169. package/packages/bundled-features/src/folders/web/folder-manager.tsx +2 -2
  170. package/packages/bundled-features/src/folders/web/tree.ts +5 -5
  171. package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +1 -1
  172. package/packages/bundled-features/src/form-draft/db/queries/owned-file-refs.ts +1 -1
  173. package/packages/bundled-features/src/form-draft/entity.ts +3 -3
  174. package/packages/bundled-features/src/form-draft/feature.ts +4 -5
  175. package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
  176. package/packages/bundled-features/src/form-draft/release-file-refs.ts +6 -6
  177. package/packages/bundled-features/src/form-draft/schemas.ts +3 -3
  178. package/packages/bundled-features/src/form-draft/web/constants.ts +0 -2
  179. package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +19 -19
  180. package/packages/bundled-features/src/inbound-mail-foundation/connect-routes.ts +4 -3
  181. package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +30 -33
  182. package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +47 -48
  183. package/packages/bundled-features/src/inbound-mail-foundation/events.ts +54 -50
  184. package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +39 -39
  185. package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-state.ts +8 -8
  186. package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +25 -26
  187. package/packages/bundled-features/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +7 -7
  188. package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +50 -51
  189. package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +8 -8
  190. package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +10 -10
  191. package/packages/bundled-features/src/inbound-mail-foundation/handlers/scope-visibility.ts +3 -4
  192. package/packages/bundled-features/src/inbound-mail-foundation/handlers/update-account.write.ts +11 -11
  193. package/packages/bundled-features/src/inbound-mail-foundation/oauth-state.ts +16 -15
  194. package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +31 -29
  195. package/packages/bundled-features/src/inbound-mail-foundation/provider-factory.ts +9 -9
  196. package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +45 -41
  197. package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +14 -16
  198. package/packages/bundled-features/src/inbound-mail-foundation/types.ts +66 -67
  199. package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +69 -68
  200. package/packages/bundled-features/src/inbound-provider-imap/credential-document.ts +13 -13
  201. package/packages/bundled-features/src/inbound-provider-imap/feature.ts +42 -40
  202. package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +20 -19
  203. package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +21 -21
  204. package/packages/bundled-features/src/jobs/db/queries/retention.ts +2 -2
  205. package/packages/bundled-features/src/jobs/db/queries/stale-run-sweep.ts +3 -3
  206. package/packages/bundled-features/src/jobs/events.ts +1 -1
  207. package/packages/bundled-features/src/jobs/feature.ts +6 -7
  208. package/packages/bundled-features/src/jobs/handlers/detail.query.ts +4 -4
  209. package/packages/bundled-features/src/jobs/handlers/list.query.ts +1 -1
  210. package/packages/bundled-features/src/jobs/handlers/projection-rebuild.job.ts +1 -1
  211. package/packages/bundled-features/src/jobs/handlers/reindex-entity.job.ts +1 -1
  212. package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
  213. package/packages/bundled-features/src/jobs/job-instant.ts +1 -1
  214. package/packages/bundled-features/src/jobs/job-run-logger.ts +14 -15
  215. package/packages/bundled-features/src/jobs/job-run-table.ts +3 -3
  216. package/packages/bundled-features/src/jobs/screens.ts +1 -1
  217. package/packages/bundled-features/src/jobs/tenant-job-failure-table.ts +1 -1
  218. package/packages/bundled-features/src/jobs/tenant-job-run-table.ts +1 -1
  219. package/packages/bundled-features/src/ledger/entity.ts +5 -5
  220. package/packages/bundled-features/src/ledger/feature.ts +3 -3
  221. package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +3 -3
  222. package/packages/bundled-features/src/ledger/recurring.ts +12 -12
  223. package/packages/bundled-features/src/ledger/schemas.ts +1 -1
  224. package/packages/bundled-features/src/ledger/web/constants.ts +2 -2
  225. package/packages/bundled-features/src/ledger/web/index.ts +7 -7
  226. package/packages/bundled-features/src/legal-pages/feature.ts +40 -41
  227. package/packages/bundled-features/src/legal-pages/markdown.ts +3 -3
  228. package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +23 -24
  229. package/packages/bundled-features/src/legal-pages/web/index.ts +0 -2
  230. package/packages/bundled-features/src/mail-foundation/feature.ts +26 -27
  231. package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +27 -28
  232. package/packages/bundled-features/src/mail-transport-smtp/feature.ts +20 -20
  233. package/packages/bundled-features/src/managed-pages/branding.ts +6 -6
  234. package/packages/bundled-features/src/managed-pages/feature.ts +62 -62
  235. package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +5 -6
  236. package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +8 -8
  237. package/packages/bundled-features/src/managed-pages/handlers/set.write.ts +5 -7
  238. package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +11 -11
  239. package/packages/bundled-features/src/managed-pages/seeding.ts +8 -8
  240. package/packages/bundled-features/src/managed-pages/table.ts +16 -15
  241. package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +6 -6
  242. package/packages/bundled-features/src/managed-pages/web/i18n.ts +1 -1
  243. package/packages/bundled-features/src/notes-history/entity.ts +4 -4
  244. package/packages/bundled-features/src/notes-history/feature.ts +2 -2
  245. package/packages/bundled-features/src/notes-history-user-data/hooks.ts +1 -1
  246. package/packages/bundled-features/src/page-render/layout.ts +9 -9
  247. package/packages/bundled-features/src/page-render/markdown.ts +11 -11
  248. package/packages/bundled-features/src/page-render/security-headers.ts +7 -6
  249. package/packages/bundled-features/src/personal-access-tokens/feature.ts +5 -5
  250. package/packages/bundled-features/src/personal-access-tokens/roles.ts +2 -2
  251. package/packages/bundled-features/src/readiness/handlers/status.query.ts +3 -3
  252. package/packages/bundled-features/src/renderer-foundation/api.ts +12 -13
  253. package/packages/bundled-features/src/renderer-foundation/constants.ts +2 -2
  254. package/packages/bundled-features/src/renderer-foundation/feature.ts +7 -7
  255. package/packages/bundled-features/src/renderer-foundation/types.ts +11 -12
  256. package/packages/bundled-features/src/secrets/feature.ts +9 -9
  257. package/packages/bundled-features/src/secrets/web/constants.ts +2 -2
  258. package/packages/bundled-features/src/seo/feature.ts +3 -3
  259. package/packages/bundled-features/src/sessions/constants.ts +1 -1
  260. package/packages/bundled-features/src/sessions/feature.ts +9 -9
  261. package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +2 -2
  262. package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +2 -2
  263. package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +1 -1
  264. package/packages/bundled-features/src/sessions/schema/user-session.ts +4 -4
  265. package/packages/bundled-features/src/sessions/screens.ts +2 -2
  266. package/packages/bundled-features/src/sessions/session-callbacks.ts +2 -2
  267. package/packages/bundled-features/src/sessions/session-revoked-event.ts +2 -2
  268. package/packages/bundled-features/src/shared/assert-no-where-rule-in-ownership-write.ts +1 -1
  269. package/packages/bundled-features/src/shared/decrypt-stored-pii.ts +1 -1
  270. package/packages/bundled-features/src/shared/encrypt-for-direct-write.ts +1 -1
  271. package/packages/bundled-features/src/shared/map-with-concurrency.ts +5 -4
  272. package/packages/bundled-features/src/shared/parent-visibility.ts +2 -2
  273. package/packages/bundled-features/src/shared/password-hashing.ts +1 -1
  274. package/packages/bundled-features/src/shared/signup-handover.ts +1 -2
  275. package/packages/bundled-features/src/shared/single-use-token-store.ts +1 -1
  276. package/packages/bundled-features/src/subscription-mollie/constants.ts +15 -17
  277. package/packages/bundled-features/src/subscription-mollie/feature.ts +41 -42
  278. package/packages/bundled-features/src/subscription-mollie/index.ts +3 -3
  279. package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +17 -16
  280. package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +34 -34
  281. package/packages/bundled-features/src/subscription-stripe/constants.ts +4 -6
  282. package/packages/bundled-features/src/subscription-stripe/feature.ts +44 -43
  283. package/packages/bundled-features/src/subscription-stripe/index.ts +6 -6
  284. package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +22 -27
  285. package/packages/bundled-features/src/subscription-stripe/runtime.ts +2 -2
  286. package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +62 -64
  287. package/packages/bundled-features/src/tags/feature.ts +3 -3
  288. package/packages/bundled-features/src/tags/screens.ts +1 -1
  289. package/packages/bundled-features/src/template-resolver/api.ts +10 -10
  290. package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +5 -5
  291. package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +1 -1
  292. package/packages/bundled-features/src/template-resolver/handlers/shared.ts +2 -2
  293. package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +3 -3
  294. package/packages/bundled-features/src/template-resolver/handlers/upsert-system.write.ts +3 -4
  295. package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +4 -5
  296. package/packages/bundled-features/src/template-resolver/seeding.ts +4 -4
  297. package/packages/bundled-features/src/template-resolver/table.ts +13 -14
  298. package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +2 -2
  299. package/packages/bundled-features/src/tenant/feature.ts +7 -7
  300. package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +1 -1
  301. package/packages/bundled-features/src/tenant/handlers/members.query.ts +1 -1
  302. package/packages/bundled-features/src/tenant/handlers/memberships.query.ts +1 -1
  303. package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +1 -1
  304. package/packages/bundled-features/src/tenant/handlers/tenant-directory.query.ts +1 -1
  305. package/packages/bundled-features/src/tenant/invitation-table.ts +37 -40
  306. package/packages/bundled-features/src/tenant/membership-table.ts +3 -3
  307. package/packages/bundled-features/src/tenant/schema/tenant.ts +7 -9
  308. package/packages/bundled-features/src/tenant/screens.ts +1 -1
  309. package/packages/bundled-features/src/tenant/seeding.ts +19 -18
  310. package/packages/bundled-features/src/tenant/testing.ts +5 -6
  311. package/packages/bundled-features/src/tenant/web/constants.ts +2 -2
  312. package/packages/bundled-features/src/tenant-handover/events.ts +5 -7
  313. package/packages/bundled-features/src/tenant-handover/feature.ts +1 -1
  314. package/packages/bundled-features/src/tenant-handover/grant.ts +1 -1
  315. package/packages/bundled-features/src/tenant-handover/handlers/claim.write.ts +1 -1
  316. package/packages/bundled-features/src/tenant-handover/move-entity-graph.ts +8 -9
  317. package/packages/bundled-features/src/tenant-handover/signup-handover-provider.ts +1 -2
  318. package/packages/bundled-features/src/tenant-handover/transfer-graph.ts +4 -5
  319. package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +1 -1
  320. package/packages/bundled-features/src/tenant-lifecycle/feature.ts +1 -1
  321. package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +2 -2
  322. package/packages/bundled-features/src/tenant-lifecycle/stages.ts +1 -1
  323. package/packages/bundled-features/src/tenant-settings/constants.ts +1 -1
  324. package/packages/bundled-features/src/tenant-settings/tenant-defaults.ts +12 -5
  325. package/packages/bundled-features/src/tier-engine/aggregate-id.ts +15 -16
  326. package/packages/bundled-features/src/tier-engine/compose-app.ts +14 -14
  327. package/packages/bundled-features/src/tier-engine/entity.ts +18 -19
  328. package/packages/bundled-features/src/tier-engine/feature.ts +88 -87
  329. package/packages/bundled-features/src/tier-engine/handlers/active-tier.query.ts +6 -7
  330. package/packages/bundled-features/src/tier-engine/handlers/get-tenant-tier.query.ts +4 -4
  331. package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +8 -8
  332. package/packages/bundled-features/src/tier-engine/tier-resolver.ts +2 -2
  333. package/packages/bundled-features/src/tier-engine/trial.ts +13 -13
  334. package/packages/bundled-features/src/tier-engine/web/index.ts +4 -4
  335. package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +8 -8
  336. package/packages/bundled-features/src/user/handlers/create.write.ts +4 -4
  337. package/packages/bundled-features/src/user/schema/user.ts +45 -44
  338. package/packages/bundled-features/src/user/seeding.ts +40 -40
  339. package/packages/bundled-features/src/user/testing.ts +3 -3
  340. package/packages/bundled-features/src/user-data-rights/audit-download.ts +27 -28
  341. package/packages/bundled-features/src/user-data-rights/boot-checks.ts +1 -1
  342. package/packages/bundled-features/src/user-data-rights/deletion-token.ts +1 -1
  343. package/packages/bundled-features/src/user-data-rights/feature.ts +112 -113
  344. package/packages/bundled-features/src/user-data-rights/handlers/cancel-deletion.write.ts +9 -9
  345. package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +8 -8
  346. package/packages/bundled-features/src/user-data-rights/handlers/download-by-job.query.ts +29 -30
  347. package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +40 -42
  348. package/packages/bundled-features/src/user-data-rights/handlers/export-status.query.ts +8 -9
  349. package/packages/bundled-features/src/user-data-rights/handlers/lift-restriction.write.ts +7 -8
  350. package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +2 -2
  351. package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +4 -4
  352. package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +30 -29
  353. package/packages/bundled-features/src/user-data-rights/handlers/request-deletion.write.ts +15 -18
  354. package/packages/bundled-features/src/user-data-rights/handlers/request-export.write.ts +42 -41
  355. package/packages/bundled-features/src/user-data-rights/handlers/restrict-account.write.ts +22 -19
  356. package/packages/bundled-features/src/user-data-rights/handlers/run-forget-cleanup.write.ts +8 -8
  357. package/packages/bundled-features/src/user-data-rights/index.ts +8 -10
  358. package/packages/bundled-features/src/user-data-rights/lib/default-mailers.ts +3 -3
  359. package/packages/bundled-features/src/user-data-rights/lib/update-user-lifecycle.ts +24 -27
  360. package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +166 -276
  361. package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +85 -107
  362. package/packages/bundled-features/src/user-data-rights/run-user-export.ts +67 -69
  363. package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +11 -11
  364. package/packages/bundled-features/src/user-data-rights/schema/download-token.ts +37 -41
  365. package/packages/bundled-features/src/user-data-rights/schema/export-job.ts +65 -67
  366. package/packages/bundled-features/src/user-data-rights/token-helpers.ts +21 -25
  367. package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +6 -6
  368. package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +6 -5
  369. package/packages/bundled-features/src/user-data-rights/web/constants.ts +1 -1
  370. package/packages/bundled-features/src/user-data-rights/web/index.ts +5 -5
  371. package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +14 -13
  372. package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +13 -12
  373. package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +6 -6
  374. package/packages/bundled-features/src/user-data-rights/zip-path.ts +41 -40
  375. package/packages/bundled-features/src/user-data-rights-defaults/feature.ts +15 -15
  376. package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +3 -5
  377. package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +45 -51
  378. package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -2
  379. package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +1 -1
  380. package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +3 -3
  381. package/packages/bundled-features/src/user-data-rights-defaults/hooks/user.userdata-hook.ts +32 -31
  382. package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +13 -13
  383. package/packages/bundled-features/src/user-profile/index.ts +3 -3
  384. package/packages/bundled-features/src/user-profile/web/client-plugin.ts +1 -1
  385. package/packages/bundled-features/src/user-profile/web/constants.ts +1 -1
  386. package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +1 -1
  387. package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +1 -1
  388. package/packages/bundled-features/src/workflow-runner/event-subscriber.ts +4 -5
  389. package/packages/bundled-features/src/workflow-runner/event-trigger.ts +4 -15
  390. package/packages/bundled-features/src/workflow-runner/feature.ts +2 -2
  391. package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +4 -4
  392. package/packages/bundled-features/src/workflow-runner/pending-projection.ts +6 -7
  393. package/packages/bundled-features/src/workflow-runner/runner.ts +6 -6
  394. package/packages/bundled-features/src/workflow-runner/tables.ts +6 -6
  395. package/packages/bundled-features/src/workflow-runner/workflow-registry.ts +1 -1
package/LICENSE CHANGED
@@ -1,57 +1,21 @@
1
- Business Source License 1.1
2
-
3
- Parameters
4
-
5
- Licensor: Marc Frost
6
-
7
- Licensed Work: @cosmicdrift/kumiko-samples
8
- The Licensed Work is © 2026 Marc Frost.
9
-
10
- Additional Use Grant:
11
- You may use the Licensed Work in production for any purpose, including
12
- commercially, EXCEPT for the Restricted Use.
13
-
14
- "Restricted Use" is defined as using the Licensed Work to provide a platform
15
- or service to third parties that allows them to host, deploy, or run their
16
- own applications built with the Licensed Work. This includes, but is not
17
- limited to: managed hosting services, software-as-a-service (SaaS) platforms,
18
- platform-as-a-service (PaaS), developer platforms, or any multi-tenant
19
- managed offering of the Licensed Work.
20
-
21
- This restriction does not apply to the Licensor, any entity controlled by,
22
- controlling, or under common control with the Licensor ("Affiliates"), or
23
- contractors acting on their behalf. The Licensor remains free to use the
24
- Licensed Work for any purpose, including for the operation of kumiko.rocks.
25
-
26
- Change Date: 2030-05-05
27
- Change License: Apache License, Version 2.0
28
-
29
-
30
- Terms
31
-
32
- The Licensor hereby grants you the right to copy, modify, create derivative works,
33
- redistribute, and make non-production use of the Licensed Work. The Licensor may
34
- make an Additional Use Grant, above, permitting limited production use.
35
-
36
- Effective on the Change Date, or the fourth anniversary of the first publicly
37
- available distribution of the Licensed Work under this License, whichever comes
38
- first, this License will convert to the Change License.
39
-
40
- This Business Source License governs use of the Licensed Work in all cases, except
41
- as to any use that is explicitly granted in the Additional Use Grant above or
42
- under the Change License after the Change Date.
43
-
44
- If your use of the Licensed Work does not comply with the requirements of this
45
- License, you must cease use of the Licensed Work immediately.
46
-
47
- All copies of the Licensed Work, and all derivative works thereof, must include
48
- this License.
49
-
50
- This License does not grant you any right, title, or interest in any trademark,
51
- logo, or branding of the Licensor, except as required to comply with this License.
52
-
53
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN
54
- “AS IS” BASIS. LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
55
- WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
56
- TITLE, AND NON-INFRINGEMENT. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY DAMAGES
57
- ARISING OUT OF OR RELATED TO THIS LICENSE OR THE USE OF THE LICENSED WORK.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marc Frost
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -11,4 +11,4 @@ packages/bundled-features/src/**
11
11
 
12
12
  This package contains plain sources only. It has no runtime API and no entry point; tests, build output and dotfiles are left out. Point tooling at the installed package directory (resolve `@cosmicdrift/kumiko-samples/package.json`), for example `buildFewShotCorpus({ repoRoot })` from `@cosmicdrift/kumiko-dev-server`, to get the same entry ids and source paths as in the monorepo.
13
13
 
14
- License: BUSL-1.1
14
+ License: MIT
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-samples",
3
- "version": "0.385.0",
3
+ "version": "0.387.0",
4
4
  "description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
5
- "license": "BUSL-1.1",
5
+ "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.385.0",
3
+ "version": "0.387.0",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
- "license": "BUSL-1.1",
5
+ "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
7
7
  "repository": {
8
8
  "type": "git",
@@ -100,7 +100,7 @@ function isDetailHandlerQn(qn: string, entityName: string): boolean {
100
100
  return qn.endsWith(`:${entityName}:detail`);
101
101
  }
102
102
 
103
- /** #2700: the entity CRUD tools are enumerated off the registry, not off the manifest, so
103
+ /** The entity CRUD tools are enumerated off the registry, not off the manifest, so
104
104
  * `resolveAgentExposure` never runs for them. Only an EXPLICIT opt-out may hide one here —
105
105
  * the resolver's own default is fail-closed on a missing `description`, and CRUD-generated
106
106
  * handlers never carry one, so reusing it would delete every entity tool in every app. */
@@ -427,8 +427,6 @@ export async function dispatchToolCall(request: ToolCallRequest): Promise<ToolCa
427
427
  }
428
428
 
429
429
  try {
430
- // The invoked tool, not the surrounding turn/approve write handler, must
431
- // be what the irreversible-operation gate sees as the entry handler.
432
430
  return await runAsDirectCallEntry(async () => {
433
431
  switch (descriptor.kind) {
434
432
  case "search":
@@ -100,7 +100,7 @@ export function auditLogDetailLayout(options: { readonly withTenant: boolean }):
100
100
  "id",
101
101
  ],
102
102
  },
103
- // No section `title` here (fw#2312 label-dedup fix): each section
103
+ // No section `title` here (label-dedup fix): each section
104
104
  // holds exactly one field, so a title would repeat the field's own
105
105
  // label (rendered by RenderField as the Field's heading) verbatim.
106
106
  { fields: [{ field: "payload", renderer: { format: "json" } }] },
@@ -17,19 +17,19 @@ export type AuthUserRow = {
17
17
  readonly isDeleted?: boolean | null;
18
18
  readonly emailVerified?: boolean | null;
19
19
  readonly lastActiveTenantId?: TenantId | string | null;
20
- // IANA zone — threaded into SessionUser.timezone at login (fw#1636).
20
+ // IANA zone — threaded into SessionUser.timezone at login.
21
21
  readonly timezone?: string | null;
22
- // BCP-47 tag — threaded into SessionUser.locale at login (fw#2333).
22
+ // BCP-47 tag — threaded into SessionUser.locale at login.
23
23
  readonly locale?: string | null;
24
- // JSON-encoded string[] — globale Rollen die parallel zu tenant-membership-
25
- // roles gelten (z.B. SystemAdmin, BillingAdmin). Caller deserialisiert via
26
- // parseRoles() vor dem Merge in die Session.
24
+ // JSON-encoded string[] — global roles that apply alongside tenant-membership-
25
+ // roles (for example, SystemAdmin and BillingAdmin). The caller deserializes
26
+ // them with parseRoles() before merging them into the session.
27
27
  readonly roles?: string | null;
28
- // user.status (S2.U1) — "active" | "restricted" | "deletion_requested" |
29
- // "deleted". Login.write.ts blockt Restricted (DSGVO Art. 18) sowie
30
- // DeletionRequested + Deleted. Untyped string hier weil die Quelle
31
- // user-feature-internes Enum ist; auth importiert den Constants-Wert
32
- // an der Verwendungsstelle.
28
+ // user.status — "active" | "restricted" | "deletion_requested" |
29
+ // "deleted". Login.write.ts blocks Restricted (DSGVO Art. 18),
30
+ // DeletionRequested, and Deleted. It remains an untyped string because the
31
+ // source enum is internal to the user feature; auth imports the constants at
32
+ // the point of use.
33
33
  readonly status?: string | null;
34
34
  };
35
35
 
@@ -120,13 +120,13 @@ export type AccountLockoutOptions = {
120
120
  // (256 bit) and Redis is the source of truth, so tokenTtlMinutes is the only knob.
121
121
  export type SignupOptions = SignupRequestOptions;
122
122
 
123
- // Tenant-Invite Magic-Link. Wenn gesetzt, registriert das Feature die
124
- // invite-create + invite-accept-Handler. Branch 2+3 (anon-flows) kommen
125
- // als separate Handler in einem Folge-Schritt. tokenTtlMinutes Default
126
- // 7 Tage (industry standard).
123
+ // Tenant-invite magic link. When set, the feature registers the
124
+ // invite-create and invite-accept handlers. Branches 2 and 3 (anonymous
125
+ // flows) will be added as separate handlers later. The default
126
+ // tokenTtlMinutes is 7 days (industry standard).
127
127
  export type InviteOptions = InviteCreateOptions;
128
128
 
129
- // Account-Unlock Magic-Link (#1266). When set, registers the
129
+ // Account-Unlock Magic-Link. When set, registers the
130
130
  // request-account-unlock + confirm-account-unlock handlers — the
131
131
  // self-service escape hatch for the monotonic lockout counter (see
132
132
  // lockout-store.ts). Only meaningful paired with `accountLockout`, but
@@ -180,7 +180,7 @@ export function createAuthEmailPasswordFeature(
180
180
  r.describe(
181
181
  "Provides email+password authentication: the always-on handlers are `login`, `changePassword`, and `logout`; optional flows — password reset, email verification, magic-link self-signup, tenant invite, and account-unlock — are registered only when you pass their respective option objects (`passwordReset`, `emailVerification`, `signup`, `invite`, `accountUnlock`) to `createAuthEmailPasswordFeature(opts)`. All five magic-link flows dispatch their mail through the `delivery` feature via `ctx.notify`, so mounting any of them additionally requires `delivery`. Tokens are HMAC-signed (reset/verify/unlock) or opaque-random in Redis (signup/invite). `accountUnlock` is the self-service escape hatch for `accountLockout`'s monotonic failure-counter (#1266): confirming the mailed token clears the Redis lockout state without touching the user entity. Requires the `user` and `tenant` features, and declares `JWT_SECRET` (≥ 32 chars) in `authEmailPasswordEnvSchema` so a missing secret surfaces at boot validation rather than on the first login attempt.",
182
182
  );
183
- // kumiko-lint-ignore i18n-ui-strings uiHints labels are feature-registry metadata for the admin feature catalog, not yet wired to the i18n system, see #2312
183
+ // kumiko-lint-ignore i18n-ui-strings uiHints labels are feature-registry metadata for the admin feature catalog, not yet wired to the i18n system
184
184
  r.uiHints({
185
185
  displayLabel: "Auth \u00b7 Email + Password",
186
186
  category: "identity",
@@ -55,9 +55,9 @@ export const changePasswordWrite = defineWriteHandler({
55
55
 
56
56
  const newHash = await hashPassword(event.payload.newPassword);
57
57
 
58
- // The user aggregate is systemStream (#497): its event stream lives on
59
- // SYSTEM_TENANT_ID deterministically. Pre-#497 scattered streams need the
60
- // one-time backfillUserStreamTenants migration (#762).
58
+ // The user aggregate is systemStream: its event stream lives on
59
+ // SYSTEM_TENANT_ID deterministically. Previously scattered streams need the
60
+ // one-time backfillUserStreamTenants migration.
61
61
  const writer = createSystemUser(SYSTEM_TENANT_ID);
62
62
 
63
63
  // Apply via user feature's update handler — writeAs(system) satisfies
@@ -15,11 +15,11 @@
15
15
  // else — including future branches a maintainer adds — releases
16
16
  // automatically.
17
17
  //
18
- // The user aggregate is systemStream (#497): its event stream lives on
18
+ // The user aggregate uses systemStream: its event stream lives on
19
19
  // SYSTEM_TENANT_ID deterministically, so the write targets exactly one
20
20
  // stream. The former membership-probing (`tryWriteAcrossTenants`) existed
21
- // for pre-#497 scattered streams; those need the one-time
22
- // backfillUserStreamTenants migration (#762) — probing them stopped working
21
+ // for scattered streams; those need the one-time
22
+ // backfillUserStreamTenants migration — probing them stopped working
23
23
  // the moment the executor's stream choke-point landed anyway.
24
24
 
25
25
  import {
@@ -108,8 +108,8 @@ export async function runConfirmTokenFlow<TSuccessData>(
108
108
  committed = true;
109
109
  return { isSuccess: true, data: spec.successData };
110
110
  }
111
- // version_conflict = concurrent modification (or an un-migrated pre-#497
112
- // stream, see header) → token-level failure. Anything else (DB down,
111
+ // version_conflict = concurrent modification (or an un-migrated
112
+ // stream) → token-level failure. Anything else (DB down,
113
113
  // access denied) bubbles unchanged so ops sees the real failure class.
114
114
  if (writeRes.error.code === "version_conflict") return spec.invalidToken();
115
115
  return writeRes;
@@ -191,7 +191,7 @@ export function createInviteAcceptWithLoginHandler(opts: InviteAcceptWithLoginOp
191
191
 
192
192
  // Password check against userTable, through the same gates
193
193
  // login.write.ts runs (see login-gates.test.ts for the gate contracts).
194
- // Email uniqueness is partial on live rows (framework#2593) — without
194
+ // Email uniqueness is partial on live rows — without
195
195
  // this filter the lookup can resolve a soft-deleted row.
196
196
  const userRow = await ctx.db.global(userTable).fetchOne<UserAuthRow>({
197
197
  email: invitationEmail,
@@ -1,19 +1,19 @@
1
- // Tenant-Invite Step 2 — Branch 1 (logged-in user accepts).
1
+ // Tenant invitation — logged-in user accepts.
2
2
  //
3
- // User ist eingeloggt (in irgendeinem Tenant), klickt Accept-Link.
3
+ // The user is signed in to some tenant and clicks the Accept link.
4
4
  // Server:
5
5
  // 1. Token → invitationId (Redis)
6
6
  // 2. Burn (single-use)
7
- // 3. Invitation-Row aus DB
8
- // 4. Email-Match: invitation.email === user.email (sonst inviteEmailMismatch)
7
+ // 3. Load the invitation row from the database
8
+ // 4. Email match: invitation.email === user.email (otherwise inviteEmailMismatch)
9
9
  // 5+6. grantInvitedMembershipRole: create the membership, or add the
10
10
  // invited role to an existing one (add-only)
11
- // 7. Invitation-Row → status=accepted
12
- // 8. Redis-Keys löschen (Burn-Key bleibt für Replay-Schutz)
11
+ // 7. Invitation row → status=accepted
12
+ // 8. Delete Redis keys (the burn key remains for replay protection)
13
13
  //
14
- // Branch 1 ist der klassische "shared workspace bei eingeloggter
15
- // Session"-Flow. Branch 2 (anon + existing email) und Branch 3 (anon +
16
- // new email) kommen als separate Handler.
14
+ // This is the classic "shared workspace with a logged-in session" flow.
15
+ // Branch 2 (anonymous + existing email) and Branch 3 (anonymous + new
16
+ // email) are handled separately.
17
17
 
18
18
  import {
19
19
  createEventStoreExecutor,
@@ -29,7 +29,7 @@ import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/error
29
29
  import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
30
30
  import * as z from "zod";
31
31
  import { decryptStoredPii } from "../../shared/index.ts";
32
- // kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link), DB-row-owner ist tenant-feature
32
+ // kumiko-lint-ignore cross-feature-import the invite flow lives in auth-email-password (Magic-Link), while the DB-row owner is a tenant feature
33
33
  import {
34
34
  INVITATION_STATUS,
35
35
  tenantInvitationEntity,
@@ -42,7 +42,7 @@ import {
42
42
  grantInvitedGlobalRoles,
43
43
  parseInvitedGlobalRoles,
44
44
  } from "../../user/invited-global-roles.ts";
45
- // kumiko-lint-ignore cross-feature-import auth handler reads user-row für email-match
45
+ // kumiko-lint-ignore cross-feature-import the auth handler reads the user row for the email match
46
46
  import { userTable } from "../../user/schema/user.ts";
47
47
  import { invalidInviteToken, inviteEmailMismatch } from "../errors.ts";
48
48
  import {
@@ -138,9 +138,9 @@ export function createInviteAcceptHandler() {
138
138
  const invitationRole = invitation.role;
139
139
  const invitationVersion = invitation.version;
140
140
 
141
- // Email-Match: User muss mit der eingeladenen Email matchen.
142
- // Sonst kann ein Angreifer mit Zugriff zur invitee-Mail seinen
143
- // eigenen Account dem Tenant zuschlagen.
141
+ // Email match: the user must match the invited email.
142
+ // Otherwise, anyone with access to the invitee's email could add
143
+ // their own account to the tenant.
144
144
  const userRow = await ctx.db.global(userTable).fetchOne<UserEmailRow>({
145
145
  id: event.user.id,
146
146
  });
@@ -169,10 +169,10 @@ export function createInviteAcceptHandler() {
169
169
  });
170
170
  if (!globalGrant.isSuccess) return globalGrant;
171
171
 
172
- // Invitation-Status → accepted via event-store-executor.
173
- // Tenant-scoping: ctx.db ist auf event.user.tenantId gescopt
174
- // (= NICHT der invitation-tenant). Eigene TenantDb für den
175
- // invitation-tenant bauen damit der executor die row findet.
172
+ // Invitation status → accepted via event-store-executor.
173
+ // Tenant scoping: ctx.db is scoped to event.user.tenantId
174
+ // (not the invitation tenant). Build a TenantDb for the
175
+ // invitation tenant so the executor can find the row.
176
176
  const invitationTdb = createTenantDb({
177
177
  db: dbConn,
178
178
  tenantId: invitationTenantId,
@@ -1,10 +1,10 @@
1
1
  // Tenant-Invite Step 1 (create).
2
2
  //
3
- // Admin invitet email → DB-Row entsteht via event-store-executor (oder
4
- // wird re-used bei Re-Invite), Random-Token in Redis bidirektional, und der
5
- // Handler schickt die Invite-Mail an den Invitee via delivery (ctx.notify) —
6
- // wie reset/verify/signup. Der Token geht NICHT an den Admin zurück (er soll
7
- // die Annahme nicht impersonieren können).
3
+ // An admin invites an email address → a DB row is created via
4
+ // event-store-executor (or reused for a re-invite), a random token is stored
5
+ // bidirectionally in Redis, and the handler sends the invite email to the
6
+ // invitee via delivery (ctx.notify), as with reset/verify/signup. The token
7
+ // is NOT returned to the admin, so the admin cannot impersonate acceptance.
8
8
  //
9
9
  // Re-invite for the same (tenantId, email): the existing row is reused
10
10
  // regardless of its prior status (pending/cancelled/accepted), reset to
@@ -12,10 +12,10 @@
12
12
  // still live for that invitation is invalidated first, so the previous
13
13
  // mail's link stops working (see invite-token-store.ts).
14
14
  //
15
- // Always-200 für unbekannten User: bei invitee-Email die nicht in users
16
- // existiert wird trotzdem ein Invite erstellt — Branch-3-Accept-Flow
17
- // erlaubt new-user-signup mit dem Token. Keine Enumeration durchs
18
- // invite-create.
15
+ // Always-200 for an unknown user: an invite is created even when the
16
+ // invitee's email does not exist in users — the Branch-3-Accept-Flow
17
+ // permits new-user-signup with the token. invite-create does not enable
18
+ // enumeration.
19
19
 
20
20
  import { generateToken } from "@cosmicdrift/kumiko-framework/api";
21
21
  import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
@@ -35,7 +35,7 @@ import {
35
35
  import { isValidLocaleTag } from "@cosmicdrift/kumiko-framework/i18n";
36
36
  import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
37
37
  import * as z from "zod";
38
- // kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link-Pattern), DB-row-owner ist tenant-feature
38
+ // kumiko-lint-ignore cross-feature-import invite flow lives in auth-email-password (Magic-Link-Pattern); DB-row owner is the tenant feature
39
39
  import {
40
40
  INVITATION_STATUS,
41
41
  tenantInvitationEntity,
@@ -77,7 +77,7 @@ export type InviteCreateData = {
77
77
  };
78
78
 
79
79
  export type InviteCreateOptions = {
80
- /** TTL für den Activation-Token. Default 7 Tage. */
80
+ /** TTL for the activation token. Default: 7 days. */
81
81
  readonly tokenTtlMinutes?: number;
82
82
  /** App page that receives the magic-link; the handler appends `?token=…`
83
83
  * and dispatches the invite mail via delivery (ctx.notify). Apps with
@@ -95,7 +95,7 @@ export type InviteCreateOptions = {
95
95
  // further restrict assignable ranked roles.
96
96
  readonly canAssignRole?: (inviterRoles: readonly string[], targetRole: string) => boolean;
97
97
  /** Opt-in allow-list for app-defined (unranked) roles the elevation guard
98
- * would otherwise reject with unassignable_membership_role (fw#2398).
98
+ * would otherwise reject with unassignable_membership_role.
99
99
  * Rank-aware alternative: declare roles via EXT_ASSIGNABLE_ROLE. */
100
100
  readonly additionalAssignableRoles?: readonly string[];
101
101
  };
@@ -10,7 +10,7 @@ import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
10
10
  import { UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
11
11
  import * as z from "zod";
12
12
  import { decryptStoredPii } from "../../shared/index.ts";
13
- // kumiko-lint-ignore cross-feature-import invite-flow lebt in auth-email-password (Magic-Link), DB-row-owner ist tenant-feature
13
+ // kumiko-lint-ignore cross-feature-import invite-flow lives in auth-email-password (Magic-Link), DB-row-owner belongs to the tenant feature
14
14
  import { INVITATION_STATUS, tenantInvitationsTable } from "../../tenant/invitation-table.ts";
15
15
  // kumiko-lint-ignore cross-feature-import login-style account lookup, same as invite-accept-with-login
16
16
  import { userTable } from "../../user/schema/user.ts";
@@ -1,21 +1,21 @@
1
- // Tenant-Invite Step 2 — Branch 3 (anon User, Email NICHT registriert).
1
+ // Tenant-Invite Step 2 — Branch 3 (anonymous user, email NOT registered).
2
2
  //
3
- // Anders als signup-confirm: KEIN neuer Tenant entsteht. Der Tenant
4
- // existiert schon (im invitation-row), wir legen NUR User+Membership an.
3
+ // Unlike signup-confirm, no new tenant is created. The tenant already
4
+ // exists in the invitation row; only the user and membership are created.
5
5
  //
6
6
  // Flow:
7
- // 1. User klickt Invite-Link → /invite/signup?token=...
8
- // 2. Frontend zeigt Password-Form (email kommt aus invitation, kein
9
- // User-Input damit kein Email-Mismatch möglich)
10
- // 3. User submitted password + token
7
+ // 1. User clicks the invite link → /invite/signup?token=...
8
+ // 2. The frontend shows the password form (the email comes from the
9
+ // invitation, not user input, so an email mismatch is impossible)
10
+ // 3. User submits the password and token
11
11
  // 4. Server:
12
12
  // a. Token → invitationId → invitation row
13
- // b. User-Existence-Check: invitation.email darf NICHT in userTable
14
- // existieren (sonst soll Branch 2 oder Branch 1 genutzt werden)
15
- // c. Create user (emailVerified=true wegen Magic-Link)
16
- // d. Add membership im invited Tenant
17
- // e. Invitation → accepted, Token gelöscht
18
- // 5. Response: SessionUser + tenantId für Auto-Login
13
+ // b. User-existence check: invitation.email must NOT exist in userTable
14
+ // (otherwise Branch 2 or Branch 1 must be used)
15
+ // c. Create the user (emailVerified=true because of the magic link)
16
+ // d. Add membership to the invited tenant
17
+ // e. Mark the invitation accepted and delete the token
18
+ // 5. Response: SessionUser + tenantId for automatic login
19
19
 
20
20
  import {
21
21
  createEventStoreExecutor,
@@ -44,7 +44,7 @@ import {
44
44
  findForbiddenMembershipRole,
45
45
  reservedMembershipRoleError,
46
46
  } from "../../tenant/membership-roles.ts";
47
- // kumiko-lint-ignore cross-feature-import membership-seed-helper für privilegierten cross-tenant-add
47
+ // kumiko-lint-ignore cross-feature-import membership-seed-helper for privileged cross-tenant addition
48
48
  import { seedTenantMembership } from "../../tenant/seeding.ts";
49
49
  // kumiko-lint-ignore cross-feature-import global roles granted on invite accept live on the user row
50
50
  import { parseInvitedGlobalRoles } from "../../user/invited-global-roles.ts";
@@ -144,20 +144,19 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
144
144
  const invitationGlobalRoles = parseInvitedGlobalRoles(invitation.globalRoles);
145
145
  const invitationVersion = invitation.version;
146
146
 
147
- // User-Not-Exists-Check: wenn die Email schon registriert ist,
148
- // muss der User Branch 2 (acceptWithLogin) nutzen. Hier ist
149
- // explizit "neue Email" — sonst hätten wir zwei Wege ein
150
- // Password zu setzen für denselben User.
151
- // Email uniqueness is partial on live rows (framework#2593) — without
152
- // this filter the lookup can resolve a soft-deleted row.
147
+ // If the email is already registered, the user must use Branch 2
148
+ // (acceptWithLogin). This flow explicitly requires a new email;
149
+ // otherwise there would be two ways to set a password for the same user.
150
+ // Email uniqueness is partial on live rows — without this filter,
151
+ // the lookup can resolve a soft-deleted row.
153
152
  const existingUser = await ctx.db.global(userTable).fetchOne({
154
153
  email: invitationEmail,
155
154
  isDeleted: false,
156
155
  });
157
156
  if (existingUser) return invalidInviteToken();
158
157
 
159
- // User anlegen via seedUserWithPassword (gleiches Pattern wie
160
- // signup-confirm), emailVerified=true wegen Magic-Link.
158
+ // Create the user through seedUserWithPassword so the magic-link flow
159
+ // records emailVerified=true.
161
160
  // @cast-boundary db-runner — helpers use only the query API that
162
161
  // DbConnection and DbTx share.
163
162
  const dbConn = ctx.db.unsafeRaw() as DbConnection;
@@ -171,9 +170,8 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
171
170
  ...(invitationGlobalRoles.length > 0 && { roles: invitationGlobalRoles }),
172
171
  });
173
172
 
174
- // Membership-Add via seed-helper (gleiches Pattern wie
175
- // provisionSignupAccount — bypassed addMember access-check
176
- // weil createSystemUser nicht ["SystemAdmin"] matcht).
173
+ // The seed helper bypasses addMember's access check because
174
+ // createSystemUser does not match ["SystemAdmin"].
177
175
  const forbiddenInviteRole = findForbiddenMembershipRole([invitationRole]);
178
176
  if (forbiddenInviteRole !== undefined) {
179
177
  return writeFailure(reservedMembershipRoleError(forbiddenInviteRole));
@@ -184,7 +182,7 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
184
182
  roles: [invitationRole],
185
183
  });
186
184
 
187
- // Invitation → accepted: TenantDb für invitation-tenant
185
+ // Update the invitation in the invited tenant's database context.
188
186
  const invitationTdb = createTenantDb({
189
187
  db: dbConn,
190
188
  tenantId: invitationTenantId,
@@ -93,7 +93,7 @@ function ok<T>(value: T): GateOk<T> {
93
93
 
94
94
  type AuthenticatableUserRow = AuthUserRow & { readonly passwordHash: string };
95
95
 
96
- /** Uniform response on any credential miss — burns argon2 cost (#774). */
96
+ /** Uniform response on any credential miss — burns argon2 cost. */
97
97
  export async function gateResolveAuthUser(
98
98
  found: AuthUserRow | null,
99
99
  password: string,
@@ -18,7 +18,7 @@ export const selfRegistrationStatusQuery = defineQueryHandler({
18
18
  description:
19
19
  "Reports whether self-registration is currently switched on, readable without signing in, so a signup page can hide its own form instead of collecting an address that would be silently ignored.",
20
20
  handler: async (_query, ctx) => {
21
- // Same fail-open reasoning as signup-request.write.ts (#1468): only
21
+ // Same fail-open reasoning as signup-request.write.ts: only
22
22
  // report disabled when the toggle feature is actually composed.
23
23
  const gated = ctx.registry.getFeature(AUTH_SELF_REGISTRATION_FEATURE) !== undefined;
24
24
  return { enabled: gated ? await ctx.hasFeature(AUTH_SELF_REGISTRATION_FEATURE) : true };