@sparkleideas/claude-flow-patch 3.1.0-alpha.44.patch.7 → 3.1.0-alpha.44.patch.9

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.md CHANGED
@@ -325,6 +325,7 @@ Both are idempotent: skip if `new` already present, warn if `old` not found.
325
325
  | `EXECUTOR` | `init/executor.js` | @claude-flow/cli |
326
326
  | `INIT_CMD` | `commands/init.js` | @claude-flow/cli |
327
327
  | `START_CMD` | `commands/start.js` | @claude-flow/cli |
328
+ | `CMDS_INDEX` | `commands/index.js` | @claude-flow/cli |
328
329
  | `ruvector_cli` | `bin/cli.js` | ruvector |
329
330
 
330
331
  To target a new file, add a variable to `lib/common.py` following the existing pattern.
package/lib/common.py CHANGED
@@ -84,6 +84,7 @@ EXECUTOR = init + "/executor.js" if init else ""
84
84
  TYPES = init + "/types.js" if init else ""
85
85
  INIT_CMD = commands + "/init.js" if commands else ""
86
86
  START_CMD = commands + "/start.js" if commands else ""
87
+ CMDS_INDEX = commands + "/index.js" if commands else ""
87
88
 
88
89
  # Source helpers (shipped with package, copied by writeHelpers when source dir found)
89
90
  _pkg_root = os.path.dirname(os.path.dirname(base)) if base else ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkleideas/claude-flow-patch",
3
- "version": "3.1.0-alpha.44.patch.7",
3
+ "version": "3.1.0-alpha.44.patch.9",
4
4
  "description": "Patch toolkit for @claude-flow/cli init/runtime defects with verify and post-init repair commands",
