@agents-at-scale/ark 0.1.35 → 0.1.36-rc1

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 (223) hide show
  1. package/dist/arkServices.d.ts +42 -0
  2. package/dist/arkServices.js +138 -0
  3. package/dist/arkServices.spec.d.ts +1 -0
  4. package/dist/arkServices.spec.js +24 -0
  5. package/dist/charts/charts.d.ts +5 -0
  6. package/dist/charts/charts.js +6 -0
  7. package/dist/charts/dependencies.d.ts +6 -0
  8. package/dist/charts/dependencies.js +50 -0
  9. package/dist/charts/types.d.ts +40 -0
  10. package/dist/charts/types.js +1 -0
  11. package/dist/commands/agents/index.d.ts +3 -0
  12. package/dist/commands/agents/index.js +65 -0
  13. package/dist/commands/agents/index.spec.d.ts +1 -0
  14. package/dist/commands/agents/index.spec.js +67 -0
  15. package/dist/commands/agents/selector.d.ts +8 -0
  16. package/dist/commands/agents/selector.js +53 -0
  17. package/dist/commands/agents.d.ts +2 -0
  18. package/dist/commands/agents.js +53 -0
  19. package/dist/commands/chat/index.d.ts +3 -0
  20. package/dist/commands/chat/index.js +29 -0
  21. package/dist/commands/chat.d.ts +2 -0
  22. package/dist/commands/chat.js +45 -0
  23. package/dist/commands/cluster/get.d.ts +2 -0
  24. package/dist/commands/cluster/get.js +39 -0
  25. package/dist/commands/cluster/get.spec.d.ts +1 -0
  26. package/dist/commands/cluster/get.spec.js +92 -0
  27. package/dist/commands/cluster/index.d.ts +2 -1
  28. package/dist/commands/cluster/index.js +3 -5
  29. package/dist/commands/cluster/index.spec.d.ts +1 -0
  30. package/dist/commands/cluster/index.spec.js +24 -0
  31. package/dist/commands/completion/index.d.ts +3 -0
  32. package/dist/commands/completion/index.js +230 -0
  33. package/dist/commands/completion/index.spec.d.ts +1 -0
  34. package/dist/commands/completion/index.spec.js +34 -0
  35. package/dist/commands/completion.js +159 -2
  36. package/dist/commands/config/index.d.ts +3 -0
  37. package/dist/commands/config/index.js +42 -0
  38. package/dist/commands/config/index.spec.d.ts +1 -0
  39. package/dist/commands/config/index.spec.js +78 -0
  40. package/dist/commands/config.d.ts +0 -3
  41. package/dist/commands/config.js +38 -321
  42. package/dist/commands/dashboard/index.d.ts +4 -0
  43. package/dist/commands/dashboard/index.js +39 -0
  44. package/dist/commands/dashboard.d.ts +3 -0
  45. package/dist/commands/dashboard.js +39 -0
  46. package/dist/commands/dev/index.d.ts +3 -0
  47. package/dist/commands/dev/index.js +9 -0
  48. package/dist/commands/dev/tool/check.d.ts +2 -0
  49. package/dist/commands/dev/tool/check.js +142 -0
  50. package/dist/commands/dev/tool/clean.d.ts +2 -0
  51. package/dist/commands/dev/tool/clean.js +153 -0
  52. package/dist/commands/dev/tool/generate.d.ts +2 -0
  53. package/dist/commands/dev/tool/generate.js +28 -0
  54. package/dist/commands/dev/tool/index.d.ts +2 -0
  55. package/dist/commands/dev/tool/index.js +14 -0
  56. package/dist/commands/dev/tool/init.d.ts +2 -0
  57. package/dist/commands/dev/tool/init.js +320 -0
  58. package/dist/commands/dev/tool/shared.d.ts +5 -0
  59. package/dist/commands/dev/tool/shared.js +258 -0
  60. package/dist/commands/dev/tool/status.d.ts +2 -0
  61. package/dist/commands/dev/tool/status.js +136 -0
  62. package/dist/commands/dev/tool-generate.spec.d.ts +1 -0
  63. package/dist/commands/dev/tool-generate.spec.js +163 -0
  64. package/dist/commands/dev/tool.d.ts +2 -0
  65. package/dist/commands/dev/tool.js +559 -0
  66. package/dist/commands/dev/tool.spec.d.ts +1 -0
  67. package/dist/commands/dev/tool.spec.js +48 -0
  68. package/dist/commands/docs/index.d.ts +4 -0
  69. package/dist/commands/docs/index.js +18 -0
  70. package/dist/commands/generate/config.js +5 -24
  71. package/dist/commands/generate/generators/mcpserver.d.ts +2 -1
  72. package/dist/commands/generate/generators/mcpserver.js +26 -5
  73. package/dist/commands/generate/generators/project.js +22 -41
  74. package/dist/commands/generate/index.d.ts +2 -1
  75. package/dist/commands/generate/index.js +1 -1
  76. package/dist/commands/install/index.d.ts +8 -0
  77. package/dist/commands/install/index.js +295 -0
  78. package/dist/commands/install/index.spec.d.ts +1 -0
  79. package/dist/commands/install/index.spec.js +143 -0
  80. package/dist/commands/install.d.ts +3 -0
  81. package/dist/commands/install.js +147 -0
  82. package/dist/commands/models/create.d.ts +1 -0
  83. package/dist/commands/models/create.js +213 -0
  84. package/dist/commands/models/create.spec.d.ts +1 -0
  85. package/dist/commands/models/create.spec.js +125 -0
  86. package/dist/commands/models/index.d.ts +3 -0
  87. package/dist/commands/models/index.js +75 -0
  88. package/dist/commands/models/index.spec.d.ts +1 -0
  89. package/dist/commands/models/index.spec.js +96 -0
  90. package/dist/commands/models/selector.d.ts +8 -0
  91. package/dist/commands/models/selector.js +53 -0
  92. package/dist/commands/query/index.d.ts +3 -0
  93. package/dist/commands/query/index.js +24 -0
  94. package/dist/commands/query/index.spec.d.ts +1 -0
  95. package/dist/commands/query/index.spec.js +53 -0
  96. package/dist/commands/routes/index.d.ts +3 -0
  97. package/dist/commands/routes/index.js +93 -0
  98. package/dist/commands/routes.d.ts +2 -0
  99. package/dist/commands/routes.js +101 -0
  100. package/dist/commands/status/index.d.ts +3 -0
  101. package/dist/commands/status/index.js +281 -0
  102. package/dist/commands/status.d.ts +3 -0
  103. package/dist/commands/status.js +33 -0
  104. package/dist/commands/targets/index.d.ts +3 -0
  105. package/dist/commands/targets/index.js +72 -0
  106. package/dist/commands/targets/index.spec.d.ts +1 -0
  107. package/dist/commands/targets/index.spec.js +154 -0
  108. package/dist/commands/targets.d.ts +2 -0
  109. package/dist/commands/targets.js +65 -0
  110. package/dist/commands/teams/index.d.ts +3 -0
  111. package/dist/commands/teams/index.js +64 -0
  112. package/dist/commands/teams/index.spec.d.ts +1 -0
  113. package/dist/commands/teams/index.spec.js +70 -0
  114. package/dist/commands/teams/selector.d.ts +8 -0
  115. package/dist/commands/teams/selector.js +55 -0
  116. package/dist/commands/tools/index.d.ts +3 -0
  117. package/dist/commands/tools/index.js +49 -0
  118. package/dist/commands/tools/index.spec.d.ts +1 -0
  119. package/dist/commands/tools/index.spec.js +70 -0
  120. package/dist/commands/tools/selector.d.ts +8 -0
  121. package/dist/commands/tools/selector.js +53 -0
  122. package/dist/commands/uninstall/index.d.ts +3 -0
  123. package/dist/commands/uninstall/index.js +101 -0
  124. package/dist/commands/uninstall/index.spec.d.ts +1 -0
  125. package/dist/commands/uninstall/index.spec.js +125 -0
  126. package/dist/commands/uninstall.d.ts +2 -0
  127. package/dist/commands/uninstall.js +83 -0
  128. package/dist/components/ChatUI.d.ts +16 -0
  129. package/dist/components/ChatUI.js +801 -0
  130. package/dist/components/StatusView.d.ts +10 -0
  131. package/dist/components/StatusView.js +39 -0
  132. package/dist/components/statusChecker.d.ts +14 -24
  133. package/dist/components/statusChecker.js +295 -129
  134. package/dist/config.d.ts +3 -22
  135. package/dist/config.js +10 -161
  136. package/dist/index.d.ts +1 -1
  137. package/dist/index.js +42 -42
  138. package/dist/lib/arkApiClient.d.ts +53 -0
  139. package/dist/lib/arkApiClient.js +102 -0
  140. package/dist/lib/arkApiProxy.d.ts +9 -0
  141. package/dist/lib/arkApiProxy.js +22 -0
  142. package/dist/lib/arkServiceProxy.d.ts +14 -0
  143. package/dist/lib/arkServiceProxy.js +95 -0
  144. package/dist/lib/arkStatus.d.ts +10 -0
  145. package/dist/lib/arkStatus.js +79 -0
  146. package/dist/lib/arkStatus.spec.d.ts +1 -0
  147. package/dist/lib/arkStatus.spec.js +49 -0
  148. package/dist/lib/chatClient.d.ts +33 -0
  149. package/dist/lib/chatClient.js +93 -0
  150. package/dist/lib/cluster.d.ts +2 -1
  151. package/dist/lib/cluster.js +37 -16
  152. package/dist/lib/cluster.spec.d.ts +1 -0
  153. package/dist/lib/cluster.spec.js +338 -0
  154. package/dist/lib/commandUtils.d.ts +4 -0
  155. package/dist/lib/commandUtils.js +18 -0
  156. package/dist/lib/commandUtils.test.d.ts +1 -0
  157. package/dist/lib/commandUtils.test.js +44 -0
  158. package/dist/lib/commands.d.ts +16 -0
  159. package/dist/lib/commands.js +29 -0
  160. package/dist/lib/commands.spec.d.ts +1 -0
  161. package/dist/lib/commands.spec.js +146 -0
  162. package/dist/lib/config.d.ts +26 -80
  163. package/dist/lib/config.js +70 -205
  164. package/dist/lib/config.spec.d.ts +1 -0
  165. package/dist/lib/config.spec.js +99 -0
  166. package/dist/lib/config.test.d.ts +1 -0
  167. package/dist/lib/config.test.js +93 -0
  168. package/dist/lib/consts.d.ts +0 -1
  169. package/dist/lib/consts.js +0 -2
  170. package/dist/lib/consts.spec.d.ts +1 -0
  171. package/dist/lib/consts.spec.js +15 -0
  172. package/dist/lib/dev/tools/analyzer.d.ts +30 -0
  173. package/dist/lib/dev/tools/analyzer.js +190 -0
  174. package/dist/lib/dev/tools/discover_tools.py +392 -0
  175. package/dist/lib/dev/tools/mcp-types.d.ts +28 -0
  176. package/dist/lib/dev/tools/mcp-types.js +86 -0
  177. package/dist/lib/dev/tools/types.d.ts +50 -0
  178. package/dist/lib/dev/tools/types.js +1 -0
  179. package/dist/lib/errors.js +1 -1
  180. package/dist/lib/errors.spec.d.ts +1 -0
  181. package/dist/lib/errors.spec.js +221 -0
  182. package/dist/lib/exec.d.ts +0 -4
  183. package/dist/lib/exec.js +0 -11
  184. package/dist/lib/executeQuery.d.ts +20 -0
  185. package/dist/lib/executeQuery.js +135 -0
  186. package/dist/lib/executeQuery.spec.d.ts +1 -0
  187. package/dist/lib/executeQuery.spec.js +170 -0
  188. package/dist/lib/nextSteps.d.ts +4 -0
  189. package/dist/lib/nextSteps.js +20 -0
  190. package/dist/lib/nextSteps.spec.d.ts +1 -0
  191. package/dist/lib/nextSteps.spec.js +59 -0
  192. package/dist/lib/output.d.ts +36 -0
  193. package/dist/lib/output.js +89 -0
  194. package/dist/lib/output.spec.d.ts +1 -0
  195. package/dist/lib/output.spec.js +123 -0
  196. package/dist/lib/portUtils.d.ts +8 -0
  197. package/dist/lib/portUtils.js +39 -0
  198. package/dist/lib/queryRunner.d.ts +22 -0
  199. package/dist/lib/queryRunner.js +142 -0
  200. package/dist/lib/startup.d.ts +9 -0
  201. package/dist/lib/startup.js +87 -0
  202. package/dist/lib/startup.spec.d.ts +1 -0
  203. package/dist/lib/startup.spec.js +152 -0
  204. package/dist/lib/types.d.ts +87 -3
  205. package/dist/lib/versions.d.ts +23 -0
  206. package/dist/lib/versions.js +51 -0
  207. package/dist/types/types.d.ts +40 -0
  208. package/dist/types/types.js +1 -0
  209. package/dist/ui/AgentSelector.d.ts +8 -0
  210. package/dist/ui/AgentSelector.js +53 -0
  211. package/dist/ui/MainMenu.d.ts +5 -1
  212. package/dist/ui/MainMenu.js +226 -91
  213. package/dist/ui/ModelSelector.d.ts +8 -0
  214. package/dist/ui/ModelSelector.js +53 -0
  215. package/dist/ui/TeamSelector.d.ts +8 -0
  216. package/dist/ui/TeamSelector.js +55 -0
  217. package/dist/ui/ToolSelector.d.ts +8 -0
  218. package/dist/ui/ToolSelector.js +53 -0
  219. package/dist/ui/statusFormatter.d.ts +22 -7
  220. package/dist/ui/statusFormatter.js +39 -39
  221. package/dist/ui/statusFormatter.spec.d.ts +1 -0
  222. package/dist/ui/statusFormatter.spec.js +58 -0
  223. package/package.json +16 -5
