dsh-plugin-local-infer 0.1.3 → 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 (250) hide show
  1. package/README.md +22 -4
  2. package/cordis.patch.yml +7 -0
  3. package/docs/zh/README.md +14 -2
  4. package/dsh/client.js +4195 -4522
  5. package/package.json +28 -11
  6. package/packages/core/lib/adapter.d.ts +133 -9
  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 +44 -17
  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 +20 -9
  41. package/packages/core/lib/registrar.js +27 -7
  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 +92 -14
  59. package/packages/providers/lib/acquire.js +215 -37
  60. package/packages/providers/lib/adapters.d.ts +136 -12
  61. package/packages/providers/lib/adapters.js +597 -70
  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 +27 -230
  65. package/packages/providers/lib/deps.js +61 -214
  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/engines/{hyperqwen.d.ts → hyperqwen/hyperqwen.d.ts} +2 -2
  79. package/packages/providers/lib/engines/{hyperqwen.js → hyperqwen/hyperqwen.js} +14 -2
  80. package/packages/providers/lib/engines/{hyperqwenAdapter.d.ts → hyperqwen/hyperqwenAdapter.d.ts} +6 -6
  81. package/packages/providers/lib/engines/{hyperqwenAdapter.js → hyperqwen/hyperqwenAdapter.js} +24 -14
  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/engines/{infernix.d.ts → infernix/infernix.d.ts} +7 -4
  95. package/packages/providers/lib/engines/{infernix.js → infernix/infernix.js} +52 -7
  96. package/packages/providers/lib/engines/{infernixAdapter.d.ts → infernix/infernixAdapter.d.ts} +5 -6
  97. package/packages/providers/lib/engines/{infernixAdapter.js → infernix/infernixAdapter.js} +75 -42
  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/engines/{llamacpp.d.ts → llamacpp/llamacpp.d.ts} +2 -2
  111. package/packages/providers/lib/engines/{llamacpp.js → llamacpp/llamacpp.js} +12 -2
  112. package/packages/providers/lib/engines/{llamacppAdapter.d.ts → llamacpp/llamacppAdapter.d.ts} +5 -6
  113. package/packages/providers/lib/engines/{llamacppAdapter.js → llamacpp/llamacppAdapter.js} +87 -45
  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/engines/{ninfer.d.ts → ninfer/ninfer.d.ts} +2 -2
  127. package/packages/providers/lib/engines/{ninfer.js → ninfer/ninfer.js} +24 -2
  128. package/packages/providers/lib/engines/{ninferAdapter.d.ts → ninfer/ninferAdapter.d.ts} +5 -6
  129. package/packages/providers/lib/engines/{ninferAdapter.js → ninfer/ninferAdapter.js} +123 -55
  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.js → strata/strata.js} +70 -3
  144. package/packages/providers/lib/engines/{strataAdapter.d.ts → strata/strataAdapter.d.ts} +5 -6
  145. package/packages/providers/lib/engines/{strataAdapter.js → strata/strataAdapter.js} +147 -111
  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 +7 -5
  159. package/packages/providers/lib/engines.js +21 -10
  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 -29
  163. package/packages/providers/lib/index.js +45 -33
  164. package/packages/providers/lib/model-defaults.d.ts +5 -1
  165. package/packages/providers/lib/model-defaults.js +25 -1
  166. package/packages/providers/lib/platform.d.ts +8 -5
  167. package/packages/providers/lib/platform.js +23 -9
  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 +176 -21
  176. package/packages/service/lib/index.js +589 -86
  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 +163 -6
  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 +12 -2
  188. package/packages/ui/lib/config.js +18 -2
  189. package/packages/ui/lib/deps.d.ts +1 -1
  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 +142 -34
  198. package/packages/ui/lib/ops/engine.js +469 -265
  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 +26 -11
  202. package/packages/ui/lib/ops/hf.js +115 -25
  203. package/packages/ui/lib/ops/logs.d.ts +70 -15
  204. package/packages/ui/lib/ops/logs.js +96 -35
  205. package/packages/ui/lib/ops/model.d.ts +2 -10
  206. package/packages/ui/lib/ops/model.js +9 -16
  207. package/packages/ui/lib/request.d.ts +1 -1
  208. package/packages/ui/lib/request.js +1 -1
  209. package/packages/ui/lib/route.d.ts +22 -6
  210. package/packages/ui/lib/route.js +32 -9
  211. package/packages/ui/lib/routes/chat-template.d.ts +1 -14
  212. package/packages/ui/lib/routes/chat-template.js +1 -37
  213. package/packages/ui/lib/routes/deps.d.ts +1 -16
  214. package/packages/ui/lib/routes/deps.js +1 -27
  215. package/packages/ui/lib/routes/download.d.ts +1 -16
  216. package/packages/ui/lib/routes/download.js +1 -48
  217. package/packages/ui/lib/routes/get.d.ts +1 -18
  218. package/packages/ui/lib/routes/get.js +66 -17
  219. package/packages/ui/lib/routes/install.d.ts +1 -1
  220. package/packages/ui/lib/routes/install.js +1 -1
  221. package/packages/ui/lib/routes/launch.d.ts +13 -7
  222. package/packages/ui/lib/routes/launch.js +33 -9
  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 +1 -1
  226. package/packages/ui/lib/routes/provider-delete.js +1 -1
  227. package/packages/ui/lib/routes/register.d.ts +1 -1
  228. package/packages/ui/lib/routes/register.js +1 -1
  229. package/packages/ui/lib/routes/save.d.ts +1 -1
  230. package/packages/ui/lib/routes/save.js +22 -2
  231. package/packages/ui/lib/routes/stop.d.ts +7 -4
  232. package/packages/ui/lib/routes/stop.js +7 -4
  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 +1 -1
  236. package/packages/ui/lib/routes/summary.js +1 -1
  237. package/packages/ui/lib/routes/unregister.d.ts +1 -1
  238. package/packages/ui/lib/routes/unregister.js +1 -1
  239. package/packages/ui/lib/viewmodels/deps.d.ts +1 -31
  240. package/packages/ui/lib/viewmodels/deps.js +1 -89
  241. package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -28
  242. package/packages/ui/lib/viewmodels/depsHelpers.js +72 -11
  243. package/packages/ui/lib/viewmodels/summary.d.ts +7 -2
  244. package/packages/ui/lib/viewmodels/summary.js +55 -35
  245. package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +1 -1
  246. package/packages/ui/lib/viewmodels/summaryHelpers.js +1 -1
  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/engines/strata.d.ts +0 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-local-infer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -63,6 +63,11 @@
