@agents-at-scale/ark 0.1.47 → 0.1.50

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 (52) hide show
  1. package/.arkrc.template.yaml +51 -0
  2. package/README.md +2 -0
  3. package/dist/arkServices.js +13 -8
  4. package/dist/commands/chat/index.js +1 -1
  5. package/dist/commands/completion/index.js +17 -1
  6. package/dist/commands/dashboard/index.d.ts +2 -2
  7. package/dist/commands/dashboard/index.js +5 -4
  8. package/dist/commands/export/index.d.ts +3 -0
  9. package/dist/commands/export/index.js +73 -0
  10. package/dist/commands/export/index.spec.d.ts +1 -0
  11. package/dist/commands/export/index.spec.js +145 -0
  12. package/dist/commands/import/index.d.ts +3 -0
  13. package/dist/commands/import/index.js +27 -0
  14. package/dist/commands/import/index.spec.d.ts +1 -0
  15. package/dist/commands/import/index.spec.js +46 -0
  16. package/dist/commands/install/index.js +12 -0
  17. package/dist/commands/memory/index.js +9 -4
  18. package/dist/commands/models/kubernetes/manifest-builder.js +1 -1
  19. package/dist/commands/queries/index.js +4 -4
  20. package/dist/commands/queries/index.spec.d.ts +1 -0
  21. package/dist/commands/queries/index.spec.js +167 -0
  22. package/dist/commands/query/index.js +2 -0
  23. package/dist/components/ChatUI.js +4 -4
  24. package/dist/index.js +4 -0
  25. package/dist/lib/arkApiProxy.d.ts +1 -1
  26. package/dist/lib/arkApiProxy.js +2 -2
  27. package/dist/lib/arkServiceProxy.d.ts +3 -1
  28. package/dist/lib/arkServiceProxy.js +34 -1
  29. package/dist/lib/arkServiceProxy.spec.d.ts +1 -0
  30. package/dist/lib/arkServiceProxy.spec.js +100 -0
  31. package/dist/lib/chatClient.d.ts +1 -0
  32. package/dist/lib/chatClient.js +7 -1
  33. package/dist/lib/config.d.ts +3 -1
  34. package/dist/lib/config.js +21 -7
  35. package/dist/lib/config.spec.js +10 -0
  36. package/dist/lib/executeQuery.d.ts +1 -0
  37. package/dist/lib/executeQuery.js +17 -8
  38. package/dist/lib/kubectl.d.ts +2 -0
  39. package/dist/lib/kubectl.js +6 -0
  40. package/dist/lib/kubectl.spec.js +16 -0
  41. package/dist/lib/types.d.ts +3 -2
  42. package/dist/types/arkService.d.ts +5 -0
  43. package/dist/ui/MainMenu.js +6 -2
  44. package/package.json +4 -2
  45. package/dist/ui/AgentSelector.d.ts +0 -8
  46. package/dist/ui/AgentSelector.js +0 -53
  47. package/dist/ui/ModelSelector.d.ts +0 -8
  48. package/dist/ui/ModelSelector.js +0 -53
  49. package/dist/ui/TeamSelector.d.ts +0 -8
  50. package/dist/ui/TeamSelector.js +0 -55
  51. package/dist/ui/ToolSelector.d.ts +0 -8
  52. package/dist/ui/ToolSelector.js +0 -53
