@cosmicdrift/kumiko-framework 0.414.0 → 0.416.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 (115) hide show
  1. package/agents/api/framework-engine.md +46 -8
  2. package/agents/api/framework-errors.md +1 -1
  3. package/agents/api/framework-ui-types.md +69 -4
  4. package/agents/api/renderer-web.md +27 -4
  5. package/agents/api/types.md +68 -16
  6. package/agents/api.md +2 -2
  7. package/agents/boot-rules.md +39 -7
  8. package/agents/examples/crypto-shredding-hr.md +63 -1
  9. package/agents/examples/embedded.md +24 -1
  10. package/agents/examples/handbook-knowledge.md +129 -0
  11. package/agents/examples/record-detail-layout.md +113 -7
  12. package/agents/examples/signature.md +186 -0
  13. package/agents/examples/writeform-section.md +1 -0
  14. package/agents/examples.md +2 -0
  15. package/agents/features-index.md +4 -0
  16. package/agents/features.md +14 -0
  17. package/agents/widgets.md +7 -0
  18. package/dist/api/request-context-internals.d.ts +2 -0
  19. package/dist/api/request-context-scopes.js +9 -2
  20. package/dist/api/request-context.js +1 -1
  21. package/dist/api/routes.js +4 -4
  22. package/dist/api/server-event-dispatcher.js +3 -0
  23. package/dist/api/server-routes.js +2 -0
  24. package/dist/db/parent-ref-clause.js +31 -3
  25. package/dist/db/parent-ref-global-hosts.d.ts +4 -1
  26. package/dist/db/parent-ref-global-hosts.js +50 -12
  27. package/dist/db/queries/rls-boot-catalog.js +5 -6
  28. package/dist/db/queries/rls-shape.d.ts +1 -0
  29. package/dist/db/queries/rls-shape.js +21 -6
  30. package/dist/db/table-builder.js +3 -1
  31. package/dist/engine/boot-validator/boot-phases.js +5 -0
  32. package/dist/engine/boot-validator/boot-rules.d.ts +144 -9
  33. package/dist/engine/boot-validator/card-meta-overflow-rules.d.ts +2 -2
  34. package/dist/engine/boot-validator/card-meta-overflow-rules.js +2 -2
  35. package/dist/engine/boot-validator/card-meta-overflow.js +7 -5
  36. package/dist/engine/boot-validator/cross-tenant-file-read.d.ts +3 -0
  37. package/dist/engine/boot-validator/cross-tenant-file-read.js +19 -0
  38. package/dist/engine/boot-validator/entity-declaration-rules.d.ts +10 -0
  39. package/dist/engine/boot-validator/entity-declaration-rules.js +10 -0
  40. package/dist/engine/boot-validator/entity-list-screens.js +2 -7
  41. package/dist/engine/boot-validator/list-row-guidance-rules.d.ts +17 -2
  42. package/dist/engine/boot-validator/list-row-guidance-rules.js +17 -2
  43. package/dist/engine/boot-validator/list-row-guidance.d.ts +7 -0
  44. package/dist/engine/boot-validator/list-row-guidance.js +45 -1
  45. package/dist/engine/boot-validator/list-sort-summary-rules.d.ts +2 -2
  46. package/dist/engine/boot-validator/list-sort-summary-rules.js +2 -2
  47. package/dist/engine/boot-validator/list-sort-summary.js +31 -20
  48. package/dist/engine/boot-validator/list-toolbar-options.js +3 -4
  49. package/dist/engine/boot-validator/named-filter-rules.d.ts +10 -0
  50. package/dist/engine/boot-validator/named-filter-rules.js +10 -0
  51. package/dist/engine/boot-validator/projection-list-screens.js +5 -4
  52. package/dist/engine/boot-validator/query-output-columns.js +18 -0
  53. package/dist/engine/boot-validator/query-output-guidance.js +3 -0
  54. package/dist/engine/boot-validator/query-refs.js +14 -1
  55. package/dist/engine/boot-validator/relative-time-format.d.ts +1 -0
  56. package/dist/engine/boot-validator/relative-time-format.js +51 -0
  57. package/dist/engine/boot-validator/screens-actions-rules.d.ts +16 -1
  58. package/dist/engine/boot-validator/screens-actions-rules.js +16 -1
  59. package/dist/engine/boot-validator/screens-actions.js +56 -16
  60. package/dist/engine/boot-validator/screens-dashboard-narrow.d.ts +2 -1
  61. package/dist/engine/boot-validator/screens-dashboard-narrow.js +43 -4
  62. package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +12 -2
  63. package/dist/engine/boot-validator/screens-dashboard-rules.js +12 -2
  64. package/dist/engine/boot-validator/screens-dashboard.js +2 -1
  65. package/dist/engine/boot-validator/screens-forms-layout-rules.d.ts +5 -0
  66. package/dist/engine/boot-validator/screens-forms-layout-rules.js +5 -0
  67. package/dist/engine/boot-validator/screens-forms-rules.d.ts +60 -0
  68. package/dist/engine/boot-validator/screens-forms-rules.js +60 -0
  69. package/dist/engine/boot-validator/screens-forms.d.ts +1 -1
  70. package/dist/engine/boot-validator/screens-forms.js +108 -2
  71. package/dist/engine/boot-validator/screens-kind-config-edit.js +1 -0
  72. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +5 -0
  73. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +5 -0
  74. package/dist/engine/boot-validator/screens-kind-projection-detail.js +30 -0
  75. package/dist/engine/boot-validator/screens-lists-rules.d.ts +5 -0
  76. package/dist/engine/boot-validator/screens-lists-rules.js +5 -0
  77. package/dist/engine/boot-validator/screens-lists.js +4 -1
  78. package/dist/engine/build-config-feature-schema.js +5 -35
  79. package/dist/engine/config-access-rules.d.ts +3 -0
  80. package/dist/engine/config-access-rules.js +34 -0
  81. package/dist/engine/factories.d.ts +2 -0
  82. package/dist/engine/named-filter-roles.js +6 -14
  83. package/dist/engine/project-app-schema-for-roles.js +2 -0
  84. package/dist/engine/schema-builder.js +3 -1
  85. package/dist/engine/soft-delete-cleanup.js +2 -0
  86. package/dist/errors/reasons.d.ts +1 -0
  87. package/dist/errors/reasons.js +4 -0
  88. package/dist/files/file-routes.d.ts +2 -0
  89. package/dist/files/file-routes.js +85 -22
  90. package/dist/files/foreign-tenant-file-read.d.ts +13 -0
  91. package/dist/files/foreign-tenant-file-read.js +64 -0
  92. package/dist/i18n/required-surface-keys.js +28 -7
  93. package/dist/jobs/job-runner-execution.js +3 -0
  94. package/dist/jobs/job-runner-types.d.ts +1 -0
  95. package/dist/jobs/job-runner.js +8 -0
  96. package/dist/pipeline/context-services.d.ts +1 -1
  97. package/dist/pipeline/context-services.js +1 -1
  98. package/dist/pipeline/event-dispatcher-delivery.js +3 -0
  99. package/dist/pipeline/event-dispatcher.d.ts +2 -0
  100. package/dist/pipeline/handler-context-phase-denials.js +1 -1
  101. package/dist/pipeline/irreversible-operation-gate.js +36 -10
  102. package/dist/search/meilisearch-adapter-internals.d.ts +2 -0
  103. package/dist/search/meilisearch-adapter-internals.js +5 -0
  104. package/dist/search/meilisearch-adapter.d.ts +1 -0
  105. package/dist/search/meilisearch-adapter.js +3 -2
  106. package/dist/ui-types/card-column-roles.d.ts +2 -0
  107. package/dist/ui-types/card-column-roles.js +15 -0
  108. package/dist/ui-types/index.d.ts +2 -2
  109. package/dist/ui-types/index.js +1 -1
  110. package/package.json +3 -3
  111. package/presets/biome-plugins/no-date-api.grit +3 -1
  112. package/presets/biome-plugins/no-direct-fetch.grit +1 -1
  113. package/presets/biome-plugins/unsafe-json-parse.grit +7 -1
  114. package/presets/biome-rules.json +12 -10
  115. package/src/changes.json +99 -0
