@almadar/shell-web 0.0.0-stage → 0.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 (274) hide show
  1. package/bundling.d.mts +18 -0
  2. package/bundling.mjs +28 -0
  3. package/dist/ArbitraryClassCompiler-Mzabq-UB.d.ts +100 -0
  4. package/dist/AvlGlyph-JKJOAH23.js +6 -0
  5. package/dist/AvlStateMachine-PI4YGREK.js +8 -0
  6. package/dist/AvlTransitionDetail-ZH7V24UG.js +12 -0
  7. package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +13 -0
  8. package/dist/BehaviorValueFrame-6RUJXT4A.js +29 -0
  9. package/dist/BehaviorValueFrame-SSEMEBTG.css +1756 -0
  10. package/dist/BehaviorView-RFEE5J6E.js +10 -0
  11. package/dist/Canvas3DHost-_Y-5uLM_.d.ts +552 -0
  12. package/dist/EventBusProvider-CVwjkV_2.d.ts +284 -0
  13. package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
  14. package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
  15. package/dist/FlowCanvas-STDC4OWK.js +27 -0
  16. package/dist/GameAudioProvider-Cm9BnvmP.d.ts +93 -0
  17. package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
  18. package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
  19. package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
  20. package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
  21. package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
  22. package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
  23. package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
  24. package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
  25. package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
  26. package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
  27. package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
  28. package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
  29. package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
  30. package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
  31. package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
  32. package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
  33. package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
  34. package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
  35. package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
  36. package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
  37. package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
  38. package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
  39. package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
  40. package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
  41. package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
  42. package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
  43. package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
  44. package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
  45. package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
  46. package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
  47. package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
  48. package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
  49. package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
  50. package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
  51. package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
  52. package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
  53. package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
  54. package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
  55. package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
  56. package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
  57. package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
  58. package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
  59. package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
  60. package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
  61. package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
  62. package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
  63. package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
  64. package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
  65. package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
  66. package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
  67. package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
  68. package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
  69. package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
  70. package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
  71. package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
  72. package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
  73. package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
  74. package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
  75. package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
  76. package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
  77. package/dist/KernelEngineContext-BOCQoFwk.d.ts +43 -0
  78. package/dist/LayersPanel-BBQ54IVG.js +7 -0
  79. package/dist/ModuleCard-3TT2X7IW.js +7 -0
  80. package/dist/OrbInspector-K6T6O7GI.js +27 -0
  81. package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
  82. package/dist/Select-mDZIwNqN.d.ts +199 -0
  83. package/dist/ServerBridge-Cm1On51b.d.ts +233 -0
  84. package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
  85. package/dist/TraitValueFrame-2PJGLLVI.js +28 -0
  86. package/dist/TraitValueFrame-4G3KOUBR.css +1756 -0
  87. package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
  88. package/dist/UISlotRenderer-JKFSX24W.js +27 -0
  89. package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
  90. package/dist/UserContext-DqWeZkUZ.d.ts +100 -0
  91. package/dist/auth/browser/index.d.ts +2 -0
  92. package/dist/auth/browser/index.js +1 -0
  93. package/dist/auth/react/index.d.ts +49 -0
  94. package/dist/auth/react/index.js +119 -0
  95. package/dist/avl/index.css +1756 -0
  96. package/dist/avl/index.d.ts +2238 -0
  97. package/dist/avl/index.js +2693 -0
  98. package/dist/avl-3d-context-BIRKWpaL.d.ts +204 -0
  99. package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
  100. package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
  101. package/dist/chunk-2PY54Z44.js +227 -0
  102. package/dist/chunk-2QOH2HWM.js +95 -0
  103. package/dist/chunk-3BBUBJFF.js +339 -0
  104. package/dist/chunk-42FY4RYA.js +191 -0
  105. package/dist/chunk-5QTYQTPS.js +15 -0
  106. package/dist/chunk-6P3MWXYE.js +440 -0
  107. package/dist/chunk-73SRAB4P.js +1053 -0
  108. package/dist/chunk-A2LR6VQQ.js +349 -0
  109. package/dist/chunk-AILY3XPS.js +562 -0
  110. package/dist/chunk-B4BU77LT.js +432 -0
  111. package/dist/chunk-DFNZUYX4.js +378 -0
  112. package/dist/chunk-DJ433ET5.js +1327 -0
  113. package/dist/chunk-DLZF4PVE.js +24 -0
  114. package/dist/chunk-DYEKAA4L.js +787 -0
  115. package/dist/chunk-DZ42OJQC.js +176 -0
  116. package/dist/chunk-EOWMARUB.js +16 -0
  117. package/dist/chunk-EQAMU2ZC.js +14 -0
  118. package/dist/chunk-FAJDTHWC.js +98 -0
  119. package/dist/chunk-FIW6WN23.js +508 -0
  120. package/dist/chunk-FP3WIKTC.js +303 -0
  121. package/dist/chunk-G7DCAZ22.js +19 -0
  122. package/dist/chunk-GAR5TQ5B.js +199 -0
  123. package/dist/chunk-GKIFONTE.js +131 -0
  124. package/dist/chunk-GYTPOFVC.js +47155 -0
  125. package/dist/chunk-KVQS4GXU.js +328 -0
  126. package/dist/chunk-L2DEKY4J.js +97 -0
  127. package/dist/chunk-L677XGY3.js +701 -0
  128. package/dist/chunk-MBQAMMSE.js +11877 -0
  129. package/dist/chunk-P4LNHAFI.js +1051 -0
  130. package/dist/chunk-P4ZFUQFF.js +93 -0
  131. package/dist/chunk-PC7K4SK7.js +1384 -0
  132. package/dist/chunk-R5O5AUPI.js +573 -0
  133. package/dist/chunk-SGM3FASH.js +672 -0
  134. package/dist/chunk-SJGJJKBY.js +502 -0
  135. package/dist/chunk-TESBIVUA.js +11 -0
  136. package/dist/chunk-TZZBINQY.js +82 -0
  137. package/dist/chunk-U6QRZASX.js +280 -0
  138. package/dist/chunk-VFF5OO47.js +319 -0
  139. package/dist/chunk-YDNJLLG6.js +516 -0
  140. package/dist/chunk-YHMRX6YA.js +455 -0
  141. package/dist/chunk-ZO6MXAS3.js +69 -0
  142. package/dist/components/index.css +1756 -0
  143. package/dist/components/index.d.ts +11093 -0
  144. package/dist/components/index.js +1110 -0
  145. package/dist/context/index.d.ts +9 -0
  146. package/dist/context/index.js +7 -0
  147. package/dist/core.d.ts +2523 -0
  148. package/dist/core.js +2 -0
  149. package/dist/design-classes/index.cjs +429 -0
  150. package/dist/design-classes/index.d.cts +165 -0
  151. package/dist/design-classes/index.d.ts +165 -0
  152. package/dist/design-classes/index.js +397 -0
  153. package/dist/emojiItems-QGSNAABW.js +20 -0
  154. package/dist/fx-CmQjnHmT.d.ts +371 -0
  155. package/dist/hooks/index.d.ts +936 -0
  156. package/dist/hooks/index.js +7 -0
  157. package/dist/index.d.ts +486 -0
  158. package/dist/index.js +38 -0
  159. package/dist/katexPlugin-FA7NX4PE.css +1161 -0
  160. package/dist/katexPlugin-NCDKOOQY.js +2 -0
  161. package/dist/kernel-client-ZH4PSMCN.js +367 -0
  162. package/dist/kernel-wire-B4S8pnP3.d.ts +65 -0
  163. package/dist/lib/index.d.ts +602 -0
  164. package/dist/lib/index.js +1288 -0
  165. package/dist/paintDispatch-ChW5mVuK.d.ts +698 -0
  166. package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
  167. package/dist/perf-CKiBKbkw.d.ts +22 -0
  168. package/dist/perf-Dr28-AgT.d.ts +57 -0
  169. package/dist/prism-AIWGN2X5.js +134 -0
  170. package/dist/providers/index.css +1756 -0
  171. package/dist/providers/index.d.ts +340 -0
  172. package/dist/providers/index.js +30 -0
  173. package/dist/renderer/index.d.ts +467 -0
  174. package/dist/renderer/index.js +3 -0
  175. package/dist/runtime/index.css +1756 -0
  176. package/dist/runtime/index.d.ts +440 -0
  177. package/dist/runtime/index.js +31 -0
  178. package/dist/slot-host-CPzrxLo9.d.ts +48 -0
  179. package/dist/ssr/index.cjs +7631 -0
  180. package/dist/ssr/index.d.cts +487 -0
  181. package/dist/ssr/index.d.ts +487 -0
  182. package/dist/ssr/index.js +7599 -0
  183. package/dist/storage/browser/index.d.ts +1 -0
  184. package/dist/storage/browser/index.js +1 -0
  185. package/dist/test-support.d.ts +35 -0
  186. package/dist/test-support.js +114 -0
  187. package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
  188. package/dist/three/index.css +503 -0
  189. package/dist/three/index.d.ts +1185 -0
  190. package/dist/three/index.js +3896 -0
  191. package/dist/useKeyboardRouter-Dsq553Ur.d.ts +42 -0
  192. package/dist/useUISlots-CiobNFGb.d.ts +211 -0
  193. package/dist/verification-C5pTeMJv.d.ts +66 -0
  194. package/dist/verificationRegistry-CabxhfTv.d.ts +122 -0
  195. package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
  196. package/index.css +199 -0
  197. package/package.json +269 -3
  198. package/src/core/locales/ar.json +1263 -0
  199. package/src/core/locales/en.json +1263 -0
  200. package/src/core/locales/index.ts +54 -0
  201. package/src/core/locales/sl.json +1263 -0
  202. package/src/core/tokens/native-tokens.json +369 -0
  203. package/tailwind-compile.cjs +29 -0
  204. package/tailwind-preset.cjs +991 -0
  205. package/themes/_base.css +451 -0
  206. package/themes/_contract.md +307 -0
  207. package/themes/_fonts-kenney.css +11 -0
  208. package/themes/_fonts.css +12 -0
  209. package/themes/_foundation.css +105 -0
  210. package/themes/_head.css +22 -0
  211. package/themes/_presets.css +67 -0
  212. package/themes/almadar-heritage.css +455 -0
  213. package/themes/almadar-website.css +269 -0
  214. package/themes/almadar.css +269 -0
  215. package/themes/aqua.css +455 -0
  216. package/themes/arabesque.css +459 -0
  217. package/themes/art-deco.css +457 -0
  218. package/themes/art-nouveau.css +459 -0
  219. package/themes/atelier.css +463 -0
  220. package/themes/bauhaus.css +461 -0
  221. package/themes/bloomberg-dense.css +463 -0
  222. package/themes/blueprint.css +457 -0
  223. package/themes/clay.css +449 -0
  224. package/themes/comic.css +453 -0
  225. package/themes/constructivist.css +457 -0
  226. package/themes/corporate.css +449 -0
  227. package/themes/cyberpunk.css +453 -0
  228. package/themes/frutiger-aero.css +458 -0
  229. package/themes/game-adventure.css +201 -0
  230. package/themes/game-rpg.css +203 -0
  231. package/themes/game-sci-fi.css +201 -0
  232. package/themes/game-ui-pack.css +200 -0
  233. package/themes/gazette.css +449 -0
  234. package/themes/glass.css +457 -0
  235. package/themes/gothic.css +453 -0
  236. package/themes/index.css +21 -0
  237. package/themes/ink-wash.css +459 -0
  238. package/themes/kawaii.css +459 -0
  239. package/themes/kflow.css +310 -0
  240. package/themes/kiosk.css +449 -0
  241. package/themes/linear-clean.css +463 -0
  242. package/themes/luxury.css +451 -0
  243. package/themes/mac-classic.css +455 -0
  244. package/themes/material.css +463 -0
  245. package/themes/memphis.css +453 -0
  246. package/themes/mid-century.css +455 -0
  247. package/themes/minimalist.css +449 -0
  248. package/themes/mudcloth.css +459 -0
  249. package/themes/nata.css +310 -0
  250. package/themes/neon.css +453 -0
  251. package/themes/neumorphic.css +451 -0
  252. package/themes/newsprint.css +455 -0
  253. package/themes/notion-editorial.css +463 -0
  254. package/themes/orb.css +465 -0
  255. package/themes/pixel.css +449 -0
  256. package/themes/prism.css +309 -0
  257. package/themes/rawi.css +310 -0
  258. package/themes/retro.css +452 -0
  259. package/themes/risograph.css +463 -0
  260. package/themes/scandi.css +469 -0
  261. package/themes/sketch.css +455 -0
  262. package/themes/solarpunk.css +469 -0
  263. package/themes/steampunk.css +451 -0
  264. package/themes/swiss.css +455 -0
  265. package/themes/terminal.css +466 -0
  266. package/themes/trait-wars.css +487 -0
  267. package/themes/ukiyo-e.css +459 -0
  268. package/themes/vaporwave.css +455 -0
  269. package/themes/victorian.css +453 -0
  270. package/themes/wabi-sabi.css +459 -0
  271. package/themes/win95.css +455 -0
  272. package/themes/wireframe.css +439 -0
  273. package/themes/zine.css +455 -0
  274. package/README.md +0 -3
