@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.
Files changed (100) hide show
  1. package/package.json +1 -1
  2. package/dist/charts/charts.d.ts +0 -5
  3. package/dist/charts/charts.js +0 -6
  4. package/dist/charts/dependencies.d.ts +0 -6
  5. package/dist/charts/dependencies.js +0 -50
  6. package/dist/charts/types.d.ts +0 -40
  7. package/dist/charts/types.js +0 -1
  8. package/dist/commands/agents/selector.d.ts +0 -8
  9. package/dist/commands/agents/selector.js +0 -53
  10. package/dist/commands/agents.d.ts +0 -2
  11. package/dist/commands/agents.js +0 -53
  12. package/dist/commands/chat.d.ts +0 -2
  13. package/dist/commands/chat.js +0 -45
  14. package/dist/commands/cluster/get-ip.d.ts +0 -2
  15. package/dist/commands/cluster/get-ip.js +0 -32
  16. package/dist/commands/cluster/get-type.d.ts +0 -2
  17. package/dist/commands/cluster/get-type.js +0 -26
  18. package/dist/commands/completion.d.ts +0 -2
  19. package/dist/commands/completion.js +0 -265
  20. package/dist/commands/config.d.ts +0 -2
  21. package/dist/commands/config.js +0 -44
  22. package/dist/commands/dashboard.d.ts +0 -3
  23. package/dist/commands/dashboard.js +0 -39
  24. package/dist/commands/dev/index.d.ts +0 -3
  25. package/dist/commands/dev/index.js +0 -9
  26. package/dist/commands/dev/tool/check.d.ts +0 -2
  27. package/dist/commands/dev/tool/check.js +0 -142
  28. package/dist/commands/dev/tool/clean.d.ts +0 -2
  29. package/dist/commands/dev/tool/clean.js +0 -153
  30. package/dist/commands/dev/tool/generate.d.ts +0 -2
  31. package/dist/commands/dev/tool/generate.js +0 -28
  32. package/dist/commands/dev/tool/index.d.ts +0 -2
  33. package/dist/commands/dev/tool/index.js +0 -14
  34. package/dist/commands/dev/tool/init.d.ts +0 -2
  35. package/dist/commands/dev/tool/init.js +0 -320
  36. package/dist/commands/dev/tool/shared.d.ts +0 -5
  37. package/dist/commands/dev/tool/shared.js +0 -258
  38. package/dist/commands/dev/tool/status.d.ts +0 -2
  39. package/dist/commands/dev/tool/status.js +0 -136
  40. package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
  41. package/dist/commands/dev/tool-generate.spec.js +0 -163
  42. package/dist/commands/dev/tool.d.ts +0 -2
  43. package/dist/commands/dev/tool.js +0 -559
  44. package/dist/commands/dev/tool.spec.d.ts +0 -1
  45. package/dist/commands/dev/tool.spec.js +0 -48
  46. package/dist/commands/install.d.ts +0 -3
  47. package/dist/commands/install.js +0 -147
  48. package/dist/commands/models/selector.d.ts +0 -8
  49. package/dist/commands/models/selector.js +0 -53
  50. package/dist/commands/routes.d.ts +0 -2
  51. package/dist/commands/routes.js +0 -101
  52. package/dist/commands/status.d.ts +0 -3
  53. package/dist/commands/status.js +0 -33
  54. package/dist/commands/targets.d.ts +0 -2
  55. package/dist/commands/targets.js +0 -65
  56. package/dist/commands/teams/selector.d.ts +0 -8
  57. package/dist/commands/teams/selector.js +0 -55
  58. package/dist/commands/tools/selector.d.ts +0 -8
  59. package/dist/commands/tools/selector.js +0 -53
  60. package/dist/commands/uninstall.d.ts +0 -2
  61. package/dist/commands/uninstall.js +0 -83
  62. package/dist/components/DashboardCLI.d.ts +0 -3
  63. package/dist/components/DashboardCLI.js +0 -149
  64. package/dist/components/StatusView.d.ts +0 -10
  65. package/dist/components/StatusView.js +0 -39
  66. package/dist/config.d.ts +0 -23
  67. package/dist/config.js +0 -92
  68. package/dist/lib/arkClient.d.ts +0 -32
  69. package/dist/lib/arkClient.js +0 -43
  70. package/dist/lib/commandUtils.d.ts +0 -4
  71. package/dist/lib/commandUtils.js +0 -18
  72. package/dist/lib/commandUtils.test.d.ts +0 -1
  73. package/dist/lib/commandUtils.test.js +0 -44
  74. package/dist/lib/config.test.d.ts +0 -1
  75. package/dist/lib/config.test.js +0 -93
  76. package/dist/lib/consts.d.ts +0 -9
  77. package/dist/lib/consts.js +0 -13
  78. package/dist/lib/consts.spec.d.ts +0 -1
  79. package/dist/lib/consts.spec.js +0 -15
  80. package/dist/lib/dev/tools/analyzer.d.ts +0 -30
  81. package/dist/lib/dev/tools/analyzer.js +0 -190
  82. package/dist/lib/dev/tools/discover_tools.py +0 -392
  83. package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
  84. package/dist/lib/dev/tools/mcp-types.js +0 -86
  85. package/dist/lib/dev/tools/types.d.ts +0 -50
  86. package/dist/lib/dev/tools/types.js +0 -1
  87. package/dist/lib/exec.d.ts +0 -1
  88. package/dist/lib/exec.js +0 -9
  89. package/dist/lib/gatewayManager.d.ts +0 -24
  90. package/dist/lib/gatewayManager.js +0 -85
  91. package/dist/lib/kubernetes.d.ts +0 -28
  92. package/dist/lib/kubernetes.js +0 -122
  93. package/dist/lib/portUtils.d.ts +0 -8
  94. package/dist/lib/portUtils.js +0 -39
  95. package/dist/lib/progress.d.ts +0 -128
  96. package/dist/lib/progress.js +0 -273
  97. package/dist/lib/queryRunner.d.ts +0 -22
  98. package/dist/lib/queryRunner.js +0 -142
  99. package/dist/lib/wrappers/git.d.ts +0 -2
  100. package/dist/lib/wrappers/git.js +0 -43
