@wildo-ai/framework-knowledge 1.1.12 → 1.1.14

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 (101) hide show
  1. package/dist/claude-marketplace/.claude-plugin/marketplace.json +1 -1
  2. package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
  3. package/dist/claude-marketplace/plugins/wildo/references/composites-and-the-loop.md +12 -4
  4. package/dist/claude-marketplace/plugins/wildo/skills/build/SKILL.md +4 -0
  5. package/dist/esm/framework-knowledge.definitions.d.ts +1 -1
  6. package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -1
  7. package/dist/esm/framework-knowledge.definitions.js +10 -0
  8. package/dist/esm/framework-knowledge.definitions.js.map +1 -1
  9. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts +2 -1
  10. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.d.ts.map +1 -1
  11. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js +8 -1
  12. package/dist/esm/playbooks/bottom_up.foundation/playbook.definition.js.map +1 -1
  13. package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
  14. package/dist/knowledge/manifest.json +7 -7
  15. package/dist/knowledge/playbooks/bottom_up.foundation/method.md +6 -0
  16. package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +6 -3
  17. package/dist/knowledge/playbooks/bottom_up.maturity-reading/method.md +9 -0
  18. package/dist/knowledge/playbooks/bottom_up.maturity-reading/playbook.json +1 -1
  19. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +11 -2
  20. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
  21. package/dist/knowledge/playbooks/top_down.requirements-definition/method.md +14 -0
  22. package/dist/knowledge/playbooks/top_down.requirements-definition/playbook.json +1 -1
  23. package/dist/knowledge/references/application-maturity.config.md +43 -0
  24. package/dist/knowledge/references/engine.client-bundle.allow-list.md +6 -0
  25. package/dist/knowledge/references/example.backend.addon-wiring.module.md +5 -1
  26. package/dist/knowledge/references/example.backend.custom-operation.declared-refusal-code.md +6 -0
  27. package/dist/knowledge/references/example.config.navigation.full.md +14 -0
  28. package/dist/knowledge/references/example.infra.environment-config.local.md +2 -2
  29. package/dist/knowledge/references/example.resource.config-wiring.retention-policy-operations.md +21 -0
  30. package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +1 -1
  31. package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -2
  32. package/dist/knowledge/references/platform.config.environment.deployment.md +60 -4
  33. package/dist/knowledge/references/platform.config.infrastructure-host.md +1 -0
  34. package/dist/knowledge/references/platform.config.platform-key-management.md +5 -2
  35. package/dist/knowledge/references/requirements.engine-substance.md +38 -0
  36. package/dist/knowledge/references/requirements.functional-requirement.config.md +11 -0
  37. package/dist/knowledge/references/requirements.non-functional-requirement.config.md +11 -0
  38. package/dist/knowledge/references/saas.approval-seals.admin-endpoints.md +20 -0
  39. package/dist/knowledge/references/saas.backend.custom-operation.hook-transaction-posture.md +12 -1
  40. package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +72 -0
  41. package/dist/knowledge/references/saas.backend.system-access-service.md +30 -1
  42. package/dist/knowledge/references/saas.frontend.app-shell.shell-motion-contract.md +30 -0
  43. package/dist/knowledge/references/saas.frontend.chart-dashboard-view.md +3 -3
  44. package/dist/knowledge/references/saas.frontend.chart-dashboard.md +38 -35
  45. package/dist/knowledge/references/saas.models.chart-dashboard-tile-sizes.md +40 -0
  46. package/dist/knowledge/references/saas.models.flows-actors.agent-content-guardrails-environment.md +52 -0
  47. package/dist/knowledge/references/saas.models.frontend-provider-public-config-contract.md +6 -0
  48. package/dist/knowledge/references/saas.models.organization-dashboard-layout.md +61 -0
  49. package/dist/knowledge/references/saas.models.privacy.data-residency.md +188 -31
  50. package/dist/knowledge/references/saas.models.providers.compliance-choice.md +9 -0
  51. package/dist/knowledge/references/saas.models.resource-config.operation-condition-parameters.md +8 -1
  52. package/dist/knowledge/references/saas.specifications.processor-register.md +10 -0
  53. package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
  54. package/dist/knowledge/registries/framework-topics.json +41 -1
  55. package/dist/knowledge/registries/playbooks.json +1 -1
  56. package/dist/knowledge/registries/source-tags.json +1147 -1077
  57. package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +5 -1
  58. package/dist/knowledge/skills/backend-custom-operation/references/declared-refusal-codes.md +28 -1
  59. package/dist/knowledge/skills/backend-custom-operation/references/framework-hook-transaction-posture-api.md +32 -1
  60. package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +11 -2
  61. package/dist/knowledge/skills/compliance-document-authoring/references/framework-processor-register-authoring.md +16 -0
  62. package/dist/knowledge/skills/compliance-document-authoring/references/framework-provider-compliance-choice-api.md +197 -31
  63. package/dist/knowledge/skills/config-app-shell/references/framework-shell-layout-api.md +30 -0
  64. package/dist/knowledge/skills/config-navigation/SKILL.md +14 -0
  65. package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +19 -0
  66. package/dist/knowledge/skills/config-saas/references/framework-key-management-api.md +58 -1
  67. package/dist/knowledge/skills/electronic-signature-deliverables/references/what-makes-a-request-signed.md +20 -3
  68. package/dist/knowledge/skills/flows-actors-autonomous-agents/SKILL.md +12 -2
  69. package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +16 -4
  70. package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-agent-content-guardrails-api.md +144 -6
  71. package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +72 -0
  72. package/dist/knowledge/skills/flows-actors-declared-flow/SKILL.md +12 -2
  73. package/dist/knowledge/skills/flows-actors-llm-agent-invocation/SKILL.md +12 -2
  74. package/dist/knowledge/skills/frontend-component-catalog/SKILL.md +1 -1
  75. package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-catalog.md +3 -2
  76. package/dist/knowledge/skills/frontend-component-catalog/references/framework-component-usage.md +13 -0
  77. package/dist/knowledge/skills/infra-environment-config/SKILL.md +36 -8
  78. package/dist/knowledge/skills/infra-environment-config/references/framework-agent-content-guardrails-environment-api.md +67 -0
  79. package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +60 -4
  80. package/dist/knowledge/skills/infra-environment-config/references/framework-infrastructure-host-api.md +1 -0
  81. package/dist/knowledge/skills/infra-environment-config/references/framework-platform-key-management-api.md +5 -2
  82. package/dist/knowledge/skills/layout-2d-adoption/references/framework-shell-motion-api.md +30 -0
  83. package/dist/knowledge/skills/provider-backend-package/SKILL.md +17 -3
  84. package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-public-config-api.md +6 -0
  85. package/dist/knowledge/skills/provider-frontend-module/references/package-frontend-facets.md +4 -1
  86. package/dist/knowledge/skills/resource-config-wiring/SKILL.md +6 -2
  87. package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +4 -2
  88. package/dist/knowledge/skills/resource-config-wiring/references/framework-retention-policy-operations.md +21 -0
  89. package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +30 -1
  90. package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +3 -2
  91. package/dist/knowledge/skills/resource-status-lifecycle/references/framework-operation-condition-parameters-api.md +8 -1
  92. package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +3 -3
  93. package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +8 -2
  94. package/dist/knowledge/skills/views-chart-authoring/SKILL.md +5 -1
  95. package/dist/knowledge/skills/views-composite-authoring/SKILL.md +1 -1
  96. package/dist/knowledge/skills/views-composite-authoring/references/framework-chart-dashboard-api.md +166 -39
  97. package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +6 -0
  98. package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +6 -0
  99. package/dist/knowledge/topic-index.json +292 -153
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/package.json +4 -4
@@ -138,7 +138,11 @@ const backendModule: BackendDomainModule = {
138
138
  ],
