@object-ui/app-shell 7.1.0 → 7.3.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 (107) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/dist/components/ManagedByBadge.js +1 -1
  3. package/dist/console/AppContent.js +9 -15
  4. package/dist/console/ConsoleShell.d.ts +16 -0
  5. package/dist/console/ConsoleShell.js +43 -2
  6. package/dist/console/ai/AiChatPage.js +64 -14
  7. package/dist/console/ai/BuildDebugDrawer.d.ts +20 -0
  8. package/dist/console/ai/BuildDebugDrawer.js +75 -0
  9. package/dist/console/ai/buildDebugApi.d.ts +94 -0
  10. package/dist/console/ai/buildDebugApi.js +16 -0
  11. package/dist/console/home/HomeLayout.js +5 -7
  12. package/dist/console/home/HomePage.js +1 -9
  13. package/dist/console/organizations/CreateWorkspaceDialog.js +15 -1
  14. package/dist/console/organizations/OrganizationsPage.js +32 -4
  15. package/dist/console/organizations/manage/OrganizationLayout.js +1 -1
  16. package/dist/console/organizations/provisionEnvironment.d.ts +53 -0
  17. package/dist/console/organizations/provisionEnvironment.js +64 -0
  18. package/dist/environment/EnvironmentEntitlementDialog.d.ts +34 -0
  19. package/dist/environment/EnvironmentEntitlementDialog.js +37 -0
  20. package/dist/environment/EnvironmentListToolbar.d.ts +33 -0
  21. package/dist/environment/EnvironmentListToolbar.js +59 -0
  22. package/dist/environment/entitlements.d.ts +90 -0
  23. package/dist/environment/entitlements.js +91 -0
  24. package/dist/environment/useEnvironmentEntitlements.d.ts +32 -0
  25. package/dist/environment/useEnvironmentEntitlements.js +108 -0
  26. package/dist/hooks/useActionModal.js +15 -1
  27. package/dist/hooks/useAiSurface.d.ts +59 -0
  28. package/dist/hooks/useAiSurface.js +78 -0
  29. package/dist/hooks/useConsoleActionRuntime.d.ts +3 -0
  30. package/dist/hooks/useConsoleActionRuntime.js +36 -8
  31. package/dist/index.d.ts +3 -1
  32. package/dist/index.js +5 -1
  33. package/dist/layout/AppHeader.js +30 -5
  34. package/dist/layout/ConsoleFloatingChatbot.js +22 -4
  35. package/dist/layout/ConsoleLayout.js +5 -6
  36. package/dist/layout/ContextSelectors.js +0 -19
  37. package/dist/layout/WorkspaceSwitcher.d.ts +14 -0
  38. package/dist/layout/WorkspaceSwitcher.js +76 -0
  39. package/dist/preview/DraftPreviewBar.js +20 -7
  40. package/dist/providers/ExpressionProvider.js +9 -3
  41. package/dist/utils/index.d.ts +2 -2
  42. package/dist/utils/index.js +1 -1
  43. package/dist/utils/managedByEmptyState.d.ts +1 -1
  44. package/dist/utils/managedByEmptyState.js +20 -2
  45. package/dist/utils/recordFormNavigation.d.ts +60 -0
  46. package/dist/utils/recordFormNavigation.js +35 -0
  47. package/dist/utils/resolvePageVarTokens.d.ts +31 -0
  48. package/dist/utils/resolvePageVarTokens.js +72 -0
  49. package/dist/views/CreateViewDialog.js +14 -1
  50. package/dist/views/ObjectView.js +27 -13
  51. package/dist/views/metadata-admin/AssignedUsersSection.d.ts +28 -0
  52. package/dist/views/metadata-admin/AssignedUsersSection.js +151 -0
  53. package/dist/views/metadata-admin/PackagesPage.d.ts +5 -0
  54. package/dist/views/metadata-admin/PackagesPage.js +49 -4
  55. package/dist/views/metadata-admin/PermissionMatrixEditor.js +2 -1
  56. package/dist/views/metadata-admin/ResourceEditPage.js +36 -4
  57. package/dist/views/metadata-admin/ResourceListPage.js +25 -10
  58. package/dist/views/metadata-admin/StudioHomePage.js +1 -5
  59. package/dist/views/metadata-admin/createBody.d.ts +26 -0
  60. package/dist/views/metadata-admin/createBody.js +30 -0
  61. package/dist/views/metadata-admin/i18n.js +20 -2
  62. package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.d.ts +8 -0
  63. package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.js +17 -3
  64. package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.js +16 -2
  65. package/dist/views/metadata-admin/inspectors/FlowExprIssue.d.ts +21 -0
  66. package/dist/views/metadata-admin/inspectors/FlowExprIssue.js +13 -0
  67. package/dist/views/metadata-admin/inspectors/FlowKeyValueField.d.ts +20 -2
  68. package/dist/views/metadata-admin/inspectors/FlowKeyValueField.js +71 -28
  69. package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.d.ts +4 -1
  70. package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.js +24 -9
  71. package/dist/views/metadata-admin/inspectors/FlowNodeInspector.js +15 -3
  72. package/dist/views/metadata-admin/inspectors/FlowObjectListField.d.ts +4 -1
  73. package/dist/views/metadata-admin/inspectors/FlowObjectListField.js +8 -3
  74. package/dist/views/metadata-admin/inspectors/VariableTextInput.d.ts +47 -0
  75. package/dist/views/metadata-admin/inspectors/VariableTextInput.js +95 -0
  76. package/dist/views/metadata-admin/inspectors/datasetFilterCondition.js +6 -1
  77. package/dist/views/metadata-admin/inspectors/flow-node-config.d.ts +16 -1
  78. package/dist/views/metadata-admin/inspectors/flow-node-config.js +21 -10
  79. package/dist/views/metadata-admin/inspectors/flow-ref-check.d.ts +39 -0
  80. package/dist/views/metadata-admin/inspectors/flow-ref-check.js +114 -0
  81. package/dist/views/metadata-admin/inspectors/flow-scope.d.ts +109 -0
  82. package/dist/views/metadata-admin/inspectors/flow-scope.js +199 -0
  83. package/dist/views/metadata-admin/inspectors/useDatasetFields.d.ts +14 -3
  84. package/dist/views/metadata-admin/inspectors/useDatasetFields.js +0 -0
  85. package/dist/views/metadata-admin/inspectors/useFlowScope.d.ts +23 -0
  86. package/dist/views/metadata-admin/inspectors/useFlowScope.js +45 -0
  87. package/dist/views/metadata-admin/package-scope.d.ts +9 -19
  88. package/dist/views/metadata-admin/package-scope.js +11 -25
  89. package/dist/views/metadata-admin/preview-registry.d.ts +12 -0
  90. package/dist/views/metadata-admin/previews/FlowCanvas.d.ts +22 -3
  91. package/dist/views/metadata-admin/previews/FlowCanvas.js +45 -6
  92. package/dist/views/metadata-admin/previews/FlowPreview.d.ts +1 -1
  93. package/dist/views/metadata-admin/previews/FlowPreview.js +42 -30
  94. package/dist/views/metadata-admin/previews/ObjectFormCanvas.js +9 -4
  95. package/dist/views/metadata-admin/previews/ProblemsPanel.d.ts +18 -0
  96. package/dist/views/metadata-admin/previews/ProblemsPanel.js +27 -0
  97. package/dist/views/metadata-admin/previews/ReportPreview.d.ts +9 -8
  98. package/dist/views/metadata-admin/previews/ReportPreview.js +33 -16
  99. package/dist/views/metadata-admin/previews/flow-canvas-parts.d.ts +9 -1
  100. package/dist/views/metadata-admin/previews/flow-canvas-parts.js +5 -3
  101. package/dist/views/metadata-admin/previews/flow-expr-problems.d.ts +19 -0
  102. package/dist/views/metadata-admin/previews/flow-expr-problems.js +97 -0
  103. package/dist/views/metadata-admin/previews/flow-problems.d.ts +84 -0
  104. package/dist/views/metadata-admin/previews/flow-problems.js +209 -0
  105. package/dist/views/metadata-admin/previews/simulator/flow-sim-types.d.ts +9 -0
  106. package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.js +4 -2
  107. package/package.json +38 -38
