modelstat 0.8.1 → 0.8.2
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 +24 -12
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -36070,7 +36070,7 @@ var init_file_queue_store = __esm({
|
|
|
36070
36070
|
});
|
|
36071
36071
|
|
|
36072
36072
|
// ../../packages/daemon-core/src/node/llama.ts
|
|
36073
|
-
import { existsSync as existsSync7 } from "fs";
|
|
36073
|
+
import { existsSync as existsSync7, rmSync, writeFileSync as writeFileSync4 } from "fs";
|
|
36074
36074
|
import { mkdir } from "fs/promises";
|
|
36075
36075
|
import { homedir as homedir4 } from "os";
|
|
36076
36076
|
import { dirname as dirname5, join as join6 } from "path";
|
|
@@ -36178,9 +36178,21 @@ async function loadOnce(cfg) {
|
|
|
36178
36178
|
loadPromise = (async () => {
|
|
36179
36179
|
const llamaMod = await import("node-llama-cpp");
|
|
36180
36180
|
const modelPath = await ensureLlamaModel(cfg);
|
|
36181
|
-
const
|
|
36181
|
+
const guardPath = `${dirname5(modelPath)}/.metal-load-guard`;
|
|
36182
|
+
const metalAborted = existsSync7(guardPath);
|
|
36183
|
+
if (!metalAborted) {
|
|
36184
|
+
try {
|
|
36185
|
+
writeFileSync4(guardPath, "probing metal\n");
|
|
36186
|
+
} catch {
|
|
36187
|
+
}
|
|
36188
|
+
}
|
|
36189
|
+
const llama = await llamaMod.getLlama(metalAborted ? { gpu: false } : void 0);
|
|
36182
36190
|
llamaInstance = llama;
|
|
36183
36191
|
const model = await llama.loadModel({ modelPath });
|
|
36192
|
+
try {
|
|
36193
|
+
rmSync(guardPath, { force: true });
|
|
36194
|
+
} catch {
|
|
36195
|
+
}
|
|
36184
36196
|
const summariserContext = await model.createContext({
|
|
36185
36197
|
contextSize: cfg.contextSize
|
|
36186
36198
|
});
|
|
@@ -37181,7 +37193,7 @@ var init_scan = __esm({
|
|
|
37181
37193
|
init_api();
|
|
37182
37194
|
init_config2();
|
|
37183
37195
|
init_pipeline2();
|
|
37184
|
-
DAEMON_VERSION = true ? "daemon-0.8.
|
|
37196
|
+
DAEMON_VERSION = true ? "daemon-0.8.2" : "daemon-dev";
|
|
37185
37197
|
BATCH_MAX_EVENTS = INGEST_BATCH_MAX_EVENTS;
|
|
37186
37198
|
BATCH_MAX_TOOL_CALLS = 2e4;
|
|
37187
37199
|
BATCH_BUFFER_HARD_CAP = BATCH_MAX_EVENTS * 2;
|
|
@@ -37204,7 +37216,7 @@ import {
|
|
|
37204
37216
|
readFileSync as readFileSync6,
|
|
37205
37217
|
renameSync as renameSync3,
|
|
37206
37218
|
unlinkSync as unlinkSync2,
|
|
37207
|
-
writeFileSync as
|
|
37219
|
+
writeFileSync as writeFileSync6,
|
|
37208
37220
|
writeSync
|
|
37209
37221
|
} from "fs";
|
|
37210
37222
|
import { join as join9 } from "path";
|
|
@@ -37336,7 +37348,7 @@ var init_lock = __esm({
|
|
|
37336
37348
|
|
|
37337
37349
|
// src/update.ts
|
|
37338
37350
|
import { spawn as spawn2, spawnSync as spawnSync3 } from "child_process";
|
|
37339
|
-
import { mkdirSync as mkdirSync6, readFileSync as readFileSync8, renameSync as renameSync4, writeFileSync as
|
|
37351
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync8, renameSync as renameSync4, writeFileSync as writeFileSync7 } from "fs";
|
|
37340
37352
|
import { platform as platform4 } from "os";
|
|
37341
37353
|
function prefPath() {
|
|
37342
37354
|
return homePath("auto-update.json");
|
|
@@ -37352,7 +37364,7 @@ function storedAutoUpdate() {
|
|
|
37352
37364
|
function setStoredAutoUpdate(enabled) {
|
|
37353
37365
|
mkdirSync6(modelstatHome(), { recursive: true, mode: 448 });
|
|
37354
37366
|
const tmp = `${prefPath()}.${process.pid}.tmp`;
|
|
37355
|
-
|
|
37367
|
+
writeFileSync7(tmp, JSON.stringify({ autoUpdate: enabled }), { mode: 384 });
|
|
37356
37368
|
renameSync4(tmp, prefPath());
|
|
37357
37369
|
}
|
|
37358
37370
|
function parseFlag(v) {
|
|
@@ -37748,7 +37760,7 @@ var PROCESSING_VERSION;
|
|
|
37748
37760
|
var init_processing_version = __esm({
|
|
37749
37761
|
"src/processing-version.ts"() {
|
|
37750
37762
|
"use strict";
|
|
37751
|
-
PROCESSING_VERSION =
|
|
37763
|
+
PROCESSING_VERSION = 7;
|
|
37752
37764
|
}
|
|
37753
37765
|
});
|
|
37754
37766
|
|
|
@@ -40108,7 +40120,7 @@ var init_daemon = __esm({
|
|
|
40108
40120
|
init_scan();
|
|
40109
40121
|
init_single_flight();
|
|
40110
40122
|
init_update();
|
|
40111
|
-
DAEMON_VERSION2 = true ? "daemon-0.8.
|
|
40123
|
+
DAEMON_VERSION2 = true ? "daemon-0.8.2" : "daemon-dev";
|
|
40112
40124
|
HEARTBEAT_INTERVAL_MS = 1e4;
|
|
40113
40125
|
SCAN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
40114
40126
|
DISCOVERY_INTERVAL_MS = 6e4;
|
|
@@ -40249,7 +40261,7 @@ import {
|
|
|
40249
40261
|
readFileSync as readFileSync5,
|
|
40250
40262
|
realpathSync,
|
|
40251
40263
|
unlinkSync,
|
|
40252
|
-
writeFileSync as
|
|
40264
|
+
writeFileSync as writeFileSync5
|
|
40253
40265
|
} from "fs";
|
|
40254
40266
|
import { createRequire } from "module";
|
|
40255
40267
|
import { homedir as homedir6, platform as platform3, userInfo } from "os";
|
|
@@ -40411,7 +40423,7 @@ ${programArgs}
|
|
|
40411
40423
|
</dict>
|
|
40412
40424
|
</plist>
|
|
40413
40425
|
`;
|
|
40414
|
-
|
|
40426
|
+
writeFileSync5(p, plist, { mode: 420 });
|
|
40415
40427
|
return p;
|
|
40416
40428
|
}
|
|
40417
40429
|
function launchctl(args) {
|
|
@@ -40485,7 +40497,7 @@ StandardError=append:${join8(logDir(), "err.log")}
|
|
|
40485
40497
|
[Install]
|
|
40486
40498
|
WantedBy=default.target
|
|
40487
40499
|
`;
|
|
40488
|
-
|
|
40500
|
+
writeFileSync5(unitPath, unit, { mode: 420 });
|
|
40489
40501
|
return unitPath;
|
|
40490
40502
|
}
|
|
40491
40503
|
function systemctl(args) {
|
|
@@ -40712,7 +40724,7 @@ function tryOpenBrowser(url) {
|
|
|
40712
40724
|
return false;
|
|
40713
40725
|
}
|
|
40714
40726
|
}
|
|
40715
|
-
var DAEMON_VERSION3 = true ? "daemon-0.8.
|
|
40727
|
+
var DAEMON_VERSION3 = true ? "daemon-0.8.2" : "daemon-dev";
|
|
40716
40728
|
function osFamily() {
|
|
40717
40729
|
const p = platform6();
|
|
40718
40730
|
if (p === "darwin") return "macos";
|