@polderlabs/bizar 6.2.0 → 6.2.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.
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ // UserPromptSubmit — Bizar harness hook.
3
+ //
4
+ // Runs when the user submits a prompt. Reads JSON from stdin, outputs
5
+ // JSON to stdout. Used to lightly tag user prompts for routing and to
6
+ // add a "Plow Through" prompt hint when ambiguity is detected.
7
+
8
+ 'use strict';
9
+
10
+ const fs = require('fs');
11
+ const os = require('os');
12
+ const path = require('path');
13
+
14
+ let raw = '';
15
+ process.stdin.setEncoding('utf8');
16
+ process.stdin.on('data', (chunk) => { raw += chunk; });
17
+ process.stdin.on('end', () => {
18
+ let input = {};
19
+ try { input = JSON.parse(raw); } catch { input = {}; }
20
+ const submit = input.userPromptSubmit || {};
21
+ const prompt = String(submit.prompt || '').trim();
22
+
23
+ // Always log (no PII redaction needed — the prompt is the user's).
24
+ try {
25
+ const logDir = path.join(os.homedir(), '.config', 'bizar', 'hook-logs');
26
+ fs.mkdirSync(logDir, { recursive: true });
27
+ const today = new Date().toISOString().slice(0, 10);
28
+ const logFile = path.join(logDir, `user-prompt-${today}.jsonl`);
29
+ fs.appendFileSync(logFile, JSON.stringify({
30
+ ts: new Date().toISOString(),
31
+ taskId: input.taskId || null,
32
+ promptLength: prompt.length,
33
+ }) + '\n');
34
+ } catch { /* best-effort */ }
35
+
36
+ const notes = [];
37
+ if (prompt.length === 0) {
38
+ notes.push('Bizar UserPromptSubmit: empty prompt — wait for actual user input.');
39
+ } else if (prompt.startsWith('/team')) {
40
+ notes.push('Bizar UserPromptSubmit: /team — Odin will spawn a coordinated agent team. Confirm disjoint file scopes before dispatching.');
41
+ } else if (prompt.startsWith('/plow-through')) {
42
+ notes.push('Bizar UserPromptSubmit: /plow-through — autonomous mode. Dispatch 2+ parallel agents when possible. Run /test before claiming done.');
43
+ } else if (prompt.startsWith('/test')) {
44
+ notes.push('Bizar UserPromptSubmit: /test — auto-detects runner (jest/vitest/bun/pytest/cargo/go). Streams output to the user.');
45
+ } else if (prompt.startsWith('/validate')) {
46
+ notes.push('Bizar UserPromptSubmit: /validate — runs 21-point health check on the Bizar install.');
47
+ } else {
48
+ notes.push('Bizar UserPromptSubmit: if the request is complex, decompose into 2+ parallel subagent tasks (Odin) or spawn a /team.');
49
+ }
50
+
51
+ process.stdout.write(JSON.stringify({
52
+ cancel: false,
53
+ contextModification: notes.join(' '),
54
+ }) + '\n');
55
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "description": "Norse-pantheon multi-agent system for cline — 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, cline plugin, and typed SDK.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,7 +24,7 @@
24
24
  "test:sdk": "node_modules/.bin/vitest run --root packages/sdk",
25
25
  "test:web": "cd bizar-dash && npx vitest run",
26
26
  "test:sdk:watch": "node_modules/.bin/vitest --root packages/sdk",
27
- "test": "npm run typecheck && npm run test:sdk && node --test cli/install.test.mjs cli/provision.test.mjs cli/commands/validate.test.mjs && bun test plugins/bizar/tests/loop.test.ts plugins/bizar/tests/block.test.ts plugins/bizar/tests/stall-think.test.ts plugins/bizar/tests/tools/bg-get-comments.test.ts plugins/bizar/tests/tools/bg-spawn-delegation.test.ts plugins/bizar/tests/tools/cline-runner.test.ts plugins/bizar/tests/settings.test.ts plugins/bizar/tests/commands.test.ts plugins/bizar/tests/commands-impl.test.ts plugins/bizar/tests/tools/plan-action.test.ts plugins/bizar/tests/tools/wait-for-feedback.test.ts plugins/bizar/tests/tools/read-glyph-feedback.test.ts plugins/bizar/tests/reasoning-clean.test.ts plugins/bizar/tests/key-rotation.test.ts && node bizar-dash/tests/smoke-v2.mjs && node --test bizar-dash/tests/path-safe.test.mjs bizar-dash/tests/tmux-wrap.test.mjs bizar-dash/tests/cline-sessions-detail.test.mjs bizar-dash/tests/cline-runner.test.mjs bizar-dash/tests/mod-instructions.node.test.mjs bizar-dash/tests/mod-upgrade.node.test.mjs bizar-dash/tests/graphify-mod-spawn.node.test.mjs bizar-dash/tests/no-agent-browser.node.test.mjs bizar-dash/tests/providers-store-backup-keys.node.test.mjs bizar-dash/tests/dashboard-ports.test.mjs bizar-dash/tests/submit-feedback.test.mjs bizar-dash/tests/yaml.test.mjs bizar-dash/tests/memory-store.test.mjs bizar-dash/tests/memory-schema.test.mjs bizar-dash/tests/memory-secrets.test.mjs bizar-dash/tests/memory-git.test.mjs bizar-dash/tests/memory-sync.test.mjs bizar-dash/tests/obsidian-back-compat.test.mjs bizar-dash/tests/memory-lightrag.test.mjs bizar-dash/tests/memory-config.test.mjs bizar-dash/tests/memory-cli.test.mjs bizar-dash/tests/memory-cli-readlistdelete.test.mjs bizar-dash/tests/memory-cli-setup.test.mjs bizar-dash/tests/memory-conflicts.test.mjs bizar-dash/tests/memory-namespace.test.mjs bizar-dash/tests/memory-path-safety.test.mjs bizar-dash/tests/memory-protocol-drift.test.mjs bizar-dash/tests/memory-roundtrip.test.mjs bizar-dash/tests/cli-bugfixes.test.mjs bizar-dash/tests/server-bugfixes.test.mjs bizar-dash/tests/frontend-bugfixes.test.mjs",
27
+ "test": "npm run typecheck && npm run test:sdk && node --test cli/install.test.mjs cli/provision.test.mjs cli/commands/validate.test.mjs cli/commands/setup-provider.test.mjs && bun test plugins/bizar/tests/loop.test.ts plugins/bizar/tests/block.test.ts plugins/bizar/tests/stall-think.test.ts plugins/bizar/tests/tools/bg-get-comments.test.ts plugins/bizar/tests/tools/bg-spawn-delegation.test.ts plugins/bizar/tests/tools/cline-runner.test.ts plugins/bizar/tests/settings.test.ts plugins/bizar/tests/commands.test.ts plugins/bizar/tests/commands-impl.test.ts plugins/bizar/tests/tools/plan-action.test.ts plugins/bizar/tests/tools/wait-for-feedback.test.ts plugins/bizar/tests/tools/read-glyph-feedback.test.ts plugins/bizar/tests/reasoning-clean.test.ts plugins/bizar/tests/key-rotation.test.ts && node bizar-dash/tests/smoke-v2.mjs && node --test bizar-dash/tests/path-safe.test.mjs bizar-dash/tests/tmux-wrap.test.mjs bizar-dash/tests/cline-sessions-detail.test.mjs bizar-dash/tests/cline-runner.test.mjs bizar-dash/tests/mod-instructions.node.test.mjs bizar-dash/tests/mod-upgrade.node.test.mjs bizar-dash/tests/graphify-mod-spawn.node.test.mjs bizar-dash/tests/no-agent-browser.node.test.mjs bizar-dash/tests/providers-store-backup-keys.node.test.mjs bizar-dash/tests/dashboard-ports.test.mjs bizar-dash/tests/submit-feedback.test.mjs bizar-dash/tests/yaml.test.mjs bizar-dash/tests/memory-store.test.mjs bizar-dash/tests/memory-schema.test.mjs bizar-dash/tests/memory-secrets.test.mjs bizar-dash/tests/memory-git.test.mjs bizar-dash/tests/memory-sync.test.mjs bizar-dash/tests/obsidian-back-compat.test.mjs bizar-dash/tests/memory-lightrag.test.mjs bizar-dash/tests/memory-config.test.mjs bizar-dash/tests/memory-cli.test.mjs bizar-dash/tests/memory-cli-readlistdelete.test.mjs bizar-dash/tests/memory-cli-setup.test.mjs bizar-dash/tests/memory-conflicts.test.mjs bizar-dash/tests/memory-namespace.test.mjs bizar-dash/tests/memory-path-safety.test.mjs bizar-dash/tests/memory-protocol-drift.test.mjs bizar-dash/tests/memory-roundtrip.test.mjs bizar-dash/tests/cli-bugfixes.test.mjs bizar-dash/tests/server-bugfixes.test.mjs bizar-dash/tests/frontend-bugfixes.test.mjs",
28
28
  "build": "npm run build:sdk && npm run build:dash",
29
29
  "prepublishOnly": "npm run build"
30
30
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar-plugin",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "description": "Bizar Norse-pantheon multi-agent plugin for Cline — 14 agents across 4 cost tiers with cost-aware routing and plans.",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -149,18 +149,20 @@ try {
149
149
  const tplPath = join(REPO_ROOT, 'config', 'cline.json.template');
150
150
  const tpl = JSON.parse(readFileSync(tplPath, 'utf8'));
151
151
  const hasPlugin = Array.isArray(tpl.plugin) && tpl.plugin.length > 0;
152
- const has9router = tpl.provider && tpl.provider['9router'];
152
+ // v6.2.2 template MUST NOT have a provider block (installer no
153
+ // longer touches provider config; user configures their own).
154
+ const hasNoProvider = !tpl.provider;
153
155
  const hasDefaultAgent = tpl.default_agent;
154
156
  const hasCommands = tpl.command && tpl.command.team && tpl.command.test && tpl.command.validate;
155
- if (hasPlugin && has9router && hasDefaultAgent && hasCommands) {
156
- record('cline.json.template is complete', true, 'plugin, 9router, default_agent, /team, /test, /validate');
157
+ if (hasPlugin && hasNoProvider && hasDefaultAgent && hasCommands) {
158
+ record('cline.json.template is complete (no provider — user configures their own)', true, 'plugin, default_agent, /team, /test, /validate');
157
159
  } else {
158
160
  const missing = [];
159
161
  if (!hasPlugin) missing.push('plugin[]');
160
- if (!has9router) missing.push('provider.9router');
162
+ if (!hasNoProvider) missing.push('provider (should be absent — user configures)');
161
163
  if (!hasDefaultAgent) missing.push('default_agent');
162
164
  if (!hasCommands) missing.push('command.team/test/validate');
163
- record('cline.json.template is complete', false, `missing: ${missing.join(', ')}`);
165
+ record('cline.json.template is complete (no provider — user configures their own)', false, `missing/wrong: ${missing.join(', ')}`);
164
166
  }
165
167
  } catch (err) {
166
168
  record('cline.json.template readable', false, err.message);
@@ -249,6 +251,39 @@ try {
249
251
  record('config/rules/ scannable', false, err.message);
250
252
  }
251
253
 
254
+ // ── 6.5. Verify config/hooks/ has Cline-native executable hooks ────
255
+ // Cline hooks are real scripts (not markdown). They must have a
256
+ // shebang line and the right names. The previous v6.x format used
257
+ // markdown behavioral files which Cline ignored.
258
+ try {
259
+ const { readFileSync, readdirSync, existsSync } = await import('node:fs');
260
+ const hooksDir = join(REPO_ROOT, 'config', 'hooks');
261
+ if (!existsSync(hooksDir)) {
262
+ record('config/hooks/ present', false, `${hooksDir} missing`);
263
+ } else {
264
+ const files = readdirSync(hooksDir);
265
+ const required = ['PreToolUse', 'PostToolUse', 'TaskStart', 'TaskResume', 'UserPromptSubmit'];
266
+ const missing = required.filter((f) => !files.includes(f));
267
+ if (missing.length > 0) {
268
+ record('config/hooks/ has 5 Cline-native hook scripts', false, `missing: ${missing.join(', ')}`);
269
+ } else {
270
+ // Verify each has a shebang line (Cline requires it).
271
+ const noShebang = [];
272
+ for (const f of required) {
273
+ const first = readFileSync(join(hooksDir, f), 'utf8').split('\n')[0] || '';
274
+ if (!first.startsWith('#!')) noShebang.push(f);
275
+ }
276
+ if (noShebang.length > 0) {
277
+ record('Cline hooks have shebang', false, `no shebang: ${noShebang.join(', ')}`);
278
+ } else {
279
+ record('config/hooks/ has 5 Cline-native executable hooks', true, required.join(', '));
280
+ }
281
+ }
282
+ }
283
+ } catch (err) {
284
+ record('config/hooks/ scannable', false, err.message);
285
+ }
286
+
252
287
  // ── 7. Verify plugin index.ts is well-formed ───────────────────
253
288
  try {
254
289
  const { readFileSync } = await import('node:fs');
@@ -1,16 +0,0 @@
1
- # Post-Tool-Use Hook
2
-
3
- Enforced by: All implementation agents (Heimdall, Thor, Tyr, Vidarr)
4
-
5
- ## Checklist
6
-
7
- After every `write` or `edit` operation:
8
-
9
- 1. **Format**: Run the project formatter (Prettier, Black, ruff, gofmt, rustfmt)
10
- 2. **Lint**: Run the linter on the modified file
11
- 3. **Typecheck**: Run the type checker (tsc, mypy, etc.) if applicable
12
- 4. **Quick test**: If modifying tests, run just the affected test file
13
-
14
- ## Enforcement
15
-
16
- Run these automatically. Do not ask for permission — the hook enforces quality.
@@ -1,16 +0,0 @@
1
- # Pre-Tool-Use Hook
2
-
3
- Enforced by: All implementation agents (Heimdall, Thor, Tyr, Vidarr)
4
-
5
- ## Checklist
6
-
7
- Before every `write` or `edit` operation, check:
8
-
9
- 1. **Secrets**: Does the content contain API keys, tokens, or passwords? (`sk-...`, `AIza...`, etc.)
10
- 2. **Console.log**: Is debug logging being committed? Use proper logging instead.
11
- 3. **Permissions**: Are you writing to a file you should not modify? (e.g., `.env`, `node_modules/`, `*.lock`)
12
- 4. **Size**: Is the file too large? Consider splitting into smaller modules.
13
-
14
- ## Enforcement
15
-
16
- Block the operation if any check fails. Fix the issue first, then proceed.