139
139
  // A signed webhook from a client's system that creates a todo (#1596) — `POST /webhooks/app/todo-intake`;
140
140
  // and an email to an organization's address that creates one and answers on the thread (#1600, #1630).
141
- inboundHandlers: [todoIntakeInboundHandler, todoEmailIntakeHandler, todoEmailScreenedHandler, todoEmailScreeningHandler],
141
+ // and what Teams sends the application's bot or an organization's own bot (#2663) — `POST /webhooks/microsoft-teams-bot/messages`.
142
+ inboundHandlers: [todoIntakeInboundHandler, todoEmailIntakeHandler, todoEmailScreenedHandler, todoEmailScreeningHandler, teamsBotInboundHandler],
143
+ // An agent's answer to a Teams conversation goes back through the bot it was sent to; startup refuses the Teams
144
+ // messages handler without it.
145
+ chatReplyHandlers: [teamsChatReplyHandler],
142
146
  // NOT listed: `todoSmsStatusHandler` (`./inbound/todos.sms-status.inbound-channel-handler`, #3394), a member's todo
143
147
  // status by text. An SMS channel handler stops the backend at startup while the SMS channel does not receive, and
144
148
  // Your Application keeps the SMS capability off (no vendor account, 2026-10-02). Enabling SMS with a provider whose
