engine7 7.1.61 → 7.1.63
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 +72 -5
- package/dist/engine-startup.mjs +15 -1
- package/dist/main.mjs +15 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
const require=(await import('node:module')).createRequire(import.meta.url)
|
|
2
|
+
const __origEmitWarning = process.emitWarning.bind(process);
|
|
3
|
+
process.emitWarning = (w, ...r) => {
|
|
4
|
+
const name = typeof w === 'object' ? w?.name : r?.[0];
|
|
5
|
+
const msg = typeof w === 'object' ? String(w?.message) : String(w);
|
|
6
|
+
if (name === 'ExperimentalWarning' && msg.includes('SQLite')) return;
|
|
7
|
+
return __origEmitWarning(w, ...r);
|
|
8
|
+
};
|
|
9
|
+
|
|
2
10
|
var __defProp = Object.defineProperty;
|
|
3
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
12
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -13532,9 +13540,13 @@ var init_body_move = __esm({
|
|
|
13532
13540
|
});
|
|
13533
13541
|
|
|
13534
13542
|
// src/calendar/db.ts
|
|
13535
|
-
import { DatabaseSync } from "node:sqlite";
|
|
13536
13543
|
import * as path21 from "node:path";
|
|
13537
13544
|
import * as fs20 from "node:fs";
|
|
13545
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
13546
|
+
function getSqlite() {
|
|
13547
|
+
if (!_sqlite) _sqlite = createRequire2(import.meta.url)("node:sqlite");
|
|
13548
|
+
return _sqlite;
|
|
13549
|
+
}
|
|
13538
13550
|
function openDb(workspace) {
|
|
13539
13551
|
const dir = path21.join(workspace, ".calendar");
|
|
13540
13552
|
fs20.mkdirSync(dir, { recursive: true });
|
|
@@ -13591,10 +13603,20 @@ function migrate(db) {
|
|
|
13591
13603
|
db.exec("ALTER TABLE events ADD COLUMN doc_path TEXT");
|
|
13592
13604
|
}
|
|
13593
13605
|
}
|
|
13594
|
-
var TZ_OFFSET_MS;
|
|
13606
|
+
var _sqlite, DatabaseSync, TZ_OFFSET_MS;
|
|
13595
13607
|
var init_db = __esm({
|
|
13596
13608
|
"src/calendar/db.ts"() {
|
|
13597
13609
|
"use strict";
|
|
13610
|
+
_sqlite = null;
|
|
13611
|
+
DatabaseSync = new Proxy(function() {
|
|
13612
|
+
}, {
|
|
13613
|
+
construct(_t, args) {
|
|
13614
|
+
return new (getSqlite()).DatabaseSync(...args);
|
|
13615
|
+
},
|
|
13616
|
+
get(_t, prop) {
|
|
13617
|
+
return getSqlite().DatabaseSync[prop];
|
|
13618
|
+
}
|
|
13619
|
+
});
|
|
13598
13620
|
TZ_OFFSET_MS = 8 * 60 * 60 * 1e3;
|
|
13599
13621
|
}
|
|
13600
13622
|
});
|
|
@@ -17038,7 +17060,7 @@ Return ONLY valid JSON: {"selected_memories": ["filename1.md", "filename2.md"]}`
|
|
|
17038
17060
|
// src/memory/memdir/findRelevantMemoriesVector.ts
|
|
17039
17061
|
import { statSync as statSync13 } from "node:fs";
|
|
17040
17062
|
import { join as join26, resolve as resolve7, sep as sep6 } from "node:path";
|
|
17041
|
-
import { createRequire as
|
|
17063
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
17042
17064
|
async function embedQuery(text, ollamaUrl, model) {
|
|
17043
17065
|
try {
|
|
17044
17066
|
const resp = await fetch(ollamaUrl, {
|
|
@@ -17226,7 +17248,7 @@ var require3, DEFAULT_TOP_K, DEFAULT_MIN_SCORE, DEFAULT_OLLAMA_URL, DEFAULT_OLLA
|
|
|
17226
17248
|
var init_findRelevantMemoriesVector = __esm({
|
|
17227
17249
|
"src/memory/memdir/findRelevantMemoriesVector.ts"() {
|
|
17228
17250
|
"use strict";
|
|
17229
|
-
require3 =
|
|
17251
|
+
require3 = createRequire3(import.meta.url);
|
|
17230
17252
|
DEFAULT_TOP_K = 3;
|
|
17231
17253
|
DEFAULT_MIN_SCORE = 0.3;
|
|
17232
17254
|
DEFAULT_OLLAMA_URL = "http://localhost:11434/api/embeddings";
|
|
@@ -19709,7 +19731,10 @@ function parseCcRunArgs(argv) {
|
|
|
19709
19731
|
return v;
|
|
19710
19732
|
};
|
|
19711
19733
|
if (a === "-p" || a === "--print") {
|
|
19712
|
-
|
|
19734
|
+
const next = argv[i + 1];
|
|
19735
|
+
if (next !== void 0 && !next.startsWith("-")) {
|
|
19736
|
+
args.prompt = takeValue();
|
|
19737
|
+
}
|
|
19713
19738
|
hasPrompt = true;
|
|
19714
19739
|
} else if (a === "--output-format") {
|
|
19715
19740
|
const v = takeValue();
|
|
@@ -19990,6 +20015,41 @@ function emitTurn(result, model) {
|
|
|
19990
20015
|
});
|
|
19991
20016
|
}
|
|
19992
20017
|
async function doCcRun(argv) {
|
|
20018
|
+
if (argv.includes("--list-models")) {
|
|
20019
|
+
try {
|
|
20020
|
+
const stateDirIdx = argv.indexOf("--state-dir");
|
|
20021
|
+
const configIdx = argv.indexOf("--config");
|
|
20022
|
+
const configVal = configIdx >= 0 ? argv[configIdx + 1] : "";
|
|
20023
|
+
let stateDir = stateDirIdx >= 0 ? argv[stateDirIdx + 1] : "";
|
|
20024
|
+
if (!stateDir) {
|
|
20025
|
+
const home = process.env.HOME || process.env.USERPROFILE || ".";
|
|
20026
|
+
try {
|
|
20027
|
+
const pointer = JSON.parse(readFileSync26(join35(home, ".engine7.json"), "utf-8"));
|
|
20028
|
+
stateDir = pointer.stateDir || join35(home, ".engine7");
|
|
20029
|
+
} catch {
|
|
20030
|
+
stateDir = join35(home, ".engine7");
|
|
20031
|
+
}
|
|
20032
|
+
}
|
|
20033
|
+
const configName = configVal.replace(/\.json$/, "") || "main7";
|
|
20034
|
+
const configPath = configVal.includes("/") || configVal.includes("\\") ? configVal : join35(stateDir, "configs", `${configName}.json`);
|
|
20035
|
+
loadSecretsEnv(stateDir, configName);
|
|
20036
|
+
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loader(), loader_exports));
|
|
20037
|
+
const config = loadConfig2(configPath);
|
|
20038
|
+
const models = [];
|
|
20039
|
+
for (const [pid, prov] of Object.entries(config.providers || {})) {
|
|
20040
|
+
for (const m of prov?.models || []) {
|
|
20041
|
+
const mid = typeof m === "string" ? m : m?.id;
|
|
20042
|
+
if (mid) models.push(`${pid}/${mid}`);
|
|
20043
|
+
}
|
|
20044
|
+
}
|
|
20045
|
+
process.stdout.write(JSON.stringify(models, null, 2) + "\n");
|
|
20046
|
+
} catch (e) {
|
|
20047
|
+
process.stdout.write("[]\n");
|
|
20048
|
+
process.stderr.write(`[cc-run] --list-models failed: ${e?.message}
|
|
20049
|
+
`);
|
|
20050
|
+
}
|
|
20051
|
+
return 0;
|
|
20052
|
+
}
|
|
19993
20053
|
const args = parseCcRunArgs(argv);
|
|
19994
20054
|
if (!args) {
|
|
19995
20055
|
process.stderr.write('cc-run: \u9700\u8981 -p "<prompt>" \u6216 --input-format stream-json \u4ECE stdin \u6536\n');
|
|
@@ -20701,6 +20761,13 @@ import * as path29 from "node:path";
|
|
|
20701
20761
|
import * as fs27 from "node:fs";
|
|
20702
20762
|
import * as readline3 from "node:readline";
|
|
20703
20763
|
import { fileURLToPath } from "node:url";
|
|
20764
|
+
var origEmitWarning = process.emitWarning.bind(process);
|
|
20765
|
+
process.emitWarning = (warning, ...rest) => {
|
|
20766
|
+
const name = typeof warning === "object" ? warning?.name : rest?.[0];
|
|
20767
|
+
const msg2 = typeof warning === "object" ? String(warning?.message) : String(warning);
|
|
20768
|
+
if (name === "ExperimentalWarning" && msg2.includes("SQLite")) return;
|
|
20769
|
+
return origEmitWarning(warning, ...rest);
|
|
20770
|
+
};
|
|
20704
20771
|
var __filename = fileURLToPath(import.meta.url);
|
|
20705
20772
|
var __dirname = path29.dirname(__filename);
|
|
20706
20773
|
var SCHEMA_VERSION = 1;
|
package/dist/engine-startup.mjs
CHANGED
|
@@ -22559,9 +22559,23 @@ function taskIdFromTitle(title) {
|
|
|
22559
22559
|
}
|
|
22560
22560
|
|
|
22561
22561
|
// src/calendar/db.ts
|
|
22562
|
-
import { DatabaseSync } from "node:sqlite";
|
|
22563
22562
|
import * as path21 from "node:path";
|
|
22564
22563
|
import * as fs21 from "node:fs";
|
|
22564
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
22565
|
+
var _sqlite = null;
|
|
22566
|
+
function getSqlite() {
|
|
22567
|
+
if (!_sqlite) _sqlite = createRequire2(import.meta.url)("node:sqlite");
|
|
22568
|
+
return _sqlite;
|
|
22569
|
+
}
|
|
22570
|
+
var DatabaseSync = new Proxy(function() {
|
|
22571
|
+
}, {
|
|
22572
|
+
construct(_t, args) {
|
|
22573
|
+
return new (getSqlite()).DatabaseSync(...args);
|
|
22574
|
+
},
|
|
22575
|
+
get(_t, prop) {
|
|
22576
|
+
return getSqlite().DatabaseSync[prop];
|
|
22577
|
+
}
|
|
22578
|
+
});
|
|
22565
22579
|
var TZ_OFFSET_MS = 8 * 60 * 60 * 1e3;
|
|
22566
22580
|
function openDb(workspace) {
|
|
22567
22581
|
const dir = path21.join(workspace, ".calendar");
|
package/dist/main.mjs
CHANGED
|
@@ -22933,9 +22933,23 @@ function taskIdFromTitle(title) {
|
|
|
22933
22933
|
}
|
|
22934
22934
|
|
|
22935
22935
|
// src/calendar/db.ts
|
|
22936
|
-
import { DatabaseSync } from "node:sqlite";
|
|
22937
22936
|
import * as path21 from "node:path";
|
|
22938
22937
|
import * as fs21 from "node:fs";
|
|
22938
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
22939
|
+
var _sqlite = null;
|
|
22940
|
+
function getSqlite() {
|
|
22941
|
+
if (!_sqlite) _sqlite = createRequire2(import.meta.url)("node:sqlite");
|
|
22942
|
+
return _sqlite;
|
|
22943
|
+
}
|
|
22944
|
+
var DatabaseSync = new Proxy(function() {
|
|
22945
|
+
}, {
|
|
22946
|
+
construct(_t, args2) {
|
|
22947
|
+
return new (getSqlite()).DatabaseSync(...args2);
|
|
22948
|
+
},
|
|
22949
|
+
get(_t, prop) {
|
|
22950
|
+
return getSqlite().DatabaseSync[prop];
|
|
22951
|
+
}
|
|
22952
|
+
});
|
|
22939
22953
|
var TZ_OFFSET_MS = 8 * 60 * 60 * 1e3;
|
|
22940
22954
|
function openDb(workspace) {
|
|
22941
22955
|
const dir = path21.join(workspace, ".calendar");
|