bloby-bot 0.46.3 → 0.47.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/bin/cli.js +42 -8
- package/dist-bloby/assets/{bloby-BnHElaWD.js → bloby-E-QLmQDW.js} +4 -4
- package/dist-bloby/assets/globals-Ci0CEj1X.js +18 -0
- package/dist-bloby/assets/globals-DriF_8Q_.css +2 -0
- package/dist-bloby/assets/{highlighted-body-OFNGDK62-B4IKFiNq.js → highlighted-body-OFNGDK62-CTiboTVa.js} +1 -1
- package/dist-bloby/assets/mermaid-GHXKKRXX-CgVqYCFU.js +1 -0
- package/dist-bloby/assets/{onboard-DoRN5jiz.js → onboard-C1uMxuk2.js} +1 -1
- package/dist-bloby/bloby.html +3 -3
- package/dist-bloby/onboard.html +3 -3
- package/package.json +3 -2
- package/scripts/postinstall.js +19 -2
- package/scripts/sync-pi-models.ts +146 -0
- package/shared/config.ts +1 -1
- package/supervisor/bloby-agent.ts +2 -0
- package/supervisor/chat/OnboardWizard.tsx +327 -2
- package/supervisor/harnesses/pi/async-queue.ts +45 -0
- package/supervisor/harnesses/pi/auth-storage.ts +56 -0
- package/supervisor/harnesses/pi/index.ts +474 -0
- package/supervisor/harnesses/pi/models-catalog.generated.ts +579 -0
- package/supervisor/harnesses/pi/providers/stream-google.ts +156 -0
- package/supervisor/harnesses/pi/providers/stream.ts +21 -0
- package/supervisor/harnesses/pi/providers/types.ts +60 -0
- package/supervisor/harnesses/pi/session.ts +140 -0
- package/supervisor/harnesses/pi/sub-providers.ts +191 -0
- package/supervisor/harnesses/pi/test-completion.ts +196 -0
- package/supervisor/index.ts +6 -0
- package/worker/index.ts +86 -0
- package/dist-bloby/assets/globals-BYieEOqL.js +0 -18
- package/dist-bloby/assets/globals-BzeCWV3t.css +0 -2
- package/dist-bloby/assets/mermaid-GHXKKRXX-32SDjrR3.js +0 -1
package/bin/cli.js
CHANGED
|
@@ -17,13 +17,34 @@ 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
|
-
// ── Ensure dependencies exist (self-heal if postinstall npm install failed) ──
|
|
21
|
-
|
|
20
|
+
// ── Ensure dependencies exist (self-heal if postinstall/update npm install failed) ──
|
|
21
|
+
// Check every declared dep, not just one sentinel: a release that adds a new
|
|
22
|
+
// dep would otherwise silently boot into an `ERR_MODULE_NOT_FOUND` crash loop.
|
|
23
|
+
function missingDeps(root) {
|
|
24
|
+
let deps;
|
|
22
25
|
try {
|
|
23
|
-
|
|
26
|
+
deps = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf-8')).dependencies || {};
|
|
24
27
|
} catch {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return Object.keys(deps).filter(d => !fs.existsSync(path.join(root, 'node_modules', d, 'package.json')));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!IS_DEV) {
|
|
34
|
+
const missing = missingDeps(ROOT);
|
|
35
|
+
if (missing.length > 0) {
|
|
36
|
+
console.error(`\n Installing missing dependencies: ${missing.slice(0, 5).join(', ')}${missing.length > 5 ? `, +${missing.length - 5} more` : ''}\n`);
|
|
37
|
+
try {
|
|
38
|
+
execSync('npm install --omit=dev', { cwd: ROOT, stdio: 'inherit' });
|
|
39
|
+
} catch {
|
|
40
|
+
console.error('\n ✗ Failed to install dependencies. Run manually:\n cd ~/.bloby && npm install\n');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const stillMissing = missingDeps(ROOT);
|
|
44
|
+
if (stillMissing.length > 0) {
|
|
45
|
+
console.error(`\n ✗ Dependencies still missing after npm install: ${stillMissing.join(', ')}\n Try: cd ~/.bloby && rm -rf node_modules package-lock.json && npm install --omit=dev\n`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
27
48
|
}
|
|
28
49
|
}
|
|
29
50
|
|
|
@@ -1498,11 +1519,24 @@ async function update() {
|
|
|
1498
1519
|
|
|
1499
1520
|
const distDst = path.join(DATA_DIR, 'dist-bloby');
|
|
1500
1521
|
|
|
1501
|
-
// Install dependencies (5 min timeout to prevent hanging forever)
|
|
1522
|
+
// Install dependencies (5 min timeout to prevent hanging forever).
|
|
1523
|
+
// A failed install while new source files are already in place leaves the
|
|
1524
|
+
// app permanently broken (e.g. crash loop on a new import). Treat as fatal,
|
|
1525
|
+
// surface the npm output so the cause is debuggable, and don't claim success.
|
|
1502
1526
|
try {
|
|
1503
|
-
execSync('npm install --omit=dev', { cwd: DATA_DIR, stdio: '
|
|
1527
|
+
execSync('npm install --omit=dev', { cwd: DATA_DIR, stdio: 'inherit', timeout: 300_000 });
|
|
1504
1528
|
} catch (e) {
|
|
1505
|
-
console.log(
|
|
1529
|
+
console.log(`\n ${c.red}✗${c.reset} npm install failed during update: ${e.message}`);
|
|
1530
|
+
console.log(` Your install is now partially upgraded. To recover:\n cd ~/.bloby && npm install --omit=dev\n`);
|
|
1531
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
1532
|
+
process.exit(1);
|
|
1533
|
+
}
|
|
1534
|
+
const stillMissing = missingDeps(DATA_DIR);
|
|
1535
|
+
if (stillMissing.length > 0) {
|
|
1536
|
+
console.log(`\n ${c.red}✗${c.reset} npm install reported success but these deps are missing: ${stillMissing.join(', ')}`);
|
|
1537
|
+
console.log(` Try: cd ~/.bloby && rm -rf node_modules package-lock.json && npm install --omit=dev\n`);
|
|
1538
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
1539
|
+
process.exit(1);
|
|
1506
1540
|
}
|
|
1507
1541
|
stepper.advance();
|
|
1508
1542
|
|