@@ -3,6 +3,7 @@ import { validateActionWiring, validateFieldWiring } from "./action-wiring.js";
3
3
  import { validateApiExposureMatching, validateExtensionUsages } from "./api-ext.js";
4
4
  import { collectExposedApis } from "./boot-context.js";
5
5
  import { validateCircularDeps, validateConfigKeyBacking, validateConfigKeyBounds, validateConfigKeyComputed, validateConfigKeyOptionsQuery, validateConfigKeyPiiEncrypted, validateConfigKeyRequired, } from "./config-deps.js";
6
+ import { validateCrossTenantFileRead } from "./cross-tenant-file-read.js";
6
7
  import { validateSqlDerivedFields } from "./derived-sql-fields.js";
7
8
  import { collectDetailForScreens } from "./detail-screens.js";
8
9
  import { validateDerivedFieldCollisions, validateEmbeddedFields, validateEncryptedFields, validateEntityIndexes, validateExtendSchemaCollisions, validateFileFields, validateHandlerAccess, validateLocatedTimestamps, validateLockedWhen, validateMultiStreamProjections, validateReferenceFields, validateSearchableFieldReadAccess, validateTransitions, } from "./entity-handler.js";
@@ -107,6 +108,10 @@ const FEATURE_CHECKS = [
107
108
  run: (f, c) => validateOwnershipRules(f, c.allClaimKeys, c.knownRoles),
108
109
  },
109
110
  { check: "validateReadGates", run: (f, c) => validateReadGates(f, c.featureMap) },
111
+ {
112
+ check: "validateCrossTenantFileRead",
113
+ run: (f, c) => validateCrossTenantFileRead(f, c.queryHandlerQns),
114
+ },
110
115
  { check: "validateTransferGraph", run: (f, c) => validateTransferGraph(f, c.featureMap) },
111
116
  { check: "validateMultiStreamProjections", run: (f) => validateMultiStreamProjections(f) },
112
117
  ];
@@ -177,6 +177,16 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
177
177
  readonly summary: "A named filter's emptyState.title is a non-empty i18n key.";
178
178
  readonly fix: "Name the title key or remove emptyState from the filter.";
179
179
  };
