@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.
- package/dist/commands/cluster/index.d.ts +1 -2
- package/dist/commands/cluster/index.js +5 -3
- package/dist/commands/completion.js +2 -159
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.js +321 -38
- package/dist/commands/generate/config.js +24 -5
- package/dist/commands/generate/generators/agent.js +2 -2
- package/dist/commands/generate/generators/mcpserver.d.ts +1 -2
- package/dist/commands/generate/generators/mcpserver.js +5 -26
- package/dist/commands/generate/generators/project.js +41 -22
- package/dist/commands/generate/generators/team.js +2 -2
- package/dist/commands/generate/index.d.ts +1 -2
- package/dist/commands/generate/index.js +1 -1
- package/dist/components/statusChecker.d.ts +23 -13
- package/dist/components/statusChecker.js +129 -295
- package/dist/config.d.ts +22 -3
- package/dist/config.js +161 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -44
- package/dist/lib/cluster.d.ts +1 -2
- package/dist/lib/cluster.js +16 -37
- package/dist/lib/config.d.ts +80 -28
- package/dist/lib/config.js +205 -70
- package/dist/lib/consts.d.ts +1 -0
- package/dist/lib/consts.js +2 -0
- package/dist/lib/errors.js +1 -1
- package/dist/lib/exec.d.ts +4 -0
- package/dist/lib/exec.js +11 -0
- package/dist/lib/types.d.ts +3 -17
- package/dist/ui/MainMenu.d.ts +1 -5
- package/dist/ui/MainMenu.js +91 -222
- package/dist/ui/statusFormatter.d.ts +7 -22
- package/dist/ui/statusFormatter.js +39 -39
- package/package.json +5 -17
- package/dist/arkServices.d.ts +0 -42
- package/dist/arkServices.js +0 -138
- package/dist/arkServices.spec.d.ts +0 -1
- package/dist/arkServices.spec.js +0 -24
- package/dist/charts/charts.d.ts +0 -5
- package/dist/charts/charts.js +0 -6
- package/dist/charts/dependencies.d.ts +0 -6
- package/dist/charts/dependencies.js +0 -50
- package/dist/charts/types.d.ts +0 -40
- package/dist/charts/types.js +0 -1
- package/dist/commands/agents/index.d.ts +0 -3
- package/dist/commands/agents/index.js +0 -51
- package/dist/commands/agents/index.spec.d.ts +0 -1
- package/dist/commands/agents/index.spec.js +0 -67
- package/dist/commands/agents/selector.d.ts +0 -8
- package/dist/commands/agents/selector.js +0 -53
- package/dist/commands/agents.d.ts +0 -2
- package/dist/commands/agents.js +0 -53
- package/dist/commands/chat/index.d.ts +0 -3
- package/dist/commands/chat/index.js +0 -29
- package/dist/commands/chat.d.ts +0 -2
- package/dist/commands/chat.js +0 -45
- package/dist/commands/cluster/get.d.ts +0 -2
- package/dist/commands/cluster/get.js +0 -39
- package/dist/commands/cluster/get.spec.d.ts +0 -1
- package/dist/commands/cluster/get.spec.js +0 -92
- package/dist/commands/cluster/index.spec.d.ts +0 -1
- package/dist/commands/cluster/index.spec.js +0 -24
- package/dist/commands/completion/index.d.ts +0 -3
- package/dist/commands/completion/index.js +0 -290
- package/dist/commands/completion/index.spec.d.ts +0 -1
- package/dist/commands/completion/index.spec.js +0 -34
- package/dist/commands/config/index.d.ts +0 -3
- package/dist/commands/config/index.js +0 -42
- package/dist/commands/config/index.spec.d.ts +0 -1
- package/dist/commands/config/index.spec.js +0 -78
- package/dist/commands/dashboard/index.d.ts +0 -4
- package/dist/commands/dashboard/index.js +0 -39
- package/dist/commands/dashboard.d.ts +0 -3
- package/dist/commands/dashboard.js +0 -39
- package/dist/commands/dev/index.d.ts +0 -3
- package/dist/commands/dev/index.js +0 -9
- package/dist/commands/dev/tool/check.d.ts +0 -2
- package/dist/commands/dev/tool/check.js +0 -142
- package/dist/commands/dev/tool/clean.d.ts +0 -2
- package/dist/commands/dev/tool/clean.js +0 -153
- package/dist/commands/dev/tool/generate.d.ts +0 -2
- package/dist/commands/dev/tool/generate.js +0 -28
- package/dist/commands/dev/tool/index.d.ts +0 -2
- package/dist/commands/dev/tool/index.js +0 -14
- package/dist/commands/dev/tool/init.d.ts +0 -2
- package/dist/commands/dev/tool/init.js +0 -320
- package/dist/commands/dev/tool/shared.d.ts +0 -5
- package/dist/commands/dev/tool/shared.js +0 -256
- package/dist/commands/dev/tool/status.d.ts +0 -2
- package/dist/commands/dev/tool/status.js +0 -136
- package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
- package/dist/commands/dev/tool-generate.spec.js +0 -163
- package/dist/commands/dev/tool.d.ts +0 -2
- package/dist/commands/dev/tool.js +0 -559
- package/dist/commands/dev/tool.spec.d.ts +0 -1
- package/dist/commands/dev/tool.spec.js +0 -48
- package/dist/commands/docs/index.d.ts +0 -4
- package/dist/commands/docs/index.js +0 -18
- package/dist/commands/install/index.d.ts +0 -8
- package/dist/commands/install/index.js +0 -300
- package/dist/commands/install/index.spec.d.ts +0 -1
- package/dist/commands/install/index.spec.js +0 -143
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/install.js +0 -147
- package/dist/commands/models/create.d.ts +0 -1
- package/dist/commands/models/create.js +0 -213
- package/dist/commands/models/create.spec.d.ts +0 -1
- package/dist/commands/models/create.spec.js +0 -125
- package/dist/commands/models/index.d.ts +0 -3
- package/dist/commands/models/index.js +0 -60
- package/dist/commands/models/index.spec.d.ts +0 -1
- package/dist/commands/models/index.spec.js +0 -76
- package/dist/commands/models/selector.d.ts +0 -8
- package/dist/commands/models/selector.js +0 -53
- package/dist/commands/query/index.d.ts +0 -3
- package/dist/commands/query/index.js +0 -131
- package/dist/commands/routes/index.d.ts +0 -3
- package/dist/commands/routes/index.js +0 -93
- package/dist/commands/routes.d.ts +0 -2
- package/dist/commands/routes.js +0 -101
- package/dist/commands/status/index.d.ts +0 -4
- package/dist/commands/status/index.js +0 -262
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.js +0 -33
- package/dist/commands/targets/index.d.ts +0 -3
- package/dist/commands/targets/index.js +0 -65
- package/dist/commands/targets/index.spec.d.ts +0 -1
- package/dist/commands/targets/index.spec.js +0 -105
- package/dist/commands/targets.d.ts +0 -2
- package/dist/commands/targets.js +0 -65
- package/dist/commands/teams/index.d.ts +0 -3
- package/dist/commands/teams/index.js +0 -49
- package/dist/commands/teams/index.spec.d.ts +0 -1
- package/dist/commands/teams/index.spec.js +0 -70
- package/dist/commands/teams/selector.d.ts +0 -8
- package/dist/commands/teams/selector.js +0 -55
- package/dist/commands/tools/index.d.ts +0 -3
- package/dist/commands/tools/index.js +0 -49
- package/dist/commands/tools/index.spec.d.ts +0 -1
- package/dist/commands/tools/index.spec.js +0 -70
- package/dist/commands/tools/selector.d.ts +0 -8
- package/dist/commands/tools/selector.js +0 -53
- package/dist/commands/uninstall/index.d.ts +0 -3
- package/dist/commands/uninstall/index.js +0 -106
- package/dist/commands/uninstall/index.spec.d.ts +0 -1
- package/dist/commands/uninstall/index.spec.js +0 -125
- package/dist/commands/uninstall.d.ts +0 -2
- package/dist/commands/uninstall.js +0 -83
- package/dist/components/ChatUI.d.ts +0 -16
- package/dist/components/ChatUI.js +0 -801
- package/dist/components/StatusView.d.ts +0 -10
- package/dist/components/StatusView.js +0 -39
- package/dist/lib/arkApiClient.d.ts +0 -53
- package/dist/lib/arkApiClient.js +0 -102
- package/dist/lib/arkApiProxy.d.ts +0 -9
- package/dist/lib/arkApiProxy.js +0 -22
- package/dist/lib/arkServiceProxy.d.ts +0 -14
- package/dist/lib/arkServiceProxy.js +0 -95
- package/dist/lib/arkStatus.d.ts +0 -10
- package/dist/lib/arkStatus.js +0 -79
- package/dist/lib/arkStatus.spec.d.ts +0 -1
- package/dist/lib/arkStatus.spec.js +0 -49
- package/dist/lib/chatClient.d.ts +0 -33
- package/dist/lib/chatClient.js +0 -99
- package/dist/lib/cluster.spec.d.ts +0 -1
- package/dist/lib/cluster.spec.js +0 -338
- package/dist/lib/commandUtils.d.ts +0 -4
- package/dist/lib/commandUtils.js +0 -18
- package/dist/lib/commandUtils.test.d.ts +0 -1
- package/dist/lib/commandUtils.test.js +0 -44
- package/dist/lib/commands.d.ts +0 -16
- package/dist/lib/commands.js +0 -29
- package/dist/lib/commands.spec.d.ts +0 -1
- package/dist/lib/commands.spec.js +0 -146
- package/dist/lib/config.spec.d.ts +0 -1
- package/dist/lib/config.spec.js +0 -99
- package/dist/lib/config.test.d.ts +0 -1
- package/dist/lib/config.test.js +0 -93
- package/dist/lib/consts.spec.d.ts +0 -1
- package/dist/lib/consts.spec.js +0 -15
- package/dist/lib/dev/tools/analyzer.d.ts +0 -30
- package/dist/lib/dev/tools/analyzer.js +0 -190
- package/dist/lib/dev/tools/discover_tools.py +0 -392
- package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
- package/dist/lib/dev/tools/mcp-types.js +0 -86
- package/dist/lib/dev/tools/types.d.ts +0 -50
- package/dist/lib/dev/tools/types.js +0 -1
- package/dist/lib/errors.spec.d.ts +0 -1
- package/dist/lib/errors.spec.js +0 -221
- package/dist/lib/nextSteps.d.ts +0 -4
- package/dist/lib/nextSteps.js +0 -20
- package/dist/lib/nextSteps.spec.d.ts +0 -1
- package/dist/lib/nextSteps.spec.js +0 -59
- package/dist/lib/output.d.ts +0 -36
- package/dist/lib/output.js +0 -89
- package/dist/lib/output.spec.d.ts +0 -1
- package/dist/lib/output.spec.js +0 -123
- package/dist/lib/portUtils.d.ts +0 -8
- package/dist/lib/portUtils.js +0 -39
- package/dist/lib/startup.d.ts +0 -9
- package/dist/lib/startup.js +0 -93
- package/dist/lib/startup.spec.d.ts +0 -1
- package/dist/lib/startup.spec.js +0 -168
- package/dist/types/types.d.ts +0 -40
- package/dist/types/types.js +0 -1
- package/dist/ui/AgentSelector.d.ts +0 -8
- package/dist/ui/AgentSelector.js +0 -53
- package/dist/ui/ModelSelector.d.ts +0 -8
- package/dist/ui/ModelSelector.js +0 -53
- package/dist/ui/TeamSelector.d.ts +0 -8
- package/dist/ui/TeamSelector.js +0 -55
- package/dist/ui/ToolSelector.d.ts +0 -8
- package/dist/ui/ToolSelector.js +0 -53
- package/dist/ui/statusFormatter.spec.d.ts +0 -1
- package/dist/ui/statusFormatter.spec.js +0 -58
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
import {
|
|
3
|
-
|
|
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(
|
|
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="
|
|
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
|
-
'
|
|
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
|
package/dist/commands/config.js
CHANGED
|
@@ -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
|
|
4
|
-
import
|
|
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
|
|
7
|
-
|
|
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
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
console.log(chalk.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
-
const configured =
|
|
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:
|
|
24
|
+
generate: (name: string, destination: string, options: any) => Promise<void>;
|
|
26
25
|
};
|