@@ -1,327 +1,44 @@
1
- /**
2
- * Configuration management commands for ARK CLI
3
- */
4
1
  import { Command } from 'commander';
5
2
  import chalk from 'chalk';
6
- import inquirer from 'inquirer';
7
- import { ConfigManager } from '../lib/config.js';
8
- import { ErrorHandler } from '../lib/errors.js';
9
- import { OutputFormatter, EnhancedPrompts } from '../lib/progress.js';
3
+ import { loadConfig, getConfigPaths, formatConfig } from '../lib/config.js';
4
+ import fs from 'fs';
10
5
  export function createConfigCommand() {
11
- const config = new Command('config');
12
- config
13
- .description('Manage ARK CLI configuration')
14
- .addHelpText('before', `
15
- ${chalk.blue('⚙️ ARK Configuration Management')}
16
- Manage your ARK CLI preferences and defaults.
17
- `)
18
- .addHelpText('after', `
19
- ${chalk.cyan('Examples:')}
20
- ${chalk.yellow('ark config list')} # Show current configuration
21
- ${chalk.yellow('ark config set defaultProjectType with-samples')}
22
- ${chalk.yellow('ark config get defaultProjectType')} # Get specific value
23
- ${chalk.yellow('ark config edit')} # Interactive configuration
24
- ${chalk.yellow('ark config reset')} # Reset to defaults
25
- `);
26
- // List command - show current configuration
27
- const listCommand = new Command('list');
28
- listCommand
29
- .alias('ls')
6
+ const configCommand = new Command('config');
7
+ configCommand
30
8
  .description('Show current configuration')
31
- .option('--json', 'Output in JSON format', false)
32
- .action((options) => {
33
- ErrorHandler.catchAndHandle(async () => {
34
- const configManager = new ConfigManager();
35
- const currentConfig = configManager.getMergedConfig();
36
- if (options.json) {
37
- console.log(JSON.stringify(currentConfig, null, 2));
38
- return;
39
- }
40
- console.log(chalk.blue('\n⚙️ ARK CLI Configuration\n'));
41
- // Generator settings
42
- console.log(chalk.cyan('🎯 Generator Defaults:'));
43
- OutputFormatter.formatKeyValueList([
44
- {
45
- key: 'Project Type',
46
- value: currentConfig.defaultProjectType,
47
- highlight: true,
48
- },
49
- {
50
- key: 'Default Destination',
51
- value: currentConfig.defaultDestination,
52
- },
53
- {
54
- key: 'Skip Git by Default',
55
- value: currentConfig.skipGitByDefault ? 'yes' : 'no',
56
- },
57
- {
58
- key: 'Skip Models by Default',
59
- value: currentConfig.skipModelsbyDefault ? 'yes' : 'no',
60
- },
61
- {
62
- key: 'Default Model Provider',
63
- value: currentConfig.defaultModelProvider,
64
- },
65
- ]);
66
- // User preferences
67
- console.log(chalk.cyan('\n👤 User Preferences:'));
68
- OutputFormatter.formatKeyValueList([
69
- { key: 'Preferred Editor', value: currentConfig.preferredEditor },
70
- {
71
- key: 'Color Output',
72
- value: currentConfig.colorOutput ? 'enabled' : 'disabled',
73
- },
74
- {
75
- key: 'Verbose Output',
76
- value: currentConfig.verboseOutput ? 'enabled' : 'disabled',
77
- },
78
- ]);
79
- // Advanced settings
80
- console.log(chalk.cyan('\n🔧 Advanced Settings:'));
81
- OutputFormatter.formatKeyValueList([
82
- {
83
- key: 'Parallel Operations',
84
- value: currentConfig.parallelOperations ? 'enabled' : 'disabled',
85
- },
86
- {
87
- key: 'Max Concurrent Files',
88
- value: currentConfig.maxConcurrentFiles.toString(),
89
- },
90
- {
91
- key: 'File Watching',
92
- value: currentConfig.fileWatchingEnabled ? 'enabled' : 'disabled',
93
- },
94
- {
95
- key: 'Telemetry',
96
- value: currentConfig.telemetryEnabled ? 'enabled' : 'disabled',
97
- },
98
- ]);
99
- console.log(chalk.gray(`\nConfig file: ${configManager.getConfigFilePath()}`));
100
- console.log(chalk.gray('Use "ark config edit" for interactive configuration\n'));
101
- }, 'Listing configuration').catch(ErrorHandler.handleAndExit);
9
+ .action(() => {
10
+ const config = loadConfig();
11
+ const paths = getConfigPaths();
12
+ console.log();
13
+ // User config
14
+ if (fs.existsSync(paths.user)) {
15
+ console.log(chalk.green('✓'), chalk.white(paths.user));
16
+ }
17
+ else {
18
+ console.log(chalk.red('✗'), chalk.white(paths.user), chalk.gray(`doesn't exist`));
19
+ }
20
+ // Project config
21
+ if (fs.existsSync(paths.project)) {
22
+ console.log(chalk.green('✓'), chalk.white(paths.project));
23
+ }
24
+ else {
25
+ console.log(chalk.red('✗'), chalk.white(paths.project), chalk.gray(`doesn't exist`));
26
+ }
27
+ // Environment variables
28
+ if (process.env.ARK_CHAT_STREAMING !== undefined) {
29
+ console.log(chalk.green('✓'), chalk.white('ARK_CHAT_STREAMING'), chalk.gray(process.env.ARK_CHAT_STREAMING));
30
+ }
31
+ else {
32
+ console.log(chalk.red('✗'), chalk.white('ARK_CHAT_STREAMING'), chalk.gray('not set'));
33
+ }
34
+ if (process.env.ARK_CHAT_OUTPUT_FORMAT !== undefined) {
35
+ console.log(chalk.green('✓'), chalk.white('ARK_CHAT_OUTPUT_FORMAT'), chalk.gray(process.env.ARK_CHAT_OUTPUT_FORMAT));
36
+ }
37
+ else {
38
+ console.log(chalk.red('✗'), chalk.white('ARK_CHAT_OUTPUT_FORMAT'), chalk.gray('not set'));
39
+ }
40
+ console.log();
41
+ console.log(formatConfig(config));
102
42
  });
103
- // Get command - get a specific configuration value
104
- const getCommand = new Command('get');
105
- getCommand
106
- .description('Get a specific configuration value')
107
- .argument('<key>', 'Configuration key to retrieve')
108
- .action((key) => {
109
- ErrorHandler.catchAndHandle(async () => {
110
- const configManager = new ConfigManager();
111
- const currentConfig = configManager.getMergedConfig();
112
- if (key in currentConfig) {
113
- const value = currentConfig[key];
114
- console.log(typeof value === 'object'
115
- ? JSON.stringify(value, null, 2)
116
- : String(value));
117
- }
118
- else {
119
- console.error(chalk.red(`Unknown configuration key: ${key}`));
120
- console.log(chalk.gray('Available keys:'));
121
- Object.keys(currentConfig).forEach((k) => console.log(chalk.gray(` ${k}`)));
122
- process.exit(1);
123
- }
124
- }, 'Getting configuration value').catch(ErrorHandler.handleAndExit);
125
- });
126
- // Set command - set a specific configuration value
127
- const setCommand = new Command('set');
128
- setCommand
129
- .description('Set a specific configuration value')
130
- .argument('<key>', 'Configuration key to set')
131
- .argument('<value>', 'Value to set')
132
- .action((key, value) => {
133
- ErrorHandler.catchAndHandle(async () => {
134
- const configManager = new ConfigManager();
135
- const currentConfig = configManager.getConfig();
136
- if (!(key in currentConfig)) {
137
- console.error(chalk.red(`Unknown configuration key: ${key}`));
138
- console.log(chalk.gray('Available keys:'));
139
- Object.keys(currentConfig).forEach((k) => console.log(chalk.gray(` ${k}`)));
140
- process.exit(1);
141
- }
142
- // Parse value based on the current type
143
- const currentValue = currentConfig[key];
144
- let parsedValue = value;
145
- if (typeof currentValue === 'boolean') {
146
- parsedValue = ['true', 'yes', '1', 'on'].includes(value.toLowerCase());
147
- }
148
- else if (typeof currentValue === 'number') {
149
- parsedValue = parseInt(value, 10);
150
- if (isNaN(parsedValue)) {
151
- console.error(chalk.red(`Invalid number value: ${value}`));
152
- process.exit(1);
153
- }
154
- }
155
- // Update configuration
156
- configManager.set(key, parsedValue);
157
- // Validate the configuration
158
- configManager.validateConfig();
159
- console.log(chalk.green(`✅ Set ${key} = ${parsedValue}`));
160
- }, 'Setting configuration value').catch(ErrorHandler.handleAndExit);
161
- });
162
- // Edit command - interactive configuration editor
163
- const editCommand = new Command('edit');
164
- editCommand.description('Edit configuration interactively').action(() => {
165
- ErrorHandler.catchAndHandle(async () => {
166
- const configManager = new ConfigManager();
167
- const currentConfig = configManager.getConfig();
168
- console.log(chalk.blue('\n⚙️ ARK CLI Configuration Editor\n'));
169
- EnhancedPrompts.showInfo('Leave fields empty to keep current values');
170
- const answers = await inquirer.prompt([
171
- {
172
- type: 'list',
173
- name: 'defaultProjectType',
174
- message: 'Default project type:',
175
- choices: [
176
- {
177
- name: 'with-samples (recommended for beginners)',
178
- value: 'with-samples',
179
- },
180
- { name: 'empty (for experienced users)', value: 'empty' },
181
- ],
182
- default: currentConfig.defaultProjectType,
183
- },
184
- {
185
- type: 'input',
186
- name: 'defaultDestination',
187
- message: 'Default destination directory:',
188
- default: currentConfig.defaultDestination,
189
- },
190
- {
191
- type: 'list',
192
- name: 'defaultModelProvider',
193
- message: 'Default model provider:',
194
- choices: [
195
- { name: 'Azure OpenAI (recommended)', value: 'azure' },
196
- { name: 'OpenAI', value: 'openai' },
197
- { name: 'Claude (Anthropic)', value: 'claude' },
198
- { name: 'Gemini (Google)', value: 'gemini' },
199
- { name: 'Custom', value: 'custom' },
200
- ],
201
- default: currentConfig.defaultModelProvider,
202
- },
203
- {
204
- type: 'input',
205
- name: 'preferredEditor',
206
- message: 'Preferred editor command:',
207
- default: currentConfig.preferredEditor,
208
- },
209
- {
210
- type: 'confirm',
211
- name: 'skipGitByDefault',
212
- message: 'Skip git setup by default?',
213
- default: currentConfig.skipGitByDefault,
214
- },
215
- {
216
- type: 'confirm',
217
- name: 'skipModelsbyDefault',
218
- message: 'Skip model configuration by default?',
219
- default: currentConfig.skipModelsbyDefault,
220
- },
221
- {
222
- type: 'confirm',
223
- name: 'colorOutput',
224
- message: 'Enable colored output?',
225
- default: currentConfig.colorOutput,
226
- },
227
- {
228
- type: 'confirm',
229
- name: 'verboseOutput',
230
- message: 'Enable verbose output?',
231
- default: currentConfig.verboseOutput,
232
- },
233
- {
234
- type: 'number',
235
- name: 'maxConcurrentFiles',
236
- message: 'Maximum concurrent file operations:',
237
- default: currentConfig.maxConcurrentFiles,
238
- validate: (input) => input !== undefined && input >= 1 && input <= 100
239
- ? true
240
- : 'Must be between 1 and 100',
241
- },
242
- ]);
243
- // Update configuration
244
- configManager.updateConfig(answers);
245
- // Validate the configuration
246
- configManager.validateConfig();
247
- EnhancedPrompts.showSuccess('Configuration updated successfully');
248
- console.log(chalk.gray(`Config saved to: ${configManager.getConfigFilePath()}\n`));
249
- }, 'Editing configuration').catch(ErrorHandler.handleAndExit);
250
- });
251
- // Reset command - reset to default configuration
252
- const resetCommand = new Command('reset');
253
- resetCommand
254
- .description('Reset configuration to defaults')
255
- .option('--confirm', 'Skip confirmation prompt', false)
256
- .action((options) => {
257
- ErrorHandler.catchAndHandle(async () => {
258
- if (!options.confirm) {
259
- const { confirmReset } = await inquirer.prompt([
260
- {
261
- type: 'confirm',
262
- name: 'confirmReset',
263
- message: 'Are you sure you want to reset all configuration to defaults?',
264
- default: false,
265
- },
266
- ]);
267
- if (!confirmReset) {
268
- console.log(chalk.yellow('Reset cancelled'));
269
- return;
270
- }
271
- }
272
- const configManager = new ConfigManager();
273
- configManager.resetConfig();
274
- EnhancedPrompts.showSuccess('Configuration reset to defaults');
275
- console.log(chalk.gray(`Config file: ${configManager.getConfigFilePath()}\n`));
276
- }, 'Resetting configuration').catch(ErrorHandler.handleAndExit);
277
- });
278
- // Export command - export configuration for backup
279
- const exportCommand = new Command('export');
280
- exportCommand
281
- .description('Export configuration to JSON')
282
- .option('-o, --output <file>', 'Output file (default: stdout)')
283
- .action((options) => {
284
- ErrorHandler.catchAndHandle(async () => {
285
- const configManager = new ConfigManager();
286
- const configJson = configManager.exportConfig();
287
- if (options.output) {
288
- const fs = await import('fs');
289
- fs.writeFileSync(options.output, configJson);
290
- EnhancedPrompts.showSuccess(`Configuration exported to ${options.output}`);
291
- }
292
- else {
293
- console.log(configJson);
294
- }
295
- }, 'Exporting configuration').catch(ErrorHandler.handleAndExit);
296
- });
297
- // Import command - import configuration from backup
298
- const importCommand = new Command('import');
299
- importCommand
300
- .description('Import configuration from JSON file')
301
- .argument('<file>', 'JSON file to import')
302
- .option('--merge', 'Merge with existing configuration', false)
303
- .action((file, options) => {
304
- ErrorHandler.catchAndHandle(async () => {
305
- const fs = await import('fs');
306
- const configJson = fs.readFileSync(file, 'utf-8');
307
- const configManager = new ConfigManager();
308
- if (options.merge) {
309
- const importedConfig = JSON.parse(configJson);
310
- configManager.updateConfig(importedConfig);
311
- }
312
- else {
313
- configManager.importConfig(configJson);
314
- }
315
- EnhancedPrompts.showSuccess(`Configuration imported from ${file}`);
316
- }, 'Importing configuration').catch(ErrorHandler.handleAndExit);
317
- });
318
- // Add subcommands
319
- config.addCommand(listCommand);
320
- config.addCommand(getCommand);
321
- config.addCommand(setCommand);
322
- config.addCommand(editCommand);
323
- config.addCommand(resetCommand);
324
- config.addCommand(exportCommand);
325
- config.addCommand(importCommand);
326
- return config;
43
+ return configCommand;
327
44
  }
@@ -0,0 +1,4 @@
1
+ import { Command } from 'commander';
2
+ import type { ArkConfig } from '../../lib/config.js';
3
+ export declare function openDashboard(): Promise<void>;
4
+ export declare function createDashboardCommand(_: ArkConfig): Command;
@@ -0,0 +1,39 @@
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ import open from 'open';
4
+ import ora from 'ora';
5
+ import { ArkServiceProxy } from '../../lib/arkServiceProxy.js';
6
+ import { arkServices } from '../../arkServices.js';
7
+ export async function openDashboard() {
8
+ const spinner = ora('Connecting to dashboard').start();
9
+ try {
10
+ const dashboardService = arkServices['ark-dashboard'];
11
+ const proxy = new ArkServiceProxy(dashboardService, 3274); // DASH on phone keypad
12
+ const url = await proxy.start();
13
+ spinner.succeed('Dashboard connected');
14
+ console.log(`ARK dashboard running on: ${chalk.green(url)}`);
15
+ console.log(chalk.gray('Press Ctrl+C to stop'));
16
+ // Brief pause before opening browser
17
+ await new Promise((resolve) => setTimeout(resolve, 1000));
18
+ // Open browser
19
+ await open(url);
20
+ // Handle Ctrl+C gracefully
21
+ process.on('SIGINT', () => {
22
+ proxy.stop();
23
+ process.exit(0);
24
+ });
25
+ // Keep process alive
26
+ process.stdin.resume();
27
+ }
28
+ catch (error) {
29
+ spinner.fail(error instanceof Error ? error.message : 'Failed to start dashboard');
30
+ process.exit(1);
31
+ }
32
+ }
33
+ export function createDashboardCommand(_) {
34
+ const dashboardCommand = new Command('dashboard');
35
+ dashboardCommand
36
+ .description('Open the ARK dashboard in your browser')
37
+ .action(openDashboard);
38
+ return dashboardCommand;
39
+ }
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function openDashboard(): Promise<void>;
3
+ export declare function createDashboardCommand(): Command;
@@ -0,0 +1,39 @@
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ import open from 'open';
4
+ import ora from 'ora';
5
+ import { ArkServiceProxy } from '../lib/arkServiceProxy.js';
6
+ import { arkServices } from '../arkServices.js';
7
+ export async function openDashboard() {
8
+ const spinner = ora('Connecting to dashboard').start();
9
+ try {
10
+ const dashboardService = arkServices['ark-dashboard'];
11
+ const proxy = new ArkServiceProxy(dashboardService, 3274); // DASH on phone keypad
12
+ const url = await proxy.start();
13
+ spinner.succeed('Dashboard connected');
14
+ console.log(`ARK dashboard running on: ${chalk.green(url)}`);
15
+ console.log(chalk.gray('Press Ctrl+C to stop'));
16
+ // Brief pause before opening browser
17
+ await new Promise((resolve) => setTimeout(resolve, 1000));
18
+ // Open browser
19
+ await open(url);
20
+ // Handle Ctrl+C gracefully
21
+ process.on('SIGINT', () => {
22
+ proxy.stop();
23
+ process.exit(0);
24
+ });
25
+ // Keep process alive
26
+ process.stdin.resume();
27
+ }
28
+ catch (error) {
29
+ spinner.fail(error instanceof Error ? error.message : 'Failed to start dashboard');
30
+ process.exit(1);
31
+ }
32
+ }
33
+ export function createDashboardCommand() {
34
+ const dashboardCommand = new Command('dashboard');
35
+ dashboardCommand
36
+ .description('Open the ARK dashboard in your browser')
37
+ .action(openDashboard);
38
+ return dashboardCommand;
39
+ }
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ import type { ArkConfig } from '../../lib/config.js';
3
+ export declare function createDevCommand(_: ArkConfig): Command;
@@ -0,0 +1,9 @@
1
+ import { Command } from 'commander';
2
+ import { createToolCommand } from './tool/index.js';
3
+ export function createDevCommand(_) {
4
+ const devCommand = new Command('dev');
5
+ devCommand.description('Development tools for ARK');
6
+ // Add subcommands
7
+ devCommand.addCommand(createToolCommand());
8
+ return devCommand;
9
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createCheckCommand(): Command;
@@ -0,0 +1,142 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import path from 'path';
4
+ import ora from 'ora';
5
+ import output from '../../../lib/output.js';
6
+ import { ArkDevToolAnalyzer } from '../../../lib/dev/tools/analyzer.js';
7
+ import { toMCPTool } from '../../../lib/dev/tools/mcp-types.js';
8
+ async function checkTool(toolPath, options) {
9
+ const absolutePath = path.resolve(toolPath);
10
+ const analyzer = new ArkDevToolAnalyzer();
11
+ const isJson = options.output === 'json';
12
+ // Build up result object as we go
13
+ const result = {
14
+ path: absolutePath,
15
+ projectRoot: null,
16
+ error: null,
17
+ platform: null,
18
+ projectType: null,
19
+ projectName: null,
20
+ projectVersion: null,
21
+ hasFastmcp: false,
22
+ fastmcpVersion: null,
23
+ tools: [],
24
+ toolDiscoveryError: null,
25
+ };
26
+ if (!isJson) {
27
+ console.log();
28
+ }
29
+ // Single spinner for all analysis (skip for JSON output)
30
+ const analyzeSpinner = isJson
31
+ ? null
32
+ : ora(`analyzing ${absolutePath}`).start();
33
+ // Small delay to let user see what's happening (skip for JSON)
34
+ if (!isJson) {
35
+ await new Promise((resolve) => setTimeout(resolve, 500));
36
+ }
37
+ // Collect all information
38
+ const project = await analyzer.discoverProject(absolutePath);
39
+ if (!project || !project.exists) {
40
+ result.error = 'path not found';
41
+ if (isJson) {
42
+ console.log(JSON.stringify(result, null, 2));
43
+ }
44
+ else {
45
+ analyzeSpinner.stop();
46
+ output.error(`path not found: ${absolutePath}`);
47
+ }
48
+ process.exit(1);
49
+ }
50
+ if (!project.is_directory) {
51
+ result.error = 'path is not a directory';
52
+ if (isJson) {
53
+ console.log(JSON.stringify(result, null, 2));
54
+ }
55
+ else {
56
+ analyzeSpinner.stop();
57
+ output.error(`path is not a directory: ${absolutePath}`);
58
+ }
59
+ process.exit(1);
60
+ }
61
+ if (!project.platform) {
62
+ result.error =
63
+ 'platform unknown - no pyproject.toml or requirements.txt found';
64
+ if (isJson) {
65
+ console.log(JSON.stringify(result, null, 2));
66
+ }
67
+ else {
68
+ analyzeSpinner.stop();
69
+ output.error(`no pyproject.toml or requirements.txt found in: ${absolutePath}`);
70
+ }
71
+ process.exit(1);
72
+ }
73
+ // Update result with project info
74
+ result.platform = project.platform;
75
+ result.projectType = project.project_type;
76
+ result.projectName = project.project_name;
77
+ result.projectVersion = project.project_version;
78
+ result.hasFastmcp = project.has_fastmcp;
79
+ result.fastmcpVersion = project.fastmcp_version;
80
+ result.projectRoot = absolutePath; // Store the project root
81
+ // Discover tools recursively in the project
82
+ const rawTools = [];
83
+ try {
84
+ const projectTools = await analyzer.findProjectTools(absolutePath);
85
+ if (projectTools && projectTools.tools) {
86
+ rawTools.push(...projectTools.tools);
87
+ }
88
+ }
89
+ catch (error) {
90
+ result.toolDiscoveryError =
91
+ error instanceof Error ? error.message : 'Unknown error';
92
+ }
93
+ // Store tools in the appropriate format
94
+ result.tools = isJson ? rawTools.map(toMCPTool) : rawTools;
95
+ if (isJson) {
96
+ // Output raw JSON
97
+ console.log(JSON.stringify(result, null, 2));
98
+ return;
99
+ }
100
+ analyzeSpinner.succeed('analysis complete');
101
+ console.log();
102
+ // Display summary in cleaner format
103
+ output.section(path.basename(absolutePath));
104
+ // Platform
105
+ output.statusCheck('found', 'platform', result.platform);
106
+ // Project type with name and version in gray
107
+ let projectDetails = '';
108
+ if (result.projectName) {
109
+ projectDetails = result.projectName;
110
+ if (result.projectVersion) {
111
+ projectDetails += ` v${result.projectVersion}`;
112
+ }
113
+ }
114
+ output.statusCheck('found', 'project', result.projectType, projectDetails);
115
+ // Framework with version in gray
116
+ if (result.hasFastmcp) {
117
+ const fastmcpDetails = result.fastmcpVersion
118
+ ? `v${result.fastmcpVersion}`
119
+ : undefined;
120
+ output.statusCheck('found', 'framework', 'fastmcp', fastmcpDetails);
121
+ }
122
+ else {
123
+ output.statusCheck('missing', 'framework', 'fastmcp');
124
+ }
125
+ // Tools with details
126
+ output.statusCheck('found', 'tools', result.tools.length.toString());
127
+ if (result.tools.length > 0) {
128
+ for (const tool of result.tools) {
129
+ const description = tool.docstring ? tool.docstring.split('\n')[0] : '';
130
+ console.log(chalk.gray(` - ${tool.name}: ${description}`));
131
+ }
132
+ }
133
+ }
134
+ export function createCheckCommand() {
135
+ const checkCommand = new Command('check');
136
+ checkCommand
137
+ .description('Check the status of an MCP tool project')
138
+ .argument('<path>', 'Path to the tool directory')
139
+ .option('-o, --output <format>', 'Output format (json)', 'text')
140
+ .action(checkTool);
141
+ return checkCommand;
142
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createCleanCommand(): Command;