180
+ readonly emptyStateParamsQueryEmpty: {
181
+ readonly id: "list/named-filter-empty-state-params-query-empty";
182
+ readonly summary: "A named filter's emptyState.paramsQuery is a non-empty query QN.";
183
+ readonly fix: "Name the query or remove paramsQuery from the emptyState.";
184
+ };
185
+ readonly emptyStateParamsQueryWithoutDescription: {
186
+ readonly id: "list/named-filter-empty-state-params-query-without-description";
187
+ readonly summary: "A named filter's emptyState.paramsQuery feeds the description, so it needs one.";
188
+ readonly fix: "Set emptyState.description (an i18n key with {params}) or remove paramsQuery.";
189
+ };
180
190
  readonly statNavigateTarget: {
181
191
  readonly id: "named-filter/stat-navigate-target";
182
192
  readonly summary: "A stat navigate.screen resolves to an entityList, projectionList or custom screen.";
@@ -231,8 +241,8 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
231
241
  }, {
232
242
  readonly overflow: {
233
243
  readonly id: "list/card-meta-overflow";
234
- readonly summary: "A card list shows at most the maximum number of meta columns.";
235
- readonly fix: "Reduce each list to the maximum number of meta columns or mark the others hideOnNarrow: true.";
244
+ readonly summary: "A card list shows at most the maximum number of meta lines.";
245
+ readonly fix: "Reduce each list to the maximum number of meta lines or mark the other columns hideOnNarrow: true.";
236
246
  };
237
247
  }, {
238
248
  readonly actionIcon: {
@@ -365,6 +375,16 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
365
375
  readonly summary: "A redirect idFrom only targets entityEdit or projectionDetail screens.";
366
376
  readonly fix: "Use the plain string redirect form.";
367
377
  };
378
+ readonly redirectSearchParamsOnlyActionForm: {
379
+ readonly id: "screen/redirect-search-params-only-action-form";
380
+ readonly summary: "A redirect searchParams is only set on actionForm redirects.";
381
+ readonly fix: "Remove searchParams; other screen kinds do not read it.";
382
+ };
383
+ readonly redirectSearchParamsEmpty: {
384
+ readonly id: "screen/redirect-search-params-empty";
385
+ readonly summary: "A redirect searchParams entry has a non-empty param name and payload field.";
386
+ readonly fix: "Map each search param name to a success-payload field.";
387
+ };
368
388
  readonly successLinkTargetsRecordScreen: {
369
389
  readonly id: "screen/success-link-targets-record-screen";
370
390
  readonly summary: "A success link without idFrom does not target a record screen.";
@@ -382,9 +402,14 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
382
402
  };
383
403
  readonly primaryActionUnknown: {
384
404
  readonly id: "screen/primary-action-unknown";
385
- readonly summary: "primaryAction and inlineActions name a declared action id or the default edit.";
405
+ readonly summary: "primaryAction, inlineActions and footerActions name a declared action id or the default edit.";
386
406
  readonly fix: 'Use a declared action id, or "edit" when the screen sets detailFor.';
387
407
  };
408
+ readonly footerActionConflict: {
409
+ readonly id: "screen/footer-action-conflict";
410
+ readonly summary: "A footerActions id is neither the primaryAction nor in inlineActions.";
411
+ readonly fix: "Keep each action in one place: header (primaryAction), inline row or pinned footer.";
412
+ };
388
413
  readonly fallbackWithoutVisibleWhen: {
389
414
  readonly id: "screen/fallback-without-visible-when";
390
415
  readonly summary: "A screen with a fallback also declares visibleWhen.";
@@ -659,10 +684,20 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
659
684
  readonly summary: 'A stat-group\'s columns is 2, 3 or 4 and needs layout "cards".';
660
685
  readonly fix: 'Set columns to 2, 3 or 4 and give the group a label or layout: "cards", or remove columns.';
661
686
  };
687
+ readonly layoutInvalid: {
688
+ readonly id: "dashboard/layout-invalid";
689
+ readonly summary: 'A dashboard layout is "main-side"; a panel column is "side" or "top", used only with that layout and never on a stat-group child.';
690
+ readonly fix: 'Set layout: "main-side" on the dashboard to use column: "side" or "top", or remove column.';
691
+ };
692
+ readonly listColumnVariantInvalid: {
693
+ readonly id: "dashboard/list-column-variant-invalid";
694
+ readonly summary: 'A list column variant is "primary" and needs display: "button".';
695
+ readonly fix: 'Set display: "button" on the column or remove variant.';
696
+ };
662
697
  readonly statGroupChildHideOnNarrow: {
663
698
  readonly id: "dashboard/stat-group-child-hide-on-narrow";
664
- readonly summary: "Stat-group children do not set hideOnNarrow.";
665
- readonly fix: "Set hideOnNarrow on the whole group instead.";
699
+ readonly summary: "A stat-group keeps at least one child on a phone: not every child sets hideOnNarrow.";
700
+ readonly fix: "Set hideOnNarrow on the whole group instead, or keep one child visible.";
666
701
  };
667
702
  readonly listNarrowFieldUnknown: {
668
703
  readonly id: "dashboard/list-narrow-field-unknown";
@@ -911,6 +946,66 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
911
946
  readonly summary: "fillAction does not target a sensitive, writeOnly or password field.";
912
947
  readonly fix: "Remove fillAction.";
913
948
  };
949
+ readonly fieldDescriptionUnknownField: {
950
+ readonly id: "form/field-description-unknown-field";
951
+ readonly summary: "actionForm fieldDescriptions keys name fields of the form.";
952
+ readonly fix: "Name a field of the form or remove the entry.";
953
+ };
954
+ readonly fieldTextParamUnknownField: {
955
+ readonly id: "form/field-text-param-unknown-field";
956
+ readonly summary: "actionForm fieldLabels and fieldDescriptions params name fields of the form.";
957
+ readonly fix: "Point each param at a field of the form or use the plain i18n key.";
958
+ };
959
+ readonly fieldBadgeUnknownField: {
960
+ readonly id: "form/field-badge-unknown-field";
961
+ readonly summary: "actionForm fieldBadges keys name fields of the form.";
962
+ readonly fix: "Name a field of the form or remove the entry.";
963
+ };
964
+ readonly aiAssistContextFieldUnknown: {
965
+ readonly id: "form/ai-assist-context-field-unknown";
966
+ readonly summary: "aiAssist.contextFields names fields of the same form.";
967
+ readonly fix: "Name other fields of the same form or remove the entry.";
968
+ };
969
+ readonly aiAssistFieldType: {
970
+ readonly id: "form/ai-assist-field-type";
971
+ readonly summary: "aiAssist targets a text or longText field.";
972
+ readonly fix: "Remove aiAssist or use a text or longText field.";
973
+ };
974
+ readonly aiAssistSensitiveField: {
975
+ readonly id: "form/ai-assist-sensitive-field";
976
+ readonly summary: "aiAssist does not target a sensitive, writeOnly or password field.";
977
+ readonly fix: "Remove aiAssist; the field text would be sent to the AI.";
978
+ };
979
+ readonly aiAssistChipInvalid: {
980
+ readonly id: "form/ai-assist-chip-invalid";
981
+ readonly summary: "An aiAssist chip has a label and at least one param.";
982
+ readonly fix: 'Set a non-empty label and params such as { style: "short" }.';
983
+ };
984
+ readonly aiAssistResultFieldEmpty: {
985
+ readonly id: "form/ai-assist-result-field-empty";
986
+ readonly summary: "aiAssist names a non-empty resultField.";
987
+ readonly fix: "Set resultField to the key of the query result that holds the text.";
988
+ };
989
+ readonly aiAssistPromptParamEmpty: {
990
+ readonly id: "form/ai-assist-prompt-param-empty";
991
+ readonly summary: "aiAssist.prompt names a non-empty param.";
992
+ readonly fix: "Set prompt.param to the query payload key that receives the typed instruction.";
993
+ };
994
+ readonly aiAssistEmpty: {
995
+ readonly id: "form/ai-assist-empty";
996
+ readonly summary: "aiAssist declares at least one chip or a prompt.";
997
+ readonly fix: "Add chips or prompt, or remove aiAssist.";
998
+ };
999
+ readonly valueChipsFieldType: {
1000
+ readonly id: "form/value-chips-field-type";
1001
+ readonly summary: "valueChips targets a number, decimal, bigInt or money field.";
1002
+ readonly fix: "Remove valueChips or use a numeric or money field.";
1003
+ };
1004
+ readonly valueChipsUnknownField: {
1005
+ readonly id: "form/value-chips-unknown-field";
1006
+ readonly summary: "valueChips.from names a field of the same form.";
1007
+ readonly fix: "Name a field of the same form (hidden and submit: false is fine) that holds the numbers.";
1008
+ };
914
1009
  readonly requiredFieldWithoutWidget: {
915
1010
  readonly id: "form/required-field-without-widget";
916
1011
  readonly summary: "A required entityEdit field has a widget to fill it.";
@@ -1107,6 +1202,11 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
1107
1202
  readonly summary: "Inline form layouts have no relatedList sections.";
1108
1203
  readonly fix: "Move the section to a projectionDetail screen or remove it.";
1109
1204
  };
1205
+ readonly stepListSectionUnsupported: {
1206
+ readonly id: "form/step-list-section-unsupported";
1207
+ readonly summary: "Inline form layouts have no stepList sections.";
1208
+ readonly fix: "Move the section to a projectionDetail screen or remove it.";
1209
+ };
1110
1210
  readonly writeFormSectionUnsupported: {
1111
1211
  readonly id: "form/write-form-section-unsupported";
1112
1212
  readonly summary: "Inline form layouts have no writeForm sections.";
@@ -1165,9 +1265,24 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
1165
1265
  };
1166
1266
  readonly hintColumnLink: {
1167
1267
  readonly id: "list/hint-column-link";
1168
- readonly summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity or badgeToneField.";
1268
+ readonly summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity, badgeToneField, badgeDot or pillField.";
1169
1269
  readonly fix: "Remove the link or badge option, or move the hint to its own column.";
1170
1270
  };
1271
+ readonly photoGridFieldNotInColumns: {
1272
+ readonly id: "list/photo-grid-field-not-in-columns";
1273
+ readonly summary: "photoGrid.imageField and photoGrid.captionField name a field of the section's columns, so the query output is checked.";
1274
+ readonly fix: "Add the field to the section's columns or name another field.";
1275
+ };
1276
+ readonly pillToneWithoutPill: {
1277
+ readonly id: "list/pill-tone-without-pill";
1278
+ readonly summary: "pillToneField colors the pillField pill, so it needs pillField.";
1279
+ readonly fix: "Set pillField on the column or remove pillToneField.";
1280
+ };
1281
+ readonly pillWithDisplay: {
1282
+ readonly id: "list/pill-with-display";
1283
+ readonly summary: "pillField adds a pill beside the cell value and is not combined with display.";
1284
+ readonly fix: "Remove display or pillField from the column.";
1285
+ };
1171
1286
  readonly hintColumnEmptyPlaceholder: {
1172
1287
  readonly id: "list/hint-column-empty-placeholder";
1173
1288
  readonly summary: "A hint column shows hint.emptyLabel for an empty value and sets no emptyPlaceholder.";
@@ -1216,7 +1331,7 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
1216
1331
  readonly rowDecorationIdsMissing: {
1217
1332
  readonly id: "list/row-decoration-ids-missing";
1218
1333
  readonly summary: "The rowDecoration query's input schema declares `ids`, the row ids the list sends with every call.";
1219
- readonly fix: "Add `ids: z.array(z.string())` to the decoration query's schema.";
1334
+ readonly fix: "Add `ids: z.array(z.string())` to the decoration query's schema; `.max(...)` must cover at least the list page size; the list asks in batches of the first page size.";
1220
1335
  };
1221
1336
  }, {
1222
1337
  readonly listScreenIdUnresolved: {
@@ -1264,6 +1379,11 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
1264
1379
  readonly summary: "A column renderer's react.__component is a non-empty string.";
1265
1380
  readonly fix: "Set react.__component to the name of a client columnRenderers entry.";
1266
1381
  };
1382
+ readonly relativeTimeOptionsInvalid: {
1383
+ readonly id: "list/relative-time-options-invalid";
1384
+ readonly summary: "relativeTime format options (style, absoluteAfterDays, withTime, timeZone) are valid.";
1385
+ readonly fix: "Use style long, short or narrow, an integer absoluteAfterDays of at least 1 and a boolean withTime and an IANA timeZone.";
1386
+ };
1267
1387
  readonly enumOptionTonesInvalid: {
1268
1388
  readonly id: "list/enum-option-tones-invalid";
1269
1389
  readonly summary: "enumOption column tones are known select option tones.";
@@ -1476,6 +1596,11 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
1476
1596
  readonly summary: "A projectionDetail with a header sets no recordTitleField.";
1477
1597
  readonly fix: "Drop recordTitleField; header.title names the record.";
1478
1598
  };
1599
+ readonly initialTabInvalid: {
1600
+ readonly id: "projection-detail/initial-tab-invalid";
1601
+ readonly summary: "initialTab needs layout.mode tabs and each rule names an existing section id; footerHint needs footerActions.";
1602
+ readonly fix: "Use tabs mode and section ids from the layout for initialTab, or declare footerActions next to footerHint.";
1603
+ };
1479
1604
  readonly tabsSectionGroupsAndActions: {
1480
1605
  readonly id: "projection-detail/tabs-section-groups-and-actions";
1481
1606
  readonly summary: "A tabs-mode section declares groups or actions, not both.";
@@ -2671,7 +2796,7 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
2671
2796
  }, {
2672
2797
  readonly sortOptionNotSortable: {
2673
2798
  readonly id: "list/sort-option-not-sortable";
2674
- readonly summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when sort is an enum, lists every option field.";
2799
+ readonly summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when they are enums, lists every option field and dir.";
2675
2800
  readonly fix: "Mark the field sortable and list it as a column, or give the projectionList's query sort and sortDirection parameters that accept the option fields.";
2676
2801
  };
2677
2802
  readonly sortOptionsInvalid: {
@@ -2696,7 +2821,7 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
2696
2821
  };
2697
2822
  readonly summaryRowQueryAcceptsListKeys: {
2698
2823
  readonly id: "list/summary-row-query-accepts-list-keys";
2699
- readonly summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters).";
2824
+ readonly summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters) and every summaryRow.params key.";
2700
2825
  readonly fix: "Add the missing keys to the query schema (or reuse the list query's filter shape) and apply them, or drop the feature on the screen.";
2701
2826
  };
2702
2827
  readonly summaryRowWithTotals: {
@@ -2994,6 +3119,16 @@ export declare const FRAMEWORK_BOOT_RULE_TABLES: readonly [{
2994
3119
  readonly summary: 'A recordOwned (or whenAbsent: "self") field lives only on entities with idType "uuid", because forgetSubject validates the record id as a UUID.';
2995
3120
  readonly fix: 'Set idType: "uuid" on the entity, or give the field a different personal stance.';
2996
3121
  };
3122
+ readonly crossTenantFileReadQueryUnregistered: {
3123
+ readonly id: "files/cross-tenant-read-query-unregistered";
3124
+ readonly summary: "crossTenantFileRead.query names a registered query handler.";
3125
+ readonly fix: "Use the qualified name of a query handler (<feature>:query:<name>) and register it.";
3126
+ };
3127
+ readonly crossTenantFileReadReasonMissing: {
3128
+ readonly id: "files/cross-tenant-read-reason-missing";
3129
+ readonly summary: "crossTenantFileRead declares a non-empty reason.";
3130
+ readonly fix: "State why files of this entity are readable across tenants.";
3131
+ };
2997
3132
  }, {
2998
3133
  readonly openToAllReasonInvalid: {
2999
3134
  readonly id: "handler/open-to-all-reason-invalid";
@@ -1,7 +1,7 @@
1
1
  export declare const CARD_META_OVERFLOW_RULES: {
2
2
  readonly overflow: {
3
3
  readonly id: "list/card-meta-overflow";
4
- readonly summary: "A card list shows at most the maximum number of meta columns.";
5
- readonly fix: "Reduce each list to the maximum number of meta columns or mark the others hideOnNarrow: true.";
4
+ readonly summary: "A card list shows at most the maximum number of meta lines.";
5
+ readonly fix: "Reduce each list to the maximum number of meta lines or mark the other columns hideOnNarrow: true.";
6
6
  };
7
7
  };
@@ -1,7 +1,7 @@
1
1
  export const CARD_META_OVERFLOW_RULES = {
2
2
  overflow: {
3
3
  id: "list/card-meta-overflow",
4
- summary: "A card list shows at most the maximum number of meta columns.",
5
- fix: "Reduce each list to the maximum number of meta columns or mark the others hideOnNarrow: true.",
4
+ summary: "A card list shows at most the maximum number of meta lines.",
5
+ fix: "Reduce each list to the maximum number of meta lines or mark the other columns hideOnNarrow: true.",
6
6
  },
7
7
  };
@@ -1,4 +1,4 @@
1
- import { CARD_META_MAX, cardColumnRoles, cardFileDisplayKind, } from "../../ui-types/card-column-roles.js";
1
+ import { CARD_META_MAX, cardColumnRoles, cardFileDisplayKind, cardMetaLines, } from "../../ui-types/card-column-roles.js";
2
2
  import { LIST_ROW_META_COLUMNS } from "../../ui-types/list-row-meta.js";
3
3
  import { parseRefTarget } from "../parse-ref-target.js";
4
4
  import { normalizeListColumn } from "../screen-helpers.js";
@@ -28,18 +28,20 @@ function countOverflow(feature, screen, location, columns, storedTypeOf, entity)
28
28
  type,
29
29
  renderer: col.renderer,
30
30
  hideOnNarrow: col.hideOnNarrow,
31
+ narrowInline: col.narrowInline,
31
32
  hint: col.hint,
32
33
  ...(fileKind !== undefined && { fileDisplay: { kind: fileKind } }),
33
34
  };
34
35
  });
35
36
  const { meta } = cardColumnRoles(cardColumns);
36
- if (meta.length <= CARD_META_MAX)
37
+ const lineCount = cardMetaLines(meta).length;
38
+ if (lineCount <= CARD_META_MAX)
37
39
  return undefined;
38
40
  return {
39
41
  feature: feature.name,
40
42
  screen,
41
43
  ...(location !== undefined && { location }),
42
- count: meta.length,
44
+ count: lineCount,
43
45
  fields: meta.map((col) => col.field),
44
46
  };
45
47
  }
