@agents-at-scale/ark 0.1.34 → 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.
Files changed (132) hide show
  1. package/dist/arkServices.d.ts +50 -0
  2. package/dist/arkServices.js +153 -0
  3. package/dist/charts/charts.d.ts +5 -0
  4. package/dist/charts/charts.js +6 -0
  5. package/dist/charts/dependencies.d.ts +6 -0
  6. package/dist/charts/dependencies.js +50 -0
  7. package/dist/charts/types.d.ts +40 -0
  8. package/dist/charts/types.js +1 -0
  9. package/dist/commands/agents/index.d.ts +2 -0
  10. package/dist/commands/agents/index.js +56 -0
  11. package/dist/commands/agents/selector.d.ts +8 -0
  12. package/dist/commands/agents/selector.js +53 -0
  13. package/dist/commands/agents.d.ts +2 -0
  14. package/dist/commands/agents.js +53 -0
  15. package/dist/commands/chat/index.d.ts +2 -0
  16. package/dist/commands/chat/index.js +45 -0
  17. package/dist/commands/chat.d.ts +2 -0
  18. package/dist/commands/chat.js +45 -0
  19. package/dist/commands/cluster/get.d.ts +2 -0
  20. package/dist/commands/cluster/get.js +39 -0
  21. package/dist/commands/cluster/index.js +2 -4
  22. package/dist/commands/completion/index.d.ts +2 -0
  23. package/dist/commands/completion/index.js +268 -0
  24. package/dist/commands/completion.js +159 -2
  25. package/dist/commands/config/index.d.ts +2 -0
  26. package/dist/commands/config/index.js +42 -0
  27. package/dist/commands/config.d.ts +0 -3
  28. package/dist/commands/config.js +38 -321
  29. package/dist/commands/dashboard/index.d.ts +3 -0
  30. package/dist/commands/dashboard/index.js +39 -0
  31. package/dist/commands/dashboard.d.ts +3 -0
  32. package/dist/commands/dashboard.js +39 -0
  33. package/dist/commands/dev/index.d.ts +2 -0
  34. package/dist/commands/dev/index.js +9 -0
  35. package/dist/commands/dev/tool/check.d.ts +2 -0
  36. package/dist/commands/dev/tool/check.js +142 -0
  37. package/dist/commands/dev/tool/clean.d.ts +2 -0
  38. package/dist/commands/dev/tool/clean.js +153 -0
  39. package/dist/commands/dev/tool/generate.d.ts +2 -0
  40. package/dist/commands/dev/tool/generate.js +28 -0
  41. package/dist/commands/dev/tool/index.d.ts +2 -0
  42. package/dist/commands/dev/tool/index.js +14 -0
  43. package/dist/commands/dev/tool/init.d.ts +2 -0
  44. package/dist/commands/dev/tool/init.js +320 -0
  45. package/dist/commands/dev/tool/shared.d.ts +5 -0
  46. package/dist/commands/dev/tool/shared.js +256 -0
  47. package/dist/commands/dev/tool/status.d.ts +2 -0
  48. package/dist/commands/dev/tool/status.js +136 -0
  49. package/dist/commands/dev/tool.d.ts +2 -0
  50. package/dist/commands/dev/tool.js +559 -0
  51. package/dist/commands/generate/config.js +5 -24
  52. package/dist/commands/generate/generators/mcpserver.d.ts +2 -1
  53. package/dist/commands/generate/generators/mcpserver.js +26 -5
  54. package/dist/commands/install/index.d.ts +6 -0
  55. package/dist/commands/install/index.js +165 -0
  56. package/dist/commands/install.d.ts +3 -0
  57. package/dist/commands/install.js +147 -0
  58. package/dist/commands/models/create.d.ts +1 -0
  59. package/dist/commands/models/create.js +213 -0
  60. package/dist/commands/models/index.d.ts +2 -0
  61. package/dist/commands/models/index.js +65 -0
  62. package/dist/commands/models/selector.d.ts +8 -0
  63. package/dist/commands/models/selector.js +53 -0
  64. package/dist/commands/routes/index.d.ts +2 -0
  65. package/dist/commands/routes/index.js +101 -0
  66. package/dist/commands/routes.d.ts +2 -0
  67. package/dist/commands/routes.js +101 -0
  68. package/dist/commands/status/index.d.ts +3 -0
  69. package/dist/commands/status/index.js +33 -0
  70. package/dist/commands/status.d.ts +3 -0
  71. package/dist/commands/status.js +33 -0
  72. package/dist/commands/targets/index.d.ts +2 -0
  73. package/dist/commands/targets/index.js +65 -0
  74. package/dist/commands/targets.d.ts +2 -0
  75. package/dist/commands/targets.js +65 -0
  76. package/dist/commands/teams/index.d.ts +2 -0
  77. package/dist/commands/teams/index.js +54 -0
  78. package/dist/commands/teams/selector.d.ts +8 -0
  79. package/dist/commands/teams/selector.js +55 -0
  80. package/dist/commands/tools/index.d.ts +2 -0
  81. package/dist/commands/tools/index.js +54 -0
  82. package/dist/commands/tools/selector.d.ts +8 -0
  83. package/dist/commands/tools/selector.js +53 -0
  84. package/dist/commands/uninstall/index.d.ts +2 -0
  85. package/dist/commands/uninstall/index.js +84 -0
  86. package/dist/commands/uninstall.d.ts +2 -0
  87. package/dist/commands/uninstall.js +83 -0
  88. package/dist/components/ChatUI.d.ts +16 -0
  89. package/dist/components/ChatUI.js +801 -0
  90. package/dist/components/StatusView.d.ts +10 -0
  91. package/dist/components/StatusView.js +39 -0
  92. package/dist/components/statusChecker.d.ts +10 -13
  93. package/dist/components/statusChecker.js +128 -65
  94. package/dist/config.js +3 -10
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +31 -36
  97. package/dist/lib/arkApiClient.d.ts +53 -0
  98. package/dist/lib/arkApiClient.js +102 -0
  99. package/dist/lib/arkApiProxy.d.ts +9 -0
  100. package/dist/lib/arkApiProxy.js +22 -0
  101. package/dist/lib/arkServiceProxy.d.ts +14 -0
  102. package/dist/lib/arkServiceProxy.js +93 -0
  103. package/dist/lib/arkStatus.d.ts +5 -0
  104. package/dist/lib/arkStatus.js +20 -0
  105. package/dist/lib/chatClient.d.ts +33 -0
  106. package/dist/lib/chatClient.js +101 -0
  107. package/dist/lib/cluster.d.ts +2 -1
  108. package/dist/lib/cluster.js +27 -3
  109. package/dist/lib/commandUtils.d.ts +4 -0
  110. package/dist/lib/commandUtils.js +18 -0
  111. package/dist/lib/commandUtils.test.d.ts +1 -0
  112. package/dist/lib/commandUtils.test.js +44 -0
  113. package/dist/lib/config.d.ts +24 -80
  114. package/dist/lib/config.js +68 -205
  115. package/dist/lib/config.test.d.ts +1 -0
  116. package/dist/lib/config.test.js +93 -0
  117. package/dist/lib/dev/tools/analyzer.d.ts +30 -0
  118. package/dist/lib/dev/tools/analyzer.js +190 -0
  119. package/dist/lib/dev/tools/discover_tools.py +392 -0
  120. package/dist/lib/dev/tools/mcp-types.d.ts +28 -0
  121. package/dist/lib/dev/tools/mcp-types.js +86 -0
  122. package/dist/lib/dev/tools/types.d.ts +50 -0
  123. package/dist/lib/dev/tools/types.js +1 -0
  124. package/dist/lib/output.d.ts +36 -0
  125. package/dist/lib/output.js +89 -0
  126. package/dist/lib/types.d.ts +8 -3
  127. package/dist/types/types.d.ts +40 -0
  128. package/dist/types/types.js +1 -0
  129. package/dist/ui/MainMenu.js +158 -90
  130. package/dist/ui/statusFormatter.d.ts +4 -1
  131. package/dist/ui/statusFormatter.js +91 -19
  132. package/package.json +16 -4
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Centralized ARK service definitions used by both install and status commands
3
+ */
4
+ export interface ArkService {
5
+ name: string;
6
+ helmReleaseName: string;
7
+ description: string;
8
+ namespace: string;
9
+ healthPath?: string;
10
+ gatewayUrl?: string;
11
+ chartPath?: string;
12
+ installArgs?: string[];
13
+ k8sServiceName?: string;
14
+ k8sServicePort?: number;
15
+ k8sPortForwardLocalPort?: number;
16
+ k8sDeploymentName?: string;
17
+ }
18
+ export interface ServiceCollection {
19
+ [key: string]: ArkService;
20
+ }
21
+ export interface ArkDependency {
22
+ name: string;
23
+ command: string;
24
+ args: string[];
25
+ description: string;
26
+ }
27
+ export interface DependencyCollection {
28
+ [key: string]: ArkDependency;
29
+ }
30
+ /**
31
+ * Dependencies that should be installed before ARK services
32
+ * Note: Dependencies will be installed in the order they are defined here
33
+ */
34
+ export declare const arkDependencies: DependencyCollection;
35
+ /**
36
+ * Core ARK services with their installation and status check configurations
37
+ */
38
+ export declare const arkServices: ServiceCollection;
39
+ /**
40
+ * Get services that can be installed via Helm charts
41
+ */
42
+ export declare function getInstallableServices(): ServiceCollection;
43
+ /**
44
+ * Get services that can be checked for status
45
+ */
46
+ export declare function getStatusCheckableServices(): Record<string, string>;
47
+ /**
48
+ * Get health check path for a specific service
49
+ */
50
+ export declare function getHealthPath(serviceName: string): string;
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Centralized ARK service definitions used by both install and status commands
3
+ */
4
+ const LOCALHOST_GATEWAY_PORT = 8080;
5
+ const REGISTRY_BASE = 'oci://ghcr.io/mckinsey/agents-at-scale-ark/charts';
6
+ /**
7
+ * Dependencies that should be installed before ARK services
8
+ * Note: Dependencies will be installed in the order they are defined here
9
+ */
10
+ export const arkDependencies = {
11
+ 'cert-manager-repo': {
12
+ name: 'cert-manager-repo',
13
+ command: 'helm',
14
+ args: [
15
+ 'repo',
16
+ 'add',
17
+ 'jetstack',
18
+ 'https://charts.jetstack.io',
19
+ '--force-update',
20
+ ],
21
+ description: 'Add Jetstack Helm repository',
22
+ },
23
+ 'helm-repo-update': {
24
+ name: 'helm-repo-update',
25
+ command: 'helm',
26
+ args: ['repo', 'update'],
27
+ description: 'Update Helm repositories',
28
+ },
29
+ 'cert-manager': {
30
+ name: 'cert-manager',
31
+ command: 'helm',
32
+ args: [
33
+ 'upgrade',
34
+ '--install',
35
+ 'cert-manager',
36
+ 'jetstack/cert-manager',
37
+ '--namespace',
38
+ 'cert-manager',
39
+ '--create-namespace',
40
+ '--set',
41
+ 'crds.enabled=true',
42
+ ],
43
+ description: 'Certificate management for Kubernetes',
44
+ },
45
+ 'gateway-api-crds': {
46
+ name: 'gateway-api-crds',
47
+ command: 'kubectl',
48
+ args: [
49
+ 'apply',
50
+ '-f',
51
+ 'https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.3.0/standard-install.yaml',
52
+ ],
53
+ description: 'Gateway API CRDs',
54
+ },
55
+ };
56
+ /**
57
+ * Core ARK services with their installation and status check configurations
58
+ */
59
+ export const arkServices = {
60
+ 'ark-controller': {
61
+ name: 'ark-controller',
62
+ helmReleaseName: 'ark-controller',
63
+ description: 'Core ARK controller for managing AI resources',
64
+ namespace: 'ark-system',
65
+ chartPath: `${REGISTRY_BASE}/ark-controller`,
66
+ installArgs: ['--create-namespace', '--set', 'rbac.enable=true'],
67
+ k8sDeploymentName: 'ark-controller',
68
+ },
69
+ 'ark-api': {
70
+ name: 'ark-api',
71
+ helmReleaseName: 'ark-api',
72
+ description: 'ARK API service for interacting with ARK resources',
73
+ namespace: 'default',
74
+ healthPath: '/health',
75
+ gatewayUrl: `http://ark-api.127.0.0.1.nip.io:${LOCALHOST_GATEWAY_PORT}`,
76
+ chartPath: `${REGISTRY_BASE}/ark-api`,
77
+ installArgs: [],
78
+ k8sServiceName: 'ark-api',
79
+ k8sServicePort: 80,
80
+ k8sPortForwardLocalPort: 34780,
81
+ k8sDeploymentName: 'ark-api',
82
+ },
83
+ 'ark-dashboard': {
84
+ name: 'ark-dashboard',
85
+ helmReleaseName: 'ark-dashboard',
86
+ description: 'Web-based dashboard for ARK',
87
+ namespace: 'default',
88
+ healthPath: '',
89
+ gatewayUrl: `http://dashboard.127.0.0.1.nip.io:${LOCALHOST_GATEWAY_PORT}`,
90
+ chartPath: `${REGISTRY_BASE}/ark-dashboard`,
91
+ installArgs: [],
92
+ k8sServiceName: 'ark-dashboard',
93
+ k8sServicePort: 3000,
94
+ k8sPortForwardLocalPort: 3274,
95
+ k8sDeploymentName: 'ark-dashboard',
96
+ },
97
+ 'ark-api-a2a': {
98
+ name: 'ark-api-a2a',
99
+ helmReleaseName: 'ark-api-a2a',
100
+ description: 'ARK API agent-to-agent communication service',
101
+ namespace: 'default',
102
+ healthPath: '/health',
103
+ gatewayUrl: `http://ark-api-a2a.127.0.0.1.nip.io:${LOCALHOST_GATEWAY_PORT}`,
104
+ // Note: This service might be installed as part of ark-api or separately
105
+ },
106
+ 'ark-mcp': {
107
+ name: 'ark-mcp',
108
+ helmReleaseName: 'ark-mcp',
109
+ description: 'MCP (Model Context Protocol) services for ARK',
110
+ namespace: 'default',
111
+ chartPath: `${REGISTRY_BASE}/ark-mcp`,
112
+ installArgs: [],
113
+ },
114
+ 'localhost-gateway': {
115
+ name: 'localhost-gateway',
116
+ helmReleaseName: 'localhost-gateway',
117
+ description: 'Gateway for local cluster access',
118
+ namespace: 'ark-system',
119
+ chartPath: `${REGISTRY_BASE}/localhost-gateway`,
120
+ installArgs: [],
121
+ },
122
+ };
123
+ /**
124
+ * Get services that can be installed via Helm charts
125
+ */
126
+ export function getInstallableServices() {
127
+ const installable = {};
128
+ for (const [key, service] of Object.entries(arkServices)) {
129
+ if (service.chartPath) {
130
+ installable[key] = service;
131
+ }
132
+ }
133
+ return installable;
134
+ }
135
+ /**
136
+ * Get services that can be checked for status
137
+ */
138
+ export function getStatusCheckableServices() {
139
+ const statusServices = {};
140
+ for (const [key, service] of Object.entries(arkServices)) {
141
+ if (service.gatewayUrl) {
142
+ statusServices[key] = service.gatewayUrl;
143
+ }
144
+ }
145
+ return statusServices;
146
+ }
147
+ /**
148
+ * Get health check path for a specific service
149
+ */
150
+ export function getHealthPath(serviceName) {
151
+ const service = arkServices[serviceName];
152
+ return service?.healthPath || '';
153
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @deprecated Use arkServices.ts instead. This file is kept for backward compatibility.
3
+ * Charts are now defined in arkServices.ts with comprehensive service definitions.
4
+ */
5
+ export declare const charts: import("../arkServices.js").ServiceCollection;
@@ -0,0 +1,6 @@
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();
@@ -0,0 +1,6 @@
1
+ import { DependencyCollection } from './types.js';
2
+ /**
3
+ * Dependencies that should be installed before ARK charts
4
+ * Note: Dependencies will be installed in the order they are defined here
5
+ */
6
+ export declare const dependencies: DependencyCollection;
@@ -0,0 +1,50 @@
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
+ };
@@ -0,0 +1,40 @@
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
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createAgentsCommand(): Command;
@@ -0,0 +1,56 @@
1
+ import { Command } from 'commander';
2
+ import { execa } from 'execa';
3
+ import output from '../../lib/output.js';
4
+ async function listAgents(options) {
5
+ try {
6
+ // Use kubectl to get agents
7
+ const result = await execa('kubectl', ['get', 'agents', '-o', 'json'], {
8
+ stdio: 'pipe',
9
+ });
10
+ const data = JSON.parse(result.stdout);
11
+ const agents = data.items || [];
12
+ if (options.output === 'json') {
13
+ // Output the raw items for JSON format
14
+ console.log(JSON.stringify(agents, null, 2));
15
+ }
16
+ else {
17
+ if (agents.length === 0) {
18
+ output.warning('no agents available');
19
+ return;
20
+ }
21
+ // Simple list output - just agent names
22
+ agents.forEach((agent) => {
23
+ console.log(agent.metadata.name);
24
+ });
25
+ }
26
+ }
27
+ catch (error) {
28
+ if (error instanceof Error && error.message.includes('the server doesn\'t have a resource type')) {
29
+ output.error('Agent CRDs not installed. Is the ARK controller running?');
30
+ }
31
+ else {
32
+ output.error('fetching agents:', error instanceof Error ? error.message : error);
33
+ }
34
+ process.exit(1);
35
+ }
36
+ }
37
+ export function createAgentsCommand() {
38
+ const agentsCommand = new Command('agents');
39
+ agentsCommand
40
+ .description('list available agents')
41
+ .alias('agent')
42
+ .option('-o, --output <format>', 'output format (json or text)', 'text')
43
+ .action(async (options) => {
44
+ await listAgents(options);
45
+ });
46
+ // Add list subcommand (same as default action)
47
+ agentsCommand
48
+ .command('list')
49
+ .alias('ls')
50
+ .description('list all available agents')
51
+ .option('-o, --output <format>', 'output format (json or text)', 'text')
52
+ .action(async (options) => {
53
+ await listAgents(options);
54
+ });
55
+ return agentsCommand;
56
+ }
@@ -0,0 +1,8 @@
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 {};
@@ -0,0 +1,53 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createAgentsCommand(): Command;
@@ -0,0 +1,53 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createChatCommand(): Command;
@@ -0,0 +1,45 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createChatCommand(): Command;
@@ -0,0 +1,45 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createGetCommand(): Command;
@@ -0,0 +1,39 @@
1
+ import { Command } from 'commander';
2
+ import output from '../../lib/output.js';
3
+ import { getClusterInfo } from '../../lib/cluster.js';
4
+ export function createGetCommand() {
5
+ const get = new Command('get');
6
+ get
7
+ .description('get current kubernetes cluster information')
8
+ .option('-c, --context <context>', 'kubernetes context to use')
9
+ .option('-o, --output <format>', 'output format (text|json)', 'text')
10
+ .action(async (options) => {
11
+ try {
12
+ const clusterInfo = await getClusterInfo(options.context);
13
+ if (clusterInfo.error) {
14
+ output.error('getting cluster info:', clusterInfo.error);
15
+ process.exit(1);
16
+ }
17
+ if (options.output === 'json') {
18
+ console.log(JSON.stringify({
19
+ context: clusterInfo.context,
20
+ namespace: clusterInfo.namespace,
21
+ type: clusterInfo.type,
22
+ ip: clusterInfo.ip,
23
+ }, null, 2));
24
+ }
25
+ else {
26
+ // Text format (default)
27
+ console.log(`context: ${clusterInfo.context}`);
28
+ console.log(`namespace: ${clusterInfo.namespace}`);
29
+ console.log(`type: ${clusterInfo.type}`);
30
+ console.log(`ip: ${clusterInfo.ip || 'unknown'}`);
31
+ }
32
+ }
33
+ catch (error) {
34
+ output.error('failed to get cluster info:', error instanceof Error ? error.message : 'Unknown error');
35
+ process.exit(1);
36
+ }
37
+ });
38
+ return get;
39
+ }
@@ -1,10 +1,8 @@
1
1
  import { Command } from 'commander';
2
- import { createGetIpCommand } from './get-ip.js';
3
- import { createGetTypeCommand } from './get-type.js';
2
+ import { createGetCommand } from './get.js';
4
3
  export function createClusterCommand() {
5
4
  const cluster = new Command('cluster');
6
5
  cluster.description('Cluster management commands');
7
- cluster.addCommand(createGetTypeCommand());
8
- cluster.addCommand(createGetIpCommand());
6
+ cluster.addCommand(createGetCommand());
9
7
  return cluster;
10
8
  }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createCompletionCommand(): Command;