@cosmicdrift/kumiko-framework 0.415.0 → 0.417.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 (90) hide show
  1. package/agents/api/framework-engine.md +67 -13
  2. package/agents/api/framework-ui-types.md +81 -7
  3. package/agents/api/renderer-web.md +31 -3
  4. package/agents/api/types.md +114 -61
  5. package/agents/api.md +1 -1
  6. package/agents/boot-rules.md +36 -4
  7. package/agents/examples/dashboard-stats.md +51 -0
  8. package/agents/examples/embedded.md +24 -1
  9. package/agents/examples/event-sourcing.md +84 -0
  10. package/agents/examples/handbook-knowledge.md +129 -0
  11. package/agents/examples/list-table-options.md +71 -5
  12. package/agents/examples/managed-config.md +9 -1
  13. package/agents/examples/record-detail-layout.md +71 -6
  14. package/agents/examples/secrets-demo.md +3 -1
  15. package/agents/examples/signature.md +187 -0
  16. package/agents/examples/writeform-section.md +330 -0
  17. package/agents/examples.md +2 -0
  18. package/agents/features-index.md +4 -0
  19. package/agents/features.md +14 -0
  20. package/dist/api/server-routes.js +2 -0
  21. package/dist/db/queries/event-store.d.ts +3 -0
  22. package/dist/db/queries/event-store.js +12 -0
  23. package/dist/db/table-builder.js +3 -1
  24. package/dist/engine/boot-validator/boot-phases.js +5 -0
  25. package/dist/engine/boot-validator/boot-rules.d.ts +140 -5
  26. package/dist/engine/boot-validator/card-meta-overflow.js +5 -1
  27. package/dist/engine/boot-validator/cross-tenant-file-read.d.ts +3 -0
  28. package/dist/engine/boot-validator/cross-tenant-file-read.js +19 -0
  29. package/dist/engine/boot-validator/entity-declaration-rules.d.ts +10 -0
  30. package/dist/engine/boot-validator/entity-declaration-rules.js +10 -0
  31. package/dist/engine/boot-validator/list-row-guidance-rules.d.ts +16 -1
  32. package/dist/engine/boot-validator/list-row-guidance-rules.js +16 -1
  33. package/dist/engine/boot-validator/list-row-guidance.d.ts +8 -0
  34. package/dist/engine/boot-validator/list-row-guidance.js +31 -0
  35. package/dist/engine/boot-validator/list-table-options.d.ts +1 -1
  36. package/dist/engine/boot-validator/list-table-options.js +8 -6
  37. package/dist/engine/boot-validator/list-table-rules.d.ts +1 -1
  38. package/dist/engine/boot-validator/list-table-rules.js +1 -1
  39. package/dist/engine/boot-validator/query-output-columns.js +22 -0
  40. package/dist/engine/boot-validator/query-output-guidance.js +3 -0
  41. package/dist/engine/boot-validator/query-refs.js +4 -1
  42. package/dist/engine/boot-validator/relative-time-format.d.ts +1 -0
  43. package/dist/engine/boot-validator/relative-time-format.js +51 -0
  44. package/dist/engine/boot-validator/screens-actions-rules.d.ts +16 -1
  45. package/dist/engine/boot-validator/screens-actions-rules.js +16 -1
  46. package/dist/engine/boot-validator/screens-actions.d.ts +1 -1
  47. package/dist/engine/boot-validator/screens-actions.js +57 -15
  48. package/dist/engine/boot-validator/screens-dashboard-narrow.d.ts +2 -1
  49. package/dist/engine/boot-validator/screens-dashboard-narrow.js +43 -4
  50. package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +12 -2
  51. package/dist/engine/boot-validator/screens-dashboard-rules.js +12 -2
  52. package/dist/engine/boot-validator/screens-dashboard.js +2 -1
  53. package/dist/engine/boot-validator/screens-forms-layout-rules.d.ts +5 -0
  54. package/dist/engine/boot-validator/screens-forms-layout-rules.js +5 -0
  55. package/dist/engine/boot-validator/screens-forms-rules.d.ts +60 -0
  56. package/dist/engine/boot-validator/screens-forms-rules.js +60 -0
  57. package/dist/engine/boot-validator/screens-forms.d.ts +1 -1
  58. package/dist/engine/boot-validator/screens-forms.js +108 -2
  59. package/dist/engine/boot-validator/screens-kind-config-edit.js +1 -0
  60. package/dist/engine/boot-validator/screens-kind-entity-list.js +3 -1
  61. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +15 -0
  62. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +15 -0
  63. package/dist/engine/boot-validator/screens-kind-projection-detail.js +110 -0
  64. package/dist/engine/boot-validator/screens-kind-projection-list.js +1 -1
  65. package/dist/engine/boot-validator/screens-lists-rules.d.ts +5 -0
  66. package/dist/engine/boot-validator/screens-lists-rules.js +5 -0
  67. package/dist/engine/boot-validator/screens-lists.js +4 -1
  68. package/dist/engine/boot-validator/screens.js +1 -2
  69. package/dist/engine/bridge-stub.js +1 -0
  70. package/dist/engine/build-config-feature-schema.js +29 -36
  71. package/dist/engine/config-access-rules.d.ts +3 -0
  72. package/dist/engine/config-access-rules.js +34 -0
  73. package/dist/engine/factories.d.ts +2 -0
  74. package/dist/engine/project-app-schema-for-roles.js +2 -0
  75. package/dist/engine/screen-helpers.js +7 -3
  76. package/dist/event-store/archive.d.ts +1 -0
  77. package/dist/event-store/archive.js +5 -1
  78. package/dist/event-store/event-store.d.ts +5 -0
  79. package/dist/event-store/event-store.js +23 -3
  80. package/dist/files/file-routes.d.ts +2 -0
  81. package/dist/files/file-routes.js +85 -22
  82. package/dist/files/foreign-tenant-file-read.d.ts +13 -0
  83. package/dist/files/foreign-tenant-file-read.js +64 -0
  84. package/dist/i18n/required-surface-keys.js +32 -6
  85. package/dist/pipeline/handler-context-events.js +15 -1
  86. package/dist/ui-types/card-column-roles.d.ts +3 -0
  87. package/dist/ui-types/card-column-roles.js +9 -5
  88. package/dist/ui-types/index.d.ts +1 -1
  89. package/package.json +3 -3
  90. package/src/changes.json +48 -0
