@vm0/cli 9.17.2 → 9.18.0
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/index.js +896 -614
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { Command as
|
|
4
|
+
import { Command as Command63 } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/auth/index.ts
|
|
7
7
|
import { Command as Command5 } from "commander";
|
|
@@ -1987,9 +1987,108 @@ var secretsByNameContract = c11.router({
|
|
|
1987
1987
|
}
|
|
1988
1988
|
});
|
|
1989
1989
|
|
|
1990
|
-
// ../../packages/core/src/contracts/
|
|
1990
|
+
// ../../packages/core/src/contracts/variables.ts
|
|
1991
1991
|
import { z as z15 } from "zod";
|
|
1992
1992
|
var c12 = initContract();
|
|
1993
|
+
var variableNameSchema = z15.string().min(1, "Variable name is required").max(255, "Variable name must be at most 255 characters").regex(
|
|
1994
|
+
/^[A-Z][A-Z0-9_]*$/,
|
|
1995
|
+
"Variable name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_VAR)"
|
|
1996
|
+
);
|
|
1997
|
+
var variableResponseSchema = z15.object({
|
|
1998
|
+
id: z15.string().uuid(),
|
|
1999
|
+
name: z15.string(),
|
|
2000
|
+
value: z15.string(),
|
|
2001
|
+
description: z15.string().nullable(),
|
|
2002
|
+
createdAt: z15.string(),
|
|
2003
|
+
updatedAt: z15.string()
|
|
2004
|
+
});
|
|
2005
|
+
var variableListResponseSchema = z15.object({
|
|
2006
|
+
variables: z15.array(variableResponseSchema)
|
|
2007
|
+
});
|
|
2008
|
+
var setVariableRequestSchema = z15.object({
|
|
2009
|
+
name: variableNameSchema,
|
|
2010
|
+
value: z15.string().min(1, "Variable value is required"),
|
|
2011
|
+
description: z15.string().max(1e3).optional()
|
|
2012
|
+
});
|
|
2013
|
+
var variablesMainContract = c12.router({
|
|
2014
|
+
/**
|
|
2015
|
+
* GET /api/variables
|
|
2016
|
+
* List all variables for the current user's scope (includes values)
|
|
2017
|
+
*/
|
|
2018
|
+
list: {
|
|
2019
|
+
method: "GET",
|
|
2020
|
+
path: "/api/variables",
|
|
2021
|
+
headers: authHeadersSchema,
|
|
2022
|
+
responses: {
|
|
2023
|
+
200: variableListResponseSchema,
|
|
2024
|
+
401: apiErrorSchema,
|
|
2025
|
+
500: apiErrorSchema
|
|
2026
|
+
},
|
|
2027
|
+
summary: "List all variables (includes values)"
|
|
2028
|
+
},
|
|
2029
|
+
/**
|
|
2030
|
+
* PUT /api/variables
|
|
2031
|
+
* Create or update a variable
|
|
2032
|
+
*/
|
|
2033
|
+
set: {
|
|
2034
|
+
method: "PUT",
|
|
2035
|
+
path: "/api/variables",
|
|
2036
|
+
headers: authHeadersSchema,
|
|
2037
|
+
body: setVariableRequestSchema,
|
|
2038
|
+
responses: {
|
|
2039
|
+
200: variableResponseSchema,
|
|
2040
|
+
201: variableResponseSchema,
|
|
2041
|
+
400: apiErrorSchema,
|
|
2042
|
+
401: apiErrorSchema,
|
|
2043
|
+
500: apiErrorSchema
|
|
2044
|
+
},
|
|
2045
|
+
summary: "Create or update a variable"
|
|
2046
|
+
}
|
|
2047
|
+
});
|
|
2048
|
+
var variablesByNameContract = c12.router({
|
|
2049
|
+
/**
|
|
2050
|
+
* GET /api/variables/:name
|
|
2051
|
+
* Get a variable by name (includes value)
|
|
2052
|
+
*/
|
|
2053
|
+
get: {
|
|
2054
|
+
method: "GET",
|
|
2055
|
+
path: "/api/variables/:name",
|
|
2056
|
+
headers: authHeadersSchema,
|
|
2057
|
+
pathParams: z15.object({
|
|
2058
|
+
name: variableNameSchema
|
|
2059
|
+
}),
|
|
2060
|
+
responses: {
|
|
2061
|
+
200: variableResponseSchema,
|
|
2062
|
+
401: apiErrorSchema,
|
|
2063
|
+
404: apiErrorSchema,
|
|
2064
|
+
500: apiErrorSchema
|
|
2065
|
+
},
|
|
2066
|
+
summary: "Get variable by name"
|
|
2067
|
+
},
|
|
2068
|
+
/**
|
|
2069
|
+
* DELETE /api/variables/:name
|
|
2070
|
+
* Delete a variable by name
|
|
2071
|
+
*/
|
|
2072
|
+
delete: {
|
|
2073
|
+
method: "DELETE",
|
|
2074
|
+
path: "/api/variables/:name",
|
|
2075
|
+
headers: authHeadersSchema,
|
|
2076
|
+
pathParams: z15.object({
|
|
2077
|
+
name: variableNameSchema
|
|
2078
|
+
}),
|
|
2079
|
+
responses: {
|
|
2080
|
+
204: c12.noBody(),
|
|
2081
|
+
401: apiErrorSchema,
|
|
2082
|
+
404: apiErrorSchema,
|
|
2083
|
+
500: apiErrorSchema
|
|
2084
|
+
},
|
|
2085
|
+
summary: "Delete a variable"
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
|
|
2089
|
+
// ../../packages/core/src/contracts/model-providers.ts
|
|
2090
|
+
import { z as z16 } from "zod";
|
|
2091
|
+
var c13 = initContract();
|
|
1993
2092
|
var MODEL_PROVIDER_TYPES = {
|
|
1994
2093
|
"claude-code-oauth-token": {
|
|
1995
2094
|
framework: "claude-code",
|
|
@@ -2210,7 +2309,7 @@ var MODEL_PROVIDER_TYPES = {
|
|
|
2210
2309
|
customModelPlaceholder: "anthropic.claude-sonnet-4-20250514-v1:0"
|
|
2211
2310
|
}
|
|
2212
2311
|
};
|
|
2213
|
-
var modelProviderTypeSchema =
|
|
2312
|
+
var modelProviderTypeSchema = z16.enum([
|
|
2214
2313
|
"claude-code-oauth-token",
|
|
2215
2314
|
"anthropic-api-key",
|
|
2216
2315
|
"openrouter-api-key",
|
|
@@ -2221,7 +2320,7 @@ var modelProviderTypeSchema = z15.enum([
|
|
|
2221
2320
|
"azure-foundry",
|
|
2222
2321
|
"aws-bedrock"
|
|
2223
2322
|
]);
|
|
2224
|
-
var modelProviderFrameworkSchema =
|
|
2323
|
+
var modelProviderFrameworkSchema = z16.enum(["claude-code", "codex"]);
|
|
2225
2324
|
function hasAuthMethods(type) {
|
|
2226
2325
|
const config = MODEL_PROVIDER_TYPES[type];
|
|
2227
2326
|
return "authMethods" in config;
|
|
@@ -2262,45 +2361,45 @@ function getCustomModelPlaceholder(type) {
|
|
|
2262
2361
|
const config = MODEL_PROVIDER_TYPES[type];
|
|
2263
2362
|
return "customModelPlaceholder" in config ? config.customModelPlaceholder : void 0;
|
|
2264
2363
|
}
|
|
2265
|
-
var modelProviderResponseSchema =
|
|
2266
|
-
id:
|
|
2364
|
+
var modelProviderResponseSchema = z16.object({
|
|
2365
|
+
id: z16.string().uuid(),
|
|
2267
2366
|
type: modelProviderTypeSchema,
|
|
2268
2367
|
framework: modelProviderFrameworkSchema,
|
|
2269
|
-
credentialName:
|
|
2368
|
+
credentialName: z16.string().nullable(),
|
|
2270
2369
|
// Legacy single-credential (deprecated for multi-auth)
|
|
2271
|
-
authMethod:
|
|
2370
|
+
authMethod: z16.string().nullable(),
|
|
2272
2371
|
// For multi-auth providers
|
|
2273
|
-
credentialNames:
|
|
2372
|
+
credentialNames: z16.array(z16.string()).nullable(),
|
|
2274
2373
|
// For multi-auth providers
|
|
2275
|
-
isDefault:
|
|
2276
|
-
selectedModel:
|
|
2277
|
-
createdAt:
|
|
2278
|
-
updatedAt:
|
|
2374
|
+
isDefault: z16.boolean(),
|
|
2375
|
+
selectedModel: z16.string().nullable(),
|
|
2376
|
+
createdAt: z16.string(),
|
|
2377
|
+
updatedAt: z16.string()
|
|
2279
2378
|
});
|
|
2280
|
-
var modelProviderListResponseSchema =
|
|
2281
|
-
modelProviders:
|
|
2379
|
+
var modelProviderListResponseSchema = z16.object({
|
|
2380
|
+
modelProviders: z16.array(modelProviderResponseSchema)
|
|
2282
2381
|
});
|
|
2283
|
-
var upsertModelProviderRequestSchema =
|
|
2382
|
+
var upsertModelProviderRequestSchema = z16.object({
|
|
2284
2383
|
type: modelProviderTypeSchema,
|
|
2285
|
-
credential:
|
|
2384
|
+
credential: z16.string().min(1).optional(),
|
|
2286
2385
|
// Legacy single credential
|
|
2287
|
-
authMethod:
|
|
2386
|
+
authMethod: z16.string().optional(),
|
|
2288
2387
|
// For multi-auth providers
|
|
2289
|
-
credentials:
|
|
2388
|
+
credentials: z16.record(z16.string(), z16.string()).optional(),
|
|
2290
2389
|
// For multi-auth providers
|
|
2291
|
-
convert:
|
|
2292
|
-
selectedModel:
|
|
2390
|
+
convert: z16.boolean().optional(),
|
|
2391
|
+
selectedModel: z16.string().optional()
|
|
2293
2392
|
});
|
|
2294
|
-
var upsertModelProviderResponseSchema =
|
|
2393
|
+
var upsertModelProviderResponseSchema = z16.object({
|
|
2295
2394
|
provider: modelProviderResponseSchema,
|
|
2296
|
-
created:
|
|
2395
|
+
created: z16.boolean()
|
|
2297
2396
|
});
|
|
2298
|
-
var checkCredentialResponseSchema =
|
|
2299
|
-
exists:
|
|
2300
|
-
credentialName:
|
|
2301
|
-
currentType:
|
|
2397
|
+
var checkCredentialResponseSchema = z16.object({
|
|
2398
|
+
exists: z16.boolean(),
|
|
2399
|
+
credentialName: z16.string(),
|
|
2400
|
+
currentType: z16.enum(["user", "model-provider"]).optional()
|
|
2302
2401
|
});
|
|
2303
|
-
var modelProvidersMainContract =
|
|
2402
|
+
var modelProvidersMainContract = c13.router({
|
|
2304
2403
|
list: {
|
|
2305
2404
|
method: "GET",
|
|
2306
2405
|
path: "/api/model-providers",
|
|
@@ -2328,12 +2427,12 @@ var modelProvidersMainContract = c12.router({
|
|
|
2328
2427
|
summary: "Create or update a model provider"
|
|
2329
2428
|
}
|
|
2330
2429
|
});
|
|
2331
|
-
var modelProvidersCheckContract =
|
|
2430
|
+
var modelProvidersCheckContract = c13.router({
|
|
2332
2431
|
check: {
|
|
2333
2432
|
method: "GET",
|
|
2334
2433
|
path: "/api/model-providers/check/:type",
|
|
2335
2434
|
headers: authHeadersSchema,
|
|
2336
|
-
pathParams:
|
|
2435
|
+
pathParams: z16.object({
|
|
2337
2436
|
type: modelProviderTypeSchema
|
|
2338
2437
|
}),
|
|
2339
2438
|
responses: {
|
|
@@ -2344,16 +2443,16 @@ var modelProvidersCheckContract = c12.router({
|
|
|
2344
2443
|
summary: "Check if credential exists for a model provider type"
|
|
2345
2444
|
}
|
|
2346
2445
|
});
|
|
2347
|
-
var modelProvidersByTypeContract =
|
|
2446
|
+
var modelProvidersByTypeContract = c13.router({
|
|
2348
2447
|
delete: {
|
|
2349
2448
|
method: "DELETE",
|
|
2350
2449
|
path: "/api/model-providers/:type",
|
|
2351
2450
|
headers: authHeadersSchema,
|
|
2352
|
-
pathParams:
|
|
2451
|
+
pathParams: z16.object({
|
|
2353
2452
|
type: modelProviderTypeSchema
|
|
2354
2453
|
}),
|
|
2355
2454
|
responses: {
|
|
2356
|
-
204:
|
|
2455
|
+
204: c13.noBody(),
|
|
2357
2456
|
401: apiErrorSchema,
|
|
2358
2457
|
404: apiErrorSchema,
|
|
2359
2458
|
500: apiErrorSchema
|
|
@@ -2361,15 +2460,15 @@ var modelProvidersByTypeContract = c12.router({
|
|
|
2361
2460
|
summary: "Delete a model provider"
|
|
2362
2461
|
}
|
|
2363
2462
|
});
|
|
2364
|
-
var modelProvidersConvertContract =
|
|
2463
|
+
var modelProvidersConvertContract = c13.router({
|
|
2365
2464
|
convert: {
|
|
2366
2465
|
method: "POST",
|
|
2367
2466
|
path: "/api/model-providers/:type/convert",
|
|
2368
2467
|
headers: authHeadersSchema,
|
|
2369
|
-
pathParams:
|
|
2468
|
+
pathParams: z16.object({
|
|
2370
2469
|
type: modelProviderTypeSchema
|
|
2371
2470
|
}),
|
|
2372
|
-
body:
|
|
2471
|
+
body: z16.undefined(),
|
|
2373
2472
|
responses: {
|
|
2374
2473
|
200: modelProviderResponseSchema,
|
|
2375
2474
|
400: apiErrorSchema,
|
|
@@ -2380,15 +2479,15 @@ var modelProvidersConvertContract = c12.router({
|
|
|
2380
2479
|
summary: "Convert existing user credential to model provider"
|
|
2381
2480
|
}
|
|
2382
2481
|
});
|
|
2383
|
-
var modelProvidersSetDefaultContract =
|
|
2482
|
+
var modelProvidersSetDefaultContract = c13.router({
|
|
2384
2483
|
setDefault: {
|
|
2385
2484
|
method: "POST",
|
|
2386
2485
|
path: "/api/model-providers/:type/set-default",
|
|
2387
2486
|
headers: authHeadersSchema,
|
|
2388
|
-
pathParams:
|
|
2487
|
+
pathParams: z16.object({
|
|
2389
2488
|
type: modelProviderTypeSchema
|
|
2390
2489
|
}),
|
|
2391
|
-
body:
|
|
2490
|
+
body: z16.undefined(),
|
|
2392
2491
|
responses: {
|
|
2393
2492
|
200: modelProviderResponseSchema,
|
|
2394
2493
|
401: apiErrorSchema,
|
|
@@ -2398,15 +2497,15 @@ var modelProvidersSetDefaultContract = c12.router({
|
|
|
2398
2497
|
summary: "Set a model provider as default for its framework"
|
|
2399
2498
|
}
|
|
2400
2499
|
});
|
|
2401
|
-
var updateModelRequestSchema =
|
|
2402
|
-
selectedModel:
|
|
2500
|
+
var updateModelRequestSchema = z16.object({
|
|
2501
|
+
selectedModel: z16.string().optional()
|
|
2403
2502
|
});
|
|
2404
|
-
var modelProvidersUpdateModelContract =
|
|
2503
|
+
var modelProvidersUpdateModelContract = c13.router({
|
|
2405
2504
|
updateModel: {
|
|
2406
2505
|
method: "PATCH",
|
|
2407
2506
|
path: "/api/model-providers/:type/model",
|
|
2408
2507
|
headers: authHeadersSchema,
|
|
2409
|
-
pathParams:
|
|
2508
|
+
pathParams: z16.object({
|
|
2410
2509
|
type: modelProviderTypeSchema
|
|
2411
2510
|
}),
|
|
2412
2511
|
body: updateModelRequestSchema,
|
|
@@ -2421,42 +2520,42 @@ var modelProvidersUpdateModelContract = c12.router({
|
|
|
2421
2520
|
});
|
|
2422
2521
|
|
|
2423
2522
|
// ../../packages/core/src/contracts/sessions.ts
|
|
2424
|
-
import { z as
|
|
2425
|
-
var
|
|
2426
|
-
var sessionResponseSchema =
|
|
2427
|
-
id:
|
|
2428
|
-
agentComposeId:
|
|
2429
|
-
agentComposeVersionId:
|
|
2430
|
-
conversationId:
|
|
2431
|
-
artifactName:
|
|
2432
|
-
vars:
|
|
2433
|
-
secretNames:
|
|
2434
|
-
volumeVersions:
|
|
2435
|
-
createdAt:
|
|
2436
|
-
updatedAt:
|
|
2523
|
+
import { z as z17 } from "zod";
|
|
2524
|
+
var c14 = initContract();
|
|
2525
|
+
var sessionResponseSchema = z17.object({
|
|
2526
|
+
id: z17.string(),
|
|
2527
|
+
agentComposeId: z17.string(),
|
|
2528
|
+
agentComposeVersionId: z17.string().nullable(),
|
|
2529
|
+
conversationId: z17.string().nullable(),
|
|
2530
|
+
artifactName: z17.string().nullable(),
|
|
2531
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
2532
|
+
secretNames: z17.array(z17.string()).nullable(),
|
|
2533
|
+
volumeVersions: z17.record(z17.string(), z17.string()).nullable(),
|
|
2534
|
+
createdAt: z17.string(),
|
|
2535
|
+
updatedAt: z17.string()
|
|
2437
2536
|
});
|
|
2438
|
-
var agentComposeSnapshotSchema =
|
|
2439
|
-
agentComposeVersionId:
|
|
2440
|
-
vars:
|
|
2441
|
-
secretNames:
|
|
2537
|
+
var agentComposeSnapshotSchema = z17.object({
|
|
2538
|
+
agentComposeVersionId: z17.string(),
|
|
2539
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
2540
|
+
secretNames: z17.array(z17.string()).optional()
|
|
2442
2541
|
});
|
|
2443
|
-
var artifactSnapshotSchema2 =
|
|
2444
|
-
artifactName:
|
|
2445
|
-
artifactVersion:
|
|
2542
|
+
var artifactSnapshotSchema2 = z17.object({
|
|
2543
|
+
artifactName: z17.string(),
|
|
2544
|
+
artifactVersion: z17.string()
|
|
2446
2545
|
});
|
|
2447
|
-
var volumeVersionsSnapshotSchema2 =
|
|
2448
|
-
versions:
|
|
2546
|
+
var volumeVersionsSnapshotSchema2 = z17.object({
|
|
2547
|
+
versions: z17.record(z17.string(), z17.string())
|
|
2449
2548
|
});
|
|
2450
|
-
var checkpointResponseSchema =
|
|
2451
|
-
id:
|
|
2452
|
-
runId:
|
|
2453
|
-
conversationId:
|
|
2549
|
+
var checkpointResponseSchema = z17.object({
|
|
2550
|
+
id: z17.string(),
|
|
2551
|
+
runId: z17.string(),
|
|
2552
|
+
conversationId: z17.string(),
|
|
2454
2553
|
agentComposeSnapshot: agentComposeSnapshotSchema,
|
|
2455
2554
|
artifactSnapshot: artifactSnapshotSchema2.nullable(),
|
|
2456
2555
|
volumeVersionsSnapshot: volumeVersionsSnapshotSchema2.nullable(),
|
|
2457
|
-
createdAt:
|
|
2556
|
+
createdAt: z17.string()
|
|
2458
2557
|
});
|
|
2459
|
-
var sessionsByIdContract =
|
|
2558
|
+
var sessionsByIdContract = c14.router({
|
|
2460
2559
|
/**
|
|
2461
2560
|
* GET /api/agent/sessions/:id
|
|
2462
2561
|
* Get session by ID
|
|
@@ -2465,8 +2564,8 @@ var sessionsByIdContract = c13.router({
|
|
|
2465
2564
|
method: "GET",
|
|
2466
2565
|
path: "/api/agent/sessions/:id",
|
|
2467
2566
|
headers: authHeadersSchema,
|
|
2468
|
-
pathParams:
|
|
2469
|
-
id:
|
|
2567
|
+
pathParams: z17.object({
|
|
2568
|
+
id: z17.string().min(1, "Session ID is required")
|
|
2470
2569
|
}),
|
|
2471
2570
|
responses: {
|
|
2472
2571
|
200: sessionResponseSchema,
|
|
@@ -2477,7 +2576,7 @@ var sessionsByIdContract = c13.router({
|
|
|
2477
2576
|
summary: "Get session by ID"
|
|
2478
2577
|
}
|
|
2479
2578
|
});
|
|
2480
|
-
var checkpointsByIdContract =
|
|
2579
|
+
var checkpointsByIdContract = c14.router({
|
|
2481
2580
|
/**
|
|
2482
2581
|
* GET /api/agent/checkpoints/:id
|
|
2483
2582
|
* Get checkpoint by ID
|
|
@@ -2486,8 +2585,8 @@ var checkpointsByIdContract = c13.router({
|
|
|
2486
2585
|
method: "GET",
|
|
2487
2586
|
path: "/api/agent/checkpoints/:id",
|
|
2488
2587
|
headers: authHeadersSchema,
|
|
2489
|
-
pathParams:
|
|
2490
|
-
id:
|
|
2588
|
+
pathParams: z17.object({
|
|
2589
|
+
id: z17.string().min(1, "Checkpoint ID is required")
|
|
2491
2590
|
}),
|
|
2492
2591
|
responses: {
|
|
2493
2592
|
200: checkpointResponseSchema,
|
|
@@ -2500,93 +2599,93 @@ var checkpointsByIdContract = c13.router({
|
|
|
2500
2599
|
});
|
|
2501
2600
|
|
|
2502
2601
|
// ../../packages/core/src/contracts/schedules.ts
|
|
2503
|
-
import { z as
|
|
2504
|
-
var
|
|
2505
|
-
var scheduleTriggerSchema =
|
|
2506
|
-
cron:
|
|
2507
|
-
at:
|
|
2508
|
-
timezone:
|
|
2602
|
+
import { z as z18 } from "zod";
|
|
2603
|
+
var c15 = initContract();
|
|
2604
|
+
var scheduleTriggerSchema = z18.object({
|
|
2605
|
+
cron: z18.string().optional(),
|
|
2606
|
+
at: z18.string().optional(),
|
|
2607
|
+
timezone: z18.string().default("UTC")
|
|
2509
2608
|
}).refine((data) => data.cron && !data.at || !data.cron && data.at, {
|
|
2510
2609
|
message: "Exactly one of 'cron' or 'at' must be specified"
|
|
2511
2610
|
});
|
|
2512
|
-
var scheduleRunConfigSchema =
|
|
2513
|
-
agent:
|
|
2514
|
-
prompt:
|
|
2515
|
-
vars:
|
|
2516
|
-
secrets:
|
|
2517
|
-
artifactName:
|
|
2518
|
-
artifactVersion:
|
|
2519
|
-
volumeVersions:
|
|
2611
|
+
var scheduleRunConfigSchema = z18.object({
|
|
2612
|
+
agent: z18.string().min(1, "Agent reference required"),
|
|
2613
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
2614
|
+
vars: z18.record(z18.string(), z18.string()).optional(),
|
|
2615
|
+
secrets: z18.record(z18.string(), z18.string()).optional(),
|
|
2616
|
+
artifactName: z18.string().optional(),
|
|
2617
|
+
artifactVersion: z18.string().optional(),
|
|
2618
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional()
|
|
2520
2619
|
});
|
|
2521
|
-
var scheduleDefinitionSchema =
|
|
2620
|
+
var scheduleDefinitionSchema = z18.object({
|
|
2522
2621
|
on: scheduleTriggerSchema,
|
|
2523
2622
|
run: scheduleRunConfigSchema
|
|
2524
2623
|
});
|
|
2525
|
-
var scheduleYamlSchema =
|
|
2526
|
-
version:
|
|
2527
|
-
schedules:
|
|
2528
|
-
});
|
|
2529
|
-
var deployScheduleRequestSchema =
|
|
2530
|
-
name:
|
|
2531
|
-
cronExpression:
|
|
2532
|
-
atTime:
|
|
2533
|
-
timezone:
|
|
2534
|
-
prompt:
|
|
2535
|
-
vars:
|
|
2536
|
-
secrets:
|
|
2537
|
-
artifactName:
|
|
2538
|
-
artifactVersion:
|
|
2539
|
-
volumeVersions:
|
|
2624
|
+
var scheduleYamlSchema = z18.object({
|
|
2625
|
+
version: z18.literal("1.0"),
|
|
2626
|
+
schedules: z18.record(z18.string(), scheduleDefinitionSchema)
|
|
2627
|
+
});
|
|
2628
|
+
var deployScheduleRequestSchema = z18.object({
|
|
2629
|
+
name: z18.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
2630
|
+
cronExpression: z18.string().optional(),
|
|
2631
|
+
atTime: z18.string().optional(),
|
|
2632
|
+
timezone: z18.string().default("UTC"),
|
|
2633
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
2634
|
+
vars: z18.record(z18.string(), z18.string()).optional(),
|
|
2635
|
+
secrets: z18.record(z18.string(), z18.string()).optional(),
|
|
2636
|
+
artifactName: z18.string().optional(),
|
|
2637
|
+
artifactVersion: z18.string().optional(),
|
|
2638
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional(),
|
|
2540
2639
|
// Resolved agent compose ID (CLI resolves scope/name:version → composeId)
|
|
2541
|
-
composeId:
|
|
2640
|
+
composeId: z18.string().uuid("Invalid compose ID")
|
|
2542
2641
|
}).refine(
|
|
2543
2642
|
(data) => data.cronExpression && !data.atTime || !data.cronExpression && data.atTime,
|
|
2544
2643
|
{
|
|
2545
2644
|
message: "Exactly one of 'cronExpression' or 'atTime' must be specified"
|
|
2546
2645
|
}
|
|
2547
2646
|
);
|
|
2548
|
-
var scheduleResponseSchema =
|
|
2549
|
-
id:
|
|
2550
|
-
composeId:
|
|
2551
|
-
composeName:
|
|
2552
|
-
scopeSlug:
|
|
2553
|
-
name:
|
|
2554
|
-
cronExpression:
|
|
2555
|
-
atTime:
|
|
2556
|
-
timezone:
|
|
2557
|
-
prompt:
|
|
2558
|
-
vars:
|
|
2647
|
+
var scheduleResponseSchema = z18.object({
|
|
2648
|
+
id: z18.string().uuid(),
|
|
2649
|
+
composeId: z18.string().uuid(),
|
|
2650
|
+
composeName: z18.string(),
|
|
2651
|
+
scopeSlug: z18.string(),
|
|
2652
|
+
name: z18.string(),
|
|
2653
|
+
cronExpression: z18.string().nullable(),
|
|
2654
|
+
atTime: z18.string().nullable(),
|
|
2655
|
+
timezone: z18.string(),
|
|
2656
|
+
prompt: z18.string(),
|
|
2657
|
+
vars: z18.record(z18.string(), z18.string()).nullable(),
|
|
2559
2658
|
// Secret names only (values are never returned)
|
|
2560
|
-
secretNames:
|
|
2561
|
-
artifactName:
|
|
2562
|
-
artifactVersion:
|
|
2563
|
-
volumeVersions:
|
|
2564
|
-
enabled:
|
|
2565
|
-
nextRunAt:
|
|
2566
|
-
lastRunAt:
|
|
2567
|
-
retryStartedAt:
|
|
2568
|
-
createdAt:
|
|
2569
|
-
updatedAt:
|
|
2570
|
-
});
|
|
2571
|
-
var runSummarySchema =
|
|
2572
|
-
id:
|
|
2573
|
-
status:
|
|
2574
|
-
createdAt:
|
|
2575
|
-
completedAt:
|
|
2576
|
-
error:
|
|
2577
|
-
});
|
|
2578
|
-
var scheduleRunsResponseSchema =
|
|
2579
|
-
runs:
|
|
2580
|
-
});
|
|
2581
|
-
var scheduleListResponseSchema =
|
|
2582
|
-
schedules:
|
|
2583
|
-
});
|
|
2584
|
-
var deployScheduleResponseSchema =
|
|
2659
|
+
secretNames: z18.array(z18.string()).nullable(),
|
|
2660
|
+
artifactName: z18.string().nullable(),
|
|
2661
|
+
artifactVersion: z18.string().nullable(),
|
|
2662
|
+
volumeVersions: z18.record(z18.string(), z18.string()).nullable(),
|
|
2663
|
+
enabled: z18.boolean(),
|
|
2664
|
+
nextRunAt: z18.string().nullable(),
|
|
2665
|
+
lastRunAt: z18.string().nullable(),
|
|
2666
|
+
retryStartedAt: z18.string().nullable(),
|
|
2667
|
+
createdAt: z18.string(),
|
|
2668
|
+
updatedAt: z18.string()
|
|
2669
|
+
});
|
|
2670
|
+
var runSummarySchema = z18.object({
|
|
2671
|
+
id: z18.string().uuid(),
|
|
2672
|
+
status: z18.enum(["pending", "running", "completed", "failed", "timeout"]),
|
|
2673
|
+
createdAt: z18.string(),
|
|
2674
|
+
completedAt: z18.string().nullable(),
|
|
2675
|
+
error: z18.string().nullable()
|
|
2676
|
+
});
|
|
2677
|
+
var scheduleRunsResponseSchema = z18.object({
|
|
2678
|
+
runs: z18.array(runSummarySchema)
|
|
2679
|
+
});
|
|
2680
|
+
var scheduleListResponseSchema = z18.object({
|
|
2681
|
+
schedules: z18.array(scheduleResponseSchema)
|
|
2682
|
+
});
|
|
2683
|
+
var deployScheduleResponseSchema = z18.object({
|
|
2585
2684
|
schedule: scheduleResponseSchema,
|
|
2586
|
-
created:
|
|
2685
|
+
created: z18.boolean()
|
|
2587
2686
|
// true if created, false if updated
|
|
2588
2687
|
});
|
|
2589
|
-
var schedulesMainContract =
|
|
2688
|
+
var schedulesMainContract = c15.router({
|
|
2590
2689
|
/**
|
|
2591
2690
|
* POST /api/agent/schedules
|
|
2592
2691
|
* Deploy (create or update) a schedule
|
|
@@ -2624,7 +2723,7 @@ var schedulesMainContract = c14.router({
|
|
|
2624
2723
|
summary: "List all schedules"
|
|
2625
2724
|
}
|
|
2626
2725
|
});
|
|
2627
|
-
var schedulesByNameContract =
|
|
2726
|
+
var schedulesByNameContract = c15.router({
|
|
2628
2727
|
/**
|
|
2629
2728
|
* GET /api/agent/schedules/:name
|
|
2630
2729
|
* Get schedule by name
|
|
@@ -2633,11 +2732,11 @@ var schedulesByNameContract = c14.router({
|
|
|
2633
2732
|
method: "GET",
|
|
2634
2733
|
path: "/api/agent/schedules/:name",
|
|
2635
2734
|
headers: authHeadersSchema,
|
|
2636
|
-
pathParams:
|
|
2637
|
-
name:
|
|
2735
|
+
pathParams: z18.object({
|
|
2736
|
+
name: z18.string().min(1, "Schedule name required")
|
|
2638
2737
|
}),
|
|
2639
|
-
query:
|
|
2640
|
-
composeId:
|
|
2738
|
+
query: z18.object({
|
|
2739
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
2641
2740
|
}),
|
|
2642
2741
|
responses: {
|
|
2643
2742
|
200: scheduleResponseSchema,
|
|
@@ -2654,21 +2753,21 @@ var schedulesByNameContract = c14.router({
|
|
|
2654
2753
|
method: "DELETE",
|
|
2655
2754
|
path: "/api/agent/schedules/:name",
|
|
2656
2755
|
headers: authHeadersSchema,
|
|
2657
|
-
pathParams:
|
|
2658
|
-
name:
|
|
2756
|
+
pathParams: z18.object({
|
|
2757
|
+
name: z18.string().min(1, "Schedule name required")
|
|
2659
2758
|
}),
|
|
2660
|
-
query:
|
|
2661
|
-
composeId:
|
|
2759
|
+
query: z18.object({
|
|
2760
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
2662
2761
|
}),
|
|
2663
2762
|
responses: {
|
|
2664
|
-
204:
|
|
2763
|
+
204: c15.noBody(),
|
|
2665
2764
|
401: apiErrorSchema,
|
|
2666
2765
|
404: apiErrorSchema
|
|
2667
2766
|
},
|
|
2668
2767
|
summary: "Delete schedule"
|
|
2669
2768
|
}
|
|
2670
2769
|
});
|
|
2671
|
-
var schedulesEnableContract =
|
|
2770
|
+
var schedulesEnableContract = c15.router({
|
|
2672
2771
|
/**
|
|
2673
2772
|
* POST /api/agent/schedules/:name/enable
|
|
2674
2773
|
* Enable a disabled schedule
|
|
@@ -2677,11 +2776,11 @@ var schedulesEnableContract = c14.router({
|
|
|
2677
2776
|
method: "POST",
|
|
2678
2777
|
path: "/api/agent/schedules/:name/enable",
|
|
2679
2778
|
headers: authHeadersSchema,
|
|
2680
|
-
pathParams:
|
|
2681
|
-
name:
|
|
2779
|
+
pathParams: z18.object({
|
|
2780
|
+
name: z18.string().min(1, "Schedule name required")
|
|
2682
2781
|
}),
|
|
2683
|
-
body:
|
|
2684
|
-
composeId:
|
|
2782
|
+
body: z18.object({
|
|
2783
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
2685
2784
|
}),
|
|
2686
2785
|
responses: {
|
|
2687
2786
|
200: scheduleResponseSchema,
|
|
@@ -2698,11 +2797,11 @@ var schedulesEnableContract = c14.router({
|
|
|
2698
2797
|
method: "POST",
|
|
2699
2798
|
path: "/api/agent/schedules/:name/disable",
|
|
2700
2799
|
headers: authHeadersSchema,
|
|
2701
|
-
pathParams:
|
|
2702
|
-
name:
|
|
2800
|
+
pathParams: z18.object({
|
|
2801
|
+
name: z18.string().min(1, "Schedule name required")
|
|
2703
2802
|
}),
|
|
2704
|
-
body:
|
|
2705
|
-
composeId:
|
|
2803
|
+
body: z18.object({
|
|
2804
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
2706
2805
|
}),
|
|
2707
2806
|
responses: {
|
|
2708
2807
|
200: scheduleResponseSchema,
|
|
@@ -2712,7 +2811,7 @@ var schedulesEnableContract = c14.router({
|
|
|
2712
2811
|
summary: "Disable schedule"
|
|
2713
2812
|
}
|
|
2714
2813
|
});
|
|
2715
|
-
var scheduleRunsContract =
|
|
2814
|
+
var scheduleRunsContract = c15.router({
|
|
2716
2815
|
/**
|
|
2717
2816
|
* GET /api/agent/schedules/:name/runs
|
|
2718
2817
|
* List recent runs for a schedule
|
|
@@ -2721,12 +2820,12 @@ var scheduleRunsContract = c14.router({
|
|
|
2721
2820
|
method: "GET",
|
|
2722
2821
|
path: "/api/agent/schedules/:name/runs",
|
|
2723
2822
|
headers: authHeadersSchema,
|
|
2724
|
-
pathParams:
|
|
2725
|
-
name:
|
|
2823
|
+
pathParams: z18.object({
|
|
2824
|
+
name: z18.string().min(1, "Schedule name required")
|
|
2726
2825
|
}),
|
|
2727
|
-
query:
|
|
2728
|
-
composeId:
|
|
2729
|
-
limit:
|
|
2826
|
+
query: z18.object({
|
|
2827
|
+
composeId: z18.string().uuid("Compose ID required"),
|
|
2828
|
+
limit: z18.coerce.number().min(0).max(100).default(5)
|
|
2730
2829
|
}),
|
|
2731
2830
|
responses: {
|
|
2732
2831
|
200: scheduleRunsResponseSchema,
|
|
@@ -2738,18 +2837,18 @@ var scheduleRunsContract = c14.router({
|
|
|
2738
2837
|
});
|
|
2739
2838
|
|
|
2740
2839
|
// ../../packages/core/src/contracts/realtime.ts
|
|
2741
|
-
import { z as
|
|
2742
|
-
var
|
|
2743
|
-
var ablyTokenRequestSchema =
|
|
2744
|
-
keyName:
|
|
2745
|
-
ttl:
|
|
2746
|
-
timestamp:
|
|
2747
|
-
capability:
|
|
2748
|
-
clientId:
|
|
2749
|
-
nonce:
|
|
2750
|
-
mac:
|
|
2751
|
-
});
|
|
2752
|
-
var realtimeTokenContract =
|
|
2840
|
+
import { z as z19 } from "zod";
|
|
2841
|
+
var c16 = initContract();
|
|
2842
|
+
var ablyTokenRequestSchema = z19.object({
|
|
2843
|
+
keyName: z19.string(),
|
|
2844
|
+
ttl: z19.number().optional(),
|
|
2845
|
+
timestamp: z19.number(),
|
|
2846
|
+
capability: z19.string(),
|
|
2847
|
+
clientId: z19.string().optional(),
|
|
2848
|
+
nonce: z19.string(),
|
|
2849
|
+
mac: z19.string()
|
|
2850
|
+
});
|
|
2851
|
+
var realtimeTokenContract = c16.router({
|
|
2753
2852
|
/**
|
|
2754
2853
|
* POST /api/realtime/token
|
|
2755
2854
|
* Get an Ably token to subscribe to a run's events channel
|
|
@@ -2758,8 +2857,8 @@ var realtimeTokenContract = c15.router({
|
|
|
2758
2857
|
method: "POST",
|
|
2759
2858
|
path: "/api/realtime/token",
|
|
2760
2859
|
headers: authHeadersSchema,
|
|
2761
|
-
body:
|
|
2762
|
-
runId:
|
|
2860
|
+
body: z19.object({
|
|
2861
|
+
runId: z19.string().uuid("runId must be a valid UUID")
|
|
2763
2862
|
}),
|
|
2764
2863
|
responses: {
|
|
2765
2864
|
200: ablyTokenRequestSchema,
|
|
@@ -2771,7 +2870,7 @@ var realtimeTokenContract = c15.router({
|
|
|
2771
2870
|
summary: "Get Ably token for run event subscription"
|
|
2772
2871
|
}
|
|
2773
2872
|
});
|
|
2774
|
-
var runnerRealtimeTokenContract =
|
|
2873
|
+
var runnerRealtimeTokenContract = c16.router({
|
|
2775
2874
|
/**
|
|
2776
2875
|
* POST /api/runners/realtime/token
|
|
2777
2876
|
* Get an Ably token to subscribe to a runner group's job notification channel
|
|
@@ -2780,7 +2879,7 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
2780
2879
|
method: "POST",
|
|
2781
2880
|
path: "/api/runners/realtime/token",
|
|
2782
2881
|
headers: authHeadersSchema,
|
|
2783
|
-
body:
|
|
2882
|
+
body: z19.object({
|
|
2784
2883
|
group: runnerGroupSchema
|
|
2785
2884
|
}),
|
|
2786
2885
|
responses: {
|
|
@@ -2794,11 +2893,11 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
2794
2893
|
});
|
|
2795
2894
|
|
|
2796
2895
|
// ../../packages/core/src/contracts/platform.ts
|
|
2797
|
-
import { z as
|
|
2896
|
+
import { z as z21 } from "zod";
|
|
2798
2897
|
|
|
2799
2898
|
// ../../packages/core/src/contracts/public/common.ts
|
|
2800
|
-
import { z as
|
|
2801
|
-
var publicApiErrorTypeSchema =
|
|
2899
|
+
import { z as z20 } from "zod";
|
|
2900
|
+
var publicApiErrorTypeSchema = z20.enum([
|
|
2802
2901
|
"api_error",
|
|
2803
2902
|
// Internal server error (5xx)
|
|
2804
2903
|
"invalid_request_error",
|
|
@@ -2812,40 +2911,40 @@ var publicApiErrorTypeSchema = z19.enum([
|
|
|
2812
2911
|
"rate_limit_error"
|
|
2813
2912
|
// Rate limit exceeded (429)
|
|
2814
2913
|
]);
|
|
2815
|
-
var publicApiErrorSchema =
|
|
2816
|
-
error:
|
|
2914
|
+
var publicApiErrorSchema = z20.object({
|
|
2915
|
+
error: z20.object({
|
|
2817
2916
|
type: publicApiErrorTypeSchema,
|
|
2818
|
-
code:
|
|
2819
|
-
message:
|
|
2820
|
-
param:
|
|
2821
|
-
docUrl:
|
|
2917
|
+
code: z20.string(),
|
|
2918
|
+
message: z20.string(),
|
|
2919
|
+
param: z20.string().optional(),
|
|
2920
|
+
docUrl: z20.string().url().optional()
|
|
2822
2921
|
})
|
|
2823
2922
|
});
|
|
2824
|
-
var paginationSchema =
|
|
2825
|
-
hasMore:
|
|
2826
|
-
nextCursor:
|
|
2923
|
+
var paginationSchema = z20.object({
|
|
2924
|
+
hasMore: z20.boolean(),
|
|
2925
|
+
nextCursor: z20.string().nullable()
|
|
2827
2926
|
});
|
|
2828
2927
|
function createPaginatedResponseSchema(dataSchema) {
|
|
2829
|
-
return
|
|
2830
|
-
data:
|
|
2928
|
+
return z20.object({
|
|
2929
|
+
data: z20.array(dataSchema),
|
|
2831
2930
|
pagination: paginationSchema
|
|
2832
2931
|
});
|
|
2833
2932
|
}
|
|
2834
|
-
var listQuerySchema =
|
|
2835
|
-
cursor:
|
|
2836
|
-
limit:
|
|
2933
|
+
var listQuerySchema = z20.object({
|
|
2934
|
+
cursor: z20.string().optional(),
|
|
2935
|
+
limit: z20.coerce.number().min(1).max(100).default(20)
|
|
2837
2936
|
});
|
|
2838
|
-
var requestIdSchema =
|
|
2839
|
-
var timestampSchema =
|
|
2937
|
+
var requestIdSchema = z20.string().uuid();
|
|
2938
|
+
var timestampSchema = z20.string().datetime();
|
|
2840
2939
|
|
|
2841
2940
|
// ../../packages/core/src/contracts/platform.ts
|
|
2842
|
-
var
|
|
2843
|
-
var platformPaginationSchema =
|
|
2844
|
-
hasMore:
|
|
2845
|
-
nextCursor:
|
|
2846
|
-
totalPages:
|
|
2941
|
+
var c17 = initContract();
|
|
2942
|
+
var platformPaginationSchema = z21.object({
|
|
2943
|
+
hasMore: z21.boolean(),
|
|
2944
|
+
nextCursor: z21.string().nullable(),
|
|
2945
|
+
totalPages: z21.number()
|
|
2847
2946
|
});
|
|
2848
|
-
var platformLogStatusSchema =
|
|
2947
|
+
var platformLogStatusSchema = z21.enum([
|
|
2849
2948
|
"pending",
|
|
2850
2949
|
"running",
|
|
2851
2950
|
"completed",
|
|
@@ -2853,41 +2952,41 @@ var platformLogStatusSchema = z20.enum([
|
|
|
2853
2952
|
"timeout",
|
|
2854
2953
|
"cancelled"
|
|
2855
2954
|
]);
|
|
2856
|
-
var platformLogEntrySchema =
|
|
2857
|
-
id:
|
|
2858
|
-
sessionId:
|
|
2859
|
-
agentName:
|
|
2860
|
-
framework:
|
|
2955
|
+
var platformLogEntrySchema = z21.object({
|
|
2956
|
+
id: z21.string().uuid(),
|
|
2957
|
+
sessionId: z21.string().nullable(),
|
|
2958
|
+
agentName: z21.string(),
|
|
2959
|
+
framework: z21.string().nullable(),
|
|
2861
2960
|
status: platformLogStatusSchema,
|
|
2862
|
-
createdAt:
|
|
2961
|
+
createdAt: z21.string()
|
|
2863
2962
|
});
|
|
2864
|
-
var platformLogsListResponseSchema =
|
|
2865
|
-
data:
|
|
2963
|
+
var platformLogsListResponseSchema = z21.object({
|
|
2964
|
+
data: z21.array(platformLogEntrySchema),
|
|
2866
2965
|
pagination: platformPaginationSchema
|
|
2867
2966
|
});
|
|
2868
|
-
var artifactSchema =
|
|
2869
|
-
name:
|
|
2870
|
-
version:
|
|
2967
|
+
var artifactSchema = z21.object({
|
|
2968
|
+
name: z21.string().nullable(),
|
|
2969
|
+
version: z21.string().nullable()
|
|
2871
2970
|
});
|
|
2872
|
-
var platformLogDetailSchema =
|
|
2873
|
-
id:
|
|
2874
|
-
sessionId:
|
|
2875
|
-
agentName:
|
|
2876
|
-
framework:
|
|
2971
|
+
var platformLogDetailSchema = z21.object({
|
|
2972
|
+
id: z21.string().uuid(),
|
|
2973
|
+
sessionId: z21.string().nullable(),
|
|
2974
|
+
agentName: z21.string(),
|
|
2975
|
+
framework: z21.string().nullable(),
|
|
2877
2976
|
status: platformLogStatusSchema,
|
|
2878
|
-
prompt:
|
|
2879
|
-
error:
|
|
2880
|
-
createdAt:
|
|
2881
|
-
startedAt:
|
|
2882
|
-
completedAt:
|
|
2977
|
+
prompt: z21.string(),
|
|
2978
|
+
error: z21.string().nullable(),
|
|
2979
|
+
createdAt: z21.string(),
|
|
2980
|
+
startedAt: z21.string().nullable(),
|
|
2981
|
+
completedAt: z21.string().nullable(),
|
|
2883
2982
|
artifact: artifactSchema
|
|
2884
2983
|
});
|
|
2885
|
-
var platformLogsListContract =
|
|
2984
|
+
var platformLogsListContract = c17.router({
|
|
2886
2985
|
list: {
|
|
2887
2986
|
method: "GET",
|
|
2888
2987
|
path: "/api/platform/logs",
|
|
2889
2988
|
query: listQuerySchema.extend({
|
|
2890
|
-
search:
|
|
2989
|
+
search: z21.string().optional()
|
|
2891
2990
|
}),
|
|
2892
2991
|
responses: {
|
|
2893
2992
|
200: platformLogsListResponseSchema,
|
|
@@ -2896,12 +2995,12 @@ var platformLogsListContract = c16.router({
|
|
|
2896
2995
|
summary: "List agent run logs with pagination"
|
|
2897
2996
|
}
|
|
2898
2997
|
});
|
|
2899
|
-
var platformLogsByIdContract =
|
|
2998
|
+
var platformLogsByIdContract = c17.router({
|
|
2900
2999
|
getById: {
|
|
2901
3000
|
method: "GET",
|
|
2902
3001
|
path: "/api/platform/logs/:id",
|
|
2903
|
-
pathParams:
|
|
2904
|
-
id:
|
|
3002
|
+
pathParams: z21.object({
|
|
3003
|
+
id: z21.string().uuid("Invalid log ID")
|
|
2905
3004
|
}),
|
|
2906
3005
|
responses: {
|
|
2907
3006
|
200: platformLogDetailSchema,
|
|
@@ -2911,17 +3010,17 @@ var platformLogsByIdContract = c16.router({
|
|
|
2911
3010
|
summary: "Get agent run log details by ID"
|
|
2912
3011
|
}
|
|
2913
3012
|
});
|
|
2914
|
-
var artifactDownloadResponseSchema =
|
|
2915
|
-
url:
|
|
2916
|
-
expiresAt:
|
|
3013
|
+
var artifactDownloadResponseSchema = z21.object({
|
|
3014
|
+
url: z21.string().url(),
|
|
3015
|
+
expiresAt: z21.string()
|
|
2917
3016
|
});
|
|
2918
|
-
var platformArtifactDownloadContract =
|
|
3017
|
+
var platformArtifactDownloadContract = c17.router({
|
|
2919
3018
|
getDownloadUrl: {
|
|
2920
3019
|
method: "GET",
|
|
2921
3020
|
path: "/api/platform/artifacts/download",
|
|
2922
|
-
query:
|
|
2923
|
-
name:
|
|
2924
|
-
version:
|
|
3021
|
+
query: z21.object({
|
|
3022
|
+
name: z21.string().min(1, "Artifact name is required"),
|
|
3023
|
+
version: z21.string().optional()
|
|
2925
3024
|
}),
|
|
2926
3025
|
responses: {
|
|
2927
3026
|
200: artifactDownloadResponseSchema,
|
|
@@ -2933,29 +3032,29 @@ var platformArtifactDownloadContract = c16.router({
|
|
|
2933
3032
|
});
|
|
2934
3033
|
|
|
2935
3034
|
// ../../packages/core/src/contracts/llm.ts
|
|
2936
|
-
import { z as
|
|
2937
|
-
var
|
|
2938
|
-
var messageRoleSchema =
|
|
2939
|
-
var chatMessageSchema =
|
|
3035
|
+
import { z as z22 } from "zod";
|
|
3036
|
+
var c18 = initContract();
|
|
3037
|
+
var messageRoleSchema = z22.enum(["user", "assistant", "system"]);
|
|
3038
|
+
var chatMessageSchema = z22.object({
|
|
2940
3039
|
role: messageRoleSchema,
|
|
2941
|
-
content:
|
|
3040
|
+
content: z22.string()
|
|
2942
3041
|
});
|
|
2943
|
-
var tokenUsageSchema =
|
|
2944
|
-
promptTokens:
|
|
2945
|
-
completionTokens:
|
|
2946
|
-
totalTokens:
|
|
3042
|
+
var tokenUsageSchema = z22.object({
|
|
3043
|
+
promptTokens: z22.number(),
|
|
3044
|
+
completionTokens: z22.number(),
|
|
3045
|
+
totalTokens: z22.number()
|
|
2947
3046
|
});
|
|
2948
|
-
var llmChatRequestSchema =
|
|
2949
|
-
model:
|
|
2950
|
-
messages:
|
|
2951
|
-
stream:
|
|
3047
|
+
var llmChatRequestSchema = z22.object({
|
|
3048
|
+
model: z22.string().min(1).optional(),
|
|
3049
|
+
messages: z22.array(chatMessageSchema).min(1, "At least one message is required"),
|
|
3050
|
+
stream: z22.boolean().optional().default(false)
|
|
2952
3051
|
});
|
|
2953
|
-
var llmChatResponseSchema =
|
|
2954
|
-
content:
|
|
2955
|
-
model:
|
|
3052
|
+
var llmChatResponseSchema = z22.object({
|
|
3053
|
+
content: z22.string(),
|
|
3054
|
+
model: z22.string(),
|
|
2956
3055
|
usage: tokenUsageSchema
|
|
2957
3056
|
});
|
|
2958
|
-
var llmChatContract =
|
|
3057
|
+
var llmChatContract = c18.router({
|
|
2959
3058
|
chat: {
|
|
2960
3059
|
method: "POST",
|
|
2961
3060
|
path: "/api/llm/chat",
|
|
@@ -2971,28 +3070,28 @@ var llmChatContract = c17.router({
|
|
|
2971
3070
|
});
|
|
2972
3071
|
|
|
2973
3072
|
// ../../packages/core/src/contracts/public/agents.ts
|
|
2974
|
-
import { z as
|
|
2975
|
-
var
|
|
2976
|
-
var publicAgentSchema =
|
|
2977
|
-
id:
|
|
2978
|
-
name:
|
|
2979
|
-
currentVersionId:
|
|
3073
|
+
import { z as z23 } from "zod";
|
|
3074
|
+
var c19 = initContract();
|
|
3075
|
+
var publicAgentSchema = z23.object({
|
|
3076
|
+
id: z23.string(),
|
|
3077
|
+
name: z23.string(),
|
|
3078
|
+
currentVersionId: z23.string().nullable(),
|
|
2980
3079
|
createdAt: timestampSchema,
|
|
2981
3080
|
updatedAt: timestampSchema
|
|
2982
3081
|
});
|
|
2983
|
-
var agentVersionSchema =
|
|
2984
|
-
id:
|
|
2985
|
-
agentId:
|
|
2986
|
-
versionNumber:
|
|
3082
|
+
var agentVersionSchema = z23.object({
|
|
3083
|
+
id: z23.string(),
|
|
3084
|
+
agentId: z23.string(),
|
|
3085
|
+
versionNumber: z23.number(),
|
|
2987
3086
|
createdAt: timestampSchema
|
|
2988
3087
|
});
|
|
2989
3088
|
var publicAgentDetailSchema = publicAgentSchema;
|
|
2990
3089
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
2991
3090
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
2992
3091
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
2993
|
-
name:
|
|
3092
|
+
name: z23.string().optional()
|
|
2994
3093
|
});
|
|
2995
|
-
var publicAgentsListContract =
|
|
3094
|
+
var publicAgentsListContract = c19.router({
|
|
2996
3095
|
list: {
|
|
2997
3096
|
method: "GET",
|
|
2998
3097
|
path: "/v1/agents",
|
|
@@ -3007,13 +3106,13 @@ var publicAgentsListContract = c18.router({
|
|
|
3007
3106
|
description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
|
|
3008
3107
|
}
|
|
3009
3108
|
});
|
|
3010
|
-
var publicAgentByIdContract =
|
|
3109
|
+
var publicAgentByIdContract = c19.router({
|
|
3011
3110
|
get: {
|
|
3012
3111
|
method: "GET",
|
|
3013
3112
|
path: "/v1/agents/:id",
|
|
3014
3113
|
headers: authHeadersSchema,
|
|
3015
|
-
pathParams:
|
|
3016
|
-
id:
|
|
3114
|
+
pathParams: z23.object({
|
|
3115
|
+
id: z23.string().min(1, "Agent ID is required")
|
|
3017
3116
|
}),
|
|
3018
3117
|
responses: {
|
|
3019
3118
|
200: publicAgentDetailSchema,
|
|
@@ -3025,13 +3124,13 @@ var publicAgentByIdContract = c18.router({
|
|
|
3025
3124
|
description: "Get agent details by ID"
|
|
3026
3125
|
}
|
|
3027
3126
|
});
|
|
3028
|
-
var publicAgentVersionsContract =
|
|
3127
|
+
var publicAgentVersionsContract = c19.router({
|
|
3029
3128
|
list: {
|
|
3030
3129
|
method: "GET",
|
|
3031
3130
|
path: "/v1/agents/:id/versions",
|
|
3032
3131
|
headers: authHeadersSchema,
|
|
3033
|
-
pathParams:
|
|
3034
|
-
id:
|
|
3132
|
+
pathParams: z23.object({
|
|
3133
|
+
id: z23.string().min(1, "Agent ID is required")
|
|
3035
3134
|
}),
|
|
3036
3135
|
query: listQuerySchema,
|
|
3037
3136
|
responses: {
|
|
@@ -3046,9 +3145,9 @@ var publicAgentVersionsContract = c18.router({
|
|
|
3046
3145
|
});
|
|
3047
3146
|
|
|
3048
3147
|
// ../../packages/core/src/contracts/public/runs.ts
|
|
3049
|
-
import { z as
|
|
3050
|
-
var
|
|
3051
|
-
var publicRunStatusSchema =
|
|
3148
|
+
import { z as z24 } from "zod";
|
|
3149
|
+
var c20 = initContract();
|
|
3150
|
+
var publicRunStatusSchema = z24.enum([
|
|
3052
3151
|
"pending",
|
|
3053
3152
|
"running",
|
|
3054
3153
|
"completed",
|
|
@@ -3056,54 +3155,54 @@ var publicRunStatusSchema = z23.enum([
|
|
|
3056
3155
|
"timeout",
|
|
3057
3156
|
"cancelled"
|
|
3058
3157
|
]);
|
|
3059
|
-
var publicRunSchema =
|
|
3060
|
-
id:
|
|
3061
|
-
agentId:
|
|
3062
|
-
agentName:
|
|
3158
|
+
var publicRunSchema = z24.object({
|
|
3159
|
+
id: z24.string(),
|
|
3160
|
+
agentId: z24.string(),
|
|
3161
|
+
agentName: z24.string(),
|
|
3063
3162
|
status: publicRunStatusSchema,
|
|
3064
|
-
prompt:
|
|
3163
|
+
prompt: z24.string(),
|
|
3065
3164
|
createdAt: timestampSchema,
|
|
3066
3165
|
startedAt: timestampSchema.nullable(),
|
|
3067
3166
|
completedAt: timestampSchema.nullable()
|
|
3068
3167
|
});
|
|
3069
3168
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
3070
|
-
error:
|
|
3071
|
-
executionTimeMs:
|
|
3072
|
-
checkpointId:
|
|
3073
|
-
sessionId:
|
|
3074
|
-
artifactName:
|
|
3075
|
-
artifactVersion:
|
|
3076
|
-
volumes:
|
|
3169
|
+
error: z24.string().nullable(),
|
|
3170
|
+
executionTimeMs: z24.number().nullable(),
|
|
3171
|
+
checkpointId: z24.string().nullable(),
|
|
3172
|
+
sessionId: z24.string().nullable(),
|
|
3173
|
+
artifactName: z24.string().nullable(),
|
|
3174
|
+
artifactVersion: z24.string().nullable(),
|
|
3175
|
+
volumes: z24.record(z24.string(), z24.string()).optional()
|
|
3077
3176
|
});
|
|
3078
3177
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
3079
|
-
var createRunRequestSchema =
|
|
3178
|
+
var createRunRequestSchema = z24.object({
|
|
3080
3179
|
// Agent identification (one of: agent, agentId, sessionId, checkpointId)
|
|
3081
|
-
agent:
|
|
3180
|
+
agent: z24.string().optional(),
|
|
3082
3181
|
// Agent name
|
|
3083
|
-
agentId:
|
|
3182
|
+
agentId: z24.string().optional(),
|
|
3084
3183
|
// Agent ID
|
|
3085
|
-
agentVersion:
|
|
3184
|
+
agentVersion: z24.string().optional(),
|
|
3086
3185
|
// Version specifier (e.g., "latest", "v1", specific ID)
|
|
3087
3186
|
// Continue session
|
|
3088
|
-
sessionId:
|
|
3187
|
+
sessionId: z24.string().optional(),
|
|
3089
3188
|
// Resume from checkpoint
|
|
3090
|
-
checkpointId:
|
|
3189
|
+
checkpointId: z24.string().optional(),
|
|
3091
3190
|
// Required
|
|
3092
|
-
prompt:
|
|
3191
|
+
prompt: z24.string().min(1, "Prompt is required"),
|
|
3093
3192
|
// Optional configuration
|
|
3094
|
-
variables:
|
|
3095
|
-
secrets:
|
|
3096
|
-
artifactName:
|
|
3193
|
+
variables: z24.record(z24.string(), z24.string()).optional(),
|
|
3194
|
+
secrets: z24.record(z24.string(), z24.string()).optional(),
|
|
3195
|
+
artifactName: z24.string().optional(),
|
|
3097
3196
|
// Artifact name to mount
|
|
3098
|
-
artifactVersion:
|
|
3197
|
+
artifactVersion: z24.string().optional(),
|
|
3099
3198
|
// Artifact version (defaults to latest)
|
|
3100
|
-
volumes:
|
|
3199
|
+
volumes: z24.record(z24.string(), z24.string()).optional()
|
|
3101
3200
|
// volume_name -> version
|
|
3102
3201
|
});
|
|
3103
3202
|
var runListQuerySchema = listQuerySchema.extend({
|
|
3104
3203
|
status: publicRunStatusSchema.optional()
|
|
3105
3204
|
});
|
|
3106
|
-
var publicRunsListContract =
|
|
3205
|
+
var publicRunsListContract = c20.router({
|
|
3107
3206
|
list: {
|
|
3108
3207
|
method: "GET",
|
|
3109
3208
|
path: "/v1/runs",
|
|
@@ -3135,13 +3234,13 @@ var publicRunsListContract = c19.router({
|
|
|
3135
3234
|
description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
|
|
3136
3235
|
}
|
|
3137
3236
|
});
|
|
3138
|
-
var publicRunByIdContract =
|
|
3237
|
+
var publicRunByIdContract = c20.router({
|
|
3139
3238
|
get: {
|
|
3140
3239
|
method: "GET",
|
|
3141
3240
|
path: "/v1/runs/:id",
|
|
3142
3241
|
headers: authHeadersSchema,
|
|
3143
|
-
pathParams:
|
|
3144
|
-
id:
|
|
3242
|
+
pathParams: z24.object({
|
|
3243
|
+
id: z24.string().min(1, "Run ID is required")
|
|
3145
3244
|
}),
|
|
3146
3245
|
responses: {
|
|
3147
3246
|
200: publicRunDetailSchema,
|
|
@@ -3153,15 +3252,15 @@ var publicRunByIdContract = c19.router({
|
|
|
3153
3252
|
description: "Get run details by ID"
|
|
3154
3253
|
}
|
|
3155
3254
|
});
|
|
3156
|
-
var publicRunCancelContract =
|
|
3255
|
+
var publicRunCancelContract = c20.router({
|
|
3157
3256
|
cancel: {
|
|
3158
3257
|
method: "POST",
|
|
3159
3258
|
path: "/v1/runs/:id/cancel",
|
|
3160
3259
|
headers: authHeadersSchema,
|
|
3161
|
-
pathParams:
|
|
3162
|
-
id:
|
|
3260
|
+
pathParams: z24.object({
|
|
3261
|
+
id: z24.string().min(1, "Run ID is required")
|
|
3163
3262
|
}),
|
|
3164
|
-
body:
|
|
3263
|
+
body: z24.undefined(),
|
|
3165
3264
|
responses: {
|
|
3166
3265
|
200: publicRunDetailSchema,
|
|
3167
3266
|
400: publicApiErrorSchema,
|
|
@@ -3174,27 +3273,27 @@ var publicRunCancelContract = c19.router({
|
|
|
3174
3273
|
description: "Cancel a pending or running execution"
|
|
3175
3274
|
}
|
|
3176
3275
|
});
|
|
3177
|
-
var logEntrySchema =
|
|
3276
|
+
var logEntrySchema = z24.object({
|
|
3178
3277
|
timestamp: timestampSchema,
|
|
3179
|
-
type:
|
|
3180
|
-
level:
|
|
3181
|
-
message:
|
|
3182
|
-
metadata:
|
|
3278
|
+
type: z24.enum(["agent", "system", "network"]),
|
|
3279
|
+
level: z24.enum(["debug", "info", "warn", "error"]),
|
|
3280
|
+
message: z24.string(),
|
|
3281
|
+
metadata: z24.record(z24.string(), z24.unknown()).optional()
|
|
3183
3282
|
});
|
|
3184
3283
|
var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
|
|
3185
3284
|
var logsQuerySchema = listQuerySchema.extend({
|
|
3186
|
-
type:
|
|
3285
|
+
type: z24.enum(["agent", "system", "network", "all"]).default("all"),
|
|
3187
3286
|
since: timestampSchema.optional(),
|
|
3188
3287
|
until: timestampSchema.optional(),
|
|
3189
|
-
order:
|
|
3288
|
+
order: z24.enum(["asc", "desc"]).default("asc")
|
|
3190
3289
|
});
|
|
3191
|
-
var publicRunLogsContract =
|
|
3290
|
+
var publicRunLogsContract = c20.router({
|
|
3192
3291
|
getLogs: {
|
|
3193
3292
|
method: "GET",
|
|
3194
3293
|
path: "/v1/runs/:id/logs",
|
|
3195
3294
|
headers: authHeadersSchema,
|
|
3196
|
-
pathParams:
|
|
3197
|
-
id:
|
|
3295
|
+
pathParams: z24.object({
|
|
3296
|
+
id: z24.string().min(1, "Run ID is required")
|
|
3198
3297
|
}),
|
|
3199
3298
|
query: logsQuerySchema,
|
|
3200
3299
|
responses: {
|
|
@@ -3207,30 +3306,30 @@ var publicRunLogsContract = c19.router({
|
|
|
3207
3306
|
description: "Get unified logs for a run. Combines agent, system, and network logs."
|
|
3208
3307
|
}
|
|
3209
3308
|
});
|
|
3210
|
-
var metricPointSchema =
|
|
3309
|
+
var metricPointSchema = z24.object({
|
|
3211
3310
|
timestamp: timestampSchema,
|
|
3212
|
-
cpuPercent:
|
|
3213
|
-
memoryUsedMb:
|
|
3214
|
-
memoryTotalMb:
|
|
3215
|
-
diskUsedMb:
|
|
3216
|
-
diskTotalMb:
|
|
3217
|
-
});
|
|
3218
|
-
var metricsSummarySchema =
|
|
3219
|
-
avgCpuPercent:
|
|
3220
|
-
maxMemoryUsedMb:
|
|
3221
|
-
totalDurationMs:
|
|
3222
|
-
});
|
|
3223
|
-
var metricsResponseSchema2 =
|
|
3224
|
-
data:
|
|
3311
|
+
cpuPercent: z24.number(),
|
|
3312
|
+
memoryUsedMb: z24.number(),
|
|
3313
|
+
memoryTotalMb: z24.number(),
|
|
3314
|
+
diskUsedMb: z24.number(),
|
|
3315
|
+
diskTotalMb: z24.number()
|
|
3316
|
+
});
|
|
3317
|
+
var metricsSummarySchema = z24.object({
|
|
3318
|
+
avgCpuPercent: z24.number(),
|
|
3319
|
+
maxMemoryUsedMb: z24.number(),
|
|
3320
|
+
totalDurationMs: z24.number().nullable()
|
|
3321
|
+
});
|
|
3322
|
+
var metricsResponseSchema2 = z24.object({
|
|
3323
|
+
data: z24.array(metricPointSchema),
|
|
3225
3324
|
summary: metricsSummarySchema
|
|
3226
3325
|
});
|
|
3227
|
-
var publicRunMetricsContract =
|
|
3326
|
+
var publicRunMetricsContract = c20.router({
|
|
3228
3327
|
getMetrics: {
|
|
3229
3328
|
method: "GET",
|
|
3230
3329
|
path: "/v1/runs/:id/metrics",
|
|
3231
3330
|
headers: authHeadersSchema,
|
|
3232
|
-
pathParams:
|
|
3233
|
-
id:
|
|
3331
|
+
pathParams: z24.object({
|
|
3332
|
+
id: z24.string().min(1, "Run ID is required")
|
|
3234
3333
|
}),
|
|
3235
3334
|
responses: {
|
|
3236
3335
|
200: metricsResponseSchema2,
|
|
@@ -3242,7 +3341,7 @@ var publicRunMetricsContract = c19.router({
|
|
|
3242
3341
|
description: "Get CPU, memory, and disk metrics for a run"
|
|
3243
3342
|
}
|
|
3244
3343
|
});
|
|
3245
|
-
var sseEventTypeSchema =
|
|
3344
|
+
var sseEventTypeSchema = z24.enum([
|
|
3246
3345
|
"status",
|
|
3247
3346
|
// Run status change
|
|
3248
3347
|
"output",
|
|
@@ -3254,26 +3353,26 @@ var sseEventTypeSchema = z23.enum([
|
|
|
3254
3353
|
"heartbeat"
|
|
3255
3354
|
// Keep-alive
|
|
3256
3355
|
]);
|
|
3257
|
-
var sseEventSchema =
|
|
3356
|
+
var sseEventSchema = z24.object({
|
|
3258
3357
|
event: sseEventTypeSchema,
|
|
3259
|
-
data:
|
|
3260
|
-
id:
|
|
3358
|
+
data: z24.unknown(),
|
|
3359
|
+
id: z24.string().optional()
|
|
3261
3360
|
// For Last-Event-ID reconnection
|
|
3262
3361
|
});
|
|
3263
|
-
var publicRunEventsContract =
|
|
3362
|
+
var publicRunEventsContract = c20.router({
|
|
3264
3363
|
streamEvents: {
|
|
3265
3364
|
method: "GET",
|
|
3266
3365
|
path: "/v1/runs/:id/events",
|
|
3267
3366
|
headers: authHeadersSchema,
|
|
3268
|
-
pathParams:
|
|
3269
|
-
id:
|
|
3367
|
+
pathParams: z24.object({
|
|
3368
|
+
id: z24.string().min(1, "Run ID is required")
|
|
3270
3369
|
}),
|
|
3271
|
-
query:
|
|
3272
|
-
lastEventId:
|
|
3370
|
+
query: z24.object({
|
|
3371
|
+
lastEventId: z24.string().optional()
|
|
3273
3372
|
// For reconnection
|
|
3274
3373
|
}),
|
|
3275
3374
|
responses: {
|
|
3276
|
-
200:
|
|
3375
|
+
200: z24.any(),
|
|
3277
3376
|
// SSE stream - actual content is text/event-stream
|
|
3278
3377
|
401: publicApiErrorSchema,
|
|
3279
3378
|
404: publicApiErrorSchema,
|
|
@@ -3285,28 +3384,28 @@ var publicRunEventsContract = c19.router({
|
|
|
3285
3384
|
});
|
|
3286
3385
|
|
|
3287
3386
|
// ../../packages/core/src/contracts/public/artifacts.ts
|
|
3288
|
-
import { z as
|
|
3289
|
-
var
|
|
3290
|
-
var publicArtifactSchema =
|
|
3291
|
-
id:
|
|
3292
|
-
name:
|
|
3293
|
-
currentVersionId:
|
|
3294
|
-
size:
|
|
3387
|
+
import { z as z25 } from "zod";
|
|
3388
|
+
var c21 = initContract();
|
|
3389
|
+
var publicArtifactSchema = z25.object({
|
|
3390
|
+
id: z25.string(),
|
|
3391
|
+
name: z25.string(),
|
|
3392
|
+
currentVersionId: z25.string().nullable(),
|
|
3393
|
+
size: z25.number(),
|
|
3295
3394
|
// Total size in bytes
|
|
3296
|
-
fileCount:
|
|
3395
|
+
fileCount: z25.number(),
|
|
3297
3396
|
createdAt: timestampSchema,
|
|
3298
3397
|
updatedAt: timestampSchema
|
|
3299
3398
|
});
|
|
3300
|
-
var artifactVersionSchema =
|
|
3301
|
-
id:
|
|
3399
|
+
var artifactVersionSchema = z25.object({
|
|
3400
|
+
id: z25.string(),
|
|
3302
3401
|
// SHA-256 content hash
|
|
3303
|
-
artifactId:
|
|
3304
|
-
size:
|
|
3402
|
+
artifactId: z25.string(),
|
|
3403
|
+
size: z25.number(),
|
|
3305
3404
|
// Size in bytes
|
|
3306
|
-
fileCount:
|
|
3307
|
-
message:
|
|
3405
|
+
fileCount: z25.number(),
|
|
3406
|
+
message: z25.string().nullable(),
|
|
3308
3407
|
// Optional commit message
|
|
3309
|
-
createdBy:
|
|
3408
|
+
createdBy: z25.string(),
|
|
3310
3409
|
createdAt: timestampSchema
|
|
3311
3410
|
});
|
|
3312
3411
|
var publicArtifactDetailSchema = publicArtifactSchema.extend({
|
|
@@ -3316,7 +3415,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
3316
3415
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
3317
3416
|
artifactVersionSchema
|
|
3318
3417
|
);
|
|
3319
|
-
var publicArtifactsListContract =
|
|
3418
|
+
var publicArtifactsListContract = c21.router({
|
|
3320
3419
|
list: {
|
|
3321
3420
|
method: "GET",
|
|
3322
3421
|
path: "/v1/artifacts",
|
|
@@ -3331,13 +3430,13 @@ var publicArtifactsListContract = c20.router({
|
|
|
3331
3430
|
description: "List all artifacts in the current scope with pagination"
|
|
3332
3431
|
}
|
|
3333
3432
|
});
|
|
3334
|
-
var publicArtifactByIdContract =
|
|
3433
|
+
var publicArtifactByIdContract = c21.router({
|
|
3335
3434
|
get: {
|
|
3336
3435
|
method: "GET",
|
|
3337
3436
|
path: "/v1/artifacts/:id",
|
|
3338
3437
|
headers: authHeadersSchema,
|
|
3339
|
-
pathParams:
|
|
3340
|
-
id:
|
|
3438
|
+
pathParams: z25.object({
|
|
3439
|
+
id: z25.string().min(1, "Artifact ID is required")
|
|
3341
3440
|
}),
|
|
3342
3441
|
responses: {
|
|
3343
3442
|
200: publicArtifactDetailSchema,
|
|
@@ -3349,13 +3448,13 @@ var publicArtifactByIdContract = c20.router({
|
|
|
3349
3448
|
description: "Get artifact details by ID"
|
|
3350
3449
|
}
|
|
3351
3450
|
});
|
|
3352
|
-
var publicArtifactVersionsContract =
|
|
3451
|
+
var publicArtifactVersionsContract = c21.router({
|
|
3353
3452
|
list: {
|
|
3354
3453
|
method: "GET",
|
|
3355
3454
|
path: "/v1/artifacts/:id/versions",
|
|
3356
3455
|
headers: authHeadersSchema,
|
|
3357
|
-
pathParams:
|
|
3358
|
-
id:
|
|
3456
|
+
pathParams: z25.object({
|
|
3457
|
+
id: z25.string().min(1, "Artifact ID is required")
|
|
3359
3458
|
}),
|
|
3360
3459
|
query: listQuerySchema,
|
|
3361
3460
|
responses: {
|
|
@@ -3368,20 +3467,20 @@ var publicArtifactVersionsContract = c20.router({
|
|
|
3368
3467
|
description: "List all versions of an artifact with pagination"
|
|
3369
3468
|
}
|
|
3370
3469
|
});
|
|
3371
|
-
var publicArtifactDownloadContract =
|
|
3470
|
+
var publicArtifactDownloadContract = c21.router({
|
|
3372
3471
|
download: {
|
|
3373
3472
|
method: "GET",
|
|
3374
3473
|
path: "/v1/artifacts/:id/download",
|
|
3375
3474
|
headers: authHeadersSchema,
|
|
3376
|
-
pathParams:
|
|
3377
|
-
id:
|
|
3475
|
+
pathParams: z25.object({
|
|
3476
|
+
id: z25.string().min(1, "Artifact ID is required")
|
|
3378
3477
|
}),
|
|
3379
|
-
query:
|
|
3380
|
-
versionId:
|
|
3478
|
+
query: z25.object({
|
|
3479
|
+
versionId: z25.string().optional()
|
|
3381
3480
|
// Defaults to current version
|
|
3382
3481
|
}),
|
|
3383
3482
|
responses: {
|
|
3384
|
-
302:
|
|
3483
|
+
302: z25.undefined(),
|
|
3385
3484
|
// Redirect to presigned URL
|
|
3386
3485
|
401: publicApiErrorSchema,
|
|
3387
3486
|
404: publicApiErrorSchema,
|
|
@@ -3393,28 +3492,28 @@ var publicArtifactDownloadContract = c20.router({
|
|
|
3393
3492
|
});
|
|
3394
3493
|
|
|
3395
3494
|
// ../../packages/core/src/contracts/public/volumes.ts
|
|
3396
|
-
import { z as
|
|
3397
|
-
var
|
|
3398
|
-
var publicVolumeSchema =
|
|
3399
|
-
id:
|
|
3400
|
-
name:
|
|
3401
|
-
currentVersionId:
|
|
3402
|
-
size:
|
|
3495
|
+
import { z as z26 } from "zod";
|
|
3496
|
+
var c22 = initContract();
|
|
3497
|
+
var publicVolumeSchema = z26.object({
|
|
3498
|
+
id: z26.string(),
|
|
3499
|
+
name: z26.string(),
|
|
3500
|
+
currentVersionId: z26.string().nullable(),
|
|
3501
|
+
size: z26.number(),
|
|
3403
3502
|
// Total size in bytes
|
|
3404
|
-
fileCount:
|
|
3503
|
+
fileCount: z26.number(),
|
|
3405
3504
|
createdAt: timestampSchema,
|
|
3406
3505
|
updatedAt: timestampSchema
|
|
3407
3506
|
});
|
|
3408
|
-
var volumeVersionSchema =
|
|
3409
|
-
id:
|
|
3507
|
+
var volumeVersionSchema = z26.object({
|
|
3508
|
+
id: z26.string(),
|
|
3410
3509
|
// SHA-256 content hash
|
|
3411
|
-
volumeId:
|
|
3412
|
-
size:
|
|
3510
|
+
volumeId: z26.string(),
|
|
3511
|
+
size: z26.number(),
|
|
3413
3512
|
// Size in bytes
|
|
3414
|
-
fileCount:
|
|
3415
|
-
message:
|
|
3513
|
+
fileCount: z26.number(),
|
|
3514
|
+
message: z26.string().nullable(),
|
|
3416
3515
|
// Optional commit message
|
|
3417
|
-
createdBy:
|
|
3516
|
+
createdBy: z26.string(),
|
|
3418
3517
|
createdAt: timestampSchema
|
|
3419
3518
|
});
|
|
3420
3519
|
var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
@@ -3422,7 +3521,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
3422
3521
|
});
|
|
3423
3522
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
3424
3523
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
3425
|
-
var publicVolumesListContract =
|
|
3524
|
+
var publicVolumesListContract = c22.router({
|
|
3426
3525
|
list: {
|
|
3427
3526
|
method: "GET",
|
|
3428
3527
|
path: "/v1/volumes",
|
|
@@ -3437,13 +3536,13 @@ var publicVolumesListContract = c21.router({
|
|
|
3437
3536
|
description: "List all volumes in the current scope with pagination"
|
|
3438
3537
|
}
|
|
3439
3538
|
});
|
|
3440
|
-
var publicVolumeByIdContract =
|
|
3539
|
+
var publicVolumeByIdContract = c22.router({
|
|
3441
3540
|
get: {
|
|
3442
3541
|
method: "GET",
|
|
3443
3542
|
path: "/v1/volumes/:id",
|
|
3444
3543
|
headers: authHeadersSchema,
|
|
3445
|
-
pathParams:
|
|
3446
|
-
id:
|
|
3544
|
+
pathParams: z26.object({
|
|
3545
|
+
id: z26.string().min(1, "Volume ID is required")
|
|
3447
3546
|
}),
|
|
3448
3547
|
responses: {
|
|
3449
3548
|
200: publicVolumeDetailSchema,
|
|
@@ -3455,13 +3554,13 @@ var publicVolumeByIdContract = c21.router({
|
|
|
3455
3554
|
description: "Get volume details by ID"
|
|
3456
3555
|
}
|
|
3457
3556
|
});
|
|
3458
|
-
var publicVolumeVersionsContract =
|
|
3557
|
+
var publicVolumeVersionsContract = c22.router({
|
|
3459
3558
|
list: {
|
|
3460
3559
|
method: "GET",
|
|
3461
3560
|
path: "/v1/volumes/:id/versions",
|
|
3462
3561
|
headers: authHeadersSchema,
|
|
3463
|
-
pathParams:
|
|
3464
|
-
id:
|
|
3562
|
+
pathParams: z26.object({
|
|
3563
|
+
id: z26.string().min(1, "Volume ID is required")
|
|
3465
3564
|
}),
|
|
3466
3565
|
query: listQuerySchema,
|
|
3467
3566
|
responses: {
|
|
@@ -3474,20 +3573,20 @@ var publicVolumeVersionsContract = c21.router({
|
|
|
3474
3573
|
description: "List all versions of a volume with pagination"
|
|
3475
3574
|
}
|
|
3476
3575
|
});
|
|
3477
|
-
var publicVolumeDownloadContract =
|
|
3576
|
+
var publicVolumeDownloadContract = c22.router({
|
|
3478
3577
|
download: {
|
|
3479
3578
|
method: "GET",
|
|
3480
3579
|
path: "/v1/volumes/:id/download",
|
|
3481
3580
|
headers: authHeadersSchema,
|
|
3482
|
-
pathParams:
|
|
3483
|
-
id:
|
|
3581
|
+
pathParams: z26.object({
|
|
3582
|
+
id: z26.string().min(1, "Volume ID is required")
|
|
3484
3583
|
}),
|
|
3485
|
-
query:
|
|
3486
|
-
versionId:
|
|
3584
|
+
query: z26.object({
|
|
3585
|
+
versionId: z26.string().optional()
|
|
3487
3586
|
// Defaults to current version
|
|
3488
3587
|
}),
|
|
3489
3588
|
responses: {
|
|
3490
|
-
302:
|
|
3589
|
+
302: z26.undefined(),
|
|
3491
3590
|
// Redirect to presigned URL
|
|
3492
3591
|
401: publicApiErrorSchema,
|
|
3493
3592
|
404: publicApiErrorSchema,
|
|
@@ -4005,11 +4104,54 @@ async function deleteSecret(name) {
|
|
|
4005
4104
|
handleError(result, `Secret "${name}" not found`);
|
|
4006
4105
|
}
|
|
4007
4106
|
|
|
4008
|
-
// src/lib/api/domains/
|
|
4107
|
+
// src/lib/api/domains/variables.ts
|
|
4009
4108
|
import { initClient as initClient8 } from "@ts-rest/core";
|
|
4109
|
+
async function listVariables() {
|
|
4110
|
+
const config = await getClientConfig();
|
|
4111
|
+
const client = initClient8(variablesMainContract, config);
|
|
4112
|
+
const result = await client.list({ headers: {} });
|
|
4113
|
+
if (result.status === 200) {
|
|
4114
|
+
return result.body;
|
|
4115
|
+
}
|
|
4116
|
+
handleError(result, "Failed to list variables");
|
|
4117
|
+
}
|
|
4118
|
+
async function getVariable(name) {
|
|
4119
|
+
const config = await getClientConfig();
|
|
4120
|
+
const client = initClient8(variablesByNameContract, config);
|
|
4121
|
+
const result = await client.get({
|
|
4122
|
+
params: { name }
|
|
4123
|
+
});
|
|
4124
|
+
if (result.status === 200) {
|
|
4125
|
+
return result.body;
|
|
4126
|
+
}
|
|
4127
|
+
handleError(result, `Variable "${name}" not found`);
|
|
4128
|
+
}
|
|
4129
|
+
async function setVariable(body) {
|
|
4130
|
+
const config = await getClientConfig();
|
|
4131
|
+
const client = initClient8(variablesMainContract, config);
|
|
4132
|
+
const result = await client.set({ body });
|
|
4133
|
+
if (result.status === 200 || result.status === 201) {
|
|
4134
|
+
return result.body;
|
|
4135
|
+
}
|
|
4136
|
+
handleError(result, "Failed to set variable");
|
|
4137
|
+
}
|
|
4138
|
+
async function deleteVariable(name) {
|
|
4139
|
+
const config = await getClientConfig();
|
|
4140
|
+
const client = initClient8(variablesByNameContract, config);
|
|
4141
|
+
const result = await client.delete({
|
|
4142
|
+
params: { name }
|
|
4143
|
+
});
|
|
4144
|
+
if (result.status === 204) {
|
|
4145
|
+
return;
|
|
4146
|
+
}
|
|
4147
|
+
handleError(result, `Variable "${name}" not found`);
|
|
4148
|
+
}
|
|
4149
|
+
|
|
4150
|
+
// src/lib/api/domains/model-providers.ts
|
|
4151
|
+
import { initClient as initClient9 } from "@ts-rest/core";
|
|
4010
4152
|
async function listModelProviders() {
|
|
4011
4153
|
const config = await getClientConfig();
|
|
4012
|
-
const client =
|
|
4154
|
+
const client = initClient9(modelProvidersMainContract, config);
|
|
4013
4155
|
const result = await client.list({ headers: {} });
|
|
4014
4156
|
if (result.status === 200) {
|
|
4015
4157
|
return result.body;
|
|
@@ -4018,7 +4160,7 @@ async function listModelProviders() {
|
|
|
4018
4160
|
}
|
|
4019
4161
|
async function upsertModelProvider(body) {
|
|
4020
4162
|
const config = await getClientConfig();
|
|
4021
|
-
const client =
|
|
4163
|
+
const client = initClient9(modelProvidersMainContract, config);
|
|
4022
4164
|
const result = await client.upsert({ body });
|
|
4023
4165
|
if (result.status === 200 || result.status === 201) {
|
|
4024
4166
|
return result.body;
|
|
@@ -4027,7 +4169,7 @@ async function upsertModelProvider(body) {
|
|
|
4027
4169
|
}
|
|
4028
4170
|
async function checkModelProviderCredential(type) {
|
|
4029
4171
|
const config = await getClientConfig();
|
|
4030
|
-
const client =
|
|
4172
|
+
const client = initClient9(modelProvidersCheckContract, config);
|
|
4031
4173
|
const result = await client.check({
|
|
4032
4174
|
params: { type }
|
|
4033
4175
|
});
|
|
@@ -4038,7 +4180,7 @@ async function checkModelProviderCredential(type) {
|
|
|
4038
4180
|
}
|
|
4039
4181
|
async function deleteModelProvider(type) {
|
|
4040
4182
|
const config = await getClientConfig();
|
|
4041
|
-
const client =
|
|
4183
|
+
const client = initClient9(modelProvidersByTypeContract, config);
|
|
4042
4184
|
const result = await client.delete({
|
|
4043
4185
|
params: { type }
|
|
4044
4186
|
});
|
|
@@ -4049,7 +4191,7 @@ async function deleteModelProvider(type) {
|
|
|
4049
4191
|
}
|
|
4050
4192
|
async function convertModelProviderCredential(type) {
|
|
4051
4193
|
const config = await getClientConfig();
|
|
4052
|
-
const client =
|
|
4194
|
+
const client = initClient9(modelProvidersConvertContract, config);
|
|
4053
4195
|
const result = await client.convert({
|
|
4054
4196
|
params: { type }
|
|
4055
4197
|
});
|
|
@@ -4060,7 +4202,7 @@ async function convertModelProviderCredential(type) {
|
|
|
4060
4202
|
}
|
|
4061
4203
|
async function setModelProviderDefault(type) {
|
|
4062
4204
|
const config = await getClientConfig();
|
|
4063
|
-
const client =
|
|
4205
|
+
const client = initClient9(modelProvidersSetDefaultContract, config);
|
|
4064
4206
|
const result = await client.setDefault({
|
|
4065
4207
|
params: { type }
|
|
4066
4208
|
});
|
|
@@ -4071,7 +4213,7 @@ async function setModelProviderDefault(type) {
|
|
|
4071
4213
|
}
|
|
4072
4214
|
async function updateModelProviderModel(type, selectedModel) {
|
|
4073
4215
|
const config = await getClientConfig();
|
|
4074
|
-
const client =
|
|
4216
|
+
const client = initClient9(modelProvidersUpdateModelContract, config);
|
|
4075
4217
|
const result = await client.updateModel({
|
|
4076
4218
|
params: { type },
|
|
4077
4219
|
body: { selectedModel }
|
|
@@ -4102,8 +4244,8 @@ async function getUsage(options) {
|
|
|
4102
4244
|
}
|
|
4103
4245
|
|
|
4104
4246
|
// src/lib/domain/yaml-validator.ts
|
|
4105
|
-
import { z as
|
|
4106
|
-
var cliAgentNameSchema =
|
|
4247
|
+
import { z as z27 } from "zod";
|
|
4248
|
+
var cliAgentNameSchema = z27.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
4107
4249
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
4108
4250
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
4109
4251
|
);
|
|
@@ -4118,7 +4260,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
4118
4260
|
const skillUrl = agent.skills[i];
|
|
4119
4261
|
if (skillUrl && !validateGitHubTreeUrl(skillUrl)) {
|
|
4120
4262
|
ctx.addIssue({
|
|
4121
|
-
code:
|
|
4263
|
+
code: z27.ZodIssueCode.custom,
|
|
4122
4264
|
message: `Invalid skill URL: ${skillUrl}. Expected format: https://github.com/{owner}/{repo}/tree/{branch}/{path}`,
|
|
4123
4265
|
path: ["skills", i]
|
|
4124
4266
|
});
|
|
@@ -4127,15 +4269,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
4127
4269
|
}
|
|
4128
4270
|
}
|
|
4129
4271
|
);
|
|
4130
|
-
var cliComposeSchema =
|
|
4131
|
-
version:
|
|
4132
|
-
agents:
|
|
4133
|
-
volumes:
|
|
4272
|
+
var cliComposeSchema = z27.object({
|
|
4273
|
+
version: z27.string().min(1, "Missing config.version"),
|
|
4274
|
+
agents: z27.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
4275
|
+
volumes: z27.record(z27.string(), volumeConfigSchema).optional()
|
|
4134
4276
|
}).superRefine((config, ctx) => {
|
|
4135
4277
|
const agentKeys = Object.keys(config.agents);
|
|
4136
4278
|
if (agentKeys.length === 0) {
|
|
4137
4279
|
ctx.addIssue({
|
|
4138
|
-
code:
|
|
4280
|
+
code: z27.ZodIssueCode.custom,
|
|
4139
4281
|
message: "agents must have at least one agent defined",
|
|
4140
4282
|
path: ["agents"]
|
|
4141
4283
|
});
|
|
@@ -4143,7 +4285,7 @@ var cliComposeSchema = z26.object({
|
|
|
4143
4285
|
}
|
|
4144
4286
|
if (agentKeys.length > 1) {
|
|
4145
4287
|
ctx.addIssue({
|
|
4146
|
-
code:
|
|
4288
|
+
code: z27.ZodIssueCode.custom,
|
|
4147
4289
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
4148
4290
|
path: ["agents"]
|
|
4149
4291
|
});
|
|
@@ -4155,7 +4297,7 @@ var cliComposeSchema = z26.object({
|
|
|
4155
4297
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
4156
4298
|
if (!config.volumes) {
|
|
4157
4299
|
ctx.addIssue({
|
|
4158
|
-
code:
|
|
4300
|
+
code: z27.ZodIssueCode.custom,
|
|
4159
4301
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
4160
4302
|
path: ["volumes"]
|
|
4161
4303
|
});
|
|
@@ -4165,7 +4307,7 @@ var cliComposeSchema = z26.object({
|
|
|
4165
4307
|
const parts = volDeclaration.split(":");
|
|
4166
4308
|
if (parts.length !== 2) {
|
|
4167
4309
|
ctx.addIssue({
|
|
4168
|
-
code:
|
|
4310
|
+
code: z27.ZodIssueCode.custom,
|
|
4169
4311
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
4170
4312
|
path: ["agents", agentName, "volumes"]
|
|
4171
4313
|
});
|
|
@@ -4174,7 +4316,7 @@ var cliComposeSchema = z26.object({
|
|
|
4174
4316
|
const volumeKey = parts[0].trim();
|
|
4175
4317
|
if (!config.volumes[volumeKey]) {
|
|
4176
4318
|
ctx.addIssue({
|
|
4177
|
-
code:
|
|
4319
|
+
code: z27.ZodIssueCode.custom,
|
|
4178
4320
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
4179
4321
|
path: ["volumes", volumeKey]
|
|
4180
4322
|
});
|
|
@@ -5224,7 +5366,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
5224
5366
|
)
|
|
5225
5367
|
);
|
|
5226
5368
|
if (options.autoUpdate !== false) {
|
|
5227
|
-
await silentUpgradeAfterCommand("9.
|
|
5369
|
+
await silentUpgradeAfterCommand("9.18.0");
|
|
5228
5370
|
}
|
|
5229
5371
|
} catch (error) {
|
|
5230
5372
|
if (error instanceof Error) {
|
|
@@ -5979,9 +6121,9 @@ var CodexEventParser = class {
|
|
|
5979
6121
|
}
|
|
5980
6122
|
}
|
|
5981
6123
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
5982
|
-
const changes = item.changes.map((
|
|
5983
|
-
const action =
|
|
5984
|
-
return `${action}: ${
|
|
6124
|
+
const changes = item.changes.map((c23) => {
|
|
6125
|
+
const action = c23.kind === "add" ? "Created" : c23.kind === "modify" ? "Modified" : "Deleted";
|
|
6126
|
+
return `${action}: ${c23.path}`;
|
|
5985
6127
|
}).join("\n");
|
|
5986
6128
|
return {
|
|
5987
6129
|
type: "text",
|
|
@@ -6135,9 +6277,9 @@ var CodexEventRenderer = class {
|
|
|
6135
6277
|
return;
|
|
6136
6278
|
}
|
|
6137
6279
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
6138
|
-
const summary = item.changes.map((
|
|
6139
|
-
const icon =
|
|
6140
|
-
return `${icon}${
|
|
6280
|
+
const summary = item.changes.map((c23) => {
|
|
6281
|
+
const icon = c23.kind === "add" ? "+" : c23.kind === "delete" ? "-" : "~";
|
|
6282
|
+
return `${icon}${c23.path}`;
|
|
6141
6283
|
}).join(", ");
|
|
6142
6284
|
console.log(chalk7.green("[files]") + ` ${summary}`);
|
|
6143
6285
|
return;
|
|
@@ -6158,7 +6300,7 @@ var CodexEventRenderer = class {
|
|
|
6158
6300
|
};
|
|
6159
6301
|
|
|
6160
6302
|
// src/lib/api/api-client.ts
|
|
6161
|
-
import { initClient as
|
|
6303
|
+
import { initClient as initClient10 } from "@ts-rest/core";
|
|
6162
6304
|
var ApiClient = class {
|
|
6163
6305
|
async getHeaders() {
|
|
6164
6306
|
const token = await getToken();
|
|
@@ -6184,7 +6326,7 @@ var ApiClient = class {
|
|
|
6184
6326
|
async getComposeByName(name, scope) {
|
|
6185
6327
|
const baseUrl = await this.getBaseUrl();
|
|
6186
6328
|
const headers = await this.getHeaders();
|
|
6187
|
-
const client =
|
|
6329
|
+
const client = initClient10(composesMainContract, {
|
|
6188
6330
|
baseUrl,
|
|
6189
6331
|
baseHeaders: headers,
|
|
6190
6332
|
jsonQuery: true
|
|
@@ -6205,7 +6347,7 @@ var ApiClient = class {
|
|
|
6205
6347
|
async getComposeById(id) {
|
|
6206
6348
|
const baseUrl = await this.getBaseUrl();
|
|
6207
6349
|
const headers = await this.getHeaders();
|
|
6208
|
-
const client =
|
|
6350
|
+
const client = initClient10(composesByIdContract, {
|
|
6209
6351
|
baseUrl,
|
|
6210
6352
|
baseHeaders: headers,
|
|
6211
6353
|
jsonQuery: true
|
|
@@ -6227,7 +6369,7 @@ var ApiClient = class {
|
|
|
6227
6369
|
async getComposeVersion(composeId, version) {
|
|
6228
6370
|
const baseUrl = await this.getBaseUrl();
|
|
6229
6371
|
const headers = await this.getHeaders();
|
|
6230
|
-
const client =
|
|
6372
|
+
const client = initClient10(composesVersionsContract, {
|
|
6231
6373
|
baseUrl,
|
|
6232
6374
|
baseHeaders: headers,
|
|
6233
6375
|
jsonQuery: true
|
|
@@ -6248,7 +6390,7 @@ var ApiClient = class {
|
|
|
6248
6390
|
async createOrUpdateCompose(body) {
|
|
6249
6391
|
const baseUrl = await this.getBaseUrl();
|
|
6250
6392
|
const headers = await this.getHeaders();
|
|
6251
|
-
const client =
|
|
6393
|
+
const client = initClient10(composesMainContract, {
|
|
6252
6394
|
baseUrl,
|
|
6253
6395
|
baseHeaders: headers,
|
|
6254
6396
|
jsonQuery: true
|
|
@@ -6271,7 +6413,7 @@ var ApiClient = class {
|
|
|
6271
6413
|
async createRun(body) {
|
|
6272
6414
|
const baseUrl = await this.getBaseUrl();
|
|
6273
6415
|
const headers = await this.getHeaders();
|
|
6274
|
-
const client =
|
|
6416
|
+
const client = initClient10(runsMainContract, {
|
|
6275
6417
|
baseUrl,
|
|
6276
6418
|
baseHeaders: headers,
|
|
6277
6419
|
jsonQuery: true
|
|
@@ -6287,7 +6429,7 @@ var ApiClient = class {
|
|
|
6287
6429
|
async getEvents(runId, options) {
|
|
6288
6430
|
const baseUrl = await this.getBaseUrl();
|
|
6289
6431
|
const headers = await this.getHeaders();
|
|
6290
|
-
const client =
|
|
6432
|
+
const client = initClient10(runEventsContract, {
|
|
6291
6433
|
baseUrl,
|
|
6292
6434
|
baseHeaders: headers,
|
|
6293
6435
|
jsonQuery: true
|
|
@@ -6309,7 +6451,7 @@ var ApiClient = class {
|
|
|
6309
6451
|
async getSystemLog(runId, options) {
|
|
6310
6452
|
const baseUrl = await this.getBaseUrl();
|
|
6311
6453
|
const headers = await this.getHeaders();
|
|
6312
|
-
const client =
|
|
6454
|
+
const client = initClient10(runSystemLogContract, {
|
|
6313
6455
|
baseUrl,
|
|
6314
6456
|
baseHeaders: headers,
|
|
6315
6457
|
jsonQuery: true
|
|
@@ -6332,7 +6474,7 @@ var ApiClient = class {
|
|
|
6332
6474
|
async getMetrics(runId, options) {
|
|
6333
6475
|
const baseUrl = await this.getBaseUrl();
|
|
6334
6476
|
const headers = await this.getHeaders();
|
|
6335
|
-
const client =
|
|
6477
|
+
const client = initClient10(runMetricsContract, {
|
|
6336
6478
|
baseUrl,
|
|
6337
6479
|
baseHeaders: headers,
|
|
6338
6480
|
jsonQuery: true
|
|
@@ -6355,7 +6497,7 @@ var ApiClient = class {
|
|
|
6355
6497
|
async getAgentEvents(runId, options) {
|
|
6356
6498
|
const baseUrl = await this.getBaseUrl();
|
|
6357
6499
|
const headers = await this.getHeaders();
|
|
6358
|
-
const client =
|
|
6500
|
+
const client = initClient10(runAgentEventsContract, {
|
|
6359
6501
|
baseUrl,
|
|
6360
6502
|
baseHeaders: headers,
|
|
6361
6503
|
jsonQuery: true
|
|
@@ -6378,7 +6520,7 @@ var ApiClient = class {
|
|
|
6378
6520
|
async getNetworkLogs(runId, options) {
|
|
6379
6521
|
const baseUrl = await this.getBaseUrl();
|
|
6380
6522
|
const headers = await this.getHeaders();
|
|
6381
|
-
const client =
|
|
6523
|
+
const client = initClient10(runNetworkLogsContract, {
|
|
6382
6524
|
baseUrl,
|
|
6383
6525
|
baseHeaders: headers,
|
|
6384
6526
|
jsonQuery: true
|
|
@@ -6404,7 +6546,7 @@ var ApiClient = class {
|
|
|
6404
6546
|
async getScope() {
|
|
6405
6547
|
const baseUrl = await this.getBaseUrl();
|
|
6406
6548
|
const headers = await this.getHeaders();
|
|
6407
|
-
const client =
|
|
6549
|
+
const client = initClient10(scopeContract, {
|
|
6408
6550
|
baseUrl,
|
|
6409
6551
|
baseHeaders: headers,
|
|
6410
6552
|
jsonQuery: true
|
|
@@ -6423,7 +6565,7 @@ var ApiClient = class {
|
|
|
6423
6565
|
async createScope(body) {
|
|
6424
6566
|
const baseUrl = await this.getBaseUrl();
|
|
6425
6567
|
const headers = await this.getHeaders();
|
|
6426
|
-
const client =
|
|
6568
|
+
const client = initClient10(scopeContract, {
|
|
6427
6569
|
baseUrl,
|
|
6428
6570
|
baseHeaders: headers,
|
|
6429
6571
|
jsonQuery: true
|
|
@@ -6442,7 +6584,7 @@ var ApiClient = class {
|
|
|
6442
6584
|
async updateScope(body) {
|
|
6443
6585
|
const baseUrl = await this.getBaseUrl();
|
|
6444
6586
|
const headers = await this.getHeaders();
|
|
6445
|
-
const client =
|
|
6587
|
+
const client = initClient10(scopeContract, {
|
|
6446
6588
|
baseUrl,
|
|
6447
6589
|
baseHeaders: headers,
|
|
6448
6590
|
jsonQuery: true
|
|
@@ -6462,7 +6604,7 @@ var ApiClient = class {
|
|
|
6462
6604
|
async getSession(sessionId) {
|
|
6463
6605
|
const baseUrl = await this.getBaseUrl();
|
|
6464
6606
|
const headers = await this.getHeaders();
|
|
6465
|
-
const client =
|
|
6607
|
+
const client = initClient10(sessionsByIdContract, {
|
|
6466
6608
|
baseUrl,
|
|
6467
6609
|
baseHeaders: headers,
|
|
6468
6610
|
jsonQuery: true
|
|
@@ -6484,7 +6626,7 @@ var ApiClient = class {
|
|
|
6484
6626
|
async getCheckpoint(checkpointId) {
|
|
6485
6627
|
const baseUrl = await this.getBaseUrl();
|
|
6486
6628
|
const headers = await this.getHeaders();
|
|
6487
|
-
const client =
|
|
6629
|
+
const client = initClient10(checkpointsByIdContract, {
|
|
6488
6630
|
baseUrl,
|
|
6489
6631
|
baseHeaders: headers,
|
|
6490
6632
|
jsonQuery: true
|
|
@@ -6505,7 +6647,7 @@ var ApiClient = class {
|
|
|
6505
6647
|
async prepareStorage(body) {
|
|
6506
6648
|
const baseUrl = await this.getBaseUrl();
|
|
6507
6649
|
const headers = await this.getHeaders();
|
|
6508
|
-
const client =
|
|
6650
|
+
const client = initClient10(storagesPrepareContract, {
|
|
6509
6651
|
baseUrl,
|
|
6510
6652
|
baseHeaders: headers,
|
|
6511
6653
|
jsonQuery: true
|
|
@@ -6524,7 +6666,7 @@ var ApiClient = class {
|
|
|
6524
6666
|
async commitStorage(body) {
|
|
6525
6667
|
const baseUrl = await this.getBaseUrl();
|
|
6526
6668
|
const headers = await this.getHeaders();
|
|
6527
|
-
const client =
|
|
6669
|
+
const client = initClient10(storagesCommitContract, {
|
|
6528
6670
|
baseUrl,
|
|
6529
6671
|
baseHeaders: headers,
|
|
6530
6672
|
jsonQuery: true
|
|
@@ -6543,7 +6685,7 @@ var ApiClient = class {
|
|
|
6543
6685
|
async getStorageDownload(query) {
|
|
6544
6686
|
const baseUrl = await this.getBaseUrl();
|
|
6545
6687
|
const headers = await this.getHeaders();
|
|
6546
|
-
const client =
|
|
6688
|
+
const client = initClient10(storagesDownloadContract, {
|
|
6547
6689
|
baseUrl,
|
|
6548
6690
|
baseHeaders: headers,
|
|
6549
6691
|
jsonQuery: true
|
|
@@ -6568,7 +6710,7 @@ var ApiClient = class {
|
|
|
6568
6710
|
async listStorages(query) {
|
|
6569
6711
|
const baseUrl = await this.getBaseUrl();
|
|
6570
6712
|
const headers = await this.getHeaders();
|
|
6571
|
-
const client =
|
|
6713
|
+
const client = initClient10(storagesListContract, {
|
|
6572
6714
|
baseUrl,
|
|
6573
6715
|
baseHeaders: headers,
|
|
6574
6716
|
jsonQuery: true
|
|
@@ -6587,7 +6729,7 @@ var ApiClient = class {
|
|
|
6587
6729
|
async deploySchedule(body) {
|
|
6588
6730
|
const baseUrl = await this.getBaseUrl();
|
|
6589
6731
|
const headers = await this.getHeaders();
|
|
6590
|
-
const client =
|
|
6732
|
+
const client = initClient10(schedulesMainContract, {
|
|
6591
6733
|
baseUrl,
|
|
6592
6734
|
baseHeaders: headers,
|
|
6593
6735
|
jsonQuery: true
|
|
@@ -6606,7 +6748,7 @@ var ApiClient = class {
|
|
|
6606
6748
|
async listSchedules() {
|
|
6607
6749
|
const baseUrl = await this.getBaseUrl();
|
|
6608
6750
|
const headers = await this.getHeaders();
|
|
6609
|
-
const client =
|
|
6751
|
+
const client = initClient10(schedulesMainContract, {
|
|
6610
6752
|
baseUrl,
|
|
6611
6753
|
baseHeaders: headers,
|
|
6612
6754
|
jsonQuery: true
|
|
@@ -6625,7 +6767,7 @@ var ApiClient = class {
|
|
|
6625
6767
|
async getScheduleByName(params) {
|
|
6626
6768
|
const baseUrl = await this.getBaseUrl();
|
|
6627
6769
|
const headers = await this.getHeaders();
|
|
6628
|
-
const client =
|
|
6770
|
+
const client = initClient10(schedulesByNameContract, {
|
|
6629
6771
|
baseUrl,
|
|
6630
6772
|
baseHeaders: headers,
|
|
6631
6773
|
jsonQuery: true
|
|
@@ -6647,7 +6789,7 @@ var ApiClient = class {
|
|
|
6647
6789
|
async deleteSchedule(params) {
|
|
6648
6790
|
const baseUrl = await this.getBaseUrl();
|
|
6649
6791
|
const headers = await this.getHeaders();
|
|
6650
|
-
const client =
|
|
6792
|
+
const client = initClient10(schedulesByNameContract, {
|
|
6651
6793
|
baseUrl,
|
|
6652
6794
|
baseHeaders: headers,
|
|
6653
6795
|
jsonQuery: true
|
|
@@ -6669,7 +6811,7 @@ var ApiClient = class {
|
|
|
6669
6811
|
async enableSchedule(params) {
|
|
6670
6812
|
const baseUrl = await this.getBaseUrl();
|
|
6671
6813
|
const headers = await this.getHeaders();
|
|
6672
|
-
const client =
|
|
6814
|
+
const client = initClient10(schedulesEnableContract, {
|
|
6673
6815
|
baseUrl,
|
|
6674
6816
|
baseHeaders: headers,
|
|
6675
6817
|
jsonQuery: true
|
|
@@ -6691,7 +6833,7 @@ var ApiClient = class {
|
|
|
6691
6833
|
async disableSchedule(params) {
|
|
6692
6834
|
const baseUrl = await this.getBaseUrl();
|
|
6693
6835
|
const headers = await this.getHeaders();
|
|
6694
|
-
const client =
|
|
6836
|
+
const client = initClient10(schedulesEnableContract, {
|
|
6695
6837
|
baseUrl,
|
|
6696
6838
|
baseHeaders: headers,
|
|
6697
6839
|
jsonQuery: true
|
|
@@ -6713,7 +6855,7 @@ var ApiClient = class {
|
|
|
6713
6855
|
async listScheduleRuns(params) {
|
|
6714
6856
|
const baseUrl = await this.getBaseUrl();
|
|
6715
6857
|
const headers = await this.getHeaders();
|
|
6716
|
-
const client =
|
|
6858
|
+
const client = initClient10(scheduleRunsContract, {
|
|
6717
6859
|
baseUrl,
|
|
6718
6860
|
baseHeaders: headers,
|
|
6719
6861
|
jsonQuery: true
|
|
@@ -6738,7 +6880,7 @@ var ApiClient = class {
|
|
|
6738
6880
|
async listPublicAgents(query) {
|
|
6739
6881
|
const baseUrl = await this.getBaseUrl();
|
|
6740
6882
|
const headers = await this.getHeaders();
|
|
6741
|
-
const client =
|
|
6883
|
+
const client = initClient10(publicAgentsListContract, {
|
|
6742
6884
|
baseUrl,
|
|
6743
6885
|
baseHeaders: headers,
|
|
6744
6886
|
jsonQuery: true
|
|
@@ -6757,7 +6899,7 @@ var ApiClient = class {
|
|
|
6757
6899
|
async listPublicArtifacts(query) {
|
|
6758
6900
|
const baseUrl = await this.getBaseUrl();
|
|
6759
6901
|
const headers = await this.getHeaders();
|
|
6760
|
-
const client =
|
|
6902
|
+
const client = initClient10(publicArtifactsListContract, {
|
|
6761
6903
|
baseUrl,
|
|
6762
6904
|
baseHeaders: headers,
|
|
6763
6905
|
jsonQuery: true
|
|
@@ -6776,7 +6918,7 @@ var ApiClient = class {
|
|
|
6776
6918
|
async getPublicArtifact(id) {
|
|
6777
6919
|
const baseUrl = await this.getBaseUrl();
|
|
6778
6920
|
const headers = await this.getHeaders();
|
|
6779
|
-
const client =
|
|
6921
|
+
const client = initClient10(publicArtifactByIdContract, {
|
|
6780
6922
|
baseUrl,
|
|
6781
6923
|
baseHeaders: headers,
|
|
6782
6924
|
jsonQuery: true
|
|
@@ -6795,7 +6937,7 @@ var ApiClient = class {
|
|
|
6795
6937
|
async listPublicVolumes(query) {
|
|
6796
6938
|
const baseUrl = await this.getBaseUrl();
|
|
6797
6939
|
const headers = await this.getHeaders();
|
|
6798
|
-
const client =
|
|
6940
|
+
const client = initClient10(publicVolumesListContract, {
|
|
6799
6941
|
baseUrl,
|
|
6800
6942
|
baseHeaders: headers,
|
|
6801
6943
|
jsonQuery: true
|
|
@@ -6814,7 +6956,7 @@ var ApiClient = class {
|
|
|
6814
6956
|
async getPublicVolume(id) {
|
|
6815
6957
|
const baseUrl = await this.getBaseUrl();
|
|
6816
6958
|
const headers = await this.getHeaders();
|
|
6817
|
-
const client =
|
|
6959
|
+
const client = initClient10(publicVolumeByIdContract, {
|
|
6818
6960
|
baseUrl,
|
|
6819
6961
|
baseHeaders: headers,
|
|
6820
6962
|
jsonQuery: true
|
|
@@ -6853,7 +6995,7 @@ var ApiClient = class {
|
|
|
6853
6995
|
async listCredentials() {
|
|
6854
6996
|
const baseUrl = await this.getBaseUrl();
|
|
6855
6997
|
const headers = await this.getHeaders();
|
|
6856
|
-
const client =
|
|
6998
|
+
const client = initClient10(credentialsMainContract, {
|
|
6857
6999
|
baseUrl,
|
|
6858
7000
|
baseHeaders: headers,
|
|
6859
7001
|
jsonQuery: true
|
|
@@ -6872,7 +7014,7 @@ var ApiClient = class {
|
|
|
6872
7014
|
async getCredential(name) {
|
|
6873
7015
|
const baseUrl = await this.getBaseUrl();
|
|
6874
7016
|
const headers = await this.getHeaders();
|
|
6875
|
-
const client =
|
|
7017
|
+
const client = initClient10(credentialsByNameContract, {
|
|
6876
7018
|
baseUrl,
|
|
6877
7019
|
baseHeaders: headers,
|
|
6878
7020
|
jsonQuery: true
|
|
@@ -6893,7 +7035,7 @@ var ApiClient = class {
|
|
|
6893
7035
|
async setCredential(body) {
|
|
6894
7036
|
const baseUrl = await this.getBaseUrl();
|
|
6895
7037
|
const headers = await this.getHeaders();
|
|
6896
|
-
const client =
|
|
7038
|
+
const client = initClient10(credentialsMainContract, {
|
|
6897
7039
|
baseUrl,
|
|
6898
7040
|
baseHeaders: headers,
|
|
6899
7041
|
jsonQuery: true
|
|
@@ -6912,7 +7054,7 @@ var ApiClient = class {
|
|
|
6912
7054
|
async deleteCredential(name) {
|
|
6913
7055
|
const baseUrl = await this.getBaseUrl();
|
|
6914
7056
|
const headers = await this.getHeaders();
|
|
6915
|
-
const client =
|
|
7057
|
+
const client = initClient10(credentialsByNameContract, {
|
|
6916
7058
|
baseUrl,
|
|
6917
7059
|
baseHeaders: headers,
|
|
6918
7060
|
jsonQuery: true
|
|
@@ -6933,7 +7075,7 @@ var ApiClient = class {
|
|
|
6933
7075
|
async getRealtimeToken(runId) {
|
|
6934
7076
|
const baseUrl = await this.getBaseUrl();
|
|
6935
7077
|
const headers = await this.getHeaders();
|
|
6936
|
-
const client =
|
|
7078
|
+
const client = initClient10(realtimeTokenContract, {
|
|
6937
7079
|
baseUrl,
|
|
6938
7080
|
baseHeaders: headers,
|
|
6939
7081
|
jsonQuery: true
|
|
@@ -7455,7 +7597,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
7455
7597
|
}
|
|
7456
7598
|
showNextSteps(result);
|
|
7457
7599
|
if (options.autoUpdate !== false) {
|
|
7458
|
-
await silentUpgradeAfterCommand("9.
|
|
7600
|
+
await silentUpgradeAfterCommand("9.18.0");
|
|
7459
7601
|
}
|
|
7460
7602
|
} catch (error) {
|
|
7461
7603
|
handleRunError(error, identifier);
|
|
@@ -8962,7 +9104,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
|
|
|
8962
9104
|
).option("-y, --yes", "Skip confirmation prompts").option("-v, --verbose", "Show full tool inputs and outputs").addOption(new Option5("--debug-no-mock-claude").hideHelp()).addOption(new Option5("--no-auto-update").hideHelp()).action(
|
|
8963
9105
|
async (prompt, options) => {
|
|
8964
9106
|
if (options.autoUpdate !== false) {
|
|
8965
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
9107
|
+
const shouldExit = await checkAndUpgrade("9.18.0", prompt);
|
|
8966
9108
|
if (shouldExit) {
|
|
8967
9109
|
process.exit(0);
|
|
8968
9110
|
}
|
|
@@ -9677,7 +9819,7 @@ var listCommand4 = new Command36().name("list").alias("ls").description("List al
|
|
|
9677
9819
|
);
|
|
9678
9820
|
return;
|
|
9679
9821
|
}
|
|
9680
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
9822
|
+
const nameWidth = Math.max(4, ...data.composes.map((c23) => c23.name.length));
|
|
9681
9823
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
9682
9824
|
" "
|
|
9683
9825
|
);
|
|
@@ -10449,7 +10591,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
10449
10591
|
);
|
|
10450
10592
|
process.exit(1);
|
|
10451
10593
|
}
|
|
10452
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
10594
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c23) => c23.value === existingFrequency) : 0;
|
|
10453
10595
|
frequency = await promptSelect(
|
|
10454
10596
|
"Schedule frequency",
|
|
10455
10597
|
FREQUENCY_CHOICES,
|
|
@@ -10478,7 +10620,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
10478
10620
|
process.exit(1);
|
|
10479
10621
|
}
|
|
10480
10622
|
if (frequency === "weekly") {
|
|
10481
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
10623
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c23) => c23.value === existingDay) : 0;
|
|
10482
10624
|
const day2 = await promptSelect(
|
|
10483
10625
|
"Day of week",
|
|
10484
10626
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -11417,20 +11559,159 @@ var deleteCommand2 = new Command50().name("delete").description("Delete a secret
|
|
|
11417
11559
|
// src/commands/secret/index.ts
|
|
11418
11560
|
var secretCommand = new Command51().name("secret").description("Manage stored secrets for agent runs").addCommand(listCommand6).addCommand(setCommand2).addCommand(deleteCommand2);
|
|
11419
11561
|
|
|
11420
|
-
// src/commands/
|
|
11421
|
-
import { Command as
|
|
11562
|
+
// src/commands/variable/index.ts
|
|
11563
|
+
import { Command as Command55 } from "commander";
|
|
11422
11564
|
|
|
11423
|
-
// src/commands/
|
|
11565
|
+
// src/commands/variable/list.ts
|
|
11424
11566
|
import { Command as Command52 } from "commander";
|
|
11425
11567
|
import chalk51 from "chalk";
|
|
11426
|
-
|
|
11568
|
+
function truncateValue(value, maxLength = 60) {
|
|
11569
|
+
if (value.length <= maxLength) {
|
|
11570
|
+
return value;
|
|
11571
|
+
}
|
|
11572
|
+
return value.slice(0, maxLength - 15) + "... [truncated]";
|
|
11573
|
+
}
|
|
11574
|
+
var listCommand7 = new Command52().name("list").alias("ls").description("List all variables").action(async () => {
|
|
11575
|
+
try {
|
|
11576
|
+
const result = await listVariables();
|
|
11577
|
+
if (result.variables.length === 0) {
|
|
11578
|
+
console.log(chalk51.dim("No variables found"));
|
|
11579
|
+
console.log();
|
|
11580
|
+
console.log("To add a variable:");
|
|
11581
|
+
console.log(chalk51.cyan(" vm0 variable set MY_VAR <value>"));
|
|
11582
|
+
return;
|
|
11583
|
+
}
|
|
11584
|
+
console.log(chalk51.bold("Variables:"));
|
|
11585
|
+
console.log();
|
|
11586
|
+
for (const variable of result.variables) {
|
|
11587
|
+
const displayValue = truncateValue(variable.value);
|
|
11588
|
+
console.log(` ${chalk51.cyan(variable.name)} = ${displayValue}`);
|
|
11589
|
+
if (variable.description) {
|
|
11590
|
+
console.log(` ${chalk51.dim(variable.description)}`);
|
|
11591
|
+
}
|
|
11592
|
+
console.log(
|
|
11593
|
+
` ${chalk51.dim(`Updated: ${new Date(variable.updatedAt).toLocaleString()}`)}`
|
|
11594
|
+
);
|
|
11595
|
+
console.log();
|
|
11596
|
+
}
|
|
11597
|
+
console.log(chalk51.dim(`Total: ${result.variables.length} variable(s)`));
|
|
11598
|
+
} catch (error) {
|
|
11599
|
+
if (error instanceof Error) {
|
|
11600
|
+
if (error.message.includes("Not authenticated")) {
|
|
11601
|
+
console.error(chalk51.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
11602
|
+
} else {
|
|
11603
|
+
console.error(chalk51.red(`\u2717 ${error.message}`));
|
|
11604
|
+
}
|
|
11605
|
+
} else {
|
|
11606
|
+
console.error(chalk51.red("\u2717 An unexpected error occurred"));
|
|
11607
|
+
}
|
|
11608
|
+
process.exit(1);
|
|
11609
|
+
}
|
|
11610
|
+
});
|
|
11611
|
+
|
|
11612
|
+
// src/commands/variable/set.ts
|
|
11613
|
+
import { Command as Command53 } from "commander";
|
|
11614
|
+
import chalk52 from "chalk";
|
|
11615
|
+
var setCommand3 = new Command53().name("set").description("Create or update a variable").argument("<name>", "Variable name (uppercase, e.g., MY_VAR)").argument("<value>", "Variable value").option("-d, --description <description>", "Optional description").action(
|
|
11616
|
+
async (name, value, options) => {
|
|
11617
|
+
try {
|
|
11618
|
+
const variable = await setVariable({
|
|
11619
|
+
name,
|
|
11620
|
+
value,
|
|
11621
|
+
description: options.description
|
|
11622
|
+
});
|
|
11623
|
+
console.log(chalk52.green(`\u2713 Variable "${variable.name}" saved`));
|
|
11624
|
+
console.log();
|
|
11625
|
+
console.log("Use in vm0.yaml:");
|
|
11626
|
+
console.log(chalk52.cyan(` environment:`));
|
|
11627
|
+
console.log(chalk52.cyan(` ${name}: \${{ vars.${name} }}`));
|
|
11628
|
+
} catch (error) {
|
|
11629
|
+
if (error instanceof Error) {
|
|
11630
|
+
if (error.message.includes("Not authenticated")) {
|
|
11631
|
+
console.error(
|
|
11632
|
+
chalk52.red("\u2717 Not authenticated. Run: vm0 auth login")
|
|
11633
|
+
);
|
|
11634
|
+
} else if (error.message.includes("must contain only uppercase")) {
|
|
11635
|
+
console.error(chalk52.red(`\u2717 ${error.message}`));
|
|
11636
|
+
console.log();
|
|
11637
|
+
console.log("Examples of valid variable names:");
|
|
11638
|
+
console.log(chalk52.dim(" MY_VAR"));
|
|
11639
|
+
console.log(chalk52.dim(" API_URL"));
|
|
11640
|
+
console.log(chalk52.dim(" DEBUG_MODE"));
|
|
11641
|
+
} else {
|
|
11642
|
+
console.error(chalk52.red(`\u2717 ${error.message}`));
|
|
11643
|
+
}
|
|
11644
|
+
} else {
|
|
11645
|
+
console.error(chalk52.red("\u2717 An unexpected error occurred"));
|
|
11646
|
+
}
|
|
11647
|
+
process.exit(1);
|
|
11648
|
+
}
|
|
11649
|
+
}
|
|
11650
|
+
);
|
|
11651
|
+
|
|
11652
|
+
// src/commands/variable/delete.ts
|
|
11653
|
+
import { Command as Command54 } from "commander";
|
|
11654
|
+
import chalk53 from "chalk";
|
|
11655
|
+
var deleteCommand3 = new Command54().name("delete").description("Delete a variable").argument("<name>", "Variable name to delete").option("-y, --yes", "Skip confirmation prompt").action(async (name, options) => {
|
|
11656
|
+
try {
|
|
11657
|
+
try {
|
|
11658
|
+
await getVariable(name);
|
|
11659
|
+
} catch (error) {
|
|
11660
|
+
if (error instanceof Error && error.message.toLowerCase().includes("not found")) {
|
|
11661
|
+
console.error(chalk53.red(`\u2717 Variable "${name}" not found`));
|
|
11662
|
+
process.exit(1);
|
|
11663
|
+
}
|
|
11664
|
+
throw error;
|
|
11665
|
+
}
|
|
11666
|
+
if (!options.yes) {
|
|
11667
|
+
if (!isInteractive()) {
|
|
11668
|
+
console.error(
|
|
11669
|
+
chalk53.red("\u2717 --yes flag is required in non-interactive mode")
|
|
11670
|
+
);
|
|
11671
|
+
process.exit(1);
|
|
11672
|
+
}
|
|
11673
|
+
const confirmed = await promptConfirm(
|
|
11674
|
+
`Are you sure you want to delete variable "${name}"?`,
|
|
11675
|
+
false
|
|
11676
|
+
);
|
|
11677
|
+
if (!confirmed) {
|
|
11678
|
+
console.log(chalk53.dim("Cancelled"));
|
|
11679
|
+
return;
|
|
11680
|
+
}
|
|
11681
|
+
}
|
|
11682
|
+
await deleteVariable(name);
|
|
11683
|
+
console.log(chalk53.green(`\u2713 Variable "${name}" deleted`));
|
|
11684
|
+
} catch (error) {
|
|
11685
|
+
if (error instanceof Error) {
|
|
11686
|
+
if (error.message.includes("Not authenticated")) {
|
|
11687
|
+
console.error(chalk53.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
11688
|
+
} else {
|
|
11689
|
+
console.error(chalk53.red(`\u2717 ${error.message}`));
|
|
11690
|
+
}
|
|
11691
|
+
} else {
|
|
11692
|
+
console.error(chalk53.red("\u2717 An unexpected error occurred"));
|
|
11693
|
+
}
|
|
11694
|
+
process.exit(1);
|
|
11695
|
+
}
|
|
11696
|
+
});
|
|
11697
|
+
|
|
11698
|
+
// src/commands/variable/index.ts
|
|
11699
|
+
var variableCommand = new Command55().name("variable").description("Manage stored variables for agent runs").addCommand(listCommand7).addCommand(setCommand3).addCommand(deleteCommand3);
|
|
11700
|
+
|
|
11701
|
+
// src/commands/model-provider/index.ts
|
|
11702
|
+
import { Command as Command60 } from "commander";
|
|
11703
|
+
|
|
11704
|
+
// src/commands/model-provider/list.ts
|
|
11705
|
+
import { Command as Command56 } from "commander";
|
|
11706
|
+
import chalk54 from "chalk";
|
|
11707
|
+
var listCommand8 = new Command56().name("list").alias("ls").description("List all model providers").action(async () => {
|
|
11427
11708
|
try {
|
|
11428
11709
|
const result = await listModelProviders();
|
|
11429
11710
|
if (result.modelProviders.length === 0) {
|
|
11430
|
-
console.log(
|
|
11711
|
+
console.log(chalk54.dim("No model providers configured"));
|
|
11431
11712
|
console.log();
|
|
11432
11713
|
console.log("To add a model provider:");
|
|
11433
|
-
console.log(
|
|
11714
|
+
console.log(chalk54.cyan(" vm0 model-provider setup"));
|
|
11434
11715
|
return;
|
|
11435
11716
|
}
|
|
11436
11717
|
const byFramework = result.modelProviders.reduce(
|
|
@@ -11444,16 +11725,16 @@ var listCommand7 = new Command52().name("list").alias("ls").description("List al
|
|
|
11444
11725
|
},
|
|
11445
11726
|
{}
|
|
11446
11727
|
);
|
|
11447
|
-
console.log(
|
|
11728
|
+
console.log(chalk54.bold("Model Providers:"));
|
|
11448
11729
|
console.log();
|
|
11449
11730
|
for (const [framework, providers] of Object.entries(byFramework)) {
|
|
11450
|
-
console.log(` ${
|
|
11731
|
+
console.log(` ${chalk54.cyan(framework)}:`);
|
|
11451
11732
|
for (const provider of providers) {
|
|
11452
|
-
const defaultTag = provider.isDefault ?
|
|
11453
|
-
const modelTag = provider.selectedModel ?
|
|
11733
|
+
const defaultTag = provider.isDefault ? chalk54.green(" (default)") : "";
|
|
11734
|
+
const modelTag = provider.selectedModel ? chalk54.dim(` [${provider.selectedModel}]`) : "";
|
|
11454
11735
|
console.log(` ${provider.type}${defaultTag}${modelTag}`);
|
|
11455
11736
|
console.log(
|
|
11456
|
-
|
|
11737
|
+
chalk54.dim(
|
|
11457
11738
|
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
11458
11739
|
)
|
|
11459
11740
|
);
|
|
@@ -11461,33 +11742,33 @@ var listCommand7 = new Command52().name("list").alias("ls").description("List al
|
|
|
11461
11742
|
console.log();
|
|
11462
11743
|
}
|
|
11463
11744
|
console.log(
|
|
11464
|
-
|
|
11745
|
+
chalk54.dim(`Total: ${result.modelProviders.length} provider(s)`)
|
|
11465
11746
|
);
|
|
11466
11747
|
} catch (error) {
|
|
11467
11748
|
if (error instanceof Error) {
|
|
11468
11749
|
if (error.message.includes("Not authenticated")) {
|
|
11469
|
-
console.error(
|
|
11750
|
+
console.error(chalk54.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
11470
11751
|
} else {
|
|
11471
|
-
console.error(
|
|
11752
|
+
console.error(chalk54.red(`\u2717 ${error.message}`));
|
|
11472
11753
|
}
|
|
11473
11754
|
} else {
|
|
11474
|
-
console.error(
|
|
11755
|
+
console.error(chalk54.red("\u2717 An unexpected error occurred"));
|
|
11475
11756
|
}
|
|
11476
11757
|
process.exit(1);
|
|
11477
11758
|
}
|
|
11478
11759
|
});
|
|
11479
11760
|
|
|
11480
11761
|
// src/commands/model-provider/setup.ts
|
|
11481
|
-
import { Command as
|
|
11482
|
-
import
|
|
11762
|
+
import { Command as Command57 } from "commander";
|
|
11763
|
+
import chalk55 from "chalk";
|
|
11483
11764
|
import prompts2 from "prompts";
|
|
11484
11765
|
function validateProviderType(typeStr) {
|
|
11485
11766
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(typeStr)) {
|
|
11486
|
-
console.error(
|
|
11767
|
+
console.error(chalk55.red(`\u2717 Invalid type "${typeStr}"`));
|
|
11487
11768
|
console.log();
|
|
11488
11769
|
console.log("Valid types:");
|
|
11489
11770
|
for (const [t, config] of Object.entries(MODEL_PROVIDER_TYPES)) {
|
|
11490
|
-
console.log(` ${
|
|
11771
|
+
console.log(` ${chalk55.cyan(t)} - ${config.label}`);
|
|
11491
11772
|
}
|
|
11492
11773
|
process.exit(1);
|
|
11493
11774
|
}
|
|
@@ -11499,11 +11780,11 @@ function validateModel(type, modelStr) {
|
|
|
11499
11780
|
return modelStr;
|
|
11500
11781
|
}
|
|
11501
11782
|
if (models && !models.includes(modelStr)) {
|
|
11502
|
-
console.error(
|
|
11783
|
+
console.error(chalk55.red(`\u2717 Invalid model "${modelStr}"`));
|
|
11503
11784
|
console.log();
|
|
11504
11785
|
console.log("Valid models:");
|
|
11505
11786
|
for (const m of models) {
|
|
11506
|
-
console.log(` ${
|
|
11787
|
+
console.log(` ${chalk55.cyan(m)}`);
|
|
11507
11788
|
}
|
|
11508
11789
|
process.exit(1);
|
|
11509
11790
|
}
|
|
@@ -11512,12 +11793,12 @@ function validateModel(type, modelStr) {
|
|
|
11512
11793
|
function validateAuthMethod(type, authMethodStr) {
|
|
11513
11794
|
const authMethods = getAuthMethodsForType(type);
|
|
11514
11795
|
if (!authMethods || !(authMethodStr in authMethods)) {
|
|
11515
|
-
console.error(
|
|
11796
|
+
console.error(chalk55.red(`\u2717 Invalid auth method "${authMethodStr}"`));
|
|
11516
11797
|
console.log();
|
|
11517
11798
|
console.log("Valid auth methods:");
|
|
11518
11799
|
if (authMethods) {
|
|
11519
11800
|
for (const [method, config] of Object.entries(authMethods)) {
|
|
11520
|
-
console.log(` ${
|
|
11801
|
+
console.log(` ${chalk55.cyan(method)} - ${config.label}`);
|
|
11521
11802
|
}
|
|
11522
11803
|
}
|
|
11523
11804
|
process.exit(1);
|
|
@@ -11527,7 +11808,7 @@ function validateAuthMethod(type, authMethodStr) {
|
|
|
11527
11808
|
function parseCredentials(type, authMethod, credentialArgs) {
|
|
11528
11809
|
const credentialsConfig = getCredentialsForAuthMethod(type, authMethod);
|
|
11529
11810
|
if (!credentialsConfig) {
|
|
11530
|
-
console.error(
|
|
11811
|
+
console.error(chalk55.red(`\u2717 Invalid auth method "${authMethod}"`));
|
|
11531
11812
|
process.exit(1);
|
|
11532
11813
|
}
|
|
11533
11814
|
const credentialNames = Object.keys(credentialsConfig);
|
|
@@ -11535,7 +11816,7 @@ function parseCredentials(type, authMethod, credentialArgs) {
|
|
|
11535
11816
|
if (credentialArgs.length === 1 && firstArg && !firstArg.includes("=")) {
|
|
11536
11817
|
if (credentialNames.length !== 1) {
|
|
11537
11818
|
console.error(
|
|
11538
|
-
|
|
11819
|
+
chalk55.red(
|
|
11539
11820
|
"\u2717 Must use KEY=VALUE format for multi-credential auth methods"
|
|
11540
11821
|
)
|
|
11541
11822
|
);
|
|
@@ -11543,13 +11824,13 @@ function parseCredentials(type, authMethod, credentialArgs) {
|
|
|
11543
11824
|
console.log("Required credentials:");
|
|
11544
11825
|
for (const [name, fieldConfig] of Object.entries(credentialsConfig)) {
|
|
11545
11826
|
const requiredNote = fieldConfig.required ? " (required)" : "";
|
|
11546
|
-
console.log(` ${
|
|
11827
|
+
console.log(` ${chalk55.cyan(name)}${requiredNote}`);
|
|
11547
11828
|
}
|
|
11548
11829
|
process.exit(1);
|
|
11549
11830
|
}
|
|
11550
11831
|
const firstCredentialName = credentialNames[0];
|
|
11551
11832
|
if (!firstCredentialName) {
|
|
11552
|
-
console.error(
|
|
11833
|
+
console.error(chalk55.red("\u2717 No credentials defined for this auth method"));
|
|
11553
11834
|
process.exit(1);
|
|
11554
11835
|
}
|
|
11555
11836
|
return { [firstCredentialName]: firstArg };
|
|
@@ -11558,7 +11839,7 @@ function parseCredentials(type, authMethod, credentialArgs) {
|
|
|
11558
11839
|
for (const arg of credentialArgs) {
|
|
11559
11840
|
const eqIndex = arg.indexOf("=");
|
|
11560
11841
|
if (eqIndex === -1) {
|
|
11561
|
-
console.error(
|
|
11842
|
+
console.error(chalk55.red(`\u2717 Invalid credential format "${arg}"`));
|
|
11562
11843
|
console.log();
|
|
11563
11844
|
console.log("Use KEY=VALUE format (e.g., AWS_REGION=us-east-1)");
|
|
11564
11845
|
process.exit(1);
|
|
@@ -11572,17 +11853,17 @@ function parseCredentials(type, authMethod, credentialArgs) {
|
|
|
11572
11853
|
function validateCredentials(type, authMethod, credentials) {
|
|
11573
11854
|
const credentialsConfig = getCredentialsForAuthMethod(type, authMethod);
|
|
11574
11855
|
if (!credentialsConfig) {
|
|
11575
|
-
console.error(
|
|
11856
|
+
console.error(chalk55.red(`\u2717 Invalid auth method "${authMethod}"`));
|
|
11576
11857
|
process.exit(1);
|
|
11577
11858
|
}
|
|
11578
11859
|
for (const [name, fieldConfig] of Object.entries(credentialsConfig)) {
|
|
11579
11860
|
if (fieldConfig.required && !credentials[name]) {
|
|
11580
|
-
console.error(
|
|
11861
|
+
console.error(chalk55.red(`\u2717 Missing required credential: ${name}`));
|
|
11581
11862
|
console.log();
|
|
11582
11863
|
console.log("Required credentials:");
|
|
11583
11864
|
for (const [n, fc] of Object.entries(credentialsConfig)) {
|
|
11584
11865
|
if (fc.required) {
|
|
11585
|
-
console.log(` ${
|
|
11866
|
+
console.log(` ${chalk55.cyan(n)} - ${fc.label}`);
|
|
11586
11867
|
}
|
|
11587
11868
|
}
|
|
11588
11869
|
process.exit(1);
|
|
@@ -11590,12 +11871,12 @@ function validateCredentials(type, authMethod, credentials) {
|
|
|
11590
11871
|
}
|
|
11591
11872
|
for (const name of Object.keys(credentials)) {
|
|
11592
11873
|
if (!(name in credentialsConfig)) {
|
|
11593
|
-
console.error(
|
|
11874
|
+
console.error(chalk55.red(`\u2717 Unknown credential: ${name}`));
|
|
11594
11875
|
console.log();
|
|
11595
11876
|
console.log("Valid credentials:");
|
|
11596
11877
|
for (const [n, fc] of Object.entries(credentialsConfig)) {
|
|
11597
11878
|
const requiredNote = fc.required ? " (required)" : " (optional)";
|
|
11598
|
-
console.log(` ${
|
|
11879
|
+
console.log(` ${chalk55.cyan(n)}${requiredNote}`);
|
|
11599
11880
|
}
|
|
11600
11881
|
process.exit(1);
|
|
11601
11882
|
}
|
|
@@ -11618,7 +11899,7 @@ function handleNonInteractiveMode(options) {
|
|
|
11618
11899
|
const defaultAuthMethod = getDefaultAuthMethod(type);
|
|
11619
11900
|
const authMethods = getAuthMethodsForType(type);
|
|
11620
11901
|
if (!defaultAuthMethod || !authMethods) {
|
|
11621
|
-
console.error(
|
|
11902
|
+
console.error(chalk55.red(`\u2717 Provider "${type}" requires --auth-method`));
|
|
11622
11903
|
process.exit(1);
|
|
11623
11904
|
}
|
|
11624
11905
|
const authMethodNames = Object.keys(authMethods);
|
|
@@ -11626,7 +11907,7 @@ function handleNonInteractiveMode(options) {
|
|
|
11626
11907
|
authMethod = authMethodNames[0];
|
|
11627
11908
|
} else {
|
|
11628
11909
|
console.error(
|
|
11629
|
-
|
|
11910
|
+
chalk55.red(
|
|
11630
11911
|
`\u2717 --auth-method is required for "${type}" (multiple auth methods available)`
|
|
11631
11912
|
)
|
|
11632
11913
|
);
|
|
@@ -11635,13 +11916,13 @@ function handleNonInteractiveMode(options) {
|
|
|
11635
11916
|
for (const [method, config] of Object.entries(authMethods)) {
|
|
11636
11917
|
const defaultNote = method === defaultAuthMethod ? " (default)" : "";
|
|
11637
11918
|
console.log(
|
|
11638
|
-
` ${
|
|
11919
|
+
` ${chalk55.cyan(method)} - ${config.label}${defaultNote}`
|
|
11639
11920
|
);
|
|
11640
11921
|
}
|
|
11641
11922
|
console.log();
|
|
11642
11923
|
console.log("Example:");
|
|
11643
11924
|
console.log(
|
|
11644
|
-
|
|
11925
|
+
chalk55.cyan(
|
|
11645
11926
|
` vm0 model-provider setup --type ${type} --auth-method ${authMethodNames[0]} --credential KEY=VALUE`
|
|
11646
11927
|
)
|
|
11647
11928
|
);
|
|
@@ -11661,7 +11942,7 @@ function handleNonInteractiveMode(options) {
|
|
|
11661
11942
|
const credentialArgs = options.credential;
|
|
11662
11943
|
const firstArg = credentialArgs[0];
|
|
11663
11944
|
if (!firstArg) {
|
|
11664
|
-
console.error(
|
|
11945
|
+
console.error(chalk55.red("\u2717 Credential is required"));
|
|
11665
11946
|
process.exit(1);
|
|
11666
11947
|
}
|
|
11667
11948
|
let credential;
|
|
@@ -11710,7 +11991,7 @@ async function promptForModelSelection(type) {
|
|
|
11710
11991
|
if (selected === "__custom__") {
|
|
11711
11992
|
const placeholder = getCustomModelPlaceholder(type);
|
|
11712
11993
|
if (placeholder) {
|
|
11713
|
-
console.log(
|
|
11994
|
+
console.log(chalk55.dim(`Example: ${placeholder}`));
|
|
11714
11995
|
}
|
|
11715
11996
|
const customResponse = await prompts2(
|
|
11716
11997
|
{
|
|
@@ -11755,13 +12036,13 @@ function isSecretCredential(name) {
|
|
|
11755
12036
|
async function promptForCredentials(type, authMethod) {
|
|
11756
12037
|
const credentialsConfig = getCredentialsForAuthMethod(type, authMethod);
|
|
11757
12038
|
if (!credentialsConfig) {
|
|
11758
|
-
console.error(
|
|
12039
|
+
console.error(chalk55.red(`\u2717 Invalid auth method "${authMethod}"`));
|
|
11759
12040
|
process.exit(1);
|
|
11760
12041
|
}
|
|
11761
12042
|
const credentials = {};
|
|
11762
12043
|
for (const [name, fieldConfig] of Object.entries(credentialsConfig)) {
|
|
11763
12044
|
if (fieldConfig.helpText) {
|
|
11764
|
-
console.log(
|
|
12045
|
+
console.log(chalk55.dim(fieldConfig.helpText));
|
|
11765
12046
|
}
|
|
11766
12047
|
const isSecret = isSecretCredential(name);
|
|
11767
12048
|
const placeholder = "placeholder" in fieldConfig ? fieldConfig.placeholder : "";
|
|
@@ -11796,11 +12077,11 @@ async function promptForCredentials(type, authMethod) {
|
|
|
11796
12077
|
}
|
|
11797
12078
|
async function handleInteractiveMode() {
|
|
11798
12079
|
if (!isInteractive()) {
|
|
11799
|
-
console.error(
|
|
12080
|
+
console.error(chalk55.red("\u2717 Interactive mode requires a TTY"));
|
|
11800
12081
|
console.log();
|
|
11801
12082
|
console.log("Use non-interactive mode:");
|
|
11802
12083
|
console.log(
|
|
11803
|
-
|
|
12084
|
+
chalk55.cyan(
|
|
11804
12085
|
' vm0 model-provider setup --type <type> --credential "<value>"'
|
|
11805
12086
|
)
|
|
11806
12087
|
);
|
|
@@ -11817,7 +12098,7 @@ async function handleInteractiveMode() {
|
|
|
11817
12098
|
title = `${title} \u2713`;
|
|
11818
12099
|
}
|
|
11819
12100
|
if (isExperimental) {
|
|
11820
|
-
title = `${title} ${
|
|
12101
|
+
title = `${title} ${chalk55.dim("(experimental)")}`;
|
|
11821
12102
|
}
|
|
11822
12103
|
return {
|
|
11823
12104
|
title,
|
|
@@ -11850,14 +12131,14 @@ async function handleInteractiveMode() {
|
|
|
11850
12131
|
const provider = await convertModelProviderCredential(type);
|
|
11851
12132
|
const defaultNote = provider.isDefault ? ` (default for ${provider.framework})` : "";
|
|
11852
12133
|
console.log(
|
|
11853
|
-
|
|
12134
|
+
chalk55.green(
|
|
11854
12135
|
`\u2713 Converted "${checkResult.credentialName}" to model provider${defaultNote}`
|
|
11855
12136
|
)
|
|
11856
12137
|
);
|
|
11857
12138
|
await promptSetAsDefault(type, provider.framework, provider.isDefault);
|
|
11858
12139
|
return null;
|
|
11859
12140
|
}
|
|
11860
|
-
console.log(
|
|
12141
|
+
console.log(chalk55.dim("Aborted"));
|
|
11861
12142
|
process.exit(0);
|
|
11862
12143
|
}
|
|
11863
12144
|
if (checkResult.exists && checkResult.currentType === "model-provider") {
|
|
@@ -11888,7 +12169,7 @@ async function handleInteractiveMode() {
|
|
|
11888
12169
|
}
|
|
11889
12170
|
const config = MODEL_PROVIDER_TYPES[type];
|
|
11890
12171
|
console.log();
|
|
11891
|
-
console.log(
|
|
12172
|
+
console.log(chalk55.dim(config.helpText));
|
|
11892
12173
|
console.log();
|
|
11893
12174
|
if (hasAuthMethods(type)) {
|
|
11894
12175
|
const authMethod = await promptForAuthMethod(type);
|
|
@@ -11919,17 +12200,17 @@ async function handleInteractiveMode() {
|
|
|
11919
12200
|
function handleSetupError2(error) {
|
|
11920
12201
|
if (error instanceof Error) {
|
|
11921
12202
|
if (error.message.includes("already exists")) {
|
|
11922
|
-
console.error(
|
|
12203
|
+
console.error(chalk55.red(`\u2717 ${error.message}`));
|
|
11923
12204
|
console.log();
|
|
11924
12205
|
console.log("To convert the existing credential, run:");
|
|
11925
|
-
console.log(
|
|
12206
|
+
console.log(chalk55.cyan(" vm0 model-provider setup --convert"));
|
|
11926
12207
|
} else if (error.message.includes("Not authenticated")) {
|
|
11927
|
-
console.error(
|
|
12208
|
+
console.error(chalk55.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
11928
12209
|
} else {
|
|
11929
|
-
console.error(
|
|
12210
|
+
console.error(chalk55.red(`\u2717 ${error.message}`));
|
|
11930
12211
|
}
|
|
11931
12212
|
} else {
|
|
11932
|
-
console.error(
|
|
12213
|
+
console.error(chalk55.red("\u2717 An unexpected error occurred"));
|
|
11933
12214
|
}
|
|
11934
12215
|
process.exit(1);
|
|
11935
12216
|
}
|
|
@@ -11946,13 +12227,13 @@ async function promptSetAsDefault(type, framework, isDefault) {
|
|
|
11946
12227
|
);
|
|
11947
12228
|
if (response.setDefault) {
|
|
11948
12229
|
await setModelProviderDefault(type);
|
|
11949
|
-
console.log(
|
|
12230
|
+
console.log(chalk55.green(`\u2713 Default for ${framework} set to "${type}"`));
|
|
11950
12231
|
}
|
|
11951
12232
|
}
|
|
11952
12233
|
function collectCredentials(value, previous) {
|
|
11953
12234
|
return previous.concat([value]);
|
|
11954
12235
|
}
|
|
11955
|
-
var setupCommand2 = new
|
|
12236
|
+
var setupCommand2 = new Command57().name("setup").description("Configure a model provider").option("-t, --type <type>", "Provider type (for non-interactive mode)").option(
|
|
11956
12237
|
"-c, --credential <value>",
|
|
11957
12238
|
"Credential value (can be used multiple times, supports VALUE or KEY=VALUE format)",
|
|
11958
12239
|
collectCredentials,
|
|
@@ -11975,7 +12256,7 @@ var setupCommand2 = new Command53().name("setup").description("Configure a model
|
|
|
11975
12256
|
});
|
|
11976
12257
|
} else if (options.type || credentialArgs.length > 0) {
|
|
11977
12258
|
console.error(
|
|
11978
|
-
|
|
12259
|
+
chalk55.red("\u2717 Both --type and --credential are required")
|
|
11979
12260
|
);
|
|
11980
12261
|
process.exit(1);
|
|
11981
12262
|
} else {
|
|
@@ -11994,11 +12275,11 @@ var setupCommand2 = new Command53().name("setup").description("Configure a model
|
|
|
11994
12275
|
const modelNote2 = provider2.selectedModel ? ` with model: ${provider2.selectedModel}` : "";
|
|
11995
12276
|
if (!hasModelSelection(input.type)) {
|
|
11996
12277
|
console.log(
|
|
11997
|
-
|
|
12278
|
+
chalk55.green(`\u2713 Model provider "${input.type}" unchanged`)
|
|
11998
12279
|
);
|
|
11999
12280
|
} else {
|
|
12000
12281
|
console.log(
|
|
12001
|
-
|
|
12282
|
+
chalk55.green(
|
|
12002
12283
|
`\u2713 Model provider "${input.type}" updated${defaultNote2}${modelNote2}`
|
|
12003
12284
|
)
|
|
12004
12285
|
);
|
|
@@ -12024,7 +12305,7 @@ var setupCommand2 = new Command53().name("setup").description("Configure a model
|
|
|
12024
12305
|
const defaultNote = provider.isDefault ? ` (default for ${provider.framework})` : "";
|
|
12025
12306
|
const modelNote = provider.selectedModel ? ` with model: ${provider.selectedModel}` : "";
|
|
12026
12307
|
console.log(
|
|
12027
|
-
|
|
12308
|
+
chalk55.green(
|
|
12028
12309
|
`\u2713 Model provider "${input.type}" ${action}${defaultNote}${modelNote}`
|
|
12029
12310
|
)
|
|
12030
12311
|
);
|
|
@@ -12042,96 +12323,96 @@ var setupCommand2 = new Command53().name("setup").description("Configure a model
|
|
|
12042
12323
|
);
|
|
12043
12324
|
|
|
12044
12325
|
// src/commands/model-provider/delete.ts
|
|
12045
|
-
import { Command as
|
|
12046
|
-
import
|
|
12047
|
-
var
|
|
12326
|
+
import { Command as Command58 } from "commander";
|
|
12327
|
+
import chalk56 from "chalk";
|
|
12328
|
+
var deleteCommand4 = new Command58().name("delete").description("Delete a model provider").argument("<type>", "Model provider type to delete").action(async (type) => {
|
|
12048
12329
|
try {
|
|
12049
12330
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type)) {
|
|
12050
|
-
console.error(
|
|
12331
|
+
console.error(chalk56.red(`\u2717 Invalid type "${type}"`));
|
|
12051
12332
|
console.log();
|
|
12052
12333
|
console.log("Valid types:");
|
|
12053
12334
|
for (const [t, config] of Object.entries(MODEL_PROVIDER_TYPES)) {
|
|
12054
|
-
console.log(` ${
|
|
12335
|
+
console.log(` ${chalk56.cyan(t)} - ${config.label}`);
|
|
12055
12336
|
}
|
|
12056
12337
|
process.exit(1);
|
|
12057
12338
|
}
|
|
12058
12339
|
await deleteModelProvider(type);
|
|
12059
|
-
console.log(
|
|
12340
|
+
console.log(chalk56.green(`\u2713 Model provider "${type}" deleted`));
|
|
12060
12341
|
} catch (error) {
|
|
12061
12342
|
if (error instanceof Error) {
|
|
12062
12343
|
if (error.message.includes("not found")) {
|
|
12063
|
-
console.error(
|
|
12344
|
+
console.error(chalk56.red(`\u2717 Model provider "${type}" not found`));
|
|
12064
12345
|
} else if (error.message.includes("Not authenticated")) {
|
|
12065
|
-
console.error(
|
|
12346
|
+
console.error(chalk56.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
12066
12347
|
} else {
|
|
12067
|
-
console.error(
|
|
12348
|
+
console.error(chalk56.red(`\u2717 ${error.message}`));
|
|
12068
12349
|
}
|
|
12069
12350
|
} else {
|
|
12070
|
-
console.error(
|
|
12351
|
+
console.error(chalk56.red("\u2717 An unexpected error occurred"));
|
|
12071
12352
|
}
|
|
12072
12353
|
process.exit(1);
|
|
12073
12354
|
}
|
|
12074
12355
|
});
|
|
12075
12356
|
|
|
12076
12357
|
// src/commands/model-provider/set-default.ts
|
|
12077
|
-
import { Command as
|
|
12078
|
-
import
|
|
12079
|
-
var setDefaultCommand = new
|
|
12358
|
+
import { Command as Command59 } from "commander";
|
|
12359
|
+
import chalk57 from "chalk";
|
|
12360
|
+
var setDefaultCommand = new Command59().name("set-default").description("Set a model provider as default for its framework").argument("<type>", "Model provider type to set as default").action(async (type) => {
|
|
12080
12361
|
try {
|
|
12081
12362
|
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type)) {
|
|
12082
|
-
console.error(
|
|
12363
|
+
console.error(chalk57.red(`\u2717 Invalid type "${type}"`));
|
|
12083
12364
|
console.log();
|
|
12084
12365
|
console.log("Valid types:");
|
|
12085
12366
|
for (const [t, config] of Object.entries(MODEL_PROVIDER_TYPES)) {
|
|
12086
|
-
console.log(` ${
|
|
12367
|
+
console.log(` ${chalk57.cyan(t)} - ${config.label}`);
|
|
12087
12368
|
}
|
|
12088
12369
|
process.exit(1);
|
|
12089
12370
|
}
|
|
12090
12371
|
const provider = await setModelProviderDefault(type);
|
|
12091
12372
|
console.log(
|
|
12092
|
-
|
|
12373
|
+
chalk57.green(
|
|
12093
12374
|
`\u2713 Default for ${provider.framework} set to "${provider.type}"`
|
|
12094
12375
|
)
|
|
12095
12376
|
);
|
|
12096
12377
|
} catch (error) {
|
|
12097
12378
|
if (error instanceof Error) {
|
|
12098
12379
|
if (error.message.includes("not found")) {
|
|
12099
|
-
console.error(
|
|
12380
|
+
console.error(chalk57.red(`\u2717 Model provider "${type}" not found`));
|
|
12100
12381
|
} else if (error.message.includes("Not authenticated")) {
|
|
12101
|
-
console.error(
|
|
12382
|
+
console.error(chalk57.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
12102
12383
|
} else {
|
|
12103
|
-
console.error(
|
|
12384
|
+
console.error(chalk57.red(`\u2717 ${error.message}`));
|
|
12104
12385
|
}
|
|
12105
12386
|
} else {
|
|
12106
|
-
console.error(
|
|
12387
|
+
console.error(chalk57.red("\u2717 An unexpected error occurred"));
|
|
12107
12388
|
}
|
|
12108
12389
|
process.exit(1);
|
|
12109
12390
|
}
|
|
12110
12391
|
});
|
|
12111
12392
|
|
|
12112
12393
|
// src/commands/model-provider/index.ts
|
|
12113
|
-
var modelProviderCommand = new
|
|
12394
|
+
var modelProviderCommand = new Command60().name("model-provider").description("Manage model providers for agent runs").addCommand(listCommand8).addCommand(setupCommand2).addCommand(deleteCommand4).addCommand(setDefaultCommand);
|
|
12114
12395
|
|
|
12115
12396
|
// src/commands/onboard/index.ts
|
|
12116
|
-
import { Command as
|
|
12117
|
-
import
|
|
12397
|
+
import { Command as Command61 } from "commander";
|
|
12398
|
+
import chalk61 from "chalk";
|
|
12118
12399
|
import { mkdir as mkdir8 } from "fs/promises";
|
|
12119
12400
|
import { existsSync as existsSync11 } from "fs";
|
|
12120
12401
|
|
|
12121
12402
|
// src/lib/ui/welcome-box.ts
|
|
12122
|
-
import
|
|
12403
|
+
import chalk58 from "chalk";
|
|
12123
12404
|
var gradientColors = [
|
|
12124
|
-
|
|
12405
|
+
chalk58.hex("#FFAB5E"),
|
|
12125
12406
|
// Line 1 - lightest
|
|
12126
|
-
|
|
12407
|
+
chalk58.hex("#FF9642"),
|
|
12127
12408
|
// Line 2
|
|
12128
|
-
|
|
12409
|
+
chalk58.hex("#FF8228"),
|
|
12129
12410
|
// Line 3
|
|
12130
|
-
|
|
12411
|
+
chalk58.hex("#FF6D0A"),
|
|
12131
12412
|
// Line 4
|
|
12132
|
-
|
|
12413
|
+
chalk58.hex("#E85D00"),
|
|
12133
12414
|
// Line 5
|
|
12134
|
-
|
|
12415
|
+
chalk58.hex("#CC4E00")
|
|
12135
12416
|
// Line 6 - darkest
|
|
12136
12417
|
];
|
|
12137
12418
|
var vm0LogoLines = [
|
|
@@ -12153,15 +12434,15 @@ function renderVm0Banner() {
|
|
|
12153
12434
|
function renderOnboardWelcome() {
|
|
12154
12435
|
renderVm0Banner();
|
|
12155
12436
|
console.log(` Build agentic workflows using natural language.`);
|
|
12156
|
-
console.log(` ${
|
|
12437
|
+
console.log(` ${chalk58.dim("Currently in beta, enjoy it free.")}`);
|
|
12157
12438
|
console.log(
|
|
12158
|
-
` ${
|
|
12439
|
+
` ${chalk58.dim("Star us on GitHub: https://github.com/vm0-ai/vm0")}`
|
|
12159
12440
|
);
|
|
12160
12441
|
console.log();
|
|
12161
12442
|
}
|
|
12162
12443
|
|
|
12163
12444
|
// src/lib/ui/step-runner.ts
|
|
12164
|
-
import
|
|
12445
|
+
import chalk59 from "chalk";
|
|
12165
12446
|
function createStepRunner(options = true) {
|
|
12166
12447
|
const opts = typeof options === "boolean" ? { interactive: options } : options;
|
|
12167
12448
|
const interactive = opts.interactive ?? true;
|
|
@@ -12176,25 +12457,25 @@ function createStepRunner(options = true) {
|
|
|
12176
12457
|
}
|
|
12177
12458
|
for (const [i, step] of completedSteps.entries()) {
|
|
12178
12459
|
if (step.failed) {
|
|
12179
|
-
console.log(
|
|
12460
|
+
console.log(chalk59.red(`\u2717 ${step.label}`));
|
|
12180
12461
|
} else {
|
|
12181
|
-
console.log(
|
|
12462
|
+
console.log(chalk59.green(`\u25CF ${step.label}`));
|
|
12182
12463
|
}
|
|
12183
12464
|
const isLastStep = i === completedSteps.length - 1;
|
|
12184
12465
|
if (!isLastStep || !isFinal) {
|
|
12185
|
-
console.log(
|
|
12466
|
+
console.log(chalk59.dim("\u2502"));
|
|
12186
12467
|
}
|
|
12187
12468
|
}
|
|
12188
12469
|
}
|
|
12189
12470
|
async function executeStep(label, fn, isFinal) {
|
|
12190
12471
|
let stepFailed = false;
|
|
12191
|
-
console.log(
|
|
12472
|
+
console.log(chalk59.yellow(`\u25CB ${label}`));
|
|
12192
12473
|
const ctx = {
|
|
12193
12474
|
connector() {
|
|
12194
|
-
console.log(
|
|
12475
|
+
console.log(chalk59.dim("\u2502"));
|
|
12195
12476
|
},
|
|
12196
12477
|
detail(message) {
|
|
12197
|
-
console.log(`${
|
|
12478
|
+
console.log(`${chalk59.dim("\u2502")} ${message}`);
|
|
12198
12479
|
},
|
|
12199
12480
|
async prompt(promptFn) {
|
|
12200
12481
|
return await promptFn();
|
|
@@ -12211,12 +12492,12 @@ function createStepRunner(options = true) {
|
|
|
12211
12492
|
redrawCompletedSteps(isFinal);
|
|
12212
12493
|
} else {
|
|
12213
12494
|
if (stepFailed) {
|
|
12214
|
-
console.log(
|
|
12495
|
+
console.log(chalk59.red(`\u2717 ${label}`));
|
|
12215
12496
|
} else {
|
|
12216
|
-
console.log(
|
|
12497
|
+
console.log(chalk59.green(`\u25CF ${label}`));
|
|
12217
12498
|
}
|
|
12218
12499
|
if (!isFinal) {
|
|
12219
|
-
console.log(
|
|
12500
|
+
console.log(chalk59.dim("\u2502"));
|
|
12220
12501
|
}
|
|
12221
12502
|
}
|
|
12222
12503
|
}
|
|
@@ -12374,7 +12655,7 @@ async function setupModelProvider(type, credential, options) {
|
|
|
12374
12655
|
|
|
12375
12656
|
// src/lib/domain/onboard/claude-setup.ts
|
|
12376
12657
|
import { spawn as spawn3 } from "child_process";
|
|
12377
|
-
import
|
|
12658
|
+
import chalk60 from "chalk";
|
|
12378
12659
|
var MARKETPLACE_NAME = "vm0-skills";
|
|
12379
12660
|
var MARKETPLACE_REPO = "vm0-ai/vm0-skills";
|
|
12380
12661
|
var PLUGIN_ID = "vm0@vm0-skills";
|
|
@@ -12411,12 +12692,12 @@ async function runClaudeCommand(args, cwd) {
|
|
|
12411
12692
|
}
|
|
12412
12693
|
function handlePluginError(error, context) {
|
|
12413
12694
|
const displayContext = context ?? "Claude plugin";
|
|
12414
|
-
console.error(
|
|
12695
|
+
console.error(chalk60.red(`Failed to install ${displayContext}`));
|
|
12415
12696
|
if (error instanceof Error) {
|
|
12416
|
-
console.error(
|
|
12697
|
+
console.error(chalk60.red(error.message));
|
|
12417
12698
|
}
|
|
12418
12699
|
console.error(
|
|
12419
|
-
|
|
12700
|
+
chalk60.dim("Please ensure Claude CLI is installed and accessible.")
|
|
12420
12701
|
);
|
|
12421
12702
|
process.exit(1);
|
|
12422
12703
|
}
|
|
@@ -12459,7 +12740,7 @@ async function updateMarketplace() {
|
|
|
12459
12740
|
]);
|
|
12460
12741
|
if (!result.success) {
|
|
12461
12742
|
console.warn(
|
|
12462
|
-
|
|
12743
|
+
chalk60.yellow(
|
|
12463
12744
|
`Warning: Could not update marketplace: ${result.error ?? "unknown error"}`
|
|
12464
12745
|
)
|
|
12465
12746
|
);
|
|
@@ -12497,7 +12778,7 @@ async function handleAuthentication(ctx) {
|
|
|
12497
12778
|
return;
|
|
12498
12779
|
}
|
|
12499
12780
|
if (!ctx.interactive) {
|
|
12500
|
-
console.error(
|
|
12781
|
+
console.error(chalk61.red("Error: Not authenticated"));
|
|
12501
12782
|
console.error("Run 'vm0 auth login' first or set VM0_TOKEN");
|
|
12502
12783
|
process.exit(1);
|
|
12503
12784
|
}
|
|
@@ -12505,16 +12786,16 @@ async function handleAuthentication(ctx) {
|
|
|
12505
12786
|
onInitiating: () => {
|
|
12506
12787
|
},
|
|
12507
12788
|
onDeviceCodeReady: (url, code, expiresIn) => {
|
|
12508
|
-
step.detail(`Copy code: ${
|
|
12509
|
-
step.detail(`Open: ${
|
|
12510
|
-
step.detail(
|
|
12789
|
+
step.detail(`Copy code: ${chalk61.cyan.bold(code)}`);
|
|
12790
|
+
step.detail(`Open: ${chalk61.cyan(url)}`);
|
|
12791
|
+
step.detail(chalk61.dim(`Expires in ${expiresIn} minutes`));
|
|
12511
12792
|
},
|
|
12512
12793
|
onPolling: () => {
|
|
12513
12794
|
},
|
|
12514
12795
|
onSuccess: () => {
|
|
12515
12796
|
},
|
|
12516
12797
|
onError: (error) => {
|
|
12517
|
-
console.error(
|
|
12798
|
+
console.error(chalk61.red(`
|
|
12518
12799
|
${error.message}`));
|
|
12519
12800
|
process.exit(1);
|
|
12520
12801
|
}
|
|
@@ -12528,7 +12809,7 @@ async function handleModelProvider(ctx) {
|
|
|
12528
12809
|
return;
|
|
12529
12810
|
}
|
|
12530
12811
|
if (!ctx.interactive) {
|
|
12531
|
-
console.error(
|
|
12812
|
+
console.error(chalk61.red("Error: No model provider configured"));
|
|
12532
12813
|
console.error("Run 'vm0 model-provider setup' first");
|
|
12533
12814
|
process.exit(1);
|
|
12534
12815
|
}
|
|
@@ -12537,19 +12818,19 @@ async function handleModelProvider(ctx) {
|
|
|
12537
12818
|
const providerType = await step.prompt(
|
|
12538
12819
|
() => promptSelect(
|
|
12539
12820
|
"Select provider type:",
|
|
12540
|
-
choices.map((
|
|
12541
|
-
title:
|
|
12542
|
-
value:
|
|
12821
|
+
choices.map((c23) => ({
|
|
12822
|
+
title: c23.label,
|
|
12823
|
+
value: c23.type
|
|
12543
12824
|
}))
|
|
12544
12825
|
)
|
|
12545
12826
|
);
|
|
12546
12827
|
if (!providerType) {
|
|
12547
12828
|
process.exit(0);
|
|
12548
12829
|
}
|
|
12549
|
-
const selectedChoice = choices.find((
|
|
12830
|
+
const selectedChoice = choices.find((c23) => c23.type === providerType);
|
|
12550
12831
|
if (selectedChoice?.helpText) {
|
|
12551
12832
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
12552
|
-
step.detail(
|
|
12833
|
+
step.detail(chalk61.dim(line));
|
|
12553
12834
|
}
|
|
12554
12835
|
}
|
|
12555
12836
|
const credential = await step.prompt(
|
|
@@ -12558,7 +12839,7 @@ async function handleModelProvider(ctx) {
|
|
|
12558
12839
|
)
|
|
12559
12840
|
);
|
|
12560
12841
|
if (!credential) {
|
|
12561
|
-
console.log(
|
|
12842
|
+
console.log(chalk61.dim("Cancelled"));
|
|
12562
12843
|
process.exit(0);
|
|
12563
12844
|
}
|
|
12564
12845
|
let selectedModel;
|
|
@@ -12577,7 +12858,7 @@ async function handleModelProvider(ctx) {
|
|
|
12577
12858
|
() => promptSelect("Select model:", modelChoices)
|
|
12578
12859
|
);
|
|
12579
12860
|
if (modelSelection === void 0) {
|
|
12580
|
-
console.log(
|
|
12861
|
+
console.log(chalk61.dim("Cancelled"));
|
|
12581
12862
|
process.exit(0);
|
|
12582
12863
|
}
|
|
12583
12864
|
selectedModel = modelSelection === "" ? void 0 : modelSelection;
|
|
@@ -12587,7 +12868,7 @@ async function handleModelProvider(ctx) {
|
|
|
12587
12868
|
});
|
|
12588
12869
|
const modelNote = result.provider.selectedModel ? ` with model: ${result.provider.selectedModel}` : "";
|
|
12589
12870
|
step.detail(
|
|
12590
|
-
|
|
12871
|
+
chalk61.green(
|
|
12591
12872
|
`${providerType} ${result.created ? "created" : "updated"}${result.isDefault ? ` (default for ${result.framework})` : ""}${modelNote}`
|
|
12592
12873
|
)
|
|
12593
12874
|
);
|
|
@@ -12618,7 +12899,7 @@ async function handleAgentCreation(ctx) {
|
|
|
12618
12899
|
agentName = inputName;
|
|
12619
12900
|
if (existsSync11(agentName)) {
|
|
12620
12901
|
step.detail(
|
|
12621
|
-
|
|
12902
|
+
chalk61.yellow(`${agentName}/ already exists, choose another name`)
|
|
12622
12903
|
);
|
|
12623
12904
|
} else {
|
|
12624
12905
|
folderExists = false;
|
|
@@ -12627,22 +12908,22 @@ async function handleAgentCreation(ctx) {
|
|
|
12627
12908
|
} else {
|
|
12628
12909
|
if (!validateAgentName(agentName)) {
|
|
12629
12910
|
console.error(
|
|
12630
|
-
|
|
12911
|
+
chalk61.red(
|
|
12631
12912
|
"Invalid agent name: must be 3-64 chars, alphanumeric + hyphens"
|
|
12632
12913
|
)
|
|
12633
12914
|
);
|
|
12634
12915
|
process.exit(1);
|
|
12635
12916
|
}
|
|
12636
12917
|
if (existsSync11(agentName)) {
|
|
12637
|
-
console.error(
|
|
12918
|
+
console.error(chalk61.red(`${agentName}/ already exists`));
|
|
12638
12919
|
console.log();
|
|
12639
12920
|
console.log("Remove it first or choose a different name:");
|
|
12640
|
-
console.log(
|
|
12921
|
+
console.log(chalk61.cyan(` rm -rf ${agentName}`));
|
|
12641
12922
|
process.exit(1);
|
|
12642
12923
|
}
|
|
12643
12924
|
}
|
|
12644
12925
|
await mkdir8(agentName, { recursive: true });
|
|
12645
|
-
step.detail(
|
|
12926
|
+
step.detail(chalk61.green(`Created ${agentName}/`));
|
|
12646
12927
|
});
|
|
12647
12928
|
return agentName;
|
|
12648
12929
|
}
|
|
@@ -12658,7 +12939,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
12658
12939
|
shouldInstall = confirmed ?? true;
|
|
12659
12940
|
}
|
|
12660
12941
|
if (!shouldInstall) {
|
|
12661
|
-
step.detail(
|
|
12942
|
+
step.detail(chalk61.dim("Skipped"));
|
|
12662
12943
|
return;
|
|
12663
12944
|
}
|
|
12664
12945
|
const scope = "project";
|
|
@@ -12666,7 +12947,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
12666
12947
|
const agentDir = `${process.cwd()}/${agentName}`;
|
|
12667
12948
|
const result = await installVm0Plugin(scope, agentDir);
|
|
12668
12949
|
step.detail(
|
|
12669
|
-
|
|
12950
|
+
chalk61.green(`Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
12670
12951
|
);
|
|
12671
12952
|
pluginInstalled = true;
|
|
12672
12953
|
} catch (error) {
|
|
@@ -12677,18 +12958,18 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
12677
12958
|
}
|
|
12678
12959
|
function printNextSteps(agentName, pluginInstalled) {
|
|
12679
12960
|
console.log();
|
|
12680
|
-
console.log(
|
|
12961
|
+
console.log(chalk61.bold("Next step:"));
|
|
12681
12962
|
console.log();
|
|
12682
12963
|
if (pluginInstalled) {
|
|
12683
12964
|
console.log(
|
|
12684
|
-
` ${
|
|
12965
|
+
` ${chalk61.cyan(`cd ${agentName} && claude "/${PRIMARY_SKILL_NAME} let's build an agent"`)}`
|
|
12685
12966
|
);
|
|
12686
12967
|
} else {
|
|
12687
|
-
console.log(` ${
|
|
12968
|
+
console.log(` ${chalk61.cyan(`cd ${agentName} && vm0 init`)}`);
|
|
12688
12969
|
}
|
|
12689
12970
|
console.log();
|
|
12690
12971
|
}
|
|
12691
|
-
var onboardCommand = new
|
|
12972
|
+
var onboardCommand = new Command61().name("onboard").description("Guided setup for new VM0 users").option("-y, --yes", "Skip confirmation prompts").option("--name <name>", `Agent name (default: ${DEFAULT_AGENT_NAME})`).action(async (options) => {
|
|
12692
12973
|
const interactive = isInteractive();
|
|
12693
12974
|
if (interactive) {
|
|
12694
12975
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
@@ -12711,15 +12992,15 @@ var onboardCommand = new Command57().name("onboard").description("Guided setup f
|
|
|
12711
12992
|
});
|
|
12712
12993
|
|
|
12713
12994
|
// src/commands/setup-claude/index.ts
|
|
12714
|
-
import { Command as
|
|
12715
|
-
import
|
|
12716
|
-
var setupClaudeCommand = new
|
|
12717
|
-
console.log(
|
|
12995
|
+
import { Command as Command62 } from "commander";
|
|
12996
|
+
import chalk62 from "chalk";
|
|
12997
|
+
var setupClaudeCommand = new Command62().name("setup-claude").description("Install VM0 Claude Plugin").option("--agent-dir <dir>", "Agent directory to run install in").option("--scope <scope>", "Installation scope (user or project)", "project").action(async (options) => {
|
|
12998
|
+
console.log(chalk62.dim("Installing VM0 Claude Plugin..."));
|
|
12718
12999
|
const scope = options.scope === "user" ? "user" : "project";
|
|
12719
13000
|
try {
|
|
12720
13001
|
const result = await installVm0Plugin(scope, options.agentDir);
|
|
12721
13002
|
console.log(
|
|
12722
|
-
|
|
13003
|
+
chalk62.green(`\u2713 Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
12723
13004
|
);
|
|
12724
13005
|
} catch (error) {
|
|
12725
13006
|
handlePluginError(error);
|
|
@@ -12728,15 +13009,15 @@ var setupClaudeCommand = new Command58().name("setup-claude").description("Insta
|
|
|
12728
13009
|
console.log("Next step:");
|
|
12729
13010
|
const cdPrefix = options.agentDir ? `cd ${options.agentDir} && ` : "";
|
|
12730
13011
|
console.log(
|
|
12731
|
-
|
|
13012
|
+
chalk62.cyan(
|
|
12732
13013
|
` ${cdPrefix}claude "/${PRIMARY_SKILL_NAME} let's build a workflow"`
|
|
12733
13014
|
)
|
|
12734
13015
|
);
|
|
12735
13016
|
});
|
|
12736
13017
|
|
|
12737
13018
|
// src/index.ts
|
|
12738
|
-
var program = new
|
|
12739
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
13019
|
+
var program = new Command63();
|
|
13020
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.18.0");
|
|
12740
13021
|
program.addCommand(authCommand);
|
|
12741
13022
|
program.addCommand(infoCommand);
|
|
12742
13023
|
program.addCommand(composeCommand);
|
|
@@ -12751,6 +13032,7 @@ program.addCommand(initCommand3);
|
|
|
12751
13032
|
program.addCommand(scheduleCommand);
|
|
12752
13033
|
program.addCommand(usageCommand);
|
|
12753
13034
|
program.addCommand(secretCommand);
|
|
13035
|
+
program.addCommand(variableCommand);
|
|
12754
13036
|
program.addCommand(modelProviderCommand);
|
|
12755
13037
|
program.addCommand(onboardCommand);
|
|
12756
13038
|
program.addCommand(setupClaudeCommand);
|