claude-flow 3.7.0-alpha.27 → 3.7.0-alpha.28
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/.claude/helpers/hook-handler.cjs +4 -1
- package/package.json +2 -2
- package/v3/@claude-flow/cli/dist/src/init/helpers-generator.js +6 -2
- package/v3/@claude-flow/cli/dist/src/init/settings-generator.js +33 -12
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +6 -3
- package/v3/@claude-flow/cli/package.json +1 -1
|
@@ -100,7 +100,10 @@ async function main() {
|
|
|
100
100
|
var toolInput = hookInput.toolInput || hookInput.tool_input || {};
|
|
101
101
|
var toolName = hookInput.toolName || hookInput.tool_name || '';
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
// `toolInput` is an object (e.g. {command:"ls"}) — falling back to it
|
|
104
|
+
// directly bound `prompt` to the object and tripped `.toLowerCase()` /
|
|
105
|
+
// `.substring()` on every Bash hook (#1944). Use the `.command` field.
|
|
106
|
+
var prompt = hookInput.prompt || hookInput.command || toolInput.command
|
|
104
107
|
|| process.env.PROMPT || process.env.TOOL_INPUT_command || '';
|
|
105
108
|
|
|
106
109
|
const handlers = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.7.0-alpha.
|
|
3
|
+
"version": "3.7.0-alpha.28",
|
|
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",
|
|
@@ -152,4 +152,4 @@
|
|
|
152
152
|
"access": "public",
|
|
153
153
|
"tag": "latest"
|
|
154
154
|
}
|
|
155
|
-
}
|
|
155
|
+
}
|
|
@@ -424,8 +424,12 @@ export function generateHookHandler() {
|
|
|
424
424
|
' if (stdinData.trim()) {',
|
|
425
425
|
' try { hookInput = JSON.parse(stdinData); } catch (e) { /* ignore */ }',
|
|
426
426
|
' }',
|
|
427
|
-
' // Prefer stdin fields, then env, then argv',
|
|
428
|
-
|
|
427
|
+
' // Prefer stdin fields, then env, then argv. `hookInput.toolInput` is an',
|
|
428
|
+
' // object (e.g. {command:"ls"}); falling back to it directly bound prompt',
|
|
429
|
+
' // to the object and tripped .toLowerCase() / .substring() on every Bash',
|
|
430
|
+
' // hook (#1944). Pull `.command` off whichever stdin shape Claude Code sent.',
|
|
431
|
+
' var toolInputObj = hookInput.toolInput || hookInput.tool_input || {};',
|
|
432
|
+
" var prompt = hookInput.prompt || hookInput.command || toolInputObj.command || process.env.PROMPT || process.env.TOOL_INPUT_command || args.join(' ') || '';",
|
|
429
433
|
'',
|
|
430
434
|
'const handlers = {',
|
|
431
435
|
" 'route': () => {",
|
|
@@ -154,21 +154,35 @@ export function generateSettings(options) {
|
|
|
154
154
|
*/
|
|
155
155
|
const IS_WINDOWS = process.platform === 'win32';
|
|
156
156
|
/**
|
|
157
|
-
* Build a hook command
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
157
|
+
* Build a hook command that resolves to the right helpers dir on every
|
|
158
|
+
* install layout. `ruflo init` can land helpers either project-locally
|
|
159
|
+
* (`<project>/.claude/helpers/…`, when run from a project root) or globally
|
|
160
|
+
* (`$HOME/.claude/helpers/…`, when settings.json gets merged into the
|
|
161
|
+
* user-level Claude Code config). The earlier `${CLAUDE_PROJECT_DIR:-.}`
|
|
162
|
+
* form assumed project-local — so any global-install user hit
|
|
163
|
+
* `MODULE_NOT_FOUND` on every Bash/Edit/Session hook (#1943).
|
|
164
|
+
*
|
|
165
|
+
* The fix is a tiny POSIX `sh` probe: try `$CLAUDE_PROJECT_DIR/.claude/...`
|
|
166
|
+
* first, fall back to `$HOME/.claude/...` if it's missing. Both modes work,
|
|
167
|
+
* the global install never crashes, and project-local overrides still take
|
|
168
|
+
* precedence when present. On Windows, the same probe via `cmd /c` (the %~%
|
|
169
|
+
* fallback uses `IF EXIST`).
|
|
162
170
|
*/
|
|
163
171
|
function hookCmd(script, subcommand) {
|
|
164
172
|
if (IS_WINDOWS) {
|
|
165
|
-
|
|
173
|
+
// cmd.exe equivalent of the sh probe below. `IF EXIST` checks the
|
|
174
|
+
// project-local path; falls back to %USERPROFILE% if missing.
|
|
175
|
+
return `cmd /c "IF EXIST \"%CLAUDE_PROJECT_DIR%\\${script.replace(/\//g, '\\')}\" (node \"%CLAUDE_PROJECT_DIR%\\${script.replace(/\//g, '\\')}\" ${subcommand}) ELSE (node \"%USERPROFILE%\\${script.replace(/\//g, '\\')}\" ${subcommand})"`;
|
|
166
176
|
}
|
|
167
|
-
//
|
|
168
|
-
//
|
|
177
|
+
// POSIX sh: prefer project-local helpers, fall back to $HOME/.claude/.
|
|
178
|
+
// The fallback handles `ruflo init`'s global-install path where helpers
|
|
179
|
+
// live at `$HOME/.claude/helpers/` but Claude Code still sets
|
|
180
|
+
// `CLAUDE_PROJECT_DIR` to the *project* root (which has no helpers).
|
|
169
181
|
// eslint-disable-next-line no-template-curly-in-string
|
|
170
|
-
const
|
|
171
|
-
|
|
182
|
+
const projVar = '${CLAUDE_PROJECT_DIR:-.}';
|
|
183
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
184
|
+
const homeVar = '${HOME}';
|
|
185
|
+
return `sh -c 'D="${projVar}"; [ -f "$D/${script}" ] || D="${homeVar}"; exec node "$D/${script}" ${subcommand}'`;
|
|
172
186
|
}
|
|
173
187
|
/** Shorthand for CJS hook-handler commands */
|
|
174
188
|
function hookHandlerCmd(subcommand) {
|
|
@@ -188,11 +202,18 @@ function generateStatusLineConfig(_options) {
|
|
|
188
202
|
// The script runs after each assistant message (debounced 300ms).
|
|
189
203
|
// NOTE: statusline must NOT use `cmd /c` — Claude Code manages its stdin
|
|
190
204
|
// directly for statusline commands, and `cmd /c` blocks stdin forwarding.
|
|
205
|
+
//
|
|
206
|
+
// Same project-local / $HOME fallback as `hookCmd()` (see #1943): the
|
|
207
|
+
// earlier `${CLAUDE_PROJECT_DIR:-.}` form broke statusline for any
|
|
208
|
+
// global-install user. Probe project-local first, fall back to $HOME.
|
|
209
|
+
const script = '.claude/helpers/statusline.cjs';
|
|
210
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
211
|
+
const projVar = '${CLAUDE_PROJECT_DIR:-.}';
|
|
191
212
|
// eslint-disable-next-line no-template-curly-in-string
|
|
192
|
-
const
|
|
213
|
+
const homeVar = '${HOME}';
|
|
193
214
|
return {
|
|
194
215
|
type: 'command',
|
|
195
|
-
command: `sh -c 'exec node "${
|
|
216
|
+
command: `sh -c 'D="${projVar}"; [ -f "$D/${script}" ] || D="${homeVar}"; exec node "$D/${script}"'`,
|
|
196
217
|
};
|
|
197
218
|
}
|
|
198
219
|
/**
|
|
@@ -866,10 +866,13 @@ INSERT OR REPLACE INTO metadata (key, value) VALUES
|
|
|
866
866
|
('temporal_decay', 'enabled'),
|
|
867
867
|
('hnsw_indexing', 'enabled');
|
|
868
868
|
|
|
869
|
-
-- Create default vector index configuration
|
|
869
|
+
-- Create default vector index configuration. Dimension matches the default
|
|
870
|
+
-- ONNX embedding model (Xenova/all-MiniLM-L6-v2, 384-dim); HNSW rejects
|
|
871
|
+
-- inserts whose dim does not match this row, so a 768 here breaks every
|
|
872
|
+
-- memory_store --vector and memory_search on a fresh install (#1947).
|
|
870
873
|
INSERT OR IGNORE INTO vector_indexes (id, name, dimensions) VALUES
|
|
871
|
-
('default', 'default',
|
|
872
|
-
('patterns', 'patterns',
|
|
874
|
+
('default', 'default', 384),
|
|
875
|
+
('patterns', 'patterns', 384);
|
|
873
876
|
`;
|
|
874
877
|
}
|
|
875
878
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.7.0-alpha.
|
|
3
|
+
"version": "3.7.0-alpha.28",
|
|
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",
|