claude-flow 2.0.0-alpha.78 → 2.0.0-alpha.79
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/CHANGELOG.md +74 -0
- package/bin/claude-flow +1 -1
- package/bin/claude-flow.js +0 -0
- package/dist/agents/agent-loader.d.ts +90 -0
- package/dist/agents/agent-loader.d.ts.map +1 -0
- package/dist/agents/agent-loader.js +195 -0
- package/dist/agents/agent-loader.js.map +1 -0
- package/dist/agents/agent-manager.d.ts +191 -0
- package/dist/agents/agent-manager.d.ts.map +1 -0
- package/dist/agents/agent-manager.js +1405 -0
- package/dist/agents/agent-manager.js.map +1 -0
- package/dist/api/claude-api-errors.d.ts +115 -0
- package/dist/api/claude-api-errors.d.ts.map +1 -0
- package/dist/api/claude-api-errors.js +198 -0
- package/dist/api/claude-api-errors.js.map +1 -0
- package/dist/api/claude-client.d.ts +197 -0
- package/dist/api/claude-client.d.ts.map +1 -0
- package/dist/api/claude-client.js +525 -0
- package/dist/api/claude-client.js.map +1 -0
- package/dist/cli/cli-core.d.ts +52 -0
- package/dist/cli/cli-core.d.ts.map +1 -0
- package/dist/cli/cli-core.js +264 -0
- package/dist/cli/cli-core.js.map +1 -0
- package/dist/cli/command-registry.d.ts +10 -0
- package/dist/cli/command-registry.d.ts.map +1 -0
- package/dist/cli/command-registry.js +758 -0
- package/dist/cli/command-registry.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +7 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +382 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/config.d.ts +5 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +88 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/enterprise.d.ts +3 -0
- package/dist/cli/commands/enterprise.d.ts.map +1 -0
- package/dist/cli/commands/enterprise.js +1506 -0
- package/dist/cli/commands/enterprise.js.map +1 -0
- package/dist/cli/commands/help.d.ts +7 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +936 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/hive-mind/index.d.ts +19 -0
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/index.js +30 -0
- package/dist/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/cli/commands/hive-mind/init.d.ts +10 -0
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/init.js +68 -0
- package/dist/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/cli/commands/hive-mind/pause.d.ts +9 -0
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/pause.js +81 -0
- package/dist/cli/commands/hive-mind/pause.js.map +1 -0
- package/dist/cli/commands/hive-mind/ps.d.ts +9 -0
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/ps.js +120 -0
- package/dist/cli/commands/hive-mind/ps.js.map +1 -0
- package/dist/cli/commands/hive-mind/resume.d.ts +9 -0
- package/dist/cli/commands/hive-mind/resume.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/resume.js +62 -0
- package/dist/cli/commands/hive-mind/resume.js.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts +10 -0
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/spawn.js +174 -0
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/cli/commands/hive-mind/status.d.ts +10 -0
- package/dist/cli/commands/hive-mind/status.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/status.js +204 -0
- package/dist/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/cli/commands/hive-mind/stop.d.ts +9 -0
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/stop.js +125 -0
- package/dist/cli/commands/hive-mind/stop.js.map +1 -0
- package/dist/cli/commands/hive-mind/task.d.ts +10 -0
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/task.js +294 -0
- package/dist/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts +10 -0
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -0
- package/dist/cli/commands/hive-mind/wizard.js +531 -0
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/cli/commands/hive.d.ts +6 -0
- package/dist/cli/commands/hive.d.ts.map +1 -0
- package/dist/cli/commands/hive.js +409 -0
- package/dist/cli/commands/hive.js.map +1 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +2532 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +5 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +169 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +30 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +225 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +6 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +139 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/monitor.d.ts +6 -0
- package/dist/cli/commands/monitor.d.ts.map +1 -0
- package/dist/cli/commands/monitor.js +493 -0
- package/dist/cli/commands/monitor.js.map +1 -0
- package/dist/cli/commands/session.d.ts +6 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +548 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/sparc.d.ts +3 -0
- package/dist/cli/commands/sparc.d.ts.map +1 -0
- package/dist/cli/commands/sparc.js +472 -0
- package/dist/cli/commands/sparc.js.map +1 -0
- package/dist/cli/commands/start/event-emitter.d.ts +13 -0
- package/dist/cli/commands/start/event-emitter.d.ts.map +1 -0
- package/dist/cli/commands/start/event-emitter.js +35 -0
- package/dist/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/cli/commands/start/index.d.ts +10 -0
- package/dist/cli/commands/start/index.d.ts.map +1 -0
- package/dist/cli/commands/start/index.js +9 -0
- package/dist/cli/commands/start/index.js.map +1 -0
- package/dist/cli/commands/start/process-manager.d.ts +31 -0
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -0
- package/dist/cli/commands/start/process-manager.js +283 -0
- package/dist/cli/commands/start/process-manager.js.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts +29 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui-simple.js +334 -0
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/cli/commands/start/process-ui.d.ts +5 -0
- package/dist/cli/commands/start/process-ui.d.ts.map +1 -0
- package/dist/cli/commands/start/process-ui.js +5 -0
- package/dist/cli/commands/start/process-ui.js.map +1 -0
- package/dist/cli/commands/start/start-command.d.ts +2 -0
- package/dist/cli/commands/start/start-command.d.ts.map +1 -0
- package/dist/cli/commands/start/start-command.js +462 -0
- package/dist/cli/commands/start/start-command.js.map +1 -0
- package/dist/cli/commands/start/system-monitor.d.ts +25 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -0
- package/dist/cli/commands/start/system-monitor.js +265 -0
- package/dist/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/cli/commands/start/types.d.ts +64 -0
- package/dist/cli/commands/start/types.d.ts.map +1 -0
- package/dist/cli/commands/start/types.js +22 -0
- package/dist/cli/commands/start/types.js.map +1 -0
- package/dist/cli/commands/start.d.ts +6 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +6 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/status.d.ts +6 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +307 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/swarm.d.ts +6 -0
- package/dist/cli/commands/swarm.d.ts.map +1 -0
- package/dist/cli/commands/swarm.js +465 -0
- package/dist/cli/commands/swarm.js.map +1 -0
- package/dist/cli/commands/task.d.ts +6 -0
- package/dist/cli/commands/task.d.ts.map +1 -0
- package/dist/cli/commands/task.js +75 -0
- package/dist/cli/commands/task.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +6 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +624 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/completion.d.ts +19 -0
- package/dist/cli/completion.d.ts.map +1 -0
- package/dist/cli/completion.js +545 -0
- package/dist/cli/completion.js.map +1 -0
- package/dist/cli/formatter.d.ts +69 -0
- package/dist/cli/formatter.d.ts.map +1 -0
- package/dist/cli/formatter.js +277 -0
- package/dist/cli/formatter.js.map +1 -0
- package/dist/cli/help-formatter.d.ts +49 -0
- package/dist/cli/help-formatter.d.ts.map +1 -0
- package/dist/cli/help-formatter.js +108 -0
- package/dist/cli/help-formatter.js.map +1 -0
- package/dist/cli/index-remote.d.ts +7 -0
- package/dist/cli/index-remote.d.ts.map +1 -0
- package/dist/cli/index-remote.js +126 -0
- package/dist/cli/index-remote.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +191 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/node-compat.d.ts +81 -0
- package/dist/cli/node-compat.d.ts.map +1 -0
- package/dist/cli/node-compat.js +229 -0
- package/dist/cli/node-compat.js.map +1 -0
- package/dist/cli/repl.d.ts +5 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +949 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/runtime-detector.d.ts +128 -0
- package/dist/cli/runtime-detector.d.ts.map +1 -0
- package/dist/cli/runtime-detector.js +267 -0
- package/dist/cli/runtime-detector.js.map +1 -0
- package/dist/cli/simple-cli.d.ts +7 -0
- package/dist/cli/simple-cli.d.ts.map +1 -0
- package/dist/cli/simple-cli.js +3074 -0
- package/dist/cli/simple-cli.js.map +1 -0
- package/dist/cli/simple-commands/agent.d.ts +2 -0
- package/dist/cli/simple-commands/agent.d.ts.map +1 -0
- package/dist/cli/simple-commands/agent.js +175 -0
- package/dist/cli/simple-commands/agent.js.map +1 -0
- package/dist/cli/simple-commands/analysis.d.ts +2 -0
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -0
- package/dist/cli/simple-commands/analysis.js +207 -0
- package/dist/cli/simple-commands/analysis.js.map +1 -0
- package/dist/cli/simple-commands/automation.d.ts +2 -0
- package/dist/cli/simple-commands/automation.d.ts.map +1 -0
- package/dist/cli/simple-commands/automation.js +246 -0
- package/dist/cli/simple-commands/automation.js.map +1 -0
- package/dist/cli/simple-commands/batch-manager.d.ts +2 -0
- package/dist/cli/simple-commands/batch-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/batch-manager.js +290 -0
- package/dist/cli/simple-commands/batch-manager.js.map +1 -0
- package/dist/cli/simple-commands/config.d.ts +2 -0
- package/dist/cli/simple-commands/config.d.ts.map +1 -0
- package/dist/cli/simple-commands/config.js +278 -0
- package/dist/cli/simple-commands/config.js.map +1 -0
- package/dist/cli/simple-commands/coordination.d.ts +2 -0
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -0
- package/dist/cli/simple-commands/coordination.js +249 -0
- package/dist/cli/simple-commands/coordination.js.map +1 -0
- package/dist/cli/simple-commands/fix-hook-variables.d.ts +16 -0
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -0
- package/dist/cli/simple-commands/fix-hook-variables.js +320 -0
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -0
- package/dist/cli/simple-commands/github.d.ts +3 -0
- package/dist/cli/simple-commands/github.d.ts.map +1 -0
- package/dist/cli/simple-commands/github.js +343 -0
- package/dist/cli/simple-commands/github.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts +68 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +264 -0
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/communication.d.ts +176 -0
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/communication.js +611 -0
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/core.d.ts +306 -0
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/core.js +840 -0
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts +32 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +702 -0
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +270 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +1211 -0
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/memory.d.ts +334 -0
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/memory.js +1068 -0
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts +256 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +520 -0
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/queen.d.ts +235 -0
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/queen.js +697 -0
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts +139 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.js +835 -0
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts +6 -0
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind-optimize.js +317 -0
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -0
- package/dist/cli/simple-commands/hive-mind.d.ts +18 -0
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -0
- package/dist/cli/simple-commands/hive-mind.js +2430 -0
- package/dist/cli/simple-commands/hive-mind.js.map +1 -0
- package/dist/cli/simple-commands/hook-safety.d.ts +177 -0
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -0
- package/dist/cli/simple-commands/hook-safety.js +590 -0
- package/dist/cli/simple-commands/hook-safety.js.map +1 -0
- package/dist/cli/simple-commands/hooks.d.ts +3 -0
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -0
- package/dist/cli/simple-commands/hooks.js +1026 -0
- package/dist/cli/simple-commands/hooks.js.map +1 -0
- package/dist/cli/simple-commands/init/agent-copier.d.ts +43 -0
- package/dist/cli/simple-commands/init/agent-copier.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/agent-copier.js +200 -0
- package/dist/cli/simple-commands/init/agent-copier.js.map +1 -0
- package/dist/cli/simple-commands/init/batch-init.d.ts +137 -0
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/batch-init.js +558 -0
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js +433 -0
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +871 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +332 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts +3 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +488 -0
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts +2 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js +51 -0
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts +3 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +288 -0
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts +29 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.js +159 -0
- package/dist/cli/simple-commands/init/copy-revised-templates.js.map +1 -0
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts +2 -0
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/executable-wrapper.js +116 -0
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts +23 -0
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/gitignore-updater.js +126 -0
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -0
- package/dist/cli/simple-commands/init/help.d.ts +2 -0
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/help.js +95 -0
- package/dist/cli/simple-commands/init/help.js.map +1 -0
- package/dist/cli/simple-commands/init/index.d.ts +2 -0
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/index.js +1178 -0
- package/dist/cli/simple-commands/init/index.js.map +1 -0
- package/dist/cli/simple-commands/init/performance-monitor.d.ts +73 -0
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/performance-monitor.js +277 -0
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts +95 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +486 -0
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/index.d.ts +114 -0
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/index.js +353 -0
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts +161 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +686 -0
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts +112 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +480 -0
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts +121 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +432 -0
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.js +61 -0
- package/dist/cli/simple-commands/init/sparc/roo-readme.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +80 -0
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc/workflows.js +36 -0
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -0
- package/dist/cli/simple-commands/init/sparc-structure.d.ts +2 -0
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/sparc-structure.js +63 -0
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -0
- package/dist/cli/simple-commands/init/template-copier.d.ts +27 -0
- package/dist/cli/simple-commands/init/template-copier.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/template-copier.js +510 -0
- package/dist/cli/simple-commands/init/template-copier.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts +5 -0
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/claude-md.js +646 -0
- package/dist/cli/simple-commands/init/templates/claude-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts +4 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.js +338 -0
- package/dist/cli/simple-commands/init/templates/coordination-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts +18 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +1407 -0
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts +4 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js +257 -0
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts +3 -0
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/readme-files.js +71 -0
- package/dist/cli/simple-commands/init/templates/readme-files.js.map +1 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts +30 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +1375 -0
- package/dist/cli/simple-commands/init/templates/sparc-modes.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts +63 -0
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/config-validator.js +308 -0
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts +117 -0
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/health-checker.js +539 -0
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/index.d.ts +55 -0
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/index.js +347 -0
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts +76 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.js +343 -0
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts +62 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +349 -0
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts +86 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +260 -0
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -0
- package/dist/cli/simple-commands/mcp.d.ts +2 -0
- package/dist/cli/simple-commands/mcp.d.ts.map +1 -0
- package/dist/cli/simple-commands/mcp.js +366 -0
- package/dist/cli/simple-commands/mcp.js.map +1 -0
- package/dist/cli/simple-commands/memory.d.ts +2 -0
- package/dist/cli/simple-commands/memory.d.ts.map +1 -0
- package/dist/cli/simple-commands/memory.js +278 -0
- package/dist/cli/simple-commands/memory.js.map +1 -0
- package/dist/cli/simple-commands/migrate-hooks.d.ts +10 -0
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -0
- package/dist/cli/simple-commands/migrate-hooks.js +57 -0
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -0
- package/dist/cli/simple-commands/monitor.d.ts +3 -0
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -0
- package/dist/cli/simple-commands/monitor.js +366 -0
- package/dist/cli/simple-commands/monitor.js.map +1 -0
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts +55 -0
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -0
- package/dist/cli/simple-commands/process-ui-enhanced.js +680 -0
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/architect.js +126 -0
- package/dist/cli/simple-commands/sparc-modes/architect.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/ask.js +127 -0
- package/dist/cli/simple-commands/sparc-modes/ask.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/code.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/code.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/code.js +149 -0
- package/dist/cli/simple-commands/sparc-modes/code.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/debug.js +113 -0
- package/dist/cli/simple-commands/sparc-modes/debug.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/devops.js +138 -0
- package/dist/cli/simple-commands/sparc-modes/devops.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/generic.js +35 -0
- package/dist/cli/simple-commands/sparc-modes/generic.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/index.d.ts +17 -0
- package/dist/cli/simple-commands/sparc-modes/index.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/index.js +196 -0
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/integration.js +56 -0
- package/dist/cli/simple-commands/sparc-modes/integration.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/mcp.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/monitoring.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/optimization.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.js +131 -0
- package/dist/cli/simple-commands/sparc-modes/security-review.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js +168 -0
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js +39 -0
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js +150 -0
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts +81 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.js +428 -0
- package/dist/cli/simple-commands/sparc-modes/swarm.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.js +113 -0
- package/dist/cli/simple-commands/sparc-modes/tdd.js.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts +2 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.js +278 -0
- package/dist/cli/simple-commands/sparc-modes/tutorial.js.map +1 -0
- package/dist/cli/simple-commands/sparc.d.ts +2 -0
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -0
- package/dist/cli/simple-commands/sparc.js +480 -0
- package/dist/cli/simple-commands/sparc.js.map +1 -0
- package/dist/cli/simple-commands/start-ui.d.ts +2 -0
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -0
- package/dist/cli/simple-commands/start-ui.js +135 -0
- package/dist/cli/simple-commands/start-ui.js.map +1 -0
- package/dist/cli/simple-commands/start-wrapper.d.ts +2 -0
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -0
- package/dist/cli/simple-commands/start-wrapper.js +264 -0
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -0
- package/dist/cli/simple-commands/start.d.ts +2 -0
- package/dist/cli/simple-commands/start.d.ts.map +1 -0
- package/dist/cli/simple-commands/start.js +3 -0
- package/dist/cli/simple-commands/start.js.map +1 -0
- package/dist/cli/simple-commands/status.d.ts +2 -0
- package/dist/cli/simple-commands/status.d.ts.map +1 -0
- package/dist/cli/simple-commands/status.js +274 -0
- package/dist/cli/simple-commands/status.js.map +1 -0
- package/dist/cli/simple-commands/swarm-executor.d.ts +68 -0
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-executor.js +218 -0
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts +69 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.js +294 -0
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -0
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts +68 -0
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm-webui-integration.js +265 -0
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -0
- package/dist/cli/simple-commands/swarm.d.ts +2 -0
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -0
- package/dist/cli/simple-commands/swarm.js +1964 -0
- package/dist/cli/simple-commands/swarm.js.map +1 -0
- package/dist/cli/simple-commands/task.d.ts +2 -0
- package/dist/cli/simple-commands/task.d.ts.map +1 -0
- package/dist/cli/simple-commands/task.js +190 -0
- package/dist/cli/simple-commands/task.js.map +1 -0
- package/dist/cli/simple-commands/training.d.ts +2 -0
- package/dist/cli/simple-commands/training.d.ts.map +1 -0
- package/dist/cli/simple-commands/training.js +240 -0
- package/dist/cli/simple-commands/training.js.map +1 -0
- package/dist/cli/simple-commands/web-server.d.ts +152 -0
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -0
- package/dist/cli/simple-commands/web-server.js +816 -0
- package/dist/cli/simple-commands/web-server.js.map +1 -0
- package/dist/cli/utils/interactive-detector.d.ts +25 -0
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -0
- package/dist/cli/utils/interactive-detector.js +129 -0
- package/dist/cli/utils/interactive-detector.js.map +1 -0
- package/dist/cli/utils/safe-interactive.d.ts +30 -0
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -0
- package/dist/cli/utils/safe-interactive.js +134 -0
- package/dist/cli/utils/safe-interactive.js.map +1 -0
- package/dist/cli/utils.d.ts +75 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +567 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/config/config-manager.d.ts +212 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +550 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/constants/agent-types.d.ts +55 -0
- package/dist/constants/agent-types.d.ts.map +1 -0
- package/dist/constants/agent-types.js +66 -0
- package/dist/constants/agent-types.js.map +1 -0
- package/dist/coordination/advanced-scheduler.d.ts +121 -0
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -0
- package/dist/coordination/advanced-scheduler.js +382 -0
- package/dist/coordination/advanced-scheduler.js.map +1 -0
- package/dist/coordination/background-executor.d.ts +69 -0
- package/dist/coordination/background-executor.d.ts.map +1 -0
- package/dist/coordination/background-executor.js +363 -0
- package/dist/coordination/background-executor.js.map +1 -0
- package/dist/coordination/circuit-breaker.d.ts +124 -0
- package/dist/coordination/circuit-breaker.d.ts.map +1 -0
- package/dist/coordination/circuit-breaker.js +301 -0
- package/dist/coordination/circuit-breaker.js.map +1 -0
- package/dist/coordination/conflict-resolution.d.ts +133 -0
- package/dist/coordination/conflict-resolution.d.ts.map +1 -0
- package/dist/coordination/conflict-resolution.js +360 -0
- package/dist/coordination/conflict-resolution.js.map +1 -0
- package/dist/coordination/dependency-graph.d.ts +78 -0
- package/dist/coordination/dependency-graph.d.ts.map +1 -0
- package/dist/coordination/dependency-graph.js +387 -0
- package/dist/coordination/dependency-graph.js.map +1 -0
- package/dist/coordination/manager.d.ts +66 -0
- package/dist/coordination/manager.d.ts.map +1 -0
- package/dist/coordination/manager.js +354 -0
- package/dist/coordination/manager.js.map +1 -0
- package/dist/coordination/messaging.d.ts +37 -0
- package/dist/coordination/messaging.d.ts.map +1 -0
- package/dist/coordination/messaging.js +219 -0
- package/dist/coordination/messaging.js.map +1 -0
- package/dist/coordination/metrics.d.ts +153 -0
- package/dist/coordination/metrics.d.ts.map +1 -0
- package/dist/coordination/metrics.js +436 -0
- package/dist/coordination/metrics.js.map +1 -0
- package/dist/coordination/resources.d.ts +36 -0
- package/dist/coordination/resources.d.ts.map +1 -0
- package/dist/coordination/resources.js +254 -0
- package/dist/coordination/resources.js.map +1 -0
- package/dist/coordination/scheduler.d.ts +48 -0
- package/dist/coordination/scheduler.d.ts.map +1 -0
- package/dist/coordination/scheduler.js +308 -0
- package/dist/coordination/scheduler.js.map +1 -0
- package/dist/coordination/swarm-coordinator.d.ts +116 -0
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -0
- package/dist/coordination/swarm-coordinator.js +563 -0
- package/dist/coordination/swarm-coordinator.js.map +1 -0
- package/dist/coordination/swarm-monitor.d.ts +101 -0
- package/dist/coordination/swarm-monitor.d.ts.map +1 -0
- package/dist/coordination/swarm-monitor.js +340 -0
- package/dist/coordination/swarm-monitor.js.map +1 -0
- package/dist/coordination/work-stealing.d.ts +44 -0
- package/dist/coordination/work-stealing.d.ts.map +1 -0
- package/dist/coordination/work-stealing.js +158 -0
- package/dist/coordination/work-stealing.js.map +1 -0
- package/dist/core/config.d.ts +243 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +1125 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/event-bus.d.ts +63 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +153 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/json-persistence.d.ts +55 -0
- package/dist/core/json-persistence.d.ts.map +1 -0
- package/dist/core/json-persistence.js +111 -0
- package/dist/core/json-persistence.js.map +1 -0
- package/dist/core/logger.d.ts +62 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +252 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/orchestrator-fixed.d.ts +81 -0
- package/dist/core/orchestrator-fixed.d.ts.map +1 -0
- package/dist/core/orchestrator-fixed.js +213 -0
- package/dist/core/orchestrator-fixed.js.map +1 -0
- package/dist/core/orchestrator.d.ts +123 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +1058 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/enterprise/analytics-manager.d.ts +489 -0
- package/dist/enterprise/analytics-manager.d.ts.map +1 -0
- package/dist/enterprise/analytics-manager.js +956 -0
- package/dist/enterprise/analytics-manager.js.map +1 -0
- package/dist/enterprise/audit-manager.d.ts +459 -0
- package/dist/enterprise/audit-manager.d.ts.map +1 -0
- package/dist/enterprise/audit-manager.js +1014 -0
- package/dist/enterprise/audit-manager.js.map +1 -0
- package/dist/enterprise/cloud-manager.d.ts +435 -0
- package/dist/enterprise/cloud-manager.d.ts.map +1 -0
- package/dist/enterprise/cloud-manager.js +789 -0
- package/dist/enterprise/cloud-manager.js.map +1 -0
- package/dist/enterprise/deployment-manager.d.ts +328 -0
- package/dist/enterprise/deployment-manager.d.ts.map +1 -0
- package/dist/enterprise/deployment-manager.js +830 -0
- package/dist/enterprise/deployment-manager.js.map +1 -0
- package/dist/enterprise/project-manager.d.ts +228 -0
- package/dist/enterprise/project-manager.d.ts.map +1 -0
- package/dist/enterprise/project-manager.js +537 -0
- package/dist/enterprise/project-manager.js.map +1 -0
- package/dist/enterprise/security-manager.d.ts +422 -0
- package/dist/enterprise/security-manager.d.ts.map +1 -0
- package/dist/enterprise/security-manager.js +910 -0
- package/dist/enterprise/security-manager.js.map +1 -0
- package/dist/hive-mind/core/Agent.d.ts +137 -0
- package/dist/hive-mind/core/Agent.d.ts.map +1 -0
- package/dist/hive-mind/core/Agent.js +567 -0
- package/dist/hive-mind/core/Agent.js.map +1 -0
- package/dist/hive-mind/core/Communication.d.ts +116 -0
- package/dist/hive-mind/core/Communication.d.ts.map +1 -0
- package/dist/hive-mind/core/Communication.js +407 -0
- package/dist/hive-mind/core/Communication.js.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts +99 -0
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -0
- package/dist/hive-mind/core/DatabaseManager.js +648 -0
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/hive-mind/core/HiveMind.d.ts +90 -0
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -0
- package/dist/hive-mind/core/HiveMind.js +455 -0
- package/dist/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/hive-mind/core/Memory.d.ts +235 -0
- package/dist/hive-mind/core/Memory.d.ts.map +1 -0
- package/dist/hive-mind/core/Memory.js +1192 -0
- package/dist/hive-mind/core/Memory.js.map +1 -0
- package/dist/hive-mind/core/Queen.d.ts +115 -0
- package/dist/hive-mind/core/Queen.d.ts.map +1 -0
- package/dist/hive-mind/core/Queen.js +649 -0
- package/dist/hive-mind/core/Queen.js.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts +117 -0
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -0
- package/dist/hive-mind/integration/ConsensusEngine.js +478 -0
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts +172 -0
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js +217 -0
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +172 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js +748 -0
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/hive-mind/types.d.ts +314 -0
- package/dist/hive-mind/types.d.ts.map +1 -0
- package/dist/hive-mind/types.js +7 -0
- package/dist/hive-mind/types.js.map +1 -0
- package/dist/mcp/auth.d.ts +80 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/auth.js +350 -0
- package/dist/mcp/auth.js.map +1 -0
- package/dist/mcp/claude-flow-tools.d.ts +13 -0
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -0
- package/dist/mcp/claude-flow-tools.js +1176 -0
- package/dist/mcp/claude-flow-tools.js.map +1 -0
- package/dist/mcp/load-balancer.d.ts +88 -0
- package/dist/mcp/load-balancer.d.ts.map +1 -0
- package/dist/mcp/load-balancer.js +393 -0
- package/dist/mcp/load-balancer.js.map +1 -0
- package/dist/mcp/router.d.ts +54 -0
- package/dist/mcp/router.d.ts.map +1 -0
- package/dist/mcp/router.js +204 -0
- package/dist/mcp/router.js.map +1 -0
- package/dist/mcp/ruv-swarm-tools.d.ts +58 -0
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -0
- package/dist/mcp/ruv-swarm-tools.js +548 -0
- package/dist/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/mcp/server.d.ts +75 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +538 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session-manager.d.ts +60 -0
- package/dist/mcp/session-manager.d.ts.map +1 -0
- package/dist/mcp/session-manager.js +323 -0
- package/dist/mcp/session-manager.js.map +1 -0
- package/dist/mcp/swarm-tools.d.ts +87 -0
- package/dist/mcp/swarm-tools.d.ts.map +1 -0
- package/dist/mcp/swarm-tools.js +731 -0
- package/dist/mcp/swarm-tools.js.map +1 -0
- package/dist/mcp/tools.d.ts +145 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +434 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transports/base.d.ts +22 -0
- package/dist/mcp/transports/base.d.ts.map +1 -0
- package/dist/mcp/transports/base.js +5 -0
- package/dist/mcp/transports/base.js.map +1 -0
- package/dist/mcp/transports/http.d.ts +48 -0
- package/dist/mcp/transports/http.d.ts.map +1 -0
- package/dist/mcp/transports/http.js +400 -0
- package/dist/mcp/transports/http.js.map +1 -0
- package/dist/mcp/transports/stdio.d.ts +37 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -0
- package/dist/mcp/transports/stdio.js +206 -0
- package/dist/mcp/transports/stdio.js.map +1 -0
- package/dist/memory/advanced-serializer.d.ts +159 -0
- package/dist/memory/advanced-serializer.d.ts.map +1 -0
- package/dist/memory/advanced-serializer.js +564 -0
- package/dist/memory/advanced-serializer.js.map +1 -0
- package/dist/memory/backends/base.d.ts +21 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +5 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/markdown.d.ts +35 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -0
- package/dist/memory/backends/markdown.js +223 -0
- package/dist/memory/backends/markdown.js.map +1 -0
- package/dist/memory/backends/sqlite.d.ts +33 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -0
- package/dist/memory/backends/sqlite.js +291 -0
- package/dist/memory/backends/sqlite.js.map +1 -0
- package/dist/memory/cache.d.ts +65 -0
- package/dist/memory/cache.d.ts.map +1 -0
- package/dist/memory/cache.js +188 -0
- package/dist/memory/cache.js.map +1 -0
- package/dist/memory/distributed-memory.d.ts +188 -0
- package/dist/memory/distributed-memory.d.ts.map +1 -0
- package/dist/memory/distributed-memory.js +710 -0
- package/dist/memory/distributed-memory.js.map +1 -0
- package/dist/memory/enhanced-session-serializer.d.ts +115 -0
- package/dist/memory/enhanced-session-serializer.d.ts.map +1 -0
- package/dist/memory/enhanced-session-serializer.js +478 -0
- package/dist/memory/enhanced-session-serializer.js.map +1 -0
- package/dist/memory/fallback-store.d.ts +28 -0
- package/dist/memory/fallback-store.d.ts.map +1 -0
- package/dist/memory/fallback-store.js +101 -0
- package/dist/memory/fallback-store.js.map +1 -0
- package/dist/memory/in-memory-store.d.ts +37 -0
- package/dist/memory/in-memory-store.d.ts.map +1 -0
- package/dist/memory/in-memory-store.js +174 -0
- package/dist/memory/in-memory-store.js.map +1 -0
- package/dist/memory/indexer.d.ts +52 -0
- package/dist/memory/indexer.d.ts.map +1 -0
- package/dist/memory/indexer.js +191 -0
- package/dist/memory/indexer.js.map +1 -0
- package/dist/memory/manager.d.ts +58 -0
- package/dist/memory/manager.d.ts.map +1 -0
- package/dist/memory/manager.js +423 -0
- package/dist/memory/manager.js.map +1 -0
- package/dist/memory/sqlite-store.d.ts +34 -0
- package/dist/memory/sqlite-store.d.ts.map +1 -0
- package/dist/memory/sqlite-store.js +267 -0
- package/dist/memory/sqlite-store.js.map +1 -0
- package/dist/memory/sqlite-wrapper.d.ts +38 -0
- package/dist/memory/sqlite-wrapper.d.ts.map +1 -0
- package/dist/memory/sqlite-wrapper.js +152 -0
- package/dist/memory/sqlite-wrapper.js.map +1 -0
- package/dist/memory/swarm-memory.d.ts +91 -0
- package/dist/memory/swarm-memory.d.ts.map +1 -0
- package/dist/memory/swarm-memory.js +454 -0
- package/dist/memory/swarm-memory.js.map +1 -0
- package/dist/migration/logger.d.ts +26 -0
- package/dist/migration/logger.d.ts.map +1 -0
- package/dist/migration/logger.js +145 -0
- package/dist/migration/logger.js.map +1 -0
- package/dist/migration/migration-analyzer.d.ts +18 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -0
- package/dist/migration/migration-analyzer.js +284 -0
- package/dist/migration/migration-analyzer.js.map +1 -0
- package/dist/migration/migration-runner.d.ts +26 -0
- package/dist/migration/migration-runner.d.ts.map +1 -0
- package/dist/migration/migration-runner.js +505 -0
- package/dist/migration/migration-runner.js.map +1 -0
- package/dist/migration/migration-validator.d.ts +17 -0
- package/dist/migration/migration-validator.d.ts.map +1 -0
- package/dist/migration/migration-validator.js +309 -0
- package/dist/migration/migration-validator.js.map +1 -0
- package/dist/migration/progress-reporter.d.ts +28 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -0
- package/dist/migration/progress-reporter.js +163 -0
- package/dist/migration/progress-reporter.js.map +1 -0
- package/dist/migration/rollback-manager.d.ts +24 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -0
- package/dist/migration/rollback-manager.js +351 -0
- package/dist/migration/rollback-manager.js.map +1 -0
- package/dist/migration/types.d.ts +103 -0
- package/dist/migration/types.d.ts.map +1 -0
- package/dist/migration/types.js +6 -0
- package/dist/migration/types.js.map +1 -0
- package/dist/swarm/types.d.ts +578 -0
- package/dist/swarm/types.d.ts.map +1 -0
- package/dist/swarm/types.js +54 -0
- package/dist/swarm/types.js.map +1 -0
- package/dist/terminal/adapters/base.d.ts +40 -0
- package/dist/terminal/adapters/base.d.ts.map +1 -0
- package/dist/terminal/adapters/base.js +5 -0
- package/dist/terminal/adapters/base.js.map +1 -0
- package/dist/terminal/adapters/native.d.ts +19 -0
- package/dist/terminal/adapters/native.d.ts.map +1 -0
- package/dist/terminal/adapters/native.js +414 -0
- package/dist/terminal/adapters/native.js.map +1 -0
- package/dist/terminal/adapters/vscode.d.ts +23 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -0
- package/dist/terminal/adapters/vscode.js +267 -0
- package/dist/terminal/adapters/vscode.js.map +1 -0
- package/dist/terminal/manager.d.ts +59 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/manager.js +235 -0
- package/dist/terminal/manager.js.map +1 -0
- package/dist/terminal/pool.d.ts +32 -0
- package/dist/terminal/pool.d.ts.map +1 -0
- package/dist/terminal/pool.js +208 -0
- package/dist/terminal/pool.js.map +1 -0
- package/dist/terminal/session.d.ts +41 -0
- package/dist/terminal/session.d.ts.map +1 -0
- package/dist/terminal/session.js +210 -0
- package/dist/terminal/session.js.map +1 -0
- package/dist/utils/error-handler.d.ts +14 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +29 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/errors.d.ts +121 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +194 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/formatters.d.ts +15 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +75 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/helpers.d.ts +134 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +444 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/npx-isolated-cache.d.ts +17 -0
- package/dist/utils/npx-isolated-cache.d.ts.map +1 -0
- package/dist/utils/npx-isolated-cache.js +140 -0
- package/dist/utils/npx-isolated-cache.js.map +1 -0
- package/dist/utils/type-guards.d.ts +117 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +166 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/types.d.ts +568 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +37 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +12 -5
- package/src/agents/agent-manager.ts +432 -0
- package/src/cli/agents/index.ts +15 -1
- package/src/cli/command-registry.js +24 -0
- package/src/cli/commands/hive-mind/spawn.ts +18 -0
- package/src/cli/commands/maestro.ts +317 -0
- package/src/cli/commands/status.ts +1 -1
- package/src/cli/help-text.js +3 -3
- package/src/cli/index-remote.ts +1 -1
- package/src/cli/index.ts +1 -1
- package/src/cli/maestro-cli-bridge.ts +556 -0
- package/src/cli/node-compat.js +4 -23
- package/src/cli/runtime-detector.js +2 -2
- package/src/cli/simple-cli.js +1 -1
- package/src/cli/simple-cli.ts +1 -1
- package/src/cli/simple-commands/batch-manager.js +6 -5
- package/src/cli/simple-commands/github/github-api.js +159 -0
- package/src/cli/simple-commands/hive-mind/session-manager.js +38 -40
- package/src/cli/simple-commands/init/batch-init.js +13 -12
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +4 -3
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +4 -3
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +4 -4
- package/src/cli/simple-commands/init/index.js +72 -49
- package/src/cli/simple-commands/init/rollback/backup-manager.js +5 -4
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +23 -22
- package/src/cli/simple-commands/init/rollback/state-tracker.js +3 -2
- package/src/cli/simple-commands/init/sparc-structure.js +9 -7
- package/src/cli/simple-commands/init/template-copier.js +1 -1
- package/src/cli/simple-commands/init/templates/CLAUDE.md +3 -3
- package/src/cli/simple-commands/init/templates/github-safe-enhanced.js +333 -0
- package/src/cli/simple-commands/init/validation/config-validator.js +8 -7
- package/src/cli/simple-commands/init/validation/health-checker.js +6 -5
- package/src/cli/simple-commands/init/validation/mode-validator.js +4 -3
- package/src/cli/simple-commands/init/validation/post-init-validator.js +15 -14
- package/src/cli/simple-commands/init/validation/test-runner.js +10 -10
- package/src/cli/simple-commands/memory.js +8 -7
- package/src/cli/simple-commands/process-ui-enhanced.js +2 -2
- package/src/cli/simple-commands/process-ui.js +2 -2
- package/src/cli/simple-commands/sparc-modes/index.js +1 -1
- package/src/cli/simple-commands/sparc.js +28 -26
- package/src/cli/simple-commands/start-wrapper.js +6 -5
- package/src/cli/simple-commands/status.js +4 -3
- package/src/cli/simple-commands/swarm-executor.js +8 -3
- package/src/cli/simple-commands/swarm.js +270 -24
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/swarm-standalone.js +5 -5
- package/src/cli/utils.js +54 -66
- package/src/hive-mind/core/HiveMind.ts +16 -0
- package/src/hive-mind/types.ts +38 -5
- package/src/hooks/index.ts +192 -0
- package/src/maestro/maestro-swarm-coordinator.ts +602 -0
- package/src/maestro/maestro-types.ts +386 -0
- package/src/maestro/tests/native-hive-mind-integration.test.ts +480 -0
- package/src/memory/advanced-serializer.js +611 -0
- package/src/memory/enhanced-session-serializer.js +523 -0
- package/src/memory/in-memory-store.js +6 -4
- package/src/memory/sqlite-store.js +5 -4
- package/src/swarm/types.ts +10 -3
- package/src/utils/__tests__/github-cli-safety-wrapper.test.js +408 -0
- package/src/utils/github-cli-safe.js +37 -119
- package/src/utils/github-cli-safety-wrapper.js +587 -0
- package/src/utils/types.ts +60 -2
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test suite for GitHub CLI Safety Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Tests all security features, error handling, and functionality
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { jest } from '@jest/globals';
|
|
8
|
+
import {
|
|
9
|
+
GitHubCliSafe,
|
|
10
|
+
createGitHubCliSafe,
|
|
11
|
+
githubCli,
|
|
12
|
+
GitHubCliError,
|
|
13
|
+
GitHubCliTimeoutError,
|
|
14
|
+
GitHubCliValidationError,
|
|
15
|
+
GitHubCliRateLimitError
|
|
16
|
+
} from '../github-cli-safety-wrapper.js';
|
|
17
|
+
import { spawn } from 'child_process';
|
|
18
|
+
import { promises as fs } from 'fs';
|
|
19
|
+
|
|
20
|
+
// Mock child_process and fs
|
|
21
|
+
jest.mock('child_process');
|
|
22
|
+
jest.mock('fs', () => ({
|
|
23
|
+
promises: {
|
|
24
|
+
writeFile: jest.fn(),
|
|
25
|
+
unlink: jest.fn(),
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
describe('GitHubCliSafe', () => {
|
|
30
|
+
let ghSafe;
|
|
31
|
+
let mockSpawn;
|
|
32
|
+
let mockChild;
|
|
33
|
+
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
ghSafe = new GitHubCliSafe({
|
|
36
|
+
timeout: 5000,
|
|
37
|
+
enableRateLimit: false,
|
|
38
|
+
enableLogging: false
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
mockChild = {
|
|
42
|
+
kill: jest.fn(),
|
|
43
|
+
on: jest.fn(),
|
|
44
|
+
stdout: { on: jest.fn() },
|
|
45
|
+
stderr: { on: jest.fn() }
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
mockSpawn = spawn.mockReturnValue(mockChild);
|
|
49
|
+
fs.writeFile.mockResolvedValue();
|
|
50
|
+
fs.unlink.mockResolvedValue();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
afterEach(() => {
|
|
54
|
+
jest.clearAllMocks();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('Input Validation', () => {
|
|
58
|
+
test('should validate allowed commands', () => {
|
|
59
|
+
expect(() => ghSafe.validateCommand('issue create')).not.toThrow();
|
|
60
|
+
expect(() => ghSafe.validateCommand('pr comment')).not.toThrow();
|
|
61
|
+
|
|
62
|
+
expect(() => ghSafe.validateCommand('rm -rf /')).toThrow(GitHubCliValidationError);
|
|
63
|
+
expect(() => ghSafe.validateCommand('maliciouscommand')).toThrow(GitHubCliValidationError);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('should reject empty or invalid commands', () => {
|
|
67
|
+
expect(() => ghSafe.validateCommand('')).toThrow(GitHubCliValidationError);
|
|
68
|
+
expect(() => ghSafe.validateCommand(null)).toThrow(GitHubCliValidationError);
|
|
69
|
+
expect(() => ghSafe.validateCommand(undefined)).toThrow(GitHubCliValidationError);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('should sanitize dangerous input patterns', () => {
|
|
73
|
+
const dangerousInputs = [
|
|
74
|
+
'$(rm -rf /)',
|
|
75
|
+
'`rm -rf /`',
|
|
76
|
+
'test && rm -rf /',
|
|
77
|
+
'test || rm -rf /',
|
|
78
|
+
'test; rm -rf /',
|
|
79
|
+
'test <(echo malicious)',
|
|
80
|
+
'test > /dev/null',
|
|
81
|
+
'test | sh',
|
|
82
|
+
'eval("malicious")',
|
|
83
|
+
'exec("malicious")'
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
dangerousInputs.forEach(input => {
|
|
87
|
+
expect(() => ghSafe.sanitizeInput(input)).toThrow(GitHubCliValidationError);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('should allow safe input', () => {
|
|
92
|
+
const safeInputs = [
|
|
93
|
+
'This is a normal comment',
|
|
94
|
+
'Code example: console.log("hello")',
|
|
95
|
+
'File path: /src/components/Button.jsx',
|
|
96
|
+
'Numbers: 123, versions: v1.2.3',
|
|
97
|
+
'Special chars: @#$%^&*()_+-=[]{}|;:,.<>?'
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
safeInputs.forEach(input => {
|
|
101
|
+
expect(() => ghSafe.sanitizeInput(input)).not.toThrow();
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('should validate body size limits', () => {
|
|
106
|
+
const largeBody = 'x'.repeat(1024 * 1024 + 1); // > 1MB
|
|
107
|
+
expect(() => ghSafe.validateBodySize(largeBody)).toThrow(GitHubCliValidationError);
|
|
108
|
+
|
|
109
|
+
const normalBody = 'x'.repeat(1000);
|
|
110
|
+
expect(() => ghSafe.validateBodySize(normalBody)).not.toThrow();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('Process Management', () => {
|
|
115
|
+
test('should spawn process with correct arguments', async () => {
|
|
116
|
+
const mockProcess = setupMockProcess(0, 'success', '');
|
|
117
|
+
|
|
118
|
+
await ghSafe.execute('issue create', {
|
|
119
|
+
title: 'Test Issue',
|
|
120
|
+
body: 'Test body'
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
expect(spawn).toHaveBeenCalledWith('gh',
|
|
124
|
+
expect.arrayContaining(['issue', 'create', '--title', 'Test Issue']),
|
|
125
|
+
expect.objectContaining({
|
|
126
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
127
|
+
shell: false
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('should handle process timeout', async () => {
|
|
133
|
+
setupMockProcess(null, '', '', true); // Never completes
|
|
134
|
+
|
|
135
|
+
await expect(
|
|
136
|
+
ghSafe.execute('issue create', { title: 'Test' })
|
|
137
|
+
).rejects.toThrow(GitHubCliTimeoutError);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('should handle process failure', async () => {
|
|
141
|
+
setupMockProcess(1, '', 'Command failed');
|
|
142
|
+
|
|
143
|
+
await expect(
|
|
144
|
+
ghSafe.execute('issue create', { title: 'Test' })
|
|
145
|
+
).rejects.toThrow(GitHubCliError);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('should cleanup processes on timeout', async () => {
|
|
149
|
+
setupMockProcess(null, '', '', true); // Never completes
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
await ghSafe.execute('issue create', { title: 'Test' });
|
|
153
|
+
} catch (error) {
|
|
154
|
+
expect(mockChild.kill).toHaveBeenCalledWith('SIGTERM');
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('Retry Logic', () => {
|
|
160
|
+
test('should retry on transient failures', async () => {
|
|
161
|
+
let attemptCount = 0;
|
|
162
|
+
const operation = jest.fn(() => {
|
|
163
|
+
attemptCount++;
|
|
164
|
+
if (attemptCount < 3) {
|
|
165
|
+
throw new GitHubCliError('Transient error');
|
|
166
|
+
}
|
|
167
|
+
return { success: true };
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const result = await ghSafe.withRetry(operation, 3);
|
|
171
|
+
expect(result.success).toBe(true);
|
|
172
|
+
expect(operation).toHaveBeenCalledTimes(3);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('should not retry validation errors', async () => {
|
|
176
|
+
const operation = jest.fn(() => {
|
|
177
|
+
throw new GitHubCliValidationError('Invalid input');
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
await expect(ghSafe.withRetry(operation, 3)).rejects.toThrow(GitHubCliValidationError);
|
|
181
|
+
expect(operation).toHaveBeenCalledTimes(1);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test('should not retry rate limit errors', async () => {
|
|
185
|
+
const operation = jest.fn(() => {
|
|
186
|
+
throw new GitHubCliRateLimitError('Rate limited');
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
await expect(ghSafe.withRetry(operation, 3)).rejects.toThrow(GitHubCliRateLimitError);
|
|
190
|
+
expect(operation).toHaveBeenCalledTimes(1);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
describe('Rate Limiting', () => {
|
|
195
|
+
test('should enforce rate limits', async () => {
|
|
196
|
+
const rateLimitedGh = new GitHubCliSafe({
|
|
197
|
+
enableRateLimit: true,
|
|
198
|
+
maxRequestsPerWindow: 2,
|
|
199
|
+
rateLimitWindow: 1000
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Mock successful executions
|
|
203
|
+
setupMockProcess(0, 'success', '');
|
|
204
|
+
|
|
205
|
+
// First two requests should succeed
|
|
206
|
+
await rateLimitedGh.execute('auth status');
|
|
207
|
+
await rateLimitedGh.execute('auth status');
|
|
208
|
+
|
|
209
|
+
// Third request should be rate limited
|
|
210
|
+
await expect(
|
|
211
|
+
rateLimitedGh.execute('auth status')
|
|
212
|
+
).rejects.toThrow(GitHubCliRateLimitError);
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
describe('Temp File Handling', () => {
|
|
217
|
+
test('should create secure temp files for body content', async () => {
|
|
218
|
+
setupMockProcess(0, 'success', '');
|
|
219
|
+
|
|
220
|
+
await ghSafe.execute('issue create', {
|
|
221
|
+
title: 'Test',
|
|
222
|
+
body: 'Test body'
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
expect(fs.writeFile).toHaveBeenCalledWith(
|
|
226
|
+
expect.stringMatching(/gh-safe-.*\.tmp$/),
|
|
227
|
+
'Test body',
|
|
228
|
+
{ mode: 0o600 }
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
test('should cleanup temp files even on error', async () => {
|
|
233
|
+
setupMockProcess(1, '', 'Error');
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
await ghSafe.execute('issue create', {
|
|
237
|
+
title: 'Test',
|
|
238
|
+
body: 'Test body'
|
|
239
|
+
});
|
|
240
|
+
} catch (error) {
|
|
241
|
+
// Expected to fail
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
expect(fs.unlink).toHaveBeenCalled();
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
describe('High-level Operations', () => {
|
|
249
|
+
beforeEach(() => {
|
|
250
|
+
setupMockProcess(0, 'Issue created successfully', '');
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test('should create issue with proper arguments', async () => {
|
|
254
|
+
await ghSafe.createIssue({
|
|
255
|
+
title: 'Bug Report',
|
|
256
|
+
body: 'Found a bug',
|
|
257
|
+
labels: ['bug', 'high-priority'],
|
|
258
|
+
assignees: ['user1', 'user2']
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
expect(spawn).toHaveBeenCalledWith('gh',
|
|
262
|
+
expect.arrayContaining([
|
|
263
|
+
'issue', 'create',
|
|
264
|
+
'--title', 'Bug Report',
|
|
265
|
+
'--body-file', expect.stringMatching(/gh-safe-.*\.tmp$/),
|
|
266
|
+
'--label', 'bug,high-priority',
|
|
267
|
+
'--assignee', 'user1,user2'
|
|
268
|
+
]),
|
|
269
|
+
expect.any(Object)
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
test('should create PR with proper arguments', async () => {
|
|
274
|
+
await ghSafe.createPR({
|
|
275
|
+
title: 'Feature: Add new component',
|
|
276
|
+
body: 'Adds new component',
|
|
277
|
+
base: 'develop',
|
|
278
|
+
head: 'feature/new-component',
|
|
279
|
+
draft: true
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
expect(spawn).toHaveBeenCalledWith('gh',
|
|
283
|
+
expect.arrayContaining([
|
|
284
|
+
'pr', 'create',
|
|
285
|
+
'--title', 'Feature: Add new component',
|
|
286
|
+
'--body-file', expect.stringMatching(/gh-safe-.*\.tmp$/),
|
|
287
|
+
'--base', 'develop',
|
|
288
|
+
'--head', 'feature/new-component',
|
|
289
|
+
'--draft'
|
|
290
|
+
]),
|
|
291
|
+
expect.any(Object)
|
|
292
|
+
);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
test('should add issue comment', async () => {
|
|
296
|
+
await ghSafe.addIssueComment(123, 'This is a comment');
|
|
297
|
+
|
|
298
|
+
expect(spawn).toHaveBeenCalledWith('gh',
|
|
299
|
+
expect.arrayContaining([
|
|
300
|
+
'issue', 'comment', '123',
|
|
301
|
+
'--body-file', expect.stringMatching(/gh-safe-.*\.tmp$/)
|
|
302
|
+
]),
|
|
303
|
+
expect.any(Object)
|
|
304
|
+
);
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
describe('Utility Methods', () => {
|
|
309
|
+
test('should check GitHub CLI availability', async () => {
|
|
310
|
+
// Mock execSync for version check
|
|
311
|
+
const { execSync } = require('child_process');
|
|
312
|
+
jest.spyOn(require('child_process'), 'execSync').mockImplementation(() => 'gh version 2.0.0');
|
|
313
|
+
|
|
314
|
+
const isAvailable = await ghSafe.checkGitHubCli();
|
|
315
|
+
expect(isAvailable).toBe(true);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test('should get stats', () => {
|
|
319
|
+
const stats = ghSafe.getStats();
|
|
320
|
+
expect(stats).toHaveProperty('totalRequests');
|
|
321
|
+
expect(stats).toHaveProperty('successfulRequests');
|
|
322
|
+
expect(stats).toHaveProperty('failedRequests');
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
test('should cleanup active processes', async () => {
|
|
326
|
+
ghSafe.activeProcesses.set('test-process', mockChild);
|
|
327
|
+
|
|
328
|
+
await ghSafe.cleanup();
|
|
329
|
+
|
|
330
|
+
expect(mockChild.kill).toHaveBeenCalledWith('SIGTERM');
|
|
331
|
+
expect(ghSafe.activeProcesses.size).toBe(0);
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
describe('Factory Function', () => {
|
|
336
|
+
test('should create configured instance', () => {
|
|
337
|
+
const instance = createGitHubCliSafe({
|
|
338
|
+
timeout: 10000,
|
|
339
|
+
maxRetries: 5
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
expect(instance).toBeInstanceOf(GitHubCliSafe);
|
|
343
|
+
expect(instance.options.timeout).toBe(10000);
|
|
344
|
+
expect(instance.options.maxRetries).toBe(5);
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
describe('Singleton Instance', () => {
|
|
349
|
+
test('should provide default singleton', () => {
|
|
350
|
+
expect(githubCli).toBeInstanceOf(GitHubCliSafe);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
// Helper function to setup mock process behavior
|
|
355
|
+
function setupMockProcess(exitCode, stdout = '', stderr = '', neverComplete = false) {
|
|
356
|
+
let closeCallback, errorCallback;
|
|
357
|
+
let stdoutCallback, stderrCallback;
|
|
358
|
+
|
|
359
|
+
mockChild.on.mockImplementation((event, callback) => {
|
|
360
|
+
if (event === 'close') closeCallback = callback;
|
|
361
|
+
if (event === 'error') errorCallback = callback;
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
mockChild.stdout.on.mockImplementation((event, callback) => {
|
|
365
|
+
if (event === 'data') stdoutCallback = callback;
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
mockChild.stderr.on.mockImplementation((event, callback) => {
|
|
369
|
+
if (event === 'data') stderrCallback = callback;
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
// Simulate process execution
|
|
373
|
+
if (!neverComplete) {
|
|
374
|
+
setTimeout(() => {
|
|
375
|
+
if (stdoutCallback && stdout) stdoutCallback(Buffer.from(stdout));
|
|
376
|
+
if (stderrCallback && stderr) stderrCallback(Buffer.from(stderr));
|
|
377
|
+
if (closeCallback) closeCallback(exitCode);
|
|
378
|
+
}, 10);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
describe('Error Classes', () => {
|
|
384
|
+
test('GitHubCliError should contain proper details', () => {
|
|
385
|
+
const error = new GitHubCliError('Test error', 'TEST_CODE', { test: true });
|
|
386
|
+
|
|
387
|
+
expect(error.name).toBe('GitHubCliError');
|
|
388
|
+
expect(error.code).toBe('TEST_CODE');
|
|
389
|
+
expect(error.details).toEqual({ test: true });
|
|
390
|
+
expect(error.timestamp).toBeDefined();
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
test('GitHubCliTimeoutError should extend GitHubCliError', () => {
|
|
394
|
+
const error = new GitHubCliTimeoutError(5000, 'gh issue create');
|
|
395
|
+
|
|
396
|
+
expect(error).toBeInstanceOf(GitHubCliError);
|
|
397
|
+
expect(error.name).toBe('GitHubCliTimeoutError');
|
|
398
|
+
expect(error.code).toBe('TIMEOUT');
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
test('GitHubCliValidationError should contain field info', () => {
|
|
402
|
+
const error = new GitHubCliValidationError('Invalid field', 'testField', 'testValue');
|
|
403
|
+
|
|
404
|
+
expect(error.name).toBe('GitHubCliValidationError');
|
|
405
|
+
expect(error.details.field).toBe('testField');
|
|
406
|
+
expect(error.details.value).toBe('testValue');
|
|
407
|
+
});
|
|
408
|
+
});
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* DEPRECATED: Use github-cli-safety-wrapper.js instead
|
|
3
|
+
* This file is maintained for backward compatibility only
|
|
4
|
+
*
|
|
2
5
|
* Safe GitHub CLI command execution utilities
|
|
3
6
|
* Prevents shell injection and timeout issues with special characters
|
|
4
7
|
*/
|
|
5
8
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
GitHubCliSafe,
|
|
11
|
+
githubCli,
|
|
12
|
+
safeGhCommand as newSafeGhCommand
|
|
13
|
+
} from './github-cli-safety-wrapper.js';
|
|
11
14
|
|
|
12
15
|
/**
|
|
16
|
+
* @deprecated Use GitHubCliSafe class from github-cli-safety-wrapper.js
|
|
13
17
|
* Execute GitHub CLI command with safe body content handling
|
|
14
18
|
* @param {string} command - The gh command (e.g., 'issue comment')
|
|
15
19
|
* @param {string} target - Target (issue/PR number or repo)
|
|
@@ -18,36 +22,18 @@ import { spawn } from 'child_process';
|
|
|
18
22
|
* @returns {Promise<string>} - Command output
|
|
19
23
|
*/
|
|
20
24
|
export async function safeGhCommand(command, target, body, options = {}) {
|
|
21
|
-
|
|
25
|
+
console.warn('safeGhCommand is deprecated. Use GitHubCliSafe from github-cli-safety-wrapper.js');
|
|
22
26
|
|
|
23
27
|
try {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const args = command.split(' ');
|
|
29
|
-
args.push(target);
|
|
30
|
-
args.push('--body-file', tmpFile);
|
|
31
|
-
|
|
32
|
-
// Add any additional options
|
|
33
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
34
|
-
args.push(`--${key}`, value);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// Execute command with timeout
|
|
38
|
-
const result = await executeWithTimeout('gh', args, options.timeout || 30000);
|
|
39
|
-
return result;
|
|
40
|
-
} finally {
|
|
41
|
-
// Clean up temp file
|
|
42
|
-
try {
|
|
43
|
-
await fs.unlink(tmpFile);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
// Ignore cleanup errors
|
|
46
|
-
}
|
|
28
|
+
const result = await newSafeGhCommand(command, target, body, options);
|
|
29
|
+
return result.stdout;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
throw error;
|
|
47
32
|
}
|
|
48
33
|
}
|
|
49
34
|
|
|
50
35
|
/**
|
|
36
|
+
* @deprecated This function is deprecated and will be removed
|
|
51
37
|
* Execute command with timeout and proper cleanup
|
|
52
38
|
* @param {string} command - Command to execute
|
|
53
39
|
* @param {string[]} args - Command arguments
|
|
@@ -55,132 +41,64 @@ export async function safeGhCommand(command, target, body, options = {}) {
|
|
|
55
41
|
* @returns {Promise<string>} - Command output
|
|
56
42
|
*/
|
|
57
43
|
function executeWithTimeout(command, args, timeout) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
let stdout = '';
|
|
65
|
-
let stderr = '';
|
|
66
|
-
let timedOut = false;
|
|
67
|
-
|
|
68
|
-
// Set timeout
|
|
69
|
-
const timer = setTimeout(() => {
|
|
70
|
-
timedOut = true;
|
|
71
|
-
child.kill('SIGTERM');
|
|
72
|
-
setTimeout(() => child.kill('SIGKILL'), 5000); // Force kill after 5s
|
|
73
|
-
}, timeout);
|
|
74
|
-
|
|
75
|
-
child.stdout.on('data', (data) => {
|
|
76
|
-
stdout += data.toString();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
child.stderr.on('data', (data) => {
|
|
80
|
-
stderr += data.toString();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
child.on('close', (code) => {
|
|
84
|
-
clearTimeout(timer);
|
|
85
|
-
|
|
86
|
-
if (timedOut) {
|
|
87
|
-
reject(new Error(`Command timed out after ${timeout}ms`));
|
|
88
|
-
} else if (code !== 0) {
|
|
89
|
-
reject(new Error(`Command failed with exit code ${code}: ${stderr}`));
|
|
90
|
-
} else {
|
|
91
|
-
resolve(stdout.trim());
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
child.on('error', (err) => {
|
|
96
|
-
clearTimeout(timer);
|
|
97
|
-
reject(err);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
44
|
+
console.warn('executeWithTimeout is deprecated. Use GitHubCliSafe.executeWithTimeout instead');
|
|
45
|
+
|
|
46
|
+
// Forward to new implementation via GitHubCliSafe
|
|
47
|
+
const ghSafe = new GitHubCliSafe({ timeout });
|
|
48
|
+
return ghSafe.executeWithTimeout(command.replace('gh ', ''), args.slice(1), { timeout });
|
|
100
49
|
}
|
|
101
50
|
|
|
102
51
|
/**
|
|
52
|
+
* @deprecated Use gh object from github-cli-safety-wrapper.js
|
|
103
53
|
* Safe methods for common GitHub CLI operations
|
|
104
54
|
*/
|
|
105
55
|
export const gh = {
|
|
106
56
|
/**
|
|
57
|
+
* @deprecated Use githubCli.addIssueComment instead
|
|
107
58
|
* Create issue comment safely
|
|
108
59
|
* @param {number|string} issue - Issue number
|
|
109
60
|
* @param {string} body - Comment body
|
|
110
61
|
* @param {Object} options - Additional options
|
|
111
62
|
*/
|
|
112
63
|
async issueComment(issue, body, options = {}) {
|
|
113
|
-
|
|
64
|
+
console.warn('gh.issueComment is deprecated. Use githubCli.addIssueComment instead');
|
|
65
|
+
const result = await githubCli.addIssueComment(issue, body, options);
|
|
66
|
+
return result.stdout;
|
|
114
67
|
},
|
|
115
68
|
|
|
116
69
|
/**
|
|
70
|
+
* @deprecated Use githubCli.addPRComment instead
|
|
117
71
|
* Create PR comment safely
|
|
118
72
|
* @param {number|string} pr - PR number
|
|
119
73
|
* @param {string} body - Comment body
|
|
120
74
|
* @param {Object} options - Additional options
|
|
121
75
|
*/
|
|
122
76
|
async prComment(pr, body, options = {}) {
|
|
123
|
-
|
|
77
|
+
console.warn('gh.prComment is deprecated. Use githubCli.addPRComment instead');
|
|
78
|
+
const result = await githubCli.addPRComment(pr, body, options);
|
|
79
|
+
return result.stdout;
|
|
124
80
|
},
|
|
125
81
|
|
|
126
82
|
/**
|
|
83
|
+
* @deprecated Use githubCli.createIssue instead
|
|
127
84
|
* Create issue safely
|
|
128
85
|
* @param {Object} params - Issue parameters
|
|
129
86
|
*/
|
|
130
87
|
async createIssue({ title, body, labels = [], assignees = [] }) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
await fs.writeFile(tmpFile, body, 'utf8');
|
|
135
|
-
|
|
136
|
-
const args = ['issue', 'create', '--title', title, '--body-file', tmpFile];
|
|
137
|
-
|
|
138
|
-
if (labels.length > 0) {
|
|
139
|
-
args.push('--label', labels.join(','));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (assignees.length > 0) {
|
|
143
|
-
args.push('--assignee', assignees.join(','));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return await executeWithTimeout('gh', args, 30000);
|
|
147
|
-
} finally {
|
|
148
|
-
try {
|
|
149
|
-
await fs.unlink(tmpFile);
|
|
150
|
-
} catch (err) {
|
|
151
|
-
// Ignore cleanup errors
|
|
152
|
-
}
|
|
153
|
-
}
|
|
88
|
+
console.warn('gh.createIssue is deprecated. Use githubCli.createIssue instead');
|
|
89
|
+
const result = await githubCli.createIssue({ title, body, labels, assignees });
|
|
90
|
+
return result.stdout;
|
|
154
91
|
},
|
|
155
92
|
|
|
156
93
|
/**
|
|
94
|
+
* @deprecated Use githubCli.createPR instead
|
|
157
95
|
* Create PR safely
|
|
158
96
|
* @param {Object} params - PR parameters
|
|
159
97
|
*/
|
|
160
98
|
async createPR({ title, body, base = 'main', head, draft = false }) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
await fs.writeFile(tmpFile, body, 'utf8');
|
|
165
|
-
|
|
166
|
-
const args = ['pr', 'create', '--title', title, '--body-file', tmpFile, '--base', base];
|
|
167
|
-
|
|
168
|
-
if (head) {
|
|
169
|
-
args.push('--head', head);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (draft) {
|
|
173
|
-
args.push('--draft');
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return await executeWithTimeout('gh', args, 30000);
|
|
177
|
-
} finally {
|
|
178
|
-
try {
|
|
179
|
-
await fs.unlink(tmpFile);
|
|
180
|
-
} catch (err) {
|
|
181
|
-
// Ignore cleanup errors
|
|
182
|
-
}
|
|
183
|
-
}
|
|
99
|
+
console.warn('gh.createPR is deprecated. Use githubCli.createPR instead');
|
|
100
|
+
const result = await githubCli.createPR({ title, body, base, head, draft });
|
|
101
|
+
return result.stdout;
|
|
184
102
|
}
|
|
185
103
|
};
|
|
186
104
|
|