@cosmicdrift/kumiko-framework 0.369.0 → 0.370.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 (449) hide show
  1. package/AGENTS.md +14 -1
  2. package/agents/examples/apex-surface-auth.md +2 -1
  3. package/agents/examples/app-config.md +98 -0
  4. package/agents/examples/auth-mfa.md +72 -0
  5. package/agents/examples/compose-stacks.md +188 -0
  6. package/agents/examples/env-composition.md +268 -0
  7. package/agents/examples/host-routing.md +181 -0
  8. package/agents/examples/legal-pages.md +52 -3
  9. package/agents/examples/managed-config.md +1 -0
  10. package/agents/examples/managed-pages.md +1 -0
  11. package/agents/examples/prod-boot-options.md +180 -0
  12. package/agents/examples/relations.md +4 -0
  13. package/agents/examples/secrets-demo.md +4 -2
  14. package/agents/examples/security-baseline.md +20 -17
  15. package/agents/examples.md +6 -1
  16. package/agents/features.md +14 -2
  17. package/dist/api/anonymous-cookie.d.ts +1 -1
  18. package/dist/api/anonymous-live-entities.d.ts +1 -1
  19. package/dist/api/auth-middleware.d.ts +2 -2
  20. package/dist/api/auth-routes.d.ts +7 -7
  21. package/dist/api/extra-route.d.ts +2 -2
  22. package/dist/api/index.d.ts +37 -37
  23. package/dist/api/jwt.d.ts +1 -1
  24. package/dist/api/observability-middleware.d.ts +1 -1
  25. package/dist/api/readiness.d.ts +1 -1
  26. package/dist/api/redis-sse-broker.d.ts +2 -2
  27. package/dist/api/request-context.d.ts +1 -1
  28. package/dist/api/request-id-middleware.d.ts +3 -3
  29. package/dist/api/route-registrars.d.ts +4 -4
  30. package/dist/api/routes.d.ts +1 -1
  31. package/dist/api/server.d.ts +16 -16
  32. package/dist/api/sse-broker.d.ts +1 -1
  33. package/dist/api/sse-route.d.ts +1 -1
  34. package/dist/api/websocket-route.d.ts +3 -3
  35. package/dist/auth/index.d.ts +2 -2
  36. package/dist/compliance/duration-spec.d.ts +2 -2
  37. package/dist/compliance/index.d.ts +6 -6
  38. package/dist/compliance/profiles.d.ts +1 -1
  39. package/dist/config/index.d.ts +44 -0
  40. package/dist/config/index.js +61 -0
  41. package/dist/crypto/blind-index.d.ts +1 -1
  42. package/dist/crypto/event-pii.d.ts +1 -1
  43. package/dist/crypto/in-memory-kms-adapter.d.ts +1 -1
  44. package/dist/crypto/index.d.ts +11 -11
  45. package/dist/crypto/is-self-pii-field.d.ts +1 -1
  46. package/dist/crypto/kms-wiring.d.ts +2 -2
  47. package/dist/crypto/owner-transition-rekey.d.ts +1 -1
  48. package/dist/crypto/pg-kms-adapter.d.ts +1 -1
  49. package/dist/crypto/pii-field-encryption.d.ts +4 -4
  50. package/dist/crypto/request-kms-cache.d.ts +1 -1
  51. package/dist/crypto/subject-resolver.d.ts +3 -3
  52. package/dist/db/apply-entity-event.d.ts +4 -4
  53. package/dist/db/assert-exists-in.d.ts +4 -4
  54. package/dist/db/blind-index-cleanup.d.ts +2 -2
  55. package/dist/db/collect-table-metas.d.ts +2 -2
  56. package/dist/db/compound-types.d.ts +1 -1
  57. package/dist/db/config-seed.d.ts +5 -5
  58. package/dist/db/connection.d.ts +1 -6
  59. package/dist/db/connection.js +15 -4
  60. package/dist/db/dialect.d.ts +1 -1
  61. package/dist/db/eagerload.d.ts +3 -3
  62. package/dist/db/entity-field-encryption.d.ts +3 -3
  63. package/dist/db/entity-field-encryption.js +3 -1
  64. package/dist/db/entity-table-from-registry.d.ts +3 -3
  65. package/dist/db/entity-table-meta.d.ts +3 -3
  66. package/dist/db/event-store-executor-context.d.ts +9 -9
  67. package/dist/db/event-store-executor-read.d.ts +2 -2
  68. package/dist/db/event-store-executor-write.d.ts +2 -2
  69. package/dist/db/event-store-executor.d.ts +8 -8
  70. package/dist/db/feature-table-sources.d.ts +1 -1
  71. package/dist/db/index.d.ts +39 -39
  72. package/dist/db/located-timestamp.d.ts +1 -1
  73. package/dist/db/lock-guard.d.ts +2 -2
  74. package/dist/db/migrate-generator.d.ts +2 -2
  75. package/dist/db/migrate-runner.d.ts +1 -1
  76. package/dist/db/money.d.ts +1 -1
  77. package/dist/db/parent-ref-clause.d.ts +4 -4
  78. package/dist/db/projection-registry-binding.d.ts +1 -1
  79. package/dist/db/queries/advisory-lock.d.ts +1 -1
  80. package/dist/db/queries/backfill-pii.d.ts +2 -2
  81. package/dist/db/queries/ddl.d.ts +1 -1
  82. package/dist/db/queries/entity-read.d.ts +1 -1
  83. package/dist/db/queries/es-ops.d.ts +1 -1
  84. package/dist/db/queries/event-consumer.d.ts +2 -2
  85. package/dist/db/queries/event-store-admin.d.ts +1 -1
  86. package/dist/db/queries/event-store-transfer.d.ts +1 -1
  87. package/dist/db/queries/event-store.d.ts +1 -1
  88. package/dist/db/queries/pii-backfill-state.d.ts +1 -1
  89. package/dist/db/queries/projection-rebuild.d.ts +1 -1
  90. package/dist/db/queries/raw-sql.d.ts +1 -1
  91. package/dist/db/queries/seed-context.d.ts +2 -2
  92. package/dist/db/queries/shadow-swap.d.ts +3 -3
  93. package/dist/db/queries/table-ops.d.ts +1 -1
  94. package/dist/db/queries/test-stack.d.ts +2 -2
  95. package/dist/db/query.d.ts +3 -3
  96. package/dist/db/rebuild-marker.d.ts +1 -1
  97. package/dist/db/reference-data.d.ts +3 -3
  98. package/dist/db/render-ddl.d.ts +1 -1
  99. package/dist/db/replay-migration-sql.d.ts +1 -1
  100. package/dist/db/retired-framework-tables.d.ts +1 -1
  101. package/dist/db/schema-inspection.d.ts +1 -1
  102. package/dist/db/table-builder.d.ts +4 -4
  103. package/dist/db/table-push.d.ts +3 -3
  104. package/dist/db/tenant-db-runner.d.ts +2 -2
  105. package/dist/db/tenant-db.d.ts +7 -9
  106. package/dist/db/tenant-db.js +2 -12
  107. package/dist/derivatives/derivatives-context.d.ts +3 -3
  108. package/dist/derivatives/field-variants.d.ts +1 -1
  109. package/dist/derivatives/index.d.ts +6 -6
  110. package/dist/engine/access.d.ts +1 -1
  111. package/dist/engine/active-membership.d.ts +2 -2
  112. package/dist/engine/boot-validator/access-declarations.d.ts +1 -1
  113. package/dist/engine/boot-validator/access-roles.d.ts +1 -1
  114. package/dist/engine/boot-validator/action-wiring.d.ts +1 -1
  115. package/dist/engine/boot-validator/api-ext.d.ts +1 -1
  116. package/dist/engine/boot-validator/boot-check.d.ts +1 -1
  117. package/dist/engine/boot-validator/card-meta-overflow.d.ts +1 -1
  118. package/dist/engine/boot-validator/config-deps.d.ts +1 -1
  119. package/dist/engine/boot-validator/detail-screens.d.ts +2 -2
  120. package/dist/engine/boot-validator/entity-handler.d.ts +1 -1
  121. package/dist/engine/boot-validator/entity-list-screens.d.ts +1 -1
  122. package/dist/engine/boot-validator/gdpr-storage.d.ts +1 -1
  123. package/dist/engine/boot-validator/global-tenancy.d.ts +1 -1
  124. package/dist/engine/boot-validator/handler-field-references.d.ts +1 -1
  125. package/dist/engine/boot-validator/i18n-keys.d.ts +1 -1
  126. package/dist/engine/boot-validator/index.d.ts +7 -7
  127. package/dist/engine/boot-validator/nav.d.ts +1 -1
  128. package/dist/engine/boot-validator/ownership.d.ts +2 -2
  129. package/dist/engine/boot-validator/parent-ref.d.ts +1 -1
  130. package/dist/engine/boot-validator/pii-retention.d.ts +2 -2
  131. package/dist/engine/boot-validator/projection-list-screens.d.ts +1 -1
  132. package/dist/engine/boot-validator/query-output-columns.d.ts +1 -1
  133. package/dist/engine/boot-validator/query-refs.d.ts +1 -1
  134. package/dist/engine/boot-validator/record-owned.d.ts +1 -1
  135. package/dist/engine/boot-validator/screens.d.ts +2 -2
  136. package/dist/engine/boot-validator/security-baseline.d.ts +1 -1
  137. package/dist/engine/boot-validator/selector-owner-panels.d.ts +1 -1
  138. package/dist/engine/boot-validator/transfer-graph.d.ts +2 -2
  139. package/dist/engine/boot-validator/url-prefill-fields.d.ts +1 -1
  140. package/dist/engine/boot-validator/workspaces.d.ts +1 -1
  141. package/dist/engine/boot-validator.d.ts +1 -1
  142. package/dist/engine/bridge-stub.d.ts +1 -1
  143. package/dist/engine/build-app-schema.d.ts +2 -2
  144. package/dist/engine/build-config-feature-schema.d.ts +5 -5
  145. package/dist/engine/build-target.d.ts +2 -2
  146. package/dist/engine/changeset-changes.d.ts +1 -1
  147. package/dist/engine/codemod/index.d.ts +2 -2
  148. package/dist/engine/config-helpers.d.ts +1 -1
  149. package/dist/engine/constants.d.ts +1 -1
  150. package/dist/engine/create-app.d.ts +2 -2
  151. package/dist/engine/cross-tenant.d.ts +2 -2
  152. package/dist/engine/dedupe-features.d.ts +1 -1
  153. package/dist/engine/define-feature.d.ts +1 -1
  154. package/dist/engine/define-feature.js +2 -2
  155. package/dist/engine/define-handler.d.ts +4 -4
  156. package/dist/engine/define-step.d.ts +1 -1
  157. package/dist/engine/define-workflow.d.ts +2 -2
  158. package/dist/engine/effective-features.d.ts +1 -1
  159. package/dist/engine/embedded-derived.d.ts +1 -1
  160. package/dist/engine/entity-handlers.d.ts +6 -5
  161. package/dist/engine/entity-handlers.js +6 -3
  162. package/dist/engine/event-def.d.ts +15 -0
  163. package/dist/engine/event-def.js +123 -0
  164. package/dist/engine/event-helpers.d.ts +1 -1
  165. package/dist/engine/extension-names.d.ts +8 -8
  166. package/dist/engine/extension-selector-plugins.d.ts +2 -2
  167. package/dist/engine/extensions/escape-hatch-usage.d.ts +1 -1
  168. package/dist/engine/extensions/storage-provider.d.ts +1 -1
  169. package/dist/engine/extensions/tenant-data.d.ts +3 -3
  170. package/dist/engine/extensions/tenant-resource.d.ts +2 -2
  171. package/dist/engine/extensions/user-data.d.ts +2 -2
  172. package/dist/engine/factories.d.ts +1 -1
  173. package/dist/engine/feature-ast/extractors/ai-steps.d.ts +2 -2
  174. package/dist/engine/feature-ast/extractors/events.d.ts +2 -2
  175. package/dist/engine/feature-ast/extractors/handlers.d.ts +4 -4
  176. package/dist/engine/feature-ast/extractors/hooks.d.ts +5 -5
  177. package/dist/engine/feature-ast/extractors/index.d.ts +14 -14
  178. package/dist/engine/feature-ast/extractors/jobs-routes.d.ts +3 -3
  179. package/dist/engine/feature-ast/extractors/projections-screens.d.ts +3 -3
  180. package/dist/engine/feature-ast/extractors/round1.d.ts +2 -2
  181. package/dist/engine/feature-ast/extractors/round2.d.ts +2 -2
  182. package/dist/engine/feature-ast/extractors/round3.d.ts +4 -4
  183. package/dist/engine/feature-ast/extractors/round5.d.ts +2 -2
  184. package/dist/engine/feature-ast/extractors/round6.d.ts +2 -2
  185. package/dist/engine/feature-ast/extractors/shared.d.ts +2 -2
  186. package/dist/engine/feature-ast/index.d.ts +16 -16
  187. package/dist/engine/feature-ast/parse.d.ts +2 -2
  188. package/dist/engine/feature-ast/patch.d.ts +1 -1
  189. package/dist/engine/feature-ast/patcher.d.ts +15 -15
  190. package/dist/engine/feature-ast/pattern-change-schema.d.ts +10 -10
  191. package/dist/engine/feature-ast/patterns.d.ts +15 -15
  192. package/dist/engine/feature-ast/render.d.ts +1 -1
  193. package/dist/engine/feature-builder-state.d.ts +5 -5
  194. package/dist/engine/feature-config-events-jobs.d.ts +3 -3
  195. package/dist/engine/feature-config-events-jobs.js +8 -130
  196. package/dist/engine/feature-entity-handlers.d.ts +4 -4
  197. package/dist/engine/feature-entity-handlers.js +11 -5
  198. package/dist/engine/feature-manifest.d.ts +1 -1
  199. package/dist/engine/feature-ui-extensions.d.ts +7 -7
  200. package/dist/engine/feature-ui-extensions.js +2 -2
  201. package/dist/engine/field-access.d.ts +1 -1
  202. package/dist/engine/field-helpers.d.ts +1 -1
  203. package/dist/engine/handler-helpers.d.ts +1 -1
  204. package/dist/engine/index.d.ts +89 -88
  205. package/dist/engine/index.js +1 -0
  206. package/dist/engine/instruction-fields.d.ts +1 -1
  207. package/dist/engine/object-form.d.ts +1 -1
  208. package/dist/engine/object-form.js +5 -6
  209. package/dist/engine/ownership.d.ts +3 -3
  210. package/dist/engine/pattern-library/index.d.ts +2 -2
  211. package/dist/engine/pattern-library/library.d.ts +2 -2
  212. package/dist/engine/pattern-library/mixed-schemas.d.ts +1 -1
  213. package/dist/engine/pattern-library/opaque-schemas.d.ts +1 -1
  214. package/dist/engine/pattern-library/shared-fields.d.ts +1 -1
  215. package/dist/engine/pattern-library/static-schemas.d.ts +1 -1
  216. package/dist/engine/pattern-library/types.d.ts +1 -1
  217. package/dist/engine/personal-data-fields.d.ts +2 -2
  218. package/dist/engine/pipeline.d.ts +2 -2
  219. package/dist/engine/project-app-schema-for-roles.d.ts +1 -1
  220. package/dist/engine/projection-helpers.d.ts +4 -4
  221. package/dist/engine/read-claim.d.ts +1 -1
  222. package/dist/engine/registry-facade.d.ts +2 -2
  223. package/dist/engine/registry-ingest.d.ts +2 -2
  224. package/dist/engine/registry-state.d.ts +2 -2
  225. package/dist/engine/registry-validate.d.ts +3 -3
  226. package/dist/engine/registry.d.ts +1 -1
  227. package/dist/engine/resolve-config-or-param.d.ts +2 -2
  228. package/dist/engine/role-assignment.d.ts +1 -1
  229. package/dist/engine/run-in.d.ts +1 -1
  230. package/dist/engine/run-pipeline.d.ts +3 -3
  231. package/dist/engine/schema-builder.d.ts +1 -1
  232. package/dist/engine/screen-filter-ops.d.ts +1 -1
  233. package/dist/engine/screen-helpers.d.ts +2 -2
  234. package/dist/engine/soft-delete-cleanup.d.ts +2 -2
  235. package/dist/engine/steps/_event-match.d.ts +1 -1
  236. package/dist/engine/steps/_no-return-guard.d.ts +1 -1
  237. package/dist/engine/steps/_read-source.d.ts +4 -4
  238. package/dist/engine/steps/_resolver-utils.d.ts +1 -1
  239. package/dist/engine/steps/aggregate-append-event.d.ts +1 -1
  240. package/dist/engine/steps/aggregate-create.d.ts +2 -2
  241. package/dist/engine/steps/aggregate-update.d.ts +3 -3
  242. package/dist/engine/steps/branch.d.ts +1 -1
  243. package/dist/engine/steps/call-feature.d.ts +2 -2
  244. package/dist/engine/steps/compute.d.ts +1 -1
  245. package/dist/engine/steps/for-each.d.ts +1 -1
  246. package/dist/engine/steps/mail-send.d.ts +1 -1
  247. package/dist/engine/steps/read-find-many.d.ts +2 -2
  248. package/dist/engine/steps/read-find-one.d.ts +2 -2
  249. package/dist/engine/steps/retry.d.ts +1 -1
  250. package/dist/engine/steps/return.d.ts +2 -2
  251. package/dist/engine/steps/unsafe-projection-delete.d.ts +2 -2
  252. package/dist/engine/steps/unsafe-projection-upsert.d.ts +1 -1
  253. package/dist/engine/steps/wait-for-event.d.ts +1 -1
  254. package/dist/engine/steps/wait.d.ts +1 -1
  255. package/dist/engine/steps/webhook-send.d.ts +1 -1
  256. package/dist/engine/strip-disabled-features-from-app-schema.d.ts +4 -4
  257. package/dist/engine/system-user.d.ts +2 -2
  258. package/dist/engine/template-variables.d.ts +1 -1
  259. package/dist/engine/tier-resolver-extension.d.ts +4 -4
  260. package/dist/engine/transfer-adjacency.d.ts +1 -1
  261. package/dist/engine/types/index.d.ts +6 -6
  262. package/dist/engine/validate-projection-allowlist.d.ts +1 -1
  263. package/dist/engine/validation.d.ts +1 -1
  264. package/dist/entrypoint/index.d.ts +12 -12
  265. package/dist/env/dry-run.d.ts +14 -1
  266. package/dist/env/dry-run.js +50 -0
  267. package/dist/env/index.d.ts +54 -16
  268. package/dist/env/index.js +60 -6
  269. package/dist/errors/classes.d.ts +3 -3
  270. package/dist/errors/docs-url.d.ts +1 -1
  271. package/dist/errors/index.d.ts +18 -18
  272. package/dist/errors/member-resolution.d.ts +1 -1
  273. package/dist/errors/serialize.d.ts +2 -2
  274. package/dist/errors/subject-erased.d.ts +1 -1
  275. package/dist/errors/to-kumiko-error.d.ts +1 -1
  276. package/dist/errors/write-error-info.d.ts +1 -1
  277. package/dist/errors/zod-bridge.d.ts +1 -1
  278. package/dist/es-ops/context.d.ts +4 -4
  279. package/dist/es-ops/index.d.ts +4 -4
  280. package/dist/es-ops/operations-schema.d.ts +1 -1
  281. package/dist/es-ops/runner.d.ts +3 -3
  282. package/dist/es-ops/runner.js +9 -1
  283. package/dist/es-ops/types.d.ts +2 -2
  284. package/dist/event-store/admin-api.d.ts +3 -3
  285. package/dist/event-store/archive.d.ts +2 -2
  286. package/dist/event-store/event-store.d.ts +2 -2
  287. package/dist/event-store/events-schema.d.ts +1 -1
  288. package/dist/event-store/index.d.ts +15 -15
  289. package/dist/event-store/provenance-append.d.ts +3 -3
  290. package/dist/event-store/rebuild-dead-letter.d.ts +2 -2
  291. package/dist/event-store/row-to-stored-event.d.ts +2 -2
  292. package/dist/event-store/snapshot.d.ts +2 -2
  293. package/dist/event-store/tenant-db-append.d.ts +2 -2
  294. package/dist/event-store/transfer.d.ts +3 -3
  295. package/dist/event-store/upcaster-dead-letter.d.ts +2 -2
  296. package/dist/event-store/upcaster.d.ts +3 -3
  297. package/dist/files/assert-file-refs-belong-to-tenant.d.ts +2 -2
  298. package/dist/files/bind-pending-file-refs.d.ts +3 -3
  299. package/dist/files/create-file-ref-from-bytes.d.ts +4 -4
  300. package/dist/files/create-file-ref.d.ts +3 -3
  301. package/dist/files/dispose-removed-file-refs.d.ts +2 -2
  302. package/dist/files/feature.d.ts +3 -3
  303. package/dist/files/file-handle.d.ts +1 -1
  304. package/dist/files/file-ref-entity.d.ts +1 -1
  305. package/dist/files/file-ref-table.d.ts +1 -1
  306. package/dist/files/file-routes.d.ts +5 -5
  307. package/dist/files/in-memory-provider.d.ts +1 -1
  308. package/dist/files/index.d.ts +20 -20
  309. package/dist/files/load-save-file-refs.d.ts +2 -2
  310. package/dist/files/local-provider.d.ts +1 -1
  311. package/dist/files/provider-resolver.d.ts +5 -5
  312. package/dist/files/purge-expired-file-ref-bytes.d.ts +2 -2
  313. package/dist/files/record-read-check.d.ts +1 -1
  314. package/dist/files/record-write-check.d.ts +3 -3
  315. package/dist/files/storage-tracking.d.ts +2 -2
  316. package/dist/files/types.d.ts +1 -1
  317. package/dist/files/zip-stream.d.ts +1 -1
  318. package/dist/i18n/index.d.ts +4 -4
  319. package/dist/i18n/mail-registry.d.ts +1 -1
  320. package/dist/i18n/required-surface-keys.d.ts +1 -1
  321. package/dist/i18n/settings-hub-keys.d.ts +1 -1
  322. package/dist/internal/stack-support.d.ts +12 -12
  323. package/dist/internal/testing.d.ts +4 -4
  324. package/dist/jobs/index.d.ts +2 -2
  325. package/dist/jobs/job-runner.d.ts +1 -1
  326. package/dist/jobs/max-per-tenant.d.ts +1 -1
  327. package/dist/lifecycle/index.d.ts +2 -2
  328. package/dist/lifecycle/lifecycle.d.ts +1 -1
  329. package/dist/lifecycle/signal-handlers.d.ts +1 -1
  330. package/dist/logging/index.d.ts +4 -4
  331. package/dist/logging/pino-logger.d.ts +1 -1
  332. package/dist/logging/utils.d.ts +1 -1
  333. package/dist/migrations/index.d.ts +4 -4
  334. package/dist/migrations/kumiko-drift.d.ts +1 -1
  335. package/dist/migrations/pending-rebuilds.d.ts +5 -5
  336. package/dist/migrations/pii-event-backfill.d.ts +4 -4
  337. package/dist/migrations/projection-table-index.d.ts +1 -1
  338. package/dist/observability/console-provider.d.ts +1 -1
  339. package/dist/observability/context.d.ts +1 -1
  340. package/dist/observability/escape-hatch-report.d.ts +3 -3
  341. package/dist/observability/fallback.d.ts +1 -1
  342. package/dist/observability/index.d.ts +16 -16
  343. package/dist/observability/metric-validator.d.ts +1 -1
  344. package/dist/observability/metrics-handle.d.ts +1 -1
  345. package/dist/observability/metrics-wiring.d.ts +2 -2
  346. package/dist/observability/noop-provider.d.ts +1 -1
  347. package/dist/observability/prometheus-meter.d.ts +1 -1
  348. package/dist/observability/recording-meter.d.ts +1 -1
  349. package/dist/observability/recording-tracer.d.ts +1 -1
  350. package/dist/observability/redis-wrapper.d.ts +1 -1
  351. package/dist/observability/sensitive-filter.d.ts +1 -1
  352. package/dist/observability/standard-metrics.d.ts +1 -1
  353. package/dist/pipeline/active-membership.d.ts +4 -4
  354. package/dist/pipeline/append-event-core.d.ts +3 -3
  355. package/dist/pipeline/auth-claims-resolver.d.ts +2 -2
  356. package/dist/pipeline/cascade-handler.d.ts +3 -3
  357. package/dist/pipeline/dispatch-batch.d.ts +2 -2
  358. package/dist/pipeline/dispatch-query.d.ts +4 -4
  359. package/dist/pipeline/dispatch-shared.d.ts +17 -17
  360. package/dist/pipeline/dispatch-stream.d.ts +2 -2
  361. package/dist/pipeline/dispatch-write.d.ts +4 -4
  362. package/dist/pipeline/dispatcher-utils.d.ts +2 -2
  363. package/dist/pipeline/dispatcher.d.ts +12 -12
  364. package/dist/pipeline/event-consumer-state.d.ts +1 -1
  365. package/dist/pipeline/event-dispatcher-admin.d.ts +1 -1
  366. package/dist/pipeline/event-dispatcher-delivery.d.ts +7 -7
  367. package/dist/pipeline/event-dispatcher.d.ts +7 -7
  368. package/dist/pipeline/event-retention.d.ts +1 -1
  369. package/dist/pipeline/handler-access-error.d.ts +2 -2
  370. package/dist/pipeline/index.d.ts +42 -42
  371. package/dist/pipeline/irreversible-operation-gate.d.ts +1 -1
  372. package/dist/pipeline/lifecycle-pipeline.d.ts +2 -2
  373. package/dist/pipeline/member-read-only-transaction.d.ts +2 -2
  374. package/dist/pipeline/member-reader.d.ts +5 -5
  375. package/dist/pipeline/msp-rebuild.d.ts +4 -4
  376. package/dist/pipeline/multi-stream-apply-context.d.ts +3 -3
  377. package/dist/pipeline/notify-scope.d.ts +3 -3
  378. package/dist/pipeline/pending-gap-ranges.d.ts +2 -2
  379. package/dist/pipeline/pre-handler-gates.d.ts +3 -3
  380. package/dist/pipeline/pre-transaction-reservations.d.ts +4 -4
  381. package/dist/pipeline/projection-rebuild.d.ts +3 -3
  382. package/dist/pipeline/projection-state.d.ts +1 -1
  383. package/dist/pipeline/projections-runner.d.ts +3 -3
  384. package/dist/pipeline/projections-runner.js +3 -4
  385. package/dist/pipeline/system-hooks.d.ts +4 -4
  386. package/dist/pipeline/system-identity-switch.d.ts +3 -3
  387. package/dist/pipeline/tenant-timezone-cache.d.ts +1 -1
  388. package/dist/pipeline/write-origin.d.ts +3 -3
  389. package/dist/pipeline/write-result-masking.d.ts +2 -2
  390. package/dist/random/index.d.ts +2 -2
  391. package/dist/rate-limit/bucket.d.ts +1 -1
  392. package/dist/rate-limit/index.d.ts +3 -3
  393. package/dist/rate-limit/middleware.d.ts +3 -3
  394. package/dist/redis/cache-sync-bus.d.ts +2 -2
  395. package/dist/redis/cache-sync-topics.d.ts +1 -1
  396. package/dist/redis/index.d.ts +8 -8
  397. package/dist/redis/pubsub-signal.d.ts +1 -1
  398. package/dist/schema-cli.d.ts +1 -1
  399. package/dist/schema-cli.js +9 -1
  400. package/dist/search/derive-search-adapter-config.d.ts +2 -2
  401. package/dist/search/in-memory-adapter.d.ts +1 -1
  402. package/dist/search/index.d.ts +6 -6
  403. package/dist/search/meilisearch-adapter.d.ts +2 -2
  404. package/dist/search/purge-subject.d.ts +4 -4
  405. package/dist/search/reindex-entity.d.ts +3 -3
  406. package/dist/secrets/dek-cache.d.ts +1 -1
  407. package/dist/secrets/env-master-key-provider.d.ts +1 -1
  408. package/dist/secrets/env-master-key-provider.js +26 -11
  409. package/dist/secrets/envelope-cipher.d.ts +2 -2
  410. package/dist/secrets/envelope.d.ts +1 -1
  411. package/dist/secrets/index.d.ts +9 -9
  412. package/dist/secrets/rotation.d.ts +1 -1
  413. package/dist/secrets/stored-envelope.d.ts +1 -1
  414. package/dist/seeding/entity-seed.d.ts +1 -1
  415. package/dist/seeding/index.d.ts +3 -3
  416. package/dist/seeding/seed-users.d.ts +1 -1
  417. package/dist/time/index.d.ts +6 -6
  418. package/dist/ui-types/app-schema.d.ts +5 -5
  419. package/dist/ui-types/index.d.ts +23 -23
  420. package/dist/upgrade-cli.js +13 -3
  421. package/dist/utils/index.d.ts +9 -9
  422. package/package.json +19 -66
  423. package/presets/biome-app.json +80 -0
  424. package/presets/tsconfig.app.json +19 -0
  425. package/src/changes.json +78 -2
  426. package/src/scripts/codemod/README.md +18 -0
  427. package/src/scripts/codemod/codemod-support.ts +1 -1
  428. package/src/scripts/codemod/db-factory.ts +1 -1
  429. package/src/scripts/codemod/feature-factory.ts +1 -1
  430. package/src/scripts/codemod/import-extensions.ts +118 -0
  431. package/src/scripts/codemod/migrate-cross-tenant.ts +2 -2
  432. package/src/scripts/codemod/migrate-db-raw.ts +1 -1
  433. package/src/scripts/codemod/migrate-open-to-all.ts +1 -1
  434. package/src/scripts/codemod/object-form.ts +1 -1
  435. package/src/scripts/codemod/s3-imports.ts +1 -1
  436. package/src/scripts/codemod/tenant-db-options.ts +1 -1
  437. package/src/scripts/codemod/testing-move.ts +2 -2
  438. package/dist/db/bun-db-deprecated.d.ts +0 -10
  439. package/dist/db/bun-db-deprecated.js +0 -5
  440. package/dist/stack/index.d.ts +0 -10
  441. package/dist/stack/index.js +0 -11
  442. package/dist/testing/e2e-generator.d.ts +0 -5
  443. package/dist/testing/e2e-generator.js +0 -5
  444. package/dist/testing/handler-context.d.ts +0 -5
  445. package/dist/testing/handler-context.js +0 -5
  446. package/dist/testing/index.d.ts +0 -10
  447. package/dist/testing/index.js +0 -10
  448. package/dist/testing/real-providers.d.ts +0 -5
  449. package/dist/testing/real-providers.js +0 -5
