catalyst-core 0.1.0-canary.9 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/catalyst.js +8 -1
- package/changelog.md +6 -0
- package/dist/native/androidProject/app/build.gradle.kts +34 -8
- package/dist/native/androidProject/app/src/main/AndroidManifest.xml +2 -1
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/BridgeMessageValidator.kt +1 -1
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/CustomWebview.kt +270 -78
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/MainActivity.kt +34 -5
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt +149 -1
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeCameraManager.kt +337 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/OfflineCacheService.kt +374 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/TransitionManager.kt +202 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/WebCacheManager.kt +156 -39
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/BarcodeDetector.kt +123 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/CameraSessionManager.kt +244 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/HoldController.kt +70 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/TorchController.kt +57 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/VideoStreamState.kt +41 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/VideoStreamStateMachine.kt +40 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/ViewfinderMapper.kt +75 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/camera/ZoomController.kt +156 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/plugins/CatalystPlugin.kt +7 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/plugins/GeneratedPluginIndex.kt +6 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/plugins/PluginBridge.kt +253 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/security/FridaDetector.kt +16 -5
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/BridgeUtils.kt +42 -5
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FrameworkServerUtils.kt +7 -3
- package/dist/native/androidProject/app/src/main/res/drawable/debug_viewfinder_border.xml +8 -0
- package/dist/native/androidProject/app/src/main/res/layout/activity_main.xml +37 -0
- package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/CustomWebviewTest.kt +7 -2
- package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/plugins/PluginBridgeTest.kt +139 -0
- package/dist/native/androidSetup.js +1 -0
- package/dist/native/bridge/WebBridge.js +5 -5
- package/dist/native/bridge/constants/NativeInterfaces.js +9 -5
- package/dist/native/bridge/hooks/index.js +1 -0
- package/dist/native/bridge/hooks/useCamera.js +9 -0
- package/dist/native/bridge/hooks/useDataProtection.js +2 -0
- package/dist/native/bridge/hooks/useDeviceInfo.js +2 -0
- package/dist/native/bridge/hooks/useFilePicker.js +2 -0
- package/dist/native/bridge/hooks/useGoogleSignIn.js +1 -0
- package/dist/native/bridge/hooks/useHapticFeedback.js +1 -0
- package/dist/native/bridge/hooks/useIntent.js +1 -0
- package/dist/native/bridge/hooks/useNativeTransition.js +43 -0
- package/dist/native/bridge/hooks/useNetworkStatus.js +3 -0
- package/dist/native/bridge/hooks/useNotification.js +2 -0
- package/dist/native/bridge/hooks/useSafeArea.js +2 -0
- package/dist/native/bridge/hooks/useVideoStream.js +6 -0
- package/dist/native/bridge/hooks/utils.js +1 -0
- package/dist/native/bridge/hooks.js +1 -137
- package/dist/native/bridge/useBaseHook.js +12 -7
- package/dist/native/bridge/utils/NativeBridge.js +41 -6
- package/dist/native/buildAndroid/assets.js +52 -0
- package/dist/native/buildAndroid/build.js +19 -0
- package/dist/native/buildAndroid/config.js +1 -0
- package/dist/native/buildAndroid/index.js +1 -0
- package/dist/native/buildAppAndroid.js +2 -150
- package/dist/native/buildAppIos.js +2 -312
- package/dist/native/buildIos/assets.js +8 -0
- package/dist/native/buildIos/build.js +40 -0
- package/dist/native/buildIos/config.js +71 -0
- package/dist/native/buildIos/index.js +6 -0
- package/dist/native/buildIos/plugins.js +45 -0
- package/dist/native/internalPluginUtils.js +7 -0
- package/dist/native/iosnativeWebView/Package.resolved +36 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/BarcodeDetector.swift +116 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/CameraPreviewView.swift +58 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/CameraSessionManager.swift +308 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/HoldController.swift +63 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/NativeCameraManager.swift +194 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/TorchController.swift +60 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/VideoStreamState.swift +44 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/VideoStreamStateMachine.swift +60 -0
- package/dist/native/iosnativeWebView/Sources/Core/Camera/ZoomController.swift +130 -0
- package/dist/native/iosnativeWebView/Sources/Core/Constants/CatalystConstants.swift +11 -1
- package/dist/native/iosnativeWebView/Sources/Core/Constants/ConfigConstants.swift +2 -1
- package/dist/native/iosnativeWebView/Sources/Core/Plugins/CatalystPlugin.swift +5 -0
- package/dist/native/iosnativeWebView/Sources/Core/Plugins/GeneratedPluginIndex.swift +6 -0
- package/dist/native/iosnativeWebView/Sources/Core/Plugins/PluginBridge.swift +364 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/CacheManager.swift +39 -4
- package/dist/native/iosnativeWebView/Sources/Core/Utils/OfflineCacheService.swift +683 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/OfflineURLSchemeHandler.swift +94 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/ResourceURLProtocol.swift +19 -6
- package/dist/native/iosnativeWebView/Sources/Core/Utils/SafeAreaUtils.swift +1 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeCommandHandler.swift +1 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeMessageValidator.swift +4 -1
- package/dist/native/iosnativeWebView/Sources/Core/WebView/NativeBridge.swift +227 -4
- package/dist/native/iosnativeWebView/Sources/Core/WebView/TransitionManager.swift +169 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WeakScriptMessageHandler.swift +14 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WebView.swift +53 -8
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewNavigationDelegate.swift +88 -4
- package/dist/native/iosnativeWebView/iosnativeWebView/ContentView.swift +30 -11
- package/dist/native/iosnativeWebView/iosnativeWebView/Info.plist +11 -17
- package/dist/native/iosnativeWebView/iosnativeWebView.xcodeproj/project.pbxproj +8 -2
- package/dist/native/iosnativeWebView/iosnativeWebViewTests/BootTimingUtilityTests.swift +1 -1
- package/dist/native/iosnativeWebView/iosnativeWebViewTests/ConfigMappingTests.swift +4 -2
- package/dist/native/iosnativeWebView/iosnativeWebViewTests/PluginBridgeTests.swift +160 -0
- package/dist/native/plugin-bridge/PluginBridge.js +1 -0
- package/dist/native/pluginComposerAndroid.js +28 -0
- package/dist/native/pluginComposerIos.js +16 -0
- package/dist/native/renameAndroidProject.js +5 -5
- package/dist/native/setupEmulatorIos.js +6 -4
- package/dist/native/setupServer.js +2 -3
- package/dist/native/utils.js +4 -1
- package/dist/offline/catalyst-sw.js +1 -0
- package/dist/offline/registerServiceWorker.js +1 -0
- package/dist/otel.js +70 -2
- package/dist/router/ClientRouter.js +1 -1
- package/dist/scripts/build.js +1 -1
- package/dist/scripts/cleanCache.js +1 -0
- package/dist/scripts/devBuild.js +1 -1
- package/dist/scripts/devServe.js +1 -1
- package/dist/scripts/generateOfflineManifest.js +1 -0
- package/dist/scripts/loadEnvironmentVariables.js +1 -2
- package/dist/scripts/plugins.js +1 -0
- package/dist/scripts/registerAliases.js +6 -2
- package/dist/scripts/scriptUtils.js +2 -1
- package/dist/scripts/serve.js +2 -1
- package/dist/scripts/start.js +7 -2
- package/dist/server/expressServer.js +4 -8
- package/dist/server/renderer/document/Body.js +4 -4
- package/dist/server/renderer/document/Head.js +2 -2
- package/dist/server/renderer/extract.js +31 -27
- package/dist/server/renderer/handler.js +47 -24
- package/dist/server/renderer/index.js +1 -1
- package/dist/server/startServer.js +57 -7
- package/dist/server/utils/userAgentUtil.js +9 -3
- package/dist/server/utils/validator.js +1 -1
- package/dist/webpack/babel-plugins/remove-client.plugin.js +2 -2
- package/dist/webpack/babel-plugins/remove-ssr.plugin.js +2 -2
- package/dist/webpack/babel.config.client.js +1 -1
- package/dist/webpack/babel.config.ssr.js +1 -1
- package/dist/webpack/base.babel.js +7 -8
- package/dist/webpack/development.client.babel.js +7 -16
- package/dist/webpack/production.client.babel.js +1 -1
- package/dist/webpack/production.ssr.babel.js +5 -1
- package/mcp_v2/knowledge-base.json +206 -100
- package/mcp_v2/lib/helpers.js +42 -8
- package/mcp_v2/lib/seed.js +88 -0
- package/mcp_v2/mcp.js +150 -4
- package/mcp_v2/setup.js +30 -193
- package/mcp_v2/tools/build.js +1 -1
- package/mcp_v2/tools/config.js +16 -4
- package/mcp_v2/tools/conversion.js +11 -11
- package/mcp_v2/tools/github.js +1117 -0
- package/mcp_v2/tools/knowledge.js +16 -3
- package/mcp_v2/tools/sync.js +179 -10
- package/mcp_v2/tools/tasks.js +13 -4
- package/package.json +20 -8
package/mcp_v2/tools/build.js
CHANGED
|
@@ -658,7 +658,7 @@ function handle_get_architecture_diagram({ feature, symptom } = {}) {
|
|
|
658
658
|
|
|
659
659
|
if (diagram_key === "routing") {
|
|
660
660
|
const { grepSrc } = makeProjectHelpers(catalystRoot.dir)
|
|
661
|
-
const routeFiles = grepSrc(
|
|
661
|
+
const routeFiles = grepSrc(/RouterDataProvider|createBrowserRouter|<Route/)
|
|
662
662
|
project_context.push(
|
|
663
663
|
`RouterDataProvider found in: ${routeFiles.length ? routeFiles.slice(0, 3).join(", ") : "not detected"}`
|
|
664
664
|
)
|
package/mcp_v2/tools/config.js
CHANGED
|
@@ -8,6 +8,14 @@ function init(projectInfo) {
|
|
|
8
8
|
_projectInfo = projectInfo
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
function projectPath(root, rel) {
|
|
12
|
+
const normalized = path.normalize(rel)
|
|
13
|
+
if (path.isAbsolute(normalized) || normalized === ".." || normalized.startsWith(`..${path.sep}`)) {
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
return `${root}${path.sep}${normalized}`
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
function handle_check_config({ project_path, platform = "both" } = {}) {
|
|
12
20
|
const root = project_path || _projectInfo.dir
|
|
13
21
|
const configPath = path.join(root, "config", "config.json")
|
|
@@ -390,7 +398,10 @@ function handle_check_config({ project_path, platform = "both" } = {}) {
|
|
|
390
398
|
})
|
|
391
399
|
} else {
|
|
392
400
|
const missingSplash = ["public/android/splashscreen.png", "public/ios/splashscreen.png"].filter(
|
|
393
|
-
(f) =>
|
|
401
|
+
(f) => {
|
|
402
|
+
const filePath = projectPath(root, f)
|
|
403
|
+
return !filePath || !fs.existsSync(filePath)
|
|
404
|
+
}
|
|
394
405
|
)
|
|
395
406
|
if (missingSplash.length) {
|
|
396
407
|
issues.push({
|
|
@@ -405,9 +416,10 @@ function handle_check_config({ project_path, platform = "both" } = {}) {
|
|
|
405
416
|
|
|
406
417
|
// ── notifications (optional, validate if present) ─────────────────────────
|
|
407
418
|
if (wc.notifications && wc.notifications.enabled) {
|
|
408
|
-
const missingFirebase = ["google-services.json", "GoogleService-Info.plist"].filter(
|
|
409
|
-
|
|
410
|
-
|
|
419
|
+
const missingFirebase = ["google-services.json", "GoogleService-Info.plist"].filter((f) => {
|
|
420
|
+
const filePath = projectPath(root, f)
|
|
421
|
+
return !filePath || !fs.existsSync(filePath)
|
|
422
|
+
})
|
|
411
423
|
if (missingFirebase.length) {
|
|
412
424
|
issues.push({
|
|
413
425
|
field: "WEBVIEW_CONFIG.notifications",
|
|
@@ -113,9 +113,9 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
113
113
|
|
|
114
114
|
T4_DATA_FETCHING: () => {
|
|
115
115
|
const useEffectFiles = grepSrc(
|
|
116
|
-
|
|
116
|
+
/useEffect.*fetch|useEffect.*axios|useEffect.*\.get\(|useEffect.*\.post\(/
|
|
117
117
|
)
|
|
118
|
-
const fetcherFiles = grepSrc(
|
|
118
|
+
const fetcherFiles = grepSrc(/\.serverFetcher\s*=|\.clientFetcher\s*=/)
|
|
119
119
|
if (useEffectFiles.length === 0) return { status: "completed" }
|
|
120
120
|
return {
|
|
121
121
|
status: "needs_review",
|
|
@@ -368,13 +368,13 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
368
368
|
// ── Tier 3: Enhancements (feature-presence gated) ───────────────────────
|
|
369
369
|
|
|
370
370
|
T17a_USE_FILEPICKER: () => {
|
|
371
|
-
const oldPatternFiles = grepSrc(
|
|
371
|
+
const oldPatternFiles = grepSrc(/<input[^>]*type=['"]file['"]/)
|
|
372
372
|
if (oldPatternFiles.length === 0)
|
|
373
373
|
return {
|
|
374
374
|
status: "not_applicable",
|
|
375
375
|
reason: 'No <input type="file"> found in project — file upload feature not used.',
|
|
376
376
|
}
|
|
377
|
-
const hookUsageFiles = grepSrc(
|
|
377
|
+
const hookUsageFiles = grepSrc(/useFilePicker/)
|
|
378
378
|
return {
|
|
379
379
|
status: "needs_review",
|
|
380
380
|
native_risk:
|
|
@@ -396,13 +396,13 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
396
396
|
},
|
|
397
397
|
|
|
398
398
|
T17b_USE_CAMERA: () => {
|
|
399
|
-
const oldPatternFiles = grepSrc(
|
|
399
|
+
const oldPatternFiles = grepSrc(/accept=['"]image[^>]*capture|<input[^>]+capture/)
|
|
400
400
|
if (oldPatternFiles.length === 0)
|
|
401
401
|
return {
|
|
402
402
|
status: "not_applicable",
|
|
403
403
|
reason: "No camera capture inputs (<input capture>) found — camera feature not used.",
|
|
404
404
|
}
|
|
405
|
-
const hookUsageFiles = grepSrc(
|
|
405
|
+
const hookUsageFiles = grepSrc(/useCamera/)
|
|
406
406
|
return {
|
|
407
407
|
status: "needs_review",
|
|
408
408
|
native_risk:
|
|
@@ -424,13 +424,13 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
424
424
|
},
|
|
425
425
|
|
|
426
426
|
T18_USE_HAPTIC: () => {
|
|
427
|
-
const oldPatternFiles = grepSrc(
|
|
427
|
+
const oldPatternFiles = grepSrc(/navigator\.vibrate/)
|
|
428
428
|
if (oldPatternFiles.length === 0)
|
|
429
429
|
return {
|
|
430
430
|
status: "not_applicable",
|
|
431
431
|
reason: "No navigator.vibrate() calls found — haptic feedback not used.",
|
|
432
432
|
}
|
|
433
|
-
const hookUsageFiles = grepSrc(
|
|
433
|
+
const hookUsageFiles = grepSrc(/useHapticFeedback/)
|
|
434
434
|
return {
|
|
435
435
|
status: "needs_review",
|
|
436
436
|
native_risk:
|
|
@@ -453,7 +453,7 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
453
453
|
|
|
454
454
|
T19_USE_NOTIFICATIONS: () => {
|
|
455
455
|
if (!webviewConfig || !webviewConfig.notifications || !webviewConfig.notifications.enabled) {
|
|
456
|
-
const pushFiles = grepSrc(
|
|
456
|
+
const pushFiles = grepSrc(/firebase|FCM|pushNotif|useNotification/)
|
|
457
457
|
if (pushFiles.length === 0)
|
|
458
458
|
return {
|
|
459
459
|
status: "not_applicable",
|
|
@@ -480,7 +480,7 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
480
480
|
|
|
481
481
|
T20_USE_DEVICE_INFO: () => {
|
|
482
482
|
const oldPatternFiles = grepSrc(
|
|
483
|
-
|
|
483
|
+
/navigator\.userAgent|\/Android\/i\.test|\/iPhone\/i\.test|\/iPad\/i\.test/
|
|
484
484
|
)
|
|
485
485
|
if (oldPatternFiles.length === 0)
|
|
486
486
|
return {
|
|
@@ -488,7 +488,7 @@ function handle_get_conversion_status({ project_path, include_not_applicable = f
|
|
|
488
488
|
reason: "No navigator.userAgent / UA-sniffing found — platform detection not used.",
|
|
489
489
|
}
|
|
490
490
|
const correctPatternFiles = grepSrc(
|
|
491
|
-
|
|
491
|
+
/isNative|window\.NativeBridge|nativeBridge\.isAndroid|nativeBridge\.isIOS/
|
|
492
492
|
)
|
|
493
493
|
return {
|
|
494
494
|
status: "needs_review",
|