@almadar/shell-web 0.1.0 → 1.1.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 (131) hide show
  1. package/dist/{ArbitraryClassCompiler-Mzabq-UB.d.ts → ArbitraryClassCompiler-CO_iASBn.d.ts} +99 -4
  2. package/dist/AvlGlyph-PIXU6QH5.js +5 -0
  3. package/dist/AvlStateMachine-CKGMECMG.js +8 -0
  4. package/dist/AvlTransitionDetail-QZX6G5KJ.js +10 -0
  5. package/dist/AvlTransitionExplainer-26WLEIC6.js +11 -0
  6. package/dist/BehaviorView-JLZ4PKWY.js +10 -0
  7. package/dist/{EventBusProvider-CVwjkV_2.d.ts → EventBusProvider-BFFHfN4O.d.ts} +12 -0
  8. package/dist/{FileTree-BCFnBEuQ.d.ts → FileTree-B3GDAjaQ.d.ts} +131 -4
  9. package/dist/FlowCanvas-RPII4V24.js +23 -0
  10. package/dist/{BehaviorValueFrame-SSEMEBTG.css → FlowCanvas-VWUPMBKB.css} +189 -191
  11. package/dist/{GameAudioProvider-Cm9BnvmP.d.ts → GameAudioProvider-D7wo5ryN.d.ts} +5 -8
  12. package/dist/KernelEngineContext-CPeWQMAz.d.ts +46 -0
  13. package/dist/LayersPanel-M2LHWUFF.js +6 -0
  14. package/dist/ModuleCard-NJD6JQGD.js +6 -0
  15. package/dist/OrbInspector-OWWKPOBF.js +23 -0
  16. package/dist/{TraitValueFrame-4G3KOUBR.css → OrbInspector-VMTMZHNQ.css} +189 -191
  17. package/dist/{Select-mDZIwNqN.d.ts → Select-C2Uq6t86.d.ts} +17 -31
  18. package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
  19. package/dist/{FlowCanvas-3JRMNJLV.css → UISlotRenderer-BIS6KT7T.css} +189 -191
  20. package/dist/UISlotRenderer-PY7FIJXN.js +23 -0
  21. package/dist/auth/browser/index.js +1 -0
  22. package/dist/auth/react/index.d.ts +8 -1
  23. package/dist/auth/react/index.js +40 -2
  24. package/dist/avl/index.css +189 -191
  25. package/dist/avl/index.d.ts +107 -85
  26. package/dist/avl/index.js +170 -39
  27. package/dist/{chunk-P4LNHAFI.js → chunk-2WGR4TDJ.js} +465 -36
  28. package/dist/{chunk-GKIFONTE.js → chunk-3S54FWRC.js} +2 -2
  29. package/dist/{chunk-KVQS4GXU.js → chunk-4YJ53G7S.js} +18 -8
  30. package/dist/{chunk-MBQAMMSE.js → chunk-4YXBKHHM.js} +269 -658
  31. package/dist/{chunk-YDNJLLG6.js → chunk-57DC34LY.js} +19 -10
  32. package/dist/{chunk-FP3WIKTC.js → chunk-7N6ZPHQ5.js} +9 -1
  33. package/dist/{chunk-AILY3XPS.js → chunk-AE7VCQB6.js} +5 -6
  34. package/dist/{chunk-L677XGY3.js → chunk-AGVSO4WY.js} +4 -5
  35. package/dist/{chunk-FAJDTHWC.js → chunk-AGXD77SL.js} +2 -2
  36. package/dist/chunk-AU7O65OX.js +66 -0
  37. package/dist/{chunk-DFNZUYX4.js → chunk-FAKU5F62.js} +273 -29
  38. package/dist/{chunk-U6QRZASX.js → chunk-ILQXJ2AR.js} +1 -1
  39. package/dist/chunk-M74BCDBQ.js +490 -0
  40. package/dist/{chunk-GYTPOFVC.js → chunk-MS4K3K2R.js} +12095 -13329
  41. package/dist/{chunk-SGM3FASH.js → chunk-OWNG4JZI.js} +13 -12
  42. package/dist/{chunk-VFF5OO47.js → chunk-PCR37T3U.js} +15 -38
  43. package/dist/{chunk-SJGJJKBY.js → chunk-PRLHKBXG.js} +5 -3
  44. package/dist/{chunk-R5O5AUPI.js → chunk-PRXQGGCO.js} +93 -86
  45. package/dist/{chunk-42FY4RYA.js → chunk-REXYVBUO.js} +2 -2
  46. package/dist/{chunk-EQAMU2ZC.js → chunk-UTDC2NEA.js} +1 -1
  47. package/dist/{chunk-73SRAB4P.js → chunk-UU57VNS2.js} +2 -2
  48. package/dist/{chunk-TESBIVUA.js → chunk-VHC2M26B.js} +2 -2
  49. package/dist/{chunk-L2DEKY4J.js → chunk-VO2TTLS5.js} +3 -6
  50. package/dist/{chunk-2PY54Z44.js → chunk-VUIACGDU.js} +4 -5
  51. package/dist/{chunk-DLZF4PVE.js → chunk-YYIHRIDH.js} +3 -3
  52. package/dist/{chunk-DYEKAA4L.js → chunk-ZDRDJKYB.js} +243 -252
  53. package/dist/components/index.css +189 -191
  54. package/dist/components/index.d.ts +739 -289
  55. package/dist/components/index.js +25 -28
  56. package/dist/context/index.d.ts +2 -3
  57. package/dist/context/index.js +4 -3
  58. package/dist/core.d.ts +95 -19
  59. package/dist/core.js +2 -1
  60. package/dist/design-classes/index.cjs +3 -1
  61. package/dist/design-classes/index.js +3 -1
  62. package/dist/{fx-CmQjnHmT.d.ts → fx-Br8zjvu9.d.ts} +6 -6
  63. package/dist/hooks/index.d.ts +40 -5
  64. package/dist/hooks/index.js +5 -4
  65. package/dist/index.d.ts +40 -114
  66. package/dist/index.js +174 -34
  67. package/dist/kernel-client-JW6OH5FX.js +537 -0
  68. package/dist/kernel-wire-DGAySGhX.d.ts +95 -0
  69. package/dist/lib/index.d.ts +3 -4
  70. package/dist/lib/index.js +4 -4
  71. package/dist/{prism-AIWGN2X5.js → prism-X5YWKXO5.js} +5 -3
  72. package/dist/providers/index.css +189 -191
  73. package/dist/providers/index.d.ts +41 -28
  74. package/dist/providers/index.js +19 -24
  75. package/dist/renderer/index.d.ts +0 -2
  76. package/dist/renderer/index.js +1 -0
  77. package/dist/runtime/index.css +189 -191
  78. package/dist/runtime/index.d.ts +57 -253
  79. package/dist/runtime/index.js +18 -24
  80. package/dist/ssr/index.cjs +2643 -535
  81. package/dist/ssr/index.d.cts +0 -23
  82. package/dist/ssr/index.d.ts +0 -23
  83. package/dist/ssr/index.js +2639 -535
  84. package/dist/storage/browser/index.js +1 -0
  85. package/dist/test-support.d.ts +15 -8
  86. package/dist/test-support.js +91 -24
  87. package/dist/{paintDispatch-ChW5mVuK.d.ts → verificationRegistry-oopV1J1n.d.ts} +132 -30
  88. package/package.json +14 -38
  89. package/src/core/lib/band-shapes.json +7 -0
  90. package/src/core/locales/ar.json +18 -5
  91. package/src/core/locales/en.json +18 -5
  92. package/src/core/locales/sl.json +18 -5
  93. package/tailwind-preset.cjs +30 -1
  94. package/dist/AvlGlyph-JKJOAH23.js +0 -6
  95. package/dist/AvlStateMachine-PI4YGREK.js +0 -8
  96. package/dist/AvlTransitionDetail-ZH7V24UG.js +0 -12
  97. package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +0 -13
  98. package/dist/BehaviorValueFrame-6RUJXT4A.js +0 -29
  99. package/dist/BehaviorView-RFEE5J6E.js +0 -10
  100. package/dist/Canvas3DHost-_Y-5uLM_.d.ts +0 -552
  101. package/dist/FlowCanvas-STDC4OWK.js +0 -27
  102. package/dist/KernelEngineContext-BOCQoFwk.d.ts +0 -43
  103. package/dist/LayersPanel-BBQ54IVG.js +0 -7
  104. package/dist/ModuleCard-3TT2X7IW.js +0 -7
  105. package/dist/OrbInspector-K6T6O7GI.js +0 -27
  106. package/dist/OrbInspector-MHLJ6OEE.css +0 -1756
  107. package/dist/ServerBridge-Cm1On51b.d.ts +0 -233
  108. package/dist/TraitValueFrame-2PJGLLVI.js +0 -28
  109. package/dist/UISlotRenderer-JKFSX24W.js +0 -27
  110. package/dist/UISlotRenderer-KVFO6J7R.css +0 -1756
  111. package/dist/UserContext-DqWeZkUZ.d.ts +0 -100
  112. package/dist/avl-3d-context-BIRKWpaL.d.ts +0 -204
  113. package/dist/avl-schema-parser-CtJxJ9KU.d.ts +0 -132
  114. package/dist/avl-zoom-state-CKMVuBFg.d.ts +0 -17
  115. package/dist/chunk-2QOH2HWM.js +0 -95
  116. package/dist/chunk-6P3MWXYE.js +0 -440
  117. package/dist/chunk-B4BU77LT.js +0 -432
  118. package/dist/chunk-DJ433ET5.js +0 -1327
  119. package/dist/chunk-DZ42OJQC.js +0 -176
  120. package/dist/chunk-EOWMARUB.js +0 -16
  121. package/dist/chunk-FIW6WN23.js +0 -508
  122. package/dist/chunk-GAR5TQ5B.js +0 -199
  123. package/dist/chunk-PC7K4SK7.js +0 -1384
  124. package/dist/chunk-ZO6MXAS3.js +0 -69
  125. package/dist/kernel-client-ZH4PSMCN.js +0 -367
  126. package/dist/kernel-wire-B4S8pnP3.d.ts +0 -65
  127. package/dist/three/index.css +0 -503
  128. package/dist/three/index.d.ts +0 -1185
  129. package/dist/three/index.js +0 -3896
  130. package/dist/useKeyboardRouter-Dsq553Ur.d.ts +0 -42
  131. package/dist/verificationRegistry-CabxhfTv.d.ts +0 -122
