dual-brain 0.3.0 → 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.
@@ -3,9 +3,9 @@
3
3
  // Ensures HEAD's running narrative, simmer buffer, and loop state survive
4
4
  // context window compression without loss.
5
5
 
6
- import { persist as persistNarrative, load as loadNarrative } from '../src/narrative.mjs';
7
- import { active as activeSimmer, prune as pruneSimmer } from '../src/simmer.mjs';
8
- import { getLoopStatus } from '../src/cognitive-loop.mjs';
6
+ import { persist as persistNarrative, load as loadNarrative } from '../dist/src/narrative.js';
7
+ import { active as activeSimmer, prune as pruneSimmer } from '../dist/src/simmer.js';
8
+ import { getLoopStatus } from '../dist/src/cognitive-loop.js';
9
9
  import { existsSync, writeFileSync, mkdirSync } from 'node:fs';
10
10
  import { join } from 'node:path';
11
11
 
@@ -95,9 +95,9 @@ async function run() {
95
95
 
96
96
  // 6. Persist immersion state and release session lock
97
97
  try {
98
- const { persist } = await import('../src/narrative.mjs');
99
- const { prune } = await import('../src/simmer.mjs');
100
- const { release } = await import('../src/session-lock.mjs');
98
+ const { persist } = await import('../dist/src/narrative.js');
99
+ const { prune } = await import('../dist/src/simmer.js');
100
+ const { release } = await import('../dist/src/session-lock.js');
101
101
  persist();
102
102
  prune();
103
103
  release();
package/install.mjs CHANGED
@@ -15,8 +15,8 @@ import { dirname, join, resolve } from 'path';
15
15
  import { fileURLToPath } from 'url';
16
16
  import { spawnSync } from 'child_process';
17
17
  import { createHash } from 'crypto';
18
- import { spinner, success as fxSuccess, warn as fxWarn, error as fxError, info as fxInfo, banner, celebrate, colors, sleep, nl, getMode } from './src/fx.mjs';
19
- import { panel, signalLine, headerBar } from './src/tui.mjs';
18
+ import { spinner, success as fxSuccess, warn as fxWarn, error as fxError, info as fxInfo, banner, celebrate, colors, sleep, nl, getMode } from './dist/src/fx.js';
19
+ import { panel, signalLine, headerBar } from './dist/src/tui.js';
20
20
 
21
21
  // Skip hook installation during global npm install — hooks are installed
22
22
  // when the user runs 'dual-brain install' in their project directory.
@@ -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.0",
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": {