@agents-at-scale/ark 0.1.35-rc2 → 0.1.35

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 (215) hide show
  1. package/dist/commands/cluster/index.d.ts +1 -2
  2. package/dist/commands/cluster/index.js +5 -3
  3. package/dist/commands/completion.js +2 -159
  4. package/dist/commands/config.d.ts +3 -0
  5. package/dist/commands/config.js +321 -38
  6. package/dist/commands/generate/config.js +24 -5
  7. package/dist/commands/generate/generators/agent.js +2 -2
  8. package/dist/commands/generate/generators/mcpserver.d.ts +1 -2
  9. package/dist/commands/generate/generators/mcpserver.js +5 -26
  10. package/dist/commands/generate/generators/project.js +41 -22
  11. package/dist/commands/generate/generators/team.js +2 -2
  12. package/dist/commands/generate/index.d.ts +1 -2
  13. package/dist/commands/generate/index.js +1 -1
  14. package/dist/components/statusChecker.d.ts +23 -13
  15. package/dist/components/statusChecker.js +129 -295
  16. package/dist/config.d.ts +22 -3
  17. package/dist/config.js +161 -10
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +42 -44
  20. package/dist/lib/cluster.d.ts +1 -2
  21. package/dist/lib/cluster.js +16 -37
  22. package/dist/lib/config.d.ts +80 -28
  23. package/dist/lib/config.js +205 -70
  24. package/dist/lib/consts.d.ts +1 -0
  25. package/dist/lib/consts.js +2 -0
  26. package/dist/lib/errors.js +1 -1
  27. package/dist/lib/exec.d.ts +4 -0
  28. package/dist/lib/exec.js +11 -0
  29. package/dist/lib/types.d.ts +3 -17
  30. package/dist/ui/MainMenu.d.ts +1 -5
  31. package/dist/ui/MainMenu.js +91 -222
  32. package/dist/ui/statusFormatter.d.ts +7 -22
  33. package/dist/ui/statusFormatter.js +39 -39
  34. package/package.json +5 -17
  35. package/dist/arkServices.d.ts +0 -42
  36. package/dist/arkServices.js +0 -138
  37. package/dist/arkServices.spec.d.ts +0 -1
  38. package/dist/arkServices.spec.js +0 -24
  39. package/dist/charts/charts.d.ts +0 -5
  40. package/dist/charts/charts.js +0 -6
  41. package/dist/charts/dependencies.d.ts +0 -6
  42. package/dist/charts/dependencies.js +0 -50
  43. package/dist/charts/types.d.ts +0 -40
  44. package/dist/charts/types.js +0 -1
  45. package/dist/commands/agents/index.d.ts +0 -3
  46. package/dist/commands/agents/index.js +0 -51
  47. package/dist/commands/agents/index.spec.d.ts +0 -1
  48. package/dist/commands/agents/index.spec.js +0 -67
  49. package/dist/commands/agents/selector.d.ts +0 -8
  50. package/dist/commands/agents/selector.js +0 -53
  51. package/dist/commands/agents.d.ts +0 -2
  52. package/dist/commands/agents.js +0 -53
  53. package/dist/commands/chat/index.d.ts +0 -3
  54. package/dist/commands/chat/index.js +0 -29
  55. package/dist/commands/chat.d.ts +0 -2
  56. package/dist/commands/chat.js +0 -45
  57. package/dist/commands/cluster/get.d.ts +0 -2
  58. package/dist/commands/cluster/get.js +0 -39
  59. package/dist/commands/cluster/get.spec.d.ts +0 -1
  60. package/dist/commands/cluster/get.spec.js +0 -92
  61. package/dist/commands/cluster/index.spec.d.ts +0 -1
  62. package/dist/commands/cluster/index.spec.js +0 -24
  63. package/dist/commands/completion/index.d.ts +0 -3
  64. package/dist/commands/completion/index.js +0 -290
  65. package/dist/commands/completion/index.spec.d.ts +0 -1
  66. package/dist/commands/completion/index.spec.js +0 -34
  67. package/dist/commands/config/index.d.ts +0 -3
  68. package/dist/commands/config/index.js +0 -42
  69. package/dist/commands/config/index.spec.d.ts +0 -1
  70. package/dist/commands/config/index.spec.js +0 -78
  71. package/dist/commands/dashboard/index.d.ts +0 -4
  72. package/dist/commands/dashboard/index.js +0 -39
  73. package/dist/commands/dashboard.d.ts +0 -3
  74. package/dist/commands/dashboard.js +0 -39
  75. package/dist/commands/dev/index.d.ts +0 -3
  76. package/dist/commands/dev/index.js +0 -9
  77. package/dist/commands/dev/tool/check.d.ts +0 -2
  78. package/dist/commands/dev/tool/check.js +0 -142
  79. package/dist/commands/dev/tool/clean.d.ts +0 -2
  80. package/dist/commands/dev/tool/clean.js +0 -153
  81. package/dist/commands/dev/tool/generate.d.ts +0 -2
  82. package/dist/commands/dev/tool/generate.js +0 -28
  83. package/dist/commands/dev/tool/index.d.ts +0 -2
  84. package/dist/commands/dev/tool/index.js +0 -14
  85. package/dist/commands/dev/tool/init.d.ts +0 -2
  86. package/dist/commands/dev/tool/init.js +0 -320
  87. package/dist/commands/dev/tool/shared.d.ts +0 -5
  88. package/dist/commands/dev/tool/shared.js +0 -256
  89. package/dist/commands/dev/tool/status.d.ts +0 -2
  90. package/dist/commands/dev/tool/status.js +0 -136
  91. package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
  92. package/dist/commands/dev/tool-generate.spec.js +0 -163
  93. package/dist/commands/dev/tool.d.ts +0 -2
  94. package/dist/commands/dev/tool.js +0 -559
  95. package/dist/commands/dev/tool.spec.d.ts +0 -1
  96. package/dist/commands/dev/tool.spec.js +0 -48
  97. package/dist/commands/docs/index.d.ts +0 -4
  98. package/dist/commands/docs/index.js +0 -18
  99. package/dist/commands/install/index.d.ts +0 -8
  100. package/dist/commands/install/index.js +0 -300
  101. package/dist/commands/install/index.spec.d.ts +0 -1
  102. package/dist/commands/install/index.spec.js +0 -143
  103. package/dist/commands/install.d.ts +0 -3
  104. package/dist/commands/install.js +0 -147
  105. package/dist/commands/models/create.d.ts +0 -1
  106. package/dist/commands/models/create.js +0 -213
  107. package/dist/commands/models/create.spec.d.ts +0 -1
  108. package/dist/commands/models/create.spec.js +0 -125
  109. package/dist/commands/models/index.d.ts +0 -3
  110. package/dist/commands/models/index.js +0 -60
  111. package/dist/commands/models/index.spec.d.ts +0 -1
  112. package/dist/commands/models/index.spec.js +0 -76
  113. package/dist/commands/models/selector.d.ts +0 -8
  114. package/dist/commands/models/selector.js +0 -53
  115. package/dist/commands/query/index.d.ts +0 -3
  116. package/dist/commands/query/index.js +0 -131
  117. package/dist/commands/routes/index.d.ts +0 -3
  118. package/dist/commands/routes/index.js +0 -93
  119. package/dist/commands/routes.d.ts +0 -2
  120. package/dist/commands/routes.js +0 -101
  121. package/dist/commands/status/index.d.ts +0 -4
  122. package/dist/commands/status/index.js +0 -262
  123. package/dist/commands/status.d.ts +0 -3
  124. package/dist/commands/status.js +0 -33
  125. package/dist/commands/targets/index.d.ts +0 -3
  126. package/dist/commands/targets/index.js +0 -65
  127. package/dist/commands/targets/index.spec.d.ts +0 -1
  128. package/dist/commands/targets/index.spec.js +0 -105
  129. package/dist/commands/targets.d.ts +0 -2
  130. package/dist/commands/targets.js +0 -65
  131. package/dist/commands/teams/index.d.ts +0 -3
  132. package/dist/commands/teams/index.js +0 -49
  133. package/dist/commands/teams/index.spec.d.ts +0 -1
  134. package/dist/commands/teams/index.spec.js +0 -70
  135. package/dist/commands/teams/selector.d.ts +0 -8
  136. package/dist/commands/teams/selector.js +0 -55
  137. package/dist/commands/tools/index.d.ts +0 -3
  138. package/dist/commands/tools/index.js +0 -49
  139. package/dist/commands/tools/index.spec.d.ts +0 -1
  140. package/dist/commands/tools/index.spec.js +0 -70
  141. package/dist/commands/tools/selector.d.ts +0 -8
  142. package/dist/commands/tools/selector.js +0 -53
  143. package/dist/commands/uninstall/index.d.ts +0 -3
  144. package/dist/commands/uninstall/index.js +0 -106
  145. package/dist/commands/uninstall/index.spec.d.ts +0 -1
  146. package/dist/commands/uninstall/index.spec.js +0 -125
  147. package/dist/commands/uninstall.d.ts +0 -2
  148. package/dist/commands/uninstall.js +0 -83
  149. package/dist/components/ChatUI.d.ts +0 -16
  150. package/dist/components/ChatUI.js +0 -801
  151. package/dist/components/StatusView.d.ts +0 -10
  152. package/dist/components/StatusView.js +0 -39
  153. package/dist/lib/arkApiClient.d.ts +0 -53
  154. package/dist/lib/arkApiClient.js +0 -102
  155. package/dist/lib/arkApiProxy.d.ts +0 -9
  156. package/dist/lib/arkApiProxy.js +0 -22
  157. package/dist/lib/arkServiceProxy.d.ts +0 -14
  158. package/dist/lib/arkServiceProxy.js +0 -95
  159. package/dist/lib/arkStatus.d.ts +0 -10
  160. package/dist/lib/arkStatus.js +0 -79
  161. package/dist/lib/arkStatus.spec.d.ts +0 -1
  162. package/dist/lib/arkStatus.spec.js +0 -49
  163. package/dist/lib/chatClient.d.ts +0 -33
  164. package/dist/lib/chatClient.js +0 -99
  165. package/dist/lib/cluster.spec.d.ts +0 -1
  166. package/dist/lib/cluster.spec.js +0 -338
  167. package/dist/lib/commandUtils.d.ts +0 -4
  168. package/dist/lib/commandUtils.js +0 -18
  169. package/dist/lib/commandUtils.test.d.ts +0 -1
  170. package/dist/lib/commandUtils.test.js +0 -44
  171. package/dist/lib/commands.d.ts +0 -16
  172. package/dist/lib/commands.js +0 -29
  173. package/dist/lib/commands.spec.d.ts +0 -1
  174. package/dist/lib/commands.spec.js +0 -146
  175. package/dist/lib/config.spec.d.ts +0 -1
  176. package/dist/lib/config.spec.js +0 -99
  177. package/dist/lib/config.test.d.ts +0 -1
  178. package/dist/lib/config.test.js +0 -93
  179. package/dist/lib/consts.spec.d.ts +0 -1
  180. package/dist/lib/consts.spec.js +0 -15
  181. package/dist/lib/dev/tools/analyzer.d.ts +0 -30
  182. package/dist/lib/dev/tools/analyzer.js +0 -190
  183. package/dist/lib/dev/tools/discover_tools.py +0 -392
  184. package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
  185. package/dist/lib/dev/tools/mcp-types.js +0 -86
  186. package/dist/lib/dev/tools/types.d.ts +0 -50
  187. package/dist/lib/dev/tools/types.js +0 -1
  188. package/dist/lib/errors.spec.d.ts +0 -1
  189. package/dist/lib/errors.spec.js +0 -221
  190. package/dist/lib/nextSteps.d.ts +0 -4
  191. package/dist/lib/nextSteps.js +0 -20
  192. package/dist/lib/nextSteps.spec.d.ts +0 -1
  193. package/dist/lib/nextSteps.spec.js +0 -59
  194. package/dist/lib/output.d.ts +0 -36
  195. package/dist/lib/output.js +0 -89
  196. package/dist/lib/output.spec.d.ts +0 -1
  197. package/dist/lib/output.spec.js +0 -123
  198. package/dist/lib/portUtils.d.ts +0 -8
  199. package/dist/lib/portUtils.js +0 -39
  200. package/dist/lib/startup.d.ts +0 -9
  201. package/dist/lib/startup.js +0 -93
  202. package/dist/lib/startup.spec.d.ts +0 -1
  203. package/dist/lib/startup.spec.js +0 -168
  204. package/dist/types/types.d.ts +0 -40
  205. package/dist/types/types.js +0 -1
  206. package/dist/ui/AgentSelector.d.ts +0 -8
  207. package/dist/ui/AgentSelector.js +0 -53
  208. package/dist/ui/ModelSelector.d.ts +0 -8
  209. package/dist/ui/ModelSelector.js +0 -53
  210. package/dist/ui/TeamSelector.d.ts +0 -8
  211. package/dist/ui/TeamSelector.js +0 -55
  212. package/dist/ui/ToolSelector.d.ts +0 -8
  213. package/dist/ui/ToolSelector.js +0 -53
  214. package/dist/ui/statusFormatter.spec.d.ts +0 -1
  215. package/dist/ui/statusFormatter.spec.js +0 -58
