dual-brain 7.1.0 → 7.1.1

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.
@@ -379,7 +379,7 @@ async function cmdStatus(args = []) {
379
379
  } else {
380
380
  const settings = JSON.parse(rfs(settingsFile, 'utf8'));
381
381
  const preToolUse = settings?.hooks?.PreToolUse ?? [];
382
- const guardCmd = 'bash .claude/hooks/head-guard.sh';
382
+ const guardCmd = 'node .claude/hooks/head-guard.mjs';
383
383
  const tierCmd = 'node .claude/hooks/enforce-tier.mjs';
384
384
  const hasEdit = preToolUse.some(e => e.matcher === 'Edit' && e.hooks?.some(h => h.command === guardCmd));
385
385
  const hasWrite = preToolUse.some(e => e.matcher === 'Write' && e.hooks?.some(h => h.command === guardCmd));
@@ -639,7 +639,7 @@ async function dashboardScreen(rl, ask) {
639
639
  if (existsSync(settingsFile)) {
640
640
  const settings = JSON.parse(readFileSync(settingsFile, 'utf8'));
641
641
  const preToolUse = settings?.hooks?.PreToolUse ?? [];
642
- const guardCmd = 'bash .claude/hooks/head-guard.sh';
642
+ const guardCmd = 'node .claude/hooks/head-guard.mjs';
643
643
  const tierCmd = 'node .claude/hooks/enforce-tier.mjs';
644
644
  const hasEdit = preToolUse.some(e => e.matcher === 'Edit' && e.hooks?.some(h => h.command === guardCmd));
645
645
  const hasWrite = preToolUse.some(e => e.matcher === 'Write' && e.hooks?.some(h => h.command === guardCmd));
@@ -839,7 +839,7 @@ async function diagnosticsScreen(rl, ask) {
839
839
  if (existsSync(settingsFile)) {
840
840
  const settings = JSON.parse(readFileSync(settingsFile, 'utf8'));
841
841
  const preToolUse = settings?.hooks?.PreToolUse ?? [];
842
- const guardCmd = 'bash .claude/hooks/head-guard.sh';
842
+ const guardCmd = 'node .claude/hooks/head-guard.mjs';
843
843
  const tierCmd = 'node .claude/hooks/enforce-tier.mjs';
844
844
  const hasEdit = preToolUse.some(e => e.matcher === 'Edit' && e.hooks?.some(h => h.command === guardCmd));
845
845
  const hasWrite = preToolUse.some(e => e.matcher === 'Write' && e.hooks?.some(h => h.command === guardCmd));
@@ -855,7 +855,7 @@ async function diagnosticsScreen(rl, ask) {
855
855
  // Hook health: check if hook files exist
856
856
  const hooksDir = join(cwd, '.claude', 'hooks');
857
857
  const expectedHooks = [
858
- 'head-guard.sh', 'enforce-tier.mjs', 'budget-balancer.mjs',
858
+ 'head-guard.mjs', 'enforce-tier.mjs', 'budget-balancer.mjs',
859
859
  'session-report.mjs', 'quality-gate.mjs', 'health-check.mjs',
860
860
  ];
861
861
  const hookStatus = expectedHooks.map(h => {
package/install.mjs CHANGED
@@ -744,7 +744,7 @@ function generateSettings(workspace) {
744
744
  let existing = {};
745
745
  try { existing = JSON.parse(readFileSync(settingsPath, 'utf8')); } catch {}
746
746
 
747
- const HEAD_GUARD_CMD = 'bash .claude/hooks/head-guard.sh';
747
+ const HEAD_GUARD_CMD = 'node .claude/hooks/head-guard.mjs';
748
748
  const ENFORCE_TIER_CMD = 'node .claude/hooks/enforce-tier.mjs';
749
749
 
750
750
  // All dual-brain PreToolUse hooks we manage
@@ -883,11 +883,12 @@ function install(workspace, env, mode) {
883
883
  'wave-orchestrator.mjs',
884
884
  'task-classifier.mjs', 'model-registry.mjs',
885
885
  'auto-update-wrapper.mjs',
886
+ 'head-guard.mjs',
886
887
  ];
887
888
  for (const h of HOOKS) cpSync(join(__dirname, 'hooks', h), join(target, 'hooks', h));
888
889
 
889
- // Copy bash hooks (auto-update.sh and head-guard.sh live alongside .mjs hooks in the package)
890
- const BASH_HOOKS = ['auto-update.sh', 'head-guard.sh'];
890
+ // Copy bash hooks (auto-update.sh lives alongside .mjs hooks in the package)
891
+ const BASH_HOOKS = ['auto-update.sh'];
891
892
  for (const h of BASH_HOOKS) {
892
893
  const src = join(__dirname, 'hooks', h);
893
894
  const dst = join(target, 'hooks', h);
@@ -253,7 +253,7 @@ async function handleRequest(msg) {
253
253
  return respond(id, {
254
254
  protocolVersion: '2024-11-05',
255
255
  capabilities: { tools: {} },
256
- serverInfo: { name: 'dual-brain', version: '1.0.0' },
256
+ serverInfo: { name: 'dual-brain', version: '7.1.0' },
257
257
  });
258
258
 
259
259
  case 'initialized':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "description": "AI orchestration across Claude + OpenAI subscriptions — smart routing, budget awareness, and dual-brain collaboration",
5
5
  "type": "module",
6
6
  "bin": {
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dual-brain",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "description": "Dual-provider AI orchestration — smart routing between Claude and OpenAI",
5
5
  "skills": [
6
6
  { "name": "go", "description": "Route and dispatch a task", "file": "skills/go.md" },
package/src/index.mjs CHANGED
@@ -6,7 +6,7 @@
6
6
  * orchestrate() convenience function for programmatic use.
7
7
  */
8
8
 
9
- export { loadProfile, ensureProfile, runOnboarding, rememberPreference, forgetPreference, getActivePreferences, getAvailableProviders, isSoloBrain, getHeadModel } from './profile.mjs';
9
+ export { loadProfile, saveProfile, ensureProfile, runOnboarding, rememberPreference, forgetPreference, getActivePreferences, getAvailableProviders, isSoloBrain, getHeadModel, detectAuth, detectEnvironment, setupAuth, getActiveKey, removeAuthKey, disableKey, rotateToNextKey } from './profile.mjs';
10
10
  export { detectTask, classifyIntent, classifyRisk, estimateComplexity, inferTier, extractPaths } from './detect.mjs';
11
11
  export { decideRoute, getModelCapabilities, getAvailableModels, estimateBudgetPressure, shouldDualBrain, explainDecision } from './decide.mjs';
12
12
  export { dispatch, buildCommand, detectRuntime, compressResult, dispatchDualBrain } from './dispatch.mjs';
@@ -16,6 +16,9 @@ export { detectRepo, loadRepoCache, getTestCommand, getLintCommand } from './rep
16
16
  export { loadSession, saveSession, updateSession, clearSession, formatSessionCard } from './session.mjs';
17
17
  export { decompose, isSimpleTask, taskGraphToWaves } from './decompose.mjs';
18
18
  export { generateBrief, compressPriorResults, listRoles } from './brief.mjs';
19
+ export { redact, redactFiles, isSecretFile } from './redact.mjs';
20
+ export { isInsideClaude, buildNativeDispatch, normalizeResult } from './dispatch.mjs';
21
+ export { box, bar, badge, menu, separator } from './tui.mjs';
19
22
 
20
23
  // Top-level convenience function
21
24
  export async function orchestrate({ prompt, files, cwd, dryRun }) {