@vm0/runner 2.5.2 → 2.6.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 +14 -309
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6293,19 +6293,11 @@ var agentVersionSchema = z16.object({
|
|
|
6293
6293
|
id: z16.string(),
|
|
6294
6294
|
agent_id: z16.string(),
|
|
6295
6295
|
version_number: z16.number(),
|
|
6296
|
-
config: z16.unknown(),
|
|
6297
|
-
// Agent YAML configuration
|
|
6298
6296
|
created_at: timestampSchema
|
|
6299
6297
|
});
|
|
6300
|
-
var publicAgentDetailSchema = publicAgentSchema
|
|
6301
|
-
config: z16.unknown().optional()
|
|
6302
|
-
});
|
|
6298
|
+
var publicAgentDetailSchema = publicAgentSchema;
|
|
6303
6299
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
6304
6300
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
6305
|
-
var updateAgentRequestSchema = z16.object({
|
|
6306
|
-
config: z16.unknown()
|
|
6307
|
-
// New agent configuration (creates new version)
|
|
6308
|
-
});
|
|
6309
6301
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
6310
6302
|
name: z16.string().optional()
|
|
6311
6303
|
});
|
|
@@ -6338,23 +6330,6 @@ var publicAgentByIdContract = c11.router({
|
|
|
6338
6330
|
},
|
|
6339
6331
|
summary: "Get agent",
|
|
6340
6332
|
description: "Get agent details by ID"
|
|
6341
|
-
},
|
|
6342
|
-
update: {
|
|
6343
|
-
method: "PUT",
|
|
6344
|
-
path: "/v1/agents/:id",
|
|
6345
|
-
pathParams: z16.object({
|
|
6346
|
-
id: z16.string().min(1, "Agent ID is required")
|
|
6347
|
-
}),
|
|
6348
|
-
body: updateAgentRequestSchema,
|
|
6349
|
-
responses: {
|
|
6350
|
-
200: publicAgentDetailSchema,
|
|
6351
|
-
400: publicApiErrorSchema,
|
|
6352
|
-
401: publicApiErrorSchema,
|
|
6353
|
-
404: publicApiErrorSchema,
|
|
6354
|
-
500: publicApiErrorSchema
|
|
6355
|
-
},
|
|
6356
|
-
summary: "Update agent",
|
|
6357
|
-
description: "Update agent configuration. Creates a new version if config changes."
|
|
6358
6333
|
}
|
|
6359
6334
|
});
|
|
6360
6335
|
var publicAgentVersionsContract = c11.router({
|
|
@@ -6398,12 +6373,12 @@ var publicRunSchema = z17.object({
|
|
|
6398
6373
|
completed_at: timestampSchema.nullable()
|
|
6399
6374
|
});
|
|
6400
6375
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
6401
|
-
output: z17.string().nullable(),
|
|
6402
6376
|
error: z17.string().nullable(),
|
|
6403
6377
|
execution_time_ms: z17.number().nullable(),
|
|
6404
6378
|
checkpoint_id: z17.string().nullable(),
|
|
6405
6379
|
session_id: z17.string().nullable(),
|
|
6406
|
-
|
|
6380
|
+
artifact_name: z17.string().nullable(),
|
|
6381
|
+
artifact_version: z17.string().nullable(),
|
|
6407
6382
|
volumes: z17.record(z17.string(), z17.string()).optional()
|
|
6408
6383
|
});
|
|
6409
6384
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
@@ -6424,8 +6399,10 @@ var createRunRequestSchema = z17.object({
|
|
|
6424
6399
|
// Optional configuration
|
|
6425
6400
|
variables: z17.record(z17.string(), z17.string()).optional(),
|
|
6426
6401
|
secrets: z17.record(z17.string(), z17.string()).optional(),
|
|
6427
|
-
|
|
6428
|
-
//
|
|
6402
|
+
artifact_name: z17.string().optional(),
|
|
6403
|
+
// Artifact name to mount
|
|
6404
|
+
artifact_version: z17.string().optional(),
|
|
6405
|
+
// Artifact version (defaults to latest)
|
|
6429
6406
|
volumes: z17.record(z17.string(), z17.string()).optional()
|
|
6430
6407
|
// volume_name -> version
|
|
6431
6408
|
});
|
|
@@ -6639,51 +6616,6 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
6639
6616
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
6640
6617
|
artifactVersionSchema
|
|
6641
6618
|
);
|
|
6642
|
-
var createArtifactRequestSchema = z18.object({
|
|
6643
|
-
name: z18.string().min(1).max(100).regex(
|
|
6644
|
-
/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/,
|
|
6645
|
-
"Name must be lowercase alphanumeric with hyphens, not starting or ending with hyphen"
|
|
6646
|
-
)
|
|
6647
|
-
});
|
|
6648
|
-
var fileEntrySchema = z18.object({
|
|
6649
|
-
path: z18.string(),
|
|
6650
|
-
size: z18.number(),
|
|
6651
|
-
hash: z18.string().optional()
|
|
6652
|
-
// SHA-256 hash of file content
|
|
6653
|
-
});
|
|
6654
|
-
var prepareUploadRequestSchema = z18.object({
|
|
6655
|
-
files: z18.array(fileEntrySchema),
|
|
6656
|
-
message: z18.string().optional()
|
|
6657
|
-
// Optional commit message
|
|
6658
|
-
});
|
|
6659
|
-
var presignedUploadSchema2 = z18.object({
|
|
6660
|
-
path: z18.string(),
|
|
6661
|
-
upload_url: z18.string(),
|
|
6662
|
-
// Presigned S3 URL
|
|
6663
|
-
upload_id: z18.string()
|
|
6664
|
-
// For multi-part uploads
|
|
6665
|
-
});
|
|
6666
|
-
var prepareUploadResponseSchema = z18.object({
|
|
6667
|
-
upload_session_id: z18.string(),
|
|
6668
|
-
files: z18.array(presignedUploadSchema2),
|
|
6669
|
-
expires_at: timestampSchema
|
|
6670
|
-
});
|
|
6671
|
-
var commitUploadRequestSchema = z18.object({
|
|
6672
|
-
upload_session_id: z18.string(),
|
|
6673
|
-
message: z18.string().optional()
|
|
6674
|
-
});
|
|
6675
|
-
var downloadResponseSchema = z18.object({
|
|
6676
|
-
version_id: z18.string(),
|
|
6677
|
-
files: z18.array(
|
|
6678
|
-
z18.object({
|
|
6679
|
-
path: z18.string(),
|
|
6680
|
-
size: z18.number(),
|
|
6681
|
-
download_url: z18.string()
|
|
6682
|
-
// Presigned S3 URL
|
|
6683
|
-
})
|
|
6684
|
-
),
|
|
6685
|
-
expires_at: timestampSchema
|
|
6686
|
-
});
|
|
6687
6619
|
var publicArtifactsListContract = c13.router({
|
|
6688
6620
|
list: {
|
|
6689
6621
|
method: "GET",
|
|
@@ -6696,20 +6628,6 @@ var publicArtifactsListContract = c13.router({
|
|
|
6696
6628
|
},
|
|
6697
6629
|
summary: "List artifacts",
|
|
6698
6630
|
description: "List all artifacts in the current scope with pagination"
|
|
6699
|
-
},
|
|
6700
|
-
create: {
|
|
6701
|
-
method: "POST",
|
|
6702
|
-
path: "/v1/artifacts",
|
|
6703
|
-
body: createArtifactRequestSchema,
|
|
6704
|
-
responses: {
|
|
6705
|
-
201: publicArtifactDetailSchema,
|
|
6706
|
-
400: publicApiErrorSchema,
|
|
6707
|
-
401: publicApiErrorSchema,
|
|
6708
|
-
409: publicApiErrorSchema,
|
|
6709
|
-
500: publicApiErrorSchema
|
|
6710
|
-
},
|
|
6711
|
-
summary: "Create artifact",
|
|
6712
|
-
description: "Create a new empty artifact container"
|
|
6713
6631
|
}
|
|
6714
6632
|
});
|
|
6715
6633
|
var publicArtifactByIdContract = c13.router({
|
|
@@ -6747,44 +6665,6 @@ var publicArtifactVersionsContract = c13.router({
|
|
|
6747
6665
|
description: "List all versions of an artifact with pagination"
|
|
6748
6666
|
}
|
|
6749
6667
|
});
|
|
6750
|
-
var publicArtifactUploadContract = c13.router({
|
|
6751
|
-
prepareUpload: {
|
|
6752
|
-
method: "POST",
|
|
6753
|
-
path: "/v1/artifacts/:id/upload",
|
|
6754
|
-
pathParams: z18.object({
|
|
6755
|
-
id: z18.string().min(1, "Artifact ID is required")
|
|
6756
|
-
}),
|
|
6757
|
-
body: prepareUploadRequestSchema,
|
|
6758
|
-
responses: {
|
|
6759
|
-
200: prepareUploadResponseSchema,
|
|
6760
|
-
400: publicApiErrorSchema,
|
|
6761
|
-
401: publicApiErrorSchema,
|
|
6762
|
-
404: publicApiErrorSchema,
|
|
6763
|
-
500: publicApiErrorSchema
|
|
6764
|
-
},
|
|
6765
|
-
summary: "Prepare artifact upload",
|
|
6766
|
-
description: "Get presigned URLs for direct S3 upload. Returns upload URLs for each file."
|
|
6767
|
-
}
|
|
6768
|
-
});
|
|
6769
|
-
var publicArtifactCommitContract = c13.router({
|
|
6770
|
-
commitUpload: {
|
|
6771
|
-
method: "POST",
|
|
6772
|
-
path: "/v1/artifacts/:id/commit",
|
|
6773
|
-
pathParams: z18.object({
|
|
6774
|
-
id: z18.string().min(1, "Artifact ID is required")
|
|
6775
|
-
}),
|
|
6776
|
-
body: commitUploadRequestSchema,
|
|
6777
|
-
responses: {
|
|
6778
|
-
200: artifactVersionSchema,
|
|
6779
|
-
400: publicApiErrorSchema,
|
|
6780
|
-
401: publicApiErrorSchema,
|
|
6781
|
-
404: publicApiErrorSchema,
|
|
6782
|
-
500: publicApiErrorSchema
|
|
6783
|
-
},
|
|
6784
|
-
summary: "Commit artifact upload",
|
|
6785
|
-
description: "Finalize an upload session and create a new artifact version."
|
|
6786
|
-
}
|
|
6787
|
-
});
|
|
6788
6668
|
var publicArtifactDownloadContract = c13.router({
|
|
6789
6669
|
download: {
|
|
6790
6670
|
method: "GET",
|
|
@@ -6797,13 +6677,14 @@ var publicArtifactDownloadContract = c13.router({
|
|
|
6797
6677
|
// Defaults to current version
|
|
6798
6678
|
}),
|
|
6799
6679
|
responses: {
|
|
6800
|
-
|
|
6680
|
+
302: z18.undefined(),
|
|
6681
|
+
// Redirect to presigned URL
|
|
6801
6682
|
401: publicApiErrorSchema,
|
|
6802
6683
|
404: publicApiErrorSchema,
|
|
6803
6684
|
500: publicApiErrorSchema
|
|
6804
6685
|
},
|
|
6805
6686
|
summary: "Download artifact",
|
|
6806
|
-
description: "
|
|
6687
|
+
description: "Redirect to presigned URL for downloading artifact as tar.gz archive. Defaults to current version."
|
|
6807
6688
|
}
|
|
6808
6689
|
});
|
|
6809
6690
|
|
|
@@ -6837,51 +6718,6 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
6837
6718
|
});
|
|
6838
6719
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
6839
6720
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
6840
|
-
var createVolumeRequestSchema = z19.object({
|
|
6841
|
-
name: z19.string().min(1).max(100).regex(
|
|
6842
|
-
/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/,
|
|
6843
|
-
"Name must be lowercase alphanumeric with hyphens, not starting or ending with hyphen"
|
|
6844
|
-
)
|
|
6845
|
-
});
|
|
6846
|
-
var fileEntrySchema2 = z19.object({
|
|
6847
|
-
path: z19.string(),
|
|
6848
|
-
size: z19.number(),
|
|
6849
|
-
hash: z19.string().optional()
|
|
6850
|
-
// SHA-256 hash of file content
|
|
6851
|
-
});
|
|
6852
|
-
var prepareUploadRequestSchema2 = z19.object({
|
|
6853
|
-
files: z19.array(fileEntrySchema2),
|
|
6854
|
-
message: z19.string().optional()
|
|
6855
|
-
// Optional commit message
|
|
6856
|
-
});
|
|
6857
|
-
var presignedUploadSchema3 = z19.object({
|
|
6858
|
-
path: z19.string(),
|
|
6859
|
-
upload_url: z19.string(),
|
|
6860
|
-
// Presigned S3 URL
|
|
6861
|
-
upload_id: z19.string()
|
|
6862
|
-
// For multi-part uploads
|
|
6863
|
-
});
|
|
6864
|
-
var prepareUploadResponseSchema2 = z19.object({
|
|
6865
|
-
upload_session_id: z19.string(),
|
|
6866
|
-
files: z19.array(presignedUploadSchema3),
|
|
6867
|
-
expires_at: timestampSchema
|
|
6868
|
-
});
|
|
6869
|
-
var commitUploadRequestSchema2 = z19.object({
|
|
6870
|
-
upload_session_id: z19.string(),
|
|
6871
|
-
message: z19.string().optional()
|
|
6872
|
-
});
|
|
6873
|
-
var downloadResponseSchema2 = z19.object({
|
|
6874
|
-
version_id: z19.string(),
|
|
6875
|
-
files: z19.array(
|
|
6876
|
-
z19.object({
|
|
6877
|
-
path: z19.string(),
|
|
6878
|
-
size: z19.number(),
|
|
6879
|
-
download_url: z19.string()
|
|
6880
|
-
// Presigned S3 URL
|
|
6881
|
-
})
|
|
6882
|
-
),
|
|
6883
|
-
expires_at: timestampSchema
|
|
6884
|
-
});
|
|
6885
6721
|
var publicVolumesListContract = c14.router({
|
|
6886
6722
|
list: {
|
|
6887
6723
|
method: "GET",
|
|
@@ -6894,20 +6730,6 @@ var publicVolumesListContract = c14.router({
|
|
|
6894
6730
|
},
|
|
6895
6731
|
summary: "List volumes",
|
|
6896
6732
|
description: "List all volumes in the current scope with pagination"
|
|
6897
|
-
},
|
|
6898
|
-
create: {
|
|
6899
|
-
method: "POST",
|
|
6900
|
-
path: "/v1/volumes",
|
|
6901
|
-
body: createVolumeRequestSchema,
|
|
6902
|
-
responses: {
|
|
6903
|
-
201: publicVolumeDetailSchema,
|
|
6904
|
-
400: publicApiErrorSchema,
|
|
6905
|
-
401: publicApiErrorSchema,
|
|
6906
|
-
409: publicApiErrorSchema,
|
|
6907
|
-
500: publicApiErrorSchema
|
|
6908
|
-
},
|
|
6909
|
-
summary: "Create volume",
|
|
6910
|
-
description: "Create a new empty volume container"
|
|
6911
6733
|
}
|
|
6912
6734
|
});
|
|
6913
6735
|
var publicVolumeByIdContract = c14.router({
|
|
@@ -6945,44 +6767,6 @@ var publicVolumeVersionsContract = c14.router({
|
|
|
6945
6767
|
description: "List all versions of a volume with pagination"
|
|
6946
6768
|
}
|
|
6947
6769
|
});
|
|
6948
|
-
var publicVolumeUploadContract = c14.router({
|
|
6949
|
-
prepareUpload: {
|
|
6950
|
-
method: "POST",
|
|
6951
|
-
path: "/v1/volumes/:id/upload",
|
|
6952
|
-
pathParams: z19.object({
|
|
6953
|
-
id: z19.string().min(1, "Volume ID is required")
|
|
6954
|
-
}),
|
|
6955
|
-
body: prepareUploadRequestSchema2,
|
|
6956
|
-
responses: {
|
|
6957
|
-
200: prepareUploadResponseSchema2,
|
|
6958
|
-
400: publicApiErrorSchema,
|
|
6959
|
-
401: publicApiErrorSchema,
|
|
6960
|
-
404: publicApiErrorSchema,
|
|
6961
|
-
500: publicApiErrorSchema
|
|
6962
|
-
},
|
|
6963
|
-
summary: "Prepare volume upload",
|
|
6964
|
-
description: "Get presigned URLs for direct S3 upload. Returns upload URLs for each file."
|
|
6965
|
-
}
|
|
6966
|
-
});
|
|
6967
|
-
var publicVolumeCommitContract = c14.router({
|
|
6968
|
-
commitUpload: {
|
|
6969
|
-
method: "POST",
|
|
6970
|
-
path: "/v1/volumes/:id/commit",
|
|
6971
|
-
pathParams: z19.object({
|
|
6972
|
-
id: z19.string().min(1, "Volume ID is required")
|
|
6973
|
-
}),
|
|
6974
|
-
body: commitUploadRequestSchema2,
|
|
6975
|
-
responses: {
|
|
6976
|
-
200: volumeVersionSchema,
|
|
6977
|
-
400: publicApiErrorSchema,
|
|
6978
|
-
401: publicApiErrorSchema,
|
|
6979
|
-
404: publicApiErrorSchema,
|
|
6980
|
-
500: publicApiErrorSchema
|
|
6981
|
-
},
|
|
6982
|
-
summary: "Commit volume upload",
|
|
6983
|
-
description: "Finalize an upload session and create a new volume version."
|
|
6984
|
-
}
|
|
6985
|
-
});
|
|
6986
6770
|
var publicVolumeDownloadContract = c14.router({
|
|
6987
6771
|
download: {
|
|
6988
6772
|
method: "GET",
|
|
@@ -6995,93 +6779,14 @@ var publicVolumeDownloadContract = c14.router({
|
|
|
6995
6779
|
// Defaults to current version
|
|
6996
6780
|
}),
|
|
6997
6781
|
responses: {
|
|
6998
|
-
|
|
6782
|
+
302: z19.undefined(),
|
|
6783
|
+
// Redirect to presigned URL
|
|
6999
6784
|
401: publicApiErrorSchema,
|
|
7000
6785
|
404: publicApiErrorSchema,
|
|
7001
6786
|
500: publicApiErrorSchema
|
|
7002
6787
|
},
|
|
7003
6788
|
summary: "Download volume",
|
|
7004
|
-
description: "
|
|
7005
|
-
}
|
|
7006
|
-
});
|
|
7007
|
-
|
|
7008
|
-
// ../../packages/core/src/contracts/public/tokens.ts
|
|
7009
|
-
import { z as z20 } from "zod";
|
|
7010
|
-
var c15 = initContract();
|
|
7011
|
-
var publicTokenSchema = z20.object({
|
|
7012
|
-
id: z20.string(),
|
|
7013
|
-
name: z20.string(),
|
|
7014
|
-
token_prefix: z20.string(),
|
|
7015
|
-
// First 12 chars for identification (e.g., "vm0_live_abc")
|
|
7016
|
-
last_used_at: timestampSchema.nullable(),
|
|
7017
|
-
expires_at: timestampSchema,
|
|
7018
|
-
created_at: timestampSchema
|
|
7019
|
-
});
|
|
7020
|
-
var publicTokenDetailSchema = publicTokenSchema.extend({
|
|
7021
|
-
token: z20.string().optional()
|
|
7022
|
-
// Full token value, only returned on creation
|
|
7023
|
-
});
|
|
7024
|
-
var paginatedTokensSchema = createPaginatedResponseSchema(publicTokenSchema);
|
|
7025
|
-
var createTokenRequestSchema = z20.object({
|
|
7026
|
-
name: z20.string().min(1, "Name is required").max(100, "Name too long"),
|
|
7027
|
-
expires_in_days: z20.number().min(1).max(365).optional()
|
|
7028
|
-
// null for no expiry (default 90 days)
|
|
7029
|
-
});
|
|
7030
|
-
var publicTokensListContract = c15.router({
|
|
7031
|
-
list: {
|
|
7032
|
-
method: "GET",
|
|
7033
|
-
path: "/v1/tokens",
|
|
7034
|
-
query: listQuerySchema,
|
|
7035
|
-
responses: {
|
|
7036
|
-
200: paginatedTokensSchema,
|
|
7037
|
-
401: publicApiErrorSchema
|
|
7038
|
-
},
|
|
7039
|
-
summary: "List API tokens",
|
|
7040
|
-
description: "List all API tokens for the authenticated user"
|
|
7041
|
-
},
|
|
7042
|
-
create: {
|
|
7043
|
-
method: "POST",
|
|
7044
|
-
path: "/v1/tokens",
|
|
7045
|
-
body: createTokenRequestSchema,
|
|
7046
|
-
responses: {
|
|
7047
|
-
201: publicTokenDetailSchema,
|
|
7048
|
-
// Includes full token value
|
|
7049
|
-
400: publicApiErrorSchema,
|
|
7050
|
-
401: publicApiErrorSchema
|
|
7051
|
-
},
|
|
7052
|
-
summary: "Create API token",
|
|
7053
|
-
description: "Create a new API token. The token value is only returned once on creation."
|
|
7054
|
-
}
|
|
7055
|
-
});
|
|
7056
|
-
var publicTokenByIdContract = c15.router({
|
|
7057
|
-
get: {
|
|
7058
|
-
method: "GET",
|
|
7059
|
-
path: "/v1/tokens/:id",
|
|
7060
|
-
pathParams: z20.object({
|
|
7061
|
-
id: z20.string()
|
|
7062
|
-
}),
|
|
7063
|
-
responses: {
|
|
7064
|
-
200: publicTokenSchema,
|
|
7065
|
-
// Does NOT include token value
|
|
7066
|
-
401: publicApiErrorSchema,
|
|
7067
|
-
404: publicApiErrorSchema
|
|
7068
|
-
},
|
|
7069
|
-
summary: "Get API token",
|
|
7070
|
-
description: "Get details of an API token (does not include the token value)"
|
|
7071
|
-
},
|
|
7072
|
-
delete: {
|
|
7073
|
-
method: "DELETE",
|
|
7074
|
-
path: "/v1/tokens/:id",
|
|
7075
|
-
pathParams: z20.object({
|
|
7076
|
-
id: z20.string()
|
|
7077
|
-
}),
|
|
7078
|
-
responses: {
|
|
7079
|
-
204: z20.undefined(),
|
|
7080
|
-
401: publicApiErrorSchema,
|
|
7081
|
-
404: publicApiErrorSchema
|
|
7082
|
-
},
|
|
7083
|
-
summary: "Revoke API token",
|
|
7084
|
-
description: "Permanently revoke an API token. This action cannot be undone."
|
|
6789
|
+
description: "Redirect to presigned URL for downloading volume as tar.gz archive. Defaults to current version."
|
|
7085
6790
|
}
|
|
7086
6791
|
});
|
|
7087
6792
|
|
|
@@ -10801,7 +10506,7 @@ var statusCommand = new Command2("status").description("Check runner connectivit
|
|
|
10801
10506
|
});
|
|
10802
10507
|
|
|
10803
10508
|
// src/index.ts
|
|
10804
|
-
var version = true ? "2.
|
|
10509
|
+
var version = true ? "2.6.1" : "0.1.0";
|
|
10805
10510
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
10806
10511
|
program.addCommand(startCommand);
|
|
10807
10512
|
program.addCommand(statusCommand);
|