stigmergy 1.2.0 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +18 -18
  2. package/README.md +28 -223
  3. package/STIGMERGY.md +61 -61
  4. package/docs/PROJECT_CONSTITUTION.md +433 -433
  5. package/docs/PROJECT_STRUCTURE_CURRENT.md +80 -80
  6. package/examples/calculator-example.js +72 -72
  7. package/examples/cline_usage_examples.md +364 -364
  8. package/examples/encryption-example.js +67 -67
  9. package/examples/json-parser-example.js +120 -120
  10. package/examples/json-validation-example.js +64 -64
  11. package/examples/rest-client-example.js +52 -52
  12. package/examples/rest_client_example.js +54 -54
  13. package/package.json +36 -15
  14. package/scripts/build.js +74 -74
  15. package/scripts/post-deployment-config.js +296 -296
  16. package/scripts/preinstall-check.js +173 -173
  17. package/scripts/publish.js +58 -268
  18. package/scripts/run-layered-tests.js +247 -0
  19. package/scripts/safe-install.js +139 -139
  20. package/scripts/simple-publish.js +57 -59
  21. package/src/adapters/claude/install_claude_integration.js +292 -0
  22. package/src/adapters/codebuddy/install_codebuddy_integration.js +349 -0
  23. package/src/adapters/codex/install_codex_integration.js +395 -0
  24. package/src/adapters/copilot/install_copilot_integration.js +716 -0
  25. package/src/adapters/gemini/install_gemini_integration.js +304 -0
  26. package/src/adapters/iflow/install_iflow_integration.js +304 -0
  27. package/src/adapters/qoder/install_qoder_integration.js +1090 -0
  28. package/src/adapters/qwen/install_qwen_integration.js +285 -0
  29. package/src/auth.js +173 -173
  30. package/src/auth_command.js +208 -208
  31. package/src/calculator.js +313 -313
  32. package/src/cli/router.js +417 -38
  33. package/src/core/cache_cleaner.js +767 -744
  34. package/src/core/cli_help_analyzer.js +680 -674
  35. package/src/core/cli_parameter_handler.js +132 -127
  36. package/src/core/cli_tools.js +89 -89
  37. package/src/core/coordination/index.js +16 -16
  38. package/src/core/coordination/nodejs/AdapterManager.js +102 -89
  39. package/src/core/coordination/nodejs/CLCommunication.js +132 -124
  40. package/src/core/coordination/nodejs/CLIIntegrationManager.js +272 -236
  41. package/src/core/coordination/nodejs/HealthChecker.js +76 -77
  42. package/src/core/coordination/nodejs/HookDeploymentManager.js +263 -190
  43. package/src/core/coordination/nodejs/StatisticsCollector.js +71 -71
  44. package/src/core/coordination/nodejs/index.js +90 -72
  45. package/src/core/coordination/nodejs/utils/Logger.js +29 -29
  46. package/src/core/enhanced_installer.js +479 -456
  47. package/src/core/enhanced_uninstaller.js +638 -618
  48. package/src/core/error_handler.js +406 -406
  49. package/src/core/installer.js +815 -294
  50. package/src/core/memory_manager.js +83 -83
  51. package/src/core/rest_client.js +160 -160
  52. package/src/core/smart_router.js +249 -146
  53. package/src/core/upgrade_manager.js +76 -59
  54. package/src/data_encryption.js +143 -143
  55. package/src/data_structures.js +440 -440
  56. package/src/deploy.js +55 -55
  57. package/src/index.js +30 -30
  58. package/src/test/cli-availability-checker.js +194 -0
  59. package/src/test/test-environment.js +289 -0
  60. package/src/utils/helpers.js +35 -35
  61. package/src/utils.js +921 -915
  62. package/src/weatherProcessor.js +228 -228
  63. package/test/cache-cleaner-implemented.test.js +0 -328
  64. package/test/cache-cleaner.test.js +0 -390
  65. package/test/calculator.test.js +0 -215
  66. package/test/collision-test.js +0 -26
  67. package/test/comprehensive-enhanced-features.test.js +0 -252
  68. package/test/comprehensive-execution-test.js +0 -428
  69. package/test/conflict-prevention-test.js +0 -95
  70. package/test/cross-cli-detection-test.js +0 -33
  71. package/test/csv-processing-test.js +0 -36
  72. package/test/deploy-hooks-test.js +0 -250
  73. package/test/e2e/claude-cli-test.js +0 -128
  74. package/test/e2e/collaboration-test.js +0 -75
  75. package/test/e2e/comprehensive-test.js +0 -431
  76. package/test/e2e/error-handling-test.js +0 -90
  77. package/test/e2e/individual-tool-test.js +0 -143
  78. package/test/e2e/other-cli-test.js +0 -130
  79. package/test/e2e/qoder-cli-test.js +0 -128
  80. package/test/e2e/run-e2e-tests.js +0 -73
  81. package/test/e2e/test-data.js +0 -88
  82. package/test/e2e/test-utils.js +0 -222
  83. package/test/encryption-simple-test.js +0 -110
  84. package/test/encryption.test.js +0 -129
  85. package/test/enhanced-main-alignment.test.js +0 -298
  86. package/test/enhanced-uninstaller-implemented.test.js +0 -271
  87. package/test/enhanced-uninstaller.test.js +0 -284
  88. package/test/error-handling-test.js +0 -341
  89. package/test/fibonacci.test.js +0 -178
  90. package/test/final-deploy-test.js +0 -221
  91. package/test/final-install-test.js +0 -226
  92. package/test/hash-table-demo.js +0 -33
  93. package/test/hash-table-test.js +0 -26
  94. package/test/hash_table_test.js +0 -114
  95. package/test/hook-system-integration-test.js +0 -307
  96. package/test/iflow-integration-test.js +0 -292
  97. package/test/improved-install-test.js +0 -362
  98. package/test/install-command-test.js +0 -370
  99. package/test/json-parser-test.js +0 -161
  100. package/test/json-validation-test.js +0 -164
  101. package/test/natural-language-skills-test.js +0 -320
  102. package/test/nl-integration-test.js +0 -179
  103. package/test/parameter-parsing-test.js +0 -143
  104. package/test/plugin-deployment-test.js +0 -316
  105. package/test/postinstall-test.js +0 -269
  106. package/test/python-plugins-test.js +0 -259
  107. package/test/real-test.js +0 -435
  108. package/test/remaining-adapters-test.js +0 -256
  109. package/test/rest-client-test.js +0 -56
  110. package/test/rest_client.test.js +0 -85
  111. package/test/safe-installation-cleaner.test.js +0 -343
  112. package/test/simple-iflow-hook-test.js +0 -137
  113. package/test/stigmergy-upgrade-test.js +0 -243
  114. package/test/system-compatibility-test.js +0 -467
  115. package/test/tdd-deploy-fix-test.js +0 -324
  116. package/test/tdd-fixes-test.js +0 -211
  117. package/test/third-party-skills-test.js +0 -321
  118. package/test/tool-selection-integration-test.js +0 -158
  119. package/test/unit/calculator-full.test.js +0 -191
  120. package/test/unit/calculator-simple.test.js +0 -96
  121. package/test/unit/calculator.test.js +0 -97
  122. package/test/unit/cli-scanner.test.js +0 -291
  123. package/test/unit/cli_parameter_handler.test.js +0 -116
  124. package/test/unit/cross-cli-executor.test.js +0 -399
  125. package/test/weather-processor.test.js +0 -104