@@ -1,40 +1,55 @@
1
- import { EventPayload, OrbitalDefinition, SchemaMetadata, PersistenceAdapter, ServiceParams, UserContext, ResolvedTraitBinding, ResolvedPage, ResolvedEntity, ResolvedTrait, ResolvedIR, OrbitalSchema, PatternConfig, ResolvedPatternProps, EventSource, SExpr, EntityData, ViewerAuthority, TraitValue, TraitValueMountResult, BehaviorRef, BehaviorValueMountResult } from '@almadar/core';
2
- export { ResolvedEntity, ResolvedIR, ResolvedPage, ResolvedTrait, ResolvedTraitBinding } from '@almadar/core';
1
+ import { OrbitalSchema, EventPayload, OrbitalDefinition, SchemaMetadata, PersistenceAdapter, ServiceParams, PatternConfig, ResolvedPatternProps, EventSource, SExpr, EntityData, ViewerAuthority } from '@almadar/core';
3
2
  import { TraitState } from '@almadar/shell-runtime/client/trait-types';
4
3
  import { EventTransport, AccessTokenProvider } from '@almadar/shell-runtime/client/EventTransport';
5
4
  export { AccessTokenProvider } from '@almadar/shell-runtime/client/EventTransport';
6
5
  import '../verification-C5pTeMJv.js';
