engine7 7.1.61 → 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 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 createRequire2 } from "node:module";
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 = createRequire2(import.meta.url);
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";
@@ -19990,6 +20012,41 @@ function emitTurn(result, model) {
19990
20012
  });
19991
20013
  }
19992
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
+ }
19993
20050
  const args = parseCcRunArgs(argv);
19994
20051
  if (!args) {
19995
20052
  process.stderr.write('cc-run: \u9700\u8981 -p "<prompt>" \u6216 --input-format stream-json \u4ECE stdin \u6536\n');
@@ -20701,6 +20758,13 @@ import * as path29 from "node:path";
20701
20758
  import * as fs27 from "node:fs";
20702
20759
  import * as readline3 from "node:readline";
20703
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
+ };
20704
20768
  var __filename = fileURLToPath(import.meta.url);
20705
20769
  var __dirname = path29.dirname(__filename);
20706
20770
  var SCHEMA_VERSION = 1;
@@ -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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "engine7",
3
- "version": "7.1.61",
3
+ "version": "7.1.62",
4
4
  "type": "module",
5
5
  "description": "Engine 7 — 给助手一个家 / A home for your AI assistant",
6
6
  "main": "dist/main.mjs",