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.
- package/README.md +32 -6
- package/cordis.patch.yml +7 -0
- package/docs/zh/README.md +24 -4
- package/dsh/client.js +4200 -4049
- package/package.json +33 -11
- package/packages/core/lib/adapter.d.ts +177 -11
- package/packages/core/lib/adapter.js +74 -1
- package/packages/core/lib/config.d.ts +1 -1
- package/packages/core/lib/config.js +1 -1
- package/packages/core/lib/debug.d.ts +1 -1
- package/packages/core/lib/debug.js +1 -1
- package/packages/core/lib/defaults.d.ts +1 -1
- package/packages/core/lib/defaults.js +1 -1
- package/packages/core/lib/deps.d.ts +48 -20
- package/packages/core/lib/deps.js +24 -8
- package/packages/core/lib/estimator.d.ts +1 -1
- package/packages/core/lib/estimator.js +1 -1
- package/packages/core/lib/guideline.d.ts +1 -1
- package/packages/core/lib/guideline.js +1 -1
- package/packages/core/lib/hardware.d.ts +1 -1
- package/packages/core/lib/hardware.js +1 -1
- package/packages/core/lib/hf-cache.d.ts +70 -0
- package/packages/core/lib/hf-cache.js +83 -0
- package/packages/core/lib/index.d.ts +16 -9
- package/packages/core/lib/index.js +10 -6
- package/packages/core/lib/infer-cache.d.ts +39 -0
- package/packages/core/lib/infer-cache.js +53 -0
- package/packages/core/lib/launch-command.d.ts +8 -4
- package/packages/core/lib/launch-command.js +13 -6
- package/packages/core/lib/launch-record.d.ts +1 -1
- package/packages/core/lib/launch-record.js +1 -1
- package/packages/core/lib/logs.d.ts +8 -1
- package/packages/core/lib/logs.js +12 -4
- package/packages/core/lib/models.d.ts +120 -14
- package/packages/core/lib/models.js +209 -17
- package/packages/core/lib/parameter.d.ts +31 -3
- package/packages/core/lib/parameter.js +1 -1
- package/packages/core/lib/progress.d.ts +54 -0
- package/packages/core/lib/progress.js +120 -0
- package/packages/core/lib/registrar.d.ts +25 -14
- package/packages/core/lib/registrar.js +30 -10
- package/packages/core/lib/reserve.d.ts +11 -3
- package/packages/core/lib/reserve.js +6 -4
- package/packages/core/lib/status.d.ts +12 -6
- package/packages/core/lib/status.js +21 -10
- package/packages/core/lib/sudo.d.ts +80 -0
- package/packages/core/lib/sudo.js +78 -0
- package/packages/core/package.json +1 -1
- package/packages/orchestrator/lib/config.d.ts +63 -0
- package/packages/orchestrator/lib/config.js +111 -0
- package/packages/orchestrator/lib/index.d.ts +51 -0
- package/packages/orchestrator/lib/index.js +73 -0
- package/packages/orchestrator/lib/route.d.ts +60 -0
- package/packages/orchestrator/lib/route.js +159 -0
- package/packages/orchestrator/locale/en.json +6 -0
- package/packages/orchestrator/package.json +39 -0
- package/packages/orchestrator/prompt.md +87 -0
- package/packages/providers/lib/acquire.d.ts +95 -15
- package/packages/providers/lib/acquire.js +239 -40
- package/packages/providers/lib/adapters.d.ts +155 -221
- package/packages/providers/lib/adapters.js +589 -935
- package/packages/providers/lib/debug.d.ts +1 -1
- package/packages/providers/lib/debug.js +1 -1
- package/packages/providers/lib/deps.d.ts +31 -212
- package/packages/providers/lib/deps.js +71 -205
- package/packages/providers/lib/engines/basalt/basalt.d.ts +130 -0
- package/packages/providers/lib/engines/basalt/basalt.js +304 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.d.ts +85 -0
- package/packages/providers/lib/engines/basalt/basaltAdapter.js +439 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.d.ts +23 -0
- package/packages/providers/lib/engines/basalt/basaltLinux.js +47 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.d.ts +17 -0
- package/packages/providers/lib/engines/basalt/basaltMacOS.js +19 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.d.ts +24 -0
- package/packages/providers/lib/engines/basalt/basaltWindows.js +49 -0
- package/packages/providers/lib/engines/engineOs.d.ts +24 -0
- package/packages/providers/lib/engines/engineOs.js +17 -0
- package/packages/providers/lib/{hyperqwen.d.ts → engines/hyperqwen/hyperqwen.d.ts} +2 -2
- package/packages/providers/lib/{hyperqwen.js → engines/hyperqwen/hyperqwen.js} +14 -2
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.d.ts +38 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenAdapter.js +115 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenArch.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenDebian.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenFedora.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.d.ts +10 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenLinux.js +14 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenMacOS.js +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.d.ts +9 -0
- package/packages/providers/lib/engines/hyperqwen/hyperqwenWindows.js +9 -0
- package/packages/providers/lib/{infernix.d.ts → engines/infernix/infernix.d.ts} +7 -4
- package/packages/providers/lib/{infernix.js → engines/infernix/infernix.js} +53 -8
- package/packages/providers/lib/engines/infernix/infernixAdapter.d.ts +52 -0
- package/packages/providers/lib/engines/infernix/infernixAdapter.js +235 -0
- package/packages/providers/lib/engines/infernix/infernixArch.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixArch.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixDebian.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.d.ts +9 -0
- package/packages/providers/lib/engines/infernix/infernixFedora.js +9 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.d.ts +17 -0
- package/packages/providers/lib/engines/infernix/infernixLinux.js +35 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixMacOS.js +18 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.d.ts +16 -0
- package/packages/providers/lib/engines/infernix/infernixWindows.js +34 -0
- package/packages/providers/lib/{llamacpp.d.ts → engines/llamacpp/llamacpp.d.ts} +2 -2
- package/packages/providers/lib/{llamacpp.js → engines/llamacpp/llamacpp.js} +12 -2
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.d.ts +50 -0
- package/packages/providers/lib/engines/llamacpp/llamacppAdapter.js +274 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppArch.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppDebian.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.d.ts +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppFedora.js +9 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.d.ts +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppLinux.js +28 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppMacOS.js +17 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.d.ts +15 -0
- package/packages/providers/lib/engines/llamacpp/llamacppWindows.js +26 -0
- package/packages/providers/lib/{ninfer.d.ts → engines/ninfer/ninfer.d.ts} +2 -2
- package/packages/providers/lib/{ninfer.js → engines/ninfer/ninfer.js} +25 -3
- package/packages/providers/lib/engines/ninfer/ninferAdapter.d.ts +81 -0
- package/packages/providers/lib/engines/ninfer/ninferAdapter.js +392 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferArch.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferDebian.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.d.ts +9 -0
- package/packages/providers/lib/engines/ninfer/ninferFedora.js +9 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.d.ts +17 -0
- package/packages/providers/lib/engines/ninfer/ninferLinux.js +37 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.d.ts +15 -0
- package/packages/providers/lib/engines/ninfer/ninferMacOS.js +17 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.d.ts +29 -0
- package/packages/providers/lib/engines/ninfer/ninferWindows.js +59 -0
- package/packages/providers/lib/engines/strata/strata.d.ts +1 -0
- package/packages/providers/lib/engines/strata/strata.js +264 -0
- package/packages/providers/lib/engines/strata/strataAdapter.d.ts +97 -0
- package/packages/providers/lib/engines/strata/strataAdapter.js +463 -0
- package/packages/providers/lib/engines/strata/strataArch.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataArch.js +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataDebian.js +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.d.ts +9 -0
- package/packages/providers/lib/engines/strata/strataFedora.js +9 -0
- package/packages/providers/lib/engines/strata/strataLinux.d.ts +21 -0
- package/packages/providers/lib/engines/strata/strataLinux.js +30 -0
- package/packages/providers/lib/engines/strata/strataMacOS.d.ts +16 -0
- package/packages/providers/lib/engines/strata/strataMacOS.js +17 -0
- package/packages/providers/lib/engines/strata/strataWindows.d.ts +27 -0
- package/packages/providers/lib/engines/strata/strataWindows.js +37 -0
- package/packages/providers/lib/engines.d.ts +8 -5
- package/packages/providers/lib/engines.js +22 -11
- package/packages/providers/lib/guidelines.d.ts +5 -4
- package/packages/providers/lib/guidelines.js +18 -5
- package/packages/providers/lib/index.d.ts +33 -24
- package/packages/providers/lib/index.js +46 -24
- package/packages/providers/lib/model-defaults.d.ts +10 -5
- package/packages/providers/lib/model-defaults.js +47 -5
- package/packages/providers/lib/platform.d.ts +8 -5
- package/packages/providers/lib/platform.js +27 -7
- package/packages/providers/lib/presets.d.ts +6 -4
- package/packages/providers/lib/presets.js +53 -5
- package/packages/providers/lib/systemDeps.d.ts +313 -0
- package/packages/providers/lib/systemDeps.js +284 -0
- package/packages/providers/lib/vram.d.ts +34 -8
- package/packages/providers/lib/vram.js +81 -8
- package/packages/providers/package.json +2 -2
- package/packages/service/lib/index.d.ts +187 -23
- package/packages/service/lib/index.js +667 -90
- package/packages/service/lib/launch-target.d.ts +19 -0
- package/packages/service/lib/launch-target.js +28 -0
- package/packages/service/lib/run-logs.d.ts +72 -0
- package/packages/service/lib/run-logs.js +125 -0
- package/packages/service/lib/types.d.ts +166 -8
- package/packages/service/lib/types.js +1 -1
- package/packages/service/package.json +2 -2
- package/packages/tool/lib/index.d.ts +1 -1
- package/packages/tool/lib/index.js +1 -1
- package/packages/tool/package.json +2 -2
- package/packages/ui/lib/config.d.ts +89 -0
- package/packages/ui/lib/config.js +251 -0
- package/packages/ui/lib/deps.d.ts +4 -4
- package/packages/ui/lib/deps.js +1 -1
- package/packages/ui/lib/form.d.ts +1 -1
- package/packages/ui/lib/form.js +1 -1
- package/packages/ui/lib/index.d.ts +7 -1
- package/packages/ui/lib/index.js +12 -2
- package/packages/ui/lib/meter.d.ts +1 -1
- package/packages/ui/lib/meter.js +1 -1
- package/packages/ui/lib/ops/engine.d.ts +216 -0
- package/packages/ui/lib/ops/engine.js +697 -0
- package/packages/ui/lib/ops/get-steps.d.ts +98 -0
- package/packages/ui/lib/ops/get-steps.js +359 -0
- package/packages/ui/lib/ops/hf.d.ts +42 -0
- package/packages/ui/lib/ops/hf.js +150 -0
- package/packages/ui/lib/ops/logs.d.ts +78 -0
- package/packages/ui/lib/ops/logs.js +119 -0
- package/packages/ui/lib/ops/model.d.ts +71 -0
- package/packages/ui/lib/ops/model.js +123 -0
- package/packages/ui/lib/request.d.ts +106 -0
- package/packages/ui/lib/request.js +80 -0
- package/packages/ui/lib/route.d.ts +106 -422
- package/packages/ui/lib/route.js +136 -1845
- package/packages/ui/lib/routes/chat-template.d.ts +1 -0
- package/packages/ui/lib/routes/chat-template.js +1 -0
- package/packages/ui/lib/routes/deps.d.ts +1 -0
- package/packages/ui/lib/routes/deps.js +1 -0
- package/packages/ui/lib/routes/download.d.ts +1 -0
- package/packages/ui/lib/routes/download.js +1 -0
- package/packages/ui/lib/routes/get.d.ts +1 -0
- package/packages/ui/lib/routes/get.js +106 -0
- package/packages/ui/lib/routes/install.d.ts +16 -0
- package/packages/ui/lib/routes/install.js +36 -0
- package/packages/ui/lib/routes/launch.d.ts +24 -0
- package/packages/ui/lib/routes/launch.js +74 -0
- package/packages/ui/lib/routes/logs.d.ts +57 -0
- package/packages/ui/lib/routes/logs.js +117 -0
- package/packages/ui/lib/routes/provider-delete.d.ts +15 -0
- package/packages/ui/lib/routes/provider-delete.js +37 -0
- package/packages/ui/lib/routes/register.d.ts +16 -0
- package/packages/ui/lib/routes/register.js +28 -0
- package/packages/ui/lib/routes/save.d.ts +18 -0
- package/packages/ui/lib/routes/save.js +159 -0
- package/packages/ui/lib/routes/stop.d.ts +19 -0
- package/packages/ui/lib/routes/stop.js +32 -0
- package/packages/ui/lib/routes/stream.d.ts +40 -0
- package/packages/ui/lib/routes/stream.js +68 -0
- package/packages/ui/lib/routes/summary.d.ts +15 -0
- package/packages/ui/lib/routes/summary.js +26 -0
- package/packages/ui/lib/routes/unregister.d.ts +14 -0
- package/packages/ui/lib/routes/unregister.js +26 -0
- package/packages/ui/lib/viewmodels/deps.d.ts +1 -0
- package/packages/ui/lib/viewmodels/deps.js +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.d.ts +1 -0
- package/packages/ui/lib/viewmodels/depsHelpers.js +94 -0
- package/packages/ui/lib/viewmodels/summary.d.ts +145 -0
- package/packages/ui/lib/viewmodels/summary.js +245 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.d.ts +30 -0
- package/packages/ui/lib/viewmodels/summaryHelpers.js +42 -0
- package/packages/ui/lib/warnings.d.ts +1 -1
- package/packages/ui/lib/warnings.js +1 -1
- package/packages/ui/package.json +4 -4
- package/packages/providers/lib/strata.d.ts +0 -15
- package/packages/providers/lib/strata.js +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-local-infer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"ai-agent"
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/cybtachyon/dsh-plugin-local-infer"
|
|
27
|
+
},
|
|
24
28
|
"type": "module",
|
|
25
29
|
"packageManager": "pnpm@12.11.2",
|
|
26
30
|
"engines": {
|
|
@@ -59,6 +63,11 @@
|
|
|
59
63
|
"types": "./packages/ui/lib/index.d.ts",
|
|
60
64
|
"default": "./packages/ui/lib/index.js"
|
|
61
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",
|
|
62
71
|
"./package.json": "./package.json"
|
|
63
72
|
},
|
|
64
73
|
"files": [
|
|
@@ -81,13 +90,18 @@
|
|
|
81
90
|
"packages/tool/lib/**/*.d.ts",
|
|
82
91
|
"packages/ui/package.json",
|
|
83
92
|
"packages/ui/lib/**/*.js",
|
|
84
|
-
"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"
|
|
85
99
|
],
|
|
86
100
|
"peerDependencies": {
|
|
87
|
-
"@deepseek-ai/cordis": ">=4.0.
|
|
101
|
+
"@deepseek-ai/cordis": ">=4.0.6-alpha.2"
|
|
88
102
|
},
|
|
89
103
|
"scripts": {
|
|
90
|
-
"build": "tsc -b",
|
|
104
|
+
"build": "tsc -b && node scripts/build-client.mjs && node scripts/build-format.mjs",
|
|
91
105
|
"typecheck": "tsc -b",
|
|
92
106
|
"test": "vitest run",
|
|
93
107
|
"test:coverage": "vitest run --coverage",
|
|
@@ -96,12 +110,20 @@
|
|
|
96
110
|
},
|
|
97
111
|
"devDependencies": {
|
|
98
112
|
"@eslint/js": "^10.0.1",
|
|
99
|
-
"@types/node": "^
|
|
100
|
-
"@
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
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",
|
|
123
|
+
"tsx": "^4.23.15",
|
|
124
|
+
"typescript": "^5.9.3",
|
|
125
|
+
"typescript-eslint": "^8.72.1",
|
|
126
|
+
"vitest": "^5.0.5",
|
|
127
|
+
"yaml": "^2.4.2"
|
|
106
128
|
}
|
|
107
129
|
}
|
|
@@ -5,6 +5,13 @@ import type { HardwareProfile } from './hardware.ts';
|
|
|
5
5
|
import type { ParameterSpec } from './parameter.ts';
|
|
6
6
|
import type { SystemDep } from './deps.ts';
|
|
7
7
|
import type { EngineLaunchSignature } from './reserve.ts';
|
|
8
|
+
/**
|
|
9
|
+
* BuildMode is the deploy mode an engine renders a plan for: a docker
|
|
10
|
+
* container, a local source build, or a prebuilt binary install (the Strata
|
|
11
|
+
* Terminal the install script places on the path). The adapter reads it from
|
|
12
|
+
* the config `buildMode` field and renders the matching plan.
|
|
13
|
+
*/
|
|
14
|
+
export type BuildMode = 'docker' | 'local' | 'binary';
|
|
8
15
|
/**
|
|
9
16
|
* LaunchPlan is the engine-neutral result of rendering a config: how to start
|
|
10
17
|
* the engine (a local process, a docker container, or a compose file), the
|
|
@@ -25,8 +32,15 @@ export interface LaunchPlan {
|
|
|
25
32
|
containerName?: string;
|
|
26
33
|
modelId?: string;
|
|
27
34
|
modelDirectory?: string;
|
|
35
|
+
modelFile?: string;
|
|
28
36
|
port: number;
|
|
29
37
|
healthUrl: string;
|
|
38
|
+
os?: 'linux' | 'windows' | 'macos';
|
|
39
|
+
configFile?: {
|
|
40
|
+
path: string;
|
|
41
|
+
content: string;
|
|
42
|
+
};
|
|
43
|
+
pid?: number;
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
32
46
|
* EnginePlatformConfig is the per-engine platform config the user adds for a
|
|
@@ -70,13 +84,19 @@ export interface ProcessExitInfo {
|
|
|
70
84
|
* fired once with the ProcessExitInfo when the child ends (a crash, a signal
|
|
71
85
|
* like a pkill, or a clean stop); a listener registered after the child has
|
|
72
86
|
* already ended fires immediately. A host that cannot watch (a stub, or a
|
|
73
|
-
* 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.
|
|
74
93
|
*/
|
|
75
94
|
export interface ProcessHandle {
|
|
76
95
|
pid: number;
|
|
77
96
|
kill(): void;
|
|
78
97
|
logs?: string;
|
|
79
98
|
onExit?(listener: (exit: ProcessExitInfo) => void): void;
|
|
99
|
+
hasExited?(): boolean;
|
|
80
100
|
}
|
|
81
101
|
/**
|
|
82
102
|
* FetchResult is the answer to a health poll: the HTTP status and whether it
|
|
@@ -86,6 +106,24 @@ export interface FetchResult {
|
|
|
86
106
|
status: number;
|
|
87
107
|
ok: boolean;
|
|
88
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
|
+
}
|
|
89
127
|
/**
|
|
90
128
|
* LifecycleHost is the injectable execution surface an adapter drives its
|
|
91
129
|
* deploy, health-check, and stop steps through. The providers ship a node
|
|
@@ -95,7 +133,7 @@ export interface FetchResult {
|
|
|
95
133
|
* DSH debug mode captures the full build-to-launch sequence the plugin runs.
|
|
96
134
|
*/
|
|
97
135
|
export interface LifecycleHost {
|
|
98
|
-
run(command: string): Promise<CommandOutcome>;
|
|
136
|
+
run(command: string, options?: RunOptions): Promise<CommandOutcome>;
|
|
99
137
|
/**
|
|
100
138
|
* Optional: run a command line and stream each stdout/stderr chunk to
|
|
101
139
|
* onOutput while it runs, so the Get step can append build output to the
|
|
@@ -104,8 +142,16 @@ export interface LifecycleHost {
|
|
|
104
142
|
* build legitimately runs past any fixed cap, and the card prices a
|
|
105
143
|
* stalled step with its own output-idle watchdog.
|
|
106
144
|
*/
|
|
107
|
-
runStream?(command: string, onOutput: (chunk: string) => void): Promise<CommandOutcome>;
|
|
145
|
+
runStream?(command: string, onOutput: (chunk: string) => void, options?: RunOptions): Promise<CommandOutcome>;
|
|
108
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>;
|
|
109
155
|
fetch(url: string): Promise<FetchResult>;
|
|
110
156
|
debug?: DebugLogger;
|
|
111
157
|
}
|
|
@@ -113,10 +159,16 @@ export interface LifecycleHost {
|
|
|
113
159
|
* HealthCheckOptions tunes the poll: the interval between attempts and the
|
|
114
160
|
* attempt cap. The service passes the config's healthPollMs and
|
|
115
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.
|
|
116
167
|
*/
|
|
117
168
|
export interface HealthCheckOptions {
|
|
118
169
|
pollMs?: number;
|
|
119
170
|
maxAttempts?: number;
|
|
171
|
+
onLog?: CommandLogger;
|
|
120
172
|
}
|
|
121
173
|
/**
|
|
122
174
|
* LaunchStep is the phase of a launch the card's Launch control prices: the
|
|
@@ -128,21 +180,79 @@ export interface HealthCheckOptions {
|
|
|
128
180
|
* rebuild. The card times out only the launch step; the rebuild steps (prereqs,
|
|
129
181
|
* download, build) run as long as they need to.
|
|
130
182
|
*/
|
|
131
|
-
|
|
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];
|
|
132
193
|
/**
|
|
133
194
|
* LaunchProgress is the callback the launch flow calls as each phase begins.
|
|
134
195
|
* The route threads it from the streamed launch response through the service
|
|
135
196
|
* and the adapter's deploy step; a launch with no progress sink omits it.
|
|
136
197
|
*/
|
|
137
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;
|
|
236
|
+
/**
|
|
237
|
+
* EngineLaunchState is the phase of an engine start the health poll reports:
|
|
238
|
+
* downloading (the engine is fetching its engine or model files, the health
|
|
239
|
+
* endpoint is not up yet), starting (the files are in place and the engine is
|
|
240
|
+
* coming up), ready (the health endpoint reports 200), and failed (the start
|
|
241
|
+
* did not reach readiness). An engine that downloads before it can serve (the
|
|
242
|
+
* Strata Terminal) spends a long time in downloading, so the poll reports the
|
|
243
|
+
* phase instead of timing out and reading the start as broken.
|
|
244
|
+
*/
|
|
245
|
+
export type EngineLaunchState = 'downloading' | 'starting' | 'ready' | 'failed';
|
|
138
246
|
/**
|
|
139
247
|
* HealthResult is the answer to a /health poll: whether the engine is up, the
|
|
140
|
-
* HTTP status,
|
|
248
|
+
* HTTP status, a detail string for the UI, and the start phase the poll
|
|
249
|
+
* observed (absent for an engine whose start has no download phase).
|
|
141
250
|
*/
|
|
142
251
|
export interface HealthResult {
|
|
143
252
|
healthy: boolean;
|
|
144
253
|
status?: number;
|
|
145
254
|
detail?: string;
|
|
255
|
+
state?: EngineLaunchState;
|
|
146
256
|
}
|
|
147
257
|
/**
|
|
148
258
|
* DeployOptions tunes a deploy run: `allowRunDeps` is the Play/Run trust gate
|
|
@@ -150,14 +260,33 @@ export interface HealthResult {
|
|
|
150
260
|
* rebuilds the engine and leaves its binary out of the path links it into
|
|
151
261
|
* /usr/local/bin; the gate decides whether that sudo link runs (on) or is
|
|
152
262
|
* written to the card's Logs section for the user to run (off). `autoRebuild`
|
|
153
|
-
* is the card's "Auto Rebuild" checkbox: when false, the
|
|
154
|
-
*
|
|
155
|
-
*
|
|
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.
|
|
156
273
|
*/
|
|
157
274
|
export interface DeployOptions {
|
|
158
275
|
allowRunDeps?: boolean;
|
|
159
276
|
autoRebuild?: boolean;
|
|
277
|
+
onLog?: CommandLogger;
|
|
160
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;
|
|
161
290
|
/**
|
|
162
291
|
* DeployResult reports whether a build-or-pull succeeded, with a detail for the
|
|
163
292
|
* UI. `handle` is the spawned engine process when the deploy step started one
|
|
@@ -190,19 +319,27 @@ export declare abstract class EngineAdapter {
|
|
|
190
319
|
abstract readonly supports: {
|
|
191
320
|
docker: boolean;
|
|
192
321
|
local: boolean;
|
|
322
|
+
binary?: boolean;
|
|
193
323
|
};
|
|
194
324
|
abstract parameters(): readonly ParameterSpec[];
|
|
195
325
|
abstract renderLaunch(config: Config, hw: HardwareProfile): LaunchPlan;
|
|
196
326
|
abstract healthCheck(plan: LaunchPlan, options?: HealthCheckOptions): Promise<HealthResult>;
|
|
197
327
|
abstract deploy(plan: LaunchPlan, platform?: EnginePlatformConfig, onProgress?: LaunchProgress, options?: DeployOptions): Promise<DeployResult>;
|
|
198
|
-
|
|
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>;
|
|
199
336
|
/**
|
|
200
337
|
* Optional: the host deps this engine's deploy step needs for a build mode,
|
|
201
338
|
* declared by the adapter that knows its own toolchain. The service asks a
|
|
202
339
|
* registered adapter first and falls back to the provider-registered plan
|
|
203
340
|
* for the engine id when the adapter declares none.
|
|
204
341
|
*/
|
|
205
|
-
systemDeps?(buildMode:
|
|
342
|
+
systemDeps?(buildMode: BuildMode, hw: HardwareProfile): readonly SystemDep[];
|
|
206
343
|
/**
|
|
207
344
|
* Optional: the model the engine serves under a config: the id the engine
|
|
208
345
|
* advertises on its OpenAI endpoint and the display name the registrar
|
|
@@ -214,6 +351,28 @@ export declare abstract class EngineAdapter {
|
|
|
214
351
|
id: string;
|
|
215
352
|
name: string;
|
|
216
353
|
} | undefined;
|
|
354
|
+
/**
|
|
355
|
+
* Optional: the model the running engine actually serves, read live from the
|
|
356
|
+
* engine (a terminal query against its model endpoint) rather than derived
|
|
357
|
+
* from the config. An engine that sizes and picks the model itself publishes
|
|
358
|
+
* the served id this returns instead of the config-derived modelRef; it
|
|
359
|
+
* returns undefined when the engine is not up, the answer cannot be read, or
|
|
360
|
+
* the config names a model, and the route falls back to modelRef. The
|
|
361
|
+
* register, save-sync, unregister, and summary paths await it, so it must
|
|
362
|
+
* never reject.
|
|
363
|
+
*/
|
|
364
|
+
discoverModel?(config: Config): Promise<{
|
|
365
|
+
id: string;
|
|
366
|
+
name: string;
|
|
367
|
+
} | undefined>;
|
|
368
|
+
/**
|
|
369
|
+
* Optional: the request modalities the engine serves under a config, the
|
|
370
|
+
* input types the DSH model row carries. An engine whose vision control is
|
|
371
|
+
* not the plain boolean flag (Strata's on|off|gpu|cpu enum, on by default)
|
|
372
|
+
* declares this so the Image input follows the engine's own vocabulary; an
|
|
373
|
+
* engine that declares none keeps the register step's boolean rule.
|
|
374
|
+
*/
|
|
375
|
+
modelInput?(config: Config): string[] | undefined;
|
|
217
376
|
/**
|
|
218
377
|
* Optional: the launch signature the engine's toArgv/toEnv produce for a
|
|
219
378
|
* config: the binary (or docker image) it runs under, the port it binds,
|
|
@@ -223,5 +382,12 @@ export declare abstract class EngineAdapter {
|
|
|
223
382
|
* process omits it, and the reserve falls back to the GPU-usage rule.
|
|
224
383
|
*/
|
|
225
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;
|
|
226
392
|
}
|
|
227
|
-
//# 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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EngineAdapter } from './adapter.ts';
|
|
1
|
+
import type { BuildMode, EngineAdapter } from './adapter.ts';
|
|
2
2
|
import type { HardwareProfile } from './hardware.ts';
|
|
3
3
|
/**
|
|
4
4
|
* DepStatus is the lifecycle state of one host dependency: satisfied, missing,
|
|
@@ -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
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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,14 +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
|
|
57
|
-
*
|
|
58
|
-
* data, so adding an engine is a
|
|
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
|
-
|
|
69
|
+
binary?: readonly SystemDep[];
|
|
70
|
+
local?: Partial<Record<'linux' | 'windows' | 'macos', readonly SystemDep[]>>;
|
|
63
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;
|
|
64
81
|
/**
|
|
65
82
|
* DepCheck is the per-dep answer from checkDeps: the dep and its current
|
|
66
83
|
* status.
|
|
@@ -71,18 +88,28 @@ export interface DepCheck {
|
|
|
71
88
|
}
|
|
72
89
|
/**
|
|
73
90
|
* CommandOutcome is the answer to one install command: whether it exited
|
|
74
|
-
* 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`.
|
|
75
97
|
*/
|
|
76
98
|
export interface CommandOutcome {
|
|
77
99
|
ok: boolean;
|
|
78
100
|
detail?: string;
|
|
101
|
+
stdout?: string;
|
|
79
102
|
}
|
|
80
103
|
/**
|
|
81
104
|
* CommandRunner runs one shell command line and reports the exit. The
|
|
82
105
|
* Play/Run path takes it as a parameter, so the tests stub it and never run a
|
|
83
|
-
* 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.
|
|
84
109
|
*/
|
|
85
|
-
export type CommandRunner = (command: string
|
|
110
|
+
export type CommandRunner = (command: string, options?: {
|
|
111
|
+
needsSudo?: boolean;
|
|
112
|
+
}) => Promise<CommandOutcome>;
|
|
86
113
|
/**
|
|
87
114
|
* InstallResult is the outcome of the Play/Run path: overall success and the
|
|
88
115
|
* per-dep status after re-running the probes.
|
|
@@ -103,17 +130,18 @@ export interface InstallResult {
|
|
|
103
130
|
* service implements this interface over the pure functions below.
|
|
104
131
|
*/
|
|
105
132
|
export interface SystemDepProvisioner {
|
|
106
|
-
planDeps(engine: EngineAdapter, buildMode:
|
|
133
|
+
planDeps(engine: EngineAdapter, buildMode: BuildMode, hw: HardwareProfile): readonly SystemDep[];
|
|
107
134
|
checkDeps(deps: readonly SystemDep[], hw: HardwareProfile): Promise<DepCheck[]>;
|
|
108
135
|
renderInstallString(deps: readonly SystemDep[], hw: HardwareProfile): string;
|
|
109
136
|
runInstall(deps: readonly SystemDep[], hw: HardwareProfile, runCommand: CommandRunner): Promise<InstallResult>;
|
|
110
137
|
}
|
|
111
138
|
/**
|
|
112
139
|
* detectPackageManager picks the single package manager the install commands
|
|
113
|
-
* key against, from the which-probe results. macOS keys on brew.
|
|
114
|
-
* the
|
|
115
|
-
*
|
|
116
|
-
*
|
|
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.
|
|
117
145
|
*/
|
|
118
146
|
export declare function detectPackageManager(probes: PackageManagerProbes): PackageManager | undefined;
|
|
119
147
|
/**
|
|
@@ -122,7 +150,7 @@ export declare function detectPackageManager(probes: PackageManagerProbes): Pack
|
|
|
122
150
|
* declares none (the Phase 5 adapters will) plans an empty list, and the
|
|
123
151
|
* service falls back to the provider-registered plan for the engine id.
|
|
124
152
|
*/
|
|
125
|
-
export declare function planDeps(engine: EngineAdapter, buildMode:
|
|
153
|
+
export declare function planDeps(engine: EngineAdapter, buildMode: BuildMode, hw: HardwareProfile): readonly SystemDep[];
|
|
126
154
|
/**
|
|
127
155
|
* checkDeps probes every dep and reports its status. A dep without a detect
|
|
128
156
|
* probe reads as missing, not satisfied: an unknown state degrades to the
|
|
@@ -148,4 +176,4 @@ export declare function renderInstallString(deps: readonly SystemDep[], hw: Hard
|
|
|
148
176
|
* a state the plugin did not see.
|
|
149
177
|
*/
|
|
150
178
|
export declare function runInstall(deps: readonly SystemDep[], hw: HardwareProfile, runCommand: CommandRunner): Promise<InstallResult>;
|
|
151
|
-
//# sourceMappingURL=deps.d.ts.map
|
|
179
|
+
//# sourceMappingURL=deps.d.ts.map
|