claude-flow 2.5.0-alpha.139 → 2.5.0-alpha.141

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.
Files changed (42) hide show
  1. package/.claude/settings.json +3 -2
  2. package/README.md +50 -55
  3. package/bin/claude-flow +1 -1
  4. package/dist/src/cli/commands/hive-mind/pause.js +2 -9
  5. package/dist/src/cli/commands/hive-mind/pause.js.map +1 -1
  6. package/dist/src/cli/commands/index.js +1 -114
  7. package/dist/src/cli/commands/index.js.map +1 -1
  8. package/dist/src/cli/commands/swarm-spawn.js +5 -33
  9. package/dist/src/cli/commands/swarm-spawn.js.map +1 -1
  10. package/dist/src/cli/help-formatter.js.map +1 -1
  11. package/dist/src/cli/help-text.js +16 -2
  12. package/dist/src/cli/help-text.js.map +1 -1
  13. package/dist/src/cli/simple-commands/hooks.js +233 -0
  14. package/dist/src/cli/simple-commands/hooks.js.map +1 -1
  15. package/dist/src/cli/validation-helper.js.map +1 -1
  16. package/dist/src/core/version.js +1 -1
  17. package/dist/src/hooks/index.js +0 -3
  18. package/dist/src/hooks/index.js.map +1 -1
  19. package/dist/src/mcp/claude-flow-tools.js +205 -150
  20. package/dist/src/mcp/claude-flow-tools.js.map +1 -1
  21. package/dist/src/mcp/mcp-server.js +125 -0
  22. package/dist/src/mcp/mcp-server.js.map +1 -1
  23. package/dist/src/memory/swarm-memory.js +421 -340
  24. package/dist/src/memory/swarm-memory.js.map +1 -1
  25. package/dist/src/sdk/query-control.js +293 -139
  26. package/dist/src/sdk/query-control.js.map +1 -1
  27. package/dist/src/sdk/session-forking.js +206 -129
  28. package/dist/src/sdk/session-forking.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/cli/commands/hive-mind/pause.ts +2 -15
  31. package/src/cli/commands/index.ts +1 -84
  32. package/src/cli/commands/swarm-spawn.ts +3 -47
  33. package/src/cli/help-text.js +16 -2
  34. package/src/cli/simple-cli.ts +0 -1
  35. package/src/cli/simple-commands/hooks.js +310 -0
  36. package/src/hooks/index.ts +0 -5
  37. package/src/mcp/claude-flow-tools.ts +203 -120
  38. package/src/mcp/mcp-server.js +86 -0
  39. package/src/sdk/query-control.ts +377 -223
  40. package/src/sdk/session-forking.ts +312 -207
  41. package/.claude/commands/coordination/README.md +0 -9
  42. package/.claude/commands/memory/README.md +0 -9
@@ -41,7 +41,7 @@
41
41
  "hooks": [
42
42
  {
43
43
  "type": "command",
44
- "command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"
44
+ "command": "cat | npx claude-flow@alpha hooks modify-bash"
45
45
  }
46
46
  ]
47
47
  },
@@ -50,7 +50,7 @@
50
50
  "hooks": [
51
51
  {
52
52
  "type": "command",
53
- "command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"
53
+ "command": "cat | npx claude-flow@alpha hooks modify-file"
54
54
  }
55
55
  ]
56
56
  }
@@ -109,6 +109,7 @@
109
109
  "includeCoAuthoredBy": true,
110
110
  "enabledMcpjsonServers": ["claude-flow", "ruv-swarm"],
111
111
  "statusLine": {
112
+ "type": "command",
112
113
  "command": "~/.claude/statusline-command.sh"
113
114
  }
114
115
  }
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # 🌊 Claude-Flow v2.5.0 Alpha 130: AI Orchestration Platform
1
+ # 🌊 Claude-Flow v2.5.0 Alpha 140: AI Orchestration Platform
2
2
 
3
3
  <div align="center">
4
4
 
