claude-flow 3.30.2 → 3.30.4

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,43 @@
1
+ ' hidden-hook.vbs — Windowless launcher for Claude Code hooks on Windows.
2
+ '
3
+ ' Workaround for anthropics/claude-code#14828 / #70200 — Claude Code's
4
+ ' child_process.spawn for hook commands is missing windowsHide/CREATE_NO_WINDOW,
5
+ ' so every hook fire flashes a visible cmd.exe window. This shim is invoked via
6
+ ' wscript.exe (a GUI-subsystem host with no console), so Claude Code's outer
7
+ ' spawn attaches no console. Internally it runs node hidden via
8
+ ' WScript.Shell.Run(cmd, 0, True).
9
+ '
10
+ ' Usage from settings.local.json:
11
+ ' "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs pre-bash"
12
+ '
13
+ ' TRADE-OFF: wscript.exe has no stdin. Claude Code sends hook event data as
14
+ ' JSON via stdin, so hooks routed through this shim run WITHOUT their event
15
+ ' payload. Most ruflo hooks (env-var driven) still work; hooks like `route`
16
+ ' that need the user's prompt will have reduced context.
17
+ '
18
+ ' Exit code from the wrapped node process is propagated back to Claude Code.
19
+
20
+ Option Explicit
21
+
22
+ If WScript.Arguments.Count < 1 Then
23
+ WScript.Quit 2
24
+ End If
25
+
26
+ Dim shell, cmd, i, arg
27
+ Set shell = CreateObject("WScript.Shell")
28
+
29
+ ' Resolve helpers dir from this script's own path (avoids env-var dependency)
30
+ Dim scriptDir
31
+ scriptDir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\"))
32
+
33
+ ' First arg is the hook-handler script name (e.g. "hook-handler.cjs"),
34
+ ' remaining args are passed through to node.
35
+ cmd = "node """ & scriptDir & WScript.Arguments(0) & """"
36
+ For i = 1 To WScript.Arguments.Count - 1
37
+ arg = WScript.Arguments(i)
38
+ arg = Replace(arg, """", "\""")
39
+ cmd = cmd & " """ & arg & """"
40
+ Next
41
+
42
+ ' 0 = SW_HIDE, True = wait for completion (propagates exit code synchronously)
43
+ WScript.Quit shell.Run(cmd, 0, True)
@@ -89,6 +89,10 @@ function spawnDetachedHookRefresh(subcommand) {
89
89
  detached: true,
90
90
  stdio: 'ignore',
91
91
  env: process.env,
92
+ // Windows: without this, npx.cmd's cmd.exe wrapper flashes a visible
93
+ // console window every time a hook fires a background refresh. Runs
94
+ // hidden instead. No-op on POSIX.
95
+ windowsHide: true,
92
96
  });
93
97
  child.unref();
94
98
  } catch (e) { /* best-effort only */ }
@@ -98,105 +102,6 @@ function spawnDetachedFunnelRefresh() {
98
102
  spawnDetachedHookRefresh('refresh-funnel');
99
103
  }
100
104
 
101
- // ADR-318/319: first-run auto-enable of spinner verbs (default ON) +
102
- // announcements (default OFF, explicit opt-in). Fires ONCE per install
103
- // (marker at ~/.ruflo/first-run-enabled.json), then never again —
104
- // subsequent sessions see the marker and skip.
105
- //
106
- // Split posture rationale:
107
- // - Spinner verbs = low-intrusion (per-spin flash, append-mode mix
108
- // with Claude Code defaults, moderate visibility over time). Default ON.
109
- // Disclosure notification + one-command disable satisfies the ethical bar.
110
- // - Announcements = higher-intrusion (prominent line at every Claude Code
111
- // startup, more attention per view). Default OFF; opt-in via
112
- // RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1 or explicit `ruflo announcements enable`.
113
- //
114
- // Gates (spinner is default-on unless any is TRUE):
115
- // - RUFLO_NO_AUTO_ENABLE truthy (master opt-out — kills both)
116
- // - RUFLO_NO_AUTO_ENABLE_SPINNER truthy (spinner-only opt-out)
117
- // - CI / GITHUB_ACTIONS truthy
118
- // - stdout is not a TTY (piped, non-interactive)
119
- // - Marker file already exists
120
- //
121
- // Announcements needs the same gates PLUS RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1.
122
- //
123
- // Marker is written even if the spawns fail — auto-enable is a "we tried once"
124
- // contract, not "keep trying until success." Users can run enable manually.
125
- function firstRunAutoEnableIfEligible() {
126
- try {
127
- const path = require('path');
128
- const fs = require('fs');
129
- const os = require('os');
130
- const truthy = (v) => v && !/^(0|false|off|no)$/i.test(String(v));
131
- if (truthy(process.env.RUFLO_NO_AUTO_ENABLE)) return;
132
- if (process.env.CI || process.env.GITHUB_ACTIONS) return;
133
- if (process.stdout && process.stdout.isTTY === false) return;
134
- const markerPath = path.join(os.homedir(), '.ruflo', 'first-run-enabled.json');
135
- if (fs.existsSync(markerPath)) return;
136
-
137
- const enableSpinner = !truthy(process.env.RUFLO_NO_AUTO_ENABLE_SPINNER);
138
- const enableAnnouncements = truthy(process.env.RUFLO_AUTO_ENABLE_ANNOUNCEMENTS);
139
-
140
- // Nothing to do — user opted out of both. Skip marker write so if they
141
- // change their mind and re-enable env vars later, first-run still fires.
142
- if (!enableSpinner && !enableAnnouncements) return;
143
-
144
- // Spawn the enable commands detached + non-blocking. Any failure
145
- // (missing CLI, refused state, etc.) is silent — auto-enable is
146
- // best-effort and MUST NOT block session-restore. Uses execPath +
147
- // resolved cli.js directly rather than spawnDetachedHookRefresh
148
- // because that helper hardcodes 'hooks' as the top-level command.
149
- const { spawn } = require('child_process');
150
- const cliBin = resolveCliBinForHook();
151
- const runDetached = (args) => {
152
- try {
153
- const spawnArgs = cliBin
154
- ? [process.execPath, [cliBin, ...args]]
155
- : [process.platform === 'win32' ? 'npx.cmd' : 'npx',
156
- ['--prefer-offline', '@claude-flow/cli', ...args]];
157
- const child = spawn(spawnArgs[0], spawnArgs[1], {
158
- detached: true, stdio: 'ignore', env: process.env, windowsHide: true,
159
- });
160
- child.unref();
161
- } catch { /* best-effort */ }
162
- };
163
- if (enableSpinner) runDetached(['spinner', 'enable', '--yes']);
164
- if (enableAnnouncements) runDetached(['announcements', 'enable', '--yes']);
165
-
166
- try {
167
- fs.mkdirSync(path.dirname(markerPath), { recursive: true, mode: 0o700 });
168
- fs.writeFileSync(
169
- markerPath,
170
- JSON.stringify({
171
- _ts: Date.now(),
172
- source: 'session-restore-hook',
173
- enabled: { spinner: enableSpinner, announcements: enableAnnouncements },
174
- }, null, 2),
175
- { encoding: 'utf-8', mode: 0o600 }
176
- );
177
- } catch { /* ignore — best effort */ }
178
-
179
- // Notification tells user exactly what happened. stderr so it doesn't
180
- // corrupt any downstream JSON stdout consumer.
181
- try {
182
- const parts = [];
183
- if (enableSpinner) parts.push('spinner verbs');
184
- if (enableAnnouncements) parts.push('startup announcements');
185
- const disableCmds = [];
186
- if (enableSpinner) disableCmds.push('`ruflo spinner disable`');
187
- if (enableAnnouncements) disableCmds.push('`ruflo announcements disable`');
188
- process.stderr.write(
189
- '[ruflo] First-run: enabled ' + parts.join(' + ') + '. ' +
190
- 'Disable anytime with ' + disableCmds.join(' / ') + '. ' +
191
- (enableSpinner && !enableAnnouncements
192
- ? 'Announcements stay opt-in — set RUFLO_AUTO_ENABLE_ANNOUNCEMENTS=1 to enable those too. '
193
- : '') +
194
- 'Restart Claude Code once to see the changes take effect.\n'
195
- );
196
- } catch { /* ignore */ }
197
- } catch { /* auto-enable must never break session-restore */ }
198
- }
199
-
200
105
  // Same fallback-aware pattern as spawnDetachedFunnelRefresh() above, for
201
106
  // ADR-316's co-pilot advisor tip. Safe to call on EVERY session-restore:
202
107
  // refresh-advisor's own action checks consent + a 24h TTL BEFORE spending
@@ -444,11 +349,6 @@ const handlers = {
444
349
  },
445
350
 
446
351
  'session-restore': async () => {
447
- // ADR-318/319 first-run auto-enable — fire once per install, never
448
- // re-fires after user disables. Respects RUFLO_NO_AUTO_ENABLE + CI.
449
- // Fully non-blocking (detached spawn) so session-restore latency
450
- // is unchanged.
451
- firstRunAutoEnableIfEligible();
452
352
  if (session) {
453
353
  // Try restore first, fall back to start
454
354
  const existing = session.restore && session.restore();
@@ -1,6 +1,5 @@
1
1
  {
2
- "model": "claude-opus-4-7",
3
- "_comment_skillListingBudgetFraction": "#1834 — repo has 367 SKILL.md files (5x duplicates of common skills) across .agents/skills, .claude/skills, archive/v2/.claude/skills, v3/@claude-flow/{cli,mcp}/.claude/skills. With Claude Code's default 1% budget, ~378 descriptions get truncated. Bumping to 6% covers the actual usage (5.5%). Long-term fix is to prune the duplicates and archive paths (see #1834).",
2
+ "model": "claude-sonnet-5",
4
3
  "skillListingBudgetFraction": 0.06,
5
4
  "customInstructions": "Follow the project's CLAUDE.md guidelines. Use concurrent execution for all operations. Prioritize v3 implementation with security-first development, 15-agent swarm coordination, phased performance optimization, and cross-platform helper automation.",
6
5
  "env": {
@@ -166,7 +165,7 @@
166
165
  "version": "3.6.11",
167
166
  "enabled": true,
168
167
  "modelPreferences": {
169
- "default": "claude-opus-4-7",
168
+ "default": "claude-sonnet-5",
170
169
  "routing": "claude-haiku-4-5-20251001"
171
170
  },
172
171
  "agentTeams": {
@@ -0,0 +1,78 @@
1
+ {
2
+ "_comment": "Windows-only override — routes HOOKS through wscript.exe hidden-hook.vbs to work around anthropics/claude-code#14828 / #70200 (missing windowsHide/CREATE_NO_WINDOW on hook spawns). Gitignored; delete or empty to restore normal .claude/settings.json behavior. Trade-offs: (1) wscript has no stdin/stdout, so hooks routed through here run without their JSON event payload and cannot print output back to Claude Code — most ruflo hooks tolerate this. (2) statusLine is NOT overridden here because it requires stdout; it falls back to .claude/settings.json's direct node invocation, which will still flash on Windows until Claude Code adds windowsHide to its statusLine spawn. See .claude/helpers/hidden-hook.vbs.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "Bash",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs pre-bash",
11
+ "timeout": 5000
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "PostToolUse": [
17
+ {
18
+ "matcher": "Write|Edit|MultiEdit",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs post-edit",
23
+ "timeout": 10000
24
+ }
25
+ ]
26
+ }
27
+ ],
28
+ "UserPromptSubmit": [
29
+ {
30
+ "hooks": [
31
+ {
32
+ "type": "command",
33
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs route",
34
+ "timeout": 10000
35
+ }
36
+ ]
37
+ }
38
+ ],
39
+ "SessionStart": [
40
+ {
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs session-restore",
45
+ "timeout": 15000
46
+ },
47
+ {
48
+ "type": "command",
49
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" auto-memory-hook.mjs import",
50
+ "timeout": 8000
51
+ }
52
+ ]
53
+ }
54
+ ],
55
+ "SessionEnd": [
56
+ {
57
+ "hooks": [
58
+ {
59
+ "type": "command",
60
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" hook-handler.cjs session-end",
61
+ "timeout": 10000
62
+ }
63
+ ]
64
+ }
65
+ ],
66
+ "Stop": [
67
+ {
68
+ "hooks": [
69
+ {
70
+ "type": "command",
71
+ "command": "wscript.exe \"${CLAUDE_PROJECT_DIR}\\.claude\\helpers\\hidden-hook.vbs\" auto-memory-hook.mjs sync",
72
+ "timeout": 10000
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.30.2",
3
+ "version": "3.30.4",
4
4
  "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "generation": 1,
4
- "generatedAt": "2026-07-14T20:51:31.912Z",
5
- "gitSha": "5fb50348",
4
+ "generatedAt": "2026-07-15T15:16:42.332Z",
5
+ "gitSha": "3e9122a3",
6
6
  "catalog": {
7
7
  "agents": 164,
8
8
  "tools": 387,
@@ -52,8 +52,8 @@ export function generateSettings(options) {
52
52
  };
53
53
  }
54
54
  // Note: Claude Code expects 'model' to be a string, not an object
55
- // Model preferences are stored in claudeFlow settings instead
56
- // settings.model = 'claude-sonnet-4-5-20250929'; // Uncomment if you want to set a default model
55
+ // Additional ruflo-specific model preferences live in claudeFlow.modelPreferences below
56
+ settings.model = 'claude-sonnet-5';
57
57
  // Add Agent Teams configuration (experimental feature)
58
58
  settings.env = {
59
59
  // Enable Claude Code Agent Teams for multi-agent coordination
@@ -74,7 +74,7 @@ export function generateSettings(options) {
74
74
  shell: platform.shell,
75
75
  },
76
76
  modelPreferences: {
77
- default: 'claude-opus-4-8',
77
+ default: 'claude-sonnet-5',
78
78
  routing: 'claude-haiku-4-5-20251001',
79
79
  },
80
80
  agentTeams: {
@@ -33,7 +33,7 @@ export interface AgentRecord {
33
33
  openrouterModel?: string;
34
34
  lastResult?: Record<string, unknown>;
35
35
  }
36
- export declare const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";
36
+ export declare const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-5";
37
37
  export declare function modelRejectsSamplingParams(model: string): boolean;
38
38
  export interface AnthropicCallInput {
39
39
  prompt: string;
@@ -35,13 +35,15 @@ function saveAgentStore(store) {
35
35
  // #1906/#2232 — Current model ids (Claude 4.x family):
36
36
  // Opus 4.8 → claude-opus-4-8 (current, the `opus` alias)
37
37
  // Opus 4.7 → claude-opus-4-7 (prior pin, reachable via `opus-4.7`)
38
- // Sonnet 4.6 → claude-sonnet-4-6
38
+ // Sonnet 5 → claude-sonnet-5 (current, the `sonnet` alias)
39
+ // Sonnet 4.6 → claude-sonnet-4-6 (prior pin, reachable via `sonnet-4.6`)
39
40
  // Haiku 4.5 → claude-haiku-4-5-20251001
40
- // `inherit` and the various defaults below all map to Sonnet 4.6.
41
- export const DEFAULT_ANTHROPIC_MODEL = 'claude-sonnet-4-6';
41
+ // `inherit` and the various defaults below all map to Sonnet 5.
42
+ export const DEFAULT_ANTHROPIC_MODEL = 'claude-sonnet-5';
42
43
  const MODEL_MAP = {
43
44
  haiku: 'claude-haiku-4-5-20251001',
44
- sonnet: 'claude-sonnet-4-6',
45
+ sonnet: 'claude-sonnet-5',
46
+ 'sonnet-4.6': 'claude-sonnet-4-6',
45
47
  opus: 'claude-opus-4-8',
46
48
  'opus-4.7': 'claude-opus-4-7',
47
49
  inherit: DEFAULT_ANTHROPIC_MODEL,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.30.2",
3
+ "version": "3.30.4",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",