dsh-plugin-local-infer 0.1.2 → 0.1.4

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 (251) hide show
  1. package/README.md +32 -6
  2. package/cordis.patch.yml +7 -0
  3. package/docs/zh/README.md +24 -4
  4. package/dsh/client.js +4200 -4049
  5. package/package.json +33 -11
  6. package/packages/core/lib/adapter.d.ts +177 -11
  7. package/packages/core/lib/adapter.js +74 -1
  8. package/packages/core/lib/config.d.ts +1 -1
  9. package/packages/core/lib/config.js +1 -1
  10. package/packages/core/lib/debug.d.ts +1 -1
  11. package/packages/core/lib/debug.js +1 -1
  12. package/packages/core/lib/defaults.d.ts +1 -1
  13. package/packages/core/lib/defaults.js +1 -1
  14. package/packages/core/lib/deps.d.ts +48 -20
  15. package/packages/core/lib/deps.js +24 -8
  16. package/packages/core/lib/estimator.d.ts +1 -1
  17. package/packages/core/lib/estimator.js +1 -1
  18. package/packages/core/lib/guideline.d.ts +1 -1
  19. package/packages/core/lib/guideline.js +1 -1
  20. package/packages/core/lib/hardware.d.ts +1 -1
  21. package/packages/core/lib/hardware.js +1 -1
  22. package/packages/core/lib/hf-cache.d.ts +70 -0
  23. package/packages/core/lib/hf-cache.js +83 -0
  24. package/packages/core/lib/index.d.ts +16 -9
  25. package/packages/core/lib/index.js +10 -6
  26. package/packages/core/lib/infer-cache.d.ts +39 -0
  27. package/packages/core/lib/infer-cache.js +53 -0
  28. package/packages/core/lib/launch-command.d.ts +8 -4
  29. package/packages/core/lib/launch-command.js +13 -6
  30. package/packages/core/lib/launch-record.d.ts +1 -1
  31. package/packages/core/lib/launch-record.js +1 -1
  32. package/packages/core/lib/logs.d.ts +8 -1
  33. package/packages/core/lib/logs.js +12 -4
  34. package/packages/core/lib/models.d.ts +120 -14
  35. package/packages/core/lib/models.js +209 -17
  36. package/packages/core/lib/parameter.d.ts +31 -3
  37. package/packages/core/lib/parameter.js +1 -1
  38. package/packages/core/lib/progress.d.ts +54 -0
  39. package/packages/core/lib/progress.js +120 -0
  40. package/packages/core/lib/registrar.d.ts +25 -14
  41. package/packages/core/lib/registrar.js +30 -10
  42. package/packages/core/lib/reserve.d.ts +11 -3
  43. package/packages/core/lib/reserve.js +6 -4
  44. package/packages/core/lib/status.d.ts +12 -6
  45. package/packages/core/lib/status.js +21 -10
  46. package/packages/core/lib/sudo.d.ts +80 -0
  47. package/packages/core/lib/sudo.js +78 -0
  48. package/packages/core/package.json +1 -1
  49. package/packages/orchestrator/lib/config.d.ts +63 -0
  50. package/packages/orchestrator/lib/config.js +111 -0
  51. package/packages/orchestrator/lib/index.d.ts +51 -0
  52. package/packages/orchestrator/lib/index.js +73 -0
  53. package/packages/orchestrator/lib/route.d.ts +60 -0
  54. package/packages/orchestrator/lib/route.js +159 -0
  55. package/packages/orchestrator/locale/en.json +6 -0
  56. package/packages/orchestrator/package.json +39 -0
  57. package/packages/orchestrator/prompt.md +87 -0
  58. package/packages/providers/lib/acquire.d.ts +95 -15
  59. package/packages/providers/lib/acquire.js +239 -40
  60. package/packages/providers/lib/adapters.d.ts +155 -221
  61. package/packages/providers/lib/adapters.js +589 -935
  62. package/packages/providers/lib/debug.d.ts +1 -1
  63. package/packages/providers/lib/debug.js +1 -1
  64. package/packages/providers/lib/deps.d.ts +31 -212
  65. package/packages/providers/lib/deps.js +71 -205
  66. package/packages/providers/lib/engines/basalt/basalt.d.ts +130 -0
  67. package/packages/providers/lib/engines/basalt/basalt.js +304 -0
  68. package/packages/providers/lib/engines/basalt/basaltAdapter.d.ts +85 -0
  69. package/packages/providers/lib/engines/basalt/basaltAdapter.js +439 -0
  70. package/packages/providers/lib/engines/basalt/basaltLinux.d.ts +23 -0
  71. package/packages/providers/lib/engines/basalt/basaltLinux.js +47 -0
  72. package/packages/providers/lib/engines/basalt/basaltMacOS.d.ts +17 -0
  73. package/packages/providers/lib/engines/basalt/basaltMacOS.js +19 -0
  74. package/packages/providers/lib/engines/basalt/basaltWindows.d.ts +24 -0
  75. package/packages/providers/lib/engines/basalt/basaltWindows.js +49 -0
  76. package/packages/providers/lib/engines/engineOs.d.ts +24 -0
  77. package/packages/providers/lib/engines/engineOs.js +17 -0
  78. package/packages/providers/lib/{hyperqwen.d.ts → engines/hyperqwen/hyperqwen.d.ts} +2 -2
  79. package/packages/providers/lib/{hyperqwen.js → engines/hyperqwen/hyperqwen.js} +14 -2
  80. package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.d.ts +38 -0
  81. package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.js +115 -0
  82. package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.d.ts +9 -0
  83. package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.js +9 -0
  84. package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.d.ts +9 -0
  85. package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.js +9 -0
  86. package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.d.ts +9 -0
  87. package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.js +9 -0
  88. package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.d.ts +10 -0
  89. package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.js +14 -0
  90. package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.d.ts +9 -0
  91. package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.js +9 -0
  92. package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.d.ts +9 -0
  93. package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.js +9 -0
  94. package/packages/providers/lib/{infernix.d.ts → engines/infernix/infernix.d.ts} +7 -4
  95. package/packages/providers/lib/{infernix.js → engines/infernix/infernix.js} +53 -8
  96. package/packages/providers/lib/engines/infernix/infernixAdapter.d.ts +52 -0
  97. package/packages/providers/lib/engines/infernix/infernixAdapter.js +235 -0
  98. package/packages/providers/lib/engines/infernix/infernixArch.d.ts +9 -0
  99. package/packages/providers/lib/engines/infernix/infernixArch.js +9 -0
  100. package/packages/providers/lib/engines/infernix/infernixDebian.d.ts +9 -0
  101. package/packages/providers/lib/engines/infernix/infernixDebian.js +9 -0
  102. package/packages/providers/lib/engines/infernix/infernixFedora.d.ts +9 -0
  103. package/packages/providers/lib/engines/infernix/infernixFedora.js +9 -0
  104. package/packages/providers/lib/engines/infernix/infernixLinux.d.ts +17 -0
  105. package/packages/providers/lib/engines/infernix/infernixLinux.js +35 -0
  106. package/packages/providers/lib/engines/infernix/infernixMacOS.d.ts +16 -0
  107. package/packages/providers/lib/engines/infernix/infernixMacOS.js +18 -0
  108. package/packages/providers/lib/engines/infernix/infernixWindows.d.ts +16 -0
  109. package/packages/providers/lib/engines/infernix/infernixWindows.js +34 -0
  110. package/packages/providers/lib/{llamacpp.d.ts → engines/llamacpp/llamacpp.d.ts} +2 -2
  111. package/packages/providers/lib/{llamacpp.js → engines/llamacpp/llamacpp.js} +12 -2
  112. package/packages/providers/lib/engines/llamacpp/llamacppAdapter.d.ts +50 -0
  113. package/packages/providers/lib/engines/llamacpp/llamacppAdapter.js +274 -0
  114. package/packages/providers/lib/engines/llamacpp/llamacppArch.d.ts +9 -0
  115. package/packages/providers/lib/engines/llamacpp/llamacppArch.js +9 -0
  116. package/packages/providers/lib/engines/llamacpp/llamacppDebian.d.ts +9 -0
  117. package/packages/providers/lib/engines/llamacpp/llamacppDebian.js +9 -0
  118. package/packages/providers/lib/engines/llamacpp/llamacppFedora.d.ts +9 -0
  119. package/packages/providers/lib/engines/llamacpp/llamacppFedora.js +9 -0
  120. package/packages/providers/lib/engines/llamacpp/llamacppLinux.d.ts +17 -0
  121. package/packages/providers/lib/engines/llamacpp/llamacppLinux.js +28 -0
  122. package/packages/providers/lib/engines/llamacpp/llamacppMacOS.d.ts +15 -0
  123. package/packages/providers/lib/engines/llamacpp/llamacppMacOS.js +17 -0
  124. package/packages/providers/lib/engines/llamacpp/llamacppWindows.d.ts +15 -0
  125. package/packages/providers/lib/engines/llamacpp/llamacppWindows.js +26 -0
  126. package/packages/providers/lib/{ninfer.d.ts → engines/ninfer/ninfer.d.ts} +2 -2
  127. package/packages/providers/lib/{ninfer.js → engines/ninfer/ninfer.js} +25 -3
  128. package/packages/providers/lib/engines/ninfer/ninferAdapter.d.ts +81 -0
  129. package/packages/providers/lib/engines/ninfer/ninferAdapter.js +392 -0
  130. package/packages/providers/lib/engines/ninfer/ninferArch.d.ts +9 -0
  131. package/packages/providers/lib/engines/ninfer/ninferArch.js +9 -0
  132. package/packages/providers/lib/engines/ninfer/ninferDebian.d.ts +9 -0
  133. package/packages/providers/lib/engines/ninfer/ninferDebian.js +9 -0
  134. package/packages/providers/lib/engines/ninfer/ninferFedora.d.ts +9 -0
  135. package/packages/providers/lib/engines/ninfer/ninferFedora.js +9 -0
  136. package/packages/providers/lib/engines/ninfer/ninferLinux.d.ts +17 -0
  137. package/packages/providers/lib/engines/ninfer/ninferLinux.js +37 -0
  138. package/packages/providers/lib/engines/ninfer/ninferMacOS.d.ts +15 -0
  139. package/packages/providers/lib/engines/ninfer/ninferMacOS.js +17 -0
  140. package/packages/providers/lib/engines/ninfer/ninferWindows.d.ts +29 -0
  141. package/packages/providers/lib/engines/ninfer/ninferWindows.js +59 -0
  142. package/packages/providers/lib/engines/strata/strata.d.ts +1 -0
  143. package/packages/providers/lib/engines/strata/strata.js +264 -0
  144. package/packages/providers/lib/engines/strata/strataAdapter.d.ts +97 -0
  145. package/packages/providers/lib/engines/strata/strataAdapter.js +463 -0
  146. package/packages/providers/lib/engines/strata/strataArch.d.ts +9 -0
  147. package/packages/providers/lib/engines/strata/strataArch.js +9 -0
  148. package/packages/providers/lib/engines/strata/strataDebian.d.ts +9 -0
  149. package/packages/providers/lib/engines/strata/strataDebian.js +9 -0
  150. package/packages/providers/lib/engines/strata/strataFedora.d.ts +9 -0
  151. package/packages/providers/lib/engines/strata/strataFedora.js +9 -0
  152. package/packages/providers/lib/engines/strata/strataLinux.d.ts +21 -0
  153. package/packages/providers/lib/engines/strata/strataLinux.js +30 -0
  154. package/packages/providers/lib/engines/strata/strataMacOS.d.ts +16 -0
  155. package/packages/providers/lib/engines/strata/strataMacOS.js +17 -0
  156. package/packages/providers/lib/engines/strata/strataWindows.d.ts +27 -0
  157. package/packages/providers/lib/engines/strata/strataWindows.js +37 -0
  158. package/packages/providers/lib/engines.d.ts +8 -5
  159. package/packages/providers/lib/engines.js +22 -11
  160. package/packages/providers/lib/guidelines.d.ts +5 -4
  161. package/packages/providers/lib/guidelines.js +18 -5
  162. package/packages/providers/lib/index.d.ts +33 -24
  163. package/packages/providers/lib/index.js +46 -24
  164. package/packages/providers/lib/model-defaults.d.ts +10 -5
  165. package/packages/providers/lib/model-defaults.js +47 -5
  166. package/packages/providers/lib/platform.d.ts +8 -5
  167. package/packages/providers/lib/platform.js +27 -7
  168. package/packages/providers/lib/presets.d.ts +6 -4
  169. package/packages/providers/lib/presets.js +53 -5
  170. package/packages/providers/lib/systemDeps.d.ts +313 -0
  171. package/packages/providers/lib/systemDeps.js +284 -0
  172. package/packages/providers/lib/vram.d.ts +34 -8
  173. package/packages/providers/lib/vram.js +81 -8
  174. package/packages/providers/package.json +2 -2
  175. package/packages/service/lib/index.d.ts +187 -23
  176. package/packages/service/lib/index.js +667 -90
  177. package/packages/service/lib/launch-target.d.ts +19 -0
  178. package/packages/service/lib/launch-target.js +28 -0
  179. package/packages/service/lib/run-logs.d.ts +72 -0
  180. package/packages/service/lib/run-logs.js +125 -0
  181. package/packages/service/lib/types.d.ts +166 -8
  182. package/packages/service/lib/types.js +1 -1
  183. package/packages/service/package.json +2 -2
  184. package/packages/tool/lib/index.d.ts +1 -1
  185. package/packages/tool/lib/index.js +1 -1
  186. package/packages/tool/package.json +2 -2
  187. package/packages/ui/lib/config.d.ts +89 -0
  188. package/packages/ui/lib/config.js +251 -0
  189. package/packages/ui/lib/deps.d.ts +4 -4
  190. package/packages/ui/lib/deps.js +1 -1
  191. package/packages/ui/lib/form.d.ts +1 -1
  192. package/packages/ui/lib/form.js +1 -1
  193. package/packages/ui/lib/index.d.ts +7 -1
  194. package/packages/ui/lib/index.js +12 -2
  195. package/packages/ui/lib/meter.d.ts +1 -1
  196. package/packages/ui/lib/meter.js +1 -1
  197. package/packages/ui/lib/ops/engine.d.ts +216 -0
  198. package/packages/ui/lib/ops/engine.js +697 -0
  199. package/packages/ui/lib/ops/get-steps.d.ts +98 -0
  200. package/packages/ui/lib/ops/get-steps.js +359 -0
  201. package/packages/ui/lib/ops/hf.d.ts +42 -0
  202. package/packages/ui/lib/ops/hf.js +150 -0
  203. package/packages/ui/lib/ops/logs.d.ts +78 -0
  204. package/packages/ui/lib/ops/logs.js +119 -0
  205. package/packages/ui/lib/ops/model.d.ts +71 -0
  206. package/packages/ui/lib/ops/model.js +123 -0
  207. package/packages/ui/lib/request.d.ts +106 -0
  208. package/packages/ui/lib/request.js +80 -0
  209. package/packages/ui/lib/route.d.ts +106 -422
  210. package/packages/ui/lib/route.js +136 -1845
  211. package/packages/ui/lib/routes/chat-template.d.ts +1 -0
  212. package/packages/ui/lib/routes/chat-template.js +1 -0
  213. package/packages/ui/lib/routes/deps.d.ts +1 -0
  214. package/packages/ui/lib/routes/deps.js +1 -0
  215. package/packages/ui/lib/routes/download.d.ts +1 -0
  216. package/packages/ui/lib/routes/download.js +1 -0
  217. package/packages/ui/lib/routes/get.d.ts +1 -0
  218. package/packages/ui/lib/routes/get.js +106 -0
  219. package/packages/ui/lib/routes/install.d.ts +16 -0
  220. package/packages/ui/lib/routes/install.js +36 -0
  221. package/packages/ui/lib/routes/launch.d.ts +24 -0
  222. package/packages/ui/lib/routes/launch.js +74 -0
  223. package/packages/ui/lib/routes/logs.d.ts +57 -0
  224. package/packages/ui/lib/routes/logs.js +117 -0
  225. package/packages/ui/lib/routes/provider-delete.d.ts +15 -0
  226. package/packages/ui/lib/routes/provider-delete.js +37 -0
  227. package/packages/ui/lib/routes/register.d.ts +16 -0
  228. package/packages/ui/lib/routes/register.js +28 -0
  229. package/packages/ui/lib/routes/save.d.ts +18 -0
  230. package/packages/ui/lib/routes/save.js +159 -0
  231. package/packages/ui/lib/routes/stop.d.ts +19 -0
  232. package/packages/ui/lib/routes/stop.js +32 -0
  233. package/packages/ui/lib/routes/stream.d.ts +40 -0
  234. package/packages/ui/lib/routes/stream.js +68 -0
  235. package/packages/ui/lib/routes/summary.d.ts +15 -0
  236. package/packages/ui/lib/routes/summary.js +26 -0
  237. package/packages/ui/lib/routes/unregister.d.ts +14 -0
  238. package/packages/ui/lib/routes/unregister.js +26 -0
  239. package/packages/ui/lib/viewmodels/deps.d.ts +1 -0
  240. package/packages/ui/lib/viewmodels/deps.js +1 -0
  241. package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -0
  242. package/packages/ui/lib/viewmodels/depsHelpers.js +94 -0
  243. package/packages/ui/lib/viewmodels/summary.d.ts +145 -0
  244. package/packages/ui/lib/viewmodels/summary.js +245 -0
  245. package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +30 -0
  246. package/packages/ui/lib/viewmodels/summaryHelpers.js +42 -0
  247. package/packages/ui/lib/warnings.d.ts +1 -1
  248. package/packages/ui/lib/warnings.js +1 -1
  249. package/packages/ui/package.json +4 -4
  250. package/packages/providers/lib/strata.d.ts +0 -15
  251. package/packages/providers/lib/strata.js +0 -14
