bloby-bot 0.52.0 → 0.52.3
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/bin/cli.js +19 -0
- package/package.json +1 -1
- package/scripts/install +4 -0
- package/scripts/install.ps1 +7 -0
- package/scripts/install.sh +4 -0
- package/scripts/postinstall.js +12 -0
package/bin/cli.js
CHANGED
|
@@ -17,6 +17,23 @@ const CONFIG_PATH = path.join(DATA_DIR, 'config.json');
|
|
|
17
17
|
const BIN_DIR = path.join(DATA_DIR, 'bin');
|
|
18
18
|
const CF_PATH = path.join(BIN_DIR, 'cloudflared');
|
|
19
19
|
|
|
20
|
+
// claude-agent-sdk 0.3.x moved @anthropic-ai/sdk + @modelcontextprotocol/sdk to
|
|
21
|
+
// peerDependencies. Upgrading an existing ~/.bloby in place (the old 0.2.x tree had
|
|
22
|
+
// them as regular deps) makes npm's resolver deadlock with ERESOLVE. We declare those
|
|
23
|
+
// peers as direct deps and persist legacy-peer-deps in ~/.bloby/.npmrc so EVERY
|
|
24
|
+
// `npm install` there — updater, self-heal, manual recovery — resolves regardless of
|
|
25
|
+
// which cli version invokes it. (.npmrc is excluded from npm tarballs, so it has to be
|
|
26
|
+
// written at runtime rather than shipped.)
|
|
27
|
+
function ensureNpmrc(dir) {
|
|
28
|
+
try {
|
|
29
|
+
const p = path.join(dir, '.npmrc');
|
|
30
|
+
const cur = fs.existsSync(p) ? fs.readFileSync(p, 'utf-8') : '';
|
|
31
|
+
if (!/^legacy-peer-deps\s*=/m.test(cur)) {
|
|
32
|
+
fs.writeFileSync(p, (cur && !cur.endsWith('\n') ? cur + '\n' : cur) + 'legacy-peer-deps=true\n');
|
|
33
|
+
}
|
|
34
|
+
} catch { /* best-effort */ }
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
// ── Ensure dependencies exist (self-heal if postinstall/update npm install failed) ──
|
|
21
38
|
// Check every declared dep, not just one sentinel: a release that adds a new
|
|
22
39
|
// dep would otherwise silently boot into an `ERR_MODULE_NOT_FOUND` crash loop.
|
|
@@ -35,6 +52,7 @@ if (!IS_DEV) {
|
|
|
35
52
|
if (missing.length > 0) {
|
|
36
53
|
console.error(`\n Installing missing dependencies: ${missing.slice(0, 5).join(', ')}${missing.length > 5 ? `, +${missing.length - 5} more` : ''}\n`);
|
|
37
54
|
try {
|
|
55
|
+
ensureNpmrc(ROOT);
|
|
38
56
|
execSync('npm install --omit=dev', { cwd: ROOT, stdio: 'inherit' });
|
|
39
57
|
} catch {
|
|
40
58
|
console.error('\n ✗ Failed to install dependencies. Run manually:\n cd ~/.bloby && npm install\n');
|
|
@@ -1524,6 +1542,7 @@ async function update() {
|
|
|
1524
1542
|
// app permanently broken (e.g. crash loop on a new import). Treat as fatal,
|
|
1525
1543
|
// surface the npm output so the cause is debuggable, and don't claim success.
|
|
1526
1544
|
try {
|
|
1545
|
+
ensureNpmrc(DATA_DIR);
|
|
1527
1546
|
execSync('npm install --omit=dev', { cwd: DATA_DIR, stdio: 'pipe', timeout: 300_000 });
|
|
1528
1547
|
} catch (e) {
|
|
1529
1548
|
if (e.stdout) process.stderr.write(e.stdout);
|
package/package.json
CHANGED
package/scripts/install
CHANGED
|
@@ -200,6 +200,10 @@ install_bloby() {
|
|
|
200
200
|
rm -rf "$TMPDIR"
|
|
201
201
|
|
|
202
202
|
# Install dependencies inside ~/.bloby/
|
|
203
|
+
# claude-agent-sdk 0.3.x moved @anthropic-ai/sdk + @modelcontextprotocol/sdk to
|
|
204
|
+
# peerDependencies; an in-place upgrade of an existing ~/.bloby deadlocks npm's
|
|
205
|
+
# resolver (ERESOLVE). Persist legacy-peer-deps so npm install resolves cleanly.
|
|
206
|
+
grep -qs '^legacy-peer-deps' "$BLOBY_HOME/.npmrc" 2>/dev/null || printf 'legacy-peer-deps=true\n' >> "$BLOBY_HOME/.npmrc"
|
|
203
207
|
printf " ${BLUE}↓${RESET} Installing dependencies...\n"
|
|
204
208
|
(cd "$BLOBY_HOME" && "$NPM" install --omit=dev 2>/dev/null)
|
|
205
209
|
|
package/scripts/install.ps1
CHANGED
|
@@ -238,6 +238,13 @@ function Install-Bloby {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
# Install dependencies inside ~/.bloby/
|
|
241
|
+
# claude-agent-sdk 0.3.x moved @anthropic-ai/sdk + @modelcontextprotocol/sdk to
|
|
242
|
+
# peerDependencies; an in-place upgrade of an existing ~/.bloby deadlocks npm's
|
|
243
|
+
# resolver (ERESOLVE). Persist legacy-peer-deps so npm install resolves cleanly.
|
|
244
|
+
$npmrc = Join-Path $BLOBY_HOME ".npmrc"
|
|
245
|
+
if (-not ((Test-Path $npmrc) -and (Select-String -Path $npmrc -Pattern '^legacy-peer-deps' -Quiet))) {
|
|
246
|
+
Add-Content -Path $npmrc -Value 'legacy-peer-deps=true'
|
|
247
|
+
}
|
|
241
248
|
Push-Location $BLOBY_HOME
|
|
242
249
|
try {
|
|
243
250
|
& $NPM install --omit=dev 2>$null
|
package/scripts/install.sh
CHANGED
|
@@ -200,6 +200,10 @@ install_bloby() {
|
|
|
200
200
|
rm -rf "$TMPDIR"
|
|
201
201
|
|
|
202
202
|
# Install dependencies inside ~/.bloby/
|
|
203
|
+
# claude-agent-sdk 0.3.x moved @anthropic-ai/sdk + @modelcontextprotocol/sdk to
|
|
204
|
+
# peerDependencies; an in-place upgrade of an existing ~/.bloby deadlocks npm's
|
|
205
|
+
# resolver (ERESOLVE). Persist legacy-peer-deps so npm install resolves cleanly.
|
|
206
|
+
grep -qs '^legacy-peer-deps' "$BLOBY_HOME/.npmrc" 2>/dev/null || printf 'legacy-peer-deps=true\n' >> "$BLOBY_HOME/.npmrc"
|
|
203
207
|
printf " ${BLUE}↓${RESET} Installing dependencies...\n"
|
|
204
208
|
(cd "$BLOBY_HOME" && "$NPM" install --omit=dev 2>/dev/null)
|
|
205
209
|
|
package/scripts/postinstall.js
CHANGED
|
@@ -68,6 +68,18 @@ for (const file of CODE_FILES) {
|
|
|
68
68
|
|
|
69
69
|
// ── Install dependencies in ~/.bloby/ ──
|
|
70
70
|
|
|
71
|
+
// claude-agent-sdk 0.3.x moved @anthropic-ai/sdk + @modelcontextprotocol/sdk to
|
|
72
|
+
// peerDependencies; upgrading the existing ~/.bloby tree in place deadlocks npm's
|
|
73
|
+
// resolver (ERESOLVE). Persist legacy-peer-deps so this install — and the manual
|
|
74
|
+
// recovery command below — resolve cleanly. (.npmrc is excluded from npm tarballs.)
|
|
75
|
+
try {
|
|
76
|
+
const npmrc = path.join(BLOBY_HOME, '.npmrc');
|
|
77
|
+
const cur = fs.existsSync(npmrc) ? fs.readFileSync(npmrc, 'utf-8') : '';
|
|
78
|
+
if (!/^legacy-peer-deps\s*=/m.test(cur)) {
|
|
79
|
+
fs.writeFileSync(npmrc, (cur && !cur.endsWith('\n') ? cur + '\n' : cur) + 'legacy-peer-deps=true\n');
|
|
80
|
+
}
|
|
81
|
+
} catch { /* best-effort */ }
|
|
82
|
+
|
|
71
83
|
try {
|
|
72
84
|
execSync('npm install --omit=dev', {
|
|
73
85
|
cwd: BLOBY_HOME,
|