5
5
  [![🌟 Star on GitHub](https://img.shields.io/github/stars/ruvnet/claude-flow?style=for-the-badge&logo=github&color=gold)](https://github.com/ruvnet/claude-flow)
6
6
  [![📈 Downloads](https://img.shields.io/npm/dt/claude-flow?style=for-the-badge&logo=npm&color=blue&label=Downloads)](https://www.npmjs.com/package/claude-flow)
7
- [![📦 Latest Release](https://img.shields.io/npm/v/claude-flow?style=for-the-badge&logo=npm&color=green&label=v2.5.0-alpha.130)](https://www.npmjs.com/package/claude-flow)
7
+ [![📦 Latest Release](https://img.shields.io/npm/v/claude-flow?style=for-the-badge&logo=npm&color=green&label=v2.5.0-alpha.140)](https://www.npmjs.com/package/claude-flow)
8
8
  [![⚡ Claude Code](https://img.shields.io/badge/Claude%20Code-SDK%20Integrated-green?style=for-the-badge&logo=anthropic)](https://github.com/ruvnet/claude-flow)
9
9
  [![🏛️ Agentics Foundation](https://img.shields.io/badge/Agentics-Foundation-crimson?style=for-the-badge&logo=openai)](https://discord.com/invite/dfxmpwkG2D)
10
10
  [![🐝 Hive-Mind](https://img.shields.io/badge/Hive--Mind-AI%20Coordination-purple?style=for-the-badge&logo=swarm)](https://github.com/ruvnet/claude-flow)
@@ -13,57 +13,6 @@
13
13
 
14
14
  </div>
15
15
 
16
- ---
17
-
18
- ## 🎉 What's New in v2.5.0-alpha.130
19
-
20
- **🚀 Claude Code SDK Integration** - Major performance breakthrough with 100-600x potential speedup!
21
-
22
- ### ✨ New Features
23
-
24
- **Session Forking & Real-Time Control** 🔥
25
- - ⚡ **10-20x faster** parallel agent spawning using Claude Code SDK's session forking
26
- - 🎮 Real-time query control: pause, resume, terminate agents mid-execution
27
- - 🔄 Dynamic model and permission changes during runtime
28
- - 📊 26 new methods for advanced agent orchestration
29
-
30
- **Hook Matchers & 4-Level Permissions** 🎯
31
- - 🎨 **2-3x faster** hook execution with pattern-based selective triggering
32
- - 🔐 Hierarchical permission system: USER → PROJECT → LOCAL → SESSION
33
- - 🔍 Glob and regex pattern matching for file-based hooks
34
- - ⚡ Intelligent caching for near-instant permission resolution
35
-
36
- **In-Process MCP Server** 🚄
37
- - 🏎️ **50-100x faster** tool calls by eliminating IPC overhead
38
- - 📦 Direct in-process execution for all 50+ Claude-Flow tools
39
- - 💾 10MB memory savings per MCP server (no extra processes)
40
- - 🔌 Automatic routing: in-process for local tools, stdio/SSE for external
41
-
42
-
43
-
44
- ### 📊 Performance Impact
45
-
46
- | Feature | Speedup | Impact |
47
- |---------|---------|--------|
48
- | Session Forking | 10-20x | Parallel agent spawning |
49
- | Hook Matchers | 2-3x | Selective hook execution |
50
- | In-Process MCP | 50-100x | Tool call latency |
51
- | **Combined** | **100-600x** | Full workflow orchestration |
52
-
53
- **Real-World Example**: Spawning 10 agents now takes ~750ms instead of ~7,500ms! 🚀
54
-
55
- ### 🔧 SDK Integration Benefits
56
-
57
- - ✅ Native Claude Code SDK features instead of custom implementations
58
- - ✅ Automatic retry handling and error management
59
- - ✅ Optimized streaming and artifact durability
60
- - ✅ Context checkpoints and session management
61
- - ✅ Reduced codebase by 200+ lines of redundant retry logic
62
-
63
- **See Full Details**: [GitHub Issue #780](https://github.com/ruvnet/claude-flow/issues/780)
64
-
65
- ---
66
-
67
16
  ## 🌟 **Overview**
68
17
 
69
18
  **Claude-Flow v2 Alpha** is an enterprise-grade AI orchestration platform that reimagines how developers build with AI. By combining **hive-mind swarm intelligence**, **neural pattern recognition**, and **87 advanced MCP tools**, Claude-Flow enables unprecedented AI-powered development workflows.
@@ -78,9 +27,41 @@
78
27
  - **🪝 Advanced Hooks System**: Automated workflows with pre/post operation hooks
79
28
  - **📊 GitHub Integration**: 6 specialized modes for repository management
80
29
  - **🌐 Flow Nexus Cloud Platform**: E2B sandboxes, AI swarms, challenges, and marketplace integration
30
+ - **🎯 PreToolUse Modification Hooks**: NEW - Claude Code v2.0.10+ intelligent input modification (safety, organization, optimization)
81
31
 
82
32
  > 🔥 **Revolutionary AI Coordination**: Build faster, smarter, and more efficiently with AI-powered development orchestration
83
33
 
34
+ ## 🎯 **NEW: PreToolUse Modification Hooks Plugin** (v2.5.0-alpha.140)
35
+
36
+ **First Claude Code plugin with intelligent tool input modification** - automatically enhances commands and files before execution.
37
+
38
+ **Key Features:**
39
+ - 🛡️ **Safety**: Auto-adds `-i` to `rm` commands, detects sensitive keywords
40
+ - 📁 **Organization**: Auto-routes files (tests→`/tests/`, src→`/src/`)
41
+ - ⚡ **Productivity**: Alias expansion (`ll`→`ls -lah`), conventional commits
42
+
43
+ **Quick Start:**
44
+
45
+ **Option 1: Direct Plugin Installation** (Recommended)
46
+ ```bash
47
+ # In Claude Code, run:
48
+ /plugin ruvnet/claude-flow
49
+ ```
50
+
51
+ **Option 2: Via NPM**
52
+ ```bash
53
+ npx claude-flow@alpha init --force # Auto-configures .claude-plugin/hooks/hooks.json
54
+ ```
55
+
56
+ **Examples:**
57
+ ```bash
58
+ rm test.txt → rm -i test.txt # Safety
59
+ test.js → src/test.js # Organization
60
+ git commit -m "fix" → [fix] fix + co-author # Commits
61
+ ```
62
+
63
+ > 📚 **Docs**: [HOOKS-V2-MODIFICATION.md](./docs/HOOKS-V2-MODIFICATION.md) | **Plugin**: `.claude-plugin/` | **Composable** with `agent-booster`
64
+
84
65
  ## 🌐 **Flow Nexus Cloud Platform**
85
66
 
86
67
  **NEW**: Claude-Flow v2.0.0 now includes **Flow Nexus integration** - a cloud-powered AI development platform featuring:
@@ -116,11 +97,18 @@ claude --dangerously-skip-permissions
116
97
 
117
98
  ### 🎯 **Instant Alpha Testing**
118
99
 
100
+ **Method 1: Plugin Installation** (Easiest - includes PreToolUse hooks!)
101
+ ```bash
102
+ # In Claude Code:
103
+ /plugin ruvnet/claude-flow
104
+ ```
105
+
106
+ **Method 2: NPM Installation** (For MCP server + CLI)
119
107
  ```bash
120
108
  # 1. Initialize Claude Flow with enhanced MCP setup (auto-configures permissions!)
121
109
  npx claude-flow@alpha init --force
122
110
 
123
- # 2. Explore all revolutionary capabilities
111
+ # 2. Explore all revolutionary capabilities
124
112
  npx claude-flow@alpha --help
125
113
 
126
114
  # 3a. Quick AI coordination (recommended for most tasks)
@@ -347,6 +335,13 @@ For detailed information about all features, advanced usage, and comprehensive g
347
335
 
348
336
  ---
349
337
 
338
+ ### 📊 Targets (Month 12)
339
+ - 5K+ GitHub stars, 50K npm downloads/month
340
+ - $25K MRR, 15 enterprise customers
341
+ - 90%+ error prevention, 30+ min saved/dev/week
342
+
343
+ ---
344
+
350
345
  ## Star History
351
346
 
352
347
  <a href="https://www.star-history.com/#ruvnet/claude-flow&Date">
@@ -361,6 +356,6 @@ For detailed information about all features, advanced usage, and comprehensive g
361
356
 
362
357
  **Built with ❤️ by [rUv](https://github.com/ruvnet) | Powered by Revolutionary AI**
363
358
 
364
- *v2.0.0 Alpha - The Future of AI Orchestration*
359
+ *v2.5.0-alpha.140 - The Future of AI Orchestration with PreToolUse Modification Hooks*
365
360
 
366
361
  </div>
package/bin/claude-flow CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
  # Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
3
3
 
4
- VERSION="2.5.0-alpha.139"
4
+ VERSION="2.5.0-alpha.141"
5
5
 
6
6
  # Determine the correct path based on how the script is invoked
7
7
  if [ -L "$0" ]; then
@@ -3,7 +3,6 @@ import { Command } from '../commander-fix.js';
3
3
  import chalk from 'chalk';
4
4
  import { HiveMindSessionManager } from '../../simple-commands/hive-mind/session-manager.js';
5
5
  import inquirer from 'inquirer';
6
- import { queryController } from '../../../sdk/query-control.js';
7
6
  export const pauseCommand = new Command('pause').description('Pause active hive mind sessions').option('-s, --session <id>', 'Pause specific session by ID').action(async (options)=>{
8
7
  const sessionManager = new HiveMindSessionManager();
9
8
  try {
@@ -23,13 +22,10 @@ export const pauseCommand = new Command('pause').description('Pause active hive
23
22
  return;
24
23
  }
25
24
  console.log(chalk.cyan(`Pausing session ${sessionId}...`));
26
- queryController.requestPause(sessionId);
27
- console.log(chalk.blue(' • SDK pause requested'));
28
25
  const result = await sessionManager.pauseSession(sessionId);
29
26
  if (result) {
30
27
  console.log(chalk.green(`✓ Session ${sessionId} paused successfully`));
31
- console.log(chalk.gray(` Pause state saved to disk (can resume across restarts)`));
32
- console.log(chalk.gray(` Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));
28
+ console.log(chalk.gray(`Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));
33
29
  } else {
34
30
  console.log(chalk.red(`Failed to pause session ${sessionId}`));
35
31
  }
@@ -52,13 +48,10 @@ export const pauseCommand = new Command('pause').description('Pause active hive
52
48
  }
53
49
  ]);
54
50
  console.log(chalk.cyan(`Pausing session ${sessionId}...`));
55
- queryController.requestPause(sessionId);
56
- console.log(chalk.blue(' • SDK pause requested'));
57
51
  const result = await sessionManager.pauseSession(sessionId);
58
52
  if (result) {
59
53
  console.log(chalk.green(`✓ Session paused successfully`));
60
- console.log(chalk.gray(` Pause state saved to disk (can resume across restarts)`));
61
- console.log(chalk.gray(` Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));
54
+ console.log(chalk.gray(`Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));
62
55
  } else {
63
56
  console.log(chalk.red(`Failed to pause session`));
64
57
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/cli/commands/hive-mind/pause.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Hive Mind Pause Command\n *\n * Pause active swarm sessions\n */\n\nimport { Command } from '../commander-fix.js';\nimport chalk from 'chalk';\nimport { HiveMindSessionManager } from '../../simple-commands/hive-mind/session-manager.js';\nimport inquirer from 'inquirer';\nimport { queryController } from '../../../sdk/query-control.js';\n\nexport const pauseCommand = new Command('pause')\n .description('Pause active hive mind sessions')\n .option('-s, --session <id>', 'Pause specific session by ID')\n .action(async (options) => {\n const sessionManager = new HiveMindSessionManager();\n\n try {\n if (options.session) {\n // Pause specific session\n const sessionId = options.session;\n const session = await sessionManager.getSession(sessionId);\n\n if (!session) {\n console.log(chalk.red(`Session ${sessionId} not found`));\n return;\n }\n\n if ((session as any).status === 'paused') {\n console.log(chalk.yellow(`Session ${sessionId} is already paused`));\n return;\n }\n\n if ((session as any).status !== 'active') {\n console.log(\n chalk.yellow(`Session ${sessionId} is not active (status: ${(session as any).status})`),\n );\n return;\n }\n\n console.log(chalk.cyan(`Pausing session ${sessionId}...`));\n\n // Use SDK query controller for REAL pause\n queryController.requestPause(sessionId);\n console.log(chalk.blue(' • SDK pause requested'));\n\n const result = await sessionManager.pauseSession(sessionId);\n\n if (result) {\n console.log(chalk.green(`✓ Session ${sessionId} paused successfully`));\n console.log(chalk.gray(` Pause state saved to disk (can resume across restarts)`));\n console.log(chalk.gray(` Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));\n } else {\n console.log(chalk.red(`Failed to pause session ${sessionId}`));\n }\n } else {\n // Interactive selection\n const sessions = await sessionManager.getActiveSessions();\n const activeSessions = sessions.filter((s: any) => s.status === 'active');\n\n if (activeSessions.length === 0) {\n console.log(chalk.yellow('No active sessions found to pause'));\n return;\n }\n\n const { sessionId } = await inquirer.prompt([\n {\n type: 'list',\n name: 'sessionId',\n message: 'Select session to pause:',\n choices: activeSessions.map((s: any) => ({\n name: `${s.swarm_name} (${s.id}) - ${s.completion_percentage}% complete`,\n value: s.id,\n })),\n },\n ]);\n\n console.log(chalk.cyan(`Pausing session ${sessionId}...`));\n\n // Use SDK query controller for REAL pause\n queryController.requestPause(sessionId);\n console.log(chalk.blue(' • SDK pause requested'));\n\n const result = await sessionManager.pauseSession(sessionId);\n\n if (result) {\n console.log(chalk.green(`✓ Session paused successfully`));\n console.log(chalk.gray(` Pause state saved to disk (can resume across restarts)`));\n console.log(chalk.gray(` Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));\n } else {\n console.log(chalk.red(`Failed to pause session`));\n }\n }\n } catch (error) {\n console.error(chalk.red('Error pausing session:'), (error as Error).message);\n process.exit(1);\n } finally {\n sessionManager.close();\n }\n });\n"],"names":["Command","chalk","HiveMindSessionManager","inquirer","queryController","pauseCommand","description","option","action","options","sessionManager","session","sessionId","getSession","console","log","red","status","yellow","cyan","requestPause","blue","result","pauseSession","green","gray","sessions","getActiveSessions","activeSessions","filter","s","length","prompt","type","name","message","choices","map","swarm_name","id","completion_percentage","value","error","process","exit","close"],"mappings":";AAOA,SAASA,OAAO,QAAQ,sBAAsB;AAC9C,OAA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,CAACd,MAAMe,GAAG,CAAC,CAAC,uBAAuB,CAAC;YACjD;QACF;IACF,EAAE,OAAO0B,OAAO;QACd5B,QAAQ4B,KAAK,CAACzC,MAAMe,GAAG,CAAC,2BAA2B,AAAC0B,MAAgBP,OAAO;QAC3EQ,QAAQC,IAAI,CAAC;IACf,SAAU;QACRlC,eAAemC,KAAK;IACtB;AACF,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/cli/commands/hive-mind/pause.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Hive Mind Pause Command\n *\n * Pause active swarm sessions\n */\n\nimport { Command } from '../commander-fix.js';\nimport chalk from 'chalk';\nimport { HiveMindSessionManager } from '../../simple-commands/hive-mind/session-manager.js';\nimport inquirer from 'inquirer';\n\nexport const pauseCommand = new Command('pause')\n .description('Pause active hive mind sessions')\n .option('-s, --session <id>', 'Pause specific session by ID')\n .action(async (options) => {\n const sessionManager = new HiveMindSessionManager();\n\n try {\n if (options.session) {\n // Pause specific session\n const sessionId = options.session;\n const session = await sessionManager.getSession(sessionId);\n\n if (!session) {\n console.log(chalk.red(`Session ${sessionId} not found`));\n return;\n }\n\n if ((session as any).status === 'paused') {\n console.log(chalk.yellow(`Session ${sessionId} is already paused`));\n return;\n }\n\n if ((session as any).status !== 'active') {\n console.log(\n chalk.yellow(`Session ${sessionId} is not active (status: ${(session as any).status})`),\n );\n return;\n }\n\n console.log(chalk.cyan(`Pausing session ${sessionId}...`));\n const result = await sessionManager.pauseSession(sessionId);\n\n if (result) {\n console.log(chalk.green(`✓ Session ${sessionId} paused successfully`));\n console.log(chalk.gray(`Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));\n } else {\n console.log(chalk.red(`Failed to pause session ${sessionId}`));\n }\n } else {\n // Interactive selection\n const sessions = await sessionManager.getActiveSessions();\n const activeSessions = sessions.filter((s: any) => s.status === 'active');\n\n if (activeSessions.length === 0) {\n console.log(chalk.yellow('No active sessions found to pause'));\n return;\n }\n\n const { sessionId } = await inquirer.prompt([\n {\n type: 'list',\n name: 'sessionId',\n message: 'Select session to pause:',\n choices: activeSessions.map((s: any) => ({\n name: `${s.swarm_name} (${s.id}) - ${s.completion_percentage}% complete`,\n value: s.id,\n })),\n },\n ]);\n\n console.log(chalk.cyan(`Pausing session ${sessionId}...`));\n const result = await sessionManager.pauseSession(sessionId);\n\n if (result) {\n console.log(chalk.green(`✓ Session paused successfully`));\n console.log(chalk.gray(`Use 'claude-flow hive-mind resume -s ${sessionId}' to resume`));\n } else {\n console.log(chalk.red(`Failed to pause session`));\n }\n }\n } catch (error) {\n console.error(chalk.red('Error pausing session:'), (error as Error).message);\n process.exit(1);\n } finally {\n sessionManager.close();\n }\n });\n"],"names":["Command","chalk","HiveMindSessionManager","inquirer","pauseCommand","description","option","action","options","sessionManager","session","sessionId","getSession","console","log","red","status","yellow","cyan","result","pauseSession","green","gray","sessions","getActiveSessions","activeSessions","filter","s","length","prompt","type","name","message","choices","map","swarm_name","id","completion_percentage","value","error","process","exit","close"],"mappings":";AAOA,SAASA,OAAO,QAAQ,sBAAsB;AAC9C,OAAOC,WAAW,QAAQ;AAC1B,SAASC,sBAAsB,QAAQ,qDAAqD;AAC5F,OAAOC,cAAc,WAAW;AAEhC,OAAO,MAAMC,eAAe,IAAIJ,QAAQ,SACrCK,WAAW,CAAC,mCACZC,MAAM,CAAC,sBAAsB,gCAC7BC,MAAM,CAAC,OAAOC;IACb,MAAMC,iBAAiB,IAAIP;IAE3B,IAAI;QACF,IAAIM,QAAQE,OAAO,EAAE;YAEnB,MAAMC,YAAYH,QAAQE,OAAO;YACjC,MAAMA,UAAU,MAAMD,eAAeG,UAAU,CAACD;YAEhD,IAAI,CAACD,SAAS;gBACZG,QAAQC,GAAG,CAACb,MAAMc,GAAG,CAAC,CAAC,QAAQ,EAAEJ,UAAU,UAAU,CAAC;gBACtD;YACF;YAEA,IAAI,AAACD,QAAgBM,MAAM,KAAK,UAAU;gBACxCH,QAAQC,GAAG,CAACb,MAAMgB,MAAM,C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vB,QAAQC,GAAG,CAACb,MAAMiB,IAAI,CAAC,CAAC,gBAAgB,EAAEP,UAAU,GAAG,CAAC;YACxD,MAAMQ,SAAS,MAAMV,eAAeW,YAAY,CAACT;YAEjD,IAAIQ,QAAQ;gBACVN,QAAQC,GAAG,CAACb,MAAMoB,KAAK,CAAC,CAAC,6BAA6B,CAAC;gBACvDR,QAAQC,GAAG,CAACb,MAAMqB,IAAI,CAAC,CAAC,qCAAqC,EAAEX,UAAU,WAAW,CAAC;YACvF,OAAO;gBACLE,QAAQC,GAAG,CAACb,MAAMc,GAAG,CAAC,CAAC,uBAAuB,CAAC;YACjD;QACF;IACF,EAAE,OAAOwB,OAAO;QACd1B,QAAQ0B,KAAK,CAACtC,MAAMc,GAAG,CAAC,2BAA2B,AAACwB,MAAgBP,OAAO;QAC3EQ,QAAQC,IAAI,CAAC;IACf,SAAU;QACRhC,eAAeiC,KAAK;IACtB;AACF,GAAG"}
@@ -1945,33 +1945,7 @@ Now, please proceed with the task: ${task}`;
1945
1945
  description: 'Show help information',
1946
1946
  action: (ctx)=>{
1947
1947
  const command = ctx.args[0];
1948
- if (command === 'checkpoint') {
1949
- console.log(bold(blue('Checkpoint Management (SDK Integration)')));
1950
- console.log();
1951
- console.log('Manage session checkpoints with Git-like time travel for AI sessions.');
1952
- console.log();
1953
- console.log(bold('Subcommands:'));
1954
- console.log(" create <session-id> [description] Create checkpoint for session");
1955
- console.log(' list <session-id> List checkpoints for session');
1956
- console.log(' info <checkpoint-id> Get checkpoint details');
1957
- console.log(' rollback <checkpoint-id> Rollback to checkpoint');
1958
- console.log(' delete <checkpoint-id> Delete checkpoint');
1959
- console.log();
1960
- console.log(bold('Examples:'));
1961
- console.log(` ${blue('claude-flow checkpoint create')} my-session "Before deployment"`);
1962
- console.log(` ${blue('claude-flow checkpoint list')} my-session`);
1963
- console.log(` ${blue('claude-flow checkpoint rollback')} cp-abc123`);
1964
- console.log();
1965
- console.log(bold('MCP Tools (Available through claude-flow MCP server):'));
1966
- console.log(' checkpoint/create Create checkpoint via MCP');
1967
- console.log(' checkpoint/list List checkpoints via MCP');
1968
- console.log(' checkpoint/rollback Rollback via MCP');
1969
- console.log(' session/fork Fork session for parallel exploration');
1970
- console.log(' session/info Get session info');
1971
- console.log(' query/pause Pause query with SDK');
1972
- console.log(' query/resume Resume paused query');
1973
- console.log();
1974
- } else if (command === 'claude') {
1948
+ if (command === 'claude') {
1975
1949
  console.log(bold(blue('Claude Instance Management')));
1976
1950
  console.log();
1977
1951
  console.log('Spawn and manage Claude Code instances with specific configurations.');
@@ -2330,93 +2304,6 @@ Now, please proceed with the task: ${task}`;
2330
2304
  }
2331
2305
  }
2332
2306
  });
2333
- cli.command({
2334
- name: 'checkpoint',
2335
- description: 'Manage session checkpoints (Git-like time travel for AI sessions)',
2336
- subcommands: [
2337
- {
2338
- name: 'create',
2339
- description: 'Create a checkpoint for a session',
2340
- action: async (ctx)=>{
2341
- const { checkpointCommand } = await import('./checkpoint.js');
2342
- await checkpointCommand.parseAsync([
2343
- 'node',
2344
- 'checkpoint',
2345
- 'create',
2346
- ...ctx.args
2347
- ], {
2348
- from: 'user'
2349
- });
2350
- }
2351
- },
2352
- {
2353
- name: 'list',
2354
- description: 'List checkpoints for a session',
2355
- action: async (ctx)=>{
2356
- const { checkpointCommand } = await import('./checkpoint.js');
2357
- await checkpointCommand.parseAsync([
2358
- 'node',
2359
- 'checkpoint',
2360
- 'list',
2361
- ...ctx.args
2362
- ], {
2363
- from: 'user'
2364
- });
2365
- }
2366
- },
2367
- {
2368
- name: 'info',
2369
- description: 'Get checkpoint information',
2370
- action: async (ctx)=>{
2371
- const { checkpointCommand } = await import('./checkpoint.js');
2372
- await checkpointCommand.parseAsync([
2373
- 'node',
2374
- 'checkpoint',
2375
- 'info',
2376
- ...ctx.args
2377
- ], {
2378
- from: 'user'
2379
- });
2380
- }
2381
- },
2382
- {
2383
- name: 'rollback',
2384
- description: 'Rollback session to a checkpoint',
2385
- action: async (ctx)=>{
2386
- const { checkpointCommand } = await import('./checkpoint.js');
2387
- await checkpointCommand.parseAsync([
2388
- 'node',
2389
- 'checkpoint',
2390
- 'rollback',
2391
- ...ctx.args
2392
- ], {
2393
- from: 'user'
2394
- });
2395
- }
2396
- },
2397
- {
2398
- name: 'delete',
2399
- description: 'Delete a checkpoint',
2400
- action: async (ctx)=>{
2401
- const { checkpointCommand } = await import('./checkpoint.js');
2402
- await checkpointCommand.parseAsync([
2403
- 'node',
2404
- 'checkpoint',
2405
- 'delete',
2406
- ...ctx.args
2407
- ], {
2408
- from: 'user'
2409
- });
2410
- }
2411
- }
2412
- ],
2413
- action: async (ctx)=>{
2414
- if (ctx.args.length === 0) {
2415
- const { checkpointCommand } = await import('./checkpoint.js');
2416
- checkpointCommand.help();
2417
- }
2418
- }
2419
- });
2420
2307
  for (const command of enterpriseCommands){
2421
2308
  cli.command(command);
2422
2309
  }