7
- import { S as ServerBridgeTransport } from '../ServerBridge-Cm1On51b.js';
6
+ import { S as ServerBridgeTransport } from '../ServerBridge-Bqsj-lOU.js';
8
7
  import { EntityBindingSource, AwaitingSkeletonSource } from '../providers/index.js';
9
- export { a as EntitySchemaContextValue, b as EntitySchemaProvider, c as EntitySchemaProviderProps, d as ServerBridgeContextValue, e as ServerBridgeProvider, T as TraitContext, f as TraitContextValue, g as TraitInstance, h as TraitProvider, i as TraitProviderProps, u as useEntitySchema, j as useEntitySchemaOptional, k as useServerBridge, l as useTrait, m as useTraitContext } from '../ServerBridge-Cm1On51b.js';
8
+ export { a as EntitySchemaContextValue, b as EntitySchemaProvider, c as EntitySchemaProviderProps, d as ServerBridgeContextValue, e as ServerBridgeProvider, u as useEntitySchema, f as useEntitySchemaOptional, g as useServerBridge } from '../ServerBridge-Bqsj-lOU.js';
10
9
  import { useUISlots } from '../context/index.js';
10
+ import { PageCircuit } from '@almadar/core/kernel-wire';
11
11
  export { w as wrapCallbackForEvent } from '../wrapCallbackForEvent-B9QLbhxX.js';
12
12
  export { a as PERF_NAMESPACE, P as PerfEntry, c as clearPerf, p as perfEnd, b as perfStart, d as perfTime } from '../perf-Dr28-AgT.js';
13
- import React__default, { ReactNode } from 'react';
14
- import { UserData } from '../context/index.js';
15
- import { SchemaLoader } from '@almadar/shell-runtime/kernel/wire';
16
- import { KernelLoader, LanguageLoader, SeedProgramLoader } from '../providers/index.js';
17
- import { KeyCaptureTable } from '../components/index.js';
13
+ import { HostSignInRequest, HostSignInAnswer, HostConsentRequest, HostConsentAnswer } from '@almadar/shell-runtime/kernel/host';
14
+ import React__default from 'react';
15
+ import { SchemaLoader } from '@almadar/shell-runtime';
16
+ import { KernelLoader } from '../providers/index.js';
17
+ import { KernelCanvas3DFactory, KernelSceneCanvasFactory } from '@almadar/shell-runtime/kernel/wire';
18
18
  export { S as SlotHostManifest, a as SlotHostRegion, b as assertUniqueSlotsPerHost } from '../slot-host-CPzrxLo9.js';
19
19
  export { p as profilerOnRender, u as usePerfBuffer } from '../perf-CKiBKbkw.js';
20
20
  import '../useUISlots-CiobNFGb.js';
21
21
  import '@almadar/core/patterns';
22
+ import '@almadar/shell-browser/kv';
23
+
24
+ /** A program's type-contract stamp: the kernel refuses to register a program carrying neither field. */
25
+ type ProgramStamp = Pick<OrbitalSchema, 'resolved' | 'typeContractVersion' | 'theme' | 'themes' | 'locales' | 'messages'>;
26
+ /** The kernel's answer for the page: nothing mounts until it is ready. */
27
+ type CircuitState = {
28
+ status: 'pending';
29
+ } | {
30
+ status: 'ready';
31
+ page: PageCircuit;
32
+ } | {
33
+ status: 'failed';
34
+ error: Error;
35
+ };
22
36
 