63
63
  "types": "./packages/ui/lib/index.d.ts",
64
64
  "default": "./packages/ui/lib/index.js"
65
65
  },
66
+ "./orchestrator": {
67
+ "types": "./packages/orchestrator/lib/index.d.ts",
68
+ "default": "./packages/orchestrator/lib/index.js"
69
+ },
70
+ "./orchestrator/locale/en.json": "./packages/orchestrator/locale/en.json",
66
71
  "./package.json": "./package.json"
67
72
  },
68
73
  "files": [
@@ -85,13 +90,18 @@
85
90
  "packages/tool/lib/**/*.d.ts",
86
91
  "packages/ui/package.json",
87
92
  "packages/ui/lib/**/*.js",
88
- "packages/ui/lib/**/*.d.ts"
93
+ "packages/ui/lib/**/*.d.ts",
94
+ "packages/orchestrator/package.json",
95
+ "packages/orchestrator/lib/**/*.js",
96
+ "packages/orchestrator/lib/**/*.d.ts",
97
+ "packages/orchestrator/prompt.md",
98
+ "packages/orchestrator/locale/en.json"
89
99
  ],
90
100
  "peerDependencies": {
91
- "@deepseek-ai/cordis": ">=4.0.5-alpha.2"
101
+ "@deepseek-ai/cordis": ">=4.0.6-alpha.2"
92
102
  },
93
103
  "scripts": {
94
- "build": "tsc -b",
104
+ "build": "tsc -b && node scripts/build-client.mjs && node scripts/build-format.mjs",
95
105
  "typecheck": "tsc -b",
96
106
  "test": "vitest run",
97
107
  "test:coverage": "vitest run --coverage",
@@ -100,13 +110,20 @@
100
110
  },
101
111
  "devDependencies": {
102
112
  "@eslint/js": "^10.0.1",
103
- "@types/node": "^22.10.0",
104
- "@vitest/coverage-v8": "^5.0.4",
105
- "eslint": "^10.12.0",
113
+ "@types/node": "^26.6.6",
114
+ "@types/react": "^18.3.31",
115
+ "@types/react-dom": "^18.3.7",
116
+ "@vitest/coverage-v8": "^5.0.5",
117
+ "esbuild": "^0.28.2",
118
+ "eslint": "^10.14.0",
119
+ "eslint-plugin-react-hooks": "^7.1.1",
120
+ "jsdom": "^30.1.3",
121
+ "react": "^18.2.0",
122
+ "react-dom": "^18.3.1",
106
123
  "tsx": "^4.23.15",
107
- "typescript": "^5.9.0",
108
- "typescript-eslint": "^8.71.2",
109
- "vite-tsconfig-paths": "^5.1.4",
110
- "vitest": "^5.0.4"
124
+ "typescript": "^5.9.3",
125
+ "typescript-eslint": "^8.72.1",
126
+ "vitest": "^5.0.5",
127
+ "yaml": "^2.4.2"
111
128
  }
112
129
  }
@@ -32,8 +32,15 @@ export interface LaunchPlan {
32
32
  containerName?: string;
33
33
  modelId?: string;
34
34
  modelDirectory?: string;
35
+ modelFile?: string;
35
36
  port: number;
36
37
  healthUrl: string;
38
+ os?: 'linux' | 'windows' | 'macos';
39
+ configFile?: {
40
+ path: string;
41
+ content: string;
42
+ };
43
+ pid?: number;
37
44
  }