@@ -1,127 +1,132 @@
1
- // Unified CLI Parameter Handler
2
- const { spawn } = require('child_process');
3
-
4
- class CLIParameterHandler {
5
- /**
6
- * Generate appropriate arguments for CLI execution based on tool patterns
7
- * @param {string} toolName - Name of the CLI tool
8
- * @param {string} prompt - User prompt
9
- * @param {Object} cliPattern - CLI pattern information from analyzer
10
- * @returns {Array} Arguments array for spawn
11
- */
12
- static generateArguments(toolName, prompt, cliPattern) {
13
- // Default arguments
14
- let toolArgs = [];
15
-
16
- // Special handling for Codex CLI which always needs 'exec' subcommand
17
- if (toolName === 'codex') {
18
- return ['exec', '-p', `"${prompt}"`];
19
- }
20
-
21
- try {
22
- // Check if we have pattern information from CLI help analyzer
23
- if (cliPattern && cliPattern.commandStructure) {
24
- const commandStructure = cliPattern.commandStructure;
25
-
26
- // Handle based on command structure and patterns from help analyzer
27
- if (commandStructure.nonInteractiveSupport) {
28
- // Use flag-based approach if available
29
- if (commandStructure.promptFlag) {
30
- toolArgs = [commandStructure.promptFlag, `"${prompt}"`];
31
- } else if (commandStructure.nonInteractiveFlag) {
32
- toolArgs = [commandStructure.nonInteractiveFlag, `"${prompt}"`];
33
- } else {
34
- // Fallback to standard -p flag
35
- toolArgs = ['-p', `"${prompt}"`];
36
- }
37
- } else if (commandStructure.executionPattern === 'flag-based') {
38
- // Explicitly flag-based tools
39
- if (commandStructure.promptFlag) {
40
- toolArgs = [commandStructure.promptFlag, `"${prompt}"`];
41
- } else {
42
- toolArgs = ['-p', `"${prompt}"`];
43
- }
44
- } else if (commandStructure.executionPattern === 'argument-based') {
45
- // Argument-based tools
46
- toolArgs = [`"${prompt}"`];
47
- } else if (commandStructure.executionPattern === 'subcommand-based') {
48
- // Subcommand-based tools
49
- toolArgs = ['-p', `"${prompt}"`];
50
- } else {
51
- // Fallback to tool-specific handling
52
- toolArgs = this.getToolSpecificArguments(toolName, prompt);
53
- }
54
- } else {
55
- // Fallback to tool-specific handling if no pattern information
56
- toolArgs = this.getToolSpecificArguments(toolName, prompt);
57
- }
58
- } catch (error) {
59
- // Final fallback to tool-specific handling
60
- toolArgs = this.getToolSpecificArguments(toolName, prompt);
61
- }
62
-
63
- return toolArgs;
64
- }
65
-
66
- /**
67
- * Get tool-specific arguments based on known patterns
68
- * @param {string} toolName - Name of the CLI tool
69
- * @param {string} prompt - User prompt
70
- * @returns {Array} Arguments array for spawn
71
- */
72
- static getToolSpecificArguments(toolName, prompt) {
73
- // Tool-specific argument handling
74
- const toolSpecificArgs = {
75
- claude: ['-p', `"${prompt}"`],
76
- qodercli: ['-p', `"${prompt}"`],
77
- iflow: ['-p', `"${prompt}"`],
78
- codebuddy: ['-p', `"${prompt}"`],
79
- copilot: ['-p', `"${prompt}"`],
80
- codex: ['exec', '-p', `"${prompt}"`], // Codex needs 'exec' subcommand
81
- };
82
-
83
- // Return tool-specific arguments if available
84
- if (toolSpecificArgs[toolName]) {
85
- return toolSpecificArgs[toolName];
86
- }
87
-
88
- // Default handling for other tools
89
- // Check if the tool commonly uses -p flag
90
- const toolsWithPFlag = [
91
- 'claude',
92
- 'qodercli',
93
- 'iflow',
94
- 'codebuddy',
95
- 'copilot',
96
- ];
97
- if (toolsWithPFlag.includes(toolName)) {
98
- return ['-p', `"${prompt}"`];
99
- }
100
-
101
- // Default to argument-based approach
102
- return [`"${prompt}"`];
103
- }
104
-
105
- /**
106
- * Execute CLI tool with appropriate arguments
107
- * @param {string} toolPath - Path to the CLI tool
108
- * @param {string} toolName - Name of the CLI tool
109
- * @param {string} prompt - User prompt
110
- * @param {Object} cliPattern - CLI pattern information from analyzer
111
- * @returns {Object} Child process object
112
- */
113
- static executeCLI(toolPath, toolName, prompt, cliPattern) {
114
- // Generate appropriate arguments
115
- const toolArgs = this.generateArguments(toolName, prompt, cliPattern);
116
-
117
- // Execute the tool
118
- const child = spawn(toolPath, toolArgs, {
119
- stdio: 'inherit',
120
- shell: true,
121
- });
122
-
123
- return child;
124
- }
125
- }
126
-
127
- module.exports = CLIParameterHandler;
1
+ // Unified CLI Parameter Handler
2
+ const { spawn } = require('child_process');
3
+
4
+ class CLIParameterHandler {
5
+ /**
6
+ * Generate appropriate arguments for CLI execution based on tool patterns
7
+ * @param {string} toolName - Name of the CLI tool
8
+ * @param {string} prompt - User prompt
9
+ * @param {Object} cliPattern - CLI pattern information from analyzer
10
+ * @returns {Array} Arguments array for spawn
11
+ */
12
+ static generateArguments(toolName, prompt, cliPattern) {
13
+ // Default arguments
14
+ let toolArgs = [];
15
+
16
+ // Special handling for Codex CLI which always needs 'exec' subcommand
17
+ if (toolName === 'codex') {
18
+ return ['exec', '-p', `"${prompt}"`];
19
+ }
20
+
21
+ try {
22
+ // Check if we have pattern information from CLI help analyzer
23
+ if (cliPattern && cliPattern.commandStructure) {
24
+ const commandStructure = cliPattern.commandStructure;
25
+
26
+ // Handle based on command structure and patterns from help analyzer
27
+ if (commandStructure.nonInteractiveSupport) {
28
+ // Use flag-based approach if available
29
+ if (commandStructure.promptFlag) {
30
+ toolArgs = [commandStructure.promptFlag, `"${prompt}"`];
31
+ } else if (commandStructure.nonInteractiveFlag) {
32
+ toolArgs = [commandStructure.nonInteractiveFlag, `"${prompt}"`];
33
+ } else {
34
+ // Fallback to standard -p flag
35
+ toolArgs = ['-p', `"${prompt}"`];
36
+ }
37
+ } else if (commandStructure.executionPattern === 'flag-based') {
38
+ // Explicitly flag-based tools
39
+ if (commandStructure.promptFlag) {
40
+ toolArgs = [commandStructure.promptFlag, `"${prompt}"`];
41
+ } else {
42
+ toolArgs = ['-p', `"${prompt}"`];
43
+ }
44
+ } else if (commandStructure.executionPattern === 'argument-based') {
45
+ // Argument-based tools
46
+ toolArgs = [`"${prompt}"`];
47
+ } else if (commandStructure.executionPattern === 'subcommand-based') {
48
+ // Subcommand-based tools
49
+ toolArgs = ['-p', `"${prompt}"`];
50
+ } else {
51
+ // Fallback to tool-specific handling
52
+ toolArgs = this.getToolSpecificArguments(toolName, prompt);
53
+ }
54
+ } else {
55
+ // Fallback to tool-specific handling if no pattern information
56
+ toolArgs = this.getToolSpecificArguments(toolName, prompt);
57
+ }
58
+ } catch (error) {
59
+ // Final fallback to tool-specific handling
60
+ toolArgs = this.getToolSpecificArguments(toolName, prompt);
61
+ }
62
+
63
+ // Add debug logging to trace parameter generation
64
+ console.log(`[DEBUG] Parameter generation for ${toolName}:`);
65
+ console.log(`[DEBUG] Prompt: ${prompt}`);
66
+ console.log(`[DEBUG] Generated args: ${JSON.stringify(toolArgs)}`);
67
+
68
+ return toolArgs;
69
+ }
70
+
71
+ /**
72
+ * Get tool-specific arguments based on known patterns
73
+ * @param {string} toolName - Name of the CLI tool
74
+ * @param {string} prompt - User prompt
75
+ * @returns {Array} Arguments array for spawn
76
+ */
77
+ static getToolSpecificArguments(toolName, prompt) {
78
+ // Tool-specific argument handling
79
+ const toolSpecificArgs = {
80
+ claude: ['-p', `"${prompt}"`],
81
+ qodercli: ['-p', `"${prompt}"`],
82
+ iflow: ['-p', `"${prompt}"`],
83
+ codebuddy: ['-p', `"${prompt}"`],
84
+ copilot: ['-p', `"${prompt}"`],
85
+ codex: ['exec', '-p', `"${prompt}"`], // Codex needs 'exec' subcommand
86
+ };
87
+
88
+ // Return tool-specific arguments if available
89
+ if (toolSpecificArgs[toolName]) {
90
+ return toolSpecificArgs[toolName];
91
+ }
92
+
93
+ // Default handling for other tools
94
+ // Check if the tool commonly uses -p flag
95
+ const toolsWithPFlag = [
96
+ 'claude',
97
+ 'qodercli',
98
+ 'iflow',
99
+ 'codebuddy',
100
+ 'copilot',
101
+ ];
102
+ if (toolsWithPFlag.includes(toolName)) {
103
+ return ['-p', `"${prompt}"`];
104
+ }
105
+
106
+ // Default to argument-based approach
107
+ return [`"${prompt}"`];
108
+ }
109
+
110
+ /**
111
+ * Execute CLI tool with appropriate arguments
112
+ * @param {string} toolPath - Path to the CLI tool
113
+ * @param {string} toolName - Name of the CLI tool
114
+ * @param {string} prompt - User prompt
115
+ * @param {Object} cliPattern - CLI pattern information from analyzer
116
+ * @returns {Object} Child process object
117
+ */
118
+ static executeCLI(toolPath, toolName, prompt, cliPattern) {
119
+ // Generate appropriate arguments
120
+ const toolArgs = this.generateArguments(toolName, prompt, cliPattern);
121
+
122
+ // Execute the tool
123
+ const child = spawn(toolPath, toolArgs, {
124
+ stdio: 'inherit',
125
+ shell: true,
126
+ });
127
+
128
+ return child;
129
+ }
130
+ }
131
+
132
+ module.exports = CLIParameterHandler;
@@ -1,89 +1,89 @@
1
- const path = require('path');
2
- const os = require('os');
3
- const { errorHandler, ERROR_TYPES } = require('./error_handler');
4
-
5
- // AI CLI Tools Configuration
6
- const CLI_TOOLS = {
7
- claude: {
8
- name: 'Claude CLI',
9
- version: 'claude --version',
10
- install: 'npm install -g @anthropic-ai/claude-cli',
11
- hooksDir: path.join(os.homedir(), '.claude', 'hooks'),
12
- config: path.join(os.homedir(), '.claude', 'config.json'),
13
- },
14
- gemini: {
15
- name: 'Gemini CLI',
16
- version: 'gemini --version',
17
- install: 'npm install -g @google/generative-ai-cli',
18
- hooksDir: path.join(os.homedir(), '.gemini', 'extensions'),
19
- config: path.join(os.homedir(), '.gemini', 'config.json'),
20
- },
21
- qwen: {
22
- name: 'Qwen CLI',
23
- version: 'qwen --version',
24
- install: 'npm install -g @qwen-code/qwen-code',
25
- hooksDir: path.join(os.homedir(), '.qwen', 'hooks'),
26
- config: path.join(os.homedir(), '.qwen', 'config.json'),
27
- },
28
- iflow: {
29
- name: 'iFlow CLI',
30
- version: 'iflow --version',
31
- install: 'npm install -g iflow-cli',
32
- hooksDir: path.join(os.homedir(), '.iflow', 'hooks'),
33
- config: path.join(os.homedir(), '.iflow', 'config.json'),
34
- },
35
- qodercli: {
36
- name: 'Qoder CLI',
37
- version: 'qodercli --version',
38
- install: 'npm install -g @qoder-ai/qodercli',
39
- hooksDir: path.join(os.homedir(), '.qoder', 'hooks'),
40
- config: path.join(os.homedir(), '.qoder', 'config.json'),
41
- },
42
- codebuddy: {
43
- name: 'CodeBuddy CLI',
44
- version: 'codebuddy --version',
45
- install: 'npm install -g codebuddy-cli',
46
- hooksDir: path.join(os.homedir(), '.codebuddy', 'hooks'),
47
- config: path.join(os.homedir(), '.codebuddy', 'config.json'),
48
- },
49
- copilot: {
50
- name: 'GitHub Copilot CLI',
51
- version: 'copilot --version',
52
- install: 'npm install -g @github/copilot-cli',
53
- hooksDir: path.join(os.homedir(), '.copilot', 'mcp'),
54
- config: path.join(os.homedir(), '.copilot', 'config.json'),
55
- },
56
- codex: {
57
- name: 'OpenAI Codex CLI',
58
- version: 'codex --version',
59
- install: 'npm install -g openai-codex-cli',
60
- hooksDir: path.join(os.homedir(), '.config', 'codex', 'slash_commands'),
61
- config: path.join(os.homedir(), '.codex', 'config.json'),
62
- },
63
- };
64
-
65
- /**
66
- * Validate CLI tool configuration
67
- * @param {string} toolName - Name of the tool to validate
68
- * @throws {StigmergyError} If validation fails
69
- */
70
- function validateCLITool(toolName) {
71
- if (!CLI_TOOLS[toolName]) {
72
- throw errorHandler.createError(
73
- `CLI tool '${toolName}' is not configured`,
74
- ERROR_TYPES.CONFIGURATION,
75
- 'INVALID_CLI_TOOL',
76
- );
77
- }
78
-
79
- const tool = CLI_TOOLS[toolName];
80
- if (!tool.name || !tool.version || !tool.install) {
81
- throw errorHandler.createError(
82
- `CLI tool '${toolName}' has invalid configuration`,
83
- ERROR_TYPES.CONFIGURATION,
84
- 'INCOMPLETE_CLI_CONFIG',
85
- );
86
- }
87
- }
88
-
89
- module.exports = { CLI_TOOLS, validateCLITool };
1
+ const path = require('path');
2
+ const os = require('os');
3
+ const { errorHandler, ERROR_TYPES } = require('./error_handler');
4
+
5
+ // AI CLI Tools Configuration
6
+ const CLI_TOOLS = {
7
+ claude: {
8
+ name: 'Claude CLI',
9
+ version: 'claude --version',
10
+ install: 'npm install -g @anthropic-ai/claude-cli',
11
+ hooksDir: path.join(os.homedir(), '.claude', 'hooks'),
12
+ config: path.join(os.homedir(), '.claude', 'config.json'),
13
+ },
14
+ gemini: {
15
+ name: 'Gemini CLI',
16
+ version: 'gemini --version',
17
+ install: 'npm install -g @google/generative-ai-cli',
18
+ hooksDir: path.join(os.homedir(), '.gemini', 'extensions'),
19
+ config: path.join(os.homedir(), '.gemini', 'config.json'),
20
+ },
21
+ qwen: {
22
+ name: 'Qwen CLI',
23
+ version: 'qwen --version',
24
+ install: 'npm install -g @qwen-code/qwen-code',
25
+ hooksDir: path.join(os.homedir(), '.qwen', 'hooks'),
26
+ config: path.join(os.homedir(), '.qwen', 'config.json'),
27
+ },
28
+ iflow: {
29
+ name: 'iFlow CLI',
30
+ version: 'iflow --version',
31
+ install: 'npm install -g iflow-cli',
32
+ hooksDir: path.join(os.homedir(), '.iflow', 'hooks'),
33
+ config: path.join(os.homedir(), '.iflow', 'config.json'),
34
+ },
35
+ qodercli: {
36
+ name: 'Qoder CLI',
37
+ version: 'qodercli --version',
38
+ install: 'npm install -g @qoder-ai/qodercli',
39
+ hooksDir: path.join(os.homedir(), '.qoder', 'hooks'),
40
+ config: path.join(os.homedir(), '.qoder', 'config.json'),
41
+ },
42
+ codebuddy: {
43
+ name: 'CodeBuddy CLI',
44
+ version: 'codebuddy --version',
45
+ install: 'npm install -g codebuddy-cli',
46
+ hooksDir: path.join(os.homedir(), '.codebuddy', 'hooks'),
47
+ config: path.join(os.homedir(), '.codebuddy', 'config.json'),
48
+ },
49
+ copilot: {
50
+ name: 'GitHub Copilot CLI',
51
+ version: 'copilot --version',
52
+ install: 'npm install -g @github/copilot-cli',
53
+ hooksDir: path.join(os.homedir(), '.copilot', 'mcp'),
54
+ config: path.join(os.homedir(), '.copilot', 'config.json'),
55
+ },
56
+ codex: {
57
+ name: 'OpenAI Codex CLI',
58
+ version: 'codex --version',
59
+ install: 'npm install -g openai-codex-cli',
60
+ hooksDir: path.join(os.homedir(), '.config', 'codex', 'slash_commands'),
61
+ config: path.join(os.homedir(), '.codex', 'config.json'),
62
+ },
63
+ };
64
+
65
+ /**
66
+ * Validate CLI tool configuration
67
+ * @param {string} toolName - Name of the tool to validate
68
+ * @throws {StigmergyError} If validation fails
69
+ */
70
+ function validateCLITool(toolName) {
71
+ if (!CLI_TOOLS[toolName]) {
72
+ throw errorHandler.createError(
73
+ `CLI tool '${toolName}' is not configured`,
74
+ ERROR_TYPES.CONFIGURATION,
75
+ 'INVALID_CLI_TOOL',
76
+ );
77
+ }
78
+
79
+ const tool = CLI_TOOLS[toolName];
80
+ if (!tool.name || !tool.version || !tool.install) {
81
+ throw errorHandler.createError(
82
+ `CLI tool '${toolName}' has invalid configuration`,
83
+ ERROR_TYPES.CONFIGURATION,
84
+ 'INCOMPLETE_CLI_CONFIG',
85
+ );
86
+ }
87
+ }
88
+
89
+ module.exports = { CLI_TOOLS, validateCLITool };
@@ -1,16 +1,16 @@
1
- // Update main coordination layer to include Node.js components
2
- // src/core/coordination/index.js
3
-
4
- // Existing content would be here...
5
-
6
- // Add Node.js coordination layer exports
7
- const NodeJsCoordinationLayer = require('./nodejs');
8
- const HookDeploymentManager = require('./nodejs/HookDeploymentManager');
9
- const CLIIntegrationManager = require('./nodejs/CLIIntegrationManager');
10
-
11
- module.exports = {
12
- // Existing exports...
13
- NodeJsCoordinationLayer,
14
- HookDeploymentManager,
15
- CLIIntegrationManager
16
- };
1
+ // Update main coordination layer to include Node.js components
2
+ // src/core/coordination/index.js
3
+
4
+ // Existing content would be here...
5
+
6
+ // Add Node.js coordination layer exports
7
+ const NodeJsCoordinationLayer = require('./nodejs');
8
+ const HookDeploymentManager = require('./nodejs/HookDeploymentManager');
9
+ const CLIIntegrationManager = require('./nodejs/CLIIntegrationManager');
10
+
11
+ module.exports = {
12
+ // Existing exports...
13
+ NodeJsCoordinationLayer,
14
+ HookDeploymentManager,
15
+ CLIIntegrationManager,
16
+ };