@@ -96,8 +98,8 @@ export function validateCardMetaOverflow(features) {
96
98
  // skip: nothing overflows, so there is nothing to report
97
99
  if (overflows.length === 0)
98
100
  return;
99
- const lines = overflows.map((o) => ` - Feature "${o.feature}" screen "${o.screen}"${o.location !== undefined ? ` ${o.location}` : ""}: ${o.count} meta columns (${o.fields.join(", ")})`);
101
+ const lines = overflows.map((o) => ` - Feature "${o.feature}" screen "${o.screen}"${o.location !== undefined ? ` ${o.location}` : ""}: ${o.count} meta lines from the columns ${o.fields.join(", ")}`);
100
102
  throw bootRuleError(CARD_META_OVERFLOW_RULES.overflow, {
101
- message: `List cards show at most ${CARD_META_MAX} meta columns (all columns except title, status select and hideOnNarrow ones); more would be cut off on narrow screens:\n${lines.join("\n")}\nReduce each to ${CARD_META_MAX} columns or mark the others hideOnNarrow: true.`,
103
+ message: `List cards show at most ${CARD_META_MAX} meta lines (all columns except title, status select and hideOnNarrow ones, consecutive narrowInline columns sharing one line); more would be cut off on narrow screens:\n${lines.join("\n")}\nReduce each to ${CARD_META_MAX} lines or mark the other columns hideOnNarrow: true.`,
102
104
  });
103
105
  }
