@almadar/shell-web 0.1.0 → 1.0.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.
- package/dist/{ArbitraryClassCompiler-Mzabq-UB.d.ts → ArbitraryClassCompiler-CO_iASBn.d.ts} +99 -4
- package/dist/AvlGlyph-EPJKFEO3.js +6 -0
- package/dist/AvlStateMachine-RKZIKNGC.js +9 -0
- package/dist/AvlTransitionDetail-63SD6GZF.js +11 -0
- package/dist/AvlTransitionExplainer-ZBTLOM3T.js +12 -0
- package/dist/BehaviorView-YS5G4GNB.js +11 -0
- package/dist/{Canvas3DHost-_Y-5uLM_.d.ts → Canvas3DHost-BkZQB5l2.d.ts} +1 -1
- package/dist/{EventBusProvider-CVwjkV_2.d.ts → EventBusProvider-BFFHfN4O.d.ts} +12 -0
- package/dist/FlowCanvas-AUMTWMNG.js +26 -0
- package/dist/{GameAudioProvider-Cm9BnvmP.d.ts → GameAudioProvider-ceM_n0ey.d.ts} +4 -7
- package/dist/KernelEngineContext-CcxGYtlr.d.ts +33 -0
- package/dist/LayersPanel-M2LHWUFF.js +6 -0
- package/dist/ModuleCard-QHDGK5XK.js +7 -0
- package/dist/OrbInspector-QCPEPUPH.js +26 -0
- package/dist/{Select-mDZIwNqN.d.ts → Select-B-iDdnvE.d.ts} +16 -30
- package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
- package/dist/UISlotRenderer-C7WWOK43.js +26 -0
- package/dist/auth/browser/index.js +1 -0
- package/dist/auth/react/index.d.ts +8 -1
- package/dist/auth/react/index.js +40 -2
- package/dist/avl/index.d.ts +89 -79
- package/dist/avl/index.js +38 -38
- package/dist/{avl-3d-context-BIRKWpaL.d.ts → avl-3d-context-BycmO6tG.d.ts} +9 -12
- package/dist/{chunk-GKIFONTE.js → chunk-3S54FWRC.js} +2 -2
- package/dist/{chunk-DYEKAA4L.js → chunk-3VZ36ZKO.js} +240 -252
- package/dist/{chunk-PC7K4SK7.js → chunk-4T3P43NS.js} +18 -269
- package/dist/{chunk-MBQAMMSE.js → chunk-4YXBKHHM.js} +269 -658
- package/dist/{chunk-YDNJLLG6.js → chunk-57DC34LY.js} +19 -10
- package/dist/{chunk-SJGJJKBY.js → chunk-AB3X7QTE.js} +6 -3
- package/dist/{chunk-AILY3XPS.js → chunk-AE7VCQB6.js} +5 -6
- package/dist/{chunk-FAJDTHWC.js → chunk-AGXD77SL.js} +2 -2
- package/dist/chunk-AU7O65OX.js +66 -0
- package/dist/{chunk-L677XGY3.js → chunk-CPLN6NBQ.js} +5 -5
- package/dist/{chunk-DZ42OJQC.js → chunk-DZBQA2OW.js} +1 -1
- package/dist/{chunk-2PY54Z44.js → chunk-E6KA4J6N.js} +5 -5
- package/dist/{chunk-DJ433ET5.js → chunk-GFXCPUMX.js} +11 -4
- package/dist/{chunk-FP3WIKTC.js → chunk-HH5KSMH5.js} +9 -1
- package/dist/{chunk-U6QRZASX.js → chunk-ILQXJ2AR.js} +1 -1
- package/dist/{chunk-B4BU77LT.js → chunk-ILZ7ORX7.js} +1 -1
- package/dist/{chunk-SGM3FASH.js → chunk-K4MOPSEL.js} +14 -12
- package/dist/{chunk-GYTPOFVC.js → chunk-LHP2TK7O.js} +7402 -6970
- package/dist/{chunk-VFF5OO47.js → chunk-PCR37T3U.js} +15 -38
- package/dist/{chunk-R5O5AUPI.js → chunk-PRXQGGCO.js} +93 -86
- package/dist/{chunk-42FY4RYA.js → chunk-REXYVBUO.js} +2 -2
- package/dist/{chunk-DLZF4PVE.js → chunk-ROICKAU7.js} +3 -3
- package/dist/{chunk-KVQS4GXU.js → chunk-SP5CDJ6K.js} +18 -8
- package/dist/{chunk-P4LNHAFI.js → chunk-TUPZWTRE.js} +2 -2
- package/dist/chunk-TXAUOLWZ.js +490 -0
- package/dist/{chunk-EQAMU2ZC.js → chunk-UTDC2NEA.js} +1 -1
- package/dist/{chunk-73SRAB4P.js → chunk-UU57VNS2.js} +2 -2
- package/dist/{chunk-DFNZUYX4.js → chunk-UXLE3IPR.js} +70 -27
- package/dist/{chunk-L2DEKY4J.js → chunk-VO2TTLS5.js} +3 -6
- package/dist/{chunk-TESBIVUA.js → chunk-X3DMMX27.js} +2 -2
- package/dist/components/index.d.ts +331 -125
- package/dist/components/index.js +28 -28
- package/dist/context/index.d.ts +2 -3
- package/dist/context/index.js +4 -3
- package/dist/core.d.ts +93 -17
- package/dist/core.js +2 -1
- package/dist/design-classes/index.cjs +3 -1
- package/dist/design-classes/index.js +3 -1
- package/dist/hooks/index.d.ts +40 -5
- package/dist/hooks/index.js +5 -4
- package/dist/index.d.ts +36 -114
- package/dist/index.js +174 -34
- package/dist/kernel-client-TZKGHJRY.js +516 -0
- package/dist/kernel-wire-wNdAPfhJ.d.ts +88 -0
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +5 -4
- package/dist/{paintDispatch-ChW5mVuK.d.ts → paintDispatch-CuJLsr9Y.d.ts} +5 -15
- package/dist/{prism-AIWGN2X5.js → prism-X5YWKXO5.js} +5 -3
- package/dist/providers/index.d.ts +42 -27
- package/dist/providers/index.js +22 -23
- package/dist/renderer/index.d.ts +0 -2
- package/dist/renderer/index.js +1 -0
- package/dist/runtime/index.d.ts +52 -253
- package/dist/runtime/index.js +21 -24
- package/dist/ssr/index.cjs +2643 -535
- package/dist/ssr/index.d.cts +0 -23
- package/dist/ssr/index.d.ts +0 -23
- package/dist/ssr/index.js +2639 -535
- package/dist/storage/browser/index.js +1 -0
- package/dist/test-support.d.ts +15 -8
- package/dist/test-support.js +91 -24
- package/dist/three/index.d.ts +6 -6
- package/dist/three/index.js +49 -37
- package/dist/{verificationRegistry-CabxhfTv.d.ts → verificationRegistry-CVrcxG1s.d.ts} +3 -3
- package/package.json +13 -9
- package/src/core/lib/band-shapes.json +7 -0
- package/src/core/locales/ar.json +18 -5
- package/src/core/locales/en.json +18 -5
- package/src/core/locales/sl.json +18 -5
- package/tailwind-preset.cjs +30 -1
- package/dist/AvlGlyph-JKJOAH23.js +0 -6
- package/dist/AvlStateMachine-PI4YGREK.js +0 -8
- package/dist/AvlTransitionDetail-ZH7V24UG.js +0 -12
- package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +0 -13
- package/dist/BehaviorValueFrame-6RUJXT4A.js +0 -29
- package/dist/BehaviorValueFrame-SSEMEBTG.css +0 -1756
- package/dist/BehaviorView-RFEE5J6E.js +0 -10
- package/dist/FlowCanvas-STDC4OWK.js +0 -27
- package/dist/KernelEngineContext-BOCQoFwk.d.ts +0 -43
- package/dist/LayersPanel-BBQ54IVG.js +0 -7
- package/dist/ModuleCard-3TT2X7IW.js +0 -7
- package/dist/OrbInspector-K6T6O7GI.js +0 -27
- package/dist/ServerBridge-Cm1On51b.d.ts +0 -233
- package/dist/TraitValueFrame-2PJGLLVI.js +0 -28
- package/dist/TraitValueFrame-4G3KOUBR.css +0 -1756
- package/dist/UISlotRenderer-JKFSX24W.js +0 -27
- package/dist/UserContext-DqWeZkUZ.d.ts +0 -100
- package/dist/chunk-2QOH2HWM.js +0 -95
- package/dist/chunk-6P3MWXYE.js +0 -440
- package/dist/chunk-FIW6WN23.js +0 -508
- package/dist/chunk-GAR5TQ5B.js +0 -199
- package/dist/chunk-ZO6MXAS3.js +0 -69
- package/dist/kernel-client-ZH4PSMCN.js +0 -367
- package/dist/kernel-wire-B4S8pnP3.d.ts +0 -65
- package/dist/useKeyboardRouter-Dsq553Ur.d.ts +0 -42
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,40 +1,54 @@
|
|
|
1
|
-
import { EventPayload, OrbitalDefinition, SchemaMetadata, PersistenceAdapter, ServiceParams,
|
|
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-
|
|
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,
|
|
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
|
|
14
|
-
import
|
|
15
|
-
import { SchemaLoader } from '@almadar/shell-runtime
|
|
16
|
-
import { KernelLoader
|
|
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';
|
|
18
17
|
export { S as SlotHostManifest, a as SlotHostRegion, b as assertUniqueSlotsPerHost } from '../slot-host-CPzrxLo9.js';
|
|
19
18
|
export { p as profilerOnRender, u as usePerfBuffer } from '../perf-CKiBKbkw.js';
|
|
20
19
|
import '../useUISlots-CiobNFGb.js';
|
|
21
20
|
import '@almadar/core/patterns';
|
|
21
|
+
import '@almadar/shell-browser/kv';
|
|
22
|
+
|
|
23
|
+
/** A program's type-contract stamp: the kernel refuses to register a program carrying neither field. */
|
|
24
|
+
type ProgramStamp = Pick<OrbitalSchema, 'resolved' | 'typeContractVersion' | 'theme' | 'themes' | 'locales' | 'messages'>;
|
|
25
|
+
/** The kernel's answer for the page: nothing mounts until it is ready. */
|
|
26
|
+
type CircuitState = {
|
|
27
|
+
status: 'pending';
|
|
28
|
+
} | {
|
|
29
|
+
status: 'ready';
|
|
30
|
+
page: PageCircuit;
|
|
31
|
+
} | {
|
|
32
|
+
status: 'failed';
|
|
33
|
+
error: Error;
|
|
34
|
+
};
|
|
22
35
|
|
|
23
36
|
interface TraitStateMachineResult {
|
|
24
37
|
/** Current state for each trait. */
|
|
25
38
|
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
39
|
getTraitState: (traitName: string) => TraitState | undefined;
|
|
31
|
-
canHandleEvent: (traitName: string, eventKey: string) => boolean;
|
|
32
40
|
/** Live per-trait binding surface for `EntityBindingContext`. */
|
|
33
41
|
entityBindingSource: EntityBindingSource;
|
|
34
42
|
/** Awaiting-server skeletons for `AwaitingSkeletonContext`. */
|
|
35
43
|
awaitingSkeletonSource: AwaitingSkeletonSource;
|
|
44
|
+
/** The kernel's answer for the page: pending until it answers, failed when it cannot. Nothing mounts before it is ready. */
|
|
45
|
+
circuit: CircuitState;
|
|
46
|
+
/** The theme key the server bound to this session with `theme/set`; `undefined` when none is and the declared themes apply. */
|
|
47
|
+
sessionTheme: string | undefined;
|
|
36
48
|
}
|
|
37
49
|
interface UseTraitStateMachineOptions {
|
|
50
|
+
/** The page the kernel answers the circuit of; absent: the initial page (or the page of `routePath`). */
|
|
51
|
+
page?: string;
|
|
38
52
|
onEventProcessed?: (eventKey: string, payload?: EventPayload) => void;
|
|
39
53
|
navigate?: (path: string, params?: Record<string, string>, crumb?: string) => void;
|
|
40
54
|
navigateBack?: () => void;
|
|
@@ -43,10 +57,12 @@ interface UseTraitStateMachineOptions {
|
|
|
43
57
|
mountKey?: string;
|
|
44
58
|
/** The route the page is opened at; the kernel's mounts for it are what the hook runs (EXEC-ENDPOINT-3). */
|
|
45
59
|
routePath?: string;
|
|
46
|
-
/** The
|
|
60
|
+
/** The program's orbitals: the kernel is built from them. */
|
|
47
61
|
orbitals: readonly OrbitalDefinition[];
|
|
48
62
|
/** The program's `_metadata` (a compiled client program's operator sites and dispatch facts), handed to the kernel. */
|
|
49
63
|
metadata?: SchemaMetadata;
|
|
64
|
+
/** The program's type-contract stamp, carried into the browser kernel's registration. */
|
|
65
|
+
stamp?: ProgramStamp;
|
|
50
66
|
/** Caller-owned transport (server bridge). Omitted + `persistence` set =
|
|
51
67
|
* offline preview (plan G7); omitted + no `persistence` = fully local,
|
|
52
68
|
* nothing ever posts. */
|
|
@@ -58,64 +74,13 @@ interface UseTraitStateMachineOptions {
|
|
|
58
74
|
/** The browser store for `[persistent: x, browser]` entities (see `useCircuitKernel`). */
|
|
59
75
|
browserStore?: PersistenceAdapter;
|
|
60
76
|
callService?: (service: string, action: string, params?: ServiceParams) => Promise<EventPayload>;
|
|
61
|
-
embeddedTraits?: ReadonlySet<string>;
|
|
62
|
-
callsiteCaptureChildrenByTrait?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
63
77
|
debug?: boolean;
|
|
64
78
|
logContext?: {
|
|
65
79
|
behavior?: string;
|
|
66
80
|
orbitalName?: string;
|
|
67
81
|
};
|
|
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
82
|
}
|
|
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;
|
|
83
|
+
declare function useTraitStateMachine(uiSlots: ReturnType<typeof useUISlots>, options: UseTraitStateMachineOptions): TraitStateMachineResult;
|
|
119
84
|
|
|
120
85
|
/**
|
|
121
86
|
* One pattern within a slot's accumulated render-ui set, plus any
|
|
@@ -139,23 +104,8 @@ interface SlotSource extends EventSource {
|
|
|
139
104
|
state: string;
|
|
140
105
|
transition: string;
|
|
141
106
|
effects: SExpr[];
|
|
142
|
-
traitDefinition: ResolvedTrait;
|
|
143
107
|
}
|
|
144
108
|
|
|
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
109
|
interface OrbPreviewProps {
|
|
160
110
|
/**
|
|
161
111
|
* The orbital schema. Accepts a JSON string or an `OrbitalSchema` object
|
|
@@ -165,22 +115,17 @@ interface OrbPreviewProps {
|
|
|
165
115
|
/**
|
|
166
116
|
* Mock entity rows keyed by entity name. The `EntityData` type from
|
|
167
117
|
* `@almadar/core` is `Record<string, EntityRow[]>` where each row is a
|
|
168
|
-
* `{ id?: string } & Record<string, FieldValue>`.
|
|
169
|
-
* is set.
|
|
118
|
+
* `{ id?: string } & Record<string, FieldValue>`.
|
|
170
119
|
*/
|
|
171
120
|
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
121
|
/** Preview container height. Default: '400px'. */
|
|
183
122
|
height?: string;
|
|
123
|
+
/**
|
|
124
|
+
* What the preview's slots lay out against. `contained` (default): the host's box, so overlays stay inside it.
|
|
125
|
+
* `page`: the preview is the host page (a served app), so overlays take the page's fixed layout and the dock pushes
|
|
126
|
+
* the body.
|
|
127
|
+
*/
|
|
128
|
+
frame?: 'contained' | 'page';
|
|
184
129
|
/** CSS class for the outer container. */
|
|
185
130
|
className?: string;
|
|
186
131
|
/** Server URL for dual execution (e.g. "/api/orbitals"). When set, events are forwarded to the server. */
|
|
@@ -199,10 +144,6 @@ interface OrbPreviewProps {
|
|
|
199
144
|
* preview runs under whatever engine the host's own `KernelEngineProvider` selects.
|
|
200
145
|
*/
|
|
201
146
|
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;
|
|
206
147
|
/**
|
|
207
148
|
* How long (ms) to wait for the server bridge to connect before assuming
|
|
208
149
|
* it's unreachable and falling back to local-only execution. Default
|
|
@@ -220,12 +161,6 @@ interface OrbPreviewProps {
|
|
|
220
161
|
* to walk DealCreate, NoteCompose, etc. on their owning pages.
|
|
221
162
|
*/
|
|
222
163
|
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
164
|
/**
|
|
230
165
|
* What the host's auth provider has resolved the viewer to be. An
|
|
231
166
|
* `access: authenticated` page mounts only on `authenticated`; any other
|
|
@@ -251,7 +186,7 @@ interface OrbPreviewProps {
|
|
|
251
186
|
fit?: boolean | 'content';
|
|
252
187
|
/**
|
|
253
188
|
* Called with the page path on every in-preview page switch (link click,
|
|
254
|
-
* navigate effect, `
|
|
189
|
+
* navigate effect, `navigatesTo`), for a host that tracks the page in its
|
|
255
190
|
* own router. When set, it replaces the built-in `?page=` URL sync.
|
|
256
191
|
*/
|
|
257
192
|
onPageChange?: (path: string) => void;
|
|
@@ -283,158 +218,22 @@ interface OrbPreviewProps {
|
|
|
283
218
|
*/
|
|
284
219
|
onSignIn?: (returnTo?: string) => void;
|
|
285
220
|
/**
|
|
286
|
-
* The host's session sign-out,
|
|
287
|
-
*
|
|
221
|
+
* The host's session sign-out, run when the circuit asks `(auth/sign-out)`
|
|
222
|
+
* (a `host-ask` client effect). Omitted → the host offers no sign-out and the ask is refused by name.
|
|
288
223
|
*/
|
|
289
224
|
onSignOut?: () => void;
|
|
225
|
+
/**
|
|
226
|
+
* The host's own sign-in, run when the circuit asks `(auth/sign-in { method … })` (a `host-ask` client effect whose
|
|
227
|
+
* answer returns to the asking trait). Omitted → the host offers no sign-in and the ask fails `unavailable`.
|
|
228
|
+
*/
|
|
229
|
+
onSignInAsk?: (request: HostSignInRequest) => Promise<HostSignInAnswer>;
|
|
230
|
+
/** Answers `auth/consent` in place of the popup the web host opens: the shell's own authorize window. */
|
|
231
|
+
onConsentAsk?: (request: HostConsentRequest) => Promise<HostConsentAnswer>;
|
|
290
232
|
}
|
|
291
|
-
declare function OrbPreview({ schema, mockData,
|
|
233
|
+
declare function OrbPreview({ schema, mockData, height, frame, className, serverUrl, transport, getAccessToken, kernelLoader, initialPagePath, isolated, fit, onPageChange, authority, localFallbackTimeoutMs, themeOverride, paused, lazyLoader, schemaPath, onUnmatchedNavigate, onSignIn, onSignOut, onSignInAsk, onConsentAsk, }: OrbPreviewProps): React__default.ReactElement;
|
|
292
234
|
declare namespace OrbPreview {
|
|
293
235
|
var displayName: string;
|
|
294
236
|
}
|
|
295
237
|
|
|
296
|
-
|
|
297
|
-
|
|
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 };
|
|
238
|
+
export { OrbPreview, ServerBridgeTransport, useTraitStateMachine };
|
|
239
|
+
export type { OrbPreviewProps, SlotPatternEntry, SlotSource, TraitStateMachineResult, UseTraitStateMachineOptions };
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
export { OrbitalPluginHost, TraitValueFrame, TraitValueMountProvider, useDeclaredCaptureTable, useOrbitalPluginHost } from '../chunk-FIW6WN23.js';
|
|
1
|
+
"use client";
|
|
3
2
|
export { assertUniqueSlotsPerHost } from '../chunk-5QTYQTPS.js';
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
14
|
-
|
|
15
|
-
export { profilerOnRender, usePerfBuffer } from '../chunk-P4LNHAFI.js';
|
|
3
|
+
export { EntitySchemaProvider, OrbPreview, ServerBridgeProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTraitStateMachine } from '../chunk-LHP2TK7O.js';
|
|
4
|
+
import '../chunk-57DC34LY.js';
|
|
5
|
+
import '../chunk-SP5CDJ6K.js';
|
|
6
|
+
import '../chunk-CPLN6NBQ.js';
|
|
7
|
+
import '../chunk-HH5KSMH5.js';
|
|
8
|
+
import '../chunk-REXYVBUO.js';
|
|
9
|
+
import '../chunk-AGXD77SL.js';
|
|
10
|
+
import '../chunk-TXAUOLWZ.js';
|
|
11
|
+
import '../chunk-AB3X7QTE.js';
|
|
12
|
+
import '../chunk-DZBQA2OW.js';
|
|
13
|
+
export { profilerOnRender, usePerfBuffer } from '../chunk-TUPZWTRE.js';
|
|
16
14
|
import '../chunk-TZZBINQY.js';
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import '../chunk-
|
|
24
|
-
import '../chunk-
|
|
25
|
-
import '../chunk-AILY3XPS.js';
|
|
15
|
+
import '../chunk-4T3P43NS.js';
|
|
16
|
+
import '../chunk-PCR37T3U.js';
|
|
17
|
+
import '../chunk-UXLE3IPR.js';
|
|
18
|
+
import '../chunk-ILZ7ORX7.js';
|
|
19
|
+
export { PERF_NAMESPACE, clearPerf, perfEnd, perfStart, perfTime, wrapCallbackForEvent } from '../chunk-3VZ36ZKO.js';
|
|
20
|
+
import '../chunk-PRXQGGCO.js';
|
|
21
|
+
import '../chunk-VO2TTLS5.js';
|
|
22
|
+
import '../chunk-AE7VCQB6.js';
|
|
26
23
|
import '../chunk-3BBUBJFF.js';
|
|
27
24
|
import '../chunk-YHMRX6YA.js';
|
|
28
|
-
import '../chunk-
|
|
25
|
+
import '../chunk-4YXBKHHM.js';
|
|
29
26
|
import '../chunk-A2LR6VQQ.js';
|
|
30
27
|
import '../chunk-P4ZFUQFF.js';
|
|
31
28
|
import '../chunk-G7DCAZ22.js';
|