23
37
  interface TraitStateMachineResult {
24
38
  /** Current state for each trait. */
25
39
  traitStates: Map<string, TraitState>;
26
- /** Send an event — broadcasts to every currently-mounted trait that can
27
- * handle it, decomposed into one targeted `kernel.dispatch` per trait
28
- * (the client role requires exactly one seed trait per call). */
29
- sendEvent: (eventKey: string, payload?: EventPayload) => void;
30
40
  getTraitState: (traitName: string) => TraitState | undefined;
31
- canHandleEvent: (traitName: string, eventKey: string) => boolean;
32
41
  /** Live per-trait binding surface for `EntityBindingContext`. */
33
42
  entityBindingSource: EntityBindingSource;
34
43
  /** Awaiting-server skeletons for `AwaitingSkeletonContext`. */
35
44
  awaitingSkeletonSource: AwaitingSkeletonSource;
45
+ /** The kernel's answer for the page: pending until it answers, failed when it cannot. Nothing mounts before it is ready. */
46
+ circuit: CircuitState;
47
+ /** The theme key the server bound to this session with `theme/set`; `undefined` when none is and the declared themes apply. */
48
+ sessionTheme: string | undefined;
36
49
  }
37
50
  interface UseTraitStateMachineOptions {
51
+ /** The page the kernel answers the circuit of; absent: the initial page (or the page of `routePath`). */
52
+ page?: string;
38
53
  onEventProcessed?: (eventKey: string, payload?: EventPayload) => void;
39
54
  navigate?: (path: string, params?: Record<string, string>, crumb?: string) => void;
40
55
  navigateBack?: () => void;
@@ -43,10 +58,12 @@ interface UseTraitStateMachineOptions {
43
58
  mountKey?: string;
44
59
  /** The route the page is opened at; the kernel's mounts for it are what the hook runs (EXEC-ENDPOINT-3). */
45
60
  routePath?: string;
46
- /** The resolved schema's full orbital set — `buildTraitIndex`'s one input. */
61
+ /** The program's orbitals: the kernel is built from them. */
47
62
  orbitals: readonly OrbitalDefinition[];
48
63
  /** The program's `_metadata` (a compiled client program's operator sites and dispatch facts), handed to the kernel. */
49
64
  metadata?: SchemaMetadata;
65
+ /** The program's type-contract stamp, carried into the browser kernel's registration. */
66
+ stamp?: ProgramStamp;
50
67
  /** Caller-owned transport (server bridge). Omitted + `persistence` set =
51
68
  * offline preview (plan G7); omitted + no `persistence` = fully local,
52
69
  * nothing ever posts. */
@@ -58,64 +75,13 @@ interface UseTraitStateMachineOptions {
58
75
  /** The browser store for `[persistent: x, browser]` entities (see `useCircuitKernel`). */
59
76
  browserStore?: PersistenceAdapter;
60
77
  callService?: (service: string, action: string, params?: ServiceParams) => Promise<EventPayload>;
61
- embeddedTraits?: ReadonlySet<string>;
62
- callsiteCaptureChildrenByTrait?: ReadonlyMap<string, ReadonlySet<string>>;
63
78
  debug?: boolean;
64
79
  logContext?: {
65
80
  behavior?: string;
66
81
  orbitalName?: string;
67
82
  };
68
- /** Explicit viewer override (e.g. a persona switcher's picked identity
69
- * threaded down as a prop rather than through `UserContext`). Wins over
70
- * `useUser()`'s context value when supplied. */
71
- user?: UserContext;
72
- }
73
- declare function useTraitStateMachine(traitBindings: ResolvedTraitBinding[], uiSlots: ReturnType<typeof useUISlots>, options: UseTraitStateMachineOptions): TraitStateMachineResult;
74
-
75
- /**
76
- * useResolvedSchema Hook
77
- *
78
- * Resolves OrbitalSchema to IR for the OrbitalRuntime.
79
- * Uses the shared resolver to ensure consistency with the compiler.
80
- *
81
- * TRAIT-DRIVEN ARCHITECTURE:
82
- * - Pages have traits, NOT sections
83
- * - UI is produced by trait effects (render_ui)
84
- * - No backwards compatibility with legacy formats
85
- *
86
- * @packageDocumentation
87
- */
88
-
89
- interface ResolvedSchemaResult {
90
- /** The resolved page (or undefined if not found) */
91
- page: ResolvedPage | undefined;
92
- /** Trait bindings for this page */
93
- traits: ResolvedTraitBinding[];
94
- /** Entities used by this page */
95
- entities: Map<string, ResolvedEntity>;
96
- /** All entities from schema */
97
- allEntities: Map<string, ResolvedEntity>;
98
- /** All resolved traits */
99
- allTraits: Map<string, ResolvedTrait>;
100
- /** Loading state */
101
- loading: boolean;
102
- /** Error message if resolution failed */
103
- error: string | null;
104
- /** Full IR (for debugging) */
105
- ir: ResolvedIR | null;
106
83
  }
107
- /**
108
- * Hook to resolve an OrbitalSchema to IR.
109
- *
110
- * @param schema - The OrbitalSchema to resolve
111
- * @param pageName - Optional page name (defaults to first page or initial page)
112
- * @returns Resolved schema data including page, traits, and entities
113
- */
114
- declare function useResolvedSchema(schema: OrbitalSchema | null | undefined, pageName?: string): ResolvedSchemaResult;
115
- /**
116
- * Clear the schema resolution cache
117
- */
118
- declare function clearSchemaCache(): void;
84
+ declare function useTraitStateMachine(uiSlots: ReturnType<typeof useUISlots>, options: UseTraitStateMachineOptions): TraitStateMachineResult;
119
85
 
120
86
  /**
121
87
  * One pattern within a slot's accumulated render-ui set, plus any
@@ -139,23 +105,8 @@ interface SlotSource extends EventSource {
139
105
  state: string;
140
106
  transition: string;
141
107
  effects: SExpr[];
142
- traitDefinition: ResolvedTrait;
143
108
  }
144
109
 
145
- /**
146
- * OrbPreview Component
147
- *
148
- * Renders a live preview of an Orbital schema (.orb program).
149
- * Uses static imports (no lazy loading) to ensure all providers,
150
- * hooks, and components share the same module instances.
151
- *
152
- * Usage:
153
- * <OrbPreview schema={orbJsonStringOrObject} />
154
- * <OrbPreview schema={schema} serverUrl="/api/orbitals" />
155
- *
156
- * @packageDocumentation
157
- */
158
-
159
110
  interface OrbPreviewProps {
160
111
  /**
161
112
  * The orbital schema. Accepts a JSON string or an `OrbitalSchema` object
@@ -165,22 +116,17 @@ interface OrbPreviewProps {
165
116
  /**
166
117
  * Mock entity rows keyed by entity name. The `EntityData` type from
167
118
  * `@almadar/core` is `Record<string, EntityRow[]>` where each row is a
168
- * `{ id?: string } & Record<string, FieldValue>`. Ignored if `autoMock`
169
- * is set.
119
+ * `{ id?: string } & Record<string, FieldValue>`.
170
120
  */
171
121
  mockData?: EntityData;
172
- /**
173
- * When true, run the schema through `prepareSchemaForPreview` before
174
- * rendering: auto-generate mock entity rows and flip two-state INIT
175
- * machines so the data state is initial. This is the same pipeline the
176
- * playground uses, so consumers (docs MDX, playground) all share one path.
177
- *
178
- * Ignored when `serverUrl` is set — server-driven previews provide their
179
- * own data.
180
- */
181
- autoMock?: boolean;
182
122
  /** Preview container height. Default: '400px'. */
183
123
  height?: string;
124
+ /**
125
+ * What the preview's slots lay out against. `contained` (default): the host's box, so overlays stay inside it.
126
+ * `page`: the preview is the host page (a served app), so overlays take the page's fixed layout and the dock pushes
127
+ * the body.
128
+ */
129
+ frame?: 'contained' | 'page';
184
130
  /** CSS class for the outer container. */
185
131
  className?: string;
186
132
  /** Server URL for dual execution (e.g. "/api/orbitals"). When set, events are forwarded to the server. */
@@ -199,10 +145,10 @@ interface OrbPreviewProps {
199
145
  * preview runs under whatever engine the host's own `KernelEngineProvider` selects.
200
146
  */
201
147
  kernelLoader?: KernelLoader;
202
- /** Resolves the language bundle a kernel opened over browser-stored rows needs (forwarded to `KernelEngineProvider`); keep its identity stable. */
203
- languageLoader?: LanguageLoader;
204
- /** Resolves the std mock-seed program that seeds a browser store. */
205
- seedProgramLoader?: SeedProgramLoader;
148
+ /** With `kernelLoader`: makes the 3D view a `canvas` mode:"3d" draws on (`(canvas) => Canvas3D.create(canvas)`). */
149
+ canvas3d?: KernelCanvas3DFactory;
150
+ /** With `kernelLoader`: makes the scene canvas the learning and 2D canvases draw on (`(canvas) => SceneCanvas.create(canvas)`). */
151
+ sceneCanvas?: KernelSceneCanvasFactory;
206
152
  /**
207
153
  * How long (ms) to wait for the server bridge to connect before assuming
208
154
  * it's unreachable and falling back to local-only execution. Default
@@ -220,12 +166,6 @@ interface OrbPreviewProps {
220
166
  * to walk DealCreate, NoteCompose, etc. on their owning pages.
221
167
  */
222
168
  initialPagePath?: string;
223
- /**
224
- * The signed-in viewer — forwarded to `OrbitalProvider`'s `UserProvider` so
225
- * `@user.x` resolves in client-side guard and effect evaluation exactly as
226
- * it does on the server. Omitted → anonymous.
227
- */
228
- user?: UserData | null;
229
169
  /**
230
170
  * What the host's auth provider has resolved the viewer to be. An
231
171
  * `access: authenticated` page mounts only on `authenticated`; any other
@@ -251,7 +191,7 @@ interface OrbPreviewProps {
251
191
  fit?: boolean | 'content';
252
192
  /**
253
193
  * Called with the page path on every in-preview page switch (link click,
254
- * navigate effect, `UI:NAVIGATE`), for a host that tracks the page in its
194
+ * navigate effect, `navigatesTo`), for a host that tracks the page in its
255
195
  * own router. When set, it replaces the built-in `?page=` URL sync.
256
196
  */
257
197
  onPageChange?: (path: string) => void;
@@ -283,158 +223,22 @@ interface OrbPreviewProps {
283
223
  */
284
224
  onSignIn?: (returnTo?: string) => void;
285
225
  /**
286
- * The host's session sign-out, called on the system event `UI:SIGN_OUT` (a
287
- * Sign out inside the circuit). Omitted → the host offers no sign-out.
226
+ * The host's session sign-out, run when the circuit asks `(auth/sign-out)`
227
+ * (a `host-ask` client effect). Omitted → the host offers no sign-out and the ask is refused by name.
288
228
  */
289
229
  onSignOut?: () => void;
230
+ /**
231
+ * The host's own sign-in, run when the circuit asks `(auth/sign-in { method … })` (a `host-ask` client effect whose
232
+ * answer returns to the asking trait). Omitted → the host offers no sign-in and the ask fails `unavailable`.
233
+ */
234
+ onSignInAsk?: (request: HostSignInRequest) => Promise<HostSignInAnswer>;
235
+ /** Answers `auth/consent` in place of the popup the web host opens: the shell's own authorize window. */
236
+ onConsentAsk?: (request: HostConsentRequest) => Promise<HostConsentAnswer>;
290
237
  }
291
- declare function OrbPreview({ schema, mockData, autoMock, height, className, serverUrl, transport, getAccessToken, kernelLoader, languageLoader, seedProgramLoader, initialPagePath, isolated, fit, onPageChange, user, authority, localFallbackTimeoutMs, themeOverride, paused, lazyLoader, schemaPath, onUnmatchedNavigate, onSignIn, onSignOut, }: OrbPreviewProps): React__default.ReactElement;
238
+ declare function OrbPreview({ schema, mockData, height, frame, className, serverUrl, transport, getAccessToken, kernelLoader, canvas3d, sceneCanvas, initialPagePath, isolated, fit, onPageChange, authority, localFallbackTimeoutMs, themeOverride, paused, lazyLoader, schemaPath, onUnmatchedNavigate, onSignIn, onSignOut, onSignInAsk, onConsentAsk, }: OrbPreviewProps): React__default.ReactElement;
292
239
  declare namespace OrbPreview {
293
240
  var displayName: string;
294
241
  }
295
242
 
296
- /**
297
- * OrbitalPluginHost — runs an ordinary behavior headless against the
298
- * AMBIENT event bus + slot provider (Almadar Studio V4 §14 plan, Part F1).
299
- *
300
- * A "plugin" is not a new kind of artifact: it is a `.lolo` behavior a host
301
- * chooses to run on a kernel of its own, wired to the SAME bus and slots every
302
- * other UI component uses. `mode: 'mock'` runs each plugin as an offline
303
- * `OrbPreview` circuit does: a client-role kernel (which also runs the plugin's
304
- * `ticks {}` on the one browser tick driver) over a local kernel whose mock
305
- * store is seeded by `seedMockStore` (persona roster, owner columns stamped for
306
- * the dev viewer, the `@create` owner gate); `mode: 'server'` dispatches
307
- * through the host's transport. Default policy denies nothing — a plugin has the full
308
- * behavior power a preview has (in-memory persist, default services); `deny`
309
- * is an opt-in host policy, never a default sandbox.
310
- *
311
- * OUTBOUND = the dispatch response. The kernel runs a dispatch's whole
312
- * `listens {}` cascade before it answers (EXEC semantics), so
313
- * `response.emittedEvents` carries every emit of the run, direct or cascaded,
314
- * on both modes, and every trait's state is read back from the kernel after it.
315
- *
316
- * RELAY RULE: the plugin's `inbound[]` is its host→plugin vocabulary — one
317
- * `UI:<busEvent>` bus event per row, dispatching `trigger` at
318
- * `orbital`/`trait`. Anything a plugin emits under one of those SAME
319
- * busEvent names (or under an inbound `trigger` name) is a relay for its
320
- * own siblings' `listens {}` (the runtime's internal event bus already
321
- * carries that fan-out), never a fresh request back to the host, and must
322
- * NEVER be re-broadcast — doing so re-fires the very `UI:<busEvent>`
323
- * listener that produced it, a synchronous self-feeding loop (verified
324
- * 2026-09-04, see `docs/Almadar_UI_Gaps.md`).
325
- *
326
- * @packageDocumentation
327
- */
328
-
329
- /** Verbs a host may deny. Never includes `emit` — it drives the kernel's `listens` cascade. */
330
- type PluginHostDenyVerb = 'persist' | 'call-service' | 'navigate';
331
- /** One bus-event → orbital-event wiring: `UI:<busEvent>` dispatches `trigger` at `orbital`/`trait`. */
332
- interface PluginHostInbound {
333
- busEvent: string;
334
- orbital: string;
335
- trait: string;
336
- trigger: string;
337
- }
338
- interface PluginHostPlugin {
339
- id: string;
340
- schema: OrbitalSchema;
341
- inbound: PluginHostInbound[];
342
- /** When set, only these events reach the host bus; every other emit stays inside the plugin. */
343
- outbound?: readonly string[];
344
- }
345
- interface OrbitalPluginHostProps {
346
- plugins: PluginHostPlugin[];
347
- /** 'mock' (default): a local kernel over in-memory mock rows — full behavior power, as any preview.
348
- * 'server': dispatch through `transport` instead of a local kernel, as `AlmadarApp`. */
349
- mode?: 'mock' | 'server';
350
- /** Required when `mode === 'server'`. */
351
- transport?: EventTransport;
352
- /** OPTIONAL policy: verbs listed here are denied with a logged warning, never a throw. Default: none denied. */
353
- deny?: PluginHostDenyVerb[];
354
- navigate?: (path: string) => void;
355
- onTransition?: (pluginId: string, orbital: string, trait: string, state: string) => void;
356
- children?: ReactNode;
357
- }
358
- /**
359
- * Reads the declared `keymap` config knob off the plugin's own trait and the
360
- * live `currentState`, so `useKeyboardRouter`'s capture table always follows
361
- * the trait's actual mode. Re-derives whenever the host records a new
362
- * transition (the context's `tick`).
363
- *
364
- * `target` accepts either one target string (default `'shell'`) or a list of
365
- * targets — the SAME derived entry (mode + keys) is repeated under every
366
- * target, for a caller keying its table by several editor ids at once (e.g.
367
- * one plugin's mode capturing keys for both `'schema'` and `'file:a.md'`).
368
- */
369
- declare function useDeclaredCaptureTable(opts: {
370
- pluginId: string;
371
- orbital: string;
372
- trait: string;
373
- keymapKnob?: string;
374
- target?: string | readonly string[];
375
- }): KeyCaptureTable;
376
- declare function useOrbitalPluginHost(): {
377
- getState: (pluginId: string, orbital: string, trait: string) => TraitState | undefined;
378
- lastEvent: (pluginId: string) => string | undefined;
379
- errors: Readonly<Record<string, string>>;
380
- };
381
- /**
382
- * Mounts one headless kernel per plugin against the ambient
383
- * event bus + slot provider. Renders nothing of its own besides an optional
384
- * `children` passthrough — MUST be mounted inside `EventBusProvider` +
385
- * `UISlotProvider`.
386
- */
387
- declare function OrbitalPluginHost({ plugins, mode, transport, deny, navigate, onTransition, children, }: OrbitalPluginHostProps): React__default.ReactElement;
388
-
389
- /**
390
- * TraitValueFrame — renders a trait VALUE (a trait of an installed behavior held
391
- * as data, language trio) where a render tree embeds it, the data-bound sibling
392
- * of `TraitFrame`'s `@trait.X` lens.
393
- *
394
- * The host turns the value into a runnable program (`TraitValueMountProvider`'s
395
- * `mount`: a validated, resolved one-orbital wrapper — the binding's admission
396
- * check), and the frame runs it through the plugin host's own runtime, bridged
397
- * to the ambient event bus, inside a scoped slot provider so the trait's UI
398
- * paints HERE rather than into the app's shared slots. `INIT` reaches the
399
- * mounted trait through the plugin host's declared inbound table.
400
- *
401
- * @packageDocumentation
402
- */
403
-
404
- /** How the host mounts trait values: the resolver plus the plugin-host execution mode. */
405
- interface TraitValueMountHost {
406
- mount: (value: TraitValue) => Promise<TraitValueMountResult>;
407
- /** 'mock' (default): in-memory, as a preview. 'server': through `transport`. */
408
- mode?: 'mock' | 'server';
409
- transport?: EventTransport;
410
- /** Mounts a whole behavior value (`BehaviorValueFrame`); a host without it cannot run behavior values. */
411
- mountBehavior?: (value: BehaviorRef) => Promise<BehaviorValueMountResult>;
412
- /** Where a mounted behavior value's events run; in-memory when omitted. */
413
- behaviorTransport?: ServerBridgeTransport;
414
- }
415
- declare function TraitValueMountProvider({ host, children }: {
416
- host: TraitValueMountHost;
417
- children: ReactNode;
418
- }): React__default.ReactElement;
419
- declare function TraitValueFrame({ value }: {
420
- value: TraitValue;
421
- }): React__default.ReactElement;
422
-
423
- /**
424
- * BehaviorValueFrame — renders a whole behavior VALUE (`.lolo` type `behavior`,
425
- * `behavior/ref`) where a render tree embeds it: the host mounts the program
426
- * (validated at 0/0 and resolved), and the frame runs it in place through an
427
- * isolated `OrbPreview` — its own event bus, in-memory navigation starting at the
428
- * program's default page, the host URL untouched. A value carrying a `bridge` runs on
429
- * the host's bus instead (`OrbitalPluginHost`): the bridge's `listens` reach the traits
430
- * that handle them, its `emits` come back out, nothing else crosses.
431
- *
432
- * @packageDocumentation
433
- */
434
-
435
- declare function BehaviorValueFrame({ value }: {
436
- value: BehaviorRef;
437
- }): React__default.ReactElement;
438
-
439
- export { BehaviorValueFrame, OrbPreview, OrbitalPluginHost, ServerBridgeTransport, TraitValueFrame, TraitValueMountProvider, clearSchemaCache, useDeclaredCaptureTable, useOrbitalPluginHost, useResolvedSchema, useTraitStateMachine };
440
- export type { OrbPreviewProps, OrbitalPluginHostProps, PluginHostDenyVerb, PluginHostInbound, PluginHostPlugin, ResolvedSchemaResult, SlotPatternEntry, SlotSource, TraitStateMachineResult, TraitValueMountHost, UseTraitStateMachineOptions };
243
+ export { OrbPreview, ServerBridgeTransport, useTraitStateMachine };
244
+ export type { OrbPreviewProps, SlotPatternEntry, SlotSource, TraitStateMachineResult, UseTraitStateMachineOptions };
@@ -1,31 +1,25 @@
1
- export { BehaviorValueFrame } from '../chunk-2QOH2HWM.js';
2
- export { OrbitalPluginHost, TraitValueFrame, TraitValueMountProvider, useDeclaredCaptureTable, useOrbitalPluginHost } from '../chunk-FIW6WN23.js';
1
+ "use client";
3
2
  export { assertUniqueSlotsPerHost } from '../chunk-5QTYQTPS.js';
4
- export { TraitContext, TraitProvider, useTrait, useTraitContext } from '../chunk-ZO6MXAS3.js';
5
- export { EntitySchemaProvider, OrbPreview, ServerBridgeProvider, clearSchemaCache, useEntitySchema, useEntitySchemaOptional, useResolvedSchema, useServerBridge, useTraitStateMachine } from '../chunk-GYTPOFVC.js';
6
- import '../chunk-YDNJLLG6.js';
7
- import '../chunk-KVQS4GXU.js';
8
- import '../chunk-L677XGY3.js';
9
- import '../chunk-FP3WIKTC.js';
10
- import '../chunk-42FY4RYA.js';
11
- import '../chunk-FAJDTHWC.js';
12
- import '../chunk-GAR5TQ5B.js';
13
- import '../chunk-SJGJJKBY.js';
14
- import '../chunk-DZ42OJQC.js';
15
- export { profilerOnRender, usePerfBuffer } from '../chunk-P4LNHAFI.js';
3
+ export { EntitySchemaProvider, OrbPreview, ServerBridgeProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTraitStateMachine } from '../chunk-MS4K3K2R.js';
4
+ import '../chunk-57DC34LY.js';
5
+ import '../chunk-4YJ53G7S.js';
6
+ import '../chunk-AGVSO4WY.js';
7
+ import '../chunk-7N6ZPHQ5.js';
8
+ import '../chunk-REXYVBUO.js';
9
+ import '../chunk-AGXD77SL.js';
10
+ import '../chunk-M74BCDBQ.js';
11
+ import '../chunk-PCR37T3U.js';
12
+ import '../chunk-PRLHKBXG.js';
13
+ import '../chunk-FAKU5F62.js';
14
+ export { profilerOnRender, usePerfBuffer } from '../chunk-2WGR4TDJ.js';
16
15
  import '../chunk-TZZBINQY.js';
17
- import '../chunk-PC7K4SK7.js';
18
- import '../chunk-VFF5OO47.js';
19
- import '../chunk-DFNZUYX4.js';
20
- import '../chunk-B4BU77LT.js';
21
- import '../chunk-6P3MWXYE.js';
22
- export { PERF_NAMESPACE, clearPerf, perfEnd, perfStart, perfTime, wrapCallbackForEvent } from '../chunk-DYEKAA4L.js';
23
- import '../chunk-R5O5AUPI.js';
24
- import '../chunk-L2DEKY4J.js';
25
- import '../chunk-AILY3XPS.js';
16
+ export { PERF_NAMESPACE, clearPerf, perfEnd, perfStart, perfTime, wrapCallbackForEvent } from '../chunk-ZDRDJKYB.js';
17
+ import '../chunk-PRXQGGCO.js';
18
+ import '../chunk-VO2TTLS5.js';
19
+ import '../chunk-AE7VCQB6.js';
26
20
  import '../chunk-3BBUBJFF.js';
27
21
  import '../chunk-YHMRX6YA.js';
28
- import '../chunk-MBQAMMSE.js';
22
+ import '../chunk-4YXBKHHM.js';
29
23
  import '../chunk-A2LR6VQQ.js';
30
24
  import '../chunk-P4ZFUQFF.js';
31
25
  import '../chunk-G7DCAZ22.js';