@@ -0,0 +1,936 @@
1
+ import { OrbitalSchema, FieldValue, EventPayload, BusEventSource, EntityFrameState, EntityFieldWrite, PageMeta, PageAccess, PageIndexing, LocaleAlternate } from '@almadar/core';
2
+ export { BusEvent, BusEventListener, BusEventSource, BusEventListener as EventListener, UISlot, Unsubscribe } from '@almadar/core';
3
+ export { E as EditorKeyEvent, a as KeyCaptureEntry, K as KeyCaptureTable, U as UseKeyboardRouterOptions, k as keyChord, m as mergeCaptureTables, u as useKeyboardRouter } from '../useKeyboardRouter-Dsq553Ur.js';
4
+ export { D as DEFAULT_SLOTS, S as SlotChangeCallback, a as SlotContent, b as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-CiobNFGb.js';
5
+ import { useEventBus } from '../core.js';
6
+ import * as React$1 from 'react';
7
+ import React__default from 'react';
8
+ import * as _tanstack_react_query from '@tanstack/react-query';
9
+
10
+ interface FileSystemTree {
11
+ [name: string]: {
12
+ file: {
13
+ contents: string;
14
+ };
15
+ } | {
16
+ directory: FileSystemTree;
17
+ };
18
+ }
19
+ interface FileNode {
20
+ path: string;
21
+ name: string;
22
+ type: 'file' | 'directory';
23
+ children?: FileNode[];
24
+ }
25
+ type FileSystemStatus = 'idle' | 'booting' | 'ready' | 'running' | 'error';
26
+ interface FileSystemFile {
27
+ path: string;
28
+ content: string;
29
+ }
30
+ interface SelectedFile {
31
+ path: string;
32
+ content: string;
33
+ language?: string;
34
+ isDirty?: boolean;
35
+ }
36
+ interface UseFileSystemResult {
37
+ status: FileSystemStatus;
38
+ error: string | null;
39
+ isLoading: boolean;
40
+ files: FileNode[];
41
+ selectedFile: SelectedFile | null;
42
+ selectedPath: string | null;
43
+ previewUrl: string | null;
44
+ boot: () => Promise<void>;
45
+ mountFiles: (files: FileSystemFile[] | FileSystemTree) => Promise<void>;
46
+ readFile: (path: string) => Promise<string>;
47
+ writeFile: (path: string, content: string) => Promise<void>;
48
+ selectFile: (path: string) => Promise<void>;
49
+ updateContent: (pathOrContent: string, content?: string) => void;
50
+ updateSelectedContent: (content: string) => void;
51
+ refreshTree: () => Promise<void>;
52
+ runCommand: (command: string) => Promise<{
53
+ exitCode: number;
54
+ output: string;
55
+ }>;
56
+ startDevServer: () => Promise<void>;
57
+ }
58
+ declare function useFileSystem(): UseFileSystemResult;
59
+
60
+ interface Extension {
61
+ id: string;
62
+ name: string;
63
+ language?: string;
64
+ loaded: boolean;
65
+ }
66
+ interface ExtensionEntry {
67
+ file: string;
68
+ language?: string;
69
+ }
70
+ interface ExtensionManifest {
71
+ languages: Record<string, {
72
+ extensions: string[];
73
+ icon?: string;
74
+ color?: string;
75
+ }>;
76
+ extensions: ExtensionEntry[];
77
+ }
78
+ interface UseExtensionsOptions {
79
+ appId: string;
80
+ loadOnMount?: boolean;
81
+ }
82
+ interface UseExtensionsResult {
83
+ extensions: Extension[];
84
+ manifest: ExtensionManifest;
85
+ isLoading: boolean;
86
+ error: string | null;
87
+ loadExtension: (extensionId: string) => Promise<void>;
88
+ loadExtensions: () => Promise<void>;
89
+ getExtensionForFile: (filename: string) => Extension | null;
90
+ }
91
+ declare function useExtensions(options: UseExtensionsOptions): UseExtensionsResult;
92
+
93
+ interface OpenFile {
94
+ path: string;
95
+ content: string;
96
+ isDirty: boolean;
97
+ language?: string;
98
+ }
99
+ interface UseFileEditorOptions {
100
+ extensions: UseExtensionsResult;
101
+ fileSystem: UseFileSystemResult;
102
+ onSchemaUpdate?: (schema: OrbitalSchema) => Promise<void>;
103
+ }
104
+ interface FileEditResult {
105
+ success: boolean;
106
+ action?: 'updated_schema' | 'converted_extension' | 'saved_extension' | 'saved';
107
+ error?: string;
108
+ }
109
+ interface UseFileEditorResult {
110
+ openFiles: OpenFile[];
111
+ activeFile: OpenFile | null;
112
+ isSaving: boolean;
113
+ openFile: (path: string) => Promise<void>;
114
+ closeFile: (path: string) => void;
115
+ setActiveFile: (path: string) => void;
116
+ updateFileContent: (path: string, content: string) => void;
117
+ handleFileEdit: (path: string, content: string) => Promise<FileEditResult>;
118
+ saveFile: (path: string) => Promise<void>;
119
+ saveAllFiles: () => Promise<void>;
120
+ }
121
+ declare function useFileEditor(options: UseFileEditorOptions): UseFileEditorResult;
122
+
123
+ type CompileStage = 'idle' | 'compiling' | 'done' | 'error';
124
+ interface CompileResult {
125
+ success: boolean;
126
+ files?: Array<{
127
+ path: string;
128
+ content: string;
129
+ }>;
130
+ errors?: string[];
131
+ }
132
+ interface UseCompileResult {
133
+ isCompiling: boolean;
134
+ stage: CompileStage;
135
+ lastResult: CompileResult | null;
136
+ error: string | null;
137
+ compileSchema: (schema: OrbitalSchema) => Promise<CompileResult | null>;
138
+ }
139
+ declare function useCompile(): UseCompileResult;
140
+
141
+ interface PreviewApp {
142
+ id: string;
143
+ name: string;
144
+ status: 'loading' | 'ready' | 'error';
145
+ schema?: OrbitalSchema;
146
+ graphView: {
147
+ version: string;
148
+ };
149
+ }
150
+ interface Notification {
151
+ id: string;
152
+ type: 'info' | 'warning' | 'error' | 'success';
153
+ title: string;
154
+ message: string;
155
+ timestamp: number;
156
+ read?: boolean;
157
+ actionLabel?: string;
158
+ onAction?: () => void;
159
+ autoDismiss?: boolean;
160
+ dismissAfter?: number;
161
+ }
162
+ interface NotificationsState {
163
+ notifications: Notification[];
164
+ isPanelOpen: boolean;
165
+ closePanel: () => void;
166
+ dismissNotification: (id: string) => void;
167
+ markAsRead: (id: string) => void;
168
+ clearAll: () => void;
169
+ }
170
+ interface ErrorToast {
171
+ message: string;
172
+ }
173
+ interface UsePreviewResult {
174
+ previewUrl: string | null;
175
+ isLoading: boolean;
176
+ error: string | null;
177
+ loadError: string | null;
178
+ app: PreviewApp | null;
179
+ isFullscreen: boolean;
180
+ isExecutingEvent: boolean;
181
+ errorToast: ErrorToast | null;
182
+ currentStateName: string | null;
183
+ notifications: NotificationsState;
184
+ startPreview: () => Promise<void>;
185
+ stopPreview: () => Promise<void>;
186
+ refresh: () => Promise<void>;
187
+ handleRefresh: () => Promise<void>;
188
+ handleReset: () => Promise<void>;
189
+ toggleFullscreen: () => void;
190
+ setErrorToast: (toast: ErrorToast | null) => void;
191
+ dismissErrorToast: () => void;
192
+ }
193
+ interface UsePreviewOptions {
194
+ appId?: string;
195
+ }
196
+ declare function usePreview(options?: UsePreviewOptions): UsePreviewResult;
197
+
198
+ interface DeepAgentActionRequest {
199
+ id: string;
200
+ type: string;
201
+ tool: string;
202
+ args: Record<string, FieldValue>;
203
+ description?: string;
204
+ allowedDecisions: ('approve' | 'edit' | 'reject')[];
205
+ status: 'pending' | 'approved' | 'rejected' | 'edited';
206
+ }
207
+ interface DeepAgentInterrupt {
208
+ id: string;
209
+ type: 'tool_calls' | 'confirmation' | 'error';
210
+ message?: string;
211
+ actionRequests: DeepAgentActionRequest[];
212
+ timestamp: number;
213
+ threadId?: string;
214
+ }
215
+ interface GenerationRequest {
216
+ id: string;
217
+ prompt: string;
218
+ status: 'pending' | 'running' | 'completed' | 'failed';
219
+ result?: OrbitalSchema;
220
+ error?: string;
221
+ }
222
+ interface GenerationProgress {
223
+ stage: string;
224
+ percent: number;
225
+ message: string;
226
+ }
227
+ interface UseDeepAgentGenerationResult {
228
+ requests: GenerationRequest[];
229
+ currentRequest: GenerationRequest | null;
230
+ isGenerating: boolean;
231
+ isLoading: boolean;
232
+ isComplete: boolean;
233
+ progress: GenerationProgress;
234
+ error: string | null;
235
+ interrupt: DeepAgentInterrupt | null;
236
+ generate: (prompt: string) => Promise<OrbitalSchema | null>;
237
+ startGeneration: (skill: string, prompt: string, options?: Record<string, FieldValue>) => Promise<void>;
238
+ cancelGeneration: () => void;
239
+ clearRequests: () => void;
240
+ submitInterruptDecisions: (decisions: FieldValue[]) => void;
241
+ }
242
+ declare function useDeepAgentGeneration(): UseDeepAgentGenerationResult;
243
+
244
+ interface ChatMessage {
245
+ id: string;
246
+ role: 'user' | 'assistant' | 'system';
247
+ content: string;
248
+ timestamp: number;
249
+ }
250
+ type AvatarRole = 'user' | 'assistant' | 'system';
251
+ type FileOperation = 'ls' | 'read_file' | 'write_file' | 'edit_file';
252
+ type Activity = {
253
+ type: 'message';
254
+ role: AvatarRole;
255
+ content: string;
256
+ timestamp: number;
257
+ isStreaming?: boolean;
258
+ } | {
259
+ type: 'tool_call';
260
+ tool: string;
261
+ args: Record<string, FieldValue>;
262
+ timestamp: number;
263
+ isExecuting?: boolean;
264
+ } | {
265
+ type: 'tool_result';
266
+ tool: string;
267
+ result: FieldValue | null;
268
+ success: boolean;
269
+ timestamp: number;
270
+ } | {
271
+ type: 'file_operation';
272
+ operation: FileOperation;
273
+ path: string;
274
+ success?: boolean;
275
+ timestamp: number;
276
+ } | {
277
+ type: 'schema_diff';
278
+ filePath: string;
279
+ hunks: DiffHunk[];
280
+ timestamp: number;
281
+ } | {
282
+ type: 'error';
283
+ message: string;
284
+ code?: string;
285
+ timestamp: number;
286
+ };
287
+ interface TodoActivity {
288
+ type: 'thinking' | 'tool_call' | 'tool_result' | 'code_change';
289
+ content: string;
290
+ timestamp: number;
291
+ tool?: string;
292
+ success?: boolean;
293
+ filePath?: string;
294
+ diff?: string;
295
+ }
296
+ interface Todo {
297
+ id: string;
298
+ task: string;
299
+ status: 'pending' | 'in_progress' | 'completed';
300
+ latestActivity?: TodoActivity;
301
+ activityHistory?: TodoActivity[];
302
+ }
303
+ interface DiffHunk {
304
+ oldStart: number;
305
+ oldLines: number;
306
+ newStart: number;
307
+ newLines: number;
308
+ lines: Array<{
309
+ type: 'add' | 'remove' | 'context';
310
+ content: string;
311
+ }>;
312
+ }
313
+ interface SchemaDiff {
314
+ id: string;
315
+ filePath: string;
316
+ hunks: DiffHunk[];
317
+ timestamp: number;
318
+ addedLines: number;
319
+ removedLines: number;
320
+ }
321
+ type AgentStatus = 'idle' | 'running' | 'complete' | 'error' | 'interrupted';
322
+ interface UseAgentChatOptions {
323
+ appId?: string;
324
+ onComplete?: (schema?: OrbitalSchema) => void;
325
+ onSchemaChange?: (diff?: OrbitalSchema) => void;
326
+ onError?: (error: Error | string) => void;
327
+ }
328
+ interface UseAgentChatResult {
329
+ messages: ChatMessage[];
330
+ status: AgentStatus;
331
+ activities: Activity[];
332
+ todos: Todo[];
333
+ schemaDiffs: SchemaDiff[];
334
+ isLoading: boolean;
335
+ error: string | null;
336
+ threadId: string | null;
337
+ interrupt: DeepAgentInterrupt | null;
338
+ sendMessage: (content: string) => Promise<void>;
339
+ startGeneration: (skill: string | string[], prompt: string, options?: Record<string, FieldValue>) => Promise<void>;
340
+ continueConversation: (message: string | string[]) => Promise<void>;
341
+ resumeWithDecision: (decisions: FieldValue[]) => Promise<void>;
342
+ cancel: () => void;
343
+ clearMessages: () => void;
344
+ clearHistory: () => void;
345
+ }
346
+ declare function useAgentChat(options?: UseAgentChatOptions): UseAgentChatResult;
347
+
348
+ interface LLMErrorContext {
349
+ rawValuePreview?: string;
350
+ expectedType?: string;
351
+ actualType?: string;
352
+ source?: {
353
+ agent: 'requirements' | 'builder' | 'view-planner';
354
+ operation: string;
355
+ promptHash?: string;
356
+ };
357
+ tokenUsage?: {
358
+ prompt: number;
359
+ completion: number;
360
+ };
361
+ }
362
+ interface ValidationError {
363
+ code: string;
364
+ message: string;
365
+ path?: string;
366
+ severity: 'error' | 'warning';
367
+ suggestion?: string;
368
+ validValues?: string[];
369
+ expectedShape?: string;
370
+ fixGuidance?: string;
371
+ llmContext?: LLMErrorContext;
372
+ }
373
+ interface ValidationResult {
374
+ valid: boolean;
375
+ errors: ValidationError[];
376
+ warnings: ValidationError[];
377
+ }
378
+ type ValidationStage = 'idle' | 'validating' | 'fixing' | 'complete';
379
+ interface UseValidationResult {
380
+ result: ValidationResult | null;
381
+ isValidating: boolean;
382
+ error: string | null;
383
+ stage: ValidationStage;
384
+ isFixing: boolean;
385
+ progressMessage: string | null;
386
+ errors: ValidationError[];
387
+ warnings: ValidationError[];
388
+ isValid: boolean;
389
+ validate: (appId: string) => Promise<ValidationResult>;
390
+ clearResult: () => void;
391
+ reset: () => void;
392
+ }
393
+ declare function useValidation(): UseValidationResult;
394
+
395
+ /**
396
+ * Hook to bridge UI events to state machine dispatch.
397
+ *
398
+ * @param dispatch - The state machine dispatch function
399
+ * @param traitName - Owning trait name; used to construct the qualified
400
+ * subscription key `UI:{traitName}.{event}`. Required — bare-key
401
+ * subscriptions were removed when the bus namespace unified on the
402
+ * listens grammar (gap #13, Phase 4 of the cross-orbital plan).
403
+ * @param validEvents - Local event names (transition triggers) the
404
+ * trait reacts to. The hook subscribes to `UI:{traitName}.{event}`
405
+ * for each entry.
406
+ * @param eventBusInstance - Optional event bus instance (for testing)
407
+ */
408
+ declare function useUIEvents<E extends string>(dispatch: (event: E, payload?: EventPayload) => void | Promise<void>, traitName: string, validEvents: readonly E[], eventBusInstance?: ReturnType<typeof useEventBus>): void;
409
+ /**
410
+ * Hook to subscribe to cross-trait listens (gap #13, Phase 4 codegen).
411
+ *
412
+ * The schema's `listens { Source EVENT -> TRIGGER }` block resolves at
413
+ * lower-time to a typed `ListenSource` enum (intra-orbital `Trait` or
414
+ * cross-orbital `Orbital.Trait`). Codegen materializes one
415
+ * `useTraitListens` call per trait, listing every `(sourceTrait,
416
+ * sourceEvent, localTrigger)` tuple from the listens block. The hook
417
+ * subscribes to the qualified bus key — `UI:Trait.EVENT` (intra-orbital)
418
+ * or `UI:Orbital.Trait.EVENT` (cross-orbital) — and dispatches the
419
+ * local trigger when the source fires.
420
+ *
421
+ * Replaces the old bare-event cross-trait fan-out that lived inside
422
+ * `useUIEvents`. Pre-unification, `useUIEvents` subscribed to bare
423
+ * `EVENT` keys and matched on `source.trait !== own`; post-unification,
424
+ * the qualified bus key carries the source identity directly, no
425
+ * `source` filtering needed.
426
+ */
427
+ interface TraitListenSpec<E extends string> {
428
+ /** Qualified `Trait.EVENT` or `Orbital.Trait.EVENT` source. */
429
+ sourceKey: string;
430
+ /** Local trigger event to dispatch when the source fires. */
431
+ trigger: E;
432
+ }
433
+ declare function useTraitListens<E extends string>(dispatch: (event: E, payload?: EventPayload) => void, listens: readonly TraitListenSpec<E>[], eventBusInstance?: ReturnType<typeof useEventBus>): void;
434
+
435
+ /**
436
+ * At-most-once delivery: one physical emit reaches a trait once per triggered
437
+ * event. Every key one emit fans to (scope-chain bubbling, a listen route)
438
+ * carries the same `source` object, so the first delivery to a (trait, event)
439
+ * claims it and the rest are the same event again. A sourceless emit is never
440
+ * deduplicated. Shared by the runtime ingress (`useBusIngress`), `useUIEvents`
441
+ * and compiled listens.
442
+ */
443
+
444
+ declare function claimDelivery(source: BusEventSource | undefined, trait: string, event: string): boolean;
445
+
446
+ /** Notification callback fired after a `commit()` for the subscribed entity id. */
447
+ type SharedEntitySubscriber = () => void;
448
+ /**
449
+ * One writer trait's per-frame step: reads the live running scratch
450
+ * (reflecting every earlier writer's writes this frame) and returns its own
451
+ * field writes. Pure — writers never call `store.commit`; only `runTickFrame`
452
+ * does, once per frame.
453
+ */
454
+ type SharedEntityWriter = (scratch: EntityFrameState) => readonly EntityFieldWrite[];
455
+ /** Manager surface, keyed by entity id. */
456
+ interface SharedEntityStore {
457
+ getSnapshot: (entityId: string) => EntityFrameState;
458
+ subscribe: (entityId: string, callback: SharedEntitySubscriber) => () => void;
459
+ commit: (entityId: string, nextState: EntityFrameState) => void;
460
+ /**
461
+ * Set the initial state for an entity id, but ONLY if nothing is committed
462
+ * yet — idempotent, and (unlike `commit`) does NOT notify subscribers, so it
463
+ * is safe to call during render. Both execution paths seed from the entity's
464
+ * declared field defaults at init, so frame 0 reads the defaults on both.
465
+ */
466
+ seed: (entityId: string, initialState: EntityFrameState) => void;
467
+ }
468
+ /**
469
+ * Create a standalone shared-entity store. Plain factory — no React — so a
470
+ * clock owner (the interpreter's TickScheduler, or a codegen rAF
471
+ * `useEffect`) can hold one instance and pass it to `runTickFrame` without
472
+ * going through a hook.
473
+ */
474
+ declare function createSharedEntityStore(): SharedEntityStore;
475
+ /**
476
+ * React hook: one stable `SharedEntityStore` instance for this component's
477
+ * lifetime (useUISlotManager's ref-backed-instance pattern — no re-creation
478
+ * across re-renders). Callers own one store per running orbital instance and
479
+ * thread it to each writer trait plus the render trait via `runTickFrame` /
480
+ * `useSharedEntitySnapshot`.
481
+ */
482
+ declare function useSharedEntityStore(): SharedEntityStore;
483
+ /**
484
+ * Cross-component access to ONE `SharedEntityStore` instance. `useSharedEntityStore`
485
+ * is `useRef`-scoped to its own call site — correct for a single owner (the JS
486
+ * runtime path's `useTraitStateMachine` interprets a whole orbital in one hook
487
+ * call), but the compiled path (`orbital-rust`'s TS-shell codegen) generates one
488
+ * hook + component PER TRAIT, so several independent trait hooks bound to the
489
+ * SAME `[shared]` entity need the SAME store instance. A page-level owner calls
490
+ * `useSharedEntityStore()` once and provides it here; every trait hook on that
491
+ * page reads it back via `useSharedEntityStoreContext()` instead of creating its
492
+ * own disconnected store. Not used by the JS runtime path today — purely
493
+ * additive, zero effect on `useSharedEntityStore`'s existing single-caller
494
+ * behavior.
495
+ */
496
+ declare const SharedEntityStoreContext: React$1.Context<SharedEntityStore | null>;
497
+ /** Read the page-level `SharedEntityStore` provided by `SharedEntityStoreContext`. */
498
+ declare function useSharedEntityStoreContext(): SharedEntityStore;
499
+ /**
500
+ * Bridge one entity's snapshot into React via `useSyncExternalStore` (the
501
+ * codebase's established store->React bridge, see `lib/perf.ts`). The render
502
+ * trait re-renders exactly when `runTickFrame` commits this entity — never on
503
+ * an intermediate per-writer write, since those never call `store.commit`.
504
+ */
505
+ declare function useSharedEntitySnapshot(store: SharedEntityStore, entityId: string): EntityFrameState;
506
+ /**
507
+ * Run one frame for `entityId`: fold each writer's writes into a running
508
+ * scratch in binding order via `mergeEntityFrame` (field-level, so writer
509
+ * k+1 reads writer k's same-frame writes), then commit the merged result
510
+ * exactly ONCE. Clock-agnostic — the caller (a TickScheduler tick or a
511
+ * codegen rAF loop) invokes this once per frame; it owns no timer itself.
512
+ */
513
+ declare function runTickFrame(entityId: string, orderedWriters: readonly SharedEntityWriter[], store: SharedEntityStore): EntityFrameState;
514
+
515
+ /**
516
+ * Query state for filters and search
517
+ */
518
+ interface QueryState {
519
+ search?: string;
520
+ filters?: Record<string, FieldValue>;
521
+ sortField?: string;
522
+ sortDirection?: 'asc' | 'desc';
523
+ }
524
+ /**
525
+ * Query singleton entity reference
526
+ */
527
+ interface QuerySingletonEntity {
528
+ name: string;
529
+ fields: Record<string, FieldValue>;
530
+ }
531
+ /**
532
+ * Query singleton result type
533
+ */
534
+ interface QuerySingletonResult {
535
+ state: QueryState;
536
+ setState: (state: Partial<QueryState>) => void;
537
+ reset: () => void;
538
+ }
539
+ interface QuerySingletonState {
540
+ /** Current search term */
541
+ search: string;
542
+ /** Set search term */
543
+ setSearch: (value: string) => void;
544
+ /** Current filters */
545
+ filters: Record<string, FieldValue>;
546
+ /** Set a filter value */
547
+ setFilter: (key: string, value: FieldValue) => void;
548
+ /** Clear all filters */
549
+ clearFilters: () => void;
550
+ /** Current sort field */
551
+ sortField?: string;
552
+ /** Current sort direction */
553
+ sortDirection?: 'asc' | 'desc';
554
+ /** Set sort */
555
+ setSort: (field: string, direction: 'asc' | 'desc') => void;
556
+ }
557
+ /**
558
+ * Hook for accessing a query singleton by name
559
+ *
560
+ * @param query - Query singleton name (e.g., "@TaskQuery")
561
+ * @returns Query singleton state or null if no query provided
562
+ *
563
+ * @example
564
+ * ```tsx
565
+ * const queryState = useQuerySingleton('@TaskQuery');
566
+ *
567
+ * // Use search state
568
+ * queryState?.search
569
+ * queryState?.setSearch('new search term')
570
+ * ```
571
+ */
572
+ declare function useQuerySingleton(query?: string): QuerySingletonState | null;
573
+ /**
574
+ * Parse a query binding string to extract the query singleton name
575
+ *
576
+ * @param binding - Binding string like "@TaskQuery.search" or "@TaskQuery"
577
+ * @returns Object with query name and optional field path
578
+ *
579
+ * @example
580
+ * ```tsx
581
+ * parseQueryBinding('@TaskQuery.search')
582
+ * // { query: 'TaskQuery', field: 'search' }
583
+ *
584
+ * parseQueryBinding('@TaskQuery')
585
+ * // { query: 'TaskQuery', field: undefined }
586
+ * ```
587
+ */
588
+ declare function parseQueryBinding(binding: string): {
589
+ query: string;
590
+ field?: string;
591
+ };
592
+
593
+ /**
594
+ * Auth Context Hook Stub
595
+ *
596
+ * Provides a placeholder auth context for the design system.
597
+ * Applications should provide their own AuthContext provider
598
+ * that implements this interface.
599
+ */
600
+ interface AuthUser {
601
+ uid: string;
602
+ email: string | null;
603
+ displayName: string | null;
604
+ photoURL: string | null;
605
+ }
606
+ interface AuthContextValue {
607
+ user: AuthUser | null;
608
+ loading: boolean;
609
+ signIn?: () => Promise<void>;
610
+ signOut?: () => Promise<void>;
611
+ }
612
+ /**
613
+ * Stub hook that returns empty auth context.
614
+ * Applications should wrap their app with an AuthProvider
615
+ * that supplies real auth state.
616
+ */
617
+ declare function useAuthContext(): AuthContextValue;
618
+
619
+ interface SwipeGestureOptions {
620
+ /** Minimum distance in px to trigger a swipe (default: 50) */
621
+ threshold?: number;
622
+ /** Minimum velocity in px/ms to qualify (default: 0.3) */
623
+ velocityThreshold?: number;
624
+ /** Prevent default touch behavior during swipe (default: false) */
625
+ preventDefault?: boolean;
626
+ }
627
+ interface SwipeGestureResult {
628
+ onSwipeLeft?: () => void;
629
+ onSwipeRight?: () => void;
630
+ onSwipeUp?: () => void;
631
+ onSwipeDown?: () => void;
632
+ }
633
+ interface SwipeHandlers {
634
+ onPointerDown: (e: React__default.PointerEvent) => void;
635
+ onPointerMove: (e: React__default.PointerEvent) => void;
636
+ onPointerUp: (e: React__default.PointerEvent) => void;
637
+ onPointerCancel: (e: React__default.PointerEvent) => void;
638
+ /** Current horizontal offset during swipe (for animation) */
639
+ offsetX: number;
640
+ /** Whether a swipe gesture is in progress */
641
+ isSwiping: boolean;
642
+ }
643
+
644
+ declare function useSwipeGesture(callbacks: SwipeGestureResult, options?: SwipeGestureOptions): SwipeHandlers;
645
+
646
+ interface LongPressOptions {
647
+ /** Hold duration in ms before triggering (default: 500) */
648
+ duration?: number;
649
+ /** Movement tolerance in px before canceling (default: 10) */
650
+ moveThreshold?: number;
651
+ }
652
+ interface LongPressHandlers {
653
+ onPointerDown: (e: React__default.PointerEvent) => void;
654
+ onPointerMove: (e: React__default.PointerEvent) => void;
655
+ onPointerUp: () => void;
656
+ onPointerCancel: () => void;
657
+ /** Whether the long press is currently active (held down, timer running) */
658
+ isPressed: boolean;
659
+ }
660
+ declare function useLongPress(onLongPress: () => void, options?: LongPressOptions): LongPressHandlers;
661
+
662
+ interface DragReorderResult<T> {
663
+ /** The reordered items array */
664
+ items: T[];
665
+ /** Index of the item currently being dragged (-1 if not dragging) */
666
+ dragIndex: number;
667
+ /** Index of the drop target (-1 if not over any target) */
668
+ dragOverIndex: number;
669
+ /** Whether a drag is in progress */
670
+ isDragging: boolean;
671
+ /** Props to spread on the drag handle element for a given index */
672
+ getDragHandleProps: (index: number) => {
673
+ onPointerDown: (e: React__default.PointerEvent) => void;
674
+ style: React__default.CSSProperties;
675
+ 'aria-grabbed': boolean;
676
+ role: 'button';
677
+ };
678
+ /** Props to spread on each list item for a given index */
679
+ getItemProps: (index: number) => {
680
+ onPointerMove: (e: React__default.PointerEvent) => void;
681
+ onPointerUp: () => void;
682
+ 'aria-dropeffect': string;
683
+ style: React__default.CSSProperties;
684
+ };
685
+ }
686
+ declare function useDragReorder<T>(initialItems: T[], onReorder: (fromIndex: number, toIndex: number, item: T) => void): DragReorderResult<T>;
687
+
688
+ interface PullToRefreshOptions {
689
+ /** Distance in px to pull before triggering refresh (default: 60) */
690
+ threshold?: number;
691
+ /** Maximum pull distance in px (default: 120) */
692
+ maxPull?: number;
693
+ }
694
+ interface PullToRefreshResult {
695
+ /** Current pull distance in px */
696
+ pullDistance: number;
697
+ /** Whether the user is actively pulling */
698
+ isPulling: boolean;
699
+ /** Whether a refresh was triggered and is in progress */
700
+ isRefreshing: boolean;
701
+ /** Props to spread on the scrollable container */
702
+ containerProps: {
703
+ onTouchStart: (e: React__default.TouchEvent) => void;
704
+ onTouchMove: (e: React__default.TouchEvent) => void;
705
+ onTouchEnd: () => void;
706
+ style: React__default.CSSProperties;
707
+ };
708
+ /** Call this when the refresh operation completes */
709
+ endRefresh: () => void;
710
+ }
711
+ declare function usePullToRefresh(onRefresh: () => void, options?: PullToRefreshOptions): PullToRefreshResult;
712
+
713
+ /**
714
+ * Unified pointer/touch gesture detection for canvas surfaces (graph, isometric, etc.).
715
+ *
716
+ * It owns the hard part — pointer tracking + two-finger pinch (scale factor + centroid) —
717
+ * and DELEGATES application to the consumer via callbacks, so each canvas applies pan/zoom
718
+ * in its own coordinate convention (screen-offset vs world-camera). A single pointer is
719
+ * passed straight through to the consumer's domain handlers (pan / node-drag / tile-select);
720
+ * a second pointer takes over as a pinch and cancels any in-flight single-pointer action.
721
+ *
722
+ * Pointer Events cover mouse, touch and pen, so this REPLACES mouse handlers — no dual paths.
723
+ */
724
+ interface CanvasGestureCallbacks {
725
+ /** Single-pointer down — start the consumer's pan / drag / select (domain-specific). */
726
+ onPointerDown?: (e: React.PointerEvent<HTMLCanvasElement>) => void;
727
+ /** Single-pointer move. */
728
+ onPointerMove?: (e: React.PointerEvent<HTMLCanvasElement>) => void;
729
+ /** Single-pointer up. */
730
+ onPointerUp?: (e: React.PointerEvent<HTMLCanvasElement>) => void;
731
+ /**
732
+ * Multiplicative zoom around a canvas-local point. Fired by wheel and by pinch.
733
+ * Consumer applies `newZoom = clamp(oldZoom * factor)` keeping (centerX,centerY) fixed.
734
+ */
735
+ onZoom?: (factor: number, centerX: number, centerY: number) => void;
736
+ /** Two-finger pan delta in canvas-local px (fired alongside pinch). */
737
+ onPanDelta?: (dx: number, dy: number) => void;
738
+ /** A second pointer arrived — cancel any single-pointer pan/drag the consumer started. */
739
+ onMultiTouchStart?: () => void;
740
+ }
741
+ interface UseCanvasGesturesOptions extends CanvasGestureCallbacks {
742
+ /** The canvas being gestured on (for coordinate translation). */
743
+ canvasRef: React.RefObject<HTMLCanvasElement | null>;
744
+ /** When false, all gestures are inert. Default true. */
745
+ enabled?: boolean;
746
+ /** Wheel zoom step per notch (>1). Default 1.1. */
747
+ wheelStep?: number;
748
+ }
749
+ interface CanvasGestureHandlers {
750
+ onPointerDown: (e: React.PointerEvent<HTMLCanvasElement>) => void;
751
+ onPointerMove: (e: React.PointerEvent<HTMLCanvasElement>) => void;
752
+ onPointerUp: (e: React.PointerEvent<HTMLCanvasElement>) => void;
753
+ onPointerCancel: (e: React.PointerEvent<HTMLCanvasElement>) => void;
754
+ onWheel: (e: WheelEvent) => void;
755
+ }
756
+ declare function useCanvasGestures(options: UseCanvasGesturesOptions): CanvasGestureHandlers;
757
+
758
+ /** Discriminated payload carried by every drag operation. */
759
+ interface DraggablePayload {
760
+ kind: 'pattern' | 'behavior' | 'tree-node' | 'event-wire';
761
+ data: EventPayload;
762
+ }
763
+ interface UseDraggableOptions {
764
+ /** The payload that will be serialised into dataTransfer. */
765
+ payload: DraggablePayload;
766
+ /** When true the element cannot be dragged. */
767
+ disabled?: boolean;
768
+ }
769
+ interface UseDraggableResult {
770
+ /** Spread these onto the draggable element. */
771
+ dragProps: {
772
+ draggable: boolean;
773
+ onDragStart: (e: React.DragEvent) => void;
774
+ onDragEnd: (e: React.DragEvent) => void;
775
+ 'aria-grabbed': boolean;
776
+ };
777
+ /** True while the element is being dragged. */
778
+ isDragging: boolean;
779
+ }
780
+ declare const ALMADAR_DND_MIME = "application/x-almadar-dnd";
781
+ declare function useDraggable({ payload, disabled }: UseDraggableOptions): UseDraggableResult;
782
+
783
+ interface UseDropZoneOptions {
784
+ /** Which payload kinds this zone accepts. */
785
+ accepts: DraggablePayload['kind'][];
786
+ /** Called when a valid payload is dropped. */
787
+ onDrop: (payload: DraggablePayload, position: {
788
+ x: number;
789
+ y: number;
790
+ }) => void;
791
+ /** When true the zone rejects all drops. */
792
+ disabled?: boolean;
793
+ }
794
+ interface UseDropZoneResult {
795
+ /** Spread these onto the drop-target element. */
796
+ dropProps: {
797
+ onDragOver: (e: React.DragEvent) => void;
798
+ onDragLeave: (e: React.DragEvent) => void;
799
+ onDrop: (e: React.DragEvent) => void;
800
+ };
801
+ /** True while a valid drag payload is hovering over this zone. */
802
+ isOver: boolean;
803
+ }
804
+ declare function useDropZone({ accepts, onDrop, disabled }: UseDropZoneOptions): UseDropZoneResult;
805
+
806
+ interface Positioned {
807
+ id: string;
808
+ x: number;
809
+ y: number;
810
+ }
811
+ interface RenderInterpolationOptions {
812
+ /** Expected tick interval in ms (default: 1000/30 ≈ 33.3ms) */
813
+ tickIntervalMs?: number;
814
+ }
815
+ interface RenderInterpolationHandle<T extends Positioned> {
816
+ /** Call when a new authoritative snapshot arrives from the model */
817
+ onSnapshot: (entities: readonly T[]) => void;
818
+ /** Returns interpolated positions for the current rAF timestamp; falls back to authoritative values */
819
+ getInterpolated: (now: number) => Map<string, {
820
+ x: number;
821
+ y: number;
822
+ }>;
823
+ /** Start the rAF loop; call the supplied draw fn on every frame */
824
+ startLoop: (draw: (positions: Map<string, {
825
+ x: number;
826
+ y: number;
827
+ }>) => void) => () => void;
828
+ }
829
+ /**
830
+ * Fixed-timestep render interpolation between the last two authoritative model snapshots.
831
+ *
832
+ * Buffers two snapshots. On each rAF frame computes
833
+ * alpha = clamp((now - lastArrival) / tickIntervalMs, 0, 1)
834
+ * and lerps x/y between prev and curr, matched by entity id.
835
+ * New or removed entities fall back to their authoritative value directly.
836
+ * Never throws; never causes a React re-render per frame.
837
+ */
838
+ declare function useRenderInterpolation<T extends Positioned>(options?: RenderInterpolationOptions): RenderInterpolationHandle<T>;
839
+
840
+ /**
841
+ * GitHub connection status
842
+ */
843
+ interface GitHubStatus {
844
+ connected: boolean;
845
+ username?: string;
846
+ avatarUrl?: string;
847
+ scopes?: string[];
848
+ connectedAt?: number;
849
+ lastUsedAt?: number;
850
+ }
851
+ /**
852
+ * GitHub repository
853
+ */
854
+ interface GitHubRepo {
855
+ id: number;
856
+ name: string;
857
+ fullName: string;
858
+ owner: string;
859
+ isPrivate: boolean;
860
+ description: string | null;
861
+ defaultBranch: string;
862
+ url: string;
863
+ }
864
+ /**
865
+ * Hook to get GitHub connection status
866
+ */
867
+ declare function useGitHubStatus(): _tanstack_react_query.UseQueryResult<GitHubStatus, Error>;
868
+ /**
869
+ * Hook to connect GitHub (initiate OAuth flow)
870
+ */
871
+ declare function useConnectGitHub(): {
872
+ connectGitHub: () => void;
873
+ };
874
+ /**
875
+ * Hook to disconnect GitHub
876
+ */
877
+ declare function useDisconnectGitHub(): _tanstack_react_query.UseMutationResult<unknown, Error, void, unknown>;
878
+ /**
879
+ * Hook to list GitHub repositories
880
+ */
881
+ declare function useGitHubRepos(page?: number, perPage?: number): _tanstack_react_query.UseQueryResult<{
882
+ repos: GitHubRepo[];
883
+ page: number;
884
+ perPage: number;
885
+ }, Error>;
886
+ /**
887
+ * Hook to get repository details
888
+ */
889
+ declare function useGitHubRepo(owner: string, repo: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<{
890
+ repo: GitHubRepo;
891
+ }, Error>;
892
+ /**
893
+ * Hook to list repository branches
894
+ */
895
+ declare function useGitHubBranches(owner: string, repo: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<{
896
+ branches: string[];
897
+ }, Error>;
898
+
899
+ /**
900
+ * The active page's document head on client navigation — the same declared
901
+ * contract the build writes into each route document: title, description,
902
+ * canonical, social tags and the robots directive, with `i18n/t` metadata
903
+ * resolved from the active locale's catalog. The tags it writes are marked
904
+ * and replaced on every page change; entering an `authenticated` or
905
+ * `noindex` page drops the public tags and declares `noindex`.
906
+ *
907
+ * @packageDocumentation
908
+ */
909
+
910
+ interface PageHeadInput {
911
+ title?: PageMeta;
912
+ description?: PageMeta;
913
+ access?: PageAccess;
914
+ indexing?: PageIndexing;
915
+ /** The app's `origin:`, for the canonical URL. */
916
+ origin?: string;
917
+ /** The app's `siteName:` — the document title of a page that declares none. */
918
+ siteName?: string;
919
+ /** The concrete path on screen. */
920
+ path: string;
921
+ /** The page's translations (`localeAlternates`), written as hreflang links. */
922
+ alternates?: readonly LocaleAlternate[];
923
+ /** The app's first locale, the `x-default` alternate. */
924
+ defaultLocale?: string;
925
+ }
926
+ /** Writes `input`'s head into the document; `null` writes nothing. */
927
+ declare function usePageHead(input: PageHeadInput | null): void;
928
+
929
+ /**
930
+ * Whether a `[visible]` tick may fire now: its trait group is not off screen (LOLO §11).
931
+ * Watches the group while mounted so `TraitScopeProvider` tracks the group's output.
932
+ */
933
+ declare function useTickVisibility(traits: readonly string[]): () => boolean;
934
+
935
+ export { ALMADAR_DND_MIME, SharedEntityStoreContext, claimDelivery, createSharedEntityStore, parseQueryBinding, runTickFrame, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useLongPress, usePageHead, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTickVisibility, useTraitListens, useUIEvents, useValidation };
936
+ export type { AuthContextValue, AuthUser, CanvasGestureCallbacks, CanvasGestureHandlers, CompileResult, CompileStage, DragReorderResult, DraggablePayload, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, LongPressHandlers, LongPressOptions, OpenFile, PageHeadInput, Positioned, PullToRefreshOptions, PullToRefreshResult, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RenderInterpolationHandle, RenderInterpolationOptions, SelectedFile, SharedEntityStore, SharedEntitySubscriber, SharedEntityWriter, SwipeGestureOptions, SwipeGestureResult, SwipeHandlers, TraitListenSpec, UseCanvasGesturesOptions, UseCompileResult, UseDraggableOptions, UseDraggableResult, UseDropZoneOptions, UseDropZoneResult, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult };