diff --git a/source/cpp/init.hpp b/source/cpp/init.hpp index 2270342..aadba74 100644 --- a/source/cpp/init.hpp +++ b/source/cpp/init.hpp @@ -156,6 +156,12 @@ class SystemState { * @return Shared pointer to the signature adaptation */ static std::shared_ptr GetSignatureAdaptation() { return s_signatureAdaptation; } + + /** + * @brief Get the AI integration + * @return Shared pointer to the AI integration + */ + static void* GetAIIntegration() { return s_aiIntegration; } #else /** * @brief Get the execution engine (non-iOS stub) @@ -192,6 +198,12 @@ class SystemState { * @return nullptr on non-iOS platforms */ static void* GetSignatureAdaptation() { return s_signatureAdaptation; } + + /** + * @brief Get the AI integration (non-iOS stub) + * @return nullptr on non-iOS platforms + */ + static void* GetAIIntegration() { return s_aiIntegration; } #endif private: diff --git a/source/cpp/ios/ExecutionEngine.h b/source/cpp/ios/ExecutionEngine.h index 45dc47b..68c68b4 100644 --- a/source/cpp/ios/ExecutionEngine.h +++ b/source/cpp/ios/ExecutionEngine.h @@ -55,8 +55,9 @@ namespace iOS { std::string m_output; // Output from the script int64_t m_executionTime; // Execution time in milliseconds - ExecutionResult(bool success = false, const std::string& error = "") - : m_success(success), m_error(error), m_executionTime(0) {} + ExecutionResult(bool success = false, const std::string& error = "", + int64_t executionTime = 0, const std::string& output = "") + : m_success(success), m_error(error), m_output(output), m_executionTime(executionTime) {} }; // Callback types @@ -73,6 +74,9 @@ namespace iOS { // Execute a script ExecutionResult Execute(const std::string& script, const ExecutionContext& context = ExecutionContext()); + // Execute a script by name from the script manager + ExecutionResult ExecuteByName(const std::string& scriptName, const ExecutionContext& context = ExecutionContext()); + // Set the default execution context void SetDefaultContext(const ExecutionContext& context); diff --git a/source/cpp/library.cpp b/source/cpp/library.cpp index 73eefe9..7721e7e 100644 --- a/source/cpp/library.cpp +++ b/source/cpp/library.cpp @@ -9,6 +9,10 @@ #include "ios/ScriptManager.h" #include "ios/JailbreakBypass.h" #include "ios/UIController.h" +#include "ios/ai_features/AIIntegrationManager.h" +#include "ios/ai_features/HybridAISystem.h" +#include "ios/ai_features/AIConfig.h" +#include "ios/ai_features/ScriptAssistant.h" #endif #ifdef __APPLE__ @@ -52,6 +56,7 @@ extern "C" { // Lua module entry point int luaopen_mylibrary(void* L) { + (void)L; // Prevent unused parameter warning std::cout << "Lua module loaded: mylibrary" << std::endl; // This will be called when the Lua state loads our library @@ -134,7 +139,7 @@ extern "C" { try { #ifdef __APPLE__ // Get UI controller - auto uiController = RobloxExecutor::SystemState::GetUIController(); + auto& uiController = RobloxExecutor::SystemState::GetUIController(); if (!uiController) { std::cerr << "InjectRobloxUI: UI controller not initialized" << std::endl; return false; @@ -164,9 +169,19 @@ extern "C" { return; } - // Configure capabilities - uint32_t capabilities = enable ? - iOS::AIFeatures::AIIntegrationManager::FULL_CAPABILITIES : 0; + // Configure capabilities based on enabled state + if (enable) { + // Log the capabilities being used + uint32_t capabilities = iOS::AIFeatures::AIIntegrationManager::FULL_CAPABILITIES; + std::cout << "Enabling AI capabilities: " << capabilities << std::endl; + + // Check available capabilities + uint32_t availableCapabilities = aiManager->GetAvailableCapabilities(); + std::cout << "Available AI capabilities: " << availableCapabilities << std::endl; + } else { + // When disabling, we don't need to set capabilities + std::cout << "Disabling all AI capabilities" << std::endl; + } // Set online mode aiManager->SetOnlineMode(enable ? @@ -214,7 +229,7 @@ extern "C" { }); // Register AI-generated script suggestions before execution - engine->RegisterBeforeExecuteCallback([scriptAssistant](const std::string& script, + engine->RegisterBeforeExecuteCallback([&scriptAssistant](const std::string& script, iOS::ExecutionEngine::ExecutionContext& context) { if (scriptAssistant) { // Log script for AI learning diff --git a/source/cpp/memory/ci_compat.h b/source/cpp/memory/ci_compat.h index b9f73ad..6f107cf 100644 --- a/source/cpp/memory/ci_compat.h +++ b/source/cpp/memory/ci_compat.h @@ -1,5 +1,7 @@ #pragma once +#include // For size_t + // CI compatibility header // This file provides compatibility definitions for continuous integration builds // where certain platform-specific features may not be available