@@ -260,7 +260,7 @@ What is **not** in either block (and shouldn't be):
260
260
  - `references/composite-embedding-checklist.md`
261
261
  - `references/framework-composite-view-contracts-api.md` — source-backed composite view types & `defineCompositeView`
262
262
  - `references/framework-inserted-view-identity-api.md` — source-backed inserted-view refs for embedded surfaces
263
- - `references/framework-chart-dashboard-api.md` — source-backed `ChartDashboard` tiles and `defineChartDashboardView`: charts of several resources on one responsive grid (column cap, two-column and two-row tiles), each tile hidden from a viewer the chart's backend gate would refuse
263
+ - `references/framework-chart-dashboard-api.md` — source-backed `ChartDashboard` tiles and `defineChartDashboardView`: charts of several resources on one responsive grid (column cap, two-column and two-row tiles), each tile hidden from a viewer the chart's backend gate would refuse; with a `layoutRef`, an organization's administrators reorder, resize and hide its tiles for their members
264
264
 
265
265
  ## Verification
266
266
 
@@ -30,6 +30,9 @@ declares. Read this when you need to:
30
30
  container, for a dashboard that shares its row with something else (a block of counters, a list);
31
31
  `TWO` stops at two. A span applies only where the grid has that many columns, so a narrow pane
32
32
  still stacks every tile.
33
+ - `ChartDashboardTileSpan` and `ChartDashboardTileRows` are imported from `@wildo-ai/saas-models` (the
34
+ stored layout below shares them); `ChartDashboard`, `ChartDashboardColumns` and `ChartDashboardTile` from
35
+ `@wildo-ai/saas-frontend-lib`.
33
36
  - `rows: ChartDashboardTileRows.TWO` makes a tile two rows tall: a large chart beside two small ones
34
37
  stacked. Order the tiles `[small, large, small]` so the second small one flows into the row under
35
38
  the first. Give each tile the canvas `height` that fills its cell (a two-row tile is roughly two
@@ -62,11 +65,33 @@ type with no dimension. The backend also refuses, at startup, a computed measure
62
65
  parse, calls a function the engine does not provide, or reads a name that is not a measure, a dimension or an
63
66
  earlier computed measure listed in its `dependsOn`.
64
67
 
68
+ ## Letting each organization arrange it
69
+
70
+ Give the dashboard a `layoutRef` (a name unique within the application, e.g. `'operations-dashboard'`)
71
+ and each organization may arrange it for its own members:
72
+
73
+ - An organization administrator (the roles of `ORGANIZATION_DASHBOARD_LAYOUT_EDITOR_ROLES`, `ORG_ADMIN`)
74
+ sees a "customize" button above the grid. It opens the layout editor: move tiles up and down, set each
75
+ one's width and height, hide or show it, save, or reset to the declared layout.
76
+ - The arrangement is stored as the organization's `organizationDashboardLayouts` row for that ref (one
77
+ per organization and dashboard). Every member reads it; only administrators write it, and every write is
78
+ audited with the tiles before and after.
79
+ - The arrangement only ARRANGES the tiles you declare. An entry naming a tile you no longer declare is
80
+ ignored, and a tile you add later is shown after the stored ones until an administrator places it. It
81
+ never shows a chart to someone who may not read it: the gate runs after it.
82
+ - Without a `layoutRef` the dashboard is always laid out as declared, and nothing is read.
83
+ - Two dashboards on one page take two refs: each is arranged on its own.
84
+ - The editor's words are the `HIGH_LEVEL_VIEWS_CHART_DASHBOARD_LAYOUT_EDITOR` component labels; the tile
85
+ names are the chart views' own titles.
86
+
87
+ The table is an engine resource, so a PostgreSQL application owes a migration creating it (`wildo db
88
+ generate`), like any resource the engine adds.
89
+
65
90
  ## Two ways to place it
66
91
 
67
92
  - Inside a composite you write: `<ChartDashboard tiles={[…]} />` in a `<Section>` of your
68
93
  `CompositeLayout`, beside the composite's other content.
69
- - As the whole view: `defineChartDashboardView({ tiles: […], …composite config })` in the frontend
94
+ - As the whole view: `defineChartDashboardView({ tiles: […], columns?, layoutRef?, …composite config })` in the frontend
70
95
  module's `compositeViews` map. The rest of the config (`icon`, `sectionRefs`,
71
96
  `requiredFeatures`) is the composite view's own.
