@polderlabs/bizar 4.4.1 → 4.4.2
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/cli/update.mjs +38 -2
- package/package.json +1 -1
package/cli/update.mjs
CHANGED
|
@@ -461,12 +461,39 @@ function spawnFreshDashboard({ port } = {}) {
|
|
|
461
461
|
// Repo-level update helpers
|
|
462
462
|
// ---------------------------------------------------------------------------
|
|
463
463
|
|
|
464
|
+
/**
|
|
465
|
+
* v4.4.2 — Detect whether `bizar update` is running from a git checkout
|
|
466
|
+
* or from a globally-installed npm package. When run from the npm
|
|
467
|
+
* install (REPO_ROOT has no `.git/`), the git-pull step is meaningless
|
|
468
|
+
* and aborts the entire update. We no-op it and let the `npm update -g`
|
|
469
|
+
* path handle the version bump.
|
|
470
|
+
*
|
|
471
|
+
* Returns `{ inRepo: boolean, repoRoot: string }` so the caller can
|
|
472
|
+
* decide what to do.
|
|
473
|
+
*/
|
|
474
|
+
function detectRepoMode() {
|
|
475
|
+
const gitDir = join(REPO_ROOT, '.git');
|
|
476
|
+
return {
|
|
477
|
+
inRepo: existsSync(gitDir),
|
|
478
|
+
repoRoot: REPO_ROOT,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
464
482
|
/**
|
|
465
483
|
* Pull the latest changes from the git origin. Exits the process if the
|
|
466
484
|
* pull fails (merge conflict etc.), matching the task flow — an update
|
|
467
485
|
* should not proceed when the working tree is dirty.
|
|
468
486
|
*/
|
|
469
487
|
function runGitPull({ dryRun = false } = {}) {
|
|
488
|
+
const { inRepo } = detectRepoMode();
|
|
489
|
+
if (!inRepo) {
|
|
490
|
+
// Running from a global npm install — there's no checkout to pull.
|
|
491
|
+
// The npm package update is handled separately by updatePackage().
|
|
492
|
+
if (dryRun) {
|
|
493
|
+
console.log(chalk.dim(' [dry-run] skipping git pull (not a git checkout)'));
|
|
494
|
+
}
|
|
495
|
+
return { ok: true, message: 'skipped git pull (not a git checkout)' };
|
|
496
|
+
}
|
|
470
497
|
if (dryRun) {
|
|
471
498
|
console.log(chalk.dim(' [dry-run] would run: git pull --rebase'));
|
|
472
499
|
return { ok: true, message: '[dry-run] git pull --rebase' };
|
|
@@ -662,10 +689,19 @@ export async function runUpdate(subargs = []) {
|
|
|
662
689
|
}
|
|
663
690
|
|
|
664
691
|
// ── Git pull ──────────────────────────────────────────────────────────
|
|
692
|
+
const { inRepo } = detectRepoMode();
|
|
665
693
|
if (dryRun) {
|
|
666
|
-
|
|
694
|
+
if (inRepo) {
|
|
695
|
+
console.log(chalk.dim('\n [dry-run] would pull latest from origin (git pull --rebase)'));
|
|
696
|
+
} else {
|
|
697
|
+
console.log(chalk.dim('\n [dry-run] skipping git pull (not a git checkout — npm install -g handles version bump)'));
|
|
698
|
+
}
|
|
667
699
|
} else {
|
|
668
|
-
|
|
700
|
+
if (inRepo) {
|
|
701
|
+
console.log(chalk.dim('\n Pulling latest from origin...'));
|
|
702
|
+
} else {
|
|
703
|
+
console.log(chalk.dim('\n Skipping git pull (not a git checkout — using npm install -g for version bump)'));
|
|
704
|
+
}
|
|
669
705
|
const pull = runGitPull();
|
|
670
706
|
if (pull.ok) {
|
|
671
707
|
console.log(chalk.green(` ✓ ${pull.message}`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polderlabs/bizar",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"description": "Norse-pantheon multi-agent system for opencode — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness. v4 ships as a single npm package bundling the dashboard server, opencode plugin, and typed SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|