@qvac/sdk 0.16.0 → 0.17.0

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 (581) hide show
  1. package/NOTICE +67 -50
  2. package/README.md +65 -0
  3. package/dist/client/api/audio-gen-result.d.ts +4 -0
  4. package/dist/client/api/audio-gen-result.js +132 -0
  5. package/dist/client/api/audio-gen.d.ts +29 -0
  6. package/dist/client/api/audio-gen.js +31 -0
  7. package/dist/client/api/batch-completion.d.ts +2 -2
  8. package/dist/client/api/batch-completion.js +2 -2
  9. package/dist/client/api/bci-transcribe.d.ts +1 -1
  10. package/dist/client/api/bci-transcribe.js +3 -3
  11. package/dist/client/api/cancel.d.ts +1 -1
  12. package/dist/client/api/cancel.js +1 -1
  13. package/dist/client/api/classify.d.ts +1 -1
  14. package/dist/client/api/classify.js +1 -1
  15. package/dist/client/api/completion-stream.d.ts +3 -3
  16. package/dist/client/api/completion-stream.js +3 -3
  17. package/dist/client/api/delete-cache.js +1 -1
  18. package/dist/client/api/diffusion.d.ts +1 -1
  19. package/dist/client/api/diffusion.js +1 -1
  20. package/dist/client/api/download-asset.d.ts +1 -1
  21. package/dist/client/api/download-asset.js +3 -3
  22. package/dist/client/api/embed.d.ts +1 -1
  23. package/dist/client/api/embed.js +2 -2
  24. package/dist/client/api/finetune.d.ts +1 -1
  25. package/dist/client/api/finetune.js +2 -2
  26. package/dist/client/api/get-loaded-model-info.d.ts +2 -2
  27. package/dist/client/api/get-loaded-model-info.js +1 -1
  28. package/dist/client/api/get-model-info.d.ts +2 -2
  29. package/dist/client/api/get-model-info.js +1 -1
  30. package/dist/client/api/get-system-resources.d.ts +3 -0
  31. package/dist/client/api/get-system-resources.js +16 -0
  32. package/dist/client/api/heartbeat.d.ts +2 -2
  33. package/dist/client/api/heartbeat.js +1 -1
  34. package/dist/client/api/index.d.ts +35 -33
  35. package/dist/client/api/index.js +2 -0
  36. package/dist/client/api/invoke-plugin.d.ts +1 -1
  37. package/dist/client/api/invoke-plugin.js +1 -1
  38. package/dist/client/api/load-model.d.ts +2 -2
  39. package/dist/client/api/load-model.js +4 -4
  40. package/dist/client/api/logging-stream.d.ts +1 -1
  41. package/dist/client/api/logging-stream.js +1 -1
  42. package/dist/client/api/ocr.d.ts +1 -1
  43. package/dist/client/api/ocr.js +1 -1
  44. package/dist/client/api/provide.d.ts +1 -1
  45. package/dist/client/api/provide.js +1 -1
  46. package/dist/client/api/rag.d.ts +1 -1
  47. package/dist/client/api/rag.js +2 -2
  48. package/dist/client/api/registry.d.ts +1 -1
  49. package/dist/client/api/registry.js +1 -1
  50. package/dist/client/api/resume.js +1 -1
  51. package/dist/client/api/state.d.ts +1 -1
  52. package/dist/client/api/state.js +1 -1
  53. package/dist/client/api/stop-provider.js +1 -1
  54. package/dist/client/api/subscribe-logs.d.ts +1 -1
  55. package/dist/client/api/suspend.js +1 -1
  56. package/dist/client/api/text-to-speech.d.ts +3 -2
  57. package/dist/client/api/text-to-speech.js +31 -9
  58. package/dist/client/api/transcribe.d.ts +1 -1
  59. package/dist/client/api/transcribe.js +2 -2
  60. package/dist/client/api/translate.d.ts +1 -1
  61. package/dist/client/api/translate.js +1 -1
  62. package/dist/client/api/unload-model.d.ts +1 -1
  63. package/dist/client/api/unload-model.js +2 -2
  64. package/dist/client/api/upscale.d.ts +1 -1
  65. package/dist/client/api/upscale.js +1 -1
  66. package/dist/client/api/video.d.ts +1 -1
  67. package/dist/client/api/video.js +2 -2
  68. package/dist/client/api/vla.d.ts +1 -1
  69. package/dist/client/config-loader/config-utils.d.ts +1 -1
  70. package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
  71. package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
  72. package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
  73. package/dist/client/index.d.ts +1 -1
  74. package/dist/client/init-hooks.d.ts +1 -1
  75. package/dist/client/logging-stream-registry.d.ts +1 -1
  76. package/dist/client/plugins-factory.d.ts +2 -2
  77. package/dist/client/plugins-factory.js +1 -1
  78. package/dist/client/rpc/bare-client.d.ts +1 -1
  79. package/dist/client/rpc/bare-client.js +3 -3
  80. package/dist/client/rpc/expo-rpc-client.js +3 -3
  81. package/dist/client/rpc/node-rpc-client.js +2 -2
  82. package/dist/client/rpc/profiling/index.d.ts +1 -1
  83. package/dist/client/rpc/profiling/profiler.d.ts +2 -2
  84. package/dist/client/rpc/profiling/profiler.js +4 -0
  85. package/dist/client/rpc/rpc-client.d.ts +1 -1
  86. package/dist/client/rpc/rpc-client.js +7 -4
  87. package/dist/client/rpc/rpc-error.d.ts +1 -1
  88. package/dist/commands/bundle/bare-pack.d.ts +1 -1
  89. package/dist/commands/bundle/constants.js +1 -0
  90. package/dist/commands/bundle/entry-gen.js +1 -1
  91. package/dist/commands/bundle/index.js +6 -6
  92. package/dist/commands/bundle/manifest.d.ts +1 -1
  93. package/dist/commands/bundle/plugins.d.ts +2 -2
  94. package/dist/commands/bundle/plugins.js +1 -1
  95. package/dist/commands/index.d.ts +4 -4
  96. package/dist/commands/index.js +2 -2
  97. package/dist/commands/verify/abi.d.ts +1 -1
  98. package/dist/commands/verify/abi.js +1 -1
  99. package/dist/commands/verify/bundle-source.d.ts +1 -1
  100. package/dist/commands/verify/bundle-source.js +2 -2
  101. package/dist/commands/verify/index.d.ts +3 -3
  102. package/dist/commands/verify/index.js +5 -5
  103. package/dist/commands/verify/node-modules-source.d.ts +1 -1
  104. package/dist/commands/verify/node-modules-source.js +1 -1
  105. package/dist/commands/verify/prebuilds.d.ts +2 -1
  106. package/dist/commands/verify/prebuilds.js +8 -11
  107. package/dist/commands/verify/resource-collectors.d.ts +88 -0
  108. package/dist/commands/verify/resource-collectors.js +261 -0
  109. package/dist/constants/audio.js +1 -1
  110. package/dist/constants/index.d.ts +2 -2
  111. package/dist/examples/{transcription → asr}/parakeet-ctc-filesystem.js +2 -3
  112. package/dist/examples/{transcription → asr}/parakeet-microphone-record.js +2 -2
  113. package/dist/examples/{transcription → asr}/parakeet-microphone-stream.js +2 -2
  114. package/dist/examples/{transcription → asr}/parakeet-sortformer-streaming.js +2 -2
  115. package/dist/examples/{transcription → asr}/parakeet-sortformer.js +1 -1
  116. package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem-chunked.js +2 -2
  117. package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem.js +2 -2
  118. package/dist/examples/{transcription → asr}/whispercpp-filesystem-streaming.js +1 -1
  119. package/dist/examples/{transcription → asr}/whispercpp-filesystem.js +1 -1
  120. package/dist/examples/{transcription → asr}/whispercpp-microphone-conversation.js +1 -1
  121. package/dist/examples/{transcription → asr}/whispercpp-microphone-record.js +2 -2
  122. package/dist/examples/{transcription → asr}/whispercpp-prompt.js +1 -1
  123. package/dist/examples/audiogen/generate-music.d.ts +2 -0
  124. package/dist/examples/audiogen/generate-music.js +112 -0
  125. package/dist/examples/cache-management.js +1 -1
  126. package/dist/examples/config-reload.js +1 -1
  127. package/dist/examples/diffusion-txt2vid-wan22.d.ts +2 -0
  128. package/dist/examples/diffusion-txt2vid-wan22.js +96 -0
  129. package/dist/examples/quickstart.bare.js +1 -1
  130. package/dist/examples/rag/rag-mongodb.d.ts +2 -0
  131. package/dist/examples/rag/rag-mongodb.js +180 -0
  132. package/dist/examples/tools/llamacpp-tools-auto-dialect.d.ts +2 -0
  133. package/dist/examples/tools/llamacpp-tools-auto-dialect.js +77 -0
  134. package/dist/examples/tts/parler.d.ts +2 -0
  135. package/dist/examples/tts/parler.js +51 -0
  136. package/dist/examples/vla-groot.js +6 -4
  137. package/dist/examples/voice-assistant/voice-assistant.js +2 -2
  138. package/dist/expo/plugins/index.d.ts +11 -11
  139. package/dist/expo/plugins/withDeviceInfo.js +2 -2
  140. package/dist/expo/plugins/withMobileBundle.js +3 -3
  141. package/dist/index.d.ts +16 -16
  142. package/dist/index.js +4 -4
  143. package/dist/logging/addon.d.ts +1 -1
  144. package/dist/logging/base-logger.d.ts +1 -1
  145. package/dist/logging/base-logger.js +1 -1
  146. package/dist/logging/client-logger.d.ts +1 -1
  147. package/dist/logging/index.d.ts +9 -9
  148. package/dist/logging/logger.d.ts +1 -1
  149. package/dist/logging/namespaces.d.ts +1 -1
  150. package/dist/logging/registry.d.ts +1 -1
  151. package/dist/logging/server-logger.d.ts +1 -1
  152. package/dist/logging/stream-logger.d.ts +1 -1
  153. package/dist/logging/transport.d.ts +1 -1
  154. package/dist/logging/utils.d.ts +1 -1
  155. package/dist/logging/utils.js +1 -1
  156. package/dist/models/registry/index.d.ts +1 -1
  157. package/dist/models/registry/models.d.ts +1226 -689
  158. package/dist/models/registry/models.js +3114 -2557
  159. package/dist/models/update-models/codegen.d.ts +1 -1
  160. package/dist/models/update-models/companions.d.ts +1 -1
  161. package/dist/models/update-models/history.d.ts +1 -1
  162. package/dist/models/update-models/history.js +4 -4
  163. package/dist/models/update-models/naming.d.ts +1 -1
  164. package/dist/models/update-models/naming.js +7 -1
  165. package/dist/models/update-models/processing.d.ts +1 -1
  166. package/dist/models/update-models/processing.js +1 -1
  167. package/dist/models/update-models/registry.d.ts +2 -2
  168. package/dist/models/update-models/shards.d.ts +1 -1
  169. package/dist/models/update-models/types.d.ts +1 -1
  170. package/dist/pear/pre.js +2 -0
  171. package/dist/profiling/aggregator.d.ts +1 -1
  172. package/dist/profiling/backend-diagnostics.d.ts +8 -0
  173. package/dist/profiling/backend-diagnostics.js +21 -0
  174. package/dist/profiling/controller.d.ts +4 -2
  175. package/dist/profiling/controller.js +8 -0
  176. package/dist/profiling/envelope.d.ts +3 -2
  177. package/dist/profiling/envelope.js +13 -2
  178. package/dist/profiling/events.d.ts +2 -2
  179. package/dist/profiling/exporters.d.ts +1 -1
  180. package/dist/profiling/index.d.ts +9 -8
  181. package/dist/profiling/index.js +3 -2
  182. package/dist/profiling/types.d.ts +6 -0
  183. package/dist/schemas/audio-gen.d.ts +253 -0
  184. package/dist/schemas/audio-gen.js +69 -0
  185. package/dist/schemas/batch-completion-stream.d.ts +7 -2
  186. package/dist/schemas/bci-config.d.ts +2 -0
  187. package/dist/schemas/bci.d.ts +1 -1
  188. package/dist/schemas/cancel.d.ts +5 -0
  189. package/dist/schemas/cancel.js +1 -0
  190. package/dist/schemas/common.d.ts +1553 -54
  191. package/dist/schemas/common.js +6 -0
  192. package/dist/schemas/completion-event.d.ts +5 -2
  193. package/dist/schemas/completion-event.js +3 -0
  194. package/dist/schemas/completion-stream.d.ts +9 -1
  195. package/dist/schemas/completion-stream.js +5 -2
  196. package/dist/schemas/constants-registry.d.ts +2 -0
  197. package/dist/schemas/constants-registry.js +2 -1
  198. package/dist/schemas/download-asset.d.ts +8 -4
  199. package/dist/schemas/engine-addon-map.d.ts +2 -1
  200. package/dist/schemas/engine-addon-map.js +5 -1
  201. package/dist/schemas/get-loaded-model-info.d.ts +2 -0
  202. package/dist/schemas/get-model-info.d.ts +2 -0
  203. package/dist/schemas/get-model-info.js +1 -0
  204. package/dist/schemas/index.d.ts +53 -51
  205. package/dist/schemas/index.js +4 -2
  206. package/dist/schemas/llamacpp-config.d.ts +6 -2
  207. package/dist/schemas/load-model.d.ts +6178 -2763
  208. package/dist/schemas/load-model.js +39 -3
  209. package/dist/schemas/mcp-adapter.d.ts +1 -1
  210. package/dist/schemas/model-src-utils.d.ts +10 -2
  211. package/dist/schemas/model-types.d.ts +19 -1
  212. package/dist/schemas/model-types.js +11 -0
  213. package/dist/schemas/ocr.d.ts +2 -0
  214. package/dist/schemas/plugin.d.ts +13 -4
  215. package/dist/schemas/plugin.js +12 -2
  216. package/dist/schemas/profiling.d.ts +587 -0
  217. package/dist/schemas/profiling.js +22 -0
  218. package/dist/schemas/registry.d.ts +18 -0
  219. package/dist/schemas/registry.js +2 -0
  220. package/dist/schemas/reload-config.d.ts +10 -2
  221. package/dist/schemas/sdcpp-config.d.ts +57 -0
  222. package/dist/schemas/sdcpp-config.js +53 -11
  223. package/dist/schemas/sdk-config.d.ts +168 -0
  224. package/dist/schemas/system-resources.d.ts +3967 -0
  225. package/dist/schemas/system-resources.js +149 -0
  226. package/dist/schemas/text-to-speech.d.ts +326 -6
  227. package/dist/schemas/text-to-speech.js +126 -13
  228. package/dist/schemas/transcription-config.d.ts +2 -0
  229. package/dist/schemas/translate.d.ts +2 -2
  230. package/dist/schemas/translation-config.d.ts +30 -10
  231. package/dist/scripts/check-resource-collectors-packaging.d.ts +33 -0
  232. package/dist/scripts/check-resource-collectors-packaging.js +136 -0
  233. package/dist/scripts/contract/build-contract.d.ts +1 -1
  234. package/dist/scripts/contract/build-models-registry.d.ts +1 -1
  235. package/dist/scripts/contract/plugin-contract.d.ts +1 -1
  236. package/dist/scripts/contract/plugin-contract.js +1 -1
  237. package/dist/scripts/export-contract.js +1 -1
  238. package/dist/scripts/export-plugin-contract.js +1 -1
  239. package/dist/server/bare/delegate-rpc-client.d.ts +1 -1
  240. package/dist/server/bare/delegate-rpc-client.js +3 -3
  241. package/dist/server/bare/hyperswarm.d.ts +1 -1
  242. package/dist/server/bare/hyperswarm.js +2 -2
  243. package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
  244. package/dist/server/bare/ops/bci-transcribe.js +4 -4
  245. package/dist/server/bare/ops/cancel.d.ts +2 -2
  246. package/dist/server/bare/ops/cancel.js +2 -2
  247. package/dist/server/bare/ops/embed.d.ts +1 -1
  248. package/dist/server/bare/ops/embed.js +3 -3
  249. package/dist/server/bare/ops/kv-cache-retention.d.ts +12 -0
  250. package/dist/server/bare/ops/kv-cache-retention.js +121 -0
  251. package/dist/server/bare/ops/kv-cache-utils.d.ts +2 -1
  252. package/dist/server/bare/ops/kv-cache-utils.js +26 -5
  253. package/dist/server/bare/ops/load-model.d.ts +2 -2
  254. package/dist/server/bare/ops/load-model.js +7 -5
  255. package/dist/server/bare/ops/transcribe.d.ts +2 -2
  256. package/dist/server/bare/ops/transcribe.js +20 -40
  257. package/dist/server/bare/ops/translate.d.ts +1 -1
  258. package/dist/server/bare/ops/translate.js +5 -9
  259. package/dist/server/bare/ops/unload-model.d.ts +1 -1
  260. package/dist/server/bare/ops/unload-model.js +5 -5
  261. package/dist/server/bare/plugins/asr-ggml/config.d.ts +32 -0
  262. package/dist/server/bare/plugins/asr-ggml/config.js +46 -0
  263. package/dist/server/bare/plugins/asr-ggml/logging.d.ts +11 -0
  264. package/dist/server/bare/plugins/asr-ggml/logging.js +12 -0
  265. package/dist/server/bare/plugins/audiogen-ggml/config.d.ts +18 -0
  266. package/dist/server/bare/plugins/audiogen-ggml/config.js +23 -0
  267. package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.d.ts +3 -0
  268. package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +162 -0
  269. package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +213 -0
  270. package/dist/server/bare/plugins/audiogen-ggml/plugin.js +58 -0
  271. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +6 -4
  272. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +4 -4
  273. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
  274. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
  275. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +1 -1
  276. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +2 -2
  277. package/dist/server/bare/plugins/ggml-classification/plugin.js +1 -1
  278. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
  279. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +2 -2
  280. package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +4 -2
  281. package/dist/server/bare/plugins/ggml-ocr/plugin.js +3 -3
  282. package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +1 -1
  283. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
  284. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +1 -1
  285. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
  286. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +1 -1
  287. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +3 -3
  288. package/dist/server/bare/plugins/index.d.ts +12 -11
  289. package/dist/server/bare/plugins/index.js +1 -0
  290. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +3 -3
  291. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +5 -5
  292. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +11 -1
  293. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +16 -0
  294. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +3 -3
  295. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +16 -14
  296. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +1 -1
  297. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +3 -3
  298. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +20 -10
  299. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +217 -80
  300. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +12 -5
  301. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +16 -16
  302. package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
  303. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +2 -2
  304. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +5 -5
  305. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +12 -2
  306. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +3 -3
  307. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
  308. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +6 -6
  309. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +13 -20
  310. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
  311. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +1 -1
  312. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
  313. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +1 -1
  314. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +2 -1
  315. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +13 -7
  316. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +26 -4
  317. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +18 -4
  318. package/dist/server/bare/plugins/tts-ggml/ops/parler-options.d.ts +7 -0
  319. package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +30 -0
  320. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
  321. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +8 -5
  322. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
  323. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +14 -6
  324. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +114 -5
  325. package/dist/server/bare/plugins/tts-ggml/plugin.js +61 -5
  326. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +8 -6
  327. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +17 -25
  328. package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
  329. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
  330. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +1 -1
  331. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
  332. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +1 -1
  333. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
  334. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +1 -1
  335. package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +1 -1
  336. package/dist/server/bare/rag-hyperdb/handlers/ingest.js +2 -2
  337. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
  338. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
  339. package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +1 -1
  340. package/dist/server/bare/rag-hyperdb/handlers/reindex.js +1 -1
  341. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +1 -1
  342. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +1 -1
  343. package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
  344. package/dist/server/bare/rag-hyperdb/handlers/search.js +2 -2
  345. package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
  346. package/dist/server/bare/rag-hyperdb/index.js +11 -11
  347. package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +1 -1
  348. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +4 -4
  349. package/dist/server/bare/registry/config-registry.d.ts +1 -1
  350. package/dist/server/bare/registry/config-registry.js +1 -1
  351. package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
  352. package/dist/server/bare/registry/model-config-registry.js +4 -4
  353. package/dist/server/bare/registry/model-config-utils.d.ts +1 -1
  354. package/dist/server/bare/registry/model-config-utils.js +3 -0
  355. package/dist/server/bare/registry/model-registry.d.ts +15 -4
  356. package/dist/server/bare/registry/registry-client.js +2 -2
  357. package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
  358. package/dist/server/bare/resources/collector.d.ts +644 -0
  359. package/dist/server/bare/resources/collector.js +226 -0
  360. package/dist/server/bare/resources/native.d.ts +3 -0
  361. package/dist/server/bare/resources/native.js +35 -0
  362. package/dist/server/bare/resources/normalize.d.ts +13 -0
  363. package/dist/server/bare/resources/normalize.js +73 -0
  364. package/dist/server/bare/resources/types.d.ts +66 -0
  365. package/dist/server/bare/resources/types.js +1 -0
  366. package/dist/server/bare/resources/worker-collector.d.ts +5 -0
  367. package/dist/server/bare/resources/worker-collector.js +15 -0
  368. package/dist/server/bare/runtime/index.d.ts +7 -7
  369. package/dist/server/bare/runtime/index.js +3 -3
  370. package/dist/server/bare/runtime/request-context.d.ts +2 -2
  371. package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
  372. package/dist/server/bare/runtime/request-registry-singleton.js +11 -1
  373. package/dist/server/bare/runtime/request-registry.d.ts +2 -2
  374. package/dist/server/bare/runtime/request-registry.js +1 -1
  375. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  376. package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
  377. package/dist/server/bare/types/addon-responses.d.ts +6 -34
  378. package/dist/server/bare/utils/asr-events.d.ts +15 -0
  379. package/dist/server/bare/utils/asr-events.js +30 -0
  380. package/dist/server/bare/utils/audio-input.d.ts +1 -1
  381. package/dist/server/bare/utils/audio-input.js +1 -1
  382. package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
  383. package/dist/server/bare/utils/tts-stats.d.ts +1 -1
  384. package/dist/server/error-handlers.d.ts +1 -1
  385. package/dist/server/plugins/index.d.ts +1 -1
  386. package/dist/server/plugins/registry.d.ts +1 -1
  387. package/dist/server/plugins/registry.js +35 -8
  388. package/dist/server/rpc/delegate-transport.d.ts +2 -2
  389. package/dist/server/rpc/delegate-transport.js +5 -10
  390. package/dist/server/rpc/handle-request.js +3 -3
  391. package/dist/server/rpc/handler-registry.d.ts +1 -1
  392. package/dist/server/rpc/handler-registry.js +41 -37
  393. package/dist/server/rpc/handler-selection.d.ts +2 -2
  394. package/dist/server/rpc/handler-utils.d.ts +2 -2
  395. package/dist/server/rpc/handler-utils.js +5 -5
  396. package/dist/server/rpc/handlers/audio-gen-stream.d.ts +3 -0
  397. package/dist/server/rpc/handlers/audio-gen-stream.js +4 -0
  398. package/dist/server/rpc/handlers/batch-completion-stream.d.ts +3 -1
  399. package/dist/server/rpc/handlers/batch-completion-stream.js +1 -1
  400. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
  401. package/dist/server/rpc/handlers/bci-transcribe-stream.js +1 -1
  402. package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
  403. package/dist/server/rpc/handlers/bci-transcribe.js +1 -1
  404. package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
  405. package/dist/server/rpc/handlers/cancel-delegated.js +3 -3
  406. package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
  407. package/dist/server/rpc/handlers/cancelHandler.js +3 -3
  408. package/dist/server/rpc/handlers/classify.d.ts +1 -1
  409. package/dist/server/rpc/handlers/classify.js +1 -1
  410. package/dist/server/rpc/handlers/completion-orchestrate.d.ts +2 -2
  411. package/dist/server/rpc/handlers/completion-orchestrate.js +1 -1
  412. package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
  413. package/dist/server/rpc/handlers/completion-stream-delegated.js +3 -3
  414. package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
  415. package/dist/server/rpc/handlers/completion-stream.js +1 -1
  416. package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
  417. package/dist/server/rpc/handlers/delete-cache.js +1 -1
  418. package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
  419. package/dist/server/rpc/handlers/diffusion-stream.js +1 -1
  420. package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
  421. package/dist/server/rpc/handlers/download-asset.js +4 -4
  422. package/dist/server/rpc/handlers/embed.d.ts +1 -1
  423. package/dist/server/rpc/handlers/embed.js +1 -1
  424. package/dist/server/rpc/handlers/finetune.d.ts +1 -1
  425. package/dist/server/rpc/handlers/finetune.js +2 -2
  426. package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
  427. package/dist/server/rpc/handlers/get-loaded-model-info.js +3 -3
  428. package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
  429. package/dist/server/rpc/handlers/get-model-info.js +4 -4
  430. package/dist/server/rpc/handlers/get-system-resources.d.ts +3 -0
  431. package/dist/server/rpc/handlers/get-system-resources.js +53 -0
  432. package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
  433. package/dist/server/rpc/handlers/heartbeat-delegated.js +2 -2
  434. package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
  435. package/dist/server/rpc/handlers/index.d.ts +37 -33
  436. package/dist/server/rpc/handlers/index.js +4 -0
  437. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +3 -3
  438. package/dist/server/rpc/handlers/load-model/download-manager.js +1 -1
  439. package/dist/server/rpc/handlers/load-model/download-stats.d.ts +3 -3
  440. package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
  441. package/dist/server/rpc/handlers/load-model/handler.js +12 -8
  442. package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
  443. package/dist/server/rpc/handlers/load-model/http.js +4 -4
  444. package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
  445. package/dist/server/rpc/handlers/load-model/hyperdrive.js +5 -5
  446. package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
  447. package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +1 -1
  448. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +3 -3
  449. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +3 -3
  450. package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +4 -4
  451. package/dist/server/rpc/handlers/load-model/registry-download-utils.js +3 -3
  452. package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +1 -1
  453. package/dist/server/rpc/handlers/load-model/registry.d.ts +3 -3
  454. package/dist/server/rpc/handlers/load-model/registry.js +6 -6
  455. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +2 -2
  456. package/dist/server/rpc/handlers/load-model/resolve-session.js +3 -3
  457. package/dist/server/rpc/handlers/load-model/resolve.d.ts +2 -2
  458. package/dist/server/rpc/handlers/load-model/resolve.js +2 -2
  459. package/dist/server/rpc/handlers/load-model/types.d.ts +2 -2
  460. package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
  461. package/dist/server/rpc/handlers/load-model-delegated.js +3 -3
  462. package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
  463. package/dist/server/rpc/handlers/logging-stream.js +1 -1
  464. package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
  465. package/dist/server/rpc/handlers/ocr-stream.js +1 -1
  466. package/dist/server/rpc/handlers/plugin-dispatch.js +3 -3
  467. package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
  468. package/dist/server/rpc/handlers/plugin-invoke.js +3 -3
  469. package/dist/server/rpc/handlers/provideHandler/connection.js +1 -1
  470. package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
  471. package/dist/server/rpc/handlers/provideHandler/handler.js +1 -1
  472. package/dist/server/rpc/handlers/provideHandler/proxy.js +1 -1
  473. package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
  474. package/dist/server/rpc/handlers/rag.d.ts +1 -1
  475. package/dist/server/rpc/handlers/rag.js +4 -4
  476. package/dist/server/rpc/handlers/registry.d.ts +1 -1
  477. package/dist/server/rpc/handlers/registry.js +1 -1
  478. package/dist/server/rpc/handlers/resume.d.ts +1 -1
  479. package/dist/server/rpc/handlers/resume.js +1 -1
  480. package/dist/server/rpc/handlers/state.d.ts +1 -1
  481. package/dist/server/rpc/handlers/state.js +1 -1
  482. package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
  483. package/dist/server/rpc/handlers/stopProvideHandler.js +1 -1
  484. package/dist/server/rpc/handlers/suspend.d.ts +1 -1
  485. package/dist/server/rpc/handlers/suspend.js +1 -1
  486. package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
  487. package/dist/server/rpc/handlers/text-to-speech-stream.js +1 -1
  488. package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
  489. package/dist/server/rpc/handlers/text-to-speech.js +1 -1
  490. package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
  491. package/dist/server/rpc/handlers/transcribe-stream.js +1 -1
  492. package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
  493. package/dist/server/rpc/handlers/transcribe.js +1 -1
  494. package/dist/server/rpc/handlers/translate.d.ts +1 -1
  495. package/dist/server/rpc/handlers/translate.js +1 -1
  496. package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
  497. package/dist/server/rpc/handlers/unload-model-delegated.js +5 -5
  498. package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
  499. package/dist/server/rpc/handlers/unload-model.js +3 -3
  500. package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
  501. package/dist/server/rpc/handlers/upscale-stream.js +1 -1
  502. package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
  503. package/dist/server/rpc/handlers/video-stream.js +1 -1
  504. package/dist/server/rpc/index.d.ts +2 -2
  505. package/dist/server/rpc/method-shapes.d.ts +2 -0
  506. package/dist/server/rpc/method-shapes.js +2 -0
  507. package/dist/server/rpc/profiling/backend-diagnostics.d.ts +3 -0
  508. package/dist/server/rpc/profiling/backend-diagnostics.js +16 -0
  509. package/dist/server/rpc/profiling/context.d.ts +1 -1
  510. package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
  511. package/dist/server/rpc/profiling/index.d.ts +4 -4
  512. package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
  513. package/dist/server/rpc/profiling/operation-metrics.js +9 -1
  514. package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
  515. package/dist/server/rpc/profiling/operation-wrappers.js +51 -13
  516. package/dist/server/rpc/profiling/profiler.d.ts +2 -2
  517. package/dist/server/rpc/transport-selector.d.ts +1 -1
  518. package/dist/server/utils/archive.js +1 -1
  519. package/dist/server/utils/audio/decoder.d.ts +1 -1
  520. package/dist/server/utils/audio/decoder.js +1 -1
  521. package/dist/server/utils/cache/auto-history.d.ts +1 -1
  522. package/dist/server/utils/cache/paths.d.ts +1 -1
  523. package/dist/server/utils/cache/paths.js +6 -6
  524. package/dist/server/utils/checksum.d.ts +1 -1
  525. package/dist/server/utils/completion-normalizer.d.ts +2 -1
  526. package/dist/server/utils/completion-normalizer.js +31 -1
  527. package/dist/server/utils/config-transform.d.ts +1 -1
  528. package/dist/server/utils/config-transform.js +5 -7
  529. package/dist/server/utils/index.d.ts +11 -11
  530. package/dist/server/utils/path-security.d.ts +1 -1
  531. package/dist/server/utils/qvac-paths.js +1 -1
  532. package/dist/server/utils/response-format.d.ts +1 -1
  533. package/dist/server/utils/shard-utils.d.ts +1 -1
  534. package/dist/server/utils/tool-integration.d.ts +1 -1
  535. package/dist/server/utils/tool-integration.js +2 -2
  536. package/dist/server/utils/tools/dialect.d.ts +1 -1
  537. package/dist/server/utils/tools/dialect.js +2 -0
  538. package/dist/server/utils/tools/index.d.ts +2 -2
  539. package/dist/server/utils/tools/parser.d.ts +1 -1
  540. package/dist/server/utils/tools/parser.js +16 -8
  541. package/dist/server/utils/tools/parsers/dsml.d.ts +4 -0
  542. package/dist/server/utils/tools/parsers/dsml.js +176 -0
  543. package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
  544. package/dist/server/utils/tools/parsers/gemma4native.js +1 -1
  545. package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
  546. package/dist/server/utils/tools/parsers/harmony.js +1 -1
  547. package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
  548. package/dist/server/utils/tools/parsers/hermes.js +1 -1
  549. package/dist/server/utils/tools/parsers/json.d.ts +2 -2
  550. package/dist/server/utils/tools/parsers/json.js +1 -1
  551. package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
  552. package/dist/server/utils/tools/parsers/pythonic.js +1 -1
  553. package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
  554. package/dist/server/utils/tools/parsers/qwen35.js +1 -1
  555. package/dist/server/utils/tools/shared.d.ts +1 -1
  556. package/dist/server/utils/worker-lock.js +1 -1
  557. package/dist/server/worker-core.js +14 -10
  558. package/dist/server/worker.js +4 -3
  559. package/dist/utils/aggregate-events.d.ts +2 -2
  560. package/dist/utils/aggregate-events.js +2 -2
  561. package/dist/utils/errors-client.d.ts +0 -3
  562. package/dist/utils/errors-client.js +0 -5
  563. package/dist/utils/errors-server.d.ts +1 -1
  564. package/dist/utils/mcp-adapter.d.ts +4 -4
  565. package/dist/utils/mcp-adapter.js +1 -1
  566. package/dist/utils/tool-helpers.d.ts +1 -1
  567. package/dist/utils/tool-helpers.js +1 -1
  568. package/docs/system-resources-support-matrix.md +103 -0
  569. package/package.json +33 -18
  570. /package/dist/examples/{transcription → asr}/parakeet-ctc-filesystem.d.ts +0 -0
  571. /package/dist/examples/{transcription → asr}/parakeet-microphone-record.d.ts +0 -0
  572. /package/dist/examples/{transcription → asr}/parakeet-microphone-stream.d.ts +0 -0
  573. /package/dist/examples/{transcription → asr}/parakeet-sortformer-streaming.d.ts +0 -0
  574. /package/dist/examples/{transcription → asr}/parakeet-sortformer.d.ts +0 -0
  575. /package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem-chunked.d.ts +0 -0
  576. /package/dist/examples/{transcription → asr}/parakeet-tdt-filesystem.d.ts +0 -0
  577. /package/dist/examples/{transcription → asr}/whispercpp-filesystem-streaming.d.ts +0 -0
  578. /package/dist/examples/{transcription → asr}/whispercpp-filesystem.d.ts +0 -0
  579. /package/dist/examples/{transcription → asr}/whispercpp-microphone-conversation.d.ts +0 -0
  580. /package/dist/examples/{transcription → asr}/whispercpp-microphone-record.d.ts +0 -0
  581. /package/dist/examples/{transcription → asr}/whispercpp-prompt.d.ts +0 -0