@@ -101,7 +101,7 @@ export interface QueryResponse {
101
101
  export interface QueryStatus {
102
102
  phase?: 'initializing' | 'running' | 'done' | 'error' | 'canceled';
103
103
  conditions?: K8sCondition[];
104
- responses?: QueryResponse[];
104
+ response?: QueryResponse;
105
105
  message?: string;
106
106
  error?: string;
107
107
  tokenUsage?: {
@@ -120,8 +120,9 @@ export interface Query {
120
120
  metadata: K8sMetadata;
121
121
  spec?: {
122
122
  input: string;
123
- targets: QueryTarget[];
123
+ target: QueryTarget;
124
124
  sessionId?: string;
125
+ conversationId?: string;
125
126
  timeout?: string;
126
127
  };
127
128
  status?: QueryStatus;
@@ -1,3 +1,7 @@
1
+ export interface PrerequisiteUninstall {
2
+ releaseName: string;
3
+ namespace?: string;
4
+ }
1
5
  export interface ArkService {
2
6
  name: string;
3
7
  helmReleaseName: string;
@@ -7,6 +11,7 @@ export interface ArkService {
7
11
  namespace?: string;
8
12
  chartPath?: string;
9
13
  installArgs?: string[];
14
+ prerequisiteUninstalls?: PrerequisiteUninstall[];
10
15
  k8sServiceName?: string;
11
16
  k8sServicePort?: number;
12
17
  k8sPortForwardLocalPort?: number;
@@ -155,9 +155,11 @@ const MainMenu = ({ config }) => {
155
155
  // Import and start ChatUI in the same process
156
156
  const { render } = await import('ink');
157
157
  const { ArkApiProxy } = await import('../lib/arkApiProxy.js');
158
+ const { loadConfig } = await import('../lib/config.js');
158
159
  const ChatUI = (await import('../components/ChatUI.js')).default;
159
160
  try {
160
- const proxy = new ArkApiProxy();
161
+ const config = loadConfig();
162
+ const proxy = new ArkApiProxy(undefined, config.services?.reusePortForwards ?? false);
161
163
  const arkApiClient = await proxy.start();
162
164
  // Render ChatUI as a new Ink app
163
165
  render(_jsx(ChatUI, { arkApiClient: arkApiClient, arkApiProxy: proxy }));
@@ -211,7 +213,9 @@ const MainMenu = ({ config }) => {
211
213
  // Unmount fullscreen app and clear screen.
212
214
  await unmountInkApp();
213
215
  const { openDashboard } = await import('../commands/dashboard/index.js');
214
- await openDashboard();
216
+ const { loadConfig } = await import('../lib/config.js');
217
+ const config = loadConfig();
218
+ await openDashboard(config);
215
219
  break;
216
220
  }
217
221
  case 'status': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-at-scale/ark",
3
- "version": "0.1.47",
3
+ "version": "0.1.50",
4
4
  "description": "Ark CLI - Interactive terminal interface for ARK agents",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "files": [
11
11
  "dist",
12
- "templates"
12
+ "templates",
13
+ ".arkrc.template.yaml"
13
14
  ],
14
15
  "scripts": {
15
16
  "build": "npm run copy-templates && tsc && chmod +x dist/index.js",
@@ -48,6 +49,7 @@
48
49
  "commander": "^12.1.0",
49
50
  "debug": "^4.4.1",
50
51
  "execa": "^9.6.0",
52
+ "find-process": "^1.4.7",
51
53
  "ink": "^6.0.1",
52
54
  "ink-select-input": "^6.2.0",
53
55
  "ink-spinner": "^5.0.0",
@@ -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
- }
@@ -1,8 +0,0 @@
1
- import { Model, ArkApiClient } from '../lib/arkApiClient.js';
2
- interface ModelSelectorProps {
3
- arkApiClient: ArkApiClient;
4
- onSelect: (model: Model) => void;
5
- onExit: () => void;
6
- }
7
- export declare function ModelSelector({ arkApiClient, onSelect, onExit, }: ModelSelectorProps): 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 ModelSelector({ arkApiClient, onSelect, onExit, }) {
5
- const [selectedIndex, setSelectedIndex] = useState(0);
6
- const [models, setModels] = useState([]);
7
- const [loading, setLoading] = useState(true);
8
- const [error, setError] = useState(null);
9
- useEffect(() => {
10
- arkApiClient
11
- .getModels()
12
- .then((fetchedModels) => {
13
- setModels(fetchedModels);
14
- setLoading(false);
15
- })
16
- .catch((err) => {
17
- setError(err.message || 'Failed to fetch models');
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 ? models.length - 1 : prev - 1));
27
- }
28
- else if (key.downArrow || input === 'j') {
29
- setSelectedIndex((prev) => (prev === models.length - 1 ? 0 : prev + 1));
30
- }
31
- else if (key.return) {
32
- onSelect(models[selectedIndex]);
33
- }
34
- else {
35
- // Handle number keys for quick selection
36
- const num = parseInt(input, 10);
37
- if (!isNaN(num) && num >= 1 && num <= models.length) {
38
- onSelect(models[num - 1]);
39
- }
40
- }
41
- });
42
- if (loading) {
43
- return (_jsx(Box, { children: _jsx(Text, { children: "Loading models..." }) }));
44
- }
45
- if (error) {
46
- return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
47
- }
48
- if (models.length === 0) {
49
- return (_jsx(Box, { children: _jsx(Text, { children: "No models available" }) }));
50
- }
51
- const selectedModel = models[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 Model" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Choose a model to start a conversation with" }) }), _jsx(Box, { flexDirection: "column", children: models.map((model, index) => (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: index === selectedIndex ? 'green' : undefined, children: [index === selectedIndex ? '❯ ' : ' ', index + 1, ". ", model.name, model.type ? ` (${model.type})` : ''] }) }, model.name))) }), selectedModel && selectedModel.model && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsxs(Text, { dimColor: true, wrap: "wrap", children: ["Model: ", selectedModel.model] }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Number to select \u00B7 Esc to exit" }) })] }));
53
- }
@@ -1,8 +0,0 @@
1
- import { Team, ArkApiClient } from '../lib/arkApiClient.js';
2
- interface TeamSelectorProps {
3
- arkApiClient: ArkApiClient;
4
- onSelect: (team: Team) => void;
5
- onExit: () => void;
6
- }
7
- export declare function TeamSelector({ arkApiClient, onSelect, onExit, }: TeamSelectorProps): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,55 +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 TeamSelector({ arkApiClient, onSelect, onExit, }) {
5
- const [selectedIndex, setSelectedIndex] = useState(0);
6
- const [teams, setTeams] = useState([]);
7
- const [loading, setLoading] = useState(true);
8
- const [error, setError] = useState(null);
9
- useEffect(() => {
10
- arkApiClient
11
- .getTeams()
12
- .then((fetchedTeams) => {
13
- setTeams(fetchedTeams);
14
- setLoading(false);
15
- })
16
- .catch((err) => {
17
- setError(err.message || 'Failed to fetch teams');
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 ? teams.length - 1 : prev - 1));
27
- }
28
- else if (key.downArrow || input === 'j') {
29
- setSelectedIndex((prev) => (prev === teams.length - 1 ? 0 : prev + 1));
30
- }
31
- else if (key.return) {
32
- onSelect(teams[selectedIndex]);
33
- }
34
- else {
35
- // Handle number keys for quick selection
36
- const num = parseInt(input, 10);
37
- if (!isNaN(num) && num >= 1 && num <= teams.length) {
38
- onSelect(teams[num - 1]);
39
- }
40
- }
41
- });
42
- if (loading) {
43
- return (_jsx(Box, { children: _jsx(Text, { children: "Loading teams..." }) }));
44
- }
45
- if (error) {
46
- return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
47
- }
48
- if (teams.length === 0) {
49
- return (_jsx(Box, { children: _jsx(Text, { children: "No teams available" }) }));
50
- }
51
- const selectedTeam = teams[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 Team" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Choose a team to start a conversation with" }) }), _jsx(Box, { flexDirection: "column", children: teams.map((team, index) => (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: index === selectedIndex ? 'green' : undefined, children: [index === selectedIndex ? '❯ ' : ' ', index + 1, ". ", team.name, team.strategy ? ` (${team.strategy})` : ''] }) }, team.name))) }), selectedTeam &&
53
- (selectedTeam.description || selectedTeam.members_count) && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: selectedTeam.description ||
54
- `Members: ${selectedTeam.members_count}` }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Number to select \u00B7 Esc to exit" }) })] }));
55
- }
@@ -1,8 +0,0 @@
1
- import { Tool, ArkApiClient } from '../lib/arkApiClient.js';
2
- interface ToolSelectorProps {
3
- arkApiClient: ArkApiClient;
4
- onSelect: (tool: Tool) => void;
5
- onExit: () => void;
6
- }
7
- export declare function ToolSelector({ arkApiClient, onSelect, onExit, }: ToolSelectorProps): 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 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
- }