38
45
  /**
39
46
  * EnginePlatformConfig is the per-engine platform config the user adds for a
@@ -77,13 +84,19 @@ export interface ProcessExitInfo {
77
84
  * fired once with the ProcessExitInfo when the child ends (a crash, a signal
78
85
  * like a pkill, or a clean stop); a listener registered after the child has
79
86
  * already ended fires immediately. A host that cannot watch (a stub, or a
80
- * container it cannot read) omits it.
87
+ * container it cannot read) omits it. `hasExited`, when the host tracks the
88
+ * child's exit state, reports whether the child has settled (exited, been
89
+ * signalled, or failed to spawn): a state read a poll can check between
90
+ * attempts, separate from the one-shot onExit listener. A handle that cannot
91
+ * report its exit state (a stub) omits it, and a caller that cannot check
92
+ * falls back to the full poll.
81
93
  */
82
94
  export interface ProcessHandle {
83
95
  pid: number;
84
96
  kill(): void;
85
97
  logs?: string;
86
98
  onExit?(listener: (exit: ProcessExitInfo) => void): void;
99
+ hasExited?(): boolean;
87
100
  }
88
101
  /**
89
102
  * FetchResult is the answer to a health poll: the HTTP status and whether it
@@ -93,6 +106,24 @@ export interface FetchResult {
93
106
  status: number;
94
107
  ok: boolean;
95
108
  }
109
+ /**
110
+ * RunOptions tunes a host command run: `shell` names the shell the command
111
+ * line runs in, read from the engine OS profile (the Windows vcpkg build route
112
+ * names pwsh.exe, because its steps set $env: variables). Absent runs
113
+ * the host's default shell. `signal` is the card's cancel: an abort kills the
114
+ * in-flight child (SIGINT, then SIGTERM), so a canceled Get/Launch download
115
+ * stops instead of running on behind the card. `graceMs` overrides the 5 s
116
+ * SIGTERM escalation window of that abort path, so a test can exercise the
117
+ * escalation without waiting. `needsSudo` declares that the command line runs
118
+ * sudo, stated by the caller (a hand-written link line), never parsed from
119
+ * the command text; the host applies the sudo-prompt rule to a declared run.
120
+ */
121
+ export interface RunOptions {
122
+ shell?: string;
123
+ signal?: AbortSignal;
124
+ graceMs?: number;
125
+ needsSudo?: boolean;
126
+ }
96
127
  /**
97
128
  * LifecycleHost is the injectable execution surface an adapter drives its
98
129
  * deploy, health-check, and stop steps through. The providers ship a node
@@ -102,7 +133,7 @@ export interface FetchResult {
102
133
  * DSH debug mode captures the full build-to-launch sequence the plugin runs.
103
134
  */
104
135
  export interface LifecycleHost {
105
- run(command: string): Promise<CommandOutcome>;
136
+ run(command: string, options?: RunOptions): Promise<CommandOutcome>;
106
137
  /**
107
138
  * Optional: run a command line and stream each stdout/stderr chunk to
108
139
  * onOutput while it runs, so the Get step can append build output to the
@@ -111,8 +142,16 @@ export interface LifecycleHost {
111
142
  * build legitimately runs past any fixed cap, and the card prices a
112
143
  * stalled step with its own output-idle watchdog.
113
144
  */
114
- runStream?(command: string, onOutput: (chunk: string) => void): Promise<CommandOutcome>;
145
+ runStream?(command: string, onOutput: (chunk: string) => void, options?: RunOptions): Promise<CommandOutcome>;
115
146
  spawn(argv: readonly string[], env: Record<string, string>, cwd?: string): ProcessHandle;
147
+ /**
148
+ * Optional: write a file to the host, creating missing parent directories.
149
+ * The deploy step calls it to land the rendered config file the plan's
150
+ * `configFile` names before the spawn, so the engine's config flag points
151
+ * at a path that exists. A host that cannot write files (a test stub)
152
+ * omits it, and the deploy step skips the write without failing.
153
+ */
154
+ writeFile?(path: string, content: string): Promise<void>;
116
155
  fetch(url: string): Promise<FetchResult>;
117
156
  debug?: DebugLogger;
118
157
  }
@@ -120,10 +159,16 @@ export interface LifecycleHost {
120
159
  * HealthCheckOptions tunes the poll: the interval between attempts and the
121
160
  * attempt cap. The service passes the config's healthPollMs and
122
161
  * healthMaxAttempts through; the adapter's defaults keep a bare call working.
162
+ * `onLog` is the launch run's log sink (the same sink LaunchOptions and
163
+ * DeployOptions carry): the health poll writes its `> GET <healthUrl>` line
164
+ * through it once before the first request and the settled verdict after, so
165
+ * the live run reads what the poll is waiting for. Absent (a headless poll)
166
+ * and the poll runs without logging.
123
167
  */
124
168
  export interface HealthCheckOptions {
125
169
  pollMs?: number;
126
170
  maxAttempts?: number;
171
+ onLog?: CommandLogger;
127
172
  }
128
173
  /**
129
174
  * LaunchStep is the phase of a launch the card's Launch control prices: the
@@ -135,13 +180,59 @@ export interface HealthCheckOptions {
135
180
  * rebuild. The card times out only the launch step; the rebuild steps (prereqs,
136
181
  * download, build) run as long as they need to.
137
182
  */