package/CHANGELOG.md CHANGED
@@ -1,5 +1,325 @@
1
1
  # @object-ui/app-shell — Changelog
2
2
 
3
+ ## 7.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 17ae00c: feat(studio): remove the "Local / Custom" stopgap scope from the package selector (ADR-0070 D5)
8
+
9
+ The package-scope selector no longer offers a synthetic "Local / Custom (this
10
+ env)" entry (the `package_id = null` / `sys_metadata` orphan bucket from
11
+ objectui#1946). That was a deliberate stopgap; ADR-0070 makes every
12
+ runtime-authored item live in a writable **base**, the kernel rejects orphan
13
+ creates (`writable_package_required`), and legacy orphans are adopted into a
14
+ base via "Adopt loose items". With no authoring path producing orphans, the
15
+ bucket has no reason to exist.
16
+
17
+ - `buildPackageScopeOptions` now returns only writable bases (drops the appended
18
+ sentinel); `isLocalScope` / `LOCAL_PACKAGE_ID` / `writableBaseOptions` and the
19
+ inline `LOCAL_SCOPE_ID` in `ContextSelectors` are removed.
20
+ - The create-flow and list/home scope filters simplify accordingly (a real base
21
+ is always the active scope; never the null/local sentinel).
22
+ - Read-side `sys_metadata` provenance handling (classifying a row as
23
+ runtime-authored, artifact detection in the editor) is unchanged — the kernel
24
+ still keeps `null` as a legacy read tag.
25
+
26
+ Closes the D5 tail of #2278 (the migration tooling it depended on already
27
+ shipped).
28
+
29
+ - Updated dependencies [788dbf9]
30
+ - @object-ui/fields@7.3.0
31
+ - @object-ui/types@7.3.0
32
+ - @object-ui/core@7.3.0
33
+ - @object-ui/i18n@7.3.0
34
+ - @object-ui/react@7.3.0
35
+ - @object-ui/components@7.3.0
36
+ - @object-ui/layout@7.3.0
37
+ - @object-ui/data-objectstack@7.3.0
38
+ - @object-ui/auth@7.3.0
39
+ - @object-ui/permissions@7.3.0
40
+ - @object-ui/plugin-editor@7.3.0
41
+ - @object-ui/collaboration@7.3.0
42
+ - @object-ui/providers@7.3.0
43
+
44
+ ## 7.2.0
45
+
46
+ ### Minor Changes
47
+
48
+ - 88a3e39: feat(console): born-with-env eager provisioning for multi-org workspace create
49
+
50
+ ObjectStack runs a 1-production-environment-per-organization model: a user who wants
51
+ another production space creates another organization, and each org is born with its
52
+ production environment. The self-service "create workspace" flow now delivers that
53
+ without an onboarding-wizard detour.
54
+
55
+ After `createOrganization` succeeds (which already switches the active org),
56
+ `CreateWorkspaceDialog` eagerly `POST`s `/api/v1/cloud/environments` with the new org as
57
+ target so its first environment is provisioned as a production env (allowed on every plan,
58
+ including free), then hands off to the existing switch-and-navigate-home path. The
59
+ provision is best-effort: on failure the onboarding gate provisions the env lazily on
60
+ first navigation, so multi-org still works. The `multiOrgEnabled` enable-gate is unchanged
61
+ (already wired end-to-end via the auth `/config` `features.multiOrgEnabled` flag).
62
+
63
+ Adds a gated **"Create workspace"** entry to the org switcher (avatar dropdown) that
64
+ opens the dialog directly — previously a single-org user could never reach it, because
65
+ the only path (`/organizations`) auto-skips to home when you belong to exactly one org.
66
+ The eager provision is idempotent: a control plane that auto-provisions the production
67
+ env on org create resolves it to "already provisioned" rather than erroring.
68
+
69
+ Also removes the unreferenced `apps/console` `CreateWorkspaceDialog` duplicate; the live
70
+ component is the app-shell copy used by `OrganizationsPage`.
71
+
72
+ - e301475: feat(console): hide the AI surface at runtime when the server serves no AI agent (Community Edition)
73
+
74
+ A self-host Community Edition runtime (framework + this MIT console, without the
75
+ cloud `@objectstack/service-ai-studio` package) serves no `ask`/`build` agent.
76
+ The console now hides every AI entry point via runtime, server-pushed gating —
77
+ no build-time edition flag, no tree-shake.
78
+
79
+ Crucially, gating is driven off the **agent catalog** (`GET /api/v1/ai/agents`),
80
+ not the discovery `services.ai` flag: the open-source framework keeps a headless
81
+ `@objectstack/service-ai` that still reports `services.ai` as available, so a CE
82
+ runtime can report AI "available" while serving zero agents. The catalog is the
83
+ real "is there an agent to answer?" signal.
84
+
85
+ - New `useAiSurfaceEnabled()` hook + `RequireAiSurface` route guard (exported).
86
+ - `/ai*` routes redirect to home when no agent is served; the FAB, top-bar AI
87
+ link and the metadata designers' "Ask AI" buttons hide; `AiChatPage` shows a
88
+ graceful "AI unavailable" state instead of an agent-less echo chat.
89
+ - Fully additive for cloud installs — when an agent is served, every AI surface
90
+ renders and works as before.
91
+
92
+ - 616157a: feat(studio): multi-hop relationship fields in the dataset designer (ADR-0071)
93
+
94
+ The dataset designer's field catalog and Included-relationships picker now
95
+ support multi-hop relationship paths (`account.owner.region`), matching the
96
+ framework's multi-hop join support (ADR-0071 P2):
97
+
98
+ - `useDatasetFieldCatalog` walks each included path hop-by-hop, fetching every
99
+ object along the chain, so `path.field` options surface for fields two–three
100
+ to-one hops deep (grouped under a chained `Account → Owner → User` heading).
101
+ - The Included-relationships combo offers one level deeper along each
102
+ already-included path (drill `account` → `account.owner`), capped at 3 hops.
103
+ - The author-time "relationship not in Included" warning generalizes to the full
104
+ relationship path (`account.owner`), with one-click "Add it".
105
+
106
+ Single-hop datasets are unchanged.
107
+
108
+ - 6668759: feat(console): entitlement- & state-aware environment actions
109
+
110
+ The `sys_environment` list now presents the right create affordance for the
111
+ org's state (born-with-env) instead of POST-then-error:
112
+
113
+ - **No production env** (historical orgs) → "Set up your production environment";
114
+ the create POST provisions the org's one production env — this path never errors.
115
+ - **Has prod env, free plan** → an "Add environment" button that opens a friendly
116
+ upgrade prompt (CTA to billing) instead of POSTing into a 403.
117
+ - **Has prod env, paid plan** → "Add development environment" creates a dev env.
118
+
119
+ The action runtime's `apiHandler` now also turns the cloud env-create entitlement
120
+ 403s (`DEV_ENV_PLAN_LOCKED` / `DEV_ENV_LIMIT` / `PRODUCTION_ENV_LIMIT`) into a
121
+ friendly upgrade/limit dialog with a CTA rather than a red error toast — a safety
122
+ net that covers any path. State is resolved from the new org-scoped
123
+ `GET /cloud/environment-entitlements` summary, with a row-derived `hasProductionEnv`
124
+ fallback so the production-setup path works even against an older control plane.
125
+
126
+ - 41c60c4: Flow builder: variable data-picker for expression / template config fields. Expression and template surfaces (decision Branches, edge Condition, Assignment values, Screen description, CRUD field values / filter, subflow / script inputs) now show a "{x}" picker listing the references in scope at that node — flow variables, upstream node outputs, the trigger record's fields, and any enclosing loop item — resolved graph-aware by walking the flow back from the node. Selecting a reference inserts the correctly-braced token at the cursor (bare CEL in `expression` fields, `{var}` in template fields), handling the ADR-0032 brace-in-CEL trap for the author. Free-text typing is unchanged and an empty scope degrades to a plain input.
127
+ - d23db5c: feat(detail): related-list add-by-picker (generic m2m/junction) + a generic "Assigned Users" management UI on permission sets (assign ai_seat and any role with zero bespoke CRUD; server-side cap errors surface inline).
128
+
129
+ ### Patch Changes
130
+
131
+ - 81ad9aa: feat(studio): package lifecycle UI — Duplicate base, Adopt loose items, structure-only delete (ADR-0070 D4/D5/D6)
132
+
133
+ `PackageDetailSheet` gains the user-facing affordances for the package-as-
134
+ lifecycle-unit work:
135
+ - **Duplicate** → `POST /packages/:id/duplicate` (clone a base into a new
136
+ writable package; D4).
137
+ - **Adopt loose items** → `POST /packages/:id/adopt-orphans` (migrate every
138
+ package-less orphan into this base; D5).
139
+ - **Delete** now asks whether to drop records too (`?keepData`) — structure-only
140
+ vs everything (D4 Q3).
141
+
142
+ D6 guardrail test: the scope selector never defaults to the package-less
143
+ `Local / Custom` sentinel (`writableBaseOptions` excludes it; real bases sort
144
+ first).
145
+
146
+ - 4b1cb7a: feat(studio): package-first create flow — prompt or redirect to a writable base (ADR-0070 D3)
147
+
148
+ Studio's create entry points no longer let a new metadata item land in a code
149
+ package or the package-less "Local / Custom" bucket. ResourceListPage's create
150
+ gate (`handleCreate`) now: opens the create-base dialog when no writable base
151
+ exists; redirects into the first base when the active scope is Local/none but
152
+ bases exist; otherwise proceeds normally. Adds package-scope helpers
153
+ (`isLocalScope` / `writableBaseOptions`) with tests, surfaces the kernel's
154
+ `writable_package_required` (422) as an actionable error in ResourceEditPage,
155
+ and exports `CreatePackageDialog` from PackagesPage for reuse.
156
+
157
+ - 8c2191d: fix(console): polished, localized "Assigned Users" management for permission sets — resolves users to name/email (no raw id), zh/en localized, friendly inline cap message (drops the dev `[Tag]` prefix), people-rows with visible remove + add-via-picker.
158
+ - 6028192: fix(console): gate the AI surface on the access-filtered agent catalog (per-user), not the deployment-wide service-ai capability
159
+
160
+ `useAiSurfaceEnabled` keys off `GET /api/v1/ai/agents` again (>= 1 agent → AI shows), reverting objectui#1992. The agent-catalog route is now access-filtered server-side (ADR-0049 / ADR-0068): it returns only the agents the caller may chat, so a user WITHOUT the per-user AI seat (`ai_seat`) gets an empty catalog and the whole AI surface (FAB, `/ai` routes, top-bar + designer "Ask AI") hides for them — instead of showing a control that 403s on click. The discovery `services.ai` flag is deployment-wide and cannot express per-user seating, so it is the wrong signal for the AI-seat gate. Community-Edition gating is unaffected: no service-ai → no agents → empty catalog → hidden.
161
+
162
+ - e575da0: fix(ai): stop the AI composer placeholder doubling to "Ask Ask…" for the Ask agent
163
+
164
+ The composer placeholder is `Ask {agent}…`, which reads fine for most agents
165
+ ("Ask Build…") but doubles to "Ask Ask…" for the data-query agent whose label is
166
+ literally "Ask". The Ask agent now uses its purpose-built placeholder
167
+ (`console.ai.askAnything` → "Ask anything…", already localized) instead. Found
168
+ dogfooding the AI Ask flow.
169
+
170
+ - cde7502: fix(form): create/edit record modal now honors the object's default form view
171
+
172
+ The "New <object>" modal (and the modal edit form) rendered every field from
173
+ the raw object schema, in schema order — ignoring the curated sections + field
174
+ selection/order defined in the object's default FORM VIEW. Customizing the form
175
+ view (section grouping, field selection/order) had no effect on the create
176
+ modal; only `tabbed` views were partially honored, while a `simple` view with
177
+ curated sections was dropped entirely.
178
+
179
+ New `resolveFormViewLayout(objectDef)` helper resolves the default form view
180
+ (`objectDef.form ?? formViews.default`) into the modal's layout props (curated
181
+ `sections`, `contentLayout: 'tabbed'`, and master-detail `subforms`), mirroring
182
+ the full-screen `RecordFormPage`. It is wired into:
183
+
184
+ - the global New/Edit `ModalForm` in `AppContent` (replacing the tabbed-only
185
+ inline logic so `simple` sectioned views are honored too), and
186
+ - `useActionModal` (action-opened forms), which previously passed no
187
+ `fields`/`sections` and so fell back to the whole object schema.
188
+
189
+ When the object declares no form view — or one without sections — the modal
190
+ keeps its prior flat-field behavior. Frontend-only.
191
+
192
+ - 0d8dbda: fix(metadata-admin): dataset filter builder ignores incomplete conditions
193
+
194
+ `groupToCondition` emitted a condition for any row that had a `field`, even when
195
+ its value was still blank — producing a silently-wrong filter like
196
+ `{ organization_id: { $eq: "" } }` (matches only empty → excludes everything)
197
+ instead of "no filter". Now rows with an empty/`undefined`/`[]` value are skipped
198
+ (value-less operators like is-empty / is-not-empty are still kept). Applies to both
199
+ the dataset Scope filter and per-measure filters. Found by dogfooding.
200
+
201
+ - e8c1c85: fix(metadata-admin): re-base a dataset when its base object changes
202
+
203
+ A dataset's joins (`include`), dimensions, measures, and filter all reference the
204
+ base object's fields. Changing the base object left those referencing the OLD
205
+ object — stale field refs that silently produce broken/ambiguous queries. Now a
206
+ real object change clears the object-dependent config (selecting the same object
207
+ is a no-op), and a heads-up note appears while there is config that a change would
208
+ clear. Found by dogfooding (G1).
209
+
210
+ - 0119ff4: Designer derives create defaults from the spec's create seed (/meta/types)
211
+
212
+ The metadata create flow now builds a new item's body from the server's authoritative `createSeed` (delivered per type on the `/meta/types` registry entry — the single source of truth in `@objectstack/spec`) instead of the locally hardcoded `createDefaults`, falling back to `createDefaults` when the server provides no seed (older server, or canvas-create types). This closes the drift loop behind the "designer emits a minimal shape the spec rejects → create→save 422" family (dashboard `layout`, action `body`): the structural create defaults now come from the same place the spec validates against, so they cannot diverge. Extracted as the pure, unit-tested `buildCreateModeBody`.
213
+
214
+ - 8e7c1da: fix(preview): draft-preview bar no longer demands a redundant Publish when nothing is pending
215
+
216
+ Under the auto-publish posture an AI build leaves zero pending drafts, yet opening a
217
+ draft preview still showed "Draft preview — Nothing here is live until you publish."
218
+ alongside "Changes (0)" and a Publish button — a self-contradicting, no-op call to
219
+ action. `DraftPreviewBar` now reflects the real pending-draft count: when it is
220
+ known to be zero the bar softens to a neutral preview indicator and drops the
221
+ Publish/Changes affordances; an unknown count (still loading / fetch failed) keeps
222
+ the publish path. `HomePage` (count-gated) and `RuntimeDraftBar` (draft-gated)
223
+ already behaved this way — this aligns the third surface.
224
+
225
+ - 522a54c: feat(studio): make the flow-canvas error banner clickable
226
+
227
+ The inline structural-error banner (ADR-0044 cycle surfacing) is now driven by
228
+ the unified `problems` list, and each row with a concrete target is clickable —
229
+ clicking it selects and pans-to-reveal the offending node/edge (the same reveal
230
+ the Problems panel performs). So the always-visible banner is actionable without
231
+ opening the panel. Drops the now-redundant `validationErrors` string prop: the
232
+ banner, the Problems panel, and the on-canvas badges all share one source.
233
+
234
+ - cdc6246: Flow builder (#1934): expression problems — ADR-0032 brace/shape errors and scope-aware "unknown reference" warnings — now also surface in the flow **Problems panel** and as on-canvas **node/edge badges** (#1972), not just inline in the inspector. A `{record.x}` brace-in-CEL mistake or a typo'd variable is now visible at the flow level without opening each node. The start node's bare trigger-record fields are excluded from the ref check to avoid false positives (the inline inspector check still covers them).
235
+ - 7fe2735: Flow builder data-picker (#1934): the cursor-insertion math is extracted into a pure `insertToken` helper with unit tests (alongside `formatToken`) — bare CEL vs `{var}` template insertion, append / mid-string / selection-replace, and clamping a reversed or out-of-range selection. Pure refactor, no behavior change.
236
+ - 3f529a8: refactor(studio): derive the flow red-error highlight from the unified problem list (one validateFlowDraft pass)
237
+
238
+ Follow-up to #1972 (Problems panel + badges) and #1976 (clickable banner). The
239
+ flow preview still ran `validateFlowDraft` twice per render — once in
240
+ `buildFlowProblems` (badges / banner / panel) and again in a separate memo that
241
+ derived the red node/edge ring/stroke — with the cycle-highlight logic duplicated
242
+ between them.
243
+
244
+ `buildFlowProblems` is now the single validation pass: a new
245
+ `deriveInvalidElements(problems)` produces the red error set (errors only; a
246
+ cycle paints its whole loop via a per-problem `highlight` set while its badge +
247
+ reveal stay on the closing edge). The preview drops its second `validateFlowDraft`
248
+ call. The clickable banner (#1976), badges, and panel are unchanged — all four
249
+ surfaces now derive from one list, so they cannot drift.
250
+
251
+ - 0b9c96c: Flow builder data-picker follow-ups (#1934): (1) a scope-aware "unknown reference" warning pairs the picker with inline validation — a typed reference whose root isn't in scope at the node is flagged with a nearest-match "did you mean?" hint (conservative: root-only, skips function calls / string literals / runtime globals; non-blocking amber). (2) Assignment values authored in the array form `[{ variable, value }]` now render in the key/value editor (and get the picker) instead of falling back to Advanced JSON; the editor reads both the object-map and array shapes and preserves whichever was authored. (3) A script `code` body (JS/TS, not a `{var}` template) now inserts bare references via a `refMode` field override — `{x}` is a syntax error in a script.
252
+ - 47537fe: Flow builder data-picker (#1934): inline validation now also shows on the repeater surfaces that carry the picker — decision **Branches** expressions, screen field **"visible when"**, and key/value **values** — not just single fields. Each shows the ADR-0032 brace error (red) or a scope-aware "unknown reference" warning (amber) via a shared `FlowExprIssue` line. The trigger-record picker also offers `previous.<field>` references on update / change / before-update triggers.
253
+ - 17ba30d: feat(studio): on-canvas validation badges + a Problems panel for the flow builder
254
+
255
+ Flow validation only surfaced as a top banner ("…N error(s)") that didn't point
256
+ to the offending element — in a non-trivial flow you couldn't tell _which_ node
257
+ or edge was wrong. The simulator's `validateFlowDraft` already detected the
258
+ structural problems (no resolvable entry, unreachable nodes, a decision with no
259
+ default branch, duplicate node ids, dangling edges, un-declared cycles); they
260
+ just weren't shown on the canvas. This was a surfacing gap, not a detection one.
261
+
262
+ The flow preview now:
263
+
264
+ - renders an error / warning **badge** on each offending node and edge, with the
265
+ issue message(s) as its tooltip;
266
+ - adds a **Problems panel** listing every issue (structural + the server
267
+ `_diagnostics` already attached to the layered record); clicking a row selects
268
+ and reveals (pans to) the node/edge;
269
+ - clears badges + rows as issues are resolved (everything derives from the live
270
+ draft).
271
+
272
+ `validateFlowDraft` now tags dangling-edge errors with their endpoints so they
273
+ key to the offending connection, and a new `flow-problems` module maps both
274
+ sources onto concrete canvas elements (node id / stable edge key). Server
275
+ diagnostics reach the preview through a new optional `diagnostics` prop on
276
+ `MetadataPreviewProps`.
277
+
278
+ - 104d181: fix(studio): flow wait-node inspector tolerates the loose `config` shape
279
+
280
+ The wait-node property form read only the spec-canonical
281
+ `waitEventConfig.{eventType,signalName,…}`, but the engine also accepts a looser
282
+ `config.{eventType,…}` shape — which the canonical `showcase_budget_approval`
283
+ (and AI-authored flows) use. So a showcase-shaped wait node opened in the
284
+ designer showed blank "Wait for" / "Signal name" fields.
285
+
286
+ Flow config fields gain an optional `fallbackPath`: reads fall back to it (so
287
+ loose-shape wait nodes display, and dependent fields reveal), writes target the
288
+ canonical path and prune the fallback (migrate-on-edit), and the fallback's
289
+ config key is suppressed from the Advanced block. The `wait` fields now fall
290
+ back to `config.*`, so the designer matches the engine's tolerance. Pairs with
291
+ the ADR-0044 revise-loop authoring (#1954).
292
+
293
+ - 1fa5982: fix(studio): preview joined reports in the report editor (was "design blind")
294
+
295
+ Found dogfooding report design in Studio as a business user. The report editor's
296
+ live preview only rendered single dataset-bound reports — a `joined` report
297
+ (which carries its data on `blocks`, with no top-level `dataset`) fell through to
298
+ the "Bind a dataset to preview this report" empty state, so an author building a
299
+ joined report saw nothing and designed blind.
300
+
301
+ `ReportPreview` now renders a joined report (≥1 dataset-bound block) through the
302
+ same runtime `ReportRenderer` (→ `DatasetReportRenderer`, which already stacks
303
+ the blocks), keeping the preview pixel-equal with the runtime, and shows a
304
+ joined-aware empty state ("Add a block…") when no block is bound yet.
305
+
306
+ - Updated dependencies [8e7c1da]
307
+ - Updated dependencies [cf746c9]
308
+ - Updated dependencies [d23db5c]
309
+ - @object-ui/i18n@7.2.0
310
+ - @object-ui/auth@7.2.0
311
+ - @object-ui/types@7.2.0
312
+ - @object-ui/components@7.2.0
313
+ - @object-ui/fields@7.2.0
314
+ - @object-ui/react@7.2.0
315
+ - @object-ui/collaboration@7.2.0
316
+ - @object-ui/core@7.2.0
317
+ - @object-ui/data-objectstack@7.2.0
318
+ - @object-ui/layout@7.2.0
319
+ - @object-ui/permissions@7.2.0
320
+ - @object-ui/plugin-editor@7.2.0
321
+ - @object-ui/providers@7.2.0
322
+
3
323
  ## 7.1.0
4
324
 
5
325
  ### Minor Changes
@@ -27,7 +27,7 @@ const VARIANTS = {
27
27
  icon: ShieldAlert,
28
28
  short: 'Identity',
29
29
  title: 'Managed by the identity provider',
30
- body: (display) => `This object's schema is owned by ${display}. Direct edits bypass password hashing, session validation, two-factor checks, and audit hooks. Use the dedicated identity workflows instead (Invite User, Reset Password, Revoke Session, Rotate Key, …).`,
30
+ body: (display) => `This object's schema is owned by ${display}. Direct edits bypass password hashing, session validation, two-factor checks, and audit hooks. Manage these records through your authentication provider's sign-in, invitation, and security flows instead.`,
31
31
  tone: 'border-amber-300/60 bg-amber-50 text-amber-900 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-amber-950/40 dark:text-amber-100',
32
32
  },
33
33
  };
@@ -23,7 +23,7 @@ import { usePreviewDrafts } from '../preview/PreviewModeContext';
23
23
  import { PreviewDraftEmptyState } from '../preview/PreviewDraftEmptyState';
24
24
  import { ExpressionProvider, evaluateVisibility } from '../providers/ExpressionProvider';
25
25
  import { useTrackRouteAsRecent } from '../hooks/useTrackRouteAsRecent';
26
- import { resolveRecordFormTarget, resolveNavigateCreateUrl, resolveNavigateEditUrl } from '../utils/recordFormNavigation';
26
+ import { resolveRecordFormTarget, resolveFormViewLayout, resolveNavigateCreateUrl, resolveNavigateEditUrl } from '../utils/recordFormNavigation';
27
27
  import { matchAppBySegment } from '../utils/appRoute';
28
28
  import { resolveHref } from '@object-ui/layout';
29
29
  import { ExpressionEvaluator } from '@object-ui/core';
@@ -401,20 +401,14 @@ export function AppContent({ extraRoutes, extraRoutesNoApp } = {}) {
401
401
  objectName: currentObjectDef.name,
402
402
  mode: editingRecord ? 'edit' : 'create',
403
403
  recordId: editingRecord?.id,
404
- // Master-detail by config: if the object's form view declares
405
- // inline child collections, the standard New/Edit modal renders
406
- // them as an atomic master-detail form (no bespoke page).
407
- subforms: currentObjectDef.form?.subforms
408
- ?? currentObjectDef.formViews?.default?.subforms,
409
- // ADR-0050 (#1890): forward the default form view's layout so the
410
- // New/Edit modal can be tabbed (not just a flat stack). `formType`
411
- // stays 'modal' (the container); `contentLayout` carries the layout.
412
- ...(() => {
413
- const fd = currentObjectDef.form ?? currentObjectDef.formViews?.default;
414
- return fd?.type === 'tabbed' && Array.isArray(fd?.sections)
415
- ? { contentLayout: 'tabbed', sections: fd.sections }
416
- : {};
417
- })(),
404
+ // Honor the object's DEFAULT FORM VIEW: curated sections (field
405
+ // selection + order + grouping), `contentLayout: 'tabbed'` when the
406
+ // view is tabbed, and inline child collections (master-detail).
407
+ // When the view declares sections they drive the modal layout and
408
+ // win over the flat `fields` list below; otherwise this resolves to
409
+ // {} and `fields` (every field, raw schema order) is used as before.
410
+ // `formType` stays 'modal' (the container). (#1890 / ADR-0050.)
411
+ ...resolveFormViewLayout(currentObjectDef),
418
412
  title: editingRecord
419
413
  ? t('form.editTitle', { object: objectLabel(currentObjectDef) })
420
414
  : t('form.createTitle', { object: objectLabel(currentObjectDef) }),
@@ -44,6 +44,22 @@ export declare function ConnectedShell({ children }: {
44
44
  export declare function RequireOrganization({ children }: {
45
45
  children: ReactNode;
46
46
  }): import("react").JSX.Element;
47
+ /**
48
+ * RequireAiSurface — gate for the `/ai*` routes. The console is edition-agnostic
49
+ * (MIT, runtime-gated): a Community Edition runtime serves no AI agent, so a
50
+ * stale `/ai` bookmark or external link must not land on a broken/empty chat.
51
+ * When the server serves no agent it redirects to `redirectTo` (home) instead.
52
+ *
53
+ * Availability is the live agent catalog (see {@link useAiSurfaceEnabled}) — the
54
+ * same signal every other AI entry point now gates on, so the route is reachable
55
+ * from exactly the entry points that are visible (no shown CTA that bounces back
56
+ * to home, no hidden FAB to a working route). Waits for the catalog to resolve
57
+ * before deciding so the redirect never flashes on first paint.
58
+ */
59
+ export declare function RequireAiSurface({ children, redirectTo, }: {
60
+ children: ReactNode;
61
+ redirectTo?: string;
62
+ }): import("react").JSX.Element;
47
63
  /**
48
64
  * AuthenticatedRoute — convenience wrapper composing AuthGuard + ConnectedShell
49
65
  * (+ optional RequireOrganization). Covers the common case for protected
@@ -10,7 +10,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
10
10
  * JSX in App.tsx. See examples/console-starter/src/App.tsx for a minimal example,
11
11
  * apps/console/src/App.tsx for one with custom system routes + CreateApp.
12
12
  */
13
- import { Suspense, useEffect, useRef } from 'react';
13
+ import { Suspense, useEffect, useRef, useState } from 'react';
14
14
  import { Navigate, useLocation } from 'react-router-dom';
15
15
  import { AuthGuard, useAuth } from '@object-ui/auth';
16
16
  import { useObjectTranslation } from '@object-ui/i18n';
@@ -18,6 +18,7 @@ import { SchemaRendererProvider } from '@object-ui/react';
18
18
  import { createObjectStackUserStateAdapter } from '@object-ui/data-objectstack';
19
19
  import { AdapterProvider, useAdapter } from '../providers/AdapterProvider';
20
20
  import { MetadataProvider, useMetadata } from '../providers/MetadataProvider';
21
+ import { useAiSurfaceEnabled } from '../hooks/useAiSurface';
21
22
  import { PreviewModeProvider } from '../preview/PreviewModeContext';
22
23
  import { NavigationProvider } from '../context/NavigationContext';
23
24
  import { FavoritesProvider } from '../context/FavoritesProvider';
@@ -131,13 +132,53 @@ function UserStateBridge() {
131
132
  * deployments (empty organizations list) render through.
132
133
  */
133
134
  export function RequireOrganization({ children }) {
134
- const { activeOrganization, organizations, isOrganizationsLoading } = useAuth();
135
+ const { activeOrganization, organizations, isOrganizationsLoading, getAuthConfig } = useAuth();
136
+ // Multi-org (cloud) deployments route a brand-new, org-less user into the
137
+ // guided "Create your workspace" flow; single-tenant self-host renders through.
138
+ const [multiOrgEnabled, setMultiOrgEnabled] = useState(null);
139
+ useEffect(() => {
140
+ let cancelled = false;
141
+ getAuthConfig()
142
+ .then((cfg) => { if (!cancelled)
143
+ setMultiOrgEnabled(cfg?.features?.multiOrgEnabled !== false); })
144
+ .catch(() => { if (!cancelled)
145
+ setMultiOrgEnabled(false); });
146
+ return () => { cancelled = true; };
147
+ }, [getAuthConfig]);
135
148
  if (isOrganizationsLoading)
136
149
  return _jsx(LoadingFallback, {});
137
150
  const orgList = organizations ?? [];
138
151
  const orgFeatureEnabled = orgList.length > 0 || !!activeOrganization;
139
152
  if (orgFeatureEnabled && !activeOrganization)
140
153
  return _jsx(Navigate, { to: "/organizations", replace: true });
154
+ // No org at all: on multi-org, send them to /organizations (the create
155
+ // screen); wait for the flag so we don't flash /home then redirect.
156
+ if (orgList.length === 0 && !activeOrganization) {
157
+ if (multiOrgEnabled === null)
158
+ return _jsx(LoadingFallback, {});
159
+ if (multiOrgEnabled)
160
+ return _jsx(Navigate, { to: "/organizations", replace: true });
161
+ }
162
+ return _jsx(_Fragment, { children: children });
163
+ }
164
+ /**
165
+ * RequireAiSurface — gate for the `/ai*` routes. The console is edition-agnostic
166
+ * (MIT, runtime-gated): a Community Edition runtime serves no AI agent, so a
167
+ * stale `/ai` bookmark or external link must not land on a broken/empty chat.
168
+ * When the server serves no agent it redirects to `redirectTo` (home) instead.
169
+ *
170
+ * Availability is the live agent catalog (see {@link useAiSurfaceEnabled}) — the
171
+ * same signal every other AI entry point now gates on, so the route is reachable
172
+ * from exactly the entry points that are visible (no shown CTA that bounces back
173
+ * to home, no hidden FAB to a working route). Waits for the catalog to resolve
174
+ * before deciding so the redirect never flashes on first paint.
175
+ */
176
+ export function RequireAiSurface({ children, redirectTo = '/home', }) {
177
+ const { enabled, isLoading } = useAiSurfaceEnabled();
178
+ if (isLoading)
179
+ return _jsx(LoadingFallback, {});
180
+ if (!enabled)
181
+ return _jsx(Navigate, { to: redirectTo, replace: true });
141
182
  return _jsx(_Fragment, { children: children });
142
183
  }
143
184
  /**