engine7 7.1.60 → 7.1.62
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 +78 -4
- package/dist/engine-startup.mjs +20 -2
- package/dist/main.mjs +20 -2
- 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";
|
|
@@ -19735,6 +19757,8 @@ function parseCcRunArgs(argv) {
|
|
|
19735
19757
|
args.configName = takeValue().trim();
|
|
19736
19758
|
} else if (a === "--agent") {
|
|
19737
19759
|
args.agentName = takeValue().trim();
|
|
19760
|
+
} else if (a === "--resume") {
|
|
19761
|
+
takeValue();
|
|
19738
19762
|
}
|
|
19739
19763
|
}
|
|
19740
19764
|
if (!hasPrompt) {
|
|
@@ -19885,6 +19909,14 @@ async function runQuery(args) {
|
|
|
19885
19909
|
systemPrompt,
|
|
19886
19910
|
channels: config.channels,
|
|
19887
19911
|
config,
|
|
19912
|
+
// 0902 修2: recall 走 everos——之前 deps 没传 everosCfg,handle-query 每单打
|
|
19913
|
+
// "everosCfg not configured, falling back to LLM recall",sideQuery 拿整个任务
|
|
19914
|
+
// prompt 当查询词(查"赢男"召回"cc-run 协议")+ 拖 30-65s。装配对齐 engine-startup:680。
|
|
19915
|
+
everosCfg: config.everos ? {
|
|
19916
|
+
...config.everos,
|
|
19917
|
+
llm: config.everos.llm?.provider && config.providers?.[config.everos.llm.provider] ? { ...config.everos.llm, apiKey: config.providers[config.everos.llm.provider].apiKey } : config.everos.llm,
|
|
19918
|
+
rerank: config.everos.rerank?.provider && config.providers?.[config.everos.rerank.provider] ? { ...config.everos.rerank, apiKey: config.providers[config.everos.rerank.provider].apiKey } : config.everos.rerank
|
|
19919
|
+
} : void 0,
|
|
19888
19920
|
mcpManager: void 0
|
|
19889
19921
|
};
|
|
19890
19922
|
let thinking = "";
|
|
@@ -19980,6 +20012,41 @@ function emitTurn(result, model) {
|
|
|
19980
20012
|
});
|
|
19981
20013
|
}
|
|
19982
20014
|
async function doCcRun(argv) {
|
|
20015
|
+
if (argv.includes("--list-models")) {
|
|
20016
|
+
try {
|
|
20017
|
+
const stateDirIdx = argv.indexOf("--state-dir");
|
|
20018
|
+
const configIdx = argv.indexOf("--config");
|
|
20019
|
+
const configVal = configIdx >= 0 ? argv[configIdx + 1] : "";
|
|
20020
|
+
let stateDir = stateDirIdx >= 0 ? argv[stateDirIdx + 1] : "";
|
|
20021
|
+
if (!stateDir) {
|
|
20022
|
+
const home = process.env.HOME || process.env.USERPROFILE || ".";
|
|
20023
|
+
try {
|
|
20024
|
+
const pointer = JSON.parse(readFileSync26(join35(home, ".engine7.json"), "utf-8"));
|
|
20025
|
+
stateDir = pointer.stateDir || join35(home, ".engine7");
|
|
20026
|
+
} catch {
|
|
20027
|
+
stateDir = join35(home, ".engine7");
|
|
20028
|
+
}
|
|
20029
|
+
}
|
|
20030
|
+
const configName = configVal.replace(/\.json$/, "") || "main7";
|
|
20031
|
+
const configPath = configVal.includes("/") || configVal.includes("\\") ? configVal : join35(stateDir, "configs", `${configName}.json`);
|
|
20032
|
+
loadSecretsEnv(stateDir, configName);
|
|
20033
|
+
const { loadConfig: loadConfig2 } = await Promise.resolve().then(() => (init_loader(), loader_exports));
|
|
20034
|
+
const config = loadConfig2(configPath);
|
|
20035
|
+
const models = [];
|
|
20036
|
+
for (const [pid, prov] of Object.entries(config.providers || {})) {
|
|
20037
|
+
for (const m of prov?.models || []) {
|
|
20038
|
+
const mid = typeof m === "string" ? m : m?.id;
|
|
20039
|
+
if (mid) models.push(`${pid}/${mid}`);
|
|
20040
|
+
}
|
|
20041
|
+
}
|
|
20042
|
+
process.stdout.write(JSON.stringify(models, null, 2) + "\n");
|
|
20043
|
+
} catch (e) {
|
|
20044
|
+
process.stdout.write("[]\n");
|
|
20045
|
+
process.stderr.write(`[cc-run] --list-models failed: ${e?.message}
|
|
20046
|
+
`);
|
|
20047
|
+
}
|
|
20048
|
+
return 0;
|
|
20049
|
+
}
|
|
19983
20050
|
const args = parseCcRunArgs(argv);
|
|
19984
20051
|
if (!args) {
|
|
19985
20052
|
process.stderr.write('cc-run: \u9700\u8981 -p "<prompt>" \u6216 --input-format stream-json \u4ECE stdin \u6536\n');
|
|
@@ -20691,6 +20758,13 @@ import * as path29 from "node:path";
|
|
|
20691
20758
|
import * as fs27 from "node:fs";
|
|
20692
20759
|
import * as readline3 from "node:readline";
|
|
20693
20760
|
import { fileURLToPath } from "node:url";
|
|
20761
|
+
var origEmitWarning = process.emitWarning.bind(process);
|
|
20762
|
+
process.emitWarning = (warning, ...rest) => {
|
|
20763
|
+
const name = typeof warning === "object" ? warning?.name : rest?.[0];
|
|
20764
|
+
const msg2 = typeof warning === "object" ? String(warning?.message) : String(warning);
|
|
20765
|
+
if (name === "ExperimentalWarning" && msg2.includes("SQLite")) return;
|
|
20766
|
+
return origEmitWarning(warning, ...rest);
|
|
20767
|
+
};
|
|
20694
20768
|
var __filename = fileURLToPath(import.meta.url);
|
|
20695
20769
|
var __dirname = path29.dirname(__filename);
|
|
20696
20770
|
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");
|
|
@@ -30486,7 +30500,7 @@ Use full ref like \`/primary ${candidates[0].ref}\``);
|
|
|
30486
30500
|
await fs45.promises.writeFile(writePath, JSON.stringify(cfg, null, 2), "utf-8");
|
|
30487
30501
|
console.log(`[primary] Persisted primary=${target} to ${writePath}`);
|
|
30488
30502
|
await ctx.reply(`\u2705 Primary model set to **${target}** (${candidates[0].name})
|
|
30489
|
-
Written to config
|
|
30503
|
+
Written to config, hot-reloading provider chain now.`);
|
|
30490
30504
|
} catch (err) {
|
|
30491
30505
|
await ctx.reply(`\u26A0\uFE0F Failed to write config: ${err.message}`);
|
|
30492
30506
|
}
|
|
@@ -32500,6 +32514,10 @@ async function doReloadConfig(config, deps, provider) {
|
|
|
32500
32514
|
lastLoadedConfigRaw = configRaw.trim();
|
|
32501
32515
|
const changes = [];
|
|
32502
32516
|
const oldProviderKey = JSON.stringify({
|
|
32517
|
+
// 0902 修:必须含"选中的 primary 是哪个 provider"——此前 key 只有 providers 整字典
|
|
32518
|
+
// + model 名,从 agentrouter/glm-5.3 切 zai-anthropic/glm-5.3(同模型名)时 key
|
|
32519
|
+
// 完全相同 → 不重建链 → /primary 热加载失效(翀哥 0902 15:03 实测切了还在走旧链)。
|
|
32520
|
+
primary: config.provider?.id,
|
|
32503
32521
|
providers: config.providers,
|
|
32504
32522
|
model: config.model,
|
|
32505
32523
|
fallbacks: config.fallbacks,
|
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");
|
|
@@ -30570,7 +30584,7 @@ Use full ref like \`/primary ${candidates[0].ref}\``);
|
|
|
30570
30584
|
await fs45.promises.writeFile(writePath, JSON.stringify(cfg, null, 2), "utf-8");
|
|
30571
30585
|
console.log(`[primary] Persisted primary=${target} to ${writePath}`);
|
|
30572
30586
|
await ctx.reply(`\u2705 Primary model set to **${target}** (${candidates[0].name})
|
|
30573
|
-
Written to config
|
|
30587
|
+
Written to config, hot-reloading provider chain now.`);
|
|
30574
30588
|
} catch (err) {
|
|
30575
30589
|
await ctx.reply(`\u26A0\uFE0F Failed to write config: ${err.message}`);
|
|
30576
30590
|
}
|
|
@@ -32584,6 +32598,10 @@ async function doReloadConfig(config2, deps, provider) {
|
|
|
32584
32598
|
lastLoadedConfigRaw = configRaw.trim();
|
|
32585
32599
|
const changes = [];
|
|
32586
32600
|
const oldProviderKey = JSON.stringify({
|
|
32601
|
+
// 0902 修:必须含"选中的 primary 是哪个 provider"——此前 key 只有 providers 整字典
|
|
32602
|
+
// + model 名,从 agentrouter/glm-5.3 切 zai-anthropic/glm-5.3(同模型名)时 key
|
|
32603
|
+
// 完全相同 → 不重建链 → /primary 热加载失效(翀哥 0902 15:03 实测切了还在走旧链)。
|
|
32604
|
+
primary: config2.provider?.id,
|
|
32587
32605
|
providers: config2.providers,
|
|
32588
32606
|
model: config2.model,
|
|
32589
32607
|
fallbacks: config2.fallbacks,
|