138
- export type LaunchStep = 'prereqs' | 'download' | 'build' | 'launch';
183
+ /**
184
+ * LAUNCH_STEPS is the step-name tuple the LaunchStep union derives from: the
185
+ * one runtime home of the four phase names. The client machine mirrors the
186
+ * tuple as its LAUNCH_PHASE_STATES (the card bundle carries no core code); the
187
+ * ui suite pins the two sides equal so a name added on one side without the
188
+ * other fails a test, not the button.
189
+ */
190
+ export declare const LAUNCH_STEPS: readonly ["prereqs", "download", "build", "launch"];
191
+ /** The LaunchStep union, derived from the LAUNCH_STEPS tuple. */
192
+ export type LaunchStep = (typeof LAUNCH_STEPS)[number];
139
193
  /**
140
194
  * LaunchProgress is the callback the launch flow calls as each phase begins.
141
195
  * The route threads it from the streamed launch response through the service
142
196
  * and the adapter's deploy step; a launch with no progress sink omits it.
143
197
  */
144
198
  export type LaunchProgress = (step: LaunchStep) => void;
199
+ /**
200
+ * CommandLogger receives the `$ <command>` line of each mutating command the
201
+ * deploy and stop steps run, before the child spawns, so the run's log reads
202
+ * command first and the CLI's output after. The launch and stop run paths
203
+ * thread their run-log sink through this seam; a caller with no run log (a
204
+ * headless service call) passes none and the steps run as they did before.
205
+ */
206
+ export type CommandLogger = (line: string) => void;
207
+ /**
208
+ * COMMAND_LOG_PREFIX leads the exec audit rule's command line in every run
209
+ * log: `$ ` then the command, newline-terminated. Every exec site (the service
210
+ * runners, the adapters' auditRun, the acquire step's echo, the Get steps'
211
+ * extra-command emit) formats through commandLogLine, so the marker has one
212
+ * home. The marker is also exported for the test stubs that replay a real
213
+ * service or runner's writes.
214
+ */
215
+ export declare const COMMAND_LOG_PREFIX = "$ ";
216
+ /**
217
+ * commandLogLine formats one exec audit rule line: the COMMAND_LOG_PREFIX, the
218
+ * command, and the newline. The `$ <command>` line reaches the run's log sink
219
+ * before the child spawns.
220
+ */
221
+ export declare function commandLogLine(command: string): string;
222
+ /**
223
+ * URL_LOG_PREFIX leads the URL audit rule's request line in every run log:
224
+ * `> GET ` then the URL. The health polls format through urlLogLine, so the
225
+ * marker has one home (the exec rule's URL twin).
226
+ */
227
+ export declare const URL_LOG_PREFIX = "> GET ";
228
+ /**
229
+ * urlLogLine formats one URL audit rule line: the URL_LOG_PREFIX, the URL, an
230
+ * optional settled verdict word the poll appends after a space (`ready`,
231
+ * `still downloading: ...`), and the newline. The bare line reaches the run's
232
+ * log sink before the first request; the verdict line lands after the poll
233
+ * returns.
234
+ */
235
+ export declare function urlLogLine(url: string, verdict?: string): string;
145
236
  /**
146
237
  * EngineLaunchState is the phase of an engine start the health poll reports:
147
238
  * downloading (the engine is fetching its engine or model files, the health
@@ -169,14 +260,33 @@ export interface HealthResult {
169
260
  * rebuilds the engine and leaves its binary out of the path links it into
170
261
  * /usr/local/bin; the gate decides whether that sudo link runs (on) or is
171
262
  * written to the card's Logs section for the user to run (off). `autoRebuild`
172
- * is the card's "Auto Rebuild" checkbox: when false, the git sync (fetch,
173
- * rebase, and the conditional rebuild) is skipped and the checkout launches
174
- * as-is. Absent reads as true (the rebuild runs).
263
+ * is the card's "Auto Rebuild" checkbox: when false, the engine acquisition
264
+ * steps (the git sync with its fetch, rebase, and conditional rebuild, the
265
+ * docker image pull, and the Strata binary installer) are skipped and the
266
+ * already-present checkout, image, or binary launches as-is. Absent reads as
267
+ * true (the acquisition runs), the rule every guard prices through
268
+ * autoRebuildEnabled. `onLog` is the launch run's
269
+ * log sink: a deploy that runs a mutating command (an image pull, a model
270
+ * download) writes its `$ <command>` line through it before the child spawns,
271
+ * so the launch's live run reads the command first. Absent (a headless
272
+ * launch) and the deploy runs without logging them.
175
273
  */
176
274
  export interface DeployOptions {
177
275
  allowRunDeps?: boolean;
178
276
  autoRebuild?: boolean;
277
+ onLog?: CommandLogger;
179
278
  }
