replit-tools 1.2.39 → 1.2.40
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 +55 -0
package/package.json
CHANGED
|
@@ -170,6 +170,61 @@ for f in "${SSH_PERSISTENT}"/*; do
|
|
|
170
170
|
esac
|
|
171
171
|
done
|
|
172
172
|
|
|
173
|
+
# =============================================================================
|
|
174
|
+
# Step 2.6: Force forever-persistence settings for Claude + Codex
|
|
175
|
+
# =============================================================================
|
|
176
|
+
# Claude: cleanupPeriodDays = 365250 (~1000 years) so sessions never auto-delete
|
|
177
|
+
# Codex: history.max_bytes = 1 TiB so history.jsonl never rotates
|
|
178
|
+
# (session rollouts under ~/.codex/sessions/ are already kept forever)
|
|
179
|
+
if command -v node &>/dev/null; then
|
|
180
|
+
PERSIST_OUTPUT=$(CLAUDE_PERSISTENT_DIR="${CLAUDE_PERSISTENT}" CODEX_PERSISTENT_DIR="${CODEX_PERSISTENT}" node -e '
|
|
181
|
+
const fs = require("fs");
|
|
182
|
+
const claudeSettingsPath = process.env.CLAUDE_PERSISTENT_DIR + "/settings.json";
|
|
183
|
+
try {
|
|
184
|
+
let s = {};
|
|
185
|
+
if (fs.existsSync(claudeSettingsPath)) {
|
|
186
|
+
try { s = JSON.parse(fs.readFileSync(claudeSettingsPath, "utf8")); } catch(e) { s = {}; }
|
|
187
|
+
}
|
|
188
|
+
if (s.cleanupPeriodDays !== 365250) {
|
|
189
|
+
s.cleanupPeriodDays = 365250;
|
|
190
|
+
fs.writeFileSync(claudeSettingsPath, JSON.stringify(s, null, 2) + "\n");
|
|
191
|
+
console.log("Claude cleanupPeriodDays set to 365250 (~1000 years)");
|
|
192
|
+
}
|
|
193
|
+
} catch(e) { console.error("Could not update Claude settings: " + e.message); }
|
|
194
|
+
|
|
195
|
+
const codexConfigPath = process.env.CODEX_PERSISTENT_DIR + "/config.toml";
|
|
196
|
+
try {
|
|
197
|
+
let c = "";
|
|
198
|
+
if (fs.existsSync(codexConfigPath)) c = fs.readFileSync(codexConfigPath, "utf8");
|
|
199
|
+
const desired = "1099511627776"; // 1 TiB
|
|
200
|
+
const hasHistory = /\[history\]/.test(c);
|
|
201
|
+
let updated = false;
|
|
202
|
+
if (!hasHistory) {
|
|
203
|
+
c = (c.trimEnd() + "\n\n[history]\nmax_bytes = " + desired + "\n").trimStart();
|
|
204
|
+
updated = true;
|
|
205
|
+
} else {
|
|
206
|
+
const m = c.match(/(\[history\][\s\S]*?)max_bytes\s*=\s*(\d+)/);
|
|
207
|
+
if (m) {
|
|
208
|
+
if (m[2] !== desired) {
|
|
209
|
+
c = c.replace(/(\[history\][\s\S]*?max_bytes\s*=\s*)\d+/, "$1" + desired);
|
|
210
|
+
updated = true;
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
c = c.replace(/\[history\](\s*)/, "[history]$1max_bytes = " + desired + "\n");
|
|
214
|
+
updated = true;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (updated) {
|
|
218
|
+
fs.writeFileSync(codexConfigPath, c);
|
|
219
|
+
console.log("Codex history.max_bytes set to 1 TiB");
|
|
220
|
+
}
|
|
221
|
+
} catch(e) { console.error("Could not update Codex config: " + e.message); }
|
|
222
|
+
' 2>&1)
|
|
223
|
+
if [ -n "${PERSIST_OUTPUT}" ]; then
|
|
224
|
+
while IFS= read -r line; do log "✅ ${line}"; done <<< "${PERSIST_OUTPUT}"
|
|
225
|
+
fi
|
|
226
|
+
fi
|
|
227
|
+
|
|
173
228
|
# =============================================================================
|
|
174
229
|
# Step 3: Create ~/.local/share/claude symlink for installed versions
|
|
175
230
|
# =============================================================================
|