@@ -0,0 +1,3 @@
1
+ import type { QueryHandlerDef } from "@cosmicdrift/kumiko-types/handlers";
2
+ import type { FeatureDefinition } from "../types/index.ts";
3
+ export declare function validateCrossTenantFileRead(feature: FeatureDefinition, queryHandlers: ReadonlyMap<string, QueryHandlerDef>): void;
@@ -0,0 +1,19 @@
1
+ import { bootRuleError } from "./boot-rule.js";
2
+ import { ENTITY_DECLARATION_RULES } from "./entity-declaration-rules.js";
3
+ export function validateCrossTenantFileRead(feature, queryHandlers) {
4
+ for (const [entityName, entity] of Object.entries(feature.entities ?? {})) {
5
+ const declaration = entity.crossTenantFileRead;
6
+ if (declaration === undefined)
7
+ continue;
8
+ if (declaration.reason.trim().length === 0) {
9
+ throw bootRuleError(ENTITY_DECLARATION_RULES.crossTenantFileReadReasonMissing, {
10
+ message: `[Feature ${feature.name}] entity "${entityName}" declares crossTenantFileRead without a reason; state why its files are readable across tenants.`,
11
+ });
12
+ }
13
+ if (!queryHandlers.has(declaration.query)) {
14
+ throw bootRuleError(ENTITY_DECLARATION_RULES.crossTenantFileReadQueryUnregistered, {
15
+ message: `[Feature ${feature.name}] entity "${entityName}" declares crossTenantFileRead.query "${declaration.query}" which is not a registered query-handler. Check the QN spelling (expected "<feature>:query:<short>") and that the handler is declared via r.queryHandler(...).`,
16
+ });
17
+ }
18
+ }
19
+ }
@@ -94,4 +94,14 @@ export declare const ENTITY_DECLARATION_RULES: {
94
94
  readonly summary: 'A recordOwned (or whenAbsent: "self") field lives only on entities with idType "uuid", because forgetSubject validates the record id as a UUID.';
95
95
  readonly fix: 'Set idType: "uuid" on the entity, or give the field a different personal stance.';
96
96
  };
