@open-core/framework 1.0.4-beta.1 → 1.0.5-beta.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 (876) hide show
  1. package/LICENSE +373 -373
  2. package/README.md +196 -268
  3. package/dist/adapters/cfx/cfx-capabilities.d.ts +16 -0
  4. package/dist/adapters/cfx/cfx-capabilities.js +70 -0
  5. package/dist/adapters/cfx/cfx-platform.d.ts +2 -0
  6. package/dist/adapters/cfx/cfx-platform.js +85 -0
  7. package/dist/adapters/cfx/index.d.ts +3 -0
  8. package/dist/adapters/cfx/index.js +3 -0
  9. package/dist/adapters/cfx/runtime-profile.d.ts +3 -0
  10. package/dist/adapters/cfx/runtime-profile.js +37 -0
  11. package/dist/adapters/contracts/IEngineEvents.d.ts +20 -0
  12. package/dist/adapters/contracts/IEngineEvents.js +2 -0
  13. package/dist/adapters/contracts/IExports.d.ts +4 -0
  14. package/dist/adapters/contracts/IExports.js +2 -0
  15. package/dist/adapters/contracts/IHasher.d.ts +15 -0
  16. package/dist/adapters/contracts/IHasher.js +8 -0
  17. package/dist/adapters/contracts/IPlatformCapabilities.d.ts +79 -0
  18. package/dist/adapters/contracts/IPlatformCapabilities.js +27 -0
  19. package/dist/adapters/contracts/IPlayerInfo.d.ts +5 -0
  20. package/dist/adapters/contracts/IPlayerInfo.js +2 -0
  21. package/dist/adapters/contracts/IResourceInfo.d.ts +4 -0
  22. package/dist/adapters/contracts/IResourceInfo.js +2 -0
  23. package/dist/adapters/contracts/ITick.d.ts +10 -0
  24. package/dist/adapters/contracts/ITick.js +5 -0
  25. package/dist/adapters/contracts/client/IPedAppearanceClient.d.ts +206 -0
  26. package/dist/adapters/contracts/client/IPedAppearanceClient.js +12 -0
  27. package/dist/adapters/contracts/index.d.ts +2 -0
  28. package/dist/adapters/contracts/index.js +3 -0
  29. package/dist/adapters/contracts/server/IEntityServer.d.ts +188 -0
  30. package/dist/adapters/contracts/server/IEntityServer.js +35 -0
  31. package/dist/adapters/contracts/server/IPedAppearanceServer.d.ts +45 -0
  32. package/dist/adapters/contracts/server/IPedAppearanceServer.js +12 -0
  33. package/dist/adapters/contracts/server/IPedServer.d.ts +29 -0
  34. package/dist/adapters/contracts/server/IPedServer.js +8 -0
  35. package/dist/adapters/contracts/server/IPlayerServer.d.ts +117 -0
  36. package/dist/adapters/contracts/server/IPlayerServer.js +35 -0
  37. package/dist/adapters/contracts/server/IVehicleServer.d.ts +55 -0
  38. package/dist/adapters/contracts/server/IVehicleServer.js +9 -0
  39. package/dist/adapters/contracts/transport/context.d.ts +5 -0
  40. package/dist/adapters/contracts/transport/events.api.d.ts +36 -0
  41. package/dist/adapters/contracts/transport/events.api.js +5 -0
  42. package/dist/adapters/contracts/transport/messaging.transport.d.ts +8 -0
  43. package/dist/adapters/contracts/transport/messaging.transport.js +2 -0
  44. package/dist/adapters/contracts/transport/rpc.api.d.ts +66 -0
  45. package/dist/adapters/contracts/transport/rpc.api.js +20 -0
  46. package/dist/adapters/contracts/types/identifier.d.ts +67 -0
  47. package/dist/adapters/contracts/types/identifier.js +58 -0
  48. package/dist/adapters/contracts/types/index.d.ts +1 -0
  49. package/dist/adapters/contracts/types/index.js +1 -0
  50. package/dist/adapters/fivem/fivem-capabilities.d.ts +18 -0
  51. package/dist/adapters/fivem/fivem-capabilities.js +61 -0
  52. package/dist/adapters/fivem/fivem-engine-events.d.ts +5 -0
  53. package/dist/adapters/fivem/fivem-engine-events.js +24 -0
  54. package/dist/adapters/fivem/fivem-entity-server.d.ts +26 -0
  55. package/dist/adapters/fivem/fivem-entity-server.js +87 -0
  56. package/dist/adapters/fivem/fivem-exports.d.ts +5 -0
  57. package/dist/adapters/fivem/fivem-exports.js +9 -0
  58. package/dist/adapters/fivem/fivem-hasher.d.ts +7 -0
  59. package/dist/adapters/fivem/fivem-hasher.js +20 -0
  60. package/dist/adapters/fivem/fivem-net-transport.d.ts +1 -0
  61. package/dist/adapters/fivem/fivem-net-transport.js +0 -0
  62. package/dist/adapters/fivem/fivem-ped-appearance-client.d.ts +34 -0
  63. package/dist/adapters/fivem/fivem-ped-appearance-client.js +79 -0
  64. package/dist/adapters/fivem/fivem-ped-appearance-server.d.ts +14 -0
  65. package/dist/adapters/fivem/fivem-ped-appearance-server.js +22 -0
  66. package/dist/adapters/fivem/fivem-ped-server.d.ts +9 -0
  67. package/dist/adapters/fivem/fivem-ped-server.js +30 -0
  68. package/dist/adapters/fivem/fivem-platform.d.ts +5 -0
  69. package/dist/adapters/fivem/fivem-platform.js +74 -0
  70. package/dist/adapters/fivem/fivem-player-server.d.ts +24 -0
  71. package/dist/adapters/fivem/fivem-player-server.js +83 -0
  72. package/dist/adapters/fivem/fivem-playerinfo.d.ts +6 -0
  73. package/dist/adapters/fivem/fivem-playerinfo.js +10 -0
  74. package/dist/adapters/fivem/fivem-resourceinfo.d.ts +5 -0
  75. package/dist/adapters/fivem/fivem-resourceinfo.js +24 -0
  76. package/dist/adapters/fivem/fivem-tick.d.ts +7 -0
  77. package/dist/adapters/fivem/fivem-tick.js +19 -0
  78. package/dist/adapters/fivem/fivem-vehicle-server.d.ts +15 -0
  79. package/dist/adapters/fivem/fivem-vehicle-server.js +44 -0
  80. package/dist/adapters/fivem/index.d.ts +14 -0
  81. package/dist/adapters/fivem/index.js +16 -0
  82. package/dist/adapters/fivem/transport/adapter.d.ts +8 -0
  83. package/dist/adapters/fivem/transport/adapter.js +8 -0
  84. package/dist/adapters/fivem/transport/fivem.events.d.ts +8 -0
  85. package/dist/adapters/fivem/transport/fivem.events.js +36 -0
  86. package/dist/adapters/fivem/transport/fivem.rpc.d.ts +28 -0
  87. package/dist/adapters/fivem/transport/fivem.rpc.js +183 -0
  88. package/dist/adapters/index.d.ts +21 -0
  89. package/dist/adapters/index.js +32 -0
  90. package/dist/adapters/node/index.d.ts +16 -0
  91. package/dist/adapters/node/index.js +18 -0
  92. package/dist/adapters/node/node-capabilities.d.ts +19 -0
  93. package/dist/adapters/node/node-capabilities.js +48 -0
  94. package/dist/adapters/node/node-engine-events.d.ts +20 -0
  95. package/dist/adapters/node/node-engine-events.js +40 -0
  96. package/dist/adapters/node/node-entity-server.d.ts +37 -0
  97. package/dist/adapters/node/node-entity-server.js +118 -0
  98. package/dist/adapters/node/node-exports.d.ts +26 -0
  99. package/dist/adapters/node/node-exports.js +58 -0
  100. package/dist/adapters/node/node-hasher.d.ts +12 -0
  101. package/dist/adapters/node/node-hasher.js +36 -0
  102. package/dist/adapters/node/node-ped-appearance-client.d.ts +34 -0
  103. package/dist/adapters/node/node-ped-appearance-client.js +55 -0
  104. package/dist/adapters/node/node-ped-appearance-server.d.ts +14 -0
  105. package/dist/adapters/node/node-ped-appearance-server.js +14 -0
  106. package/dist/adapters/node/node-ped-server.d.ts +13 -0
  107. package/dist/adapters/node/node-ped-server.js +45 -0
  108. package/dist/adapters/node/node-platform.d.ts +5 -0
  109. package/dist/adapters/node/node-platform.js +76 -0
  110. package/dist/adapters/node/node-player-server.d.ts +44 -0
  111. package/dist/adapters/node/node-player-server.js +105 -0
  112. package/dist/adapters/node/node-playerinfo.d.ts +6 -0
  113. package/dist/adapters/node/node-playerinfo.js +20 -0
  114. package/dist/adapters/node/node-resourceinfo.d.ts +13 -0
  115. package/dist/adapters/node/node-resourceinfo.js +27 -0
  116. package/dist/adapters/node/node-tick.d.ts +10 -0
  117. package/dist/adapters/node/node-tick.js +41 -0
  118. package/dist/adapters/node/node-vehicle-server.d.ts +21 -0
  119. package/dist/adapters/node/node-vehicle-server.js +84 -0
  120. package/dist/adapters/node/transport/adapter.d.ts +10 -0
  121. package/dist/adapters/node/transport/adapter.js +14 -0
  122. package/dist/adapters/node/transport/node.events.d.ts +14 -0
  123. package/dist/adapters/node/transport/node.events.js +38 -0
  124. package/dist/adapters/node/transport/node.rpc.d.ts +18 -0
  125. package/dist/adapters/node/transport/node.rpc.js +71 -0
  126. package/dist/adapters/platform/index.d.ts +1 -0
  127. package/dist/adapters/platform/index.js +1 -0
  128. package/dist/adapters/platform/platform-registry.d.ts +101 -0
  129. package/dist/adapters/platform/platform-registry.js +113 -0
  130. package/dist/adapters/register-capabilities.d.ts +61 -0
  131. package/dist/adapters/register-capabilities.js +78 -0
  132. package/dist/adapters/register-client-capabilities.d.ts +8 -0
  133. package/dist/adapters/register-client-capabilities.js +58 -0
  134. package/dist/index.d.ts +3 -4
  135. package/dist/index.js +4 -41
  136. package/dist/kernel/di/class-constructor.js +0 -0
  137. package/dist/kernel/di/container.d.ts +5 -0
  138. package/dist/kernel/di/container.js +6 -0
  139. package/dist/kernel/di/decorator-processor.js +0 -0
  140. package/dist/kernel/di/index.d.ts +4 -0
  141. package/dist/kernel/di/index.js +4 -0
  142. package/dist/kernel/di/metadata.scanner.d.ts +7 -0
  143. package/dist/kernel/di/metadata.scanner.js +61 -0
  144. package/dist/kernel/error/app.error.d.ts +9 -0
  145. package/dist/kernel/error/app.error.js +15 -0
  146. package/dist/kernel/error/common.error-codes.d.ts +1 -0
  147. package/dist/kernel/error/common.error-codes.js +0 -0
  148. package/dist/kernel/error/framework.error-codes.d.ts +12 -0
  149. package/dist/kernel/error/framework.error-codes.js +0 -0
  150. package/dist/kernel/error/index.d.ts +4 -0
  151. package/dist/kernel/error/index.js +2 -0
  152. package/dist/kernel/error/security.error.d.ts +6 -0
  153. package/dist/kernel/error/security.error.js +9 -0
  154. package/dist/kernel/error/security.types.js +0 -0
  155. package/dist/kernel/index.d.ts +6 -0
  156. package/dist/kernel/index.js +7 -0
  157. package/dist/kernel/logger/core-logger.d.ts +31 -0
  158. package/dist/kernel/logger/core-logger.js +66 -0
  159. package/dist/kernel/logger/index.d.ts +14 -0
  160. package/dist/kernel/logger/index.js +12 -0
  161. package/dist/kernel/logger/logger.config.d.ts +47 -0
  162. package/dist/kernel/logger/logger.config.js +32 -0
  163. package/dist/kernel/logger/logger.env.d.ts +35 -0
  164. package/dist/kernel/logger/logger.env.js +59 -0
  165. package/dist/kernel/logger/logger.service.d.ts +175 -0
  166. package/dist/kernel/logger/logger.service.js +301 -0
  167. package/dist/kernel/logger/logger.types.js +70 -0
  168. package/dist/kernel/logger/transports/buffered.transport.d.ts +88 -0
  169. package/dist/kernel/logger/transports/buffered.transport.js +154 -0
  170. package/dist/kernel/logger/transports/console.transport.d.ts +37 -0
  171. package/dist/kernel/logger/transports/console.transport.js +121 -0
  172. package/dist/kernel/logger/transports/dev-transport.factory.d.ts +75 -0
  173. package/dist/kernel/logger/transports/dev-transport.factory.js +101 -0
  174. package/dist/kernel/logger/transports/http.transport.d.ts +67 -0
  175. package/dist/kernel/logger/transports/http.transport.js +168 -0
  176. package/dist/kernel/logger/transports/index.d.ts +7 -0
  177. package/dist/kernel/logger/transports/index.js +7 -0
  178. package/dist/kernel/logger/transports/simple-console.transport.d.ts +38 -0
  179. package/dist/kernel/logger/transports/simple-console.transport.js +79 -0
  180. package/dist/kernel/logger/transports/transport.interface.d.ts +40 -0
  181. package/dist/kernel/logger/transports/transport.interface.js +0 -0
  182. package/dist/kernel/logger/transports/websocket.transport.d.ts +69 -0
  183. package/dist/kernel/logger/transports/websocket.transport.js +164 -0
  184. package/dist/kernel/schema/index.d.ts +32 -0
  185. package/dist/kernel/schema/index.js +4 -0
  186. package/dist/kernel/shared/index.d.ts +1 -0
  187. package/dist/kernel/shared/index.js +1 -0
  188. package/dist/kernel/shared/player-appearance.types.d.ts +276 -0
  189. package/dist/kernel/shared/player-appearance.types.js +74 -0
  190. package/dist/kernel/utils/index.d.ts +3 -0
  191. package/dist/kernel/utils/index.js +3 -0
  192. package/dist/kernel/utils/result.d.ts +12 -0
  193. package/dist/kernel/utils/result.js +6 -0
  194. package/dist/kernel/utils/rgb.d.ts +17 -0
  195. package/dist/kernel/utils/rgb.js +61 -0
  196. package/dist/kernel/utils/vector3.d.ts +14 -0
  197. package/dist/kernel/utils/vector3.js +24 -0
  198. package/dist/runtime/client/.opencore/autoload.client.controllers.d.ts +1 -0
  199. package/dist/runtime/client/.opencore/autoload.client.controllers.js +0 -0
  200. package/dist/runtime/client/api.d.ts +8 -0
  201. package/dist/runtime/client/api.js +8 -0
  202. package/dist/runtime/client/bus/library-event.bus.d.ts +5 -0
  203. package/dist/runtime/client/bus/library-event.bus.js +28 -0
  204. package/dist/runtime/client/client-api-runtime.d.ts +7 -0
  205. package/dist/runtime/client/client-api-runtime.js +34 -0
  206. package/dist/runtime/client/client-bootstrap.d.ts +7 -0
  207. package/dist/runtime/client/client-bootstrap.js +160 -0
  208. package/dist/runtime/client/client-container.js +3 -0
  209. package/dist/runtime/client/client-core.d.ts +19 -0
  210. package/dist/runtime/client/client-core.js +23 -0
  211. package/dist/runtime/client/client-runtime.d.ts +63 -0
  212. package/dist/runtime/client/client-runtime.js +21 -0
  213. package/dist/runtime/client/controllers/appearance.controller.d.ts +8 -0
  214. package/dist/runtime/client/controllers/appearance.controller.js +48 -0
  215. package/dist/runtime/client/controllers/player-sync.controller.d.ts +11 -0
  216. package/dist/runtime/client/controllers/player-sync.controller.js +51 -0
  217. package/dist/runtime/client/controllers/spawner.controller.d.ts +12 -0
  218. package/dist/runtime/client/controllers/spawner.controller.js +49 -0
  219. package/dist/runtime/client/decorators/controller.d.ts +20 -0
  220. package/dist/runtime/client/decorators/controller.js +62 -0
  221. package/dist/runtime/client/decorators/export.d.ts +21 -0
  222. package/dist/runtime/client/decorators/export.js +26 -0
  223. package/dist/runtime/client/decorators/gameEvent.d.ts +47 -0
  224. package/dist/runtime/client/decorators/gameEvent.js +50 -0
  225. package/dist/runtime/client/decorators/index.d.ts +13 -0
  226. package/dist/runtime/client/decorators/index.js +13 -0
  227. package/dist/runtime/client/decorators/interval.d.ts +23 -0
  228. package/dist/runtime/client/decorators/interval.js +28 -0
  229. package/dist/runtime/client/decorators/key.d.ts +23 -0
  230. package/dist/runtime/client/decorators/key.js +28 -0
  231. package/dist/runtime/client/decorators/localEvent.d.ts +21 -0
  232. package/dist/runtime/client/decorators/localEvent.js +26 -0
  233. package/dist/runtime/client/decorators/onLibraryEvent.d.ts +17 -0
  234. package/dist/runtime/client/decorators/onLibraryEvent.js +22 -0
  235. package/dist/runtime/client/decorators/onNet.d.ts +21 -0
  236. package/dist/runtime/client/decorators/onNet.js +26 -0
  237. package/dist/runtime/client/decorators/onRPC.d.ts +41 -0
  238. package/dist/runtime/client/decorators/onRPC.js +40 -0
  239. package/dist/runtime/client/decorators/onTick.d.ts +21 -0
  240. package/dist/runtime/client/decorators/onTick.js +26 -0
  241. package/dist/runtime/client/decorators/onView.d.ts +21 -0
  242. package/dist/runtime/client/decorators/onView.js +26 -0
  243. package/dist/runtime/client/decorators/resourceLifecycle.d.ts +40 -0
  244. package/dist/runtime/client/decorators/resourceLifecycle.js +49 -0
  245. package/dist/runtime/client/index.d.ts +4 -0
  246. package/dist/runtime/client/index.js +2 -0
  247. package/dist/runtime/client/library/create-client-library.d.ts +13 -0
  248. package/dist/runtime/client/library/create-client-library.js +45 -0
  249. package/dist/runtime/client/library/index.d.ts +4 -0
  250. package/dist/runtime/client/library/index.js +2 -0
  251. package/dist/runtime/client/library/plugin/client-plugin-api.d.ts +5 -0
  252. package/dist/runtime/client/library/plugin/client-plugin-api.js +0 -0
  253. package/dist/runtime/client/library/plugin/index.d.ts +4 -0
  254. package/dist/runtime/client/library/plugin/index.js +4 -0
  255. package/dist/runtime/client/library/plugin/install-client-plugins.d.ts +3 -0
  256. package/dist/runtime/client/library/plugin/install-client-plugins.js +35 -0
  257. package/dist/runtime/client/library/plugin/plugin-context.d.ts +10 -0
  258. package/dist/runtime/client/library/plugin/plugin-context.js +0 -0
  259. package/dist/runtime/client/library/plugin/plugin-registry.d.ts +6 -0
  260. package/dist/runtime/client/library/plugin/plugin-registry.js +12 -0
  261. package/dist/runtime/client/library/plugin/plugin.interface.d.ts +11 -0
  262. package/dist/runtime/client/library/plugin/plugin.interface.js +0 -0
  263. package/dist/runtime/client/player/player.d.ts +262 -0
  264. package/dist/runtime/client/player/player.js +474 -0
  265. package/dist/runtime/client/player/player.loader.js +18 -0
  266. package/dist/runtime/client/services/appearance.service.d.ts +132 -0
  267. package/dist/runtime/client/services/appearance.service.js +330 -0
  268. package/dist/runtime/client/services/blip.service.d.ts +112 -0
  269. package/dist/runtime/client/services/blip.service.js +209 -0
  270. package/dist/runtime/client/services/camera-effects.registry.d.ts +94 -0
  271. package/dist/runtime/client/services/camera-effects.registry.js +145 -0
  272. package/dist/runtime/client/services/camera.d.ts +129 -0
  273. package/dist/runtime/client/services/camera.js +158 -0
  274. package/dist/runtime/client/services/cinematic-builder.d.ts +107 -0
  275. package/dist/runtime/client/services/cinematic-builder.js +467 -0
  276. package/dist/runtime/client/services/cinematic.d.ts +284 -0
  277. package/dist/runtime/client/services/cinematic.js +783 -0
  278. package/dist/runtime/client/services/index.d.ts +14 -0
  279. package/dist/runtime/client/services/index.js +14 -0
  280. package/dist/runtime/client/services/marker.service.d.ts +94 -0
  281. package/dist/runtime/client/services/marker.service.js +148 -0
  282. package/dist/runtime/client/services/notification.service.js +108 -0
  283. package/dist/runtime/client/services/ped.service.d.ts +182 -0
  284. package/dist/runtime/client/services/ped.service.js +298 -0
  285. package/dist/runtime/client/services/progress.service.js +199 -0
  286. package/dist/runtime/client/services/spawn.service.d.ts +73 -0
  287. package/dist/runtime/client/services/spawn.service.js +255 -0
  288. package/dist/runtime/client/services/streaming.service.js +331 -0
  289. package/dist/runtime/client/services/textui.service.d.ts +82 -0
  290. package/dist/runtime/client/services/textui.service.js +160 -0
  291. package/dist/runtime/client/services/vehicle-client.service.d.ts +180 -0
  292. package/dist/runtime/client/services/vehicle-client.service.js +483 -0
  293. package/dist/runtime/client/services/vehicle.service.d.ts +168 -0
  294. package/dist/runtime/client/services/vehicle.service.js +293 -0
  295. package/dist/runtime/client/system/metadata-client.keys.d.ts +15 -0
  296. package/dist/runtime/client/system/metadata-client.keys.js +15 -0
  297. package/dist/runtime/client/system/processors/export.processor.d.ts +7 -0
  298. package/dist/runtime/client/system/processors/export.processor.js +34 -0
  299. package/dist/runtime/client/system/processors/gameEvent.processor.d.ts +10 -0
  300. package/dist/runtime/client/system/processors/gameEvent.processor.js +53 -0
  301. package/dist/runtime/client/system/processors/interval.processor.d.ts +7 -0
  302. package/dist/runtime/client/system/processors/interval.processor.js +38 -0
  303. package/dist/runtime/client/system/processors/key.processor.d.ts +8 -0
  304. package/dist/runtime/client/system/processors/key.processor.js +22 -0
  305. package/dist/runtime/client/system/processors/libraryEvent.processor.d.ts +6 -0
  306. package/dist/runtime/client/system/processors/libraryEvent.processor.js +36 -0
  307. package/dist/runtime/client/system/processors/localEvent.processor.d.ts +7 -0
  308. package/dist/runtime/client/system/processors/localEvent.processor.js +33 -0
  309. package/dist/runtime/client/system/processors/netEvent.processor.d.ts +7 -0
  310. package/dist/runtime/client/system/processors/netEvent.processor.js +33 -0
  311. package/dist/runtime/client/system/processors/onRpc.processor.d.ts +9 -0
  312. package/dist/runtime/client/system/processors/onRpc.processor.js +62 -0
  313. package/dist/runtime/client/system/processors/resourceLifecycle.processor.d.ts +9 -0
  314. package/dist/runtime/client/system/processors/resourceLifecycle.processor.js +62 -0
  315. package/dist/runtime/client/system/processors/tick.processor.d.ts +5 -0
  316. package/dist/runtime/client/system/processors/tick.processor.js +32 -0
  317. package/dist/runtime/client/system/processors/view.processor.d.ts +7 -0
  318. package/dist/runtime/client/system/processors/view.processor.js +36 -0
  319. package/dist/runtime/client/system/processors.register.js +28 -0
  320. package/dist/runtime/client/types/game-events.d.ts +128 -0
  321. package/dist/runtime/client/types/game-events.js +72 -0
  322. package/dist/runtime/client/types/index.js +1 -0
  323. package/dist/runtime/client/ui-bridge.js +196 -0
  324. package/dist/runtime/core/entity.d.ts +168 -0
  325. package/dist/runtime/core/entity.js +232 -0
  326. package/dist/runtime/core/index.d.ts +5 -0
  327. package/dist/runtime/core/index.js +5 -0
  328. package/dist/runtime/core/library/create-library-base.d.ts +15 -0
  329. package/dist/runtime/core/library/create-library-base.js +27 -0
  330. package/dist/runtime/core/library/index.d.ts +5 -0
  331. package/dist/runtime/core/library/index.js +4 -0
  332. package/dist/runtime/core/library/library-bus.d.ts +9 -0
  333. package/dist/runtime/core/library/library-bus.js +46 -0
  334. package/dist/runtime/core/library/library-config.d.ts +10 -0
  335. package/dist/runtime/core/library/library-config.js +12 -0
  336. package/dist/runtime/core/library/library-event-id.d.ts +8 -0
  337. package/dist/runtime/core/library/library-event-id.js +9 -0
  338. package/dist/runtime/core/library/types.d.ts +146 -0
  339. package/dist/runtime/core/library/types.js +0 -0
  340. package/dist/runtime/core/nativehandle.d.ts +3 -0
  341. package/dist/runtime/core/nativehandle.js +0 -0
  342. package/dist/runtime/core/spatial.d.ts +7 -0
  343. package/dist/runtime/core/spatial.js +0 -0
  344. package/dist/runtime/core/world.d.ts +13 -0
  345. package/dist/runtime/core/world.js +57 -0
  346. package/dist/runtime/server/.opencore/autoload.server.controllers.d.ts +1 -0
  347. package/dist/runtime/server/.opencore/autoload.server.controllers.js +0 -0
  348. package/dist/runtime/server/api.d.ts +15 -0
  349. package/dist/runtime/server/api.js +21 -0
  350. package/dist/runtime/server/apis/appearance.api.d.ts +41 -0
  351. package/dist/runtime/server/apis/appearance.api.js +66 -0
  352. package/dist/runtime/server/apis/chat.api.d.ts +69 -0
  353. package/dist/runtime/server/apis/chat.api.js +129 -0
  354. package/dist/runtime/server/apis/index.d.ts +6 -0
  355. package/dist/runtime/server/apis/index.js +6 -0
  356. package/dist/runtime/server/apis/npcs.api.d.ts +213 -0
  357. package/dist/runtime/server/apis/npcs.api.js +465 -0
  358. package/dist/runtime/server/apis/parallel-compute.api.d.ts +118 -0
  359. package/dist/runtime/server/apis/parallel-compute.api.js +423 -0
  360. package/dist/runtime/server/apis/vehicle-modification.api.d.ts +94 -0
  361. package/dist/runtime/server/apis/vehicle-modification.api.js +308 -0
  362. package/dist/runtime/server/apis/vehicles.api.d.ts +140 -0
  363. package/dist/runtime/server/apis/vehicles.api.js +386 -0
  364. package/dist/runtime/server/bootstrap.d.ts +21 -0
  365. package/dist/runtime/server/bootstrap.js +310 -0
  366. package/dist/runtime/server/bus/internal-event.bus.d.ts +6 -0
  367. package/dist/runtime/server/bus/internal-event.bus.js +30 -0
  368. package/dist/runtime/server/bus/library-event.bus.d.ts +5 -0
  369. package/dist/runtime/server/bus/library-event.bus.js +27 -0
  370. package/dist/runtime/server/concepts/channel.d.ts +29 -0
  371. package/dist/runtime/server/concepts/channel.js +70 -0
  372. package/dist/runtime/server/contracts/index.d.ts +6 -0
  373. package/dist/runtime/server/contracts/index.js +8 -0
  374. package/dist/runtime/server/contracts/player-persistence.contract.d.ts +84 -0
  375. package/dist/runtime/server/contracts/player-persistence.contract.js +46 -0
  376. package/dist/runtime/server/contracts/security/command-error-observer.contract.d.ts +73 -0
  377. package/dist/runtime/server/contracts/security/command-error-observer.contract.js +5 -0
  378. package/dist/runtime/server/contracts/security/net-event-security-observer.contract.d.ts +15 -0
  379. package/dist/runtime/server/contracts/security/net-event-security-observer.contract.js +2 -0
  380. package/dist/runtime/server/contracts/security/principal-provider.contract.d.ts +43 -0
  381. package/dist/runtime/server/contracts/security/principal-provider.contract.js +15 -0
  382. package/dist/runtime/server/contracts/security/security-handler.contract.d.ts +5 -0
  383. package/dist/runtime/server/contracts/security/security-handler.contract.js +2 -0
  384. package/dist/runtime/server/controllers/channel.controller.d.ts +115 -0
  385. package/dist/runtime/server/controllers/channel.controller.js +373 -0
  386. package/dist/runtime/server/controllers/chat.controller.d.ts +11 -0
  387. package/dist/runtime/server/controllers/chat.controller.js +67 -0
  388. package/dist/runtime/server/controllers/command-export.controller.d.ts +83 -0
  389. package/dist/runtime/server/controllers/command-export.controller.js +331 -0
  390. package/dist/runtime/server/controllers/player-export.controller.d.ts +30 -0
  391. package/dist/runtime/server/controllers/player-export.controller.js +172 -0
  392. package/dist/runtime/server/controllers/principal-export.controller.d.ts +79 -0
  393. package/dist/runtime/server/controllers/principal-export.controller.js +292 -0
  394. package/dist/runtime/server/controllers/ready.controller.d.ts +4 -0
  395. package/dist/runtime/server/controllers/ready.controller.js +27 -0
  396. package/dist/runtime/server/controllers/remote-command-execution.controller.d.ts +52 -0
  397. package/dist/runtime/server/controllers/remote-command-execution.controller.js +172 -0
  398. package/dist/runtime/server/controllers/session.controller.d.ts +11 -0
  399. package/dist/runtime/server/controllers/session.controller.js +83 -0
  400. package/dist/runtime/server/controllers/vehicle.controller.d.ts +20 -0
  401. package/dist/runtime/server/controllers/vehicle.controller.js +68 -0
  402. package/dist/runtime/server/core.d.ts +7 -0
  403. package/dist/runtime/server/core.js +37 -0
  404. package/dist/runtime/server/decorators/binaryCall.d.ts +15 -0
  405. package/dist/runtime/server/decorators/binaryCall.js +23 -0
  406. package/dist/runtime/server/decorators/binaryEvent.d.ts +21 -0
  407. package/dist/runtime/server/decorators/binaryEvent.js +22 -0
  408. package/dist/runtime/server/decorators/binaryService.d.ts +27 -0
  409. package/dist/runtime/server/decorators/binaryService.js +71 -0
  410. package/dist/runtime/server/decorators/bind.d.ts +21 -0
  411. package/dist/runtime/server/decorators/bind.js +28 -0
  412. package/dist/runtime/server/decorators/command.d.ts +87 -0
  413. package/dist/runtime/server/decorators/command.js +36 -0
  414. package/dist/runtime/server/decorators/controller.d.ts +26 -0
  415. package/dist/runtime/server/decorators/controller.js +56 -0
  416. package/dist/runtime/server/decorators/export.d.ts +24 -0
  417. package/dist/runtime/server/decorators/export.js +29 -0
  418. package/dist/runtime/server/decorators/guard.d.ts +51 -0
  419. package/dist/runtime/server/decorators/guard.js +80 -0
  420. package/dist/runtime/server/decorators/index.d.ts +18 -0
  421. package/dist/runtime/server/decorators/index.js +18 -0
  422. package/dist/runtime/server/decorators/onFrameworkEvent.d.ts +24 -0
  423. package/dist/runtime/server/decorators/onFrameworkEvent.js +28 -0
  424. package/dist/runtime/server/decorators/onLibraryEvent.d.ts +17 -0
  425. package/dist/runtime/server/decorators/onLibraryEvent.js +22 -0
  426. package/dist/runtime/server/decorators/onNet.d.ts +65 -0
  427. package/dist/runtime/server/decorators/onNet.js +12 -0
  428. package/dist/runtime/server/decorators/onRPC.d.ts +78 -0
  429. package/dist/runtime/server/decorators/onRPC.js +59 -0
  430. package/dist/runtime/server/decorators/onRuntimeEvent.d.ts +25 -0
  431. package/dist/runtime/server/decorators/onRuntimeEvent.js +30 -0
  432. package/dist/runtime/server/decorators/onTick.d.ts +21 -0
  433. package/dist/runtime/server/decorators/onTick.js +26 -0
  434. package/dist/runtime/server/decorators/public.d.ts +26 -0
  435. package/dist/runtime/server/decorators/public.js +32 -0
  436. package/dist/runtime/server/decorators/requiresState.d.ts +63 -0
  437. package/dist/runtime/server/decorators/requiresState.js +70 -0
  438. package/dist/runtime/server/decorators/throttle.d.ts +56 -0
  439. package/dist/runtime/server/decorators/throttle.js +73 -0
  440. package/dist/runtime/server/decorators/utils.d.ts +54 -0
  441. package/dist/runtime/server/decorators/utils.js +54 -0
  442. package/dist/runtime/server/default/default-command-error-observer.d.ts +14 -0
  443. package/dist/runtime/server/default/default-command-error-observer.js +40 -0
  444. package/dist/runtime/server/default/default-net-event-security-observer.d.ts +15 -0
  445. package/dist/runtime/server/default/default-net-event-security-observer.js +25 -0
  446. package/dist/runtime/server/default/default-principal.provider.d.ts +13 -0
  447. package/dist/runtime/server/default/default-principal.provider.js +35 -0
  448. package/dist/runtime/server/default/default-security.handler.d.ts +19 -0
  449. package/dist/runtime/server/default/default-security.handler.js +36 -0
  450. package/dist/runtime/server/devmode/contracts/IDevModeBridge.d.ts +36 -0
  451. package/dist/runtime/server/devmode/contracts/IDevModeBridge.js +8 -0
  452. package/dist/runtime/server/devmode/contracts/IDevModeInspector.d.ts +52 -0
  453. package/dist/runtime/server/devmode/contracts/IDevModeInspector.js +8 -0
  454. package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.d.ts +41 -0
  455. package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.js +7 -0
  456. package/dist/runtime/server/devmode/contracts/index.d.ts +3 -0
  457. package/dist/runtime/server/devmode/contracts/index.js +3 -0
  458. package/dist/runtime/server/devmode/dev-mode.service.d.ts +109 -0
  459. package/dist/runtime/server/devmode/dev-mode.service.js +290 -0
  460. package/dist/runtime/server/devmode/event-interceptor.service.d.ts +80 -0
  461. package/dist/runtime/server/devmode/event-interceptor.service.js +233 -0
  462. package/dist/runtime/server/devmode/index.d.ts +6 -0
  463. package/dist/runtime/server/devmode/index.js +7 -0
  464. package/dist/runtime/server/devmode/player-simulator.service.d.ts +66 -0
  465. package/dist/runtime/server/devmode/player-simulator.service.js +199 -0
  466. package/dist/runtime/server/devmode/state-inspector.service.d.ts +57 -0
  467. package/dist/runtime/server/devmode/state-inspector.service.js +175 -0
  468. package/dist/runtime/server/devmode/types.d.ts +197 -0
  469. package/dist/runtime/server/devmode/types.js +22 -0
  470. package/dist/runtime/server/entities/index.d.ts +3 -0
  471. package/dist/runtime/server/entities/index.js +3 -0
  472. package/dist/runtime/server/entities/npc.d.ts +255 -0
  473. package/dist/runtime/server/entities/npc.js +307 -0
  474. package/dist/runtime/server/entities/player.d.ts +239 -0
  475. package/dist/runtime/server/entities/player.js +340 -0
  476. package/dist/runtime/server/entities/vehicle.d.ts +113 -0
  477. package/dist/runtime/server/entities/vehicle.js +245 -0
  478. package/dist/runtime/server/error-handler.d.ts +2 -0
  479. package/dist/runtime/server/error-handler.js +39 -0
  480. package/dist/runtime/server/helpers/command-validation.helper.d.ts +3 -0
  481. package/dist/runtime/server/helpers/command-validation.helper.js +73 -0
  482. package/dist/runtime/server/helpers/function-helper.d.ts +6 -0
  483. package/dist/runtime/server/helpers/function-helper.js +28 -0
  484. package/dist/runtime/server/helpers/normalize-app-error.d.ts +9 -0
  485. package/dist/runtime/server/helpers/normalize-app-error.js +17 -0
  486. package/dist/runtime/server/helpers/process-tuple-schema.d.ts +20 -0
  487. package/dist/runtime/server/helpers/process-tuple-schema.js +56 -0
  488. package/dist/runtime/server/helpers/resolve-method.d.ts +5 -0
  489. package/dist/runtime/server/helpers/resolve-method.js +25 -0
  490. package/dist/runtime/server/implementations/local/channel.local.d.ts +32 -0
  491. package/dist/runtime/server/implementations/local/channel.local.js +185 -0
  492. package/dist/runtime/server/implementations/local/command.local.d.ts +57 -0
  493. package/dist/runtime/server/implementations/local/command.local.js +110 -0
  494. package/dist/runtime/server/implementations/local/player.local.d.ts +110 -0
  495. package/dist/runtime/server/implementations/local/player.local.js +204 -0
  496. package/dist/runtime/server/implementations/local/principal.local.d.ts +28 -0
  497. package/dist/runtime/server/implementations/local/principal.local.js +120 -0
  498. package/dist/runtime/server/implementations/remote/channel.remote.d.ts +47 -0
  499. package/dist/runtime/server/implementations/remote/channel.remote.js +165 -0
  500. package/dist/runtime/server/implementations/remote/command.remote.d.ts +64 -0
  501. package/dist/runtime/server/implementations/remote/command.remote.js +154 -0
  502. package/dist/runtime/server/implementations/remote/player.remote.d.ts +65 -0
  503. package/dist/runtime/server/implementations/remote/player.remote.js +204 -0
  504. package/dist/runtime/server/implementations/remote/principal.remote.d.ts +33 -0
  505. package/dist/runtime/server/implementations/remote/principal.remote.js +97 -0
  506. package/dist/runtime/server/index.d.ts +9 -0
  507. package/dist/runtime/server/index.js +4 -0
  508. package/dist/runtime/server/library/create-server-library.d.ts +13 -0
  509. package/dist/runtime/server/library/create-server-library.js +48 -0
  510. package/dist/runtime/server/library/index.d.ts +4 -0
  511. package/dist/runtime/server/library/index.js +2 -0
  512. package/dist/runtime/server/library/plugin/index.d.ts +4 -0
  513. package/dist/runtime/server/library/plugin/index.js +4 -0
  514. package/dist/runtime/server/library/plugin/plugin-context.d.ts +10 -0
  515. package/dist/runtime/server/library/plugin/plugin-context.js +0 -0
  516. package/dist/runtime/server/library/plugin/plugin-registry.d.ts +7 -0
  517. package/dist/runtime/server/library/plugin/plugin-registry.js +25 -0
  518. package/dist/runtime/server/library/plugin/plugin.interface.d.ts +19 -0
  519. package/dist/runtime/server/library/plugin/plugin.interface.js +0 -0
  520. package/dist/runtime/server/library/plugin/server-plugin-api.d.ts +5 -0
  521. package/dist/runtime/server/library/plugin/server-plugin-api.js +0 -0
  522. package/dist/runtime/server/ports/authorization.api-port.d.ts +149 -0
  523. package/dist/runtime/server/ports/authorization.api-port.js +28 -0
  524. package/dist/runtime/server/ports/channel.api-port.d.ts +218 -0
  525. package/dist/runtime/server/ports/channel.api-port.js +2 -0
  526. package/dist/runtime/server/ports/internal/command-execution.port.d.ts +48 -0
  527. package/dist/runtime/server/ports/internal/command-execution.port.js +11 -0
  528. package/dist/runtime/server/ports/internal/player-session-lifecycle.port.d.ts +37 -0
  529. package/dist/runtime/server/ports/internal/player-session-lifecycle.port.js +12 -0
  530. package/dist/runtime/server/ports/players.api-port.d.ts +108 -0
  531. package/dist/runtime/server/ports/players.api-port.js +19 -0
  532. package/dist/runtime/server/runtime.d.ts +192 -0
  533. package/dist/runtime/server/runtime.js +211 -0
  534. package/dist/runtime/server/server.runtime.d.ts +7 -0
  535. package/dist/runtime/server/server.runtime.js +34 -0
  536. package/dist/runtime/server/services/appearance.service.d.ts +99 -0
  537. package/dist/runtime/server/services/appearance.service.js +307 -0
  538. package/dist/runtime/server/services/index.d.ts +6 -0
  539. package/dist/runtime/server/services/index.js +6 -0
  540. package/dist/runtime/server/services/parallel/native-worker.entry.d.ts +1 -0
  541. package/dist/runtime/server/services/parallel/native-worker.entry.js +10 -0
  542. package/dist/runtime/server/services/parallel/worker-pool.d.ts +79 -0
  543. package/dist/runtime/server/services/parallel/worker-pool.js +428 -0
  544. package/dist/runtime/server/services/parallel/worker.d.ts +22 -0
  545. package/dist/runtime/server/services/parallel/worker.js +48 -0
  546. package/dist/runtime/server/services/persistence.service.d.ts +59 -0
  547. package/dist/runtime/server/services/persistence.service.js +161 -0
  548. package/dist/runtime/server/services/rate-limiter.service.d.ts +23 -0
  549. package/dist/runtime/server/services/rate-limiter.service.js +52 -0
  550. package/dist/runtime/server/services/services.register.d.ts +11 -0
  551. package/dist/runtime/server/services/services.register.js +108 -0
  552. package/dist/runtime/server/services/session-recovery.local.d.ts +39 -0
  553. package/dist/runtime/server/services/session-recovery.local.js +108 -0
  554. package/dist/runtime/server/setup.d.ts +9 -0
  555. package/dist/runtime/server/setup.js +25 -0
  556. package/dist/runtime/server/system/managers/binary-process.manager.d.ts +19 -0
  557. package/dist/runtime/server/system/managers/binary-process.manager.js +312 -0
  558. package/dist/runtime/server/system/metadata-server.keys.d.ts +18 -0
  559. package/dist/runtime/server/system/metadata-server.keys.js +18 -0
  560. package/dist/runtime/server/system/processors/command.processor.d.ts +16 -0
  561. package/dist/runtime/server/system/processors/command.processor.js +62 -0
  562. package/dist/runtime/server/system/processors/export.processor.d.ts +10 -0
  563. package/dist/runtime/server/system/processors/export.processor.js +38 -0
  564. package/dist/runtime/server/system/processors/internalEvent.processor.d.ts +7 -0
  565. package/dist/runtime/server/system/processors/internalEvent.processor.js +36 -0
  566. package/dist/runtime/server/system/processors/libraryEvent.processor.d.ts +6 -0
  567. package/dist/runtime/server/system/processors/libraryEvent.processor.js +38 -0
  568. package/dist/runtime/server/system/processors/netEvent.processor.d.ts +23 -0
  569. package/dist/runtime/server/system/processors/netEvent.processor.js +243 -0
  570. package/dist/runtime/server/system/processors/onRpc.processor.d.ts +12 -0
  571. package/dist/runtime/server/system/processors/onRpc.processor.js +142 -0
  572. package/dist/runtime/server/system/processors/runtimeEvent.processor.d.ts +10 -0
  573. package/dist/runtime/server/system/processors/runtimeEvent.processor.js +48 -0
  574. package/dist/runtime/server/system/processors/tick.processor.d.ts +8 -0
  575. package/dist/runtime/server/system/processors/tick.processor.js +44 -0
  576. package/dist/runtime/server/system/processors.register.d.ts +2 -0
  577. package/dist/runtime/server/system/processors.register.js +43 -0
  578. package/dist/runtime/server/system/schema-generator.d.ts +2 -0
  579. package/dist/runtime/server/system/schema-generator.js +38 -0
  580. package/dist/runtime/server/types/channel.types.d.ts +44 -0
  581. package/dist/runtime/server/types/channel.types.js +10 -0
  582. package/dist/runtime/server/types/core-exports.types.d.ts +286 -0
  583. package/dist/runtime/server/types/core-exports.types.js +0 -0
  584. package/dist/runtime/server/types/framework-events.types.d.ts +22 -0
  585. package/dist/runtime/server/types/framework-events.types.js +0 -0
  586. package/dist/runtime/server/types/index.d.ts +9 -0
  587. package/dist/runtime/server/types/index.js +9 -0
  588. package/dist/runtime/server/types/linked-id.d.ts +6 -0
  589. package/dist/runtime/server/types/linked-id.js +0 -0
  590. package/dist/runtime/server/types/npc.types.d.ts +36 -0
  591. package/dist/runtime/server/types/npc.types.js +0 -0
  592. package/dist/runtime/server/types/parallel.types.d.ts +191 -0
  593. package/dist/runtime/server/types/parallel.types.js +5 -0
  594. package/dist/runtime/server/types/player-session.types.d.ts +11 -0
  595. package/dist/runtime/server/types/player-session.types.js +0 -0
  596. package/dist/runtime/server/types/principal.type.d.ts +32 -0
  597. package/dist/runtime/server/types/principal.type.js +0 -0
  598. package/dist/runtime/server/types/vehicle.types.d.ts +152 -0
  599. package/dist/runtime/server/types/vehicle.types.js +0 -0
  600. package/package.json +43 -46
  601. package/dist/client/client-bootstrap.d.ts +0 -1
  602. package/dist/client/client-bootstrap.js +0 -50
  603. package/dist/client/client-container.js +0 -6
  604. package/dist/client/client-core.d.ts +0 -1
  605. package/dist/client/client-core.js +0 -7
  606. package/dist/client/controllers/spawner.controller.d.ts +0 -12
  607. package/dist/client/controllers/spawner.controller.js +0 -51
  608. package/dist/client/decorators/controller.d.ts +0 -3
  609. package/dist/client/decorators/controller.js +0 -14
  610. package/dist/client/decorators/export.d.ts +0 -7
  611. package/dist/client/decorators/export.js +0 -15
  612. package/dist/client/decorators/gameEvent.d.ts +0 -47
  613. package/dist/client/decorators/gameEvent.js +0 -54
  614. package/dist/client/decorators/index.d.ts +0 -10
  615. package/dist/client/decorators/index.js +0 -26
  616. package/dist/client/decorators/interval.d.ts +0 -7
  617. package/dist/client/decorators/interval.js +0 -15
  618. package/dist/client/decorators/key.d.ts +0 -2
  619. package/dist/client/decorators/key.js +0 -10
  620. package/dist/client/decorators/localEvent.d.ts +0 -7
  621. package/dist/client/decorators/localEvent.js +0 -15
  622. package/dist/client/decorators/nui.d.ts +0 -1
  623. package/dist/client/decorators/nui.js +0 -9
  624. package/dist/client/decorators/onNet.d.ts +0 -1
  625. package/dist/client/decorators/onNet.js +0 -9
  626. package/dist/client/decorators/resourceLifecycle.d.ts +0 -11
  627. package/dist/client/decorators/resourceLifecycle.js +0 -24
  628. package/dist/client/decorators/tick.d.ts +0 -1
  629. package/dist/client/decorators/tick.js +0 -9
  630. package/dist/client/index.d.ts +0 -7
  631. package/dist/client/index.js +0 -23
  632. package/dist/client/interfaces/appearance.interface.d.ts +0 -19
  633. package/dist/client/interfaces/appearance.interface.js +0 -2
  634. package/dist/client/player/player.d.ts +0 -262
  635. package/dist/client/player/player.js +0 -480
  636. package/dist/client/player/player.loader.js +0 -22
  637. package/dist/client/services/appearance.service.d.ts +0 -6
  638. package/dist/client/services/appearance.service.js +0 -89
  639. package/dist/client/services/blip.service.d.ts +0 -112
  640. package/dist/client/services/blip.service.js +0 -215
  641. package/dist/client/services/index.d.ts +0 -9
  642. package/dist/client/services/index.js +0 -25
  643. package/dist/client/services/marker.service.d.ts +0 -94
  644. package/dist/client/services/marker.service.js +0 -153
  645. package/dist/client/services/notification.service.js +0 -111
  646. package/dist/client/services/ped.service.d.ts +0 -182
  647. package/dist/client/services/ped.service.js +0 -302
  648. package/dist/client/services/progress.service.js +0 -210
  649. package/dist/client/services/spawn.service.d.ts +0 -73
  650. package/dist/client/services/spawn.service.js +0 -261
  651. package/dist/client/services/streaming.service.js +0 -341
  652. package/dist/client/services/textui.service.d.ts +0 -82
  653. package/dist/client/services/textui.service.js +0 -156
  654. package/dist/client/services/vehicle.service.d.ts +0 -168
  655. package/dist/client/services/vehicle.service.js +0 -296
  656. package/dist/client/system/metadata-client.keys.d.ts +0 -13
  657. package/dist/client/system/metadata-client.keys.js +0 -16
  658. package/dist/client/system/processors/export.processor.d.ts +0 -7
  659. package/dist/client/system/processors/export.processor.js +0 -39
  660. package/dist/client/system/processors/gameEvent.processor.d.ts +0 -10
  661. package/dist/client/system/processors/gameEvent.processor.js +0 -58
  662. package/dist/client/system/processors/interval.processor.d.ts +0 -7
  663. package/dist/client/system/processors/interval.processor.js +0 -43
  664. package/dist/client/system/processors/key.processor.d.ts +0 -8
  665. package/dist/client/system/processors/key.processor.js +0 -27
  666. package/dist/client/system/processors/localEvent.processor.d.ts +0 -7
  667. package/dist/client/system/processors/localEvent.processor.js +0 -38
  668. package/dist/client/system/processors/netEvent.processor.d.ts +0 -7
  669. package/dist/client/system/processors/netEvent.processor.js +0 -38
  670. package/dist/client/system/processors/nui.processor.d.ts +0 -7
  671. package/dist/client/system/processors/nui.processor.js +0 -40
  672. package/dist/client/system/processors/resourceLifecycle.processor.d.ts +0 -9
  673. package/dist/client/system/processors/resourceLifecycle.processor.js +0 -69
  674. package/dist/client/system/processors/tick.processor.d.ts +0 -5
  675. package/dist/client/system/processors/tick.processor.js +0 -37
  676. package/dist/client/system/processors.register.js +0 -27
  677. package/dist/client/types/game-events.d.ts +0 -126
  678. package/dist/client/types/game-events.js +0 -83
  679. package/dist/client/types/index.js +0 -17
  680. package/dist/client/ui-bridge.js +0 -201
  681. package/dist/server/bootstrap.d.ts +0 -16
  682. package/dist/server/bootstrap.js +0 -57
  683. package/dist/server/bus/core-event-bus.d.ts +0 -6
  684. package/dist/server/bus/core-event-bus.js +0 -31
  685. package/dist/server/configs/api.config.d.ts +0 -71
  686. package/dist/server/configs/api.config.js +0 -81
  687. package/dist/server/configs/config.base.d.ts +0 -63
  688. package/dist/server/configs/config.base.js +0 -64
  689. package/dist/server/configs/index.d.ts +0 -2
  690. package/dist/server/configs/index.js +0 -18
  691. package/dist/server/container.d.ts +0 -2
  692. package/dist/server/container.js +0 -6
  693. package/dist/server/controllers/chat.controller.d.ts +0 -10
  694. package/dist/server/controllers/chat.controller.js +0 -50
  695. package/dist/server/controllers/command.controller.d.ts +0 -7
  696. package/dist/server/controllers/command.controller.js +0 -47
  697. package/dist/server/controllers/session.controller.d.ts +0 -9
  698. package/dist/server/controllers/session.controller.js +0 -70
  699. package/dist/server/core.d.ts +0 -1
  700. package/dist/server/core.js +0 -7
  701. package/dist/server/database/adapters/oxmysql.adapter.d.ts +0 -89
  702. package/dist/server/database/adapters/oxmysql.adapter.js +0 -149
  703. package/dist/server/database/database.contract.d.ts +0 -128
  704. package/dist/server/database/database.contract.js +0 -29
  705. package/dist/server/database/database.service.d.ts +0 -216
  706. package/dist/server/database/database.service.js +0 -301
  707. package/dist/server/database/index.d.ts +0 -53
  708. package/dist/server/database/index.js +0 -70
  709. package/dist/server/database/types.d.ts +0 -67
  710. package/dist/server/database/types.js +0 -7
  711. package/dist/server/database.d.ts +0 -7
  712. package/dist/server/database.js +0 -23
  713. package/dist/server/decorators/bind.d.ts +0 -2
  714. package/dist/server/decorators/bind.js +0 -15
  715. package/dist/server/decorators/command.d.ts +0 -49
  716. package/dist/server/decorators/command.js +0 -23
  717. package/dist/server/decorators/controller.d.ts +0 -25
  718. package/dist/server/decorators/controller.js +0 -36
  719. package/dist/server/decorators/export.d.ts +0 -39
  720. package/dist/server/decorators/export.js +0 -47
  721. package/dist/server/decorators/guard.d.ts +0 -56
  722. package/dist/server/decorators/guard.js +0 -82
  723. package/dist/server/decorators/index.d.ts +0 -10
  724. package/dist/server/decorators/index.js +0 -29
  725. package/dist/server/decorators/onFiveMEvent.d.ts +0 -6
  726. package/dist/server/decorators/onFiveMEvent.js +0 -14
  727. package/dist/server/decorators/onFrameworkEvent.d.ts +0 -22
  728. package/dist/server/decorators/onFrameworkEvent.js +0 -29
  729. package/dist/server/decorators/onNet.d.ts +0 -58
  730. package/dist/server/decorators/onNet.js +0 -57
  731. package/dist/server/decorators/onTick.d.ts +0 -32
  732. package/dist/server/decorators/onTick.js +0 -40
  733. package/dist/server/decorators/public.d.ts +0 -27
  734. package/dist/server/decorators/public.js +0 -36
  735. package/dist/server/decorators/requiresState.d.ts +0 -56
  736. package/dist/server/decorators/requiresState.js +0 -63
  737. package/dist/server/decorators/throttle.d.ts +0 -48
  738. package/dist/server/decorators/throttle.js +0 -63
  739. package/dist/server/decorators/utils.d.ts +0 -57
  740. package/dist/server/decorators/utils.js +0 -63
  741. package/dist/server/entities/index.d.ts +0 -1
  742. package/dist/server/entities/index.js +0 -17
  743. package/dist/server/entities/player.d.ts +0 -157
  744. package/dist/server/entities/player.js +0 -217
  745. package/dist/server/error-handler.d.ts +0 -2
  746. package/dist/server/error-handler.js +0 -43
  747. package/dist/server/helpers/resolve-method.d.ts +0 -5
  748. package/dist/server/helpers/resolve-method.js +0 -18
  749. package/dist/server/index.d.ts +0 -10
  750. package/dist/server/index.js +0 -31
  751. package/dist/server/loaders/exports.loader.js +0 -23
  752. package/dist/server/loaders/playerSession.loader.d.ts +0 -1
  753. package/dist/server/loaders/playerSession.loader.js +0 -51
  754. package/dist/server/services/access-control.service.d.ts +0 -56
  755. package/dist/server/services/access-control.service.js +0 -99
  756. package/dist/server/services/chat.service.d.ts +0 -7
  757. package/dist/server/services/chat.service.js +0 -31
  758. package/dist/server/services/command.service.d.ts +0 -15
  759. package/dist/server/services/command.service.js +0 -77
  760. package/dist/server/services/config.service.d.ts +0 -75
  761. package/dist/server/services/config.service.js +0 -116
  762. package/dist/server/services/default/default-security.handler.d.ts +0 -6
  763. package/dist/server/services/default/default-security.handler.js +0 -26
  764. package/dist/server/services/http/http.service.d.ts +0 -50
  765. package/dist/server/services/http/http.service.js +0 -126
  766. package/dist/server/services/index.d.ts +0 -10
  767. package/dist/server/services/index.js +0 -26
  768. package/dist/server/services/parallel/index.d.ts +0 -49
  769. package/dist/server/services/parallel/index.js +0 -67
  770. package/dist/server/services/parallel/parallel-compute.service.d.ts +0 -132
  771. package/dist/server/services/parallel/parallel-compute.service.js +0 -449
  772. package/dist/server/services/parallel/types.d.ts +0 -188
  773. package/dist/server/services/parallel/types.js +0 -7
  774. package/dist/server/services/parallel/worker-pool.d.ts +0 -83
  775. package/dist/server/services/parallel/worker-pool.js +0 -350
  776. package/dist/server/services/parallel/worker.d.ts +0 -19
  777. package/dist/server/services/parallel/worker.js +0 -49
  778. package/dist/server/services/persistence.service.d.ts +0 -59
  779. package/dist/server/services/persistence.service.js +0 -166
  780. package/dist/server/services/player.service.d.ts +0 -96
  781. package/dist/server/services/player.service.js +0 -132
  782. package/dist/server/services/rate-limiter.service.d.ts +0 -5
  783. package/dist/server/services/rate-limiter.service.js +0 -39
  784. package/dist/server/services/registers.d.ts +0 -1
  785. package/dist/server/services/registers.js +0 -18
  786. package/dist/server/setup.d.ts +0 -9
  787. package/dist/server/setup.js +0 -28
  788. package/dist/server/system/metadata-server.keys.d.ts +0 -10
  789. package/dist/server/system/metadata-server.keys.js +0 -13
  790. package/dist/server/system/processors/command.processor.d.ts +0 -9
  791. package/dist/server/system/processors/command.processor.js +0 -30
  792. package/dist/server/system/processors/coreEvent.processor.d.ts +0 -7
  793. package/dist/server/system/processors/coreEvent.processor.js +0 -41
  794. package/dist/server/system/processors/export.processor.d.ts +0 -7
  795. package/dist/server/system/processors/export.processor.js +0 -30
  796. package/dist/server/system/processors/fivemEvent.processor.d.ts +0 -7
  797. package/dist/server/system/processors/fivemEvent.processor.js +0 -40
  798. package/dist/server/system/processors/netEvent.processor.d.ts +0 -11
  799. package/dist/server/system/processors/netEvent.processor.js +0 -103
  800. package/dist/server/system/processors/tick.processor.d.ts +0 -5
  801. package/dist/server/system/processors/tick.processor.js +0 -36
  802. package/dist/server/system/processors.register.d.ts +0 -1
  803. package/dist/server/system/processors.register.js +0 -23
  804. package/dist/server/system/schema-generator.d.ts +0 -2
  805. package/dist/server/system/schema-generator.js +0 -34
  806. package/dist/server/templates/admin/admin.controller-template.d.ts +0 -12
  807. package/dist/server/templates/admin/admin.controller-template.js +0 -2
  808. package/dist/server/templates/auth/auth-provider.contract.d.ts +0 -58
  809. package/dist/server/templates/auth/auth-provider.contract.js +0 -23
  810. package/dist/server/templates/index.d.ts +0 -8
  811. package/dist/server/templates/index.js +0 -21
  812. package/dist/server/templates/persistence/index.d.ts +0 -30
  813. package/dist/server/templates/persistence/index.js +0 -34
  814. package/dist/server/templates/persistence/player-persistence.contract.d.ts +0 -86
  815. package/dist/server/templates/persistence/player-persistence.contract.js +0 -52
  816. package/dist/server/templates/repository/index.d.ts +0 -57
  817. package/dist/server/templates/repository/index.js +0 -61
  818. package/dist/server/templates/repository/repository.contract.d.ts +0 -224
  819. package/dist/server/templates/repository/repository.contract.js +0 -342
  820. package/dist/server/templates/repository/repository.types.d.ts +0 -51
  821. package/dist/server/templates/repository/repository.types.js +0 -7
  822. package/dist/server/templates/security/permission.types.d.ts +0 -32
  823. package/dist/server/templates/security/permission.types.js +0 -2
  824. package/dist/server/templates/security/principal-provider.contract.d.ts +0 -43
  825. package/dist/server/templates/security/principal-provider.contract.js +0 -19
  826. package/dist/server/templates/security/security-handler.contract.d.ts +0 -5
  827. package/dist/server/templates/security/security-handler.contract.js +0 -6
  828. package/dist/server/types/core-events.d.ts +0 -22
  829. package/dist/server/types/core-events.js +0 -2
  830. package/dist/server/types/security.types.js +0 -2
  831. package/dist/shared/index.d.ts +0 -1
  832. package/dist/shared/index.js +0 -17
  833. package/dist/shared/logger/core-logger.d.ts +0 -35
  834. package/dist/shared/logger/core-logger.js +0 -52
  835. package/dist/shared/logger/index.d.ts +0 -11
  836. package/dist/shared/logger/index.js +0 -26
  837. package/dist/shared/logger/logger.config.d.ts +0 -47
  838. package/dist/shared/logger/logger.config.js +0 -33
  839. package/dist/shared/logger/logger.service.d.ts +0 -161
  840. package/dist/shared/logger/logger.service.js +0 -279
  841. package/dist/shared/logger/logger.types.js +0 -74
  842. package/dist/shared/logger/transports/buffered.transport.d.ts +0 -88
  843. package/dist/shared/logger/transports/buffered.transport.js +0 -174
  844. package/dist/shared/logger/transports/console.transport.d.ts +0 -37
  845. package/dist/shared/logger/transports/console.transport.js +0 -134
  846. package/dist/shared/logger/transports/index.d.ts +0 -3
  847. package/dist/shared/logger/transports/index.js +0 -19
  848. package/dist/shared/logger/transports/transport.interface.d.ts +0 -40
  849. package/dist/shared/logger/transports/transport.interface.js +0 -2
  850. package/dist/system/class-constructor.js +0 -2
  851. package/dist/system/decorator-processor.js +0 -2
  852. package/dist/system/metadata.scanner.d.ts +0 -7
  853. package/dist/system/metadata.scanner.js +0 -45
  854. package/dist/utils/errors.d.ts +0 -14
  855. package/dist/utils/errors.js +0 -25
  856. package/dist/utils/index.d.ts +0 -4
  857. package/dist/utils/index.js +0 -20
  858. package/dist/utils/result.d.ts +0 -12
  859. package/dist/utils/result.js +0 -10
  860. package/dist/utils/rgb.d.ts +0 -5
  861. package/dist/utils/rgb.js +0 -2
  862. package/dist/utils/vector3.d.ts +0 -13
  863. package/dist/utils/vector3.js +0 -27
  864. /package/dist/{server/loaders/exports.loader.d.ts → adapters/contracts/transport/context.js} +0 -0
  865. /package/dist/{system → kernel/di}/class-constructor.d.ts +0 -0
  866. /package/dist/{system → kernel/di}/decorator-processor.d.ts +0 -0
  867. /package/dist/{server/types → kernel/error}/security.types.d.ts +0 -0
  868. /package/dist/{shared → kernel}/logger/logger.types.d.ts +0 -0
  869. /package/dist/{client → runtime/client}/client-container.d.ts +0 -0
  870. /package/dist/{client → runtime/client}/player/player.loader.d.ts +0 -0
  871. /package/dist/{client → runtime/client}/services/notification.service.d.ts +0 -0
  872. /package/dist/{client → runtime/client}/services/progress.service.d.ts +0 -0
  873. /package/dist/{client → runtime/client}/services/streaming.service.d.ts +0 -0
  874. /package/dist/{client → runtime/client}/system/processors.register.d.ts +0 -0
  875. /package/dist/{client → runtime/client}/types/index.d.ts +0 -0
  876. /package/dist/{client → runtime/client}/ui-bridge.d.ts +0 -0
