javonet-ruby-sdk 2.6.6 → 2.6.8

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 (248) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/javonet-ruby-sdk/Binaries/Clr/JavonetClrRuntime.dll +0 -0
  4. data/lib/javonet-ruby-sdk/Binaries/Jvm/JavonetJvmRuntime.jar +0 -0
  5. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/ARM64/libJavonetActivationService.so +0 -0
  6. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/ARM64/libJavonetJvmRuntimeNative.so +0 -0
  7. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/ARM64/libJavonetRubyRuntimeNative.so +0 -0
  8. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/ARM64/libUtils.so +0 -0
  9. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/ARM64/version.txt +1 -1
  10. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/libJavonetActivationService.so +0 -0
  11. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/libJavonetJvmRuntimeNative.so +0 -0
  12. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/libJavonetNodejs2218RuntimeNative.so +0 -0
  13. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/libJavonetRubyRuntimeNative.so +0 -0
  14. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/libUtils.so +0 -0
  15. data/lib/javonet-ruby-sdk/Binaries/Native/Linux/X64/version.txt +1 -1
  16. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetActivationService.dylib +0 -0
  17. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetCppRuntimeNative.dylib +0 -0
  18. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetGoRuntimeNative.dylib +0 -0
  19. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetJvmRuntimeNative.dylib +0 -0
  20. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetNetcoreRuntimeNative.dylib +0 -0
  21. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetPythonRuntimeNative.dylib +0 -0
  22. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetRubyRuntimeNative.dylib +0 -0
  23. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetTcpClient.dylib +0 -0
  24. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libJavonetTcpTlsClient.dylib +0 -0
  25. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/libUtils.dylib +0 -0
  26. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/ARM64/version.txt +1 -1
  27. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetActivationService.dylib +0 -0
  28. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetCppRuntimeNative.dylib +0 -0
  29. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetGoRuntimeNative.dylib +0 -0
  30. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetJvmRuntimeNative.dylib +0 -0
  31. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetNetcoreRuntimeNative.dylib +0 -0
  32. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetNodejs2218RuntimeNative.dylib +0 -0
  33. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetNodejsRuntimeNative.dylib +0 -0
  34. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetPerlRuntimeNative.dylib +0 -0
  35. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetPhp848RuntimeNative.dylib +0 -0
  36. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetPhpRuntimeNative.dylib +0 -0
  37. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetPythonRuntimeNative.dylib +0 -0
  38. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetRubyRuntimeNative.dylib +0 -0
  39. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetTcpClient.dylib +0 -0
  40. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libJavonetTcpTlsClient.dylib +0 -0
  41. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/libUtils.dylib +0 -0
  42. data/lib/javonet-ruby-sdk/Binaries/Native/MacOs/X64/version.txt +1 -1
  43. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/Configs.dll +0 -0
  44. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetActivationService.dll +0 -0
  45. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetCppRuntimeNative.dll +0 -0
  46. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetGoRuntimeNative.dll +0 -0
  47. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetJvmRuntimeNative.dll +0 -0
  48. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetNetcoreRuntimeNative.dll +0 -0
  49. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetPhpRuntimeNative.dll +0 -0
  50. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetPythonRuntimeNative.dll +0 -0
  51. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetRubyRuntimeNative.dll +0 -0
  52. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetTcpClient.dll +0 -0
  53. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/JavonetTcpTlsClient.dll +0 -0
  54. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/Utils.dll +0 -0
  55. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/ARM64/version.txt +0 -0
  56. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/Configs.dll +0 -0
  57. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetActivationService.dll +0 -0
  58. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetClrRuntimeNative.dll +0 -0
  59. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetCppRuntimeNative.dll +0 -0
  60. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetGoRuntimeNative.dll +0 -0
  61. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetJvmRuntimeNative.dll +0 -0
  62. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetNetcoreRuntimeNative.dll +0 -0
  63. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetNodejs2218RuntimeNative.dll +0 -0
  64. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetNodejsRuntimeNative.dll +0 -0
  65. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetPerlRuntimeNative.dll +0 -0
  66. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetPhp848RuntimeNative.dll +0 -0
  67. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetPhpRuntimeNative.dll +0 -0
  68. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetPython2RuntimeNative.dll +0 -0
  69. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetPythonRuntimeNative.dll +0 -0
  70. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetRubyRuntimeNative.dll +0 -0
  71. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetTcpClient.dll +0 -0
  72. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/JavonetTcpTlsClient.dll +0 -0
  73. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/Utils.dll +0 -0
  74. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X64/version.txt +1 -1
  75. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/Configs.dll +0 -0
  76. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetActivationService.dll +0 -0
  77. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetClrRuntimeNative.dll +0 -0
  78. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetCppRuntimeNative.dll +0 -0
  79. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetGoRuntimeNative.dll +0 -0
  80. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetJvmRuntimeNative.dll +0 -0
  81. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetNetcoreRuntimeNative.dll +0 -0
  82. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetPhpRuntimeNative.dll +0 -0
  83. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetPython2RuntimeNative.dll +0 -0
  84. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetPythonRuntimeNative.dll +0 -0
  85. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetTcpClient.dll +0 -0
  86. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/JavonetTcpTlsClient.dll +0 -0
  87. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/Utils.dll +0 -0
  88. data/lib/javonet-ruby-sdk/Binaries/Native/Windows/X86/version.txt +1 -1
  89. data/lib/javonet-ruby-sdk/Binaries/Netcore/Javonet.Netcore.Core.dll +0 -0
  90. data/lib/javonet-ruby-sdk/Binaries/Netcore/Javonet.Netcore.Plugins.dll +0 -0
  91. data/lib/javonet-ruby-sdk/Binaries/Netcore/Javonet.Netcore.Utils.dll +0 -0
  92. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/handler/Handler.cjs +2 -7
  93. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/handler/LoadLibraryHandler.cjs +26 -12
  94. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/handler/PassDelegateHandler.cjs +2 -2
  95. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/interpreter/Interpreter.cjs +27 -92
  96. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/protocol/CommandSerializer.cjs +3 -8
  97. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/core/receiver/Receiver.cjs +6 -6
  98. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/Activator.cjs +44 -0
  99. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/ActivatorDetails.cjs +13 -3
  100. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/ConfigRuntimeFactory.cjs +9 -0
  101. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/InvocationContext.cjs +52 -200
  102. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/Javonet.cjs +3 -11
  103. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/RuntimeContext.cjs +11 -57
  104. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/configuration/ConfigSourceResolver.cjs +43 -21
  105. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/sdk/tools/ComplexTypeResolver.cjs +84 -45
  106. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/core/handler/Handler.d.ts +2 -1
  107. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/core/handler/PassDelegateHandler.d.ts +2 -2
  108. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/core/interpreter/Interpreter.d.ts +2 -9
  109. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/core/protocol/CommandSerializer.d.ts +3 -3
  110. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/core/receiver/Receiver.d.ts +4 -4
  111. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/Activator.d.ts +12 -0
  112. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/ActivatorDetails.d.ts +5 -3
  113. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/ConfigRuntimeFactory.d.ts +7 -0
  114. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/InvocationContext.d.ts +11 -34
  115. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/Javonet.d.ts +3 -1
  116. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/RuntimeContext.d.ts +4 -3
  117. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/configuration/ConfigSourceResolver.d.ts +21 -4
  118. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/sdk/tools/ComplexTypeResolver.d.ts +21 -5
  119. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/types/utils/Primitives.d.ts +5 -0
  120. data/lib/javonet-ruby-sdk/Binaries/Nodejs/dist/utils/Primitives.cjs +201 -0
  121. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Class/Load/XS/XS.so +0 -0
  122. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Data/UUID/UUID.so +0 -0
  123. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/FFI/Platypus/Platypus.so +0 -0
  124. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/List/Util/Util.so +0 -0
  125. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Moose/Moose.so +0 -0
  126. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/PPI/XS/XS.so +0 -0
  127. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Package/Stash/XS/XS.so +0 -0
  128. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Params/Util/Util.so +0 -0
  129. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Want/Want.so +0 -0
  130. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/auto/share/dist/FFI-Platypus/lib/libplfill.so +0 -0
  131. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod +96 -96
  132. data/lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/CommandHandler/LoadLibraryHandler.pm +108 -11
  133. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/auto/Data/UUID/UUID.xs.dll +0 -0
  134. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/auto/PPI/XS/XS.xs.dll +0 -0
  135. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/auto/Scalar/Util/Numeric/Numeric.xs.dll +0 -0
  136. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/auto/Want/Want.xs.dll +0 -0
  137. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/auto/autobox/autobox.xs.dll +0 -0
  138. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/deps/lib/perl5/MSWin32-x64-multi-thread/perllocal.pod +24 -24
  139. data/lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/CommandHandler/LoadLibraryHandler.pm +108 -11
  140. data/lib/javonet-ruby-sdk/Binaries/Php/javonet/core/handler/LoadLibraryHandler.php +56 -21
  141. data/lib/javonet-ruby-sdk/Binaries/Php/javonet/core/interpreter/Interpreter.php +2 -2
  142. data/lib/javonet-ruby-sdk/Binaries/Php/javonet/core/protocol/CommandDeserializer.php +219 -106
  143. data/lib/javonet-ruby-sdk/Binaries/Php/javonet/core/protocol/CommandSerializer.php +55 -13
  144. data/lib/javonet-ruby-sdk/Binaries/Php/javonet/utils/Command.php +27 -9
  145. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/__pycache__/__init__.cpython-312.pyc +0 -0
  146. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/delegateCache/__pycache__/DelegatesCache.cpython-312.pyc +0 -0
  147. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/delegateCache/__pycache__/__init__.cpython-312.pyc +0 -0
  148. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/GetTypeHandler.py +2 -2
  149. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/LoadLibraryHandler.py +54 -14
  150. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/AbstractCommandHandler.cpython-312.pyc +0 -0
  151. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/AbstractHandler.cpython-312.pyc +0 -0
  152. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/AddEventListenerHandler.cpython-312.pyc +0 -0
  153. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArrayGetItemHandler.cpython-312.pyc +0 -0
  154. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArrayGetRankHandler.cpython-312.pyc +0 -0
  155. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArrayGetSizeHandler.cpython-312.pyc +0 -0
  156. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArrayHandler.cpython-312.pyc +0 -0
  157. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArrayReferenceHandler.cpython-312.pyc +0 -0
  158. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ArraySetItemHandler.cpython-312.pyc +0 -0
  159. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/AsOutHandler.cpython-312.pyc +0 -0
  160. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/AsRefHandler.cpython-312.pyc +0 -0
  161. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/CastingHandler.cpython-312.pyc +0 -0
  162. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ConvertTypeHandler.cpython-312.pyc +0 -0
  163. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/CreateClassInstanceHandler.cpython-312.pyc +0 -0
  164. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/CreateNullHandler.cpython-312.pyc +0 -0
  165. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/DestructReferenceHandler.cpython-312.pyc +0 -0
  166. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/EnableNamespaceHandler.cpython-312.pyc +0 -0
  167. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/EnableTypeHandler.cpython-312.pyc +0 -0
  168. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ExceptionHandler.cpython-312.pyc +0 -0
  169. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GenerateLibHandler.cpython-312.pyc +0 -0
  170. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetAsyncOperationResultHandler.cpython-312.pyc +0 -0
  171. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetEnumItemHandler.cpython-312.pyc +0 -0
  172. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetEnumNameHandler.cpython-312.pyc +0 -0
  173. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetEnumValueHandler.cpython-312.pyc +0 -0
  174. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetGlobalFieldHandler.cpython-312.pyc +0 -0
  175. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetInstanceFieldHandler.cpython-312.pyc +0 -0
  176. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetInstanceMethodAsDelegateHandler.cpython-312.pyc +0 -0
  177. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetKwargHandler.cpython-312.pyc +0 -0
  178. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetModuleHandler.cpython-312.pyc +0 -0
  179. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetRefValueHandler.cpython-312.pyc +0 -0
  180. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetResultTypeHandler.cpython-312.pyc +0 -0
  181. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetStaticFieldHandler.cpython-312.pyc +0 -0
  182. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetStaticMethodAsDelegateHandler.cpython-312.pyc +0 -0
  183. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/GetTypeHandler.cpython-312.pyc +0 -0
  184. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/Handler.cpython-312.pyc +0 -0
  185. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/HandlerDictionary.cpython-312.pyc +0 -0
  186. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/HeartBeatHandler.cpython-312.pyc +0 -0
  187. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeDelegateHandler.cpython-312.pyc +0 -0
  188. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeGenericMethodHandler.cpython-312.pyc +0 -0
  189. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeGenericStaticMethodHandler.cpython-312.pyc +0 -0
  190. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeGlobalFunctionHandler.cpython-312.pyc +0 -0
  191. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeInstanceMethodHandler.cpython-312.pyc +0 -0
  192. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/InvokeStaticMethodHandler.cpython-312.pyc +0 -0
  193. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/LoadLibraryHandler.cpython-312.pyc +0 -0
  194. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/OptimizeHandler.cpython-312.pyc +0 -0
  195. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/PassDelegateHandler.cpython-312.pyc +0 -0
  196. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/PluginWrapperHandler.cpython-312.pyc +0 -0
  197. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ResolveInstanceHandler.cpython-312.pyc +0 -0
  198. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/RetrieveArrayHandler.cpython-312.pyc +0 -0
  199. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/SetInstanceFieldHandler.cpython-312.pyc +0 -0
  200. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/SetStaticFieldHandler.cpython-312.pyc +0 -0
  201. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/ValueHandler.cpython-312.pyc +0 -0
  202. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/handler/__pycache__/__init__.cpython-312.pyc +0 -0
  203. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/interpreter/__pycache__/Interpreter.cpython-312.pyc +0 -0
  204. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/interpreter/__pycache__/__init__.cpython-312.pyc +0 -0
  205. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/namespaceCache/__pycache__/NamespaceCache.cpython-312.pyc +0 -0
  206. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/namespaceCache/__pycache__/__init__.cpython-312.pyc +0 -0
  207. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/protocol/__pycache__/CommandDeserializer.cpython-312.pyc +0 -0
  208. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/protocol/__pycache__/CommandSerializer.cpython-312.pyc +0 -0
  209. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/protocol/__pycache__/TypeDeserializer.cpython-312.pyc +0 -0
  210. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/protocol/__pycache__/TypeSerializer.cpython-312.pyc +0 -0
  211. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/protocol/__pycache__/__init__.cpython-312.pyc +0 -0
  212. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/__pycache__/Receiver.cpython-312.pyc +0 -0
  213. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/__pycache__/__init__.cpython-312.pyc +0 -0
  214. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/referenceCache/__pycache__/ReferencesCache.cpython-312.pyc +0 -0
  215. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/referenceCache/__pycache__/__init__.cpython-312.pyc +0 -0
  216. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/typeCache/__pycache__/TypeCache.cpython-312.pyc +0 -0
  217. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/core/typeCache/__pycache__/__init__.cpython-312.pyc +0 -0
  218. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/LazyModuleLoader.py +8 -11
  219. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/Command.cpython-312.pyc +0 -0
  220. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/CommandType.cpython-312.pyc +0 -0
  221. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/ConnectionType.cpython-312.pyc +0 -0
  222. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/ExceptionType.cpython-312.pyc +0 -0
  223. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/LazyModuleLoader.cpython-312.pyc +0 -0
  224. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/RuntimeLogger.cpython-312.pyc +0 -0
  225. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/RuntimeName.cpython-312.pyc +0 -0
  226. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/StringEncodingMode.cpython-312.pyc +0 -0
  227. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/Type.cpython-312.pyc +0 -0
  228. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/TypesHandler.cpython-312.pyc +0 -0
  229. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/UtilsConst.cpython-312.pyc +0 -0
  230. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/__pycache__/__init__.cpython-312.pyc +0 -0
  231. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/__pycache__/IConnectionData.cpython-312.pyc +0 -0
  232. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/__pycache__/InMemoryConnectionData.cpython-312.pyc +0 -0
  233. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/__pycache__/__init__.cpython-312.pyc +0 -0
  234. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/exception/ExceptionSerializer.py +1 -1
  235. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/exception/__pycache__/ExceptionSerializer.cpython-312.pyc +0 -0
  236. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/exception/__pycache__/ExceptionThrower.cpython-312.pyc +0 -0
  237. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/exception/__pycache__/JavonetException.cpython-312.pyc +0 -0
  238. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/exception/__pycache__/__init__.cpython-312.pyc +0 -0
  239. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/messageHelper/__pycache__/MessageHelper.cpython-312.pyc +0 -0
  240. data/lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/messageHelper/__pycache__/__init__.cpython-312.pyc +0 -0
  241. data/lib/javonet-ruby-sdk/Binaries/version.txt +1 -1
  242. data/lib/javonet-ruby-sdk/core/handler/load_library_handler.rb +22 -9
  243. data/lib/javonet-ruby-sdk/core/interpreter/interpreter.rb +1 -1
  244. data/lib/javonet-ruby-sdk/core/receiver/receiver_new.rb +3 -3
  245. data/lib/javonet-ruby-sdk/sdk/config_runtime_factory.rb +8 -0
  246. data/lib/javonet-ruby-sdk/utils/exceptions/exception_serializer.rb +0 -1
  247. data/lib/javonet-ruby-sdk/utils/runtime_logger.rb +3 -0
  248. metadata +6 -2
