@polderlabs/bizar 5.6.0-beta.13 → 5.6.0-beta.14
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/provision.mjs +56 -12
- package/package.json +1 -1
- package/packages/sdk/package.json +1 -1
- package/plugins/bizar/package.json +25 -0
package/cli/provision.mjs
CHANGED
|
@@ -40,16 +40,7 @@ import chalk from 'chalk';
|
|
|
40
40
|
import { execSync, spawn, spawnSync } from 'node:child_process';
|
|
41
41
|
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync, mkdirSync, statSync, copyFileSync } from 'node:fs';
|
|
42
42
|
import { homedir } from 'node:os';
|
|
43
|
-
import { join
|
|
44
|
-
// Debug: throw with stack trace if a Dirent sneaks into path.join
|
|
45
|
-
function join(...args) {
|
|
46
|
-
for (const a of args) {
|
|
47
|
-
if (a && typeof a === 'object' && a.constructor && a.constructor.name === 'Dirent') {
|
|
48
|
-
console.error('Dirent passed to join:', a.name, 'stack:', new Error().stack.split('\n').slice(0, 8).join('\n '));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return _origJoin(...args);
|
|
52
|
-
}
|
|
43
|
+
import { join, dirname, sep } from 'node:path';
|
|
53
44
|
import { fileURLToPath } from 'node:url';
|
|
54
45
|
import { bizarConfigDir } from './utils.mjs';
|
|
55
46
|
|
|
@@ -629,6 +620,40 @@ export async function copyPluginToCline({ dryRun, force }) {
|
|
|
629
620
|
};
|
|
630
621
|
}
|
|
631
622
|
|
|
623
|
+
// v5.6.0-beta.14: require a package.json with a `cline` field before
|
|
624
|
+
// copying. Per https://docs.cline.bot/customization/plugins — without
|
|
625
|
+
// the `cline.plugins` manifest, Cline falls back to recursive
|
|
626
|
+
// auto-discovery and tries to load every .ts file in the plugin tree
|
|
627
|
+
// (including `src/tools/*.ts`, `tests/*.test.ts`) as a plugin module,
|
|
628
|
+
// which produces ~100 `Invalid plugin module` errors at startup.
|
|
629
|
+
// Refuse to copy a plugin that isn't actually a Cline plugin.
|
|
630
|
+
const pkgJsonPath = join(src, 'package.json');
|
|
631
|
+
if (!existsSync(pkgJsonPath)) {
|
|
632
|
+
return {
|
|
633
|
+
ok: false,
|
|
634
|
+
message:
|
|
635
|
+
`plugin source missing package.json at ${pkgJsonPath} — ` +
|
|
636
|
+
`rebuild @polderlabs/bizar (the plugin must ship a cline field)`,
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
try {
|
|
640
|
+
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
|
641
|
+
if (!pkg.cline?.plugins?.length) {
|
|
642
|
+
return {
|
|
643
|
+
ok: false,
|
|
644
|
+
message:
|
|
645
|
+
`plugin package.json at ${pkgJsonPath} is missing the ` +
|
|
646
|
+
'cline.plugins manifest required by Cline — see ' +
|
|
647
|
+
'https://docs.cline.bot/customization/plugins',
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
} catch (err) {
|
|
651
|
+
return {
|
|
652
|
+
ok: false,
|
|
653
|
+
message: `plugin package.json at ${pkgJsonPath} is invalid JSON: ${err.message}`,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
632
657
|
if (state.plugin.symlink && !force) {
|
|
633
658
|
return {
|
|
634
659
|
ok: true,
|
|
@@ -672,7 +697,19 @@ export async function copyPluginToCline({ dryRun, force }) {
|
|
|
672
697
|
// Filter against RELATIVE path segments, not absolute substrings. This
|
|
673
698
|
// is the v5.6.0-beta.12 fix: the old filter excluded the src dir itself
|
|
674
699
|
// because npm-global paths contain `node_modules`.
|
|
675
|
-
|
|
700
|
+
//
|
|
701
|
+
// v5.6.0-beta.14: also skip `tests/` and `scripts/` (test fixtures &
|
|
702
|
+
// helper scripts aren't part of the runtime plugin) and `coverage/`
|
|
703
|
+
// (jest artifacts). The runtime only needs `index.ts`, `src/`,
|
|
704
|
+
// `package.json`, and the static docs.
|
|
705
|
+
const skipDirs = new Set([
|
|
706
|
+
'node_modules',
|
|
707
|
+
'dist',
|
|
708
|
+
'tests',
|
|
709
|
+
'scripts',
|
|
710
|
+
'coverage',
|
|
711
|
+
'.DS_Store',
|
|
712
|
+
]);
|
|
676
713
|
await cp(src, dest, {
|
|
677
714
|
recursive: true,
|
|
678
715
|
filter: (p) => {
|
|
@@ -826,7 +863,14 @@ export async function patchClineJson({ dryRun, force }) {
|
|
|
826
863
|
}
|
|
827
864
|
|
|
828
865
|
if (!hasEntry) {
|
|
829
|
-
|
|
866
|
+
// v5.6.0-beta.14: point at the plugin DIRECTORY (not a file inside
|
|
867
|
+
// it). Cline reads `package.json#cline.plugins` from there and loads
|
|
868
|
+
// the entry point declared in the manifest. Pointing at `index.ts`
|
|
869
|
+
// directly used to work, but with the new auto-discovery rules (see
|
|
870
|
+
// https://docs.cline.bot/customization/plugins) it can cause every
|
|
871
|
+
// .ts file under the plugin tree to be loaded as a separate plugin
|
|
872
|
+
// module — producing ~100 `Invalid plugin module` errors at startup.
|
|
873
|
+
plugins.push(['./plugins/bizar', {
|
|
830
874
|
loopThresholdWarn: 5,
|
|
831
875
|
loopThresholdEscalate: 8,
|
|
832
876
|
loopThresholdBlock: 12,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polderlabs/bizar",
|
|
3
|
-
"version": "5.6.0-beta.
|
|
3
|
+
"version": "5.6.0-beta.14",
|
|
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": {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@polderlabs/bizar-plugin",
|
|
3
|
+
"version": "5.6.0-beta.14",
|
|
4
|
+
"description": "Bizar Norse-pantheon multi-agent plugin for Cline — 14 agents across 4 cost tiers with cost-aware routing and plans.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.ts",
|
|
7
|
+
"cline": {
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"paths": ["./index.ts"],
|
|
11
|
+
"capabilities": ["tools", "hooks"]
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@cline/sdk": "*",
|
|
17
|
+
"@cline/core": "*",
|
|
18
|
+
"@cline/shared": "*"
|
|
19
|
+
},
|
|
20
|
+
"peerDependenciesMeta": {
|
|
21
|
+
"@cline/sdk": { "optional": true },
|
|
22
|
+
"@cline/core": { "optional": true },
|
|
23
|
+
"@cline/shared": { "optional": true }
|
|
24
|
+
}
|
|
25
|
+
}
|