@wundr.io/cli 1.0.11 → 1.0.13
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/bin/wundr.js +8 -4
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/claude-client.js.map +1 -1
- package/dist/ai/conversation-manager.js.map +1 -1
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +179 -24
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/analyze-optimized.d.ts.map +1 -1
- package/dist/commands/analyze-optimized.js +15 -6
- package/dist/commands/analyze-optimized.js.map +1 -1
- package/dist/commands/batch.d.ts +22 -0
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +130 -14
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/chat.d.ts +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +7 -3
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claude-init.d.ts +1 -1
- package/dist/commands/claude-init.d.ts.map +1 -1
- package/dist/commands/claude-init.js +16 -16
- package/dist/commands/claude-init.js.map +1 -1
- package/dist/commands/claude-setup.d.ts +5 -5
- package/dist/commands/claude-setup.d.ts.map +1 -1
- package/dist/commands/claude-setup.js +65 -59
- package/dist/commands/claude-setup.js.map +1 -1
- package/dist/commands/computer-setup.d.ts +1 -0
- package/dist/commands/computer-setup.d.ts.map +1 -1
- package/dist/commands/computer-setup.js +35 -7
- package/dist/commands/computer-setup.js.map +1 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/govern.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/orchestrator.js +11 -4
- package/dist/commands/orchestrator.js.map +1 -1
- package/dist/commands/performance-optimizer.d.ts.map +1 -1
- package/dist/commands/performance-optimizer.js.map +1 -1
- package/dist/commands/rag.d.ts.map +1 -1
- package/dist/commands/rag.js +9 -6
- package/dist/commands/rag.js.map +1 -1
- package/dist/commands/setup.d.ts +5 -10
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +35 -260
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js.map +1 -1
- package/dist/context/session-manager.js.map +1 -1
- package/dist/framework/command-interface.d.ts +349 -0
- package/dist/framework/command-interface.d.ts.map +1 -0
- package/dist/framework/command-interface.js +101 -0
- package/dist/framework/command-interface.js.map +1 -0
- package/dist/framework/command-registry.d.ts +173 -0
- package/dist/framework/command-registry.d.ts.map +1 -0
- package/dist/framework/command-registry.js +734 -0
- package/dist/framework/command-registry.js.map +1 -0
- package/dist/framework/completion-exporter.d.ts +79 -0
- package/dist/framework/completion-exporter.d.ts.map +1 -0
- package/dist/framework/completion-exporter.js +259 -0
- package/dist/framework/completion-exporter.js.map +1 -0
- package/dist/framework/debug-logger.d.ts +163 -0
- package/dist/framework/debug-logger.d.ts.map +1 -0
- package/dist/framework/debug-logger.js +373 -0
- package/dist/framework/debug-logger.js.map +1 -0
- package/dist/framework/error-handler.d.ts +196 -0
- package/dist/framework/error-handler.d.ts.map +1 -0
- package/dist/framework/error-handler.js +613 -0
- package/dist/framework/error-handler.js.map +1 -0
- package/dist/framework/help-generator.d.ts +78 -0
- package/dist/framework/help-generator.d.ts.map +1 -0
- package/dist/framework/help-generator.js +414 -0
- package/dist/framework/help-generator.js.map +1 -0
- package/dist/framework/index.d.ts +62 -0
- package/dist/framework/index.d.ts.map +1 -0
- package/dist/framework/index.js +95 -0
- package/dist/framework/index.js.map +1 -0
- package/dist/framework/interactive-repl.d.ts +138 -0
- package/dist/framework/interactive-repl.d.ts.map +1 -0
- package/dist/framework/interactive-repl.js +567 -0
- package/dist/framework/interactive-repl.js.map +1 -0
- package/dist/framework/output-formatter.d.ts +274 -0
- package/dist/framework/output-formatter.d.ts.map +1 -0
- package/dist/framework/output-formatter.js +545 -0
- package/dist/framework/output-formatter.js.map +1 -0
- package/dist/framework/progress-manager.d.ts +192 -0
- package/dist/framework/progress-manager.d.ts.map +1 -0
- package/dist/framework/progress-manager.js +408 -0
- package/dist/framework/progress-manager.js.map +1 -0
- package/dist/interactive/interactive-mode.js.map +1 -1
- package/dist/nlp/command-mapper.js.map +1 -1
- package/dist/nlp/command-parser.js.map +1 -1
- package/dist/nlp/intent-parser.d.ts.map +1 -1
- package/dist/nlp/intent-parser.js +4 -2
- package/dist/nlp/intent-parser.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +2 -1
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +30 -19
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/utils/backup-rollback-manager.d.ts.map +1 -1
- package/dist/utils/backup-rollback-manager.js +1 -2
- package/dist/utils/backup-rollback-manager.js.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +6 -6
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Registry - Auto-discovery, registration, and Commander.js integration.
|
|
3
|
+
*
|
|
4
|
+
* The registry is the central hub that:
|
|
5
|
+
* 1. Discovers CommandDefinition files from the commands/ directory
|
|
6
|
+
* 2. Validates definitions at registration time
|
|
7
|
+
* 3. Builds a Commander.js program from registered definitions
|
|
8
|
+
* 4. Provides lookup for shell completion generation
|
|
9
|
+
* 5. Supports legacy command wrapping for incremental migration
|
|
10
|
+
*
|
|
11
|
+
* @module framework/command-registry
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
import type { CommandDefinition, CommandModule, CommandHook, CommandCategory, CommandContext, GlobalOptions } from './command-interface';
|
|
15
|
+
/**
|
|
16
|
+
* Options for the command registry.
|
|
17
|
+
*/
|
|
18
|
+
export interface RegistryOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Whether to enable strict mode.
|
|
21
|
+
* In strict mode, duplicate command names cause an error.
|
|
22
|
+
* In non-strict mode, the later registration wins with a warning.
|
|
23
|
+
*/
|
|
24
|
+
strict?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Base directory for auto-discovery.
|
|
27
|
+
* Defaults to the `commands/` directory relative to the framework.
|
|
28
|
+
*/
|
|
29
|
+
commandsDir?: string;
|
|
30
|
+
/**
|
|
31
|
+
* File pattern for auto-discovery.
|
|
32
|
+
* Defaults to files ending in `.command.ts` or `.command.js`.
|
|
33
|
+
* Set to `*` to discover all .ts/.js files.
|
|
34
|
+
*/
|
|
35
|
+
filePattern?: RegExp;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Metadata about a registered command for introspection.
|
|
39
|
+
*/
|
|
40
|
+
export interface RegisteredCommand {
|
|
41
|
+
definition: CommandDefinition;
|
|
42
|
+
hooks: CommandHook[];
|
|
43
|
+
registeredAt: Date;
|
|
44
|
+
}
|
|
45
|
+
export declare class CommandRegistry {
|
|
46
|
+
private commands;
|
|
47
|
+
private globalHooks;
|
|
48
|
+
private options;
|
|
49
|
+
constructor(options?: RegistryOptions);
|
|
50
|
+
/**
|
|
51
|
+
* Register a single command definition.
|
|
52
|
+
*
|
|
53
|
+
* @param definition - The command to register
|
|
54
|
+
* @param hooks - Optional lifecycle hooks for this command
|
|
55
|
+
* @throws Error in strict mode if command name is already registered
|
|
56
|
+
*/
|
|
57
|
+
register(definition: CommandDefinition, hooks?: CommandHook[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Register a command module (definition + hooks bundle).
|
|
60
|
+
*/
|
|
61
|
+
registerModule(mod: CommandModule): void;
|
|
62
|
+
/**
|
|
63
|
+
* Register a global hook that runs for all commands.
|
|
64
|
+
*/
|
|
65
|
+
registerGlobalHook(hook: CommandHook): void;
|
|
66
|
+
/**
|
|
67
|
+
* Remove a registered command.
|
|
68
|
+
*/
|
|
69
|
+
unregister(name: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Discover and register commands from a directory.
|
|
72
|
+
*
|
|
73
|
+
* Scans the directory for files matching the configured pattern.
|
|
74
|
+
* Each file should export either:
|
|
75
|
+
* - A `module` property conforming to `CommandModule`
|
|
76
|
+
* - A `command` property conforming to `CommandDefinition`
|
|
77
|
+
* - A default export conforming to `CommandDefinition`
|
|
78
|
+
*
|
|
79
|
+
* @param directory - Directory to scan. Defaults to configured commandsDir.
|
|
80
|
+
* @returns Number of commands discovered and registered.
|
|
81
|
+
*/
|
|
82
|
+
discoverCommands(directory?: string): Promise<number>;
|
|
83
|
+
/**
|
|
84
|
+
* Discover commands from multiple directories.
|
|
85
|
+
*
|
|
86
|
+
* @param directories - Array of directory paths to scan
|
|
87
|
+
* @returns Total number of commands discovered
|
|
88
|
+
*/
|
|
89
|
+
discoverFromDirectories(directories: string[]): Promise<number>;
|
|
90
|
+
/**
|
|
91
|
+
* Get a registered command by name.
|
|
92
|
+
*/
|
|
93
|
+
get(name: string): CommandDefinition | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Find a command by name or alias.
|
|
96
|
+
* Searches direct name first, then aliases.
|
|
97
|
+
*/
|
|
98
|
+
findByNameOrAlias(nameOrAlias: string): CommandDefinition | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Check if a command is registered.
|
|
101
|
+
*/
|
|
102
|
+
has(name: string): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* List all registered commands, optionally filtered by category.
|
|
105
|
+
*/
|
|
106
|
+
list(category?: CommandCategory): CommandDefinition[];
|
|
107
|
+
/**
|
|
108
|
+
* List all registered command names.
|
|
109
|
+
*/
|
|
110
|
+
names(): string[];
|
|
111
|
+
/**
|
|
112
|
+
* Get commands grouped by category.
|
|
113
|
+
*/
|
|
114
|
+
grouped(): Map<CommandCategory | 'uncategorized', CommandDefinition[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Get all command names for shell completion.
|
|
117
|
+
*/
|
|
118
|
+
getCompletionWords(): string[];
|
|
119
|
+
/**
|
|
120
|
+
* Build a Commander.js program from all registered commands.
|
|
121
|
+
*
|
|
122
|
+
* This is the bridge between the registry's CommandDefinition world
|
|
123
|
+
* and Commander.js's imperative API. Call this once after all commands
|
|
124
|
+
* are registered.
|
|
125
|
+
*
|
|
126
|
+
* @param program - The root Commander.js Command instance
|
|
127
|
+
* @param contextFactory - Factory that creates a CommandContext for each invocation
|
|
128
|
+
*/
|
|
129
|
+
buildProgram(program: Command, contextFactory: (globalOpts: GlobalOptions) => CommandContext): void;
|
|
130
|
+
/**
|
|
131
|
+
* Build a single Commander.Command from a CommandDefinition.
|
|
132
|
+
*/
|
|
133
|
+
private buildCommand;
|
|
134
|
+
/**
|
|
135
|
+
* Generate a bash completion script.
|
|
136
|
+
*/
|
|
137
|
+
generateBashCompletion(programName?: string): string;
|
|
138
|
+
/**
|
|
139
|
+
* Generate a zsh completion script.
|
|
140
|
+
*/
|
|
141
|
+
generateZshCompletion(programName?: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* Load a module from a file path. Handles both ESM and CJS.
|
|
144
|
+
*/
|
|
145
|
+
private loadModule;
|
|
146
|
+
/**
|
|
147
|
+
* Validate a command definition at registration time.
|
|
148
|
+
*/
|
|
149
|
+
private validateDefinition;
|
|
150
|
+
/**
|
|
151
|
+
* Run hooks for a specific phase.
|
|
152
|
+
*/
|
|
153
|
+
private runHooks;
|
|
154
|
+
/**
|
|
155
|
+
* Handle a CommandResult by formatting output appropriately.
|
|
156
|
+
*/
|
|
157
|
+
private handleResult;
|
|
158
|
+
/**
|
|
159
|
+
* Convert Commander.js flag specification to a camelCase option name.
|
|
160
|
+
* e.g., '-p, --port <number>' -> 'port'
|
|
161
|
+
* e.g., '--dry-run' -> 'dryRun'
|
|
162
|
+
*/
|
|
163
|
+
private flagsToOptionName;
|
|
164
|
+
/**
|
|
165
|
+
* Generate bash case clauses for subcommand completion.
|
|
166
|
+
*/
|
|
167
|
+
private generateBashCaseClauses;
|
|
168
|
+
/**
|
|
169
|
+
* Generate zsh case clauses for subcommand completion.
|
|
170
|
+
*/
|
|
171
|
+
private generateZshCaseClauses;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=command-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../../src/framework/command-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,eAAe,EACf,cAAc,EAGd,aAAa,EACd,MAAM,qBAAqB,CAAC;AAO7B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,WAAW,C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