5
5
  "scripts": {
6
6
  "preflight": "node scripts/preflight.mjs",
@@ -9,12 +9,13 @@ The `wizardCommand.action` in `commands/init.js` was implemented as a
9
9
  standalone code path that diverges from the parent `initAction`. It skips the
10
10
  already-initialized guard, ignores `--force`, `--start-all`, `--start-daemon`,
11
11
  `--codex`, and `--dual` flags, and never shows "Next steps" hints. The wizard
12
- is conceptually "init with interactive value selection" but behaves as a
13
- completely separate command.
12
+ is also only reachable as a subcommand of `init` with no `options` array, so
13
+ the parser cannot validate flags for the wizard context.
14
14
 
15
15
  ## Fix
16
16
 
17
- Four ops bring the wizard to full parity with `init`:
17
+ Ten ops bring the wizard to full parity with `init` and promote it to a
18
+ top-level command (`claude-flow wizard`):
18
19
 
19
20
  | Op | What it does |
20
21
  |----|-------------|
@@ -22,11 +23,18 @@ Four ops bring the wizard to full parity with `init`:
22
23
  | SG-004b | Adds `--codex`/`--dual` handling after executeInit succeeds |
23
24
  | SG-004c | Adds `--start-all`/`--start-daemon` service startup + "Next steps" hints |
24
25
  | SG-004d | Fixes catch block — catches errors cleanly instead of re-throwing |
26
+ | SG-004e | Exports `wizardCommand` from init.js, adds `options` + `examples` arrays |
27
+ | SG-004f | Imports `wizardCommand` in the command registry (`commands/index.js`) |
28
+ | SG-004g | Adds wizard to `commandLoaders` for lazy-loading |
29
+ | SG-004h | Pre-populates wizard in the loaded commands cache |
30
+ | SG-004i | Adds `wizardCommand` to the `commands` array (parser registration) |
31
+ | SG-004j | Adds `wizardCommand` to `commandsByCategory.primary` for help display |
25
32
 
26
33
  ## Files Patched
27
34
 
28
35
  - `commands/init.js`
36
+ - `commands/index.js`
29
37
 
30
38
  ## Ops
31
39
 
32
- 4 ops in fix.py
40
+ 10 ops in fix.py
@@ -3,10 +3,14 @@
3
3
  #
4
4
  # The wizard was implemented as a standalone code path that ignores
5
5
  # --force, --start-all, --start-daemon, --codex, --dual, and skips
6
- # the already-initialized guard and "Next steps" hints.
6
+ # the already-initialized guard and "Next steps" hints. It is also only
7
+ # reachable as a subcommand of `init` with no options array, so the parser
8
+ # cannot validate flags for the wizard context.
7
9
  #
8
- # 4 ops: init-guard + force (a), codex/dual (b), start-all + next-steps (c),
9
- # catch-block error handling (d)
10
+ # 10 ops: init-guard + force (a), codex/dual (b), start-all + next-steps (c),
11
+ # catch-block error handling (d), export + options (e),
12
+ # import in registry (f), loaders (g), cache (h),
13
+ # commands array (i), category (j)
10
14
 
11
15
  # Op 1: Add already-initialized guard + pass --force to executeInit options
12
16
  patch("SG-004a: wizard init-guard + --force",
@@ -131,3 +135,74 @@ patch("SG-004d: wizard catch block handles errors cleanly",
131
135
  }
132
136
  output.printError(`Failed to initialize: ${error instanceof Error ? error.message : String(error)}`);
133
137
  return { success: false, exitCode: 1 };""")
138
+
139
+ # ── Promote wizard to top-level command ──
140
+ # Ops e–j: export wizardCommand with options, register in command registry
141
+
142
+ # Op 5: Export wizardCommand + add options/examples arrays
143
+ patch("SG-004e: export wizardCommand with options",
144
+ INIT_CMD,
145
+ """// Wizard subcommand for interactive setup
146
+ const wizardCommand = {
147
+ name: 'wizard',
148
+ description: 'Interactive setup wizard for comprehensive configuration',
149
+ action: async (ctx) => {""",
150
+ """// Wizard — top-level command + init subcommand — SG-004
151
+ export const wizardCommand = {
152
+ name: 'wizard',
153
+ aliases: ['wiz'],
154
+ description: 'Interactive setup wizard for comprehensive configuration',
155
+ options: [
156
+ { name: 'force', short: 'f', description: 'Overwrite existing configuration', type: 'boolean', default: false },
157
+ { name: 'start-all', description: 'Auto-start daemon, memory, and swarm after init', type: 'boolean', default: false },
158
+ { name: 'start-daemon', description: 'Auto-start daemon after init', type: 'boolean', default: false },
159
+ { name: 'codex', description: 'Initialize for OpenAI Codex CLI', type: 'boolean', default: false },
160
+ { name: 'dual', description: 'Initialize for both Claude Code and Codex', type: 'boolean', default: false },
161
+ { name: 'with-embeddings', description: 'Initialize ONNX embedding subsystem', type: 'boolean', default: false },
162
+ { name: 'embedding-model', description: 'ONNX embedding model', type: 'string', default: 'all-MiniLM-L6-v2', choices: ['all-MiniLM-L6-v2', 'all-mpnet-base-v2'] },
163
+ ],
164
+ examples: [
165
+ { command: 'claude-flow wizard', description: 'Run interactive setup wizard' },
166
+ { command: 'claude-flow wizard --start-all', description: 'Wizard then start all services' },
167
+ { command: 'claude-flow wizard --force', description: 'Reinitialize with wizard' },
168
+ { command: 'claude-flow wizard --codex', description: 'Wizard with Codex integration' },
169
+ ],
170
+ action: async (ctx) => {""")
171
+
172
+ # Op 6: Import wizardCommand in command registry
173
+ patch("SG-004f: import wizardCommand in command registry",
174
+ CMDS_INDEX,
175
+ """import { initCommand } from './init.js';""",
176
+ """import { initCommand, wizardCommand } from './init.js';""")
177
+
178
+ # Op 7: Add wizard to commandLoaders for lazy loading
179
+ patch("SG-004g: add wizard to commandLoaders",
180
+ CMDS_INDEX,
181
+ """ init: () => import('./init.js'),""",
182
+ """ init: () => import('./init.js'),
183
+ wizard: () => import('./init.js'),""")
184
+
185
+ # Op 8: Pre-populate wizard in loadedCommands cache
186
+ patch("SG-004h: cache wizard command",
187
+ CMDS_INDEX,
188
+ """loadedCommands.set('init', initCommand);""",
189
+ """loadedCommands.set('init', initCommand);
190
+ loadedCommands.set('wizard', wizardCommand);""")
191
+
192
+ # Op 9: Add wizardCommand to commands array (triggers parser registration)
193
+ patch("SG-004i: register wizard in commands array",
194
+ CMDS_INDEX,
195
+ """ initCommand,
196
+ startCommand,""",
197
+ """ initCommand,
198
+ wizardCommand,
199
+ startCommand,""")
200
+
201
+ # Op 10: Add wizardCommand to commandsByCategory.primary for help display
202
+ patch("SG-004j: add wizard to primary category",
203
+ CMDS_INDEX,
204
+ """ primary: [
205
+ initCommand,""",
206
+ """ primary: [
207
+ initCommand,
208
+ wizardCommand,""")
@@ -1 +1,3 @@
1
1
  grep "SG-004" commands/init.js
2
+ grep "export const wizardCommand" commands/init.js
3
+ grep "wizardCommand" commands/index.js
@@ -17,8 +17,11 @@ Add an `allCommand` subcommand to the `start` command so that
17
17
  `claude-flow start all` initializes memory, starts the daemon, then runs the
18
18
  normal `startAction` (swarm + MCP + health checks).
19
19
 
20
- Also adds the subcommand to the `subcommands` array and a corresponding
21
- example entry.
20
+ | Op | What it does |
21
+ |----|-------------|
22
+ | SG-005a | Adds `allCommand` subcommand definition before `quickCommand` |
23
+ | SG-005b | Registers `allCommand` in the `subcommands` array |
24
+ | SG-005c | Adds `start all` to the examples array for `--help` output |
22
25
 
23
26
  ## Files Patched
24
27
 
@@ -26,4 +29,4 @@ example entry.
26
29
 
27
30
  ## Ops
28
31
 
29
- 2 ops in fix.py
32
+ 3 ops in fix.py
@@ -44,7 +44,15 @@ const allCommand = {
44
44
  // Quick start subcommand
45
45
  const quickCommand = {""")
46
46
 
47
- patch("SG-005b: register allCommand in subcommands array and add example",
47
+ patch("SG-005b: register allCommand in subcommands array",
48
48
  START_CMD,
49
49
  """ subcommands: [stopCommand, restartCommand, quickCommand],""",
50
50
  """ subcommands: [stopCommand, restartCommand, quickCommand, allCommand],""")
51
+
52
+ patch("SG-005c: add 'start all' to examples array",
53
+ START_CMD,
54
+ """ { command: 'claude-flow start stop', description: 'Stop the running system' }
55
+ ],""",
56
+ """ { command: 'claude-flow start stop', description: 'Stop the running system' },
57
+ { command: 'claude-flow start all', description: 'Start memory, daemon, swarm, and MCP' }
58
+ ],""")