@@ -1,3 +1,3 @@
1
- import type { OCRStreamRequest, OCRStreamResponse } from '../../../schemas/index';
1
+ import type { OCRStreamRequest, OCRStreamResponse } from '../../../schemas/index.js';
2
2
  export declare function handleOCRStream(request: OCRStreamRequest): AsyncGenerator<OCRStreamResponse>;
3
3
  //# sourceMappingURL=ocr-stream.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleOCRStream(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'ocrStream', request);
4
4
  }
@@ -1,6 +1,6 @@
1
- import { getModelEntry } from '../../bare/registry/model-registry.js';
2
- import { getAllPlugins, getPlugin } from '../../plugins/index.js';
3
- import { profileReplyHandler, profileStreamHandler } from '../profiling/index.js';
1
+ import { getModelEntry } from '../../../server/bare/registry/model-registry.js';
2
+ import { getAllPlugins, getPlugin } from '../../../server/plugins/index.js';
3
+ import { profileReplyHandler, profileStreamHandler } from '../../../server/rpc/profiling/index.js';
4
4
  import { ModelNotFoundError, ModelIsDelegatedError, ModelOperationNotSupportedError, PluginNotFoundError, PluginHandlerTypeMismatchError } from '../../../utils/errors-server.js';
5
5
  function resolvePluginHandlerDef(modelId, handlerName) {
6
6
  const entry = getModelEntry(modelId);
@@ -1,4 +1,4 @@
1
- import type { PluginInvokeRequest, PluginInvokeResponse, PluginInvokeStreamRequest, PluginInvokeStreamResponse } from '../../../schemas/plugin';
1
+ import type { PluginInvokeRequest, PluginInvokeResponse, PluginInvokeStreamRequest, PluginInvokeStreamResponse } from '../../../schemas/plugin.js';
2
2
  export declare function handlePluginInvoke(request: PluginInvokeRequest): Promise<PluginInvokeResponse>;
3
3
  export declare function handlePluginInvokeStream(request: PluginInvokeStreamRequest): AsyncGenerator<PluginInvokeStreamResponse>;
4
4
  //# sourceMappingURL=plugin-invoke.d.ts.map
@@ -1,6 +1,6 @@
1
- import { getModelEntry } from '../../bare/registry/model-registry.js';
2
- import { getPlugin, getPluginHandler } from '../../plugins/index.js';
3
- import { profileReplyHandler, profileStreamHandler } from '../profiling/index.js';
1
+ import { getModelEntry } from '../../../server/bare/registry/model-registry.js';
2
+ import { getPlugin, getPluginHandler } from '../../../server/plugins/index.js';
3
+ import { profileReplyHandler, profileStreamHandler } from '../../../server/rpc/profiling/index.js';
4
4
  import { PluginNotFoundError, PluginHandlerNotFoundError, PluginHandlerTypeMismatchError, PluginRequestValidationFailedError, PluginResponseValidationFailedError, ModelIsDelegatedError, ModelNotFoundError } from '../../../utils/errors-server.js';
5
5
  import { getServerLogger } from '../../../logging/index.js';
6
6
  import { formatZodError } from '../../../utils/zod-error.js';
@@ -1,6 +1,6 @@
1
1
  import RPC from 'bare-rpc';
2
2
  import { createRpcProxy } from './proxy.js';
3
- import { hasActiveProviders } from '../../../bare/hyperswarm.js';
3
+ import { hasActiveProviders } from '../../../../server/bare/hyperswarm.js';
4
4
  import { getServerLogger } from '../../../../logging/index.js';
5
5
  const logger = getServerLogger();
6
6
  export function setupConnectionHandlers(swarm) {
@@ -1,3 +1,3 @@
1
- import type { ProvideRequest, ProvideResponse } from '../../../../schemas/provide';
1
+ import type { ProvideRequest, ProvideResponse } from '../../../../schemas/provide.js';
2
2
  export declare function provideHandler(request: ProvideRequest): Promise<ProvideResponse>;
3
3
  //# sourceMappingURL=handler.d.ts.map
@@ -1,4 +1,4 @@
1
- import { getSwarm, hasActiveProviders, registerProvider } from '../../../bare/hyperswarm.js';
1
+ import { getSwarm, hasActiveProviders, registerProvider } from '../../../../server/bare/hyperswarm.js';
2
2
  import { setupConnectionHandlers } from './connection.js';
3
3
  import { getServerLogger } from '../../../../logging/index.js';
4
4
  const logger = getServerLogger();
@@ -1,4 +1,4 @@
1
- import { handleRequest } from '../../handle-request.js';
1
+ import { handleRequest } from '../../../../server/rpc/handle-request.js';
2
2
  import { getServerLogger } from '../../../../logging/index.js';
3
3
  const logger = getServerLogger();
4
4
  // Proxies RPC requests to the main handler: handleRequest
@@ -1,2 +1,2 @@
1
- export { provideHandler } from './provideHandler/handler';
1
+ export { provideHandler } from './provideHandler/handler.js';
2
2
  //# sourceMappingURL=provideHandler.d.ts.map
@@ -1,3 +1,3 @@
1
- import type { RagRequest, RagResponse, RagProgressUpdate } from '../../../schemas/index';
1
+ import type { RagRequest, RagResponse, RagProgressUpdate } from '../../../schemas/index.js';
2
2
  export declare function handleRag(request: RagRequest, onProgress?: (update: RagProgressUpdate) => void): Promise<RagResponse>;
3
3
  //# sourceMappingURL=rag.d.ts.map
@@ -50,11 +50,11 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
50
50
  var e = new Error(message);
51
51
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
52
  });