279
+ /**
280
+ * autoRebuildEnabled reports whether a launch's engine acquisition steps
281
+ * (the git sync with its conditional rebuild, the docker image pull, the
282
+ * Strata binary installer, the compose `--pull` mode, the Get steps'
283
+ * sync/build skip) run: the card's Auto Rebuild flag, with only an explicit
284
+ * false disabling them so the already-present checkout, image, or binary
285
+ * launches as-is. An absent flag (a CLI launch, a legacy caller) reads as
286
+ * enabled. Every guard prices the flag through this one predicate, so the
287
+ * absent-means-enabled rule cannot drift between adapters.
288
+ */
289
+ export declare function autoRebuildEnabled(autoRebuild?: boolean): boolean;
180
290
  /**
181
291
  * DeployResult reports whether a build-or-pull succeeded, with a detail for the
182
292
  * UI. `handle` is the spawned engine process when the deploy step started one
@@ -215,7 +325,14 @@ export declare abstract class EngineAdapter {
215
325
  abstract renderLaunch(config: Config, hw: HardwareProfile): LaunchPlan;
216
326
  abstract healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
217
327
  abstract deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
218
- abstract stop(plan: LaunchPlan): Promise<void>;
328
+ /**
329
+ * stop signals the engine the plan names. The optional `log` is the stop
330
+ * run's log sink: an adapter that stops through a command (compose down,
331
+ * docker stop, a pid signal) writes its `$ <command>` line through it
332
+ * before the child runs, so the stop's live run reads the command first.
333
+ * An adapter that only signals a tracked handle logs nothing.
334
+ */
335
+ abstract stop(plan: LaunchPlan, log?: CommandLogger): Promise<void>;
219
336
  /**
220
337
  * Optional: the host deps this engine's deploy step needs for a build mode,
221
338
  * declared by the adapter that knows its own toolchain. The service asks a
@@ -265,5 +382,12 @@ export declare abstract class EngineAdapter {
265
382
  * process omits it, and the reserve falls back to the GPU-usage rule.
266
383
  */
267
384
  launchSignature?(config?: Config): EngineLaunchSignature | undefined;
385
+ /**
386
+ * planKey is the children-map key an adapter tracks a spawned engine
387
+ * process under: the plan's engine id and port, the pair that identifies
388
+ * one running engine. The base class owns the rule, so every adapter
389
+ * tracks and stops the exact process it started.
390
+ */
391
+ protected planKey(plan: LaunchPlan): string;
268
392
  }
269
- //# sourceMappingURL=adapter.d.ts.map
393
+ //# sourceMappingURL=adapter.d.ts.map
@@ -1,3 +1,67 @@
1
+ /**
2
+ * LaunchStep is the phase of a launch the card's Launch control prices: the
3
+ * system-dependency install (prereqs), the model and git checkout download
4
+ * (download), the source build or image pull (build), and the health poll that
5
+ * waits for the engine to come ready (launch). The service and the adapters
6
+ * report the step as each phase begins, so the card's button reads the phase
7
+ * that is actually running instead of a single "Launching..." for the whole
8
+ * rebuild. The card times out only the launch step; the rebuild steps (prereqs,
9
+ * download, build) run as long as they need to.
10
+ */
11
+ /**
12
+ * LAUNCH_STEPS is the step-name tuple the LaunchStep union derives from: the
13
+ * one runtime home of the four phase names. The client machine mirrors the
14
+ * tuple as its LAUNCH_PHASE_STATES (the card bundle carries no core code); the
15
+ * ui suite pins the two sides equal so a name added on one side without the
16
+ * other fails a test, not the button.
17
+ */
18
+ export const LAUNCH_STEPS = ['prereqs', 'download', 'build', 'launch'];
19
+ /**
20
+ * COMMAND_LOG_PREFIX leads the exec audit rule's command line in every run
21
+ * log: `$ ` then the command, newline-terminated. Every exec site (the service
22
+ * runners, the adapters' auditRun, the acquire step's echo, the Get steps'
23
+ * extra-command emit) formats through commandLogLine, so the marker has one
24
+ * home. The marker is also exported for the test stubs that replay a real
25
+ * service or runner's writes.
26
+ */
27
+ export const COMMAND_LOG_PREFIX = '$ ';
28
+ /**
29
+ * commandLogLine formats one exec audit rule line: the COMMAND_LOG_PREFIX, the
30
+ * command, and the newline. The `$ <command>` line reaches the run's log sink
31
+ * before the child spawns.
32
+ */
33
+ export function commandLogLine(command) {
34
+ return `${COMMAND_LOG_PREFIX}${command}\n`;
35
+ }
36
+ /**
37
+ * URL_LOG_PREFIX leads the URL audit rule's request line in every run log:
38
+ * `> GET ` then the URL. The health polls format through urlLogLine, so the
39
+ * marker has one home (the exec rule's URL twin).
40
+ */
41
+ export const URL_LOG_PREFIX = '> GET ';
42
+ /**
43
+ * urlLogLine formats one URL audit rule line: the URL_LOG_PREFIX, the URL, an
44
+ * optional settled verdict word the poll appends after a space (`ready`,
45
+ * `still downloading: ...`), and the newline. The bare line reaches the run's
46
+ * log sink before the first request; the verdict line lands after the poll
47
+ * returns.
48
+ */
49
+ export function urlLogLine(url, verdict) {
50
+ return `${URL_LOG_PREFIX}${url}${verdict === undefined ? '' : ` ${verdict}`}\n`;
51
+ }
52
+ /**
53
+ * autoRebuildEnabled reports whether a launch's engine acquisition steps
54
+ * (the git sync with its conditional rebuild, the docker image pull, the
55
+ * Strata binary installer, the compose `--pull` mode, the Get steps'
56
+ * sync/build skip) run: the card's Auto Rebuild flag, with only an explicit
57
+ * false disabling them so the already-present checkout, image, or binary
58
+ * launches as-is. An absent flag (a CLI launch, a legacy caller) reads as
59
+ * enabled. Every guard prices the flag through this one predicate, so the
60
+ * absent-means-enabled rule cannot drift between adapters.
61
+ */
62
+ export function autoRebuildEnabled(autoRebuild) {
63
+ return autoRebuild !== false;
64
+ }
1
65
  /**
2
66
  * EngineAdapter is the abstract base one subclass implements per engine. It
3
67
  * owns the engine's parameter surface and turns a config into a launch plan,
@@ -8,5 +72,14 @@
8
72
  * from the config.
9
73
  */
