modelstat 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +34 -22
- package/dist/cli.mjs.map +1 -1
- package/package.json +2 -1
package/dist/cli.mjs
CHANGED
|
@@ -37315,7 +37315,7 @@ var init_scan = __esm({
|
|
|
37315
37315
|
init_api();
|
|
37316
37316
|
init_config2();
|
|
37317
37317
|
init_pipeline2();
|
|
37318
|
-
DAEMON_VERSION = true ? "daemon-0.
|
|
37318
|
+
DAEMON_VERSION = true ? "daemon-0.10.0" : "daemon-dev";
|
|
37319
37319
|
BATCH_MAX_EVENTS = INGEST_BATCH_MAX_EVENTS;
|
|
37320
37320
|
BATCH_MAX_TOOL_CALLS = 2e4;
|
|
37321
37321
|
BATCH_BUFFER_HARD_CAP = BATCH_MAX_EVENTS * 2;
|
|
@@ -37882,7 +37882,7 @@ var PROCESSING_VERSION;
|
|
|
37882
37882
|
var init_processing_version = __esm({
|
|
37883
37883
|
"src/processing-version.ts"() {
|
|
37884
37884
|
"use strict";
|
|
37885
|
-
PROCESSING_VERSION =
|
|
37885
|
+
PROCESSING_VERSION = 8;
|
|
37886
37886
|
}
|
|
37887
37887
|
});
|
|
37888
37888
|
|
|
@@ -40262,7 +40262,7 @@ var init_daemon = __esm({
|
|
|
40262
40262
|
init_scan();
|
|
40263
40263
|
init_single_flight();
|
|
40264
40264
|
init_update();
|
|
40265
|
-
DAEMON_VERSION2 = true ? "daemon-0.
|
|
40265
|
+
DAEMON_VERSION2 = true ? "daemon-0.10.0" : "daemon-dev";
|
|
40266
40266
|
HEARTBEAT_INTERVAL_MS = 1e4;
|
|
40267
40267
|
SCAN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
40268
40268
|
DISCOVERY_INTERVAL_MS = 6e4;
|
|
@@ -40448,15 +40448,16 @@ function setupRuntime() {
|
|
|
40448
40448
|
return installBundle();
|
|
40449
40449
|
}
|
|
40450
40450
|
var NODE_LLAMA_CPP_FALLBACK_VERSION = "3.18.1";
|
|
40451
|
-
|
|
40451
|
+
var HF_TRANSFORMERS_FALLBACK_VERSION = "3.8.1";
|
|
40452
|
+
function sourcePkgVersion(sourceCli, pkgName) {
|
|
40452
40453
|
try {
|
|
40453
40454
|
const req = createRequire(sourceCli);
|
|
40454
|
-
let d = dirname6(realpathSync(req.resolve(
|
|
40455
|
+
let d = dirname6(realpathSync(req.resolve(pkgName)));
|
|
40455
40456
|
for (let i = 0; i < 10; i++) {
|
|
40456
40457
|
const pj = join8(d, "package.json");
|
|
40457
40458
|
if (existsSync9(pj)) {
|
|
40458
40459
|
const p = JSON.parse(readFileSync5(pj, "utf8"));
|
|
40459
|
-
if (p.name ===
|
|
40460
|
+
if (p.name === pkgName && p.version) return p.version;
|
|
40460
40461
|
}
|
|
40461
40462
|
const up = dirname6(d);
|
|
40462
40463
|
if (up === d) break;
|
|
@@ -40466,21 +40467,21 @@ function sourceLlamaVersion(sourceCli) {
|
|
|
40466
40467
|
}
|
|
40467
40468
|
return null;
|
|
40468
40469
|
}
|
|
40469
|
-
function
|
|
40470
|
-
const version =
|
|
40470
|
+
function stageNativePkg(sourceCli, pkgName, fallbackVersion, critical) {
|
|
40471
|
+
const version = sourcePkgVersion(sourceCli, pkgName) ?? fallbackVersion;
|
|
40471
40472
|
const dest = binDir();
|
|
40473
|
+
const pkgJson = join8(dest, "node_modules", ...pkgName.split("/"), "package.json");
|
|
40472
40474
|
try {
|
|
40473
|
-
const have = JSON.parse(
|
|
40474
|
-
|
|
40475
|
-
);
|
|
40476
|
-
if (have.version === version) return [`node-llama-cpp@${version} (cached)`];
|
|
40475
|
+
const have = JSON.parse(readFileSync5(pkgJson, "utf8"));
|
|
40476
|
+
if (have.version === version) return [`${pkgName}@${version} (cached)`];
|
|
40477
40477
|
} catch {
|
|
40478
40478
|
}
|
|
40479
40479
|
mkdirSync4(dest, { recursive: true });
|
|
40480
40480
|
const childEnv = { ...process.env };
|
|
40481
40481
|
delete childEnv.npm_config_global;
|
|
40482
40482
|
delete childEnv.npm_config_prefix;
|
|
40483
|
-
|
|
40483
|
+
const label = critical ? "summariser runtime" : "on-device embedder + PII/NER redactor";
|
|
40484
|
+
process.stderr.write(` \xB7 staging ${label} (${pkgName}@${version})\u2026
|
|
40484
40485
|
`);
|
|
40485
40486
|
const r = spawnSync2(
|
|
40486
40487
|
"npm",
|
|
@@ -40493,27 +40494,38 @@ function installNativeRuntime(sourceCli) {
|
|
|
40493
40494
|
"--omit=dev",
|
|
40494
40495
|
"--no-audit",
|
|
40495
40496
|
"--no-fund",
|
|
40496
|
-
// Prefer the npm cache the current install already populated
|
|
40497
|
-
//
|
|
40498
|
-
//
|
|
40499
|
-
//
|
|
40500
|
-
// daemon's summariser preflight re-stages) rather than hang indefinitely.
|
|
40497
|
+
// Prefer the npm cache the current install already populated — an offline
|
|
40498
|
+
// ~3s copy instead of a redundant network re-fetch. Only a genuine cache
|
|
40499
|
+
// miss touches the network, and a capped per-request timeout makes that
|
|
40500
|
+
// fail fast (the daemon re-stages on its next preflight) rather than hang.
|
|
40501
40501
|
"--prefer-offline",
|
|
40502
40502
|
"--fetch-timeout=60000",
|
|
40503
40503
|
"--loglevel=error",
|
|
40504
|
-
|
|
40504
|
+
`${pkgName}@${version}`
|
|
40505
40505
|
],
|
|
40506
40506
|
{ encoding: "utf8", stdio: "pipe", env: childEnv }
|
|
40507
40507
|
);
|
|
40508
40508
|
if (r.status !== 0) {
|
|
40509
40509
|
process.stderr.write(
|
|
40510
|
-
`[modelstat] couldn't stage the bundled summariser runtime via npm (
|
|
40510
|
+
critical ? `[modelstat] couldn't stage the bundled summariser runtime via npm (${pkgName}@${version}); the daemon's summariser preflight will fail until this is resolved.
|
|
40511
40511
|
${(r.stderr || r.stdout || "").trim()}
|
|
40512
|
+
` : `[modelstat] couldn't stage the on-device embedder/redactor (${pkgName}@${version}); the daemon falls back to server-side embedding + regex/LLM redaction (non-fatal).
|
|
40512
40513
|
`
|
|
40513
40514
|
);
|
|
40514
40515
|
return [];
|
|
40515
40516
|
}
|
|
40516
|
-
return [
|
|
40517
|
+
return [`${pkgName}@${version}`];
|
|
40518
|
+
}
|
|
40519
|
+
function installNativeRuntime(sourceCli) {
|
|
40520
|
+
return [
|
|
40521
|
+
...stageNativePkg(sourceCli, "node-llama-cpp", NODE_LLAMA_CPP_FALLBACK_VERSION, true),
|
|
40522
|
+
...stageNativePkg(
|
|
40523
|
+
sourceCli,
|
|
40524
|
+
"@huggingface/transformers",
|
|
40525
|
+
HF_TRANSFORMERS_FALLBACK_VERSION,
|
|
40526
|
+
false
|
|
40527
|
+
)
|
|
40528
|
+
];
|
|
40517
40529
|
}
|
|
40518
40530
|
function nodeBinary() {
|
|
40519
40531
|
return process.execPath;
|
|
@@ -40867,7 +40879,7 @@ function tryOpenBrowser(url) {
|
|
|
40867
40879
|
return false;
|
|
40868
40880
|
}
|
|
40869
40881
|
}
|
|
40870
|
-
var DAEMON_VERSION3 = true ? "daemon-0.
|
|
40882
|
+
var DAEMON_VERSION3 = true ? "daemon-0.10.0" : "daemon-dev";
|
|
40871
40883
|
function osFamily() {
|
|
40872
40884
|
const p = platform6();
|
|
40873
40885
|
if (p === "darwin") return "macos";
|