@agents-at-scale/ark 0.1.36-rc1 → 0.1.36
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/package.json +1 -1
- 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/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.d.ts +0 -2
- package/dist/commands/chat.js +0 -45
- package/dist/commands/cluster/get-ip.d.ts +0 -2
- package/dist/commands/cluster/get-ip.js +0 -32
- package/dist/commands/cluster/get-type.d.ts +0 -2
- package/dist/commands/cluster/get-type.js +0 -26
- package/dist/commands/completion.d.ts +0 -2
- package/dist/commands/completion.js +0 -265
- package/dist/commands/config.d.ts +0 -2
- package/dist/commands/config.js +0 -44
- 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 -258
- 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/install.d.ts +0 -3
- package/dist/commands/install.js +0 -147
- package/dist/commands/models/selector.d.ts +0 -8
- package/dist/commands/models/selector.js +0 -53
- package/dist/commands/routes.d.ts +0 -2
- package/dist/commands/routes.js +0 -101
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.js +0 -33
- package/dist/commands/targets.d.ts +0 -2
- package/dist/commands/targets.js +0 -65
- package/dist/commands/teams/selector.d.ts +0 -8
- package/dist/commands/teams/selector.js +0 -55
- package/dist/commands/tools/selector.d.ts +0 -8
- package/dist/commands/tools/selector.js +0 -53
- package/dist/commands/uninstall.d.ts +0 -2
- package/dist/commands/uninstall.js +0 -83
- package/dist/components/DashboardCLI.d.ts +0 -3
- package/dist/components/DashboardCLI.js +0 -149
- package/dist/components/StatusView.d.ts +0 -10
- package/dist/components/StatusView.js +0 -39
- package/dist/config.d.ts +0 -23
- package/dist/config.js +0 -92
- package/dist/lib/arkClient.d.ts +0 -32
- package/dist/lib/arkClient.js +0 -43
- 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/config.test.d.ts +0 -1
- package/dist/lib/config.test.js +0 -93
- package/dist/lib/consts.d.ts +0 -9
- package/dist/lib/consts.js +0 -13
- 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/exec.d.ts +0 -1
- package/dist/lib/exec.js +0 -9
- package/dist/lib/gatewayManager.d.ts +0 -24
- package/dist/lib/gatewayManager.js +0 -85
- package/dist/lib/kubernetes.d.ts +0 -28
- package/dist/lib/kubernetes.js +0 -122
- package/dist/lib/portUtils.d.ts +0 -8
- package/dist/lib/portUtils.js +0 -39
- package/dist/lib/progress.d.ts +0 -128
- package/dist/lib/progress.js +0 -273
- package/dist/lib/queryRunner.d.ts +0 -22
- package/dist/lib/queryRunner.js +0 -142
- package/dist/lib/wrappers/git.d.ts +0 -2
- package/dist/lib/wrappers/git.js +0 -43
package/package.json
CHANGED
package/dist/charts/charts.d.ts
DELETED
package/dist/charts/charts.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { getInstallableServices } from '../arkServices.js';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use arkServices.ts instead. This file is kept for backward compatibility.
|
|
4
|
-
* Charts are now defined in arkServices.ts with comprehensive service definitions.
|
|
5
|
-
*/
|
|
6
|
-
export const charts = getInstallableServices();
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dependencies that should be installed before ARK charts
|
|
3
|
-
* Note: Dependencies will be installed in the order they are defined here
|
|
4
|
-
*/
|
|
5
|
-
export const dependencies = {
|
|
6
|
-
'cert-manager-repo': {
|
|
7
|
-
name: 'cert-manager-repo',
|
|
8
|
-
command: 'helm',
|
|
9
|
-
args: [
|
|
10
|
-
'repo',
|
|
11
|
-
'add',
|
|
12
|
-
'jetstack',
|
|
13
|
-
'https://charts.jetstack.io',
|
|
14
|
-
'--force-update',
|
|
15
|
-
],
|
|
16
|
-
description: 'Add Jetstack Helm repository',
|
|
17
|
-
},
|
|
18
|
-
'helm-repo-update': {
|
|
19
|
-
name: 'helm-repo-update',
|
|
20
|
-
command: 'helm',
|
|
21
|
-
args: ['repo', 'update'],
|
|
22
|
-
description: 'Update Helm repositories',
|
|
23
|
-
},
|
|
24
|
-
'cert-manager': {
|
|
25
|
-
name: 'cert-manager',
|
|
26
|
-
command: 'helm',
|
|
27
|
-
args: [
|
|
28
|
-
'upgrade',
|
|
29
|
-
'--install',
|
|
30
|
-
'cert-manager',
|
|
31
|
-
'jetstack/cert-manager',
|
|
32
|
-
'--namespace',
|
|
33
|
-
'cert-manager',
|
|
34
|
-
'--create-namespace',
|
|
35
|
-
'--set',
|
|
36
|
-
'crds.enabled=true',
|
|
37
|
-
],
|
|
38
|
-
description: 'Certificate management for Kubernetes',
|
|
39
|
-
},
|
|
40
|
-
'gateway-api-crds': {
|
|
41
|
-
name: 'gateway-api-crds',
|
|
42
|
-
command: 'kubectl',
|
|
43
|
-
args: [
|
|
44
|
-
'apply',
|
|
45
|
-
'-f',
|
|
46
|
-
'https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.3.0/standard-install.yaml',
|
|
47
|
-
],
|
|
48
|
-
description: 'Gateway API CRDs',
|
|
49
|
-
},
|
|
50
|
-
};
|
package/dist/charts/types.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a Helm chart configuration for ARK components
|
|
3
|
-
*/
|
|
4
|
-
export interface ArkChart {
|
|
5
|
-
/** Name of the chart (used as release name) */
|
|
6
|
-
name: string;
|
|
7
|
-
/** Full chart path (OCI registry or local path) */
|
|
8
|
-
chartPath: string;
|
|
9
|
-
/** Kubernetes namespace to install into */
|
|
10
|
-
namespace: string;
|
|
11
|
-
/** Additional arguments to pass to helm (e.g., --create-namespace, --wait, --timeout 300s, --set key=value) */
|
|
12
|
-
args?: string[];
|
|
13
|
-
/** Description of what this chart provides */
|
|
14
|
-
description?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Collection of ARK charts
|
|
18
|
-
*/
|
|
19
|
-
export interface ChartCollection {
|
|
20
|
-
[key: string]: ArkChart;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Represents a dependency that needs to be installed
|
|
24
|
-
*/
|
|
25
|
-
export interface Dependency {
|
|
26
|
-
/** Name of the dependency */
|
|
27
|
-
name: string;
|
|
28
|
-
/** Command to execute (helm, kubectl, etc.) */
|
|
29
|
-
command: string;
|
|
30
|
-
/** Arguments to pass to the command */
|
|
31
|
-
args: string[];
|
|
32
|
-
/** Description of what this dependency provides */
|
|
33
|
-
description?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Collection of dependencies
|
|
37
|
-
*/
|
|
38
|
-
export interface DependencyCollection {
|
|
39
|
-
[key: string]: Dependency;
|
|
40
|
-
}
|
package/dist/charts/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Agent, ArkApiClient } from '../../lib/arkApiClient.js';
|
|
2
|
-
interface AgentSelectorProps {
|
|
3
|
-
arkApiClient: ArkApiClient;
|
|
4
|
-
onSelect: (agent: Agent) => void;
|
|
5
|
-
onExit: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function AgentSelector({ arkApiClient, onSelect, onExit, }: AgentSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
export function AgentSelector({ arkApiClient, onSelect, onExit, }) {
|
|
5
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
6
|
-
const [agents, setAgents] = useState([]);
|
|
7
|
-
const [loading, setLoading] = useState(true);
|
|
8
|
-
const [error, setError] = useState(null);
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
arkApiClient
|
|
11
|
-
.getAgents()
|
|
12
|
-
.then((fetchedAgents) => {
|
|
13
|
-
setAgents(fetchedAgents);
|
|
14
|
-
setLoading(false);
|
|
15
|
-
})
|
|
16
|
-
.catch((err) => {
|
|
17
|
-
setError(err.message || 'Failed to fetch agents');
|
|
18
|
-
setLoading(false);
|
|
19
|
-
});
|
|
20
|
-
}, [arkApiClient]);
|
|
21
|
-
useInput((input, key) => {
|
|
22
|
-
if (key.escape) {
|
|
23
|
-
onExit();
|
|
24
|
-
}
|
|
25
|
-
else if (key.upArrow || input === 'k') {
|
|
26
|
-
setSelectedIndex((prev) => (prev === 0 ? agents.length - 1 : prev - 1));
|
|
27
|
-
}
|
|
28
|
-
else if (key.downArrow || input === 'j') {
|
|
29
|
-
setSelectedIndex((prev) => (prev === agents.length - 1 ? 0 : prev + 1));
|
|
30
|
-
}
|
|
31
|
-
else if (key.return) {
|
|
32
|
-
onSelect(agents[selectedIndex]);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
// Handle number keys for quick selection
|
|
36
|
-
const num = parseInt(input, 10);
|
|
37
|
-
if (!isNaN(num) && num >= 1 && num <= agents.length) {
|
|
38
|
-
onSelect(agents[num - 1]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
if (loading) {
|
|
43
|
-
return (_jsx(Box, { children: _jsx(Text, { children: "Loading agents..." }) }));
|
|
44
|
-
}
|
|
45
|
-
if (error) {
|
|
46
|
-
return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
|
|
47
|
-
}
|
|
48
|
-
if (agents.length === 0) {
|
|
49
|
-
return (_jsx(Box, { children: _jsx(Text, { children: "No agents available" }) }));
|
|
50
|
-
}
|
|
51
|
-
const selectedAgent = agents[selectedIndex];
|
|
52
|
-
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 2, paddingY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Select Agent" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Choose an agent to start a conversation with" }) }), _jsx(Box, { flexDirection: "column", children: agents.map((agent, index) => (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: index === selectedIndex ? 'green' : undefined, children: [index === selectedIndex ? '❯ ' : ' ', index + 1, ". ", agent.name] }) }, agent.name))) }), selectedAgent.description && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: selectedAgent.description }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Number to select \u00B7 Esc to exit" }) })] }));
|
|
53
|
-
}
|
package/dist/commands/agents.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { ArkApiProxy } from '../lib/arkApiProxy.js';
|
|
3
|
-
import output from '../lib/output.js';
|
|
4
|
-
async function listAgents(options) {
|
|
5
|
-
let proxy;
|
|
6
|
-
try {
|
|
7
|
-
proxy = new ArkApiProxy();
|
|
8
|
-
const arkApiClient = await proxy.start();
|
|
9
|
-
const agents = await arkApiClient.getAgents();
|
|
10
|
-
if (options.output === 'json') {
|
|
11
|
-
console.log(JSON.stringify(agents, null, 2));
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
if (agents.length === 0) {
|
|
15
|
-
output.warning('no agents available');
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
// Simple list output - just agent names with namespace prefix
|
|
19
|
-
agents.forEach(agent => {
|
|
20
|
-
console.log(`agent/${agent.name}`);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
output.error('fetching agents:', error instanceof Error ? error.message : error);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
if (proxy) {
|
|
30
|
-
proxy.stop();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function createAgentsCommand() {
|
|
35
|
-
const agentsCommand = new Command('agents');
|
|
36
|
-
agentsCommand
|
|
37
|
-
.description('list available agents')
|
|
38
|
-
.alias('agent')
|
|
39
|
-
.option('-o, --output <format>', 'output format (json or text)', 'text')
|
|
40
|
-
.action(async (options) => {
|
|
41
|
-
await listAgents(options);
|
|
42
|
-
});
|
|
43
|
-
// Add list subcommand (same as default action)
|
|
44
|
-
agentsCommand
|
|
45
|
-
.command('list')
|
|
46
|
-
.alias('ls')
|
|
47
|
-
.description('list all available agents')
|
|
48
|
-
.option('-o, --output <format>', 'output format (json or text)', 'text')
|
|
49
|
-
.action(async (options) => {
|
|
50
|
-
await listAgents(options);
|
|
51
|
-
});
|
|
52
|
-
return agentsCommand;
|
|
53
|
-
}
|
package/dist/commands/chat.d.ts
DELETED
package/dist/commands/chat.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { render } from 'ink';
|
|
4
|
-
import ChatUI from '../components/ChatUI.js';
|
|
5
|
-
import { ArkApiProxy } from '../lib/arkApiProxy.js';
|
|
6
|
-
import { loadConfig } from '../lib/config.js';
|
|
7
|
-
import output from '../lib/output.js';
|
|
8
|
-
export function createChatCommand() {
|
|
9
|
-
const chatCommand = new Command('chat');
|
|
10
|
-
chatCommand
|
|
11
|
-
.description('Start an interactive chat session with ARK agents or models')
|
|
12
|
-
.argument('[target]', 'Target to connect to (e.g., agent/sample-agent, model/default)')
|
|
13
|
-
.option('-a, --agent <name>', 'Connect directly to a specific agent')
|
|
14
|
-
.option('-m, --model <name>', 'Connect directly to a specific model')
|
|
15
|
-
.action(async (targetArg, options) => {
|
|
16
|
-
// Determine initial target from argument or options
|
|
17
|
-
let initialTargetId;
|
|
18
|
-
if (targetArg) {
|
|
19
|
-
// Direct target argument (e.g., "agent/sample-agent")
|
|
20
|
-
initialTargetId = targetArg;
|
|
21
|
-
}
|
|
22
|
-
else if (options.agent) {
|
|
23
|
-
// Agent option
|
|
24
|
-
initialTargetId = `agent/${options.agent}`;
|
|
25
|
-
}
|
|
26
|
-
else if (options.model) {
|
|
27
|
-
// Model option
|
|
28
|
-
initialTargetId = `model/${options.model}`;
|
|
29
|
-
}
|
|
30
|
-
// Load config
|
|
31
|
-
const config = loadConfig();
|
|
32
|
-
// Initialize proxy first - no spinner, just let ChatUI handle loading state
|
|
33
|
-
try {
|
|
34
|
-
const proxy = new ArkApiProxy();
|
|
35
|
-
const arkApiClient = await proxy.start();
|
|
36
|
-
// Pass the initialized client and config to ChatUI
|
|
37
|
-
render(_jsx(ChatUI, { initialTargetId: initialTargetId, arkApiClient: arkApiClient, arkApiProxy: proxy, config: config }));
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
output.error(error instanceof Error ? error.message : 'ARK API connection failed');
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
return chatCommand;
|
|
45
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { getClusterIp } from '../../lib/cluster.js';
|
|
4
|
-
export function createGetIpCommand() {
|
|
5
|
-
const getIp = new Command('get-ip');
|
|
6
|
-
getIp
|
|
7
|
-
.description('Get the IP address of the current Kubernetes cluster')
|
|
8
|
-
.option('-c, --context <context>', 'Kubernetes context to use')
|
|
9
|
-
.action(async (options) => {
|
|
10
|
-
try {
|
|
11
|
-
const clusterInfo = await getClusterIp(options.context);
|
|
12
|
-
if (clusterInfo.error) {
|
|
13
|
-
console.error(chalk.red('Error getting cluster IP:'), clusterInfo.error);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
if (!clusterInfo.ip) {
|
|
17
|
-
console.error(chalk.red('Could not determine cluster IP'));
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
console.log(clusterInfo.ip);
|
|
21
|
-
console.error(chalk.grey(`Cluster type: ${clusterInfo.type}`));
|
|
22
|
-
if (clusterInfo.context) {
|
|
23
|
-
console.error(chalk.grey(`Context: ${clusterInfo.context}`));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
console.error(chalk.red('Failed to get cluster IP:'), error.message);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return getIp;
|
|
32
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { Command } from 'commander';
|
|
3
|
-
import { detectClusterType } from '../../lib/cluster.js';
|
|
4
|
-
export function createGetTypeCommand() {
|
|
5
|
-
const getType = new Command('get-type');
|
|
6
|
-
getType
|
|
7
|
-
.description('Detect and display the current Kubernetes cluster type')
|
|
8
|
-
.action(async () => {
|
|
9
|
-
try {
|
|
10
|
-
const clusterInfo = await detectClusterType();
|
|
11
|
-
if (clusterInfo.error) {
|
|
12
|
-
console.error(chalk.red('Error detecting cluster type:'), clusterInfo.error);
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
15
|
-
console.log(clusterInfo.type);
|
|
16
|
-
if (clusterInfo.context) {
|
|
17
|
-
console.error(chalk.grey(`Context: ${clusterInfo.context}`));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
console.error(chalk.red('Failed to detect cluster type:'), error.message);
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
return getType;
|
|
26
|
-
}
|
|
@@ -1,265 +0,0 @@
|
|
|
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
|
-
console.log(`
|
|
140
|
-
#compdef ark
|
|
141
|
-
|
|
142
|
-
_ark() {
|
|
143
|
-
local context state line
|
|
144
|
-
|
|
145
|
-
_arguments -C \\
|
|
146
|
-
'1:command:->command' \\
|
|
147
|
-
'2:subcommand:->subcommand' \\
|
|
148
|
-
'*::arg:->args'
|
|
149
|
-
|
|
150
|
-
case $state in
|
|
151
|
-
command)
|
|
152
|
-
_values 'ark commands' \\
|
|
153
|
-
'agents[List available agents]' \\
|
|
154
|
-
'chat[Interactive chat with agents and models]' \\
|
|
155
|
-
'cluster[Cluster management commands]' \\
|
|
156
|
-
'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]' \\
|
|
169
|
-
'help[Show help information]'
|
|
170
|
-
;;
|
|
171
|
-
subcommand)
|
|
172
|
-
case $words[2] in
|
|
173
|
-
cluster)
|
|
174
|
-
_values 'cluster commands' \\
|
|
175
|
-
'get-ip[Get cluster IP address]' \\
|
|
176
|
-
'get-type[Get cluster type]'
|
|
177
|
-
;;
|
|
178
|
-
completion)
|
|
179
|
-
_values 'completion shells' \\
|
|
180
|
-
'bash[Generate bash completion]' \\
|
|
181
|
-
'zsh[Generate zsh completion]'
|
|
182
|
-
;;
|
|
183
|
-
check)
|
|
184
|
-
_values 'check commands' \\
|
|
185
|
-
'status[Check system status]'
|
|
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
|
-
;;
|
|
256
|
-
esac
|
|
257
|
-
;;
|
|
258
|
-
esac
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
_ark
|
|
262
|
-
`.trim());
|
|
263
|
-
});
|
|
264
|
-
return completion;
|
|
265
|
-
}
|