10
74
  export class EngineAdapter {
75
+ /**
76
+ * planKey is the children-map key an adapter tracks a spawned engine
77
+ * process under: the plan's engine id and port, the pair that identifies
78
+ * one running engine. The base class owns the rule, so every adapter
79
+ * tracks and stops the exact process it started.
80
+ */
81
+ planKey(plan) {
82
+ return `${plan.engineId}:${plan.port}`;
83
+ }
11
84
  }
12
- //# sourceMappingURL=adapter.js.map
85
+ //# sourceMappingURL=adapter.js.map
@@ -17,4 +17,4 @@ export interface CustomArg {
17
17
  key: string;
18
18
  value?: string;
19
19
  }
20
- //# sourceMappingURL=config.d.ts.map
20
+ //# sourceMappingURL=config.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=config.js.map
2
+ //# sourceMappingURL=config.js.map
@@ -41,4 +41,4 @@ export interface CreateCommandDebugLoggerArgs {
41
41
  * no sink is wired, so a bare host never throws on a missing logger.
42
42
  */
43
43
  export declare function createCommandDebugLogger(args: CreateCommandDebugLoggerArgs): DebugLogger;
44
- //# sourceMappingURL=debug.d.ts.map
44
+ //# sourceMappingURL=debug.d.ts.map
@@ -40,4 +40,4 @@ export function createCommandDebugLogger(args) {
40
40
  return NOOP_DEBUG_LOGGER;
41
41
  return args.emit;
42
42
  }
43
- //# sourceMappingURL=debug.js.map
43
+ //# sourceMappingURL=debug.js.map
@@ -98,4 +98,4 @@ export declare function presetFromFetch(source: PresetSource, content: string, f
98
98
  * supplied each value in the result, in key order.
99
99
  */
100
100
  export declare function resolveDefaults(presets: readonly Preset[], specs: readonly ParameterSpec[], engineId: string, modelId: string, hw: HardwareProfile, explicit?: Config): ResolvedDefaults;
101
- //# sourceMappingURL=defaults.d.ts.map
101
+ //# sourceMappingURL=defaults.d.ts.map
@@ -92,4 +92,4 @@ function overlayPreset(preset, config, sources) {
92
92
  sources.set(key, preset.source);
93
93
  }
94
94
  }
95
- //# sourceMappingURL=defaults.js.map
95
+ //# sourceMappingURL=defaults.js.map
@@ -9,14 +9,15 @@ export type DepStatus = 'satisfied' | 'missing' | 'installing' | 'failed';
9
9
  /**
10
10
  * PackageManager is the detected host package manager the install commands are
11
11
  * keyed against. The same dep renders the right commands for the user's OS
12
- * through this key.
12
+ * through this key. Windows keys on winget, the package manager that ships
13
+ * with the OS.
13
14
  */
14
- export type PackageManager = 'apt' | 'dnf' | 'pacman' | 'brew';
15
+ export type PackageManager = 'apt' | 'dnf' | 'pacman' | 'brew' | 'winget';
15
16
  /**
16
17
  * PackageManagerProbes are the raw which-probe results a detection run
17
- * collects: which of the four package-manager binaries exist on the host, plus
18
- * the OS. The pure mapping below turns them into the single winner; the
19
- * probes are the service's job.
18
+ * collects: which of the package-manager binaries exist on the host, plus the
19
+ * OS. The pure mapping below turns them into the single winner; the probes are
20
+ * the service's job.
20
21
  */
21
22
  export interface PackageManagerProbes {
22
23
  os: 'linux' | 'windows' | 'macos';
@@ -24,6 +25,7 @@ export interface PackageManagerProbes {
24
25
  dnf: boolean;
25
26
  pacman: boolean;
26
27
  brew: boolean;
28
+ winget: boolean;
27
29
  }
28
30
  /**
29
31
  * InstallCommands is one dep's install block for one package manager: the
@@ -53,15 +55,29 @@ export interface SystemDep {
53
55
  }
54
56
  /**
55
57
  * EngineDepPlan is the per-engine answer to "which host deps does this engine
56
- * need": the docker list and the local list. A docker build skips the compile
57
- * toolchain entirely; a local build needs it. The providers ship the plans as
58
- * data, so adding an engine is a data edit.
58
+ * need": the docker list, the optional binary list, and the per-OS local
59
+ * lists. A docker build skips the compile toolchain entirely; a local build
60
+ * needs it. The providers ship the plans as data, so adding an engine is a
61
+ * data edit. The local lists are per-OS, sourced from the engine OS profile's
62
+ * deps by the providers (the Windows profile carries the winget toolchain,
63
+ * the shared Linux profile the apt/dnf/pacman/brew toolchain); a host OS
64
+ * reads its own list, and an OS with no dedicated list (macOS) reads the
65
+ * Linux list.
59
66
  */
60
67
  export interface EngineDepPlan {
61
68
  docker: readonly SystemDep[];
62
- local: readonly SystemDep[];
63
69
  binary?: readonly SystemDep[];
70
+ local?: Partial<Record<'linux' | 'windows' | 'macos', readonly SystemDep[]>>;
64
71
  }
72
+ /**
73
+ * osLabel is the friendly OS name the install string's header and the card's
74
+ * System dependencies section show: WSL on a WSL2 kernel, Windows on Windows,
75
+ * OSX on macOS, and Linux on every other Linux host.
76
+ */
77
+ export declare function osLabel(hw: {
78
+ os: 'linux' | 'windows' | 'macos';
79
+ wsl2?: boolean;
80
+ }): string;
65
81
  /**
66
82
  * DepCheck is the per-dep answer from checkDeps: the dep and its current
67
83
  * status.
@@ -72,18 +88,28 @@ export interface DepCheck {
72
88
  }
73
89
  /**
74
90
  * CommandOutcome is the answer to one install command: whether it exited
75
- * clean and a detail the UI shows when it did not.
91
+ * clean and a detail the UI shows when it did not. `stdout`, when the host
92
+ * captures the child's streams, is the tail of the captured output of a clean
93
+ * exit (stdout then stderr, capped by the host's tail rule so success output
94
+ * can follow its `$ <command>` log line without regurgitating a huge blob).
95
+ * A failed run carries the output in `detail` instead, and a host that does
96
+ * not capture output (a test stub) omits `stdout`.
76
97
  */
77
98
  export interface CommandOutcome {
78
99
  ok: boolean;
79
100
  detail?: string;
101
+ stdout?: string;
80
102
  }
81
103
  /**
82
104
  * CommandRunner runs one shell command line and reports the exit. The
83
105
  * Play/Run path takes it as a parameter, so the tests stub it and never run a
84
- * real sudo in CI.
106
+ * real sudo in CI. `needsSudo` carries the dep's sudo declaration
107
+ * (SystemDep.requiresSudo) to the runner so it can apply the sudo-prompt rule;
108
+ * the need is declared in data, never parsed from the command text.
85
109
  */
86
- export type CommandRunner = (command: string) => Promise<CommandOutcome>;
110
+ export type CommandRunner = (command: string, options?: {
111
+ needsSudo?: boolean;
112
+ }) => Promise<CommandOutcome>;
87
113
  /**
88
114
  * InstallResult is the outcome of the Play/Run path: overall success and the
89
115
  * per-dep status after re-running the probes.
@@ -111,10 +137,11 @@ export interface SystemDepProvisioner {
111
137
  }
112
138
  /**
113
139
  * detectPackageManager picks the single package manager the install commands
114
- * key against, from the which-probe results. macOS keys on brew. Linux tries
115
- * the distro-native manager in the order the plan lists them (apt, dnf,
116
- * pacman); a distro that ships two keeps the first. Windows has no command
117
- * set yet and reads as undetected, which the renderer degrades to.
140
+ * key against, from the which-probe results. macOS keys on brew. Windows keys
141
+ * on winget, the package manager that ships with the OS. Linux tries the
142
+ * distro-native manager in the order the plan lists them (apt, dnf, pacman);
143
+ * a distro that ships two keeps the first. A host whose manager probe reads
144
+ * absent reads as undetected, which the renderer degrades to.
118
145
  */
119
146
  export declare function detectPackageManager(probes: PackageManagerProbes): PackageManager | undefined;
120
147
  /**
@@ -149,4 +176,4 @@ export declare function renderInstallString(deps: readonly SystemDep[], hw: Hard
149
176
  * a state the plugin did not see.
150
177
  */
151
178
  export declare function runInstall(deps: readonly SystemDep[], hw: HardwareProfile, runCommand: CommandRunner): Promise<InstallResult>;
152
- //# sourceMappingURL=deps.d.ts.map
179
+ //# sourceMappingURL=deps.d.ts.map
@@ -1,14 +1,30 @@
1
+ /**
2
+ * osLabel is the friendly OS name the install string's header and the card's
3
+ * System dependencies section show: WSL on a WSL2 kernel, Windows on Windows,
4
+ * OSX on macOS, and Linux on every other Linux host.
5
+ */
6
+ export function osLabel(hw) {
7
+ if (hw.os === 'windows')
8
+ return 'Windows';
9
+ if (hw.os === 'macos')
10
+ return 'OSX';
11
+ return hw.wsl2 === true ? 'WSL' : 'Linux';
12
+ }
1
13
  /**
2
14
  * detectPackageManager picks the single package manager the install commands
3
- * key against, from the which-probe results. macOS keys on brew. Linux tries
4
- * the distro-native manager in the order the plan lists them (apt, dnf,
5
- * pacman); a distro that ships two keeps the first. Windows has no command
6
- * set yet and reads as undetected, which the renderer degrades to.
15
+ * key against, from the which-probe results. macOS keys on brew. Windows keys
16
+ * on winget, the package manager that ships with the OS. Linux tries the
17
+ * distro-native manager in the order the plan lists them (apt, dnf, pacman);
18
+ * a distro that ships two keeps the first. A host whose manager probe reads
19
+ * absent reads as undetected, which the renderer degrades to.
7
20
  */
8
21
  export function detectPackageManager(probes) {
9
22
  if (probes.os === 'macos') {
10
23
  return probes.brew ? 'brew' : undefined;
11
24
  }
25
+ if (probes.os === 'windows') {
26
+ return probes.winget ? 'winget' : undefined;
27
+ }
12
28
  if (probes.os === 'linux') {
13
29
  if (probes.apt)
14
30
  return 'apt';
@@ -46,7 +62,7 @@ export async function checkDeps(deps, hw) {
46
62
  * in. It is the order the plan lists them, so the block the user's host
47
63
  * would have picked sits at the top.
48
64
  */
49
- const MANAGER_ORDER = ['apt', 'dnf', 'pacman', 'brew'];
65
+ const MANAGER_ORDER = ['apt', 'dnf', 'pacman', 'brew', 'winget'];
50
66
  /**
51
67
  * renderInstallString emits the copy/paste block for the user's detected OS
52
68
  * and package manager, mirroring the qwen-ninfer header: the apt and CUDA-
@@ -59,7 +75,7 @@ const MANAGER_ORDER = ['apt', 'dnf', 'pacman', 'brew'];
59
75
  export function renderInstallString(deps, hw) {
60
76
  const pm = hw.packageManager;
61
77
  const lines = [];
62
- lines.push(`# System dependencies on ${hw.os}`);
78
+ lines.push(`# System dependencies on ${osLabel(hw)}`);
63
79
  if (pm === undefined) {
64
80
  lines.push('# No package manager detected; blocks are grouped by manager.');
65
81
  }
@@ -131,7 +147,7 @@ export async function runInstall(deps, hw, runCommand) {
131
147
  }
132
148
  let failure;
133
149
  for (const command of commands.commands) {
134
- const outcome = await runCommand(command);
150
+ const outcome = await runCommand(command, { needsSudo: dep.requiresSudo });
135
151
  if (!outcome.ok) {
136
152
  failure = outcome;
137
153
  break;
@@ -165,4 +181,4 @@ export async function runInstall(deps, hw, runCommand) {
165
181
  async function isSatisfied(dep, hw) {
166
182
  return dep.detect === undefined ? false : await dep.detect(hw);
167
183
  }
168
- //# sourceMappingURL=deps.js.map
184
+ //# sourceMappingURL=deps.js.map
@@ -135,4 +135,4 @@ export declare const DEFAULT_OS_RESERVE_MIB: number;
135
135
  * no reserve of its own.
136
136
  */
137
137
  export declare function estimateVram(model: VramModel | undefined, config: Config, hw: HardwareProfile, specs?: readonly ParameterSpec[], options?: EstimateOptions): VramEstimate;
138
- //# sourceMappingURL=estimator.d.ts.map
138
+ //# sourceMappingURL=estimator.d.ts.map
@@ -235,4 +235,4 @@ export function estimateVram(model, config, hw, specs, options) {
235
235
  };
236
236
  return { breakdown, verdict, source: model.source };
237
237
  }
238
- //# sourceMappingURL=estimator.js.map
238
+ //# sourceMappingURL=estimator.js.map
@@ -61,4 +61,4 @@ export declare function evaluateGuidelines(guidelines: readonly Guideline[], spe
61
61
  * OS reserve, so the rule prices the same usable budget the meter does.
62
62
  */
63
63
  export declare function modelGuidelines(model: VramModel, config: Config, hw: HardwareProfile, options?: EstimateOptions): GuidelineResult[];
64
- //# sourceMappingURL=guideline.d.ts.map
64
+ //# sourceMappingURL=guideline.d.ts.map
@@ -115,4 +115,4 @@ export function modelGuidelines(model, config, hw, options) {
115
115
  }
116
116
  return results;
117
117
  }
118
- //# sourceMappingURL=guideline.js.map
118
+ //# sourceMappingURL=guideline.js.map
@@ -64,4 +64,4 @@ export declare function parseNvidiaSmiGpu(output: string): GpuProbe | null;
64
64
  * formats off.
65
65
  */
66
66
  export declare function detectHardware(probes: HardwareProbes): HardwareProfile;
67
- //# sourceMappingURL=hardware.d.ts.map
67
+ //# sourceMappingURL=hardware.d.ts.map
@@ -57,4 +57,4 @@ export function detectHardware(probes) {
57
57
  }
58
58
  return profile;
59
59
  }
60
- //# sourceMappingURL=hardware.js.map
60
+ //# sourceMappingURL=hardware.js.map