kradle 0.4.1 → 0.4.2
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.
|
@@ -29,12 +29,12 @@ export default class Run extends Command {
|
|
|
29
29
|
const challengeSlug = args.challengeSlug;
|
|
30
30
|
try {
|
|
31
31
|
const { participants } = (await loadTemplateRun());
|
|
32
|
-
|
|
32
|
+
this.log(pc.blue(`>> Running challenge: ${challengeSlug}${flags.studio ? " (studio)" : ""}...`));
|
|
33
|
+
const response = await studioApi.runChallenge({
|
|
33
34
|
challenge: challengeSlug,
|
|
34
35
|
participants,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const response = await studioApi.runChallenge(template);
|
|
36
|
+
jobType: "foreground",
|
|
37
|
+
});
|
|
38
38
|
if (response.runIds && response.runIds.length > 0) {
|
|
39
39
|
const baseUrl = flags.studio ? flags["studio-url"] : flags["web-url"];
|
|
40
40
|
const runUrl = `${baseUrl}/runs/${response.runIds[0]}`;
|
package/dist/lib/api-client.d.ts
CHANGED
|
@@ -75,7 +75,8 @@ export declare class ApiClient {
|
|
|
75
75
|
runChallenge(runData: {
|
|
76
76
|
challenge: string;
|
|
77
77
|
participants: unknown[];
|
|
78
|
-
|
|
78
|
+
jobType: "background" | "foreground";
|
|
79
|
+
}): Promise<{
|
|
79
80
|
runIds?: string[] | undefined;
|
|
80
81
|
participants?: Record<string, {
|
|
81
82
|
agent: string;
|
package/dist/lib/api-client.js
CHANGED
|
@@ -221,11 +221,10 @@ export class ApiClient {
|
|
|
221
221
|
async getChallengeDownloadUrl(slug) {
|
|
222
222
|
return this.get(`challenges/${slug}/datapackDownloadUrl`, {}, DownloadUrlResponseSchema);
|
|
223
223
|
}
|
|
224
|
-
async runChallenge(runData
|
|
224
|
+
async runChallenge(runData) {
|
|
225
225
|
const url = "jobs";
|
|
226
|
-
const payload = isBackground ? { ...runData, jobType: "background" } : runData;
|
|
227
226
|
return this.post(url, {
|
|
228
|
-
body: JSON.stringify(
|
|
227
|
+
body: JSON.stringify(runData),
|
|
229
228
|
}, JobResponseSchema);
|
|
230
229
|
}
|
|
231
230
|
async deleteChallenge(challengeId) {
|
|
@@ -161,7 +161,8 @@ export class Runner {
|
|
|
161
161
|
const response = await this.api.runChallenge({
|
|
162
162
|
challenge: state.config.challenge_slug,
|
|
163
163
|
participants: state.config.participants,
|
|
164
|
-
|
|
164
|
+
jobType: "background",
|
|
165
|
+
});
|
|
165
166
|
if (!response.runIds || response.runIds.length === 0) {
|
|
166
167
|
throw new Error("No run ID returned from API");
|
|
167
168
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -42,6 +42,50 @@
|
|
|
42
42
|
"init.js"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
+
"agent:list": {
|
|
46
|
+
"aliases": [],
|
|
47
|
+
"args": {},
|
|
48
|
+
"description": "List all agents",
|
|
49
|
+
"examples": [
|
|
50
|
+
"<%= config.bin %> <%= command.id %>"
|
|
51
|
+
],
|
|
52
|
+
"flags": {
|
|
53
|
+
"api-key": {
|
|
54
|
+
"description": "Kradle API key",
|
|
55
|
+
"env": "KRADLE_API_KEY",
|
|
56
|
+
"name": "api-key",
|
|
57
|
+
"required": true,
|
|
58
|
+
"hasDynamicHelp": false,
|
|
59
|
+
"multiple": false,
|
|
60
|
+
"type": "option"
|
|
61
|
+
},
|
|
62
|
+
"api-url": {
|
|
63
|
+
"description": "Kradle Web API URL",
|
|
64
|
+
"env": "KRADLE_API_URL",
|
|
65
|
+
"name": "api-url",
|
|
66
|
+
"required": true,
|
|
67
|
+
"default": "https://api.kradle.ai/v0",
|
|
68
|
+
"hasDynamicHelp": false,
|
|
69
|
+
"multiple": false,
|
|
70
|
+
"type": "option"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"hasDynamicHelp": false,
|
|
74
|
+
"hiddenAliases": [],
|
|
75
|
+
"id": "agent:list",
|
|
76
|
+
"pluginAlias": "kradle",
|
|
77
|
+
"pluginName": "kradle",
|
|
78
|
+
"pluginType": "core",
|
|
79
|
+
"strict": true,
|
|
80
|
+
"enableJsonFlag": false,
|
|
81
|
+
"isESM": true,
|
|
82
|
+
"relativePath": [
|
|
83
|
+
"dist",
|
|
84
|
+
"commands",
|
|
85
|
+
"agent",
|
|
86
|
+
"list.js"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
45
89
|
"ai-docs:challenges-sdk": {
|
|
46
90
|
"aliases": [],
|
|
47
91
|
"args": {
|
|
@@ -1197,51 +1241,7 @@
|
|
|
1197
1241
|
"world",
|
|
1198
1242
|
"push.js"
|
|
1199
1243
|
]
|
|
1200
|
-
},
|
|
1201
|
-
"agent:list": {
|
|
1202
|
-
"aliases": [],
|
|
1203
|
-
"args": {},
|
|
1204
|
-
"description": "List all agents",
|
|
1205
|
-
"examples": [
|
|
1206
|
-
"<%= config.bin %> <%= command.id %>"
|
|
1207
|
-
],
|
|
1208
|
-
"flags": {
|
|
1209
|
-
"api-key": {
|
|
1210
|
-
"description": "Kradle API key",
|
|
1211
|
-
"env": "KRADLE_API_KEY",
|
|
1212
|
-
"name": "api-key",
|
|
1213
|
-
"required": true,
|
|
1214
|
-
"hasDynamicHelp": false,
|
|
1215
|
-
"multiple": false,
|
|
1216
|
-
"type": "option"
|
|
1217
|
-
},
|
|
1218
|
-
"api-url": {
|
|
1219
|
-
"description": "Kradle Web API URL",
|
|
1220
|
-
"env": "KRADLE_API_URL",
|
|
1221
|
-
"name": "api-url",
|
|
1222
|
-
"required": true,
|
|
1223
|
-
"default": "https://api.kradle.ai/v0",
|
|
1224
|
-
"hasDynamicHelp": false,
|
|
1225
|
-
"multiple": false,
|
|
1226
|
-
"type": "option"
|
|
1227
|
-
}
|
|
1228
|
-
},
|
|
1229
|
-
"hasDynamicHelp": false,
|
|
1230
|
-
"hiddenAliases": [],
|
|
1231
|
-
"id": "agent:list",
|
|
1232
|
-
"pluginAlias": "kradle",
|
|
1233
|
-
"pluginName": "kradle",
|
|
1234
|
-
"pluginType": "core",
|
|
1235
|
-
"strict": true,
|
|
1236
|
-
"enableJsonFlag": false,
|
|
1237
|
-
"isESM": true,
|
|
1238
|
-
"relativePath": [
|
|
1239
|
-
"dist",
|
|
1240
|
-
"commands",
|
|
1241
|
-
"agent",
|
|
1242
|
-
"list.js"
|
|
1243
|
-
]
|
|
1244
1244
|
}
|
|
1245
1245
|
},
|
|
1246
|
-
"version": "0.4.
|
|
1246
|
+
"version": "0.4.2"
|
|
1247
1247
|
}
|