@@ -1,3 +1,2 @@
1
1
  import { Command } from 'commander';
2
- import type { ArkConfig } from '../../lib/config.js';
3
- export declare function createClusterCommand(_: ArkConfig): Command;
2
+ export declare function createClusterCommand(): Command;
@@ -1,8 +1,10 @@
1
1
  import { Command } from 'commander';
2
- import { createGetCommand } from './get.js';
3
- export function createClusterCommand(_) {
2
+ import { createGetIpCommand } from './get-ip.js';
3
+ import { createGetTypeCommand } from './get-type.js';
4
+ export function createClusterCommand() {
4
5
  const cluster = new Command('cluster');
5
6
  cluster.description('Cluster management commands');
6
- cluster.addCommand(createGetCommand());
7
+ cluster.addCommand(createGetTypeCommand());
8
+ cluster.addCommand(createGetIpCommand());
7
9
  return cluster;
8
10
  }
@@ -28,7 +28,7 @@ _ark_completion() {
28
28
 
29
29
  case \${COMP_CWORD} in
30
30
  1)
31
- opts="agents chat cluster completion config dashboard dev generate install models routes status targets teams tools uninstall help"
31
+ opts="cluster completion check help"
32
32
  COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
33
33
  return 0
34
34
  ;;
@@ -49,81 +49,6 @@ _ark_completion() {
49
49
  COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
50
50
  return 0
51
51
  ;;
52
- targets)
53
- opts="list ls"
54
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
55
- return 0
56
- ;;
57
- agents)
58
- opts="list ls"
59
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
60
- return 0
61
- ;;
62
- models)
63
- opts="list ls create"
64
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
65
- return 0
66
- ;;
67
- teams)
68
- opts="list ls"
69
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
70
- return 0
71
- ;;
72
- tools)
73
- opts="list ls"
74
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
75
- return 0
76
- ;;
77
- dev)
78
- opts="tool"
79
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
80
- return 0
81
- ;;
82
- generate)
83
- opts="agent marketplace mcp-server project query team"
84
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
85
- return 0
86
- ;;
87
- chat)
88
- # Dynamically fetch available targets using ark targets list
89
- local targets
90
- targets=$(ark targets list 2>/dev/null)
91
- if [ -z "$targets" ]; then
92
- # Fallback to common targets if API is not available
93
- targets="agent/sample-agent agent/math agent/weather model/default"
94
- fi
95
- COMPREPLY=( $(compgen -W "\${targets}" -- \${cur}) )
96
- return 0
97
- ;;
98
- esac
99
- ;;
100
- 3)
101
- case \${COMP_WORDS[1]} in
102
- dev)
103
- case \${prev} in
104
- tool)
105
- opts="check init generate"
106
- COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
107
- return 0
108
- ;;
109
- esac
110
- ;;
111
- esac
112
- ;;
113
- 4)
114
- # Handle path completion for dev tool commands
115
- case \${COMP_WORDS[1]} in
116
- dev)
117
- if [[ \${COMP_WORDS[2]} == "tool" ]]; then
118
- case \${COMP_WORDS[3]} in
119
- check|init|generate)
120
- # Complete with directories
121
- COMPREPLY=( $(compgen -d -- \${cur}) )
122
- return 0
123
- ;;
124
- esac
125
- fi
126
- ;;
127
52
  esac
