@kenkaiiii/gg-core 5.97.0 → 5.97.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/dist/{chunk-2ZTKYSSY.js → chunk-OVIBOKD4.js} +13 -1
- package/dist/chunk-OVIBOKD4.js.map +1 -0
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/model-registry.cjs.map +1 -1
- package/dist/model-registry.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2ZTKYSSY.js.map +0 -1
|
@@ -1042,6 +1042,7 @@ import path3 from "path";
|
|
|
1042
1042
|
import { randomBytes } from "crypto";
|
|
1043
1043
|
import { environmentSecrets, redactText, redactValue } from "@kenkaiiii/gg-ai";
|
|
1044
1044
|
var MAX_BYTES = 10 * 1024 * 1024;
|
|
1045
|
+
var ROTATED_GENERATIONS = 3;
|
|
1045
1046
|
var MIN_HEADROOM_BYTES = 64 * 1024;
|
|
1046
1047
|
var fd = null;
|
|
1047
1048
|
var logPath = null;
|
|
@@ -1058,6 +1059,17 @@ function rotateIfNeeded(filePath, force = false) {
|
|
|
1058
1059
|
const st = fs5.statSync(filePath);
|
|
1059
1060
|
if (!force && st.size <= MAX_BYTES - MIN_HEADROOM_BYTES) return;
|
|
1060
1061
|
const rotated = `${filePath}.1`;
|
|
1062
|
+
for (let generation = ROTATED_GENERATIONS - 1; generation >= 1; generation--) {
|
|
1063
|
+
const older = `${filePath}.${generation + 1}`;
|
|
1064
|
+
try {
|
|
1065
|
+
fs5.unlinkSync(older);
|
|
1066
|
+
} catch {
|
|
1067
|
+
}
|
|
1068
|
+
try {
|
|
1069
|
+
fs5.renameSync(`${filePath}.${generation}`, older);
|
|
1070
|
+
} catch {
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1061
1073
|
try {
|
|
1062
1074
|
fs5.unlinkSync(rotated);
|
|
1063
1075
|
} catch {
|
|
@@ -3063,4 +3075,4 @@ export {
|
|
|
3063
3075
|
getDefaultThinkingLevel,
|
|
3064
3076
|
getSummaryModel
|
|
3065
3077
|
};
|
|
3066
|
-
//# sourceMappingURL=chunk-
|
|
3078
|
+
//# sourceMappingURL=chunk-OVIBOKD4.js.map
|