umadev 1.0.9 → 1.0.11
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/bin/cli.js +35 -10
- package/package.json +7 -7
package/bin/cli.js
CHANGED
|
@@ -182,7 +182,7 @@ function downloadTo(url, dest, withBar, label) {
|
|
|
182
182
|
const now = Date.now();
|
|
183
183
|
const pct = Math.floor((got / total) * 100);
|
|
184
184
|
// Redraw on each new percent OR every ~250ms — keeps the live speed
|
|
185
|
-
// ticking even while a single percent of a
|
|
185
|
+
// ticking even while a single percent of a large file streams in.
|
|
186
186
|
if (pct !== lastPct || now - lastDraw > 250) {
|
|
187
187
|
lastPct = pct;
|
|
188
188
|
lastDraw = now;
|
|
@@ -213,11 +213,11 @@ function downloadTo(url, dest, withBar, label) {
|
|
|
213
213
|
req.setTimeout(120000, () => req.destroy(new Error('timeout')));
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
// Ordered list of base URLs to try for the
|
|
217
|
-
// (UMADEV_MODEL_BASE_URL) wins; otherwise
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
//
|
|
216
|
+
// Ordered list of base URLs to try for the model files. An explicit override
|
|
217
|
+
// (UMADEV_MODEL_BASE_URL) wins; otherwise EVERYONE pulls the SAME upstream f32 from
|
|
218
|
+
// HuggingFace (international) / hf-mirror.com (China), region-ordered, with the
|
|
219
|
+
// GitHub fp16 release as a last-resort fallback — so the download is consistent in
|
|
220
|
+
// size everywhere and the model is always reachable.
|
|
221
221
|
function releaseBases(version) {
|
|
222
222
|
if (process.env.UMADEV_MODEL_BASE_URL) {
|
|
223
223
|
return [process.env.UMADEV_MODEL_BASE_URL.replace(/\/+$/, '')];
|
|
@@ -242,9 +242,13 @@ function releaseBases(version) {
|
|
|
242
242
|
} catch (_) {
|
|
243
243
|
/* default to international order */
|
|
244
244
|
}
|
|
245
|
-
//
|
|
246
|
-
//
|
|
247
|
-
|
|
245
|
+
// Unified on the upstream f32 model from HuggingFace (international) + its China
|
|
246
|
+
// mirror hf-mirror.com, so BOTH regions download the SAME ~448MB f32 — consistent
|
|
247
|
+
// everywhere (no more "some get 200MB, some 400MB"). China: hf-mirror first (fast
|
|
248
|
+
// in CN); international: huggingface.co first. The GitHub Release fp16 (~224MB) +
|
|
249
|
+
// proxies stay only as a LAST-RESORT fallback if both HF endpoints are down (the
|
|
250
|
+
// candle loader casts either precision to f32, so a fallback still loads).
|
|
251
|
+
return cn ? [hfMirror, hf, gh, ...ghProxies] : [hf, hfMirror, gh, ...ghProxies];
|
|
248
252
|
}
|
|
249
253
|
// Try each base for `name` in order; resolve on first success, throw the last
|
|
250
254
|
// error if all fail. A China mirror can cover a blocked github.com (or vice
|
|
@@ -300,6 +304,22 @@ async function ensureModel() {
|
|
|
300
304
|
}
|
|
301
305
|
}
|
|
302
306
|
|
|
307
|
+
// Subcommands that do NOT drive the agent runtime — they never retrieve
|
|
308
|
+
// knowledge, so they must not trigger the one-time vector-model download.
|
|
309
|
+
// Without this, `umadev update` (and `--version` / `--help` / `doctor` / …) would
|
|
310
|
+
// appear to hang on a machine that doesn't have the model yet, while it streams
|
|
311
|
+
// in — which reads as "the update command broke". The model is fetched lazily on
|
|
312
|
+
// the first command that actually needs it (the TUI / run / quick / …).
|
|
313
|
+
const NO_MODEL_COMMANDS = new Set([
|
|
314
|
+
'update', 'install', 'uninstall', 'init',
|
|
315
|
+
'--version', '-V', 'version',
|
|
316
|
+
'--help', '-h', 'help',
|
|
317
|
+
'doctor', 'mcp', 'hook', 'ci',
|
|
318
|
+
'usage', 'lessons', 'history',
|
|
319
|
+
'examples', 'guide',
|
|
320
|
+
'mcp-manage', 'skill', 'knowledge-manage', 'pr',
|
|
321
|
+
]);
|
|
322
|
+
|
|
303
323
|
async function main() {
|
|
304
324
|
const binary = findBinary();
|
|
305
325
|
// npm artifact round-trips (upload/download-artifact in CI) can strip the
|
|
@@ -310,10 +330,15 @@ async function main() {
|
|
|
310
330
|
// read-only install dir or already +x — spawnSync below reports real errors
|
|
311
331
|
}
|
|
312
332
|
const extraEnv = {};
|
|
333
|
+
// A utility command (update/--version/--help/doctor/…) skips the model fetch so
|
|
334
|
+
// it returns instantly even before the model is installed; the agent runtime
|
|
335
|
+
// commands still fetch it lazily on first use.
|
|
336
|
+
const firstArg = process.argv[2] || '';
|
|
337
|
+
const needsModel = !NO_MODEL_COMMANDS.has(firstArg);
|
|
313
338
|
// Prefer a bundled npm model package (dev / sibling layout); otherwise fetch
|
|
314
339
|
// it on demand into ~/.umadev/embed-model (the binary's model_dir() fallback).
|
|
315
340
|
let modelDir = findModelDir();
|
|
316
|
-
if (!modelDir) modelDir = await ensureModel();
|
|
341
|
+
if (needsModel && !modelDir) modelDir = await ensureModel();
|
|
317
342
|
if (modelDir && !process.env.UMADEV_EMBED_MODEL_DIR) {
|
|
318
343
|
extraEnv.UMADEV_EMBED_MODEL_DIR = modelDir;
|
|
319
344
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umadev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A project-director Agent for AI coding hosts — drives your logged-in Claude Code / Codex through a 9-phase commercial delivery pipeline with governance. No API key needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"node": ">=18"
|
|
38
38
|
},
|
|
39
39
|
"optionalDependencies": {
|
|
40
|
-
"@umacloud/cli-darwin-arm64": "1.0.
|
|
41
|
-
"@umacloud/cli-darwin-x64": "1.0.
|
|
42
|
-
"@umacloud/cli-linux-x64": "1.0.
|
|
43
|
-
"@umacloud/cli-linux-arm64": "1.0.
|
|
44
|
-
"@umacloud/cli-win32-x64": "1.0.
|
|
45
|
-
"@umacloud/knowledge": "1.0.
|
|
40
|
+
"@umacloud/cli-darwin-arm64": "1.0.11",
|
|
41
|
+
"@umacloud/cli-darwin-x64": "1.0.11",
|
|
42
|
+
"@umacloud/cli-linux-x64": "1.0.11",
|
|
43
|
+
"@umacloud/cli-linux-arm64": "1.0.11",
|
|
44
|
+
"@umacloud/cli-win32-x64": "1.0.11",
|
|
45
|
+
"@umacloud/knowledge": "1.0.11"
|
|
46
46
|
}
|
|
47
47
|
}
|