53
- import { chunk, ingest, reindex, saveEmbeddings, search, deleteEmbeddings, listWorkspaces, closeWorkspace, deleteWorkspace, DEFAULT_WORKSPACE, getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest } from '../../bare/rag-hyperdb/index.js';
54
- import { getRequestRegistry, withRequestContext } from '../../bare/runtime/index.js';
55
- import { generateServerRequestId } from '../../bare/runtime/request-id.js';
53
+ import { chunk, ingest, reindex, saveEmbeddings, search, deleteEmbeddings, listWorkspaces, closeWorkspace, deleteWorkspace, DEFAULT_WORKSPACE, getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest } from '../../../server/bare/rag-hyperdb/index.js';
54
+ import { getRequestRegistry, withRequestContext } from '../../../server/bare/runtime/index.js';
55
+ import { generateServerRequestId } from '../../../server/bare/runtime/request-id.js';
56
56
  import { getServerLogger } from '../../../logging/index.js';
57
- import { profileReplyHandler, registerOperationMetrics } from '../profiling/index.js';
57
+ import { profileReplyHandler, registerOperationMetrics } from '../../../server/rpc/profiling/index.js';
58
58
  registerOperationMetrics({
59
59
  op: 'rag',
60
60
  kind: 'handler',
@@ -1,4 +1,4 @@
1
- import type { ModelRegistryListResponse, ModelRegistrySearchRequest, ModelRegistrySearchResponse, ModelRegistryGetModelRequest, ModelRegistryGetModelResponse } from '../../../schemas/index';
1
+ import type { ModelRegistryListResponse, ModelRegistrySearchRequest, ModelRegistrySearchResponse, ModelRegistryGetModelRequest, ModelRegistryGetModelResponse } from '../../../schemas/index.js';
2
2
  export declare function handleModelRegistryList(): Promise<ModelRegistryListResponse>;
3
3
  export declare function handleModelRegistrySearch(request: ModelRegistrySearchRequest): Promise<ModelRegistrySearchResponse>;
4
4
  export declare function handleModelRegistryGetModel(request: ModelRegistryGetModelRequest): Promise<ModelRegistryGetModelResponse>;
@@ -1,6 +1,6 @@
1
1
  import { REGISTRY_ERROR_CODES } from '../../../schemas/sdk-errors-registry.js';
2
2
  import { getAddonFromEngine, resolveCanonicalEngine } from '../../../schemas/engine-addon-map.js';
3
- import { getRegistryClient } from '../../bare/registry/registry-client.js';
3
+ import { getRegistryClient } from '../../../server/bare/registry/registry-client.js';
4
4
  import { getServerLogger } from '../../../logging/index.js';
5
5
  import { ModelRegistryQueryFailedError } from '../../../utils/errors-server.js';
6
6
  const logger = getServerLogger();
@@ -1,3 +1,3 @@
1
- import type { ResumeResponse } from '../../../schemas/index';
1
+ import type { ResumeResponse } from '../../../schemas/index.js';
2
2
  export declare function handleResume(): Promise<ResumeResponse>;
3
3
  //# sourceMappingURL=resume.d.ts.map
@@ -1,4 +1,4 @@
1
- import { resumeRuntime } from '../../bare/runtime-lifecycle.js';
1
+ import { resumeRuntime } from '../../../server/bare/runtime-lifecycle.js';
2
2
  import { LifecycleResumeFailedError } from '../../../utils/errors-server.js';
3
3
  export async function handleResume() {
4
4
  try {
@@ -1,3 +1,3 @@
1
- import type { StateResponse } from '../../../schemas/index';
1
+ import type { StateResponse } from '../../../schemas/index.js';
2
2
  export declare function handleState(): StateResponse;
3
3
  //# sourceMappingURL=state.d.ts.map
@@ -1,4 +1,4 @@
1
- import { getLifecycleState } from '../../bare/runtime-lifecycle.js';
1
+ import { getLifecycleState } from '../../../server/bare/runtime-lifecycle.js';
2
2
  export function handleState() {
3
3
  return {
4
4
  type: 'state',
@@ -1,3 +1,3 @@
1
- import type { StopProvideResponse } from '../../../schemas/stop-provide';
1
+ import type { StopProvideResponse } from '../../../schemas/stop-provide.js';
2
2
  export declare function stopProvideHandler(): StopProvideResponse;
3
3
  //# sourceMappingURL=stopProvideHandler.d.ts.map
@@ -1,4 +1,4 @@
1
- import { unregisterProvider } from '../../bare/hyperswarm.js';
1
+ import { unregisterProvider } from '../../../server/bare/hyperswarm.js';
2
2
  import { getServerLogger } from '../../../logging/index.js';
3
3
  const logger = getServerLogger();
4
4
  // Decrements the active-provider counter. The shared connection listener
@@ -1,3 +1,3 @@
1
- import type { SuspendResponse } from '../../../schemas/index';
1
+ import type { SuspendResponse } from '../../../schemas/index.js';
2
2
  export declare function handleSuspend(): Promise<SuspendResponse>;
3
3
  //# sourceMappingURL=suspend.d.ts.map
@@ -1,4 +1,4 @@
1
- import { suspendRuntime } from '../../bare/runtime-lifecycle.js';
1
+ import { suspendRuntime } from '../../../server/bare/runtime-lifecycle.js';
2
2
  import { LifecycleSuspendFailedError } from '../../../utils/errors-server.js';
3
3
  export async function handleSuspend() {
4
4
  try {
@@ -1,3 +1,3 @@
1
- import type { TextToSpeechStreamRequest, TextToSpeechStreamResponse } from '../../../schemas/index';
1
+ import type { TextToSpeechStreamRequest, TextToSpeechStreamResponse } from '../../../schemas/index.js';
2
2
  export declare function handleTextToSpeechStream(request: TextToSpeechStreamRequest, inputStream: AsyncIterable<Buffer>): AsyncGenerator<TextToSpeechStreamResponse>;
3
3
  //# sourceMappingURL=text-to-speech-stream.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleTextToSpeechStream(request, inputStream) {
3
3
  yield* dispatchPluginStream(request.modelId, 'textToSpeechStream', request, inputStream);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { TtsRequest, TtsResponse } from '../../../schemas/index';
1
+ import type { TtsRequest, TtsResponse } from '../../../schemas/index.js';
2
2
  export declare function handleTextToSpeech(request: TtsRequest): AsyncGenerator<TtsResponse>;
3
3
  //# sourceMappingURL=text-to-speech.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleTextToSpeech(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'textToSpeech', request);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { TranscribeStreamRequest, TranscribeStreamResponse } from '../../../schemas/index';
1
+ import type { TranscribeStreamRequest, TranscribeStreamResponse } from '../../../schemas/index.js';
2
2
  export declare function handleTranscribeStream(request: TranscribeStreamRequest, inputStream: AsyncIterable<Buffer>): AsyncGenerator<TranscribeStreamResponse>;
3
3
  //# sourceMappingURL=transcribe-stream.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleTranscribeStream(request, inputStream) {
3
3
  yield* dispatchPluginStream(request.modelId, 'transcribeStream', request, inputStream);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { TranscribeRequest, TranscribeResponse } from '../../../schemas/index';
1
+ import type { TranscribeRequest, TranscribeResponse } from '../../../schemas/index.js';
2
2
  export declare function handleTranscribe(request: TranscribeRequest): AsyncGenerator<TranscribeResponse>;
3
3
  //# sourceMappingURL=transcribe.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleTranscribe(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'transcribe', request);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { TranslateRequest, TranslateResponse } from '../../../schemas/index';
1
+ import type { TranslateRequest, TranslateResponse } from '../../../schemas/index.js';
2
2
  export declare function handleTranslate(request: TranslateRequest): AsyncGenerator<TranslateResponse>;
3
3
  //# sourceMappingURL=translate.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleTranslate(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'translate', request);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { UnloadModelRequest, UnloadModelResponse } from '../../../schemas/index';
1
+ import type { UnloadModelRequest, UnloadModelResponse } from '../../../schemas/index.js';
2
2
  export declare function handleUnloadModelDelegated(request: UnloadModelRequest): Promise<UnloadModelResponse>;
3
3
  //# sourceMappingURL=unload-model-delegated.d.ts.map
@@ -1,8 +1,8 @@
1
- import { getModelEntry, unregisterModel } from '../../bare/registry/model-registry.js';
2
- import { getRPC } from '../../bare/delegate-rpc-client.js';
3
- import { send } from '../delegate-transport.js';
4
- import { hasActiveProviders } from '../../bare/hyperswarm.js';
5
- import { getRegistryStats } from '../../bare/registry/model-registry.js';
1
+ import { getModelEntry, unregisterModel } from '../../../server/bare/registry/model-registry.js';
2
+ import { getRPC } from '../../../server/bare/delegate-rpc-client.js';
3
+ import { send } from '../../../server/rpc/delegate-transport.js';
4
+ import { hasActiveProviders } from '../../../server/bare/hyperswarm.js';
5
+ import { getRegistryStats } from '../../../server/bare/registry/model-registry.js';
6
6
  import { ModelIsDelegatedError } from '../../../utils/errors-server.js';
7
7
  import { getServerLogger } from '../../../logging/index.js';
8
8
  const logger = getServerLogger();
@@ -1,3 +1,3 @@
1
- import type { UnloadModelRequest, UnloadModelResponse } from '../../../schemas/index';
1
+ import type { UnloadModelRequest, UnloadModelResponse } from '../../../schemas/index.js';
2
2
  export declare function handleUnloadModel(request: UnloadModelRequest): Promise<UnloadModelResponse>;
3
3
  //# sourceMappingURL=unload-model.d.ts.map
@@ -1,6 +1,6 @@
1
- import { unloadModel } from '../../bare/ops/unload-model.js';
2
- import { getRegistryStats } from '../../bare/registry/model-registry.js';
3
- import { hasActiveProviders } from '../../bare/hyperswarm.js';
1
+ import { unloadModel } from '../../../server/bare/ops/unload-model.js';
2
+ import { getRegistryStats } from '../../../server/bare/registry/model-registry.js';
3
+ import { hasActiveProviders } from '../../../server/bare/hyperswarm.js';
4
4
  import { getServerLogger } from '../../../logging/index.js';
5
5
  const logger = getServerLogger();
6
6
  export async function handleUnloadModel(request) {
@@ -1,3 +1,3 @@
1
- import type { UpscaleStreamRequest, UpscaleStreamResponse } from '../../../schemas/sdcpp-config';
1
+ import type { UpscaleStreamRequest, UpscaleStreamResponse } from '../../../schemas/sdcpp-config.js';
2
2
  export declare function handleUpscaleStream(request: UpscaleStreamRequest): AsyncGenerator<UpscaleStreamResponse>;
3
3
  //# sourceMappingURL=upscale-stream.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleUpscaleStream(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'upscaleStream', request);
4
4
  }
@@ -1,3 +1,3 @@
1
- import type { VideoStreamRequest, VideoStreamResponse } from '../../../schemas/sdcpp-config';
1
+ import type { VideoStreamRequest, VideoStreamResponse } from '../../../schemas/sdcpp-config.js';
2
2
  export declare function handleVideoStream(request: VideoStreamRequest): AsyncGenerator<VideoStreamResponse>;
3
3
  //# sourceMappingURL=video-stream.d.ts.map
@@ -1,4 +1,4 @@
1
- import { dispatchPluginStream } from './plugin-dispatch.js';
1
+ import { dispatchPluginStream } from '../../../server/rpc/handlers/plugin-dispatch.js';
2
2
  export async function* handleVideoStream(request) {
3
3
  yield* dispatchPluginStream(request.modelId, 'videoStream', request);
4
4
  }
@@ -1,3 +1,3 @@
1
- export { createBareKitRPCServer, createIPCClient } from './create-server';
2
- export { handleRequest } from './handle-request';
1
+ export { createBareKitRPCServer, createIPCClient } from './create-server.js';
2
+ export { handleRequest } from './handle-request.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -8,6 +8,7 @@
8
8
  * diverges from it fails to compile.
9
9
  */
10
10
  export declare const methodShapes: {
11
+ readonly audioGenStream: "stream";
11
12
  readonly batchCompletionStream: "stream";
12
13
  readonly bciTranscribe: "stream";
13
14
  readonly bciTranscribeStream: "duplex";
@@ -22,6 +23,7 @@ export declare const methodShapes: {
22
23
  readonly finetune: "reply";
23
24
  readonly getLoadedModelInfo: "reply";
24
25
  readonly getModelInfo: "reply";
26
+ readonly getSystemResources: "reply";
25
27
  readonly heartbeat: "reply";
26
28
  readonly loadModel: "reply";
27
29
  readonly loggingStream: "stream";
@@ -8,6 +8,7 @@
8
8
  * diverges from it fails to compile.
9
9
  */
10
10
  export const methodShapes = {
11
+ audioGenStream: 'stream',
11
12
  batchCompletionStream: 'stream',
12
13
  bciTranscribe: 'stream',
13
14
  bciTranscribeStream: 'duplex',
@@ -22,6 +23,7 @@ export const methodShapes = {
22
23
  finetune: 'reply',
23
24
  getLoadedModelInfo: 'reply',
24
25
  getModelInfo: 'reply',
26
+ getSystemResources: 'reply',
25
27
  heartbeat: 'reply',
26
28
  loadModel: 'reply',
27
29
  loggingStream: 'stream',
@@ -0,0 +1,3 @@
1
+ import { type InferenceBackendDiagnostics } from '../../../schemas/index.js';
2
+ export declare function readBackendDiagnostics(target: unknown): InferenceBackendDiagnostics | undefined;
3
+ //# sourceMappingURL=backend-diagnostics.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { getServerLogger } from '../../../logging/index.js';
2
+ import { BACKEND_DIAGNOSTICS_KEY, inferenceBackendDiagnosticsSchema } from '../../../schemas/index.js';
3
+ const logger = getServerLogger();
4
+ export function readBackendDiagnostics(target) {
5
+ if (!target || typeof target !== 'object')
6
+ return undefined;
7
+ const diagnostics = target[BACKEND_DIAGNOSTICS_KEY];
8
+ if (diagnostics === undefined)
9
+ return undefined;
10
+ const result = inferenceBackendDiagnosticsSchema.safeParse(diagnostics);
11
+ if (!result.success) {
12
+ logger.debug('Ignoring invalid backend diagnostics', result.error);
13
+ return undefined;
14
+ }
15
+ return result.data;
16
+ }
@@ -1,4 +1,4 @@
1
- import { type ProfilingRequestMeta, type DelegationBreakdown, type OperationEvent } from '../../../schemas/index';
1
+ import { type ProfilingRequestMeta, type DelegationBreakdown, type OperationEvent } from '../../../schemas/index.js';
2
2
  export interface ServerProfilingContext {
3
3
  meta: ProfilingRequestMeta;
4
4
  requestStart: number;
@@ -1,5 +1,5 @@
1
- import { type BaseTimings } from '../../../profiling/index';
2
- import type { ProfilingRequestMeta, ProfilingResponseMeta, DelegationBreakdown } from '../../../schemas/index';
1
+ import { type BaseTimings } from '../../../profiling/index.js';
2
+ import type { ProfilingRequestMeta, ProfilingResponseMeta, DelegationBreakdown } from '../../../schemas/index.js';
3
3
  export interface DelegatedHandlerOptions {
4
4
  profilingMeta?: ProfilingRequestMeta;
5
5
  }
@@ -1,5 +1,5 @@
1
- export { createServerProfiler, type ServerProfiler } from './profiler';
2
- export { profileReplyHandler, profileStreamHandler } from './operation-wrappers';
3
- export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from './operation-metrics';
4
- export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, type DelegationTimings, type DelegationStreamTimings, type DelegatedHandlerOptions } from './delegation-profiler';
1
+ export { createServerProfiler, type ServerProfiler } from './profiler.js';
2
+ export { profileReplyHandler, profileStreamHandler } from './operation-wrappers.js';
3
+ export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from './operation-metrics.js';
4
+ export { shouldProfileDelegation, createDelegationTimings, createDelegationStreamTimings, recordDelegationEvents, recordDelegationStreamEvents, cacheDelegationConnectionTime, flushServerConnectionEvent, consumeBreakdownConnectionTime, clearPeerConnectionTracking, resetDelegationConnectionTracking, type DelegationTimings, type DelegationStreamTimings, type DelegatedHandlerOptions } from './delegation-profiler.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -2,8 +2,8 @@
2
2
  * Declarative extraction of operation-level metrics from request/response data.
3
3
  * Used by operation wrappers to capture handler-specific profiling events.
4
4
  */
5
- import type { ProfilingEvent, ProfilingEventKind } from '../../../profiling/types';
6
- import type { DownloadStats } from '../handlers/load-model/types';
5
+ import type { ProfilingEvent, ProfilingEventKind } from '../../../profiling/types.js';
6
+ import type { DownloadStats } from '../../../server/rpc/handlers/load-model/types.js';
7
7
  export type MetricExtractor<T> = (data: T) => Record<string, number> | undefined;
8
8
  export type TagExtractor<T> = (data: T) => Record<string, string> | undefined;
9
9
  export interface OperationMetricsConfig<TRequest = unknown, TResponse = unknown> {
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import {} from '../../../schemas/index.js';
6
6
  import { readModelExecutionMs } from '../../../profiling/model-execution.js';
7
+ import { readBackendDiagnostics } from './backend-diagnostics.js';
7
8
  const metricsRegistry = new Map();
8
9
  function extractDownloadStatsGauges(stats, gauges) {
9
10
  if (stats?.downloadTimeMs !== undefined) {
@@ -21,14 +22,18 @@ export function registerOperationMetrics(config) {
21
22
  }
22
23
  export function buildOperationEvent(op, profileId, ts, executionMs, request, finalResponse, ttfb) {
23
24
  const config = metricsRegistry.get(op);
25
+ const backend = readBackendDiagnostics(finalResponse);
24
26
  if (!config) {
25
- return {
27
+ const event = {
26
28
  ts,
27
29
  op,
28
30
  kind: 'handler',
29
31
  profileId,
30
32
  ms: executionMs
31
33
  };
34
+ if (backend)
35
+ event.backend = backend;
36
+ return event;
32
37
  }
33
38
  const gauges = {};
34
39
  if (ttfb !== undefined) {
@@ -64,6 +69,9 @@ export function buildOperationEvent(op, profileId, ts, executionMs, request, fin
64
69
  if (hasGauges) {
65
70
  event.gauges = gauges;
66
71
  }
72
+ if (backend) {
73
+ event.backend = backend;
74
+ }
67
75
  if (hasTags) {
68
76
  event.tags = tags;
69
77
  }
@@ -2,7 +2,7 @@
2
2
  * Generic wrappers for profiling handler execution.
3
3
  * Used to wrap dispatch/invoke functions with timing capture.
4
4
  */
5
- import { type PerCallProfiling } from '../../../schemas/index';
5
+ import { type PerCallProfiling } from '../../../schemas/index.js';
6
6
  export interface ProfiledReplyOptions<TRequest> {
7
7
  op: string;
8
8
  request: TRequest;
@@ -4,9 +4,10 @@
4
4
  */
5
5
  import { PROFILING_KEY, OPERATION_EVENT_KEY } from '../../../schemas/index.js';
6
6
  import { nowMs, generateProfileId } from '../../../profiling/clock.js';
7
- import { record, shouldProfile } from '../../../profiling/controller.js';
7
+ import { record, shouldIncludeResourceGauges, shouldProfile } from '../../../profiling/controller.js';
8
+ import { getWorkerResourceCollector } from '../../../server/bare/resources/worker-collector.js';
8
9
  import { buildOperationEvent } from './operation-metrics.js';
9
- import { isTerminalChunk } from '../rpc-utils';
10
+ import { isTerminalChunk } from '../rpc-utils.js';
10
11
  function getRequestProfilingMeta(request) {
11
12
  if (!request || typeof request !== 'object') {
12
13
  return undefined;
@@ -17,21 +18,47 @@ function getRequestProfilingMeta(request) {
17
18
  }
18
19
  return meta;
19
20
  }
20
- function resolvePerCallProfiling(options) {
21
+ function resolveOperationProfiling(options) {
21
22
  if (options.perCall) {
22
- return options.perCall;
23
+ return { perCall: options.perCall, resourceOrigin: 'local' };
23
24
  }
24
25
  const meta = getRequestProfilingMeta(options.request);
25
26
  if (!meta) {
26
- return undefined;
27
+ return { perCall: undefined, resourceOrigin: 'local' };
27
28
  }
28
29
  if (meta.enabled === false) {
29
- return { enabled: false };
30
+ return {
31
+ perCall: { enabled: false },
32
+ resourceOrigin: meta.resourceOrigin ?? 'local'
33
+ };
30
34
  }
31
35
  return {
32
- enabled: true,
33
- includeServerBreakdown: meta.includeServer,
34
- mode: meta.mode
36
+ perCall: {
37
+ enabled: true,
38
+ includeServerBreakdown: meta.includeServer,
39
+ includeResourceGauges: meta.includeResources,
40
+ mode: meta.mode
41
+ },
42
+ resourceOrigin: meta.resourceOrigin ?? 'local'
43
+ };
44
+ }
45
+ function toProfilerResourceGauge(sample, sampledAt, origin) {
46
+ const gpus = sample.gpus.status === 'supported'
47
+ ? {
48
+ ...sample.gpus,
49
+ value: sample.gpus.value.map((gpu) => ({
50
+ id: gpu.id,
51
+ compute: gpu.compute,
52
+ memoryUsedBytes: gpu.memoryUsedBytes
53
+ }))
54
+ }
55
+ : sample.gpus;
56
+ return {
57
+ origin,
58
+ sampledAt,
59
+ cpu: sample.cpu,
60
+ memory: sample.memory,
61
+ gpus
35
62
  };
36
63
  }
37
64
  function buildAndRecordOperationEvent(params) {
@@ -44,12 +71,18 @@ function buildAndRecordOperationEvent(params) {
44
71
  if (params.count !== undefined && params.count > 0) {
45
72
  event.count = params.count;
46
73
  }
74
+ if (shouldIncludeResourceGauges(params.profiling.perCall)) {
75
+ const resources = getWorkerResourceCollector()?.sample();
76
+ if (resources) {
77
+ event.resources = toProfilerResourceGauge(resources, nowMs(), params.profiling.resourceOrigin);
78
+ }
79
+ }
47
80
  record(event);
48
81
  return event;
49
82
  }
50
83
  export async function profileReplyHandler(options, handler) {
51
- const perCall = resolvePerCallProfiling(options);
52
- if (!shouldProfile(options.op, perCall)) {
84
+ const profiling = resolveOperationProfiling(options);
85
+ if (!shouldProfile(options.op, profiling.perCall)) {
53
86
  return handler();
54
87
  }
55
88
  const profileId = generateProfileId();
@@ -59,6 +92,7 @@ export async function profileReplyHandler(options, handler) {
59
92
  const executionMs = nowMs() - startTs;
60
93
  const event = buildAndRecordOperationEvent({
61
94
  options,
95
+ profiling,
62
96
  profileId,
63
97
  startTs,
64
98
  executionMs,
@@ -74,6 +108,7 @@ export async function profileReplyHandler(options, handler) {
74
108
  const executionMs = nowMs() - startTs;
75
109
  buildAndRecordOperationEvent({
76
110
  options,
111
+ profiling,
77
112
  profileId,
78
113
  startTs,
79
114
  executionMs,
@@ -83,8 +118,8 @@ export async function profileReplyHandler(options, handler) {
83
118
  }
84
119
  }
85
120
  export async function* profileStreamHandler(options, handler) {
86
- const perCall = resolvePerCallProfiling(options);
87
- if (!shouldProfile(options.op, perCall)) {
121
+ const profiling = resolveOperationProfiling(options);
122
+ if (!shouldProfile(options.op, profiling.perCall)) {
88
123
  return yield* handler();
89
124
  }
90
125
  const profileId = generateProfileId();
@@ -102,6 +137,7 @@ export async function* profileStreamHandler(options, handler) {
102
137
  const executionMs = nowMs() - startTs;
103
138
  buildAndRecordOperationEvent({
104
139
  options,
140
+ profiling,
105
141
  profileId,
106
142
  startTs,
107
143
  executionMs,
@@ -122,6 +158,7 @@ export async function* profileStreamHandler(options, handler) {
122
158
  const executionMs = nowMs() - startTs;
123
159
  const event = buildAndRecordOperationEvent({
124
160
  options,
161
+ profiling,
125
162
  profileId,
126
163
  startTs,
127
164
  executionMs,
@@ -142,6 +179,7 @@ export async function* profileStreamHandler(options, handler) {
142
179
  const executionMs = nowMs() - startTs;
143
180
  buildAndRecordOperationEvent({
144
181
  options,
182
+ profiling,
145
183
  profileId,
146
184
  startTs,
147
185
  executionMs,
@@ -1,5 +1,5 @@
1
- import { type Response, type ProfilingRequestMeta } from '../../../schemas/index';
2
- import { type ServerProfilingContext } from './context';
1
+ import { type Response, type ProfilingRequestMeta } from '../../../schemas/index.js';
2
+ import { type ServerProfilingContext } from './context.js';
3
3
  export type ServerProfiler = {
4
4
  markRequestParsed: (ms: number) => void;
5
5
  markRequestValidated: (ms: number) => void;