@@ -0,0 +1,439 @@
1
+ /**
2
+ * The Basalt engine adapter. BasaltAdapter is the Basalt engine (the
3
+ * C++/CUDA serve/ server for the Qwen3.8-Flash-Next and DeepSeek-V4.1-Flash
4
+ * MoE models, Blackwell-only).
5
+ * `renderLaunch` renders a `basalt serve --config --engine-bin` process
6
+ * plan: the binary name comes from the host OS profile, every setting and
7
+ * the served model land in the `basalt_config.json` the plan's `configFile`
8
+ * carries (the spec surface rendered with `configFileFromSpecs` into the
9
+ * versioned v2 envelope the 0.3.0 serve CLI accepts), and the argv carries
10
+ * the CLI-only `--engine-bin` flag, so it stays fixed no matter how many
11
+ * settings the form offers. `deploy` builds the engine in the checkout (the
12
+ * acquisition build steps), downloads the `.basalt` model into the model
13
+ * directory, stamps the artifact path into the config entry, writes the
14
+ * config file, and spawns the serve command.
15
+ * `healthCheck` polls the health URL and reports the start phase from the
16
+ * tracked process output. `stop` signals the tracked process.
17
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltAdapter
18
+ */
19
+ import { basename, join } from 'node:path';
20
+ import { EngineAdapter, autoRebuildEnabled, dshConfigCacheDirectory, hfDownloadCommand, hubCacheSnapshotFilePath, modelArtifactPresent, modelDownloadTarget, repoIdFromUrl, } from '../../../../core/lib/index.js';
21
+ import { auditRun, configFileFromSpecs, nodeLifecycleHost, pollHealth, resolveLaunchArgv, stopProcessPlan, trackChild, } from "../../adapters.js";
22
+ import { engineBuildDir, syncEngineForDeploy } from "../../acquire.js";
23
+ import { defaultModelFor, defaultModelsForEngine } from "../../model-defaults.js";
24
+ import { BASALT_CONFIG_VERSION, BASALT_DEFAULT_MODEL_ID, BASALT_DEFAULT_PORT, BASALT_MODEL_FILE, BASALT_MODEL_REPO, BASALT_PARAMETERS, basaltModelKey, basaltServedName, } from "./basalt.js";
25
+ import { basaltLinuxBinary } from "./basaltLinux.js";
26
+ import { basaltMacOSBinary } from "./basaltMacOS.js";
27
+ import { basaltWindowsBinary } from "./basaltWindows.js";
28
+ /**
29
+ * The Basalt engine binary is OS-specific (the .exe on Windows, where the
30
+ * Ninja/MSVC route writes the Release binary), so the launch binary comes
31
+ * from the host OS's binary function. The adapter's renderLaunch reads this
32
+ * map by the hardware profile's os, keeping the per-OS name in its own OS
33
+ * file.
34
+ */
35
+ const BASALT_BINARY = {
36
+ linux: basaltLinuxBinary,
37
+ macos: basaltMacOSBinary,
38
+ windows: basaltWindowsBinary,
39
+ };
40
+ // The repo and file the deploy step downloads live in the leaf basalt.ts
41
+ // module (the default model list imports them from there, so defining them
42
+ // here would close a circular edge). Re-exported so the existing
43
+ // `basaltAdapter` import path keeps working.
44
+ export { BASALT_MODEL_FILE, BASALT_MODEL_REPO } from "./basalt.js";
45
+ /**
46
+ * The config file name the deploy step writes. It lands in the plugin's
47
+ * config cache home in the per-engine subdirectory (Basalt takes the path
48
+ * via `--config`, so it carries no placement requirement of its own), never
49
+ * the model directory, the hub cache, or the engine checkout.
50
+ */
51
+ export const BASALT_CONFIG_FILE = 'basalt_config.json';
52
+ /**
53
+ * basaltConfigContent renders the spec surface and seals it into the v2
54
+ * envelope the 0.3.0 serve CLI accepts: the version stamp plus the three
55
+ * blocks, in the key order upstream documents. The surface's raw `model`
56
+ * value is a registry key or file name, but the entry must carry an absolute
57
+ * artifact path, so the single models entry is restamped with the
58
+ * download-target placeholder before the envelope is sealed (the deploy step
59
+ * replaces it with the concrete artifact path after the model download). The
60
+ * entry also carries the deterministic API name as `alias`:
61
+ * without one the server reports the artifact's stored `meta.name`, which
62
+ * the plugin cannot know for arbitrary packs, so the entry stamps the same
63
+ * basaltServedName string modelRef publishes and `/v1/models` always lists
64
+ * what DSH routes to.
65
+ */
66
+ function basaltConfigContent(config, modelPath, modelFile) {
67
+ const blocks = JSON.parse(configFileFromSpecs(BASALT_PARAMETERS, config, 'json'));
68
+ return JSON.stringify({
69
+ version: BASALT_CONFIG_VERSION,
70
+ models: [{ ...blocks.models?.[0], model: modelPath, alias: basaltServedName(modelFile) }],
71
+ engine: blocks.engine ?? {},
72
+ server: blocks.server ?? {},
73
+ }, null, 2);
74
+ }
75
+ /**
76
+ * basaltModelFileName resolves the `.basalt` artifact file name a config's
77
+ * model field names: a value that is already a `.basalt` file name (a
78
+ * directory-scan selection) passes through; a registry key (a default-model
79
+ * selection, e.g. `qwen38-flash-next`) maps to its artifact file through the
80
+ * default model list; and a bare config falls back to the engine's default
81
+ * artifact. The deploy step resolves the file name to the concrete artifact
82
+ * path after the model download.
83
+ */
84
+ function basaltModelFileName(modelValue) {
85
+ if (modelValue !== '' && modelValue.endsWith('.basalt'))
86
+ return modelValue;
87
+ const entry = modelValue === '' ? undefined : defaultModelFor('basalt', modelValue);
88
+ return entry?.file ?? BASALT_MODEL_FILE;
89
+ }
90
+ /**
91
+ * basaltDownloadEntry resolves the model download source whose Hugging Face
92
+ * repo a `.basalt` artifact downloads from: the entry the plan's modelId
93
+ * names (a registry-key selection), else the entry whose artifact file
94
+ * matches modelFile (a directory-scan pick of a listed artifact), else the
95
+ * default list entry (today's fallback for a custom `.basalt` file no list
96
+ * entry names). The resolved entry supplies only the repo URL (the
97
+ * download read), and the artifact being downloaded is stamped as `file`,
98
+ * so the presence check, the hf command, and the hub-cache lookup all read
99
+ * the resolved pair: the DeepSeek pack downloads from its own repo, not the
100
+ * hardcoded Qwen one.
101
+ */
102
+ function basaltDownloadEntry(modelId, modelFile) {
103
+ const byKey = modelId === '' ? undefined : defaultModelFor('basalt', modelId);
104
+ const entry = byKey ??
105
+ defaultModelsForEngine('basalt').find((item) => item.file === modelFile) ??
106
+ defaultModelFor('basalt', BASALT_DEFAULT_MODEL_ID);
107
+ // The bundled Qwen repo is the download home of a custom `.basalt` file
108
+ // no list entry names; the literal only remains reachable if the list
109
+ // lost its own default row.
110
+ const source = entry ?? { url: `https://huggingface.co/${BASALT_MODEL_REPO}` };
111
+ return { url: source.url, file: modelFile };
112
+ }
113
+ /**
114
+ * configContentWithModelPath returns config file content with the v2
115
+ * envelope's single models entry stamped with the concrete artifact path,
116
+ * replacing the renderLaunch placeholder. Content that is not a JSON object
117
+ * carrying a models array with at least one object entry (a hand-built plan,
118
+ * a plan carrying an unrelated payload) returns as-is: deploy still writes
119
+ * what the plan carries and never crashes.
120
+ */
121
+ function configContentWithModelPath(content, modelPath) {
122
+ let envelope;
123
+ try {
124
+ envelope = JSON.parse(content);
125
+ }
126
+ catch {
127
+ return content;
128
+ }
129
+ const models = envelope !== null && typeof envelope === 'object'
130
+ ? envelope.models
131
+ : undefined;
132
+ if (!Array.isArray(models) ||
133
+ models.length === 0 ||
134
+ models[0] === null ||
135
+ typeof models[0] !== 'object') {
136
+ return content;
137
+ }
138
+ models[0] = { ...models[0], model: modelPath };
139
+ return JSON.stringify(envelope, null, 2);
140
+ }
141
+ /**
142
+ * BasaltAdapter is the Basalt engine. `renderLaunch` renders a
143
+ * `basalt serve --config --engine-bin` process plan (the settings and the
144
+ * served model ride the versioned config file; the argv carries the CLI-only
145
+ * `--engine-bin` flag); `deploy` builds the engine, downloads the model,
146
+ * stamps the artifact path into the config entry, writes the config file,
147
+ * and spawns the serve command; `healthCheck` polls the health URL and
148
+ * reports the start phase from the tracked process output; `stop` signals
149
+ * the tracked process.
150
+ */
151
+ export class BasaltAdapter extends EngineAdapter {
152
+ id = 'basalt';
153
+ supports = { docker: false, local: true };
154
+ host;
155
+ children = new Map();
156
+ constructor(host = nodeLifecycleHost) {
157
+ super();
158
+ this.host = host;
159
+ }
160
+ parameters() {
161
+ return BASALT_PARAMETERS;
162
+ }
163
+ modelRef(config) {
164
+ // The serve server answers to the config entry's `alias` (and to the
165
+ // artifact's own file name), so the registrar publishes exactly the
166
+ // name renderLaunch stamps into the entry: basaltServedName resolves it
167
+ // from the artifact file the config names (basaltModelFileName: registry
168
+ // key, .basalt path, or the engine default). A bare config, the Qwen
169
+ // registry key, and the bundled file name all publish the Qwen served
170
+ // id; the DeepSeek key and file publish `DeepSeek-V4.1-Flash`; any
171
+ // other `.basalt` pick publishes its file name, which the engine also
172
+ // accepts. The chat turn then routes to a name the engine lists.
173
+ const served = basaltServedName(basaltModelFileName(basaltModelKey(config)));
174
+ return { id: served, name: served };
175
+ }
176
+ modelInput(config) {
177
+ // The vision control gates the image input. off (the default) reads no
178
+ // pictures; every other value (dynamic, cpu, a pinned GPU number spelled
179
+ // as a string or a number) does.
180
+ const vision = config.vision;
181
+ if (typeof vision === 'number') {
182
+ return ['text', 'image'];
183
+ }
184
+ if (typeof vision === 'string' && vision !== '' && vision !== 'off') {
185
+ return ['text', 'image'];
186
+ }
187
+ return ['text'];
188
+ }
189
+ launchSignature(config = {}) {
190
+ // The local plan runs the basalt binary, so the binary name is the
191
+ // command-line marker the reserve probe matches on. The serve CLI binds
192
+ // the port from the basalt_config.json server block, so the argv never
193
+ // carries the number; the port stays the model-tie key for the
194
+ // launched-models map.
195
+ const port = this.port(config);
196
+ return { binary: 'basalt', port, portInArgv: false };
197
+ }
198
+ renderLaunch(config, _hw) {
199
+ const port = this.port(config);
200
+ const modelDirectory = typeof config.modelDirectory === 'string' ? config.modelDirectory : '';
201
+ // The config file lands in the plugin's config cache home in the
202
+ // per-engine subdirectory, never the model directory, the hub cache, or
203
+ // the engine's git checkout: Basalt takes the path via --config, so it
204
+ // carries no placement requirement of its own.
205
+ const configPath = join(dshConfigCacheDirectory(), this.id, BASALT_CONFIG_FILE);
206
+ // The model artifact placeholder still rides the download target base
207
+ // directory (the hub-cache root for the default layout, the user model
208
+ // directory for an override).
209
+ const { baseDir } = modelDownloadTarget(modelDirectory);
210
+ // The engine binary is OS-specific (the .exe on Windows), so the name
211
+ // comes from the host OS's binary function. CMake writes it into the
212
+ // profile's buildDir (the repo's bin/ folder), so the launch spells it as
213
+ // a build-tree relative path. The deploy step joins it against the engine
214
+ // directory, so the spawn resolves the real binary without relying on the
215
+ // PATH (a bare name would ENOENT when the rebuild's symlink step has not
216
+ // put it on the path).
217
+ const binary = BASALT_BINARY[_hw.os]();
218
+ const buildDir = engineBuildDir(this.id, _hw.os);
219
+ const binaryPath = buildDir === '' ? binary : join(buildDir, binary);
220
+ // The .basalt artifact the engine serves, resolved from config.model (a
221
+ // registry key, a .basalt file name, or the engine default). It stamps
222
+ // both the config entry's `model` placeholder and the plan's modelFile
223
+ // field, so the deploy step downloads exactly the file the entry names
224
+ // without re-parsing the rendered config. The entry value is a
225
+ // placeholder the deploy step resolves to the concrete artifact path
226
+ // after the model download (the flat join for a user model directory,
227
+ // the hub-cache snapshot path for the default layout). Upstream refuses
228
+ // a model entry without a `model`, so the stamp below never leaves the
229
+ // entry empty.
230
+ const modelValue = basaltModelKey(config);
231
+ const modelFile = basaltModelFileName(modelValue);
232
+ const modelPath = join(baseDir, modelFile);
233
+ // The config file is the sealed v2 envelope (the entry's `model` carries
234
+ // this placeholder path, restamped by deploy after the download).
235
+ const configContent = basaltConfigContent(config, modelPath, modelFile);
236
+ return {
237
+ engineId: this.id,
238
+ kind: 'process',
239
+ // The serve CLI takes every setting and the model from the config
240
+ // file, so the argv stays fixed. --engine-bin is CLI-only (refused in
241
+ // the config file): it pins the build-tree binary the first token
242
+ // already names.
243
+ argv: [binaryPath, 'serve', '--config', configPath, '--engine-bin', binaryPath],
244
+ env: {},
245
+ ...(modelDirectory === '' ? {} : { modelDirectory }),
246
+ // The raw config.model value stamps the plan's modelId (a bare config
247
+ // names the engine's single default model), so the service's
248
+ // launched-models tie compares equal against the provider's stored
249
+ // config.model, the infernix pattern.
250
+ modelId: modelValue !== '' ? modelValue : BASALT_DEFAULT_MODEL_ID,
251
+ modelFile,
252
+ port,
253
+ healthUrl: `http://127.0.0.1:${port}/health`,
254
+ os: _hw.os,
255
+ // Every setting and the served model ride the v2 config file the
256
+ // deploy step writes; --engine-bin is the only argv addition.
257
+ configFile: {
258
+ path: configPath,
259
+ content: configContent,
260
+ },
261
+ };
262
+ }
263
+ async deploy(plan, platform, onProgress, options) {
264
+ if (plan.kind !== 'process') {
265
+ // Basalt renders process plans only; a docker or compose plan is a
266
+ // no-op.
267
+ return { ok: true };
268
+ }
269
+ const engineDir = platform?.engineDirectory;
270
+ let buildLogs = '';
271
+ // Auto Rebuild off (the card's checkbox): the git sync (fetch, rebase,
272
+ // rebuild) is skipped and the checkout launches as-is.
273
+ if (engineDir !== undefined && autoRebuildEnabled(options?.autoRebuild)) {
274
+ // The conditional rebuild fetches the checkout, prices it against the
275
+ // remote branch, and rebuilds only when it is behind (or a fresh
276
+ // clone). The decision, the build command, and its output are captured
277
+ // into buildLogs and threaded to the card's Logs section.
278
+ const sync = await syncEngineForDeploy(this.host, {
279
+ engineId: this.id,
280
+ directory: engineDir,
281
+ ...(platform !== undefined ? { platform } : {}),
282
+ ...(options !== undefined ? { options } : {}),
283
+ // The host OS the build steps pick for: a Windows host reads the
284
+ // engine's Windows build steps (the Ninja/MSVC route) when the user
285
+ // carries no build-command override.
286
+ ...(plan.os !== undefined ? { os: plan.os } : {}),
287
+ ...(onProgress !== undefined ? { onProgress } : {}),
288
+ });
289
+ buildLogs = sync.buildLogs;
290
+ if (!sync.ok) {
291
+ return { ok: false, detail: sync.detail ?? 'unknown', logs: buildLogs };
292
+ }
293
+ }
294
+ const withLogs = (result) => buildLogs !== '' ? { ...result, logs: buildLogs } : result;
295
+ // The .basalt model artifact the engine serves, downloaded into the model
296
+ // directory. The file name is the basename of the plan's modelFile
297
+ // (renderLaunch stamps it from config.model), so the download fetches
298
+ // exactly the file the config entry names. A bare config (no model
299
+ // directory) downloads into the hub cache (the hub-cache layout, no
300
+ // --local-dir); a user-overridden model directory keeps the flat
301
+ // --local-dir target. A model the shared Get-steps routine already
302
+ // downloaded is on disk, so the deploy step skips the re-fetch and a
303
+ // launch after a Get does no duplicate download.
304
+ const { baseDir, useHubCache } = modelDownloadTarget(plan.modelDirectory);
305
+ const modelFile = basename(plan.modelFile ?? BASALT_MODEL_FILE);
306
+ // The repo rides the default model list entry the plan resolves to (the
307
+ // modelId key or the artifact file), so each artifact downloads from its
308
+ // own repo.
309
+ const artifact = await this.ensureModelArtifact(basaltDownloadEntry(plan.modelId ?? '', modelFile), baseDir, useHubCache, onProgress, options?.onLog);
310
+ if (!artifact.ok) {
311
+ return withLogs({ ok: false, detail: artifact.detail });
312
+ }
313
+ // Upstream rejects --model beside --config, so the concrete artifact
314
+ // path lands in the config file's models entry (replacing the
315
+ // renderLaunch placeholder) instead of the argv. Stamping the plan keeps
316
+ // writeConfigFile and the launch record reading the one content the
317
+ // engine will see; a plan with no config file writes nothing, and content
318
+ // that is not a v2 envelope is written as-is.
319
+ if (plan.configFile !== undefined) {
320
+ plan.configFile.content = configContentWithModelPath(plan.configFile.content, artifact.path);
321
+ }
322
+ // Write the config file the plan names, so the engine's --config flag
323
+ // points at a path that exists.
324
+ const configFailure = await this.writeConfigFile(plan);
325
+ if (configFailure !== null) {
326
+ return withLogs({ ok: false, detail: configFailure });
327
+ }
328
+ // A relative launch path (a build-tree binary) is joined against the
329
+ // engine directory the spawn runs in, so the spawn resolves an absolute
330
+ // path. A bare name (the basalt binary, on the path after the rebuild's
331
+ // symlink step) is left as-is.
332
+ const resolvedArgv = resolveLaunchArgv(engineDir, plan.argv ?? []);
333
+ // The plan is the launch record's argv source (launchRecordFromPlan reads
334
+ // it), and the re-link rule substring-matches every record argv token
335
+ // against the live command line, so the record must name the spawn, not
336
+ // the build-tree relative binary.
337
+ plan.argv = resolvedArgv;
338
+ const handle = this.host.spawn(resolvedArgv, plan.env ?? {}, engineDir);
339
+ trackChild(this.children, this.planKey(plan), handle);
340
+ return withLogs({ ok: true, handle });
341
+ }
342
+ /**
343
+ * ensureModelArtifact downloads the `.basalt` model file named by the
344
+ * resolved download source (its repo URL plus artifact file) into the
345
+ * model directory and resolves the concrete path the engine serves. A
346
+ * model the Get-steps routine already downloaded is on disk, so the
347
+ * re-fetch is skipped; presence is the deterministic snapshot check
348
+ * (modelArtifactPresent), so a blob-only cache left by an interrupted
349
+ * download re-runs the cheap hf download (the CLI reuses the blobs and
350
+ * writes the snapshot links) instead of dead-ending on the later lookup.
351
+ * With the hub-cache layout the concrete path is the content-addressed
352
+ * snapshot path (only known after the download); with the flat layout it
353
+ * is the flat join. Returns the path, or a detail when the download fails
354
+ * or leaves no snapshot.
355
+ */
356
+ async ensureModelArtifact(entry, baseDir, useHubCache, onProgress, log) {
357
+ const modelFile = entry.file;
358
+ if (!modelArtifactPresent(entry, baseDir, useHubCache)) {
359
+ onProgress?.('download');
360
+ const download = await auditRun(this.host, hfDownloadCommand(entry, baseDir, useHubCache), log);
361
+ if (!download.ok) {
362
+ return { ok: false, detail: `model download failed: ${download.detail ?? 'unknown'}` };
363
+ }
364
+ }
365
+ if (useHubCache) {
366
+ // The hf CLI writes the content-addressed snapshots tree, whose commit
367
+ // directory is only known after the download. A download that left no
368
+ // snapshot (a failed or partial fetch the hf CLI reported as ok) leaves
369
+ // no artifact to serve.
370
+ const snapshotPath = hubCacheSnapshotFilePath(baseDir, repoIdFromUrl(entry.url), modelFile);
371
+ if (snapshotPath === null) {
372
+ return {
373
+ ok: false,
374
+ detail: `model artifact missing: ${modelFile} (no hub-cache snapshot after download)`,
375
+ };
376
+ }
377
+ return { ok: true, path: snapshotPath };
378
+ }
379
+ return { ok: true, path: join(baseDir, modelFile) };
380
+ }
381
+ /**
382
+ * writeConfigFile writes the config file the plan names, so the engine's
383
+ * --config flag points at a path that exists. renderLaunch renders the
384
+ * path absolute under the plugin's config cache home, and the host's
385
+ * writeFile mkdirs the parent before writing. Returns a failure detail (a
386
+ * host that cannot write files, a test stub) or null when the write
387
+ * succeeded or the plan names no config file.
388
+ */
389
+ async writeConfigFile(plan) {
390
+ if (plan.configFile === undefined)
391
+ return null;
392
+ if (this.host.writeFile === undefined) {
393
+ return 'the host cannot write the config file';
394
+ }
395
+ await this.host.writeFile(plan.configFile.path, plan.configFile.content);
396
+ return null;
397
+ }
398
+ async healthCheck(plan, options) {
399
+ // The health poll is the shared loop (a 200 is ready, the attempt cap
400
+ // times out). Basalt downloads its model in the deploy step, so the
401
+ // engine's own start has no download phase: a tracked process that is
402
+ // still coming up reads as starting, and a missing handle (no deploy
403
+ // tracked one) reads as failed. The tracked handle rides into the poll,
404
+ // so a child that exits (a crash) ends the poll early with the failed
405
+ // state the poll stamps.
406
+ const handle = this.children.get(this.planKey(plan));
407
+ const result = await pollHealth(this.host, plan, options, handle);
408
+ if (result.healthy) {
409
+ return { ...result, state: 'ready' };
410
+ }
411
+ if (result.state === 'failed') {
412
+ // The poll ended early because the tracked child exited: the process
413
+ // is gone, so the start reads as failed, not starting.
414
+ return result;
415
+ }
416
+ const state = handle !== undefined && (handle.logs ?? '') !== '' ? 'starting' : 'failed';
417
+ return { ...result, state };
418
+ }
419
+ async stop(plan, log) {
420
+ // The serve process is the tracked child: signal it and drop the entry,
421
+ // so a later stop never signals a pid a recycled process has taken over.
422
+ const handle = this.children.get(this.planKey(plan));
423
+ if (handle !== undefined) {
424
+ handle.kill();
425
+ this.children.delete(this.planKey(plan));
426
+ return;
427
+ }
428
+ // No tracked child (an engine a DSH restart re-adopted): signal the pid
429
+ // the stored launch record stamped on the plan, so the stop reaches a
430
+ // process this adapter instance did not spawn.
431
+ await stopProcessPlan(this.host, plan, log);
432
+ }
433
+ port(config) {
434
+ // The port the basalt serve CLI binds by default, so a bare config
435
+ // launches on it.
436
+ return typeof config.port === 'number' ? config.port : BASALT_DEFAULT_PORT;
437
+ }
438
+ }
439
+ //# sourceMappingURL=basaltAdapter.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The Basalt shared Linux build profile. Every Linux distro (Arch, Debian,
3
+ * Fedora) builds Basalt through the engine's own CMake route: configure a
4
+ * Release build into the `build` directory, then compile it. CMake sets the
5
+ * target's RUNTIME_OUTPUT_DIRECTORY to the repo's `bin` folder, so the
6
+ * `basalt` binary lands in `bin/`, not the CMake `build/` tree. The distro
7
+ * profiles reuse this profile, so a distro carries no build steps of its own.
8
+ *
9
+ * Basalt is Blackwell-only (sm_120): the engine is compiled for the NVIDIA
10
+ * Blackwell GPU, so the CUDA 13 toolkit and a C++20 compiler are hard
11
+ * requirements. The serve/ server's pip requirements install into the system
12
+ * Python, and the hf CLI downloads the .basalt model artifact.
13
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltLinux
14
+ */
15
+ import type { EngineOsProfile } from '../engineOs.ts';
16
+ export declare const BASALT_LINUX: EngineOsProfile;
17
+ /**
18
+ * basaltLinuxBinary returns the Basalt engine binary name on Linux: the plain
19
+ * `basalt` (no .exe). The name comes from the shared Linux profile, so the
20
+ * spelling has one home.
21
+ */
22
+ export declare function basaltLinuxBinary(): string;
23
+ //# sourceMappingURL=basaltLinux.d.ts.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The Basalt shared Linux build profile. Every Linux distro (Arch, Debian,
3
+ * Fedora) builds Basalt through the engine's own CMake route: configure a
4
+ * Release build into the `build` directory, then compile it. CMake sets the
5
+ * target's RUNTIME_OUTPUT_DIRECTORY to the repo's `bin` folder, so the
6
+ * `basalt` binary lands in `bin/`, not the CMake `build/` tree. The distro
7
+ * profiles reuse this profile, so a distro carries no build steps of its own.
8
+ *
9
+ * Basalt is Blackwell-only (sm_120): the engine is compiled for the NVIDIA
10
+ * Blackwell GPU, so the CUDA 13 toolkit and a C++20 compiler are hard
11
+ * requirements. The serve/ server's pip requirements install into the system
12
+ * Python, and the hf CLI downloads the .basalt model artifact.
13
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltLinux
14
+ */
15
+ import { SYSTEM_DEPS } from "../../systemDeps.js";
16
+ export const BASALT_LINUX = {
17
+ buildSteps: [
18
+ 'cmake -S {dir} -B {dir}/build -DCMAKE_BUILD_TYPE=Release && cmake --build {dir}/build -j',
19
+ ],
20
+ // The CMake target sets RUNTIME_OUTPUT_DIRECTORY to the repo's bin/ folder,
21
+ // so the basalt executable lands in bin/, not the CMake build/ tree.
22
+ buildDir: 'bin',
23
+ binary: 'basalt',
24
+ // The local build is the engine's own CMake route: the CMake toolchain, the
25
+ // C++20 compiler, the CUDA 13 toolkit (Blackwell-only), the serve/
26
+ // server's pip requirements in the system Python, and the hf CLI to
27
+ // download the model.
28
+ deps: [
29
+ SYSTEM_DEPS.cmake,
30
+ SYSTEM_DEPS.compiler,
31
+ SYSTEM_DEPS.cudaToolkit,
32
+ // The serve/ server is Python; its pip requirements land in the system
33
+ // Python the serve CLI falls back to, so the launch's health poll does not
34
+ // time out on a missing module import.
35
+ SYSTEM_DEPS.basaltPip,
36
+ SYSTEM_DEPS.hfCli,
37
+ ],
38
+ };
39
+ /**
40
+ * basaltLinuxBinary returns the Basalt engine binary name on Linux: the plain
41
+ * `basalt` (no .exe). The name comes from the shared Linux profile, so the
42
+ * spelling has one home.
43
+ */
44
+ export function basaltLinuxBinary() {
45
+ return BASALT_LINUX.binary ?? 'basalt';
46
+ }
47
+ //# sourceMappingURL=basaltLinux.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The Basalt macOS build profile. Basalt is Blackwell-only (sm_120), and macOS
3
+ * ships no NVIDIA Blackwell GPU, so the engine cannot run there; the hardware
4
+ * constraint on the `gpu` spec fires for every macOS host. The profile exists
5
+ * for registry completeness and reuses the shared Linux CMake route, so a
6
+ * macOS host reads the same build steps and toolchain list.
7
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltMacOS
8
+ */
9
+ import type { EngineOsProfile } from '../engineOs.ts';
10
+ export declare const BASALT_MACOS: EngineOsProfile;
11
+ /**
12
+ * basaltMacOSBinary returns the Basalt engine binary name on macOS: the plain
13
+ * `basalt` (no .exe), reusing the shared Linux route. The name comes from the
14
+ * shared Linux profile, so the spelling has one home.
15
+ */
16
+ export declare function basaltMacOSBinary(): string;
17
+ //# sourceMappingURL=basaltMacOS.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The Basalt macOS build profile. Basalt is Blackwell-only (sm_120), and macOS
3
+ * ships no NVIDIA Blackwell GPU, so the engine cannot run there; the hardware
4
+ * constraint on the `gpu` spec fires for every macOS host. The profile exists
5
+ * for registry completeness and reuses the shared Linux CMake route, so a
6
+ * macOS host reads the same build steps and toolchain list.
7
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltMacOS
8
+ */
9
+ import { BASALT_LINUX, basaltLinuxBinary } from "./basaltLinux.js";
10
+ export const BASALT_MACOS = BASALT_LINUX;
11
+ /**
12
+ * basaltMacOSBinary returns the Basalt engine binary name on macOS: the plain
13
+ * `basalt` (no .exe), reusing the shared Linux route. The name comes from the
14
+ * shared Linux profile, so the spelling has one home.
15
+ */
16
+ export function basaltMacOSBinary() {
17
+ return basaltLinuxBinary();
18
+ }
19
+ //# sourceMappingURL=basaltMacOS.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The Basalt Windows build profile. The Windows route is the engine's own
3
+ * CMake build with the Ninja generator, run inside the MSVC developer shell:
4
+ * the step calls vcvars64.bat (the Visual Studio 2022 Community C++ toolchain)
5
+ * to put cl, cmake, and ninja on the path, then configures a Release build
6
+ * into the `build` directory and compiles it. CMake sets the target's
7
+ * RUNTIME_OUTPUT_DIRECTORY to the repo's `bin` folder, so the `basalt.exe`
8
+ * binary lands in `bin/`, not the CMake `build/` tree.
9
+ *
10
+ * The Windows toolchain is the winget route: CMake, Ninja (the -G Ninja
11
+ * generator), the Visual Studio C++ workload (the MSVC C++20 compiler), the
12
+ * CUDA 13 toolkit (Blackwell-only), the serve/ server's pip requirements in
13
+ * the system Python, and the hf CLI to download the model.
14
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltWindows
15
+ */
16
+ import type { EngineOsProfile } from '../engineOs.ts';
17
+ export declare const BASALT_WINDOWS: EngineOsProfile;
18
+ /**
19
+ * basaltWindowsBinary returns the Basalt launch binary on Windows: the plain
20
+ * `basalt.exe` the Windows build leaves in the `build` directory. The name
21
+ * comes from the Windows profile, so the .exe spelling has one home.
22
+ */
23
+ export declare function basaltWindowsBinary(): string;
24
+ //# sourceMappingURL=basaltWindows.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The Basalt Windows build profile. The Windows route is the engine's own
3
+ * CMake build with the Ninja generator, run inside the MSVC developer shell:
4
+ * the step calls vcvars64.bat (the Visual Studio 2022 Community C++ toolchain)
5
+ * to put cl, cmake, and ninja on the path, then configures a Release build
6
+ * into the `build` directory and compiles it. CMake sets the target's
7
+ * RUNTIME_OUTPUT_DIRECTORY to the repo's `bin` folder, so the `basalt.exe`
8
+ * binary lands in `bin/`, not the CMake `build/` tree.
9
+ *
10
+ * The Windows toolchain is the winget route: CMake, Ninja (the -G Ninja
11
+ * generator), the Visual Studio C++ workload (the MSVC C++20 compiler), the
12
+ * CUDA 13 toolkit (Blackwell-only), the serve/ server's pip requirements in
13
+ * the system Python, and the hf CLI to download the model.
14
+ * @module dsh-plugin-local-infer/providers/engines/basalt/basaltWindows
15
+ */
16
+ import { SYSTEM_DEPS } from "../../systemDeps.js";
17
+ export const BASALT_WINDOWS = {
18
+ buildSteps: [
19
+ 'cmd /c "call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" && cmake -S {dir} -B {dir}/build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build {dir}/build -j"',
20
+ ],
21
+ // The CMake target sets RUNTIME_OUTPUT_DIRECTORY to the repo's bin/ folder,
22
+ // so the basalt.exe lands in bin/, not the CMake build/ tree.
23
+ buildDir: 'bin',
24
+ binary: 'basalt.exe',
25
+ // The Windows local build is the winget route: the CMake toolchain, Ninja
26
+ // (the -G Ninja generator), the Visual Studio C++ workload (the MSVC C++20
27
+ // compiler), the CUDA 13 toolkit (Blackwell-only), the serve/ server's pip
28
+ // requirements in the system Python, and the hf CLI to download the model.
29
+ deps: [
30
+ SYSTEM_DEPS.cmake,
31
+ SYSTEM_DEPS.ninja,
32
+ SYSTEM_DEPS.visualStudio,
33
+ SYSTEM_DEPS.cudaToolkit,
34
+ // The serve/ server is Python; its pip requirements land in the system
35
+ // Python the serve CLI falls back to, so the launch's health poll does not
36
+ // time out on a missing module import.
37
+ SYSTEM_DEPS.basaltPip,
38
+ SYSTEM_DEPS.hfCli,
39
+ ],
40
+ };
41
+ /**
42
+ * basaltWindowsBinary returns the Basalt launch binary on Windows: the plain
43
+ * `basalt.exe` the Windows build leaves in the `build` directory. The name
44
+ * comes from the Windows profile, so the .exe spelling has one home.
45
+ */
46
+ export function basaltWindowsBinary() {
47
+ return BASALT_WINDOWS.binary ?? 'basalt.exe';
48
+ }
49
+ //# sourceMappingURL=basaltWindows.js.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * EngineOsProfile is the per-engine, per-OS build configuration: the build
3
+ * steps run in the checkout (the `{dir}` placeholder is substituted before a
4
+ * step runs), the directory, relative to the checkout, where the build leaves
5
+ * the engine binary, the binary name on this OS (the .exe on Windows), and the
6
+ * shell the build steps run in (absent runs the host's default shell).
7
+ *
8
+ * The profile is the single source the acquisition build step, the platform
9
+ * defaults, and the binary symlink step read, so a build command and its
10
+ * output directory have one home. The distro-specific Linux profiles (Arch,
11
+ * Debian, Fedora) reuse the shared Linux profile, so they carry no build steps
12
+ * of their own. The optional deps list carries the host build dependencies the
13
+ * platform's local build needs.
14
+ * @module dsh-plugin-local-infer/providers/engines/engineOs
15
+ */
16
+ import type { SystemDep } from '../../../core/lib/index.js';
17
+ export interface EngineOsProfile {
18
+ buildSteps: readonly string[];
19
+ buildDir?: string;
20
+ binary?: string;
21
+ shell?: string;
22
+ deps?: readonly SystemDep[];
23
+ }
24
+ //# sourceMappingURL=engineOs.d.ts.map