72
97
 
@@ -81,27 +106,6 @@ earlier computed measure listed in its `dependsOn`.
81
106
  ### Origin Package: `@wildo-ai/saas-frontend-lib`
82
107
 
83
108
  ```tsx
84
- /** How many grid columns a dashboard tile spans, where the dashboard is wide enough to have them. */
85
- export enum ChartDashboardTileSpan {
86
- /** One column (the default): a donut, a bar of a few categories. */
87
- ONE = 'one',
88
- /** Two columns: a trend over time, a bar of many categories. One column where the dashboard has one. */
89
- TWO = 'two',
90
- /** The whole row: a long timeline, a wide table-like chart. */
91
- FULL = 'full',
92
- }
93
-
94
- /** How many grid rows a dashboard tile spans, where the dashboard has more than one column. */
95
- export enum ChartDashboardTileRows {
96
- /** One row (the default). */
97
- ONE = 'one',
98
- /**
99
- * Two rows: a large chart beside two smaller ones stacked in the next column. Place it right after the first
100
- * small tile, so the second small tile flows into the row beneath the first: `[small, large (TWO rows), small]`.
101
- */
102
- TWO = 'two',
103
- }
104
-
105
109
  /**
106
110
  * The most columns a dashboard's grid reaches, as its container widens. Every dashboard is one column in a narrow pane.
107
111
  */
@@ -126,13 +130,15 @@ export interface ChartDashboardTile {
126
130
  resourceType: string;
127
131
  /** The chart view's `ref` on that resource (`InsertedChartDeclaration.ref`, usually `<chartDefinition>.ref`). */
128
132
  chartViewRef: string;
129
- /** Grid columns the tile spans. Default: {@link ChartDashboardTileSpan.ONE}. */
133
+ /** Grid columns the tile spans (`ChartDashboardTileSpan`, `@wildo-ai/saas-models`). Default: `ONE`. */
130
134
  span?: ChartDashboardTileSpan;
131
- /** Grid rows the tile spans. Default: {@link ChartDashboardTileRows.ONE}. */
135
+ /** Grid rows the tile spans (`ChartDashboardTileRows`, `@wildo-ai/saas-models`). Default: `ONE`. */
132
136
  rows?: ChartDashboardTileRows;
133
137
  /**
134
- * Chart canvas height in px (the canvas is sized by this, not by the tile). Default: 280 for a chart; a KPI tile takes
135
- * the height of its figure, and this only sizes its loading placeholder (default 64).
138
+ * Chart canvas height in px for the tile's declared `rows` (the canvas is sized by this, not by the tile). Default:
139
+ * 280 for a one-row chart, 592 for a two-row one (two rows and the gap between them); a KPI tile takes the height of its
140
+ * figure, and this only sizes its loading placeholder (default 64). When an organization's layout changes the tile's
141
+ * rows, this height is doubled (plus the gap) or halved with them.
136
142
  */
137
143
  height?: number;
138
144
  }
@@ -142,6 +148,13 @@ export interface ChartDashboardProps {
142
148
  tiles: readonly ChartDashboardTile[];
143
149
  /** The most columns the grid reaches. Default: {@link ChartDashboardColumns.FOUR}. */
144
150
  columns?: ChartDashboardColumns;
151
+ /**
152
+ * The dashboard's name for an organization's stored arrangement of it (`organizationDashboardLayouts.dashboardRef`),
153
+ * unique within the application, e.g. `'home-analytics'`. Given one, the organization's administrators may reorder,
154
+ * resize and hide its tiles for every member, and go back to the declared layout; without one the dashboard is always
155
+ * laid out as declared.
156
+ */
157
+ layoutRef?: string;
145
158
  className?: string;
146
159
  }
147
160
 
@@ -159,6 +172,11 @@ export interface ChartDashboardProps {
159
172
  *
160
173
  * A KPI tile (a chart view whose chart is `ChartType.KPI`) shows one figure under that title, hidden by the same rule.
161
174
  *
175
+ * With a `layoutRef`, the current organization's stored arrangement applies first (order, sizes, hidden tiles); the read
176
+ * gate then applies to what is left. An administrator who may arrange it gets a "customize" button above the grid,
177
+ * opening the layout editor, and keeps it even when every tile is hidden. The grid waits for the arrangement to be read,
178
+ * and a read that fails shows the declared layout.
179
+ *
162
180
  * Place it inside a composite view (`CompositeLayout`), or declare a whole view as one with
163
181
  * {@link defineChartDashboardView}.
164
182
  *
@@ -173,29 +191,39 @@ export interface ChartDashboardProps {
173
191
  * />
174
192
  * ```