@@ -1,50 +0,0 @@
1
- export interface ToolParameter {
2
- name: string;
3
- type?: string;
4
- }
5
- export interface DiscoveredTool {
6
- name: string;
7
- parameters: ToolParameter[];
8
- return_type?: string;
9
- docstring?: string;
10
- }
11
- export interface FileDiscoveryResult {
12
- success: boolean;
13
- file: string;
14
- tools: DiscoveredTool[];
15
- uses_fastmcp: boolean;
16
- mcp_instance?: string;
17
- server_name?: string;
18
- error?: string;
19
- }
20
- export interface DirectoryDiscoveryResult {
21
- directory: string;
22
- files: FileDiscoveryResult[];
23
- total_tools: number;
24
- uses_fastmcp: boolean;
25
- }
26
- export type DiscoveryResult = FileDiscoveryResult | DirectoryDiscoveryResult;
27
- export interface ProjectDiscoveryResult {
28
- path: string;
29
- exists: boolean;
30
- is_directory: boolean;
31
- platform: 'python3' | null;
32
- project_type: 'pyproject' | 'requirements' | null;
33
- project_file: string | null;
34
- project_name: string | null;
35
- project_version: string | null;
36
- has_fastmcp: boolean;
37
- fastmcp_version: string | null;
38
- }
39
- export interface ProjectInfo {
40
- path: string;
41
- platform: 'python3';
42
- projectType: 'pyproject' | 'requirements' | 'unknown';
43
- hasVenv: boolean;
44
- fastMCP: boolean;
45
- fastMCPVersion?: string;
46
- }
47
- export interface ArkDevToolStatus extends ProjectInfo {
48
- discovery?: DiscoveryResult;
49
- tools: DiscoveredTool[];
50
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function fileExists(path: string): boolean;
package/dist/lib/exec.js DELETED
@@ -1,9 +0,0 @@
1
- import fs from 'fs';
2
- export function fileExists(path) {
3
- try {
4
- return fs.existsSync(path);
5
- }
6
- catch {
7
- return false;
8
- }
9
- }
@@ -1,24 +0,0 @@
1
- export declare class GatewayManager {
2
- private kubernetesManager;
3
- constructor();
4
- /**
5
- * Check if localhost-gateway port-forward is running by testing the endpoint
6
- */
7
- isPortForwardRunning(port?: number): Promise<boolean>;
8
- /**
9
- * Check if localhost-gateway service is deployed in cluster
10
- */
11
- isGatewayDeployed(): Promise<boolean>;
12
- /**
13
- * Check if port-forward is needed and provide setup instructions
14
- */
15
- checkPortForwardStatus(port?: number): Promise<{
16
- isRunning: boolean;
17
- needsSetup: boolean;
18
- instructions?: string;
19
- }>;
20
- /**
21
- * Get setup instructions for fresh installations
22
- */
23
- getSetupInstructions(): string;
24
- }
@@ -1,85 +0,0 @@
1
- import * as k8s from '@kubernetes/client-node';
2
- import { KubernetesConfigManager } from './kubernetes.js';
3
- export class GatewayManager {
4
- constructor() {
5
- this.kubernetesManager = new KubernetesConfigManager();
6
- }
7
- /**
8
- * Check if localhost-gateway port-forward is running by testing the endpoint
9
- */
10
- async isPortForwardRunning(port = 8080) {
11
- try {
12
- const axios = (await import('axios')).default;
13
- await axios.get(`http://127.0.0.1:${port}`, {
14
- timeout: 2000,
15
- validateStatus: () => true,
16
- });
17
- return true;
18
- }
19
- catch {
20
- return false;
21
- }
22
- }
23
- /**
24
- * Check if localhost-gateway service is deployed in cluster
25
- */
26
- async isGatewayDeployed() {
27
- try {
28
- await this.kubernetesManager.initializeConfig();
29
- const kc = this.kubernetesManager.getKubeConfig();
30
- const k8sApi = kc.makeApiClient(k8s.CoreV1Api);
31
- await k8sApi.readNamespacedService({
32
- name: 'localhost-gateway-nginx',
33
- namespace: 'ark-system',
34
- });
35
- return true;
36
- }
37
- catch {
38
- return false;
39
- }
40
- }
41
- /**
42
- * Check if port-forward is needed and provide setup instructions
43
- */
44
- async checkPortForwardStatus(port = 8080) {
45
- const isRunning = await this.isPortForwardRunning(port);
46
- if (isRunning) {
47
- return { isRunning: true, needsSetup: false };
48
- }
49
- const isDeployed = await this.isGatewayDeployed();
50
- if (!isDeployed) {
51
- return {
52
- isRunning: false,
53
- needsSetup: true,
54
- instructions: this.getSetupInstructions(),
55
- };
56
- }
57
- return {
58
- isRunning: false,
59
- needsSetup: true,
60
- instructions: `Gateway is deployed but port-forward not running. Start it with:\nkubectl port-forward -n ark-system service/localhost-gateway-nginx ${port}:80`,
61
- };
62
- }
63
- /**
64
- * Get setup instructions for fresh installations
65
- */
66
- getSetupInstructions() {
67
- return `
68
- 🔧 ARK Gateway Setup Required:
69
-
70
- To enable service discovery, you need to install the localhost-gateway:
71
-
72
- 1. From your agents-at-scale project root, run:
73
- make localhost-gateway-install
74
-
75
- 2. This will:
76
- - Install Gateway API CRDs
77
- - Deploy NGINX Gateway Fabric
78
- - Set up port-forwarding to localhost:8080
79
-
80
- 3. Then run 'ark check status' again
81
-
82
- For more info: docs/content/ark-101/ark-gateway.mdx
83
- `;
84
- }
85
- }
@@ -1,28 +0,0 @@
1
- import * as k8s from '@kubernetes/client-node';
2
- import { KubernetesConfig } from './types.js';
3
- export declare class KubernetesConfigManager {
4
- private kc;
5
- constructor();
6
- /**
7
- * Get the KubeConfig instance for API client creation
8
- */
9
- getKubeConfig(): k8s.KubeConfig;
10
- /**
11
- * Initialize Kubernetes configuration similar to fark's approach
12
- * Priority: in-cluster config > KUBECONFIG env > ~/.kube/config
13
- */
14
- initializeConfig(): Promise<KubernetesConfig>;
15
- /**
16
- * Get the API server URL for the current cluster
17
- */
18
- getClusterApiUrl(): string;
19
- /**
20
- * Detect ark-api service URL in the cluster
21
- * This mimics how fark discovers services
22
- */
23
- getArkApiUrl(namespace?: string): Promise<string>;
24
- /**
25
- * Check if we can access the cluster
26
- */
27
- testClusterAccess(): Promise<boolean>;
28
- }
@@ -1,122 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import { homedir } from 'os';
3
- import { join } from 'path';
4
- import * as k8s from '@kubernetes/client-node';
5
- export class KubernetesConfigManager {
6
- constructor() {
7
- this.kc = new k8s.KubeConfig();
8
- }
9
- /**
10
- * Get the KubeConfig instance for API client creation
11
- */
12
- getKubeConfig() {
13
- return this.kc;
14
- }
15
- /**
16
- * Initialize Kubernetes configuration similar to fark's approach
17
- * Priority: in-cluster config > KUBECONFIG env > ~/.kube/config
18
- */
19
- async initializeConfig() {
20
- let kubeconfig;
21
- let currentContext;
22
- let namespace;
23
- let inCluster = false;
24
- // Check if we're explicitly in a Kubernetes pod environment
25
- const isInPod = process.env.KUBERNETES_SERVICE_HOST &&
26
- process.env.KUBERNETES_SERVICE_PORT &&
27
- process.env.POD_NAMESPACE;
28
- if (isInPod) {
29
- try {
30
- // Try in-cluster config only if we're definitely in a pod
31
- this.kc.loadFromCluster();
32
- inCluster = true;
33
- kubeconfig = '/var/run/secrets/kubernetes.io/serviceaccount';
34
- namespace = process.env.POD_NAMESPACE || 'default';
35
- }
36
- catch (error) {
37
- throw new Error(`Failed to load in-cluster Kubernetes configuration: ${error}`);
38
- }
39
- }
40
- else {
41
- // Use kubeconfig file for local development
42
- try {
43
- kubeconfig =
44
- process.env.KUBECONFIG || join(homedir(), '.kube', 'config');
45
- // Check if kubeconfig file exists
46
- await fs.access(kubeconfig);
47
- this.kc.loadFromFile(kubeconfig);
48
- // Get current context and namespace
49
- currentContext = this.kc.currentContext;
50
- // Simplified namespace detection - just use default for now
51
- // Complex namespace detection can be added later if needed
52
- namespace = 'default';
53
- }
54
- catch (error) {
55
- throw new Error(`Failed to load Kubernetes configuration: ${error}`);
56
- }
57
- }
58
- return {
59
- kubeconfig,
60
- currentContext,
61
- namespace,
62
- inCluster,
63
- };
64
- }
65
- /**
66
- * Get the API server URL for the current cluster
67
- */
68
- getClusterApiUrl() {
69
- const cluster = this.kc.getCurrentCluster();
70
- if (!cluster) {
71
- throw new Error('No current cluster found in kubeconfig');
72
- }
73
- return cluster.server;
74
- }
75
- /**
76
- * Detect ark-api service URL in the cluster
77
- * This mimics how fark discovers services
78
- */
79
- async getArkApiUrl(namespace = 'default') {
80
- const k8sApi = this.kc.makeApiClient(k8s.CoreV1Api);
81
- try {
82
- // Try to find ark-api service
83
- const service = await k8sApi.readNamespacedService({
84
- name: 'ark-api',
85
- namespace,
86
- });
87
- if (service.spec?.type === 'LoadBalancer' &&
88
- service.status?.loadBalancer?.ingress?.[0]) {
89
- const ingress = service.status.loadBalancer.ingress[0];
90
- const host = ingress.ip || ingress.hostname;
91
- const port = service.spec.ports?.[0]?.port || 8080;
92
- return `http://${host}:${port}`;
93
- }
94
- if (service.spec?.type === 'NodePort' && service.spec.ports?.[0]) {
95
- const nodePort = service.spec.ports[0].nodePort;
96
- const clusterUrl = this.getClusterApiUrl();
97
- const clusterHost = new URL(clusterUrl).hostname;
98
- return `http://${clusterHost}:${nodePort}`;
99
- }
100
- // Default to port-forward style access
101
- const port = service.spec?.ports?.[0]?.port || 8080;
102
- return `http://localhost:${port}`;
103
- }
104
- catch (error) {
105
- // Service not found or not accessible
106
- throw new Error(`ark-api service not found or not accessible in namespace '${namespace}': ${error instanceof Error ? error.message : error}`);
107
- }
108
- }
109
- /**
110
- * Check if we can access the cluster
111
- */
112
- async testClusterAccess() {
113
- try {
114
- const k8sApi = this.kc.makeApiClient(k8s.CoreV1Api);
115
- await k8sApi.listNamespace();
116
- return true;
117
- }
118
- catch {
119
- return false;
120
- }
121
- }
122
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Check if a port is available
3
- */
4
- export declare function isPortAvailable(port: number): Promise<boolean>;
5
- /**
6
- * Find an available port, starting from the preferred port
7
- */
8
- export declare function findAvailablePort(preferredPort: number, maxAttempts?: number): Promise<number>;
@@ -1,39 +0,0 @@
1
- import net from 'net';
2
- /**
3
- * Check if a port is available
4
- */
5
- export async function isPortAvailable(port) {
6
- return new Promise((resolve) => {
7
- const server = net.createServer();
8
- server.once('error', (err) => {
9
- if (err.code === 'EADDRINUSE') {
10
- resolve(false);
11
- }
12
- else {
13
- resolve(false);
14
- }
15
- });
16
- server.once('listening', () => {
17
- server.close();
18
- resolve(true);
19
- });
20
- server.listen(port, '127.0.0.1');
21
- });
22
- }
23
- /**
24
- * Find an available port, starting from the preferred port
25
- */
26
- export async function findAvailablePort(preferredPort, maxAttempts = 10) {
27
- // First try the preferred port
28
- if (await isPortAvailable(preferredPort)) {
29
- return preferredPort;
30
- }
31
- // Try random ports
32
- for (let i = 0; i < maxAttempts; i++) {
33
- const randomPort = Math.floor(Math.random() * (65535 - 1024) + 1024);
34
- if (await isPortAvailable(randomPort)) {
35
- return randomPort;
36
- }
37
- }
38
- throw new Error(`Could not find an available port after ${maxAttempts} attempts`);
39
- }
@@ -1,128 +0,0 @@
1
- /**
2
- * Progress indicators and user experience utilities for ARK CLI
3
- */
4
- export interface ProgressStep {
5
- name: string;
6
- status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
7
- message?: string;
8
- duration?: number;
9
- }
10
- export declare class ProgressIndicator {
11
- private title;
12
- private steps;
13
- private startTime;
14
- constructor(title: string);
15
- /**
16
- * Add a step to the progress indicator
17
- */
18
- addStep(name: string, message?: string): void;
19
- /**
20
- * Start a step
21
- */
22
- startStep(name: string, message?: string): void;
23
- /**
24
- * Complete a step
25
- */
26
- completeStep(name: string, message?: string): void;
27
- /**
28
- * Fail a step
29
- */
30
- failStep(name: string, message?: string): void;
31
- /**
32
- * Skip a step
33
- */
34
- skipStep(name: string, message?: string): void;
35
- /**
36
- * Render the current progress
37
- */
38
- private renderProgress;
39
- /**
40
- * Complete the progress indicator
41
- */
42
- complete(message?: string): void;
43
- /**
44
- * Get status icon for a step
45
- */
46
- private getStatusIcon;
47
- /**
48
- * Get status color for a step
49
- */
50
- private getStatusColor;
51
- }
52
- /**
53
- * Simple spinner for long-running operations
54
- */
55
- export declare class Spinner {
56
- private frames;
57
- private index;
58
- private interval;
59
- private message;
60
- constructor(message: string);
61
- start(): void;
62
- stop(finalMessage?: string): void;
63
- fail(errorMessage?: string): void;
64
- }
65
- /**
66
- * Enhanced prompts with better validation and user guidance
67
- */
68
- export declare class EnhancedPrompts {
69
- /**
70
- * Show a helpful tip to the user
71
- */
72
- static showTip(message: string): void;
73
- /**
74
- * Show a warning to the user
75
- */
76
- static showWarning(message: string): void;
77
- /**
78
- * Show information to the user
79
- */
80
- static showInfo(message: string): void;
81
- /**
82
- * Show a success message
83
- */
84
- static showSuccess(message: string): void;
85
- /**
86
- * Show available options for a choice
87
- */
88
- static showChoiceHelp(title: string, choices: Array<{
89
- name: string;
90
- description: string;
91
- }>): void;
92
- /**
93
- * Show next steps after completion
94
- */
95
- static showNextSteps(title: string, steps: string[]): void;
96
- /**
97
- * Show a separator for better visual organization
98
- */
99
- static showSeparator(title?: string): void;
100
- }
101
- /**
102
- * Utility for consistent formatting of output
103
- */
104
- export declare class OutputFormatter {
105
- /**
106
- * Format a list of key-value pairs
107
- */
108
- static formatKeyValueList(items: Array<{
109
- key: string;
110
- value: string;
111
- highlight?: boolean;
112
- }>): void;
113
- /**
114
- * Format a file list with icons
115
- */
116
- static formatFileList(files: Array<{
117
- path: string;
118
- type: 'file' | 'directory';
119
- description?: string;
120
- }>): void;
121
- /**
122
- * Format command examples
123
- */
124
- static formatCommands(title: string, commands: Array<{
125
- command: string;
126
- description: string;
127
- }>): void;
128
- }