@vm0/runner 2.7.0 → 2.7.1
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 +364 -166
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6287,9 +6287,207 @@ var checkpointsByIdContract = c10.router({
|
|
|
6287
6287
|
}
|
|
6288
6288
|
});
|
|
6289
6289
|
|
|
6290
|
-
// ../../packages/core/src/contracts/
|
|
6290
|
+
// ../../packages/core/src/contracts/schedules.ts
|
|
6291
6291
|
import { z as z15 } from "zod";
|
|
6292
|
-
var
|
|
6292
|
+
var c11 = initContract();
|
|
6293
|
+
var scheduleTriggerSchema = z15.object({
|
|
6294
|
+
cron: z15.string().optional(),
|
|
6295
|
+
at: z15.string().optional(),
|
|
6296
|
+
timezone: z15.string().default("UTC")
|
|
6297
|
+
}).refine((data) => data.cron && !data.at || !data.cron && data.at, {
|
|
6298
|
+
message: "Exactly one of 'cron' or 'at' must be specified"
|
|
6299
|
+
});
|
|
6300
|
+
var scheduleRunConfigSchema = z15.object({
|
|
6301
|
+
agent: z15.string().min(1, "Agent reference required"),
|
|
6302
|
+
prompt: z15.string().min(1, "Prompt required"),
|
|
6303
|
+
vars: z15.record(z15.string(), z15.string()).optional(),
|
|
6304
|
+
secrets: z15.record(z15.string(), z15.string()).optional(),
|
|
6305
|
+
artifactName: z15.string().optional(),
|
|
6306
|
+
artifactVersion: z15.string().optional(),
|
|
6307
|
+
volumeVersions: z15.record(z15.string(), z15.string()).optional()
|
|
6308
|
+
});
|
|
6309
|
+
var scheduleDefinitionSchema = z15.object({
|
|
6310
|
+
on: scheduleTriggerSchema,
|
|
6311
|
+
run: scheduleRunConfigSchema
|
|
6312
|
+
});
|
|
6313
|
+
var scheduleYamlSchema = z15.object({
|
|
6314
|
+
version: z15.literal("1.0"),
|
|
6315
|
+
schedules: z15.record(z15.string(), scheduleDefinitionSchema)
|
|
6316
|
+
});
|
|
6317
|
+
var deployScheduleRequestSchema = z15.object({
|
|
6318
|
+
name: z15.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
6319
|
+
cronExpression: z15.string().optional(),
|
|
6320
|
+
atTime: z15.string().optional(),
|
|
6321
|
+
timezone: z15.string().default("UTC"),
|
|
6322
|
+
prompt: z15.string().min(1, "Prompt required"),
|
|
6323
|
+
vars: z15.record(z15.string(), z15.string()).optional(),
|
|
6324
|
+
secrets: z15.record(z15.string(), z15.string()).optional(),
|
|
6325
|
+
artifactName: z15.string().optional(),
|
|
6326
|
+
artifactVersion: z15.string().optional(),
|
|
6327
|
+
volumeVersions: z15.record(z15.string(), z15.string()).optional(),
|
|
6328
|
+
// Resolved agent compose ID (CLI resolves scope/name:version → composeId)
|
|
6329
|
+
composeId: z15.string().uuid("Invalid compose ID")
|
|
6330
|
+
}).refine(
|
|
6331
|
+
(data) => data.cronExpression && !data.atTime || !data.cronExpression && data.atTime,
|
|
6332
|
+
{
|
|
6333
|
+
message: "Exactly one of 'cronExpression' or 'atTime' must be specified"
|
|
6334
|
+
}
|
|
6335
|
+
);
|
|
6336
|
+
var scheduleResponseSchema = z15.object({
|
|
6337
|
+
id: z15.string().uuid(),
|
|
6338
|
+
composeId: z15.string().uuid(),
|
|
6339
|
+
composeName: z15.string(),
|
|
6340
|
+
scopeSlug: z15.string(),
|
|
6341
|
+
name: z15.string(),
|
|
6342
|
+
cronExpression: z15.string().nullable(),
|
|
6343
|
+
atTime: z15.string().nullable(),
|
|
6344
|
+
timezone: z15.string(),
|
|
6345
|
+
prompt: z15.string(),
|
|
6346
|
+
vars: z15.record(z15.string(), z15.string()).nullable(),
|
|
6347
|
+
// Secret names only (values are never returned)
|
|
6348
|
+
secretNames: z15.array(z15.string()).nullable(),
|
|
6349
|
+
artifactName: z15.string().nullable(),
|
|
6350
|
+
artifactVersion: z15.string().nullable(),
|
|
6351
|
+
volumeVersions: z15.record(z15.string(), z15.string()).nullable(),
|
|
6352
|
+
enabled: z15.boolean(),
|
|
6353
|
+
nextRunAt: z15.string().nullable(),
|
|
6354
|
+
lastRunAt: z15.string().nullable(),
|
|
6355
|
+
lastRunId: z15.string().nullable(),
|
|
6356
|
+
createdAt: z15.string(),
|
|
6357
|
+
updatedAt: z15.string()
|
|
6358
|
+
});
|
|
6359
|
+
var scheduleListResponseSchema = z15.object({
|
|
6360
|
+
schedules: z15.array(scheduleResponseSchema)
|
|
6361
|
+
});
|
|
6362
|
+
var deployScheduleResponseSchema = z15.object({
|
|
6363
|
+
schedule: scheduleResponseSchema,
|
|
6364
|
+
created: z15.boolean()
|
|
6365
|
+
// true if created, false if updated
|
|
6366
|
+
});
|
|
6367
|
+
var schedulesMainContract = c11.router({
|
|
6368
|
+
/**
|
|
6369
|
+
* POST /api/agent/schedules
|
|
6370
|
+
* Deploy (create or update) a schedule
|
|
6371
|
+
*/
|
|
6372
|
+
deploy: {
|
|
6373
|
+
method: "POST",
|
|
6374
|
+
path: "/api/agent/schedules",
|
|
6375
|
+
body: deployScheduleRequestSchema,
|
|
6376
|
+
responses: {
|
|
6377
|
+
200: deployScheduleResponseSchema,
|
|
6378
|
+
// Updated
|
|
6379
|
+
201: deployScheduleResponseSchema,
|
|
6380
|
+
// Created
|
|
6381
|
+
400: apiErrorSchema,
|
|
6382
|
+
401: apiErrorSchema,
|
|
6383
|
+
404: apiErrorSchema,
|
|
6384
|
+
409: apiErrorSchema
|
|
6385
|
+
// Schedule limit reached
|
|
6386
|
+
},
|
|
6387
|
+
summary: "Deploy schedule (create or update)"
|
|
6388
|
+
},
|
|
6389
|
+
/**
|
|
6390
|
+
* GET /api/agent/schedules
|
|
6391
|
+
* List all schedules for the user
|
|
6392
|
+
*/
|
|
6393
|
+
list: {
|
|
6394
|
+
method: "GET",
|
|
6395
|
+
path: "/api/agent/schedules",
|
|
6396
|
+
responses: {
|
|
6397
|
+
200: scheduleListResponseSchema,
|
|
6398
|
+
401: apiErrorSchema
|
|
6399
|
+
},
|
|
6400
|
+
summary: "List all schedules"
|
|
6401
|
+
}
|
|
6402
|
+
});
|
|
6403
|
+
var schedulesByNameContract = c11.router({
|
|
6404
|
+
/**
|
|
6405
|
+
* GET /api/agent/schedules/:name
|
|
6406
|
+
* Get schedule by name
|
|
6407
|
+
*/
|
|
6408
|
+
getByName: {
|
|
6409
|
+
method: "GET",
|
|
6410
|
+
path: "/api/agent/schedules/:name",
|
|
6411
|
+
pathParams: z15.object({
|
|
6412
|
+
name: z15.string().min(1, "Schedule name required")
|
|
6413
|
+
}),
|
|
6414
|
+
query: z15.object({
|
|
6415
|
+
composeId: z15.string().uuid("Compose ID required")
|
|
6416
|
+
}),
|
|
6417
|
+
responses: {
|
|
6418
|
+
200: scheduleResponseSchema,
|
|
6419
|
+
401: apiErrorSchema,
|
|
6420
|
+
404: apiErrorSchema
|
|
6421
|
+
},
|
|
6422
|
+
summary: "Get schedule by name"
|
|
6423
|
+
},
|
|
6424
|
+
/**
|
|
6425
|
+
* DELETE /api/agent/schedules/:name
|
|
6426
|
+
* Delete schedule by name
|
|
6427
|
+
*/
|
|
6428
|
+
delete: {
|
|
6429
|
+
method: "DELETE",
|
|
6430
|
+
path: "/api/agent/schedules/:name",
|
|
6431
|
+
pathParams: z15.object({
|
|
6432
|
+
name: z15.string().min(1, "Schedule name required")
|
|
6433
|
+
}),
|
|
6434
|
+
query: z15.object({
|
|
6435
|
+
composeId: z15.string().uuid("Compose ID required")
|
|
6436
|
+
}),
|
|
6437
|
+
responses: {
|
|
6438
|
+
204: z15.undefined(),
|
|
6439
|
+
401: apiErrorSchema,
|
|
6440
|
+
404: apiErrorSchema
|
|
6441
|
+
},
|
|
6442
|
+
summary: "Delete schedule"
|
|
6443
|
+
}
|
|
6444
|
+
});
|
|
6445
|
+
var schedulesEnableContract = c11.router({
|
|
6446
|
+
/**
|
|
6447
|
+
* POST /api/agent/schedules/:name/enable
|
|
6448
|
+
* Enable a disabled schedule
|
|
6449
|
+
*/
|
|
6450
|
+
enable: {
|
|
6451
|
+
method: "POST",
|
|
6452
|
+
path: "/api/agent/schedules/:name/enable",
|
|
6453
|
+
pathParams: z15.object({
|
|
6454
|
+
name: z15.string().min(1, "Schedule name required")
|
|
6455
|
+
}),
|
|
6456
|
+
body: z15.object({
|
|
6457
|
+
composeId: z15.string().uuid("Compose ID required")
|
|
6458
|
+
}),
|
|
6459
|
+
responses: {
|
|
6460
|
+
200: scheduleResponseSchema,
|
|
6461
|
+
401: apiErrorSchema,
|
|
6462
|
+
404: apiErrorSchema
|
|
6463
|
+
},
|
|
6464
|
+
summary: "Enable schedule"
|
|
6465
|
+
},
|
|
6466
|
+
/**
|
|
6467
|
+
* POST /api/agent/schedules/:name/disable
|
|
6468
|
+
* Disable an enabled schedule
|
|
6469
|
+
*/
|
|
6470
|
+
disable: {
|
|
6471
|
+
method: "POST",
|
|
6472
|
+
path: "/api/agent/schedules/:name/disable",
|
|
6473
|
+
pathParams: z15.object({
|
|
6474
|
+
name: z15.string().min(1, "Schedule name required")
|
|
6475
|
+
}),
|
|
6476
|
+
body: z15.object({
|
|
6477
|
+
composeId: z15.string().uuid("Compose ID required")
|
|
6478
|
+
}),
|
|
6479
|
+
responses: {
|
|
6480
|
+
200: scheduleResponseSchema,
|
|
6481
|
+
401: apiErrorSchema,
|
|
6482
|
+
404: apiErrorSchema
|
|
6483
|
+
},
|
|
6484
|
+
summary: "Disable schedule"
|
|
6485
|
+
}
|
|
6486
|
+
});
|
|
6487
|
+
|
|
6488
|
+
// ../../packages/core/src/contracts/public/common.ts
|
|
6489
|
+
import { z as z16 } from "zod";
|
|
6490
|
+
var publicApiErrorTypeSchema = z16.enum([
|
|
6293
6491
|
"api_error",
|
|
6294
6492
|
// Internal server error (5xx)
|
|
6295
6493
|
"invalid_request_error",
|
|
@@ -6301,55 +6499,55 @@ var publicApiErrorTypeSchema = z15.enum([
|
|
|
6301
6499
|
"conflict_error"
|
|
6302
6500
|
// Resource conflict (409)
|
|
6303
6501
|
]);
|
|
6304
|
-
var publicApiErrorSchema =
|
|
6305
|
-
error:
|
|
6502
|
+
var publicApiErrorSchema = z16.object({
|
|
6503
|
+
error: z16.object({
|
|
6306
6504
|
type: publicApiErrorTypeSchema,
|
|
6307
|
-
code:
|
|
6308
|
-
message:
|
|
6309
|
-
param:
|
|
6310
|
-
doc_url:
|
|
6505
|
+
code: z16.string(),
|
|
6506
|
+
message: z16.string(),
|
|
6507
|
+
param: z16.string().optional(),
|
|
6508
|
+
doc_url: z16.string().url().optional()
|
|
6311
6509
|
})
|
|
6312
6510
|
});
|
|
6313
|
-
var paginationSchema =
|
|
6314
|
-
has_more:
|
|
6315
|
-
next_cursor:
|
|
6511
|
+
var paginationSchema = z16.object({
|
|
6512
|
+
has_more: z16.boolean(),
|
|
6513
|
+
next_cursor: z16.string().nullable()
|
|
6316
6514
|
});
|
|
6317
6515
|
function createPaginatedResponseSchema(dataSchema) {
|
|
6318
|
-
return
|
|
6319
|
-
data:
|
|
6516
|
+
return z16.object({
|
|
6517
|
+
data: z16.array(dataSchema),
|
|
6320
6518
|
pagination: paginationSchema
|
|
6321
6519
|
});
|
|
6322
6520
|
}
|
|
6323
|
-
var listQuerySchema =
|
|
6324
|
-
cursor:
|
|
6325
|
-
limit:
|
|
6521
|
+
var listQuerySchema = z16.object({
|
|
6522
|
+
cursor: z16.string().optional(),
|
|
6523
|
+
limit: z16.coerce.number().min(1).max(100).default(20)
|
|
6326
6524
|
});
|
|
6327
|
-
var requestIdSchema =
|
|
6328
|
-
var timestampSchema =
|
|
6525
|
+
var requestIdSchema = z16.string().uuid();
|
|
6526
|
+
var timestampSchema = z16.string().datetime();
|
|
6329
6527
|
|
|
6330
6528
|
// ../../packages/core/src/contracts/public/agents.ts
|
|
6331
|
-
import { z as
|
|
6332
|
-
var
|
|
6333
|
-
var publicAgentSchema =
|
|
6334
|
-
id:
|
|
6335
|
-
name:
|
|
6336
|
-
current_version_id:
|
|
6529
|
+
import { z as z17 } from "zod";
|
|
6530
|
+
var c12 = initContract();
|
|
6531
|
+
var publicAgentSchema = z17.object({
|
|
6532
|
+
id: z17.string(),
|
|
6533
|
+
name: z17.string(),
|
|
6534
|
+
current_version_id: z17.string().nullable(),
|
|
6337
6535
|
created_at: timestampSchema,
|
|
6338
6536
|
updated_at: timestampSchema
|
|
6339
6537
|
});
|
|
6340
|
-
var agentVersionSchema =
|
|
6341
|
-
id:
|
|
6342
|
-
agent_id:
|
|
6343
|
-
version_number:
|
|
6538
|
+
var agentVersionSchema = z17.object({
|
|
6539
|
+
id: z17.string(),
|
|
6540
|
+
agent_id: z17.string(),
|
|
6541
|
+
version_number: z17.number(),
|
|
6344
6542
|
created_at: timestampSchema
|
|
6345
6543
|
});
|
|
6346
6544
|
var publicAgentDetailSchema = publicAgentSchema;
|
|
6347
6545
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
6348
6546
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
6349
6547
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
6350
|
-
name:
|
|
6548
|
+
name: z17.string().optional()
|
|
6351
6549
|
});
|
|
6352
|
-
var publicAgentsListContract =
|
|
6550
|
+
var publicAgentsListContract = c12.router({
|
|
6353
6551
|
list: {
|
|
6354
6552
|
method: "GET",
|
|
6355
6553
|
path: "/v1/agents",
|
|
@@ -6363,12 +6561,12 @@ var publicAgentsListContract = c11.router({
|
|
|
6363
6561
|
description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
|
|
6364
6562
|
}
|
|
6365
6563
|
});
|
|
6366
|
-
var publicAgentByIdContract =
|
|
6564
|
+
var publicAgentByIdContract = c12.router({
|
|
6367
6565
|
get: {
|
|
6368
6566
|
method: "GET",
|
|
6369
6567
|
path: "/v1/agents/:id",
|
|
6370
|
-
pathParams:
|
|
6371
|
-
id:
|
|
6568
|
+
pathParams: z17.object({
|
|
6569
|
+
id: z17.string().min(1, "Agent ID is required")
|
|
6372
6570
|
}),
|
|
6373
6571
|
responses: {
|
|
6374
6572
|
200: publicAgentDetailSchema,
|
|
@@ -6380,12 +6578,12 @@ var publicAgentByIdContract = c11.router({
|
|
|
6380
6578
|
description: "Get agent details by ID"
|
|
6381
6579
|
}
|
|
6382
6580
|
});
|
|
6383
|
-
var publicAgentVersionsContract =
|
|
6581
|
+
var publicAgentVersionsContract = c12.router({
|
|
6384
6582
|
list: {
|
|
6385
6583
|
method: "GET",
|
|
6386
6584
|
path: "/v1/agents/:id/versions",
|
|
6387
|
-
pathParams:
|
|
6388
|
-
id:
|
|
6585
|
+
pathParams: z17.object({
|
|
6586
|
+
id: z17.string().min(1, "Agent ID is required")
|
|
6389
6587
|
}),
|
|
6390
6588
|
query: listQuerySchema,
|
|
6391
6589
|
responses: {
|
|
@@ -6400,9 +6598,9 @@ var publicAgentVersionsContract = c11.router({
|
|
|
6400
6598
|
});
|
|
6401
6599
|
|
|
6402
6600
|
// ../../packages/core/src/contracts/public/runs.ts
|
|
6403
|
-
import { z as
|
|
6404
|
-
var
|
|
6405
|
-
var publicRunStatusSchema =
|
|
6601
|
+
import { z as z18 } from "zod";
|
|
6602
|
+
var c13 = initContract();
|
|
6603
|
+
var publicRunStatusSchema = z18.enum([
|
|
6406
6604
|
"pending",
|
|
6407
6605
|
"running",
|
|
6408
6606
|
"completed",
|
|
@@ -6410,56 +6608,56 @@ var publicRunStatusSchema = z17.enum([
|
|
|
6410
6608
|
"timeout",
|
|
6411
6609
|
"cancelled"
|
|
6412
6610
|
]);
|
|
6413
|
-
var publicRunSchema =
|
|
6414
|
-
id:
|
|
6415
|
-
agent_id:
|
|
6416
|
-
agent_name:
|
|
6611
|
+
var publicRunSchema = z18.object({
|
|
6612
|
+
id: z18.string(),
|
|
6613
|
+
agent_id: z18.string(),
|
|
6614
|
+
agent_name: z18.string(),
|
|
6417
6615
|
status: publicRunStatusSchema,
|
|
6418
|
-
prompt:
|
|
6616
|
+
prompt: z18.string(),
|
|
6419
6617
|
created_at: timestampSchema,
|
|
6420
6618
|
started_at: timestampSchema.nullable(),
|
|
6421
6619
|
completed_at: timestampSchema.nullable()
|
|
6422
6620
|
});
|
|
6423
6621
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
6424
|
-
error:
|
|
6425
|
-
execution_time_ms:
|
|
6426
|
-
checkpoint_id:
|
|
6427
|
-
session_id:
|
|
6428
|
-
artifact_name:
|
|
6429
|
-
artifact_version:
|
|
6430
|
-
volumes:
|
|
6622
|
+
error: z18.string().nullable(),
|
|
6623
|
+
execution_time_ms: z18.number().nullable(),
|
|
6624
|
+
checkpoint_id: z18.string().nullable(),
|
|
6625
|
+
session_id: z18.string().nullable(),
|
|
6626
|
+
artifact_name: z18.string().nullable(),
|
|
6627
|
+
artifact_version: z18.string().nullable(),
|
|
6628
|
+
volumes: z18.record(z18.string(), z18.string()).optional()
|
|
6431
6629
|
});
|
|
6432
6630
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
6433
|
-
var createRunRequestSchema =
|
|
6631
|
+
var createRunRequestSchema = z18.object({
|
|
6434
6632
|
// Agent identification (one of: agent, agent_id, session_id, checkpoint_id)
|
|
6435
|
-
agent:
|
|
6633
|
+
agent: z18.string().optional(),
|
|
6436
6634
|
// Agent name
|
|
6437
|
-
agent_id:
|
|
6635
|
+
agent_id: z18.string().optional(),
|
|
6438
6636
|
// Agent ID
|
|
6439
|
-
agent_version:
|
|
6637
|
+
agent_version: z18.string().optional(),
|
|
6440
6638
|
// Version specifier (e.g., "latest", "v1", specific ID)
|
|
6441
6639
|
// Continue session
|
|
6442
|
-
session_id:
|
|
6640
|
+
session_id: z18.string().optional(),
|
|
6443
6641
|
// Resume from checkpoint
|
|
6444
|
-
checkpoint_id:
|
|
6642
|
+
checkpoint_id: z18.string().optional(),
|
|
6445
6643
|
// Required
|
|
6446
|
-
prompt:
|
|
6644
|
+
prompt: z18.string().min(1, "Prompt is required"),
|
|
6447
6645
|
// Optional configuration
|
|
6448
|
-
variables:
|
|
6449
|
-
secrets:
|
|
6450
|
-
artifact_name:
|
|
6646
|
+
variables: z18.record(z18.string(), z18.string()).optional(),
|
|
6647
|
+
secrets: z18.record(z18.string(), z18.string()).optional(),
|
|
6648
|
+
artifact_name: z18.string().optional(),
|
|
6451
6649
|
// Artifact name to mount
|
|
6452
|
-
artifact_version:
|
|
6650
|
+
artifact_version: z18.string().optional(),
|
|
6453
6651
|
// Artifact version (defaults to latest)
|
|
6454
|
-
volumes:
|
|
6652
|
+
volumes: z18.record(z18.string(), z18.string()).optional()
|
|
6455
6653
|
// volume_name -> version
|
|
6456
6654
|
});
|
|
6457
6655
|
var runListQuerySchema = listQuerySchema.extend({
|
|
6458
|
-
agent_id:
|
|
6656
|
+
agent_id: z18.string().optional(),
|
|
6459
6657
|
status: publicRunStatusSchema.optional(),
|
|
6460
6658
|
since: timestampSchema.optional()
|
|
6461
6659
|
});
|
|
6462
|
-
var publicRunsListContract =
|
|
6660
|
+
var publicRunsListContract = c13.router({
|
|
6463
6661
|
list: {
|
|
6464
6662
|
method: "GET",
|
|
6465
6663
|
path: "/v1/runs",
|
|
@@ -6488,12 +6686,12 @@ var publicRunsListContract = c12.router({
|
|
|
6488
6686
|
description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
|
|
6489
6687
|
}
|
|
6490
6688
|
});
|
|
6491
|
-
var publicRunByIdContract =
|
|
6689
|
+
var publicRunByIdContract = c13.router({
|
|
6492
6690
|
get: {
|
|
6493
6691
|
method: "GET",
|
|
6494
6692
|
path: "/v1/runs/:id",
|
|
6495
|
-
pathParams:
|
|
6496
|
-
id:
|
|
6693
|
+
pathParams: z18.object({
|
|
6694
|
+
id: z18.string().min(1, "Run ID is required")
|
|
6497
6695
|
}),
|
|
6498
6696
|
responses: {
|
|
6499
6697
|
200: publicRunDetailSchema,
|
|
@@ -6505,14 +6703,14 @@ var publicRunByIdContract = c12.router({
|
|
|
6505
6703
|
description: "Get run details by ID"
|
|
6506
6704
|
}
|
|
6507
6705
|
});
|
|
6508
|
-
var publicRunCancelContract =
|
|
6706
|
+
var publicRunCancelContract = c13.router({
|
|
6509
6707
|
cancel: {
|
|
6510
6708
|
method: "POST",
|
|
6511
6709
|
path: "/v1/runs/:id/cancel",
|
|
6512
|
-
pathParams:
|
|
6513
|
-
id:
|
|
6710
|
+
pathParams: z18.object({
|
|
6711
|
+
id: z18.string().min(1, "Run ID is required")
|
|
6514
6712
|
}),
|
|
6515
|
-
body:
|
|
6713
|
+
body: z18.undefined(),
|
|
6516
6714
|
responses: {
|
|
6517
6715
|
200: publicRunDetailSchema,
|
|
6518
6716
|
400: publicApiErrorSchema,
|
|
@@ -6525,26 +6723,26 @@ var publicRunCancelContract = c12.router({
|
|
|
6525
6723
|
description: "Cancel a pending or running execution"
|
|
6526
6724
|
}
|
|
6527
6725
|
});
|
|
6528
|
-
var logEntrySchema =
|
|
6726
|
+
var logEntrySchema = z18.object({
|
|
6529
6727
|
timestamp: timestampSchema,
|
|
6530
|
-
type:
|
|
6531
|
-
level:
|
|
6532
|
-
message:
|
|
6533
|
-
metadata:
|
|
6728
|
+
type: z18.enum(["agent", "system", "network"]),
|
|
6729
|
+
level: z18.enum(["debug", "info", "warn", "error"]),
|
|
6730
|
+
message: z18.string(),
|
|
6731
|
+
metadata: z18.record(z18.string(), z18.unknown()).optional()
|
|
6534
6732
|
});
|
|
6535
6733
|
var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
|
|
6536
6734
|
var logsQuerySchema = listQuerySchema.extend({
|
|
6537
|
-
type:
|
|
6735
|
+
type: z18.enum(["agent", "system", "network", "all"]).default("all"),
|
|
6538
6736
|
since: timestampSchema.optional(),
|
|
6539
6737
|
until: timestampSchema.optional(),
|
|
6540
|
-
order:
|
|
6738
|
+
order: z18.enum(["asc", "desc"]).default("asc")
|
|
6541
6739
|
});
|
|
6542
|
-
var publicRunLogsContract =
|
|
6740
|
+
var publicRunLogsContract = c13.router({
|
|
6543
6741
|
getLogs: {
|
|
6544
6742
|
method: "GET",
|
|
6545
6743
|
path: "/v1/runs/:id/logs",
|
|
6546
|
-
pathParams:
|
|
6547
|
-
id:
|
|
6744
|
+
pathParams: z18.object({
|
|
6745
|
+
id: z18.string().min(1, "Run ID is required")
|
|
6548
6746
|
}),
|
|
6549
6747
|
query: logsQuerySchema,
|
|
6550
6748
|
responses: {
|
|
@@ -6557,29 +6755,29 @@ var publicRunLogsContract = c12.router({
|
|
|
6557
6755
|
description: "Get unified logs for a run. Combines agent, system, and network logs."
|
|
6558
6756
|
}
|
|
6559
6757
|
});
|
|
6560
|
-
var metricPointSchema =
|
|
6758
|
+
var metricPointSchema = z18.object({
|
|
6561
6759
|
timestamp: timestampSchema,
|
|
6562
|
-
cpu_percent:
|
|
6563
|
-
memory_used_mb:
|
|
6564
|
-
memory_total_mb:
|
|
6565
|
-
disk_used_mb:
|
|
6566
|
-
disk_total_mb:
|
|
6567
|
-
});
|
|
6568
|
-
var metricsSummarySchema =
|
|
6569
|
-
avg_cpu_percent:
|
|
6570
|
-
max_memory_used_mb:
|
|
6571
|
-
total_duration_ms:
|
|
6572
|
-
});
|
|
6573
|
-
var metricsResponseSchema2 =
|
|
6574
|
-
data:
|
|
6760
|
+
cpu_percent: z18.number(),
|
|
6761
|
+
memory_used_mb: z18.number(),
|
|
6762
|
+
memory_total_mb: z18.number(),
|
|
6763
|
+
disk_used_mb: z18.number(),
|
|
6764
|
+
disk_total_mb: z18.number()
|
|
6765
|
+
});
|
|
6766
|
+
var metricsSummarySchema = z18.object({
|
|
6767
|
+
avg_cpu_percent: z18.number(),
|
|
6768
|
+
max_memory_used_mb: z18.number(),
|
|
6769
|
+
total_duration_ms: z18.number().nullable()
|
|
6770
|
+
});
|
|
6771
|
+
var metricsResponseSchema2 = z18.object({
|
|
6772
|
+
data: z18.array(metricPointSchema),
|
|
6575
6773
|
summary: metricsSummarySchema
|
|
6576
6774
|
});
|
|
6577
|
-
var publicRunMetricsContract =
|
|
6775
|
+
var publicRunMetricsContract = c13.router({
|
|
6578
6776
|
getMetrics: {
|
|
6579
6777
|
method: "GET",
|
|
6580
6778
|
path: "/v1/runs/:id/metrics",
|
|
6581
|
-
pathParams:
|
|
6582
|
-
id:
|
|
6779
|
+
pathParams: z18.object({
|
|
6780
|
+
id: z18.string().min(1, "Run ID is required")
|
|
6583
6781
|
}),
|
|
6584
6782
|
responses: {
|
|
6585
6783
|
200: metricsResponseSchema2,
|
|
@@ -6591,7 +6789,7 @@ var publicRunMetricsContract = c12.router({
|
|
|
6591
6789
|
description: "Get CPU, memory, and disk metrics for a run"
|
|
6592
6790
|
}
|
|
6593
6791
|
});
|
|
6594
|
-
var sseEventTypeSchema =
|
|
6792
|
+
var sseEventTypeSchema = z18.enum([
|
|
6595
6793
|
"status",
|
|
6596
6794
|
// Run status change
|
|
6597
6795
|
"output",
|
|
@@ -6603,25 +6801,25 @@ var sseEventTypeSchema = z17.enum([
|
|
|
6603
6801
|
"heartbeat"
|
|
6604
6802
|
// Keep-alive
|
|
6605
6803
|
]);
|
|
6606
|
-
var sseEventSchema =
|
|
6804
|
+
var sseEventSchema = z18.object({
|
|
6607
6805
|
event: sseEventTypeSchema,
|
|
6608
|
-
data:
|
|
6609
|
-
id:
|
|
6806
|
+
data: z18.unknown(),
|
|
6807
|
+
id: z18.string().optional()
|
|
6610
6808
|
// For Last-Event-ID reconnection
|
|
6611
6809
|
});
|
|
6612
|
-
var publicRunEventsContract =
|
|
6810
|
+
var publicRunEventsContract = c13.router({
|
|
6613
6811
|
streamEvents: {
|
|
6614
6812
|
method: "GET",
|
|
6615
6813
|
path: "/v1/runs/:id/events",
|
|
6616
|
-
pathParams:
|
|
6617
|
-
id:
|
|
6814
|
+
pathParams: z18.object({
|
|
6815
|
+
id: z18.string().min(1, "Run ID is required")
|
|
6618
6816
|
}),
|
|
6619
|
-
query:
|
|
6620
|
-
last_event_id:
|
|
6817
|
+
query: z18.object({
|
|
6818
|
+
last_event_id: z18.string().optional()
|
|
6621
6819
|
// For reconnection
|
|
6622
6820
|
}),
|
|
6623
6821
|
responses: {
|
|
6624
|
-
200:
|
|
6822
|
+
200: z18.any(),
|
|
6625
6823
|
// SSE stream - actual content is text/event-stream
|
|
6626
6824
|
401: publicApiErrorSchema,
|
|
6627
6825
|
404: publicApiErrorSchema,
|
|
@@ -6633,28 +6831,28 @@ var publicRunEventsContract = c12.router({
|
|
|
6633
6831
|
});
|
|
6634
6832
|
|
|
6635
6833
|
// ../../packages/core/src/contracts/public/artifacts.ts
|
|
6636
|
-
import { z as
|
|
6637
|
-
var
|
|
6638
|
-
var publicArtifactSchema =
|
|
6639
|
-
id:
|
|
6640
|
-
name:
|
|
6641
|
-
current_version_id:
|
|
6642
|
-
size:
|
|
6834
|
+
import { z as z19 } from "zod";
|
|
6835
|
+
var c14 = initContract();
|
|
6836
|
+
var publicArtifactSchema = z19.object({
|
|
6837
|
+
id: z19.string(),
|
|
6838
|
+
name: z19.string(),
|
|
6839
|
+
current_version_id: z19.string().nullable(),
|
|
6840
|
+
size: z19.number(),
|
|
6643
6841
|
// Total size in bytes
|
|
6644
|
-
file_count:
|
|
6842
|
+
file_count: z19.number(),
|
|
6645
6843
|
created_at: timestampSchema,
|
|
6646
6844
|
updated_at: timestampSchema
|
|
6647
6845
|
});
|
|
6648
|
-
var artifactVersionSchema =
|
|
6649
|
-
id:
|
|
6846
|
+
var artifactVersionSchema = z19.object({
|
|
6847
|
+
id: z19.string(),
|
|
6650
6848
|
// SHA-256 content hash
|
|
6651
|
-
artifact_id:
|
|
6652
|
-
size:
|
|
6849
|
+
artifact_id: z19.string(),
|
|
6850
|
+
size: z19.number(),
|
|
6653
6851
|
// Size in bytes
|
|
6654
|
-
file_count:
|
|
6655
|
-
message:
|
|
6852
|
+
file_count: z19.number(),
|
|
6853
|
+
message: z19.string().nullable(),
|
|
6656
6854
|
// Optional commit message
|
|
6657
|
-
created_by:
|
|
6855
|
+
created_by: z19.string(),
|
|
6658
6856
|
created_at: timestampSchema
|
|
6659
6857
|
});
|
|
6660
6858
|
var publicArtifactDetailSchema = publicArtifactSchema.extend({
|
|
@@ -6664,7 +6862,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
6664
6862
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
6665
6863
|
artifactVersionSchema
|
|
6666
6864
|
);
|
|
6667
|
-
var publicArtifactsListContract =
|
|
6865
|
+
var publicArtifactsListContract = c14.router({
|
|
6668
6866
|
list: {
|
|
6669
6867
|
method: "GET",
|
|
6670
6868
|
path: "/v1/artifacts",
|
|
@@ -6678,12 +6876,12 @@ var publicArtifactsListContract = c13.router({
|
|
|
6678
6876
|
description: "List all artifacts in the current scope with pagination"
|
|
6679
6877
|
}
|
|
6680
6878
|
});
|
|
6681
|
-
var publicArtifactByIdContract =
|
|
6879
|
+
var publicArtifactByIdContract = c14.router({
|
|
6682
6880
|
get: {
|
|
6683
6881
|
method: "GET",
|
|
6684
6882
|
path: "/v1/artifacts/:id",
|
|
6685
|
-
pathParams:
|
|
6686
|
-
id:
|
|
6883
|
+
pathParams: z19.object({
|
|
6884
|
+
id: z19.string().min(1, "Artifact ID is required")
|
|
6687
6885
|
}),
|
|
6688
6886
|
responses: {
|
|
6689
6887
|
200: publicArtifactDetailSchema,
|
|
@@ -6695,12 +6893,12 @@ var publicArtifactByIdContract = c13.router({
|
|
|
6695
6893
|
description: "Get artifact details by ID"
|
|
6696
6894
|
}
|
|
6697
6895
|
});
|
|
6698
|
-
var publicArtifactVersionsContract =
|
|
6896
|
+
var publicArtifactVersionsContract = c14.router({
|
|
6699
6897
|
list: {
|
|
6700
6898
|
method: "GET",
|
|
6701
6899
|
path: "/v1/artifacts/:id/versions",
|
|
6702
|
-
pathParams:
|
|
6703
|
-
id:
|
|
6900
|
+
pathParams: z19.object({
|
|
6901
|
+
id: z19.string().min(1, "Artifact ID is required")
|
|
6704
6902
|
}),
|
|
6705
6903
|
query: listQuerySchema,
|
|
6706
6904
|
responses: {
|
|
@@ -6713,19 +6911,19 @@ var publicArtifactVersionsContract = c13.router({
|
|
|
6713
6911
|
description: "List all versions of an artifact with pagination"
|
|
6714
6912
|
}
|
|
6715
6913
|
});
|
|
6716
|
-
var publicArtifactDownloadContract =
|
|
6914
|
+
var publicArtifactDownloadContract = c14.router({
|
|
6717
6915
|
download: {
|
|
6718
6916
|
method: "GET",
|
|
6719
6917
|
path: "/v1/artifacts/:id/download",
|
|
6720
|
-
pathParams:
|
|
6721
|
-
id:
|
|
6918
|
+
pathParams: z19.object({
|
|
6919
|
+
id: z19.string().min(1, "Artifact ID is required")
|
|
6722
6920
|
}),
|
|
6723
|
-
query:
|
|
6724
|
-
version_id:
|
|
6921
|
+
query: z19.object({
|
|
6922
|
+
version_id: z19.string().optional()
|
|
6725
6923
|
// Defaults to current version
|
|
6726
6924
|
}),
|
|
6727
6925
|
responses: {
|
|
6728
|
-
302:
|
|
6926
|
+
302: z19.undefined(),
|
|
6729
6927
|
// Redirect to presigned URL
|
|
6730
6928
|
401: publicApiErrorSchema,
|
|
6731
6929
|
404: publicApiErrorSchema,
|
|
@@ -6737,28 +6935,28 @@ var publicArtifactDownloadContract = c13.router({
|
|
|
6737
6935
|
});
|
|
6738
6936
|
|
|
6739
6937
|
// ../../packages/core/src/contracts/public/volumes.ts
|
|
6740
|
-
import { z as
|
|
6741
|
-
var
|
|
6742
|
-
var publicVolumeSchema =
|
|
6743
|
-
id:
|
|
6744
|
-
name:
|
|
6745
|
-
current_version_id:
|
|
6746
|
-
size:
|
|
6938
|
+
import { z as z20 } from "zod";
|
|
6939
|
+
var c15 = initContract();
|
|
6940
|
+
var publicVolumeSchema = z20.object({
|
|
6941
|
+
id: z20.string(),
|
|
6942
|
+
name: z20.string(),
|
|
6943
|
+
current_version_id: z20.string().nullable(),
|
|
6944
|
+
size: z20.number(),
|
|
6747
6945
|
// Total size in bytes
|
|
6748
|
-
file_count:
|
|
6946
|
+
file_count: z20.number(),
|
|
6749
6947
|
created_at: timestampSchema,
|
|
6750
6948
|
updated_at: timestampSchema
|
|
6751
6949
|
});
|
|
6752
|
-
var volumeVersionSchema =
|
|
6753
|
-
id:
|
|
6950
|
+
var volumeVersionSchema = z20.object({
|
|
6951
|
+
id: z20.string(),
|
|
6754
6952
|
// SHA-256 content hash
|
|
6755
|
-
volume_id:
|
|
6756
|
-
size:
|
|
6953
|
+
volume_id: z20.string(),
|
|
6954
|
+
size: z20.number(),
|
|
6757
6955
|
// Size in bytes
|
|
6758
|
-
file_count:
|
|
6759
|
-
message:
|
|
6956
|
+
file_count: z20.number(),
|
|
6957
|
+
message: z20.string().nullable(),
|
|
6760
6958
|
// Optional commit message
|
|
6761
|
-
created_by:
|
|
6959
|
+
created_by: z20.string(),
|
|
6762
6960
|
created_at: timestampSchema
|
|
6763
6961
|
});
|
|
6764
6962
|
var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
@@ -6766,7 +6964,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
6766
6964
|
});
|
|
6767
6965
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
6768
6966
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
6769
|
-
var publicVolumesListContract =
|
|
6967
|
+
var publicVolumesListContract = c15.router({
|
|
6770
6968
|
list: {
|
|
6771
6969
|
method: "GET",
|
|
6772
6970
|
path: "/v1/volumes",
|
|
@@ -6780,12 +6978,12 @@ var publicVolumesListContract = c14.router({
|
|
|
6780
6978
|
description: "List all volumes in the current scope with pagination"
|
|
6781
6979
|
}
|
|
6782
6980
|
});
|
|
6783
|
-
var publicVolumeByIdContract =
|
|
6981
|
+
var publicVolumeByIdContract = c15.router({
|
|
6784
6982
|
get: {
|
|
6785
6983
|
method: "GET",
|
|
6786
6984
|
path: "/v1/volumes/:id",
|
|
6787
|
-
pathParams:
|
|
6788
|
-
id:
|
|
6985
|
+
pathParams: z20.object({
|
|
6986
|
+
id: z20.string().min(1, "Volume ID is required")
|
|
6789
6987
|
}),
|
|
6790
6988
|
responses: {
|
|
6791
6989
|
200: publicVolumeDetailSchema,
|
|
@@ -6797,12 +6995,12 @@ var publicVolumeByIdContract = c14.router({
|
|
|
6797
6995
|
description: "Get volume details by ID"
|
|
6798
6996
|
}
|
|
6799
6997
|
});
|
|
6800
|
-
var publicVolumeVersionsContract =
|
|
6998
|
+
var publicVolumeVersionsContract = c15.router({
|
|
6801
6999
|
list: {
|
|
6802
7000
|
method: "GET",
|
|
6803
7001
|
path: "/v1/volumes/:id/versions",
|
|
6804
|
-
pathParams:
|
|
6805
|
-
id:
|
|
7002
|
+
pathParams: z20.object({
|
|
7003
|
+
id: z20.string().min(1, "Volume ID is required")
|
|
6806
7004
|
}),
|
|
6807
7005
|
query: listQuerySchema,
|
|
6808
7006
|
responses: {
|
|
@@ -6815,19 +7013,19 @@ var publicVolumeVersionsContract = c14.router({
|
|
|
6815
7013
|
description: "List all versions of a volume with pagination"
|
|
6816
7014
|
}
|
|
6817
7015
|
});
|
|
6818
|
-
var publicVolumeDownloadContract =
|
|
7016
|
+
var publicVolumeDownloadContract = c15.router({
|
|
6819
7017
|
download: {
|
|
6820
7018
|
method: "GET",
|
|
6821
7019
|
path: "/v1/volumes/:id/download",
|
|
6822
|
-
pathParams:
|
|
6823
|
-
id:
|
|
7020
|
+
pathParams: z20.object({
|
|
7021
|
+
id: z20.string().min(1, "Volume ID is required")
|
|
6824
7022
|
}),
|
|
6825
|
-
query:
|
|
6826
|
-
version_id:
|
|
7023
|
+
query: z20.object({
|
|
7024
|
+
version_id: z20.string().optional()
|
|
6827
7025
|
// Defaults to current version
|
|
6828
7026
|
}),
|
|
6829
7027
|
responses: {
|
|
6830
|
-
302:
|
|
7028
|
+
302: z20.undefined(),
|
|
6831
7029
|
// Redirect to presigned URL
|
|
6832
7030
|
401: publicApiErrorSchema,
|
|
6833
7031
|
404: publicApiErrorSchema,
|
|
@@ -10898,7 +11096,7 @@ var benchmarkCommand = new Command3("benchmark").description(
|
|
|
10898
11096
|
});
|
|
10899
11097
|
|
|
10900
11098
|
// src/index.ts
|
|
10901
|
-
var version = true ? "2.7.
|
|
11099
|
+
var version = true ? "2.7.1" : "0.1.0";
|
|
10902
11100
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
10903
11101
|
program.addCommand(startCommand);
|
|
10904
11102
|
program.addCommand(statusCommand);
|