replit-tools 1.2.41 → 1.2.42
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/package.json +1 -1
- package/scripts/setup-claude-code.sh +17 -8
package/package.json
CHANGED
|
@@ -225,18 +225,27 @@ if command -v node &>/dev/null; then
|
|
|
225
225
|
if (fs.existsSync(codexConfigPath)) c = fs.readFileSync(codexConfigPath, "utf8");
|
|
226
226
|
const desired = String(codexMaxBytes);
|
|
227
227
|
let updated = false;
|
|
228
|
+
// Codex requires persistence field when [history] section is present
|
|
228
229
|
if (!/\[history\]/.test(c)) {
|
|
229
|
-
c = (c.trimEnd() + "\n\n[history]\nmax_bytes = " + desired + "\n").trimStart();
|
|
230
|
+
c = (c.trimEnd() + "\n\n[history]\npersistence = \"save-all\"\nmax_bytes = " + desired + "\n").trimStart();
|
|
230
231
|
updated = true;
|
|
231
|
-
} else
|
|
232
|
-
|
|
233
|
-
if (
|
|
234
|
-
c = c.replace(
|
|
232
|
+
} else {
|
|
233
|
+
// Ensure persistence field exists
|
|
234
|
+
if (!/(\[history\][\s\S]*?)persistence\s*=/.test(c)) {
|
|
235
|
+
c = c.replace(/\[history\](\s*)/, "[history]$1persistence = \"save-all\"\n");
|
|
236
|
+
updated = true;
|
|
237
|
+
}
|
|
238
|
+
// Ensure max_bytes is set correctly
|
|
239
|
+
if (/max_bytes\s*=\s*(\d+)/.test(c)) {
|
|
240
|
+
const cur = c.match(/max_bytes\s*=\s*(\d+)/)[1];
|
|
241
|
+
if (cur !== desired) {
|
|
242
|
+
c = c.replace(/(\[history\][\s\S]*?max_bytes\s*=\s*)\d+/, "$1" + desired);
|
|
243
|
+
updated = true;
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
c = c.replace(/(\[history\][\s\S]*?persistence\s*=\s*"[^"]*"\s*\n)/, "$1max_bytes = " + desired + "\n");
|
|
235
247
|
updated = true;
|
|
236
248
|
}
|
|
237
|
-
} else {
|
|
238
|
-
c = c.replace(/\[history\](\s*)/, "[history]$1max_bytes = " + desired + "\n");
|
|
239
|
-
updated = true;
|
|
240
249
|
}
|
|
241
250
|
if (updated) {
|
|
242
251
|
fs.writeFileSync(codexConfigPath, c);
|