claude-flow 3.5.35 → 3.5.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow",
3
- "version": "3.5.35",
3
+ "version": "3.5.37",
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",
@@ -154,42 +154,29 @@ export function generateSettings(options) {
154
154
  */
155
155
  const IS_WINDOWS = process.platform === 'win32';
156
156
  /**
157
- * Platform-aware project dir variable reference.
158
- * Claude Code sets $CLAUDE_PROJECT_DIR (Unix) / %CLAUDE_PROJECT_DIR% (Windows)
159
- * as an environment variable before running hook commands.
160
- * Falls back to "." (cwd) when the variable is unset, since Claude Code
161
- * runs hooks from the project root directory.
162
- */
163
- function projectDirVar() {
164
- return IS_WINDOWS ? '%CLAUDE_PROJECT_DIR%' : '${CLAUDE_PROJECT_DIR:-.}';
165
- }
166
- /**
167
- * Build a cross-platform hook command.
168
- * On Windows, wraps with `cmd /c` to avoid PowerShell stdin/process issues
169
- * that cause "UserPromptSubmit hook error" in Claude Code.
157
+ * Build a hook command with reliable $CLAUDE_PROJECT_DIR expansion.
158
+ * Wraps in `sh -c` to guarantee shell expansion on all platforms (macOS zsh,
159
+ * Linux bash). Falls back to "." if CLAUDE_PROJECT_DIR is unset, since
160
+ * Claude Code runs hooks from the project root.
161
+ * On Windows, uses `cmd /c` with %CLAUDE_PROJECT_DIR%.
170
162
  */
171
163
  function hookCmd(script, subcommand) {
172
- const cmd = `node ${script} ${subcommand}`.trim();
173
- return IS_WINDOWS ? `cmd /c ${cmd}` : cmd;
174
- }
175
- /**
176
- * Build a cross-platform hook command for ESM scripts (.mjs).
177
- */
178
- function hookCmdEsm(script, subcommand) {
179
- const cmd = `node ${script} ${subcommand}`.trim();
180
- return IS_WINDOWS ? `cmd /c ${cmd}` : cmd;
164
+ if (IS_WINDOWS) {
165
+ return `cmd /c node %CLAUDE_PROJECT_DIR%/${script} ${subcommand}`.trim();
166
+ }
167
+ // Use sh -c to ensure $CLAUDE_PROJECT_DIR is expanded by a real shell,
168
+ // even if Claude Code doesn't invoke hooks through a shell on macOS.
169
+ // eslint-disable-next-line no-template-curly-in-string
170
+ const dir = '${CLAUDE_PROJECT_DIR:-.}';
171
+ return `sh -c 'exec node "${dir}/${script}" ${subcommand}'`;
181
172
  }
182
173
  /** Shorthand for CJS hook-handler commands */
183
174
  function hookHandlerCmd(subcommand) {
184
- const dir = projectDirVar();
185
- const quote = IS_WINDOWS ? '' : '"';
186
- return hookCmd(`${quote}${dir}/.claude/helpers/hook-handler.cjs${quote}`, subcommand);
175
+ return hookCmd('.claude/helpers/hook-handler.cjs', subcommand);
187
176
  }
188
177
  /** Shorthand for ESM auto-memory-hook commands */
189
178
  function autoMemoryCmd(subcommand) {
190
- const dir = projectDirVar();
191
- const quote = IS_WINDOWS ? '' : '"';
192
- return hookCmdEsm(`${quote}${dir}/.claude/helpers/auto-memory-hook.mjs${quote}`, subcommand);
179
+ return hookCmd('.claude/helpers/auto-memory-hook.mjs', subcommand);
193
180
  }
194
181
  /**
195
182
  * Generate statusLine configuration for Claude Code
@@ -201,11 +188,11 @@ function generateStatusLineConfig(_options) {
201
188
  // The script runs after each assistant message (debounced 300ms).
202
189
  // NOTE: statusline must NOT use `cmd /c` — Claude Code manages its stdin
203
190
  // directly for statusline commands, and `cmd /c` blocks stdin forwarding.
204
- const dir = projectDirVar();
205
- const quote = IS_WINDOWS ? '' : '"';
191
+ // eslint-disable-next-line no-template-curly-in-string
192
+ const dir = '${CLAUDE_PROJECT_DIR:-.}';
206
193
  return {
207
194
  type: 'command',
208
- command: `node ${quote}${dir}/.claude/helpers/statusline.cjs${quote}`,
195
+ command: `sh -c 'exec node "${dir}/.claude/helpers/statusline.cjs"'`,
209
196
  };
210
197
  }
211
198
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.5.35",
3
+ "version": "3.5.37",
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",
@@ -148,7 +148,23 @@ export class ConfigLoader {
148
148
  break;
149
149
  }
150
150
  else {
151
- warnings.push(`Invalid config at ${configPath}: ${validation.errors?.map(e => e.message).join(', ')}`);
151
+ // Config file exists but doesn't match the strict schema.
152
+ // Merge whatever valid object fields exist with defaults and continue.
153
+ // This handles partial configs, legacy configs, and simple key-value files.
154
+ if (fileConfig && typeof fileConfig === 'object' && !Array.isArray(fileConfig)) {
155
+ const partial = fileConfig;
156
+ const merged = { ...defaultSystemConfig };
157
+ for (const key of Object.keys(partial)) {
158
+ if (partial[key] && typeof partial[key] === 'object' && !Array.isArray(partial[key])) {
159
+ merged[key] = { ...(merged[key] || {}), ...partial[key] };
160
+ }
161
+ }
162
+ config = merged;
163
+ source = 'file';
164
+ path = configPath;
165
+ }
166
+ // Always break on first found config file — don't search further
167
+ break;
152
168
  }
153
169
  }
154
170
  catch (error) {