chatlab-cli 0.24.0 → 0.24.1
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/README.md +5 -2
- package/dist/{chunk-KCBIBRHL.mjs → chunk-43XWYC3M.mjs} +2 -2
- package/dist/{chunk-A6JCL4PT.mjs → chunk-CIIQ3S2X.mjs} +24 -10
- package/dist/chunk-CIIQ3S2X.mjs.map +1 -0
- package/dist/{chunk-XJJXSOLO.mjs → chunk-N5DGZQB4.mjs} +172 -41
- package/dist/chunk-N5DGZQB4.mjs.map +1 -0
- package/dist/{chunk-RLCFXTTS.mjs → chunk-QJI6AOAT.mjs} +2 -2
- package/dist/{chunk-36W2HWQN.mjs → chunk-QY6P2YS7.mjs} +2 -2
- package/dist/{chunk-NE4A6PND.mjs → chunk-ZL322NVL.mjs} +23 -26
- package/dist/chunk-ZL322NVL.mjs.map +1 -0
- package/dist/cli.mjs +2 -2
- package/dist/{http-OPQ352FZ.mjs → http-TPX74BLK.mjs} +6 -6
- package/dist/{import-GZMDLK2E.mjs → import-B745DRHD.mjs} +4 -4
- package/dist/index.mjs +6 -6
- package/dist/{mcp-SHZ2CVXY.mjs → mcp-YWAVG5XW.mjs} +3 -3
- package/dist/{stream-import-RDDB3N7B.mjs → stream-import-OPALPVWF.mjs} +3 -3
- package/dist/{update-checker-JG5K67O2.mjs → update-checker-JIBA7T4U.mjs} +24 -21
- package/dist/update-checker-JIBA7T4U.mjs.map +1 -0
- package/dist-web/assets/{DebugToolsPanel.vue_vue_type_script_setup_true_lang-_gbTn1ha.js → DebugToolsPanel.vue_vue_type_script_setup_true_lang-BBDrsJfe.js} +9 -9
- package/dist-web/assets/MessageExportModal-CSfaY25B.js +1 -0
- package/dist-web/assets/{electron-BIWBW8k_.js → electron-BUeXfvxT.js} +1 -1
- package/dist-web/assets/electron-BynNUuEA.js +1 -0
- package/dist-web/assets/{fetch-BhsrPRzn.js → fetch-B2q6973s.js} +1 -1
- package/dist-web/assets/{fetch-CnyupWWc.js → fetch-BGMRmQx0.js} +2 -2
- package/dist-web/assets/{fetch-ClDGP9DK.js → fetch-BneHn5qk.js} +1 -1
- package/dist-web/assets/{fetch-DwPB8NOH.js → fetch-BohUj3CQ.js} +1 -1
- package/dist-web/assets/{fetch-BOevuRK_.js → fetch-BtHwWs8A.js} +1 -1
- package/dist-web/assets/{fetch-DFWZ48Xw.js → fetch-CARsBVl0.js} +1 -1
- package/dist-web/assets/{fetch-CvaXKzA-.js → fetch-Ck3tjoLa.js} +1 -1
- package/dist-web/assets/{fetch-DKD1bKt2.js → fetch-DypPduyQ.js} +1 -1
- package/dist-web/assets/{fetch-ChECfwh7.js → fetch-DzNuFdFM.js} +1 -1
- package/dist-web/assets/{fetch-D1_jL6PO.js → fetch-RDFt3hmp.js} +1 -1
- package/dist-web/assets/index-BRwEubUe.js +173 -0
- package/dist-web/assets/{index-Bzg8BftZ.js → index-BvaWRM6_.js} +1 -1
- package/dist-web/assets/{index-BVQsKKwg.js → index-Bvlj3dMn.js} +1 -1
- package/dist-web/assets/{index-D6ga3hbF.js → index-C5LrQG3N.js} +3 -3
- package/dist-web/assets/index-DB-iqXzV.css +1 -0
- package/dist-web/assets/index-DCWvD-4L.js +2 -0
- package/dist-web/assets/index-DS1rzk1I.js +8 -0
- package/dist-web/assets/{vendor-nuxt-ui-BLMzqeB8.js → vendor-nuxt-ui-BYU7dz8t.js} +1 -1
- package/dist-web/assets/{web-DtlveK3q.js → web-CXPkmhis.js} +1 -1
- package/dist-web/index.html +3 -3
- package/package.json +1 -1
- package/dist/chunk-A6JCL4PT.mjs.map +0 -1
- package/dist/chunk-NE4A6PND.mjs.map +0 -1
- package/dist/chunk-XJJXSOLO.mjs.map +0 -1
- package/dist/update-checker-JG5K67O2.mjs.map +0 -1
- package/dist-web/assets/MessageExportModal-n4JgNg_F.js +0 -1
- package/dist-web/assets/electron-Bt9dK4Sr.js +0 -1
- package/dist-web/assets/index-BN79SJSr.js +0 -173
- package/dist-web/assets/index-C-5bP7_E.js +0 -2
- package/dist-web/assets/index-ESCx9pRR.js +0 -8
- package/dist-web/assets/index-JbR9Q-bb.css +0 -1
- package/dist-web/assets/model-catalog-DUuKjIVU.js +0 -1
- /package/dist/{chunk-KCBIBRHL.mjs.map → chunk-43XWYC3M.mjs.map} +0 -0
- /package/dist/{chunk-RLCFXTTS.mjs.map → chunk-QJI6AOAT.mjs.map} +0 -0
- /package/dist/{chunk-36W2HWQN.mjs.map → chunk-QY6P2YS7.mjs.map} +0 -0
- /package/dist/{http-OPQ352FZ.mjs.map → http-TPX74BLK.mjs.map} +0 -0
- /package/dist/{import-GZMDLK2E.mjs.map → import-B745DRHD.mjs.map} +0 -0
- /package/dist/{mcp-SHZ2CVXY.mjs.map → mcp-YWAVG5XW.mjs.map} +0 -0
- /package/dist/{stream-import-RDDB3N7B.mjs.map → stream-import-OPALPVWF.mjs.map} +0 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
generateMessageKey,
|
|
12
12
|
openBetterSqliteDatabase,
|
|
13
13
|
writeParseResultToDb
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-N5DGZQB4.mjs";
|
|
15
15
|
|
|
16
16
|
// src/import/chatlab-reader.ts
|
|
17
17
|
import * as fs from "fs";
|
|
@@ -392,4 +392,4 @@ export {
|
|
|
392
392
|
parseFile,
|
|
393
393
|
importData
|
|
394
394
|
};
|
|
395
|
-
//# sourceMappingURL=chunk-
|
|
395
|
+
//# sourceMappingURL=chunk-QJI6AOAT.mjs.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
incrementalImport,
|
|
14
14
|
openBetterSqliteDatabase,
|
|
15
15
|
streamingImport
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-N5DGZQB4.mjs";
|
|
17
17
|
|
|
18
18
|
// src/import/stream-import.ts
|
|
19
19
|
import * as fs from "fs";
|
|
@@ -141,4 +141,4 @@ export {
|
|
|
141
141
|
analyzeIncrementalImport2 as analyzeIncrementalImport,
|
|
142
142
|
analyzeNewImport2 as analyzeNewImport
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=chunk-
|
|
144
|
+
//# sourceMappingURL=chunk-QY6P2YS7.mjs.map
|
|
@@ -7,17 +7,17 @@ const __dirname = __pathDirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
importData,
|
|
9
9
|
parseFile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QJI6AOAT.mjs";
|
|
11
11
|
import {
|
|
12
12
|
analyzeIncrementalImport,
|
|
13
13
|
analyzeNewImport,
|
|
14
14
|
incrementalImport,
|
|
15
15
|
streamImport
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QY6P2YS7.mjs";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_TOOL_REGISTRY,
|
|
19
19
|
CoreDataProvider
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-43XWYC3M.mjs";
|
|
21
21
|
import {
|
|
22
22
|
getVersion
|
|
23
23
|
} from "./chunk-5ADKYYNA.mjs";
|
|
@@ -106,6 +106,7 @@ import {
|
|
|
106
106
|
initNlpDir,
|
|
107
107
|
initTokenizer,
|
|
108
108
|
isDictDownloaded,
|
|
109
|
+
isNewerStableVersion,
|
|
109
110
|
loadConfig,
|
|
110
111
|
member_service_exports,
|
|
111
112
|
mergeRulesForLocale,
|
|
@@ -127,7 +128,7 @@ import {
|
|
|
127
128
|
verifyCliDataPath,
|
|
128
129
|
writeAuthProfile,
|
|
129
130
|
writeConfigField
|
|
130
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-N5DGZQB4.mjs";
|
|
131
132
|
import {
|
|
132
133
|
resolveCliPath
|
|
133
134
|
} from "./chunk-FJ35V3TE.mjs";
|
|
@@ -1047,7 +1048,7 @@ function registerAiLlmRoutes(server2, ctx) {
|
|
|
1047
1048
|
return getDefaultRulesForLocale(request.query.locale ?? "zh-CN");
|
|
1048
1049
|
});
|
|
1049
1050
|
server2.post("/_web/ai/desensitize-rules/merge", async (request) => {
|
|
1050
|
-
return mergeRulesForLocale(request.body.existingRules, request.body.locale);
|
|
1051
|
+
return mergeRulesForLocale(request.body.existingRules, request.body.locale, request.body.overrides ?? {});
|
|
1051
1052
|
});
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
@@ -2304,21 +2305,20 @@ async function showPathInFolder(filePath, platform = process.platform, runner) {
|
|
|
2304
2305
|
}
|
|
2305
2306
|
}
|
|
2306
2307
|
|
|
2307
|
-
// src/http/routes/web/
|
|
2308
|
-
function
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2308
|
+
// src/http/routes/web/update-check.ts
|
|
2309
|
+
function isDevelopmentPlaceholderVersion(version) {
|
|
2310
|
+
return /^0\.0\.0(?:$|-)/.test(version.trim());
|
|
2311
|
+
}
|
|
2312
|
+
function buildWebUpdateCheckResult(options) {
|
|
2313
|
+
const latestVersion = options.latestVersion || options.currentVersion;
|
|
2314
|
+
return {
|
|
2315
|
+
hasUpdate: !isDevelopmentPlaceholderVersion(options.currentVersion) && isNewerStableVersion(latestVersion, options.currentVersion),
|
|
2316
|
+
currentVersion: options.currentVersion,
|
|
2317
|
+
latestVersion
|
|
2313
2318
|
};
|
|
2314
|
-
const l = parse(latest);
|
|
2315
|
-
const c = parse(current);
|
|
2316
|
-
if (l.major !== c.major) return l.major > c.major;
|
|
2317
|
-
if (l.minor !== c.minor) return l.minor > c.minor;
|
|
2318
|
-
if (l.patch !== c.patch) return l.patch > c.patch;
|
|
2319
|
-
if (c.pre && !l.pre) return true;
|
|
2320
|
-
return false;
|
|
2321
2319
|
}
|
|
2320
|
+
|
|
2321
|
+
// src/http/routes/web/index.ts
|
|
2322
2322
|
function registerWebRoutes(server2, dbManager2, options) {
|
|
2323
2323
|
const adapter = createDatabaseManagerAdapter(dbManager2);
|
|
2324
2324
|
const mergeCache = options?.pathProvider ? new MergeSessionCache(options.pathProvider, { nativeBinding: options.nativeBinding }) : null;
|
|
@@ -2337,7 +2337,7 @@ function registerWebRoutes(server2, dbManager2, options) {
|
|
|
2337
2337
|
const resolvedPathProvider = options?.pathProvider ?? fallbackPathProvider;
|
|
2338
2338
|
const ai = options?.aiContext;
|
|
2339
2339
|
const cliStreamImport = async (dm, filePath) => {
|
|
2340
|
-
const { streamImport: streamImport2 } = await import("./stream-import-
|
|
2340
|
+
const { streamImport: streamImport2 } = await import("./stream-import-OPALPVWF.mjs");
|
|
2341
2341
|
const result = await streamImport2(dm, filePath);
|
|
2342
2342
|
if (!result.sessionId) throw new Error("Import succeeded but no sessionId returned");
|
|
2343
2343
|
return { sessionId: result.sessionId };
|
|
@@ -2387,19 +2387,16 @@ function registerWebRoutes(server2, dbManager2, options) {
|
|
|
2387
2387
|
registerImportRoutes(server2, dbManager2);
|
|
2388
2388
|
server2.get("/_web/system/check-update", async () => {
|
|
2389
2389
|
const currentVersion = getVersion();
|
|
2390
|
-
const packageName = "chatlab-cli";
|
|
2391
2390
|
try {
|
|
2392
|
-
const resp = await fetch(
|
|
2391
|
+
const resp = await fetch("https://chatlab.fun/latest-version", {
|
|
2393
2392
|
headers: { Accept: "application/json" },
|
|
2394
2393
|
signal: AbortSignal.timeout(1e4)
|
|
2395
2394
|
});
|
|
2396
2395
|
if (!resp.ok) {
|
|
2397
|
-
return { hasUpdate: false, currentVersion, error: `
|
|
2396
|
+
return { hasUpdate: false, currentVersion, error: `latest-version HTTP ${resp.status}` };
|
|
2398
2397
|
}
|
|
2399
2398
|
const data = await resp.json();
|
|
2400
|
-
|
|
2401
|
-
const hasUpdate = isNewerVersion(latestVersion, currentVersion);
|
|
2402
|
-
return { hasUpdate, currentVersion, latestVersion };
|
|
2399
|
+
return buildWebUpdateCheckResult({ currentVersion, latestVersion: data.version });
|
|
2403
2400
|
} catch (err) {
|
|
2404
2401
|
return {
|
|
2405
2402
|
hasUpdate: false,
|
|
@@ -3896,4 +3893,4 @@ export {
|
|
|
3896
3893
|
startHttpServer,
|
|
3897
3894
|
stopHttpServer
|
|
3898
3895
|
};
|
|
3899
|
-
//# sourceMappingURL=chunk-
|
|
3896
|
+
//# sourceMappingURL=chunk-ZL322NVL.mjs.map
|