@claude-flow/cli 3.1.0-alpha.31 → 3.1.0-alpha.33
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/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +10 -25
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +1 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +2 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +24 -1
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +67 -10
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +2 -0
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +1 -0
- package/dist/src/init/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAizI1E,eAAO,MAAM,YAAY,EAAE,OAyG1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -53,12 +53,9 @@ const preEditCommand = {
|
|
|
53
53
|
{ command: 'claude-flow hooks pre-edit -f src/api.ts -o refactor', description: 'Pre-edit with operation type' }
|
|
54
54
|
],
|
|
55
55
|
action: async (ctx) => {
|
|
56
|
-
|
|
56
|
+
// Default file to 'unknown' for backward compatibility (env var may be empty)
|
|
57
|
+
const filePath = ctx.args[0] || ctx.flags.file || 'unknown';
|
|
57
58
|
const operation = ctx.flags.operation || 'update';
|
|
58
|
-
if (!filePath) {
|
|
59
|
-
output.printError('File path is required. Use --file or -f flag.');
|
|
60
|
-
return { success: false, exitCode: 1 };
|
|
61
|
-
}
|
|
62
59
|
output.printInfo(`Analyzing context for: ${output.highlight(filePath)}`);
|
|
63
60
|
try {
|
|
64
61
|
// Call MCP tool for pre-edit hook
|
|
@@ -161,16 +158,10 @@ const postEditCommand = {
|
|
|
161
158
|
{ command: 'claude-flow hooks post-edit -f src/api.ts --success false -o "Type error"', description: 'Record failed edit' }
|
|
162
159
|
],
|
|
163
160
|
action: async (ctx) => {
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return { success: false, exitCode: 1 };
|
|
169
|
-
}
|
|
170
|
-
if (success === undefined) {
|
|
171
|
-
output.printError('Success flag is required. Use --success true/false.');
|
|
172
|
-
return { success: false, exitCode: 1 };
|
|
173
|
-
}
|
|
161
|
+
// Default file to 'unknown' for backward compatibility (env var may be empty)
|
|
162
|
+
const filePath = ctx.args[0] || ctx.flags.file || 'unknown';
|
|
163
|
+
// Default success to true for backward compatibility (PostToolUse = success, PostToolUseFailure = failure)
|
|
164
|
+
const success = ctx.flags.success !== undefined ? ctx.flags.success : true;
|
|
174
165
|
output.printInfo(`Recording outcome for: ${output.highlight(filePath)}`);
|
|
175
166
|
try {
|
|
176
167
|
// Parse metrics if provided
|
|
@@ -361,15 +352,12 @@ const postCommandCommand = {
|
|
|
361
352
|
],
|
|
362
353
|
action: async (ctx) => {
|
|
363
354
|
const command = ctx.args[0] || ctx.flags.command;
|
|
364
|
-
|
|
355
|
+
// Default success to true for backward compatibility
|
|
356
|
+
const success = ctx.flags.success !== undefined ? ctx.flags.success : true;
|
|
365
357
|
if (!command) {
|
|
366
358
|
output.printError('Command is required. Use --command or -c flag.');
|
|
367
359
|
return { success: false, exitCode: 1 };
|
|
368
360
|
}
|
|
369
|
-
if (success === undefined) {
|
|
370
|
-
output.printError('Success flag is required. Use --success true/false.');
|
|
371
|
-
return { success: false, exitCode: 1 };
|
|
372
|
-
}
|
|
373
361
|
output.printInfo(`Recording command outcome: ${output.highlight(command)}`);
|
|
374
362
|
try {
|
|
375
363
|
// Call MCP tool for post-command hook
|
|
@@ -1327,11 +1315,8 @@ const postTaskCommand = {
|
|
|
1327
1315
|
action: async (ctx) => {
|
|
1328
1316
|
// Auto-generate task ID if not provided
|
|
1329
1317
|
const taskId = ctx.flags.taskId || `task_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
output.printError('Success flag is required. Use --success true/false.');
|
|
1333
|
-
return { success: false, exitCode: 1 };
|
|
1334
|
-
}
|
|
1318
|
+
// Default success to true for backward compatibility
|
|
1319
|
+
const success = ctx.flags.success !== undefined ? ctx.flags.success : true;
|
|
1335
1320
|
output.printInfo(`Recording outcome for task: ${output.highlight(taskId)}`);
|
|
1336
1321
|
try {
|
|
1337
1322
|
const result = await callMCPTool('hooks_post-task', {
|