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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replit-tools",
3
- "version": "1.2.41",
3
+ "version": "1.2.42",
4
4
  "description": "DATA Tools - One command to set up Claude Code and Codex CLI on Replit with full persistence",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -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 if (/max_bytes\s*=\s*(\d+)/.test(c)) {
232
- const cur = c.match(/max_bytes\s*=\s*(\d+)/)[1];
233
- if (cur !== desired) {
234
- c = c.replace(/(\[history\][\s\S]*?max_bytes\s*=\s*)\d+/, "$1" + desired);
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);