128
53
  ;;
129
54
  esac
@@ -150,22 +75,9 @@ _ark() {
150
75
  case $state in
151
76
  command)
152
77
  _values 'ark commands' \\
153
- 'agents[List available agents]' \\
154
- 'chat[Interactive chat with agents and models]' \\
155
78
  'cluster[Cluster management commands]' \\
156
79
  'completion[Generate shell completion scripts]' \\
157
- 'config[Configuration management]' \\
158
- 'dashboard[Open ARK dashboard]' \\
159
- 'dev[Development tools for ARK]' \\
160
- 'generate[Generate ARK resources]' \\
161
- 'install[Install ARK services]' \\
162
- 'models[List available models]' \\
163
- 'routes[List available routes]' \\
164
- 'status[Check system status]' \\
165
- 'targets[List available query targets]' \\
166
- 'teams[List available teams]' \\
167
- 'tools[List available tools]' \\
168
- 'uninstall[Uninstall ARK services]' \\
80
+ 'check[Check system components]' \\
169
81
  'help[Show help information]'
170
82
  ;;
171
83
  subcommand)
@@ -184,75 +96,6 @@ _ark() {
184
96
  _values 'check commands' \\
185
97
  'status[Check system status]'
186
98
  ;;
187
- targets)
188
- _values 'targets commands' \\
189
- 'list[List all available targets]' \\
190
- 'ls[List all available targets]'
191
- ;;
192
- agents)
193
- _values 'agents commands' \\
194
- 'list[List all available agents]' \\
195
- 'ls[List all available agents]'
196
- ;;
197
- models)
198
- _values 'models commands' \\
199
- 'list[List all available models]' \\
200
- 'ls[List all available models]' \\
201
- 'create[Create a new model]'
202
- ;;
203
- teams)
204
- _values 'teams commands' \\
205
- 'list[List all available teams]' \\
206
- 'ls[List all available teams]'
207
- ;;
208
- tools)
209
- _values 'tools commands' \\
210
- 'list[List all available tools]' \\
211
- 'ls[List all available tools]'
212
- ;;
213
- dev)
214
- _values 'dev commands' \\
215
- 'tool[MCP tool development utilities]'
216
- ;;
217
- generate)
218
- _values 'generate types' \\
219
- 'agent[Generate a new agent]' \\
220
- 'marketplace[Generate marketplace content]' \\
221
- 'mcp-server[Generate MCP server]' \\
222
- 'project[Generate a new project]' \\
223
- 'query[Generate a query]' \\
224
- 'team[Generate a team]'
225
- ;;
226
- chat)
227
- # Get available targets dynamically
228
- local -a targets
229
- targets=($(ark targets list 2>/dev/null))
230
- if [ \${#targets[@]} -eq 0 ]; then
231
- targets=('agent/sample-agent' 'agent/math' 'agent/weather' 'model/default')
232
- fi
233
- _values 'available targets' \${targets[@]}
234
- ;;
235
- esac
236
- ;;
237
- args)
238
- case \$words[2] in
239
- dev)
240
- if [[ \$words[3] == "tool" ]]; then
241
- case \$words[4] in
242
- check|init|generate)
243
- # Complete with directories
244
- _files -/
245
- ;;
246
- *)
247
- _values 'tool commands' \\
248
- 'check[Check the status of an MCP tool project]' \\
249
- 'init[Initialize an MCP tool project]' \\
250
- 'generate[Generate project files from templates]' \\
251
- 'clean[Remove template-generated files]'
252
- ;;
253
- esac
254
- fi
255
- ;;
256
99
  esac
