@vm0/cli 9.23.0 → 9.24.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 +500 -251
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -61,7 +61,7 @@ if (DSN) {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
Sentry.setContext("cli", {
|
|
64
|
-
version: "9.
|
|
64
|
+
version: "9.24.0",
|
|
65
65
|
command: process.argv.slice(2).join(" ")
|
|
66
66
|
});
|
|
67
67
|
Sentry.setContext("runtime", {
|
|
@@ -72,7 +72,7 @@ if (DSN) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/index.ts
|
|
75
|
-
import { Command as
|
|
75
|
+
import { Command as Command72 } from "commander";
|
|
76
76
|
|
|
77
77
|
// src/commands/auth/index.ts
|
|
78
78
|
import { Command as Command5 } from "commander";
|
|
@@ -3235,29 +3235,158 @@ var webhookComposeCompleteContract = c19.router({
|
|
|
3235
3235
|
}
|
|
3236
3236
|
});
|
|
3237
3237
|
|
|
3238
|
-
// ../../packages/core/src/contracts/
|
|
3238
|
+
// ../../packages/core/src/contracts/connectors.ts
|
|
3239
3239
|
import { z as z24 } from "zod";
|
|
3240
3240
|
var c20 = initContract();
|
|
3241
|
-
var
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3241
|
+
var connectorTypeSchema = z24.enum(["github"]);
|
|
3242
|
+
var connectorResponseSchema = z24.object({
|
|
3243
|
+
id: z24.string().uuid(),
|
|
3244
|
+
type: connectorTypeSchema,
|
|
3245
|
+
authMethod: z24.string(),
|
|
3246
|
+
externalId: z24.string().nullable(),
|
|
3247
|
+
externalUsername: z24.string().nullable(),
|
|
3248
|
+
externalEmail: z24.string().nullable(),
|
|
3249
|
+
oauthScopes: z24.array(z24.string()).nullable(),
|
|
3250
|
+
createdAt: z24.string(),
|
|
3251
|
+
updatedAt: z24.string()
|
|
3252
|
+
});
|
|
3253
|
+
var connectorListResponseSchema = z24.object({
|
|
3254
|
+
connectors: z24.array(connectorResponseSchema)
|
|
3255
|
+
});
|
|
3256
|
+
var connectorsMainContract = c20.router({
|
|
3257
|
+
list: {
|
|
3258
|
+
method: "GET",
|
|
3259
|
+
path: "/api/connectors",
|
|
3260
|
+
headers: authHeadersSchema,
|
|
3261
|
+
responses: {
|
|
3262
|
+
200: connectorListResponseSchema,
|
|
3263
|
+
401: apiErrorSchema,
|
|
3264
|
+
500: apiErrorSchema
|
|
3265
|
+
},
|
|
3266
|
+
summary: "List all connectors for the authenticated user"
|
|
3267
|
+
}
|
|
3268
|
+
});
|
|
3269
|
+
var connectorsByTypeContract = c20.router({
|
|
3270
|
+
get: {
|
|
3271
|
+
method: "GET",
|
|
3272
|
+
path: "/api/connectors/:type",
|
|
3273
|
+
headers: authHeadersSchema,
|
|
3274
|
+
pathParams: z24.object({
|
|
3275
|
+
type: connectorTypeSchema
|
|
3276
|
+
}),
|
|
3277
|
+
responses: {
|
|
3278
|
+
200: connectorResponseSchema,
|
|
3279
|
+
401: apiErrorSchema,
|
|
3280
|
+
404: apiErrorSchema,
|
|
3281
|
+
500: apiErrorSchema
|
|
3282
|
+
},
|
|
3283
|
+
summary: "Get connector status by type"
|
|
3284
|
+
},
|
|
3285
|
+
delete: {
|
|
3286
|
+
method: "DELETE",
|
|
3287
|
+
path: "/api/connectors/:type",
|
|
3288
|
+
headers: authHeadersSchema,
|
|
3289
|
+
pathParams: z24.object({
|
|
3290
|
+
type: connectorTypeSchema
|
|
3291
|
+
}),
|
|
3292
|
+
responses: {
|
|
3293
|
+
204: c20.noBody(),
|
|
3294
|
+
401: apiErrorSchema,
|
|
3295
|
+
404: apiErrorSchema,
|
|
3296
|
+
500: apiErrorSchema
|
|
3297
|
+
},
|
|
3298
|
+
summary: "Disconnect a connector"
|
|
3299
|
+
}
|
|
3300
|
+
});
|
|
3301
|
+
var connectorSessionStatusSchema = z24.enum([
|
|
3302
|
+
"pending",
|
|
3303
|
+
"complete",
|
|
3304
|
+
"expired",
|
|
3305
|
+
"error"
|
|
3306
|
+
]);
|
|
3307
|
+
var connectorSessionResponseSchema = z24.object({
|
|
3308
|
+
id: z24.string().uuid(),
|
|
3309
|
+
code: z24.string(),
|
|
3310
|
+
type: connectorTypeSchema,
|
|
3311
|
+
status: connectorSessionStatusSchema,
|
|
3312
|
+
verificationUrl: z24.string(),
|
|
3313
|
+
expiresIn: z24.number(),
|
|
3314
|
+
interval: z24.number(),
|
|
3315
|
+
errorMessage: z24.string().nullable().optional()
|
|
3316
|
+
});
|
|
3317
|
+
var connectorSessionStatusResponseSchema = z24.object({
|
|
3318
|
+
status: connectorSessionStatusSchema,
|
|
3319
|
+
errorMessage: z24.string().nullable().optional()
|
|
3320
|
+
});
|
|
3321
|
+
var connectorSessionsContract = c20.router({
|
|
3322
|
+
/**
|
|
3323
|
+
* POST /api/connectors/:type/sessions
|
|
3324
|
+
* Create a new connector session for CLI device flow
|
|
3325
|
+
*/
|
|
3326
|
+
create: {
|
|
3327
|
+
method: "POST",
|
|
3328
|
+
path: "/api/connectors/:type/sessions",
|
|
3329
|
+
headers: authHeadersSchema,
|
|
3330
|
+
pathParams: z24.object({
|
|
3331
|
+
type: connectorTypeSchema
|
|
3332
|
+
}),
|
|
3333
|
+
body: z24.object({}).optional(),
|
|
3334
|
+
responses: {
|
|
3335
|
+
200: connectorSessionResponseSchema,
|
|
3336
|
+
400: apiErrorSchema,
|
|
3337
|
+
401: apiErrorSchema,
|
|
3338
|
+
500: apiErrorSchema
|
|
3339
|
+
},
|
|
3340
|
+
summary: "Create connector session for CLI device flow"
|
|
3341
|
+
}
|
|
3342
|
+
});
|
|
3343
|
+
var connectorSessionByIdContract = c20.router({
|
|
3344
|
+
/**
|
|
3345
|
+
* GET /api/connectors/:type/sessions/:sessionId
|
|
3346
|
+
* Get connector session status (for CLI polling)
|
|
3347
|
+
*/
|
|
3348
|
+
get: {
|
|
3349
|
+
method: "GET",
|
|
3350
|
+
path: "/api/connectors/:type/sessions/:sessionId",
|
|
3351
|
+
headers: authHeadersSchema,
|
|
3352
|
+
pathParams: z24.object({
|
|
3353
|
+
type: connectorTypeSchema,
|
|
3354
|
+
sessionId: z24.string().uuid()
|
|
3355
|
+
}),
|
|
3356
|
+
responses: {
|
|
3357
|
+
200: connectorSessionStatusResponseSchema,
|
|
3358
|
+
400: apiErrorSchema,
|
|
3359
|
+
401: apiErrorSchema,
|
|
3360
|
+
404: apiErrorSchema,
|
|
3361
|
+
500: apiErrorSchema
|
|
3362
|
+
},
|
|
3363
|
+
summary: "Get connector session status"
|
|
3364
|
+
}
|
|
3365
|
+
});
|
|
3366
|
+
|
|
3367
|
+
// ../../packages/core/src/contracts/public/agents.ts
|
|
3368
|
+
import { z as z25 } from "zod";
|
|
3369
|
+
var c21 = initContract();
|
|
3370
|
+
var publicAgentSchema = z25.object({
|
|
3371
|
+
id: z25.string(),
|
|
3372
|
+
name: z25.string(),
|
|
3373
|
+
currentVersionId: z25.string().nullable(),
|
|
3245
3374
|
createdAt: timestampSchema,
|
|
3246
3375
|
updatedAt: timestampSchema
|
|
3247
3376
|
});
|
|
3248
|
-
var agentVersionSchema =
|
|
3249
|
-
id:
|
|
3250
|
-
agentId:
|
|
3251
|
-
versionNumber:
|
|
3377
|
+
var agentVersionSchema = z25.object({
|
|
3378
|
+
id: z25.string(),
|
|
3379
|
+
agentId: z25.string(),
|
|
3380
|
+
versionNumber: z25.number(),
|
|
3252
3381
|
createdAt: timestampSchema
|
|
3253
3382
|
});
|
|
3254
3383
|
var publicAgentDetailSchema = publicAgentSchema;
|
|
3255
3384
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
3256
3385
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
3257
3386
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
3258
|
-
name:
|
|
3387
|
+
name: z25.string().optional()
|
|
3259
3388
|
});
|
|
3260
|
-
var publicAgentsListContract =
|
|
3389
|
+
var publicAgentsListContract = c21.router({
|
|
3261
3390
|
list: {
|
|
3262
3391
|
method: "GET",
|
|
3263
3392
|
path: "/v1/agents",
|
|
@@ -3272,13 +3401,13 @@ var publicAgentsListContract = c20.router({
|
|
|
3272
3401
|
description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
|
|
3273
3402
|
}
|
|
3274
3403
|
});
|
|
3275
|
-
var publicAgentByIdContract =
|
|
3404
|
+
var publicAgentByIdContract = c21.router({
|
|
3276
3405
|
get: {
|
|
3277
3406
|
method: "GET",
|
|
3278
3407
|
path: "/v1/agents/:id",
|
|
3279
3408
|
headers: authHeadersSchema,
|
|
3280
|
-
pathParams:
|
|
3281
|
-
id:
|
|
3409
|
+
pathParams: z25.object({
|
|
3410
|
+
id: z25.string().min(1, "Agent ID is required")
|
|
3282
3411
|
}),
|
|
3283
3412
|
responses: {
|
|
3284
3413
|
200: publicAgentDetailSchema,
|
|
@@ -3290,13 +3419,13 @@ var publicAgentByIdContract = c20.router({
|
|
|
3290
3419
|
description: "Get agent details by ID"
|
|
3291
3420
|
}
|
|
3292
3421
|
});
|
|
3293
|
-
var publicAgentVersionsContract =
|
|
3422
|
+
var publicAgentVersionsContract = c21.router({
|
|
3294
3423
|
list: {
|
|
3295
3424
|
method: "GET",
|
|
3296
3425
|
path: "/v1/agents/:id/versions",
|
|
3297
3426
|
headers: authHeadersSchema,
|
|
3298
|
-
pathParams:
|
|
3299
|
-
id:
|
|
3427
|
+
pathParams: z25.object({
|
|
3428
|
+
id: z25.string().min(1, "Agent ID is required")
|
|
3300
3429
|
}),
|
|
3301
3430
|
query: listQuerySchema,
|
|
3302
3431
|
responses: {
|
|
@@ -3311,9 +3440,9 @@ var publicAgentVersionsContract = c20.router({
|
|
|
3311
3440
|
});
|
|
3312
3441
|
|
|
3313
3442
|
// ../../packages/core/src/contracts/public/runs.ts
|
|
3314
|
-
import { z as
|
|
3315
|
-
var
|
|
3316
|
-
var publicRunStatusSchema =
|
|
3443
|
+
import { z as z26 } from "zod";
|
|
3444
|
+
var c22 = initContract();
|
|
3445
|
+
var publicRunStatusSchema = z26.enum([
|
|
3317
3446
|
"pending",
|
|
3318
3447
|
"running",
|
|
3319
3448
|
"completed",
|
|
@@ -3321,54 +3450,54 @@ var publicRunStatusSchema = z25.enum([
|
|
|
3321
3450
|
"timeout",
|
|
3322
3451
|
"cancelled"
|
|
3323
3452
|
]);
|
|
3324
|
-
var publicRunSchema =
|
|
3325
|
-
id:
|
|
3326
|
-
agentId:
|
|
3327
|
-
agentName:
|
|
3453
|
+
var publicRunSchema = z26.object({
|
|
3454
|
+
id: z26.string(),
|
|
3455
|
+
agentId: z26.string(),
|
|
3456
|
+
agentName: z26.string(),
|
|
3328
3457
|
status: publicRunStatusSchema,
|
|
3329
|
-
prompt:
|
|
3458
|
+
prompt: z26.string(),
|
|
3330
3459
|
createdAt: timestampSchema,
|
|
3331
3460
|
startedAt: timestampSchema.nullable(),
|
|
3332
3461
|
completedAt: timestampSchema.nullable()
|
|
3333
3462
|
});
|
|
3334
3463
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
3335
|
-
error:
|
|
3336
|
-
executionTimeMs:
|
|
3337
|
-
checkpointId:
|
|
3338
|
-
sessionId:
|
|
3339
|
-
artifactName:
|
|
3340
|
-
artifactVersion:
|
|
3341
|
-
volumes:
|
|
3464
|
+
error: z26.string().nullable(),
|
|
3465
|
+
executionTimeMs: z26.number().nullable(),
|
|
3466
|
+
checkpointId: z26.string().nullable(),
|
|
3467
|
+
sessionId: z26.string().nullable(),
|
|
3468
|
+
artifactName: z26.string().nullable(),
|
|
3469
|
+
artifactVersion: z26.string().nullable(),
|
|
3470
|
+
volumes: z26.record(z26.string(), z26.string()).optional()
|
|
3342
3471
|
});
|
|
3343
3472
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
3344
|
-
var createRunRequestSchema =
|
|
3473
|
+
var createRunRequestSchema = z26.object({
|
|
3345
3474
|
// Agent identification (one of: agent, agentId, sessionId, checkpointId)
|
|
3346
|
-
agent:
|
|
3475
|
+
agent: z26.string().optional(),
|
|
3347
3476
|
// Agent name
|
|
3348
|
-
agentId:
|
|
3477
|
+
agentId: z26.string().optional(),
|
|
3349
3478
|
// Agent ID
|
|
3350
|
-
agentVersion:
|
|
3479
|
+
agentVersion: z26.string().optional(),
|
|
3351
3480
|
// Version specifier (e.g., "latest", "v1", specific ID)
|
|
3352
3481
|
// Continue session
|
|
3353
|
-
sessionId:
|
|
3482
|
+
sessionId: z26.string().optional(),
|
|
3354
3483
|
// Resume from checkpoint
|
|
3355
|
-
checkpointId:
|
|
3484
|
+
checkpointId: z26.string().optional(),
|
|
3356
3485
|
// Required
|
|
3357
|
-
prompt:
|
|
3486
|
+
prompt: z26.string().min(1, "Prompt is required"),
|
|
3358
3487
|
// Optional configuration
|
|
3359
|
-
variables:
|
|
3360
|
-
secrets:
|
|
3361
|
-
artifactName:
|
|
3488
|
+
variables: z26.record(z26.string(), z26.string()).optional(),
|
|
3489
|
+
secrets: z26.record(z26.string(), z26.string()).optional(),
|
|
3490
|
+
artifactName: z26.string().optional(),
|
|
3362
3491
|
// Artifact name to mount
|
|
3363
|
-
artifactVersion:
|
|
3492
|
+
artifactVersion: z26.string().optional(),
|
|
3364
3493
|
// Artifact version (defaults to latest)
|
|
3365
|
-
volumes:
|
|
3494
|
+
volumes: z26.record(z26.string(), z26.string()).optional()
|
|
3366
3495
|
// volume_name -> version
|
|
3367
3496
|
});
|
|
3368
3497
|
var runListQuerySchema = listQuerySchema.extend({
|
|
3369
3498
|
status: publicRunStatusSchema.optional()
|
|
3370
3499
|
});
|
|
3371
|
-
var publicRunsListContract =
|
|
3500
|
+
var publicRunsListContract = c22.router({
|
|
3372
3501
|
list: {
|
|
3373
3502
|
method: "GET",
|
|
3374
3503
|
path: "/v1/runs",
|
|
@@ -3400,13 +3529,13 @@ var publicRunsListContract = c21.router({
|
|
|
3400
3529
|
description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
|
|
3401
3530
|
}
|
|
3402
3531
|
});
|
|
3403
|
-
var publicRunByIdContract =
|
|
3532
|
+
var publicRunByIdContract = c22.router({
|
|
3404
3533
|
get: {
|
|
3405
3534
|
method: "GET",
|
|
3406
3535
|
path: "/v1/runs/:id",
|
|
3407
3536
|
headers: authHeadersSchema,
|
|
3408
|
-
pathParams:
|
|
3409
|
-
id:
|
|
3537
|
+
pathParams: z26.object({
|
|
3538
|
+
id: z26.string().min(1, "Run ID is required")
|
|
3410
3539
|
}),
|
|
3411
3540
|
responses: {
|
|
3412
3541
|
200: publicRunDetailSchema,
|
|
@@ -3418,15 +3547,15 @@ var publicRunByIdContract = c21.router({
|
|
|
3418
3547
|
description: "Get run details by ID"
|
|
3419
3548
|
}
|
|
3420
3549
|
});
|
|
3421
|
-
var publicRunCancelContract =
|
|
3550
|
+
var publicRunCancelContract = c22.router({
|
|
3422
3551
|
cancel: {
|
|
3423
3552
|
method: "POST",
|
|
3424
3553
|
path: "/v1/runs/:id/cancel",
|
|
3425
3554
|
headers: authHeadersSchema,
|
|
3426
|
-
pathParams:
|
|
3427
|
-
id:
|
|
3555
|
+
pathParams: z26.object({
|
|
3556
|
+
id: z26.string().min(1, "Run ID is required")
|
|
3428
3557
|
}),
|
|
3429
|
-
body:
|
|
3558
|
+
body: z26.undefined(),
|
|
3430
3559
|
responses: {
|
|
3431
3560
|
200: publicRunDetailSchema,
|
|
3432
3561
|
400: publicApiErrorSchema,
|
|
@@ -3439,27 +3568,27 @@ var publicRunCancelContract = c21.router({
|
|
|
3439
3568
|
description: "Cancel a pending or running execution"
|
|
3440
3569
|
}
|
|
3441
3570
|
});
|
|
3442
|
-
var logEntrySchema =
|
|
3571
|
+
var logEntrySchema = z26.object({
|
|
3443
3572
|
timestamp: timestampSchema,
|
|
3444
|
-
type:
|
|
3445
|
-
level:
|
|
3446
|
-
message:
|
|
3447
|
-
metadata:
|
|
3573
|
+
type: z26.enum(["agent", "system", "network"]),
|
|
3574
|
+
level: z26.enum(["debug", "info", "warn", "error"]),
|
|
3575
|
+
message: z26.string(),
|
|
3576
|
+
metadata: z26.record(z26.string(), z26.unknown()).optional()
|
|
3448
3577
|
});
|
|
3449
3578
|
var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
|
|
3450
3579
|
var logsQuerySchema = listQuerySchema.extend({
|
|
3451
|
-
type:
|
|
3580
|
+
type: z26.enum(["agent", "system", "network", "all"]).default("all"),
|
|
3452
3581
|
since: timestampSchema.optional(),
|
|
3453
3582
|
until: timestampSchema.optional(),
|
|
3454
|
-
order:
|
|
3583
|
+
order: z26.enum(["asc", "desc"]).default("asc")
|
|
3455
3584
|
});
|
|
3456
|
-
var publicRunLogsContract =
|
|
3585
|
+
var publicRunLogsContract = c22.router({
|
|
3457
3586
|
getLogs: {
|
|
3458
3587
|
method: "GET",
|
|
3459
3588
|
path: "/v1/runs/:id/logs",
|
|
3460
3589
|
headers: authHeadersSchema,
|
|
3461
|
-
pathParams:
|
|
3462
|
-
id:
|
|
3590
|
+
pathParams: z26.object({
|
|
3591
|
+
id: z26.string().min(1, "Run ID is required")
|
|
3463
3592
|
}),
|
|
3464
3593
|
query: logsQuerySchema,
|
|
3465
3594
|
responses: {
|
|
@@ -3472,30 +3601,30 @@ var publicRunLogsContract = c21.router({
|
|
|
3472
3601
|
description: "Get unified logs for a run. Combines agent, system, and network logs."
|
|
3473
3602
|
}
|
|
3474
3603
|
});
|
|
3475
|
-
var metricPointSchema =
|
|
3604
|
+
var metricPointSchema = z26.object({
|
|
3476
3605
|
timestamp: timestampSchema,
|
|
3477
|
-
cpuPercent:
|
|
3478
|
-
memoryUsedMb:
|
|
3479
|
-
memoryTotalMb:
|
|
3480
|
-
diskUsedMb:
|
|
3481
|
-
diskTotalMb:
|
|
3482
|
-
});
|
|
3483
|
-
var metricsSummarySchema =
|
|
3484
|
-
avgCpuPercent:
|
|
3485
|
-
maxMemoryUsedMb:
|
|
3486
|
-
totalDurationMs:
|
|
3487
|
-
});
|
|
3488
|
-
var metricsResponseSchema2 =
|
|
3489
|
-
data:
|
|
3606
|
+
cpuPercent: z26.number(),
|
|
3607
|
+
memoryUsedMb: z26.number(),
|
|
3608
|
+
memoryTotalMb: z26.number(),
|
|
3609
|
+
diskUsedMb: z26.number(),
|
|
3610
|
+
diskTotalMb: z26.number()
|
|
3611
|
+
});
|
|
3612
|
+
var metricsSummarySchema = z26.object({
|
|
3613
|
+
avgCpuPercent: z26.number(),
|
|
3614
|
+
maxMemoryUsedMb: z26.number(),
|
|
3615
|
+
totalDurationMs: z26.number().nullable()
|
|
3616
|
+
});
|
|
3617
|
+
var metricsResponseSchema2 = z26.object({
|
|
3618
|
+
data: z26.array(metricPointSchema),
|
|
3490
3619
|
summary: metricsSummarySchema
|
|
3491
3620
|
});
|
|
3492
|
-
var publicRunMetricsContract =
|
|
3621
|
+
var publicRunMetricsContract = c22.router({
|
|
3493
3622
|
getMetrics: {
|
|
3494
3623
|
method: "GET",
|
|
3495
3624
|
path: "/v1/runs/:id/metrics",
|
|
3496
3625
|
headers: authHeadersSchema,
|
|
3497
|
-
pathParams:
|
|
3498
|
-
id:
|
|
3626
|
+
pathParams: z26.object({
|
|
3627
|
+
id: z26.string().min(1, "Run ID is required")
|
|
3499
3628
|
}),
|
|
3500
3629
|
responses: {
|
|
3501
3630
|
200: metricsResponseSchema2,
|
|
@@ -3507,7 +3636,7 @@ var publicRunMetricsContract = c21.router({
|
|
|
3507
3636
|
description: "Get CPU, memory, and disk metrics for a run"
|
|
3508
3637
|
}
|
|
3509
3638
|
});
|
|
3510
|
-
var sseEventTypeSchema =
|
|
3639
|
+
var sseEventTypeSchema = z26.enum([
|
|
3511
3640
|
"status",
|
|
3512
3641
|
// Run status change
|
|
3513
3642
|
"output",
|
|
@@ -3519,26 +3648,26 @@ var sseEventTypeSchema = z25.enum([
|
|
|
3519
3648
|
"heartbeat"
|
|
3520
3649
|
// Keep-alive
|
|
3521
3650
|
]);
|
|
3522
|
-
var sseEventSchema =
|
|
3651
|
+
var sseEventSchema = z26.object({
|
|
3523
3652
|
event: sseEventTypeSchema,
|
|
3524
|
-
data:
|
|
3525
|
-
id:
|
|
3653
|
+
data: z26.unknown(),
|
|
3654
|
+
id: z26.string().optional()
|
|
3526
3655
|
// For Last-Event-ID reconnection
|
|
3527
3656
|
});
|
|
3528
|
-
var publicRunEventsContract =
|
|
3657
|
+
var publicRunEventsContract = c22.router({
|
|
3529
3658
|
streamEvents: {
|
|
3530
3659
|
method: "GET",
|
|
3531
3660
|
path: "/v1/runs/:id/events",
|
|
3532
3661
|
headers: authHeadersSchema,
|
|
3533
|
-
pathParams:
|
|
3534
|
-
id:
|
|
3662
|
+
pathParams: z26.object({
|
|
3663
|
+
id: z26.string().min(1, "Run ID is required")
|
|
3535
3664
|
}),
|
|
3536
|
-
query:
|
|
3537
|
-
lastEventId:
|
|
3665
|
+
query: z26.object({
|
|
3666
|
+
lastEventId: z26.string().optional()
|
|
3538
3667
|
// For reconnection
|
|
3539
3668
|
}),
|
|
3540
3669
|
responses: {
|
|
3541
|
-
200:
|
|
3670
|
+
200: z26.any(),
|
|
3542
3671
|
// SSE stream - actual content is text/event-stream
|
|
3543
3672
|
401: publicApiErrorSchema,
|
|
3544
3673
|
404: publicApiErrorSchema,
|
|
@@ -3550,28 +3679,28 @@ var publicRunEventsContract = c21.router({
|
|
|
3550
3679
|
});
|
|
3551
3680
|
|
|
3552
3681
|
// ../../packages/core/src/contracts/public/artifacts.ts
|
|
3553
|
-
import { z as
|
|
3554
|
-
var
|
|
3555
|
-
var publicArtifactSchema =
|
|
3556
|
-
id:
|
|
3557
|
-
name:
|
|
3558
|
-
currentVersionId:
|
|
3559
|
-
size:
|
|
3682
|
+
import { z as z27 } from "zod";
|
|
3683
|
+
var c23 = initContract();
|
|
3684
|
+
var publicArtifactSchema = z27.object({
|
|
3685
|
+
id: z27.string(),
|
|
3686
|
+
name: z27.string(),
|
|
3687
|
+
currentVersionId: z27.string().nullable(),
|
|
3688
|
+
size: z27.number(),
|
|
3560
3689
|
// Total size in bytes
|
|
3561
|
-
fileCount:
|
|
3690
|
+
fileCount: z27.number(),
|
|
3562
3691
|
createdAt: timestampSchema,
|
|
3563
3692
|
updatedAt: timestampSchema
|
|
3564
3693
|
});
|
|
3565
|
-
var artifactVersionSchema =
|
|
3566
|
-
id:
|
|
3694
|
+
var artifactVersionSchema = z27.object({
|
|
3695
|
+
id: z27.string(),
|
|
3567
3696
|
// SHA-256 content hash
|
|
3568
|
-
artifactId:
|
|
3569
|
-
size:
|
|
3697
|
+
artifactId: z27.string(),
|
|
3698
|
+
size: z27.number(),
|
|
3570
3699
|
// Size in bytes
|
|
3571
|
-
fileCount:
|
|
3572
|
-
message:
|
|
3700
|
+
fileCount: z27.number(),
|
|
3701
|
+
message: z27.string().nullable(),
|
|
3573
3702
|
// Optional commit message
|
|
3574
|
-
createdBy:
|
|
3703
|
+
createdBy: z27.string(),
|
|
3575
3704
|
createdAt: timestampSchema
|
|
3576
3705
|
});
|
|
3577
3706
|
var publicArtifactDetailSchema = publicArtifactSchema.extend({
|
|
@@ -3581,7 +3710,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
3581
3710
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
3582
3711
|
artifactVersionSchema
|
|
3583
3712
|
);
|
|
3584
|
-
var publicArtifactsListContract =
|
|
3713
|
+
var publicArtifactsListContract = c23.router({
|
|
3585
3714
|
list: {
|
|
3586
3715
|
method: "GET",
|
|
3587
3716
|
path: "/v1/artifacts",
|
|
@@ -3596,13 +3725,13 @@ var publicArtifactsListContract = c22.router({
|
|
|
3596
3725
|
description: "List all artifacts in the current scope with pagination"
|
|
3597
3726
|
}
|
|
3598
3727
|
});
|
|
3599
|
-
var publicArtifactByIdContract =
|
|
3728
|
+
var publicArtifactByIdContract = c23.router({
|
|
3600
3729
|
get: {
|
|
3601
3730
|
method: "GET",
|
|
3602
3731
|
path: "/v1/artifacts/:id",
|
|
3603
3732
|
headers: authHeadersSchema,
|
|
3604
|
-
pathParams:
|
|
3605
|
-
id:
|
|
3733
|
+
pathParams: z27.object({
|
|
3734
|
+
id: z27.string().min(1, "Artifact ID is required")
|
|
3606
3735
|
}),
|
|
3607
3736
|
responses: {
|
|
3608
3737
|
200: publicArtifactDetailSchema,
|
|
@@ -3614,13 +3743,13 @@ var publicArtifactByIdContract = c22.router({
|
|
|
3614
3743
|
description: "Get artifact details by ID"
|
|
3615
3744
|
}
|
|
3616
3745
|
});
|
|
3617
|
-
var publicArtifactVersionsContract =
|
|
3746
|
+
var publicArtifactVersionsContract = c23.router({
|
|
3618
3747
|
list: {
|
|
3619
3748
|
method: "GET",
|
|
3620
3749
|
path: "/v1/artifacts/:id/versions",
|
|
3621
3750
|
headers: authHeadersSchema,
|
|
3622
|
-
pathParams:
|
|
3623
|
-
id:
|
|
3751
|
+
pathParams: z27.object({
|
|
3752
|
+
id: z27.string().min(1, "Artifact ID is required")
|
|
3624
3753
|
}),
|
|
3625
3754
|
query: listQuerySchema,
|
|
3626
3755
|
responses: {
|
|
@@ -3633,20 +3762,20 @@ var publicArtifactVersionsContract = c22.router({
|
|
|
3633
3762
|
description: "List all versions of an artifact with pagination"
|
|
3634
3763
|
}
|
|
3635
3764
|
});
|
|
3636
|
-
var publicArtifactDownloadContract =
|
|
3765
|
+
var publicArtifactDownloadContract = c23.router({
|
|
3637
3766
|
download: {
|
|
3638
3767
|
method: "GET",
|
|
3639
3768
|
path: "/v1/artifacts/:id/download",
|
|
3640
3769
|
headers: authHeadersSchema,
|
|
3641
|
-
pathParams:
|
|
3642
|
-
id:
|
|
3770
|
+
pathParams: z27.object({
|
|
3771
|
+
id: z27.string().min(1, "Artifact ID is required")
|
|
3643
3772
|
}),
|
|
3644
|
-
query:
|
|
3645
|
-
versionId:
|
|
3773
|
+
query: z27.object({
|
|
3774
|
+
versionId: z27.string().optional()
|
|
3646
3775
|
// Defaults to current version
|
|
3647
3776
|
}),
|
|
3648
3777
|
responses: {
|
|
3649
|
-
302:
|
|
3778
|
+
302: z27.undefined(),
|
|
3650
3779
|
// Redirect to presigned URL
|
|
3651
3780
|
401: publicApiErrorSchema,
|
|
3652
3781
|
404: publicApiErrorSchema,
|
|
@@ -3658,28 +3787,28 @@ var publicArtifactDownloadContract = c22.router({
|
|
|
3658
3787
|
});
|
|
3659
3788
|
|
|
3660
3789
|
// ../../packages/core/src/contracts/public/volumes.ts
|
|
3661
|
-
import { z as
|
|
3662
|
-
var
|
|
3663
|
-
var publicVolumeSchema =
|
|
3664
|
-
id:
|
|
3665
|
-
name:
|
|
3666
|
-
currentVersionId:
|
|
3667
|
-
size:
|
|
3790
|
+
import { z as z28 } from "zod";
|
|
3791
|
+
var c24 = initContract();
|
|
3792
|
+
var publicVolumeSchema = z28.object({
|
|
3793
|
+
id: z28.string(),
|
|
3794
|
+
name: z28.string(),
|
|
3795
|
+
currentVersionId: z28.string().nullable(),
|
|
3796
|
+
size: z28.number(),
|
|
3668
3797
|
// Total size in bytes
|
|
3669
|
-
fileCount:
|
|
3798
|
+
fileCount: z28.number(),
|
|
3670
3799
|
createdAt: timestampSchema,
|
|
3671
3800
|
updatedAt: timestampSchema
|
|
3672
3801
|
});
|
|
3673
|
-
var volumeVersionSchema =
|
|
3674
|
-
id:
|
|
3802
|
+
var volumeVersionSchema = z28.object({
|
|
3803
|
+
id: z28.string(),
|
|
3675
3804
|
// SHA-256 content hash
|
|
3676
|
-
volumeId:
|
|
3677
|
-
size:
|
|
3805
|
+
volumeId: z28.string(),
|
|
3806
|
+
size: z28.number(),
|
|
3678
3807
|
// Size in bytes
|
|
3679
|
-
fileCount:
|
|
3680
|
-
message:
|
|
3808
|
+
fileCount: z28.number(),
|
|
3809
|
+
message: z28.string().nullable(),
|
|
3681
3810
|
// Optional commit message
|
|
3682
|
-
createdBy:
|
|
3811
|
+
createdBy: z28.string(),
|
|
3683
3812
|
createdAt: timestampSchema
|
|
3684
3813
|
});
|
|
3685
3814
|
var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
@@ -3687,7 +3816,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
3687
3816
|
});
|
|
3688
3817
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
3689
3818
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
3690
|
-
var publicVolumesListContract =
|
|
3819
|
+
var publicVolumesListContract = c24.router({
|
|
3691
3820
|
list: {
|
|
3692
3821
|
method: "GET",
|
|
3693
3822
|
path: "/v1/volumes",
|
|
@@ -3702,13 +3831,13 @@ var publicVolumesListContract = c23.router({
|
|
|
3702
3831
|
description: "List all volumes in the current scope with pagination"
|
|
3703
3832
|
}
|
|
3704
3833
|
});
|
|
3705
|
-
var publicVolumeByIdContract =
|
|
3834
|
+
var publicVolumeByIdContract = c24.router({
|
|
3706
3835
|
get: {
|
|
3707
3836
|
method: "GET",
|
|
3708
3837
|
path: "/v1/volumes/:id",
|
|
3709
3838
|
headers: authHeadersSchema,
|
|
3710
|
-
pathParams:
|
|
3711
|
-
id:
|
|
3839
|
+
pathParams: z28.object({
|
|
3840
|
+
id: z28.string().min(1, "Volume ID is required")
|
|
3712
3841
|
}),
|
|
3713
3842
|
responses: {
|
|
3714
3843
|
200: publicVolumeDetailSchema,
|
|
@@ -3720,13 +3849,13 @@ var publicVolumeByIdContract = c23.router({
|
|
|
3720
3849
|
description: "Get volume details by ID"
|
|
3721
3850
|
}
|
|
3722
3851
|
});
|
|
3723
|
-
var publicVolumeVersionsContract =
|
|
3852
|
+
var publicVolumeVersionsContract = c24.router({
|
|
3724
3853
|
list: {
|
|
3725
3854
|
method: "GET",
|
|
3726
3855
|
path: "/v1/volumes/:id/versions",
|
|
3727
3856
|
headers: authHeadersSchema,
|
|
3728
|
-
pathParams:
|
|
3729
|
-
id:
|
|
3857
|
+
pathParams: z28.object({
|
|
3858
|
+
id: z28.string().min(1, "Volume ID is required")
|
|
3730
3859
|
}),
|
|
3731
3860
|
query: listQuerySchema,
|
|
3732
3861
|
responses: {
|
|
@@ -3739,20 +3868,20 @@ var publicVolumeVersionsContract = c23.router({
|
|
|
3739
3868
|
description: "List all versions of a volume with pagination"
|
|
3740
3869
|
}
|
|
3741
3870
|
});
|
|
3742
|
-
var publicVolumeDownloadContract =
|
|
3871
|
+
var publicVolumeDownloadContract = c24.router({
|
|
3743
3872
|
download: {
|
|
3744
3873
|
method: "GET",
|
|
3745
3874
|
path: "/v1/volumes/:id/download",
|
|
3746
3875
|
headers: authHeadersSchema,
|
|
3747
|
-
pathParams:
|
|
3748
|
-
id:
|
|
3876
|
+
pathParams: z28.object({
|
|
3877
|
+
id: z28.string().min(1, "Volume ID is required")
|
|
3749
3878
|
}),
|
|
3750
|
-
query:
|
|
3751
|
-
versionId:
|
|
3879
|
+
query: z28.object({
|
|
3880
|
+
versionId: z28.string().optional()
|
|
3752
3881
|
// Defaults to current version
|
|
3753
3882
|
}),
|
|
3754
3883
|
responses: {
|
|
3755
|
-
302:
|
|
3884
|
+
302: z28.undefined(),
|
|
3756
3885
|
// Redirect to presigned URL
|
|
3757
3886
|
401: publicApiErrorSchema,
|
|
3758
3887
|
404: publicApiErrorSchema,
|
|
@@ -4470,8 +4599,8 @@ async function getUsage(options) {
|
|
|
4470
4599
|
}
|
|
4471
4600
|
|
|
4472
4601
|
// src/lib/domain/yaml-validator.ts
|
|
4473
|
-
import { z as
|
|
4474
|
-
var cliAgentNameSchema =
|
|
4602
|
+
import { z as z29 } from "zod";
|
|
4603
|
+
var cliAgentNameSchema = z29.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
4475
4604
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
4476
4605
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
4477
4606
|
);
|
|
@@ -4486,7 +4615,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
4486
4615
|
const skillUrl = agent.skills[i];
|
|
4487
4616
|
if (skillUrl && !validateGitHubTreeUrl(skillUrl)) {
|
|
4488
4617
|
ctx.addIssue({
|
|
4489
|
-
code:
|
|
4618
|
+
code: z29.ZodIssueCode.custom,
|
|
4490
4619
|
message: `Invalid skill URL: ${skillUrl}. Expected format: https://github.com/{owner}/{repo}/tree/{branch}/{path}`,
|
|
4491
4620
|
path: ["skills", i]
|
|
4492
4621
|
});
|
|
@@ -4495,15 +4624,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
4495
4624
|
}
|
|
4496
4625
|
}
|
|
4497
4626
|
);
|
|
4498
|
-
var cliComposeSchema =
|
|
4499
|
-
version:
|
|
4500
|
-
agents:
|
|
4501
|
-
volumes:
|
|
4627
|
+
var cliComposeSchema = z29.object({
|
|
4628
|
+
version: z29.string().min(1, "Missing config.version"),
|
|
4629
|
+
agents: z29.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
4630
|
+
volumes: z29.record(z29.string(), volumeConfigSchema).optional()
|
|
4502
4631
|
}).superRefine((config, ctx) => {
|
|
4503
4632
|
const agentKeys = Object.keys(config.agents);
|
|
4504
4633
|
if (agentKeys.length === 0) {
|
|
4505
4634
|
ctx.addIssue({
|
|
4506
|
-
code:
|
|
4635
|
+
code: z29.ZodIssueCode.custom,
|
|
4507
4636
|
message: "agents must have at least one agent defined",
|
|
4508
4637
|
path: ["agents"]
|
|
4509
4638
|
});
|
|
@@ -4511,7 +4640,7 @@ var cliComposeSchema = z28.object({
|
|
|
4511
4640
|
}
|
|
4512
4641
|
if (agentKeys.length > 1) {
|
|
4513
4642
|
ctx.addIssue({
|
|
4514
|
-
code:
|
|
4643
|
+
code: z29.ZodIssueCode.custom,
|
|
4515
4644
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
4516
4645
|
path: ["agents"]
|
|
4517
4646
|
});
|
|
@@ -4523,7 +4652,7 @@ var cliComposeSchema = z28.object({
|
|
|
4523
4652
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
4524
4653
|
if (!config.volumes) {
|
|
4525
4654
|
ctx.addIssue({
|
|
4526
|
-
code:
|
|
4655
|
+
code: z29.ZodIssueCode.custom,
|
|
4527
4656
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
4528
4657
|
path: ["volumes"]
|
|
4529
4658
|
});
|
|
@@ -4533,7 +4662,7 @@ var cliComposeSchema = z28.object({
|
|
|
4533
4662
|
const parts = volDeclaration.split(":");
|
|
4534
4663
|
if (parts.length !== 2) {
|
|
4535
4664
|
ctx.addIssue({
|
|
4536
|
-
code:
|
|
4665
|
+
code: z29.ZodIssueCode.custom,
|
|
4537
4666
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
4538
4667
|
path: ["agents", agentName, "volumes"]
|
|
4539
4668
|
});
|
|
@@ -4542,7 +4671,7 @@ var cliComposeSchema = z28.object({
|
|
|
4542
4671
|
const volumeKey = parts[0].trim();
|
|
4543
4672
|
if (!config.volumes[volumeKey]) {
|
|
4544
4673
|
ctx.addIssue({
|
|
4545
|
-
code:
|
|
4674
|
+
code: z29.ZodIssueCode.custom,
|
|
4546
4675
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
4547
4676
|
path: ["volumes", volumeKey]
|
|
4548
4677
|
});
|
|
@@ -5711,7 +5840,7 @@ async function finalizeCompose(config, agent, variables, options) {
|
|
|
5711
5840
|
);
|
|
5712
5841
|
}
|
|
5713
5842
|
if (options.autoUpdate !== false) {
|
|
5714
|
-
await silentUpgradeAfterCommand("9.
|
|
5843
|
+
await silentUpgradeAfterCommand("9.24.0");
|
|
5715
5844
|
}
|
|
5716
5845
|
return result;
|
|
5717
5846
|
}
|
|
@@ -6648,9 +6777,9 @@ var CodexEventParser = class {
|
|
|
6648
6777
|
}
|
|
6649
6778
|
}
|
|
6650
6779
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
6651
|
-
const changes = item.changes.map((
|
|
6652
|
-
const action =
|
|
6653
|
-
return `${action}: ${
|
|
6780
|
+
const changes = item.changes.map((c25) => {
|
|
6781
|
+
const action = c25.kind === "add" ? "Created" : c25.kind === "modify" ? "Modified" : "Deleted";
|
|
6782
|
+
return `${action}: ${c25.path}`;
|
|
6654
6783
|
}).join("\n");
|
|
6655
6784
|
return {
|
|
6656
6785
|
type: "text",
|
|
@@ -6804,9 +6933,9 @@ var CodexEventRenderer = class {
|
|
|
6804
6933
|
return;
|
|
6805
6934
|
}
|
|
6806
6935
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
6807
|
-
const summary = item.changes.map((
|
|
6808
|
-
const icon =
|
|
6809
|
-
return `${icon}${
|
|
6936
|
+
const summary = item.changes.map((c25) => {
|
|
6937
|
+
const icon = c25.kind === "add" ? "+" : c25.kind === "delete" ? "-" : "~";
|
|
6938
|
+
return `${icon}${c25.path}`;
|
|
6810
6939
|
}).join(", ");
|
|
6811
6940
|
console.log(chalk7.green("[files]") + ` ${summary}`);
|
|
6812
6941
|
return;
|
|
@@ -8153,7 +8282,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
8153
8282
|
}
|
|
8154
8283
|
showNextSteps(result);
|
|
8155
8284
|
if (options.autoUpdate !== false) {
|
|
8156
|
-
await silentUpgradeAfterCommand("9.
|
|
8285
|
+
await silentUpgradeAfterCommand("9.24.0");
|
|
8157
8286
|
}
|
|
8158
8287
|
} catch (error) {
|
|
8159
8288
|
handleRunError(error, identifier);
|
|
@@ -9660,7 +9789,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
|
|
|
9660
9789
|
).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(
|
|
9661
9790
|
async (prompt, options) => {
|
|
9662
9791
|
if (options.autoUpdate !== false) {
|
|
9663
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
9792
|
+
const shouldExit = await checkAndUpgrade("9.24.0", prompt);
|
|
9664
9793
|
if (shouldExit) {
|
|
9665
9794
|
process.exit(0);
|
|
9666
9795
|
}
|
|
@@ -10375,7 +10504,7 @@ var listCommand4 = new Command36().name("list").alias("ls").description("List al
|
|
|
10375
10504
|
);
|
|
10376
10505
|
return;
|
|
10377
10506
|
}
|
|
10378
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
10507
|
+
const nameWidth = Math.max(4, ...data.composes.map((c25) => c25.name.length));
|
|
10379
10508
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
10380
10509
|
" "
|
|
10381
10510
|
);
|
|
@@ -11349,7 +11478,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
11349
11478
|
);
|
|
11350
11479
|
process.exit(1);
|
|
11351
11480
|
}
|
|
11352
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
11481
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c25) => c25.value === existingFrequency) : 0;
|
|
11353
11482
|
frequency = await promptSelect(
|
|
11354
11483
|
"Schedule frequency",
|
|
11355
11484
|
FREQUENCY_CHOICES,
|
|
@@ -11378,7 +11507,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
11378
11507
|
process.exit(1);
|
|
11379
11508
|
}
|
|
11380
11509
|
if (frequency === "weekly") {
|
|
11381
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
11510
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c25) => c25.value === existingDay) : 0;
|
|
11382
11511
|
const day2 = await promptSelect(
|
|
11383
11512
|
"Day of week",
|
|
11384
11513
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -13137,26 +13266,145 @@ var setDefaultCommand = new Command64().name("set-default").description("Set a m
|
|
|
13137
13266
|
// src/commands/model-provider/index.ts
|
|
13138
13267
|
var modelProviderCommand = new Command65().name("model-provider").description("Manage model providers for agent runs").addCommand(listCommand8).addCommand(setupCommand2).addCommand(deleteCommand4).addCommand(setDefaultCommand);
|
|
13139
13268
|
|
|
13140
|
-
// src/commands/
|
|
13269
|
+
// src/commands/connector/index.ts
|
|
13270
|
+
import { Command as Command67 } from "commander";
|
|
13271
|
+
|
|
13272
|
+
// src/commands/connector/connect.ts
|
|
13141
13273
|
import { Command as Command66 } from "commander";
|
|
13142
|
-
import
|
|
13274
|
+
import chalk63 from "chalk";
|
|
13275
|
+
import { initClient as initClient11 } from "@ts-rest/core";
|
|
13276
|
+
function delay2(ms) {
|
|
13277
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13278
|
+
}
|
|
13279
|
+
async function getHeaders2() {
|
|
13280
|
+
const token = await getToken();
|
|
13281
|
+
if (!token) {
|
|
13282
|
+
throw new Error("Not authenticated. Run: vm0 auth login");
|
|
13283
|
+
}
|
|
13284
|
+
const headers = {
|
|
13285
|
+
Authorization: `Bearer ${token}`
|
|
13286
|
+
};
|
|
13287
|
+
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
13288
|
+
if (bypassSecret) {
|
|
13289
|
+
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
13290
|
+
}
|
|
13291
|
+
return headers;
|
|
13292
|
+
}
|
|
13293
|
+
var connectCommand = new Command66().name("connect").description("Connect a third-party service (e.g., GitHub)").argument("<type>", "Connector type (e.g., github)").action(async (type) => {
|
|
13294
|
+
const parseResult = connectorTypeSchema.safeParse(type);
|
|
13295
|
+
if (!parseResult.success) {
|
|
13296
|
+
console.error(chalk63.red(`Unknown connector type: ${type}`));
|
|
13297
|
+
console.error("Available connectors: github");
|
|
13298
|
+
process.exit(1);
|
|
13299
|
+
}
|
|
13300
|
+
const connectorType = parseResult.data;
|
|
13301
|
+
const apiUrl = await getApiUrl();
|
|
13302
|
+
const headers = await getHeaders2();
|
|
13303
|
+
console.log(`Connecting ${chalk63.cyan(type)}...`);
|
|
13304
|
+
const sessionsClient = initClient11(connectorSessionsContract, {
|
|
13305
|
+
baseUrl: apiUrl,
|
|
13306
|
+
baseHeaders: headers,
|
|
13307
|
+
jsonQuery: true
|
|
13308
|
+
});
|
|
13309
|
+
const createResult = await sessionsClient.create({
|
|
13310
|
+
params: { type: connectorType },
|
|
13311
|
+
body: {}
|
|
13312
|
+
});
|
|
13313
|
+
if (createResult.status !== 200) {
|
|
13314
|
+
const errorBody = createResult.body;
|
|
13315
|
+
console.error(
|
|
13316
|
+
chalk63.red(`Failed to create session: ${errorBody.error?.message}`)
|
|
13317
|
+
);
|
|
13318
|
+
process.exit(1);
|
|
13319
|
+
}
|
|
13320
|
+
const session = createResult.body;
|
|
13321
|
+
const verificationUrl = `${apiUrl}${session.verificationUrl}`;
|
|
13322
|
+
console.log(chalk63.green("\nSession created"));
|
|
13323
|
+
console.log(chalk63.cyan(`
|
|
13324
|
+
To connect, visit: ${verificationUrl}`));
|
|
13325
|
+
console.log(`Session code: ${chalk63.bold(session.code)}`);
|
|
13326
|
+
console.log(
|
|
13327
|
+
`
|
|
13328
|
+
The session expires in ${Math.floor(session.expiresIn / 60)} minutes.`
|
|
13329
|
+
);
|
|
13330
|
+
console.log("\nWaiting for authorization...");
|
|
13331
|
+
const sessionClient = initClient11(connectorSessionByIdContract, {
|
|
13332
|
+
baseUrl: apiUrl,
|
|
13333
|
+
baseHeaders: headers,
|
|
13334
|
+
jsonQuery: true
|
|
13335
|
+
});
|
|
13336
|
+
const startTime = Date.now();
|
|
13337
|
+
const maxWaitTime = session.expiresIn * 1e3;
|
|
13338
|
+
const pollInterval = (session.interval || 5) * 1e3;
|
|
13339
|
+
let isFirstPoll = true;
|
|
13340
|
+
while (Date.now() - startTime < maxWaitTime) {
|
|
13341
|
+
if (!isFirstPoll) {
|
|
13342
|
+
await delay2(pollInterval);
|
|
13343
|
+
}
|
|
13344
|
+
isFirstPoll = false;
|
|
13345
|
+
const statusResult = await sessionClient.get({
|
|
13346
|
+
params: { type: connectorType, sessionId: session.id }
|
|
13347
|
+
});
|
|
13348
|
+
if (statusResult.status !== 200) {
|
|
13349
|
+
const errorBody = statusResult.body;
|
|
13350
|
+
console.error(
|
|
13351
|
+
chalk63.red(`
|
|
13352
|
+
Failed to check status: ${errorBody.error?.message}`)
|
|
13353
|
+
);
|
|
13354
|
+
process.exit(1);
|
|
13355
|
+
}
|
|
13356
|
+
const status = statusResult.body;
|
|
13357
|
+
switch (status.status) {
|
|
13358
|
+
case "complete":
|
|
13359
|
+
console.log(chalk63.green(`
|
|
13360
|
+
|
|
13361
|
+
${type} connected successfully!`));
|
|
13362
|
+
return;
|
|
13363
|
+
case "expired":
|
|
13364
|
+
console.log(chalk63.red("\nSession expired. Please try again."));
|
|
13365
|
+
process.exit(1);
|
|
13366
|
+
break;
|
|
13367
|
+
case "error":
|
|
13368
|
+
console.log(
|
|
13369
|
+
chalk63.red(
|
|
13370
|
+
`
|
|
13371
|
+
Connection failed: ${status.errorMessage || "Unknown error"}`
|
|
13372
|
+
)
|
|
13373
|
+
);
|
|
13374
|
+
process.exit(1);
|
|
13375
|
+
break;
|
|
13376
|
+
case "pending":
|
|
13377
|
+
process.stdout.write(chalk63.dim("."));
|
|
13378
|
+
break;
|
|
13379
|
+
}
|
|
13380
|
+
}
|
|
13381
|
+
console.log(chalk63.red("\nSession timed out. Please try again."));
|
|
13382
|
+
process.exit(1);
|
|
13383
|
+
});
|
|
13384
|
+
|
|
13385
|
+
// src/commands/connector/index.ts
|
|
13386
|
+
var connectorCommand = new Command67().name("connector").description("Manage third-party service connections").addCommand(connectCommand);
|
|
13387
|
+
|
|
13388
|
+
// src/commands/onboard/index.ts
|
|
13389
|
+
import { Command as Command68 } from "commander";
|
|
13390
|
+
import chalk67 from "chalk";
|
|
13143
13391
|
import { mkdir as mkdir8 } from "fs/promises";
|
|
13144
13392
|
import { existsSync as existsSync11 } from "fs";
|
|
13145
13393
|
|
|
13146
13394
|
// src/lib/ui/welcome-box.ts
|
|
13147
|
-
import
|
|
13395
|
+
import chalk64 from "chalk";
|
|
13148
13396
|
var gradientColors = [
|
|
13149
|
-
|
|
13397
|
+
chalk64.hex("#FFAB5E"),
|
|
13150
13398
|
// Line 1 - lightest
|
|
13151
|
-
|
|
13399
|
+
chalk64.hex("#FF9642"),
|
|
13152
13400
|
// Line 2
|
|
13153
|
-
|
|
13401
|
+
chalk64.hex("#FF8228"),
|
|
13154
13402
|
// Line 3
|
|
13155
|
-
|
|
13403
|
+
chalk64.hex("#FF6D0A"),
|
|
13156
13404
|
// Line 4
|
|
13157
|
-
|
|
13405
|
+
chalk64.hex("#E85D00"),
|
|
13158
13406
|
// Line 5
|
|
13159
|
-
|
|
13407
|
+
chalk64.hex("#CC4E00")
|
|
13160
13408
|
// Line 6 - darkest
|
|
13161
13409
|
];
|
|
13162
13410
|
var vm0LogoLines = [
|
|
@@ -13178,15 +13426,15 @@ function renderVm0Banner() {
|
|
|
13178
13426
|
function renderOnboardWelcome() {
|
|
13179
13427
|
renderVm0Banner();
|
|
13180
13428
|
console.log(` Build agentic workflows using natural language.`);
|
|
13181
|
-
console.log(` ${
|
|
13429
|
+
console.log(` ${chalk64.dim("Currently in beta, enjoy it free.")}`);
|
|
13182
13430
|
console.log(
|
|
13183
|
-
` ${
|
|
13431
|
+
` ${chalk64.dim("Star us on GitHub: https://github.com/vm0-ai/vm0")}`
|
|
13184
13432
|
);
|
|
13185
13433
|
console.log();
|
|
13186
13434
|
}
|
|
13187
13435
|
|
|
13188
13436
|
// src/lib/ui/step-runner.ts
|
|
13189
|
-
import
|
|
13437
|
+
import chalk65 from "chalk";
|
|
13190
13438
|
function createStepRunner(options = true) {
|
|
13191
13439
|
const opts = typeof options === "boolean" ? { interactive: options } : options;
|
|
13192
13440
|
const interactive = opts.interactive ?? true;
|
|
@@ -13201,25 +13449,25 @@ function createStepRunner(options = true) {
|
|
|
13201
13449
|
}
|
|
13202
13450
|
for (const [i, step] of completedSteps.entries()) {
|
|
13203
13451
|
if (step.failed) {
|
|
13204
|
-
console.log(
|
|
13452
|
+
console.log(chalk65.red(`\u2717 ${step.label}`));
|
|
13205
13453
|
} else {
|
|
13206
|
-
console.log(
|
|
13454
|
+
console.log(chalk65.green(`\u25CF ${step.label}`));
|
|
13207
13455
|
}
|
|
13208
13456
|
const isLastStep = i === completedSteps.length - 1;
|
|
13209
13457
|
if (!isLastStep || !isFinal) {
|
|
13210
|
-
console.log(
|
|
13458
|
+
console.log(chalk65.dim("\u2502"));
|
|
13211
13459
|
}
|
|
13212
13460
|
}
|
|
13213
13461
|
}
|
|
13214
13462
|
async function executeStep(label, fn, isFinal) {
|
|
13215
13463
|
let stepFailed = false;
|
|
13216
|
-
console.log(
|
|
13464
|
+
console.log(chalk65.yellow(`\u25CB ${label}`));
|
|
13217
13465
|
const ctx = {
|
|
13218
13466
|
connector() {
|
|
13219
|
-
console.log(
|
|
13467
|
+
console.log(chalk65.dim("\u2502"));
|
|
13220
13468
|
},
|
|
13221
13469
|
detail(message) {
|
|
13222
|
-
console.log(`${
|
|
13470
|
+
console.log(`${chalk65.dim("\u2502")} ${message}`);
|
|
13223
13471
|
},
|
|
13224
13472
|
async prompt(promptFn) {
|
|
13225
13473
|
return await promptFn();
|
|
@@ -13236,12 +13484,12 @@ function createStepRunner(options = true) {
|
|
|
13236
13484
|
redrawCompletedSteps(isFinal);
|
|
13237
13485
|
} else {
|
|
13238
13486
|
if (stepFailed) {
|
|
13239
|
-
console.log(
|
|
13487
|
+
console.log(chalk65.red(`\u2717 ${label}`));
|
|
13240
13488
|
} else {
|
|
13241
|
-
console.log(
|
|
13489
|
+
console.log(chalk65.green(`\u25CF ${label}`));
|
|
13242
13490
|
}
|
|
13243
13491
|
if (!isFinal) {
|
|
13244
|
-
console.log(
|
|
13492
|
+
console.log(chalk65.dim("\u2502"));
|
|
13245
13493
|
}
|
|
13246
13494
|
}
|
|
13247
13495
|
}
|
|
@@ -13286,7 +13534,7 @@ async function exchangeToken2(apiUrl, deviceCode) {
|
|
|
13286
13534
|
});
|
|
13287
13535
|
return response.json();
|
|
13288
13536
|
}
|
|
13289
|
-
function
|
|
13537
|
+
function delay3(ms) {
|
|
13290
13538
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13291
13539
|
}
|
|
13292
13540
|
async function isAuthenticated() {
|
|
@@ -13317,7 +13565,7 @@ async function pollForToken(apiUrl, deviceAuth, callbacks) {
|
|
|
13317
13565
|
let isFirstPoll = true;
|
|
13318
13566
|
while (Date.now() - startTime < maxWaitTime) {
|
|
13319
13567
|
if (!isFirstPoll) {
|
|
13320
|
-
await
|
|
13568
|
+
await delay3(pollInterval);
|
|
13321
13569
|
}
|
|
13322
13570
|
isFirstPoll = false;
|
|
13323
13571
|
const tokenResult = await exchangeToken2(apiUrl, deviceAuth.device_code);
|
|
@@ -13398,7 +13646,7 @@ async function setupModelProvider(type, secret, options) {
|
|
|
13398
13646
|
|
|
13399
13647
|
// src/lib/domain/onboard/claude-setup.ts
|
|
13400
13648
|
import { spawn as spawn3 } from "child_process";
|
|
13401
|
-
import
|
|
13649
|
+
import chalk66 from "chalk";
|
|
13402
13650
|
var MARKETPLACE_NAME = "vm0-skills";
|
|
13403
13651
|
var MARKETPLACE_REPO = "vm0-ai/vm0-skills";
|
|
13404
13652
|
var PLUGIN_ID = "vm0@vm0-skills";
|
|
@@ -13435,12 +13683,12 @@ async function runClaudeCommand(args, cwd) {
|
|
|
13435
13683
|
}
|
|
13436
13684
|
function handlePluginError(error, context) {
|
|
13437
13685
|
const displayContext = context ?? "Claude plugin";
|
|
13438
|
-
console.error(
|
|
13686
|
+
console.error(chalk66.red(`Failed to install ${displayContext}`));
|
|
13439
13687
|
if (error instanceof Error) {
|
|
13440
|
-
console.error(
|
|
13688
|
+
console.error(chalk66.red(error.message));
|
|
13441
13689
|
}
|
|
13442
13690
|
console.error(
|
|
13443
|
-
|
|
13691
|
+
chalk66.dim("Please ensure Claude CLI is installed and accessible.")
|
|
13444
13692
|
);
|
|
13445
13693
|
process.exit(1);
|
|
13446
13694
|
}
|
|
@@ -13483,7 +13731,7 @@ async function updateMarketplace() {
|
|
|
13483
13731
|
]);
|
|
13484
13732
|
if (!result.success) {
|
|
13485
13733
|
console.warn(
|
|
13486
|
-
|
|
13734
|
+
chalk66.yellow(
|
|
13487
13735
|
`Warning: Could not update marketplace: ${result.error ?? "unknown error"}`
|
|
13488
13736
|
)
|
|
13489
13737
|
);
|
|
@@ -13521,7 +13769,7 @@ async function handleAuthentication(ctx) {
|
|
|
13521
13769
|
return;
|
|
13522
13770
|
}
|
|
13523
13771
|
if (!ctx.interactive) {
|
|
13524
|
-
console.error(
|
|
13772
|
+
console.error(chalk67.red("Error: Not authenticated"));
|
|
13525
13773
|
console.error("Run 'vm0 auth login' first or set VM0_TOKEN");
|
|
13526
13774
|
process.exit(1);
|
|
13527
13775
|
}
|
|
@@ -13529,16 +13777,16 @@ async function handleAuthentication(ctx) {
|
|
|
13529
13777
|
onInitiating: () => {
|
|
13530
13778
|
},
|
|
13531
13779
|
onDeviceCodeReady: (url, code, expiresIn) => {
|
|
13532
|
-
step.detail(`Copy code: ${
|
|
13533
|
-
step.detail(`Open: ${
|
|
13534
|
-
step.detail(
|
|
13780
|
+
step.detail(`Copy code: ${chalk67.cyan.bold(code)}`);
|
|
13781
|
+
step.detail(`Open: ${chalk67.cyan(url)}`);
|
|
13782
|
+
step.detail(chalk67.dim(`Expires in ${expiresIn} minutes`));
|
|
13535
13783
|
},
|
|
13536
13784
|
onPolling: () => {
|
|
13537
13785
|
},
|
|
13538
13786
|
onSuccess: () => {
|
|
13539
13787
|
},
|
|
13540
13788
|
onError: (error) => {
|
|
13541
|
-
console.error(
|
|
13789
|
+
console.error(chalk67.red(`
|
|
13542
13790
|
${error.message}`));
|
|
13543
13791
|
process.exit(1);
|
|
13544
13792
|
}
|
|
@@ -13552,7 +13800,7 @@ async function handleModelProvider(ctx) {
|
|
|
13552
13800
|
return;
|
|
13553
13801
|
}
|
|
13554
13802
|
if (!ctx.interactive) {
|
|
13555
|
-
console.error(
|
|
13803
|
+
console.error(chalk67.red("Error: No model provider configured"));
|
|
13556
13804
|
console.error("Run 'vm0 model-provider setup' first");
|
|
13557
13805
|
process.exit(1);
|
|
13558
13806
|
}
|
|
@@ -13561,26 +13809,26 @@ async function handleModelProvider(ctx) {
|
|
|
13561
13809
|
const providerType = await step.prompt(
|
|
13562
13810
|
() => promptSelect(
|
|
13563
13811
|
"Select provider type:",
|
|
13564
|
-
choices.map((
|
|
13565
|
-
title:
|
|
13566
|
-
value:
|
|
13812
|
+
choices.map((c25) => ({
|
|
13813
|
+
title: c25.label,
|
|
13814
|
+
value: c25.type
|
|
13567
13815
|
}))
|
|
13568
13816
|
)
|
|
13569
13817
|
);
|
|
13570
13818
|
if (!providerType) {
|
|
13571
13819
|
process.exit(0);
|
|
13572
13820
|
}
|
|
13573
|
-
const selectedChoice = choices.find((
|
|
13821
|
+
const selectedChoice = choices.find((c25) => c25.type === providerType);
|
|
13574
13822
|
if (selectedChoice?.helpText) {
|
|
13575
13823
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
13576
|
-
step.detail(
|
|
13824
|
+
step.detail(chalk67.dim(line));
|
|
13577
13825
|
}
|
|
13578
13826
|
}
|
|
13579
13827
|
const secret = await step.prompt(
|
|
13580
13828
|
() => promptPassword(`Enter your ${selectedChoice?.secretLabel ?? "secret"}:`)
|
|
13581
13829
|
);
|
|
13582
13830
|
if (!secret) {
|
|
13583
|
-
console.log(
|
|
13831
|
+
console.log(chalk67.dim("Cancelled"));
|
|
13584
13832
|
process.exit(0);
|
|
13585
13833
|
}
|
|
13586
13834
|
let selectedModel;
|
|
@@ -13599,7 +13847,7 @@ async function handleModelProvider(ctx) {
|
|
|
13599
13847
|
() => promptSelect("Select model:", modelChoices)
|
|
13600
13848
|
);
|
|
13601
13849
|
if (modelSelection === void 0) {
|
|
13602
|
-
console.log(
|
|
13850
|
+
console.log(chalk67.dim("Cancelled"));
|
|
13603
13851
|
process.exit(0);
|
|
13604
13852
|
}
|
|
13605
13853
|
selectedModel = modelSelection === "" ? void 0 : modelSelection;
|
|
@@ -13609,7 +13857,7 @@ async function handleModelProvider(ctx) {
|
|
|
13609
13857
|
});
|
|
13610
13858
|
const modelNote = result.provider.selectedModel ? ` with model: ${result.provider.selectedModel}` : "";
|
|
13611
13859
|
step.detail(
|
|
13612
|
-
|
|
13860
|
+
chalk67.green(
|
|
13613
13861
|
`${providerType} ${result.created ? "created" : "updated"}${result.isDefault ? ` (default for ${result.framework})` : ""}${modelNote}`
|
|
13614
13862
|
)
|
|
13615
13863
|
);
|
|
@@ -13640,7 +13888,7 @@ async function handleAgentCreation(ctx) {
|
|
|
13640
13888
|
agentName = inputName;
|
|
13641
13889
|
if (existsSync11(agentName)) {
|
|
13642
13890
|
step.detail(
|
|
13643
|
-
|
|
13891
|
+
chalk67.yellow(`${agentName}/ already exists, choose another name`)
|
|
13644
13892
|
);
|
|
13645
13893
|
} else {
|
|
13646
13894
|
folderExists = false;
|
|
@@ -13649,22 +13897,22 @@ async function handleAgentCreation(ctx) {
|
|
|
13649
13897
|
} else {
|
|
13650
13898
|
if (!validateAgentName(agentName)) {
|
|
13651
13899
|
console.error(
|
|
13652
|
-
|
|
13900
|
+
chalk67.red(
|
|
13653
13901
|
"Invalid agent name: must be 3-64 chars, alphanumeric + hyphens"
|
|
13654
13902
|
)
|
|
13655
13903
|
);
|
|
13656
13904
|
process.exit(1);
|
|
13657
13905
|
}
|
|
13658
13906
|
if (existsSync11(agentName)) {
|
|
13659
|
-
console.error(
|
|
13907
|
+
console.error(chalk67.red(`${agentName}/ already exists`));
|
|
13660
13908
|
console.log();
|
|
13661
13909
|
console.log("Remove it first or choose a different name:");
|
|
13662
|
-
console.log(
|
|
13910
|
+
console.log(chalk67.cyan(` rm -rf ${agentName}`));
|
|
13663
13911
|
process.exit(1);
|
|
13664
13912
|
}
|
|
13665
13913
|
}
|
|
13666
13914
|
await mkdir8(agentName, { recursive: true });
|
|
13667
|
-
step.detail(
|
|
13915
|
+
step.detail(chalk67.green(`Created ${agentName}/`));
|
|
13668
13916
|
});
|
|
13669
13917
|
return agentName;
|
|
13670
13918
|
}
|
|
@@ -13680,7 +13928,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13680
13928
|
shouldInstall = confirmed ?? true;
|
|
13681
13929
|
}
|
|
13682
13930
|
if (!shouldInstall) {
|
|
13683
|
-
step.detail(
|
|
13931
|
+
step.detail(chalk67.dim("Skipped"));
|
|
13684
13932
|
return;
|
|
13685
13933
|
}
|
|
13686
13934
|
const scope = "project";
|
|
@@ -13688,7 +13936,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13688
13936
|
const agentDir = `${process.cwd()}/${agentName}`;
|
|
13689
13937
|
const result = await installVm0Plugin(scope, agentDir);
|
|
13690
13938
|
step.detail(
|
|
13691
|
-
|
|
13939
|
+
chalk67.green(`Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
13692
13940
|
);
|
|
13693
13941
|
pluginInstalled = true;
|
|
13694
13942
|
} catch (error) {
|
|
@@ -13699,18 +13947,18 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13699
13947
|
}
|
|
13700
13948
|
function printNextSteps(agentName, pluginInstalled) {
|
|
13701
13949
|
console.log();
|
|
13702
|
-
console.log(
|
|
13950
|
+
console.log(chalk67.bold("Next step:"));
|
|
13703
13951
|
console.log();
|
|
13704
13952
|
if (pluginInstalled) {
|
|
13705
13953
|
console.log(
|
|
13706
|
-
` ${
|
|
13954
|
+
` ${chalk67.cyan(`cd ${agentName} && claude "/${PRIMARY_SKILL_NAME} let's build an agent"`)}`
|
|
13707
13955
|
);
|
|
13708
13956
|
} else {
|
|
13709
|
-
console.log(` ${
|
|
13957
|
+
console.log(` ${chalk67.cyan(`cd ${agentName} && vm0 init`)}`);
|
|
13710
13958
|
}
|
|
13711
13959
|
console.log();
|
|
13712
13960
|
}
|
|
13713
|
-
var onboardCommand = new
|
|
13961
|
+
var onboardCommand = new Command68().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) => {
|
|
13714
13962
|
const interactive = isInteractive();
|
|
13715
13963
|
if (interactive) {
|
|
13716
13964
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
@@ -13733,15 +13981,15 @@ var onboardCommand = new Command66().name("onboard").description("Guided setup f
|
|
|
13733
13981
|
});
|
|
13734
13982
|
|
|
13735
13983
|
// src/commands/setup-claude/index.ts
|
|
13736
|
-
import { Command as
|
|
13737
|
-
import
|
|
13738
|
-
var setupClaudeCommand = new
|
|
13739
|
-
console.log(
|
|
13984
|
+
import { Command as Command69 } from "commander";
|
|
13985
|
+
import chalk68 from "chalk";
|
|
13986
|
+
var setupClaudeCommand = new Command69().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) => {
|
|
13987
|
+
console.log(chalk68.dim("Installing VM0 Claude Plugin..."));
|
|
13740
13988
|
const scope = options.scope === "user" ? "user" : "project";
|
|
13741
13989
|
try {
|
|
13742
13990
|
const result = await installVm0Plugin(scope, options.agentDir);
|
|
13743
13991
|
console.log(
|
|
13744
|
-
|
|
13992
|
+
chalk68.green(`\u2713 Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
13745
13993
|
);
|
|
13746
13994
|
} catch (error) {
|
|
13747
13995
|
handlePluginError(error);
|
|
@@ -13750,19 +13998,19 @@ var setupClaudeCommand = new Command67().name("setup-claude").description("Insta
|
|
|
13750
13998
|
console.log("Next step:");
|
|
13751
13999
|
const cdPrefix = options.agentDir ? `cd ${options.agentDir} && ` : "";
|
|
13752
14000
|
console.log(
|
|
13753
|
-
|
|
14001
|
+
chalk68.cyan(
|
|
13754
14002
|
` ${cdPrefix}claude "/${PRIMARY_SKILL_NAME} let's build a workflow"`
|
|
13755
14003
|
)
|
|
13756
14004
|
);
|
|
13757
14005
|
});
|
|
13758
14006
|
|
|
13759
14007
|
// src/commands/dev-tool/index.ts
|
|
13760
|
-
import { Command as
|
|
14008
|
+
import { Command as Command71 } from "commander";
|
|
13761
14009
|
|
|
13762
14010
|
// src/commands/dev-tool/compose.ts
|
|
13763
|
-
import { Command as
|
|
13764
|
-
import
|
|
13765
|
-
import { initClient as
|
|
14011
|
+
import { Command as Command70 } from "commander";
|
|
14012
|
+
import chalk69 from "chalk";
|
|
14013
|
+
import { initClient as initClient12 } from "@ts-rest/core";
|
|
13766
14014
|
function sleep2(ms) {
|
|
13767
14015
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13768
14016
|
}
|
|
@@ -13771,7 +14019,7 @@ function timestamp() {
|
|
|
13771
14019
|
}
|
|
13772
14020
|
async function createComposeJob(githubUrl, overwrite) {
|
|
13773
14021
|
const config = await getClientConfig();
|
|
13774
|
-
const client =
|
|
14022
|
+
const client = initClient12(composeJobsMainContract, config);
|
|
13775
14023
|
const result = await client.create({
|
|
13776
14024
|
body: { githubUrl, overwrite }
|
|
13777
14025
|
});
|
|
@@ -13788,7 +14036,7 @@ async function createComposeJob(githubUrl, overwrite) {
|
|
|
13788
14036
|
}
|
|
13789
14037
|
async function getComposeJobStatus(jobId) {
|
|
13790
14038
|
const config = await getClientConfig();
|
|
13791
|
-
const client =
|
|
14039
|
+
const client = initClient12(composeJobsByIdContract, config);
|
|
13792
14040
|
const result = await client.getById({
|
|
13793
14041
|
params: { jobId }
|
|
13794
14042
|
});
|
|
@@ -13813,7 +14061,7 @@ async function pollUntilComplete(jobId, intervalMs, timeoutMs, jsonMode) {
|
|
|
13813
14061
|
const job = await getComposeJobStatus(jobId);
|
|
13814
14062
|
if (!jsonMode) {
|
|
13815
14063
|
console.log(
|
|
13816
|
-
|
|
14064
|
+
chalk69.dim(`[${timestamp()}] Polling... status=${job.status}`)
|
|
13817
14065
|
);
|
|
13818
14066
|
}
|
|
13819
14067
|
if (job.status === "completed" || job.status === "failed") {
|
|
@@ -13823,7 +14071,7 @@ async function pollUntilComplete(jobId, intervalMs, timeoutMs, jsonMode) {
|
|
|
13823
14071
|
}
|
|
13824
14072
|
throw new Error(`Timeout after ${timeoutMs / 1e3} seconds`);
|
|
13825
14073
|
}
|
|
13826
|
-
var composeCommand2 = new
|
|
14074
|
+
var composeCommand2 = new Command70().name("compose").description("Test server-side GitHub compose API").argument("<github-url>", "GitHub URL to compose from").option("--overwrite", "Overwrite existing compose", false).option(
|
|
13827
14075
|
"--interval <seconds>",
|
|
13828
14076
|
"Polling interval in seconds",
|
|
13829
14077
|
(v) => parseInt(v, 10),
|
|
@@ -13846,7 +14094,7 @@ var composeCommand2 = new Command68().name("compose").description("Test server-s
|
|
|
13846
14094
|
options.overwrite
|
|
13847
14095
|
);
|
|
13848
14096
|
if (!options.json) {
|
|
13849
|
-
console.log(`Job ID: ${
|
|
14097
|
+
console.log(`Job ID: ${chalk69.cyan(jobId)}`);
|
|
13850
14098
|
console.log();
|
|
13851
14099
|
}
|
|
13852
14100
|
if (initialStatus === "completed" || initialStatus === "failed") {
|
|
@@ -13880,7 +14128,7 @@ var composeCommand2 = new Command68().name("compose").description("Test server-s
|
|
|
13880
14128
|
);
|
|
13881
14129
|
} else {
|
|
13882
14130
|
console.error(
|
|
13883
|
-
|
|
14131
|
+
chalk69.red(
|
|
13884
14132
|
`\u2717 ${error instanceof Error ? error.message : String(error)}`
|
|
13885
14133
|
)
|
|
13886
14134
|
);
|
|
@@ -13891,21 +14139,21 @@ var composeCommand2 = new Command68().name("compose").description("Test server-s
|
|
|
13891
14139
|
);
|
|
13892
14140
|
function displayResult(job) {
|
|
13893
14141
|
if (job.status === "completed" && job.result) {
|
|
13894
|
-
console.log(
|
|
13895
|
-
console.log(` Compose ID: ${
|
|
13896
|
-
console.log(` Name: ${
|
|
13897
|
-
console.log(` Version: ${
|
|
14142
|
+
console.log(chalk69.green("\u2713 Compose completed!"));
|
|
14143
|
+
console.log(` Compose ID: ${chalk69.cyan(job.result.composeId)}`);
|
|
14144
|
+
console.log(` Name: ${chalk69.cyan(job.result.composeName)}`);
|
|
14145
|
+
console.log(` Version: ${chalk69.cyan(job.result.versionId.slice(0, 8))}`);
|
|
13898
14146
|
if (job.result.warnings.length > 0) {
|
|
13899
14147
|
console.log();
|
|
13900
|
-
console.log(
|
|
14148
|
+
console.log(chalk69.yellow(" Warnings:"));
|
|
13901
14149
|
for (const warning of job.result.warnings) {
|
|
13902
|
-
console.log(
|
|
14150
|
+
console.log(chalk69.yellow(` - ${warning}`));
|
|
13903
14151
|
}
|
|
13904
14152
|
}
|
|
13905
14153
|
} else if (job.status === "failed") {
|
|
13906
|
-
console.log(
|
|
14154
|
+
console.log(chalk69.red("\u2717 Compose failed!"));
|
|
13907
14155
|
if (job.error) {
|
|
13908
|
-
console.log(` Error: ${
|
|
14156
|
+
console.log(` Error: ${chalk69.red(job.error)}`);
|
|
13909
14157
|
}
|
|
13910
14158
|
} else {
|
|
13911
14159
|
console.log(`Status: ${job.status}`);
|
|
@@ -13913,11 +14161,11 @@ function displayResult(job) {
|
|
|
13913
14161
|
}
|
|
13914
14162
|
|
|
13915
14163
|
// src/commands/dev-tool/index.ts
|
|
13916
|
-
var devToolCommand = new
|
|
14164
|
+
var devToolCommand = new Command71().name("dev-tool").description("Developer tools for testing and debugging").addCommand(composeCommand2);
|
|
13917
14165
|
|
|
13918
14166
|
// src/index.ts
|
|
13919
|
-
var program = new
|
|
13920
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
14167
|
+
var program = new Command72();
|
|
14168
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.24.0");
|
|
13921
14169
|
program.addCommand(authCommand);
|
|
13922
14170
|
program.addCommand(infoCommand);
|
|
13923
14171
|
program.addCommand(composeCommand);
|
|
@@ -13934,6 +14182,7 @@ program.addCommand(usageCommand);
|
|
|
13934
14182
|
program.addCommand(secretCommand);
|
|
13935
14183
|
program.addCommand(variableCommand);
|
|
13936
14184
|
program.addCommand(modelProviderCommand);
|
|
14185
|
+
program.addCommand(connectorCommand);
|
|
13937
14186
|
program.addCommand(onboardCommand);
|
|
13938
14187
|
program.addCommand(setupClaudeCommand);
|
|
13939
14188
|
program.addCommand(devToolCommand, { hidden: true });
|