@agents-at-scale/ark 0.1.53 → 0.1.56
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/dist/arkServices.js +14 -0
- package/dist/commands/completion/index.js +9 -6
- package/dist/commands/export/index.js +6 -5
- package/dist/commands/generate/generators/agent.js +2 -0
- package/dist/commands/generate/generators/marketplace.js +2 -0
- package/dist/commands/generate/generators/mcpserver.js +2 -0
- package/dist/commands/generate/generators/project.js +9 -2
- package/dist/commands/generate/generators/query.js +2 -0
- package/dist/commands/generate/generators/team.js +2 -1
- package/dist/commands/generate/templateDiscovery.js +1 -0
- package/dist/commands/generate/templateEngine.js +1 -3
- package/dist/commands/import/index.js +1 -1
- package/dist/commands/install/index.js +35 -31
- package/dist/commands/marketplace/index.js +18 -3
- package/dist/commands/models/create.js +1 -0
- package/dist/commands/models/kubernetes/manifest-builder.js +49 -10
- package/dist/commands/models/providers/anthropic.d.ts +15 -0
- package/dist/commands/models/providers/anthropic.js +72 -0
- package/dist/commands/models/providers/azure.d.ts +10 -7
- package/dist/commands/models/providers/azure.js +83 -21
- package/dist/commands/models/providers/factory.js +3 -0
- package/dist/commands/models/providers/index.d.ts +3 -4
- package/dist/commands/models/providers/index.js +1 -0
- package/dist/commands/uninstall/index.js +9 -3
- package/dist/components/ChatUI.js +21 -33
- package/dist/components/statusChecker.js +3 -3
- package/dist/index.js +0 -2
- package/dist/lib/arkApiClient.d.ts +14 -4
- package/dist/lib/arkApiClient.js +61 -42
- package/dist/lib/arkApiProxy.js +1 -0
- package/dist/lib/arkServiceProxy.js +5 -1
- package/dist/lib/chatClient.d.ts +4 -6
- package/dist/lib/chatClient.js +138 -95
- package/dist/lib/config.js +8 -3
- package/dist/lib/errors.d.ts +0 -1
- package/dist/lib/errors.js +3 -1
- package/dist/lib/marketplaceFetcher.d.ts +1 -0
- package/dist/lib/marketplaceFetcher.js +17 -0
- package/dist/lib/types.d.ts +0 -38
- package/dist/marketplaceServices.d.ts +6 -1
- package/dist/marketplaceServices.js +19 -3
- package/dist/types/arkService.d.ts +1 -0
- package/dist/types/marketplace.d.ts +1 -1
- package/dist/ui/asyncOperations/connectingToArk.js +2 -2
- package/package.json +19 -13
- package/templates/marketplace/marketplace.json.example +2 -2
- package/templates/tool/uv.lock +794 -95
- package/dist/arkServices.spec.d.ts +0 -1
- package/dist/arkServices.spec.js +0 -138
- package/dist/commands/agents/index.spec.d.ts +0 -1
- package/dist/commands/agents/index.spec.js +0 -67
- package/dist/commands/cluster/get.spec.d.ts +0 -1
- package/dist/commands/cluster/get.spec.js +0 -92
- package/dist/commands/cluster/index.spec.d.ts +0 -1
- package/dist/commands/cluster/index.spec.js +0 -24
- package/dist/commands/completion/index.spec.d.ts +0 -1
- package/dist/commands/completion/index.spec.js +0 -34
- package/dist/commands/config/index.spec.d.ts +0 -1
- package/dist/commands/config/index.spec.js +0 -78
- package/dist/commands/evaluation/index.d.ts +0 -3
- package/dist/commands/evaluation/index.js +0 -60
- package/dist/commands/evaluation/index.spec.d.ts +0 -1
- package/dist/commands/evaluation/index.spec.js +0 -161
- package/dist/commands/export/index.spec.d.ts +0 -1
- package/dist/commands/export/index.spec.js +0 -145
- package/dist/commands/import/index.spec.d.ts +0 -1
- package/dist/commands/import/index.spec.js +0 -46
- package/dist/commands/install/index.spec.d.ts +0 -1
- package/dist/commands/install/index.spec.js +0 -286
- package/dist/commands/marketplace/index.spec.d.ts +0 -1
- package/dist/commands/marketplace/index.spec.js +0 -88
- package/dist/commands/memory/index.spec.d.ts +0 -1
- package/dist/commands/memory/index.spec.js +0 -124
- package/dist/commands/models/create.spec.d.ts +0 -1
- package/dist/commands/models/create.spec.js +0 -167
- package/dist/commands/models/index.spec.d.ts +0 -1
- package/dist/commands/models/index.spec.js +0 -96
- package/dist/commands/models/providers/azure.spec.d.ts +0 -1
- package/dist/commands/models/providers/azure.spec.js +0 -232
- package/dist/commands/models/providers/bedrock.spec.d.ts +0 -1
- package/dist/commands/models/providers/bedrock.spec.js +0 -241
- package/dist/commands/models/providers/openai.spec.d.ts +0 -1
- package/dist/commands/models/providers/openai.spec.js +0 -180
- package/dist/commands/queries/delete.spec.d.ts +0 -1
- package/dist/commands/queries/delete.spec.js +0 -74
- package/dist/commands/queries/index.spec.d.ts +0 -1
- package/dist/commands/queries/index.spec.js +0 -167
- package/dist/commands/queries/list.spec.d.ts +0 -1
- package/dist/commands/queries/list.spec.js +0 -170
- package/dist/commands/queries/validation.spec.d.ts +0 -1
- package/dist/commands/queries/validation.spec.js +0 -27
- package/dist/commands/query/index.spec.d.ts +0 -1
- package/dist/commands/query/index.spec.js +0 -104
- package/dist/commands/targets/index.spec.d.ts +0 -1
- package/dist/commands/targets/index.spec.js +0 -154
- package/dist/commands/teams/index.spec.d.ts +0 -1
- package/dist/commands/teams/index.spec.js +0 -70
- package/dist/commands/tools/index.spec.d.ts +0 -1
- package/dist/commands/tools/index.spec.js +0 -70
- package/dist/commands/uninstall/index.spec.d.ts +0 -1
- package/dist/commands/uninstall/index.spec.js +0 -125
- package/dist/lib/arkServiceProxy.spec.d.ts +0 -1
- package/dist/lib/arkServiceProxy.spec.js +0 -100
- package/dist/lib/arkStatus.spec.d.ts +0 -1
- package/dist/lib/arkStatus.spec.js +0 -49
- package/dist/lib/chatClient.spec.d.ts +0 -1
- package/dist/lib/chatClient.spec.js +0 -108
- package/dist/lib/cluster.spec.d.ts +0 -1
- package/dist/lib/cluster.spec.js +0 -338
- package/dist/lib/commands.spec.d.ts +0 -1
- package/dist/lib/commands.spec.js +0 -146
- package/dist/lib/config.spec.d.ts +0 -1
- package/dist/lib/config.spec.js +0 -202
- package/dist/lib/duration.spec.d.ts +0 -1
- package/dist/lib/duration.spec.js +0 -13
- package/dist/lib/errors.spec.d.ts +0 -1
- package/dist/lib/errors.spec.js +0 -221
- package/dist/lib/executeEvaluation.d.ts +0 -16
- package/dist/lib/executeEvaluation.js +0 -155
- package/dist/lib/executeQuery.spec.d.ts +0 -1
- package/dist/lib/executeQuery.spec.js +0 -325
- package/dist/lib/kubectl.spec.d.ts +0 -1
- package/dist/lib/kubectl.spec.js +0 -192
- package/dist/lib/marketplaceFetcher.spec.d.ts +0 -1
- package/dist/lib/marketplaceFetcher.spec.js +0 -225
- package/dist/lib/nextSteps.spec.d.ts +0 -1
- package/dist/lib/nextSteps.spec.js +0 -59
- package/dist/lib/output.spec.d.ts +0 -1
- package/dist/lib/output.spec.js +0 -123
- package/dist/lib/startup.spec.d.ts +0 -1
- package/dist/lib/startup.spec.js +0 -152
- package/dist/lib/stdin.spec.d.ts +0 -1
- package/dist/lib/stdin.spec.js +0 -82
- package/dist/lib/timeout.spec.d.ts +0 -1
- package/dist/lib/timeout.spec.js +0 -14
- package/dist/lib/waitForReady.spec.d.ts +0 -1
- package/dist/lib/waitForReady.spec.js +0 -104
- package/dist/marketplaceServices.spec.d.ts +0 -1
- package/dist/marketplaceServices.spec.js +0 -74
- package/dist/ui/statusFormatter.spec.d.ts +0 -1
- package/dist/ui/statusFormatter.spec.js +0 -58
package/dist/lib/chatClient.js
CHANGED
|
@@ -1,117 +1,160 @@
|
|
|
1
1
|
import { QUERY_ANNOTATIONS } from './constants.js';
|
|
2
2
|
export class ChatClient {
|
|
3
|
+
arkApiClient;
|
|
3
4
|
constructor(arkApiClient) {
|
|
4
5
|
this.arkApiClient = arkApiClient;
|
|
5
6
|
}
|
|
6
7
|
async getQueryTargets() {
|
|
7
8
|
return await this.arkApiClient.getQueryTargets();
|
|
8
9
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Send a chat completion request
|
|
11
|
-
*/
|
|
12
10
|
async sendMessage(targetId, messages, config, onChunk, signal) {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
config.conversationId ||
|
|
22
|
-
config.a2aContextId ||
|
|
23
|
-
config.queryTimeout) {
|
|
24
|
-
params.metadata = {};
|
|
25
|
-
if (config.sessionId) {
|
|
26
|
-
params.metadata.sessionId = config.sessionId;
|
|
27
|
-
}
|
|
28
|
-
if (config.conversationId) {
|
|
29
|
-
params.metadata.conversationId = config.conversationId;
|
|
30
|
-
}
|
|
31
|
-
if (config.queryTimeout) {
|
|
32
|
-
params.metadata.timeout = config.queryTimeout;
|
|
33
|
-
}
|
|
34
|
-
// Add A2A context ID to queryAnnotations (goes to annotations)
|
|
35
|
-
if (config.a2aContextId) {
|
|
36
|
-
const queryAnnotations = {
|
|
37
|
-
[QUERY_ANNOTATIONS.A2A_CONTEXT_ID]: config.a2aContextId,
|
|
38
|
-
};
|
|
39
|
-
params.metadata.queryAnnotations = JSON.stringify(queryAnnotations);
|
|
40
|
-
}
|
|
11
|
+
const parts = targetId.split('/');
|
|
12
|
+
const targetType = parts[0] || 'agent';
|
|
13
|
+
const targetName = parts.slice(1).join('/') || targetId;
|
|
14
|
+
const lastUserMessage = messages.filter(m => m.role === 'user').pop();
|
|
15
|
+
const input = lastUserMessage?.content || '';
|
|
16
|
+
const annotations = {};
|
|
17
|
+
if (config.a2aContextId) {
|
|
18
|
+
annotations[QUERY_ANNOTATIONS.A2A_CONTEXT_ID] = config.a2aContextId;
|
|
41
19
|
}
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
20
|
+
if (config.streamingEnabled && onChunk) {
|
|
21
|
+
annotations['ark.mckinsey.com/streaming-enabled'] = 'true';
|
|
22
|
+
}
|
|
23
|
+
const queryResult = await this.arkApiClient.createQuery({
|
|
24
|
+
input,
|
|
25
|
+
target: { type: targetType, name: targetName },
|
|
26
|
+
sessionId: config.sessionId,
|
|
27
|
+
conversationId: config.conversationId,
|
|
28
|
+
timeout: config.queryTimeout,
|
|
29
|
+
...(Object.keys(annotations).length > 0
|
|
30
|
+
? { metadata: { annotations } }
|
|
31
|
+
: {}),
|
|
32
|
+
});
|
|
33
|
+
const queryName = queryResult.name;
|
|
34
|
+
if (!queryName) {
|
|
35
|
+
throw new Error('Query creation did not return a name');
|
|
36
|
+
}
|
|
37
|
+
if (config.streamingEnabled && onChunk) {
|
|
38
|
+
return await this.pollStreamResponse(queryName, onChunk, signal);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return await this.pollResponse(queryName, onChunk, signal);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async pollResponse(queryName, onChunk, signal) {
|
|
45
|
+
while (!signal?.aborted) {
|
|
46
|
+
const query = (await this.arkApiClient.getQuery(queryName));
|
|
47
|
+
const phase = query.status?.phase;
|
|
48
|
+
if (phase === 'done' || phase === 'error' || phase === 'canceled') {
|
|
49
|
+
const content = query.status?.response?.content || '';
|
|
50
|
+
let toolCalls;
|
|
51
|
+
if (query.status?.response?.raw) {
|
|
52
|
+
try {
|
|
53
|
+
const rawMessages = JSON.parse(query.status.response.raw);
|
|
54
|
+
for (const msg of rawMessages) {
|
|
55
|
+
if (msg.tool_calls && msg.tool_calls.length > 0) {
|
|
56
|
+
toolCalls = msg.tool_calls.map(tc => ({
|
|
57
|
+
id: tc.id,
|
|
58
|
+
type: 'function',
|
|
59
|
+
function: tc.function,
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// ignore parse errors
|
|
66
|
+
}
|
|
49
67
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const arkMetadata = chunk.ark;
|
|
53
|
-
const content = delta?.content || '';
|
|
54
|
-
if (content) {
|
|
55
|
-
fullResponse += content;
|
|
68
|
+
if (toolCalls && onChunk) {
|
|
69
|
+
onChunk('', toolCalls, undefined);
|
|
56
70
|
}
|
|
57
|
-
if (onChunk) {
|
|
58
|
-
onChunk(content, undefined,
|
|
71
|
+
if (content && onChunk) {
|
|
72
|
+
onChunk(content, undefined, undefined);
|
|
59
73
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
if (phase === 'error') {
|
|
75
|
+
throw new Error(content || 'Query failed');
|
|
76
|
+
}
|
|
77
|
+
return content;
|
|
78
|
+
}
|
|
79
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
80
|
+
}
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
async pollStreamResponse(queryName, onChunk, signal) {
|
|
84
|
+
const baseUrl = this.arkApiClient.getBaseUrl();
|
|
85
|
+
const response = await fetch(`${baseUrl}/v1/broker/chunks?watch=true&query-id=${queryName}`, { signal });
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
return await this.pollResponse(queryName, onChunk, signal);
|
|
88
|
+
}
|
|
89
|
+
const reader = response.body?.getReader();
|
|
90
|
+
if (!reader) {
|
|
91
|
+
return await this.pollResponse(queryName, onChunk, signal);
|
|
92
|
+
}
|
|
93
|
+
const decoder = new TextDecoder();
|
|
94
|
+
let buffer = '';
|
|
95
|
+
let fullResponse = '';
|
|
96
|
+
const toolCallsById = new Map();
|
|
97
|
+
try {
|
|
98
|
+
while (true) {
|
|
99
|
+
const { done, value } = await reader.read();
|
|
100
|
+
if (done)
|
|
101
|
+
break;
|
|
102
|
+
buffer += decoder.decode(value, { stream: true });
|
|
103
|
+
const lines = buffer.split('\n\n');
|
|
104
|
+
buffer = lines.pop() || '';
|
|
105
|
+
for (const line of lines) {
|
|
106
|
+
const trimmed = line.trim();
|
|
107
|
+
if (!trimmed || !trimmed.startsWith('data:'))
|
|
108
|
+
continue;
|
|
109
|
+
const data = trimmed.substring(5).trim();
|
|
110
|
+
if (data === '[DONE]')
|
|
111
|
+
continue;
|
|
112
|
+
let chunk;
|
|
113
|
+
try {
|
|
114
|
+
chunk = JSON.parse(data);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const arkMetadata = chunk.ark;
|
|
120
|
+
const choices = chunk.choices;
|
|
121
|
+
const delta = choices?.[0]?.delta;
|
|
122
|
+
const content = delta?.content || '';
|
|
123
|
+
if (content) {
|
|
124
|
+
fullResponse += content;
|
|
125
|
+
onChunk(content, undefined, arkMetadata);
|
|
126
|
+
}
|
|
127
|
+
if (delta?.tool_calls) {
|
|
128
|
+
for (const tc of delta.tool_calls) {
|
|
129
|
+
if (!toolCallsById.has(tc.index)) {
|
|
130
|
+
toolCallsById.set(tc.index, {
|
|
131
|
+
id: tc.id || '',
|
|
132
|
+
type: 'function',
|
|
133
|
+
function: { name: tc.function?.name || '', arguments: '' },
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const existing = toolCallsById.get(tc.index);
|
|
137
|
+
if (tc.function?.arguments) {
|
|
138
|
+
existing.function.arguments += tc.function.arguments;
|
|
139
|
+
}
|
|
140
|
+
onChunk('', Array.from(toolCallsById.values()), arkMetadata);
|
|
79
141
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
142
|
+
}
|
|
143
|
+
if (!fullResponse &&
|
|
144
|
+
arkMetadata?.completedQuery) {
|
|
145
|
+
const completed = arkMetadata.completedQuery;
|
|
146
|
+
const responseContent = completed?.status?.response?.content;
|
|
147
|
+
if (responseContent) {
|
|
148
|
+
fullResponse = responseContent;
|
|
149
|
+
onChunk(responseContent, undefined, arkMetadata);
|
|
84
150
|
}
|
|
85
151
|
}
|
|
86
152
|
}
|
|
87
153
|
}
|
|
88
|
-
return fullResponse;
|
|
89
154
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const message = response.choices[0]?.message;
|
|
93
|
-
const content = message?.content || '';
|
|
94
|
-
const arkMetadata = response.ark;
|
|
95
|
-
// Handle tool calls in non-streaming mode
|
|
96
|
-
if (message?.tool_calls && message.tool_calls.length > 0) {
|
|
97
|
-
const toolCalls = message.tool_calls.map((tc) => ({
|
|
98
|
-
id: tc.id,
|
|
99
|
-
type: tc.type || 'function',
|
|
100
|
-
function: {
|
|
101
|
-
name: tc.function?.name || '',
|
|
102
|
-
arguments: tc.function?.arguments || '',
|
|
103
|
-
},
|
|
104
|
-
}));
|
|
105
|
-
// Send tool calls first
|
|
106
|
-
if (onChunk) {
|
|
107
|
-
onChunk('', toolCalls, arkMetadata);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// Send content after tool calls
|
|
111
|
-
if (content && onChunk) {
|
|
112
|
-
onChunk(content, undefined, arkMetadata);
|
|
113
|
-
}
|
|
114
|
-
return content;
|
|
155
|
+
finally {
|
|
156
|
+
reader.releaseLock();
|
|
115
157
|
}
|
|
158
|
+
return fullResponse;
|
|
116
159
|
}
|
|
117
160
|
}
|
package/dist/lib/config.js
CHANGED
|
@@ -33,7 +33,9 @@ export function loadConfig() {
|
|
|
33
33
|
}
|
|
34
34
|
catch (e) {
|
|
35
35
|
const message = e instanceof Error ? e.message : 'Unknown error';
|
|
36
|
-
throw new Error(`Invalid YAML in ${userConfigPath}: ${message}
|
|
36
|
+
throw new Error(`Invalid YAML in ${userConfigPath}: ${message}`, {
|
|
37
|
+
cause: e,
|
|
38
|
+
});
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
// Load project config from current directory
|
|
@@ -45,7 +47,9 @@ export function loadConfig() {
|
|
|
45
47
|
}
|
|
46
48
|
catch (e) {
|
|
47
49
|
const message = e instanceof Error ? e.message : 'Unknown error';
|
|
48
|
-
throw new Error(`Invalid YAML in ${projectConfigPath}: ${message}
|
|
50
|
+
throw new Error(`Invalid YAML in ${projectConfigPath}: ${message}`, {
|
|
51
|
+
cause: e,
|
|
52
|
+
});
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
// Apply environment variable overrides
|
|
@@ -106,7 +110,8 @@ function mergeConfig(target, source) {
|
|
|
106
110
|
target.services.reusePortForwards = source.services.reusePortForwards;
|
|
107
111
|
}
|
|
108
112
|
for (const [serviceName, overrides] of Object.entries(source.services)) {
|
|
109
|
-
if (serviceName !== 'reusePortForwards' &&
|
|
113
|
+
if (serviceName !== 'reusePortForwards' &&
|
|
114
|
+
typeof overrides === 'object') {
|
|
110
115
|
target.services[serviceName] = {
|
|
111
116
|
...target.services[serviceName],
|
|
112
117
|
...overrides,
|
package/dist/lib/errors.d.ts
CHANGED
package/dist/lib/errors.js
CHANGED
|
@@ -8,7 +8,6 @@ export const ExitCodes = {
|
|
|
8
8
|
CliError: 1,
|
|
9
9
|
OperationError: 2,
|
|
10
10
|
Timeout: 3,
|
|
11
|
-
EvaluationFailed: 4,
|
|
12
11
|
};
|
|
13
12
|
export var ErrorCode;
|
|
14
13
|
(function (ErrorCode) {
|
|
@@ -24,6 +23,9 @@ export var ErrorCode;
|
|
|
24
23
|
ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
25
24
|
})(ErrorCode || (ErrorCode = {}));
|
|
26
25
|
export class ArkError extends Error {
|
|
26
|
+
code;
|
|
27
|
+
details;
|
|
28
|
+
suggestions;
|
|
27
29
|
constructor(message, code = ErrorCode.UNKNOWN_ERROR, details, suggestions) {
|
|
28
30
|
super(message);
|
|
29
31
|
this.name = 'ArkError';
|
|
@@ -4,3 +4,4 @@ export declare function fetchMarketplaceManifest(): Promise<AnthropicMarketplace
|
|
|
4
4
|
export declare function mapMarketplaceItemToArkService(item: AnthropicMarketplaceItem, registry?: string): ArkService;
|
|
5
5
|
export declare function getMarketplaceServicesFromManifest(): Promise<ServiceCollection | null>;
|
|
6
6
|
export declare function getMarketplaceAgentsFromManifest(): Promise<ServiceCollection | null>;
|
|
7
|
+
export declare function getMarketplaceExecutorsFromManifest(): Promise<ServiceCollection | null>;
|
|
@@ -78,3 +78,20 @@ export async function getMarketplaceAgentsFromManifest() {
|
|
|
78
78
|
}
|
|
79
79
|
return Object.keys(agents).length > 0 ? agents : null;
|
|
80
80
|
}
|
|
81
|
+
export async function getMarketplaceExecutorsFromManifest() {
|
|
82
|
+
const manifest = await fetchMarketplaceManifest();
|
|
83
|
+
if (!manifest || !manifest.items) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const executors = {};
|
|
87
|
+
for (const item of manifest.items) {
|
|
88
|
+
if (item.ark && item.type === 'executor') {
|
|
89
|
+
const executorName = item.name
|
|
90
|
+
.toLowerCase()
|
|
91
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
92
|
+
.replace(/^-+|-+$/g, '');
|
|
93
|
+
executors[executorName] = mapMarketplaceItemToArkService(item);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return Object.keys(executors).length > 0 ? executors : null;
|
|
97
|
+
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -136,41 +136,3 @@ export interface ClusterInfo {
|
|
|
136
136
|
user?: string;
|
|
137
137
|
namespace?: string;
|
|
138
138
|
}
|
|
139
|
-
export interface EvaluationManifest {
|
|
140
|
-
apiVersion: string;
|
|
141
|
-
kind: 'Evaluation';
|
|
142
|
-
metadata: {
|
|
143
|
-
name: string;
|
|
144
|
-
};
|
|
145
|
-
spec: {
|
|
146
|
-
type: 'direct' | 'query';
|
|
147
|
-
evaluator: {
|
|
148
|
-
name: string;
|
|
149
|
-
};
|
|
150
|
-
config: {
|
|
151
|
-
input?: string;
|
|
152
|
-
output?: string;
|
|
153
|
-
queryRef?: {
|
|
154
|
-
name: string;
|
|
155
|
-
};
|
|
156
|
-
responseTarget?: {
|
|
157
|
-
type: string;
|
|
158
|
-
name: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
timeout?: string;
|
|
162
|
-
ttl?: string;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
export interface EvaluationStatus {
|
|
166
|
-
phase?: 'pending' | 'running' | 'done' | 'error';
|
|
167
|
-
score?: string;
|
|
168
|
-
passed?: boolean;
|
|
169
|
-
message?: string;
|
|
170
|
-
}
|
|
171
|
-
export interface Evaluation {
|
|
172
|
-
metadata: {
|
|
173
|
-
name: string;
|
|
174
|
-
};
|
|
175
|
-
status?: EvaluationStatus;
|
|
176
|
-
}
|
|
@@ -17,7 +17,12 @@ export declare function getAllMarketplaceServices(): Promise<ServiceCollection |
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function getAllMarketplaceAgents(): Promise<ServiceCollection | null>;
|
|
19
19
|
/**
|
|
20
|
-
* Get
|
|
20
|
+
* Get all marketplace executors, fetching from marketplace.json
|
|
21
|
+
* Returns null if marketplace is unavailable
|
|
22
|
+
*/
|
|
23
|
+
export declare function getAllMarketplaceExecutors(): Promise<ServiceCollection | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Get a marketplace item by path (supports services, agents, and executors)
|
|
21
26
|
* Returns null if marketplace is unavailable
|
|
22
27
|
*/
|
|
23
28
|
export declare function getMarketplaceItem(path: string): Promise<ArkService | undefined | null>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Supports Anthropic Marketplace JSON format for dynamic enumeration
|
|
7
7
|
*/
|
|
8
|
-
import { getMarketplaceServicesFromManifest, getMarketplaceAgentsFromManifest, } from './lib/marketplaceFetcher.js';
|
|
8
|
+
import { getMarketplaceServicesFromManifest, getMarketplaceAgentsFromManifest, getMarketplaceExecutorsFromManifest, } from './lib/marketplaceFetcher.js';
|
|
9
9
|
/**
|
|
10
10
|
* Get all marketplace services, fetching from marketplace.json
|
|
11
11
|
* Returns null if marketplace is unavailable
|
|
@@ -21,7 +21,14 @@ export async function getAllMarketplaceAgents() {
|
|
|
21
21
|
return await getMarketplaceAgentsFromManifest();
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Get
|
|
24
|
+
* Get all marketplace executors, fetching from marketplace.json
|
|
25
|
+
* Returns null if marketplace is unavailable
|
|
26
|
+
*/
|
|
27
|
+
export async function getAllMarketplaceExecutors() {
|
|
28
|
+
return await getMarketplaceExecutorsFromManifest();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get a marketplace item by path (supports services, agents, and executors)
|
|
25
32
|
* Returns null if marketplace is unavailable
|
|
26
33
|
*/
|
|
27
34
|
export async function getMarketplaceItem(path) {
|
|
@@ -41,9 +48,18 @@ export async function getMarketplaceItem(path) {
|
|
|
41
48
|
}
|
|
42
49
|
return agents[name];
|
|
43
50
|
}
|
|
51
|
+
if (path.startsWith('marketplace/executors/')) {
|
|
52
|
+
const name = path.replace(/^marketplace\/executors\//, '');
|
|
53
|
+
const executors = await getAllMarketplaceExecutors();
|
|
54
|
+
if (!executors) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return executors[name];
|
|
58
|
+
}
|
|
44
59
|
return undefined;
|
|
45
60
|
}
|
|
46
61
|
export function isMarketplaceService(name) {
|
|
47
62
|
return (name.startsWith('marketplace/services/') ||
|
|
48
|
-
name.startsWith('marketplace/agents/')
|
|
63
|
+
name.startsWith('marketplace/agents/') ||
|
|
64
|
+
name.startsWith('marketplace/executors/'));
|
|
49
65
|
}
|
|
@@ -5,8 +5,8 @@ export function createConnectingToArkOperation(params) {
|
|
|
5
5
|
operation: async (_signal) => {
|
|
6
6
|
const client = new ChatClient(params.arkApiClient);
|
|
7
7
|
const targets = await client.getQueryTargets();
|
|
8
|
-
let selectedTarget
|
|
9
|
-
let selectedIndex
|
|
8
|
+
let selectedTarget;
|
|
9
|
+
let selectedIndex;
|
|
10
10
|
if (params.initialTargetId) {
|
|
11
11
|
const matchedTarget = targets.find((t) => t.id === params.initialTargetId);
|
|
12
12
|
const matchedIndex = targets.findIndex((t) => t.id === params.initialTargetId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agents-at-scale/ark",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.56",
|
|
4
4
|
"description": "Ark CLI - Interactive terminal interface for ARK agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"clean": "rm -rf dist",
|
|
21
21
|
"lint": "eslint src/ --fix && prettier --write src/",
|
|
22
22
|
"lint:check": "eslint src/ && prettier --check src/",
|
|
23
|
-
"test": "
|
|
23
|
+
"test": "vitest run --coverage",
|
|
24
24
|
"postinstall": "echo \"Ark CLI installed. Run 'ark' to try it out.\""
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@kubernetes/client-node": "^1.3.0",
|
|
46
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
46
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
47
47
|
"axios": "^1.13.5",
|
|
48
48
|
"chalk": "^4.1.2",
|
|
49
49
|
"commander": "^12.1.0",
|
|
@@ -58,31 +58,37 @@
|
|
|
58
58
|
"marked": "^15.0.12",
|
|
59
59
|
"marked-terminal": "^7.3.0",
|
|
60
60
|
"open": "^10.2.0",
|
|
61
|
-
"openai": "^5.19.1",
|
|
62
61
|
"ora": "^8.2.0",
|
|
62
|
+
"picomatch": "4.0.4",
|
|
63
63
|
"react": "^19.1.5",
|
|
64
64
|
"yaml": "^2.6.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@eslint/js": "^
|
|
68
|
-
"@jest/globals": "^30.1.2",
|
|
67
|
+
"@eslint/js": "^10.0.1",
|
|
69
68
|
"@types/debug": "^4.1.12",
|
|
70
69
|
"@types/inquirer": "^9.0.7",
|
|
71
|
-
"@types/jest": "^30.0.0",
|
|
72
70
|
"@types/marked-terminal": "^6.1.1",
|
|
73
71
|
"@types/node": "^22.10.2",
|
|
74
72
|
"@types/react": "^19.1.13",
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
76
|
-
"@typescript-eslint/parser": "^8.
|
|
77
|
-
"
|
|
78
|
-
"
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
74
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
75
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
76
|
+
"eslint": "^10.0.0",
|
|
77
|
+
"globals": "^16.2.0",
|
|
79
78
|
"prettier": "^3.6.2",
|
|
80
|
-
"ts-jest": "^29.4.1",
|
|
81
79
|
"ts-node": "^10.9.2",
|
|
82
80
|
"tsx": "^4.20.5",
|
|
83
|
-
"typescript": "^5.7.2"
|
|
81
|
+
"typescript": "^5.7.2",
|
|
82
|
+
"vitest": "^3.2.4"
|
|
84
83
|
},
|
|
85
84
|
"engines": {
|
|
86
85
|
"node": ">=18.0.0"
|
|
86
|
+
},
|
|
87
|
+
"overrides": {
|
|
88
|
+
"minimatch": "^10.2.3",
|
|
89
|
+
"rollup": "4.59.0",
|
|
90
|
+
"hono": "^4.12.4",
|
|
91
|
+
"@hono/node-server": "^1.19.10",
|
|
92
|
+
"flatted": "^3.4.2"
|
|
87
93
|
}
|
|
88
94
|
}
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
{
|
|
6
6
|
"name": "phoenix",
|
|
7
7
|
"displayName": "Phoenix",
|
|
8
|
-
"description": "AI/ML observability
|
|
8
|
+
"description": "AI/ML observability platform with OpenTelemetry integration",
|
|
9
9
|
"version": "0.1.5",
|
|
10
10
|
"author": "ARK Marketplace",
|
|
11
11
|
"homepage": "https://github.com/mckinsey/agents-at-scale-marketplace",
|
|
12
12
|
"repository": "https://github.com/mckinsey/agents-at-scale-marketplace",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
|
-
"tags": ["observability", "
|
|
14
|
+
"tags": ["observability", "telemetry", "monitoring"],
|
|
15
15
|
"category": "observability",
|
|
16
16
|
"icon": "https://example.com/phoenix-icon.png",
|
|
17
17
|
"documentation": "https://mckinsey.github.io/agents-at-scale-marketplace/services/phoenix/",
|