175
193
  */
176
- export function ChartDashboard({ tiles, columns = ChartDashboardColumns.FOUR, className }: ChartDashboardProps): React.JSX.Element | null {
194
+ export function ChartDashboard({ tiles, columns = ChartDashboardColumns.FOUR, layoutRef, className }: ChartDashboardProps): React.JSX.Element | null {
177
195
  const { registry } = useResourceRegistry();
178
196
  const viewer = useViewerEffectiveRoles();
197
+ const layout = useChartDashboardLayout(layoutRef, viewer);
198
+ const arrangedTiles = useMemo(
199
+ () => arrangeChartDashboardTiles(tiles, layout.stored?.tiles).filter((entry) => !entry.hidden).map((entry) => entry.tile),
200
+ [tiles, layout.stored],
201
+ );
179
202
  const visibleTiles = useMemo(
180
- () => tiles.flatMap((tile) => {
203
+ () => arrangedTiles.flatMap((tile) => {
181
204
  const chartView = registry.resourceConfigurations[tile.resourceType]?.frontendConfiguration?.chartViews
182
205
  ?.find((candidate) => candidate.ref === tile.chartViewRef);
183
206
  // An unknown chart is an authoring error, and `EmbedChart` throws it with the resource and ref named.
184
207
  if (chartView !== undefined && !viewerMayReadChart(chartView.chartDefinition, registry, viewer)) return [];
185
208
  return [{ tile, isFigure: chartView?.chartDefinition.chartType === ChartType.KPI }];
186
209
  }),
187
- [tiles, registry, viewer],
210
+ [arrangedTiles, registry, viewer],
188
211
  );
189
212
 
190
- if (visibleTiles.length === 0) return null;
213
+ if (layout.readState === ChartDashboardLayoutReadState.LOADING) return null;
214
+ // An administrator keeps the editor even when nothing is left to show: they may have hidden every tile.
215
+ if (visibleTiles.length === 0 && !layout.canEdit) return null;
191
216
  const grid = GRID_CLASSES[columns];
192
217
  return (
193
- <div className={cn('@container w-full', className)} data-chart-dashboard>
194
- <div className={cn('grid grid-cols-1 gap-group', grid.columns)}>
195
- {visibleTiles.map(({ tile, isFigure }) => (
196
- <ChartDashboardTileCell key={`${tile.resourceType}:${tile.chartViewRef}`} tile={tile} isFigure={isFigure} grid={grid} />
197
- ))}
198
- </div>
218
+ <div className={cn('@container flex w-full flex-col gap-element', className)} data-chart-dashboard>
219
+ {layout.canEdit && <ChartDashboardLayoutControl tiles={tiles} layout={layout} />}
220
+ {visibleTiles.length > 0 && (
221
+ <div className={cn('grid grid-cols-1 gap-group', grid.columns)}>
222
+ {visibleTiles.map(({ tile, isFigure }) => (
223
+ <ChartDashboardTileCell key={`${tile.resourceType}:${tile.chartViewRef}`} tile={tile} isFigure={isFigure} grid={grid} />
224
+ ))}
225
+ </div>
226
+ )}
199
227
  </div>
200
228
  );
201
229
  }
@@ -229,16 +257,115 @@ export function ChartDashboard({ tiles, columns = ChartDashboardColumns.FOUR, cl
229
257
  * ```
230
258
  */
231
259
  export function defineChartDashboardView(
232
- config: { tiles: readonly ChartDashboardTile[] } & Omit<CompositeViewAuthoringConfig, 'viewComponent'>,
260
+ config: { tiles: readonly ChartDashboardTile[]; columns?: ChartDashboardColumns; layoutRef?: string } & Omit<CompositeViewAuthoringConfig, 'viewComponent'>,
233
261
  ): CompositeViewAuthoringConfig {
234
- const { tiles, ...compositeConfig } = config;
262
+ const { tiles, columns, layoutRef, ...compositeConfig } = config;
235
263
  function ChartDashboardView(): React.JSX.Element {
236
264
  return (
237
265
  <CompositeLayout>
238
- <ChartDashboard tiles={tiles} />
266
+ <ChartDashboard tiles={tiles} columns={columns} layoutRef={layoutRef} />
239
267
  </CompositeLayout>
240
268
  );
241
269
  }
242
270
  return defineCompositeView(ChartDashboardView, compositeConfig);
243
271
  }
244
272
  ```
273
+
274
+ ## Import Origins
275
+
276
+ - `@wildo-ai/saas-models`
277
+
278
+ ## Source Excerpts
279
+
280
+ ### Origin Package: `@wildo-ai/saas-models`
281
+
282
+ ```typescript
283
+ /**
284
+ * How many grid columns a dashboard tile spans, where the dashboard is wide enough to have them.
285
+ *
286
+ * Import path: `@wildo-ai/saas-models`.
287
+ */
288
+ export enum ChartDashboardTileSpan {
289
+ /** One column (the default): a donut, a bar of a few categories. */
290
+ ONE = 'one',
291
+ /** Two columns: a trend over time, a bar of many categories. One column where the dashboard has one. */
292
+ TWO = 'two',
293
+ /** The whole row: a long timeline, a wide table-like chart. */
294
+ FULL = 'full',
295
+ }
296
+
297
+ /**
298
+ * How many grid rows a dashboard tile spans, where the dashboard has more than one column.
299
+ *
300
+ * Import path: `@wildo-ai/saas-models`.
301
+ */
302
+ export enum ChartDashboardTileRows {
303
+ /** One row (the default). */
304
+ ONE = 'one',
305
+ /**
306
+ * Two rows: a large chart beside two smaller ones stacked in the next column. Place it right after the first
307
+ * small tile, so the second small tile flows into the row beneath the first: `[small, large (TWO rows), small]`.
308
+ */
309
+ TWO = 'two',
310
+ }
311
+ ```
312
+
313
+ ## Import Origins
314
+
315
+ - `@wildo-ai/saas-models`
316
+
317
+ ## Source Excerpts
318
+
319
+ ### Origin Package: `@wildo-ai/saas-models`
320
+
321
+ ```typescript
322
+ /**
323
+ * One tile of a stored dashboard layout: which declared tile (the resource that declares the chart and the chart view's
324
+ * ref, the pair `ChartDashboard` knows the tile by), its size, and whether the organization hides it. Every field is
325
+ * explicit, so the row reads the same whatever the application later declares as the tile's default size.
326
+ *
327
+ * The size vocabularies declare no `.systemEnum()`: nothing renders this resource through the generic views, and the
328
+ * one surface that shows a size, the layout editor, words its choices itself (`span_<value>`, `rows_<value>` in its
329
+ * component labels). Declaring the vocabulary here too would plan a second set of words for the same values.
330
+ */
331
+ export const OrganizationDashboardLayoutTileSchema = z.object({
332
+ resourceType: z.string().min(1).max(120).describe('The resource whose chart views declare the tile\'s chart.'),
333
+ chartViewRef: z.string().min(1).max(200).describe('The chart view\'s ref on that resource.'),
334
+ span: z.enum(ChartDashboardTileSpan).describe('How many grid columns the tile spans.'),
335
+ rows: z.enum(ChartDashboardTileRows).describe('How many grid rows the tile spans.'),
336
+ hidden: z.boolean().describe('Whether the organization hides the tile from its dashboard.'),
337
+ });
338
+ export type OrganizationDashboardLayoutTile = z.infer<typeof OrganizationDashboardLayoutTileSchema>;
339
+
340
+ /**
341
+ * The tiles of a stored layout, in the order the dashboard shows them. A tile appears at most once: two entries for one
342
+ * tile would leave its position and size undecided.
343
+ */
344
+ export const OrganizationDashboardLayoutTilesSchema = z.array(OrganizationDashboardLayoutTileSchema)
345
+ .max(ORGANIZATION_DASHBOARD_LAYOUT_MAX_TILES)
346
+ .superRefine((tiles, context) => {
347
+ const seen = new Set<string>();
348
+ tiles.forEach((tile, index) => {
349
+ const key = chartDashboardTileKey(tile);
350
+ if (seen.has(key)) context.addIssue({ code: 'custom', path: [index], message: `The tile ${key} appears more than once in the layout.` });
351
+ seen.add(key);
352
+ });
353
+ });
354
+
355
+ /**
356
+ * How one organization arranges one dashboard. `dashboardRef` is the dashboard's `layoutRef`; (`organizationId`,
357
+ * `dashboardRef`) is the row's business key, unique on both stores. Changing it is audited, with the tiles before and after.
358
+ */
359
+ export const OrganizationDashboardLayoutSchema = z.object({
360
+ _id: z.string().min(1).isPrimaryKey().isSummaryField(),
361
+ organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),
362
+ dashboardRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate()
363
+ .describe('The dashboard this layout arranges: the `layoutRef` the application gives it.'),
364
+ tiles: z_clone(OrganizationDashboardLayoutTilesSchema).isAuditEvidence()
365
+ .describe('The dashboard\'s tiles in the order shown, each with its size and whether it is hidden.'),
366
+ createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),
367
+ updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),
368
+ // One layout per organization and dashboard: the composite business key is a unique constraint on both stores.
369
+ }).businessKeySet(['organizationId', 'dashboardRef']);
370
+ export type OrganizationDashboardLayout = z.infer<typeof OrganizationDashboardLayoutSchema>;
371
+ ```
@@ -323,6 +323,12 @@ const ALLOWED_BARE_SPECIFIERS: ReadonlySet<string> = new Set([
323
323
  */
324
324
  'node:module',
325
325
  'node:url',
326
+ /**
327
+ * `node:crypto` — `websiteContentSecurityPolicy()` (`content-security-policy.integration.ts`, on the `astro.ts`
328
+ * sub-entry, #3830) names each inline script it moves out of a built page by the SHA-256 of its content. It runs in
329
+ * `astro.config.ts` after the build, never in an island; pinned SSR-only below.
330
+ */
331
+ 'node:crypto',
326
332
  /**
327
333
  * `sharp` — measures a blog post's cover from the site's `public/` at build time (`blog-post-cover.resolver.ts`, on
328
334
  * the `astro.ts` sub-entry, #2723), so a cover reaches `WebsiteImage` with its real size. A native library: loaded
@@ -256,6 +256,12 @@ const ALLOWED_BARE_SPECIFIERS: ReadonlySet<string> = new Set([
256
256
  */
257
257
  'node:module',
258
258
  'node:url',
259
+ /**
260
+ * `node:crypto` — `websiteContentSecurityPolicy()` (`content-security-policy.integration.ts`, on the `astro.ts`
261
+ * sub-entry, #3830) names each inline script it moves out of a built page by the SHA-256 of its content. It runs in
262
+ * `astro.config.ts` after the build, never in an island; pinned SSR-only below.
263
+ */
264
+ 'node:crypto',
259
265
  /**
260
266
  * `sharp` — measures a blog post's cover from the site's `public/` at build time (`blog-post-cover.resolver.ts`, on
261
267
  * the `astro.ts` sub-entry, #2723), so a cover reaches `WebsiteImage` with its real size. A native library: loaded