Repository navigation
Expand file tree
/
Copy pathindex.ts
More file actions
661 lines (631 loc) · 30.9 KB
/
Copy pathindex.ts
File metadata and controls
661 lines (631 loc) · 30.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
/**
* @object-ui/app-shell
*
* Minimal Application Shell for ObjectUI
* Framework-agnostic rendering engine for third-party integration
*/
// Components
export { AppShell } from './components/AppShell.js';
// The adapter this shell installs into `AdapterCtx`, declared for every
// reader of `useAdapter` (see the module).
import './adapter-context-register.js';
// Providers
export { AdapterProvider, useAdapter } from './providers/AdapterProvider.js';
export { MetadataProvider, useMetadata, useMetadataItem } from './providers/MetadataProvider.js';
export { ExpressionProvider, evaluateVisibility } from './providers/ExpressionProvider.js';
/**
* The `user` normalisation `ExpressionProvider` is fed with — exported so every
* console surface that mounts the provider publishes the SAME `current_user`
* shape (objectui#6110). It supplies the defaults a predicate needs in order to
* evaluate to FALSE rather than FAULT: an absent `positions` makes
* `'x' in current_user.positions` an unbound-key fault, which fails OPEN, so a
* second mount site re-deriving this by hand would reintroduce exactly the
* asymmetry #6010's parity pin exists to refuse.
*
* objectui#6515 — that is exactly what `RecordFormPage` did, because the
* normaliser used to live in `console/AppContent.js` and the view is
* `lazy()`-loaded BY that module. The specifier below moved to the leaf module
* beside the provider it feeds; the NAME published from this entry did not.
* `console/AppContent.js` re-exports it too, for importers already reaching it
* there.
*/
export { buildExpressionUser } from './providers/expressionUser.js';
// Hooks
export { useObjectActions } from './hooks/useObjectActions.js';
export { useUrlOverlay } from './hooks/useUrlOverlay.js';
export { useSettleSignal } from './hooks/useSettleSignal.js';
export {
getPendingRequests,
subscribeSettle,
whenIdle,
withSettleSignal,
installSettleSignalGlobal,
} from './observability/settleSignal.js';
export { useRecentItems } from './hooks/useRecentItems.js';
// From its own module, not the `useRecentItems` shim: it reads the metadata
// cache, and the shim must not drag that into a list-only importer's graph.
export { useRecentItemLabel } from './hooks/useRecentItemLabel.js';
// Types
export type {
MinimalAppShellProps,
} from './types.js';
export type {
MetadataCacheState,
MetadataContextValue,
MetadataTypeStatus,
} from './providers/MetadataProvider.js';
export type {
RecentItem,
RecentItemType,
RecentNamedItem,
} from './hooks/useRecentItems.js';
// Console building blocks — compose these in your App.tsx to build the console
// routing tree. See apps/console/src/App.tsx.
export {
ConsoleShell,
ConnectedShell,
RequireOrganization,
RequireAiSurface,
AuthenticatedRoute,
SystemRedirect,
// objectui#2794 — the stable `/setup` deep link into platform administration,
// plus the pure policy behind it and the identifiers it resolves by.
SetupRedirect,
resolveSetupAppPath,
SETUP_APP_PACKAGE_ID,
SETUP_APP_NAME,
LoadingFallback,
} from './console/ConsoleShell.js';
// objectstack#36732 — what a host draws above the Setup app's first page (the
// console's first-run checklist, now that the desktop's home page retired).
export { SetupFirstPageSlotProvider, type SetupFirstPageSlot } from './console/setupFirstPageSlot.js';
// objectstack#36739 — what a host draws at the bottom of an app's sidebar (the
// console's 「Get started n/m」 pill), and after the app's menu on a phone.
export {
SidebarFooterSlotProvider,
type SidebarFooterSlot,
type SidebarFooterSlotPlace,
} from './layout/sidebarFooterSlot.js';
// objectstack#37150 — the shell sidebar's place for an app's docs navigation,
// drawn by the console's docs pages (the provider and the target are the
// shell's side, mounted by `ConsoleLayout` and `UnifiedSidebar`); and the page
// header's two shell slots (the top-right button group and the sidebar's
// expand button), for a docs page, which draws no `ConsolePageHeader`.
export {
SidebarDocsNav,
SidebarDocsNavSlotProvider,
SidebarDocsNavTarget,
useSidebarDocsNavSlot,
} from './layout/sidebarDocsNavSlot.js';
export { useShellPageActionsSlot, useShellSidebarExpandSlot } from './layout/shellPageActionsSlot.js';
// Host-app route policy (ADR-0048) — which app's `/apps/<segment>/…` URL a
// framework-owned, app-INDEPENDENT page should build, and the two predicates it
// is defined in terms of. Published from the package root (objectui#4280)
// because the resolution order in `resolveHostAppSegment`'s docblock is one
// hard-won definition, and a consumer that cannot import it re-derives it: the
// console shipped a documented copy of steps 1–2 for exactly this reason
// (objectui#4109 / PR #4279), which is the "two readers of one prose contract"
// shape #3367 / #3842 record. `./utils/appRoute` is the contract.
export { resolveHostAppSegment, appRouteSegment, filterActiveApps } from './utils/index.js';
// objectstack#35424 — the docs reader names the app it returns to (「← Back to
// APP」) the way the app bar does: the app its route segment addresses, by its
// served label.
export { matchAppBySegment } from './utils/index.js';
export { useServedAppLabel } from './hooks/useServedAppLabel.js';
// objectstack#32667 — which app OWNS a record of an object (the app a link to
// the record, or to a page about it, opens under), as opposed to which app
// hosts an app-independent page. `./utils/objectHostApp` is the contract.
export { objectHostAppSegment } from './utils/objectHostApp.js';
// objectstack#34586 — the history state the approvals inbox opens a request
// with, so its page steps the reader's pending queue and moves on after a decision.
export { approvalQueueState } from './views/approval-decision/approvalQueueAdvance.js';
// Which apps are the platform's own code-loaded built-ins (`com.objectstack.*`),
// one criterion for the AI switcher and the console's first-run checklist.
export { isPlatformBuiltinApp } from './utils/platformApp.js';
// objectstack#29750 — the inbox's notification-link resolver, and the table of
// console routes served outside an app. The console's native-shell navigate
// listener and its unmatched-route guard host an app-relative push route
// through the SAME resolver every inbox door uses, so a push tap and the inbox
// row open the same screen; re-deriving either here would be a second reader
// of one contract.
export { resolveNotificationTarget } from './utils/index.js';
export type { NotificationTarget } from './utils/index.js';
export { CONSOLE_ROOT_SEGMENTS } from './utils/hostInConsolePath.js';
// objectui#5178 — the Approval Center's timeline reads the same `via_override`
// verdict the record page's approval panel does.
export {
isOverrideDecision,
isViaOverrideRow,
} from './utils/index.js';
// objectui#7256 — "where is home". `apps/console`'s `/` redirect layers its
// emptiness heuristic on top of the SAME declaration reader the chrome's Home
// affordances use, so the post-login landing and the top-bar logo cannot name
// two different homes.
export { HOME_LAUNCHER_PATH, resolveDeclaredHomePath, resolveDesktopHomePath } from './utils/index.js';
// `a810bb2ae` — ONE read of the ADR-0112 failure envelope, published so a
// consumer OUTSIDE this package inherits the pinned rule instead of writing a
// fourth reading of the same body. `apps/console`'s agent-key generator read
// `error.message` and stopped, so a producer-marked `error.userMessage` (the
// objectstack `79c46da90` channel, which rides through the 5xx prose withhold
// untouched) and the declared `error.code` never reached the developer.
//
// The card behind `36fc74629` left this off the public entry as SCOPE RESTRAINT —
// that card's file surface was `packages/app-shell/**` — not as a ruling that the
// function should stay private, as the card behind `a810bb2ae` records. Exported from its
// own module rather than through `./utils/index.js`: the rule and its docblock
// are the contract, and `apiErrorEnvelope.ts` imports nothing, so this adds no
// module side effect and no transitive surface. The return type is `string |
// null`, so no type accompanies it.
export { readEnvelopeFailureText } from './utils/apiErrorEnvelope.js';
// Runtime AI-availability signal — the single source of truth every AI entry
// point gates on (FAB, /ai routes, designer "Ask AI"). Server-pushed, no
// build-time edition flag. See ./hooks/useAiSurface.
export { useAiSurfaceEnabled } from './hooks/useAiSurface.js';
// The sign-in page saves a language picked there as the person's own when
// they have none, before it navigates away (objectstack#30399). The pick is
// this module's page-load memory, so the sign-in host asks it here.
export { hasSignInLanguagePick, saveSignInLanguagePick } from './hooks/useUserLocale.js';
export type { SignInLanguagePickWriter } from './hooks/useUserLocale.js';
// Layout chrome
export {
ConsoleLayout,
ConsoleNotificationBanners,
AppHeader,
UnifiedSidebar,
AppSwitcher,
ConnectionStatus,
ActivityFeed,
LocaleSwitcher,
ModeToggle,
PreviewBadge,
AuthPageLayout,
// The console page header — icon chip, title, secondary line, actions —
// that object lists and dashboards draw, for console pages outside this
// package (objectui#12526). Named so it cannot be mistaken for
// `@object-ui/layout`'s `PageHeader`, a different component.
ConsolePageHeader,
} from './layout/index.js';
export type { ActivityItem, ConsolePageHeaderProps } from './layout/index.js';
// Top-level chrome (dialogs, providers, error boundaries)
export {
CommandPalette,
KeyboardShortcutsDialog,
OnboardingWalkthrough,
ConditionalAuthWrapper,
ConsoleToaster,
presentNotificationToast,
RouteFader,
RedirectWithSplash,
ErrorBoundary,
LoadingScreen,
ThemeProvider,
useTheme,
} from './chrome/index.js';
// Unsaved edits (objectui#13231): a console page outside this package registers
// the edits it holds, and every shell departure asks before dropping them.
export { useRegisterUnsavedEdits, confirmUnsavedLeave } from './chrome/unsavedEdits.js';
// Observability — Sentry integration, configured by the runtime on
// `/api/v1/runtime/config` (objectstack#12681). No build-time DSN.
export { initSentry, captureError, setSentryUser, getSentry } from './observability/index.js';
// Runtime configuration pushed by the server at boot. Consumers fetch
// `/api/v1/runtime/config` via `initRuntimeConfig()` before first render
// and read upstream cloud URL + capability flags from `getRuntimeConfig()`.
export {
initRuntimeConfig,
getRuntimeConfig,
getProductName,
getProductShortName,
// The Community-default reading behind the sign-in page's "Powered by
// ObjectStack" mark: true until a runtime pushes its own `productName`.
isDefaultProductName,
getPlatformStage,
getLogoUrl,
getFaviconUrl,
getPwaDescription,
getPwaThemeColor,
// The fail-closed reading of the runtime's client error-reporting sink.
// Exported so no consumer has to write its own `?.` chain against the
// payload — one loose truthiness dialect is all it takes to re-open
// objectui#5522. (Replaces `isClientErrorReportingAllowed`, removed with the
// permission boolean it read — objectstack#12681.)
getClientErrorReporting,
// `resetRuntimeConfigForTesting` is test-only and stays off the barrel
// (objectui#13453); tests import it from `runtime-config` directly.
} from './runtime-config.js';
export type {
AppShellRuntimeConfig,
RuntimeBranding,
RuntimeTelemetry,
RuntimeClientErrorReporting,
PlatformStage,
} from './runtime-config.js';
// Standard inner-SPA views
export {
ObjectView,
RecordDetailView,
RecordFormPage,
DashboardView,
PageView,
ReportView,
SearchResultsPage,
ViewConfigPanel,
DeclaredActionsBar,
FlowRunner,
} from './views/index.js';
export type {
ConsoleObjectViewProps,
FlowRunnerProps,
ScreenFlowState,
ScreenSpec,
ScreenFieldSpec,
} from './views/index.js';
// The list's URL state stays behind when the session ends: the Console's
// signed-out guard composes the sign-in page's return link without it.
export { withoutListStateParams } from './views/userFilterUrlState.js';
// Hooks
export {
useFavorites,
useMetadataService,
useNavActionDispatch,
useNavPins,
useNavigationSync,
useResponsiveSidebar,
useActionModal,
useHomePath,
LauncherAppsProvider,
useLauncherApps,
useServedApps,
} from './hooks/index.js';
export type { FavoriteItem, LauncherApps, LauncherAppsProviderProps } from './hooks/index.js';
// Context providers
export {
NavigationProvider,
useNavigationContext,
FavoritesProvider,
RecentItemsProvider,
CommandPaletteProvider,
useCommandPalette,
UserStateAdaptersProvider,
useUserStateAdapter,
useAttachUserStateAdapters,
} from './context/index.js';
export type { UserDataAdapter, UserStateKind } from './context/index.js';
// objectstack#35881 — the person's last app and the phone breakpoint: the
// console's `/` landing reads both on a phone.
export { useLastApp } from './context/LastAppProvider.js';
export { usePhoneViewport } from './hooks/usePhoneViewport.js';
// Default page implementations (consumers can partial-override slots)
export { AppContent as DefaultAppContent } from './console/AppContent.js';
export { MarketplacePage } from './console/marketplace/MarketplacePage.js';
export { MarketplacePackagePage } from './console/marketplace/MarketplacePackagePage.js';
export { LoginPage as DefaultLoginPage } from './console/auth/LoginPage.js';
export { signInRefusalMessages } from './console/auth/signInRefusalMessages.js';
export { RegisterPage as DefaultRegisterPage } from './console/auth/RegisterPage.js';
export {
signUpCaptchaFailedMessage,
signUpRefusalMessages,
type SignUpRefusalInvitation,
} from './console/auth/signUpRefusalMessages.js';
// The sign-up decision the default login/register pages above and the
// console's own pages share — one rule, read off `disableSignUp` AND
// `features.audiencePosture` (objectui#11691, objectui#11705).
export {
decideSignUpOffer,
needsBootstrapProbe,
needsOwnerProbe,
isInvitationRedirect,
type SignUpOffer,
} from './console/auth/signUpOffer.js';
export {
useBootstrapProbe,
useBootstrapStatus,
type BootstrapProbe,
type BootstrapStatus,
} from './console/auth/bootstrapStatus.js';
// The register-first prompt both login pages show a signed-out visitor who
// arrived from an invitation link (#25886), and the signed-out invitation
// preview both login and both register pages greet that visitor with (#26473),
// or answer with the "no longer valid" notice when the server no longer knows
// the invitation (#27509), and the plain login's hint to open the link.
export {
InvitationSignUpPrompt,
InvitationGoneNotice,
InvitationLinkHint,
invitationArrivalCopy,
invitationIdOf,
useInvitationArrival,
useInvitationPreview,
type InvitationArrival,
} from './console/auth/invitationArrival.js';
// Registering from an invitation link accepts that invitation and enters its
// organization, on both register pages (#30125).
export { useInvitationSignUpJoin, type InvitationSignUpJoin } from './console/auth/invitationSignUpJoin.js';
export { ForgotPasswordPage as DefaultForgotPasswordPage } from './console/auth/ForgotPasswordPage.js';
export { HomeLayout as DefaultHomeLayout, HomeLayout } from './console/home/HomeLayout.js';
// objectstack#37197 — the docs portal's frame: the app-less shell from 768 px up.
export { DocsPortalShell } from './console/docs/DocsPortalShell.js';
export type { DocsPortalShellProps } from './console/docs/DocsPortalShell.js';
export { HomePage as DefaultHomePage, HomePage } from './console/home/HomePage.js';
// Whether the signed-in person has connected an AI assistant (or holds a
// working API key), and where Connect an AI Assistant opens: the one read and
// the one path the Connect page, Home's card and the first-run checklist share
// (#30898, #30895).
export {
useConnectedAccess,
type ConnectedAccess,
type ConnectedEntry,
} from './console/connect/connectedAccess.js';
export { connectAssistantPath } from './console/connect/connectAssistantPath.js';
// Which Home card draws an item that more than one could (email not set up,
// connect an AI assistant), so the console's first-run checklist and this
// package's Home cards say each one once (#32021).
export { useHomeItemClaim, useHomeItemClaimed, type HomeItem } from './console/home/homeItemClaims.js';
// The frame the lazy `developer` i18n namespace's readers render under
// (#32225): the console's Developer pages wrap their bodies in it.
export { DeveloperNamespaceGate } from './console/connect/DeveloperNamespaceGate.js';
export { OrganizationsLayout as DefaultOrganizationsLayout } from './console/organizations/OrganizationsLayout.js';
export { OrganizationsPage as DefaultOrganizationsPage } from './console/organizations/OrganizationsPage.js';
export { OrganizationLayout as DefaultOrganizationLayout } from './console/organizations/manage/OrganizationLayout.js';
export { MembersPage as DefaultMembersPage } from './console/organizations/manage/MembersPage.js';
export { InvitationsPage as DefaultInvitationsPage } from './console/organizations/manage/InvitationsPage.js';
export { SettingsPage as DefaultSettingsPage } from './console/organizations/manage/SettingsPage.js';
export { AcceptInvitationPage as DefaultAcceptInvitationPage } from './console/organizations/manage/AcceptInvitationPage.js';
export {
AiChatPage as DefaultAiChatPage,
AiChatPage,
hydratedMessagesToChatMessages,
} from './console/ai/AiChatPage.js';
export { ConversationsSidebar } from './console/ai/ConversationsSidebar.js';
// objectstack#34608 — the AI assistant is one right-side drawer: the old
// `/ai…` addresses route here to open it, and pages open it through the handle.
export { AiAddressRedirect } from './console/ai/AiAddressRedirect.js';
export {
ChatDockControlProvider,
useChatDockControl,
useOpenAssistant,
type ChatDockControl,
} from './layout/chatDockControl.js';
export type { ChatDockTarget } from './layout/chatDockTarget.js';
// objectstack#36999 — the one setter every entry point pins a record through
// (the page chip's pin, the record drawer, the `ask_ai` action); chat-free.
export { setChatFocus, type ChatFocus } from './layout/chatFocus.js';
// Conversation-history hydration helpers — reused by the public read-only
// share page (`/s/:token`) so a shared transcript renders identically to the
// live chat (tool cards included) instead of dumping raw envelopes.
export {
toUIMessages,
aiMessageRowsToServerMessages,
type RawAiMessageRow,
} from './hooks/useChatConversation.js';
// Phase 3b: Component nav registry — plugins use this to register
// admin/setup UI surfaces that are addressable from App metadata via
// `{ type: 'component', componentRef: 'ns:name' }` nav items.
export {
registerAppComponent,
getAppComponent,
componentRefToUrlSegments,
} from './services/componentRegistry.js';
// Side-effect import: registers built-in admin components
// (metadata:directory, metadata:resource) at module load.
import './services/builtinComponents.js';
// SDUI widget for the metadata-driven Cloud Connection page (cloud ADR-0008).
import './console/cloud-connection/CloudConnectionPanel.js';
import './console/connect/ConnectAgentWidget.js';
import './console/connect/ManagedPersonAssistants.js';
import './console/security/UserEffectiveAccess.js';
// Generic product-page blocks — hero, stat, usage-bar, checklist, tile-grid
// (objectui#12197), and row-table (#31856).
import './console/blocks/productBlocks.js';
// SDUI widget for the Cloud welcome page's seeded workspace-timezone line (objectui#11930).
import './console/home/CloudWorkspaceTimezoneNotice.js';
// SDUI widget: read-only admin diagnostic for the env's effective AI model
// (cloud#797) — fetches GET /api/v1/ai/effective-model.
import './console/diagnostics/CloudAiModelStatus.js';
// `record:attachments` — schema-addressable Attachments panel referenced by
// synthesized record pages when `enable.files: true` (objectstack#4358).
import './views/record-attachments-renderer.js';
// `record:approvals` — schema-addressable approval panel referenced by
// synthesized record pages when the record has approval requests (#3461).
import './views/record-approvals-renderer.js';
// `record:approval_decision` — an approval request page's decision panel, the
// third record block `@objectstack/spec` 18 declares (objectui#12342).
import './views/record-approval-decision-renderer.js';
// A2's record card as the details grid's face for a `referenceVia` pointer
// pair, registered under `@object-ui/fields`' `RECORD_POINTER_CARD_TYPE`
// (objectui#12045).
import './views/record-preview/record-pointer-card-renderer.js';
// The faces of `@object-ui/fields`' widget-hinted reference keys,
// `object-ref` and `recipient-picker`, loaded lazily on the first cell that
// draws one (objectui#12613).
import './views/widget-ref-cells/widget-ref-cell-renderers.js';
// `global:search` / `global:notifications` — the two spec `PageComponentType`
// members the 2026-08-26 ruling on objectstack#12183 kept declared because both
// data sources shipped (`f99932a42`). Registered here, not in
// `@object-ui/components`, because they read this package's providers and feeds;
// without these two imports an authored page draws the "Component Placeholder"
// scaffold for `global:search` and a red unknown-type panel for
// `global:notifications`.
import './views/global-search-renderer.js';
import './views/global-notifications-renderer.js';
// `app:launcher` / `nav:menu` — Phase 1 of that same 2026-08-26 ruling
// (`969ba84f4`): the two `PageComponentType` members that are purely
// metadata-driven, so nothing had to ship before their renderers could.
// Registered here, not in `@object-ui/components`, because they read this
// package's providers (the metadata app registry, the expression / permission /
// capability guards) and `@object-ui/components` depends on neither
// `@object-ui/layout`, `@object-ui/permissions` nor `react-router-dom`. Without
// these two imports an authored page draws the "Component Placeholder" scaffold
// for `nav:menu` and a red unknown-type panel for `app:launcher` (which, unlike
// `nav:menu`, is not in the eager `PALETTE_PLACEHOLDER_BLOCKS` set).
import './views/app-launcher-renderer.js';
import './views/nav-menu-renderer.js';
// The metadata-admin engine's three eager load-time registrations (built-in
// anchors, default JSONSchemas, the datasource resource). objectui#6776 moved
// them OUT of `views/metadata-admin/index.ts` into this leaf so the page barrel
// became shakeable; the bare import lives HERE, on the package entry, and must
// not be moved onto the page barrel — `scripts/vite-declared-lazy-views.ts`
// reads a bare import as "this module is not pure" and the whole eager closure
// comes back. See the leaf's own header.
import './views/metadata-admin/register-builtins.js';
import { deferBuiltinDesigners } from './views/metadata-admin/builtin-designers-loader.js';
// The built-in metadata DESIGNERS (every Preview and Inspector) are registered
// from a chunk of their own, so importing the package still registers them with
// no action from the host — once the chunk has arrived rather than during this
// module's evaluation (objectui#11939 step 2). Their three registries are
// observable (step 1), so a reader that rendered first shows its "designer
// missing" state and then the designer. A host's own registration is kept
// whichever comes first: see `registerAsBuiltIns` in
// `views/metadata-admin/preview-registry.ts`.
//
// The entry hands the loader to the registries instead of running it here, and
// the first read of a designer registry runs it (objectui#12187). Run here, it
// fetched every Preview and Inspector chunk, and the icons they draw, on every
// console page, before a plain page route's content and with nothing on that
// route reading a designer. See `views/metadata-admin/builtin-designers-loader.ts`.
//
// ⛔ Keep this edge DYNAMIC. A static import of that module, or of the
// previews/inspectors it registers, from anything this entry reaches statically
// puts every designer back on every console page's first load, and
// `scripts/check-eager-closure-budget.mjs` is sized on the bytes that left.
// ⛔ And keep it DEFERRED: calling the loader at this module's scope puts the
// same chunks back on every page load as dynamic requests, where that gate
// cannot see them.
deferBuiltinDesigners(() =>
import('./views/metadata-admin/register-builtin-designers.js')
.then(({ registerBuiltinDesigners }) => registerBuiltinDesigners())
.catch((error: unknown) => {
// The readers keep their "designer missing" states; say why once, here.
console.error('[@object-ui/app-shell] The built-in metadata designers failed to load.', error);
}),
);
// Phase 3c — generic metadata admin engine. Re-exported so plugins
// can call `registerMetadataResource()` to override the per-type
// list / edit / create components, and host apps can compose the
// page primitives directly when needed.
//
// ⚠️ These runtime re-exports name the LEAF modules, never
// `./views/metadata-admin/index.js` (objectui#6776). The names and their types
// are unchanged — an out-of-package consumer imports exactly what it imported
// before — but a named re-export is an ordinary STATIC EDGE, and the console's
// entry imports this barrel, so pointing them at the page barrel made that
// barrel (and every page, preview and inspector it reaches) eager on every
// console page load, past the six `lazy()` declarations `AppContent` writes for
// it. The 9 TYPE-ONLY re-exports below are erased at build and carry no edge;
// they are grouped separately for that reason and not because they are less
// public.
export { MetadataDirectoryPage } from './views/metadata-admin/DirectoryPage.js';
export { MetadataResourceRouter } from './views/metadata-admin/ResourceRouter.js';
export { MetadataResourceListPage } from './views/metadata-admin/ResourceListPage.js';
export { MetadataResourceEditPage } from './views/metadata-admin/ResourceEditPage.js';
export { MetadataResourceHistoryPage } from './views/item-tools/ResourceHistoryPage.js';
export { MetadataDiagnosticsPage } from './views/metadata-admin/DiagnosticsPage.js';
export { MetadataQuickFind } from './views/metadata-admin/QuickFind.js';
export { SchemaForm } from './views/metadata-admin/SchemaForm.js';
export { LayeredDiff } from './views/item-tools/LayeredDiff.js';
// objectui#7611 — the Setup catalog's URL scope (`?scope=environment`), for a
// host that routes its own legacy URLs onto the catalog (the console's
// `system/positions` / `system/permissions`). A dependency-free leaf.
export { ENVIRONMENT_SCOPE_QUERY } from './views/metadata-admin/catalog-scope.js';
export {
registerMetadataResource,
getMetadataResource,
resolveResourceConfig,
} from './views/metadata-admin/registry.js';
export {
useMetadataClient,
useGlobalDiagnostics,
} from './views/metadata-admin/useMetadata.js';
// objectui#11939 — the `useRegistered*` hooks are the render-time reads of the
// two designer registries: a component that reads through them re-renders when
// a designer is registered after its first render. `get*` / `list*` remain the
// reads for non-render code.
export {
registerMetadataPreview,
getMetadataPreview,
listMetadataPreviewTypes,
useRegisteredMetadataPreview,
useRegisteredMetadataPreviewTypes,
} from './views/metadata-admin/preview-registry.js';
export {
registerMetadataInspector,
getMetadataInspector,
listMetadataInspectorTypes,
useRegisteredMetadataInspector,
} from './views/metadata-admin/inspector-registry.js';
export type {
MetadataResourceConfig,
MetadataDomain,
} from './views/metadata-admin/registry.js';
export type { RichMetadataTypeEntry } from './views/metadata-admin/useMetadata.js';
export type {
MetadataPreview,
MetadataSelection,
} from './views/metadata-admin/preview-registry.js';
export type {
MetadataInspector,
} from './views/metadata-admin/inspector-registry.js';
// The form authoring surface, in ONE declaration per layer: the field
// (objectui#5040 / #5542) and the two containers above it (objectui#5596).
// `apps/console` renders the same authored `FormView` documents this package's
// metadata-admin does; before it could import these names it kept its own
// hand-written copies of all three shapes. See the note on the re-export in
// `views/metadata-admin/index.ts`.
export type {
FormFieldSpec,
FormSectionSpec,
FormViewSpec,
} from './views/metadata-admin/form-spec.js';
// Studio WYSIWYG design surface (ADR-0080) — the open-source design surface.
// The left AI copilot is an injected `aiSlot`; OSS renders three zones.
export {
StudioDesignSurface,
} from './views/studio-design/StudioDesignSurface.js';
// Per-type canvas renderers for the Studio design surface. Register an override
// (e.g. a custom `object` records surface) without forking StudioDesignSurface.
export {
registerStudioCanvasPreview,
} from './views/studio-design/studio-canvas-preview.js';
// The builder's front door: pick/create a writable package → pillar builder.
// Standalone at `/studio` and embedded via the `studio:builder` component ref.
export { BuilderLanding } from './views/studio-design/BuilderLanding.js';
// The one Studio scope that is not a package (objectui#11553): the
// organization's own package-less flows, listed at
// `/studio/~org/metadata/flow?source=runtime` (objectstack#36903; the old
// `/studio/~org/automations` redirects there). A host that declares the
// `/studio` routes reads the reserved segment from here.
export {
STUDIO_ORG_SCOPE_SEGMENT,
STUDIO_ORG_SCOPE_PILLAR,
studioOrgScopePath,
} from './views/studio-design/studioScope.js';
// Studio's "All metadata" area (objectstack ADR-0146 D1): per package beside
// the pillars, at `/studio/<package>/metadata/*`, and across packages at the
// reserved `/studio/~all/metadata/*`. A host that declares the `/studio` routes
// reads the segments from here, and mounts the cross-package leg's area.
export {
STUDIO_METADATA_AREA,
STUDIO_ALL_PACKAGES_SEGMENT,
studioMetadataAreaPath,
} from './views/studio-design/metadataArea.js';
export { StudioMetadataArea } from './views/studio-design/StudioMetadataArea.js';
// objectstack ADR-0146 D1 (N-28) — where a Setup metadata URL lands in that
// area (the datasource's stays in Setup). A host whose legacy aliases forward
// onto Setup's metadata routes lands them in one hop through this.
export { setupMetadataStudioPath } from './views/studio-design/setupMetadataRedirect.js';
// objectstack#36895 — the one builder of Studio addresses. A host that
// declares the `/studio` routes, or links into them, spells every address
// through these, never by hand (`studioAddress.guard.test.ts`).
export {
STUDIO_ROOT_PATH,
STUDIO_HOME_PILLAR,
studioLandingPath,
studioPackagePath,
} from './views/studio-design/studioAddress.js';
// AI assistant bus — connects the metadata designers to the global chat.
export {
assistantBus,
} from './assistant/assistantBus.js';
export type {
AssistantSnapshot,
} from './assistant/assistantBus.js';
export { RemediationOverlay } from './console/RemediationOverlay.js';