catalyst-core 0.3.0-beta.4 → 0.3.0-canary.1

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 (316) hide show
  1. package/changelog.md +80 -0
  2. package/dist/errors/generateDocs.js +100 -0
  3. package/dist/errors/index.js +243 -0
  4. package/dist/errors/registry.js +483 -0
  5. package/dist/errors-index.json +506 -0
  6. package/dist/globals.d.ts +62 -0
  7. package/dist/index.d.ts +5 -0
  8. package/dist/index.jsx +5 -8
  9. package/dist/logger.js +1 -1
  10. package/dist/native/androidProject/app/build.gradle.kts +142 -7
  11. package/dist/native/androidProject/app/src/main/AndroidManifest.xml +4 -0
  12. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt +2 -2
  13. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/BarcodeDetector.kt +3 -0
  14. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/CameraSessionManager.kt +3 -0
  15. package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FrameworkServerUtils.kt +43 -8
  16. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/BridgeUtilsTest.kt +181 -1
  17. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/CameraUtilsTest.kt +156 -236
  18. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FileSizeRouterUtilsTest.kt +471 -0
  19. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FileUtilsTest.kt +222 -226
  20. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/FrameworkServerUtilsTest.kt +300 -0
  21. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/IntentUtilsTest.kt +244 -0
  22. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/MetricsMonitorTest.kt +359 -0
  23. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/NativeBridgeTest.kt +108 -63
  24. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/NotificationUtilsTest.kt +329 -385
  25. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/OfflineCacheServiceTest.kt +302 -0
  26. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/PerfEventBufferTest.kt +133 -0
  27. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/UtilsKtTest.kt +152 -0
  28. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/WebCacheManagerTest.kt +145 -324
  29. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/BarcodeDetectorTest.kt +132 -0
  30. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/HoldControllerTest.kt +155 -0
  31. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/TorchControllerTest.kt +150 -0
  32. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/VideoStreamStateMachineTest.kt +120 -0
  33. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/VideoStreamStateTest.kt +62 -0
  34. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/ViewfinderMapperTest.kt +143 -0
  35. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/camera/ZoomControllerTest.kt +421 -0
  36. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/design/DesignTokensTest.kt +207 -0
  37. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/plugins/PluginBridgeTest.kt +368 -0
  38. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/FridaDetectorTest.kt +193 -0
  39. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/SecurityCheckManagerTest.kt +260 -0
  40. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/security/SecurityCheckSchedulerTest.kt +166 -0
  41. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/DeviceInfoUtilsTest.kt +167 -0
  42. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/DownloadUtilsTest.kt +197 -0
  43. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/NetworkMonitorTest.kt +271 -0
  44. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/PushNotificationUtilsTest.kt +119 -0
  45. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/utils/SafeAreaUtilsTest.kt +108 -0
  46. package/dist/native/androidProject/build.gradle.kts +1 -0
  47. package/dist/native/androidProject/gradle/libs.versions.toml +26 -0
  48. package/dist/native/androidProject/settings.gradle.kts +11 -8
  49. package/dist/native/androidSetup.js +2 -2
  50. package/dist/native/bridge/WebBridge.d.ts +98 -0
  51. package/dist/native/bridge/WebBridge.js +40 -6
  52. package/dist/native/bridge/constants/NativeInterfaces.d.ts +391 -0
  53. package/dist/native/bridge/errors.d.ts +67 -0
  54. package/dist/native/bridge/errors.js +66 -151
  55. package/dist/native/bridge/hooks/index.d.ts +13 -0
  56. package/dist/native/bridge/hooks/index.js +0 -6
  57. package/dist/native/bridge/hooks/useAI.d.ts +1 -0
  58. package/dist/native/bridge/hooks/useAI.js +3 -1
  59. package/dist/native/bridge/hooks/useCamera.d.ts +86 -0
  60. package/dist/native/bridge/hooks/useCamera.js +35 -6
  61. package/dist/native/bridge/hooks/useDataProtection.d.ts +17 -0
  62. package/dist/native/bridge/hooks/useDeviceInfo.d.ts +34 -0
  63. package/dist/native/bridge/hooks/useDeviceInfo.js +5 -0
  64. package/dist/native/bridge/hooks/useFilePicker.d.ts +53 -0
  65. package/dist/native/bridge/hooks/useFilePicker.js +13 -0
  66. package/dist/native/bridge/hooks/useGoogleSignIn.d.ts +12 -0
  67. package/dist/native/bridge/hooks/useHapticFeedback.d.ts +76 -0
  68. package/dist/native/bridge/hooks/useHapticFeedback.js +6 -1
  69. package/dist/native/bridge/hooks/useIntent.d.ts +33 -0
  70. package/dist/native/bridge/hooks/useIntent.js +2 -0
  71. package/dist/native/bridge/hooks/useNativeTransition.d.ts +53 -0
  72. package/dist/native/bridge/hooks/useNativeTransition.js +14 -7
  73. package/dist/native/bridge/hooks/useNetworkStatus.d.ts +22 -0
  74. package/dist/native/bridge/hooks/useNetworkStatus.js +7 -0
  75. package/dist/native/bridge/hooks/useNotification.d.ts +83 -0
  76. package/dist/native/bridge/hooks/useNotification.js +81 -34
  77. package/dist/native/bridge/hooks/useSafeArea.d.ts +12 -0
  78. package/dist/native/bridge/hooks/useSafeArea.js +8 -0
  79. package/dist/native/bridge/hooks/useVideoStream.d.ts +67 -0
  80. package/dist/native/bridge/hooks/useVideoStream.js +38 -52
  81. package/dist/native/bridge/hooks/utils.d.ts +4 -0
  82. package/dist/native/bridge/hooks.d.ts +1 -0
  83. package/dist/native/bridge/perf/collectors/ApiCollector.d.ts +30 -0
  84. package/dist/native/bridge/perf/collectors/ApiCollector.js +4 -0
  85. package/dist/native/bridge/perf/collectors/CacheCollector.d.ts +43 -0
  86. package/dist/native/bridge/perf/collectors/CacheCollector.js +4 -0
  87. package/dist/native/bridge/perf/collectors/HookCollector.d.ts +37 -0
  88. package/dist/native/bridge/perf/collectors/HookCollector.js +4 -0
  89. package/dist/native/bridge/perf/collectors/InsightsCollector.d.ts +103 -0
  90. package/dist/native/bridge/perf/collectors/InsightsCollector.js +4 -0
  91. package/dist/native/bridge/perf/collectors/InteractionCollector.d.ts +53 -0
  92. package/dist/native/bridge/perf/collectors/InteractionCollector.js +4 -0
  93. package/dist/native/bridge/perf/collectors/KeyboardCollector.d.ts +30 -0
  94. package/dist/native/bridge/perf/collectors/KeyboardCollector.js +4 -0
  95. package/dist/native/bridge/perf/collectors/NavigationCollector.d.ts +37 -0
  96. package/dist/native/bridge/perf/collectors/NavigationCollector.js +4 -0
  97. package/dist/native/bridge/perf/collectors/NetworkTimingCollector.d.ts +30 -0
  98. package/dist/native/bridge/perf/collectors/NetworkTimingCollector.js +4 -0
  99. package/dist/native/bridge/perf/collectors/RenderCollector.d.ts +47 -0
  100. package/dist/native/bridge/perf/collectors/RenderCollector.js +8 -0
  101. package/dist/native/bridge/perf/collectors/ScrollCollector.d.ts +29 -0
  102. package/dist/native/bridge/perf/collectors/ScrollCollector.js +4 -0
  103. package/dist/native/bridge/perf/collectors/ThreadCollector.d.ts +31 -0
  104. package/dist/native/bridge/perf/collectors/ThreadCollector.js +4 -0
  105. package/dist/native/bridge/perf/core/constants.d.ts +76 -0
  106. package/dist/native/bridge/perf/core/measure.d.ts +39 -0
  107. package/dist/native/bridge/perf/core/measure.js +4 -0
  108. package/dist/native/bridge/perf/core/session.d.ts +49 -0
  109. package/dist/native/bridge/perf/core/session.js +4 -0
  110. package/dist/native/bridge/perf/core/store.d.ts +37 -0
  111. package/dist/native/bridge/perf/core/store.js +4 -0
  112. package/dist/native/bridge/perf/core/summary.d.ts +60 -0
  113. package/dist/native/bridge/perf/core/traceExport.d.ts +10 -0
  114. package/dist/native/bridge/perf/core/waterfalls.d.ts +2 -0
  115. package/dist/native/bridge/perf/index.d.ts +63 -0
  116. package/dist/native/bridge/perf/index.js +4 -0
  117. package/dist/native/bridge/safeArea.d.ts +11 -0
  118. package/dist/native/bridge/safeArea.js +2 -0
  119. package/dist/native/bridge/useBaseHook.d.ts +137 -0
  120. package/dist/native/bridge/useBaseHook.js +34 -4
  121. package/dist/native/bridge/utils/CameraUtils.d.ts +94 -0
  122. package/dist/native/bridge/utils/CameraUtils.js +4 -0
  123. package/dist/native/bridge/utils/FileObjectConverter.d.ts +36 -0
  124. package/dist/native/bridge/utils/NativeBridge.d.ts +270 -0
  125. package/dist/native/bridge/utils/NativeBridge.js +10 -0
  126. package/dist/native/buildAndroid/index.js +1 -1
  127. package/dist/native/buildAppAndroid.js +9 -0
  128. package/dist/native/buildAppIos.js +16 -1
  129. package/dist/native/buildErrorFormat.js +57 -0
  130. package/dist/native/buildIos/config.js +15 -1
  131. package/dist/native/buildIos/index.js +1 -1
  132. package/dist/native/buildIos/plugins.js +10 -1
  133. package/dist/native/iosnativeWebView/CoreLogic/Package.swift +36 -0
  134. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Camera/VideoStreamState.swift +1 -1
  135. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Camera/VideoStreamStateMachine.swift +6 -4
  136. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/BootTimingUtility.swift +3 -3
  137. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/FrameworkServerUtils.swift +14 -9
  138. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NetworkMonitor.swift +11 -9
  139. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NotificationHandlerProvider.swift +1 -1
  140. package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/URLWhitelistManager.swift +7 -7
  141. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/AnyCodableTests.swift +154 -0
  142. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/BootTimingUtilityTests.swift +23 -5
  143. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/CatalystConstantsTests.swift +192 -0
  144. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/ConfigMappingTests.swift +1 -1
  145. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/FrameworkServerUtilsErrorPathTests.swift +106 -0
  146. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/FrameworkServerUtilsLoopbackTests.swift +243 -0
  147. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/FrameworkServerUtilsTests.swift +1 -1
  148. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/NetworkMonitorTests.swift +119 -0
  149. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/NotificationHandlerProviderTests.swift +59 -0
  150. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/NotificationHandlerTests.swift +1 -1
  151. package/dist/native/iosnativeWebView/{iosnativeWebViewTests → CoreLogic/Tests/CatalystCoreLogicTests}/URLWhitelistManagerTests.swift +1 -1
  152. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/VideoStreamStateMachineTests.swift +171 -0
  153. package/dist/native/iosnativeWebView/CoreLogic/Tests/CatalystCoreLogicTests/VideoStreamStateTests.swift +91 -0
  154. package/dist/native/iosnativeWebView/Package.swift +10 -9
  155. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/LocalNotificationHandler.swift +7 -2
  156. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/NotificationManager.swift +1 -2
  157. package/dist/native/iosnativeWebView/Sources/CatalystNotifications/PushNotificationHandler.swift +5 -4
  158. package/dist/native/iosnativeWebView/Sources/Core/Camera/CameraSessionManager.swift +1 -0
  159. package/dist/native/iosnativeWebView/Sources/Core/Camera/HoldController.swift +1 -0
  160. package/dist/native/iosnativeWebView/Sources/Core/Camera/NativeCameraManager.swift +6 -5
  161. package/dist/native/iosnativeWebView/Sources/Core/Camera/ZoomController.swift +1 -0
  162. package/dist/native/iosnativeWebView/Sources/Core/Plugins/PluginBridge.swift +1 -0
  163. package/dist/native/iosnativeWebView/Sources/Core/Utils/CacheManager.swift +31 -30
  164. package/dist/native/iosnativeWebView/Sources/Core/Utils/CameraTransportUtils.swift +2 -1
  165. package/dist/native/iosnativeWebView/Sources/Core/Utils/DeviceInfoUtils.swift +1 -1
  166. package/dist/native/iosnativeWebView/Sources/Core/Utils/FilePickerHandler.swift +22 -19
  167. package/dist/native/iosnativeWebView/Sources/Core/Utils/ImageHandler.swift +40 -39
  168. package/dist/native/iosnativeWebView/Sources/Core/Utils/PerfEventBuffer.swift +1 -0
  169. package/dist/native/iosnativeWebView/Sources/Core/Utils/ResourceURLProtocol.swift +15 -15
  170. package/dist/native/iosnativeWebView/Sources/Core/Utils/WebKitConfig.swift +4 -3
  171. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeCommandHandler.swift +6 -1
  172. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeDelegateHandler.swift +1 -0
  173. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeFileHandler.swift +2 -1
  174. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeJavaScriptInterface.swift +2 -1
  175. package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeMessageValidator.swift +3 -5
  176. package/dist/native/iosnativeWebView/Sources/Core/WebView/NativeBridge.swift +20 -13
  177. package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashView.swift +6 -5
  178. package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashViewModel.swift +14 -13
  179. package/dist/native/iosnativeWebView/Sources/Core/WebView/TransitionManager.swift +3 -3
  180. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebView.swift +9 -8
  181. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewModel.swift +7 -6
  182. package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewNavigationDelegate.swift +24 -25
  183. package/dist/native/iosnativeWebView/iosnativeWebView/AppDelegate.swift +6 -1
  184. package/dist/native/iosnativeWebView/iosnativeWebView/ContentView.swift +1 -0
  185. package/dist/native/iosnativeWebView/iosnativeWebView/iosnativeWebViewApp.swift +4 -0
  186. package/dist/native/iosnativeWebView/iosnativeWebView.xcodeproj/project.pbxproj +2 -22
  187. package/dist/native/iosnativeWebView/iosnativeWebViewTests/BridgeMessageValidatorTests.swift +1 -0
  188. package/dist/native/iosnativeWebView/iosnativeWebViewTests/CacheManagerTests.swift +1 -0
  189. package/dist/native/iosnativeWebView/iosnativeWebViewTests/FilePickerHandlerTests.swift +2 -1
  190. package/dist/native/iosnativeWebView/iosnativeWebViewTests/NativeBridgeTests.swift +15 -9
  191. package/dist/native/iosnativeWebView/iosnativeWebViewTests/WebViewTests.swift +1 -0
  192. package/dist/native/setupEmulatorIos.js +2 -2
  193. package/dist/native/terminalProgress.js +17 -17
  194. package/dist/router/ClientRouter.d.ts +8 -0
  195. package/dist/router/ClientRouter.js +13 -11
  196. package/dist/router/ServerRouter.d.ts +13 -0
  197. package/dist/router/ServerRouter.js +19 -7
  198. package/dist/scripts/build.js +14 -2
  199. package/dist/scripts/loadEnvironmentVariables.js +3 -2
  200. package/dist/scripts/plugins.js +1 -1
  201. package/dist/scripts/preServerInit.js +49 -3
  202. package/dist/scripts/preflight.js +111 -0
  203. package/dist/scripts/scriptUtils.js +46 -1
  204. package/dist/scripts/serve.js +7 -1
  205. package/dist/scripts/start.js +8 -1
  206. package/dist/server/expressServer.d.ts +1 -0
  207. package/dist/server/expressServer.js +247 -271
  208. package/dist/server/manifestCache.d.ts +2 -0
  209. package/dist/server/manifestCache.js +25 -33
  210. package/dist/server/renderer/ChunkExtractor.d.ts +44 -0
  211. package/dist/server/renderer/ChunkExtractor.js +113 -125
  212. package/dist/server/renderer/document/Body.d.ts +21 -0
  213. package/dist/server/renderer/document/Body.jsx +45 -45
  214. package/dist/server/renderer/document/FastRefresh.d.ts +3 -0
  215. package/dist/server/renderer/document/FastRefresh.jsx +7 -13
  216. package/dist/server/renderer/document/Head.d.ts +20 -0
  217. package/dist/server/renderer/document/Head.jsx +32 -32
  218. package/dist/server/renderer/document/index.d.ts +2 -0
  219. package/dist/server/renderer/document/index.jsx +2 -2
  220. package/dist/server/renderer/extract.d.ts +67 -0
  221. package/dist/server/renderer/extract.js +92 -89
  222. package/dist/server/renderer/handler.d.ts +2 -0
  223. package/dist/server/renderer/handler.jsx +401 -404
  224. package/dist/server/renderer/index.d.ts +2 -0
  225. package/dist/server/renderer/index.js +5 -8
  226. package/dist/server/renderer/render.d.ts +35 -0
  227. package/dist/server/renderer/render.js +33 -32
  228. package/dist/server/utils/botDetectionMiddleware.d.ts +1 -0
  229. package/dist/server/utils/botDetectionMiddleware.js +33 -23
  230. package/dist/server/utils/cjsRequire.d.ts +8 -0
  231. package/dist/server/utils/cjsRequire.js +2 -2
  232. package/dist/server/utils/userAgentUtil.d.ts +7 -0
  233. package/dist/server/utils/userAgentUtil.js +68 -71
  234. package/dist/server/utils/validator.d.ts +31 -0
  235. package/dist/server/utils/validator.js +133 -158
  236. package/dist/vite/inject-cache-key-plugin.js +3 -27
  237. package/dist/vite/moduleAliases.js +36 -0
  238. package/dist/vite/node-loader.mjs +2 -29
  239. package/dist/vite/resolveDevServerConfig.js +4 -1
  240. package/dist/vite/vite.config.js +13 -31
  241. package/dist/web-router/components/MetaTag.d.ts +4 -0
  242. package/dist/web-router/components/MetaTag.jsx +26 -28
  243. package/dist/web-router/components/MetaTag.test.jsx +100 -0
  244. package/dist/web-router/components/RouterDataProvider.d.ts +96 -0
  245. package/dist/web-router/components/RouterDataProvider.jsx +260 -259
  246. package/dist/web-router/components/RouterDataProvider.server.test.jsx +98 -0
  247. package/dist/web-router/components/RouterDataProvider.test.jsx +310 -0
  248. package/dist/web-router/components/Split.d.ts +74 -0
  249. package/dist/web-router/components/Split.jsx +147 -156
  250. package/dist/web-router/components/Split.server.test.jsx +52 -0
  251. package/dist/web-router/components/Split.test.jsx +167 -0
  252. package/dist/web-router/components/SplitInview.d.ts +22 -0
  253. package/dist/web-router/components/SplitInview.jsx +78 -89
  254. package/dist/web-router/components/SplitInview.test.jsx +112 -0
  255. package/dist/web-router/components/SsrRequestContext.d.ts +20 -0
  256. package/dist/web-router/components/SsrRequestContext.jsx +17 -7
  257. package/dist/web-router/components/SsrRequestContext.test.jsx +53 -0
  258. package/dist/web-router/context.d.ts +15 -0
  259. package/dist/web-router/context.jsx +5 -5
  260. package/dist/web-router/context.test.jsx +10 -0
  261. package/dist/web-router/utils/metaDataUtils.d.ts +24 -0
  262. package/dist/web-router/utils/metaDataUtils.jsx +86 -86
  263. package/dist/web-router/utils/metaDataUtils.test.jsx +188 -0
  264. package/dist/web-router/vitest.setup.js +12 -0
  265. package/mcp_v2/knowledge-base.json +52 -8
  266. package/mcp_v2/mcp.js +140 -3
  267. package/mcp_v2/package-lock.json +2031 -0
  268. package/mcp_v2/package.json +13 -2
  269. package/mcp_v2/scripts/copyErrorsIndex.cjs +34 -0
  270. package/mcp_v2/test/errors.test.ts +123 -0
  271. package/mcp_v2/test/github.test.ts +177 -0
  272. package/mcp_v2/tools/errors.d.ts +20 -0
  273. package/mcp_v2/tools/errors.js +63 -0
  274. package/mcp_v2/tools/github.d.ts +41 -0
  275. package/mcp_v2/tools/github.js +231 -0
  276. package/mcp_v2/vitest.config.mjs +22 -0
  277. package/package.json +60 -11
  278. package/test/errors/docsDrift.test.ts +113 -0
  279. package/test/errors/index.test.ts +200 -0
  280. package/test/errors/registry.test.ts +108 -0
  281. package/test/scripts/preflight.test.ts +121 -0
  282. package/test/server/ChunkExtractor.test.ts +97 -0
  283. package/test/server/extract.test.ts +128 -0
  284. package/test/server/fixtures/template/server/document.jsx +19 -0
  285. package/test/server/fixtures/template/server/index.js +10 -0
  286. package/test/server/fixtures/template/src/js/containers/App/index.jsx +33 -0
  287. package/test/server/fixtures/template/src/js/routes/index.jsx +72 -0
  288. package/test/server/fixtures/template/src/js/routes/utils.jsx +39 -0
  289. package/test/server/fixtures/template/src/js/store/index.js +19 -0
  290. package/test/server/handler.assets.test.ts +331 -0
  291. package/test/server/handler.test.ts +210 -0
  292. package/test/server/manifestCache.test.ts +71 -0
  293. package/test/server/render.test.ts +90 -0
  294. package/test/server/scriptUtils.test.ts +103 -0
  295. package/test/server/userAgentUtil.test.ts +48 -0
  296. package/test/server/validator.test.ts +228 -0
  297. package/test/vite/resolveDevServerConfig.test.js +4 -1
  298. package/tsconfig.test.json +23 -0
  299. package/vitest.config.ts +93 -0
  300. package/dist/caching.js +0 -1
  301. package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/DeviceInfoUtilsTest.kt +0 -187
  302. package/dist/native/bridge/standardizedHooks.js +0 -611
  303. package/dist/router.js +0 -1
  304. package/dist/scripts/validator.js +0 -149
  305. package/dist/web-router/hooks.jsx +0 -72
  306. package/dist/web-router/types/components/MetaTag.d.ts +0 -2
  307. package/dist/web-router/types/components/RouterDataProvider.d.ts +0 -95
  308. package/dist/web-router/types/context.d.ts +0 -14
  309. package/dist/web-router/types/hooks.d.ts +0 -1
  310. package/dist/web-router/types/index.d.ts +0 -3
  311. package/dist/web-router/types/utils/metaDataUtils.d.ts +0 -24
  312. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Constants/CatalystConstants.swift +0 -0
  313. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Constants/ConfigConstants.swift +0 -0
  314. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Notifications/NotificationModels.swift +0 -0
  315. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Protocols/NotificationHandlerProtocol.swift +0 -0
  316. /package/dist/native/iosnativeWebView/{Sources/Core → CoreLogic/Sources/CatalystCoreLogic}/Utils/NullNotificationHandler.swift +0 -0
