@costrict/csc 4.1.11 → 4.2.0

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.
@@ -427,7 +427,7 @@ async function appendDeadLetter(entry) {
427
427
  // src/services/rawDump/worker.ts
428
428
  import { promises as fs7 } from "fs";
429
429
  import { createHash as createHash2 } from "crypto";
430
- import os7 from "os";
430
+ import os5 from "os";
431
431
  import path7 from "path";
432
432
  import { fileURLToPath } from "url";
433
433
 
@@ -477,8 +477,8 @@ async function saveCoStrictCredentials(credentials) {
477
477
  import { createRequire } from "module";
478
478
  function getVersion() {
479
479
  try {
480
- if (typeof MACRO !== "undefined" && "4.1.11")
481
- return "4.1.11";
480
+ if (typeof MACRO !== "undefined" && "4.2.0")
481
+ return "4.2.0";
482
482
  } catch {}
483
483
  try {
484
484
  const require2 = createRequire(import.meta.url);
@@ -824,21 +824,454 @@ async function releaseQueueLock() {
824
824
 
825
825
  // src/services/rawDump/history.ts
826
826
  import { promises as fs5 } from "fs";
827
- import os5 from "os";
828
827
  import path5 from "path";
829
- var HISTORY_FILE = path5.join(os5.homedir(), ".claude", "history.jsonl");
828
+
829
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
830
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
831
+ var _freeGlobal_default = freeGlobal;
832
+
833
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js
834
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
835
+ var root = _freeGlobal_default || freeSelf || Function("return this")();
836
+ var _root_default = root;
837
+
838
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js
839
+ var Symbol2 = _root_default.Symbol;
840
+ var _Symbol_default = Symbol2;
841
+
842
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js
843
+ var objectProto = Object.prototype;
844
+ var hasOwnProperty = objectProto.hasOwnProperty;
845
+ var nativeObjectToString = objectProto.toString;
846
+ var symToStringTag = _Symbol_default ? _Symbol_default.toStringTag : undefined;
847
+ function getRawTag(value) {
848
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
849
+ try {
850
+ value[symToStringTag] = undefined;
851
+ var unmasked = true;
852
+ } catch (e) {}
853
+ var result = nativeObjectToString.call(value);
854
+ if (unmasked) {
855
+ if (isOwn) {
856
+ value[symToStringTag] = tag;
857
+ } else {
858
+ delete value[symToStringTag];
859
+ }
860
+ }
861
+ return result;
862
+ }
863
+ var _getRawTag_default = getRawTag;
864
+
865
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js
866
+ var objectProto2 = Object.prototype;
867
+ var nativeObjectToString2 = objectProto2.toString;
868
+ function objectToString(value) {
869
+ return nativeObjectToString2.call(value);
870
+ }
871
+ var _objectToString_default = objectToString;
872
+
873
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js
874
+ var nullTag = "[object Null]";
875
+ var undefinedTag = "[object Undefined]";
876
+ var symToStringTag2 = _Symbol_default ? _Symbol_default.toStringTag : undefined;
877
+ function baseGetTag(value) {
878
+ if (value == null) {
879
+ return value === undefined ? undefinedTag : nullTag;
880
+ }
881
+ return symToStringTag2 && symToStringTag2 in Object(value) ? _getRawTag_default(value) : _objectToString_default(value);
882
+ }
883
+ var _baseGetTag_default = baseGetTag;
884
+
885
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js
886
+ function isObject(value) {
887
+ var type = typeof value;
888
+ return value != null && (type == "object" || type == "function");
889
+ }
890
+ var isObject_default = isObject;
891
+
892
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js
893
+ var asyncTag = "[object AsyncFunction]";
894
+ var funcTag = "[object Function]";
895
+ var genTag = "[object GeneratorFunction]";
896
+ var proxyTag = "[object Proxy]";
897
+ function isFunction(value) {
898
+ if (!isObject_default(value)) {
899
+ return false;
900
+ }
901
+ var tag = _baseGetTag_default(value);
902
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
903
+ }
904
+ var isFunction_default = isFunction;
905
+
906
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js
907
+ var coreJsData = _root_default["__core-js_shared__"];
908
+ var _coreJsData_default = coreJsData;
909
+
910
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js
911
+ var maskSrcKey = function() {
912
+ var uid = /[^.]+$/.exec(_coreJsData_default && _coreJsData_default.keys && _coreJsData_default.keys.IE_PROTO || "");
913
+ return uid ? "Symbol(src)_1." + uid : "";
914
+ }();
915
+ function isMasked(func) {
916
+ return !!maskSrcKey && maskSrcKey in func;
917
+ }
918
+ var _isMasked_default = isMasked;
919
+
920
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js
921
+ var funcProto = Function.prototype;
922
+ var funcToString = funcProto.toString;
923
+ function toSource(func) {
924
+ if (func != null) {
925
+ try {
926
+ return funcToString.call(func);
927
+ } catch (e) {}
928
+ try {
929
+ return func + "";
930
+ } catch (e) {}
931
+ }
932
+ return "";
933
+ }
934
+ var _toSource_default = toSource;
935
+
936
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js
937
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
938
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
939
+ var funcProto2 = Function.prototype;
940
+ var objectProto3 = Object.prototype;
941
+ var funcToString2 = funcProto2.toString;
942
+ var hasOwnProperty2 = objectProto3.hasOwnProperty;
943
+ var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
944
+ function baseIsNative(value) {
945
+ if (!isObject_default(value) || _isMasked_default(value)) {
946
+ return false;
947
+ }
948
+ var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
949
+ return pattern.test(_toSource_default(value));
950
+ }
951
+ var _baseIsNative_default = baseIsNative;
952
+
953
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js
954
+ function getValue(object, key) {
955
+ return object == null ? undefined : object[key];
956
+ }
957
+ var _getValue_default = getValue;
958
+
959
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js
960
+ function getNative(object, key) {
961
+ var value = _getValue_default(object, key);
962
+ return _baseIsNative_default(value) ? value : undefined;
963
+ }
964
+ var _getNative_default = getNative;
965
+
966
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js
967
+ var nativeCreate = _getNative_default(Object, "create");
968
+ var _nativeCreate_default = nativeCreate;
969
+
970
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js
971
+ function hashClear() {
972
+ this.__data__ = _nativeCreate_default ? _nativeCreate_default(null) : {};
973
+ this.size = 0;
974
+ }
975
+ var _hashClear_default = hashClear;
976
+
977
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js
978
+ function hashDelete(key) {
979
+ var result = this.has(key) && delete this.__data__[key];
980
+ this.size -= result ? 1 : 0;
981
+ return result;
982
+ }
983
+ var _hashDelete_default = hashDelete;
984
+
985
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js
986
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
987
+ var objectProto4 = Object.prototype;
988
+ var hasOwnProperty3 = objectProto4.hasOwnProperty;
989
+ function hashGet(key) {
990
+ var data = this.__data__;
991
+ if (_nativeCreate_default) {
992
+ var result = data[key];
993
+ return result === HASH_UNDEFINED ? undefined : result;
994
+ }
995
+ return hasOwnProperty3.call(data, key) ? data[key] : undefined;
996
+ }
997
+ var _hashGet_default = hashGet;
998
+
999
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js
1000
+ var objectProto5 = Object.prototype;
1001
+ var hasOwnProperty4 = objectProto5.hasOwnProperty;
1002
+ function hashHas(key) {
1003
+ var data = this.__data__;
1004
+ return _nativeCreate_default ? data[key] !== undefined : hasOwnProperty4.call(data, key);
1005
+ }
1006
+ var _hashHas_default = hashHas;
1007
+
1008
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js
1009
+ var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
1010
+ function hashSet(key, value) {
1011
+ var data = this.__data__;
1012
+ this.size += this.has(key) ? 0 : 1;
1013
+ data[key] = _nativeCreate_default && value === undefined ? HASH_UNDEFINED2 : value;
1014
+ return this;
1015
+ }
1016
+ var _hashSet_default = hashSet;
1017
+
1018
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js
1019
+ function Hash(entries) {
1020
+ var index = -1, length = entries == null ? 0 : entries.length;
1021
+ this.clear();
1022
+ while (++index < length) {
1023
+ var entry = entries[index];
1024
+ this.set(entry[0], entry[1]);
1025
+ }
1026
+ }
1027
+ Hash.prototype.clear = _hashClear_default;
1028
+ Hash.prototype["delete"] = _hashDelete_default;
1029
+ Hash.prototype.get = _hashGet_default;
1030
+ Hash.prototype.has = _hashHas_default;
1031
+ Hash.prototype.set = _hashSet_default;
1032
+ var _Hash_default = Hash;
1033
+
1034
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js
1035
+ function listCacheClear() {
1036
+ this.__data__ = [];
1037
+ this.size = 0;
1038
+ }
1039
+ var _listCacheClear_default = listCacheClear;
1040
+
1041
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js
1042
+ function eq(value, other) {
1043
+ return value === other || value !== value && other !== other;
1044
+ }
1045
+ var eq_default = eq;
1046
+
1047
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js
1048
+ function assocIndexOf(array, key) {
1049
+ var length = array.length;
1050
+ while (length--) {
1051
+ if (eq_default(array[length][0], key)) {
1052
+ return length;
1053
+ }
1054
+ }
1055
+ return -1;
1056
+ }
1057
+ var _assocIndexOf_default = assocIndexOf;
1058
+
1059
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js
1060
+ var arrayProto = Array.prototype;
1061
+ var splice = arrayProto.splice;
1062
+ function listCacheDelete(key) {
1063
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
1064
+ if (index < 0) {
1065
+ return false;
1066
+ }
1067
+ var lastIndex = data.length - 1;
1068
+ if (index == lastIndex) {
1069
+ data.pop();
1070
+ } else {
1071
+ splice.call(data, index, 1);
1072
+ }
1073
+ --this.size;
1074
+ return true;
1075
+ }
1076
+ var _listCacheDelete_default = listCacheDelete;
1077
+
1078
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js
1079
+ function listCacheGet(key) {
1080
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
1081
+ return index < 0 ? undefined : data[index][1];
1082
+ }
1083
+ var _listCacheGet_default = listCacheGet;
1084
+
1085
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js
1086
+ function listCacheHas(key) {
1087
+ return _assocIndexOf_default(this.__data__, key) > -1;
1088
+ }
1089
+ var _listCacheHas_default = listCacheHas;
1090
+
1091
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js
1092
+ function listCacheSet(key, value) {
1093
+ var data = this.__data__, index = _assocIndexOf_default(data, key);
1094
+ if (index < 0) {
1095
+ ++this.size;
1096
+ data.push([key, value]);
1097
+ } else {
1098
+ data[index][1] = value;
1099
+ }
1100
+ return this;
1101
+ }
1102
+ var _listCacheSet_default = listCacheSet;
1103
+
1104
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js
1105
+ function ListCache(entries) {
1106
+ var index = -1, length = entries == null ? 0 : entries.length;
1107
+ this.clear();
1108
+ while (++index < length) {
1109
+ var entry = entries[index];
1110
+ this.set(entry[0], entry[1]);
1111
+ }
1112
+ }
1113
+ ListCache.prototype.clear = _listCacheClear_default;
1114
+ ListCache.prototype["delete"] = _listCacheDelete_default;
1115
+ ListCache.prototype.get = _listCacheGet_default;
1116
+ ListCache.prototype.has = _listCacheHas_default;
1117
+ ListCache.prototype.set = _listCacheSet_default;
1118
+ var _ListCache_default = ListCache;
1119
+
1120
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js
1121
+ var Map2 = _getNative_default(_root_default, "Map");
1122
+ var _Map_default = Map2;
1123
+
1124
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js
1125
+ function mapCacheClear() {
1126
+ this.size = 0;
1127
+ this.__data__ = {
1128
+ hash: new _Hash_default,
1129
+ map: new (_Map_default || _ListCache_default),
1130
+ string: new _Hash_default
1131
+ };
1132
+ }
1133
+ var _mapCacheClear_default = mapCacheClear;
1134
+
1135
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js
1136
+ function isKeyable(value) {
1137
+ var type = typeof value;
1138
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1139
+ }
1140
+ var _isKeyable_default = isKeyable;
1141
+
1142
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js
1143
+ function getMapData(map, key) {
1144
+ var data = map.__data__;
1145
+ return _isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1146
+ }
1147
+ var _getMapData_default = getMapData;
1148
+
1149
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js
1150
+ function mapCacheDelete(key) {
1151
+ var result = _getMapData_default(this, key)["delete"](key);
1152
+ this.size -= result ? 1 : 0;
1153
+ return result;
1154
+ }
1155
+ var _mapCacheDelete_default = mapCacheDelete;
1156
+
1157
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js
1158
+ function mapCacheGet(key) {
1159
+ return _getMapData_default(this, key).get(key);
1160
+ }
1161
+ var _mapCacheGet_default = mapCacheGet;
1162
+
1163
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js
1164
+ function mapCacheHas(key) {
1165
+ return _getMapData_default(this, key).has(key);
1166
+ }
1167
+ var _mapCacheHas_default = mapCacheHas;
1168
+
1169
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js
1170
+ function mapCacheSet(key, value) {
1171
+ var data = _getMapData_default(this, key), size = data.size;
1172
+ data.set(key, value);
1173
+ this.size += data.size == size ? 0 : 1;
1174
+ return this;
1175
+ }
1176
+ var _mapCacheSet_default = mapCacheSet;
1177
+
1178
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js
1179
+ function MapCache(entries) {
1180
+ var index = -1, length = entries == null ? 0 : entries.length;
1181
+ this.clear();
1182
+ while (++index < length) {
1183
+ var entry = entries[index];
1184
+ this.set(entry[0], entry[1]);
1185
+ }
1186
+ }
1187
+ MapCache.prototype.clear = _mapCacheClear_default;
1188
+ MapCache.prototype["delete"] = _mapCacheDelete_default;
1189
+ MapCache.prototype.get = _mapCacheGet_default;
1190
+ MapCache.prototype.has = _mapCacheHas_default;
1191
+ MapCache.prototype.set = _mapCacheSet_default;
1192
+ var _MapCache_default = MapCache;
1193
+
1194
+ // node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js
1195
+ var FUNC_ERROR_TEXT = "Expected a function";
1196
+ function memoize(func, resolver) {
1197
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
1198
+ throw new TypeError(FUNC_ERROR_TEXT);
1199
+ }
1200
+ var memoized = function() {
1201
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
1202
+ if (cache.has(key)) {
1203
+ return cache.get(key);
1204
+ }
1205
+ var result = func.apply(this, args);
1206
+ memoized.cache = cache.set(key, result) || cache;
1207
+ return result;
1208
+ };
1209
+ memoized.cache = new (memoize.Cache || _MapCache_default);
1210
+ return memoized;
1211
+ }
1212
+ memoize.Cache = _MapCache_default;
1213
+ var memoize_default = memoize;
1214
+
1215
+ // src/utils/envUtils.ts
1216
+ import { homedir as homedir2 } from "os";
1217
+ import { join as join2 } from "path";
1218
+
1219
+ // src/constants/branding.ts
1220
+ var PRODUCT_URL = "https://costrict.ai";
1221
+ var PRODUCT_DOCS_URL = `${PRODUCT_URL}/docs`;
1222
+ var PRODUCT_CHROME_URL = `${PRODUCT_URL}/chrome`;
1223
+ var PRODUCT_SETTINGS_URL = `${PRODUCT_URL}/settings`;
1224
+ var PRODUCT_CODE_URL = `${PRODUCT_URL}/code`;
1225
+ var PRODUCT_SESSION_URL = `${PRODUCT_URL}/session`;
1226
+ var PRODUCT_UPGRADE_URL = `${PRODUCT_URL}/upgrade/max`;
1227
+ var PRODUCT_DOWNLOAD_URL = `${PRODUCT_URL}/download`;
1228
+ var PRODUCT_DESKTOP_API_URL = `${PRODUCT_URL}/api/desktop`;
1229
+ var PRODUCT_OAUTH_CLIENT_METADATA_URL = `${PRODUCT_URL}/oauth/costrict-client-metadata`;
1230
+ var CONFIG_DIR_NAME = ".costrict";
1231
+ var LEGACY_CONFIG_DIR_NAME = ".claude";
1232
+
1233
+ // src/utils/envUtils.ts
1234
+ var getCostrictConfigHomeDir = memoize_default(() => {
1235
+ return (process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR ?? join2(homedir2(), CONFIG_DIR_NAME)).normalize("NFC");
1236
+ }, () => process.env.COSTRICT_CONFIG_DIR ?? process.env.CLAUDE_CONFIG_DIR);
1237
+ var getClaudeConfigHomeDir = getCostrictConfigHomeDir;
1238
+ function getLegacyConfigHomeDir() {
1239
+ if (process.env.COSTRICT_CONFIG_DIR || process.env.CLAUDE_CONFIG_DIR) {
1240
+ return;
1241
+ }
1242
+ return join2(homedir2(), LEGACY_CONFIG_DIR_NAME).normalize("NFC");
1243
+ }
1244
+
1245
+ // src/services/rawDump/history.ts
1246
+ var HISTORY_FILE = path5.join(getClaudeConfigHomeDir(), "history.jsonl");
1247
+ var LEGACY_HISTORY_FILE = (() => {
1248
+ const legacy = getLegacyConfigHomeDir();
1249
+ return legacy ? path5.join(legacy, "history.jsonl") : null;
1250
+ })();
1251
+ async function resolveHistoryFilePath() {
1252
+ try {
1253
+ const s = await fs5.stat(HISTORY_FILE);
1254
+ return { path: HISTORY_FILE, mtimeMs: Number(s.mtimeMs), size: Number(s.size) };
1255
+ } catch {}
1256
+ if (LEGACY_HISTORY_FILE) {
1257
+ try {
1258
+ const s = await fs5.stat(LEGACY_HISTORY_FILE);
1259
+ return { path: LEGACY_HISTORY_FILE, mtimeMs: Number(s.mtimeMs), size: Number(s.size) };
1260
+ } catch {}
1261
+ }
1262
+ return null;
1263
+ }
830
1264
  var cache = null;
831
1265
  async function loadHistory() {
832
1266
  const items = [];
833
- let fileStat = null;
834
- try {
835
- fileStat = await fs5.stat(HISTORY_FILE);
836
- } catch {
1267
+ const resolved = await resolveHistoryFilePath();
1268
+ if (!resolved) {
837
1269
  cache = null;
838
1270
  return [];
839
1271
  }
1272
+ const { path: historyFile, mtimeMs, size } = resolved;
840
1273
  try {
841
- const content = await fs5.readFile(HISTORY_FILE, "utf-8");
1274
+ const content = await fs5.readFile(historyFile, "utf-8");
842
1275
  const lines = content.split(`
843
1276
  `);
844
1277
  for (const line of lines) {
@@ -853,36 +1286,32 @@ async function loadHistory() {
853
1286
  return cache?.items ?? [];
854
1287
  }
855
1288
  cache = {
856
- mtime: fileStat.mtimeMs,
857
- size: fileStat.size,
1289
+ mtime: mtimeMs,
1290
+ size,
858
1291
  items
859
1292
  };
860
1293
  return cache.items;
861
1294
  }
862
1295
  async function autoLoadHistory() {
863
- let fileStat = null;
864
- try {
865
- fileStat = await fs5.stat(HISTORY_FILE);
866
- } catch {
1296
+ const resolved = await resolveHistoryFilePath();
1297
+ if (!resolved) {
867
1298
  if (cache) {
868
1299
  return null;
869
1300
  }
870
1301
  return [];
871
1302
  }
872
- if (cache && cache.mtime === fileStat.mtimeMs && cache.size === fileStat.size) {
1303
+ if (cache && cache.mtime === resolved.mtimeMs && cache.size === resolved.size) {
873
1304
  return cache.items;
874
1305
  }
875
1306
  return await loadHistory();
876
1307
  }
877
1308
  async function getProjectDirs() {
878
1309
  if (cache) {
879
- let fileStat = null;
880
- try {
881
- fileStat = await fs5.stat(HISTORY_FILE);
882
- } catch {
1310
+ const resolved = await resolveHistoryFilePath();
1311
+ if (!resolved) {
883
1312
  return [...new Set(cache.items.map((item) => item.project))];
884
1313
  }
885
- if (fileStat.mtimeMs === cache.mtime && fileStat.size === cache.size) {
1314
+ if (resolved.mtimeMs === cache.mtime && resolved.size === cache.size) {
886
1315
  return [...new Set(cache.items.map((item) => item.project))];
887
1316
  }
888
1317
  }
@@ -892,7 +1321,6 @@ async function getProjectDirs() {
892
1321
 
893
1322
  // src/services/rawDump/session.ts
894
1323
  import { promises as fs6 } from "fs";
895
- import os6 from "os";
896
1324
  import path6 from "path";
897
1325
 
898
1326
  // src/services/rawDump/parse.ts
@@ -964,8 +1392,8 @@ function fillConversation(conv) {
964
1392
  let outputTokens = 0;
965
1393
  let cacheReadInputTokens = 0;
966
1394
  let cacheCreationInputTokens = 0;
967
- let startTime = undefined;
968
- let endTime = undefined;
1395
+ let startTime;
1396
+ let endTime;
969
1397
  conv.events.forEach((evt) => {
970
1398
  if (evt.timestamp) {
971
1399
  const t = new Date(evt.timestamp);
@@ -1254,9 +1682,6 @@ function parseSession(cacheConversations, events) {
1254
1682
 
1255
1683
  // src/services/rawDump/session.ts
1256
1684
  var log2 = createLogger("session");
1257
- function getClaudeConfigHomeDir() {
1258
- return process.env.CLAUDE_CONFIG_HOME || path6.join(os6.homedir(), ".claude");
1259
- }
1260
1685
  function normalizeProjectPath2(dir) {
1261
1686
  return dir.replace(/:/g, "-").replace(/[/\\]/g, "-");
1262
1687
  }
@@ -1267,8 +1692,8 @@ function getSessionDirectory(directory) {
1267
1692
  path6.join(claudeHome, "projects", projectPath),
1268
1693
  path6.join(claudeHome, "transcripts"),
1269
1694
  path6.join(claudeHome, "sessions"),
1270
- path6.join(directory, ".claude", "sessions"),
1271
- path6.join(directory, ".claude"),
1695
+ path6.join(directory, CONFIG_DIR_NAME, "sessions"),
1696
+ path6.join(directory, CONFIG_DIR_NAME),
1272
1697
  directory,
1273
1698
  process.env.CSC_SESSION_DIR || ""
1274
1699
  ];
@@ -1871,7 +2296,7 @@ async function uploadSummary(payload, authData) {
1871
2296
  client_ide: "cli",
1872
2297
  client_version: authData.version,
1873
2298
  client_os: detectOs(),
1874
- client_os_version: os7.release(),
2299
+ client_os_version: os5.release(),
1875
2300
  caller: process.env.CSC_RAW_DUMP_CALLER || "chat"
1876
2301
  };
1877
2302
  await uploadReport(authData, "/raw-store/task-summary", body);
@@ -2173,10 +2598,10 @@ if (scriptPath.endsWith("worker.ts") || scriptPath.endsWith("worker.js")) {
2173
2598
 
2174
2599
  // src/services/rawDump/timerWorker.ts
2175
2600
  import { promises as fs8 } from "fs";
2176
- import os8 from "os";
2601
+ import os6 from "os";
2177
2602
  import path8 from "path";
2178
2603
  var log5 = createLogger("timer");
2179
- var TIMER_LOCK_FILE = path8.join(os8.homedir(), ".claude", "raw-dump", "csc-timer.lock");
2604
+ var TIMER_LOCK_FILE = path8.join(os6.homedir(), ".claude", "raw-dump", "csc-timer.lock");
2180
2605
  var isRunning = false;
2181
2606
  async function acquireTimerLock() {
2182
2607
  try {
@@ -2288,5 +2713,5 @@ export {
2288
2713
  startBatchWorker
2289
2714
  };
2290
2715
 
2291
- //# debugId=2644B5BA08355EE564756E2164756E21
2716
+ //# debugId=449D577A7A20A18F64756E2164756E21
2292
2717
  //# sourceMappingURL=batchWorker.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@costrict/csc",
3
- "version": "4.1.11",
3
+ "version": "4.2.0",
4
4
  "description": "costrict",
5
5
  "type": "module",
6
6
  "author": "costrict",
@@ -29,8 +29,7 @@
29
29
  },
30
30
  "workspaces": [
31
31
  "packages/*",
32
- "packages/@ant/*",
33
- "packages/@anthropic-ai/*"
32
+ "packages/@costrict/*"
34
33
  ],
35
34
  "files": [
36
35
  "dist",
@@ -79,6 +78,7 @@
79
78
  "docs:dev": "npx mintlify dev",
80
79
  "typecheck": "tsc --noEmit",
81
80
  "rcs": "bun run scripts/rcs.ts",
81
+ "self-verify": "bun run scripts/self-verify.ts",
82
82
  "security:scan": "bun run scripts/security-scan.ts"
83
83
  },
84
84
  "dependencies": {
@@ -97,18 +97,18 @@
97
97
  },
98
98
  "devDependencies": {
99
99
  "@alcalzone/ansi-tokenize": "^0.3.0",
100
- "@ant/claude-for-chrome-mcp": "workspace:*",
101
- "@ant/computer-use-input": "workspace:*",
102
- "@ant/computer-use-mcp": "workspace:*",
103
- "@ant/computer-use-swift": "workspace:*",
104
- "@ant/model-provider": "workspace:*",
100
+ "@costrict/chrome-mcp": "workspace:*",
101
+ "@costrict/computer-use-input": "workspace:*",
102
+ "@costrict/computer-use-mcp": "workspace:*",
103
+ "@costrict/computer-use-swift": "workspace:*",
104
+ "@costrict/model-provider": "workspace:*",
105
105
  "@anthropic-ai/bedrock-sdk": "^0.26.4",
106
106
  "@anthropic-ai/claude-agent-sdk": "^0.2.87",
107
107
  "@anthropic-ai/foundry-sdk": "^0.2.3",
108
108
  "@anthropic-ai/mcpb": "^2.1.2",
109
109
  "@anthropic-ai/sdk": "^0.80.0",
110
110
  "@anthropic-ai/vertex-sdk": "^0.14.4",
111
- "@anthropic/ink": "workspace:*",
111
+ "@costrict/ink": "workspace:*",
112
112
  "@aws-sdk/client-bedrock": "^3.1020.0",
113
113
  "@aws-sdk/client-bedrock-runtime": "^3.1020.0",
114
114
  "@aws-sdk/client-sts": "^3.1020.0",
@@ -116,9 +116,9 @@
116
116
  "@aws-sdk/credential-providers": "^3.1020.0",
117
117
  "@azure/identity": "^4.13.1",
118
118
  "@biomejs/biome": "^2.4.10",
119
- "@claude-code-best/agent-tools": "workspace:*",
120
- "@claude-code-best/builtin-tools": "workspace:*",
121
- "@claude-code-best/mcp-client": "workspace:*",
119
+ "@costrict/agent-tools": "workspace:*",
120
+ "@costrict/builtin-tools": "workspace:*",
121
+ "@costrict/mcp-client": "workspace:*",
122
122
  "@commander-js/extra-typings": "^14.0.0",
123
123
  "@growthbook/growthbook": "^1.6.5",
124
124
  "@langfuse/otel": "^5.1.0",