@runanywhere/core 0.17.4 → 0.17.7
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/android/src/main/include/rac/infrastructure/model_management/rac_model_assignment.h +4 -20
- package/android/src/main/include/rac/infrastructure/network/rac_endpoints.h +3 -17
- package/android/src/main/jniLibs/arm64-v8a/libc++_shared.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libomp.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librac_commons.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/librunanywhere_jni.so +0 -0
- package/cpp/HybridRunAnywhereCore.cpp +78 -17
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h +4 -4
- package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/RACommons +0 -0
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/Headers/RACommons.h +4 -4
- package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons +0 -0
- package/nitrogen/generated/shared/c++/HybridRunAnywhereCoreSpec.hpp +1 -1
- package/package.json +3 -3
- package/src/Public/Extensions/RunAnywhere+Models.ts +8 -5
- package/src/services/Network/APIEndpoints.ts +1 -1
|
@@ -34,17 +34,9 @@ typedef struct rac_assignment_http_response {
|
|
|
34
34
|
const char* error_message; // Error message (can be NULL)
|
|
35
35
|
} rac_assignment_http_response_t;
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* @brief Device info for model assignment request
|
|
39
|
-
*/
|
|
40
|
-
typedef struct rac_assignment_device_info {
|
|
41
|
-
const char* device_type; // e.g., "iPhone15,2"
|
|
42
|
-
const char* platform; // e.g., "iOS"
|
|
43
|
-
} rac_assignment_device_info_t;
|
|
44
|
-
|
|
45
37
|
/**
|
|
46
38
|
* Make HTTP GET request for model assignments
|
|
47
|
-
* @param endpoint
|
|
39
|
+
* @param endpoint Endpoint path (e.g., "/api/v1/model-assignments/for-sdk")
|
|
48
40
|
* @param requires_auth Whether authentication header is required
|
|
49
41
|
* @param out_response Output parameter for response
|
|
50
42
|
* @param user_data User-provided context
|
|
@@ -54,14 +46,6 @@ typedef rac_result_t (*rac_assignment_http_get_fn)(const char* endpoint, rac_boo
|
|
|
54
46
|
rac_assignment_http_response_t* out_response,
|
|
55
47
|
void* user_data);
|
|
56
48
|
|
|
57
|
-
/**
|
|
58
|
-
* Get device info for model assignment request
|
|
59
|
-
* @param out_info Output parameter for device info
|
|
60
|
-
* @param user_data User-provided context
|
|
61
|
-
*/
|
|
62
|
-
typedef void (*rac_assignment_get_device_info_fn)(rac_assignment_device_info_t* out_info,
|
|
63
|
-
void* user_data);
|
|
64
|
-
|
|
65
49
|
/**
|
|
66
50
|
* @brief Callback structure for model assignment operations
|
|
67
51
|
*/
|
|
@@ -69,11 +53,11 @@ typedef struct rac_assignment_callbacks {
|
|
|
69
53
|
/** Make HTTP GET request */
|
|
70
54
|
rac_assignment_http_get_fn http_get;
|
|
71
55
|
|
|
72
|
-
/** Get device info for request */
|
|
73
|
-
rac_assignment_get_device_info_fn get_device_info;
|
|
74
|
-
|
|
75
56
|
/** User data passed to all callbacks */
|
|
76
57
|
void* user_data;
|
|
58
|
+
|
|
59
|
+
/** If true, automatically fetch models after callbacks are registered */
|
|
60
|
+
rac_bool_t auto_fetch;
|
|
77
61
|
} rac_assignment_callbacks_t;
|
|
78
62
|
|
|
79
63
|
// =============================================================================
|
|
@@ -62,24 +62,10 @@ const char* rac_endpoint_device_registration(rac_environment_t env);
|
|
|
62
62
|
const char* rac_endpoint_telemetry(rac_environment_t env);
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* @brief
|
|
66
|
-
* @
|
|
67
|
-
* @param platform Platform (e.g., "ios", "android")
|
|
68
|
-
* @param out_buffer Buffer to write endpoint path
|
|
69
|
-
* @param buffer_size Size of buffer
|
|
70
|
-
* @return Length of written string, or -1 on error
|
|
71
|
-
*/
|
|
72
|
-
int rac_endpoint_model_assignments(const char* device_type, const char* platform, char* out_buffer,
|
|
73
|
-
size_t buffer_size);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @brief Build model download endpoint
|
|
77
|
-
* @param model_id The model ID
|
|
78
|
-
* @param out_buffer Buffer to write endpoint path
|
|
79
|
-
* @param buffer_size Size of buffer
|
|
80
|
-
* @return Length of written string, or -1 on error
|
|
65
|
+
* @brief Get model assignments endpoint
|
|
66
|
+
* @return Endpoint path string
|
|
81
67
|
*/
|
|
82
|
-
|
|
68
|
+
const char* rac_endpoint_model_assignments(void);
|
|
83
69
|
|
|
84
70
|
// =============================================================================
|
|
85
71
|
// Full URL Building
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -373,6 +373,67 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::initialize(
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
// 9. Initialize model assignments with auto-fetch
|
|
377
|
+
// Set up HTTP GET callback for fetching models from backend
|
|
378
|
+
{
|
|
379
|
+
rac_assignment_callbacks_t callbacks = {};
|
|
380
|
+
|
|
381
|
+
// HTTP GET callback - uses HTTPBridge for network requests
|
|
382
|
+
callbacks.http_get = [](const char* endpoint, rac_bool_t requires_auth,
|
|
383
|
+
rac_assignment_http_response_t* out_response, void* user_data) -> rac_result_t {
|
|
384
|
+
if (!out_response) return RAC_ERROR_NULL_POINTER;
|
|
385
|
+
|
|
386
|
+
try {
|
|
387
|
+
std::string endpointStr = endpoint ? endpoint : "";
|
|
388
|
+
LOGD("Model assignment HTTP GET: %s", endpointStr.c_str());
|
|
389
|
+
|
|
390
|
+
// Use HTTPBridge::execute which calls the registered JS executor
|
|
391
|
+
auto responseOpt = HTTPBridge::shared().execute("GET", endpointStr, "", requires_auth == RAC_TRUE);
|
|
392
|
+
|
|
393
|
+
if (!responseOpt.has_value()) {
|
|
394
|
+
LOGE("HTTP executor not registered");
|
|
395
|
+
out_response->result = RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
396
|
+
out_response->error_message = strdup("HTTP executor not registered");
|
|
397
|
+
return RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const auto& response = responseOpt.value();
|
|
401
|
+
if (response.success && !response.body.empty()) {
|
|
402
|
+
out_response->result = RAC_SUCCESS;
|
|
403
|
+
out_response->status_code = response.statusCode;
|
|
404
|
+
out_response->response_body = strdup(response.body.c_str());
|
|
405
|
+
out_response->response_length = response.body.length();
|
|
406
|
+
return RAC_SUCCESS;
|
|
407
|
+
} else {
|
|
408
|
+
out_response->result = RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
409
|
+
out_response->status_code = response.statusCode;
|
|
410
|
+
if (!response.error.empty()) {
|
|
411
|
+
out_response->error_message = strdup(response.error.c_str());
|
|
412
|
+
}
|
|
413
|
+
return RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
414
|
+
}
|
|
415
|
+
} catch (const std::exception& e) {
|
|
416
|
+
LOGE("Model assignment HTTP GET failed: %s", e.what());
|
|
417
|
+
out_response->result = RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
418
|
+
out_response->error_message = strdup(e.what());
|
|
419
|
+
return RAC_ERROR_HTTP_REQUEST_FAILED;
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
callbacks.user_data = nullptr;
|
|
424
|
+
// Only auto-fetch in staging/production, not development
|
|
425
|
+
bool shouldAutoFetch = (env != SDKEnvironment::Development);
|
|
426
|
+
callbacks.auto_fetch = shouldAutoFetch ? RAC_TRUE : RAC_FALSE;
|
|
427
|
+
|
|
428
|
+
result = rac_model_assignment_set_callbacks(&callbacks);
|
|
429
|
+
if (result == RAC_SUCCESS) {
|
|
430
|
+
LOGI("Model assignment callbacks registered (autoFetch: %s)", shouldAutoFetch ? "true" : "false");
|
|
431
|
+
} else {
|
|
432
|
+
LOGE("Failed to register model assignment callbacks: %d", result);
|
|
433
|
+
// Continue - not fatal, models can be fetched later
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
376
437
|
LOGI("Core SDK initialized successfully");
|
|
377
438
|
return true;
|
|
378
439
|
});
|
|
@@ -406,10 +467,10 @@ std::shared_ptr<Promise<std::string>> HybridRunAnywhereCore::getBackendInfo() {
|
|
|
406
467
|
return Promise<std::string>::async([]() {
|
|
407
468
|
// Check if SDK is initialized using the actual InitBridge state
|
|
408
469
|
bool isInitialized = InitBridge::shared().isInitialized();
|
|
409
|
-
|
|
470
|
+
|
|
410
471
|
std::string status = isInitialized ? "initialized" : "not_initialized";
|
|
411
472
|
std::string name = isInitialized ? "RunAnywhere Core" : "Not initialized";
|
|
412
|
-
|
|
473
|
+
|
|
413
474
|
return buildJsonObject({
|
|
414
475
|
{"name", jsonString(name)},
|
|
415
476
|
{"status", jsonString(status)},
|
|
@@ -496,8 +557,8 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::setAuthTokens(
|
|
|
496
557
|
// IMPORTANT: Actually store the tokens in AuthBridge!
|
|
497
558
|
// handleAuthResponse only parses, setAuth stores them
|
|
498
559
|
AuthBridge::shared().setAuth(response);
|
|
499
|
-
|
|
500
|
-
LOGI("Auth tokens set successfully. Token expires in %lld seconds",
|
|
560
|
+
|
|
561
|
+
LOGI("Auth tokens set successfully. Token expires in %lld seconds",
|
|
501
562
|
static_cast<long long>(response.expiresIn));
|
|
502
563
|
LOGD("Access token stored (length=%zu)", response.accessToken.length());
|
|
503
564
|
return true;
|
|
@@ -526,7 +587,7 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
526
587
|
|
|
527
588
|
std::string buildToken = extractStringValue(environmentJson, "buildToken", "");
|
|
528
589
|
std::string supabaseKey = extractStringValue(environmentJson, "supabaseKey", "");
|
|
529
|
-
|
|
590
|
+
|
|
530
591
|
// For development mode, get build token from C++ dev config if not provided
|
|
531
592
|
// This matches Swift's CppBridge.DevConfig.buildToken behavior
|
|
532
593
|
if (buildToken.empty() && env == RAC_ENV_DEVELOPMENT) {
|
|
@@ -544,7 +605,7 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
544
605
|
// Matches Swift's CppBridge+Device.swift get_device_info callback
|
|
545
606
|
callbacks.getDeviceInfo = []() -> DeviceInfo {
|
|
546
607
|
DeviceInfo info;
|
|
547
|
-
|
|
608
|
+
|
|
548
609
|
// Core identification
|
|
549
610
|
info.deviceId = InitBridge::shared().getPersistentDeviceUUID();
|
|
550
611
|
// Use actual platform (ios/android) as backend only accepts these values
|
|
@@ -557,7 +618,7 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
557
618
|
#endif
|
|
558
619
|
// Use centralized SDK version from InitBridge (set from TypeScript SDKConstants)
|
|
559
620
|
info.sdkVersion = InitBridge::shared().getSdkVersion();
|
|
560
|
-
|
|
621
|
+
|
|
561
622
|
// Device hardware info from platform-specific code
|
|
562
623
|
info.deviceModel = InitBridge::shared().getDeviceModel();
|
|
563
624
|
info.deviceName = info.deviceModel; // Use model as name (React Native doesn't expose device name)
|
|
@@ -567,12 +628,12 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
567
628
|
info.totalMemory = InitBridge::shared().getTotalMemory();
|
|
568
629
|
info.availableMemory = InitBridge::shared().getAvailableMemory();
|
|
569
630
|
info.coreCount = InitBridge::shared().getCoreCount();
|
|
570
|
-
|
|
631
|
+
|
|
571
632
|
// Form factor detection (matches Swift SDK: device.userInterfaceIdiom == .pad)
|
|
572
633
|
// Uses platform-specific detection via InitBridge::isTablet()
|
|
573
634
|
bool isTabletDevice = InitBridge::shared().isTablet();
|
|
574
635
|
info.formFactor = isTabletDevice ? "tablet" : "phone";
|
|
575
|
-
|
|
636
|
+
|
|
576
637
|
// Platform-specific values
|
|
577
638
|
#if defined(__APPLE__)
|
|
578
639
|
info.osName = "iOS";
|
|
@@ -590,16 +651,16 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
590
651
|
info.hasNeuralEngine = false;
|
|
591
652
|
info.neuralEngineCores = 0;
|
|
592
653
|
#endif
|
|
593
|
-
|
|
654
|
+
|
|
594
655
|
// Battery info (not available in React Native easily, use defaults)
|
|
595
656
|
info.batteryLevel = -1.0; // Unknown
|
|
596
657
|
info.batteryState = ""; // Unknown
|
|
597
658
|
info.isLowPowerMode = false;
|
|
598
|
-
|
|
659
|
+
|
|
599
660
|
// Core distribution (approximate for mobile devices)
|
|
600
661
|
info.performanceCores = info.coreCount > 4 ? 2 : 1;
|
|
601
662
|
info.efficiencyCores = info.coreCount - info.performanceCores;
|
|
602
|
-
|
|
663
|
+
|
|
603
664
|
return info;
|
|
604
665
|
};
|
|
605
666
|
|
|
@@ -641,10 +702,10 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
641
702
|
// NO FALLBACK - credentials must come from C++ config only
|
|
642
703
|
const char* devUrl = rac_dev_config_get_supabase_url();
|
|
643
704
|
const char* devKey = rac_dev_config_get_supabase_key();
|
|
644
|
-
|
|
705
|
+
|
|
645
706
|
baseURL = devUrl ? devUrl : "";
|
|
646
707
|
apiKey = devKey ? devKey : "";
|
|
647
|
-
|
|
708
|
+
|
|
648
709
|
if (baseURL.empty()) {
|
|
649
710
|
LOGW("Development mode but Supabase URL not configured in C++ dev_config");
|
|
650
711
|
} else {
|
|
@@ -654,7 +715,7 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
654
715
|
// Production/Staging: Use configured Railway URL
|
|
655
716
|
// These come from SDK initialization (App.tsx -> RunAnywhere.initialize)
|
|
656
717
|
baseURL = InitBridge::shared().getBaseURL();
|
|
657
|
-
|
|
718
|
+
|
|
658
719
|
// For production mode, prefer JWT access token (from authentication)
|
|
659
720
|
// over raw API key. This matches Swift/Kotlin behavior.
|
|
660
721
|
std::string accessToken = AuthBridge::shared().getAccessToken();
|
|
@@ -666,12 +727,12 @@ std::shared_ptr<Promise<bool>> HybridRunAnywhereCore::registerDevice(
|
|
|
666
727
|
apiKey = InitBridge::shared().getApiKey();
|
|
667
728
|
LOGD("Using API key for device registration (not authenticated)");
|
|
668
729
|
}
|
|
669
|
-
|
|
730
|
+
|
|
670
731
|
// Fallback to default if not configured
|
|
671
732
|
if (baseURL.empty()) {
|
|
672
733
|
baseURL = "https://api.runanywhere.ai";
|
|
673
734
|
}
|
|
674
|
-
|
|
735
|
+
|
|
675
736
|
LOGD("Using production config: %s", baseURL.c_str());
|
|
676
737
|
}
|
|
677
738
|
|
package/ios/Binaries/RACommons.xcframework/ios-arm64/RACommons.framework/Headers/RACommons.h
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include "rac_events.h"
|
|
17
17
|
#include "rac_http_client.h"
|
|
18
18
|
#include "rac_lifecycle.h"
|
|
19
|
-
#include "rac_llm.h"
|
|
20
19
|
#include "rac_llm_analytics.h"
|
|
21
20
|
#include "rac_llm_component.h"
|
|
22
21
|
#include "rac_llm_events.h"
|
|
@@ -26,6 +25,7 @@
|
|
|
26
25
|
#include "rac_llm_service.h"
|
|
27
26
|
#include "rac_llm_structured_output.h"
|
|
28
27
|
#include "rac_llm_types.h"
|
|
28
|
+
#include "rac_llm.h"
|
|
29
29
|
#include "rac_logger.h"
|
|
30
30
|
#include "rac_model_assignment.h"
|
|
31
31
|
#include "rac_model_paths.h"
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
#include "rac_sdk_state.h"
|
|
37
37
|
#include "rac_storage_analyzer.h"
|
|
38
38
|
#include "rac_structured_error.h"
|
|
39
|
-
#include "rac_stt.h"
|
|
40
39
|
#include "rac_stt_analytics.h"
|
|
41
40
|
#include "rac_stt_component.h"
|
|
42
41
|
#include "rac_stt_events.h"
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
#include "rac_stt_service.h"
|
|
45
44
|
#include "rac_stt_types.h"
|
|
46
45
|
#include "rac_stt_whispercpp.h"
|
|
46
|
+
#include "rac_stt.h"
|
|
47
47
|
#include "rac_telemetry_manager.h"
|
|
48
48
|
#include "rac_telemetry_types.h"
|
|
49
|
-
#include "rac_tts.h"
|
|
50
49
|
#include "rac_tts_analytics.h"
|
|
51
50
|
#include "rac_tts_component.h"
|
|
52
51
|
#include "rac_tts_events.h"
|
|
@@ -54,8 +53,8 @@
|
|
|
54
53
|
#include "rac_tts_platform.h"
|
|
55
54
|
#include "rac_tts_service.h"
|
|
56
55
|
#include "rac_tts_types.h"
|
|
56
|
+
#include "rac_tts.h"
|
|
57
57
|
#include "rac_types.h"
|
|
58
|
-
#include "rac_vad.h"
|
|
59
58
|
#include "rac_vad_analytics.h"
|
|
60
59
|
#include "rac_vad_component.h"
|
|
61
60
|
#include "rac_vad_energy.h"
|
|
@@ -63,5 +62,6 @@
|
|
|
63
62
|
#include "rac_vad_onnx.h"
|
|
64
63
|
#include "rac_vad_service.h"
|
|
65
64
|
#include "rac_vad_types.h"
|
|
65
|
+
#include "rac_vad.h"
|
|
66
66
|
#include "rac_voice_agent.h"
|
|
67
67
|
#endif
|
|
Binary file
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include "rac_events.h"
|
|
17
17
|
#include "rac_http_client.h"
|
|
18
18
|
#include "rac_lifecycle.h"
|
|
19
|
-
#include "rac_llm.h"
|
|
20
19
|
#include "rac_llm_analytics.h"
|
|
21
20
|
#include "rac_llm_component.h"
|
|
22
21
|
#include "rac_llm_events.h"
|
|
@@ -26,6 +25,7 @@
|
|
|
26
25
|
#include "rac_llm_service.h"
|
|
27
26
|
#include "rac_llm_structured_output.h"
|
|
28
27
|
#include "rac_llm_types.h"
|
|
28
|
+
#include "rac_llm.h"
|
|
29
29
|
#include "rac_logger.h"
|
|
30
30
|
#include "rac_model_assignment.h"
|
|
31
31
|
#include "rac_model_paths.h"
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
#include "rac_sdk_state.h"
|
|
37
37
|
#include "rac_storage_analyzer.h"
|
|
38
38
|
#include "rac_structured_error.h"
|
|
39
|
-
#include "rac_stt.h"
|
|
40
39
|
#include "rac_stt_analytics.h"
|
|
41
40
|
#include "rac_stt_component.h"
|
|
42
41
|
#include "rac_stt_events.h"
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
#include "rac_stt_service.h"
|
|
45
44
|
#include "rac_stt_types.h"
|
|
46
45
|
#include "rac_stt_whispercpp.h"
|
|
46
|
+
#include "rac_stt.h"
|
|
47
47
|
#include "rac_telemetry_manager.h"
|
|
48
48
|
#include "rac_telemetry_types.h"
|
|
49
|
-
#include "rac_tts.h"
|
|
50
49
|
#include "rac_tts_analytics.h"
|
|
51
50
|
#include "rac_tts_component.h"
|
|
52
51
|
#include "rac_tts_events.h"
|
|
@@ -54,8 +53,8 @@
|
|
|
54
53
|
#include "rac_tts_platform.h"
|
|
55
54
|
#include "rac_tts_service.h"
|
|
56
55
|
#include "rac_tts_types.h"
|
|
56
|
+
#include "rac_tts.h"
|
|
57
57
|
#include "rac_types.h"
|
|
58
|
-
#include "rac_vad.h"
|
|
59
58
|
#include "rac_vad_analytics.h"
|
|
60
59
|
#include "rac_vad_component.h"
|
|
61
60
|
#include "rac_vad_energy.h"
|
|
@@ -63,5 +62,6 @@
|
|
|
63
62
|
#include "rac_vad_onnx.h"
|
|
64
63
|
#include "rac_vad_service.h"
|
|
65
64
|
#include "rac_vad_types.h"
|
|
65
|
+
#include "rac_vad.h"
|
|
66
66
|
#include "rac_voice_agent.h"
|
|
67
67
|
#endif
|
package/ios/Binaries/RACommons.xcframework/ios-arm64_x86_64-simulator/RACommons.framework/RACommons
CHANGED
|
Binary file
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
#include <string>
|
|
20
20
|
#include <optional>
|
|
21
21
|
#include <functional>
|
|
22
|
-
//
|
|
22
|
+
// #include <NitroModules/Null.hpp> // Removed - file does not exist in nitro-modules 0.31.3
|
|
23
23
|
#include <variant>
|
|
24
24
|
|
|
25
25
|
namespace margelo::nitro::runanywhere {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runanywhere/core",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.7",
|
|
4
4
|
"description": "Core SDK for RunAnywhere React Native - includes RACommons bindings, native bridges, and public API",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/react": "~19.1.0",
|
|
70
|
-
"nitrogen": "^0.
|
|
71
|
-
"react-native-nitro-modules": "
|
|
70
|
+
"nitrogen": "^0.33.2",
|
|
71
|
+
"react-native-nitro-modules": "0.33.2",
|
|
72
72
|
"typescript": "~5.9.2"
|
|
73
73
|
},
|
|
74
74
|
"create-react-native-library": {
|
|
@@ -135,7 +135,11 @@ export async function getDownloadedModels(): Promise<ModelInfo[]> {
|
|
|
135
135
|
// ============================================================================
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* Fetch model assignments for the current device from the backend
|
|
138
|
+
* Fetch model assignments for the current device from the backend.
|
|
139
|
+
*
|
|
140
|
+
* Note: Model assignments are automatically fetched during SDK initialization
|
|
141
|
+
* (auto-fetch is enabled in the C++ layer). This method retrieves the cached
|
|
142
|
+
* models from the registry.
|
|
139
143
|
*/
|
|
140
144
|
export async function fetchModelAssignments(
|
|
141
145
|
forceRefresh = false,
|
|
@@ -150,7 +154,7 @@ export async function fetchModelAssignments(
|
|
|
150
154
|
|
|
151
155
|
logger.info('Fetching model assignments...');
|
|
152
156
|
|
|
153
|
-
//
|
|
157
|
+
// Models are auto-fetched at SDK initialization and saved to the registry
|
|
154
158
|
try {
|
|
155
159
|
const models = await ModelRegistry.getAllModels();
|
|
156
160
|
logger.info(`Successfully fetched ${models.length} model assignments`);
|
|
@@ -181,7 +185,8 @@ export async function getModelsForCategory(
|
|
|
181
185
|
}
|
|
182
186
|
|
|
183
187
|
/**
|
|
184
|
-
* Clear cached model assignments
|
|
188
|
+
* Clear cached model assignments.
|
|
189
|
+
* Resets local state; next fetch will get fresh data from the registry.
|
|
185
190
|
*/
|
|
186
191
|
export async function clearModelAssignmentsCache(
|
|
187
192
|
initState: { isCoreInitialized: boolean }
|
|
@@ -190,8 +195,6 @@ export async function clearModelAssignmentsCache(
|
|
|
190
195
|
return;
|
|
191
196
|
}
|
|
192
197
|
|
|
193
|
-
// Cache clearing is handled by native commons
|
|
194
|
-
// Reset local state if needed
|
|
195
198
|
ModelRegistry.reset();
|
|
196
199
|
}
|
|
197
200
|
|
|
@@ -44,7 +44,7 @@ export const APIEndpoints = {
|
|
|
44
44
|
MODEL_INFO: '/api/v1/models',
|
|
45
45
|
|
|
46
46
|
/** Model assignments */
|
|
47
|
-
MODEL_ASSIGNMENTS: '/api/v1/model-assignments',
|
|
47
|
+
MODEL_ASSIGNMENTS: '/api/v1/model-assignments/for-sdk',
|
|
48
48
|
|
|
49
49
|
/** Model assignments (development - Supabase) */
|
|
50
50
|
DEV_MODEL_ASSIGNMENTS: '/rest/v1/sdk_model_assignments',
|