@@ -0,0 +1,180 @@
1
+ <!-- Generated by `bun run gen:agent-docs` from samples/recipes/prod-boot-options. Do not edit. -->
2
+
3
+ # prod-boot-options
4
+
5
+ runProdApp boot options: mail, kmsMode, fileStorage, demoMode and signal handling declared as options instead of hand-wired in bin/main.ts.
6
+
7
+ ## README
8
+
9
+ # Prod boot options
10
+
11
+ Declare mail, KMS, file storage, demo mode, seeds and signal handling as
12
+ `runProdApp` options instead of wiring them by hand in `bin/main.ts`. Each
13
+ option mounts the matching bundled feature, reads its env block and fails
14
+ the boot with a clear message when the env is incomplete.
15
+
16
+ ## What it shows
17
+
18
+ - **`mail`**: `{ transport: "smtp-env" }` mounts `channel-email` with an
19
+ SMTP transport from `SMTP_*` and makes the auth mail flows use it.
20
+ `"inmemory"` is for dev and tests and is rejected in production.
21
+ - **`kmsMode`**: `"required"` builds the KMS adapter and blind-index key from
22
+ `PLATFORM_KEK`, `SUBJECT_KEYS_DATABASE_URL` and `KUMIKO_BLIND_INDEX_KEY` and
23
+ aborts without them. `"optional"` uses them when present.
24
+ `{ plaintextReason }` stores PII in plaintext on purpose.
25
+ - **`fileStorage`**: `{ provider: "auto" }` mounts the S3 provider when
26
+ `S3_BUCKET`, `S3_REGION`, `S3_ACCESS_KEY` and `S3_SECRET_KEY` are complete. In
27
+ production a partial S3 env aborts the boot; in dev it falls back to
28
+ in-memory storage.
29
+ - **`demoMode`**: `GET /demo-mode` publishes the notice, and `readOnly: true`
30
+ answers every write except query and login with `403 demo_read_only`.
31
+ - **`signals`**: SIGTERM and SIGINT run `stop()` with a drain timeout, then
32
+ exit 0, or exit 1 on timeout or error. `signals: false` leaves the process
33
+ signals to the host.
34
+ - **`seeds`**: `{ demoTenant, demoAdminFromEnv, sysadminFromEnv, run }`
35
+ replaces hand-written tenant and admin seeds; needs the auth features (not
36
+ mounted here).
37
+ - **`billing`**: `{ stripe: { priceToTier }, defaultTier }` mounts the Stripe
38
+ bridge and the tier-sync webhook route; needs `billing-foundation` and
39
+ `tier-engine`.
40
+
41
+ ## Flow
42
+
43
+ 1. `src/app.ts` lists the features and the boot options.
44
+ 2. `bin/server.ts` passes both to `runProdApp`.
45
+ 3. The test boots with `KUMIKO_DRY_RUN_ENV=boot`, which runs the full
46
+ validation and exits before any DB or Redis connection: a complete
47
+ production env passes, a partial S3 or missing KMS env aborts the boot,
48
+ and a missing `SMTP_HOST` shows up in the env inventory under
49
+ `runProdApp.mail`, because the options add their env blocks to the app's
50
+ `envSchema`.
51
+
52
+ ## Run
53
+
54
+ ```bash
55
+ bun test samples/recipes/prod-boot-options
56
+ ```
57
+
58
+ ## Source files
59
+
60
+ ### src/__tests__/boot-options.test.ts
61
+
62
+ ```ts
63
+ // KUMIKO_DRY_RUN_ENV=boot validates the whole wiring and exits before any
64
+ // DB/Redis connection, so the recipe's options are checked without infra.
65
+
66
+ import { afterEach, beforeEach, describe, expect, spyOn, test } from "bun:test";
67
+ import { randomBytes } from "node:crypto";
68
+ import { composeEnvSchema } from "@cosmicdrift/kumiko-framework/env";
69
+ import { runProdApp } from "@cosmicdrift/kumiko-server-runtime";
70
+ import { appFeatures, bootOptions } from "../app";
71
+
72
+ const PRODUCTION_BOOT_ENV: Readonly<Record<string, string>> = {
73
+ DATABASE_URL: "postgres://recipe:recipe@127.0.0.1:1/recipe",
74
+ REDIS_URL: "redis://127.0.0.1:1",
75
+ JWT_SECRET: "r".repeat(32),
76
+ KUMIKO_DRY_RUN_ENV: "boot",
77
+ NODE_ENV: "production",
78
+ SMTP_HOST: "smtp.recipe.example",
79
+ PLATFORM_KEK: randomBytes(32).toString("base64"),
80
+ SUBJECT_KEYS_DATABASE_URL: "postgres://kms:kms@127.0.0.1:1/subject_keys",
81
+ KUMIKO_BLIND_INDEX_KEY: randomBytes(32).toString("base64"),
82
+ S3_BUCKET: "recipe",
83
+ S3_REGION: "eu-central",
84
+ S3_ACCESS_KEY: "access",
85
+ S3_SECRET_KEY: "secret",
86
+ };
87
+
88
+ function withoutKey(key: string): Record<string, string> {
89
+ const { [key]: _dropped, ...rest } = PRODUCTION_BOOT_ENV;
90
+ return rest;
91
+ }
92
+
93
+ async function bootValidate(envSource: Record<string, string>): Promise<void> {
94
+ const features = appFeatures();
95
+ const handle = await runProdApp({
96
+ features,
97
+ envSchema: composeEnvSchema({ features: [] }),
98
+ autoListen: false,
99
+ migrations: false,
100
+ envSource,
101
+ ...bootOptions(envSource),
102
+ });
103
+ await handle.stop();
104
+ }
105
+
106
+ describe("prod boot options recipe", () => {
107
+ let logSpy: ReturnType<typeof spyOn>;
108
+ let warnSpy: ReturnType<typeof spyOn>;
109
+ beforeEach(() => {
110
+ logSpy = spyOn(console, "log").mockImplementation(() => {});
111
+ warnSpy = spyOn(console, "warn").mockImplementation(() => {});
112
+ });
113
+ afterEach(() => {
114
+ logSpy.mockRestore();
115
+ warnSpy.mockRestore();
116
+ });
117
+
118
+ test("a complete production env passes boot validation", async () => {
119
+ await bootValidate({ ...PRODUCTION_BOOT_ENV });
120
+ const lines = logSpy.mock.calls.map((call: unknown[]) => String(call[0]));
121
+ expect(lines.some((line: string) => line.includes("boot validation OK"))).toBe(true);
122
+ });
123
+
124
+ test("an incomplete S3 env aborts the production boot", async () => {
125
+ await expect(bootValidate(withoutKey("S3_BUCKET"))).rejects.toThrow(/S3_BUCKET/);
126
+ });
127
+
128
+ test("the dry run reports a missing SMTP host from the mail option's env block", async () => {
129
+ await bootValidate(withoutKey("SMTP_HOST"));
130
+ const lines = logSpy.mock.calls.map((call: unknown[]) => String(call[0]));
131
+ const inventory = lines.find((line: string) => line.startsWith("Env check")) ?? "";
132
+ expect(inventory).toMatch(/SMTP_HOST\s+runProdApp\.mail\s+required\s+.*missing/i);
133
+ expect(lines.some((line: string) => line.includes("boot validation OK"))).toBe(false);
134
+ });
135
+
136
+ test("a missing KMS trio aborts the boot under kmsMode required", async () => {
137
+ const envSource = withoutKey("PLATFORM_KEK");
138
+ delete envSource["SUBJECT_KEYS_DATABASE_URL"];
139
+ delete envSource["KUMIKO_BLIND_INDEX_KEY"];
140
+ await expect(bootValidate(envSource)).rejects.toThrow(/kmsMode "required"/);
141
+ });
142
+ });
143
+ ```
144
+
145
+ ### src/app.ts
146
+
147
+ ```ts
148
+ import { createConfigFeature } from "@cosmicdrift/kumiko-bundled-features/config";
149
+ import { createDeliveryFeature } from "@cosmicdrift/kumiko-bundled-features/delivery";
150
+ import { createFileFoundationFeature } from "@cosmicdrift/kumiko-bundled-features/file-foundation";
151
+ import { createTenantFeature } from "@cosmicdrift/kumiko-bundled-features/tenant";
152
+ import type { RunProdAppOptions } from "@cosmicdrift/kumiko-server-runtime";
153
+
154
+ export function appFeatures(): RunProdAppOptions["features"] {
155
+ return [
156
+ createConfigFeature(),
157
+ createTenantFeature(),
158
+ createDeliveryFeature(),
159
+ createFileFoundationFeature(),
160
+ ];
161
+ }
162
+
163
+ type BootOptions = Pick<
164
+ RunProdAppOptions,
165
+ "mail" | "kmsMode" | "fileStorage" | "demoMode" | "signals"
166
+ >;
167
+
168
+ export function bootOptions(envSource: Record<string, string | undefined>): BootOptions {
169
+ return {
170
+ mail: { transport: "smtp-env", from: "Recipe <noreply@recipe.example>" },
171
+ kmsMode: "required",
172
+ fileStorage: { provider: "auto" },
173
+ demoMode: {
174
+ readOnly: envSource["DEMO_READ_ONLY"] === "true",
175
+ notice: { text: { en: "This demo is read-only.", de: "Diese Demo ist schreibgeschützt." } },
176
+ },
177
+ signals: { drainTimeoutMs: 20_000 },
178
+ };
179
+ }
180
+ ```
@@ -41,6 +41,7 @@ import type { SaveContext } from "@cosmicdrift/kumiko-framework/engine";
41
41
  import { createEventsTable } from "@cosmicdrift/kumiko-framework/event-store";
