dual-brain 0.3.1 → 0.3.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.
Files changed (2) hide show
  1. package/install.mjs +13 -5
  2. package/package.json +1 -1
package/install.mjs CHANGED
@@ -916,7 +916,10 @@ function install(workspace, env, mode) {
916
916
  'auto-update-wrapper.mjs',
917
917
  'head-guard.mjs',
918
918
  ];
919
- for (const h of HOOKS) cpSync(join(__dirname, 'hooks', h), join(target, 'hooks', h));
919
+ for (const h of HOOKS) {
920
+ const hSrc = join(__dirname, 'hooks', h);
921
+ if (existsSync(hSrc)) cpSync(hSrc, join(target, 'hooks', h));
922
+ }
920
923
 
921
924
  // Copy bash hooks (auto-update.sh lives alongside .mjs hooks in the package)
922
925
  const BASH_HOOKS = ['auto-update.sh'];
@@ -935,8 +938,12 @@ function install(workspace, env, mode) {
935
938
  'hookify.orchestrator-gate.local.md',
936
939
  'hookify.orchestrator-cost.local.md',
937
940
  ];
938
- for (const r of RULES) cpSync(join(__dirname, r), join(target, r));
939
- actions.push(`✓ ${RULES.length} hookify rules`);
941
+ let rulesInstalled = 0;
942
+ for (const r of RULES) {
943
+ const rSrc = join(__dirname, r);
944
+ if (existsSync(rSrc)) { cpSync(rSrc, join(target, r)); rulesInstalled++; }
945
+ }
946
+ if (rulesInstalled) actions.push(`✓ ${rulesInstalled} hookify rules`);
940
947
 
941
948
  const orch = generateOrchestrator(mode, workspace);
942
949
  writeFileSync(join(target, 'orchestrator.json'), JSON.stringify(orch, null, 2) + '\n');
@@ -954,8 +961,9 @@ function install(workspace, env, mode) {
954
961
  actions.push('✓ CLAUDE.md (session instructions)');
955
962
 
956
963
  const rulesTarget = join(target, 'review-rules.md');
957
- if (!existsSync(rulesTarget) || force) {
958
- cpSync(join(__dirname, 'review-rules.md'), rulesTarget);
964
+ const rulesSrc = join(__dirname, 'review-rules.md');
965
+ if (existsSync(rulesSrc) && (!existsSync(rulesTarget) || force)) {
966
+ cpSync(rulesSrc, rulesTarget);
959
967
  actions.push('✓ review-rules.md template');
960
968
  } else {
961
969
  actions.push('⊘ review-rules.md (kept yours)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "AI orchestration across Claude + OpenAI subscriptions — smart routing, budget awareness, and dual-brain collaboration",
5
5
  "type": "module",
6
6
  "bin": {