@@ -0,0 +1,506 @@
1
+ {
2
+ "CCA-000": {
3
+ "category": "CCA",
4
+ "message": "An upstream command failed",
5
+ "details": "This wraps an error from npm, tar, or another upstream tool invoked by create-catalyst-app. See the printed upstream message for the actual cause.",
6
+ "suggestedAction": "Read the upstream error message printed above and fix the underlying issue.",
7
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-000.md"
8
+ },
9
+ "CCA-001": {
10
+ "category": "CCA",
11
+ "message": "Invalid project name",
12
+ "details": "The project name is not a valid npm package name.",
13
+ "suggestedAction": "Choose a project name that is a valid npm package name and try again.",
14
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-001.md"
15
+ },
16
+ "CCA-002": {
17
+ "category": "CCA",
18
+ "message": "Target directory already exists",
19
+ "details": "A file or directory with the project name already exists in the current directory.",
20
+ "suggestedAction": "Choose a different project name, or remove/rename the existing directory.",
21
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-002.md"
22
+ },
23
+ "CCA-003": {
24
+ "category": "CCA",
25
+ "message": "Invalid language option",
26
+ "details": "The --lang option must be \"js\" or \"ts\".",
27
+ "suggestedAction": "Pass --lang js or --lang ts.",
28
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-003.md"
29
+ },
30
+ "CCA-004": {
31
+ "category": "CCA",
32
+ "message": "Invalid state management option",
33
+ "details": "The --state-management option must be \"rtk\", \"redux\", or \"none\".",
34
+ "suggestedAction": "Pass a supported --state-management value.",
35
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-004.md"
36
+ },
37
+ "CCA-005": {
38
+ "category": "CCA",
39
+ "message": "Invalid --yes option",
40
+ "details": "The -y/--yes flag does not accept a non-boolean value.",
41
+ "suggestedAction": "Use -y or --yes with no value to accept defaults.",
42
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-005.md"
43
+ },
44
+ "CCA-006": {
45
+ "category": "CCA",
46
+ "message": "Failed to pack create-catalyst-app",
47
+ "details": "npm pack could not produce the tarball used to scaffold the new project.",
48
+ "suggestedAction": "Check your npm registry access/network connection and try again.",
49
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-006.md"
50
+ },
51
+ "CCA-007": {
52
+ "category": "CCA",
53
+ "message": "Failed to extract template files",
54
+ "details": "The packed tarball could not be extracted into the new project directory.",
55
+ "suggestedAction": "Ensure the target directory is writable and try again.",
56
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-007.md"
57
+ },
58
+ "CCA-008": {
59
+ "category": "CCA",
60
+ "message": "MCP server setup failed",
61
+ "details": "Downloading, installing, or configuring the MCP server failed.",
62
+ "suggestedAction": "Check your network connection and re-run `catalyst-mcp` inside the project.",
63
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-008.md"
64
+ },
65
+ "CCA-009": {
66
+ "category": "CCA",
67
+ "message": ".gitignore already exists",
68
+ "details": "The scaffolded project already contains a .gitignore file.",
69
+ "suggestedAction": "Remove or rename the existing .gitignore before running again, or ignore this warning.",
70
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/CCA/CCA-009.md"
71
+ },
72
+ "PREFLIGHT-001": {
73
+ "category": "PREFLIGHT",
74
+ "message": "config not found in config folder",
75
+ "details": "A config object must be exported from the config folder in your project root.",
76
+ "suggestedAction": "Create config/config.json (or config/index.js) exporting the required config object.",
77
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-001.md"
78
+ },
79
+ "PREFLIGHT-002": {
80
+ "category": "PREFLIGHT",
81
+ "message": "config export is not an object",
82
+ "details": "The config folder must export a plain object.",
83
+ "suggestedAction": "Ensure config/config.json exports an object, not a string, array, or function.",
84
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-002.md"
85
+ },
86
+ "PREFLIGHT-003": {
87
+ "category": "PREFLIGHT",
88
+ "message": "required key missing inside config.json",
89
+ "details": "config.json is missing one or more required keys.",
90
+ "suggestedAction": "Add the missing key to config.json. See the config.json reference in the framework docs.",
91
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-003.md"
92
+ },
93
+ "PREFLIGHT-004": {
94
+ "category": "PREFLIGHT",
95
+ "message": "package.json not found in the project",
96
+ "details": "A package.json must exist in the project root directory.",
97
+ "suggestedAction": "Run this command from the project root, or restore package.json.",
98
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-004.md"
99
+ },
100
+ "PREFLIGHT-005": {
101
+ "category": "PREFLIGHT",
102
+ "message": "package.json should be defined in project root directory",
103
+ "details": "package.json exists but could not be parsed as an object.",
104
+ "suggestedAction": "Check package.json for valid JSON syntax.",
105
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-005.md"
106
+ },
107
+ "PREFLIGHT-006": {
108
+ "category": "PREFLIGHT",
109
+ "message": "moduleAliases not found in package.json",
110
+ "details": "package.json must export a moduleAliases object.",
111
+ "suggestedAction": "Add a moduleAliases object to package.json.",
112
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-006.md"
113
+ },
114
+ "PREFLIGHT-007": {
115
+ "category": "PREFLIGHT",
116
+ "message": "moduleAliases named object should be exported from package.json",
117
+ "details": "moduleAliases was found in package.json but is not an object.",
118
+ "suggestedAction": "Ensure moduleAliases is exported as an object in package.json.",
119
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-007.md"
120
+ },
121
+ "PREFLIGHT-008": {
122
+ "category": "PREFLIGHT",
123
+ "message": "catalyst keyword is restricted for defining aliases",
124
+ "details": "Module alias keys containing 'catalyst' are reserved by the framework.",
125
+ "suggestedAction": "Rename the alias to something that does not contain 'catalyst'.",
126
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-008.md"
127
+ },
128
+ "PREFLIGHT-009": {
129
+ "category": "PREFLIGHT",
130
+ "message": "required module alias not defined inside package.json",
131
+ "details": "One or more required module aliases are missing from moduleAliases.",
132
+ "suggestedAction": "Add the missing alias to the moduleAliases object in package.json.",
133
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-009.md"
134
+ },
135
+ "PREFLIGHT-010": {
136
+ "category": "PREFLIGHT",
137
+ "message": "preServerInit named function should be defined in server/index.js",
138
+ "details": "server/index.js must export a preServerInit function.",
139
+ "suggestedAction": "Export a preServerInit function from server/index.js, or remove the reference to it.",
140
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-010.md"
141
+ },
142
+ "PREFLIGHT-011": {
143
+ "category": "PREFLIGHT",
144
+ "message": "preServerInit should be a function present in server/index.js",
145
+ "details": "preServerInit was found but is not a function.",
146
+ "suggestedAction": "Ensure preServerInit is exported as a function.",
147
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-011.md"
148
+ },
149
+ "PREFLIGHT-012": {
150
+ "category": "PREFLIGHT",
151
+ "message": "addMiddlewares named function not found in server/server.js",
152
+ "details": "server/server.js must export an addMiddlewares function.",
153
+ "suggestedAction": "Export an addMiddlewares function from server/server.js.",
154
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-012.md"
155
+ },
156
+ "PREFLIGHT-013": {
157
+ "category": "PREFLIGHT",
158
+ "message": "addMiddlewares should be a function present in server/server.js",
159
+ "details": "addMiddlewares was found but is not a function.",
160
+ "suggestedAction": "Ensure addMiddlewares is exported as a function.",
161
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-013.md"
162
+ },
163
+ "PREFLIGHT-014": {
164
+ "category": "PREFLIGHT",
165
+ "message": "reducer not found in src/js/containers/App/reducer",
166
+ "details": "A reducer must be exported from src/js/containers/App/reducer.",
167
+ "suggestedAction": "Export a reducer from src/js/containers/App/reducer.",
168
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-014.md"
169
+ },
170
+ "PREFLIGHT-015": {
171
+ "category": "PREFLIGHT",
172
+ "message": "reducer should be present in src/js/containers/App/reducer",
173
+ "details": "The reducer export was found but is not a function.",
174
+ "suggestedAction": "Ensure the reducer is exported as a function.",
175
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-015.md"
176
+ },
177
+ "PREFLIGHT-016": {
178
+ "category": "PREFLIGHT",
179
+ "message": "configureStore not found in file src/js/store/index.js",
180
+ "details": "src/js/store/index.js must export a configureStore function.",
181
+ "suggestedAction": "Export a configureStore function from src/js/store/index.js.",
182
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-016.md"
183
+ },
184
+ "PREFLIGHT-017": {
185
+ "category": "PREFLIGHT",
186
+ "message": "configureStore should be a function exported from src/js/store/index.js",
187
+ "details": "configureStore was found but is not a function.",
188
+ "suggestedAction": "Ensure configureStore is exported as a function.",
189
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-017.md"
190
+ },
191
+ "PREFLIGHT-018": {
192
+ "category": "PREFLIGHT",
193
+ "message": "getRoutes not found in file src/js/routes/utils.js",
194
+ "details": "src/js/routes/utils.js must export a getRoutes function.",
195
+ "suggestedAction": "Export a getRoutes function from src/js/routes/utils.js.",
196
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-018.md"
197
+ },
198
+ "PREFLIGHT-019": {
199
+ "category": "PREFLIGHT",
200
+ "message": "getRoutes should be a function exported from src/js/routers/index.js",
201
+ "details": "getRoutes was found but is not a function.",
202
+ "suggestedAction": "Ensure getRoutes is exported as a function.",
203
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-019.md"
204
+ },
205
+ "PREFLIGHT-020": {
206
+ "category": "PREFLIGHT",
207
+ "message": "document not found in file server/document.js",
208
+ "details": "server/document.js must export a document component.",
209
+ "suggestedAction": "Export a document React component from server/document.js.",
210
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-020.md"
211
+ },
212
+ "PREFLIGHT-021": {
213
+ "category": "PREFLIGHT",
214
+ "message": "document should be a react component exported from server/document.js",
215
+ "details": "document was found but is not a function/component.",
216
+ "suggestedAction": "Ensure document is exported as a React component (function).",
217
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PREFLIGHT/PREFLIGHT-021.md"
218
+ },
219
+ "PROCESS-001": {
220
+ "category": "PROCESS",
221
+ "message": "preServerInit threw an error during server startup",
222
+ "details": "The preServerInit hook failed. Note: server startup currently continues despite this error (tracked separately as a fix — see issue #298); this code only identifies which hook failed.",
223
+ "suggestedAction": "Fix the error thrown inside your preServerInit hook (see the cause above).",
224
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PROCESS/PROCESS-001.md"
225
+ },
226
+ "PROCESS-002": {
227
+ "category": "PROCESS",
228
+ "message": "A user-defined hook threw an error",
229
+ "details": "A user-defined hook (e.g. onRouteMatch, onFetcherError, onServerError) threw. It was caught so the SSR pipeline keeps running; see the cause above for which hook and why.",
230
+ "suggestedAction": "Fix the error thrown inside the hook (see the cause above).",
231
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/PROCESS/PROCESS-002.md"
232
+ },
233
+ "BUNDLE-000": {
234
+ "category": "BUNDLE",
235
+ "message": "Build failed in an upstream bundler step",
236
+ "details": "This is a wrapper around an error from Vite/Rollup or another upstream build tool. See the printed upstream code/message for the actual cause — catalyst-core does not reinterpret it.",
237
+ "suggestedAction": "Read the upstream error message/code printed above and fix the underlying issue.",
238
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/BUNDLE/BUNDLE-000.md"
239
+ },
240
+ "IOS-000": {
241
+ "category": "IOS",
242
+ "message": "iOS build failed in an upstream toolchain step",
243
+ "details": "This wraps an error from Xcode/CocoaPods. See the printed upstream output for the cause.",
244
+ "suggestedAction": "Read the upstream Xcode/CocoaPods error printed above and fix the underlying issue.",
245
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/IOS/IOS-000.md"
246
+ },
247
+ "ANDROID-000": {
248
+ "category": "ANDROID",
249
+ "message": "Android build failed in an upstream toolchain step",
250
+ "details": "This wraps an error from Gradle. See the printed upstream output for the cause.",
251
+ "suggestedAction": "Read the upstream Gradle error printed above and fix the underlying issue.",
252
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/ANDROID/ANDROID-000.md"
253
+ },
254
+ "RUNTIME-NATIVE-001": {
255
+ "category": "RUNTIME-NATIVE",
256
+ "message": "Permission denied",
257
+ "details": "Required permission was not granted by the user",
258
+ "suggestedAction": "Grant permission in device settings and try again",
259
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-001.md"
260
+ },
261
+ "RUNTIME-NATIVE-002": {
262
+ "category": "RUNTIME-NATIVE",
263
+ "message": "Permission required",
264
+ "details": "This operation requires additional permissions",
265
+ "suggestedAction": "Grant the required permission to continue",
266
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-002.md"
267
+ },
268
+ "RUNTIME-NATIVE-003": {
269
+ "category": "RUNTIME-NATIVE",
270
+ "message": "No internet connection",
271
+ "details": "Network connection is required for this operation",
272
+ "suggestedAction": "Check your internet connection and try again",
273
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-003.md"
274
+ },
275
+ "RUNTIME-NATIVE-004": {
276
+ "category": "RUNTIME-NATIVE",
277
+ "message": "Download failed",
278
+ "details": "The download could not be completed",
279
+ "suggestedAction": "Check your connection and try again",
280
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-004.md"
281
+ },
282
+ "RUNTIME-NATIVE-005": {
283
+ "category": "RUNTIME-NATIVE",
284
+ "message": "File not found",
285
+ "details": "The requested file could not be located",
286
+ "suggestedAction": "The file may have been moved or deleted",
287
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-005.md"
288
+ },
289
+ "RUNTIME-NATIVE-006": {
290
+ "category": "RUNTIME-NATIVE",
291
+ "message": "File too large",
292
+ "details": "File exceeds the maximum size limit",
293
+ "suggestedAction": "Choose a smaller file or compress the current file",
294
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-006.md"
295
+ },
296
+ "RUNTIME-NATIVE-007": {
297
+ "category": "RUNTIME-NATIVE",
298
+ "message": "Storage full",
299
+ "details": "Device storage is full and cannot save the file",
300
+ "suggestedAction": "Free up some storage space and try again",
301
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-007.md"
302
+ },
303
+ "RUNTIME-NATIVE-008": {
304
+ "category": "RUNTIME-NATIVE",
305
+ "message": "File corrupted",
306
+ "details": "The file could not be read or is corrupted",
307
+ "suggestedAction": "Try selecting a different file",
308
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-008.md"
309
+ },
310
+ "RUNTIME-NATIVE-009": {
311
+ "category": "RUNTIME-NATIVE",
312
+ "message": "Operation cancelled",
313
+ "details": "The operation was cancelled by the user",
314
+ "suggestedAction": "Try again if you want to complete the operation",
315
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-009.md"
316
+ },
317
+ "RUNTIME-NATIVE-010": {
318
+ "category": "RUNTIME-NATIVE",
319
+ "message": "No file selected",
320
+ "details": "No file was selected by the user",
321
+ "suggestedAction": "Select a file and try again",
322
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-010.md"
323
+ },
324
+ "RUNTIME-NATIVE-011": {
325
+ "category": "RUNTIME-NATIVE",
326
+ "message": "Invalid file type",
327
+ "details": "The selected file type is not supported",
328
+ "suggestedAction": "Choose a file with a supported format",
329
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-011.md"
330
+ },
331
+ "RUNTIME-NATIVE-012": {
332
+ "category": "RUNTIME-NATIVE",
333
+ "message": "Invalid parameters",
334
+ "details": "One or more parameters passed to the native call were invalid",
335
+ "suggestedAction": "Check the parameters passed to the native API call",
336
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-012.md"
337
+ },
338
+ "RUNTIME-NATIVE-013": {
339
+ "category": "RUNTIME-NATIVE",
340
+ "message": "Native feature unavailable",
341
+ "details": "The native bridge is not available or not initialized",
342
+ "suggestedAction": "Use web fallback if available",
343
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-013.md"
344
+ },
345
+ "RUNTIME-NATIVE-014": {
346
+ "category": "RUNTIME-NATIVE",
347
+ "message": "Feature not supported",
348
+ "details": "This feature is not supported on the current platform",
349
+ "suggestedAction": "Try using an alternative method or device",
350
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-014.md"
351
+ },
352
+ "RUNTIME-NATIVE-015": {
353
+ "category": "RUNTIME-NATIVE",
354
+ "message": "An unexpected error occurred",
355
+ "details": "An internal error occurred while processing the request",
356
+ "suggestedAction": "Try again or contact support if the problem persists",
357
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-015.md"
358
+ },
359
+ "RUNTIME-NATIVE-016": {
360
+ "category": "RUNTIME-NATIVE",
361
+ "message": "Camera unavailable",
362
+ "details": "Camera hardware is not available or accessible",
363
+ "suggestedAction": "Check if your device has a camera and try again",
364
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-016.md"
365
+ },
366
+ "RUNTIME-NATIVE-017": {
367
+ "category": "RUNTIME-NATIVE",
368
+ "message": "Camera in use",
369
+ "details": "Camera is being used by another application",
370
+ "suggestedAction": "Close other camera apps and try again",
371
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-017.md"
372
+ },
373
+ "RUNTIME-NATIVE-018": {
374
+ "category": "RUNTIME-NATIVE",
375
+ "message": "Invalid callback interface",
376
+ "details": "The native platform invoked WebBridge.callback() with an interface name that isn't recognized.",
377
+ "suggestedAction": "Check the interface name against the registered NATIVE_CALLBACKS list; this usually indicates a native/JS version mismatch.",
378
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-018.md"
379
+ },
380
+ "RUNTIME-NATIVE-019": {
381
+ "category": "RUNTIME-NATIVE",
382
+ "message": "No handler registered for this bridge interface",
383
+ "details": "Native sent a callback for this interface, but your webview hasn't registered a handler for it yet.",
384
+ "suggestedAction": "Call WebBridge.register() for this interface before native calls arrive.",
385
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-019.md"
386
+ },
387
+ "RUNTIME-NATIVE-020": {
388
+ "category": "RUNTIME-NATIVE",
389
+ "message": "A registered bridge callback handler threw",
390
+ "details": "The JS handler registered for this native callback interface threw an error while processing the callback.",
391
+ "suggestedAction": "Fix the error thrown inside the registered handler (see the cause above).",
392
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-020.md"
393
+ },
394
+ "RUNTIME-NATIVE-021": {
395
+ "category": "RUNTIME-NATIVE",
396
+ "message": "Invalid bridge callback registration",
397
+ "details": "WebBridge.register() was called with a non-function callback or an unrecognized interface name.",
398
+ "suggestedAction": "Pass a function as the callback and a valid interface name from NATIVE_CALLBACKS.",
399
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-021.md"
400
+ },
401
+ "RUNTIME-NATIVE-022": {
402
+ "category": "RUNTIME-NATIVE",
403
+ "message": "WebBridge could not be initialized",
404
+ "details": "WebBridge.init() was called outside a browser environment (no `window` available).",
405
+ "suggestedAction": "Call WebBridge.init() in a browser environment, before using bridge features.",
406
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-NATIVE/RUNTIME-NATIVE-022.md"
407
+ },
408
+ "AI-000": {
409
+ "category": "AI",
410
+ "message": "AI provider request failed",
411
+ "details": "This is a wrapper around a non-2xx response or thrown error from the upstream AI provider (OpenAI/Gemini). See the printed upstream status/message for the actual cause — catalyst-ai does not reinterpret it.",
412
+ "suggestedAction": "Read the upstream provider error printed above and fix the underlying issue (auth, rate limit, invalid request).",
413
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-000.md"
414
+ },
415
+ "AI-001": {
416
+ "category": "AI",
417
+ "message": "AI is disabled",
418
+ "details": "AI_CONFIG.enabled is not set to true.",
419
+ "suggestedAction": "Set AI_CONFIG.enabled=true in your environment configuration.",
420
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-001.md"
421
+ },
422
+ "AI-002": {
423
+ "category": "AI",
424
+ "message": "AI provider not configured",
425
+ "details": "The requested provider is unknown, or has no apiKey configured in AI_CONFIG.providers.",
426
+ "suggestedAction": "Add the provider's apiKey to AI_CONFIG.providers, or use a configured provider.",
427
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-002.md"
428
+ },
429
+ "AI-003": {
430
+ "category": "AI",
431
+ "message": "Invalid AI request body",
432
+ "details": "The request body is missing a non-empty messages array, or no model could be resolved.",
433
+ "suggestedAction": "Pass a non-empty messages array, and either a model or a provider defaultModel.",
434
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-003.md"
435
+ },
436
+ "AI-004": {
437
+ "category": "AI",
438
+ "message": "Native AI bridge unavailable",
439
+ "details": "window.NativeBridge.initAI or window.WebBridge was not found when useNativeAI mounted.",
440
+ "suggestedAction": "Update catalyst-core to >=0.2.0, add the native AI module, and call WebBridge.init() before mounting useNativeAI.",
441
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-004.md"
442
+ },
443
+ "AI-005": {
444
+ "category": "AI",
445
+ "message": "Native AI stream not ready",
446
+ "details": "generate() was called before the native side reported a ready stream URL (initAI has not fired ON_AI_READY yet).",
447
+ "suggestedAction": "Wait for modelReady to become true before calling generate().",
448
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-005.md"
449
+ },
450
+ "AI-006": {
451
+ "category": "AI",
452
+ "message": "Native AI request failed",
453
+ "details": "The native AI HTTP endpoint returned a non-ok status or reported an error in its response body.",
454
+ "suggestedAction": "See the cause above for the native-reported status/message.",
455
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-006.md"
456
+ },
457
+ "AI-007": {
458
+ "category": "AI",
459
+ "message": "Native AI reported an error",
460
+ "details": "The native platform invoked ON_AI_ERROR — a failure during model load, init, or inference on the native side, not an HTTP request made by this JS code.",
461
+ "suggestedAction": "See the cause above for the native-reported message.",
462
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-007.md"
463
+ },
464
+ "AI-008": {
465
+ "category": "AI",
466
+ "message": "Web AI worker unavailable",
467
+ "details": "Constructing the module Worker for in-browser AI failed — module workers may be unsupported in this browser.",
468
+ "suggestedAction": "Use a browser with module Worker support, or fall back to useCloudAI/useNativeAI.",
469
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-008.md"
470
+ },
471
+ "AI-009": {
472
+ "category": "AI",
473
+ "message": "Web AI worker crashed",
474
+ "details": "The in-browser AI worker threw during model load or generation (e.g. all device backends failed, or an uncaught exception). See the cause above for the worker's reported message.",
475
+ "suggestedAction": "Check that the model is compatible with this browser/device, or use useCloudAI/useNativeAI instead.",
476
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/AI/AI-009.md"
477
+ },
478
+ "RUNTIME-WEB-001": {
479
+ "category": "RUNTIME-WEB",
480
+ "message": "Rendering failed on the server",
481
+ "details": "An error was thrown while streaming or rendering the document on the server. This may originate from app code, a third-party dependency, or catalyst-core itself — see the cause above for the actual error.",
482
+ "suggestedAction": "See the cause above for the error thrown during rendering.",
483
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-WEB/RUNTIME-WEB-001.md"
484
+ },
485
+ "RUNTIME-WEB-002": {
486
+ "category": "RUNTIME-WEB",
487
+ "message": "serverFetcher failed",
488
+ "details": "An error was thrown while executing a route's serverFetcher function(s). This may originate from app code, a third-party dependency, or catalyst-core itself — see the cause above for the actual error.",
489
+ "suggestedAction": "See the cause above for the error thrown inside serverFetcher.",
490
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-WEB/RUNTIME-WEB-002.md"
491
+ },
492
+ "RUNTIME-WEB-003": {
493
+ "category": "RUNTIME-WEB",
494
+ "message": "App.serverSideFunction failed",
495
+ "details": "An error was thrown while executing the app-level serverSideFunction hook. This may originate from app code, a third-party dependency, or catalyst-core itself — see the cause above for the actual error.",
496
+ "suggestedAction": "See the cause above for the error thrown inside serverSideFunction.",
497
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-WEB/RUNTIME-WEB-003.md"
498
+ },
499
+ "RUNTIME-WEB-004": {
500
+ "category": "RUNTIME-WEB",
501
+ "message": "Failed to handle document request",
502
+ "details": "An unhandled error reached the top level of the SSR request handler. This may originate from app code, a third-party dependency, or catalyst-core itself — see the cause above for the actual error.",
503
+ "suggestedAction": "See the cause above for the underlying error.",
504
+ "docUrl": "https://github.com/tata1mg/catalyst-core/blob/main/errors/RUNTIME-WEB/RUNTIME-WEB-004.md"
505
+ }
506
+ }
package/dist/globals.d.ts CHANGED
@@ -5,3 +5,65 @@ declare const __CATALYST_PACKAGES__: {
5
5
  readonly webAILocal: boolean
6
6
  readonly nativeAILocal: boolean
7
7
  }
