mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 10:13:24 +08:00
chore: batch update - cleanup ghost commands, ccw-help index refresh, CLI session/orchestrator enhancements, skill minor fixes
- Add cleanup-ghost-commands.mjs script - Refresh ccw-help index files (remove stale entries) - CLI session manager: add instruction assembler and launch registry - Frontend: orchestrator plan builder, property panel, dashboard toolbar updates - Flow executor and type updates - Minor fixes across multiple skills and commands
This commit is contained in:
53
ccw/src/core/services/cli-launch-registry.ts
Normal file
53
ccw/src/core/services/cli-launch-registry.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
// ========================================
|
||||
// CLI Launch Registry
|
||||
// ========================================
|
||||
// Defines interactive-mode launch parameters for each CLI tool.
|
||||
// Supports 'default' and 'yolo' launch modes.
|
||||
|
||||
export type CliTool = 'claude' | 'gemini' | 'qwen' | 'codex' | 'opencode';
|
||||
|
||||
export type LaunchMode = 'default' | 'yolo';
|
||||
|
||||
export interface CliLaunchConfig {
|
||||
command: string;
|
||||
args: string[];
|
||||
env?: Record<string, string>;
|
||||
}
|
||||
|
||||
function parseCommand(raw: string): CliLaunchConfig {
|
||||
const parts = raw.split(/\s+/);
|
||||
return { command: parts[0], args: parts.slice(1) };
|
||||
}
|
||||
|
||||
const LAUNCH_CONFIGS: Record<CliTool, Record<LaunchMode, CliLaunchConfig>> = {
|
||||
claude: {
|
||||
default: parseCommand('claude'),
|
||||
yolo: parseCommand('claude --permission-mode bypassPermissions'),
|
||||
},
|
||||
gemini: {
|
||||
default: parseCommand('gemini'),
|
||||
yolo: parseCommand('gemini --approval-mode yolo'),
|
||||
},
|
||||
qwen: {
|
||||
default: parseCommand('qwen'),
|
||||
yolo: parseCommand('qwen --approval-mode yolo'),
|
||||
},
|
||||
codex: {
|
||||
default: parseCommand('codex'),
|
||||
yolo: parseCommand('codex --full-auto'),
|
||||
},
|
||||
opencode: {
|
||||
default: parseCommand('opencode'),
|
||||
yolo: parseCommand('opencode'),
|
||||
},
|
||||
};
|
||||
|
||||
const KNOWN_TOOLS = new Set<string>(Object.keys(LAUNCH_CONFIGS));
|
||||
|
||||
export function getLaunchConfig(tool: string, launchMode: LaunchMode): CliLaunchConfig {
|
||||
if (KNOWN_TOOLS.has(tool)) {
|
||||
return LAUNCH_CONFIGS[tool as CliTool][launchMode];
|
||||
}
|
||||
// Unknown tool: treat the tool name itself as the command
|
||||
return { command: tool, args: [] };
|
||||
}
|
||||
Reference in New Issue
Block a user