@vm0/runner 3.1.0 → 3.2.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 +219 -153
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7463,6 +7463,9 @@ var realtimeTokenContract = c14.router({
|
|
|
7463
7463
|
}
|
|
7464
7464
|
});
|
|
7465
7465
|
|
|
7466
|
+
// ../../packages/core/src/contracts/platform.ts
|
|
7467
|
+
import { z as z21 } from "zod";
|
|
7468
|
+
|
|
7466
7469
|
// ../../packages/core/src/contracts/public/common.ts
|
|
7467
7470
|
import { z as z20 } from "zod";
|
|
7468
7471
|
var publicApiErrorTypeSchema = z20.enum([
|
|
@@ -7503,29 +7506,92 @@ var listQuerySchema = z20.object({
|
|
|
7503
7506
|
var requestIdSchema = z20.string().uuid();
|
|
7504
7507
|
var timestampSchema = z20.string().datetime();
|
|
7505
7508
|
|
|
7506
|
-
// ../../packages/core/src/contracts/
|
|
7507
|
-
import { z as z21 } from "zod";
|
|
7509
|
+
// ../../packages/core/src/contracts/platform.ts
|
|
7508
7510
|
var c15 = initContract();
|
|
7509
|
-
var
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7511
|
+
var platformLogStatusSchema = z21.enum([
|
|
7512
|
+
"pending",
|
|
7513
|
+
"running",
|
|
7514
|
+
"completed",
|
|
7515
|
+
"failed",
|
|
7516
|
+
"timeout",
|
|
7517
|
+
"cancelled"
|
|
7518
|
+
]);
|
|
7519
|
+
var platformLogEntrySchema = z21.object({
|
|
7520
|
+
id: z21.string().uuid()
|
|
7521
|
+
});
|
|
7522
|
+
var platformLogsListResponseSchema = createPaginatedResponseSchema(
|
|
7523
|
+
platformLogEntrySchema
|
|
7524
|
+
);
|
|
7525
|
+
var artifactSchema = z21.object({
|
|
7526
|
+
name: z21.string().nullable(),
|
|
7527
|
+
version: z21.string().nullable()
|
|
7528
|
+
});
|
|
7529
|
+
var platformLogDetailSchema = z21.object({
|
|
7530
|
+
id: z21.string().uuid(),
|
|
7531
|
+
sessionId: z21.string().nullable(),
|
|
7532
|
+
agentName: z21.string(),
|
|
7533
|
+
provider: z21.string(),
|
|
7534
|
+
status: platformLogStatusSchema,
|
|
7535
|
+
prompt: z21.string(),
|
|
7536
|
+
error: z21.string().nullable(),
|
|
7537
|
+
createdAt: z21.string(),
|
|
7538
|
+
startedAt: z21.string().nullable(),
|
|
7539
|
+
completedAt: z21.string().nullable(),
|
|
7540
|
+
artifact: artifactSchema
|
|
7541
|
+
});
|
|
7542
|
+
var platformLogsListContract = c15.router({
|
|
7543
|
+
list: {
|
|
7544
|
+
method: "GET",
|
|
7545
|
+
path: "/api/platform/logs",
|
|
7546
|
+
query: listQuerySchema.extend({
|
|
7547
|
+
search: z21.string().optional()
|
|
7548
|
+
}),
|
|
7549
|
+
responses: {
|
|
7550
|
+
200: platformLogsListResponseSchema,
|
|
7551
|
+
401: apiErrorSchema
|
|
7552
|
+
},
|
|
7553
|
+
summary: "List agent run logs with pagination"
|
|
7554
|
+
}
|
|
7555
|
+
});
|
|
7556
|
+
var platformLogsByIdContract = c15.router({
|
|
7557
|
+
getById: {
|
|
7558
|
+
method: "GET",
|
|
7559
|
+
path: "/api/platform/logs/:id",
|
|
7560
|
+
pathParams: z21.object({
|
|
7561
|
+
id: z21.string().uuid("Invalid log ID")
|
|
7562
|
+
}),
|
|
7563
|
+
responses: {
|
|
7564
|
+
200: platformLogDetailSchema,
|
|
7565
|
+
401: apiErrorSchema,
|
|
7566
|
+
404: apiErrorSchema
|
|
7567
|
+
},
|
|
7568
|
+
summary: "Get agent run log details by ID"
|
|
7569
|
+
}
|
|
7570
|
+
});
|
|
7571
|
+
|
|
7572
|
+
// ../../packages/core/src/contracts/public/agents.ts
|
|
7573
|
+
import { z as z22 } from "zod";
|
|
7574
|
+
var c16 = initContract();
|
|
7575
|
+
var publicAgentSchema = z22.object({
|
|
7576
|
+
id: z22.string(),
|
|
7577
|
+
name: z22.string(),
|
|
7578
|
+
current_version_id: z22.string().nullable(),
|
|
7513
7579
|
created_at: timestampSchema,
|
|
7514
7580
|
updated_at: timestampSchema
|
|
7515
7581
|
});
|
|
7516
|
-
var agentVersionSchema =
|
|
7517
|
-
id:
|
|
7518
|
-
agent_id:
|
|
7519
|
-
version_number:
|
|
7582
|
+
var agentVersionSchema = z22.object({
|
|
7583
|
+
id: z22.string(),
|
|
7584
|
+
agent_id: z22.string(),
|
|
7585
|
+
version_number: z22.number(),
|
|
7520
7586
|
created_at: timestampSchema
|
|
7521
7587
|
});
|
|
7522
7588
|
var publicAgentDetailSchema = publicAgentSchema;
|
|
7523
7589
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
7524
7590
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
7525
7591
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
7526
|
-
name:
|
|
7592
|
+
name: z22.string().optional()
|
|
7527
7593
|
});
|
|
7528
|
-
var publicAgentsListContract =
|
|
7594
|
+
var publicAgentsListContract = c16.router({
|
|
7529
7595
|
list: {
|
|
7530
7596
|
method: "GET",
|
|
7531
7597
|
path: "/v1/agents",
|
|
@@ -7540,13 +7606,13 @@ var publicAgentsListContract = c15.router({
|
|
|
7540
7606
|
description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
|
|
7541
7607
|
}
|
|
7542
7608
|
});
|
|
7543
|
-
var publicAgentByIdContract =
|
|
7609
|
+
var publicAgentByIdContract = c16.router({
|
|
7544
7610
|
get: {
|
|
7545
7611
|
method: "GET",
|
|
7546
7612
|
path: "/v1/agents/:id",
|
|
7547
7613
|
headers: authHeadersSchema,
|
|
7548
|
-
pathParams:
|
|
7549
|
-
id:
|
|
7614
|
+
pathParams: z22.object({
|
|
7615
|
+
id: z22.string().min(1, "Agent ID is required")
|
|
7550
7616
|
}),
|
|
7551
7617
|
responses: {
|
|
7552
7618
|
200: publicAgentDetailSchema,
|
|
@@ -7558,13 +7624,13 @@ var publicAgentByIdContract = c15.router({
|
|
|
7558
7624
|
description: "Get agent details by ID"
|
|
7559
7625
|
}
|
|
7560
7626
|
});
|
|
7561
|
-
var publicAgentVersionsContract =
|
|
7627
|
+
var publicAgentVersionsContract = c16.router({
|
|
7562
7628
|
list: {
|
|
7563
7629
|
method: "GET",
|
|
7564
7630
|
path: "/v1/agents/:id/versions",
|
|
7565
7631
|
headers: authHeadersSchema,
|
|
7566
|
-
pathParams:
|
|
7567
|
-
id:
|
|
7632
|
+
pathParams: z22.object({
|
|
7633
|
+
id: z22.string().min(1, "Agent ID is required")
|
|
7568
7634
|
}),
|
|
7569
7635
|
query: listQuerySchema,
|
|
7570
7636
|
responses: {
|
|
@@ -7579,9 +7645,9 @@ var publicAgentVersionsContract = c15.router({
|
|
|
7579
7645
|
});
|
|
7580
7646
|
|
|
7581
7647
|
// ../../packages/core/src/contracts/public/runs.ts
|
|
7582
|
-
import { z as
|
|
7583
|
-
var
|
|
7584
|
-
var publicRunStatusSchema =
|
|
7648
|
+
import { z as z23 } from "zod";
|
|
7649
|
+
var c17 = initContract();
|
|
7650
|
+
var publicRunStatusSchema = z23.enum([
|
|
7585
7651
|
"pending",
|
|
7586
7652
|
"running",
|
|
7587
7653
|
"completed",
|
|
@@ -7589,56 +7655,56 @@ var publicRunStatusSchema = z22.enum([
|
|
|
7589
7655
|
"timeout",
|
|
7590
7656
|
"cancelled"
|
|
7591
7657
|
]);
|
|
7592
|
-
var publicRunSchema =
|
|
7593
|
-
id:
|
|
7594
|
-
agent_id:
|
|
7595
|
-
agent_name:
|
|
7658
|
+
var publicRunSchema = z23.object({
|
|
7659
|
+
id: z23.string(),
|
|
7660
|
+
agent_id: z23.string(),
|
|
7661
|
+
agent_name: z23.string(),
|
|
7596
7662
|
status: publicRunStatusSchema,
|
|
7597
|
-
prompt:
|
|
7663
|
+
prompt: z23.string(),
|
|
7598
7664
|
created_at: timestampSchema,
|
|
7599
7665
|
started_at: timestampSchema.nullable(),
|
|
7600
7666
|
completed_at: timestampSchema.nullable()
|
|
7601
7667
|
});
|
|
7602
7668
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
7603
|
-
error:
|
|
7604
|
-
execution_time_ms:
|
|
7605
|
-
checkpoint_id:
|
|
7606
|
-
session_id:
|
|
7607
|
-
artifact_name:
|
|
7608
|
-
artifact_version:
|
|
7609
|
-
volumes:
|
|
7669
|
+
error: z23.string().nullable(),
|
|
7670
|
+
execution_time_ms: z23.number().nullable(),
|
|
7671
|
+
checkpoint_id: z23.string().nullable(),
|
|
7672
|
+
session_id: z23.string().nullable(),
|
|
7673
|
+
artifact_name: z23.string().nullable(),
|
|
7674
|
+
artifact_version: z23.string().nullable(),
|
|
7675
|
+
volumes: z23.record(z23.string(), z23.string()).optional()
|
|
7610
7676
|
});
|
|
7611
7677
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
7612
|
-
var createRunRequestSchema =
|
|
7678
|
+
var createRunRequestSchema = z23.object({
|
|
7613
7679
|
// Agent identification (one of: agent, agent_id, session_id, checkpoint_id)
|
|
7614
|
-
agent:
|
|
7680
|
+
agent: z23.string().optional(),
|
|
7615
7681
|
// Agent name
|
|
7616
|
-
agent_id:
|
|
7682
|
+
agent_id: z23.string().optional(),
|
|
7617
7683
|
// Agent ID
|
|
7618
|
-
agent_version:
|
|
7684
|
+
agent_version: z23.string().optional(),
|
|
7619
7685
|
// Version specifier (e.g., "latest", "v1", specific ID)
|
|
7620
7686
|
// Continue session
|
|
7621
|
-
session_id:
|
|
7687
|
+
session_id: z23.string().optional(),
|
|
7622
7688
|
// Resume from checkpoint
|
|
7623
|
-
checkpoint_id:
|
|
7689
|
+
checkpoint_id: z23.string().optional(),
|
|
7624
7690
|
// Required
|
|
7625
|
-
prompt:
|
|
7691
|
+
prompt: z23.string().min(1, "Prompt is required"),
|
|
7626
7692
|
// Optional configuration
|
|
7627
|
-
variables:
|
|
7628
|
-
secrets:
|
|
7629
|
-
artifact_name:
|
|
7693
|
+
variables: z23.record(z23.string(), z23.string()).optional(),
|
|
7694
|
+
secrets: z23.record(z23.string(), z23.string()).optional(),
|
|
7695
|
+
artifact_name: z23.string().optional(),
|
|
7630
7696
|
// Artifact name to mount
|
|
7631
|
-
artifact_version:
|
|
7697
|
+
artifact_version: z23.string().optional(),
|
|
7632
7698
|
// Artifact version (defaults to latest)
|
|
7633
|
-
volumes:
|
|
7699
|
+
volumes: z23.record(z23.string(), z23.string()).optional()
|
|
7634
7700
|
// volume_name -> version
|
|
7635
7701
|
});
|
|
7636
7702
|
var runListQuerySchema = listQuerySchema.extend({
|
|
7637
|
-
agent_id:
|
|
7703
|
+
agent_id: z23.string().optional(),
|
|
7638
7704
|
status: publicRunStatusSchema.optional(),
|
|
7639
7705
|
since: timestampSchema.optional()
|
|
7640
7706
|
});
|
|
7641
|
-
var publicRunsListContract =
|
|
7707
|
+
var publicRunsListContract = c17.router({
|
|
7642
7708
|
list: {
|
|
7643
7709
|
method: "GET",
|
|
7644
7710
|
path: "/v1/runs",
|
|
@@ -7669,13 +7735,13 @@ var publicRunsListContract = c16.router({
|
|
|
7669
7735
|
description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
|
|
7670
7736
|
}
|
|
7671
7737
|
});
|
|
7672
|
-
var publicRunByIdContract =
|
|
7738
|
+
var publicRunByIdContract = c17.router({
|
|
7673
7739
|
get: {
|
|
7674
7740
|
method: "GET",
|
|
7675
7741
|
path: "/v1/runs/:id",
|
|
7676
7742
|
headers: authHeadersSchema,
|
|
7677
|
-
pathParams:
|
|
7678
|
-
id:
|
|
7743
|
+
pathParams: z23.object({
|
|
7744
|
+
id: z23.string().min(1, "Run ID is required")
|
|
7679
7745
|
}),
|
|
7680
7746
|
responses: {
|
|
7681
7747
|
200: publicRunDetailSchema,
|
|
@@ -7687,15 +7753,15 @@ var publicRunByIdContract = c16.router({
|
|
|
7687
7753
|
description: "Get run details by ID"
|
|
7688
7754
|
}
|
|
7689
7755
|
});
|
|
7690
|
-
var publicRunCancelContract =
|
|
7756
|
+
var publicRunCancelContract = c17.router({
|
|
7691
7757
|
cancel: {
|
|
7692
7758
|
method: "POST",
|
|
7693
7759
|
path: "/v1/runs/:id/cancel",
|
|
7694
7760
|
headers: authHeadersSchema,
|
|
7695
|
-
pathParams:
|
|
7696
|
-
id:
|
|
7761
|
+
pathParams: z23.object({
|
|
7762
|
+
id: z23.string().min(1, "Run ID is required")
|
|
7697
7763
|
}),
|
|
7698
|
-
body:
|
|
7764
|
+
body: z23.undefined(),
|
|
7699
7765
|
responses: {
|
|
7700
7766
|
200: publicRunDetailSchema,
|
|
7701
7767
|
400: publicApiErrorSchema,
|
|
@@ -7708,27 +7774,27 @@ var publicRunCancelContract = c16.router({
|
|
|
7708
7774
|
description: "Cancel a pending or running execution"
|
|
7709
7775
|
}
|
|
7710
7776
|
});
|
|
7711
|
-
var logEntrySchema =
|
|
7777
|
+
var logEntrySchema = z23.object({
|
|
7712
7778
|
timestamp: timestampSchema,
|
|
7713
|
-
type:
|
|
7714
|
-
level:
|
|
7715
|
-
message:
|
|
7716
|
-
metadata:
|
|
7779
|
+
type: z23.enum(["agent", "system", "network"]),
|
|
7780
|
+
level: z23.enum(["debug", "info", "warn", "error"]),
|
|
7781
|
+
message: z23.string(),
|
|
7782
|
+
metadata: z23.record(z23.string(), z23.unknown()).optional()
|
|
7717
7783
|
});
|
|
7718
7784
|
var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
|
|
7719
7785
|
var logsQuerySchema = listQuerySchema.extend({
|
|
7720
|
-
type:
|
|
7786
|
+
type: z23.enum(["agent", "system", "network", "all"]).default("all"),
|
|
7721
7787
|
since: timestampSchema.optional(),
|
|
7722
7788
|
until: timestampSchema.optional(),
|
|
7723
|
-
order:
|
|
7789
|
+
order: z23.enum(["asc", "desc"]).default("asc")
|
|
7724
7790
|
});
|
|
7725
|
-
var publicRunLogsContract =
|
|
7791
|
+
var publicRunLogsContract = c17.router({
|
|
7726
7792
|
getLogs: {
|
|
7727
7793
|
method: "GET",
|
|
7728
7794
|
path: "/v1/runs/:id/logs",
|
|
7729
7795
|
headers: authHeadersSchema,
|
|
7730
|
-
pathParams:
|
|
7731
|
-
id:
|
|
7796
|
+
pathParams: z23.object({
|
|
7797
|
+
id: z23.string().min(1, "Run ID is required")
|
|
7732
7798
|
}),
|
|
7733
7799
|
query: logsQuerySchema,
|
|
7734
7800
|
responses: {
|
|
@@ -7741,30 +7807,30 @@ var publicRunLogsContract = c16.router({
|
|
|
7741
7807
|
description: "Get unified logs for a run. Combines agent, system, and network logs."
|
|
7742
7808
|
}
|
|
7743
7809
|
});
|
|
7744
|
-
var metricPointSchema =
|
|
7810
|
+
var metricPointSchema = z23.object({
|
|
7745
7811
|
timestamp: timestampSchema,
|
|
7746
|
-
cpu_percent:
|
|
7747
|
-
memory_used_mb:
|
|
7748
|
-
memory_total_mb:
|
|
7749
|
-
disk_used_mb:
|
|
7750
|
-
disk_total_mb:
|
|
7751
|
-
});
|
|
7752
|
-
var metricsSummarySchema =
|
|
7753
|
-
avg_cpu_percent:
|
|
7754
|
-
max_memory_used_mb:
|
|
7755
|
-
total_duration_ms:
|
|
7756
|
-
});
|
|
7757
|
-
var metricsResponseSchema2 =
|
|
7758
|
-
data:
|
|
7812
|
+
cpu_percent: z23.number(),
|
|
7813
|
+
memory_used_mb: z23.number(),
|
|
7814
|
+
memory_total_mb: z23.number(),
|
|
7815
|
+
disk_used_mb: z23.number(),
|
|
7816
|
+
disk_total_mb: z23.number()
|
|
7817
|
+
});
|
|
7818
|
+
var metricsSummarySchema = z23.object({
|
|
7819
|
+
avg_cpu_percent: z23.number(),
|
|
7820
|
+
max_memory_used_mb: z23.number(),
|
|
7821
|
+
total_duration_ms: z23.number().nullable()
|
|
7822
|
+
});
|
|
7823
|
+
var metricsResponseSchema2 = z23.object({
|
|
7824
|
+
data: z23.array(metricPointSchema),
|
|
7759
7825
|
summary: metricsSummarySchema
|
|
7760
7826
|
});
|
|
7761
|
-
var publicRunMetricsContract =
|
|
7827
|
+
var publicRunMetricsContract = c17.router({
|
|
7762
7828
|
getMetrics: {
|
|
7763
7829
|
method: "GET",
|
|
7764
7830
|
path: "/v1/runs/:id/metrics",
|
|
7765
7831
|
headers: authHeadersSchema,
|
|
7766
|
-
pathParams:
|
|
7767
|
-
id:
|
|
7832
|
+
pathParams: z23.object({
|
|
7833
|
+
id: z23.string().min(1, "Run ID is required")
|
|
7768
7834
|
}),
|
|
7769
7835
|
responses: {
|
|
7770
7836
|
200: metricsResponseSchema2,
|
|
@@ -7776,7 +7842,7 @@ var publicRunMetricsContract = c16.router({
|
|
|
7776
7842
|
description: "Get CPU, memory, and disk metrics for a run"
|
|
7777
7843
|
}
|
|
7778
7844
|
});
|
|
7779
|
-
var sseEventTypeSchema =
|
|
7845
|
+
var sseEventTypeSchema = z23.enum([
|
|
7780
7846
|
"status",
|
|
7781
7847
|
// Run status change
|
|
7782
7848
|
"output",
|
|
@@ -7788,26 +7854,26 @@ var sseEventTypeSchema = z22.enum([
|
|
|
7788
7854
|
"heartbeat"
|
|
7789
7855
|
// Keep-alive
|
|
7790
7856
|
]);
|
|
7791
|
-
var sseEventSchema =
|
|
7857
|
+
var sseEventSchema = z23.object({
|
|
7792
7858
|
event: sseEventTypeSchema,
|
|
7793
|
-
data:
|
|
7794
|
-
id:
|
|
7859
|
+
data: z23.unknown(),
|
|
7860
|
+
id: z23.string().optional()
|
|
7795
7861
|
// For Last-Event-ID reconnection
|
|
7796
7862
|
});
|
|
7797
|
-
var publicRunEventsContract =
|
|
7863
|
+
var publicRunEventsContract = c17.router({
|
|
7798
7864
|
streamEvents: {
|
|
7799
7865
|
method: "GET",
|
|
7800
7866
|
path: "/v1/runs/:id/events",
|
|
7801
7867
|
headers: authHeadersSchema,
|
|
7802
|
-
pathParams:
|
|
7803
|
-
id:
|
|
7868
|
+
pathParams: z23.object({
|
|
7869
|
+
id: z23.string().min(1, "Run ID is required")
|
|
7804
7870
|
}),
|
|
7805
|
-
query:
|
|
7806
|
-
last_event_id:
|
|
7871
|
+
query: z23.object({
|
|
7872
|
+
last_event_id: z23.string().optional()
|
|
7807
7873
|
// For reconnection
|
|
7808
7874
|
}),
|
|
7809
7875
|
responses: {
|
|
7810
|
-
200:
|
|
7876
|
+
200: z23.any(),
|
|
7811
7877
|
// SSE stream - actual content is text/event-stream
|
|
7812
7878
|
401: publicApiErrorSchema,
|
|
7813
7879
|
404: publicApiErrorSchema,
|
|
@@ -7819,28 +7885,28 @@ var publicRunEventsContract = c16.router({
|
|
|
7819
7885
|
});
|
|
7820
7886
|
|
|
7821
7887
|
// ../../packages/core/src/contracts/public/artifacts.ts
|
|
7822
|
-
import { z as
|
|
7823
|
-
var
|
|
7824
|
-
var publicArtifactSchema =
|
|
7825
|
-
id:
|
|
7826
|
-
name:
|
|
7827
|
-
current_version_id:
|
|
7828
|
-
size:
|
|
7888
|
+
import { z as z24 } from "zod";
|
|
7889
|
+
var c18 = initContract();
|
|
7890
|
+
var publicArtifactSchema = z24.object({
|
|
7891
|
+
id: z24.string(),
|
|
7892
|
+
name: z24.string(),
|
|
7893
|
+
current_version_id: z24.string().nullable(),
|
|
7894
|
+
size: z24.number(),
|
|
7829
7895
|
// Total size in bytes
|
|
7830
|
-
file_count:
|
|
7896
|
+
file_count: z24.number(),
|
|
7831
7897
|
created_at: timestampSchema,
|
|
7832
7898
|
updated_at: timestampSchema
|
|
7833
7899
|
});
|
|
7834
|
-
var artifactVersionSchema =
|
|
7835
|
-
id:
|
|
7900
|
+
var artifactVersionSchema = z24.object({
|
|
7901
|
+
id: z24.string(),
|
|
7836
7902
|
// SHA-256 content hash
|
|
7837
|
-
artifact_id:
|
|
7838
|
-
size:
|
|
7903
|
+
artifact_id: z24.string(),
|
|
7904
|
+
size: z24.number(),
|
|
7839
7905
|
// Size in bytes
|
|
7840
|
-
file_count:
|
|
7841
|
-
message:
|
|
7906
|
+
file_count: z24.number(),
|
|
7907
|
+
message: z24.string().nullable(),
|
|
7842
7908
|
// Optional commit message
|
|
7843
|
-
created_by:
|
|
7909
|
+
created_by: z24.string(),
|
|
7844
7910
|
created_at: timestampSchema
|
|
7845
7911
|
});
|
|
7846
7912
|
var publicArtifactDetailSchema = publicArtifactSchema.extend({
|
|
@@ -7850,7 +7916,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
7850
7916
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
7851
7917
|
artifactVersionSchema
|
|
7852
7918
|
);
|
|
7853
|
-
var publicArtifactsListContract =
|
|
7919
|
+
var publicArtifactsListContract = c18.router({
|
|
7854
7920
|
list: {
|
|
7855
7921
|
method: "GET",
|
|
7856
7922
|
path: "/v1/artifacts",
|
|
@@ -7865,13 +7931,13 @@ var publicArtifactsListContract = c17.router({
|
|
|
7865
7931
|
description: "List all artifacts in the current scope with pagination"
|
|
7866
7932
|
}
|
|
7867
7933
|
});
|
|
7868
|
-
var publicArtifactByIdContract =
|
|
7934
|
+
var publicArtifactByIdContract = c18.router({
|
|
7869
7935
|
get: {
|
|
7870
7936
|
method: "GET",
|
|
7871
7937
|
path: "/v1/artifacts/:id",
|
|
7872
7938
|
headers: authHeadersSchema,
|
|
7873
|
-
pathParams:
|
|
7874
|
-
id:
|
|
7939
|
+
pathParams: z24.object({
|
|
7940
|
+
id: z24.string().min(1, "Artifact ID is required")
|
|
7875
7941
|
}),
|
|
7876
7942
|
responses: {
|
|
7877
7943
|
200: publicArtifactDetailSchema,
|
|
@@ -7883,13 +7949,13 @@ var publicArtifactByIdContract = c17.router({
|
|
|
7883
7949
|
description: "Get artifact details by ID"
|
|
7884
7950
|
}
|
|
7885
7951
|
});
|
|
7886
|
-
var publicArtifactVersionsContract =
|
|
7952
|
+
var publicArtifactVersionsContract = c18.router({
|
|
7887
7953
|
list: {
|
|
7888
7954
|
method: "GET",
|
|
7889
7955
|
path: "/v1/artifacts/:id/versions",
|
|
7890
7956
|
headers: authHeadersSchema,
|
|
7891
|
-
pathParams:
|
|
7892
|
-
id:
|
|
7957
|
+
pathParams: z24.object({
|
|
7958
|
+
id: z24.string().min(1, "Artifact ID is required")
|
|
7893
7959
|
}),
|
|
7894
7960
|
query: listQuerySchema,
|
|
7895
7961
|
responses: {
|
|
@@ -7902,20 +7968,20 @@ var publicArtifactVersionsContract = c17.router({
|
|
|
7902
7968
|
description: "List all versions of an artifact with pagination"
|
|
7903
7969
|
}
|
|
7904
7970
|
});
|
|
7905
|
-
var publicArtifactDownloadContract =
|
|
7971
|
+
var publicArtifactDownloadContract = c18.router({
|
|
7906
7972
|
download: {
|
|
7907
7973
|
method: "GET",
|
|
7908
7974
|
path: "/v1/artifacts/:id/download",
|
|
7909
7975
|
headers: authHeadersSchema,
|
|
7910
|
-
pathParams:
|
|
7911
|
-
id:
|
|
7976
|
+
pathParams: z24.object({
|
|
7977
|
+
id: z24.string().min(1, "Artifact ID is required")
|
|
7912
7978
|
}),
|
|
7913
|
-
query:
|
|
7914
|
-
version_id:
|
|
7979
|
+
query: z24.object({
|
|
7980
|
+
version_id: z24.string().optional()
|
|
7915
7981
|
// Defaults to current version
|
|
7916
7982
|
}),
|
|
7917
7983
|
responses: {
|
|
7918
|
-
302:
|
|
7984
|
+
302: z24.undefined(),
|
|
7919
7985
|
// Redirect to presigned URL
|
|
7920
7986
|
401: publicApiErrorSchema,
|
|
7921
7987
|
404: publicApiErrorSchema,
|
|
@@ -7927,28 +7993,28 @@ var publicArtifactDownloadContract = c17.router({
|
|
|
7927
7993
|
});
|
|
7928
7994
|
|
|
7929
7995
|
// ../../packages/core/src/contracts/public/volumes.ts
|
|
7930
|
-
import { z as
|
|
7931
|
-
var
|
|
7932
|
-
var publicVolumeSchema =
|
|
7933
|
-
id:
|
|
7934
|
-
name:
|
|
7935
|
-
current_version_id:
|
|
7936
|
-
size:
|
|
7996
|
+
import { z as z25 } from "zod";
|
|
7997
|
+
var c19 = initContract();
|
|
7998
|
+
var publicVolumeSchema = z25.object({
|
|
7999
|
+
id: z25.string(),
|
|
8000
|
+
name: z25.string(),
|
|
8001
|
+
current_version_id: z25.string().nullable(),
|
|
8002
|
+
size: z25.number(),
|
|
7937
8003
|
// Total size in bytes
|
|
7938
|
-
file_count:
|
|
8004
|
+
file_count: z25.number(),
|
|
7939
8005
|
created_at: timestampSchema,
|
|
7940
8006
|
updated_at: timestampSchema
|
|
7941
8007
|
});
|
|
7942
|
-
var volumeVersionSchema =
|
|
7943
|
-
id:
|
|
8008
|
+
var volumeVersionSchema = z25.object({
|
|
8009
|
+
id: z25.string(),
|
|
7944
8010
|
// SHA-256 content hash
|
|
7945
|
-
volume_id:
|
|
7946
|
-
size:
|
|
8011
|
+
volume_id: z25.string(),
|
|
8012
|
+
size: z25.number(),
|
|
7947
8013
|
// Size in bytes
|
|
7948
|
-
file_count:
|
|
7949
|
-
message:
|
|
8014
|
+
file_count: z25.number(),
|
|
8015
|
+
message: z25.string().nullable(),
|
|
7950
8016
|
// Optional commit message
|
|
7951
|
-
created_by:
|
|
8017
|
+
created_by: z25.string(),
|
|
7952
8018
|
created_at: timestampSchema
|
|
7953
8019
|
});
|
|
7954
8020
|
var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
@@ -7956,7 +8022,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
7956
8022
|
});
|
|
7957
8023
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
7958
8024
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
7959
|
-
var publicVolumesListContract =
|
|
8025
|
+
var publicVolumesListContract = c19.router({
|
|
7960
8026
|
list: {
|
|
7961
8027
|
method: "GET",
|
|
7962
8028
|
path: "/v1/volumes",
|
|
@@ -7971,13 +8037,13 @@ var publicVolumesListContract = c18.router({
|
|
|
7971
8037
|
description: "List all volumes in the current scope with pagination"
|
|
7972
8038
|
}
|
|
7973
8039
|
});
|
|
7974
|
-
var publicVolumeByIdContract =
|
|
8040
|
+
var publicVolumeByIdContract = c19.router({
|
|
7975
8041
|
get: {
|
|
7976
8042
|
method: "GET",
|
|
7977
8043
|
path: "/v1/volumes/:id",
|
|
7978
8044
|
headers: authHeadersSchema,
|
|
7979
|
-
pathParams:
|
|
7980
|
-
id:
|
|
8045
|
+
pathParams: z25.object({
|
|
8046
|
+
id: z25.string().min(1, "Volume ID is required")
|
|
7981
8047
|
}),
|
|
7982
8048
|
responses: {
|
|
7983
8049
|
200: publicVolumeDetailSchema,
|
|
@@ -7989,13 +8055,13 @@ var publicVolumeByIdContract = c18.router({
|
|
|
7989
8055
|
description: "Get volume details by ID"
|
|
7990
8056
|
}
|
|
7991
8057
|
});
|
|
7992
|
-
var publicVolumeVersionsContract =
|
|
8058
|
+
var publicVolumeVersionsContract = c19.router({
|
|
7993
8059
|
list: {
|
|
7994
8060
|
method: "GET",
|
|
7995
8061
|
path: "/v1/volumes/:id/versions",
|
|
7996
8062
|
headers: authHeadersSchema,
|
|
7997
|
-
pathParams:
|
|
7998
|
-
id:
|
|
8063
|
+
pathParams: z25.object({
|
|
8064
|
+
id: z25.string().min(1, "Volume ID is required")
|
|
7999
8065
|
}),
|
|
8000
8066
|
query: listQuerySchema,
|
|
8001
8067
|
responses: {
|
|
@@ -8008,20 +8074,20 @@ var publicVolumeVersionsContract = c18.router({
|
|
|
8008
8074
|
description: "List all versions of a volume with pagination"
|
|
8009
8075
|
}
|
|
8010
8076
|
});
|
|
8011
|
-
var publicVolumeDownloadContract =
|
|
8077
|
+
var publicVolumeDownloadContract = c19.router({
|
|
8012
8078
|
download: {
|
|
8013
8079
|
method: "GET",
|
|
8014
8080
|
path: "/v1/volumes/:id/download",
|
|
8015
8081
|
headers: authHeadersSchema,
|
|
8016
|
-
pathParams:
|
|
8017
|
-
id:
|
|
8082
|
+
pathParams: z25.object({
|
|
8083
|
+
id: z25.string().min(1, "Volume ID is required")
|
|
8018
8084
|
}),
|
|
8019
|
-
query:
|
|
8020
|
-
version_id:
|
|
8085
|
+
query: z25.object({
|
|
8086
|
+
version_id: z25.string().optional()
|
|
8021
8087
|
// Defaults to current version
|
|
8022
8088
|
}),
|
|
8023
8089
|
responses: {
|
|
8024
|
-
302:
|
|
8090
|
+
302: z25.undefined(),
|
|
8025
8091
|
// Redirect to presigned URL
|
|
8026
8092
|
401: publicApiErrorSchema,
|
|
8027
8093
|
404: publicApiErrorSchema,
|
|
@@ -10264,14 +10330,14 @@ var Timer = class {
|
|
|
10264
10330
|
this.startTime = Date.now();
|
|
10265
10331
|
}
|
|
10266
10332
|
/**
|
|
10267
|
-
* Get elapsed time formatted as [MM:SS.
|
|
10333
|
+
* Get elapsed time formatted as [MM:SS.mmm]
|
|
10268
10334
|
*/
|
|
10269
10335
|
elapsed() {
|
|
10270
10336
|
const ms = Date.now() - this.startTime;
|
|
10271
|
-
const
|
|
10272
|
-
const
|
|
10273
|
-
const
|
|
10274
|
-
return `[${String(minutes).padStart(2, "0")}:${seconds.padStart(
|
|
10337
|
+
const minutes = Math.floor(ms / 6e4);
|
|
10338
|
+
const seconds = Math.floor(ms % 6e4 / 1e3);
|
|
10339
|
+
const millis = ms % 1e3;
|
|
10340
|
+
return `[${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(millis).padStart(3, "0")}]`;
|
|
10275
10341
|
}
|
|
10276
10342
|
/**
|
|
10277
10343
|
* Log message with timestamp
|
|
@@ -10345,7 +10411,7 @@ var benchmarkCommand = new Command4("benchmark").description(
|
|
|
10345
10411
|
});
|
|
10346
10412
|
|
|
10347
10413
|
// src/index.ts
|
|
10348
|
-
var version = true ? "3.
|
|
10414
|
+
var version = true ? "3.2.0" : "0.1.0";
|
|
10349
10415
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
10350
10416
|
program.addCommand(startCommand);
|
|
10351
10417
|
program.addCommand(doctorCommand);
|