8
+
9
+ // `@catalyst/template` is the consuming application, aliased to the app root by
10
+ // the `_moduleAliases` entry in package.json. Those modules live in the app, not
11
+ // in this package, so there is nothing for TypeScript to resolve here — they are
12
+ // typed as `any` to model the framework/app boundary.
13
+ declare module "@catalyst/template/*" {
14
+ const value: any
15
+ export default value
16
+ export const getRoutes: any
17
+ export const onRouteMatch: any
18
+ export const onFetcherSuccess: any
19
+ export const onFetcherError: any
20
+ export const onAppServerSideSuccess: any
21
+ export const onAppServerSideError: any
22
+ export const onRenderError: any
23
+ export const onRequestError: any
24
+ export const preparedRoutes: any
25
+ }
26
+
27
+ // Set per request by the SSR handler so client-side hydration can read the
28
+ // device safe-area insets that were used to render the shell.
29
+ declare var __SAFE_AREA_INITIAL__: any
30
+
31
+ // Globals owned by the native bridge (src/native/bridge). They are installed on
32
+ // `window` by code that lives outside this package's type graph — the native
33
+ // WebView host injects `NativeBridge` (Android) and `webkit.messageHandlers`
34
+ // (iOS), and `WebBridge.init()` attaches the web half — so there is nothing for
35
+ // TypeScript to resolve. They are typed as `any` to model that host boundary,
36
+ // matching how `@catalyst/template/*` models the framework/app boundary above.
37
+ //
38
+ // The bridge guards every one of these with a `typeof window === "undefined"`
39
+ // or truthiness check before use, because none of them exist under SSR or in a
40
+ // plain browser; declaring them here does not change that contract.
41
+ interface Window {
42
+ /** Web half of the bridge, attached by `WebBridge.init()`. */
43
+ WebBridge: any
44
+ /** Android WebView bridge, injected by the native host. */
45
+ NativeBridge: any
46
+ /** iOS WKWebView message handlers, injected by the native host. */
47
+ webkit: any
48
+ /** Opt-in flag read by `WebBridge.init()` to load the perf collector. */
49
+ __CATALYST_PROFILER_ENABLED: any
50
+ /** Perf collector internals (src/native/bridge/perf). */
51
+ CatalystPerf: any
52
+ __catalystPerfCollector: any
53
+ __catalystPerfStore: any
54
+ __catalystPerfBatch: any
55
+ __catalystPerfEvent: any
56
+ /** Clock skew between the native host and the WebView, set by native. */
57
+ __NATIVE_TIME_OFFSET: any
58
+ }
59
+
60
+ // Set on the server for the duration of one render by the SSR renderer, so
61
+ // split() can record which chunks a request actually touched.
62
+ declare var __CHUNK_EXTRACTOR__: any
63
+
64
+ // Inlined into the document by the SSR handler. `__SSR_RENDERED_COMPONENTS__`
65
+ // lists the cacheKeys server-rendered for this request, which split() uses to
66
+ // decide what to prefetch before hydration; `__CATALYST_IS_BOT__` mirrors the
67
+ // server's crawler decision so hydration matches the server output.
68
+ declare var __SSR_RENDERED_COMPONENTS__: any
69
+ declare var __CATALYST_IS_BOT__: any
@@ -0,0 +1,5 @@
1
+ export { RouterDataProvider, useCurrentRouteData, useRouterData, } from "./web-router/components/RouterDataProvider.jsx";
2
+ export { MetaTag } from "./web-router/components/MetaTag.jsx";
3
+ export { split, hydrationReady } from "./web-router/components/Split.jsx";
4
+ export { Head } from "./server/renderer/document/Head.jsx";
5
+ export { Body } from "./server/renderer/document/Body.jsx";
package/dist/index.jsx CHANGED
@@ -1,8 +1,5 @@
1
- export * from "react-router-dom"
2
- export * from "./web-router/components/RouterDataProvider.jsx"
3
- export * from "./web-router/components/MetaTag.jsx"
4
- export { split, hydrationReady } from "./web-router/components/Split.jsx"
5
- export { split as default } from "./web-router/components/Split.jsx"
6
- export * from "./web-router/hooks.jsx"
7
- export * from "./web-router/utils/metaDataUtils.jsx"
8
- export * from "./server/renderer/document/index.jsx"
1
+ export { RouterDataProvider, useCurrentRouteData, useRouterData } from "./web-router/components/RouterDataProvider.jsx";
2
+ export { MetaTag } from "./web-router/components/MetaTag.jsx";
3
+ export { split, hydrationReady } from "./web-router/components/Split.jsx";
4
+ export { Head } from "./server/renderer/document/Head.jsx";
5
+ export { Body } from "./server/renderer/document/Body.jsx";
package/dist/logger.js CHANGED
@@ -1,4 +1,4 @@
1
- import pc from "picocolors"
1
+ import pc from "ansis"
2
2
  import winston from "winston"
3
3
  import DailyRotateFile from "winston-daily-rotate-file"
4
4