97
+ readonly crossTenantFileReadQueryUnregistered: {
98
+ readonly id: "files/cross-tenant-read-query-unregistered";
99
+ readonly summary: "crossTenantFileRead.query names a registered query handler.";
100
+ readonly fix: "Use the qualified name of a query handler (<feature>:query:<name>) and register it.";
101
+ };
102
+ readonly crossTenantFileReadReasonMissing: {
103
+ readonly id: "files/cross-tenant-read-reason-missing";
104
+ readonly summary: "crossTenantFileRead declares a non-empty reason.";
105
+ readonly fix: "State why files of this entity are readable across tenants.";
106
+ };
97
107
  };
@@ -94,4 +94,14 @@ export const ENTITY_DECLARATION_RULES = {
94
94
  summary: 'A recordOwned (or whenAbsent: "self") field lives only on entities with idType "uuid", because forgetSubject validates the record id as a UUID.',
95
95
  fix: 'Set idType: "uuid" on the entity, or give the field a different personal stance.',
96
96
  },
97
+ crossTenantFileReadQueryUnregistered: {
98
+ id: "files/cross-tenant-read-query-unregistered",
99
+ summary: "crossTenantFileRead.query names a registered query handler.",
100
+ fix: "Use the qualified name of a query handler (<feature>:query:<name>) and register it.",
101
+ },
102
+ crossTenantFileReadReasonMissing: {
103
+ id: "files/cross-tenant-read-reason-missing",
104
+ summary: "crossTenantFileRead declares a non-empty reason.",
105
+ fix: "State why files of this entity are readable across tenants.",
106
+ },
97
107
  };
@@ -1,3 +1,4 @@
1
+ import { entityHasFilterableFields, } from "@cosmicdrift/kumiko-types/screen";
1
2
  import { LIST_ROW_META_COLUMNS } from "../../ui-types/list-row-meta.js";
2
3
  import { normalizeListColumn } from "../screen-helpers.js";
3
4
  import { collectBootRuleViolations } from "./boot-report.js";
