chatlab-cli 0.27.1 → 0.27.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/{chat-command-B7POB3C3.mjs → chat-command-QVCZVDSB.mjs} +5 -5
- package/dist/{chunk-I7BHOZPX.mjs → chunk-B2VLK3FB.mjs} +35 -2
- package/dist/{chunk-I7BHOZPX.mjs.map → chunk-B2VLK3FB.mjs.map} +1 -1
- package/dist/{chunk-N3G43SCQ.mjs → chunk-DHRSLYUM.mjs} +105 -9
- package/dist/chunk-DHRSLYUM.mjs.map +1 -0
- package/dist/{chunk-3JNVGW62.mjs → chunk-H22VDCPB.mjs} +2 -2
- package/dist/{chunk-SIVERPF5.mjs → chunk-JOXF6ROV.mjs} +44 -9
- package/dist/chunk-JOXF6ROV.mjs.map +1 -0
- package/dist/{chunk-3FUF3PEY.mjs → chunk-K7UUN3HT.mjs} +11 -11
- package/dist/{chunk-SAE2H2LN.mjs → chunk-MDDWX2MG.mjs} +3 -3
- package/dist/{chunk-WQMKKUSD.mjs → chunk-OD3YH23N.mjs} +2 -2
- package/dist/{chunk-RJ4D4QWK.mjs → chunk-PXWAYFII.mjs} +3 -3
- package/dist/{chunk-YUFYTDRH.mjs → chunk-ST5APJB2.mjs} +3 -3
- package/dist/cli.mjs +4 -4
- package/dist/{http-A54ZBBAY.mjs → http-LSCVGWCI.mjs} +9 -9
- package/dist/{import-EA3TB3S2.mjs → import-E6HBJMMT.mjs} +5 -5
- package/dist/index.mjs +9 -9
- package/dist/{mcp-DJDOWHH3.mjs → mcp-I7JUC5JV.mjs} +5 -5
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{src-EKPMJRG6.mjs → src-HZILDI7C.mjs} +5 -3
- package/dist/{stream-import-FQFNRQ2B.mjs → stream-import-IMRULRS2.mjs} +4 -4
- package/dist/{worker-runtime-UH2OBO3T.mjs → worker-runtime-WWQ7W74Q.mjs} +2 -2
- package/dist-web/assets/{DebugToolsPanel.vue_vue_type_script_setup_true_lang-NL1sTF6i.js → DebugToolsPanel.vue_vue_type_script_setup_true_lang-Du1FDD8L.js} +4 -4
- package/dist-web/assets/{MessageExportModal-B60rvfCh.js → MessageExportModal-4ehLHG4x.js} +1 -1
- package/dist-web/assets/{electron-BRUg9LnY.js → electron-B3AteJC8.js} +1 -1
- package/dist-web/assets/electron-DGxVMsvC.js +1 -0
- package/dist-web/assets/{fetch-BIpjJHxj.js → fetch-BQxv_UGQ.js} +1 -1
- package/dist-web/assets/{fetch-DSN-QYZE.js → fetch-BUcl-Frr.js} +1 -1
- package/dist-web/assets/{fetch-DE8gj5Ke.js → fetch-BwQh9WUD.js} +1 -1
- package/dist-web/assets/{fetch-woAa3H2L.js → fetch-C2mSdG3h.js} +1 -1
- package/dist-web/assets/{fetch-Cma-mZjd.js → fetch-CZDFhvxY.js} +1 -1
- package/dist-web/assets/{fetch-DNSaxRnL.js → fetch-ChZEF_n3.js} +1 -1
- package/dist-web/assets/{fetch-BRsMdFcn.js → fetch-DCQN6wfR.js} +1 -1
- package/dist-web/assets/{fetch-DLAp7h55.js → fetch-DZFx8FA4.js} +1 -1
- package/dist-web/assets/{fetch-C-m3IysH.js → fetch-DlJFgbum.js} +1 -1
- package/dist-web/assets/{fetch-DOEbyLSD.js → fetch-O8M5ZWsc.js} +1 -1
- package/dist-web/assets/index-B_uZZGqi.js +173 -0
- package/dist-web/assets/{index-YmzTgkb2.css → index-CoX0L-A8.css} +1 -1
- package/dist-web/assets/{index-B3mDjury.js → index-DR78oafF.js} +7 -7
- package/dist-web/assets/{index-iwqJDVMJ.js → index-DTlfOd_u.js} +2 -2
- package/dist-web/assets/{index-r_zHR2t9.js → index-DlkH2E7N.js} +1 -1
- package/dist-web/assets/{index-B9I-Y3fR.js → index-KAFPL6dl.js} +1 -1
- package/dist-web/assets/{index-o6veAyTB.js → index-qVTX1tLg.js} +3 -3
- package/dist-web/assets/web-CoKgy4Oo.js +1 -0
- package/dist-web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-N3G43SCQ.mjs.map +0 -1
- package/dist/chunk-SIVERPF5.mjs.map +0 -1
- package/dist-web/assets/electron-CRSL7qPM.js +0 -1
- package/dist-web/assets/index-GAU7LI1r.js +0 -173
- package/dist-web/assets/web-C2UtGskd.js +0 -1
- /package/dist/{chat-command-B7POB3C3.mjs.map → chat-command-QVCZVDSB.mjs.map} +0 -0
- /package/dist/{chunk-3JNVGW62.mjs.map → chunk-H22VDCPB.mjs.map} +0 -0
- /package/dist/{chunk-3FUF3PEY.mjs.map → chunk-K7UUN3HT.mjs.map} +0 -0
- /package/dist/{chunk-SAE2H2LN.mjs.map → chunk-MDDWX2MG.mjs.map} +0 -0
- /package/dist/{chunk-WQMKKUSD.mjs.map → chunk-OD3YH23N.mjs.map} +0 -0
- /package/dist/{chunk-RJ4D4QWK.mjs.map → chunk-PXWAYFII.mjs.map} +0 -0
- /package/dist/{chunk-YUFYTDRH.mjs.map → chunk-ST5APJB2.mjs.map} +0 -0
- /package/dist/{http-A54ZBBAY.mjs.map → http-LSCVGWCI.mjs.map} +0 -0
- /package/dist/{import-EA3TB3S2.mjs.map → import-E6HBJMMT.mjs.map} +0 -0
- /package/dist/{mcp-DJDOWHH3.mjs.map → mcp-I7JUC5JV.mjs.map} +0 -0
- /package/dist/{src-EKPMJRG6.mjs.map → src-HZILDI7C.mjs.map} +0 -0
- /package/dist/{stream-import-FQFNRQ2B.mjs.map → stream-import-IMRULRS2.mjs.map} +0 -0
- /package/dist/{worker-runtime-UH2OBO3T.mjs.map → worker-runtime-WWQ7W74Q.mjs.map} +0 -0
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
vecTableName,
|
|
83
83
|
vecTableSchema,
|
|
84
84
|
writeConfigField
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-B2VLK3FB.mjs";
|
|
86
86
|
import {
|
|
87
87
|
__commonJS,
|
|
88
88
|
__export,
|
|
@@ -698,8 +698,8 @@ var require_FilterBase = __commonJS({
|
|
|
698
698
|
var FilterBase = class _FilterBase extends Transform {
|
|
699
699
|
static stringFilter(string, separator) {
|
|
700
700
|
return (stack) => {
|
|
701
|
-
const
|
|
702
|
-
return
|
|
701
|
+
const path19 = stack.join(separator);
|
|
702
|
+
return path19.length === string.length && path19 === string || path19.length > string.length && path19.substr(0, string.length) === string && path19.substr(string.length, separator.length) === separator;
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
static regExpFilter(regExp, separator) {
|
|
@@ -1153,12 +1153,12 @@ var require_Assembler = __commonJS({
|
|
|
1153
1153
|
return (this.stack.length >> 1) + (this.done ? 0 : 1);
|
|
1154
1154
|
}
|
|
1155
1155
|
get path() {
|
|
1156
|
-
const
|
|
1156
|
+
const path19 = [];
|
|
1157
1157
|
for (let i = 0; i < this.stack.length; i += 2) {
|
|
1158
1158
|
const key = this.stack[i + 1];
|
|
1159
|
-
|
|
1159
|
+
path19.push(key === null ? this.stack[i].length : key);
|
|
1160
1160
|
}
|
|
1161
|
-
return
|
|
1161
|
+
return path19;
|
|
1162
1162
|
}
|
|
1163
1163
|
dropToLevel(level) {
|
|
1164
1164
|
if (level < this.depth) {
|
|
@@ -6893,6 +6893,101 @@ function* serializeChatLabToJsonl(data) {
|
|
|
6893
6893
|
}
|
|
6894
6894
|
}
|
|
6895
6895
|
|
|
6896
|
+
// ../../packages/node-runtime/src/services/analytics.ts
|
|
6897
|
+
import * as fs23 from "fs";
|
|
6898
|
+
import * as path17 from "path";
|
|
6899
|
+
var REGIONS = {
|
|
6900
|
+
US: "https://us.aptabase.com",
|
|
6901
|
+
EU: "https://eu.aptabase.com"
|
|
6902
|
+
};
|
|
6903
|
+
var DEFAULT_DATA = { lastReportDate: null, firstReportDate: null, enabled: true };
|
|
6904
|
+
var AnalyticsService = class {
|
|
6905
|
+
dataPath;
|
|
6906
|
+
endpoint;
|
|
6907
|
+
appKey;
|
|
6908
|
+
appVersion;
|
|
6909
|
+
sessionId;
|
|
6910
|
+
constructor(systemDir, appKey, appVersion) {
|
|
6911
|
+
this.dataPath = path17.join(systemDir, "analytics.json");
|
|
6912
|
+
this.appKey = appKey;
|
|
6913
|
+
this.appVersion = appVersion;
|
|
6914
|
+
this.sessionId = `${Math.floor(Date.now() / 1e3)}${Math.floor(Math.random() * 1e8).toString().padStart(8, "0")}`;
|
|
6915
|
+
const parts = appKey.split("-");
|
|
6916
|
+
const base = parts.length === 3 ? REGIONS[parts[1]] : void 0;
|
|
6917
|
+
this.endpoint = base ? `${base}/api/v0/event` : null;
|
|
6918
|
+
}
|
|
6919
|
+
load() {
|
|
6920
|
+
try {
|
|
6921
|
+
if (fs23.existsSync(this.dataPath)) {
|
|
6922
|
+
return { ...DEFAULT_DATA, ...JSON.parse(fs23.readFileSync(this.dataPath, "utf-8")) };
|
|
6923
|
+
}
|
|
6924
|
+
} catch (_e) {
|
|
6925
|
+
}
|
|
6926
|
+
return { ...DEFAULT_DATA };
|
|
6927
|
+
}
|
|
6928
|
+
save(data) {
|
|
6929
|
+
try {
|
|
6930
|
+
fs23.writeFileSync(this.dataPath, JSON.stringify(data, null, 2), "utf-8");
|
|
6931
|
+
} catch (e) {
|
|
6932
|
+
console.error("[Analytics] Failed to save:", e);
|
|
6933
|
+
}
|
|
6934
|
+
}
|
|
6935
|
+
getEnabled() {
|
|
6936
|
+
return this.load().enabled;
|
|
6937
|
+
}
|
|
6938
|
+
setEnabled(enabled) {
|
|
6939
|
+
const data = this.load();
|
|
6940
|
+
data.enabled = enabled;
|
|
6941
|
+
this.save(data);
|
|
6942
|
+
}
|
|
6943
|
+
async track(eventName, props) {
|
|
6944
|
+
if (!this.endpoint) return false;
|
|
6945
|
+
if (!this.getEnabled()) return false;
|
|
6946
|
+
try {
|
|
6947
|
+
const resp = await fetch(this.endpoint, {
|
|
6948
|
+
method: "POST",
|
|
6949
|
+
headers: { "Content-Type": "application/json", "App-Key": this.appKey },
|
|
6950
|
+
body: JSON.stringify({
|
|
6951
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6952
|
+
sessionId: this.sessionId,
|
|
6953
|
+
eventName,
|
|
6954
|
+
systemProps: {
|
|
6955
|
+
isDebug: false,
|
|
6956
|
+
locale: "",
|
|
6957
|
+
osName: process.platform,
|
|
6958
|
+
osVersion: "",
|
|
6959
|
+
engineName: "Node.js",
|
|
6960
|
+
engineVersion: process.versions.node,
|
|
6961
|
+
appVersion: this.appVersion,
|
|
6962
|
+
sdkVersion: "chatlab@1"
|
|
6963
|
+
},
|
|
6964
|
+
props
|
|
6965
|
+
})
|
|
6966
|
+
});
|
|
6967
|
+
return resp.ok;
|
|
6968
|
+
} catch (e) {
|
|
6969
|
+
console.error(`[Analytics] Failed to track ${eventName}:`, e);
|
|
6970
|
+
return false;
|
|
6971
|
+
}
|
|
6972
|
+
}
|
|
6973
|
+
async trackDailyActive(props) {
|
|
6974
|
+
if (!this.endpoint) return;
|
|
6975
|
+
const data = this.load();
|
|
6976
|
+
if (!data.enabled) return;
|
|
6977
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
6978
|
+
const isNew = data.firstReportDate === null;
|
|
6979
|
+
if (isNew) data.firstReportDate = today;
|
|
6980
|
+
if (data.lastReportDate === today) {
|
|
6981
|
+
if (isNew) this.save(data);
|
|
6982
|
+
return;
|
|
6983
|
+
}
|
|
6984
|
+
const tracked = await this.track(isNew ? "app_active_new" : "app_active", props);
|
|
6985
|
+
if (!tracked) return;
|
|
6986
|
+
data.lastReportDate = today;
|
|
6987
|
+
this.save(data);
|
|
6988
|
+
}
|
|
6989
|
+
};
|
|
6990
|
+
|
|
6896
6991
|
// ../../packages/node-runtime/src/semantic-index/index.ts
|
|
6897
6992
|
var semantic_index_exports = {};
|
|
6898
6993
|
__export(semantic_index_exports, {
|
|
@@ -6952,7 +7047,7 @@ __export(semantic_index_exports, {
|
|
|
6952
7047
|
});
|
|
6953
7048
|
|
|
6954
7049
|
// ../../packages/node-runtime/src/semantic-index/worker-client.ts
|
|
6955
|
-
import
|
|
7050
|
+
import path18 from "path";
|
|
6956
7051
|
|
|
6957
7052
|
// ../../packages/node-runtime/src/semantic-index/worker-thread-transport.ts
|
|
6958
7053
|
import { Worker } from "worker_threads";
|
|
@@ -7255,7 +7350,7 @@ function createSemanticIndexWorkerClient(options) {
|
|
|
7255
7350
|
}
|
|
7256
7351
|
function createSemanticIndexWorkerRuntimeClient(options) {
|
|
7257
7352
|
const configStore = new SemanticIndexConfigStore(
|
|
7258
|
-
|
|
7353
|
+
path18.join(options.pathProvider.getAiDataDir(), SEMANTIC_INDEX_CONFIG_FILE)
|
|
7259
7354
|
);
|
|
7260
7355
|
return createSemanticIndexWorkerClient({
|
|
7261
7356
|
configStore,
|
|
@@ -7331,7 +7426,8 @@ export {
|
|
|
7331
7426
|
checkConflictsFromSources,
|
|
7332
7427
|
buildMergedOutput,
|
|
7333
7428
|
serializeChatLabToJsonl,
|
|
7429
|
+
AnalyticsService,
|
|
7334
7430
|
createSemanticIndexWorkerRuntimeClient,
|
|
7335
7431
|
semantic_index_exports
|
|
7336
7432
|
};
|
|
7337
|
-
//# sourceMappingURL=chunk-
|
|
7433
|
+
//# sourceMappingURL=chunk-DHRSLYUM.mjs.map
|