@vm0/runner 2.13.2 → 2.13.4
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 +435 -305
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5431,7 +5431,7 @@ var agentDefinitionSchema = z5.object({
|
|
|
5431
5431
|
* This field will be removed in a future version.
|
|
5432
5432
|
*/
|
|
5433
5433
|
image: z5.string().optional(),
|
|
5434
|
-
|
|
5434
|
+
framework: z5.string().min(1, "Framework is required"),
|
|
5435
5435
|
/**
|
|
5436
5436
|
* Array of pre-installed apps/tools for the agent environment.
|
|
5437
5437
|
* Format: "app" or "app:tag" (e.g., "github", "github:dev", "github:latest")
|
|
@@ -5690,7 +5690,7 @@ var eventsResponseSchema = z6.object({
|
|
|
5690
5690
|
hasMore: z6.boolean(),
|
|
5691
5691
|
nextSequence: z6.number(),
|
|
5692
5692
|
run: runStateSchema,
|
|
5693
|
-
|
|
5693
|
+
framework: z6.string()
|
|
5694
5694
|
});
|
|
5695
5695
|
var runsMainContract = c3.router({
|
|
5696
5696
|
/**
|
|
@@ -5772,7 +5772,7 @@ var metricsResponseSchema = z6.object({
|
|
|
5772
5772
|
var agentEventsResponseSchema = z6.object({
|
|
5773
5773
|
events: z6.array(runEventSchema),
|
|
5774
5774
|
hasMore: z6.boolean(),
|
|
5775
|
-
|
|
5775
|
+
framework: z6.string()
|
|
5776
5776
|
});
|
|
5777
5777
|
var networkLogEntrySchema = z6.object({
|
|
5778
5778
|
timestamp: z6.string(),
|
|
@@ -6651,10 +6651,12 @@ var credentialNameSchema = z14.string().min(1, "Credential name is required").ma
|
|
|
6651
6651
|
/^[A-Z][A-Z0-9_]*$/,
|
|
6652
6652
|
"Credential name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_API_KEY)"
|
|
6653
6653
|
);
|
|
6654
|
+
var credentialTypeSchema = z14.enum(["user", "model-provider"]);
|
|
6654
6655
|
var credentialResponseSchema = z14.object({
|
|
6655
6656
|
id: z14.string().uuid(),
|
|
6656
6657
|
name: z14.string(),
|
|
6657
6658
|
description: z14.string().nullable(),
|
|
6659
|
+
type: credentialTypeSchema,
|
|
6658
6660
|
createdAt: z14.string(),
|
|
6659
6661
|
updatedAt: z14.string()
|
|
6660
6662
|
});
|
|
@@ -6738,43 +6740,171 @@ var credentialsByNameContract = c10.router({
|
|
|
6738
6740
|
}
|
|
6739
6741
|
});
|
|
6740
6742
|
|
|
6741
|
-
// ../../packages/core/src/contracts/
|
|
6743
|
+
// ../../packages/core/src/contracts/model-providers.ts
|
|
6742
6744
|
import { z as z15 } from "zod";
|
|
6743
6745
|
var c11 = initContract();
|
|
6744
|
-
var
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6746
|
+
var modelProviderTypeSchema = z15.enum([
|
|
6747
|
+
"claude-code-oauth-token",
|
|
6748
|
+
"anthropic-api-key",
|
|
6749
|
+
"openai-api-key"
|
|
6750
|
+
]);
|
|
6751
|
+
var modelProviderFrameworkSchema = z15.enum(["claude-code", "codex"]);
|
|
6752
|
+
var modelProviderResponseSchema = z15.object({
|
|
6753
|
+
id: z15.string().uuid(),
|
|
6754
|
+
type: modelProviderTypeSchema,
|
|
6755
|
+
framework: modelProviderFrameworkSchema,
|
|
6756
|
+
credentialName: z15.string(),
|
|
6757
|
+
isDefault: z15.boolean(),
|
|
6753
6758
|
createdAt: z15.string(),
|
|
6754
6759
|
updatedAt: z15.string()
|
|
6755
6760
|
});
|
|
6756
|
-
var
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6761
|
+
var modelProviderListResponseSchema = z15.object({
|
|
6762
|
+
modelProviders: z15.array(modelProviderResponseSchema)
|
|
6763
|
+
});
|
|
6764
|
+
var upsertModelProviderRequestSchema = z15.object({
|
|
6765
|
+
type: modelProviderTypeSchema,
|
|
6766
|
+
credential: z15.string().min(1, "Credential is required"),
|
|
6767
|
+
convert: z15.boolean().optional()
|
|
6760
6768
|
});
|
|
6761
|
-
var
|
|
6762
|
-
|
|
6763
|
-
|
|
6769
|
+
var upsertModelProviderResponseSchema = z15.object({
|
|
6770
|
+
provider: modelProviderResponseSchema,
|
|
6771
|
+
created: z15.boolean()
|
|
6772
|
+
});
|
|
6773
|
+
var checkCredentialResponseSchema = z15.object({
|
|
6774
|
+
exists: z15.boolean(),
|
|
6775
|
+
credentialName: z15.string(),
|
|
6776
|
+
currentType: z15.enum(["user", "model-provider"]).optional()
|
|
6777
|
+
});
|
|
6778
|
+
var modelProvidersMainContract = c11.router({
|
|
6779
|
+
list: {
|
|
6780
|
+
method: "GET",
|
|
6781
|
+
path: "/api/model-providers",
|
|
6782
|
+
responses: {
|
|
6783
|
+
200: modelProviderListResponseSchema,
|
|
6784
|
+
401: apiErrorSchema,
|
|
6785
|
+
500: apiErrorSchema
|
|
6786
|
+
},
|
|
6787
|
+
summary: "List all model providers"
|
|
6788
|
+
},
|
|
6789
|
+
upsert: {
|
|
6790
|
+
method: "PUT",
|
|
6791
|
+
path: "/api/model-providers",
|
|
6792
|
+
body: upsertModelProviderRequestSchema,
|
|
6793
|
+
responses: {
|
|
6794
|
+
200: upsertModelProviderResponseSchema,
|
|
6795
|
+
201: upsertModelProviderResponseSchema,
|
|
6796
|
+
400: apiErrorSchema,
|
|
6797
|
+
401: apiErrorSchema,
|
|
6798
|
+
409: apiErrorSchema,
|
|
6799
|
+
500: apiErrorSchema
|
|
6800
|
+
},
|
|
6801
|
+
summary: "Create or update a model provider"
|
|
6802
|
+
}
|
|
6803
|
+
});
|
|
6804
|
+
var modelProvidersCheckContract = c11.router({
|
|
6805
|
+
check: {
|
|
6806
|
+
method: "GET",
|
|
6807
|
+
path: "/api/model-providers/check/:type",
|
|
6808
|
+
pathParams: z15.object({
|
|
6809
|
+
type: modelProviderTypeSchema
|
|
6810
|
+
}),
|
|
6811
|
+
responses: {
|
|
6812
|
+
200: checkCredentialResponseSchema,
|
|
6813
|
+
401: apiErrorSchema,
|
|
6814
|
+
500: apiErrorSchema
|
|
6815
|
+
},
|
|
6816
|
+
summary: "Check if credential exists for a model provider type"
|
|
6817
|
+
}
|
|
6764
6818
|
});
|
|
6765
|
-
var
|
|
6766
|
-
|
|
6819
|
+
var modelProvidersByTypeContract = c11.router({
|
|
6820
|
+
delete: {
|
|
6821
|
+
method: "DELETE",
|
|
6822
|
+
path: "/api/model-providers/:type",
|
|
6823
|
+
pathParams: z15.object({
|
|
6824
|
+
type: modelProviderTypeSchema
|
|
6825
|
+
}),
|
|
6826
|
+
responses: {
|
|
6827
|
+
204: z15.undefined(),
|
|
6828
|
+
401: apiErrorSchema,
|
|
6829
|
+
404: apiErrorSchema,
|
|
6830
|
+
500: apiErrorSchema
|
|
6831
|
+
},
|
|
6832
|
+
summary: "Delete a model provider"
|
|
6833
|
+
}
|
|
6767
6834
|
});
|
|
6768
|
-
var
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6835
|
+
var modelProvidersConvertContract = c11.router({
|
|
6836
|
+
convert: {
|
|
6837
|
+
method: "POST",
|
|
6838
|
+
path: "/api/model-providers/:type/convert",
|
|
6839
|
+
pathParams: z15.object({
|
|
6840
|
+
type: modelProviderTypeSchema
|
|
6841
|
+
}),
|
|
6842
|
+
body: z15.undefined(),
|
|
6843
|
+
responses: {
|
|
6844
|
+
200: modelProviderResponseSchema,
|
|
6845
|
+
400: apiErrorSchema,
|
|
6846
|
+
401: apiErrorSchema,
|
|
6847
|
+
404: apiErrorSchema,
|
|
6848
|
+
500: apiErrorSchema
|
|
6849
|
+
},
|
|
6850
|
+
summary: "Convert existing user credential to model provider"
|
|
6851
|
+
}
|
|
6852
|
+
});
|
|
6853
|
+
var modelProvidersSetDefaultContract = c11.router({
|
|
6854
|
+
setDefault: {
|
|
6855
|
+
method: "POST",
|
|
6856
|
+
path: "/api/model-providers/:type/set-default",
|
|
6857
|
+
pathParams: z15.object({
|
|
6858
|
+
type: modelProviderTypeSchema
|
|
6859
|
+
}),
|
|
6860
|
+
body: z15.undefined(),
|
|
6861
|
+
responses: {
|
|
6862
|
+
200: modelProviderResponseSchema,
|
|
6863
|
+
401: apiErrorSchema,
|
|
6864
|
+
404: apiErrorSchema,
|
|
6865
|
+
500: apiErrorSchema
|
|
6866
|
+
},
|
|
6867
|
+
summary: "Set a model provider as default for its framework"
|
|
6868
|
+
}
|
|
6869
|
+
});
|
|
6870
|
+
|
|
6871
|
+
// ../../packages/core/src/contracts/sessions.ts
|
|
6872
|
+
import { z as z16 } from "zod";
|
|
6873
|
+
var c12 = initContract();
|
|
6874
|
+
var sessionResponseSchema = z16.object({
|
|
6875
|
+
id: z16.string(),
|
|
6876
|
+
agentComposeId: z16.string(),
|
|
6877
|
+
agentComposeVersionId: z16.string().nullable(),
|
|
6878
|
+
conversationId: z16.string().nullable(),
|
|
6879
|
+
artifactName: z16.string().nullable(),
|
|
6880
|
+
vars: z16.record(z16.string(), z16.string()).nullable(),
|
|
6881
|
+
secretNames: z16.array(z16.string()).nullable(),
|
|
6882
|
+
volumeVersions: z16.record(z16.string(), z16.string()).nullable(),
|
|
6883
|
+
createdAt: z16.string(),
|
|
6884
|
+
updatedAt: z16.string()
|
|
6885
|
+
});
|
|
6886
|
+
var agentComposeSnapshotSchema = z16.object({
|
|
6887
|
+
agentComposeVersionId: z16.string(),
|
|
6888
|
+
vars: z16.record(z16.string(), z16.string()).optional(),
|
|
6889
|
+
secretNames: z16.array(z16.string()).optional()
|
|
6890
|
+
});
|
|
6891
|
+
var artifactSnapshotSchema2 = z16.object({
|
|
6892
|
+
artifactName: z16.string(),
|
|
6893
|
+
artifactVersion: z16.string()
|
|
6894
|
+
});
|
|
6895
|
+
var volumeVersionsSnapshotSchema2 = z16.object({
|
|
6896
|
+
versions: z16.record(z16.string(), z16.string())
|
|
6897
|
+
});
|
|
6898
|
+
var checkpointResponseSchema = z16.object({
|
|
6899
|
+
id: z16.string(),
|
|
6900
|
+
runId: z16.string(),
|
|
6901
|
+
conversationId: z16.string(),
|
|
6772
6902
|
agentComposeSnapshot: agentComposeSnapshotSchema,
|
|
6773
6903
|
artifactSnapshot: artifactSnapshotSchema2.nullable(),
|
|
6774
6904
|
volumeVersionsSnapshot: volumeVersionsSnapshotSchema2.nullable(),
|
|
6775
|
-
createdAt:
|
|
6905
|
+
createdAt: z16.string()
|
|
6776
6906
|
});
|
|
6777
|
-
var sessionsByIdContract =
|
|
6907
|
+
var sessionsByIdContract = c12.router({
|
|
6778
6908
|
/**
|
|
6779
6909
|
* GET /api/agent/sessions/:id
|
|
6780
6910
|
* Get session by ID
|
|
@@ -6782,8 +6912,8 @@ var sessionsByIdContract = c11.router({
|
|
|
6782
6912
|
getById: {
|
|
6783
6913
|
method: "GET",
|
|
6784
6914
|
path: "/api/agent/sessions/:id",
|
|
6785
|
-
pathParams:
|
|
6786
|
-
id:
|
|
6915
|
+
pathParams: z16.object({
|
|
6916
|
+
id: z16.string().min(1, "Session ID is required")
|
|
6787
6917
|
}),
|
|
6788
6918
|
responses: {
|
|
6789
6919
|
200: sessionResponseSchema,
|
|
@@ -6794,7 +6924,7 @@ var sessionsByIdContract = c11.router({
|
|
|
6794
6924
|
summary: "Get session by ID"
|
|
6795
6925
|
}
|
|
6796
6926
|
});
|
|
6797
|
-
var checkpointsByIdContract =
|
|
6927
|
+
var checkpointsByIdContract = c12.router({
|
|
6798
6928
|
/**
|
|
6799
6929
|
* GET /api/agent/checkpoints/:id
|
|
6800
6930
|
* Get checkpoint by ID
|
|
@@ -6802,8 +6932,8 @@ var checkpointsByIdContract = c11.router({
|
|
|
6802
6932
|
getById: {
|
|
6803
6933
|
method: "GET",
|
|
6804
6934
|
path: "/api/agent/checkpoints/:id",
|
|
6805
|
-
pathParams:
|
|
6806
|
-
id:
|
|
6935
|
+
pathParams: z16.object({
|
|
6936
|
+
id: z16.string().min(1, "Checkpoint ID is required")
|
|
6807
6937
|
}),
|
|
6808
6938
|
responses: {
|
|
6809
6939
|
200: checkpointResponseSchema,
|
|
@@ -6816,91 +6946,91 @@ var checkpointsByIdContract = c11.router({
|
|
|
6816
6946
|
});
|
|
6817
6947
|
|
|
6818
6948
|
// ../../packages/core/src/contracts/schedules.ts
|
|
6819
|
-
import { z as
|
|
6820
|
-
var
|
|
6821
|
-
var scheduleTriggerSchema =
|
|
6822
|
-
cron:
|
|
6823
|
-
at:
|
|
6824
|
-
timezone:
|
|
6949
|
+
import { z as z17 } from "zod";
|
|
6950
|
+
var c13 = initContract();
|
|
6951
|
+
var scheduleTriggerSchema = z17.object({
|
|
6952
|
+
cron: z17.string().optional(),
|
|
6953
|
+
at: z17.string().optional(),
|
|
6954
|
+
timezone: z17.string().default("UTC")
|
|
6825
6955
|
}).refine((data) => data.cron && !data.at || !data.cron && data.at, {
|
|
6826
6956
|
message: "Exactly one of 'cron' or 'at' must be specified"
|
|
6827
6957
|
});
|
|
6828
|
-
var scheduleRunConfigSchema =
|
|
6829
|
-
agent:
|
|
6830
|
-
prompt:
|
|
6831
|
-
vars:
|
|
6832
|
-
secrets:
|
|
6833
|
-
artifactName:
|
|
6834
|
-
artifactVersion:
|
|
6835
|
-
volumeVersions:
|
|
6958
|
+
var scheduleRunConfigSchema = z17.object({
|
|
6959
|
+
agent: z17.string().min(1, "Agent reference required"),
|
|
6960
|
+
prompt: z17.string().min(1, "Prompt required"),
|
|
6961
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
6962
|
+
secrets: z17.record(z17.string(), z17.string()).optional(),
|
|
6963
|
+
artifactName: z17.string().optional(),
|
|
6964
|
+
artifactVersion: z17.string().optional(),
|
|
6965
|
+
volumeVersions: z17.record(z17.string(), z17.string()).optional()
|
|
6836
6966
|
});
|
|
6837
|
-
var scheduleDefinitionSchema =
|
|
6967
|
+
var scheduleDefinitionSchema = z17.object({
|
|
6838
6968
|
on: scheduleTriggerSchema,
|
|
6839
6969
|
run: scheduleRunConfigSchema
|
|
6840
6970
|
});
|
|
6841
|
-
var scheduleYamlSchema =
|
|
6842
|
-
version:
|
|
6843
|
-
schedules:
|
|
6844
|
-
});
|
|
6845
|
-
var deployScheduleRequestSchema =
|
|
6846
|
-
name:
|
|
6847
|
-
cronExpression:
|
|
6848
|
-
atTime:
|
|
6849
|
-
timezone:
|
|
6850
|
-
prompt:
|
|
6851
|
-
vars:
|
|
6852
|
-
secrets:
|
|
6853
|
-
artifactName:
|
|
6854
|
-
artifactVersion:
|
|
6855
|
-
volumeVersions:
|
|
6971
|
+
var scheduleYamlSchema = z17.object({
|
|
6972
|
+
version: z17.literal("1.0"),
|
|
6973
|
+
schedules: z17.record(z17.string(), scheduleDefinitionSchema)
|
|
6974
|
+
});
|
|
6975
|
+
var deployScheduleRequestSchema = z17.object({
|
|
6976
|
+
name: z17.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
6977
|
+
cronExpression: z17.string().optional(),
|
|
6978
|
+
atTime: z17.string().optional(),
|
|
6979
|
+
timezone: z17.string().default("UTC"),
|
|
6980
|
+
prompt: z17.string().min(1, "Prompt required"),
|
|
6981
|
+
vars: z17.record(z17.string(), z17.string()).optional(),
|
|
6982
|
+
secrets: z17.record(z17.string(), z17.string()).optional(),
|
|
6983
|
+
artifactName: z17.string().optional(),
|
|
6984
|
+
artifactVersion: z17.string().optional(),
|
|
6985
|
+
volumeVersions: z17.record(z17.string(), z17.string()).optional(),
|
|
6856
6986
|
// Resolved agent compose ID (CLI resolves scope/name:version → composeId)
|
|
6857
|
-
composeId:
|
|
6987
|
+
composeId: z17.string().uuid("Invalid compose ID")
|
|
6858
6988
|
}).refine(
|
|
6859
6989
|
(data) => data.cronExpression && !data.atTime || !data.cronExpression && data.atTime,
|
|
6860
6990
|
{
|
|
6861
6991
|
message: "Exactly one of 'cronExpression' or 'atTime' must be specified"
|
|
6862
6992
|
}
|
|
6863
6993
|
);
|
|
6864
|
-
var scheduleResponseSchema =
|
|
6865
|
-
id:
|
|
6866
|
-
composeId:
|
|
6867
|
-
composeName:
|
|
6868
|
-
scopeSlug:
|
|
6869
|
-
name:
|
|
6870
|
-
cronExpression:
|
|
6871
|
-
atTime:
|
|
6872
|
-
timezone:
|
|
6873
|
-
prompt:
|
|
6874
|
-
vars:
|
|
6994
|
+
var scheduleResponseSchema = z17.object({
|
|
6995
|
+
id: z17.string().uuid(),
|
|
6996
|
+
composeId: z17.string().uuid(),
|
|
6997
|
+
composeName: z17.string(),
|
|
6998
|
+
scopeSlug: z17.string(),
|
|
6999
|
+
name: z17.string(),
|
|
7000
|
+
cronExpression: z17.string().nullable(),
|
|
7001
|
+
atTime: z17.string().nullable(),
|
|
7002
|
+
timezone: z17.string(),
|
|
7003
|
+
prompt: z17.string(),
|
|
7004
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
6875
7005
|
// Secret names only (values are never returned)
|
|
6876
|
-
secretNames:
|
|
6877
|
-
artifactName:
|
|
6878
|
-
artifactVersion:
|
|
6879
|
-
volumeVersions:
|
|
6880
|
-
enabled:
|
|
6881
|
-
nextRunAt:
|
|
6882
|
-
createdAt:
|
|
6883
|
-
updatedAt:
|
|
6884
|
-
});
|
|
6885
|
-
var runSummarySchema =
|
|
6886
|
-
id:
|
|
6887
|
-
status:
|
|
6888
|
-
createdAt:
|
|
6889
|
-
completedAt:
|
|
6890
|
-
error:
|
|
6891
|
-
});
|
|
6892
|
-
var scheduleRunsResponseSchema =
|
|
6893
|
-
runs:
|
|
6894
|
-
});
|
|
6895
|
-
var scheduleListResponseSchema =
|
|
6896
|
-
schedules:
|
|
6897
|
-
});
|
|
6898
|
-
var deployScheduleResponseSchema =
|
|
7006
|
+
secretNames: z17.array(z17.string()).nullable(),
|
|
7007
|
+
artifactName: z17.string().nullable(),
|
|
7008
|
+
artifactVersion: z17.string().nullable(),
|
|
7009
|
+
volumeVersions: z17.record(z17.string(), z17.string()).nullable(),
|
|
7010
|
+
enabled: z17.boolean(),
|
|
7011
|
+
nextRunAt: z17.string().nullable(),
|
|
7012
|
+
createdAt: z17.string(),
|
|
7013
|
+
updatedAt: z17.string()
|
|
7014
|
+
});
|
|
7015
|
+
var runSummarySchema = z17.object({
|
|
7016
|
+
id: z17.string().uuid(),
|
|
7017
|
+
status: z17.enum(["pending", "running", "completed", "failed", "timeout"]),
|
|
7018
|
+
createdAt: z17.string(),
|
|
7019
|
+
completedAt: z17.string().nullable(),
|
|
7020
|
+
error: z17.string().nullable()
|
|
7021
|
+
});
|
|
7022
|
+
var scheduleRunsResponseSchema = z17.object({
|
|
7023
|
+
runs: z17.array(runSummarySchema)
|
|
7024
|
+
});
|
|
7025
|
+
var scheduleListResponseSchema = z17.object({
|
|
7026
|
+
schedules: z17.array(scheduleResponseSchema)
|
|
7027
|
+
});
|
|
7028
|
+
var deployScheduleResponseSchema = z17.object({
|
|
6899
7029
|
schedule: scheduleResponseSchema,
|
|
6900
|
-
created:
|
|
7030
|
+
created: z17.boolean()
|
|
6901
7031
|
// true if created, false if updated
|
|
6902
7032
|
});
|
|
6903
|
-
var schedulesMainContract =
|
|
7033
|
+
var schedulesMainContract = c13.router({
|
|
6904
7034
|
/**
|
|
6905
7035
|
* POST /api/agent/schedules
|
|
6906
7036
|
* Deploy (create or update) a schedule
|
|
@@ -6936,7 +7066,7 @@ var schedulesMainContract = c12.router({
|
|
|
6936
7066
|
summary: "List all schedules"
|
|
6937
7067
|
}
|
|
6938
7068
|
});
|
|
6939
|
-
var schedulesByNameContract =
|
|
7069
|
+
var schedulesByNameContract = c13.router({
|
|
6940
7070
|
/**
|
|
6941
7071
|
* GET /api/agent/schedules/:name
|
|
6942
7072
|
* Get schedule by name
|
|
@@ -6944,11 +7074,11 @@ var schedulesByNameContract = c12.router({
|
|
|
6944
7074
|
getByName: {
|
|
6945
7075
|
method: "GET",
|
|
6946
7076
|
path: "/api/agent/schedules/:name",
|
|
6947
|
-
pathParams:
|
|
6948
|
-
name:
|
|
7077
|
+
pathParams: z17.object({
|
|
7078
|
+
name: z17.string().min(1, "Schedule name required")
|
|
6949
7079
|
}),
|
|
6950
|
-
query:
|
|
6951
|
-
composeId:
|
|
7080
|
+
query: z17.object({
|
|
7081
|
+
composeId: z17.string().uuid("Compose ID required")
|
|
6952
7082
|
}),
|
|
6953
7083
|
responses: {
|
|
6954
7084
|
200: scheduleResponseSchema,
|
|
@@ -6964,21 +7094,21 @@ var schedulesByNameContract = c12.router({
|
|
|
6964
7094
|
delete: {
|
|
6965
7095
|
method: "DELETE",
|
|
6966
7096
|
path: "/api/agent/schedules/:name",
|
|
6967
|
-
pathParams:
|
|
6968
|
-
name:
|
|
7097
|
+
pathParams: z17.object({
|
|
7098
|
+
name: z17.string().min(1, "Schedule name required")
|
|
6969
7099
|
}),
|
|
6970
|
-
query:
|
|
6971
|
-
composeId:
|
|
7100
|
+
query: z17.object({
|
|
7101
|
+
composeId: z17.string().uuid("Compose ID required")
|
|
6972
7102
|
}),
|
|
6973
7103
|
responses: {
|
|
6974
|
-
204:
|
|
7104
|
+
204: z17.undefined(),
|
|
6975
7105
|
401: apiErrorSchema,
|
|
6976
7106
|
404: apiErrorSchema
|
|
6977
7107
|
},
|
|
6978
7108
|
summary: "Delete schedule"
|
|
6979
7109
|
}
|
|
6980
7110
|
});
|
|
6981
|
-
var schedulesEnableContract =
|
|
7111
|
+
var schedulesEnableContract = c13.router({
|
|
6982
7112
|
/**
|
|
6983
7113
|
* POST /api/agent/schedules/:name/enable
|
|
6984
7114
|
* Enable a disabled schedule
|
|
@@ -6986,11 +7116,11 @@ var schedulesEnableContract = c12.router({
|
|
|
6986
7116
|
enable: {
|
|
6987
7117
|
method: "POST",
|
|
6988
7118
|
path: "/api/agent/schedules/:name/enable",
|
|
6989
|
-
pathParams:
|
|
6990
|
-
name:
|
|
7119
|
+
pathParams: z17.object({
|
|
7120
|
+
name: z17.string().min(1, "Schedule name required")
|
|
6991
7121
|
}),
|
|
6992
|
-
body:
|
|
6993
|
-
composeId:
|
|
7122
|
+
body: z17.object({
|
|
7123
|
+
composeId: z17.string().uuid("Compose ID required")
|
|
6994
7124
|
}),
|
|
6995
7125
|
responses: {
|
|
6996
7126
|
200: scheduleResponseSchema,
|
|
@@ -7006,11 +7136,11 @@ var schedulesEnableContract = c12.router({
|
|
|
7006
7136
|
disable: {
|
|
7007
7137
|
method: "POST",
|
|
7008
7138
|
path: "/api/agent/schedules/:name/disable",
|
|
7009
|
-
pathParams:
|
|
7010
|
-
name:
|
|
7139
|
+
pathParams: z17.object({
|
|
7140
|
+
name: z17.string().min(1, "Schedule name required")
|
|
7011
7141
|
}),
|
|
7012
|
-
body:
|
|
7013
|
-
composeId:
|
|
7142
|
+
body: z17.object({
|
|
7143
|
+
composeId: z17.string().uuid("Compose ID required")
|
|
7014
7144
|
}),
|
|
7015
7145
|
responses: {
|
|
7016
7146
|
200: scheduleResponseSchema,
|
|
@@ -7020,7 +7150,7 @@ var schedulesEnableContract = c12.router({
|
|
|
7020
7150
|
summary: "Disable schedule"
|
|
7021
7151
|
}
|
|
7022
7152
|
});
|
|
7023
|
-
var scheduleRunsContract =
|
|
7153
|
+
var scheduleRunsContract = c13.router({
|
|
7024
7154
|
/**
|
|
7025
7155
|
* GET /api/agent/schedules/:name/runs
|
|
7026
7156
|
* List recent runs for a schedule
|
|
@@ -7028,12 +7158,12 @@ var scheduleRunsContract = c12.router({
|
|
|
7028
7158
|
listRuns: {
|
|
7029
7159
|
method: "GET",
|
|
7030
7160
|
path: "/api/agent/schedules/:name/runs",
|
|
7031
|
-
pathParams:
|
|
7032
|
-
name:
|
|
7161
|
+
pathParams: z17.object({
|
|
7162
|
+
name: z17.string().min(1, "Schedule name required")
|
|
7033
7163
|
}),
|
|
7034
|
-
query:
|
|
7035
|
-
composeId:
|
|
7036
|
-
limit:
|
|
7164
|
+
query: z17.object({
|
|
7165
|
+
composeId: z17.string().uuid("Compose ID required"),
|
|
7166
|
+
limit: z17.coerce.number().min(0).max(100).default(5)
|
|
7037
7167
|
}),
|
|
7038
7168
|
responses: {
|
|
7039
7169
|
200: scheduleRunsResponseSchema,
|
|
@@ -7045,18 +7175,18 @@ var scheduleRunsContract = c12.router({
|
|
|
7045
7175
|
});
|
|
7046
7176
|
|
|
7047
7177
|
// ../../packages/core/src/contracts/realtime.ts
|
|
7048
|
-
import { z as
|
|
7049
|
-
var
|
|
7050
|
-
var ablyTokenRequestSchema =
|
|
7051
|
-
keyName:
|
|
7052
|
-
ttl:
|
|
7053
|
-
timestamp:
|
|
7054
|
-
capability:
|
|
7055
|
-
clientId:
|
|
7056
|
-
nonce:
|
|
7057
|
-
mac:
|
|
7058
|
-
});
|
|
7059
|
-
var realtimeTokenContract =
|
|
7178
|
+
import { z as z18 } from "zod";
|
|
7179
|
+
var c14 = initContract();
|
|
7180
|
+
var ablyTokenRequestSchema = z18.object({
|
|
7181
|
+
keyName: z18.string(),
|
|
7182
|
+
ttl: z18.number().optional(),
|
|
7183
|
+
timestamp: z18.number(),
|
|
7184
|
+
capability: z18.string(),
|
|
7185
|
+
clientId: z18.string().optional(),
|
|
7186
|
+
nonce: z18.string(),
|
|
7187
|
+
mac: z18.string()
|
|
7188
|
+
});
|
|
7189
|
+
var realtimeTokenContract = c14.router({
|
|
7060
7190
|
/**
|
|
7061
7191
|
* POST /api/realtime/token
|
|
7062
7192
|
* Get an Ably token to subscribe to a run's events channel
|
|
@@ -7064,8 +7194,8 @@ var realtimeTokenContract = c13.router({
|
|
|
7064
7194
|
create: {
|
|
7065
7195
|
method: "POST",
|
|
7066
7196
|
path: "/api/realtime/token",
|
|
7067
|
-
body:
|
|
7068
|
-
runId:
|
|
7197
|
+
body: z18.object({
|
|
7198
|
+
runId: z18.string().uuid("runId must be a valid UUID")
|
|
7069
7199
|
}),
|
|
7070
7200
|
responses: {
|
|
7071
7201
|
200: ablyTokenRequestSchema,
|
|
@@ -7079,8 +7209,8 @@ var realtimeTokenContract = c13.router({
|
|
|
7079
7209
|
});
|
|
7080
7210
|
|
|
7081
7211
|
// ../../packages/core/src/contracts/public/common.ts
|
|
7082
|
-
import { z as
|
|
7083
|
-
var publicApiErrorTypeSchema =
|
|
7212
|
+
import { z as z19 } from "zod";
|
|
7213
|
+
var publicApiErrorTypeSchema = z19.enum([
|
|
7084
7214
|
"api_error",
|
|
7085
7215
|
// Internal server error (5xx)
|
|
7086
7216
|
"invalid_request_error",
|
|
@@ -7092,55 +7222,55 @@ var publicApiErrorTypeSchema = z18.enum([
|
|
|
7092
7222
|
"conflict_error"
|
|
7093
7223
|
// Resource conflict (409)
|
|
7094
7224
|
]);
|
|
7095
|
-
var publicApiErrorSchema =
|
|
7096
|
-
error:
|
|
7225
|
+
var publicApiErrorSchema = z19.object({
|
|
7226
|
+
error: z19.object({
|
|
7097
7227
|
type: publicApiErrorTypeSchema,
|
|
7098
|
-
code:
|
|
7099
|
-
message:
|
|
7100
|
-
param:
|
|
7101
|
-
doc_url:
|
|
7228
|
+
code: z19.string(),
|
|
7229
|
+
message: z19.string(),
|
|
7230
|
+
param: z19.string().optional(),
|
|
7231
|
+
doc_url: z19.string().url().optional()
|
|
7102
7232
|
})
|
|
7103
7233
|
});
|
|
7104
|
-
var paginationSchema =
|
|
7105
|
-
has_more:
|
|
7106
|
-
next_cursor:
|
|
7234
|
+
var paginationSchema = z19.object({
|
|
7235
|
+
has_more: z19.boolean(),
|
|
7236
|
+
next_cursor: z19.string().nullable()
|
|
7107
7237
|
});
|
|
7108
7238
|
function createPaginatedResponseSchema(dataSchema) {
|
|
7109
|
-
return
|
|
7110
|
-
data:
|
|
7239
|
+
return z19.object({
|
|
7240
|
+
data: z19.array(dataSchema),
|
|
7111
7241
|
pagination: paginationSchema
|
|
7112
7242
|
});
|
|
7113
7243
|
}
|
|
7114
|
-
var listQuerySchema =
|
|
7115
|
-
cursor:
|
|
7116
|
-
limit:
|
|
7244
|
+
var listQuerySchema = z19.object({
|
|
7245
|
+
cursor: z19.string().optional(),
|
|
7246
|
+
limit: z19.coerce.number().min(1).max(100).default(20)
|
|
7117
7247
|
});
|
|
7118
|
-
var requestIdSchema =
|
|
7119
|
-
var timestampSchema =
|
|
7248
|
+
var requestIdSchema = z19.string().uuid();
|
|
7249
|
+
var timestampSchema = z19.string().datetime();
|
|
7120
7250
|
|
|
7121
7251
|
// ../../packages/core/src/contracts/public/agents.ts
|
|
7122
|
-
import { z as
|
|
7123
|
-
var
|
|
7124
|
-
var publicAgentSchema =
|
|
7125
|
-
id:
|
|
7126
|
-
name:
|
|
7127
|
-
current_version_id:
|
|
7252
|
+
import { z as z20 } from "zod";
|
|
7253
|
+
var c15 = initContract();
|
|
7254
|
+
var publicAgentSchema = z20.object({
|
|
7255
|
+
id: z20.string(),
|
|
7256
|
+
name: z20.string(),
|
|
7257
|
+
current_version_id: z20.string().nullable(),
|
|
7128
7258
|
created_at: timestampSchema,
|
|
7129
7259
|
updated_at: timestampSchema
|
|
7130
7260
|
});
|
|
7131
|
-
var agentVersionSchema =
|
|
7132
|
-
id:
|
|
7133
|
-
agent_id:
|
|
7134
|
-
version_number:
|
|
7261
|
+
var agentVersionSchema = z20.object({
|
|
7262
|
+
id: z20.string(),
|
|
7263
|
+
agent_id: z20.string(),
|
|
7264
|
+
version_number: z20.number(),
|
|
7135
7265
|
created_at: timestampSchema
|
|
7136
7266
|
});
|
|
7137
7267
|
var publicAgentDetailSchema = publicAgentSchema;
|
|
7138
7268
|
var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
|
|
7139
7269
|
var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
|
|
7140
7270
|
var agentListQuerySchema = listQuerySchema.extend({
|
|
7141
|
-
name:
|
|
7271
|
+
name: z20.string().optional()
|
|
7142
7272
|
});
|
|
7143
|
-
var publicAgentsListContract =
|
|
7273
|
+
var publicAgentsListContract = c15.router({
|
|
7144
7274
|
list: {
|
|
7145
7275
|
method: "GET",
|
|
7146
7276
|
path: "/v1/agents",
|
|
@@ -7154,12 +7284,12 @@ var publicAgentsListContract = c14.router({
|
|
|
7154
7284
|
description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
|
|
7155
7285
|
}
|
|
7156
7286
|
});
|
|
7157
|
-
var publicAgentByIdContract =
|
|
7287
|
+
var publicAgentByIdContract = c15.router({
|
|
7158
7288
|
get: {
|
|
7159
7289
|
method: "GET",
|
|
7160
7290
|
path: "/v1/agents/:id",
|
|
7161
|
-
pathParams:
|
|
7162
|
-
id:
|
|
7291
|
+
pathParams: z20.object({
|
|
7292
|
+
id: z20.string().min(1, "Agent ID is required")
|
|
7163
7293
|
}),
|
|
7164
7294
|
responses: {
|
|
7165
7295
|
200: publicAgentDetailSchema,
|
|
@@ -7171,12 +7301,12 @@ var publicAgentByIdContract = c14.router({
|
|
|
7171
7301
|
description: "Get agent details by ID"
|
|
7172
7302
|
}
|
|
7173
7303
|
});
|
|
7174
|
-
var publicAgentVersionsContract =
|
|
7304
|
+
var publicAgentVersionsContract = c15.router({
|
|
7175
7305
|
list: {
|
|
7176
7306
|
method: "GET",
|
|
7177
7307
|
path: "/v1/agents/:id/versions",
|
|
7178
|
-
pathParams:
|
|
7179
|
-
id:
|
|
7308
|
+
pathParams: z20.object({
|
|
7309
|
+
id: z20.string().min(1, "Agent ID is required")
|
|
7180
7310
|
}),
|
|
7181
7311
|
query: listQuerySchema,
|
|
7182
7312
|
responses: {
|
|
@@ -7191,9 +7321,9 @@ var publicAgentVersionsContract = c14.router({
|
|
|
7191
7321
|
});
|
|
7192
7322
|
|
|
7193
7323
|
// ../../packages/core/src/contracts/public/runs.ts
|
|
7194
|
-
import { z as
|
|
7195
|
-
var
|
|
7196
|
-
var publicRunStatusSchema =
|
|
7324
|
+
import { z as z21 } from "zod";
|
|
7325
|
+
var c16 = initContract();
|
|
7326
|
+
var publicRunStatusSchema = z21.enum([
|
|
7197
7327
|
"pending",
|
|
7198
7328
|
"running",
|
|
7199
7329
|
"completed",
|
|
@@ -7201,56 +7331,56 @@ var publicRunStatusSchema = z20.enum([
|
|
|
7201
7331
|
"timeout",
|
|
7202
7332
|
"cancelled"
|
|
7203
7333
|
]);
|
|
7204
|
-
var publicRunSchema =
|
|
7205
|
-
id:
|
|
7206
|
-
agent_id:
|
|
7207
|
-
agent_name:
|
|
7334
|
+
var publicRunSchema = z21.object({
|
|
7335
|
+
id: z21.string(),
|
|
7336
|
+
agent_id: z21.string(),
|
|
7337
|
+
agent_name: z21.string(),
|
|
7208
7338
|
status: publicRunStatusSchema,
|
|
7209
|
-
prompt:
|
|
7339
|
+
prompt: z21.string(),
|
|
7210
7340
|
created_at: timestampSchema,
|
|
7211
7341
|
started_at: timestampSchema.nullable(),
|
|
7212
7342
|
completed_at: timestampSchema.nullable()
|
|
7213
7343
|
});
|
|
7214
7344
|
var publicRunDetailSchema = publicRunSchema.extend({
|
|
7215
|
-
error:
|
|
7216
|
-
execution_time_ms:
|
|
7217
|
-
checkpoint_id:
|
|
7218
|
-
session_id:
|
|
7219
|
-
artifact_name:
|
|
7220
|
-
artifact_version:
|
|
7221
|
-
volumes:
|
|
7345
|
+
error: z21.string().nullable(),
|
|
7346
|
+
execution_time_ms: z21.number().nullable(),
|
|
7347
|
+
checkpoint_id: z21.string().nullable(),
|
|
7348
|
+
session_id: z21.string().nullable(),
|
|
7349
|
+
artifact_name: z21.string().nullable(),
|
|
7350
|
+
artifact_version: z21.string().nullable(),
|
|
7351
|
+
volumes: z21.record(z21.string(), z21.string()).optional()
|
|
7222
7352
|
});
|
|
7223
7353
|
var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
|
|
7224
|
-
var createRunRequestSchema =
|
|
7354
|
+
var createRunRequestSchema = z21.object({
|
|
7225
7355
|
// Agent identification (one of: agent, agent_id, session_id, checkpoint_id)
|
|
7226
|
-
agent:
|
|
7356
|
+
agent: z21.string().optional(),
|
|
7227
7357
|
// Agent name
|
|
7228
|
-
agent_id:
|
|
7358
|
+
agent_id: z21.string().optional(),
|
|
7229
7359
|
// Agent ID
|
|
7230
|
-
agent_version:
|
|
7360
|
+
agent_version: z21.string().optional(),
|
|
7231
7361
|
// Version specifier (e.g., "latest", "v1", specific ID)
|
|
7232
7362
|
// Continue session
|
|
7233
|
-
session_id:
|
|
7363
|
+
session_id: z21.string().optional(),
|
|
7234
7364
|
// Resume from checkpoint
|
|
7235
|
-
checkpoint_id:
|
|
7365
|
+
checkpoint_id: z21.string().optional(),
|
|
7236
7366
|
// Required
|
|
7237
|
-
prompt:
|
|
7367
|
+
prompt: z21.string().min(1, "Prompt is required"),
|
|
7238
7368
|
// Optional configuration
|
|
7239
|
-
variables:
|
|
7240
|
-
secrets:
|
|
7241
|
-
artifact_name:
|
|
7369
|
+
variables: z21.record(z21.string(), z21.string()).optional(),
|
|
7370
|
+
secrets: z21.record(z21.string(), z21.string()).optional(),
|
|
7371
|
+
artifact_name: z21.string().optional(),
|
|
7242
7372
|
// Artifact name to mount
|
|
7243
|
-
artifact_version:
|
|
7373
|
+
artifact_version: z21.string().optional(),
|
|
7244
7374
|
// Artifact version (defaults to latest)
|
|
7245
|
-
volumes:
|
|
7375
|
+
volumes: z21.record(z21.string(), z21.string()).optional()
|
|
7246
7376
|
// volume_name -> version
|
|
7247
7377
|
});
|
|
7248
7378
|
var runListQuerySchema = listQuerySchema.extend({
|
|
7249
|
-
agent_id:
|
|
7379
|
+
agent_id: z21.string().optional(),
|
|
7250
7380
|
status: publicRunStatusSchema.optional(),
|
|
7251
7381
|
since: timestampSchema.optional()
|
|
7252
7382
|
});
|
|
7253
|
-
var publicRunsListContract =
|
|
7383
|
+
var publicRunsListContract = c16.router({
|
|
7254
7384
|
list: {
|
|
7255
7385
|
method: "GET",
|
|
7256
7386
|
path: "/v1/runs",
|
|
@@ -7279,12 +7409,12 @@ var publicRunsListContract = c15.router({
|
|
|
7279
7409
|
description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
|
|
7280
7410
|
}
|
|
7281
7411
|
});
|
|
7282
|
-
var publicRunByIdContract =
|
|
7412
|
+
var publicRunByIdContract = c16.router({
|
|
7283
7413
|
get: {
|
|
7284
7414
|
method: "GET",
|
|
7285
7415
|
path: "/v1/runs/:id",
|
|
7286
|
-
pathParams:
|
|
7287
|
-
id:
|
|
7416
|
+
pathParams: z21.object({
|
|
7417
|
+
id: z21.string().min(1, "Run ID is required")
|
|
7288
7418
|
}),
|
|
7289
7419
|
responses: {
|
|
7290
7420
|
200: publicRunDetailSchema,
|
|
@@ -7296,14 +7426,14 @@ var publicRunByIdContract = c15.router({
|
|
|
7296
7426
|
description: "Get run details by ID"
|
|
7297
7427
|
}
|
|
7298
7428
|
});
|
|
7299
|
-
var publicRunCancelContract =
|
|
7429
|
+
var publicRunCancelContract = c16.router({
|
|
7300
7430
|
cancel: {
|
|
7301
7431
|
method: "POST",
|
|
7302
7432
|
path: "/v1/runs/:id/cancel",
|
|
7303
|
-
pathParams:
|
|
7304
|
-
id:
|
|
7433
|
+
pathParams: z21.object({
|
|
7434
|
+
id: z21.string().min(1, "Run ID is required")
|
|
7305
7435
|
}),
|
|
7306
|
-
body:
|
|
7436
|
+
body: z21.undefined(),
|
|
7307
7437
|
responses: {
|
|
7308
7438
|
200: publicRunDetailSchema,
|
|
7309
7439
|
400: publicApiErrorSchema,
|
|
@@ -7316,26 +7446,26 @@ var publicRunCancelContract = c15.router({
|
|
|
7316
7446
|
description: "Cancel a pending or running execution"
|
|
7317
7447
|
}
|
|
7318
7448
|
});
|
|
7319
|
-
var logEntrySchema =
|
|
7449
|
+
var logEntrySchema = z21.object({
|
|
7320
7450
|
timestamp: timestampSchema,
|
|
7321
|
-
type:
|
|
7322
|
-
level:
|
|
7323
|
-
message:
|
|
7324
|
-
metadata:
|
|
7451
|
+
type: z21.enum(["agent", "system", "network"]),
|
|
7452
|
+
level: z21.enum(["debug", "info", "warn", "error"]),
|
|
7453
|
+
message: z21.string(),
|
|
7454
|
+
metadata: z21.record(z21.string(), z21.unknown()).optional()
|
|
7325
7455
|
});
|
|
7326
7456
|
var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
|
|
7327
7457
|
var logsQuerySchema = listQuerySchema.extend({
|
|
7328
|
-
type:
|
|
7458
|
+
type: z21.enum(["agent", "system", "network", "all"]).default("all"),
|
|
7329
7459
|
since: timestampSchema.optional(),
|
|
7330
7460
|
until: timestampSchema.optional(),
|
|
7331
|
-
order:
|
|
7461
|
+
order: z21.enum(["asc", "desc"]).default("asc")
|
|
7332
7462
|
});
|
|
7333
|
-
var publicRunLogsContract =
|
|
7463
|
+
var publicRunLogsContract = c16.router({
|
|
7334
7464
|
getLogs: {
|
|
7335
7465
|
method: "GET",
|
|
7336
7466
|
path: "/v1/runs/:id/logs",
|
|
7337
|
-
pathParams:
|
|
7338
|
-
id:
|
|
7467
|
+
pathParams: z21.object({
|
|
7468
|
+
id: z21.string().min(1, "Run ID is required")
|
|
7339
7469
|
}),
|
|
7340
7470
|
query: logsQuerySchema,
|
|
7341
7471
|
responses: {
|
|
@@ -7348,29 +7478,29 @@ var publicRunLogsContract = c15.router({
|
|
|
7348
7478
|
description: "Get unified logs for a run. Combines agent, system, and network logs."
|
|
7349
7479
|
}
|
|
7350
7480
|
});
|
|
7351
|
-
var metricPointSchema =
|
|
7481
|
+
var metricPointSchema = z21.object({
|
|
7352
7482
|
timestamp: timestampSchema,
|
|
7353
|
-
cpu_percent:
|
|
7354
|
-
memory_used_mb:
|
|
7355
|
-
memory_total_mb:
|
|
7356
|
-
disk_used_mb:
|
|
7357
|
-
disk_total_mb:
|
|
7358
|
-
});
|
|
7359
|
-
var metricsSummarySchema =
|
|
7360
|
-
avg_cpu_percent:
|
|
7361
|
-
max_memory_used_mb:
|
|
7362
|
-
total_duration_ms:
|
|
7363
|
-
});
|
|
7364
|
-
var metricsResponseSchema2 =
|
|
7365
|
-
data:
|
|
7483
|
+
cpu_percent: z21.number(),
|
|
7484
|
+
memory_used_mb: z21.number(),
|
|
7485
|
+
memory_total_mb: z21.number(),
|
|
7486
|
+
disk_used_mb: z21.number(),
|
|
7487
|
+
disk_total_mb: z21.number()
|
|
7488
|
+
});
|
|
7489
|
+
var metricsSummarySchema = z21.object({
|
|
7490
|
+
avg_cpu_percent: z21.number(),
|
|
7491
|
+
max_memory_used_mb: z21.number(),
|
|
7492
|
+
total_duration_ms: z21.number().nullable()
|
|
7493
|
+
});
|
|
7494
|
+
var metricsResponseSchema2 = z21.object({
|
|
7495
|
+
data: z21.array(metricPointSchema),
|
|
7366
7496
|
summary: metricsSummarySchema
|
|
7367
7497
|
});
|
|
7368
|
-
var publicRunMetricsContract =
|
|
7498
|
+
var publicRunMetricsContract = c16.router({
|
|
7369
7499
|
getMetrics: {
|
|
7370
7500
|
method: "GET",
|
|
7371
7501
|
path: "/v1/runs/:id/metrics",
|
|
7372
|
-
pathParams:
|
|
7373
|
-
id:
|
|
7502
|
+
pathParams: z21.object({
|
|
7503
|
+
id: z21.string().min(1, "Run ID is required")
|
|
7374
7504
|
}),
|
|
7375
7505
|
responses: {
|
|
7376
7506
|
200: metricsResponseSchema2,
|
|
@@ -7382,7 +7512,7 @@ var publicRunMetricsContract = c15.router({
|
|
|
7382
7512
|
description: "Get CPU, memory, and disk metrics for a run"
|
|
7383
7513
|
}
|
|
7384
7514
|
});
|
|
7385
|
-
var sseEventTypeSchema =
|
|
7515
|
+
var sseEventTypeSchema = z21.enum([
|
|
7386
7516
|
"status",
|
|
7387
7517
|
// Run status change
|
|
7388
7518
|
"output",
|
|
@@ -7394,25 +7524,25 @@ var sseEventTypeSchema = z20.enum([
|
|
|
7394
7524
|
"heartbeat"
|
|
7395
7525
|
// Keep-alive
|
|
7396
7526
|
]);
|
|
7397
|
-
var sseEventSchema =
|
|
7527
|
+
var sseEventSchema = z21.object({
|
|
7398
7528
|
event: sseEventTypeSchema,
|
|
7399
|
-
data:
|
|
7400
|
-
id:
|
|
7529
|
+
data: z21.unknown(),
|
|
7530
|
+
id: z21.string().optional()
|
|
7401
7531
|
// For Last-Event-ID reconnection
|
|
7402
7532
|
});
|
|
7403
|
-
var publicRunEventsContract =
|
|
7533
|
+
var publicRunEventsContract = c16.router({
|
|
7404
7534
|
streamEvents: {
|
|
7405
7535
|
method: "GET",
|
|
7406
7536
|
path: "/v1/runs/:id/events",
|
|
7407
|
-
pathParams:
|
|
7408
|
-
id:
|
|
7537
|
+
pathParams: z21.object({
|
|
7538
|
+
id: z21.string().min(1, "Run ID is required")
|
|
7409
7539
|
}),
|
|
7410
|
-
query:
|
|
7411
|
-
last_event_id:
|
|
7540
|
+
query: z21.object({
|
|
7541
|
+
last_event_id: z21.string().optional()
|
|
7412
7542
|
// For reconnection
|
|
7413
7543
|
}),
|
|
7414
7544
|
responses: {
|
|
7415
|
-
200:
|
|
7545
|
+
200: z21.any(),
|
|
7416
7546
|
// SSE stream - actual content is text/event-stream
|
|
7417
7547
|
401: publicApiErrorSchema,
|
|
7418
7548
|
404: publicApiErrorSchema,
|
|
@@ -7424,28 +7554,28 @@ var publicRunEventsContract = c15.router({
|
|
|
7424
7554
|
});
|
|
7425
7555
|
|
|
7426
7556
|
// ../../packages/core/src/contracts/public/artifacts.ts
|
|
7427
|
-
import { z as
|
|
7428
|
-
var
|
|
7429
|
-
var publicArtifactSchema =
|
|
7430
|
-
id:
|
|
7431
|
-
name:
|
|
7432
|
-
current_version_id:
|
|
7433
|
-
size:
|
|
7557
|
+
import { z as z22 } from "zod";
|
|
7558
|
+
var c17 = initContract();
|
|
7559
|
+
var publicArtifactSchema = z22.object({
|
|
7560
|
+
id: z22.string(),
|
|
7561
|
+
name: z22.string(),
|
|
7562
|
+
current_version_id: z22.string().nullable(),
|
|
7563
|
+
size: z22.number(),
|
|
7434
7564
|
// Total size in bytes
|
|
7435
|
-
file_count:
|
|
7565
|
+
file_count: z22.number(),
|
|
7436
7566
|
created_at: timestampSchema,
|
|
7437
7567
|
updated_at: timestampSchema
|
|
7438
7568
|
});
|
|
7439
|
-
var artifactVersionSchema =
|
|
7440
|
-
id:
|
|
7569
|
+
var artifactVersionSchema = z22.object({
|
|
7570
|
+
id: z22.string(),
|
|
7441
7571
|
// SHA-256 content hash
|
|
7442
|
-
artifact_id:
|
|
7443
|
-
size:
|
|
7572
|
+
artifact_id: z22.string(),
|
|
7573
|
+
size: z22.number(),
|
|
7444
7574
|
// Size in bytes
|
|
7445
|
-
file_count:
|
|
7446
|
-
message:
|
|
7575
|
+
file_count: z22.number(),
|
|
7576
|
+
message: z22.string().nullable(),
|
|
7447
7577
|
// Optional commit message
|
|
7448
|
-
created_by:
|
|
7578
|
+
created_by: z22.string(),
|
|
7449
7579
|
created_at: timestampSchema
|
|
7450
7580
|
});
|
|
7451
7581
|
var publicArtifactDetailSchema = publicArtifactSchema.extend({
|
|
@@ -7455,7 +7585,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
|
|
|
7455
7585
|
var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
|
|
7456
7586
|
artifactVersionSchema
|
|
7457
7587
|
);
|
|
7458
|
-
var publicArtifactsListContract =
|
|
7588
|
+
var publicArtifactsListContract = c17.router({
|
|
7459
7589
|
list: {
|
|
7460
7590
|
method: "GET",
|
|
7461
7591
|
path: "/v1/artifacts",
|
|
@@ -7469,12 +7599,12 @@ var publicArtifactsListContract = c16.router({
|
|
|
7469
7599
|
description: "List all artifacts in the current scope with pagination"
|
|
7470
7600
|
}
|
|
7471
7601
|
});
|
|
7472
|
-
var publicArtifactByIdContract =
|
|
7602
|
+
var publicArtifactByIdContract = c17.router({
|
|
7473
7603
|
get: {
|
|
7474
7604
|
method: "GET",
|
|
7475
7605
|
path: "/v1/artifacts/:id",
|
|
7476
|
-
pathParams:
|
|
7477
|
-
id:
|
|
7606
|
+
pathParams: z22.object({
|
|
7607
|
+
id: z22.string().min(1, "Artifact ID is required")
|
|
7478
7608
|
}),
|
|
7479
7609
|
responses: {
|
|
7480
7610
|
200: publicArtifactDetailSchema,
|
|
@@ -7486,12 +7616,12 @@ var publicArtifactByIdContract = c16.router({
|
|
|
7486
7616
|
description: "Get artifact details by ID"
|
|
7487
7617
|
}
|
|
7488
7618
|
});
|
|
7489
|
-
var publicArtifactVersionsContract =
|
|
7619
|
+
var publicArtifactVersionsContract = c17.router({
|
|
7490
7620
|
list: {
|
|
7491
7621
|
method: "GET",
|
|
7492
7622
|
path: "/v1/artifacts/:id/versions",
|
|
7493
|
-
pathParams:
|
|
7494
|
-
id:
|
|
7623
|
+
pathParams: z22.object({
|
|
7624
|
+
id: z22.string().min(1, "Artifact ID is required")
|
|
7495
7625
|
}),
|
|
7496
7626
|
query: listQuerySchema,
|
|
7497
7627
|
responses: {
|
|
@@ -7504,19 +7634,19 @@ var publicArtifactVersionsContract = c16.router({
|
|
|
7504
7634
|
description: "List all versions of an artifact with pagination"
|
|
7505
7635
|
}
|
|
7506
7636
|
});
|
|
7507
|
-
var publicArtifactDownloadContract =
|
|
7637
|
+
var publicArtifactDownloadContract = c17.router({
|
|
7508
7638
|
download: {
|
|
7509
7639
|
method: "GET",
|
|
7510
7640
|
path: "/v1/artifacts/:id/download",
|
|
7511
|
-
pathParams:
|
|
7512
|
-
id:
|
|
7641
|
+
pathParams: z22.object({
|
|
7642
|
+
id: z22.string().min(1, "Artifact ID is required")
|
|
7513
7643
|
}),
|
|
7514
|
-
query:
|
|
7515
|
-
version_id:
|
|
7644
|
+
query: z22.object({
|
|
7645
|
+
version_id: z22.string().optional()
|
|
7516
7646
|
// Defaults to current version
|
|
7517
7647
|
}),
|
|
7518
7648
|
responses: {
|
|
7519
|
-
302:
|
|
7649
|
+
302: z22.undefined(),
|
|
7520
7650
|
// Redirect to presigned URL
|
|
7521
7651
|
401: publicApiErrorSchema,
|
|
7522
7652
|
404: publicApiErrorSchema,
|
|
@@ -7528,28 +7658,28 @@ var publicArtifactDownloadContract = c16.router({
|
|
|
7528
7658
|
});
|
|
7529
7659
|
|
|
7530
7660
|
// ../../packages/core/src/contracts/public/volumes.ts
|
|
7531
|
-
import { z as
|
|
7532
|
-
var
|
|
7533
|
-
var publicVolumeSchema =
|
|
7534
|
-
id:
|
|
7535
|
-
name:
|
|
7536
|
-
current_version_id:
|
|
7537
|
-
size:
|
|
7661
|
+
import { z as z23 } from "zod";
|
|
7662
|
+
var c18 = initContract();
|
|
7663
|
+
var publicVolumeSchema = z23.object({
|
|
7664
|
+
id: z23.string(),
|
|
7665
|
+
name: z23.string(),
|
|
7666
|
+
current_version_id: z23.string().nullable(),
|
|
7667
|
+
size: z23.number(),
|
|
7538
7668
|
// Total size in bytes
|
|
7539
|
-
file_count:
|
|
7669
|
+
file_count: z23.number(),
|
|
7540
7670
|
created_at: timestampSchema,
|
|
7541
7671
|
updated_at: timestampSchema
|
|
7542
7672
|
});
|
|
7543
|
-
var volumeVersionSchema =
|
|
7544
|
-
id:
|
|
7673
|
+
var volumeVersionSchema = z23.object({
|
|
7674
|
+
id: z23.string(),
|
|
7545
7675
|
// SHA-256 content hash
|
|
7546
|
-
volume_id:
|
|
7547
|
-
size:
|
|
7676
|
+
volume_id: z23.string(),
|
|
7677
|
+
size: z23.number(),
|
|
7548
7678
|
// Size in bytes
|
|
7549
|
-
file_count:
|
|
7550
|
-
message:
|
|
7679
|
+
file_count: z23.number(),
|
|
7680
|
+
message: z23.string().nullable(),
|
|
7551
7681
|
// Optional commit message
|
|
7552
|
-
created_by:
|
|
7682
|
+
created_by: z23.string(),
|
|
7553
7683
|
created_at: timestampSchema
|
|
7554
7684
|
});
|
|
7555
7685
|
var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
@@ -7557,7 +7687,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
|
|
|
7557
7687
|
});
|
|
7558
7688
|
var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
|
|
7559
7689
|
var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
|
|
7560
|
-
var publicVolumesListContract =
|
|
7690
|
+
var publicVolumesListContract = c18.router({
|
|
7561
7691
|
list: {
|
|
7562
7692
|
method: "GET",
|
|
7563
7693
|
path: "/v1/volumes",
|
|
@@ -7571,12 +7701,12 @@ var publicVolumesListContract = c17.router({
|
|
|
7571
7701
|
description: "List all volumes in the current scope with pagination"
|
|
7572
7702
|
}
|
|
7573
7703
|
});
|
|
7574
|
-
var publicVolumeByIdContract =
|
|
7704
|
+
var publicVolumeByIdContract = c18.router({
|
|
7575
7705
|
get: {
|
|
7576
7706
|
method: "GET",
|
|
7577
7707
|
path: "/v1/volumes/:id",
|
|
7578
|
-
pathParams:
|
|
7579
|
-
id:
|
|
7708
|
+
pathParams: z23.object({
|
|
7709
|
+
id: z23.string().min(1, "Volume ID is required")
|
|
7580
7710
|
}),
|
|
7581
7711
|
responses: {
|
|
7582
7712
|
200: publicVolumeDetailSchema,
|
|
@@ -7588,12 +7718,12 @@ var publicVolumeByIdContract = c17.router({
|
|
|
7588
7718
|
description: "Get volume details by ID"
|
|
7589
7719
|
}
|
|
7590
7720
|
});
|
|
7591
|
-
var publicVolumeVersionsContract =
|
|
7721
|
+
var publicVolumeVersionsContract = c18.router({
|
|
7592
7722
|
list: {
|
|
7593
7723
|
method: "GET",
|
|
7594
7724
|
path: "/v1/volumes/:id/versions",
|
|
7595
|
-
pathParams:
|
|
7596
|
-
id:
|
|
7725
|
+
pathParams: z23.object({
|
|
7726
|
+
id: z23.string().min(1, "Volume ID is required")
|
|
7597
7727
|
}),
|
|
7598
7728
|
query: listQuerySchema,
|
|
7599
7729
|
responses: {
|
|
@@ -7606,19 +7736,19 @@ var publicVolumeVersionsContract = c17.router({
|
|
|
7606
7736
|
description: "List all versions of a volume with pagination"
|
|
7607
7737
|
}
|
|
7608
7738
|
});
|
|
7609
|
-
var publicVolumeDownloadContract =
|
|
7739
|
+
var publicVolumeDownloadContract = c18.router({
|
|
7610
7740
|
download: {
|
|
7611
7741
|
method: "GET",
|
|
7612
7742
|
path: "/v1/volumes/:id/download",
|
|
7613
|
-
pathParams:
|
|
7614
|
-
id:
|
|
7743
|
+
pathParams: z23.object({
|
|
7744
|
+
id: z23.string().min(1, "Volume ID is required")
|
|
7615
7745
|
}),
|
|
7616
|
-
query:
|
|
7617
|
-
version_id:
|
|
7746
|
+
query: z23.object({
|
|
7747
|
+
version_id: z23.string().optional()
|
|
7618
7748
|
// Defaults to current version
|
|
7619
7749
|
}),
|
|
7620
7750
|
responses: {
|
|
7621
|
-
302:
|
|
7751
|
+
302: z23.undefined(),
|
|
7622
7752
|
// Redirect to presigned URL
|
|
7623
7753
|
401: publicApiErrorSchema,
|
|
7624
7754
|
404: publicApiErrorSchema,
|
|
@@ -9949,7 +10079,7 @@ var benchmarkCommand = new Command4("benchmark").description(
|
|
|
9949
10079
|
});
|
|
9950
10080
|
|
|
9951
10081
|
// src/index.ts
|
|
9952
|
-
var version = true ? "2.13.
|
|
10082
|
+
var version = true ? "2.13.4" : "0.1.0";
|
|
9953
10083
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
9954
10084
|
program.addCommand(startCommand);
|
|
9955
10085
|
program.addCommand(doctorCommand);
|