@@ -15,13 +16,7 @@ export const SEARCHABLE_FALSE_WHITELIST = new Set(["download-attempt-list", "cap
15
16
  // because the renderer's LIST_ROW_META_COLUMNS doesn't know them.
16
17
  export const LIST_ROW_META_COLUMN_NAMES = new Set(Object.keys(LIST_ROW_META_COLUMNS));
17
18
  export function hasFilterableFields(feature, entityName) {
18
- const entities = feature.entities;
19
- if (!entities)
20
- return false;
21
- const entity = entities[entityName];
22
- if (!entity)
23
- return false;
24
- return Object.values(entity.fields).some((raw) => "filterable" in raw && raw.filterable === true);
19
+ return entityHasFilterableFields(feature.entities?.[entityName]);
25
20
  }
26
21
  function hasEntityEditDetail(feature, entityName) {
27
22
  return Object.values(feature.screens).some((s) => s.type === "entityEdit" && s.entity === entityName);
@@ -11,9 +11,24 @@ export declare const LIST_ROW_GUIDANCE_RULES: {
11
11
  };
12
12
  readonly hintColumnLink: {
13
13
  readonly id: "list/hint-column-link";
14
- readonly summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity or badgeToneField.";
14
+ readonly summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity, badgeToneField, badgeDot or pillField.";
15
15
  readonly fix: "Remove the link or badge option, or move the hint to its own column.";
16
16
  };
17
+ readonly photoGridFieldNotInColumns: {
18
+ readonly id: "list/photo-grid-field-not-in-columns";
19
+ readonly summary: "photoGrid.imageField and photoGrid.captionField name a field of the section's columns, so the query output is checked.";
20
+ readonly fix: "Add the field to the section's columns or name another field.";
21
+ };
22
+ readonly pillToneWithoutPill: {
23
+ readonly id: "list/pill-tone-without-pill";
24
+ readonly summary: "pillToneField colors the pillField pill, so it needs pillField.";
25
+ readonly fix: "Set pillField on the column or remove pillToneField.";
26
+ };
27
+ readonly pillWithDisplay: {
28
+ readonly id: "list/pill-with-display";
29
+ readonly summary: "pillField adds a pill beside the cell value and is not combined with display.";
30
+ readonly fix: "Remove display or pillField from the column.";
31
+ };
17
32
  readonly hintColumnEmptyPlaceholder: {
18
33
  readonly id: "list/hint-column-empty-placeholder";
19
34
  readonly summary: "A hint column shows hint.emptyLabel for an empty value and sets no emptyPlaceholder.";
@@ -62,6 +77,6 @@ export declare const LIST_ROW_GUIDANCE_RULES: {
62
77
  readonly rowDecorationIdsMissing: {
63
78
  readonly id: "list/row-decoration-ids-missing";
64
79
  readonly summary: "The rowDecoration query's input schema declares `ids`, the row ids the list sends with every call.";
65
- readonly fix: "Add `ids: z.array(z.string())` to the decoration query's schema.";
80
+ readonly fix: "Add `ids: z.array(z.string())` to the decoration query's schema; `.max(...)` must cover at least the list page size; the list asks in batches of the first page size.";
66
81
  };
67
82
  };
@@ -11,9 +11,24 @@ export const LIST_ROW_GUIDANCE_RULES = {
11
11
  },
12
12
  hintColumnLink: {
13
13
  id: "list/hint-column-link",
14
- summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity or badgeToneField.",
14
+ summary: "A hint column owns its cell rendering and sets no linkScreenField, linkParamsField, refEntity, badgeToneField, badgeDot or pillField.",
15
15
  fix: "Remove the link or badge option, or move the hint to its own column.",
16
16
  },
17
+ photoGridFieldNotInColumns: {
18
+ id: "list/photo-grid-field-not-in-columns",
19
+ summary: "photoGrid.imageField and photoGrid.captionField name a field of the section's columns, so the query output is checked.",
20
+ fix: "Add the field to the section's columns or name another field.",
21
+ },
22
+ pillToneWithoutPill: {
23
+ id: "list/pill-tone-without-pill",
24
+ summary: "pillToneField colors the pillField pill, so it needs pillField.",
25
+ fix: "Set pillField on the column or remove pillToneField.",
26
+ },
27
+ pillWithDisplay: {
28
+ id: "list/pill-with-display",
29
+ summary: "pillField adds a pill beside the cell value and is not combined with display.",
30
+ fix: "Remove display or pillField from the column.",
31
+ },
17
32
  hintColumnEmptyPlaceholder: {
18
33
  id: "list/hint-column-empty-placeholder",
19
34
  summary: "A hint column shows hint.emptyLabel for an empty value and sets no emptyPlaceholder.",
@@ -62,6 +77,6 @@ export const LIST_ROW_GUIDANCE_RULES = {
62
77
  rowDecorationIdsMissing: {
63
78
  id: "list/row-decoration-ids-missing",
64
79
  summary: "The rowDecoration query's input schema declares `ids`, the row ids the list sends with every call.",
65
- fix: "Add `ids: z.array(z.string())` to the decoration query's schema.",
80
+ fix: "Add `ids: z.array(z.string())` to the decoration query's schema; `.max(...)` must cover at least the list page size; the list asks in batches of the first page size.",
66
81
  },
67
82
  };
@@ -15,6 +15,13 @@ export type EntityRowFields = {
15
15
  readonly fieldNames: ReadonlySet<string>;
16
16
  readonly rowDecorationFields?: RowDecorationFields | undefined;
17
17
  };
18
+ export declare function validatePhotoGrid(where: string, section: {
19
+ readonly columns: readonly ListColumnSpec[];
20
+ readonly photoGrid?: {
21
+ readonly imageField: string;
22
+ readonly captionField?: string;
23
+ };
24
+ }): void;
18
25
  type GuidanceListKind = "entityList" | "projectionList" | "dashboard" | "relatedList";
19
26
  export declare function validateListRowGuidance(featureName: string, screenId: string, kind: GuidanceListKind, screen: RowGuidanceScreen, entityFields?: EntityRowFields, partLabel?: string): void;
20
27
  export {};
@@ -14,6 +14,8 @@ const HINT_CONFLICTS = [
14
14
  { option: "linkParamsField", rule: LIST_ROW_GUIDANCE_RULES.hintColumnLink },
15
15
  { option: "refEntity", rule: LIST_ROW_GUIDANCE_RULES.hintColumnLink },
16
16
  { option: "badgeToneField", rule: LIST_ROW_GUIDANCE_RULES.hintColumnLink },
17
+ { option: "badgeDot", rule: LIST_ROW_GUIDANCE_RULES.hintColumnLink },
18
+ { option: "pillField", rule: LIST_ROW_GUIDANCE_RULES.hintColumnLink },
17
19
  { option: "emptyPlaceholder", rule: LIST_ROW_GUIDANCE_RULES.hintColumnEmptyPlaceholder },
18
20
  ];
19
21
  function validateHintColumn(where, column) {
@@ -59,6 +61,34 @@ function validateNarrowOnlyColumn(where, column) {
59
61
  });
60
62
  }
61
63
  }
64
+ export function validatePhotoGrid(where, section) {
65
+ const { photoGrid } = section;
66
+ if (photoGrid === undefined)
67
+ return;
68
+ const columnFields = new Set(section.columns.map((col) => normalizeListColumn(col).field));
69
+ for (const [option, field] of [
70
+ ["imageField", photoGrid.imageField],
71
+ ["captionField", photoGrid.captionField],
72
+ ]) {
73
+ if (field === undefined || columnFields.has(field))
74
+ continue;
75
+ throw bootRuleError(LIST_ROW_GUIDANCE_RULES.photoGridFieldNotInColumns, {
76
+ message: `${where} photoGrid.${option} "${field}" is not one of the section's columns (${[...columnFields].join(", ")}). Add it to columns or name another field.`,
77
+ });
78
+ }
79
+ }
80
+ function validatePillColumn(where, column) {
81
+ if (column.pillToneField !== undefined && column.pillField === undefined) {
82
+ throw bootRuleError(LIST_ROW_GUIDANCE_RULES.pillToneWithoutPill, {
83
+ message: `${where} column "${column.field}" sets pillToneField without pillField. Set pillField or remove pillToneField.`,
84
+ });
85
+ }
86
+ if (column.pillField !== undefined && column.display !== undefined) {
87
+ throw bootRuleError(LIST_ROW_GUIDANCE_RULES.pillWithDisplay, {
88
+ message: `${where} column "${column.field}" sets both pillField and display. Remove one of them.`,
89
+ });
90
+ }
91
+ }
62
92
  function validateButtonColumn(where, column, kind) {
63
93
  if (column.display === "button" && kind !== "dashboard") {
64
94
  throw bootRuleError(LIST_ROW_GUIDANCE_RULES.buttonColumnInListTable, {
@@ -81,11 +111,24 @@ function validateNamedFilterOptions(where, screen) {
81
111
  });
82
112
  }
83
113
  for (const ref of screen.namedFilters ?? []) {
84
- if (ref.emptyState !== undefined && ref.emptyState.title.trim().length === 0) {
114
+ const { emptyState } = ref;
115
+ if (emptyState === undefined)
116
+ continue;
117
+ if (emptyState.title.trim().length === 0) {
85
118
  throw bootRuleError(NAMED_FILTER_RULES.emptyStateTitleEmpty, {
86
119
  message: `${where} namedFilters "${ref.id}" sets emptyState with an empty title. Name the i18n key or remove emptyState.`,
87
120
  });
88
121
  }
122
+ if (emptyState.paramsQuery !== undefined && emptyState.paramsQuery.trim().length === 0) {
123
+ throw bootRuleError(NAMED_FILTER_RULES.emptyStateParamsQueryEmpty, {
124
+ message: `${where} namedFilters "${ref.id}" sets emptyState.paramsQuery to an empty string. Name the query or remove paramsQuery.`,
125
+ });
126
+ }
127
+ if (emptyState.paramsQuery !== undefined && emptyState.description === undefined) {
128
+ throw bootRuleError(NAMED_FILTER_RULES.emptyStateParamsQueryWithoutDescription, {
129
+ message: `${where} namedFilters "${ref.id}" sets emptyState.paramsQuery without a description — the params only feed the description. Set description or remove paramsQuery.`,
130
+ });
131
+ }
89
132
  }
90
133
  }
91
134
  function guidanceLocation(featureName, screenId, kind, partLabel) {
@@ -109,6 +152,7 @@ partLabel) {
109
152
  const column = normalizeListColumn(col);
110
153
  validateHintColumn(where, column);
111
154
  validateNarrowOnlyColumn(where, column);
155
+ validatePillColumn(where, column);
112
156
  validateButtonColumn(where, column, kind);
113
157
  }
114
158
  validateNamedFilterOptions(where, screen);
@@ -1,7 +1,7 @@
1
1
  export declare const LIST_SORT_SUMMARY_RULES: {
2
2
  readonly sortOptionNotSortable: {
3
3
  readonly id: "list/sort-option-not-sortable";
4
- readonly summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when sort is an enum, lists every option field.";
4
+ readonly summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when they are enums, lists every option field and dir.";
5
5
  readonly fix: "Mark the field sortable and list it as a column, or give the projectionList's query sort and sortDirection parameters that accept the option fields.";
6
6
  };
7
7
  readonly sortOptionsInvalid: {
@@ -26,7 +26,7 @@ export declare const LIST_SORT_SUMMARY_RULES: {
26
26
  };
27
27
  readonly summaryRowQueryAcceptsListKeys: {
28
28
  readonly id: "list/summary-row-query-accepts-list-keys";
29
- readonly summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters).";
29
+ readonly summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters) and every summaryRow.params key.";
30
30
  readonly fix: "Add the missing keys to the query schema (or reuse the list query's filter shape) and apply them, or drop the feature on the screen.";
31
31
  };
32
32
  readonly summaryRowWithTotals: {
@@ -1,7 +1,7 @@
1
1
  export const LIST_SORT_SUMMARY_RULES = {
2
2
  sortOptionNotSortable: {
3
3
  id: "list/sort-option-not-sortable",
4
- summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when sort is an enum, lists every option field.",
4
+ summary: "Every sortOptions field is a listed, sortable column (entityList); a projectionList's query takes sort and sortDirection and, when they are enums, lists every option field and dir.",
5
5
  fix: "Mark the field sortable and list it as a column, or give the projectionList's query sort and sortDirection parameters that accept the option fields.",
6
6
  },
7
7
  sortOptionsInvalid: {
@@ -26,7 +26,7 @@ export const LIST_SORT_SUMMARY_RULES = {
26
26
  },
27
27
  summaryRowQueryAcceptsListKeys: {
28
28
  id: "list/summary-row-query-accepts-list-keys",
29
- summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters).",
29
+ summary: "The summaryRow query's Zod schema accepts every list key the screen sends (search, namedFilter, filters) and every summaryRow.params key.",
30
30
  fix: "Add the missing keys to the query schema (or reuse the list query's filter shape) and apply them, or drop the feature on the screen.",
31
31
  },
32
32
  summaryRowWithTotals: {