@xemahq/ui-kernel 0.1.4

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 (208) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +72 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +19 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/biome-host/biome-mode.d.ts +2 -0
  8. package/dist/lib/biome-host/biome-mode.d.ts.map +1 -0
  9. package/dist/lib/biome-host/biome-mode.js +3 -0
  10. package/dist/lib/biome-host/biome-mode.js.map +1 -0
  11. package/dist/lib/biome-host/biome-registry.d.ts +30 -0
  12. package/dist/lib/biome-host/biome-registry.d.ts.map +1 -0
  13. package/dist/lib/biome-host/biome-registry.js +134 -0
  14. package/dist/lib/biome-host/biome-registry.js.map +1 -0
  15. package/dist/lib/biome-host/composition-validation.d.ts +22 -0
  16. package/dist/lib/biome-host/composition-validation.d.ts.map +1 -0
  17. package/dist/lib/biome-host/composition-validation.js +127 -0
  18. package/dist/lib/biome-host/composition-validation.js.map +1 -0
  19. package/dist/lib/biome-host/frontend-biome.d.ts +47 -0
  20. package/dist/lib/biome-host/frontend-biome.d.ts.map +1 -0
  21. package/dist/lib/biome-host/frontend-biome.js +3 -0
  22. package/dist/lib/biome-host/frontend-biome.js.map +1 -0
  23. package/dist/lib/biome-host/host-bridge.d.ts +55 -0
  24. package/dist/lib/biome-host/host-bridge.d.ts.map +1 -0
  25. package/dist/lib/biome-host/host-bridge.js +16 -0
  26. package/dist/lib/biome-host/host-bridge.js.map +1 -0
  27. package/dist/lib/biome-host/host-sources.d.ts +12 -0
  28. package/dist/lib/biome-host/host-sources.d.ts.map +1 -0
  29. package/dist/lib/biome-host/host-sources.js +3 -0
  30. package/dist/lib/biome-host/host-sources.js.map +1 -0
  31. package/dist/lib/biome-host/index.d.ts +10 -0
  32. package/dist/lib/biome-host/index.d.ts.map +1 -0
  33. package/dist/lib/biome-host/index.js +26 -0
  34. package/dist/lib/biome-host/index.js.map +1 -0
  35. package/dist/lib/biome-host/nav.d.ts +17 -0
  36. package/dist/lib/biome-host/nav.d.ts.map +1 -0
  37. package/dist/lib/biome-host/nav.js +52 -0
  38. package/dist/lib/biome-host/nav.js.map +1 -0
  39. package/dist/lib/biome-host/session-contributions.d.ts +143 -0
  40. package/dist/lib/biome-host/session-contributions.d.ts.map +1 -0
  41. package/dist/lib/biome-host/session-contributions.js +3 -0
  42. package/dist/lib/biome-host/session-contributions.js.map +1 -0
  43. package/dist/lib/biome-host/session-profiles.d.ts +18 -0
  44. package/dist/lib/biome-host/session-profiles.d.ts.map +1 -0
  45. package/dist/lib/biome-host/session-profiles.js +39 -0
  46. package/dist/lib/biome-host/session-profiles.js.map +1 -0
  47. package/dist/lib/system-bus/capability-invoke.d.ts +18 -0
  48. package/dist/lib/system-bus/capability-invoke.d.ts.map +1 -0
  49. package/dist/lib/system-bus/capability-invoke.js +3 -0
  50. package/dist/lib/system-bus/capability-invoke.js.map +1 -0
  51. package/dist/lib/system-bus/deeplink.d.ts +33 -0
  52. package/dist/lib/system-bus/deeplink.d.ts.map +1 -0
  53. package/dist/lib/system-bus/deeplink.js +99 -0
  54. package/dist/lib/system-bus/deeplink.js.map +1 -0
  55. package/dist/lib/system-bus/enums.d.ts +27 -0
  56. package/dist/lib/system-bus/enums.d.ts.map +1 -0
  57. package/dist/lib/system-bus/enums.js +35 -0
  58. package/dist/lib/system-bus/enums.js.map +1 -0
  59. package/dist/lib/system-bus/host-ports.d.ts +24 -0
  60. package/dist/lib/system-bus/host-ports.d.ts.map +1 -0
  61. package/dist/lib/system-bus/host-ports.js +3 -0
  62. package/dist/lib/system-bus/host-ports.js.map +1 -0
  63. package/dist/lib/system-bus/index.d.ts +11 -0
  64. package/dist/lib/system-bus/index.d.ts.map +1 -0
  65. package/dist/lib/system-bus/index.js +27 -0
  66. package/dist/lib/system-bus/index.js.map +1 -0
  67. package/dist/lib/system-bus/intent-registry.d.ts +14 -0
  68. package/dist/lib/system-bus/intent-registry.d.ts.map +1 -0
  69. package/dist/lib/system-bus/intent-registry.js +66 -0
  70. package/dist/lib/system-bus/intent-registry.js.map +1 -0
  71. package/dist/lib/system-bus/intents.d.ts +30 -0
  72. package/dist/lib/system-bus/intents.d.ts.map +1 -0
  73. package/dist/lib/system-bus/intents.js +3 -0
  74. package/dist/lib/system-bus/intents.js.map +1 -0
  75. package/dist/lib/system-bus/palette.d.ts +25 -0
  76. package/dist/lib/system-bus/palette.d.ts.map +1 -0
  77. package/dist/lib/system-bus/palette.js +3 -0
  78. package/dist/lib/system-bus/palette.js.map +1 -0
  79. package/dist/lib/system-bus/system-bus-builder.d.ts +10 -0
  80. package/dist/lib/system-bus/system-bus-builder.d.ts.map +1 -0
  81. package/dist/lib/system-bus/system-bus-builder.js +82 -0
  82. package/dist/lib/system-bus/system-bus-builder.js.map +1 -0
  83. package/dist/lib/system-bus/system-bus.d.ts +13 -0
  84. package/dist/lib/system-bus/system-bus.d.ts.map +1 -0
  85. package/dist/lib/system-bus/system-bus.js +3 -0
  86. package/dist/lib/system-bus/system-bus.js.map +1 -0
  87. package/dist/lib/system-bus/windows.d.ts +21 -0
  88. package/dist/lib/system-bus/windows.d.ts.map +1 -0
  89. package/dist/lib/system-bus/windows.js +3 -0
  90. package/dist/lib/system-bus/windows.js.map +1 -0
  91. package/dist/org-db/components/DbResultTable.d.ts +13 -0
  92. package/dist/org-db/components/DbResultTable.d.ts.map +1 -0
  93. package/dist/org-db/components/DbResultTable.js +58 -0
  94. package/dist/org-db/components/DbResultTable.js.map +1 -0
  95. package/dist/org-db/index.d.ts +2 -0
  96. package/dist/org-db/index.d.ts.map +1 -0
  97. package/dist/org-db/index.js +6 -0
  98. package/dist/org-db/index.js.map +1 -0
  99. package/dist/registry/index.d.ts +9 -0
  100. package/dist/registry/index.d.ts.map +1 -0
  101. package/dist/registry/index.js +25 -0
  102. package/dist/registry/index.js.map +1 -0
  103. package/dist/registry/lib/biome-slot.d.ts +7 -0
  104. package/dist/registry/lib/biome-slot.d.ts.map +1 -0
  105. package/dist/registry/lib/biome-slot.js +18 -0
  106. package/dist/registry/lib/biome-slot.js.map +1 -0
  107. package/dist/registry/lib/biomes-enabled-context.d.ts +3 -0
  108. package/dist/registry/lib/biomes-enabled-context.d.ts.map +1 -0
  109. package/dist/registry/lib/biomes-enabled-context.js +11 -0
  110. package/dist/registry/lib/biomes-enabled-context.js.map +1 -0
  111. package/dist/registry/lib/composition-validation-host.d.ts +3 -0
  112. package/dist/registry/lib/composition-validation-host.d.ts.map +1 -0
  113. package/dist/registry/lib/composition-validation-host.js +10 -0
  114. package/dist/registry/lib/composition-validation-host.js.map +1 -0
  115. package/dist/registry/lib/extension-points.d.ts +15 -0
  116. package/dist/registry/lib/extension-points.d.ts.map +1 -0
  117. package/dist/registry/lib/extension-points.js +17 -0
  118. package/dist/registry/lib/extension-points.js.map +1 -0
  119. package/dist/registry/lib/primitives/SessionEventCard.d.ts +14 -0
  120. package/dist/registry/lib/primitives/SessionEventCard.d.ts.map +1 -0
  121. package/dist/registry/lib/primitives/SessionEventCard.js +60 -0
  122. package/dist/registry/lib/primitives/SessionEventCard.js.map +1 -0
  123. package/dist/registry/lib/primitives/SessionEventTimeline.d.ts +13 -0
  124. package/dist/registry/lib/primitives/SessionEventTimeline.d.ts.map +1 -0
  125. package/dist/registry/lib/primitives/SessionEventTimeline.js +35 -0
  126. package/dist/registry/lib/primitives/SessionEventTimeline.js.map +1 -0
  127. package/dist/registry/lib/primitives/SessionMutationBar.d.ts +10 -0
  128. package/dist/registry/lib/primitives/SessionMutationBar.d.ts.map +1 -0
  129. package/dist/registry/lib/primitives/SessionMutationBar.js +37 -0
  130. package/dist/registry/lib/primitives/SessionMutationBar.js.map +1 -0
  131. package/dist/registry/lib/primitives/SessionTabbedDrawer.d.ts +19 -0
  132. package/dist/registry/lib/primitives/SessionTabbedDrawer.d.ts.map +1 -0
  133. package/dist/registry/lib/primitives/SessionTabbedDrawer.js +75 -0
  134. package/dist/registry/lib/primitives/SessionTabbedDrawer.js.map +1 -0
  135. package/dist/registry/lib/primitives/index.d.ts +5 -0
  136. package/dist/registry/lib/primitives/index.d.ts.map +1 -0
  137. package/dist/registry/lib/primitives/index.js +21 -0
  138. package/dist/registry/lib/primitives/index.js.map +1 -0
  139. package/dist/registry/lib/session-context-builder.d.ts +13 -0
  140. package/dist/registry/lib/session-context-builder.d.ts.map +1 -0
  141. package/dist/registry/lib/session-context-builder.js +39 -0
  142. package/dist/registry/lib/session-context-builder.js.map +1 -0
  143. package/dist/registry/lib/session-context-provider.d.ts +10 -0
  144. package/dist/registry/lib/session-context-provider.d.ts.map +1 -0
  145. package/dist/registry/lib/session-context-provider.js +24 -0
  146. package/dist/registry/lib/session-context-provider.js.map +1 -0
  147. package/dist/registry/lib/session-selectors.d.ts +9 -0
  148. package/dist/registry/lib/session-selectors.d.ts.map +1 -0
  149. package/dist/registry/lib/session-selectors.js +149 -0
  150. package/dist/registry/lib/session-selectors.js.map +1 -0
  151. package/dist/session/comments/CommentRail.d.ts +20 -0
  152. package/dist/session/comments/CommentRail.d.ts.map +1 -0
  153. package/dist/session/comments/CommentRail.js +16 -0
  154. package/dist/session/comments/CommentRail.js.map +1 -0
  155. package/dist/session/index.d.ts +4 -0
  156. package/dist/session/index.d.ts.map +1 -0
  157. package/dist/session/index.js +10 -0
  158. package/dist/session/index.js.map +1 -0
  159. package/dist/session/lib/cn.d.ts +3 -0
  160. package/dist/session/lib/cn.d.ts.map +1 -0
  161. package/dist/session/lib/cn.js +9 -0
  162. package/dist/session/lib/cn.js.map +1 -0
  163. package/dist/session/shell/SessionWorkspaceShell.d.ts +16 -0
  164. package/dist/session/shell/SessionWorkspaceShell.d.ts.map +1 -0
  165. package/dist/session/shell/SessionWorkspaceShell.js +15 -0
  166. package/dist/session/shell/SessionWorkspaceShell.js.map +1 -0
  167. package/package.json +84 -0
  168. package/src/index.ts +2 -0
  169. package/src/lib/biome-host/biome-mode.ts +6 -0
  170. package/src/lib/biome-host/biome-registry.ts +245 -0
  171. package/src/lib/biome-host/composition-validation.ts +215 -0
  172. package/src/lib/biome-host/frontend-biome.ts +162 -0
  173. package/src/lib/biome-host/host-bridge.ts +178 -0
  174. package/src/lib/biome-host/host-sources.ts +41 -0
  175. package/src/lib/biome-host/index.ts +23 -0
  176. package/src/lib/biome-host/nav.ts +83 -0
  177. package/src/lib/biome-host/session-contributions.ts +293 -0
  178. package/src/lib/biome-host/session-profiles.ts +99 -0
  179. package/src/lib/system-bus/capability-invoke.ts +92 -0
  180. package/src/lib/system-bus/deeplink.ts +200 -0
  181. package/src/lib/system-bus/enums.ts +86 -0
  182. package/src/lib/system-bus/host-ports.ts +96 -0
  183. package/src/lib/system-bus/index.ts +16 -0
  184. package/src/lib/system-bus/intent-registry.ts +106 -0
  185. package/src/lib/system-bus/intents.ts +109 -0
  186. package/src/lib/system-bus/palette.ts +77 -0
  187. package/src/lib/system-bus/system-bus-builder.ts +157 -0
  188. package/src/lib/system-bus/system-bus.ts +37 -0
  189. package/src/lib/system-bus/windows.ts +51 -0
  190. package/src/org-db/components/DbResultTable.tsx +143 -0
  191. package/src/org-db/index.ts +1 -0
  192. package/src/registry/index.ts +8 -0
  193. package/src/registry/lib/biome-slot.tsx +47 -0
  194. package/src/registry/lib/biomes-enabled-context.ts +20 -0
  195. package/src/registry/lib/composition-validation-host.ts +37 -0
  196. package/src/registry/lib/extension-points.ts +134 -0
  197. package/src/registry/lib/primitives/SessionEventCard.tsx +138 -0
  198. package/src/registry/lib/primitives/SessionEventTimeline.tsx +89 -0
  199. package/src/registry/lib/primitives/SessionMutationBar.tsx +76 -0
  200. package/src/registry/lib/primitives/SessionTabbedDrawer.tsx +155 -0
  201. package/src/registry/lib/primitives/index.ts +18 -0
  202. package/src/registry/lib/session-context-builder.ts +68 -0
  203. package/src/registry/lib/session-context-provider.tsx +50 -0
  204. package/src/registry/lib/session-selectors.ts +231 -0
  205. package/src/session/comments/CommentRail.tsx +164 -0
  206. package/src/session/index.ts +3 -0
  207. package/src/session/lib/cn.ts +11 -0
  208. package/src/session/shell/SessionWorkspaceShell.tsx +141 -0
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+
17
+ Copyright (c) Xema Platform contributors.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ <p align="center">
2
+ <svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/ui-kernel">
3
+ <rect width="680" height="120" rx="14" fill="#0B1020"/>
4
+ <g transform="translate(28,34)">
5
+ <path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
6
+ <path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
7
+ </g>
8
+ <text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/ui-kernel</text>
9
+ <text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Host-agnostic UI kernel for the Xema frontend.</text>
10
+ <text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
11
+ </svg>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://xema.dev">Website</a> &middot;
16
+ <a href="https://www.npmjs.com/package/@xemahq/ui-kernel">npm</a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fui-kernel?color=2563eb&label=npm">
21
+ <img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fui-kernel?color=10b981">
22
+ <img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fui-kernel?color=3178c6">
23
+ </p>
24
+
25
+ # @xemahq/ui-kernel
26
+
27
+ > Host-agnostic UI kernel for the Xema frontend.
28
+
29
+ ## Overview
30
+
31
+ The host-framework-agnostic UI kernel every frontend biome composes against. It
32
+ defines the system bus — the orchestration contract for capability invocation,
33
+ cross-biome intents, the command palette, deeplinks, and window management — and
34
+ the biome-host contract surface, including the frontend-biome and host-bridge
35
+ shapes, the singleton biome registry, and session contributions. React is the
36
+ shared component model, but the kernel carries no router, bundler, or
37
+ host-specific wiring; concrete host adapters live in separate packages. The
38
+ system bus is pure orchestration — it never authorizes; policy is enforced by
39
+ the backend.
40
+
41
+ ## When to use it
42
+
43
+ - Use it to author a frontend biome against the shared host contracts and
44
+ register it with the biome registry.
45
+ - Reach for the system bus to dispatch capability invocations, intents, or
46
+ deeplinks across biomes.
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ pnpm add @xemahq/ui-kernel
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ```ts
57
+ import { buildSystemBus, biomeRegistry } from '@xemahq/ui-kernel';
58
+
59
+ const bus = buildSystemBus(hostPorts);
60
+
61
+ // Register a frontend biome so the host can render its contributions:
62
+ biomeRegistry.registerBiome(myBiome);
63
+ ```
64
+
65
+ ## Peer requirements
66
+
67
+ - `react` — the shared component model.
68
+ - `@tanstack/react-query` — async state for host data hooks.
69
+
70
+ ## License
71
+
72
+ Apache-2.0 &copy; Xema — [xema.dev](https://xema.dev)
@@ -0,0 +1,3 @@
1
+ export * from './lib/system-bus';
2
+ export * from './lib/biome-host';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lib/system-bus"), exports);
18
+ __exportStar(require("./lib/biome-host"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,mDAAiC"}
@@ -0,0 +1,2 @@
1
+ export type BiomesMode = 'enabled' | 'disabled';
2
+ //# sourceMappingURL=biome-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-mode.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/biome-mode.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=biome-mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-mode.js","sourceRoot":"","sources":["../../../src/lib/biome-host/biome-mode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import { Registry } from '@xemahq/registry';
2
+ import type { FrontendBiome, FrontendBiomeFactory, OutputRendererContribution, PanelContribution } from './frontend-biome';
3
+ import type { HostBridge } from './host-bridge';
4
+ declare class FrontendBiomeRegistry extends Registry<string, FrontendBiome & {
5
+ key: string;
6
+ }> {
7
+ private revisionCount;
8
+ private readonly listeners;
9
+ private readonly initialized;
10
+ private enabled;
11
+ constructor();
12
+ registerBiome(biome: FrontendBiome): void;
13
+ runInit(biomeId: string, bridge: HostBridge): Promise<void>;
14
+ unregisterBiome(id: string): boolean;
15
+ snapshot(): readonly string[];
16
+ setEnabled(enabled: boolean): void;
17
+ isEnabled(): boolean;
18
+ revision(): number;
19
+ subscribe(listener: () => void): () => void;
20
+ panelsForSlot(slot: string): readonly PanelContribution[];
21
+ outputRenderers(): ReadonlyMap<string, OutputRendererContribution>;
22
+ private notify;
23
+ }
24
+ export declare const biomeRegistry: FrontendBiomeRegistry;
25
+ export declare function registerFrontendBiomeInstance(biome: FrontendBiome): void;
26
+ export declare function registerFrontendBiome(factory: FrontendBiomeFactory, bridge: HostBridge): void;
27
+ export declare function unregisterFrontendBiome(id: string): boolean;
28
+ export declare function useBiomeRegistryRevision(): number;
29
+ export {};
30
+ //# sourceMappingURL=biome-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-registry.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/biome-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAwBhD,cAAM,qBAAsB,SAAQ,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;IACnF,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAQnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,OAAO,CAAQ;;IAMvB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAYnC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjE,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IA0BpC,QAAQ,IAAI,SAAS,MAAM,EAAE;IAI7B,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAgBlC,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,MAAM;IAUlB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAO3C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,iBAAiB,EAAE;IAmBzD,eAAe,IAAI,WAAW,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAkBlE,OAAO,CAAC,MAAM;CAKf;AAED,eAAO,MAAM,aAAa,uBAA8B,CAAC;AAOzD,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAExE;AAWD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,UAAU,GACjB,IAAI,CAUN;AAOD,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE3D;AAeD,wBAAgB,wBAAwB,IAAI,MAAM,CAMjD"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.biomeRegistry = void 0;
4
+ exports.registerFrontendBiomeInstance = registerFrontendBiomeInstance;
5
+ exports.registerFrontendBiome = registerFrontendBiome;
6
+ exports.unregisterFrontendBiome = unregisterFrontendBiome;
7
+ exports.useBiomeRegistryRevision = useBiomeRegistryRevision;
8
+ const registry_1 = require("@xemahq/registry");
9
+ const react_1 = require("react");
10
+ class FrontendBiomeRegistry extends registry_1.Registry {
11
+ revisionCount = 0;
12
+ listeners = new Set();
13
+ initialized = new Set();
14
+ enabled = true;
15
+ constructor() {
16
+ super({ name: 'FrontendBiomeRegistry' });
17
+ }
18
+ registerBiome(biome) {
19
+ if (!this.enabled)
20
+ return;
21
+ this.register({ ...biome, key: biome.id });
22
+ this.revisionCount += 1;
23
+ this.notify();
24
+ }
25
+ async runInit(biomeId, bridge) {
26
+ const entry = this.get(biomeId);
27
+ if (!entry || !entry.init)
28
+ return;
29
+ if (this.initialized.has(biomeId))
30
+ return;
31
+ this.initialized.add(biomeId);
32
+ await entry.init({ bridge, biomeId });
33
+ }
34
+ unregisterBiome(id) {
35
+ if (!this.enabled)
36
+ return false;
37
+ const entry = this.get(id);
38
+ const removed = this.unregister(id);
39
+ if (removed) {
40
+ this.revisionCount += 1;
41
+ this.initialized.delete(id);
42
+ if (entry?.dispose) {
43
+ void Promise.resolve(entry.dispose()).catch((error) => {
44
+ console.error(`[xema-ui-kernel] dispose() failed for '${id}':`, error);
45
+ });
46
+ }
47
+ this.notify();
48
+ }
49
+ return removed;
50
+ }
51
+ snapshot() {
52
+ return this.list().map((b) => b.id);
53
+ }
54
+ setEnabled(enabled) {
55
+ if (this.enabled === enabled)
56
+ return;
57
+ this.enabled = enabled;
58
+ if (!enabled) {
59
+ const had = this.size() > 0;
60
+ this.clear();
61
+ this.initialized.clear();
62
+ if (had) {
63
+ this.revisionCount += 1;
64
+ this.notify();
65
+ }
66
+ }
67
+ }
68
+ isEnabled() {
69
+ return this.enabled;
70
+ }
71
+ revision() {
72
+ return this.revisionCount;
73
+ }
74
+ subscribe(listener) {
75
+ this.listeners.add(listener);
76
+ return () => {
77
+ this.listeners.delete(listener);
78
+ };
79
+ }
80
+ panelsForSlot(slot) {
81
+ if (!this.enabled)
82
+ return [];
83
+ const out = [];
84
+ for (const biome of this.list()) {
85
+ for (const panel of biome.panels ?? []) {
86
+ if (panel.slot === slot)
87
+ out.push(panel);
88
+ }
89
+ }
90
+ return out.sort((a, b) => (a.weight ?? 100) - (b.weight ?? 100));
91
+ }
92
+ outputRenderers() {
93
+ const out = new Map();
94
+ if (!this.enabled)
95
+ return out;
96
+ for (const biome of this.list()) {
97
+ for (const entry of biome.outputRenderers ?? []) {
98
+ if (out.has(entry.outputKind)) {
99
+ console.error(`[xema-ui-kernel] duplicate outputRenderer for kind '${entry.outputKind}' ` +
100
+ `from biome '${biome.id}'; first registration wins.`);
101
+ continue;
102
+ }
103
+ out.set(entry.outputKind, entry);
104
+ }
105
+ }
106
+ return out;
107
+ }
108
+ notify() {
109
+ for (const listener of this.listeners) {
110
+ listener();
111
+ }
112
+ }
113
+ }
114
+ exports.biomeRegistry = new FrontendBiomeRegistry();
115
+ function registerFrontendBiomeInstance(biome) {
116
+ exports.biomeRegistry.registerBiome(biome);
117
+ }
118
+ function registerFrontendBiome(factory, bridge) {
119
+ if (!exports.biomeRegistry.isEnabled())
120
+ return;
121
+ const biome = factory(bridge);
122
+ if (!biome || typeof biome !== 'object' || typeof biome.id !== 'string') {
123
+ throw new Error('[xema-ui-kernel] FrontendBiomeFactory returned a non-FrontendBiome value. ' +
124
+ 'A biome module must default-export `(bridge) => FrontendBiome`.');
125
+ }
126
+ exports.biomeRegistry.registerBiome(biome);
127
+ }
128
+ function unregisterFrontendBiome(id) {
129
+ return exports.biomeRegistry.unregisterBiome(id);
130
+ }
131
+ function useBiomeRegistryRevision() {
132
+ return (0, react_1.useSyncExternalStore)((listener) => exports.biomeRegistry.subscribe(listener), () => exports.biomeRegistry.revision(), () => exports.biomeRegistry.revision());
133
+ }
134
+ //# sourceMappingURL=biome-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biome-registry.js","sourceRoot":"","sources":["../../../src/lib/biome-host/biome-registry.ts"],"names":[],"mapp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
+ Error = "error",
4
+ Warning = "warning"
5
+ }
6
+ export declare enum CompositionDiagnosticCode {
7
+ DuplicateRoutePath = "duplicate_route_path",
8
+ DuplicateNavId = "duplicate_nav_id",
9
+ UnknownSlot = "unknown_slot",
10
+ OrphanedPanelSlot = "orphaned_panel_slot"
11
+ }
12
+ export interface CompositionDiagnostic {
13
+ readonly code: CompositionDiagnosticCode;
14
+ readonly severity: CompositionDiagnosticSeverity;
15
+ readonly biomeIds: readonly string[];
16
+ readonly message: string;
17
+ }
18
+ export interface ValidateBiomeCompositionOptions {
19
+ readonly knownSlots: ReadonlySet<string>;
20
+ }
21
+ export declare function validateBiomeComposition(biomes: readonly FrontendBiome[], options: ValidateBiomeCompositionOptions): readonly CompositionDiagnostic[];
22
+ //# sourceMappingURL=composition-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition-validation.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/composition-validation.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,oBAAY,6BAA6B;IAMvC,KAAK,UAAU;IAOf,OAAO,YAAY;CACpB;AAGD,oBAAY,yBAAyB;IAEnC,kBAAkB,yBAAyB;IAE3C,cAAc,qBAAqB;IAKnC,WAAW,iBAAiB;IAK5B,iBAAiB,wBAAwB;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;IAEjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,+BAA+B;IAM9C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1C;AAwBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,OAAO,EAAE,+BAA+B,GACvC,SAAS,qBAAqB,EAAE,CA6FlC"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CompositionDiagnosticCode = exports.CompositionDiagnosticSeverity = void 0;
4
+ exports.validateBiomeComposition = validateBiomeComposition;
5
+ var CompositionDiagnosticSeverity;
6
+ (function (CompositionDiagnosticSeverity) {
7
+ CompositionDiagnosticSeverity["Error"] = "error";
8
+ CompositionDiagnosticSeverity["Warning"] = "warning";
9
+ })(CompositionDiagnosticSeverity || (exports.CompositionDiagnosticSeverity = CompositionDiagnosticSeverity = {}));
10
+ var CompositionDiagnosticCode;
11
+ (function (CompositionDiagnosticCode) {
12
+ CompositionDiagnosticCode["DuplicateRoutePath"] = "duplicate_route_path";
13
+ CompositionDiagnosticCode["DuplicateNavId"] = "duplicate_nav_id";
14
+ CompositionDiagnosticCode["UnknownSlot"] = "unknown_slot";
15
+ CompositionDiagnosticCode["OrphanedPanelSlot"] = "orphaned_panel_slot";
16
+ })(CompositionDiagnosticCode || (exports.CompositionDiagnosticCode = CompositionDiagnosticCode = {}));
17
+ function biomeOwnedSlotOwner(slot) {
18
+ const slashIndex = slot.indexOf('/');
19
+ if (slashIndex <= 0)
20
+ return null;
21
+ if (slot.indexOf('/', slashIndex + 1) !== -1)
22
+ return null;
23
+ const owner = slot.slice(0, slashIndex);
24
+ const name = slot.slice(slashIndex + 1);
25
+ if (owner.length === 0 || name.length === 0)
26
+ return null;
27
+ return owner;
28
+ }
29
+ function validateBiomeComposition(biomes, options) {
30
+ const diagnostics = [];
31
+ const biomeIds = new Set(biomes.map((b) => b.id));
32
+ const routeOwners = new Map();
33
+ for (const biome of biomes) {
34
+ for (const route of biome.routes ?? []) {
35
+ const scope = route.projectScoped ? 'project' : 'root';
36
+ const key = `${scope}:${route.path}`;
37
+ const owners = routeOwners.get(key);
38
+ if (owners)
39
+ owners.push(biome.id);
40
+ else
41
+ routeOwners.set(key, [biome.id]);
42
+ }
43
+ }
44
+ for (const [key, owners] of routeOwners) {
45
+ if (owners.length < 2)
46
+ continue;
47
+ const [scope, path] = splitFirst(key, ':');
48
+ diagnostics.push({
49
+ code: CompositionDiagnosticCode.DuplicateRoutePath,
50
+ severity: CompositionDiagnosticSeverity.Error,
51
+ biomeIds: owners,
52
+ message: `Route path '${path}' (${scope}-scoped) is contributed by multiple biomes: ` +
53
+ `${owners.join(', ')}. Each route must be unique within its scope — ` +
54
+ `only one would mount and the others would be unreachable.`,
55
+ });
56
+ }
57
+ const navOwners = new Map();
58
+ for (const biome of biomes) {
59
+ for (const navItem of biome.navItems ?? []) {
60
+ const owners = navOwners.get(navItem.id);
61
+ if (owners)
62
+ owners.push(biome.id);
63
+ else
64
+ navOwners.set(navItem.id, [biome.id]);
65
+ }
66
+ }
67
+ for (const [navId, owners] of navOwners) {
68
+ if (owners.length < 2)
69
+ continue;
70
+ diagnostics.push({
71
+ code: CompositionDiagnosticCode.DuplicateNavId,
72
+ severity: CompositionDiagnosticSeverity.Error,
73
+ biomeIds: owners,
74
+ message: `Nav id '${navId}' is contributed by multiple biomes: ${owners.join(', ')}. ` +
75
+ `Nav ids must be unique — a duplicate silently overwrites the ` +
76
+ `feature-route mapping and collides as a render key.`,
77
+ });
78
+ }
79
+ for (const biome of biomes) {
80
+ for (const panel of biome.panels ?? []) {
81
+ if (options.knownSlots.has(panel.slot))
82
+ continue;
83
+ const owner = biomeOwnedSlotOwner(panel.slot);
84
+ if (owner === null) {
85
+ diagnostics.push({
86
+ code: CompositionDiagnosticCode.UnknownSlot,
87
+ severity: CompositionDiagnosticSeverity.Warning,
88
+ biomeIds: [biome.id],
89
+ message: `Biome '${biome.id}' panel '${panel.id}' targets slot '${panel.slot}', ` +
90
+ `which is neither a known host slot nor a well-formed ` +
91
+ `'<owner>/<name>' biome-owned slot. It will never render — ` +
92
+ `check for a typo against the host slot catalog.`,
93
+ });
94
+ continue;
95
+ }
96
+ if (!biomeIds.has(owner)) {
97
+ diagnostics.push({
98
+ code: CompositionDiagnosticCode.OrphanedPanelSlot,
99
+ severity: CompositionDiagnosticSeverity.Warning,
100
+ biomeIds: [biome.id],
101
+ message: `Biome '${biome.id}' panel '${panel.id}' targets biome-owned slot ` +
102
+ `'${panel.slot}', but its owner biome '${owner}' is not registered. ` +
103
+ `The panel will never render until '${owner}' is enabled.`,
104
+ });
105
+ }
106
+ }
107
+ }
108
+ return sortDiagnostics(diagnostics);
109
+ }
110
+ function splitFirst(value, sep) {
111
+ const idx = value.indexOf(sep);
112
+ if (idx === -1)
113
+ return [value, ''];
114
+ return [value.slice(0, idx), value.slice(idx + sep.length)];
115
+ }
116
+ function sortDiagnostics(diagnostics) {
117
+ return diagnostics.slice().sort((a, b) => {
118
+ if (a.code !== b.code)
119
+ return a.code.localeCompare(b.code);
120
+ const ai = a.biomeIds.join(',');
121
+ const bi = b.biomeIds.join(',');
122
+ if (ai !== bi)
123
+ return ai.localeCompare(bi);
124
+ return a.message.localeCompare(b.message);
125
+ });
126
+ }
127
+ //# sourceMappingURL=composition-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition-validation.js","sourceRoot":"","sources":["../../../src/lib/biome-host/composition-validation.ts"],"names":[],"mappings":";;;AAkGA,4DAgGC;AA1KD,IAAY,6BAcX;AAdD,WAAY,6BAA6B;IAMvC,gDAAe,CAAA;IAOf,oDAAmB,CAAA;AACrB,CAAC,EAdW,6BAA6B,6CAA7B,6BAA6B,QAcxC;AAGD,IAAY,yBAeX;AAfD,WAAY,yBAAyB;IAEnC,wEAA2C,CAAA;IAE3C,gEAAmC,CAAA;IAKnC,yDAA4B,CAAA;IAK5B,sEAAyC,CAAA;AAC3C,CAAC,EAfW,yBAAyB,yCAAzB,yBAAyB,QAepC;AA0BD,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,UAAU,IAAI,CAAC;QAAE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C;QACH,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC;AACtC,CAAC;AAGD,SAAS,UAAU,CAAC,KAAa,EAAE,GAAW;IAC5C,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9D,CAAC;AAGD,SAAS,eAAe,CACtB,WAAoC;IAEpC,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,EAAE,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ import type { HostBridge } from './host-bridge';
3
+ import type { SessionContributions } from './session-contributions';
4
+ export interface NavItemContribution {
5
+ readonly id: string;
6
+ readonly label: string;
7
+ readonly route: string;
8
+ readonly icon?: ComponentType<{
9
+ className?: string | undefined;
10
+ }>;
11
+ readonly section?: string;
12
+ readonly weight?: number;
13
+ }
14
+ export interface RouteContribution {
15
+ readonly path: string;
16
+ readonly element: () => ReactNode;
17
+ readonly projectScoped?: boolean;
18
+ }
19
+ export interface PanelContribution {
20
+ readonly slot: string;
21
+ readonly id: string;
22
+ readonly render: () => ReactNode;
23
+ readonly weight?: number;
24
+ }
25
+ export interface BiomeInitContext {
26
+ readonly bridge: HostBridge;
27
+ readonly biomeId: string;
28
+ }
29
+ export interface FrontendBiome {
30
+ readonly id: string;
31
+ readonly displayName: string;
32
+ readonly init?: (ctx: BiomeInitContext) => void | Promise<void>;
33
+ readonly dispose?: () => void | Promise<void>;
34
+ readonly navItems?: readonly NavItemContribution[];
35
+ readonly routes?: readonly RouteContribution[];
36
+ readonly panels?: readonly PanelContribution[];
37
+ readonly session?: SessionContributions;
38
+ readonly outputRenderers?: readonly OutputRendererContribution[];
39
+ }
40
+ export interface OutputRendererContribution {
41
+ readonly outputKind: string;
42
+ readonly render: () => ComponentType<{
43
+ readonly output: unknown;
44
+ }>;
45
+ }
46
+ export type FrontendBiomeFactory = (bridge: HostBridge) => FrontendBiome;
47
+ //# sourceMappingURL=frontend-biome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend-biome.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/frontend-biome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAYpE,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAQvB,QAAQ,CAAC,I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IAO/C,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAexC,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;CAClE;AAYD,MAAM,WAAW,0BAA0B;IAOzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAQ5B,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAa,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpE;AAaD,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=frontend-biome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend-biome.js","sourceRoot":"","sources":["../../../src/lib/biome-host/frontend-biome.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ import { type ReactNode } from 'react';
3
+ import type { SystemBus } from '../system-bus';
4
+ export interface HostBridgeNavigation {
5
+ push(path: string): void;
6
+ replace(path: string): void;
7
+ useLocation(): HostLocation;
8
+ useRouteParams<T extends Record<string, string | undefined> = Record<string, string | undefined>>(): T;
9
+ }
10
+ export interface HostLocation {
11
+ readonly pathname: string;
12
+ readonly search: string;
13
+ }
14
+ export interface HostBridgeAuth {
15
+ getActorToken(): string | null;
16
+ getOrgId(): string | null;
17
+ getProjectId(): string | null;
18
+ getUserId(): string | null;
19
+ }
20
+ export interface HostBridgeToast {
21
+ success(message: string, detail?: string): void;
22
+ error(message: string, detail?: string): void;
23
+ info(message: string, detail?: string): void;
24
+ }
25
+ export interface HostBridgeRequestContext {
26
+ readonly correlationId: string;
27
+ }
28
+ export interface PageBackTarget {
29
+ readonly to: string;
30
+ readonly label?: string;
31
+ }
32
+ export interface PageMeta {
33
+ readonly title: string;
34
+ readonly eyebrow?: string;
35
+ readonly description?: string;
36
+ readonly actions?: readonly string[];
37
+ readonly backTo?: PageBackTarget;
38
+ readonly topbarActions?: ReactNode;
39
+ readonly topbarMeta?: ReactNode;
40
+ }
41
+ export interface HostBridgePageMeta {
42
+ usePageMeta(meta: PageMeta): void;
43
+ }
44
+ export interface HostBridge {
45
+ readonly navigation: HostBridgeNavigation;
46
+ readonly auth: HostBridgeAuth;
47
+ readonly toast: HostBridgeToast;
48
+ readonly queryClient: QueryClient;
49
+ readonly requestContext: HostBridgeRequestContext;
50
+ readonly pageMeta: HostBridgePageMeta;
51
+ readonly system: SystemBus;
52
+ }
53
+ export declare const HostBridgeContext: import("react").Context<HostBridge | null>;
54
+ export declare function useHostBridge(): HostBridge;
55
+ //# sourceMappingURL=host-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-bridge.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/host-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,MAAM,WAAW,oBAAoB;IAEnC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,WAAW,IAAI,YAAY,CAAC;IAe5B,cAAc,CACZ,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,KAC9E,CAAC,CAAC;CACR;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;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C,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAC;IAOlD,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IAStC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,4CAAyC,CAAC;AAQxE,wBAAgB,aAAa,IAAI,UAAU,CAS1C"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HostBridgeContext = void 0;
4
+ exports.useHostBridge = useHostBridge;
5
+ const react_1 = require("react");
6
+ exports.HostBridgeContext = (0, react_1.createContext)(null);
7
+ exports.HostBridgeContext.displayName = 'HostBridgeContext';
8
+ function useHostBridge() {
9
+ const bridge = (0, react_1.useContext)(exports.HostBridgeContext);
10
+ if (!bridge) {
11
+ throw new Error('[xema-ui-kernel] useHostBridge() called outside <HostBridgeContext.Provider>. ' +
12
+ 'The host app must wrap biome-rendered subtrees with the bridge provider.');
13
+ }
14
+ return bridge;
15
+ }
16
+ //# sourceMappingURL=host-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-bridge.js","sourceRoot":"","sources":["../../../src/lib/biome-host/host-bridge.ts"],"names":[],"mappings":";;;AAwKA,sCASC;AA/KD,iCAAkE;AA8JrD,QAAA,iBAAiB,GAAG,IAAA,qBAAa,EAAoB,IAAI,CAAC,CAAC;AACxE,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAOpD,SAAgB,aAAa;IAC3B,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,yBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,gFAAgF;YAC9E,0EAA0E,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface AuthSource {
2
+ getActorToken(): string | null;
3
+ getOrgId(): string | null;
4
+ getProjectId(): string | null;
5
+ getUserId(): string | null;
6
+ }
7
+ export interface ToastSource {
8
+ success(message: string, detail?: string): void;
9
+ error(message: string, detail?: string): void;
10
+ info(message: string, detail?: string): void;
11
+ }
12
+ //# sourceMappingURL=host-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-sources.d.ts","sourceRoot":"","sources":["../../../src/lib/biome-host/host-sources.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,UAAU;IAEzB,aAAa,IAAI,MAAM,GAAG,IAAI,CAAC;IAE/B,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC;IAE1B,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;CAC5B;AAOD,MAAM,WAAW,WAAW;IAE1B,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}