42
42
  import { createCascadeDeleteHook } from "@cosmicdrift/kumiko-framework/pipeline";
43
43
  import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
44
+ import { createTestStoredEvent } from "@cosmicdrift/kumiko-testing/helpers";
44
45
  import {
45
46
  setupTestStack,
46
47
  type TestStack,
@@ -101,6 +102,7 @@ describe("restrict: team cannot be deleted with members", () => {
101
102
  id: team.id,
102
103
  data: { tenantId: "00000000-0000-4000-8000-000000000001" },
103
104
  entityName: "team",
105
+ event: createTestStoredEvent(),
104
106
  },
105
107
  { db: stack.db },
106
108
  ),
@@ -123,6 +125,7 @@ describe("restrict: team cannot be deleted with members", () => {
123
125
  id: team.id,
124
126
  data: { tenantId: "00000000-0000-4000-8000-000000000001" },
125
127
  entityName: "team",
128
+ event: createTestStoredEvent(),
126
129
  },
127
130
  { db: stack.db },
128
131
  ),
@@ -172,6 +175,7 @@ describe("cascade: deleting member removes tasks", () => {
172
175
  id: member.id,
173
176
  data: { tenantId: "00000000-0000-4000-8000-000000000001" },
174
177
  entityName: "member",
178
+ event: createTestStoredEvent(),
175
179
  },
176
180
  { db: stack.db },
177
181
  );
@@ -53,6 +53,8 @@ import { createJobsFeature } from "@cosmicdrift/kumiko-bundled-features/jobs";
53
53
  import {
54
54
  createSecretsContext,
55
55
  createSecretsFeature,
56
+ SecretsHandlers,
57
+ SecretsQueries,
56
58
  type StoredEnvelope,
57
59
  TENANT_SECRET_READ_EVENT,
58
60
  tenantSecretsTable,
@@ -167,7 +169,7 @@ afterAll(async () => {
167
169
  describe("1. at-rest representation", () => {
168
170
  test("set stores envelope only — plaintext nowhere in the row", async () => {
169
171
  await stack.http.writeOk(
170
- "secrets:write:set",
172
+ SecretsHandlers.set,
171
173
  { key: STRIPE_API_KEY.name, value: "sk_test_SuperSecretLivePlatz12345" },
172
174
  tenantAdmin,
173
175
  );
@@ -190,7 +192,7 @@ describe("2. list shows preview only", () => {
190
192
  test("redactedPreview uses billing's domain-aware redact function", async () => {
191
193
  const list = await stack.http.queryOk<
192
194
  Array<{ key: string; redactedPreview: string | null; kekVersion: number }>
193
- >("secrets:query:list", {}, tenantAdmin);
195
+ >(SecretsQueries.list, {}, tenantAdmin);
194
196
 
195
197
  const stripe = list.find((r) => r.key === STRIPE_API_KEY.name);
196
198
  expect(stripe).toBeDefined();
@@ -2,13 +2,13 @@
2
2
 
3
3
  # security-baseline
4
4
 
5
- securityBaselineFeatures() preset: sessions, crypto-shredding, rate-limiting, audit — plus the NODE_ENV=production boot warning when one is missing.
5
+ composeSecurityStack(): sessions, crypto-shredding, rate-limiting, audit — plus the NODE_ENV=production boot warning when one is missing.
6
6
 
7
7
  ## README
8
8
 
9
9
  # Security baseline
10
10
 
11
- Mount `securityBaselineFeatures()` instead of hand-picking the four features
11
+ Mount `composeSecurityStack()` instead of hand-picking the four features
12
12
  every prod app needs for basic account/security hygiene: `sessions`
13
13
  (revocable JWTs), `crypto-shredding` (operator-triggered subject-key erase),
14
14
  `rate-limiting` (ops-side bucket-status query, dispatcher wiring is
@@ -17,16 +17,19 @@ used to be silent; now the boot validator warns at `NODE_ENV=production`.
17
17
 
18
18
  ## What it shows
19
19
 
20
- - **`securityBaselineFeatures()`** (`@cosmicdrift/kumiko-bundled-features/presets`) —
21
- returns the four features in one call, fresh instances per call.
20
+ - **`composeSecurityStack()`** (`@cosmicdrift/kumiko-dev-server/compose-stacks`) —
21
+ returns the four features in one call, fresh instances per call. It replaces
22
+ the deprecated `securityBaselineFeatures()` preset. `runProdApp` refuses to
23
+ boot it without a KMS decision (`kmsMode`) or with `rateLimit: false`; see
24
+ [`compose-stacks`](../compose-stacks/).
22
25
  - **`warnOnMissingSecurityBaseline`** — wired into `validateBoot` (fw#2857).
23
26
  At `NODE_ENV=production`, boot compares mounted feature names against
24
27
  `SECURITY_BASELINE_FEATURE_NAMES` and logs a `console.warn` naming whatever
25
28
  is missing. It never throws — the baseline is a strong recommendation, not
26
29
  a hard requirement — and it is silent outside production.
27
30
  - **`includeSessions: false`** — an optional opt-out for dropping `sessions`
28
- from the preset explicitly. Not required for combining with
29
- `dsgvoSelfServiceFeatures()` any more: both mount `createSessionsFeature()`
31
+ from the stack explicitly. Not required for combining with
32
+ `composeGdprStack({ selfService })`: both mount `createSessionsFeature()`
30
33
  with no-arg options, and the framework's `dedupeFeatures()` collapses the
31
34
  two identical instances at boot instead of throwing.
32
35
 
@@ -45,22 +48,22 @@ audit → tenant-scoped audit trail
45
48
 
46
49
  ## When to reach for it
47
50
 
48
- Any app that also mounts `dsgvoSelfServiceFeatures()` — that preset already
51
+ Any app that also mounts `composeGdprStack({ selfService })`, which already
49
52
  mounts `sessions` as part of its own require-chain. Combine both directly;
50
53
  `dedupeFeatures()` collapses the two identical `sessions` instances at boot:
51
54
 
52
55
  ```ts illustration
53
- import { dsgvoSelfServiceFeatures, securityBaselineFeatures } from "@cosmicdrift/kumiko-bundled-features/presets";
56
+ import { composeGdprStack, composeSecurityStack } from "@cosmicdrift/kumiko-dev-server/compose-stacks";
54
57
 
55
58
  export const APP_FEATURES = [
56
59
  // ...config, user, tenant, auth-foundation...
57
- ...dsgvoSelfServiceFeatures(),
58
- ...securityBaselineFeatures(),
60
+ ...composeGdprStack({ selfService: {} }),
61
+ ...composeSecurityStack(),
59
62
  ];
60
63
  ```
61
64
 
62
- For an app that does not mount `dsgvoSelfServiceFeatures()`, use
63
- `securityBaselineFeatures()` with its default options, as this recipe does.
65
+ For an app without the self-service stack, use `composeSecurityStack()` with
66
+ its default options, as this recipe does.
64
67
 
65
68
  Dedupe keeps the first mounted instance. Late-bound state such as
66
69
  `bindAutoRevokeOnPasswordChange` must be bound on the instance returned by
@@ -69,14 +72,14 @@ the dropped instance's hooks never run and password changes silently stop
69
72
  revoking sessions.
70
73
 
71
74
  A `createSessionsFeature({ ... })` mounted with different options than the
72
- preset's own no-arg instance still produces a clear boot error — dedupe only
75
+ stack's own no-arg instance still produces a clear boot error — dedupe only
73
76
  collapses provably interchangeable instances, never silently picks one:
74
77
 
75
78
  ```ts illustration
76
79
  export const APP_FEATURES = [
77
80
  // ...
78
81
  createSessionsFeature({ expiresInMs: 1000 }),
79
- ...securityBaselineFeatures(),
82
+ ...composeSecurityStack(),
80
83
  // throws: Duplicate feature: "sessions" mounted twice with different
81
84
  // options — mount it once or pass identical options
82
85
  ];
@@ -166,15 +169,15 @@ describe("security-baseline sample", () => {
166
169
 
167
170
  ```ts
168
171
  // Security-Baseline Sample
169
- // Shows: mounting securityBaselineFeatures() (sessions, crypto-shredding,
172
+ // Shows: mounting composeSecurityStack() (sessions, crypto-shredding,
170
173
  // rate-limiting, audit) and how it silences the NODE_ENV=production boot
171
174
  // warning that fires when one of those four is missing.
172
175
 
173
176
  import { createAuthFoundationFeature } from "@cosmicdrift/kumiko-bundled-features/auth-foundation";
174
177
  import { createConfigFeature } from "@cosmicdrift/kumiko-bundled-features/config";
175
- import { securityBaselineFeatures } from "@cosmicdrift/kumiko-bundled-features/presets";
176
178
  import { createTenantFeature } from "@cosmicdrift/kumiko-bundled-features/tenant";
177
179
  import { createUserFeature } from "@cosmicdrift/kumiko-bundled-features/user";
180
+ import { composeSecurityStack } from "@cosmicdrift/kumiko-dev-server/compose-stacks";
178
181
  import type { FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
179
182
 
180
183
  export const APP_FEATURES: FeatureDefinition[] = [
@@ -182,6 +185,6 @@ export const APP_FEATURES: FeatureDefinition[] = [
182
185
  createUserFeature(),
183
186
  createTenantFeature(),
184
187
  createAuthFoundationFeature(),
185
- ...securityBaselineFeatures(),
188
+ ...composeSecurityStack(),
186
189
  ];
187
190
  ```
@@ -10,6 +10,7 @@
10
10
  | `apex-landing` | Apex landing page composed from other features — hero copy from template-resolver, prices and caps from tier-engine — rendered to one static HTML string. | `examples/apex-landing.md` |
11
11
  | `apex-surface-auth` | Apex-Surface: öffentliche Account-Flows (Login/Register/PW/Löschen) via createPublicSurface + AuthShell, inkl. anonymem email-verifiziertem Deletion-Flow. | `examples/apex-surface-auth.md` |
12
12
  | `api-worker-split` | Split deploy topology: API process (runSingleInstance:false, enqueue-only) + worker process (consumes worker-lane jobs, applies multiStreamProjections, writes results back through the worker dispatcher). | `examples/api-worker-split.md` |
13
+ | `app-config` | kumiko.config.ts with defineAppConfig: the one feature list, client entries and ports the tooling reads. | `examples/app-config.md` |
13
14
  | `auth-claims` | r.authClaims() — features contribute identity facts into the JWT at login time with auto-prefixed keys. | `examples/auth-claims.md` |
14
15
  | `auth-foundation-providers` | Register custom tenantResolver / tenantExistence via auth-foundation extension points (no anonymousAccess callbacks). | `examples/auth-foundation-providers.md` |
15
16
  | `auth-mfa` | createAuthMfaFeature — TOTP/2FA enrollment, login challenge, and recovery codes wired into auth-email-password. | `examples/auth-mfa.md` |
@@ -17,6 +18,7 @@
17
18
  | `boot-check` | A feature declares its own mount-invariant via r.bootCheck. | `examples/boot-check.md` |
18
19
  | `chat-channels` | Chat channels. Delivery notifications to Slack, minus the browser tab. | `examples/chat-channels.md` |
19
20
  | `compliance-profiles-demo` | Two-tenant demo: EU + Swiss compliance profiles deliver different authority contacts, languages, and grace periods through the same App-code. | `examples/compliance-profiles-demo.md` |
21
+ | `compose-stacks` | compose*Stack helpers for auth, security, GDPR and SaaS billing, and the runProdApp check that names a stack whose boot option is missing. | `examples/compose-stacks.md` |
20
22
  | `cross-feature-events` | Feature appends a typed domain event via ctx.appendEvent; a r.multiStreamProjection reacts asynchronously. | `examples/cross-feature-events.md` |
21
23
  | `crypto-shredding-hr` | Crypto-shredding: PII fields encrypted per subject key; forgetting the subject erases the key and every field it protected. | `examples/crypto-shredding-hr.md` |
22
24
  | `currencies-global` | Shared money fields across tenants. Commas still matter. | `examples/currencies-global.md` |
@@ -30,12 +32,14 @@
30
32
  | `embedded` | Embedded fields on entities. Structured JSON without the JSON part. | `examples/embedded.md` |
31
33
  | `embedded-entity-form` | RenderEdit hosted in a Drawer, no screen or route — externally-sourced prefill, controlled mode, and a custom write handler instead of the built-in CRUD create. | `examples/embedded-entity-form.md` |
32
34
  | `encrypted-tenant-config` | Per-tenant secrets via config-key encryption — Stripe-API-key pattern. | `examples/encrypted-tenant-config.md` |
35
+ | `env-composition` | Typed app env from the env blocks bundled features register, plus app-level blocks in extend. | `examples/env-composition.md` |
33
36
  | `error-contract` | Typed errors on the wire. With snake_case reasons, because we care. | `examples/error-contract.md` |
34
37
  | `event-sourcing` | Production-pattern ES sample: r.defineEvent (versioned + migrations) + ctx.appendEvent + r.projection + r.multiStreamProjection + ctx.loadAggregate (asOf) + ctx.archiveStream + ctx.queryProjection. | `examples/event-sourcing.md` |
35
38
  | `feature-toggles` | Runtime feature-toggle flip — two toggleable features, one registers a cross-feature hook on the other; disabling either has the documented effect without reboot. | `examples/feature-toggles.md` |
36
39
  | `field-access` | Field-level access control. When entity-level roles aren't granular enough. | `examples/field-access.md` |
37
40
  | `files-post-processing` | The three ways to generate an image variant: declarative field variants, imperative ctx.derivatives.variant() with region-blur, and the public route behind a default-deny predicate. | `examples/files-post-processing.md` |
38
41
  | `golden-path` | The smallest complete feature: entity, write handler, event, projection, screen and an integration test. | `examples/golden-path.md` |
42
+ | `host-routing` | createHostRoutingFeature + createHostDispatch — tenant per subdomain, per-host HTML and CSP, locale redirect, shared by runProdApp and the dev server. | `examples/host-routing.md` |
39
43
  | `i18n` | Feature-scoped translations. 'Hallo' and 'Hello' in the same app. | `examples/i18n.md` |
40
44
  | `idempotency` | Same request, same result. Dedupes on request ID. | `examples/idempotency.md` |
41
45
  | `inbound-mail-triage` | Inbound-mail consumer pattern: inbound-mail-foundation + in-memory provider, a worker-lane triage job attached to the ingest handler, verified end-to-end through createAllInOneEntrypoint. | `examples/inbound-mail-triage.md` |
@@ -50,6 +54,7 @@
50
54
  | `ownership` | Entity- and Field-level Row-Ownership: from() helper, Straddle-safe multi-role checks, Field-level Read/Write filtering. | `examples/ownership.md` |
51
55
  | `pdf-audit-export` | Exports an audit table as a PDF: a write handler renders rows with renderTablePdf and uploads the bytes before the transaction (uploadFileBytesBeforeTransaction) and stores them as a FileRef (createFileRefFromUploadedBytes). | `examples/pdf-audit-export.md` |
52
56
  | `pipeline-basics` | M.1 Tier-1 step-vocabulary showcase: every step in one inventory-management feature (aggregate.{create,update,appendEvent}, read.{findOne,findMany}, branch, forEach, compute, return, unsafeProjection{Upsert,Delete}). | `examples/pipeline-basics.md` |
57
+ | `prod-boot-options` | runProdApp boot options: mail, kmsMode, fileStorage, demoMode and signal handling declared as options instead of hand-wired in bin/main.ts. | `examples/prod-boot-options.md` |
53
58
  | `public-share-token` | Generic share-token entity: mint hash-stored token, anonymous read-by-token with IP rate-limit. | `examples/public-share-token.md` |
54
59
  | `rate-limiting` | End-to-end rate limiting: L1 global-IP + L2 auth-endpoints + L3 handler opt-in. | `examples/rate-limiting.md` |
55
60
  | `realtime-sse` | Server-sent events demo. Goodbye F5. | `examples/realtime-sse.md` |
@@ -59,7 +64,7 @@
59
64
  | `screens-nav` | r.screen() + r.nav() — entityList/entityEdit/custom screens, cross-feature nav parents, FieldCondition<TData>, boot-validator behaviour. | `examples/screens-nav.md` |
60
65
  | `search` | Tenant-scoped Meilisearch. Because ILIKE is not search. | `examples/search.md` |
61
66
  | `secrets-demo` | Tenant-owned secrets with envelope encryption, DEK cache, and KEK rotation. | `examples/secrets-demo.md` |
62
- | `security-baseline` | securityBaselineFeatures() preset: sessions, crypto-shredding, rate-limiting, audit — plus the NODE_ENV=production boot warning when one is missing. | `examples/security-baseline.md` |
67
+ | `security-baseline` | composeSecurityStack(): sessions, crypto-shredding, rate-limiting, audit — plus the NODE_ENV=production boot warning when one is missing. | `examples/security-baseline.md` |
63
68
  | `seed-migration` | ES-Operations seed-migrations — file-based diff-and-apply für Aggregate-Updates die idempotent-Seeder nicht erfassen. | `examples/seed-migration.md` |
64
69
  | `session-revocation` | createSessionCallbacks + sessionChecker — server-side session revocation via JWT jti. | `examples/session-revocation.md` |
65
70
  | `state-machine` | Enforced entity state transitions. No more illegal state changes. | `examples/state-machine.md` |
@@ -2,6 +2,12 @@
2
2
 
3
3
  # Bundled features
4
4
 
5
+ ## account-security
6
+
7
+ Self-service account dashboard: MFA enrollment, recovery codes and the user's own sessions, composed from the auth-mfa and sessions screens.
8
+
9
+ Requires: `sessions`, `auth-mfa`
10
+
5
11
  ## admin-shell
6
12
 
7
13
  Registers tenant-admin and platform-admin workspaces with provider nav into owner-feature screens (`tenant:screen:members`, `audit:screen:audit-log`, `tenant:screen:tenant-list`, `jobs:screen:job-runs`, optional `tier-engine:screen:tier-admin`, optional `cap-overview:screen:my-caps`/`cap-overview:screen:tenant-cap-list`, optional `document-designer` template navs) and the two overview dashboards, built from the metrics list (`metrics` option, default DEFAULT_METRICS). Mount after user, tenant, audit, jobs, metrics and metrics-system; pass `workspaceIds` to match app URL conventions (e.g. Studio `d`/`s`, PublicStatus `admin`/`sysadmin`). Client: `adminShellClient()`, `tenantClient()`, `auditClient()`, `jobsClient()`, optional `tierEngineClient()`.
@@ -363,6 +369,12 @@ Requires: `user-data-rights`
363
369
 
364
370
  Optional requires: `form-draft`
365
371
 
372
+ ## host-routing
373
+
374
+ Host- and path-based tenant routing: an authoritative tenant resolver from the subdomain (tenantBy host), a tenant existence check against enabled, active tenants, and the tenant-key query behind createHostDispatch, which picks the HTML file, CSP, locale redirect or 404 per host for runProdApp's hostDispatch.
375
+
376
+ Requires: `auth-foundation`, `tenant`
377
+
366
378
  ## inbound-mail-foundation
367
379
 
368
380
  Plugin host for inbound e-mail (inbox federation) — provider plugins (inbound-provider-imap, later M365 Graph / Gmail REST) register at the `inboundMailProvider` extension point with verify/fetch and optional oauth/watch (live push). The foundation owns three event-sourced streams (mail-account lifecycle, inbound-message with exactly-once ingest via deterministic aggregate ids, mail-thread rollup) and their projections `read_mail_accounts`/`read_inbound_messages`/`read_mail_threads`; PII fields are envelope-encrypted per tenant subject key before every append (crypto-shredding on tenant destroy). Wire `createInboundMailConnectRoutes` (OAuth connect + anonymous callback outside /api) and `createInboundMailSupervisor` (IDLE watch with backoff + reconciliation poll) in bin/server.ts. Consume `inbound-mail-foundation:event:inbound-message-received` from app features to attach business processes.
@@ -538,7 +550,7 @@ Requires: `template-resolver`
538
550
 
539
551
  ## renderer-mail-html
540
552
 
541
- A `renderer-foundation` plugin that handles `RenderRequest { kind: "mail" }` and returns `{ subject, html, text, previewText? }` suitable for sending via `channel-email`. The mail template (`kind: "mail"`, document HTML, subject in `meta`) resolves through `template-resolver`'s DB fallback, its body is compiled to Handlebars by template-resolver and rendered with escaping, then placed into an MJML layout (`kind: "mail-layout"`, slug `default` unless `meta.layoutSlug` says otherwise, an in-code structured layout with the tenant branding logo and accent color as last resort) that `mjml()` compiles to email-safe table HTML, with `html-to-text` producing the plain-text alternative. An optional `footer` resolver adds the platform imprint, privacy link and footer text below every structured layout, an optional `brandSuffix` resolver adds a word after the tenant name in the brand row of the in-code layout, and an optional `siteUrl` resolver supplies the site link of the card when the tenant branding has no site URL (without either, the link is left out). The brand row and `data-resource="logo"` images use the branding logo upload, or the branding logo https address when no file is uploaded. Mail meta `headerChip`, `tone` and `footerNote` add a chip beside the brand, the tone of the top line and chip, and a note above the site and unsubscribe links of the card. Seed an editable system layout with `seedSystemMailLayout(db)`. Requires `renderer-foundation` + `template-resolver`.
553
+ A `renderer-foundation` plugin that handles `RenderRequest { kind: "mail" }` and returns `{ subject, html, text, previewText? }` suitable for sending via `channel-email`. The mail template (`kind: "mail"`, document HTML, subject in `meta`) resolves through `template-resolver`'s DB fallback, its body is compiled to Handlebars by template-resolver and rendered with escaping, then placed into an MJML layout (`kind: "mail-layout"`, slug `default` unless `meta.layoutSlug` says otherwise, an in-code structured layout with the tenant branding logo and accent color as last resort) that `mjml()` compiles to email-safe table HTML, with `html-to-text` producing the plain-text alternative. An optional `footer` resolver adds the platform imprint, privacy link and footer text below every structured layout, an optional `brandSuffix` resolver adds a word after the tenant name in the brand row of the in-code layout, and an optional `siteUrl` resolver supplies the site link of the card when the tenant branding has no site URL (without either, the link is left out). The brand row and `data-resource="logo"` images use the branding logo upload, or the branding logo https address when no file is uploaded. Mail meta `headerChip`, `tone` and `footerNote` add a chip beside the brand, the tone of the top line and chip, and a note above the site and unsubscribe links of the card. `readMailChrome` hands the same brand row and footer, resolved for one locale, to pages a recipient opens from a mail, such as the unsubscribe page. Seed an editable system layout with `seedSystemMailLayout(db)`. Requires `renderer-foundation` + `template-resolver`.
542
554
 
543
555
  Requires: `renderer-foundation`, `template-resolver`
544
556
 
@@ -558,7 +570,7 @@ Requires: `renderer-foundation`
558
570
 
559
571
  ## secrets
560
572
 
561
- Stores arbitrary per-tenant secrets (API keys, tokens, credentials) encrypted at rest using AES-256 with a KEK loaded from `KUMIKO_SECRETS_MASTER_KEY_V1` (and successive versions for rotation). Read a secret in handlers via `ctx.secrets.get(tenantId, handle)`, which automatically appends a `tenantSecretRead` audit event so every access is traceable. A `rotate` job re-encrypts all envelopes after a KEK version bump. The `set`/`delete`/`list` handlers share one access rule — default { roles: ["TenantAdmin"] }; adopt the host's role vocabulary with createSecretsFeature({ roles }) or open it to every authenticated tenant user with { access: { openToAll: { reason } } } (larger blast radius: any tenant member can then read secret previews and write/delete secrets, not just admins). Server-side code writes a tenant secret with `dispatchSystemWrite({ handlerQn: "secrets:write:set", payload, tenantId })`: set and delete also admit the in-process system identity, so such writes pass the same declared-key and value checks.
573
+ Stores arbitrary per-tenant secrets (API keys, tokens, credentials) encrypted at rest using AES-256 with a KEK loaded from `KUMIKO_SECRETS_MASTER_KEY_V1` (and successive versions for rotation). Read a secret in handlers via `ctx.secrets.get(tenantId, handle)`, which automatically appends a `tenantSecretRead` audit event so every access is traceable. A `rotate` job re-encrypts all envelopes after a KEK version bump. The `set`/`delete`/`list` handlers share one access rule — default { roles: ["TenantAdmin"] }; adopt the host's role vocabulary with createSecretsFeature({ roles }) or open it to every authenticated tenant user with { access: { openToAll: { reason } } } (larger blast radius: any tenant member can then read secret previews and write/delete secrets, not just admins). Server-side code writes a tenant secret with `dispatchSystemWrite({ handlerQn: SecretsHandlers.set, payload, tenantId })`: set and delete also admit the in-process system identity, so such writes pass the same declared-key and value checks.
562
574
 
563
575
  Category: infrastructure
564
576
 
@@ -1,5 +1,5 @@
1
1
  import type { Context } from "hono";
2
- import type { TenantId } from "../engine/types/index.js";
2
+ import type { TenantId } from "../engine/types/index.ts";
3
3
  export type SetTenantCookieOptions = {
4
4
  readonly maxAgeSeconds?: number;
5
5
  readonly sameSite?: "Lax" | "Strict";
@@ -1,2 +1,2 @@
1
- import type { Registry } from "../engine/types/index.js";
1
+ import type { Registry } from "../engine/types/index.ts";
2
2
  export declare function collectAnonymousLiveEntities(registry: Registry): ReadonlySet<string>;
@@ -1,6 +1,6 @@
1
1
  import type { Context, Next } from "hono";
2
- import type { SessionUser, TenantId } from "../engine/types/index.js";
3
- import type { JwtHelper } from "./jwt.js";
2
+ import type { SessionUser, TenantId } from "../engine/types/index.ts";
3
+ import type { JwtHelper } from "./jwt.ts";
4
4
  export declare const CSRF_HEADER_NAME = "X-CSRF-Token";
5
5
  export declare const PAT_TOKEN_PREFIX = "kpat_";
6
6
  export type AuthTransport = "cookie" | "bearer";
@@ -1,11 +1,11 @@
1
1
  import { Hono } from "hono";
2
2
  import type { Redis } from "ioredis";
3
- import { type SessionUser } from "../engine/types/index.js";
4
- import type { Dispatcher } from "../pipeline/dispatcher.js";
5
- import { type AuthSessionChecker, type AuthSessionStatus, type TokenVerifier } from "./auth-middleware.js";
6
- import { type ClientIpResolver } from "./client-ip.js";
7
- import type { JwtHelper } from "./jwt.js";
8
- import type { PostAuthLandingResolver } from "./post-auth-landing.js";
3
+ import { type SessionUser } from "../engine/types/index.ts";
4
+ import type { Dispatcher } from "../pipeline/dispatcher.ts";
5
+ import { type AuthSessionChecker, type AuthSessionStatus, type TokenVerifier } from "./auth-middleware.ts";
6
+ import { type ClientIpResolver } from "./client-ip.ts";
7
+ import type { JwtHelper } from "./jwt.ts";
8
+ import type { PostAuthLandingResolver } from "./post-auth-landing.ts";
9
9
  export type LoginRateLimiter = {
10
10
  check(key: string): Promise<boolean>;
11
11
  reset(key: string): Promise<void>;
@@ -41,7 +41,7 @@ export type AuthRoutesConfig = {
41
41
  sessionChecker?: SessionChecker;
42
42
  tokenVerifier?: TokenVerifier;
43
43
  patRateLimiter?: LoginRateLimiter;
44
- resolveTenantLifecycleStatus?: import("./auth-middleware.js").TenantLifecycleStatusResolver;
44
+ resolveTenantLifecycleStatus?: import("./auth-middleware.ts").TenantLifecycleStatusResolver;
45
45
  passwordReset?: PasswordResetConfig;
46
46
  emailVerification?: EmailVerificationConfig;
47
47
  accountUnlock?: AccountUnlockConfig;
@@ -1,6 +1,6 @@
1
1
  import type { Context, Hono } from "hono";
2
- import type { HttpRouteMethod, Registry, SessionUser, TenantId, WriteResult } from "../engine/types/index.js";
3
- import type { SecretsContext } from "../secrets/index.js";
2
+ import type { HttpRouteMethod, Registry, SessionUser, TenantId, WriteResult } from "../engine/types/index.ts";
3
+ import type { SecretsContext } from "../secrets/index.ts";
4
4
  export declare const ExtraRouteEntries: {
5
5
  readonly anonymous: "anonymous";
6
6
  readonly user: "user";
@@ -1,37 +1,37 @@
1
- export type { SetTenantCookieOptions } from "./anonymous-cookie.js";
2
- export { deleteTenantCookie, setTenantCookie } from "./anonymous-cookie.js";
3
- export { collectAnonymousLiveEntities } from "./anonymous-live-entities.js";
4
- export { LOCALE_HEADER_NAME, NO_ROUTE_MATCH_HEADER_NAME } from "./api-constants.js";
5
- export type { AnonymousAccessConfig, AnonymousAccessResolved, AuthMiddlewareOptions, AuthSessionChecker, AuthSessionCheckResult, AuthSessionStatus, TenantExists, TenantLifecycleStatusResolver, TenantResolver, TokenVerifier, } from "./auth-middleware.js";
6
- export { authMiddleware, getUser, PAT_TOKEN_PREFIX, sessionCheckStatus, } from "./auth-middleware.js";
7
- export type { AuthRoutesConfig, LoginRateLimiter, SessionChecker, SessionCreator, SessionMassRevoker, SessionMetadata, SessionRevoker, } from "./auth-routes.js";
8
- export { createAuthRoutes, createInMemoryLoginRateLimiter, createRedisLoginRateLimiter, } from "./auth-routes.js";
9
- export type { ClientIpHeaderSource, ClientIpResolver } from "./client-ip.js";
10
- export { assertValidTrustedProxyHops, clientIpSourceFromHonoContext, createClientIpResolver, extractSocketAddress, parseTrustedProxyHopsEnv, TRUSTED_PROXY_HOPS_ENV, UNKNOWN_CLIENT_IP, } from "./client-ip.js";
11
- export type { AnonymousExtraRoute, AnonymousExtraRouteDeps, ExtraRouteDefinition, ExtraRouteEntry, ExtraRouteRejectionOptions, ExtraRouteRejectionStatus, RoleDispatchArgs, SignatureExtraRoute, SignatureExtraRouteDeps, SignatureExtraRouteVerifyDeps, SignatureExtraRouteVerifyRequest, SystemDispatchArgs, UserExtraRoute, UserExtraRouteDeps, } from "./extra-route.js";
12
- export { ExtraRouteEntries, ExtraRouteRejection, signatureRoute } from "./extra-route.js";
13
- export type { CachedResponseInit, CachePolicy } from "./http-cache.js";
14
- export { cacheControlHeader, cachedResponse, computeRevisionEtag, computeStrongEtag, computeWeakEtag, etagMatches, parseIfNoneMatch, } from "./http-cache.js";
15
- export type { JwtHelper, JwtKeyring, JwtPayload } from "./jwt.js";
16
- export { createJwtHelper, loadJwtSecretOrKeyring } from "./jwt.js";
17
- export { publicOriginOf } from "./origin-middleware.js";
18
- export { patAllows, qnMatches } from "./pat-scope.js";
19
- export type { PostAuthLandingArgs, PostAuthLandingFlow, PostAuthLandingResolver, } from "./post-auth-landing.js";
20
- export { isSafeLandingPath } from "./post-auth-landing.js";
21
- export type { RedisSseBroker, RedisSseBrokerOptions } from "./redis-sse-broker.js";
22
- export { createDefaultSseBroker, createRedisSseBroker, isRedisSseBroker, } from "./redis-sse-broker.js";
23
- export { type RequestContextData, readonlyRequestContext as requestContext, } from "./request-context.js";
24
- export { buildRequestContextDataFromRequest, requestIdMiddleware, } from "./request-id-middleware.js";
25
- export type { MetricsRouteOptions } from "./route-registrars.js";
26
- export { createMetricsApp, DEFAULT_MAX_REQUEST_BYTES, isPrometheusMeter, } from "./route-registrars.js";
27
- export { createApiRoutes } from "./routes.js";
28
- export type { KumikoServer, ServerOptions } from "./server.js";
29
- export { buildServer, makeDispatchSystemQuery, makeDispatchSystemWrite, makeDispatchWriteAs, withFileProviderResolver, } from "./server.js";
30
- export type { ResolvedSessionCookies, SessionCookieBase, SessionCookieNames, } from "./session-cookies.js";
31
- export { AUTH_COOKIE_BASE, CSRF_COOKIE_BASE, getSessionCookies, HOST_COOKIE_PREFIX, isHostPrefixedCookieName, resolveSessionCookieNames, resolveSessionCookies, sessionCookieName, sessionCookiesMiddleware, TENANT_COOKIE_BASE, } from "./session-cookies.js";
32
- export type { SseBroker, SseClient, SseEvent } from "./sse-broker.js";
33
- export { createSseBroker } from "./sse-broker.js";
34
- export { createSseRoute, SSE_HEARTBEAT_INTERVAL_MS, type SseRouteOptions } from "./sse-route.js";
35
- export { generateToken } from "./tokens.js";
36
- export type { KumikoServeEnv, KumikoServerWebSocket, KumikoWebSocketData, WebSocketUpgradeServer, } from "./websocket-route.js";
37
- export { createKumikoWebSocketHandler, isWebSocketUpgradeRequest, kumikoWebSocketHandler, WEBSOCKET_BACKPRESSURE_LIMIT_BYTES, WEBSOCKET_DEFAULT_MAX_CONNECTIONS_PER_USER, WEBSOCKET_HEARTBEAT_INTERVAL_MS, WEBSOCKET_MAX_PAYLOAD_BYTES, WEBSOCKET_PENDING_BUFFER_LIMIT_BYTES, WEBSOCKET_REVALIDATION_FAILURE_LIMIT, WEBSOCKET_ROUTE_PATH_PREFIX, } from "./websocket-route.js";
1
+ export type { SetTenantCookieOptions } from "./anonymous-cookie.ts";
2
+ export { deleteTenantCookie, setTenantCookie } from "./anonymous-cookie.ts";
3
+ export { collectAnonymousLiveEntities } from "./anonymous-live-entities.ts";
4
+ export { LOCALE_HEADER_NAME, NO_ROUTE_MATCH_HEADER_NAME } from "./api-constants.ts";
5
+ export type { AnonymousAccessConfig, AnonymousAccessResolved, AuthMiddlewareOptions, AuthSessionChecker, AuthSessionCheckResult, AuthSessionStatus, TenantExists, TenantLifecycleStatusResolver, TenantResolver, TokenVerifier, } from "./auth-middleware.ts";
6
+ export { authMiddleware, getUser, PAT_TOKEN_PREFIX, sessionCheckStatus, } from "./auth-middleware.ts";
7
+ export type { AuthRoutesConfig, LoginRateLimiter, SessionChecker, SessionCreator, SessionMassRevoker, SessionMetadata, SessionRevoker, } from "./auth-routes.ts";
8
+ export { createAuthRoutes, createInMemoryLoginRateLimiter, createRedisLoginRateLimiter, } from "./auth-routes.ts";
9
+ export type { ClientIpHeaderSource, ClientIpResolver } from "./client-ip.ts";
10
+ export { assertValidTrustedProxyHops, clientIpSourceFromHonoContext, createClientIpResolver, extractSocketAddress, parseTrustedProxyHopsEnv, TRUSTED_PROXY_HOPS_ENV, UNKNOWN_CLIENT_IP, } from "./client-ip.ts";
11
+ export type { AnonymousExtraRoute, AnonymousExtraRouteDeps, ExtraRouteDefinition, ExtraRouteEntry, ExtraRouteRejectionOptions, ExtraRouteRejectionStatus, RoleDispatchArgs, SignatureExtraRoute, SignatureExtraRouteDeps, SignatureExtraRouteVerifyDeps, SignatureExtraRouteVerifyRequest, SystemDispatchArgs, UserExtraRoute, UserExtraRouteDeps, } from "./extra-route.ts";
12
+ export { ExtraRouteEntries, ExtraRouteRejection, signatureRoute } from "./extra-route.ts";
13
+ export type { CachedResponseInit, CachePolicy } from "./http-cache.ts";
14
+ export { cacheControlHeader, cachedResponse, computeRevisionEtag, computeStrongEtag, computeWeakEtag, etagMatches, parseIfNoneMatch, } from "./http-cache.ts";
15
+ export type { JwtHelper, JwtKeyring, JwtPayload } from "./jwt.ts";
16
+ export { createJwtHelper, loadJwtSecretOrKeyring } from "./jwt.ts";
17
+ export { publicOriginOf } from "./origin-middleware.ts";
18
+ export { patAllows, qnMatches } from "./pat-scope.ts";
19
+ export type { PostAuthLandingArgs, PostAuthLandingFlow, PostAuthLandingResolver, } from "./post-auth-landing.ts";
20
+ export { isSafeLandingPath } from "./post-auth-landing.ts";
21
+ export type { RedisSseBroker, RedisSseBrokerOptions } from "./redis-sse-broker.ts";
22
+ export { createDefaultSseBroker, createRedisSseBroker, isRedisSseBroker, } from "./redis-sse-broker.ts";
23
+ export { type RequestContextData, readonlyRequestContext as requestContext, } from "./request-context.ts";
24
+ export { buildRequestContextDataFromRequest, requestIdMiddleware, } from "./request-id-middleware.ts";
25
+ export type { MetricsRouteOptions } from "./route-registrars.ts";
26
+ export { createMetricsApp, DEFAULT_MAX_REQUEST_BYTES, isPrometheusMeter, } from "./route-registrars.ts";
27
+ export { createApiRoutes } from "./routes.ts";
28
+ export type { KumikoServer, ServerOptions } from "./server.ts";
29
+ export { buildServer, makeDispatchSystemQuery, makeDispatchSystemWrite, makeDispatchWriteAs, withFileProviderResolver, } from "./server.ts";
30
+ export type { ResolvedSessionCookies, SessionCookieBase, SessionCookieNames, } from "./session-cookies.ts";
31
+ export { AUTH_COOKIE_BASE, CSRF_COOKIE_BASE, getSessionCookies, HOST_COOKIE_PREFIX, isHostPrefixedCookieName, resolveSessionCookieNames, resolveSessionCookies, sessionCookieName, sessionCookiesMiddleware, TENANT_COOKIE_BASE, } from "./session-cookies.ts";
32
+ export type { SseBroker, SseClient, SseEvent } from "./sse-broker.ts";
33
+ export { createSseBroker } from "./sse-broker.ts";
34
+ export { createSseRoute, SSE_HEARTBEAT_INTERVAL_MS, type SseRouteOptions } from "./sse-route.ts";
35
+ export { generateToken } from "./tokens.ts";
36
+ export type { KumikoServeEnv, KumikoServerWebSocket, KumikoWebSocketData, WebSocketUpgradeServer, } from "./websocket-route.ts";
37
+ export { createKumikoWebSocketHandler, isWebSocketUpgradeRequest, kumikoWebSocketHandler, WEBSOCKET_BACKPRESSURE_LIMIT_BYTES, WEBSOCKET_DEFAULT_MAX_CONNECTIONS_PER_USER, WEBSOCKET_HEARTBEAT_INTERVAL_MS, WEBSOCKET_MAX_PAYLOAD_BYTES, WEBSOCKET_PENDING_BUFFER_LIMIT_BYTES, WEBSOCKET_REVALIDATION_FAILURE_LIMIT, WEBSOCKET_ROUTE_PATH_PREFIX, } from "./websocket-route.ts";
package/dist/api/jwt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SessionUser, TenantId } from "../engine/types/index.js";
1
+ import type { SessionUser, TenantId } from "../engine/types/index.ts";
2
2
  export type JwtPayload = {
3
3
  sub: string;
4
4
  tenantId: TenantId;
@@ -1,5 +1,5 @@
1
1
  import type { Context, Next } from "hono";
2
- import { type Meter, type SensitiveFilterConfig, type Tracer } from "../observability/index.js";
2
+ import { type Meter, type SensitiveFilterConfig, type Tracer } from "../observability/index.ts";
3
3
  export type ObservabilityMiddlewareOptions = {
4
4
  readonly tracer: Tracer;
5
5
  readonly meter: Meter;
@@ -1,5 +1,5 @@
1
1
  import type { Redis } from "ioredis";
2
- import type { DbConnection } from "../db/connection.js";
2
+ import type { DbConnection } from "../db/connection.ts";
3
3
  export type ReadinessCheck = {
4
4
  readonly name: string;
5
5
  readonly run: () => Promise<void>;
@@ -1,5 +1,5 @@
1
- import { type RedisClientOptions } from "../redis/client.js";
2
- import { type SseBroker } from "./sse-broker.js";
1
+ import { type RedisClientOptions } from "../redis/client.ts";
2
+ import { type SseBroker } from "./sse-broker.ts";
3
3
  export type RedisSseBrokerOptions = {
4
4
  readonly redisUrl: string;
5
5
  readonly clientOptions?: RedisClientOptions;