@@ -0,0 +1,118 @@
1
+ import { Vector3 } from '../../../kernel';
2
+ import { ParallelComputeMetrics, ParallelTask, ParallelTaskOptions, TaskResult, WorkerPoolConfig } from '../types/parallel.types';
3
+ /**
4
+ * Service for managing parallel computation
5
+ */
6
+ export declare class ParallelCompute {
7
+ private pool;
8
+ private metrics;
9
+ private totalExecutionTime;
10
+ private isInitialized;
11
+ private poolConfig;
12
+ /**
13
+ * Initialize the worker pool
14
+ * Must be called before using parallel execution
15
+ */
16
+ initialize(config?: Partial<WorkerPoolConfig>): void;
17
+ /**
18
+ * Check if initialized
19
+ */
20
+ get initialized(): boolean;
21
+ /**
22
+ * Check if using native workers
23
+ */
24
+ get isNative(): boolean;
25
+ /**
26
+ * Shutdown the service and worker pool
27
+ */
28
+ shutdown(): Promise<void>;
29
+ /**
30
+ * Get current metrics
31
+ */
32
+ getMetrics(): ParallelComputeMetrics;
33
+ /**
34
+ * Get worker pool statistics
35
+ */
36
+ getPoolStats(): {
37
+ totalWorkers: number;
38
+ idleWorkers: number;
39
+ busyWorkers: number;
40
+ queuedTasks: number;
41
+ isNative: boolean;
42
+ } | null;
43
+ /**
44
+ * Reset metrics
45
+ */
46
+ resetMetrics(): void;
47
+ /**
48
+ * Execute a compute function with automatic mode selection
49
+ */
50
+ run<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): Promise<TaskResult<TOutput>>;
51
+ /**
52
+ * Execute synchronously on main thread
53
+ */
54
+ sync<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): TaskResult<TOutput>;
55
+ /**
56
+ * Execute on worker (async with yielding in FiveM)
57
+ */
58
+ parallel<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): Promise<TaskResult<TOutput>>;
59
+ /**
60
+ * Execute distributed across multiple workers
61
+ */
62
+ distributed<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput, workerCount?: number): Promise<TaskResult<TOutput>>;
63
+ /**
64
+ * Update internal metrics
65
+ */
66
+ private updateMetrics;
67
+ }
68
+ /**
69
+ * Get or create the global ParallelCompute service instance
70
+ */
71
+ export declare function getParallelComputeService(): ParallelCompute;
72
+ /**
73
+ * Initialize the global ParallelCompute service
74
+ */
75
+ export declare function initParallelCompute(config?: Partial<WorkerPoolConfig>): void;
76
+ /**
77
+ * Shutdown the global ParallelCompute service
78
+ */
79
+ export declare function shutdownParallelCompute(): Promise<void>;
80
+ /**
81
+ * Define a parallel task with the given options
82
+ * Returns a task object with run, sync, parallel, and distributed methods
83
+ */
84
+ export declare function defineTask<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>): ParallelTask<TInput, TOutput>;
85
+ /**
86
+ * Built-in task: Filter entities by distance from a position
87
+ */
88
+ export declare const filterByDistance: ParallelTask<{
89
+ entities: Vector3[];
90
+ position: Vector3;
91
+ radius: number;
92
+ }, Vector3[]>;
93
+ /**
94
+ * Built-in task: Sort entities by distance from a position
95
+ */
96
+ export declare const sortByDistance: ParallelTask<{
97
+ entities: Vector3[];
98
+ position: Vector3;
99
+ }, Vector3[]>;
100
+ /**
101
+ * Built-in task: Find closest entity to a position
102
+ */
103
+ export declare const findClosest: ParallelTask<{
104
+ entities: Vector3[];
105
+ position: Vector3;
106
+ }, Vector3 | null>;
107
+ /**
108
+ * Built-in task: Batch transform items
109
+ */
110
+ export declare function defineBatchTransform<T, R>(name: string, transform: (item: T) => R, threshold?: number): ParallelTask<T[], R[]>;
111
+ /**
112
+ * Built-in task: Batch filter items
113
+ */
114
+ export declare function defineBatchFilter<T>(name: string, predicate: (item: T) => boolean, threshold?: number): ParallelTask<T[], T[]>;
115
+ /**
116
+ * Built-in task: Batch reduce items
117
+ */
118
+ export declare function defineBatchReduce<T, R>(name: string, reducer: (acc: R, item: T) => R, initial: R, merger: (results: R[]) => R, threshold?: number): ParallelTask<T[], R>;
@@ -0,0 +1,423 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { injectable } from 'tsyringe';
8
+ import { v4 as uuid } from 'uuid';
9
+ import { WorkerPool } from '../services/parallel/worker-pool';
10
+ const DEFAULT_WORKER_THRESHOLD = 10000;
11
+ /**
12
+ * Service for managing parallel computation
13
+ */
14
+ let ParallelCompute = class ParallelCompute {
15
+ pool = null;
16
+ metrics = {
17
+ totalTasks: 0,
18
+ syncTasks: 0,
19
+ parallelTasks: 0,
20
+ failedTasks: 0,
21
+ avgExecutionTime: 0,
22
+ estimatedTimeSaved: 0,
23
+ activeWorkers: 0,
24
+ peakWorkers: 0,
25
+ };
26
+ totalExecutionTime = 0;
27
+ isInitialized = false;
28
+ poolConfig = {};
29
+ /**
30
+ * Initialize the worker pool
31
+ * Must be called before using parallel execution
32
+ */
33
+ initialize(config = {}) {
34
+ if (this.isInitialized)
35
+ return;
36
+ this.poolConfig = config;
37
+ this.pool = new WorkerPool(config);
38
+ this.pool.on('taskCompleted', (data) => {
39
+ const { executionTime } = data;
40
+ this.updateMetrics(executionTime, 'parallel');
41
+ });
42
+ this.pool.on('workerSpawned', () => {
43
+ const stats = this.pool?.getStats();
44
+ if (stats) {
45
+ this.metrics.activeWorkers = stats.totalWorkers;
46
+ this.metrics.peakWorkers = Math.max(this.metrics.peakWorkers, stats.totalWorkers);
47
+ }
48
+ });
49
+ this.pool.on('workerExit', () => {
50
+ const stats = this.pool?.getStats();
51
+ if (stats) {
52
+ this.metrics.activeWorkers = stats.totalWorkers;
53
+ }
54
+ });
55
+ this.isInitialized = true;
56
+ }
57
+ /**
58
+ * Check if initialized
59
+ */
60
+ get initialized() {
61
+ return this.isInitialized;
62
+ }
63
+ /**
64
+ * Check if using native workers
65
+ */
66
+ get isNative() {
67
+ return this.pool?.isNative ?? false;
68
+ }
69
+ /**
70
+ * Shutdown the service and worker pool
71
+ */
72
+ async shutdown() {
73
+ if (this.pool) {
74
+ await this.pool.shutdown();
75
+ this.pool = null;
76
+ }
77
+ this.isInitialized = false;
78
+ }
79
+ /**
80
+ * Get current metrics
81
+ */
82
+ getMetrics() {
83
+ return { ...this.metrics };
84
+ }
85
+ /**
86
+ * Get worker pool statistics
87
+ */
88
+ getPoolStats() {
89
+ return this.pool?.getStats() ?? null;
90
+ }
91
+ /**
92
+ * Reset metrics
93
+ */
94
+ resetMetrics() {
95
+ this.metrics = {
96
+ totalTasks: 0,
97
+ syncTasks: 0,
98
+ parallelTasks: 0,
99
+ failedTasks: 0,
100
+ avgExecutionTime: 0,
101
+ estimatedTimeSaved: 0,
102
+ activeWorkers: this.pool?.getStats().totalWorkers ?? 0,
103
+ peakWorkers: 0,
104
+ };
105
+ this.totalExecutionTime = 0;
106
+ }
107
+ /**
108
+ * Execute a compute function with automatic mode selection
109
+ */
110
+ async run(options, input) {
111
+ const cost = options.estimateCost?.(input) ?? 0;
112
+ const threshold = options.workerThreshold ?? DEFAULT_WORKER_THRESHOLD;
113
+ if (cost > threshold && this.pool) {
114
+ return this.parallel(options, input);
115
+ }
116
+ return this.sync(options, input);
117
+ }
118
+ /**
119
+ * Execute synchronously on main thread
120
+ */
121
+ sync(options, input) {
122
+ const startTime = performance.now();
123
+ try {
124
+ const result = options.compute(input);
125
+ const executionTime = performance.now() - startTime;
126
+ this.updateMetrics(executionTime, 'sync');
127
+ return {
128
+ result,
129
+ executionTime,
130
+ mode: 'sync',
131
+ };
132
+ }
133
+ catch (error) {
134
+ this.metrics.failedTasks++;
135
+ throw error;
136
+ }
137
+ }
138
+ /**
139
+ * Execute on worker (async with yielding in FiveM)
140
+ */
141
+ async parallel(options, input) {
142
+ if (!this.pool) {
143
+ // Fallback to sync if pool not initialized
144
+ return this.sync(options, input);
145
+ }
146
+ const startTime = performance.now();
147
+ try {
148
+ const message = {
149
+ id: uuid(),
150
+ taskName: options.name,
151
+ functionBody: options.compute.toString(),
152
+ input,
153
+ };
154
+ const result = (await this.pool.execute(message));
155
+ const executionTime = performance.now() - startTime;
156
+ return {
157
+ result,
158
+ executionTime,
159
+ mode: 'parallel',
160
+ };
161
+ }
162
+ catch (error) {
163
+ this.metrics.failedTasks++;
164
+ throw error;
165
+ }
166
+ }
167
+ /**
168
+ * Execute distributed across multiple workers
169
+ */
170
+ async distributed(options, input, workerCount) {
171
+ if (!options.chunker || !options.merger) {
172
+ throw new Error('Distributed execution requires chunker and merger functions');
173
+ }
174
+ if (!this.pool) {
175
+ // Fallback to sync if pool not initialized
176
+ return this.sync(options, input);
177
+ }
178
+ const startTime = performance.now();
179
+ const actualWorkerCount = workerCount ?? this.poolConfig.maxWorkers ?? 4;
180
+ try {
181
+ const chunks = options.chunker(input, actualWorkerCount);
182
+ const results = await Promise.all(chunks.map(async (chunk) => {
183
+ const message = {
184
+ id: uuid(),
185
+ taskName: options.name,
186
+ functionBody: options.compute.toString(),
187
+ input: chunk,
188
+ };
189
+ return this.pool?.execute(message);
190
+ }));
191
+ const mergedResult = options.merger(results);
192
+ const executionTime = performance.now() - startTime;
193
+ this.updateMetrics(executionTime, 'distributed');
194
+ return {
195
+ result: mergedResult,
196
+ executionTime,
197
+ mode: 'distributed',
198
+ workerCount: chunks.length,
199
+ };
200
+ }
201
+ catch (error) {
202
+ this.metrics.failedTasks++;
203
+ throw error;
204
+ }
205
+ }
206
+ /**
207
+ * Update internal metrics
208
+ */
209
+ updateMetrics(executionTime, mode) {
210
+ this.metrics.totalTasks++;
211
+ this.totalExecutionTime += executionTime;
212
+ this.metrics.avgExecutionTime = this.totalExecutionTime / this.metrics.totalTasks;
213
+ if (mode === 'sync') {
214
+ this.metrics.syncTasks++;
215
+ }
216
+ else {
217
+ this.metrics.parallelTasks++;
218
+ }
219
+ }
220
+ };
221
+ ParallelCompute = __decorate([
222
+ injectable()
223
+ ], ParallelCompute);
224
+ export { ParallelCompute };
225
+ // ─────────────────────────────────────────────────────────────────────────────
226
+ // Standalone Functions (no DI required)
227
+ // ─────────────────────────────────────────────────────────────────────────────
228
+ let globalService = null;
229
+ /**
230
+ * Get or create the global ParallelCompute service instance
231
+ */
232
+ export function getParallelComputeService() {
233
+ if (!globalService) {
234
+ globalService = new ParallelCompute();
235
+ }
236
+ return globalService;
237
+ }
238
+ /**
239
+ * Initialize the global ParallelCompute service
240
+ */
241
+ export function initParallelCompute(config = {}) {
242
+ const service = getParallelComputeService();
243
+ service.initialize(config);
244
+ }
245
+ /**
246
+ * Shutdown the global ParallelCompute service
247
+ */
248
+ export async function shutdownParallelCompute() {
249
+ if (globalService) {
250
+ await globalService.shutdown();
251
+ globalService = null;
252
+ }
253
+ }
254
+ /**
255
+ * Define a parallel task with the given options
256
+ * Returns a task object with run, sync, parallel, and distributed methods
257
+ */
258
+ export function defineTask(options) {
259
+ const service = getParallelComputeService();
260
+ return {
261
+ name: options.name,
262
+ options,
263
+ async run(input) {
264
+ const result = await service.run(options, input);
265
+ return result.result;
266
+ },
267
+ sync(input) {
268
+ const result = service.sync(options, input);
269
+ return result.result;
270
+ },
271
+ async parallel(input) {
272
+ const result = await service.parallel(options, input);
273
+ return result.result;
274
+ },
275
+ async distributed(input, workerCount) {
276
+ const result = await service.distributed(options, input, workerCount);
277
+ return result.result;
278
+ },
279
+ };
280
+ }
281
+ // ─────────────────────────────────────────────────────────────────────────────
282
+ // Built-in Tasks
283
+ // ─────────────────────────────────────────────────────────────────────────────
284
+ /**
285
+ * Built-in task: Filter entities by distance from a position
286
+ */
287
+ export const filterByDistance = defineTask({
288
+ name: 'filterByDistance',
289
+ estimateCost: (input) => input.entities.length,
290
+ workerThreshold: 1000,
291
+ compute: (input) => {
292
+ const { entities, position, radius } = input;
293
+ const radiusSquared = radius * radius;
294
+ return entities.filter((entity) => {
295
+ const dx = entity.x - position.x;
296
+ const dy = entity.y - position.y;
297
+ const dz = entity.z - position.z;
298
+ return dx * dx + dy * dy + dz * dz <= radiusSquared;
299
+ });
300
+ },
301
+ chunker: (input, workerCount) => {
302
+ const { entities, position, radius } = input;
303
+ const chunkSize = Math.ceil(entities.length / workerCount);
304
+ const chunks = [];
305
+ for (let i = 0; i < entities.length; i += chunkSize) {
306
+ chunks.push({
307
+ entities: entities.slice(i, i + chunkSize),
308
+ position,
309
+ radius,
310
+ });
311
+ }
312
+ return chunks;
313
+ },
314
+ merger: (results) => [].concat(...results),
315
+ });
316
+ /**
317
+ * Built-in task: Sort entities by distance from a position
318
+ */
319
+ export const sortByDistance = defineTask({
320
+ name: 'sortByDistance',
321
+ estimateCost: (input) => input.entities.length * Math.log(input.entities.length),
322
+ workerThreshold: 500,
323
+ compute: (input) => {
324
+ const { entities, position } = input;
325
+ return [...entities].sort((a, b) => {
326
+ const dxA = a.x - position.x;
327
+ const dyA = a.y - position.y;
328
+ const dzA = a.z - position.z;
329
+ const distA = dxA * dxA + dyA * dyA + dzA * dzA;
330
+ const dxB = b.x - position.x;
331
+ const dyB = b.y - position.y;
332
+ const dzB = b.z - position.z;
333
+ const distB = dxB * dxB + dyB * dyB + dzB * dzB;
334
+ return distA - distB;
335
+ });
336
+ },
337
+ });
338
+ /**
339
+ * Built-in task: Find closest entity to a position
340
+ */
341
+ export const findClosest = defineTask({
342
+ name: 'findClosest',
343
+ estimateCost: (input) => input.entities.length,
344
+ workerThreshold: 5000,
345
+ compute: (input) => {
346
+ const { entities, position } = input;
347
+ if (entities.length === 0)
348
+ return null;
349
+ let closest = entities[0];
350
+ let minDistSquared = Infinity;
351
+ for (const entity of entities) {
352
+ const dx = entity.x - position.x;
353
+ const dy = entity.y - position.y;
354
+ const dz = entity.z - position.z;
355
+ const distSquared = dx * dx + dy * dy + dz * dz;
356
+ if (distSquared < minDistSquared) {
357
+ minDistSquared = distSquared;
358
+ closest = entity;
359
+ }
360
+ }
361
+ return closest;
362
+ },
363
+ });
364
+ /**
365
+ * Built-in task: Batch transform items
366
+ */
367
+ export function defineBatchTransform(name, transform, threshold = 1000) {
368
+ return defineTask({
369
+ name,
370
+ estimateCost: (input) => input.length,
371
+ workerThreshold: threshold,
372
+ compute: (input) => input.map(transform),
373
+ chunker: (input, workerCount) => {
374
+ const chunkSize = Math.ceil(input.length / workerCount);
375
+ const chunks = [];
376
+ for (let i = 0; i < input.length; i += chunkSize) {
377
+ chunks.push(input.slice(i, i + chunkSize));
378
+ }
379
+ return chunks;
380
+ },
381
+ merger: (results) => [].concat(...results),
382
+ });
383
+ }
384
+ /**
385
+ * Built-in task: Batch filter items
386
+ */
387
+ export function defineBatchFilter(name, predicate, threshold = 1000) {
388
+ return defineTask({
389
+ name,
390
+ estimateCost: (input) => input.length,
391
+ workerThreshold: threshold,
392
+ compute: (input) => input.filter(predicate),
393
+ chunker: (input, workerCount) => {
394
+ const chunkSize = Math.ceil(input.length / workerCount);
395
+ const chunks = [];
396
+ for (let i = 0; i < input.length; i += chunkSize) {
397
+ chunks.push(input.slice(i, i + chunkSize));
398
+ }
399
+ return chunks;
400
+ },
401
+ merger: (results) => [].concat(...results),
402
+ });
403
+ }
404
+ /**
405
+ * Built-in task: Batch reduce items
406
+ */
407
+ export function defineBatchReduce(name, reducer, initial, merger, threshold = 1000) {
408
+ return defineTask({
409
+ name,
410
+ estimateCost: (input) => input.length,
411
+ workerThreshold: threshold,
412
+ compute: (input) => input.reduce(reducer, initial),
413
+ chunker: (input, workerCount) => {
414
+ const chunkSize = Math.ceil(input.length / workerCount);
415
+ const chunks = [];
416
+ for (let i = 0; i < input.length; i += chunkSize) {
417
+ chunks.push(input.slice(i, i + chunkSize));
418
+ }
419
+ return chunks;
420
+ },
421
+ merger,
422
+ });
423
+ }
@@ -0,0 +1,94 @@
1
+ import { VehicleModificationOptions, VehicleMods } from '../types/vehicle.types';
2
+ import { Vehicles } from './vehicles.api';
3
+ /**
4
+ * Service for handling vehicle modifications with validation.
5
+ *
6
+ * This service is separated from VehicleService to maintain single responsibility.
7
+ * All modifications are validated server-side before being applied.
8
+ *
9
+ * Security features:
10
+ * - Ownership validation
11
+ * - Proximity checks
12
+ * - Modification limits
13
+ * - Audit logging
14
+ */
15
+ export declare class VehicleModification {
16
+ private readonly vehicleService;
17
+ constructor(vehicleService: Vehicles);
18
+ /**
19
+ * Applies modifications to a vehicle with validation.
20
+ *
21
+ * @param options - Modification options
22
+ * @returns Success status
23
+ */
24
+ applyModifications(options: VehicleModificationOptions): boolean;
25
+ /**
26
+ * Sets vehicle colors with validation.
27
+ *
28
+ * @param networkId - Network ID of the vehicle
29
+ * @param primaryColor - Primary color ID
30
+ * @param secondaryColor - Secondary color ID
31
+ * @param requestedBy - Client ID requesting the change
32
+ * @returns Success status
33
+ */
34
+ setColors(networkId: number, primaryColor: number, secondaryColor: number, requestedBy?: number): boolean;
35
+ /**
36
+ * Sets vehicle livery with validation.
37
+ *
38
+ * @param networkId - Network ID of the vehicle
39
+ * @param livery - Livery index
40
+ * @param requestedBy - Client ID requesting the change
41
+ * @returns Success status
42
+ */
43
+ setLivery(networkId: number, livery: number, requestedBy?: number): boolean;
44
+ /**
45
+ * Toggles vehicle turbo with validation.
46
+ *
47
+ * @param networkId - Network ID of the vehicle
48
+ * @param enabled - Whether turbo should be enabled
49
+ * @param requestedBy - Client ID requesting the change
50
+ * @returns Success status
51
+ */
52
+ setTurbo(networkId: number, enabled: boolean, requestedBy?: number): boolean;
53
+ /**
54
+ * Sets vehicle window tint with validation.
55
+ *
56
+ * @param networkId - Network ID of the vehicle
57
+ * @param tint - Tint level (0-6)
58
+ * @param requestedBy - Client ID requesting the change
59
+ * @returns Success status
60
+ */
61
+ setWindowTint(networkId: number, tint: number, requestedBy?: number): boolean;
62
+ /**
63
+ * Sets vehicle neon lights with validation.
64
+ *
65
+ * @param networkId - Network ID of the vehicle
66
+ * @param enabled - Array of [left, right, front, back] enabled states
67
+ * @param color - RGB color array
68
+ * @param requestedBy - Client ID requesting the change
69
+ * @returns Success status
70
+ */
71
+ setNeon(networkId: number, enabled: [boolean, boolean, boolean, boolean], color?: [number, number, number], requestedBy?: number): boolean;
72
+ /**
73
+ * Resets all modifications on a vehicle.
74
+ *
75
+ * @param networkId - Network ID of the vehicle
76
+ * @param requestedBy - Client ID requesting the reset
77
+ * @returns Success status
78
+ */
79
+ resetModifications(networkId: number, requestedBy?: number): boolean;
80
+ /**
81
+ * Gets the current modifications of a vehicle.
82
+ *
83
+ * @param networkId - Network ID of the vehicle
84
+ * @returns Vehicle mods or undefined
85
+ */
86
+ getModifications(networkId: number): VehicleMods | undefined;
87
+ /**
88
+ * Validates modification values to prevent exploits.
89
+ *
90
+ * @param mods - Modifications to validate
91
+ * @returns Validated modifications
92
+ */
93
+ private validateMods;
94
+ }