@cosmicdrift/kumiko-framework 0.413.1 → 0.415.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 (479) hide show
  1. package/AGENTS.md +5 -2
  2. package/agents/api/framework-db.md +14 -3
  3. package/agents/api/framework-engine.md +69 -13
  4. package/agents/api/framework-errors.md +1 -1
  5. package/agents/api/framework-event-store.md +14 -0
  6. package/agents/api/framework-ui-types.md +158 -21
  7. package/agents/api/renderer-web.md +112 -11
  8. package/agents/api/testing-helpers.md +3 -2
  9. package/agents/api/testing-stack.md +3 -0
  10. package/agents/api/types.md +248 -24
  11. package/agents/api.md +7 -7
  12. package/agents/boot-rules.md +66 -10
  13. package/agents/examples/api-docs.md +2 -6
  14. package/agents/examples/auth-mfa.md +57 -10
  15. package/agents/examples/chat-channels.md +2 -0
  16. package/agents/examples/crypto-shredding-hr.md +63 -1
  17. package/agents/examples/currencies-global.md +1 -0
  18. package/agents/examples/env-composition.md +7 -11
  19. package/agents/examples/managed-pages.md +90 -1
  20. package/agents/examples/pwa-shell.md +210 -0
  21. package/agents/examples/rate-limiting.md +3 -3
  22. package/agents/examples/record-detail-layout.md +1643 -67
  23. package/agents/examples/workflow-engine.md +16 -12
  24. package/agents/examples.md +1 -0
  25. package/agents/features-index.md +4 -2
  26. package/agents/features.md +22 -7
  27. package/agents/widgets.md +26 -1
  28. package/dist/api/api-constants.d.ts +1 -0
  29. package/dist/api/api-constants.js +4 -0
  30. package/dist/api/auth-middleware.js +4 -3
  31. package/dist/api/auth-routes-shared.js +2 -1
  32. package/dist/api/entity-read-access.d.ts +1 -0
  33. package/dist/api/entity-read-access.js +18 -0
  34. package/dist/api/export/export-route.d.ts +6 -1
  35. package/dist/api/export/export-route.js +27 -1
  36. package/dist/api/export/export-rows.js +19 -3
  37. package/dist/api/request-context-internals.d.ts +2 -0
  38. package/dist/api/request-context-scopes.js +9 -2
  39. package/dist/api/request-context.js +1 -1
  40. package/dist/api/routes.d.ts +2 -0
  41. package/dist/api/routes.js +9 -1
  42. package/dist/api/server-event-dispatcher.js +3 -0
  43. package/dist/api/server-extra-routes.js +2 -1
  44. package/dist/api/server-feature-http-routes.d.ts +9 -0
  45. package/dist/api/server-feature-http-routes.js +109 -0
  46. package/dist/api/server-middleware.js +2 -19
  47. package/dist/api/server-pat-rate-limit-guard.d.ts +3 -0
  48. package/dist/api/server-pat-rate-limit-guard.js +19 -0
  49. package/dist/api/server-rate-limit-wiring.d.ts +10 -0
  50. package/dist/api/server-rate-limit-wiring.js +37 -0
  51. package/dist/api/server-routes.d.ts +4 -12
  52. package/dist/api/server-routes.js +12 -171
  53. package/dist/api/server-schema-route.d.ts +3 -0
  54. package/dist/api/server-schema-route.js +58 -0
  55. package/dist/api/server-wiring.js +2 -37
  56. package/dist/api/server.js +3 -1
  57. package/dist/compliance/override-schema.js +5 -5
  58. package/dist/compliance/sub-processors.js +10 -1
  59. package/dist/crypto/index.d.ts +1 -1
  60. package/dist/crypto/index.js +1 -1
  61. package/dist/crypto/pii-field-encryption.d.ts +2 -0
  62. package/dist/crypto/pii-field-encryption.js +16 -1
  63. package/dist/db/apply-entity-event.js +4 -0
  64. package/dist/db/bun-sql-connection-codes.d.ts +1 -0
  65. package/dist/db/bun-sql-connection-codes.js +7 -0
  66. package/dist/db/collect-table-metas.js +4 -1
  67. package/dist/db/config-seed.js +1 -1
  68. package/dist/db/derived-field-sql.js +15 -13
  69. package/dist/db/derived-related-sql.d.ts +2 -2
  70. package/dist/db/derived-related-sql.js +4 -2
  71. package/dist/db/dialect.d.ts +3 -0
  72. package/dist/db/dialect.js +1 -3
  73. package/dist/db/driver-row-coercion.js +2 -2
  74. package/dist/db/driver-value-preparation.js +1 -1
  75. package/dist/db/eagerload.js +15 -12
  76. package/dist/db/entity-table-meta.d.ts +2 -0
  77. package/dist/db/entity-table-meta.js +7 -0
  78. package/dist/db/event-store-executor-context.js +13 -8
  79. package/dist/db/event-store-executor-read-aggregate-currencies.js +2 -2
  80. package/dist/db/event-store-executor-read-aggregate.js +2 -2
  81. package/dist/db/event-store-executor-read-filter.d.ts +4 -0
  82. package/dist/db/event-store-executor-read-filter.js +28 -11
  83. package/dist/db/event-store-executor-read-search.d.ts +1 -0
  84. package/dist/db/event-store-executor-read-search.js +6 -6
  85. package/dist/db/event-store-executor-read-sort.js +3 -3
  86. package/dist/db/event-store-executor-read-where.js +14 -5
  87. package/dist/db/event-store-executor-read.js +7 -7
  88. package/dist/db/event-store-executor-write.js +50 -95
  89. package/dist/db/executor-managed-tables.js +4 -1
  90. package/dist/db/index.d.ts +4 -2
  91. package/dist/db/index.js +4 -2
  92. package/dist/db/known-table-names.d.ts +1 -0
  93. package/dist/db/known-table-names.js +7 -5
  94. package/dist/db/list-aggregate-labels.d.ts +1 -0
  95. package/dist/db/list-aggregate-labels.js +9 -1
  96. package/dist/db/migrate-generator.js +23 -4
  97. package/dist/db/migrate-rls-diff.d.ts +1 -0
  98. package/dist/db/migrate-rls-diff.js +15 -1
  99. package/dist/db/migrate-runner.js +2 -2
  100. package/dist/db/money.d.ts +1 -1
  101. package/dist/db/money.js +1 -4
  102. package/dist/db/parent-ref-clause.d.ts +6 -2
  103. package/dist/db/parent-ref-clause.js +105 -24
  104. package/dist/db/parent-ref-global-hosts.d.ts +23 -0
  105. package/dist/db/parent-ref-global-hosts.js +85 -0
  106. package/dist/db/production-schema-command-hint.d.ts +1 -0
  107. package/dist/db/production-schema-command-hint.js +3 -0
  108. package/dist/db/queries/backfill-pii.js +55 -29
  109. package/dist/db/queries/ddl.js +13 -2
  110. package/dist/db/queries/event-store-open-streams.d.ts +15 -0
  111. package/dist/db/queries/event-store-open-streams.js +33 -0
  112. package/dist/db/queries/event-store-payload-scrub.d.ts +5 -0
  113. package/dist/db/queries/event-store-payload-scrub.js +11 -0
  114. package/dist/db/queries/event-store.js +0 -1
  115. package/dist/db/queries/raw-sql.js +0 -1
  116. package/dist/db/queries/rebuild-rls-guard.d.ts +2 -1
  117. package/dist/db/queries/rebuild-rls-guard.js +24 -11
  118. package/dist/db/queries/rls-boot-catalog.d.ts +1 -0
  119. package/dist/db/queries/rls-boot-catalog.js +13 -9
  120. package/dist/db/queries/rls-shape.d.ts +3 -1
  121. package/dist/db/queries/rls-shape.js +31 -6
  122. package/dist/db/queries/session-advisory-lock.js +2 -1
  123. package/dist/db/queries/test-stack.js +7 -7
  124. package/dist/db/query.js +16 -11
  125. package/dist/db/rebuild-marker.js +11 -2
  126. package/dist/db/render-rls-ddl.d.ts +2 -0
  127. package/dist/db/render-rls-ddl.js +16 -11
  128. package/dist/db/replay-migration-sql.js +1 -1
  129. package/dist/db/row-level-security-boot-check.js +18 -5
  130. package/dist/db/row-level-security-connection.js +25 -12
  131. package/dist/db/row-level-security-scope.d.ts +2 -1
  132. package/dist/db/row-level-security-scope.js +9 -5
  133. package/dist/db/sql-identifier.d.ts +1 -0
  134. package/dist/db/sql-identifier.js +3 -0
  135. package/dist/db/system-tenant-read-db.d.ts +5 -0
  136. package/dist/db/system-tenant-read-db.js +28 -0
  137. package/dist/db/table-builder.d.ts +3 -1
  138. package/dist/db/table-builder.js +18 -8
  139. package/dist/db/table-info.d.ts +1 -2
  140. package/dist/db/table-introspection.d.ts +3 -0
  141. package/dist/db/table-introspection.js +6 -0
  142. package/dist/db/table-push.d.ts +1 -0
  143. package/dist/db/table-push.js +7 -1
  144. package/dist/db/tenant-db-runner.d.ts +3 -0
  145. package/dist/db/tenant-db-runner.js +19 -1
  146. package/dist/db/transaction-serialization.d.ts +1 -0
  147. package/dist/db/transaction-serialization.js +20 -3
  148. package/dist/db/where-clause.js +11 -2
  149. package/dist/db/write-ownership-failures.d.ts +25 -0
  150. package/dist/db/write-ownership-failures.js +82 -0
  151. package/dist/engine/boot-validator/boot-check.js +7 -1
  152. package/dist/engine/boot-validator/boot-phases-app.js +5 -5
  153. package/dist/engine/boot-validator/boot-phases.js +3 -2
  154. package/dist/engine/boot-validator/boot-rules.d.ts +305 -28
  155. package/dist/engine/boot-validator/boot-rules.js +4 -0
  156. package/dist/engine/boot-validator/bundled-lists-table.js +2 -2
  157. package/dist/engine/boot-validator/card-meta-overflow-rules.d.ts +2 -2
  158. package/dist/engine/boot-validator/card-meta-overflow-rules.js +2 -2
  159. package/dist/engine/boot-validator/card-meta-overflow.js +8 -5
  160. package/dist/engine/boot-validator/config-deps.d.ts +0 -1
  161. package/dist/engine/boot-validator/config-deps.js +0 -28
  162. package/dist/engine/boot-validator/config-key-rules.d.ts +0 -15
  163. package/dist/engine/boot-validator/config-key-rules.js +0 -15
  164. package/dist/engine/boot-validator/dashboard-screen-target.d.ts +22 -0
  165. package/dist/engine/boot-validator/dashboard-screen-target.js +20 -0
  166. package/dist/engine/boot-validator/dashboard-stat-navigate.d.ts +1 -0
  167. package/dist/engine/boot-validator/dashboard-stat-navigate.js +25 -17
  168. package/dist/engine/boot-validator/definition-webhook-events-rules.d.ts +5 -0
  169. package/dist/engine/boot-validator/definition-webhook-events-rules.js +5 -0
  170. package/dist/engine/boot-validator/derived-sql-fields.js +1 -2
  171. package/dist/engine/boot-validator/entity-declaration-rules.d.ts +5 -0
  172. package/dist/engine/boot-validator/entity-declaration-rules.js +5 -0
  173. package/dist/engine/boot-validator/entity-list-screens.d.ts +1 -0
  174. package/dist/engine/boot-validator/entity-list-screens.js +35 -13
  175. package/dist/engine/boot-validator/entity-structure-rules.d.ts +5 -0
  176. package/dist/engine/boot-validator/entity-structure-rules.js +5 -0
  177. package/dist/engine/boot-validator/list-column-layout.js +10 -6
  178. package/dist/engine/boot-validator/list-row-guidance-rules.d.ts +67 -0
  179. package/dist/engine/boot-validator/list-row-guidance-rules.js +67 -0
  180. package/dist/engine/boot-validator/list-row-guidance.d.ts +20 -0
  181. package/dist/engine/boot-validator/list-row-guidance.js +143 -0
  182. package/dist/engine/boot-validator/list-sort-summary-rules.d.ts +42 -0
  183. package/dist/engine/boot-validator/list-sort-summary-rules.js +42 -0
  184. package/dist/engine/boot-validator/list-sort-summary.d.ts +5 -0
  185. package/dist/engine/boot-validator/list-sort-summary.js +160 -0
  186. package/dist/engine/boot-validator/list-table-options.js +15 -1
  187. package/dist/engine/boot-validator/list-table-rules.d.ts +10 -5
  188. package/dist/engine/boot-validator/list-table-rules.js +10 -5
  189. package/dist/engine/boot-validator/list-toolbar-options.d.ts +10 -0
  190. package/dist/engine/boot-validator/list-toolbar-options.js +30 -0
  191. package/dist/engine/boot-validator/named-filter-rules.d.ts +42 -2
  192. package/dist/engine/boot-validator/named-filter-rules.js +42 -2
  193. package/dist/engine/boot-validator/ownership.js +10 -1
  194. package/dist/engine/boot-validator/parent-ref.js +87 -50
  195. package/dist/engine/boot-validator/projection-list-screens.d.ts +1 -0
  196. package/dist/engine/boot-validator/projection-list-screens.js +32 -1
  197. package/dist/engine/boot-validator/query-output-columns.js +62 -9
  198. package/dist/engine/boot-validator/query-output-guidance.d.ts +7 -0
  199. package/dist/engine/boot-validator/query-output-guidance.js +40 -0
  200. package/dist/engine/boot-validator/query-refs.js +34 -1
  201. package/dist/engine/boot-validator/row-decoration.d.ts +11 -0
  202. package/dist/engine/boot-validator/row-decoration.js +16 -0
  203. package/dist/engine/boot-validator/screens-actions.js +1 -1
  204. package/dist/engine/boot-validator/screens-dashboard-links.d.ts +10 -0
  205. package/dist/engine/boot-validator/screens-dashboard-links.js +36 -0
  206. package/dist/engine/boot-validator/screens-dashboard-narrow.d.ts +4 -0
  207. package/dist/engine/boot-validator/screens-dashboard-narrow.js +211 -0
  208. package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +84 -4
  209. package/dist/engine/boot-validator/screens-dashboard-rules.js +84 -4
  210. package/dist/engine/boot-validator/screens-dashboard.js +29 -7
  211. package/dist/engine/boot-validator/screens-kind-entity-list.js +32 -27
  212. package/dist/engine/boot-validator/screens-kind-projection-detail-guidance.d.ts +3 -0
  213. package/dist/engine/boot-validator/screens-kind-projection-detail-guidance.js +46 -0
  214. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +20 -0
  215. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +20 -0
  216. package/dist/engine/boot-validator/screens-kind-projection-detail.js +2 -0
  217. package/dist/engine/boot-validator/screens-kind-projection-list.js +4 -0
  218. package/dist/engine/boot-validator/screens-kind-rules.d.ts +25 -0
  219. package/dist/engine/boot-validator/screens-kind-rules.js +25 -0
  220. package/dist/engine/boot-validator/screens-lists.d.ts +8 -2
  221. package/dist/engine/boot-validator/screens-lists.js +19 -3
  222. package/dist/engine/boot-validator/screens.js +1 -1
  223. package/dist/engine/boot-validator/sort-nulls.d.ts +2 -0
  224. package/dist/engine/boot-validator/sort-nulls.js +15 -0
  225. package/dist/engine/boot-validator/zod-shape.d.ts +2 -1
  226. package/dist/engine/boot-validator/zod-shape.js +19 -1
  227. package/dist/engine/build-app-schema.js +4 -0
  228. package/dist/engine/config-helpers.d.ts +1 -2
  229. package/dist/engine/config-helpers.js +6 -7
  230. package/dist/engine/define-feature.js +1 -0
  231. package/dist/engine/define-handler.d.ts +1 -0
  232. package/dist/engine/define-handler.js +4 -2
  233. package/dist/engine/definition-violations.js +2 -2
  234. package/dist/engine/entity-handlers.js +3 -8
  235. package/dist/engine/entity-list-runtime-options.js +9 -8
  236. package/dist/engine/factories.d.ts +2 -0
  237. package/dist/engine/feature-config-events-jobs.js +1 -0
  238. package/dist/engine/feature-entity-handlers.js +5 -2
  239. package/dist/engine/field-access.d.ts +1 -1
  240. package/dist/engine/field-access.js +7 -10
  241. package/dist/engine/find-entity.js +3 -3
  242. package/dist/engine/form-derivations.js +3 -3
  243. package/dist/engine/index.d.ts +3 -3
  244. package/dist/engine/index.js +2 -2
  245. package/dist/engine/named-filter-roles.d.ts +3 -0
  246. package/dist/engine/named-filter-roles.js +15 -0
  247. package/dist/engine/pipeline.js +0 -1
  248. package/dist/engine/project-app-schema-for-roles.js +17 -2
  249. package/dist/engine/qualified-name.js +0 -1
  250. package/dist/engine/registry-facade.js +1 -2
  251. package/dist/engine/registry-state.d.ts +1 -1
  252. package/dist/engine/registry-state.js +5 -2
  253. package/dist/engine/registry-validate.js +2 -1
  254. package/dist/engine/resolve-named-list-filters.js +5 -2
  255. package/dist/engine/schema-builder.js +9 -11
  256. package/dist/engine/screen-helpers.d.ts +12 -0
  257. package/dist/engine/screen-helpers.js +17 -1
  258. package/dist/engine/soft-delete-cleanup.js +3 -5
  259. package/dist/engine/state-machine.js +0 -1
  260. package/dist/engine/steps/_database-clock.d.ts +2 -0
  261. package/dist/engine/steps/_database-clock.js +6 -0
  262. package/dist/engine/steps/compute.js +1 -1
  263. package/dist/engine/steps/retry.js +5 -1
  264. package/dist/engine/steps/return.js +0 -1
  265. package/dist/engine/steps/wait-for-event.js +2 -1
  266. package/dist/engine/steps/wait.js +2 -1
  267. package/dist/engine/system-user.d.ts +2 -2
  268. package/dist/engine/system-user.js +2 -2
  269. package/dist/engine/types/handlers.d.ts +1 -1
  270. package/dist/engine/types/handlers.js +1 -1
  271. package/dist/engine/types/screen.d.ts +1 -1
  272. package/dist/engine/types/screen.js +1 -1
  273. package/dist/engine/webhook-contracts.d.ts +2 -3
  274. package/dist/engine/webhook-contracts.js +2 -25
  275. package/dist/engine/webhook-events.js +48 -29
  276. package/dist/engine/webhook-payload-strictness.d.ts +7 -0
  277. package/dist/engine/webhook-payload-strictness.js +53 -0
  278. package/dist/env/_zod-introspect.d.ts +1 -0
  279. package/dist/env/dry-run.d.ts +1 -1
  280. package/dist/env/dry-run.js +1 -1
  281. package/dist/env/field-meta.d.ts +4 -0
  282. package/dist/env/field-meta.js +67 -0
  283. package/dist/env/field-rules.d.ts +9 -0
  284. package/dist/env/field-rules.js +46 -0
  285. package/dist/env/index.d.ts +3 -3
  286. package/dist/env/index.js +16 -71
  287. package/dist/env/internals.d.ts +3 -0
  288. package/dist/env/internals.js +1 -2
  289. package/dist/env/required-env.d.ts +3 -1
  290. package/dist/env/required-env.js +5 -2
  291. package/dist/errors/reasons.d.ts +1 -0
  292. package/dist/errors/reasons.js +4 -0
  293. package/dist/errors/serialize.js +2 -2
  294. package/dist/errors/write-error-info.js +0 -2
  295. package/dist/es-ops/operations-schema.js +18 -7
  296. package/dist/event-store/admin-api.js +3 -3
  297. package/dist/event-store/event-store.js +0 -3
  298. package/dist/event-store/index.d.ts +1 -0
  299. package/dist/event-store/index.js +1 -0
  300. package/dist/event-store/transfer.js +1 -1
  301. package/dist/files/assert-file-refs-belong-to-tenant.d.ts +2 -1
  302. package/dist/files/assert-file-refs-belong-to-tenant.js +15 -13
  303. package/dist/files/bind-pending-file-refs.d.ts +3 -1
  304. package/dist/files/bind-pending-file-refs.js +54 -27
  305. package/dist/files/copy-pending-file-refs-to-tenant.js +7 -3
  306. package/dist/files/create-file-ref.d.ts +4 -1
  307. package/dist/files/create-file-ref.js +14 -3
  308. package/dist/files/default-file-guard.js +4 -1
  309. package/dist/files/file-claim.d.ts +6 -0
  310. package/dist/files/file-claim.js +17 -0
  311. package/dist/files/file-field-slots.d.ts +2 -0
  312. package/dist/files/file-field-slots.js +28 -0
  313. package/dist/files/file-ref-entity.d.ts +3 -0
  314. package/dist/files/file-ref-entity.js +2 -0
  315. package/dist/files/file-ref-table.d.ts +3 -0
  316. package/dist/files/file-routes.d.ts +4 -1
  317. package/dist/files/file-routes.js +80 -16
  318. package/dist/files/in-memory-provider.d.ts +1 -1
  319. package/dist/files/in-memory-provider.js +2 -1
  320. package/dist/files/index.d.ts +1 -1
  321. package/dist/files/index.js +1 -1
  322. package/dist/files/invalid-file-ref-error.d.ts +2 -0
  323. package/dist/files/invalid-file-ref-error.js +15 -0
  324. package/dist/files/local-provider.js +9 -2
  325. package/dist/files/provider-resolver.js +1 -1
  326. package/dist/files/rebind-file-ref.d.ts +3 -2
  327. package/dist/files/rebind-file-ref.js +24 -18
  328. package/dist/files/resolve-file-handles.d.ts +13 -0
  329. package/dist/files/resolve-file-handles.js +57 -0
  330. package/dist/files/storage-tracking.d.ts +1 -1
  331. package/dist/files/storage-tracking.js +5 -2
  332. package/dist/files/sweep-stale-pending-file-refs.js +10 -4
  333. package/dist/files/types.d.ts +4 -0
  334. package/dist/files/types.js +10 -0
  335. package/dist/files/upload-field-resolution.d.ts +1 -0
  336. package/dist/files/upload-field-resolution.js +16 -2
  337. package/dist/files/upload-ledger.js +1 -1
  338. package/dist/i18n/required-surface-guidance-keys.d.ts +3 -0
  339. package/dist/i18n/required-surface-guidance-keys.js +9 -0
  340. package/dist/i18n/required-surface-keys.js +21 -5
  341. package/dist/internal/boot-rule-table-expectations.d.ts +2 -0
  342. package/dist/internal/boot-rule-table-expectations.js +29 -0
  343. package/dist/internal/row-level-security.d.ts +1 -0
  344. package/dist/internal/row-level-security.js +1 -0
  345. package/dist/internal/testing.d.ts +1 -0
  346. package/dist/internal/testing.js +1 -0
  347. package/dist/jobs/index.d.ts +1 -0
  348. package/dist/jobs/index.js +1 -0
  349. package/dist/jobs/job-load-events.d.ts +10 -0
  350. package/dist/jobs/job-load-events.js +12 -0
  351. package/dist/jobs/job-runner-context.js +6 -158
  352. package/dist/jobs/job-runner-dispatch.d.ts +7 -0
  353. package/dist/jobs/job-runner-dispatch.js +57 -0
  354. package/dist/jobs/job-runner-event-triggers.js +18 -9
  355. package/dist/jobs/job-runner-execution.js +5 -2
  356. package/dist/jobs/job-runner-facets.d.ts +48 -0
  357. package/dist/jobs/job-runner-facets.js +156 -0
  358. package/dist/jobs/job-runner-gates.js +19 -11
  359. package/dist/jobs/job-runner-helpers.d.ts +5 -1
  360. package/dist/jobs/job-runner-helpers.js +18 -3
  361. package/dist/jobs/job-runner-scope.d.ts +1 -0
  362. package/dist/jobs/job-runner-scope.js +2 -0
  363. package/dist/jobs/job-runner-tenant-cap-lock.d.ts +2 -0
  364. package/dist/jobs/job-runner-tenant-cap-lock.js +30 -0
  365. package/dist/jobs/job-runner-types.d.ts +1 -0
  366. package/dist/jobs/job-runner.js +39 -70
  367. package/dist/jobs/obliterate-job-queues.d.ts +6 -0
  368. package/dist/jobs/obliterate-job-queues.js +23 -0
  369. package/dist/lifecycle/lifecycle.js +1 -1
  370. package/dist/migrations/event-header-scrub.d.ts +11 -0
  371. package/dist/migrations/event-header-scrub.js +33 -0
  372. package/dist/migrations/event-payload-scrub.d.ts +1 -1
  373. package/dist/migrations/event-payload-scrub.js +36 -4
  374. package/dist/migrations/index.d.ts +1 -0
  375. package/dist/migrations/index.js +2 -0
  376. package/dist/migrations/kumiko-drift.d.ts +5 -2
  377. package/dist/migrations/kumiko-drift.js +51 -14
  378. package/dist/migrations/pending-rebuilds.js +4 -5
  379. package/dist/observability/sensitive-filter.js +0 -12
  380. package/dist/pipeline/aggregate-type-removal.js +17 -4
  381. package/dist/pipeline/context-services.d.ts +2 -0
  382. package/dist/pipeline/context-services.js +5 -2
  383. package/dist/pipeline/dispatch-batch.js +4 -3
  384. package/dist/pipeline/dispatch-context-helpers.d.ts +11 -0
  385. package/dist/pipeline/dispatch-context-helpers.js +58 -0
  386. package/dist/pipeline/dispatch-nested-write.d.ts +7 -0
  387. package/dist/pipeline/dispatch-nested-write.js +119 -0
  388. package/dist/pipeline/dispatch-query.js +10 -3
  389. package/dist/pipeline/dispatch-scope.js +4 -3
  390. package/dist/pipeline/dispatch-shared.d.ts +2 -6
  391. package/dist/pipeline/dispatch-shared.js +6 -38
  392. package/dist/pipeline/dispatch-write.d.ts +0 -1
  393. package/dist/pipeline/dispatch-write.js +3 -302
  394. package/dist/pipeline/dispatcher-utils.js +6 -0
  395. package/dist/pipeline/effective-system-scope.d.ts +3 -0
  396. package/dist/pipeline/effective-system-scope.js +22 -0
  397. package/dist/pipeline/event-dispatcher-delivery.d.ts +1 -0
  398. package/dist/pipeline/event-dispatcher-delivery.js +20 -9
  399. package/dist/pipeline/event-dispatcher.d.ts +6 -1
  400. package/dist/pipeline/event-dispatcher.js +6 -7
  401. package/dist/pipeline/handler-context-auth.d.ts +3 -2
  402. package/dist/pipeline/handler-context-auth.js +3 -4
  403. package/dist/pipeline/handler-context-db.js +11 -4
  404. package/dist/pipeline/handler-context-dispatch.js +2 -2
  405. package/dist/pipeline/handler-context-events.d.ts +8 -3
  406. package/dist/pipeline/handler-context-events.js +20 -65
  407. package/dist/pipeline/handler-context-member-resolution.js +16 -8
  408. package/dist/pipeline/handler-context-notify.d.ts +1 -0
  409. package/dist/pipeline/handler-context-notify.js +2 -0
  410. package/dist/pipeline/handler-context-phase-denials.js +3 -2
  411. package/dist/pipeline/handler-context-projection.d.ts +3 -0
  412. package/dist/pipeline/handler-context-projection.js +39 -0
  413. package/dist/pipeline/handler-context-scope.d.ts +1 -1
  414. package/dist/pipeline/handler-context-scope.js +14 -2
  415. package/dist/pipeline/index.d.ts +1 -1
  416. package/dist/pipeline/index.js +1 -1
  417. package/dist/pipeline/irreversible-operation-gate.js +36 -10
  418. package/dist/pipeline/lifecycle-pipeline.d.ts +1 -0
  419. package/dist/pipeline/lifecycle-pipeline.js +7 -4
  420. package/dist/pipeline/member-reader.js +4 -2
  421. package/dist/pipeline/msp-rebuild.js +1 -1
  422. package/dist/pipeline/nested-write-parent-guard.d.ts +5 -0
  423. package/dist/pipeline/nested-write-parent-guard.js +81 -0
  424. package/dist/pipeline/projection-rebuild.d.ts +2 -0
  425. package/dist/pipeline/projection-rebuild.js +16 -7
  426. package/dist/pipeline/projection-state.js +4 -6
  427. package/dist/pipeline/system-hooks.js +36 -6
  428. package/dist/pipeline/write-result-masking.js +31 -3
  429. package/dist/pipeline/write-transition-guard.d.ts +7 -0
  430. package/dist/pipeline/write-transition-guard.js +95 -0
  431. package/dist/schema-cli/shared.d.ts +2 -0
  432. package/dist/schema-cli/shared.js +4 -2
  433. package/dist/schema-cli/validate-command.js +43 -28
  434. package/dist/search/meilisearch-adapter-internals.d.ts +2 -0
  435. package/dist/search/meilisearch-adapter-internals.js +5 -0
  436. package/dist/search/meilisearch-adapter.d.ts +1 -0
  437. package/dist/search/meilisearch-adapter.js +17 -11
  438. package/dist/search/reindex-entity.d.ts +2 -0
  439. package/dist/search/reindex-entity.js +32 -4
  440. package/dist/search/reindex-tenants-search.js +20 -4
  441. package/dist/time/tz-context.js +1 -1
  442. package/dist/ui-types/card-column-roles.d.ts +6 -0
  443. package/dist/ui-types/card-column-roles.js +21 -3
  444. package/dist/ui-types/index.d.ts +3 -3
  445. package/dist/ui-types/index.js +2 -2
  446. package/dist/utils/ids.js +0 -1
  447. package/dist/utils/index.d.ts +1 -0
  448. package/dist/utils/index.js +1 -0
  449. package/dist/utils/return-path-limit.d.ts +1 -0
  450. package/dist/utils/return-path-limit.js +1 -0
  451. package/package.json +5 -3
  452. package/presets/biome-app.json +39 -21
  453. package/presets/biome-plugins/admin-api.grit +10 -0
  454. package/presets/biome-plugins/error-reasons.grit +53 -0
  455. package/presets/biome-plugins/es-literal-writes-tests.grit +18 -0
  456. package/presets/biome-plugins/es-literal-writes.grit +22 -0
  457. package/presets/biome-plugins/i18n-locale-terminology-de.grit +15 -0
  458. package/presets/biome-plugins/i18n-locale-terminology-romance.grit +10 -0
  459. package/presets/biome-plugins/no-create-test-dispatcher.grit +5 -0
  460. package/presets/biome-plugins/no-css-properties-type.grit +7 -0
  461. package/presets/biome-plugins/no-date-api.grit +11 -0
  462. package/presets/biome-plugins/no-direct-fetch.grit +16 -0
  463. package/presets/biome-plugins/no-direct-fs.grit +16 -0
  464. package/presets/biome-plugins/no-external-font-cdn-css.grit +9 -0
  465. package/presets/biome-plugins/no-external-font-cdn.grit +12 -0
  466. package/presets/biome-plugins/no-raw-hooks.grit +10 -0
  467. package/presets/biome-plugins/no-same-folder-barrel-import.grit +11 -0
  468. package/presets/biome-plugins/no-screen-container-classes.grit +7 -0
  469. package/presets/biome-plugins/no-skipped-or-retried-tests.grit +34 -0
  470. package/presets/biome-plugins/no-temporal-polyfill-require.grit +10 -0
  471. package/presets/biome-plugins/raw-html-in-web.grit +40 -0
  472. package/presets/biome-plugins/raw-ui-in-app.grit +142 -0
  473. package/presets/biome-plugins/restricted-event-store-symbols.grit +18 -0
  474. package/presets/biome-plugins/test-title.grit +20 -0
  475. package/presets/biome-plugins/unsafe-json-parse.grit +12 -0
  476. package/presets/biome-rules.json +467 -0
  477. package/src/changes.json +366 -0
  478. package/dist/engine/minor-units.d.ts +0 -2
  479. package/dist/engine/minor-units.js +0 -8
