@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,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 ToolSelector({ arkApiClient, onSelect, onExit, }) {
5
+ const [selectedIndex, setSelectedIndex] = useState(0);
6
+ const [tools, setTools] = useState([]);
7
+ const [loading, setLoading] = useState(true);
8
+ const [error, setError] = useState(null);
9
+ useEffect(() => {
10
+ arkApiClient
11
+ .getTools()
12
+ .then((fetchedTools) => {
13
+ setTools(fetchedTools);
14
+ setLoading(false);
15
+ })
16
+ .catch((err) => {
17
+ setError(err.message || 'Failed to fetch tools');
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 ? tools.length - 1 : prev - 1));
27
+ }
28
+ else if (key.downArrow || input === 'j') {
29
+ setSelectedIndex((prev) => (prev === tools.length - 1 ? 0 : prev + 1));
30
+ }
31
+ else if (key.return) {
32
+ onSelect(tools[selectedIndex]);
33
+ }
34
+ else {
35
+ // Handle number keys for quick selection
36
+ const num = parseInt(input, 10);
37
+ if (!isNaN(num) && num >= 1 && num <= tools.length) {
38
+ onSelect(tools[num - 1]);
39
+ }
40
+ }
41
+ });
42
+ if (loading) {
43
+ return (_jsx(Box, { children: _jsx(Text, { children: "Loading tools..." }) }));
44
+ }
45
+ if (error) {
46
+ return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
47
+ }
48
+ if (tools.length === 0) {
49
+ return (_jsx(Box, { children: _jsx(Text, { children: "No tools available" }) }));
50
+ }
51
+ const selectedTool = tools[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 Tool" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Choose a tool to start a conversation with" }) }), _jsx(Box, { flexDirection: "column", children: tools.map((tool, index) => (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: index === selectedIndex ? 'green' : undefined, children: [index === selectedIndex ? '❯ ' : ' ', index + 1, ". ", tool.name] }) }, tool.name))) }), selectedTool && selectedTool.description && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: selectedTool.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 createUninstallCommand(): Command;
@@ -0,0 +1,84 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { execa } from 'execa';
4
+ import inquirer from 'inquirer';
5
+ import { isCommandAvailable } from '../../lib/commandUtils.js';
6
+ import { getClusterInfo } from '../../lib/cluster.js';
7
+ import output from '../../lib/output.js';
8
+ import { getInstallableServices } from '../../arkServices.js';
9
+ async function uninstallArk(options = {}) {
10
+ // Check if helm is installed
11
+ const helmInstalled = await isCommandAvailable('helm');
12
+ if (!helmInstalled) {
13
+ output.error('helm is not installed. please install helm first:');
14
+ output.info('https://helm.sh/docs/intro/install/');
15
+ process.exit(1);
16
+ }
17
+ // Check if kubectl is installed
18
+ const kubectlInstalled = await isCommandAvailable('kubectl');
19
+ if (!kubectlInstalled) {
20
+ output.error('kubectl is not installed. please install kubectl first:');
21
+ output.info('https://kubernetes.io/docs/tasks/tools/');
22
+ process.exit(1);
23
+ }
24
+ // Check cluster connectivity
25
+ const clusterInfo = await getClusterInfo();
26
+ if (clusterInfo.error) {
27
+ output.error('no kubernetes cluster detected');
28
+ output.info('please ensure you have a running cluster and kubectl is configured.');
29
+ process.exit(1);
30
+ }
31
+ // Show cluster info
32
+ output.success(`connected to cluster: ${chalk.bold(clusterInfo.context)}`);
33
+ output.info(`type: ${clusterInfo.type}`);
34
+ output.info(`namespace: ${clusterInfo.namespace}`);
35
+ if (clusterInfo.ip) {
36
+ output.info(`ip: ${clusterInfo.ip}`);
37
+ }
38
+ console.log(); // Add blank line after cluster info
39
+ // Get installable services and iterate through them in reverse order for clean uninstall
40
+ const services = getInstallableServices();
41
+ const serviceEntries = Object.entries(services).reverse();
42
+ for (const [, service] of serviceEntries) {
43
+ // Ask for confirmation
44
+ const shouldUninstall = options.yes || (await inquirer.prompt([
45
+ {
46
+ type: 'confirm',
47
+ name: 'shouldUninstall',
48
+ message: `uninstall ${chalk.bold(service.name)}? ${service.description ? chalk.gray(`(${service.description.toLowerCase()})`) : ''}`,
49
+ default: true,
50
+ },
51
+ ])).shouldUninstall;
52
+ if (!shouldUninstall) {
53
+ output.warning(`skipping ${service.name}`);
54
+ continue;
55
+ }
56
+ try {
57
+ // Uninstall the release
58
+ await execa('helm', [
59
+ 'uninstall',
60
+ service.helmReleaseName,
61
+ '--namespace',
62
+ service.namespace,
63
+ '--ignore-not-found',
64
+ ], {
65
+ stdio: 'inherit',
66
+ });
67
+ console.log(); // Add blank line after command output
68
+ }
69
+ catch {
70
+ // Continue with remaining charts on error
71
+ console.log(); // Add blank line after error output
72
+ }
73
+ }
74
+ }
75
+ export function createUninstallCommand() {
76
+ const command = new Command('uninstall');
77
+ command
78
+ .description('Uninstall ARK components using Helm')
79
+ .option('-y, --yes', 'automatically confirm all uninstallations')
80
+ .action(async (options) => {
81
+ await uninstallArk(options);
82
+ });
83
+ return command;
84
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function createUninstallCommand(): Command;
@@ -0,0 +1,83 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { execa } from 'execa';
4
+ import inquirer from 'inquirer';
5
+ import { isCommandAvailable } from '../lib/commandUtils.js';
6
+ import { getClusterInfo } from '../lib/cluster.js';
7
+ import output from '../lib/output.js';
8
+ import { getInstallableServices } from '../arkServices.js';
9
+ async function uninstallArk() {
10
+ // Check if helm is installed
11
+ const helmInstalled = await isCommandAvailable('helm');
12
+ if (!helmInstalled) {
13
+ output.error('helm is not installed. please install helm first:');
14
+ output.info('https://helm.sh/docs/intro/install/');
15
+ process.exit(1);
16
+ }
17
+ // Check if kubectl is installed
18
+ const kubectlInstalled = await isCommandAvailable('kubectl');
19
+ if (!kubectlInstalled) {
20
+ output.error('kubectl is not installed. please install kubectl first:');
21
+ output.info('https://kubernetes.io/docs/tasks/tools/');
22
+ process.exit(1);
23
+ }
24
+ // Check cluster connectivity
25
+ const clusterInfo = await getClusterInfo();
26
+ if (clusterInfo.error) {
27
+ output.error('no kubernetes cluster detected');
28
+ output.info('please ensure you have a running cluster and kubectl is configured.');
29
+ process.exit(1);
30
+ }
31
+ // Show cluster info
32
+ output.success(`connected to cluster: ${chalk.bold(clusterInfo.context)}`);
33
+ output.info(`type: ${clusterInfo.type}`);
34
+ output.info(`namespace: ${clusterInfo.namespace}`);
35
+ if (clusterInfo.ip) {
36
+ output.info(`ip: ${clusterInfo.ip}`);
37
+ }
38
+ console.log(); // Add blank line after cluster info
39
+ // Get installable services and iterate through them in reverse order for clean uninstall
40
+ const services = getInstallableServices();
41
+ const serviceEntries = Object.entries(services).reverse();
42
+ for (const [, service] of serviceEntries) {
43
+ // Ask for confirmation
44
+ const { shouldUninstall } = await inquirer.prompt([
45
+ {
46
+ type: 'confirm',
47
+ name: 'shouldUninstall',
48
+ message: `uninstall ${chalk.bold(service.name)}? ${service.description ? chalk.gray(`(${service.description.toLowerCase()})`) : ''}`,
49
+ default: true,
50
+ },
51
+ ]);
52
+ if (!shouldUninstall) {
53
+ output.warning(`skipping ${service.name}`);
54
+ continue;
55
+ }
56
+ try {
57
+ // Uninstall the release
58
+ await execa('helm', [
59
+ 'uninstall',
60
+ service.helmReleaseName,
61
+ '--namespace',
62
+ service.namespace,
63
+ '--ignore-not-found',
64
+ ], {
65
+ stdio: 'inherit',
66
+ });
67
+ console.log(); // Add blank line after command output
68
+ }
69
+ catch {
70
+ // Continue with remaining charts on error
71
+ console.log(); // Add blank line after error output
72
+ }
73
+ }
74
+ }
75
+ export function createUninstallCommand() {
76
+ const command = new Command('uninstall');
77
+ command
78
+ .description('Uninstall ARK components using Helm')
79
+ .action(async () => {
80
+ await uninstallArk();
81
+ });
82
+ return command;
83
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { ArkApiClient } from '../lib/arkApiClient.js';
3
+ import { ArkApiProxy } from '../lib/arkApiProxy.js';
4
+ interface ChatUIProps {
5
+ initialTargetId?: string;
6
+ arkApiClient: ArkApiClient;
7
+ arkApiProxy: ArkApiProxy;
8
+ config?: {
9
+ chat?: {
10
+ streaming?: boolean;
11
+ outputFormat?: 'text' | 'markdown';
12
+ };
13
+ };
14
+ }
15
+ declare const ChatUI: React.FC<ChatUIProps>;
16
+ export default ChatUI;