@agents-at-scale/ark 0.1.33 → 0.1.35-rc.1
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/arkServices.d.ts +50 -0
- package/dist/arkServices.js +153 -0
- package/dist/charts/charts.d.ts +5 -0
- package/dist/charts/charts.js +6 -0
- package/dist/charts/dependencies.d.ts +6 -0
- package/dist/charts/dependencies.js +50 -0
- package/dist/charts/types.d.ts +40 -0
- package/dist/charts/types.js +1 -0
- package/dist/commands/agents/index.d.ts +2 -0
- package/dist/commands/agents/index.js +56 -0
- package/dist/commands/agents/selector.d.ts +8 -0
- package/dist/commands/agents/selector.js +53 -0
- package/dist/commands/agents.d.ts +2 -0
- package/dist/commands/agents.js +53 -0
- package/dist/commands/chat/index.d.ts +2 -0
- package/dist/commands/chat/index.js +45 -0
- package/dist/commands/chat.d.ts +2 -0
- package/dist/commands/chat.js +45 -0
- package/dist/commands/cluster/get.d.ts +2 -0
- package/dist/commands/cluster/get.js +39 -0
- package/dist/commands/cluster/index.js +2 -4
- package/dist/commands/completion/index.d.ts +2 -0
- package/dist/commands/completion/index.js +268 -0
- package/dist/commands/completion.js +159 -2
- package/dist/commands/config/index.d.ts +2 -0
- package/dist/commands/config/index.js +42 -0
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.js +38 -321
- package/dist/commands/dashboard/index.d.ts +3 -0
- package/dist/commands/dashboard/index.js +39 -0
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.js +39 -0
- package/dist/commands/dev/index.d.ts +2 -0
- package/dist/commands/dev/index.js +9 -0
- package/dist/commands/dev/tool/check.d.ts +2 -0
- package/dist/commands/dev/tool/check.js +142 -0
- package/dist/commands/dev/tool/clean.d.ts +2 -0
- package/dist/commands/dev/tool/clean.js +153 -0
- package/dist/commands/dev/tool/generate.d.ts +2 -0
- package/dist/commands/dev/tool/generate.js +28 -0
- package/dist/commands/dev/tool/index.d.ts +2 -0
- package/dist/commands/dev/tool/index.js +14 -0
- package/dist/commands/dev/tool/init.d.ts +2 -0
- package/dist/commands/dev/tool/init.js +320 -0
- package/dist/commands/dev/tool/shared.d.ts +5 -0
- package/dist/commands/dev/tool/shared.js +256 -0
- package/dist/commands/dev/tool/status.d.ts +2 -0
- package/dist/commands/dev/tool/status.js +136 -0
- package/dist/commands/dev/tool.d.ts +2 -0
- package/dist/commands/dev/tool.js +559 -0
- package/dist/commands/generate/config.js +5 -24
- package/dist/commands/generate/generators/mcpserver.d.ts +2 -1
- package/dist/commands/generate/generators/mcpserver.js +26 -5
- package/dist/commands/install/index.d.ts +6 -0
- package/dist/commands/install/index.js +165 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.js +147 -0
- package/dist/commands/models/create.d.ts +1 -0
- package/dist/commands/models/create.js +213 -0
- package/dist/commands/models/index.d.ts +2 -0
- package/dist/commands/models/index.js +65 -0
- package/dist/commands/models/selector.d.ts +8 -0
- package/dist/commands/models/selector.js +53 -0
- package/dist/commands/routes/index.d.ts +2 -0
- package/dist/commands/routes/index.js +101 -0
- package/dist/commands/routes.d.ts +2 -0
- package/dist/commands/routes.js +101 -0
- package/dist/commands/status/index.d.ts +3 -0
- package/dist/commands/status/index.js +33 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +33 -0
- package/dist/commands/targets/index.d.ts +2 -0
- package/dist/commands/targets/index.js +65 -0
- package/dist/commands/targets.d.ts +2 -0
- package/dist/commands/targets.js +65 -0
- package/dist/commands/teams/index.d.ts +2 -0
- package/dist/commands/teams/index.js +54 -0
- package/dist/commands/teams/selector.d.ts +8 -0
- package/dist/commands/teams/selector.js +55 -0
- package/dist/commands/tools/index.d.ts +2 -0
- package/dist/commands/tools/index.js +54 -0
- package/dist/commands/tools/selector.d.ts +8 -0
- package/dist/commands/tools/selector.js +53 -0
- package/dist/commands/uninstall/index.d.ts +2 -0
- package/dist/commands/uninstall/index.js +84 -0
- package/dist/commands/uninstall.d.ts +2 -0
- package/dist/commands/uninstall.js +83 -0
- package/dist/components/ChatUI.d.ts +16 -0
- package/dist/components/ChatUI.js +801 -0
- package/dist/components/StatusView.d.ts +10 -0
- package/dist/components/StatusView.js +39 -0
- package/dist/components/statusChecker.d.ts +10 -13
- package/dist/components/statusChecker.js +128 -65
- package/dist/config.js +3 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31 -36
- package/dist/lib/arkApiClient.d.ts +53 -0
- package/dist/lib/arkApiClient.js +102 -0
- package/dist/lib/arkApiProxy.d.ts +9 -0
- package/dist/lib/arkApiProxy.js +22 -0
- package/dist/lib/arkServiceProxy.d.ts +14 -0
- package/dist/lib/arkServiceProxy.js +93 -0
- package/dist/lib/arkStatus.d.ts +5 -0
- package/dist/lib/arkStatus.js +20 -0
- package/dist/lib/chatClient.d.ts +33 -0
- package/dist/lib/chatClient.js +101 -0
- package/dist/lib/cluster.d.ts +2 -1
- package/dist/lib/cluster.js +27 -3
- package/dist/lib/commandUtils.d.ts +4 -0
- package/dist/lib/commandUtils.js +18 -0
- package/dist/lib/commandUtils.test.d.ts +1 -0
- package/dist/lib/commandUtils.test.js +44 -0
- package/dist/lib/config.d.ts +24 -80
- package/dist/lib/config.js +68 -205
- package/dist/lib/config.test.d.ts +1 -0
- package/dist/lib/config.test.js +93 -0
- package/dist/lib/dev/tools/analyzer.d.ts +30 -0
- package/dist/lib/dev/tools/analyzer.js +190 -0
- package/dist/lib/dev/tools/discover_tools.py +392 -0
- package/dist/lib/dev/tools/mcp-types.d.ts +28 -0
- package/dist/lib/dev/tools/mcp-types.js +86 -0
- package/dist/lib/dev/tools/types.d.ts +50 -0
- package/dist/lib/dev/tools/types.js +1 -0
- package/dist/lib/output.d.ts +36 -0
- package/dist/lib/output.js +89 -0
- package/dist/lib/types.d.ts +8 -3
- package/dist/types/types.d.ts +40 -0
- package/dist/types/types.js +1 -0
- package/dist/ui/MainMenu.js +158 -90
- package/dist/ui/statusFormatter.d.ts +4 -1
- package/dist/ui/statusFormatter.js +91 -19
- package/package.json +16 -4
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
export function createCompletionCommand() {
|
|
4
|
+
const completion = new Command('completion');
|
|
5
|
+
completion.description('Generate shell completion scripts').action(() => {
|
|
6
|
+
console.log(chalk.cyan('Shell completion for ARK CLI'));
|
|
7
|
+
console.log('');
|
|
8
|
+
console.log('Usage:');
|
|
9
|
+
console.log(' ark completion bash Generate bash completion script');
|
|
10
|
+
console.log(' ark completion zsh Generate zsh completion script');
|
|
11
|
+
console.log('');
|
|
12
|
+
console.log('To enable completion, add this to your shell profile:');
|
|
13
|
+
console.log(chalk.grey(' # For bash:'));
|
|
14
|
+
console.log(chalk.grey(' eval "$(ark completion bash)"'));
|
|
15
|
+
console.log(chalk.grey(' # For zsh:'));
|
|
16
|
+
console.log(chalk.grey(' eval "$(ark completion zsh)"'));
|
|
17
|
+
});
|
|
18
|
+
completion
|
|
19
|
+
.command('bash')
|
|
20
|
+
.description('Generate bash completion script')
|
|
21
|
+
.action(() => {
|
|
22
|
+
console.log(`
|
|
23
|
+
_ark_completion() {
|
|
24
|
+
local cur prev opts
|
|
25
|
+
COMPREPLY=()
|
|
26
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
27
|
+
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
28
|
+
|
|
29
|
+
case \${COMP_CWORD} in
|
|
30
|
+
1)
|
|
31
|
+
opts="agents chat cluster completion config dashboard dev generate install models routes status targets teams tools uninstall help"
|
|
32
|
+
COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
|
|
33
|
+
return 0
|
|
34
|
+
;;
|
|
35
|
+
2)
|
|
36
|
+
case \${prev} in
|
|
37
|
+
cluster)
|
|
38
|
+
opts="get-ip get-type"
|
|
39
|
+
COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
|
|
40
|
+
return 0
|
|
41
|
+
;;
|
|
42
|
+
completion)
|
|
43
|
+
opts="bash zsh"
|
|
44
|
+
COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
|
|
45
|
+
return 0
|
|
46
|
+
;;
|
|
47
|
+
check)
|
|
48
|
+
opts="status"
|
|
49
|
+
COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
|
|
50
|
+
return 0
|
|
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
|
+
esac
|
|
128
|
+
;;
|
|
129
|
+
esac
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
complete -F _ark_completion ark
|
|
133
|
+
`.trim());
|
|
134
|
+
});
|
|
135
|
+
completion
|
|
136
|
+
.command('zsh')
|
|
137
|
+
.description('Generate zsh completion script')
|
|
138
|
+
.action(() => {
|
|
139
|
+
// Shell script requires escaped $ characters
|
|
140
|
+
/* eslint-disable no-useless-escape */
|
|
141
|
+
console.log(`
|
|
142
|
+
#compdef ark
|
|
143
|
+
|
|
144
|
+
_ark() {
|
|
145
|
+
local context state line
|
|
146
|
+
|
|
147
|
+
_arguments -C \\
|
|
148
|
+
'1:command:->command' \\
|
|
149
|
+
'2:subcommand:->subcommand' \\
|
|
150
|
+
'*::arg:->args'
|
|
151
|
+
|
|
152
|
+
case $state in
|
|
153
|
+
command)
|
|
154
|
+
_values 'ark commands' \\
|
|
155
|
+
'agents[List available agents]' \\
|
|
156
|
+
'chat[Interactive chat with agents and models]' \\
|
|
157
|
+
'cluster[Cluster management commands]' \\
|
|
158
|
+
'completion[Generate shell completion scripts]' \\
|
|
159
|
+
'config[Configuration management]' \\
|
|
160
|
+
'dashboard[Open ARK dashboard]' \\
|
|
161
|
+
'dev[Development tools for ARK]' \\
|
|
162
|
+
'generate[Generate ARK resources]' \\
|
|
163
|
+
'install[Install ARK services]' \\
|
|
164
|
+
'models[List available models]' \\
|
|
165
|
+
'routes[List available routes]' \\
|
|
166
|
+
'status[Check system status]' \\
|
|
167
|
+
'targets[List available query targets]' \\
|
|
168
|
+
'teams[List available teams]' \\
|
|
169
|
+
'tools[List available tools]' \\
|
|
170
|
+
'uninstall[Uninstall ARK services]' \\
|
|
171
|
+
'help[Show help information]'
|
|
172
|
+
;;
|
|
173
|
+
subcommand)
|
|
174
|
+
case $words[2] in
|
|
175
|
+
cluster)
|
|
176
|
+
_values 'cluster commands' \\
|
|
177
|
+
'get-ip[Get cluster IP address]' \\
|
|
178
|
+
'get-type[Get cluster type]'
|
|
179
|
+
;;
|
|
180
|
+
completion)
|
|
181
|
+
_values 'completion shells' \\
|
|
182
|
+
'bash[Generate bash completion]' \\
|
|
183
|
+
'zsh[Generate zsh completion]'
|
|
184
|
+
;;
|
|
185
|
+
check)
|
|
186
|
+
_values 'check commands' \\
|
|
187
|
+
'status[Check system status]'
|
|
188
|
+
;;
|
|
189
|
+
targets)
|
|
190
|
+
_values 'targets commands' \\
|
|
191
|
+
'list[List all available targets]' \\
|
|
192
|
+
'ls[List all available targets]'
|
|
193
|
+
;;
|
|
194
|
+
agents)
|
|
195
|
+
_values 'agents commands' \\
|
|
196
|
+
'list[List all available agents]' \\
|
|
197
|
+
'ls[List all available agents]'
|
|
198
|
+
;;
|
|
199
|
+
models)
|
|
200
|
+
_values 'models commands' \\
|
|
201
|
+
'list[List all available models]' \\
|
|
202
|
+
'ls[List all available models]' \\
|
|
203
|
+
'create[Create a new model]'
|
|
204
|
+
;;
|
|
205
|
+
teams)
|
|
206
|
+
_values 'teams commands' \\
|
|
207
|
+
'list[List all available teams]' \\
|
|
208
|
+
'ls[List all available teams]'
|
|
209
|
+
;;
|
|
210
|
+
tools)
|
|
211
|
+
_values 'tools commands' \\
|
|
212
|
+
'list[List all available tools]' \\
|
|
213
|
+
'ls[List all available tools]'
|
|
214
|
+
;;
|
|
215
|
+
dev)
|
|
216
|
+
_values 'dev commands' \\
|
|
217
|
+
'tool[MCP tool development utilities]'
|
|
218
|
+
;;
|
|
219
|
+
generate)
|
|
220
|
+
_values 'generate types' \\
|
|
221
|
+
'agent[Generate a new agent]' \\
|
|
222
|
+
'marketplace[Generate marketplace content]' \\
|
|
223
|
+
'mcp-server[Generate MCP server]' \\
|
|
224
|
+
'project[Generate a new project]' \\
|
|
225
|
+
'query[Generate a query]' \\
|
|
226
|
+
'team[Generate a team]'
|
|
227
|
+
;;
|
|
228
|
+
chat)
|
|
229
|
+
# Get available targets dynamically
|
|
230
|
+
local -a targets
|
|
231
|
+
targets=($(ark targets list 2>/dev/null))
|
|
232
|
+
if [ \${#targets[@]} -eq 0 ]; then
|
|
233
|
+
targets=('agent/sample-agent' 'agent/math' 'agent/weather' 'model/default')
|
|
234
|
+
fi
|
|
235
|
+
_values 'available targets' \${targets[@]}
|
|
236
|
+
;;
|
|
237
|
+
esac
|
|
238
|
+
;;
|
|
239
|
+
args)
|
|
240
|
+
case \$words[2] in
|
|
241
|
+
dev)
|
|
242
|
+
if [[ \$words[3] == "tool" ]]; then
|
|
243
|
+
case \$words[4] in
|
|
244
|
+
check|init|generate)
|
|
245
|
+
# Complete with directories
|
|
246
|
+
_files -/
|
|
247
|
+
;;
|
|
248
|
+
*)
|
|
249
|
+
_values 'tool commands' \\
|
|
250
|
+
'check[Check the status of an MCP tool project]' \\
|
|
251
|
+
'init[Initialize an MCP tool project]' \\
|
|
252
|
+
'generate[Generate project files from templates]' \\
|
|
253
|
+
'clean[Remove template-generated files]'
|
|
254
|
+
;;
|
|
255
|
+
esac
|
|
256
|
+
fi
|
|
257
|
+
;;
|
|
258
|
+
esac
|
|
259
|
+
;;
|
|
260
|
+
esac
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
_ark
|
|
264
|
+
`.trim());
|
|
265
|
+
/* eslint-enable no-useless-escape */
|
|
266
|
+
});
|
|
267
|
+
return completion;
|
|
268
|
+
}
|
|
@@ -28,7 +28,7 @@ _ark_completion() {
|
|
|
28
28
|
|
|
29
29
|
case \${COMP_CWORD} in
|
|
30
30
|
1)
|
|
31
|
-
opts="cluster completion
|
|
31
|
+
opts="agents chat cluster completion config dashboard dev generate install models routes status targets teams tools uninstall help"
|
|
32
32
|
COMPREPLY=( $(compgen -W "\${opts}" -- \${cur}) )
|
|
33
33
|
return 0
|
|
34
34
|
;;
|
|
@@ -49,6 +49,81 @@ _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
|
+
;;
|
|
52
127
|
esac
|
|
53
128
|
;;
|
|
54
129
|
esac
|
|
@@ -75,9 +150,22 @@ _ark() {
|
|
|
75
150
|
case $state in
|
|
76
151
|
command)
|
|
77
152
|
_values 'ark commands' \\
|
|
153
|
+
'agents[List available agents]' \\
|
|
154
|
+
'chat[Interactive chat with agents and models]' \\
|
|
78
155
|
'cluster[Cluster management commands]' \\
|
|
79
156
|
'completion[Generate shell completion scripts]' \\
|
|
80
|
-
'
|
|
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]' \\
|
|
81
169
|
'help[Show help information]'
|
|
82
170
|
;;
|
|
83
171
|
subcommand)
|
|
@@ -96,6 +184,75 @@ _ark() {
|
|
|
96
184
|
_values 'check commands' \\
|
|
97
185
|
'status[Check system status]'
|
|
98
186
|
;;
|
|
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
|
+
;;
|
|
99
256
|
esac
|
|
100
257
|
;;
|
|
101
258
|
esac
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { loadConfig, getConfigPaths, formatConfig } from '../../lib/config.js';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
export function createConfigCommand() {
|
|
6
|
+
const configCommand = new Command('config');
|
|
7
|
+
configCommand.description('Show current configuration').action(() => {
|
|
8
|
+
const config = loadConfig();
|
|
9
|
+
const paths = getConfigPaths();
|
|
10
|
+
console.log();
|
|
11
|
+
// User config
|
|
12
|
+
if (fs.existsSync(paths.user)) {
|
|
13
|
+
console.log(chalk.green('✓'), chalk.white(paths.user));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.log(chalk.red('✗'), chalk.white(paths.user), chalk.gray(`doesn't exist`));
|
|
17
|
+
}
|
|
18
|
+
// Project config
|
|
19
|
+
if (fs.existsSync(paths.project)) {
|
|
20
|
+
console.log(chalk.green('✓'), chalk.white(paths.project));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.log(chalk.red('✗'), chalk.white(paths.project), chalk.gray(`doesn't exist`));
|
|
24
|
+
}
|
|
25
|
+
// Environment variables
|
|
26
|
+
if (process.env.ARK_CHAT_STREAMING !== undefined) {
|
|
27
|
+
console.log(chalk.green('✓'), chalk.white('ARK_CHAT_STREAMING'), chalk.gray(process.env.ARK_CHAT_STREAMING));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
console.log(chalk.red('✗'), chalk.white('ARK_CHAT_STREAMING'), chalk.gray('not set'));
|
|
31
|
+
}
|
|
32
|
+
if (process.env.ARK_CHAT_OUTPUT_FORMAT !== undefined) {
|
|
33
|
+
console.log(chalk.green('✓'), chalk.white('ARK_CHAT_OUTPUT_FORMAT'), chalk.gray(process.env.ARK_CHAT_OUTPUT_FORMAT));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
console.log(chalk.red('✗'), chalk.white('ARK_CHAT_OUTPUT_FORMAT'), chalk.gray('not set'));
|
|
37
|
+
}
|
|
38
|
+
console.log();
|
|
39
|
+
console.log(formatConfig(config));
|
|
40
|
+
});
|
|
41
|
+
return configCommand;
|
|
42
|
+
}
|