@polderlabs/bizar 4.4.6 → 4.4.7
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/bin.mjs +39 -30
- package/cli/install.mjs +13 -51
- package/cli/provision.mjs +967 -0
- package/cli/update.mjs +28 -878
- package/install.sh +226 -439
- package/package.json +1 -1
package/cli/bin.mjs
CHANGED
|
@@ -153,59 +153,68 @@ function showExportHelp() {
|
|
|
153
153
|
|
|
154
154
|
function showInstallHelp() {
|
|
155
155
|
console.log(`
|
|
156
|
-
bizar install — Run the
|
|
156
|
+
bizar install — Run the unified BizarHarness installer
|
|
157
157
|
|
|
158
158
|
Usage:
|
|
159
|
-
bizar install
|
|
159
|
+
bizar install Install (or refresh) every component
|
|
160
|
+
bizar install --dry-run Print what would happen, change nothing
|
|
161
|
+
bizar install --force Overwrite existing files
|
|
162
|
+
bizar install --help Show this help
|
|
160
163
|
|
|
161
164
|
Description:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
v4.4.7+ — unified installer. Same code path as 'bizar update'; the
|
|
166
|
+
difference is just mode=install vs mode=update. Every step is
|
|
167
|
+
idempotent — running this twice is safe.
|
|
168
|
+
|
|
169
|
+
1. Installs @polderlabs/bizar via npm (skipped if already current).
|
|
170
|
+
2. Shells to ./install.sh for platform-specific system deps (uv,
|
|
171
|
+
python3.12, jq, gh on Linux; brew on macOS) + service registration
|
|
172
|
+
(systemd / launchd / Task Scheduler).
|
|
173
|
+
3. Syncs agent files, slash commands, and bundled skills into
|
|
174
|
+
~/.config/opencode/.
|
|
175
|
+
4. Copies plugins/bizar/ from the npm install into
|
|
176
|
+
~/.config/opencode/plugins/bizar/ (preserves dev symlinks).
|
|
177
|
+
5. Patches ~/.config/opencode/opencode.json with the Bizar plugin
|
|
178
|
+
entry (skipped if already present).
|
|
179
|
+
6. Runs 'bizar doctor' as a post-install health check.
|
|
180
|
+
|
|
181
|
+
No API key collection, no interactive prompts.
|
|
172
182
|
`);
|
|
173
183
|
}
|
|
174
184
|
|
|
175
185
|
function showUpdateHelp() {
|
|
176
186
|
console.log(`
|
|
177
|
-
bizar update — Update opencode
|
|
187
|
+
bizar update — Update opencode + @polderlabs/bizar (which bundles the
|
|
188
|
+
plugin and dashboard). Detects what's installed and only touches what's
|
|
189
|
+
missing or out of date.
|
|
178
190
|
|
|
179
191
|
Usage:
|
|
180
192
|
bizar update Update EVERYTHING (default; auto-kills + restarts)
|
|
181
|
-
bizar update --pick Interactive picker (legacy per-component UI)
|
|
182
|
-
bizar update opencode bizar dash Update specific components
|
|
183
193
|
bizar update --no-restart Don't auto-restart the dashboard after update
|
|
184
194
|
bizar update --dry-run Print what would happen, change nothing
|
|
195
|
+
bizar update --force Override .bizar/PRE_PUSH_NOTES.md blockers
|
|
196
|
+
bizar update --yes Same as --force, but named for one-line scripts
|
|
185
197
|
bizar update --help Show this help
|
|
186
198
|
|
|
187
|
-
Components:
|
|
188
|
-
opencode the opencode CLI itself
|
|
189
|
-
|
|
190
|
-
dash @polderlabs/bizar-dash (web dashboard + TUI)
|
|
191
|
-
plugin @polderlabs/bizar-plugin (opencode plugin)
|
|
199
|
+
Components updated:
|
|
200
|
+
opencode-ai the opencode CLI itself
|
|
201
|
+
@polderlabs/bizar this CLI + dashboard + plugin (one package)
|
|
192
202
|
|
|
193
|
-
Behavior (
|
|
194
|
-
•
|
|
195
|
-
|
|
196
|
-
|
|
203
|
+
Behavior (v4.4.7+):
|
|
204
|
+
• Single unified provisioner. 'bizar install' and 'bizar update' are
|
|
205
|
+
the same code path with different mode flags. Every step is
|
|
206
|
+
idempotent — re-running is safe.
|
|
197
207
|
• Detects running Bizar instances (background service daemon, web
|
|
198
208
|
dashboard) by reading ~/.config/bizar/{service,dashboard}.pid and
|
|
199
209
|
cleans up any stale or empty PID files.
|
|
200
|
-
• Auto-kills running instances with a brief notice
|
|
201
|
-
be prompted first instead).
|
|
210
|
+
• Auto-kills running instances with a brief notice.
|
|
202
211
|
• Sends SIGTERM, waits up to 5s, escalates to SIGKILL if needed.
|
|
203
212
|
• Re-runs the install script so the deployed plugin source matches
|
|
204
213
|
the just-upgraded npm version (avoids the version-skew trap).
|
|
205
|
-
• If the dashboard was running and bizar
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
• Runs
|
|
214
|
+
• If the dashboard was running and bizar was updated, spawns a
|
|
215
|
+
fresh detached dashboard process with the new code (skipped with
|
|
216
|
+
--no-restart).
|
|
217
|
+
• Runs 'bizar doctor' after a successful update to catch config
|
|
209
218
|
regressions before opencode tries to start.
|
|
210
219
|
|
|
211
220
|
Examples:
|
package/cli/install.mjs
CHANGED
|
@@ -203,60 +203,22 @@ export async function installPluginFromGlobal(opts = {}) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
/**
|
|
206
|
-
* runInstaller —
|
|
206
|
+
* runInstaller — v4.4.7 thin wrapper around the unified provisioner.
|
|
207
207
|
*
|
|
208
|
-
*
|
|
209
|
-
* `
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
208
|
+
* `bizar install` and `bizar update` are now the SAME code path with
|
|
209
|
+
* different `mode` flags. Everything (deps, plugin copy, opencode.json
|
|
210
|
+
* patching, service registration, agent files, skills, doctor) is
|
|
211
|
+
* owned by `cli/provision.mjs:runProvision`. This file just parses the
|
|
212
|
+
* flags and forwards.
|
|
213
213
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* guarantees the two will diverge.
|
|
219
|
-
* - No interactive prompts. The TUI asked for API keys, restart
|
|
220
|
-
* confirmation, and component selection — none of which belong in a
|
|
221
|
-
* `npm i -g @polderlabs/bizar` install (no TTY, secrets stay local).
|
|
222
|
-
* - Cross-platform. The bash script already detects Windows and falls
|
|
223
|
-
* back to the npm-based path; re-implementing that in Node is busywork.
|
|
224
|
-
*
|
|
225
|
-
* Returns the install.sh exit code (0 = success, 1 = partial failure).
|
|
226
|
-
* On platforms where bash isn't available (rare — Windows without WSL),
|
|
227
|
-
* falls back to running the npm-based path directly.
|
|
214
|
+
* Backward-compatible — the public exports (`runInstaller`,
|
|
215
|
+
* `runPostInstall`, `installPluginFromGlobal`) still exist so that any
|
|
216
|
+
* external callers (including the postinstall npm hook) keep working.
|
|
217
|
+
* New code should call `runProvision({ mode: 'install' })` directly.
|
|
228
218
|
*/
|
|
229
|
-
export async function runInstaller() {
|
|
230
|
-
const {
|
|
231
|
-
|
|
232
|
-
const { spawnSync } = await import('node:child_process');
|
|
233
|
-
|
|
234
|
-
// __dirname is defined at module scope (see top of file)
|
|
235
|
-
// cli/install.mjs → ../install.sh
|
|
236
|
-
const installSh = join(__dirname, '..', 'install.sh');
|
|
237
|
-
|
|
238
|
-
if (!existsSync(installSh)) {
|
|
239
|
-
console.error(chalk.red(' ✗ install.sh not found at ' + installSh));
|
|
240
|
-
console.error(chalk.dim(' Run `git clone https://github.com/DrB0rk/BizarHarness` first, then `cd BizarHarness && ./install.sh`.'));
|
|
241
|
-
process.exit(1);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
console.log(chalk.bold.hex('#6366f1')('\n BizarHarness installer (delegating to install.sh)\n'));
|
|
245
|
-
|
|
246
|
-
const useBash = process.platform !== 'win32' || process.env.WSL_DISTRO_NAME;
|
|
247
|
-
if (useBash) {
|
|
248
|
-
const r = spawnSync('bash', [installSh], { stdio: 'inherit' });
|
|
249
|
-
process.exit(r.status ?? 1);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// Windows without WSL — bash isn't available. The bash script has a
|
|
253
|
-
// Windows fallback that uses npm-based install paths. Run the npm path
|
|
254
|
-
// directly: install the BizarHarness npm packages + copy plugin from
|
|
255
|
-
// global to ~/.config/opencode/plugins/bizar/. This is the same code
|
|
256
|
-
// path install.sh uses for `platform == win32`.
|
|
257
|
-
console.log(chalk.dim(' bash not available — running npm-based installer (Windows path)'));
|
|
258
|
-
console.log('');
|
|
259
|
-
await runPostInstall();
|
|
219
|
+
export async function runInstaller(opts = {}) {
|
|
220
|
+
const { runProvision } = await import('./provision.mjs');
|
|
221
|
+
return runProvision({ ...opts, mode: 'install' });
|
|
260
222
|
}
|
|
261
223
|
|
|
262
224
|
// ── Interactive prompts for optional packages ─────────────────────────────────
|