@@ -33,14 +33,25 @@ function DropdownMenuContent(props: ComponentPropsWithoutRef<typeof Primitive.Co
33
33
  function DropdownMenuItem(props: ComponentPropsWithoutRef<typeof Primitive.Item>): ReactNode;
34
34
  function DropdownMenuLabel(props: ComponentPropsWithoutRef<typeof Primitive.Label>): ReactNode;
35
35
  function DropdownMenuSeparator(props: ComponentPropsWithoutRef<typeof Primitive.Separator>): ReactNode;
36
+ function EditorBody(props: { left?: ReactNode; center: ReactNode; right: ReactNode; testId?: string; }): ReactNode;
37
+ function EditorFooter(props: { testIdPrefix: string; actionTestIds?: EditorActionTestIds; message: { tone: FooterTone; text: string; } | null; pendingMessage?: string; saveError: string | null; modifiedAt: string | null; dirty: boolean; busy: boolean; canSave: boolean; canPublish?: boolean; onDiscard: () => void; onSave: () => void; saveLabel?: string; onPublish?: () => void; }): ReactNode;
38
+ function EditorFrame(props: { testId: string; children: ReactNode; }): ReactNode;
39
+ function EditorHeader(props: { title: string; status?: ReactNode; actions: EditorSaveActions; testIds?: EditorHeaderTestIds; children: ReactNode; }): ReactNode;
40
+ function EditorInfoBar(props: { tone: InfoBarTone; testId: string; origin?: ReactNode; controls?: ReactNode; links?: ReactNode; overlays?: ReactNode; children: ReactNode; }): ReactNode;
41
+ function EditorLocaleSwitch(props: { testIdPrefix: string; locales: string[]; locale: string; onLocale: (locale: string) => void; }): ReactNode;
42
+ function EditorModeSwitch(props: { testIdPrefix: string; mode: EditorMode; onMode: (mode: EditorMode) => void; }): ReactNode;
36
43
  function EditorPanel(props: EditorPanelProps): ReactNode;
44
+ function EditorWorkbench(props: EditorWorkbenchProps): ReactNode;
37
45
  function EmptyState(props: { icon?: ReactNode; title: string; description?: string; action?: ReactNode; testId?: string; }): ReactNode; // Empty state with an optional icon and CTA, using the dashed-box style of entityList empty states as a standalone widget for custom screens.
38
46
  function ErrorState(props: { error: DispatcherError; onRetry?: () => void; testId?: string; }): ReactNode; // Error state based on the Banner primitive, with a retry button.
39
47
  function FeedList(props: { rows: FeedRow[]; emptyContent?: ReactNode; testId?: string; }): ReactNode; // Non-tabular compact list (e.g. "upcoming appointments") — primary text plus an optional right-aligned trailing value for each row.
40
48
  function FileField(props: FileFieldProps): ReactNode; // File upload = Field + Input(kind:"file"|"image"), based on FileRef.
49
+ function FileViewAction(props: { fileId: string; }): ReactNode; // "View" action for a stored file: renders only for PDFs and opens the viewer in a drawer.
41
50
  function FloatingPanel(props: FloatingPanelProps): ReactNode; // Non-modal panel floating above the page: draggable by its header, resizable from all edges and corners, clamped to the viewport, geometry optionally remembered.
42
51
  function FormScreenShell(props: { children: ReactNode; className?: string; testId?: string; maxWidth?: FormScreenShellWidth; fillHeight?: boolean; }): ReactNode;
43
52
  function HeaderActionGroup(props: HeaderActionGroupProps): ReactNode;
53
+ function HeaderActionPinned(props: { children: ReactNode; }): ReactNode; // Marks an app header action (e.g. the assistant trigger) that stays in the bar on a phone, next to the bell; the rest of `headerActions` folds into the "…" menu.
54
+ function HtmlMailFrame(props: { html: string; title: string; allowRemoteImages: boolean; testId?: string; }): ReactNode; // Renders server-sanitized mail HTML in a script-free sandboxed iframe that grows to its content.
44
55
  function Icon(props: { name: NavIconKey; className?: string; }): ReactNode;
45
56
  function InfinityList<TData = unknown, TRow = Readonly<Record<string, unknown>>>(props: InfinityListProps<TData, TRow>): ReactNode; // Cursor-paginated scroll list (mail inbox, activity feeds) — loads the next page when the end sentinel becomes visible (IntersectionObserver), instead of a pager bar like QueryTable/entityList.
46
57
  function KumikoLink(props: KumikoLinkProps): ReactNode;
@@ -66,12 +77,17 @@ function PlanCard(props: PlanCardProps): ReactNode;
66
77
  function PlanGrid(props: PlanGridProps): ReactNode;
67
78
  function PresenceAvatars(props: PresenceAvatarsProps): ReactNode; // Small round avatars of the people on a row, with "+n" for the rest; for list rows.
68
79
  function PresenceNotice(props: PresenceNoticeProps): ReactNode; // One quiet line above a record: who else is on it and for how long.
80
+ function PreviewWidthFrame(props: { device: PreviewDevice; children: ReactNode; testId?: string; }): ReactNode;
69
81
  function PrimitivesProvider(props: PrimitivesProviderProps): ReactNode;
70
82
  function ProfileMenu(props: ProfileMenuProps): ReactNode;
71
83
  function ProgressBar(props: { value: number; tone?: ProgressTone; size?: "default" | "thin"; ariaLabel?: string; className?: string; testId?: string; }): ReactNode; // Progress bar, `value` 0..1 (clamped).
72
84
  function ProgressList(props: { rows: ProgressListRow[]; emptyContent?: ReactNode; testId?: string; }): ReactNode; // Label/value header and progress bar for each entry (for example, loan repayment progress).
73
85
  function PublicShell(props: PublicShellProps): ReactNode; // One header and footer for anonymous pages; `focus` narrows to a task column, `card` centers a single card (sign-in).
74
86
  function QueryTable<TData = unknown>(props: QueryTableProps<TData>): ReactNode;
87
+ function RailField(props: { children: ReactNode; }): ReactNode;
88
+ function RailHint(props: { children: ReactNode; }): ReactNode;
89
+ function RailRow(props: { symbol?: string; label: string; nameHint?: string; required?: boolean; trailing?: ReactNode; trailingTone?: keyof typeof TRAILING_TONE; action?: ReactNode; bad?: boolean; testId?: string; onPress?: () => void; }): ReactNode;
90
+ function RailSection(props: { title: string; action?: ReactNode; testId?: string; children: ReactNode; }): ReactNode;
75
91
  function RangeField(props: RangeFieldProps): ReactNode; // Slider = Field + Input(kind:"range").
76
92
  function RenderEdit<TValues extends FormValues, TCtx = unknown>(rawProps: RenderEditProps<TValues, TCtx>): ReactNode;
77
93
  function RenderField(props: RenderFieldProps): ReactNode;
@@ -82,7 +98,7 @@ function ResizablePanelGroup(props: ResizablePrimitive.GroupProps): JSX.Element;
82
98
  function ResultPanel(props: { title: string; subtitle?: string; empty?: boolean; emptyText?: ReactNode; rows?: { label: string; value: ReactNode; emphasize?: boolean; }[]; footer?: ReactNode; children?: ReactNode; testId?: string; }): ReactNode; // Result section for a calculator: SectionCard with an empty state (Banner) or a metric list (DetailList) plus optional extras (table, notes).
83
99
  function ResultTable<Row>(props: { columns: ResultColumn<Row>[]; rows: Row[]; rowKey: (row: Row, index: number) => string; testId?: string; className?: string; card?: boolean; footer?: ResultTableFooterRow[]; compactHeader?: boolean; }): ReactNode; // Static, prop-driven result table for calculated rows (tranches, scenarios).
84
100
  function ScreenWidthProvider(props: { width: FormWidth | undefined; children: ReactNode; }): ReactNode;
85
- function SectionCard(props: { title: string; subtitle?: string; action?: ReactNode; footer?: ReactNode; children: ReactNode; testId?: string; }): ReactNode; // Section with a title and optional action slot (range switcher, filter) — replaces repeated `<section className={CARD}>…<h2>` blocks in custom screens.
101
+ function SectionCard(props: { title?: string; subtitle?: string; action?: ReactNode; footer?: ReactNode; children: ReactNode; testId?: string; }): ReactNode; // Section with a title and optional action slot (range switcher, filter) — replaces repeated `<section className={CARD}>…<h2>` blocks in custom screens.
86
102
  function SectionNavLayout(props: SectionNavLayoutProps): ReactNode; // Content column plus an "On this page" navigation in a right column (from xl), for custom screens.
87
103
  function SelectField(props: SelectFieldProps): ReactNode; // Select field = Field + Input(kind:"select").
88
104
  function SenderFrame(props: { children: ReactNode; label?: string; testId?: string; }): ReactNode; // Sand frame with one white sheet inside, for content that mimics a letter or mail.
@@ -98,10 +114,10 @@ function SidebarProvider(props: React.ComponentProps<"div"> & { defaultOpen?: bo
98
114
  function SidebarUser(props: SidebarUserProps): ReactNode;
99
115
  function Sparkline(props: { points: number[]; className?: string; }): ReactNode;
100
116
  function Stack(props: StackProps): ReactNode;
101
- function StatCard(props: { icon?: ReactNode; label: string; value: string; sub?: string; tone?: StatTone; accentColor?: string; delta?: StatDelta; trend?: string; spark?: number[]; testId?: string; link?: StatLink; children?: ReactNode; }): ReactNode; // Icon-bearing metric tile with an optional delta chip, trend line, and sparkline.
102
- function StatusBadge(props: { tone: StatusBadgeTone; children: ReactNode; className?: string; testId?: string; }): ReactNode; // Pill badge with a status dot.
117
+ function StatCard(props: { icon?: ReactNode; label: string; value: string; sub?: string; tone?: StatTone; accentColor?: string; delta?: StatDelta; trend?: string; spark?: number[]; testId?: string; link?: StatLink; navigable?: boolean; inset?: boolean; subBelow?: boolean; boardPadding?: boolean; children?: ReactNode; }): ReactNode; // Icon-bearing metric tile with an optional delta chip, trend line, and sparkline.
118
+ function StatusBadge(props: { tone: StatusBadgeTone; dot?: boolean; children: ReactNode; className?: string; testId?: string; }): ReactNode; // Pill badge with a status dot.
103
119
  function StatusBarChart(props: { entries: StatusBarEntry[]; ariaLabel: string; startLabel?: string; endLabel?: string; highlightLast?: boolean; dense?: boolean; testId?: string; }): ReactNode; // Status bar strip (e.g. 90-day uptime): variable-height bars with gradient fade + tick line on top; the last entry gets a "now" accent stripe.
104
- function StepBar(props: { steps: string[]; currentIndex: number; compactLabel: string; onStepSelect?: (index: number) => void; doneSteps?: boolean[]; selectableSteps?: "done" | "all"; narrowLayout?: "label" | "steps"; orientation?: "horizontal" | "vertical"; heading?: string; description?: string; subtitles?: (string | undefined)[]; upNext?: { heading: string; title: string; subtitle?: string; }; testId?: string; compactTestId?: string; }): ReactNode; // Wizard step overview — numbered chips with a connector line between them.
120
+ function StepBar(props: { steps: string[]; currentIndex: number; compactLabel: string; onStepSelect?: (index: number) => void; doneSteps?: boolean[]; selectableSteps?: "done" | "all"; narrowLayout?: "label" | "steps"; orientation?: "horizontal" | "vertical" | "stacked"; heading?: string; description?: string; subtitles?: (string | undefined)[]; upNext?: { heading: string; title: string; subtitle?: string; }; testId?: string; compactTestId?: string; }): ReactNode; // Wizard step overview — numbered chips with a connector line between them.
105
121
  function StepList(props: StepListProps): ReactNode; // Ordered plan of steps with status icons, progress header and per-step actions.
106
122
  function TextField(props: TextFieldProps): ReactNode; // Text field = Field + Input(kind:"text").
107
123
  function TextareaField(props: TextareaFieldProps): ReactNode; // Multi-line text field = Field + Input(kind:"textarea").
@@ -119,6 +135,7 @@ function applyTokensToCssVars(_tokens: Tokens): void; // Historically wrote toke
119
135
  function buildFileUploadFormData(input: FileUploadFormDataInput): FormData;
120
136
  function buildNavRegistrySlice(schema: FeatureSchema, allowedNavQns?: ReadonlySet<string>): NavRegistrySlice;
121
137
  function buildNavRegistrySliceForApp(app: AppSchema, allowedNavQns?: ReadonlySet<string>): NavRegistrySlice;
138
+ function clearNavCollapseState(): void; // Forgets the collapsed containers and the revealed screen; logout calls it so the next user starts expanded.
122
139
  function clearRememberedListState(): void; // Forgets all remembered list state and the identity marker.
123
140
  function cn(...inputs: ClassValue[]): string; // Standard shadcn helper: `clsx` combines conditional classes, while `tailwind-merge` resolves conflicts (for example, `px-2 px-4` → `px-4`).
124
141
  function createBrowserDraftStorage(options?: CreateBrowserDraftStorageOptions): DraftStorage; // Default DraftStorage when createKumikoApp boots without one.
@@ -134,6 +151,7 @@ function filterAppSchemaNavsByAllowlist(schema: AppSchema, allowedNavQns: Readon
134
151
  function filterByAccess(workspaces: WorkspaceSchema[], userRoles: string[] | undefined): WorkspaceSchema[];
135
152
  function formatMoney(amountMinor: number, currency: string, locale?: string, fractionDigits?: number): string;
136
153
  function formatPath(target: ScreenTarget): string;
154
+ function formatRelativeWhen(value: string, now?: number): string;
137
155
  function parsePath(pathname: string, hasWorkspaces?: boolean): NavRoute | undefined;
138
156
  function parseTargetFromSearchParams(params: Readonly<Record<string, string>>): TargetRef | undefined; // Parses the current search parameters back into a TargetRef.
139
157
  function postWithDownload(dispatcher: Dispatcher, type: string, payload: unknown): Promise<DispatcherError | null>;
@@ -145,13 +163,14 @@ function saveBlobAsFile(fileName: string, blob: Blob, options?: { bom?: boolean;
145
163
  function smoothPath(pts: ReadonlyArray<{ x: number; y: number; }>): string; // Quadratic midpoint technique: smooths the zigzag line without overshoot (~5 lines instead of a Catmull-Rom/Bezier fit).
146
164
  function synthesizeActionFormEntity(fields: Readonly<Record<string, FieldDefinition>>): EntityDefinition; // Builds a minimal EntityDefinition from the inline fields of an ActionForm or SecretMint screen.
147
165
  function synthesizeActionFormScreen(screen: ActionFormScreenDefinition | SecretMintScreenDefinition): EntityEditScreenDefinition; // Converts an ActionFormScreenDefinition or SecretMintScreenDefinition to the EntityEditScreen shape expected by RenderEdit.
148
- function uploadFileRef(file: Blob, target?: FileRefTarget): Promise<string>; // Posts one file to the stack's file endpoint (double-submit CSRF) and returns the new FileRef id.
166
+ function uploadFileRef(file: Blob, target?: FileRefTarget): Promise<string>; // Posts one file to the stack's file endpoint (double-submit CSRF) and returns the new FileRef id, or the claim handle when the server issued one (anonymous uploads), which a save must submit.
149
167
  function useBrowserNavApi(options?: { hasWorkspaces?: boolean; basePath?: string; features?: FeatureSchema[]; }): NavApi; // React hook that builds a NavApi from browser history.
150
168
  function useBrowserTokensApi(): TokensApi; // Builds a TokensApi for the browser.
151
169
  function useDispatchTarget(): (target: TargetRef) => void; // Recommended production dispatch.
152
170
  function useDispatcher(): Dispatcher;
153
171
  function useDispatcherStatus(): DispatcherStatus;
154
172
  function useDraft<T extends object>(defaults: T, options?: { idPrefix?: string; }): { draft: T; patch: (changes: Partial<T>) => void; reset: () => void; field: <K extends keyof T>(name: K) => { id: string; name: string; value: T[K]; onChange: (v: T[K]) => void; }; }; // Form state for calculator screens: a draft object plus `patch` for partial updates, and `field(name)` that provides `{ id, name, value, onChange }` props ready for field widgets (NumberField/MoneyField/PercentField).
173
+ function useFileMeta(fileId: string): FileMeta | null;
155
174
  function useForm<TValues extends FormValues, TCtx = unknown>(options: UseFormOptions<TValues, TCtx>): UseFormResult<TValues>;
156
175
  function useIsNarrowViewport(): boolean;
157
176
  function useIsViewportBelow(breakpointPx: number): boolean;
@@ -177,6 +196,12 @@ function useUserRoles(): string[] | undefined;
177
196
 
178
197
  ```ts
179
198
  const BROWSER_LOCALE_STORAGE_KEY: "kumiko:locale";
199
+ const DrawnFilter: LucideIcon;
200
+ const DrawnPanel: LucideIcon;
201
+ const DrawnPencil: LucideIcon;
202
+ const DrawnSearch: LucideIcon;
203
+ const DrawnSparkles: LucideIcon;
204
+ const DrawnWand: LucideIcon;
180
205
  const DropdownMenu: FC<Primitive.DropdownMenuProps>;
181
206
  const DropdownMenuPortal: FC<Primitive.DropdownMenuPortalProps>;
182
207
  const DropdownMenuTrigger: ForwardRefExoticComponent<Primitive.DropdownMenuTriggerProps & RefAttributes<HTMLButtonElement>>;
@@ -237,10 +262,13 @@ type AvatarProps = {
237
262
  type AvatarShape = "square" | "round";
238
263
  type AvatarSize = "xs" | "sm" | "md" | "lg";
239
264
  type BannerProps = { // Banner for an inline message or page state (for example, "Loading…" or "Screen not found").
240
- variant?: "error" | "info" | "loading" | "warning" | "primary" | "hint" | "ok"; // "error" for alerts (conflict, network error), "info" for neutral placeholders (not-found, loading), "loading" for load states, "warning" for a non-blocking but attention-grabbing notice (e.g. secretMint's "this is shown only once"), "primary" for a call-to-action notice (neutral background, accent in the primary color; pair it with `title` and `actions`), "hint" for a quiet aside on a muted background (e.g. per-entry results of a submit, with an "Open" link in `actions`), "ok" for a completed state (e.g. "Done, nothing left to do here").
265
+ variant?: "error" | "info" | "loading" | "warning" | "primary" | "hint" | "ok"; // "error" for alerts (conflict, network error), "info" for neutral placeholders (not-found, loading), "loading" for load states, "warning" for a non-blocking but attention-grabbing notice (e.g. secretMint's "this is shown only once"), "primary" for a call-to-action notice (neutral background, accent in the primary color; pair it with `title` and `actions`), "hint" for a quiet aside on a muted background (e.g. per-entry results of a submit, with an "Open" link in `actions`), "ok" for a completed state (e.g. "Done").
266
+ inline?: boolean; // Title and text run on one line (text right behind the bold title); the text is dropped below sm, so a phone shows title and actions only.
241
267
  density?: "default" | "compact"; // "compact" is one line: the title reads inline before the text.
242
268
  icon?: NavIconKey; // Icon left of the text.
243
269
  title?: ReactNode; // Bold heading above `children`, inside the text column.
270
+ narrowTitle?: ReactNode; // Replaces `title` below sm.
271
+ narrowText?: ReactNode; // Replaces `children` below sm and stays visible there even when `inline` drops the text.
244
272
  titleTestId?: string;
245
273
  children?: ReactNode;
246
274
  parts?: { text: string; strong?: boolean; }[]; // Structured text after `children`; `strong` parts render emphasized.
@@ -276,6 +304,7 @@ type ClientFeatureDefinition = {
276
304
  navEntities?: Readonly<Record<string, string[]>>; // SSE entity lists per nav ID for live refresh of navProviders, analogous to `treeEntities`.
277
305
  navProvidersFromCollections?: (collections: QualifiedContentCollection[]) => CollectionNavProviders; // Nav providers derived from the app schema — called with every `r.contentCollection()` the app declares.
278
306
  contentEditors?: Partial<Record<ContentEditorFormat, ContentEditorComponent>>; // Content editor components — map `contentFormat` ("plain" | "document") → React component.
307
+ contentPreviews?: ContentPreviewsMap; // Preview renderers for the editor workbench's preview mode, keyed by target ("pdf" | "mail" | "web" | "text").
279
308
  resolvers?: Readonly<Record<string, ComponentType<{ target: TargetRef; onClose: () => void; }>>>; // Editor resolver components keyed by featureId:action.
280
309
  };
281
310
  type ColorTokens = {
@@ -347,6 +376,9 @@ type CorePrimitives = {
347
376
  FillContainer?: ComponentType<FillContainerProps>; // Optional (unlike the other Core-Primitives) so existing partial CorePrimitives mocks in tests keep compiling — additive rollout of a new primitive shouldn't force every test double to grow a stub.
348
377
  PageHeader?: ComponentType<PageHeaderProps>; // Optional — additive rollout, see StickyActionBar.
349
378
  MetricBand?: ComponentType<MetricBandProps>; // Optional — additive rollout, see StickyActionBar.
379
+ RecordBreadcrumb?: ComponentType<RecordBreadcrumbProps>; // Optional — without it the detail screen renders the path as plain links.
380
+ RecordSummary?: ComponentType<RecordSummaryProps>; // Optional — without it the summary renders as plain text.
381
+ RecordSteps?: ComponentType<RecordStepsProps>; // Optional — without it the steps render as a plain card.
350
382
  ActionOverflowMenu?: ComponentType<ActionOverflowMenuProps>; // Optional: without an implementation, callers with >2 header/row actions fall back to today's all-buttons-inline rendering.
351
383
  SecretReveal?: ComponentType<SecretRevealProps>; // Optional (unlike the other Core-Primitives) so existing partial CorePrimitives mocks in tests keep compiling — additive rollout of a new primitive shouldn't force every test double to grow a stub.
352
384
  StickyActionBar?: ComponentType<StickyActionBarProps>; // Optional (unlike the other Core-Primitives) so existing partial CorePrimitives mocks in tests keep compiling — additive rollout of a new primitive shouldn't force every test double to grow a stub.
@@ -413,8 +445,10 @@ type DataTableProps = DataTableTableBlock & {
413
445
  rowTone?: (row: ListRowViewModel) => SelectOptionTone | undefined; // Tints a row.
414
446
  onRowClick?: (row: ListRowViewModel) => void;
415
447
  sort?: DataTableSort | null; // Current sorting, or null when unsorted.
416
- onSortChange?: (next: DataTableSort | null) => void; // Called with the next sort state after a header click.
417
- rowActions?: DataTableRowAction[]; // Per-row actions rendered in a right-hand column as inline buttons (≤2 actions) or a kebab dropdown (>2).
448
+ onSortChange?: (next: DataTableSort | null) => void; // Called with the next sort state after a header click (asc → desc → null); the caller updates URL state or the query parameter and refetches.
449
+ sortOptions?: (DataTableSort & { label: string; })[];
450
+ toolbarSort?: true;
451
+ rowActions?: DataTableRowAction[]; // Per-row actions in a right-hand column: inline buttons (≤2) or a kebab (>2).
418
452
  rowActionMode?: DataTableRowActionMode; // How the row-action column renders: - `"adaptive"` (default): with `onRowClick` all actions except the `rowClick` one go in the kebab (no kebab or column if none remain); without it the primary action is a link button and the rest go in the kebab (a single action gets no kebab).
419
453
  bulk?: DataTableBulk; // Present: row checkboxes plus a selection bar that runs these actions once per selected row.
420
454
  emptyState?: ReactNode; // Custom empty-state content (e.g. Icon + Heading + CTA-Button).
@@ -499,9 +533,46 @@ type DrawerProps = {
499
533
  panelClassName?: string; // Extra classes for the panel, merged over the built-in ones.
500
534
  fillBody?: boolean; // The body becomes a plain flex column with no padding or scrolling of its own, for children that bring their own scroll area and pinned footer.
501
535
  };
536
+ type EditorActionTestIds = {
537
+ discard: string;
538
+ save: string;
539
+ publish: string;
540
+ };
541
+ type EditorHeaderTestIds = {
542
+ save: string;
543
+ publish: string;
544
+ };
545
+ type EditorMode = "edit" | "preview";
502
546
  type EditorPanelProps = {
503
547
  resolvers: ReadonlyMap<string, ResolverComponent>;
504
548
  };
549
+ type EditorSaveActions = {
550
+ busy: boolean;
551
+ canSave: boolean;
552
+ onSave: () => void;
553
+ saveLabel?: string; // Replaces "Save", e.g. "Create" for a record that does not exist yet.
554
+ canPublish?: boolean; // Without them the header has no publish button.
555
+ onPublish?: () => void;
556
+ };
557
+ type EditorWorkbenchProps = {
558
+ testId: string;
559
+ title: string;
560
+ status?: ReactNode;
561
+ info: {
562
+ edit: ReactNode;
563
+ preview: ReactNode;
564
+ }; // Info bar text per mode.
565
+ controls?: ReactNode; // Info bar controls shared by both modes, e.g. the locale switch.
566
+ banners?: ReactNode;
567
+ edit: ReactNode;
568
+ preview: ReactNode;
569
+ rail: {
570
+ edit: ReactNode;
571
+ preview: ReactNode;
572
+ left?: ReactNode;
573
+ }; // Right rail per mode; `left` adds a rail on the left (a placeholder list) shown in both modes.
574
+ save: WorkbenchSave;
575
+ };
505
576
  type FeedRow = {
506
577
  id: string;
507
578
  primary: string;
@@ -536,6 +607,10 @@ interface FileFieldProps extends FieldBase {
536
607
  entityType?: string; // Binds the upload to a specific entity field; the `/api/files` endpoint then validates `accept`/`maxSize` server-side against that field's definition.
537
608
  fieldName?: string;
538
609
  }
610
+ type FileMeta = {
611
+ fileName: string;
612
+ mimeType: string | undefined;
613
+ };
539
614
  type FileRefTarget = Pick<FileUploadFormDataInput, "entityType" | "entityId" | "fieldName" | "subField" | "actionForm">;
540
615
  type FloatingPanelGeometry = {
541
616
  x: number;
@@ -575,6 +650,7 @@ type FontTokens = {
575
650
  heading: string;
576
651
  mono: string;
577
652
  };
653
+ type FooterTone = "bad" | "warn" | "ok";
578
654
  type FormProps = { // Submit wrapper.
579
655
  onSubmit: (e?: FormEvent) => void;
580
656
  focusFirstErrorKey?: number; // Bumped by the host each time a submit fails on field errors; the form then moves focus to its first invalid control.
@@ -645,6 +721,7 @@ type InfinityListSelection = { // Position of the selected row among the rows lo
645
721
  nextId: string | null;
646
722
  hasMore: boolean;
647
723
  };
724
+ type InfoBarTone = "active" | "muted" | "warn";
648
725
  type InputProps =
649
726
  | {
650
727
  kind: "text";
@@ -1155,6 +1232,7 @@ type PresenceNoticeProps = {
1155
1232
  nowMs?: number; // Fixed "now" in epoch ms; without it the notice follows the clock once a minute.
1156
1233
  testId?: string;
1157
1234
  };
1235
+ type PreviewDevice = "desktop" | "mobile";
1158
1236
  type PrimitivesProviderProps = {
1159
1237
  children: ReactNode;
1160
1238
  value: PrimitivesRegistry;
@@ -1324,12 +1402,15 @@ type RenderListProps = DataTableTableBlockProps & {
1324
1402
  description?: string; // Hint at the left of the toolbar (already translated).
1325
1403
  emptyContent?: ListEmptyStateContent; // Author-declared replacement for the default empty box (already translated).
1326
1404
  narrowed?: boolean; // Search or filters changed the result; the empty box then says "no matches".
1405
+ namedFilterEmpty?: NamedFilterEmptyContent; // Empty sentence of the active named filter (already translated) with its reset; shown instead of "no matches" when no search term is set.
1327
1406
  defaultFilterActive?: boolean; // Nothing was narrowed by the user, but a default filter is still on; the empty box then offers "show all" instead of "create the first one".
1328
1407
  itemNounKey?: string; // Plural-forms key for the footer count noun; default is the entity's `:noun` convention key.
1329
1408
  searchValue?: string; // Current search term (from URL state / the parent).
1330
1409
  onSearchChange?: (next: string) => void; // Called when the debounced search term changes.
1331
1410
  sort?: ListSort | null; // Current sorting, or null for the server's default order.
1332
1411
  onSortChange?: (next: ListSort | null) => void; // Called with the next sort state after a header click.
1412
+ sortOptions?: DataTableProps["sortOptions"]; // Labelled sort choices (labels already translated) for the "Sorted by" select.
1413
+ toolbarSort?: DataTableProps["toolbarSort"];
1333
1414
  pager?: {
1334
1415
  page: number;
1335
1416
  limit: number;
@@ -1430,7 +1511,7 @@ type StatDelta = {
1430
1511
  tone?: StatTone;
1431
1512
  };
1432
1513
  type StatTone = DashboardStatTone;
1433
- type StatusBadgeTone = StatusTone | "accent"; // `accent` is a brand-colored call-out (e.g. "3 suggestions"), not a status — hence not part of `StatusTone`, which toasts and select options share.
1514
+ type StatusBadgeTone = StatusBadgeOptionTone; // `accent` is a brand tone select options can request; toasts only use `StatusTone`.
1434
1515
  type StatusBarEntry = {
1435
1516
  key: string; // Stable key (z.B.
1436
1517
  level: number; // Bar height from 0 to 1 (e.g. operational=1, degraded=0.75, outage=0.25).
@@ -1475,11 +1556,12 @@ type StepListProps = {
1475
1556
  }; // Badge next to the title, e.g. "Erledigt" for a finished list.
1476
1557
  steps: StepListItem[];
1477
1558
  footerActions?: StepAction[]; // Footer row: a ghost action for the whole list next to the primary next-step action.
1559
+ footerNote?: string; // Quiet line under the footer actions, e.g. "Nothing is saved without you."
1478
1560
  collapsedAfter?: number; // Show only the first n steps plus "und k weitere Schritte" (expands on click).
1479
1561
  collapseWhen?: "always" | "overflow"; // "always" (default) folds after `collapsedAfter`; "overflow" folds a `fill` list only when its steps do not fit its height, then shows as many as fit but at least `collapsedAfter`.
1480
1562
  surface?: "ai" | "plain"; // "ai" (default) = AiSurface background, "plain" = no background.
1481
1563
  fill?: boolean; // Stretch to the container height: steps scroll in the middle, the footer stays pinned at the bottom.
1482
- progress?: "full" | "count" | "none"; // "full" (default) = "x von y erledigt" plus bar, "count" = only the count, "none" = neither, e.g. when `status` already says the list is done.
1564
+ progress?: "full" | "count" | "total" | "none"; // "full" (default) = "x von y erledigt" plus bar, "count" = only the count, "total" = only "n steps" (rejected ones left out), "none" = neither, e.g. when `status` already says the list is done.
1483
1565
  emptyContent?: ReactNode;
1484
1566
  selection?: StepListSelection; // Adds a checkbox per selectable step, a select-all row and selection footer actions.
1485
1567
  phoneCard?: boolean; // On a phone the list reads as a card: the header sits inside the surface and the steps in a framed white box.
@@ -1489,6 +1571,7 @@ type StepListSelection = {
1489
1571
  selectedIds: string[]; // Explicitly chosen step ids (controlled); prerequisites are added on top.
1490
1572
  onSelectionChange: (selectedIds: string[]) => void;
1491
1573
  actions: StepSelectionAction[]; // Replace `footerActions` while at least one step is selected.
1574
+ compact?: true; // Phone-card style: no select-all row, the actions stay visible at 0 selected (disabled unless `ignoresSelection`), a muted header and left-aligned footer.
1492
1575
  };
1493
1576
  type StepSelectability =
1494
1577
  | {
@@ -1504,7 +1587,9 @@ type StepSelectability =
1504
1587
  ;
1505
1588
  type StepSelectionAction = {
1506
1589
  id: string;
1507
- label: string; // Without a number: the list appends " (n)" with the effective selection size.
1590
+ label: string; // Without a number: the list appends " (n)" with the effective selection size (see `labelForCount`).
1591
+ labelForCount?: (count: number) => string; // Replaces the appended " (n)": the label for the effective selection size.
1592
+ ignoresSelection?: true; // No counter, never disabled by an empty selection (e.g. "Review one by one"); `onClick` still gets the selection.
1508
1593
  onClick: (stepIds: string[]) => void; // Receives the effective selection in list order, prerequisites included.
1509
1594
  variant?: "primary" | "secondary" | "ghost";
1510
1595
  disabled?: boolean;
@@ -1519,6 +1604,7 @@ type StepTag = {
1519
1604
  label: string;
1520
1605
  tone?: "accent" | "muted" | "warn" | "ok" | "bad";
1521
1606
  afterWaiting?: boolean; // A note about the step's history (e.g. just changed) reads after what it waits for.
1607
+ side?: true; // Sits in the right column of the row, above a trailing link (e.g. a risk chip over "Preview").
1522
1608
  };
1523
1609
  interface TextFieldProps extends FieldBase {
1524
1610
  value: string;
@@ -1639,6 +1725,8 @@ type UploadZoneProps = {
1639
1725
  describeError?: (cause: unknown) => string; // Turns a failed upload into the row's error text.
1640
1726
  onRemove?: (value: string) => void; // Controlled use, for a form field: a string returned by `onUpload` becomes the row's value and done rows get a remove button that calls this with it.
1641
1727
  doneValues?: string[]; // The values the owner currently holds.
1728
+ trackUpload?: TrackFormUpload; // Wraps the whole per-file work, image resize included, so a surrounding form can hold back submit while the file is still being prepared.
1729
+ labelForValue?: (value: string) => ReactNode; // Row label of a value the owner already held (e.g. a FileRef id resolved to its file name).
1642
1730
  };
1643
1731
  type UseFormOptions<TValues extends FormValues, TCtx = unknown> = FormControllerOptions<TValues, TCtx>;
1644
1732
  type UseFormResult<TValues extends FormValues> = {
@@ -1679,6 +1767,16 @@ type UserRolesProviderProps = {
1679
1767
  roles: string[] | undefined;
1680
1768
  children: ReactNode;
1681
1769
  };
1770
+ type WorkbenchSave = {
1771
+ busy: boolean;
1772
+ canSave: boolean;
1773
+ dirty: boolean;
1774
+ onSave: () => void;
1775
+ saveLabel?: string;
1776
+ onDiscard: () => void;
1777
+ saveError: string | null;
1778
+ modifiedAt?: string | null;
1779
+ };
1682
1780
  type WorkspaceShellProps = {
1683
1781
  brand: ReactNode; // Branding / logo on the left side of the topbar.
1684
1782
  schema: AppSchema | FeatureSchema; // Schema with `workspaces` populated — the engine builds this from registry.getAllWorkspaces() + getWorkspaceNavs().
@@ -1689,6 +1787,9 @@ type WorkspaceShellProps = {
1689
1787
  focusRailNavQns?: string[]; // Top-level nav QNs the focus rail shows as tiles; the others sit behind a "More" tile that opens the full sidebar.
1690
1788
  navBadges?: ReadonlyMap<string, ReactNode>; // Runtime badge slot per nav leaf (bare nav id), same as DefaultAppShell.
1691
1789
  fill?: boolean; // Viewport-fit shell.
1790
+ contentSurface?: "card" | "background"; // Surface behind the screen content.
1791
+ navStyle?: ShellNavStyle; // `"plain"` renders the sidebar without leading icons while expanded (the focus rail and the collapsed rail keep them), with uppercase group labels, quiet active entries, a panel-symbol sidebar trigger and a 58px title bar.
1792
+ notificationBellPlacement?: "header" | "overflow"; // `"header"` (default) draws the notification bell in the title bar; `"overflow"` moves it into the "…" menu, which then shows on every width.
1692
1793
  children: ReactNode; // Screen content.
1693
1794
  };
1694
1795
  type WorkspaceShellUser = {
@@ -42,9 +42,10 @@ function resetTestTables(db: AnyDb, tables: ClearableTable[]): Promise<void>; //
42
42
  function rolesOf(access: AccessRule | undefined): string[];
43
43
  function runInRowLevelSecurityScope<T>(scope: RowLevelSecurityScope, fn: () => T): T;
44
44
  function runInSystemRowLevelSecurityScope<T>(reason: string, fn: () => T): T;
45
- function seedRow<TRow = unknown>(db: AnyDb, table: SeedTable, values: Record<string, unknown>): Promise<TRow | undefined>;
45
+ function seedRow<TRow = unknown>(db: AnyDb, table: SeedTable, values: Record<string, unknown>, options?: SeedOptions): Promise<TRow | undefined>;
46
46
  function seedRowViaEventStore(db: DbConnection, table: EventStoreWriteTarget["table"], values: Readonly<Record<string, unknown>>): Promise<void>;
47
- function seedRows<TRow = unknown>(db: AnyDb, table: SeedTable, rows: ReadonlyArray<Record<string, unknown>>): Promise<TRow[]>;
47
+ function seedRows<TRow = unknown>(db: AnyDb, table: SeedTable, rows: ReadonlyArray<Record<string, unknown>>, options?: SeedOptions): Promise<TRow[]>;
48
+ function seedRowsViaEventStore(db: DbConnection, table: EventStoreWriteTarget["table"], rows: ReadonlyArray<Readonly<Record<string, unknown>>>): Promise<void>;
48
49
  function sleep(ms: number): Promise<unknown>;
49
50
  function tenantRowLevelSecurityScope(tenantId: TenantId): RowLevelSecurityScope;
50
51
  function terminateBackendsByApplicationName(admin: AdminClient, applicationName: string): Promise<void>;
@@ -17,6 +17,7 @@ function dropTestDb(baseUrl: string, dbName: string): Promise<void>;
17
17
  function pushEntityProjectionTables(stack: DbHolder, registry: Registry): Promise<void>; // Push all implicit-projection tables — one per `r.entity()` — that the registry knows about.
18
18
  function resetEventStore(stack: { db: unknown; eventDispatcher?: EventDispatcher; }, extraTables?: (unknown | string)[]): Promise<void>; // Wipes event store + framework-state + the given feature read-models in one TRUNCATE, then re-registers the event-consumer state rows.
19
19
  function setupTestStack(options: TestStackOptions): Promise<TestStack>;
20
+ function testRunQueueNamePrefix(label: string): string; // Queue-name prefix for a JobRunner a test builds itself (`jobs.queueNamePrefix`, `createJobRunner`): it sits in the test run's namespace, so the run sweep removes its BullMQ keys even when the test never cleans them up.
20
21
  function unsafeCreateEntityTable(db: DbConnection, entity: EntityDefinition, entityName?: string): Promise<void>; // Bypass: creates an entity-table directly without going through the full registry.
21
22
  function unsafeEnsureEntityTable(db: DbConnection, entity: EntityDefinition, entityName?: string): Promise<boolean>;
22
23
  function unsafePushTables(db: DbConnection, tables: Record<string, unknown>, prevTables?: Record<string, unknown>, options?: { rowLevelSecurity?: RowLevelSecurityMode; }): Promise<void>; // Bypass: pushes table definitions to the database directly.
@@ -90,6 +91,7 @@ type TestStack = {
90
91
  sseBroker: SseBroker;
91
92
  dispatcher: Dispatcher;
92
93
  context: AppContext;
94
+ clock?: ManualClock; // The effective manual clock behind `ctx.tz.now()`: `extraContext.clock` when it is one, else the clock created from `options.now`; absent when neither is manual.
93
95
  eventDispatcher?: EventDispatcher;
94
96
  lifecycle?: Lifecycle;
95
97
  jobRunner?: JobRunner;
@@ -107,6 +109,7 @@ type TestStackOptions = {
107
109
  }; // Search config per tenant — defaults to tenant 1 with all text fields
108
110
  jwtSecret?: string;
109
111
  defaultLocale?: string; // Boot default locale (BCP-47) merged into AppContext before extraContext.
112
+ now?: string | Temporal.Instant; // Fixed wall clock for `ctx.tz.now()`: becomes a manual clock merged into the AppContext as `clock`; an `extraContext.clock` wins.
110
113
  extraContext?: Record<string, unknown> | ((deps: { registry: Registry; db: DbConnection; sseBroker: SseBroker; redis: Redis; }) => Record<string, unknown>);
111
114
  authConfig?: AuthRoutesConfig; // Wire up auth routes (login, tenant-switch).
112
115
  files?: {