@@ -129,6 +129,16 @@ export declare const SCREEN_ACTION_RULES: {
129
129
  readonly summary: "A redirect idFrom only targets entityEdit or projectionDetail screens.";
130
130
  readonly fix: "Use the plain string redirect form.";
131
131
  };
132
+ readonly redirectSearchParamsOnlyActionForm: {
133
+ readonly id: "screen/redirect-search-params-only-action-form";
134
+ readonly summary: "A redirect searchParams is only set on actionForm redirects.";
135
+ readonly fix: "Remove searchParams; other screen kinds do not read it.";
136
+ };
137
+ readonly redirectSearchParamsEmpty: {
138
+ readonly id: "screen/redirect-search-params-empty";
139
+ readonly summary: "A redirect searchParams entry has a non-empty param name and payload field.";
140
+ readonly fix: "Map each search param name to a success-payload field.";
141
+ };
132
142
  readonly successLinkTargetsRecordScreen: {
133
143
  readonly id: "screen/success-link-targets-record-screen";
134
144
  readonly summary: "A success link without idFrom does not target a record screen.";
@@ -146,9 +156,14 @@ export declare const SCREEN_ACTION_RULES: {
146
156
  };
147
157
  readonly primaryActionUnknown: {
148
158
  readonly id: "screen/primary-action-unknown";
149
- readonly summary: "primaryAction and inlineActions name a declared action id or the default edit.";
159
+ readonly summary: "primaryAction, inlineActions and footerActions name a declared action id or the default edit.";
150
160
  readonly fix: 'Use a declared action id, or "edit" when the screen sets detailFor.';
151
161
  };
162
+ readonly footerActionConflict: {
163
+ readonly id: "screen/footer-action-conflict";
164
+ readonly summary: "A footerActions id is neither the primaryAction nor in inlineActions.";
165
+ readonly fix: "Keep each action in one place: header (primaryAction), inline row or pinned footer.";
166
+ };
152
167
  readonly fallbackWithoutVisibleWhen: {
153
168
  readonly id: "screen/fallback-without-visible-when";
154
169
  readonly summary: "A screen with a fallback also declares visibleWhen.";
@@ -129,6 +129,16 @@ export const SCREEN_ACTION_RULES = {
129
129
  summary: "A redirect idFrom only targets entityEdit or projectionDetail screens.",
130
130
  fix: "Use the plain string redirect form.",
131
131
  },
132
+ redirectSearchParamsOnlyActionForm: {
133
+ id: "screen/redirect-search-params-only-action-form",
134
+ summary: "A redirect searchParams is only set on actionForm redirects.",
135
+ fix: "Remove searchParams; other screen kinds do not read it.",
136
+ },
137
+ redirectSearchParamsEmpty: {
138
+ id: "screen/redirect-search-params-empty",
139
+ summary: "A redirect searchParams entry has a non-empty param name and payload field.",
140
+ fix: "Map each search param name to a success-payload field.",
141
+ },
132
142
  successLinkTargetsRecordScreen: {
133
143
  id: "screen/success-link-targets-record-screen",
134
144
  summary: "A success link without idFrom does not target a record screen.",
@@ -146,9 +156,14 @@ export const SCREEN_ACTION_RULES = {
146
156
  },
147
157
  primaryActionUnknown: {
148
158
  id: "screen/primary-action-unknown",
149
- summary: "primaryAction and inlineActions name a declared action id or the default edit.",
159
+ summary: "primaryAction, inlineActions and footerActions name a declared action id or the default edit.",
150
160
  fix: 'Use a declared action id, or "edit" when the screen sets detailFor.',
151
161
  },
162
+ footerActionConflict: {
163
+ id: "screen/footer-action-conflict",
164
+ summary: "A footerActions id is neither the primaryAction nor in inlineActions.",
165
+ fix: "Keep each action in one place: header (primaryAction), inline row or pinned footer.",
166
+ },
152
167
  fallbackWithoutVisibleWhen: {
153
168
  id: "screen/fallback-without-visible-when",
154
169
  summary: "A screen with a fallback also declares visibleWhen.",
@@ -12,7 +12,7 @@ export declare function validateRowActionNavigateParams(featureName: string, scr
12
12
  } | undefined, actionLabel?: "rowAction" | "emptyState action"): void;
13
13
  export declare function validateActionHasIcon(featureName: string, screenId: string, screenType: "projectionDetail" | "entityEdit" | "entityList" | "projectionList" | "dashboard", context: string, action: {
14
14
  readonly id: string;
15
- readonly icon?: IconKey;
15
+ readonly icon?: IconKey | false;
16
16
  }): void;
17
17
  export declare function validateActionFieldRefs(featureName: string, screenId: string, actionKind: "rowAction" | "toolbarAction", actionId: string, action: RowAction | ToolbarAction | RelatedListToolbarAction, fieldNames: ReadonlySet<string>, rowMeta: ReadonlySet<string>): void;
18
18
  export declare function validateScreenShortIdCollisions(screensByShortId: ReadonlyMap<string, ReadonlyArray<{
@@ -125,6 +125,8 @@ function isRegisteredIcon(icon) {
125
125
  return isOneOf(NAV_ICON_KEYS, icon);
126
126
  }
127
127
  export function validateActionHasIcon(featureName, screenId, screenType, context, action) {
128
+ if (action.icon === false)
129
+ return;
128
130
  const resolved = resolveActionIcon(action.id, action.icon);
129
131
  if (resolved === undefined || !isRegisteredIcon(resolved)) {
130
132
  throw bootRuleError(SCREEN_ACTION_RULES.actionIcon, {
@@ -398,38 +400,67 @@ export function validateRedirectTarget(feature, screenId, screenKind, redirect,
398
400
  propertyPath = "redirect") {
399
401
  const { allScreenQns } = lookups;
400
402
  const redirectTarget = typeof redirect === "string" ? redirect : redirect.screen;
401
- if (typeof redirect !== "string" &&
402
- (typeof redirect.idFrom !== "string" || redirect.idFrom.trim() === "")) {
403
+ if (typeof redirect !== "string") {
404
+ validateRedirectIdFromShape(feature.name, screenId, screenKind, propertyPath, redirect);
405
+ }
406
+ validateScreenNavTarget(feature.name, screenId, screenKind, propertyPath, redirectTarget, allScreenQns, feature.screens);
407
+ if (typeof redirect !== "string" && redirect.idFrom !== undefined) {
408
+ validateRedirectIdFromTarget(feature.name, screenId, screenKind, propertyPath, redirectTarget, feature.screens[redirectTarget]);
409
+ }
410
+ if (typeof redirect !== "string" && redirect.searchParams !== undefined) {
411
+ validateRedirectSearchParams(feature.name, screenId, screenKind, propertyPath, redirect.searchParams);
412
+ }
413
+ if (typeof redirect !== "string" && redirect.tab !== undefined) {
414
+ validateRowActionNavigateTab(feature.name, screenId, screenKind, propertyPath, { kind: "navigate", id: redirectTarget, label: redirectTarget, tab: redirect.tab }, findNavTargetEntry(feature, redirectTarget, lookups));
415
+ }
416
+ }
417
+ function validateRedirectIdFromShape(featureName, screenId, screenKind, propertyPath, redirect) {
418
+ const { idFrom } = redirect;
419
+ if (idFrom === undefined)
420
+ return;
421
+ if (typeof idFrom !== "string" || idFrom.trim() === "") {
403
422
  throw bootRuleError(SCREEN_ACTION_RULES.redirectIdFromEmpty, {
404
- message: `[Feature ${feature.name}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom is empty or not a string — ` +
423
+ message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom is empty or not a string — ` +
405
424
  `name the success-payload field carrying the navigation id, or use the plain string ` +
406
425
  `redirect form to navigate with the handler's own "id".`,
407
426
  });
408
427
  }
409
428
  // The renderer reads idFrom verbatim (Object.hasOwn), so stray whitespace
410
429
  // never matches and the navigation silently lands without an entityId.
411
- if (typeof redirect !== "string" && redirect.idFrom !== redirect.idFrom.trim()) {
430
+ if (idFrom !== idFrom.trim()) {
412
431
  throw bootRuleError(SCREEN_ACTION_RULES.redirectIdFromWhitespace, {
413
- message: `[Feature ${feature.name}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom "${redirect.idFrom}" ` +
432
+ message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom "${idFrom}" ` +
414
433
  `has leading/trailing whitespace — it would never match a payload field. Remove the whitespace from idFrom.`,
415
434
  });
416
435
  }
417
- validateScreenNavTarget(feature.name, screenId, screenKind, propertyPath, redirectTarget, allScreenQns, feature.screens);
418
- // idFrom only means something to a target that carries a record id; the
419
- // renderer drops it silently otherwise. Cross-feature QN targets can't be
420
- // typed from here and stay unchecked.
421
- const sameFeatureTarget = feature.screens[redirectTarget];
422
- if (typeof redirect !== "string" &&
423
- sameFeatureTarget !== undefined &&
436
+ }
437
+ // idFrom only means something to a target that carries a record id; the
438
+ // renderer drops it silently otherwise. Cross-feature QN targets can't be
439
+ // typed from here and stay unchecked.
440
+ function validateRedirectIdFromTarget(featureName, screenId, screenKind, propertyPath, redirectTarget, sameFeatureTarget) {
441
+ if (sameFeatureTarget !== undefined &&
424
442
  sameFeatureTarget.type !== "entityEdit" &&
425
443
  sameFeatureTarget.type !== "projectionDetail") {
426
444
  throw bootRuleError(SCREEN_ACTION_RULES.redirectIdFromOnIdlessTarget, {
427
- message: `[Feature ${feature.name}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom is set but target screen ` +
445
+ message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.idFrom is set but target screen ` +
428
446
  `"${redirectTarget}" (${sameFeatureTarget.type}) carries no id — use the plain string form.`,
429
447
  });
430
448
  }
431
- if (typeof redirect !== "string" && redirect.tab !== undefined) {
432
- validateRowActionNavigateTab(feature.name, screenId, screenKind, propertyPath, { kind: "navigate", id: redirectTarget, label: redirectTarget, tab: redirect.tab }, findNavTargetEntry(feature, redirectTarget, lookups));
449
+ }
450
+ function validateRedirectSearchParams(featureName, screenId, screenKind, propertyPath, searchParams) {
451
+ if (screenKind !== "actionForm") {
452
+ throw bootRuleError(SCREEN_ACTION_RULES.redirectSearchParamsOnlyActionForm, {
453
+ message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.searchParams is only ` +
454
+ `read for actionForm redirects — remove it.`,
455
+ });
456
+ }
457
+ for (const [param, field] of Object.entries(searchParams)) {
458
+ if (param.trim() === "" || typeof field !== "string" || field.trim() === "") {
459
+ throw bootRuleError(SCREEN_ACTION_RULES.redirectSearchParamsEmpty, {
460
+ message: `[Feature ${featureName}] Screen "${screenId}" (${screenKind}) ${propertyPath}.searchParams ` +
461
+ `entry "${param}" has an empty param name or payload field — map each search param name to a success-payload field.`,
462
+ });
463
+ }
433
464
  }
434
465
  }
435
466
  function findNavTargetEntry(feature, target, lookups) {
@@ -498,6 +529,15 @@ export function validateRecordActionRedirect(feature, screenId, screenKind, acti
498
529
  validateRedirectTarget(feature, screenId, screenKind, action.redirect, lookups);
499
530
  }
500
531
  }
532
+ function validateFooterActionsAreExclusive(featureName, screenId, screen) {
533
+ for (const id of screen.footerActions ?? []) {
534
+ if (id === screen.primaryAction || (screen.inlineActions ?? []).includes(id)) {
535
+ throw bootRuleError(SCREEN_ACTION_RULES.footerActionConflict, {
536
+ message: `[Feature ${featureName}] Screen "${screenId}" (projectionDetail) footerActions "${id}" is also the primaryAction or in inlineActions. Keep it in one place.`,
537
+ });
538
+ }
539
+ }
540
+ }
501
541
  // "edit" is the default edit action, which only exists when detailFor names
502
542
  // the entity; a typo would otherwise silently fall back to the default header layout.
503
543
  export function validatePrimaryActionTarget(featureName, screenId, screen) {
@@ -506,7 +546,9 @@ export function validatePrimaryActionTarget(featureName, screenId, screen) {
506
546
  ? [["primaryAction", screen.primaryAction]]
507
547
  : []),
508
548
  ...(screen.inlineActions ?? []).map((id) => ["inlineActions", id]),
549
+ ...(screen.footerActions ?? []).map((id) => ["footerActions", id]),
509
550
  ];
551
+ validateFooterActionsAreExclusive(featureName, screenId, screen);
510
552
  const declaredIds = (screen.actions ?? []).map((action) => action.id);
511
553
  const editIsAvailable = screen.detailFor !== undefined;
512
554
  for (const [option, id] of targets) {
@@ -1,4 +1,5 @@
1
- import type { DashboardListPanel, DashboardPanelDefinition } from "../types/screen.ts";
1
+ import type { DashboardListPanel, DashboardPanelDefinition, DashboardScreenDefinition } from "../types/screen.ts";
2
2
  /** The screen itself is checked by validateDashboardPanelLink; this covers the rest of the shape. */
3
3
  export declare function validateListRowLinkShape(context: string, panel: DashboardListPanel): void;
4
+ export declare function validateDashboardLayout(featureName: string, screenId: string, screen: DashboardScreenDefinition): void;
4
5
  export declare function validateDashboardPanelNarrow(featureName: string, screenId: string, panel: DashboardPanelDefinition): void;
@@ -112,15 +112,20 @@ function isTitledStrip(panel) {
112
112
  return panel.label !== undefined && panel.layout === "strip";
113
113
  }
114
114
  function validateStatGroupChildren(context, panel) {
115
+ if (panel.stats.length > 0 && panel.stats.every((stat) => stat.hideOnNarrow === true)) {
116
+ throw bootRuleError(DASHBOARD_RULES.statGroupChildHideOnNarrow, {
117
+ message: `${context} hides every child on narrow — set hideOnNarrow on the whole group instead.`,
118
+ });
119
+ }
115
120
  for (const stat of panel.stats) {
116
121
  if (stat.narrowLabel !== undefined && !isTitledStrip(panel)) {
117
122
  throw bootRuleError(DASHBOARD_RULES.statNarrowLabelOutsideGroup, {
118
123
  message: `${context} child "${stat.id}" sets narrowLabel, but only the one-line phone strip of a titled group with layout "strip" draws it. Give the group a label and layout "strip", or remove narrowLabel.`,
119
124
  });
120
125
  }
121
- if (stat.hideOnNarrow !== undefined) {
122
- throw bootRuleError(DASHBOARD_RULES.statGroupChildHideOnNarrow, {
123
- message: `${context} child "${stat.id}" sets hideOnNarrow — set it on the whole group instead; a hidden cell would leave a gap.`,
126
+ if (stat.column !== undefined) {
127
+ throw bootRuleError(DASHBOARD_RULES.layoutInvalid, {
128
+ message: `${context} child "${stat.id}" sets column — set it on the whole group instead.`,
124
129
  });
125
130
  }
126
131
  if (stat.narrowOrder !== undefined) {
@@ -195,14 +200,48 @@ function validateNarrowOrder(context, panel) {
195
200
  });
196
201
  }
197
202
  }
203
+ const PANEL_COLUMNS = ["side", "top"];
204
+ function validateListColumnVariants(context, panel) {
205
+ for (const spec of panel.columns) {
206
+ const column = normalizeListColumn(spec);
207
+ // skip: default outline look
208
+ if (column.variant === undefined)
209
+ continue;
210
+ if (column.variant !== "primary" || column.display !== "button") {
211
+ throw bootRuleError(DASHBOARD_RULES.listColumnVariantInvalid, {
212
+ message: `${context} column "${column.field}" sets variant "${String(column.variant)}", which must be "primary" and needs display: "button".`,
213
+ });
214
+ }
215
+ }
216
+ }
217
+ export function validateDashboardLayout(featureName, screenId, screen) {
218
+ const prefix = `[Feature ${featureName}] Screen "${screenId}" (dashboard)`;
219
+ if (screen.layout !== undefined && screen.layout !== "main-side") {
220
+ throw bootRuleError(DASHBOARD_RULES.layoutInvalid, {
221
+ message: `${prefix} layout "${String(screen.layout)}" is not "main-side".`,
222
+ });
223
+ }
224
+ for (const panel of screen.panels) {
225
+ // skip: panel stays in the main column
226
+ if (panel.column === undefined)
227
+ continue;
228
+ if (screen.layout !== "main-side" || !PANEL_COLUMNS.includes(panel.column)) {
229
+ throw bootRuleError(DASHBOARD_RULES.layoutInvalid, {
230
+ message: `${prefix} panel "${panel.id}" sets column "${String(panel.column)}", which needs layout: "main-side" and the value "side" or "top".`,
231
+ });
232
+ }
233
+ }
234
+ }
198
235
  // Phone-layout options per panel kind; `hideOnNarrow` itself is a plain flag with no cross-field rule.
199
236
  export function validateDashboardPanelNarrow(featureName, screenId, panel) {
200
237
  const prefix = `[Feature ${featureName}] Screen "${screenId}" (dashboard)`;
201
238
  validateNarrowOrder(`${prefix} panel "${panel.id}"`, panel);
202
239
  if (panel.kind === "stat")
203
240
  validateStatNarrowLabel(`${prefix} stat "${panel.id}"`, panel);
204
- if (panel.kind === "list")
241
+ if (panel.kind === "list") {
205
242
  validateListNarrow(`${prefix} list-panel "${panel.id}"`, panel);
243
+ validateListColumnVariants(`${prefix} list-panel "${panel.id}"`, panel);
244
+ }
206
245
  else if (panel.kind === "stat-group") {
207
246
  validateStatGroupNarrow(`${prefix} stat-group "${panel.id}"`, panel);
208
247
  }
@@ -184,10 +184,20 @@ export declare const DASHBOARD_RULES: {
184
184
  readonly summary: 'A stat-group\'s columns is 2, 3 or 4 and needs layout "cards".';
185
185
  readonly fix: 'Set columns to 2, 3 or 4 and give the group a label or layout: "cards", or remove columns.';
186
186
  };
187
+ readonly layoutInvalid: {
188
+ readonly id: "dashboard/layout-invalid";
189
+ 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.';
190
+ readonly fix: 'Set layout: "main-side" on the dashboard to use column: "side" or "top", or remove column.';
191
+ };
192
+ readonly listColumnVariantInvalid: {
193
+ readonly id: "dashboard/list-column-variant-invalid";
194
+ readonly summary: 'A list column variant is "primary" and needs display: "button".';
195
+ readonly fix: 'Set display: "button" on the column or remove variant.';
196
+ };
187
197
  readonly statGroupChildHideOnNarrow: {
188
198
  readonly id: "dashboard/stat-group-child-hide-on-narrow";
189
- readonly summary: "Stat-group children do not set hideOnNarrow.";
190
- readonly fix: "Set hideOnNarrow on the whole group instead.";
199
+ readonly summary: "A stat-group keeps at least one child on a phone: not every child sets hideOnNarrow.";
200
+ readonly fix: "Set hideOnNarrow on the whole group instead, or keep one child visible.";
191
201
  };
192
202
  readonly listNarrowFieldUnknown: {
193
203
  readonly id: "dashboard/list-narrow-field-unknown";
@@ -184,10 +184,20 @@ export const DASHBOARD_RULES = {
184
184
  summary: 'A stat-group\'s columns is 2, 3 or 4 and needs layout "cards".',
185
185
  fix: 'Set columns to 2, 3 or 4 and give the group a label or layout: "cards", or remove columns.',
186
186
  },
187
+ layoutInvalid: {
188
+ id: "dashboard/layout-invalid",
189
+ 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.',
190
+ fix: 'Set layout: "main-side" on the dashboard to use column: "side" or "top", or remove column.',
191
+ },
192
+ listColumnVariantInvalid: {
193
+ id: "dashboard/list-column-variant-invalid",
194
+ summary: 'A list column variant is "primary" and needs display: "button".',
195
+ fix: 'Set display: "button" on the column or remove variant.',
196
+ },
187
197
  statGroupChildHideOnNarrow: {
188
198
  id: "dashboard/stat-group-child-hide-on-narrow",
189
- summary: "Stat-group children do not set hideOnNarrow.",
190
- fix: "Set hideOnNarrow on the whole group instead.",
199
+ summary: "A stat-group keeps at least one child on a phone: not every child sets hideOnNarrow.",
200
+ fix: "Set hideOnNarrow on the whole group instead, or keep one child visible.",
191
201
  },
192
202
  listNarrowFieldUnknown: {
193
203
  id: "dashboard/list-narrow-field-unknown",
@@ -5,7 +5,7 @@ import { validateListRowGuidance } from "./list-row-guidance.js";
5
5
  import { assertWriteHandlerRegistered, isRowClickAction, resolveRowActionNavigateTarget, resolveScreenTargetQn, validateActionHasIcon, validateClientActionName, validateRowActionNavigateParams, } from "./screens-actions.js";
6
6
  import { DASHBOARD_CHART_RULES } from "./screens-dashboard-chart-rules.js";
7
7
  import { validateDashboardPanelLink, validateListRowLinkTarget, } from "./screens-dashboard-links.js";
8
- import { validateDashboardPanelNarrow, validateListRowLinkShape, } from "./screens-dashboard-narrow.js";
8
+ import { validateDashboardLayout, validateDashboardPanelNarrow, validateListRowLinkShape, } from "./screens-dashboard-narrow.js";
9
9
  import { DASHBOARD_RULES } from "./screens-dashboard-rules.js";
10
10
  import { assertRefTargetRegistered, validateColumnRendererForm } from "./screens-lists.js";
11
11
  // Panel-driven, no entity — structural checks (unique panel ids, non-empty
@@ -18,6 +18,7 @@ export function validateDashboardScreen(featureName, screenId, screen, featureMa
18
18
  `declare at least one panel.`,
19
19
  });
20
20
  }
21
+ validateDashboardLayout(featureName, screenId, screen);
21
22
  const panelIds = new Set();
22
23
  const addPanelId = (id, context) => {
23
24
  if (panelIds.has(id)) {
@@ -89,6 +89,11 @@ export declare const FORM_LAYOUT_RULES: {
89
89
  readonly summary: "Inline form layouts have no relatedList sections.";
90
90
  readonly fix: "Move the section to a projectionDetail screen or remove it.";
91
91
  };
92
+ readonly stepListSectionUnsupported: {
93
+ readonly id: "form/step-list-section-unsupported";
94
+ readonly summary: "Inline form layouts have no stepList sections.";
95
+ readonly fix: "Move the section to a projectionDetail screen or remove it.";
96
+ };
92
97
  readonly writeFormSectionUnsupported: {
93
98
  readonly id: "form/write-form-section-unsupported";
94
99
  readonly summary: "Inline form layouts have no writeForm sections.";
@@ -89,6 +89,11 @@ export const FORM_LAYOUT_RULES = {
89
89
  summary: "Inline form layouts have no relatedList sections.",
90
90
  fix: "Move the section to a projectionDetail screen or remove it.",
91
91
  },
92
+ stepListSectionUnsupported: {
93
+ id: "form/step-list-section-unsupported",
94
+ summary: "Inline form layouts have no stepList sections.",
95
+ fix: "Move the section to a projectionDetail screen or remove it.",
96
+ },
92
97
  writeFormSectionUnsupported: {
93
98
  id: "form/write-form-section-unsupported",
94
99
  summary: "Inline form layouts have no writeForm sections.",
@@ -44,6 +44,66 @@ export declare const FORM_FIELD_RULES: {
44
44
  readonly summary: "fillAction does not target a sensitive, writeOnly or password field.";
45
45
  readonly fix: "Remove fillAction.";
46
46
  };
47
+ readonly fieldDescriptionUnknownField: {
48
+ readonly id: "form/field-description-unknown-field";
49
+ readonly summary: "actionForm fieldDescriptions keys name fields of the form.";
50
+ readonly fix: "Name a field of the form or remove the entry.";
51
+ };
52
+ readonly fieldTextParamUnknownField: {
53
+ readonly id: "form/field-text-param-unknown-field";
54
+ readonly summary: "actionForm fieldLabels and fieldDescriptions params name fields of the form.";
55
+ readonly fix: "Point each param at a field of the form or use the plain i18n key.";
56
+ };
57
+ readonly fieldBadgeUnknownField: {
58
+ readonly id: "form/field-badge-unknown-field";
59
+ readonly summary: "actionForm fieldBadges keys name fields of the form.";
60
+ readonly fix: "Name a field of the form or remove the entry.";
61
+ };
62
+ readonly aiAssistContextFieldUnknown: {
63
+ readonly id: "form/ai-assist-context-field-unknown";
64
+ readonly summary: "aiAssist.contextFields names fields of the same form.";
65
+ readonly fix: "Name other fields of the same form or remove the entry.";
66
+ };
67
+ readonly aiAssistFieldType: {
68
+ readonly id: "form/ai-assist-field-type";
69
+ readonly summary: "aiAssist targets a text or longText field.";
70
+ readonly fix: "Remove aiAssist or use a text or longText field.";
71
+ };
72
+ readonly aiAssistSensitiveField: {
73
+ readonly id: "form/ai-assist-sensitive-field";
74
+ readonly summary: "aiAssist does not target a sensitive, writeOnly or password field.";
75
+ readonly fix: "Remove aiAssist; the field text would be sent to the AI.";
76
+ };
77
+ readonly aiAssistChipInvalid: {
78
+ readonly id: "form/ai-assist-chip-invalid";
79
+ readonly summary: "An aiAssist chip has a label and at least one param.";
80
+ readonly fix: 'Set a non-empty label and params such as { style: "short" }.';
81
+ };
82
+ readonly aiAssistResultFieldEmpty: {
83
+ readonly id: "form/ai-assist-result-field-empty";
84
+ readonly summary: "aiAssist names a non-empty resultField.";
85
+ readonly fix: "Set resultField to the key of the query result that holds the text.";
86
+ };
87
+ readonly aiAssistPromptParamEmpty: {
88
+ readonly id: "form/ai-assist-prompt-param-empty";
89
+ readonly summary: "aiAssist.prompt names a non-empty param.";
90
+ readonly fix: "Set prompt.param to the query payload key that receives the typed instruction.";
91
+ };
92
+ readonly aiAssistEmpty: {
93
+ readonly id: "form/ai-assist-empty";
94
+ readonly summary: "aiAssist declares at least one chip or a prompt.";
95
+ readonly fix: "Add chips or prompt, or remove aiAssist.";
96
+ };
97
+ readonly valueChipsFieldType: {
98
+ readonly id: "form/value-chips-field-type";
99
+ readonly summary: "valueChips targets a number, decimal, bigInt or money field.";
100
+ readonly fix: "Remove valueChips or use a numeric or money field.";
101
+ };
102
+ readonly valueChipsUnknownField: {
103
+ readonly id: "form/value-chips-unknown-field";
104
+ readonly summary: "valueChips.from names a field of the same form.";
105
+ readonly fix: "Name a field of the same form (hidden and submit: false is fine) that holds the numbers.";
106
+ };
47
107
  readonly requiredFieldWithoutWidget: {
48
108
  readonly id: "form/required-field-without-widget";
49
109
  readonly summary: "A required entityEdit field has a widget to fill it.";
@@ -44,6 +44,66 @@ export const FORM_FIELD_RULES = {
44
44
  summary: "fillAction does not target a sensitive, writeOnly or password field.",
45
45
  fix: "Remove fillAction.",
46
46
  },
47
+ fieldDescriptionUnknownField: {
48
+ id: "form/field-description-unknown-field",
49
+ summary: "actionForm fieldDescriptions keys name fields of the form.",
50
+ fix: "Name a field of the form or remove the entry.",
51
+ },
52
+ fieldTextParamUnknownField: {
53
+ id: "form/field-text-param-unknown-field",
54
+ summary: "actionForm fieldLabels and fieldDescriptions params name fields of the form.",
55
+ fix: "Point each param at a field of the form or use the plain i18n key.",
56
+ },
57
+ fieldBadgeUnknownField: {
58
+ id: "form/field-badge-unknown-field",
59
+ summary: "actionForm fieldBadges keys name fields of the form.",
60
+ fix: "Name a field of the form or remove the entry.",
61
+ },
62
+ aiAssistContextFieldUnknown: {
63
+ id: "form/ai-assist-context-field-unknown",
64
+ summary: "aiAssist.contextFields names fields of the same form.",
65
+ fix: "Name other fields of the same form or remove the entry.",
66
+ },
67
+ aiAssistFieldType: {
68
+ id: "form/ai-assist-field-type",
69
+ summary: "aiAssist targets a text or longText field.",
70
+ fix: "Remove aiAssist or use a text or longText field.",
71
+ },
72
+ aiAssistSensitiveField: {
73
+ id: "form/ai-assist-sensitive-field",
74
+ summary: "aiAssist does not target a sensitive, writeOnly or password field.",
75
+ fix: "Remove aiAssist; the field text would be sent to the AI.",
76
+ },
77
+ aiAssistChipInvalid: {
78
+ id: "form/ai-assist-chip-invalid",
79
+ summary: "An aiAssist chip has a label and at least one param.",
80
+ fix: 'Set a non-empty label and params such as { style: "short" }.',
81
+ },
82
+ aiAssistResultFieldEmpty: {
83
+ id: "form/ai-assist-result-field-empty",
84
+ summary: "aiAssist names a non-empty resultField.",
85
+ fix: "Set resultField to the key of the query result that holds the text.",
86
+ },
87
+ aiAssistPromptParamEmpty: {
88
+ id: "form/ai-assist-prompt-param-empty",
89
+ summary: "aiAssist.prompt names a non-empty param.",
90
+ fix: "Set prompt.param to the query payload key that receives the typed instruction.",
91
+ },
92
+ aiAssistEmpty: {
93
+ id: "form/ai-assist-empty",
94
+ summary: "aiAssist declares at least one chip or a prompt.",
95
+ fix: "Add chips or prompt, or remove aiAssist.",
96
+ },
97
+ valueChipsFieldType: {
98
+ id: "form/value-chips-field-type",
99
+ summary: "valueChips targets a number, decimal, bigInt or money field.",
100
+ fix: "Remove valueChips or use a numeric or money field.",
101
+ },
102
+ valueChipsUnknownField: {
103
+ id: "form/value-chips-unknown-field",
104
+ summary: "valueChips.from names a field of the same form.",
105
+ fix: "Name a field of the same form (hidden and submit: false is fine) that holds the numbers.",
106
+ },
47
107
  requiredFieldWithoutWidget: {
48
108
  id: "form/required-field-without-widget",
49
109
  summary: "A required entityEdit field has a widget to fill it.",
@@ -9,7 +9,7 @@ export declare function validateFillActionTarget(where: string, fieldSpec: Exclu
9
9
  readonly type: string;
10
10
  } | undefined): void;
11
11
  export declare function validateNoWidgetRequiredField(featureName: string, screenId: string, entityDef: EntityDefinition, fieldSpec: Exclude<EditFieldSpec, string>): void;
12
- export declare function validateTabSections(featureName: string, screenId: string, screenType: "projectionDetail" | "entityEdit", sections: readonly {
12
+ export declare function validateTabSections(featureName: string, screenId: string, screenType: "projectionDetail" | "entityEdit", allSections: readonly {
13
13
  readonly id?: string;
14
14
  readonly title?: string;
15
15
  }[]): void;