@@ -4,39 +4,136 @@ use warnings FATAL => 'all';
4
4
  use lib 'lib';
5
5
  use Moose;
6
6
  use File::Basename;
7
+ use Cwd qw(abs_path);
7
8
  use Nice::Try;
8
9
  use aliased 'Javonet::Core::Exception::Exception' => 'Exception';
9
10
  extends 'Javonet::Core::Handler::CommandHandler::AbstractCommandHandler';
10
11
 
12
+ # Track loaded libraries by absolute path
13
+ our %LOADED_LIBRARIES;
14
+
11
15
  sub new {
12
16
  my $class = shift;
13
- my $self = {
14
- required_parameters_count => 1
17
+ my $self = {
18
+ required_parameters_count => 1,
19
+ @_, # optional extras
15
20
  };
16
21
  return bless $self, $class;
17
22
  }
18
23
 
19
24
  sub process {
20
- my ($self, $command) = @_;
25
+ my ( $self, $command ) = @_;
21
26
  try {
22
27
  my $current_payload_ref = $command->{payload};
23
- my @cur_payload = @$current_payload_ref;
24
- my $parameters_length = @cur_payload;
25
- if ($parameters_length != $self->{required_parameters_count}) {
28
+ my @cur_payload = @$current_payload_ref;
29
+ my $parameters_length = @cur_payload;
30
+
31
+ if ( $parameters_length != $self->{required_parameters_count} ) {
26
32
  die Exception->new("Exception: LoadLibrary parameters mismatch");
27
33
  }
34
+
28
35
  my $path_to_file = $command->{payload}[0];
29
- my $path_to_file_dir = dirname($path_to_file);
30
- my $file_name = basename($path_to_file);
31
36
 
32
- push(@INC, "$path_to_file_dir");
33
- eval(require $file_name);
37
+ if ( !defined $path_to_file || $path_to_file eq '' ) {
38
+ die Exception->new(
39
+ "Cannot load module: Library path is required but was not provided"
40
+ );
41
+ }
42
+
43
+ # ---------------------------------------------------------------------
44
+ # Normalize file extension
45
+ # If no extension is given, try "<file>.pm"
46
+ # ---------------------------------------------------------------------
47
+ my $normalized_path = $path_to_file;
48
+
49
+ if ( $normalized_path !~ /\.[^\/\\]+$/ ) { # no extension
50
+ my $with_pm = $normalized_path . '.pm';
51
+ if ( -e $with_pm ) {
52
+ $normalized_path = $with_pm;
53
+ }
54
+ }
55
+
56
+ # Resolve to absolute path if possible
57
+ my $absolute_path =
58
+ abs_path($normalized_path)
59
+ // abs_path($path_to_file)
60
+ // $normalized_path;
61
+
62
+ # Check that the file exists
63
+ if ( !-e $absolute_path ) {
64
+ die Exception->new("Cannot load module: Library not found: $path_to_file");
65
+ }
66
+
67
+ # ---------------------------------------------------------------------
68
+ # Load only once by absolute path
69
+ # ---------------------------------------------------------------------
70
+ if ( $LOADED_LIBRARIES{$absolute_path} ) {
71
+ return 0;
72
+ }
73
+
74
+ my $path_to_file_dir = dirname($absolute_path);
75
+ my $file_name = basename($absolute_path);
76
+
77
+ # Ensure directory is in @INC
78
+ if ( !grep { $_ eq $path_to_file_dir } @INC ) {
79
+ push @INC, $path_to_file_dir;
80
+ }
81
+
82
+ # ---------------------------------------------------------------------
83
+ # Validate Perl module syntax before requiring
84
+ # ---------------------------------------------------------------------
85
+ #_validate_perl_syntax($absolute_path); #causes issues
86
+
87
+ # ---------------------------------------------------------------------
88
+ # Load the file
89
+ # ---------------------------------------------------------------------
90
+ eval {
91
+ require $file_name;
92
+ 1;
93
+ } or do {
94
+ my $err = $@ || 'Unknown error';
95
+ die Exception->new("Cannot load module: $absolute_path\n$err");
96
+ };
97
+
98
+ # Mark library as loaded
99
+ $LOADED_LIBRARIES{$absolute_path} = 1;
100
+
34
101
  return 0;
35
102
  }
36
- catch ( $e ) {
103
+ catch ($e) {
37
104
  return Exception->new($e);
38
105
  }
39
106
  }
40
107
 
108
+ sub get_loaded_libraries {
109
+ my ($self) = @_;
110
+ return [ keys %LOADED_LIBRARIES ];
111
+ }
112
+
113
+ # -------------------------------------------------------------------------
114
+ # Validate syntax using "perl -c <file>"
115
+ # -------------------------------------------------------------------------
116
+ sub _validate_perl_syntax {
117
+ my ($absolute_path) = @_;
118
+
119
+ my $perl = $^X || 'perl';
120
+
121
+ my $pid = open my $fh, '-|', $perl, '-c', $absolute_path;
122
+ if ( !defined $pid ) {
123
+ # If perl cannot be spawned, we silently skip validation.
124
+ return;
125
+ }
126
+
127
+ my $output = do { local $/; <$fh> // '' };
128
+ close $fh;
129
+ my $exit_code = $? >> 8;
130
+
131
+ if ( $exit_code != 0 ) {
132
+ die Exception->new(
133
+ "Cannot load module: syntax check failed for $absolute_path\n$output"
134
+ );
135
+ }
136
+ }
137
+
41
138
  no Moose;
42
139
  1;
@@ -1,4 +1,4 @@
1
- =head2 Thu Nov 13 12:42:50 2025: C<Module> L<Safe::Isa|Safe::Isa>
1
+ =head2 Tue Nov 25 20:56:11 2025: C<Module> L<Test::Fatal|Test::Fatal>
2
2
 
3
3
  =over 4
4
4
 
@@ -12,7 +12,7 @@ C<LINKTYPE: dynamic>
12
12
 
13
13
  =item *
14
14
 
15
- C<VERSION: 1.000010>
15
+ C<VERSION: 0.018>
16
16
 
17
17
  =item *
18
18
 
@@ -20,7 +20,7 @@ C<EXE_FILES: >
20
20
 
21
21
  =back
22
22
 
23
- =head2 Thu Nov 13 12:42:59 2025: C<Module> L<YAML::PP|YAML::PP>
23
+ =head2 Tue Nov 25 20:56:18 2025: C<Module> L<autobox|autobox>
24
24
 
25
25
  =over 4
26
26
 
@@ -34,15 +34,15 @@ C<LINKTYPE: dynamic>
34
34
 
35
35
  =item *
36
36
 
37
- C<VERSION: v0.39.0>
37
+ C<VERSION: v3.0.2>
38
38
 
39
39
  =item *
40
40
 
41
- C<EXE_FILES: bin/yamlpp-events bin/yamlpp-highlight bin/yamlpp-load bin/yamlpp-load-dump bin/yamlpp-parse-emit>
41
+ C<EXE_FILES: >
42
42
 
43
43
  =back
44
44
 
45
- =head2 Thu Nov 13 12:43:02 2025: C<Module> L<PPI|PPI>
45
+ =head2 Tue Nov 25 20:56:22 2025: C<Module> L<Scalar::Util::Numeric|Scalar::Util::Numeric>
46
46
 
47
47
  =over 4
48
48
 
@@ -56,7 +56,7 @@ C<LINKTYPE: dynamic>
56
56
 
57
57
  =item *
58
58
 
59
- C<VERSION: 1.284>
59
+ C<VERSION: 0.40>
60
60
 
61
61
  =item *
62
62
 
@@ -64,7 +64,7 @@ C<EXE_FILES: >
64
64
 
65
65
  =back
66
66
 
67
- =head2 Thu Nov 13 12:43:32 2025: C<Module> L<PPI::XS|PPI::XS>
67
+ =head2 Tue Nov 25 20:56:25 2025: C<Module> L<Data::Cmp|Data::Cmp>
68
68
 
69
69
  =over 4
70
70
 
@@ -78,7 +78,7 @@ C<LINKTYPE: dynamic>
78
78
 
79
79
  =item *
80
80
 
81
- C<VERSION: 0.910>
81
+ C<VERSION: 0.010>
82
82
 
83
83
  =item *
84
84
 
@@ -86,7 +86,7 @@ C<EXE_FILES: >
86
86
 
87
87
  =back
88
88
 
89
- =head2 Thu Nov 13 12:43:38 2025: C<Module> L<Want|Want>
89
+ =head2 Tue Nov 25 20:56:35 2025: C<Module> L<YAML::PP|YAML::PP>
90
90
 
91
91
  =over 4
92
92
 
@@ -100,15 +100,15 @@ C<LINKTYPE: dynamic>
100
100
 
101
101
  =item *
102
102
 
103
- C<VERSION: 0.29>
103
+ C<VERSION: v0.39.0>
104
104
 
105
105
  =item *
106
106
 
107
- C<EXE_FILES: >
107
+ C<EXE_FILES: bin/yamlpp-events bin/yamlpp-highlight bin/yamlpp-load bin/yamlpp-load-dump bin/yamlpp-parse-emit>
108
108
 
109
109
  =back
110
110
 
111
- =head2 Thu Nov 13 12:43:39 2025: C<Module> L<Nice::Try|Nice::Try>
111
+ =head2 Tue Nov 25 20:56:37 2025: C<Module> L<Safe::Isa|Safe::Isa>
112
112
 
113
113
  =over 4
114
114
 
@@ -122,7 +122,7 @@ C<LINKTYPE: dynamic>
122
122
 
123
123
  =item *
124
124
 
125
- C<VERSION: v1.3.17>
125
+ C<VERSION: 1.000010>
126
126
 
127
127
  =item *
128
128
 
@@ -130,7 +130,7 @@ C<EXE_FILES: >
130
130
 
131
131
  =back
132
132
 
133
- =head2 Thu Nov 13 12:43:42 2025: C<Module> L<Data::Cmp|Data::Cmp>
133
+ =head2 Tue Nov 25 20:56:40 2025: C<Module> L<PPI|PPI>
134
134
 
135
135
  =over 4
136
136
 
@@ -144,7 +144,7 @@ C<LINKTYPE: dynamic>
144
144
 
145
145
  =item *
146
146
 
147
- C<VERSION: 0.010>
147
+ C<VERSION: 1.284>
148
148
 
149
149
  =item *
150
150
 
@@ -152,7 +152,7 @@ C<EXE_FILES: >
152
152
 
153
153
  =back
154
154
 
155
- =head2 Thu Nov 13 12:43:45 2025: C<Module> L<Test::Fatal|Test::Fatal>
155
+ =head2 Tue Nov 25 20:56:44 2025: C<Module> L<PPI::XS|PPI::XS>
156
156
 
157
157
  =over 4
158
158
 
@@ -166,7 +166,7 @@ C<LINKTYPE: dynamic>
166
166
 
167
167
  =item *
168
168
 
169
- C<VERSION: 0.018>
169
+ C<VERSION: 0.910>
170
170
 
171
171
  =item *
172
172
 
@@ -174,7 +174,7 @@ C<EXE_FILES: >
174
174
 
175
175
  =back
176
176
 
177
- =head2 Thu Nov 13 12:43:49 2025: C<Module> L<autobox|autobox>
177
+ =head2 Tue Nov 25 20:56:49 2025: C<Module> L<Want|Want>
178
178
 
179
179
  =over 4
180
180
 
@@ -188,7 +188,7 @@ C<LINKTYPE: dynamic>
188
188
 
189
189
  =item *
190
190
 
191
- C<VERSION: v3.0.2>
191
+ C<VERSION: 0.29>
192
192
 
193
193
  =item *
194
194
 
@@ -196,7 +196,7 @@ C<EXE_FILES: >
196
196
 
197
197
  =back
198
198
 
199
- =head2 Thu Nov 13 12:43:53 2025: C<Module> L<Scalar::Util::Numeric|Scalar::Util::Numeric>
199
+ =head2 Tue Nov 25 20:56:51 2025: C<Module> L<Nice::Try|Nice::Try>
200
200
 
201
201
  =over 4
202
202
 
@@ -210,7 +210,7 @@ C<LINKTYPE: dynamic>
210
210
 
211
211
  =item *
212
212
 
213
- C<VERSION: 0.40>
213
+ C<VERSION: v1.3.17>
214
214
 
215
215
  =item *
216
216
 
@@ -218,7 +218,7 @@ C<EXE_FILES: >
218
218
 
219
219
  =back
220
220
 
221
- =head2 Thu Nov 13 12:43:58 2025: C<Module> L<Data::UUID|Data::UUID>
221
+ =head2 Tue Nov 25 20:56:55 2025: C<Module> L<Data::UUID|Data::UUID>
222
222
 
223
223
  =over 4
224
224
 
@@ -240,7 +240,7 @@ C<EXE_FILES: >
240
240
 
241
241
  =back
242
242
 
243
- =head2 Thu Nov 13 12:44:01 2025: C<Module> L<Attribute::Util|Attribute::Util>
243
+ =head2 Tue Nov 25 20:56:58 2025: C<Module> L<Attribute::Util|Attribute::Util>
244
244
 
245
245
  =over 4
246
246
 
@@ -4,39 +4,136 @@ use warnings FATAL => 'all';
4
4
  use lib 'lib';
5
5
  use Moose;
6
6
  use File::Basename;
7
+ use Cwd qw(abs_path);
7
8
  use Nice::Try;
8
9
  use aliased 'Javonet::Core::Exception::Exception' => 'Exception';
9
10
  extends 'Javonet::Core::Handler::CommandHandler::AbstractCommandHandler';
10
11
 
12
+ # Track loaded libraries by absolute path
13
+ our %LOADED_LIBRARIES;
14
+
11
15
  sub new {
12
16
  my $class = shift;
13
- my $self = {
14
- required_parameters_count => 1
17
+ my $self = {
18
+ required_parameters_count => 1,
19
+ @_, # optional extras
15
20
  };
16
21
  return bless $self, $class;
17
22
  }
18
23
 
19
24
  sub process {
20
- my ($self, $command) = @_;
25
+ my ( $self, $command ) = @_;
21
26
  try {
22
27
  my $current_payload_ref = $command->{payload};
23
- my @cur_payload = @$current_payload_ref;
24
- my $parameters_length = @cur_payload;
25
- if ($parameters_length != $self->{required_parameters_count}) {
28
+ my @cur_payload = @$current_payload_ref;
29
+ my $parameters_length = @cur_payload;
30
+
31
+ if ( $parameters_length != $self->{required_parameters_count} ) {
26
32
  die Exception->new("Exception: LoadLibrary parameters mismatch");
27
33
  }
34
+
28
35
  my $path_to_file = $command->{payload}[0];
29
- my $path_to_file_dir = dirname($path_to_file);
30
- my $file_name = basename($path_to_file);
31
36
 
32
- push(@INC, "$path_to_file_dir");
33
- eval(require $file_name);
37
+ if ( !defined $path_to_file || $path_to_file eq '' ) {
38
+ die Exception->new(
39
+ "Cannot load module: Library path is required but was not provided"
40
+ );
41
+ }
42
+
43
+ # ---------------------------------------------------------------------
44
+ # Normalize file extension
45
+ # If no extension is given, try "<file>.pm"
46
+ # ---------------------------------------------------------------------
47
+ my $normalized_path = $path_to_file;
48
+
49
+ if ( $normalized_path !~ /\.[^\/\\]+$/ ) { # no extension
50
+ my $with_pm = $normalized_path . '.pm';
51
+ if ( -e $with_pm ) {
52
+ $normalized_path = $with_pm;
53
+ }
54
+ }
55
+
56
+ # Resolve to absolute path if possible
57
+ my $absolute_path =
58
+ abs_path($normalized_path)
59
+ // abs_path($path_to_file)
60
+ // $normalized_path;
61
+
62
+ # Check that the file exists
63
+ if ( !-e $absolute_path ) {
64
+ die Exception->new("Cannot load module: Library not found: $path_to_file");
65
+ }
66
+
67
+ # ---------------------------------------------------------------------
68
+ # Load only once by absolute path
69
+ # ---------------------------------------------------------------------
70
+ if ( $LOADED_LIBRARIES{$absolute_path} ) {
71
+ return 0;
72
+ }
73
+
74
+ my $path_to_file_dir = dirname($absolute_path);
75
+ my $file_name = basename($absolute_path);
76
+
77
+ # Ensure directory is in @INC
78
+ if ( !grep { $_ eq $path_to_file_dir } @INC ) {
79
+ push @INC, $path_to_file_dir;
80
+ }
81
+
82
+ # ---------------------------------------------------------------------
83
+ # Validate Perl module syntax before requiring
84
+ # ---------------------------------------------------------------------
85
+ #_validate_perl_syntax($absolute_path); #causes issues
86
+
87
+ # ---------------------------------------------------------------------
88
+ # Load the file
89
+ # ---------------------------------------------------------------------
90
+ eval {
91
+ require $file_name;
92
+ 1;
93
+ } or do {
94
+ my $err = $@ || 'Unknown error';
95
+ die Exception->new("Cannot load module: $absolute_path\n$err");
96
+ };
97
+
98
+ # Mark library as loaded
99
+ $LOADED_LIBRARIES{$absolute_path} = 1;
100
+
34
101
  return 0;
35
102
  }
36
- catch ( $e ) {
103
+ catch ($e) {
37
104
  return Exception->new($e);
38
105
  }
39
106
  }
40
107
 
108
+ sub get_loaded_libraries {
109
+ my ($self) = @_;
110
+ return [ keys %LOADED_LIBRARIES ];
111
+ }
112
+
113
+ # -------------------------------------------------------------------------
114
+ # Validate syntax using "perl -c <file>"
115
+ # -------------------------------------------------------------------------
116
+ sub _validate_perl_syntax {
117
+ my ($absolute_path) = @_;
118
+
119
+ my $perl = $^X || 'perl';
120
+
121
+ my $pid = open my $fh, '-|', $perl, '-c', $absolute_path;
122
+ if ( !defined $pid ) {
123
+ # If perl cannot be spawned, we silently skip validation.
124
+ return;
125
+ }
126
+
127
+ my $output = do { local $/; <$fh> // '' };
128
+ close $fh;
129
+ my $exit_code = $? >> 8;
130
+
131
+ if ( $exit_code != 0 ) {
132
+ die Exception->new(
133
+ "Cannot load module: syntax check failed for $absolute_path\n$output"
134
+ );
135
+ }
136
+ }
137
+
41
138
  no Moose;
42
139
  1;
@@ -27,29 +27,38 @@ final class LoadLibraryHandler extends AbstractHandler
27
27
  {
28
28
  if ($command->getPayloadSize() < self::REQUIRED_ARGUMENTS_COUNT) {
29
29
  throw new JavonetArgumentsMismatchException(
30
- self::class,
30
+ self::class,
31
31
  self::REQUIRED_ARGUMENTS_COUNT
32
32
  );
33
33
  }
34
34
 
35
35
  $assemblyName = (string) $command->getPayload()[0];
36
+
36
37
  if (!file_exists($assemblyName)) {
37
38
  throw new Exception('File not found: ' . $assemblyName);
38
39
  }
39
40
 
40
- if (in_array($assemblyName, self::$loadedLibraries, true)) {
41
+ // Normalize path first
42
+ $canonicalPath = realpath($assemblyName);
43
+ if ($canonicalPath === false) {
44
+ throw new Exception('Cannot resolve path: ' . $assemblyName);
45
+ }
46
+
47
+ // Already loaded? bail out early
48
+ if (in_array($canonicalPath, self::$loadedLibraries, true)) {
41
49
  return 0;
42
50
  }
43
51
 
44
- if (is_dir($assemblyName)) {
45
- $this->loadDirectory($assemblyName);
46
- } elseif (pathinfo($assemblyName, PATHINFO_EXTENSION) === 'phar') {
47
- $this->loadPharFile($assemblyName);
52
+ // Use canonical path for type detection as well
53
+ if (is_dir($canonicalPath)) {
54
+ $this->loadDirectory($canonicalPath);
55
+ } elseif (pathinfo($canonicalPath, PATHINFO_EXTENSION) === 'phar') {
56
+ $this->loadPharFile($canonicalPath);
48
57
  } else {
49
- $this->loadPhpFile($assemblyName);
58
+ $this->loadPhpFile($canonicalPath);
50
59
  }
51
60
 
52
- self::$loadedLibraries[] = $assemblyName;
61
+ self::$loadedLibraries[] = $canonicalPath;
53
62
  return 0;
54
63
  }
55
64
 
@@ -79,51 +88,69 @@ final class LoadLibraryHandler extends AbstractHandler
79
88
  throw new Exception('PHAR file is not readable: ' . $pharPath);
80
89
  }
81
90
 
91
+ $realPath = realpath($pharPath);
92
+ if ($realPath === false) {
93
+ throw new Exception('Cannot resolve PHAR path: ' . $pharPath);
94
+ }
95
+
82
96
  try {
83
- $phar = new Phar($pharPath);
97
+ $phar = new Phar($realPath);
84
98
 
85
99
  $currentIncludePath = get_include_path();
86
- if (strpos($currentIncludePath, $pharPath) === false) {
87
- set_include_path($currentIncludePath . PATH_SEPARATOR . $pharPath);
88
- $this->loadedClassPaths[] = $pharPath;
100
+ if (strpos($currentIncludePath, $realPath) === false) {
101
+ set_include_path($currentIncludePath . PATH_SEPARATOR . $realPath);
102
+ $this->loadedClassPaths[] = $realPath;
89
103
  }
90
104
 
91
105
  if (isset($phar['bootstrap.php'])) {
92
- include_once 'phar://' . $pharPath . '/bootstrap.php';
106
+ include_once 'phar://' . $realPath . '/bootstrap.php';
93
107
  }
94
108
  } catch (Exception $e) {
95
109
  throw new Exception(sprintf('Error loading PHAR file %s : %s', $pharPath, $e->getMessage()));
96
110
  }
97
111
  }
98
112
 
113
+ private static array $loadedPhpFiles = []; // optional extra safeguard
114
+
99
115
  private function loadPhpFile(string $filePath): void
100
116
  {
101
117
  if (!is_readable($filePath)) {
102
118
  throw new Exception('PHP file is not readable: ' . $filePath);
103
119
  }
104
120
 
105
- $fileExtension = pathinfo($filePath, PATHINFO_EXTENSION);
121
+ $realPath = realpath($filePath);
122
+ if ($realPath === false) {
123
+ throw new Exception('Cannot resolve PHP file path: ' . $filePath);
124
+ }
125
+
126
+ $fileExtension = pathinfo($realPath, PATHINFO_EXTENSION);
106
127
  if (!in_array($fileExtension, ['php', 'inc'], true)) {
107
- throw new Exception('File is not a valid PHP file: ' . $filePath);
128
+ throw new Exception('File is not a valid PHP file: ' . $realPath);
108
129
  }
109
130
 
110
- $code = file_get_contents($filePath);
131
+ // OPTIONAL: skip if we already loaded this exact file
132
+ if (in_array($realPath, self::$loadedPhpFiles, true)) {
133
+ return;
134
+ }
135
+
136
+ $code = file_get_contents($realPath);
111
137
  if ($code === false) {
112
- throw new Exception(sprintf('Failed to read php file: %s', $filePath));
138
+ throw new Exception(sprintf('Failed to read php file: %s', $realPath));
113
139
  }
114
140
 
115
141
  try {
116
142
  token_get_all($code, TOKEN_PARSE);
117
143
  } catch (ParseError $e) {
118
- throw new Exception(sprintf('PHP syntax error in file %s: %s', $filePath, $e->getMessage()));
144
+ throw new Exception(sprintf('PHP syntax error in file %s: %s', $realPath, $e->getMessage()));
119
145
  }
120
146
 
121
147
  $lastError = error_get_last();
122
148
  if ($lastError && $lastError['type'] === E_PARSE) {
123
- throw new Exception(sprintf('PHP syntax error in file %s: %s', $filePath, $lastError['message']));
149
+ throw new Exception(sprintf('PHP syntax error in file %s: %s', $realPath, $lastError['message']));
124
150
  }
125
151
 
126
- include_once $filePath;
152
+ include_once $realPath;
153
+ self::$loadedPhpFiles[] = $realPath;
127
154
  }
128
155
 
129
156
  private function autoloadPhpFilesFromDirectory(string $directory): void
@@ -134,7 +161,15 @@ final class LoadLibraryHandler extends AbstractHandler
134
161
 
135
162
  foreach ($iterator as $file) {
136
163
  if ($file->isFile() && $file->getExtension() === 'php') {
137
- include_once $file->getPathname();
164
+ $realPath = $file->getRealPath() ?: $file->getPathname();
165
+
166
+ // Optional: same guard as loadPhpFile
167
+ if (in_array($realPath, self::$loadedPhpFiles, true)) {
168
+ continue;
169
+ }
170
+
171
+ include_once $realPath;
172
+ self::$loadedPhpFiles[] = $realPath;
138
173
  }
139
174
  }
140
175
  }
@@ -44,7 +44,7 @@ final class Interpreter
44
44
  return $responseByteArray;
45
45
  }
46
46
 
47
- $response = (new CommandDeserializer($responseByteArray))->deserialize();
47
+ $response = CommandDeserializer::deserialize($responseByteArray);
48
48
  if ($this->debugMode === 'TRUE') {
49
49
  echo 'Received command: ' . $response;
50
50
  MessageHelper::getInstance()->sendMessageToAppInsights('ReceivedCommand', $response->toString());
@@ -89,7 +89,7 @@ final class Interpreter
89
89
 
90
90
  public function process(array $byteArray): CommandInterface
91
91
  {
92
- $receivedCommand = (new CommandDeserializer($byteArray))->deserialize();
92
+ $receivedCommand = CommandDeserializer::deserialize($byteArray);
93
93
  if ($this->debugMode === 'TRUE') {
94
94
  echo 'Received command: ' . $receivedCommand;
95
95
  MessageHelper::getInstance()->sendMessageToAppInsights('ReceivedCommand', $receivedCommand->toString());