257
100
  ;;
258
101
  esac
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Configuration management commands for ARK CLI
3
+ */
1
4
  import { Command } from 'commander';
2
5
  export declare function createConfigCommand(): Command;
@@ -1,44 +1,327 @@
1
+ /**
2
+ * Configuration management commands for ARK CLI
3
+ */
1
4
  import { Command } from 'commander';
2
5
  import chalk from 'chalk';
3
- import { loadConfig, getConfigPaths, formatConfig } from '../lib/config.js';
4
- import fs from 'fs';
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';
5
10
  export function createConfigCommand() {
6
- const configCommand = new Command('config');
7
- configCommand
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')
8
30
  .description('Show current configuration')
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));
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);
42
102
  });
43
- return configCommand;
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;
44
327
  }
@@ -2,6 +2,7 @@
2
2
  * Shared configuration for generators across CLI and UI
3
3
  */
4
4
  import path from 'path';
5
+ import { ConfigManager } from '../../lib/config.js';
5
6
  /**
6
7
  * Project type choices - shared between CLI and UI
7
8
  */
@@ -69,18 +70,36 @@ export const GENERATOR_CHOICES = [
69
70
  */
70
71
  export const GENERATOR_DEFAULTS = {
71
72
  get projectType() {
72
- return 'with-samples';
73
+ try {
74
+ const configManager = new ConfigManager();
75
+ return configManager.get('defaultProjectType');
76
+ }
77
+ catch {
78
+ return 'with-samples';
79
+ }
73
80
  },
74
81
  get skipModels() {
75
- return false;
82
+ try {
83
+ const configManager = new ConfigManager();
84
+ return configManager.get('skipModelsbyDefault');
85
+ }
86
+ catch {
87
+ return false;
88
+ }
76
89
  },
77
90
  get skipGit() {
78
- return false;
91
+ try {
92
+ const configManager = new ConfigManager();
93
+ return configManager.get('skipGitByDefault');
94
+ }
95
+ catch {
96
+ return false;
97
+ }
79
98
  },
80
99
  getDefaultDestination: () => {
81
100
  try {
82
- // Return current working directory as default
83
- const configured = null;
101
+ const configManager = new ConfigManager();
102
+ const configured = configManager.get('defaultDestination');
84
103
  if (configured && configured !== process.cwd()) {
85
104
  return configured;
86
105
  }
@@ -144,11 +144,11 @@ class AgentGenerator {
144
144
  console.log(chalk.gray(` 1. Review and customise the agent configuration`));
145
145
  if (config.createQuery) {
146
146
  console.log(chalk.gray(` 2. Review and customise the query configuration`));
147
- console.log(chalk.gray(` 3. Deploy with: helm upgrade --install ${config.projectName} .`));
147
+ console.log(chalk.gray(` 3. Deploy with: helm upgrade --install ${config.projectName} . --namespace ${config.projectName}`));
148
148
  console.log(chalk.gray(` 4. Test with: kubectl get agents,queries`));
149
149
  }
150
150
  else {
151
- console.log(chalk.gray(` 2. Deploy with: helm upgrade --install ${config.projectName} .`));
151
+ console.log(chalk.gray(` 2. Deploy with: helm upgrade --install ${config.projectName} . --namespace ${config.projectName}`));
152
152
  console.log(chalk.gray(` 3. Test with: kubectl get agents`));
153
153
  }
154
154
  }, 'Generating agent');
@@ -1,4 +1,3 @@
1
- import type { GeneratorOptions } from '../index.js';
2
1
  export interface McpServerConfig {
3
2
  mcpServerName: string;
4
3
  description: string;
@@ -22,5 +21,5 @@ export declare function createMcpServerGenerator(): {
22
21
  name: string;
23
22
  description: string;
24
23
  templatePath: string;
25
- generate: (name: string, destination: string, options: GeneratorOptions) => Promise<void>;
24
+ generate: (name: string, destination: string, options: any) => Promise<void>;
26
25
  };