@vm0/cli 9.62.6 → 9.63.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 +518 -414
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ if (DSN) {
|
|
|
45
45
|
Sentry.init({
|
|
46
46
|
dsn: DSN,
|
|
47
47
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
48
|
-
release: "9.
|
|
48
|
+
release: "9.63.0",
|
|
49
49
|
sendDefaultPii: false,
|
|
50
50
|
tracesSampleRate: 0,
|
|
51
51
|
shutdownTimeout: 500,
|
|
@@ -64,7 +64,7 @@ if (DSN) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
Sentry.setContext("cli", {
|
|
67
|
-
version: "9.
|
|
67
|
+
version: "9.63.0",
|
|
68
68
|
command: process.argv.slice(2).join(" ")
|
|
69
69
|
});
|
|
70
70
|
Sentry.setContext("runtime", {
|
|
@@ -673,7 +673,7 @@ function getConfigPath() {
|
|
|
673
673
|
return join2(homedir2(), ".vm0", "config.json");
|
|
674
674
|
}
|
|
675
675
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
676
|
-
console.log(chalk4.bold(`VM0 CLI v${"9.
|
|
676
|
+
console.log(chalk4.bold(`VM0 CLI v${"9.63.0"}`));
|
|
677
677
|
console.log();
|
|
678
678
|
const config = await loadConfig();
|
|
679
679
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -864,6 +864,15 @@ var agentDefinitionSchema = z4.object({
|
|
|
864
864
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
865
865
|
)
|
|
866
866
|
}).optional(),
|
|
867
|
+
/**
|
|
868
|
+
* VM profile for resource allocation (e.g., "vm0/default", "vm0/browser").
|
|
869
|
+
* Determines rootfs image and VM resources (vCPU, memory).
|
|
870
|
+
* Defaults to "vm0/default" when omitted.
|
|
871
|
+
*/
|
|
872
|
+
experimental_profile: z4.string().regex(
|
|
873
|
+
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
874
|
+
"Profile must be in org/name format (e.g., vm0/default)"
|
|
875
|
+
).optional(),
|
|
867
876
|
/**
|
|
868
877
|
* External firewall rules for proxy-side token replacement.
|
|
869
878
|
* CLI input: map format { slack: { permissions: [...] | "all" } }
|
|
@@ -2638,8 +2647,7 @@ var MODEL_PROVIDER_TYPES = {
|
|
|
2638
2647
|
ANTHROPIC_AUTH_TOKEN: "$secret",
|
|
2639
2648
|
ANTHROPIC_BASE_URL: "https://ai-gateway.vercel.sh",
|
|
2640
2649
|
ANTHROPIC_API_KEY: "",
|
|
2641
|
-
ANTHROPIC_MODEL: "
|
|
2642
|
-
ANTHROPIC_CUSTOM_HEADERS: "x-ai-gateway-providers-only: moonshot"
|
|
2650
|
+
ANTHROPIC_MODEL: "anthropic/claude-sonnet-4.6"
|
|
2643
2651
|
}
|
|
2644
2652
|
},
|
|
2645
2653
|
"azure-foundry": {
|
|
@@ -3091,30 +3099,120 @@ var checkpointsByIdContract = c12.router({
|
|
|
3091
3099
|
}
|
|
3092
3100
|
});
|
|
3093
3101
|
|
|
3094
|
-
// ../../packages/core/src/contracts/
|
|
3102
|
+
// ../../packages/core/src/contracts/chat-threads.ts
|
|
3095
3103
|
import { z as z16 } from "zod";
|
|
3096
3104
|
var c13 = initContract();
|
|
3097
|
-
var
|
|
3105
|
+
var chatThreadListItemSchema = z16.object({
|
|
3106
|
+
id: z16.string(),
|
|
3107
|
+
title: z16.string().nullable(),
|
|
3108
|
+
preview: z16.string().nullable(),
|
|
3109
|
+
createdAt: z16.string(),
|
|
3110
|
+
updatedAt: z16.string()
|
|
3111
|
+
});
|
|
3112
|
+
var storedChatMessageSchema2 = z16.object({
|
|
3113
|
+
role: z16.enum(["user", "assistant"]),
|
|
3114
|
+
content: z16.string(),
|
|
3115
|
+
runId: z16.string().optional(),
|
|
3116
|
+
createdAt: z16.string()
|
|
3117
|
+
});
|
|
3118
|
+
var chatThreadDetailSchema = z16.object({
|
|
3119
|
+
id: z16.string(),
|
|
3120
|
+
title: z16.string().nullable(),
|
|
3121
|
+
agentComposeId: z16.string(),
|
|
3122
|
+
chatMessages: z16.array(storedChatMessageSchema2),
|
|
3123
|
+
latestSessionId: z16.string().nullable(),
|
|
3124
|
+
activeRunId: z16.string().nullable(),
|
|
3125
|
+
activeRunPrompt: z16.string().nullable(),
|
|
3126
|
+
createdAt: z16.string(),
|
|
3127
|
+
updatedAt: z16.string()
|
|
3128
|
+
});
|
|
3129
|
+
var chatThreadsContract = c13.router({
|
|
3130
|
+
create: {
|
|
3131
|
+
method: "POST",
|
|
3132
|
+
path: "/api/chat-threads",
|
|
3133
|
+
headers: authHeadersSchema,
|
|
3134
|
+
body: z16.object({
|
|
3135
|
+
agentComposeId: z16.string().min(1),
|
|
3136
|
+
title: z16.string().optional()
|
|
3137
|
+
}),
|
|
3138
|
+
responses: {
|
|
3139
|
+
201: z16.object({ id: z16.string(), createdAt: z16.string() }),
|
|
3140
|
+
401: apiErrorSchema
|
|
3141
|
+
},
|
|
3142
|
+
summary: "Create a new chat thread"
|
|
3143
|
+
},
|
|
3144
|
+
list: {
|
|
3145
|
+
method: "GET",
|
|
3146
|
+
path: "/api/chat-threads",
|
|
3147
|
+
headers: authHeadersSchema,
|
|
3148
|
+
query: z16.object({
|
|
3149
|
+
agentComposeId: z16.string().min(1, "agentComposeId is required")
|
|
3150
|
+
}),
|
|
3151
|
+
responses: {
|
|
3152
|
+
200: z16.object({ threads: z16.array(chatThreadListItemSchema) }),
|
|
3153
|
+
401: apiErrorSchema
|
|
3154
|
+
},
|
|
3155
|
+
summary: "List chat threads for an agent"
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
var chatThreadByIdContract = c13.router({
|
|
3159
|
+
get: {
|
|
3160
|
+
method: "GET",
|
|
3161
|
+
path: "/api/chat-threads/:id",
|
|
3162
|
+
headers: authHeadersSchema,
|
|
3163
|
+
pathParams: z16.object({ id: z16.string() }),
|
|
3164
|
+
responses: {
|
|
3165
|
+
200: chatThreadDetailSchema,
|
|
3166
|
+
401: apiErrorSchema,
|
|
3167
|
+
404: apiErrorSchema
|
|
3168
|
+
},
|
|
3169
|
+
summary: "Get chat thread detail with messages"
|
|
3170
|
+
}
|
|
3171
|
+
});
|
|
3172
|
+
var chatThreadRunsContract = c13.router({
|
|
3173
|
+
addRun: {
|
|
3174
|
+
method: "POST",
|
|
3175
|
+
path: "/api/chat-threads/:id/runs",
|
|
3176
|
+
headers: authHeadersSchema,
|
|
3177
|
+
pathParams: z16.object({ id: z16.string() }),
|
|
3178
|
+
body: z16.object({
|
|
3179
|
+
runId: z16.string().min(1)
|
|
3180
|
+
}),
|
|
3181
|
+
responses: {
|
|
3182
|
+
204: z16.void(),
|
|
3183
|
+
401: apiErrorSchema,
|
|
3184
|
+
404: apiErrorSchema
|
|
3185
|
+
},
|
|
3186
|
+
summary: "Associate a run to a chat thread"
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
|
|
3190
|
+
// ../../packages/core/src/contracts/runners.ts
|
|
3191
|
+
import { z as z17 } from "zod";
|
|
3192
|
+
var c14 = initContract();
|
|
3193
|
+
var runnerGroupSchema = z17.string().regex(
|
|
3098
3194
|
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
3099
3195
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
3100
3196
|
);
|
|
3101
|
-
var jobSchema =
|
|
3102
|
-
runId:
|
|
3103
|
-
prompt:
|
|
3104
|
-
agentComposeVersionId:
|
|
3105
|
-
vars:
|
|
3106
|
-
checkpointId:
|
|
3197
|
+
var jobSchema = z17.object({
|
|
3198
|
+
runId: z17.uuid(),
|
|
3199
|
+
prompt: z17.string(),
|
|
3200
|
+
agentComposeVersionId: z17.string().nullable(),
|
|
3201
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
3202
|
+
checkpointId: z17.uuid().nullable(),
|
|
3203
|
+
experimentalProfile: z17.string().optional()
|
|
3107
3204
|
});
|
|
3108
|
-
var runnersPollContract =
|
|
3205
|
+
var runnersPollContract = c14.router({
|
|
3109
3206
|
poll: {
|
|
3110
3207
|
method: "POST",
|
|
3111
3208
|
path: "/api/runners/poll",
|
|
3112
3209
|
headers: authHeadersSchema,
|
|
3113
|
-
body:
|
|
3114
|
-
group: runnerGroupSchema
|
|
3210
|
+
body: z17.object({
|
|
3211
|
+
group: runnerGroupSchema,
|
|
3212
|
+
profiles: z17.array(z17.string()).optional()
|
|
3115
3213
|
}),
|
|
3116
3214
|
responses: {
|
|
3117
|
-
200:
|
|
3215
|
+
200: z17.object({
|
|
3118
3216
|
job: jobSchema.nullable()
|
|
3119
3217
|
}),
|
|
3120
3218
|
400: apiErrorSchema,
|
|
@@ -3124,94 +3222,98 @@ var runnersPollContract = c13.router({
|
|
|
3124
3222
|
summary: "Poll for pending jobs (long-polling with 30s timeout)"
|
|
3125
3223
|
}
|
|
3126
3224
|
});
|
|
3127
|
-
var storageEntrySchema =
|
|
3128
|
-
mountPath:
|
|
3129
|
-
archiveUrl:
|
|
3225
|
+
var storageEntrySchema = z17.object({
|
|
3226
|
+
mountPath: z17.string(),
|
|
3227
|
+
archiveUrl: z17.string().nullable()
|
|
3130
3228
|
});
|
|
3131
|
-
var artifactEntrySchema =
|
|
3132
|
-
mountPath:
|
|
3133
|
-
archiveUrl:
|
|
3134
|
-
vasStorageName:
|
|
3135
|
-
vasVersionId:
|
|
3229
|
+
var artifactEntrySchema = z17.object({
|
|
3230
|
+
mountPath: z17.string(),
|
|
3231
|
+
archiveUrl: z17.string().nullable(),
|
|
3232
|
+
vasStorageName: z17.string(),
|
|
3233
|
+
vasVersionId: z17.string()
|
|
3136
3234
|
});
|
|
3137
|
-
var storageManifestSchema =
|
|
3138
|
-
storages:
|
|
3235
|
+
var storageManifestSchema = z17.object({
|
|
3236
|
+
storages: z17.array(storageEntrySchema),
|
|
3139
3237
|
artifact: artifactEntrySchema.nullable(),
|
|
3140
3238
|
memory: artifactEntrySchema.nullable()
|
|
3141
3239
|
});
|
|
3142
|
-
var resumeSessionSchema =
|
|
3143
|
-
sessionId:
|
|
3144
|
-
sessionHistory:
|
|
3240
|
+
var resumeSessionSchema = z17.object({
|
|
3241
|
+
sessionId: z17.string(),
|
|
3242
|
+
sessionHistory: z17.string()
|
|
3145
3243
|
});
|
|
3146
|
-
var storedExecutionContextSchema =
|
|
3147
|
-
workingDir:
|
|
3244
|
+
var storedExecutionContextSchema = z17.object({
|
|
3245
|
+
workingDir: z17.string(),
|
|
3148
3246
|
storageManifest: storageManifestSchema.nullable(),
|
|
3149
|
-
environment:
|
|
3247
|
+
environment: z17.record(z17.string(), z17.string()).nullable(),
|
|
3150
3248
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3151
|
-
encryptedSecrets:
|
|
3249
|
+
encryptedSecrets: z17.string().nullable(),
|
|
3152
3250
|
// AES-256-GCM encrypted Record<string, string> (secret name → value)
|
|
3153
3251
|
// Maps secret names to OAuth connector types for runtime token refresh (e.g. { "GMAIL_ACCESS_TOKEN": "gmail" })
|
|
3154
|
-
secretConnectorMap:
|
|
3155
|
-
cliAgentType:
|
|
3252
|
+
secretConnectorMap: z17.record(z17.string(), z17.string()).nullable().optional(),
|
|
3253
|
+
cliAgentType: z17.string(),
|
|
3156
3254
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3157
|
-
debugNoMockClaude:
|
|
3255
|
+
debugNoMockClaude: z17.boolean().optional(),
|
|
3158
3256
|
// Dispatch timestamp for E2E timing metrics
|
|
3159
|
-
apiStartTime:
|
|
3257
|
+
apiStartTime: z17.number().optional(),
|
|
3160
3258
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3161
|
-
userTimezone:
|
|
3259
|
+
userTimezone: z17.string().optional(),
|
|
3162
3260
|
// Agent metadata for VM0_AGENT_NAME and VM0_AGENT_ORG env vars
|
|
3163
|
-
agentName:
|
|
3164
|
-
agentOrgSlug:
|
|
3261
|
+
agentName: z17.string().optional(),
|
|
3262
|
+
agentOrgSlug: z17.string().optional(),
|
|
3165
3263
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3166
|
-
memoryName:
|
|
3264
|
+
memoryName: z17.string().optional(),
|
|
3167
3265
|
// Experimental firewall for proxy-side token replacement
|
|
3168
3266
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3169
3267
|
// Experimental capabilities for agent permission enforcement
|
|
3170
|
-
experimentalCapabilities:
|
|
3268
|
+
experimentalCapabilities: z17.array(z17.enum(VALID_CAPABILITIES)).optional(),
|
|
3269
|
+
// VM profile for resource allocation (e.g., "vm0/default", "vm0/browser")
|
|
3270
|
+
experimentalProfile: z17.string().optional()
|
|
3171
3271
|
});
|
|
3172
|
-
var executionContextSchema =
|
|
3173
|
-
runId:
|
|
3174
|
-
prompt:
|
|
3175
|
-
agentComposeVersionId:
|
|
3176
|
-
vars:
|
|
3177
|
-
checkpointId:
|
|
3178
|
-
sandboxToken:
|
|
3272
|
+
var executionContextSchema = z17.object({
|
|
3273
|
+
runId: z17.uuid(),
|
|
3274
|
+
prompt: z17.string(),
|
|
3275
|
+
agentComposeVersionId: z17.string().nullable(),
|
|
3276
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
3277
|
+
checkpointId: z17.uuid().nullable(),
|
|
3278
|
+
sandboxToken: z17.string(),
|
|
3179
3279
|
// New fields for E2B parity:
|
|
3180
|
-
workingDir:
|
|
3280
|
+
workingDir: z17.string(),
|
|
3181
3281
|
storageManifest: storageManifestSchema.nullable(),
|
|
3182
|
-
environment:
|
|
3282
|
+
environment: z17.record(z17.string(), z17.string()).nullable(),
|
|
3183
3283
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3184
|
-
secretValues:
|
|
3284
|
+
secretValues: z17.array(z17.string()).nullable(),
|
|
3185
3285
|
// AES-256-GCM encrypted Record<string, string> — passed through to mitm-addon for auth resolution
|
|
3186
|
-
encryptedSecrets:
|
|
3286
|
+
encryptedSecrets: z17.string().nullable(),
|
|
3187
3287
|
// Maps secret names to OAuth connector types for runtime token refresh
|
|
3188
|
-
secretConnectorMap:
|
|
3189
|
-
cliAgentType:
|
|
3288
|
+
secretConnectorMap: z17.record(z17.string(), z17.string()).nullable().optional(),
|
|
3289
|
+
cliAgentType: z17.string(),
|
|
3190
3290
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3191
|
-
debugNoMockClaude:
|
|
3291
|
+
debugNoMockClaude: z17.boolean().optional(),
|
|
3192
3292
|
// Dispatch timestamp for E2E timing metrics
|
|
3193
|
-
apiStartTime:
|
|
3293
|
+
apiStartTime: z17.number().optional(),
|
|
3194
3294
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3195
|
-
userTimezone:
|
|
3295
|
+
userTimezone: z17.string().optional(),
|
|
3196
3296
|
// Agent metadata
|
|
3197
|
-
agentName:
|
|
3198
|
-
agentOrgSlug:
|
|
3297
|
+
agentName: z17.string().optional(),
|
|
3298
|
+
agentOrgSlug: z17.string().optional(),
|
|
3199
3299
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3200
|
-
memoryName:
|
|
3300
|
+
memoryName: z17.string().optional(),
|
|
3201
3301
|
// Experimental firewall for proxy-side token replacement
|
|
3202
3302
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3203
3303
|
// Experimental capabilities for agent permission enforcement
|
|
3204
|
-
experimentalCapabilities:
|
|
3304
|
+
experimentalCapabilities: z17.array(z17.enum(VALID_CAPABILITIES)).optional(),
|
|
3305
|
+
// VM profile for resource allocation (e.g., "vm0/default", "vm0/browser")
|
|
3306
|
+
experimentalProfile: z17.string().optional()
|
|
3205
3307
|
});
|
|
3206
|
-
var runnersJobClaimContract =
|
|
3308
|
+
var runnersJobClaimContract = c14.router({
|
|
3207
3309
|
claim: {
|
|
3208
3310
|
method: "POST",
|
|
3209
3311
|
path: "/api/runners/jobs/:id/claim",
|
|
3210
3312
|
headers: authHeadersSchema,
|
|
3211
|
-
pathParams:
|
|
3212
|
-
id:
|
|
3313
|
+
pathParams: z17.object({
|
|
3314
|
+
id: z17.uuid()
|
|
3213
3315
|
}),
|
|
3214
|
-
body:
|
|
3316
|
+
body: z17.object({}),
|
|
3215
3317
|
responses: {
|
|
3216
3318
|
200: executionContextSchema,
|
|
3217
3319
|
400: apiErrorSchema,
|
|
@@ -3228,13 +3330,13 @@ var runnersJobClaimContract = c13.router({
|
|
|
3228
3330
|
});
|
|
3229
3331
|
|
|
3230
3332
|
// ../../packages/core/src/contracts/schedules.ts
|
|
3231
|
-
import { z as
|
|
3232
|
-
var
|
|
3233
|
-
var scheduleTriggerSchema =
|
|
3234
|
-
cron:
|
|
3235
|
-
at:
|
|
3236
|
-
loop:
|
|
3237
|
-
timezone:
|
|
3333
|
+
import { z as z18 } from "zod";
|
|
3334
|
+
var c15 = initContract();
|
|
3335
|
+
var scheduleTriggerSchema = z18.object({
|
|
3336
|
+
cron: z18.string().optional(),
|
|
3337
|
+
at: z18.string().optional(),
|
|
3338
|
+
loop: z18.object({ interval: z18.number().int().min(0) }).optional(),
|
|
3339
|
+
timezone: z18.string().default("UTC")
|
|
3238
3340
|
}).refine(
|
|
3239
3341
|
(data) => {
|
|
3240
3342
|
const triggers = [data.cron, data.at, data.loop].filter(Boolean);
|
|
@@ -3244,41 +3346,41 @@ var scheduleTriggerSchema = z17.object({
|
|
|
3244
3346
|
message: "Exactly one of 'cron', 'at', or 'loop' must be specified"
|
|
3245
3347
|
}
|
|
3246
3348
|
);
|
|
3247
|
-
var scheduleRunConfigSchema =
|
|
3248
|
-
agent:
|
|
3249
|
-
prompt:
|
|
3250
|
-
vars:
|
|
3251
|
-
secrets:
|
|
3252
|
-
artifactName:
|
|
3253
|
-
artifactVersion:
|
|
3254
|
-
volumeVersions:
|
|
3349
|
+
var scheduleRunConfigSchema = z18.object({
|
|
3350
|
+
agent: z18.string().min(1, "Agent reference required"),
|
|
3351
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
3352
|
+
vars: z18.record(z18.string(), z18.string()).optional(),
|
|
3353
|
+
secrets: z18.record(z18.string(), z18.string()).optional(),
|
|
3354
|
+
artifactName: z18.string().optional(),
|
|
3355
|
+
artifactVersion: z18.string().optional(),
|
|
3356
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional()
|
|
3255
3357
|
});
|
|
3256
|
-
var scheduleDefinitionSchema =
|
|
3358
|
+
var scheduleDefinitionSchema = z18.object({
|
|
3257
3359
|
on: scheduleTriggerSchema,
|
|
3258
3360
|
run: scheduleRunConfigSchema
|
|
3259
3361
|
});
|
|
3260
|
-
var scheduleYamlSchema =
|
|
3261
|
-
version:
|
|
3262
|
-
schedules:
|
|
3362
|
+
var scheduleYamlSchema = z18.object({
|
|
3363
|
+
version: z18.literal("1.0"),
|
|
3364
|
+
schedules: z18.record(z18.string(), scheduleDefinitionSchema)
|
|
3263
3365
|
});
|
|
3264
|
-
var deployScheduleRequestSchema =
|
|
3265
|
-
name:
|
|
3266
|
-
cronExpression:
|
|
3267
|
-
atTime:
|
|
3268
|
-
intervalSeconds:
|
|
3269
|
-
timezone:
|
|
3270
|
-
prompt:
|
|
3366
|
+
var deployScheduleRequestSchema = z18.object({
|
|
3367
|
+
name: z18.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
3368
|
+
cronExpression: z18.string().optional(),
|
|
3369
|
+
atTime: z18.string().optional(),
|
|
3370
|
+
intervalSeconds: z18.number().int().min(0).optional(),
|
|
3371
|
+
timezone: z18.string().default("UTC"),
|
|
3372
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
3271
3373
|
// vars and secrets removed - now managed via platform tables
|
|
3272
|
-
artifactName:
|
|
3273
|
-
artifactVersion:
|
|
3274
|
-
volumeVersions:
|
|
3374
|
+
artifactName: z18.string().optional(),
|
|
3375
|
+
artifactVersion: z18.string().optional(),
|
|
3376
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional(),
|
|
3275
3377
|
// Resolved agent compose ID (CLI resolves org/name:version → composeId)
|
|
3276
|
-
composeId:
|
|
3378
|
+
composeId: z18.string().uuid("Invalid compose ID"),
|
|
3277
3379
|
// Enable schedule immediately upon creation
|
|
3278
|
-
enabled:
|
|
3380
|
+
enabled: z18.boolean().optional(),
|
|
3279
3381
|
// Per-schedule notification control (AND'd with user global preferences)
|
|
3280
|
-
notifyEmail:
|
|
3281
|
-
notifySlack:
|
|
3382
|
+
notifyEmail: z18.boolean().optional(),
|
|
3383
|
+
notifySlack: z18.boolean().optional()
|
|
3282
3384
|
}).refine(
|
|
3283
3385
|
(data) => {
|
|
3284
3386
|
const triggers = [
|
|
@@ -3292,38 +3394,38 @@ var deployScheduleRequestSchema = z17.object({
|
|
|
3292
3394
|
message: "Exactly one of 'cronExpression', 'atTime', or 'intervalSeconds' must be specified"
|
|
3293
3395
|
}
|
|
3294
3396
|
);
|
|
3295
|
-
var scheduleResponseSchema =
|
|
3296
|
-
id:
|
|
3297
|
-
composeId:
|
|
3298
|
-
composeName:
|
|
3299
|
-
orgSlug:
|
|
3300
|
-
userId:
|
|
3301
|
-
name:
|
|
3302
|
-
triggerType:
|
|
3303
|
-
cronExpression:
|
|
3304
|
-
atTime:
|
|
3305
|
-
intervalSeconds:
|
|
3306
|
-
timezone:
|
|
3307
|
-
prompt:
|
|
3308
|
-
vars:
|
|
3397
|
+
var scheduleResponseSchema = z18.object({
|
|
3398
|
+
id: z18.uuid(),
|
|
3399
|
+
composeId: z18.uuid(),
|
|
3400
|
+
composeName: z18.string(),
|
|
3401
|
+
orgSlug: z18.string(),
|
|
3402
|
+
userId: z18.string(),
|
|
3403
|
+
name: z18.string(),
|
|
3404
|
+
triggerType: z18.enum(["cron", "once", "loop"]),
|
|
3405
|
+
cronExpression: z18.string().nullable(),
|
|
3406
|
+
atTime: z18.string().nullable(),
|
|
3407
|
+
intervalSeconds: z18.number().nullable(),
|
|
3408
|
+
timezone: z18.string(),
|
|
3409
|
+
prompt: z18.string(),
|
|
3410
|
+
vars: z18.record(z18.string(), z18.string()).nullable(),
|
|
3309
3411
|
// Secret names only (values are never returned)
|
|
3310
|
-
secretNames:
|
|
3311
|
-
artifactName:
|
|
3312
|
-
artifactVersion:
|
|
3313
|
-
volumeVersions:
|
|
3314
|
-
enabled:
|
|
3315
|
-
notifyEmail:
|
|
3316
|
-
notifySlack:
|
|
3317
|
-
nextRunAt:
|
|
3318
|
-
lastRunAt:
|
|
3319
|
-
retryStartedAt:
|
|
3320
|
-
consecutiveFailures:
|
|
3321
|
-
createdAt:
|
|
3322
|
-
updatedAt:
|
|
3412
|
+
secretNames: z18.array(z18.string()).nullable(),
|
|
3413
|
+
artifactName: z18.string().nullable(),
|
|
3414
|
+
artifactVersion: z18.string().nullable(),
|
|
3415
|
+
volumeVersions: z18.record(z18.string(), z18.string()).nullable(),
|
|
3416
|
+
enabled: z18.boolean(),
|
|
3417
|
+
notifyEmail: z18.boolean(),
|
|
3418
|
+
notifySlack: z18.boolean(),
|
|
3419
|
+
nextRunAt: z18.string().nullable(),
|
|
3420
|
+
lastRunAt: z18.string().nullable(),
|
|
3421
|
+
retryStartedAt: z18.string().nullable(),
|
|
3422
|
+
consecutiveFailures: z18.number(),
|
|
3423
|
+
createdAt: z18.string(),
|
|
3424
|
+
updatedAt: z18.string()
|
|
3323
3425
|
});
|
|
3324
|
-
var runSummarySchema =
|
|
3325
|
-
id:
|
|
3326
|
-
status:
|
|
3426
|
+
var runSummarySchema = z18.object({
|
|
3427
|
+
id: z18.uuid(),
|
|
3428
|
+
status: z18.enum([
|
|
3327
3429
|
"queued",
|
|
3328
3430
|
"pending",
|
|
3329
3431
|
"running",
|
|
@@ -3331,22 +3433,22 @@ var runSummarySchema = z17.object({
|
|
|
3331
3433
|
"failed",
|
|
3332
3434
|
"timeout"
|
|
3333
3435
|
]),
|
|
3334
|
-
createdAt:
|
|
3335
|
-
completedAt:
|
|
3336
|
-
error:
|
|
3436
|
+
createdAt: z18.string(),
|
|
3437
|
+
completedAt: z18.string().nullable(),
|
|
3438
|
+
error: z18.string().nullable()
|
|
3337
3439
|
});
|
|
3338
|
-
var scheduleRunsResponseSchema =
|
|
3339
|
-
runs:
|
|
3440
|
+
var scheduleRunsResponseSchema = z18.object({
|
|
3441
|
+
runs: z18.array(runSummarySchema)
|
|
3340
3442
|
});
|
|
3341
|
-
var scheduleListResponseSchema =
|
|
3342
|
-
schedules:
|
|
3443
|
+
var scheduleListResponseSchema = z18.object({
|
|
3444
|
+
schedules: z18.array(scheduleResponseSchema)
|
|
3343
3445
|
});
|
|
3344
|
-
var deployScheduleResponseSchema =
|
|
3446
|
+
var deployScheduleResponseSchema = z18.object({
|
|
3345
3447
|
schedule: scheduleResponseSchema,
|
|
3346
|
-
created:
|
|
3448
|
+
created: z18.boolean()
|
|
3347
3449
|
// true if created, false if updated
|
|
3348
3450
|
});
|
|
3349
|
-
var schedulesMainContract =
|
|
3451
|
+
var schedulesMainContract = c15.router({
|
|
3350
3452
|
/**
|
|
3351
3453
|
* POST /api/agent/schedules
|
|
3352
3454
|
* Deploy (create or update) a schedule
|
|
@@ -3384,7 +3486,7 @@ var schedulesMainContract = c14.router({
|
|
|
3384
3486
|
summary: "List all schedules"
|
|
3385
3487
|
}
|
|
3386
3488
|
});
|
|
3387
|
-
var schedulesByNameContract =
|
|
3489
|
+
var schedulesByNameContract = c15.router({
|
|
3388
3490
|
/**
|
|
3389
3491
|
* GET /api/agent/schedules/:name
|
|
3390
3492
|
* Get schedule by name
|
|
@@ -3393,11 +3495,11 @@ var schedulesByNameContract = c14.router({
|
|
|
3393
3495
|
method: "GET",
|
|
3394
3496
|
path: "/api/agent/schedules/:name",
|
|
3395
3497
|
headers: authHeadersSchema,
|
|
3396
|
-
pathParams:
|
|
3397
|
-
name:
|
|
3498
|
+
pathParams: z18.object({
|
|
3499
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3398
3500
|
}),
|
|
3399
|
-
query:
|
|
3400
|
-
composeId:
|
|
3501
|
+
query: z18.object({
|
|
3502
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3401
3503
|
}),
|
|
3402
3504
|
responses: {
|
|
3403
3505
|
200: scheduleResponseSchema,
|
|
@@ -3415,14 +3517,14 @@ var schedulesByNameContract = c14.router({
|
|
|
3415
3517
|
method: "DELETE",
|
|
3416
3518
|
path: "/api/agent/schedules/:name",
|
|
3417
3519
|
headers: authHeadersSchema,
|
|
3418
|
-
pathParams:
|
|
3419
|
-
name:
|
|
3520
|
+
pathParams: z18.object({
|
|
3521
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3420
3522
|
}),
|
|
3421
|
-
query:
|
|
3422
|
-
composeId:
|
|
3523
|
+
query: z18.object({
|
|
3524
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3423
3525
|
}),
|
|
3424
3526
|
responses: {
|
|
3425
|
-
204:
|
|
3527
|
+
204: c15.noBody(),
|
|
3426
3528
|
401: apiErrorSchema,
|
|
3427
3529
|
403: apiErrorSchema,
|
|
3428
3530
|
404: apiErrorSchema
|
|
@@ -3430,7 +3532,7 @@ var schedulesByNameContract = c14.router({
|
|
|
3430
3532
|
summary: "Delete schedule"
|
|
3431
3533
|
}
|
|
3432
3534
|
});
|
|
3433
|
-
var schedulesEnableContract =
|
|
3535
|
+
var schedulesEnableContract = c15.router({
|
|
3434
3536
|
/**
|
|
3435
3537
|
* POST /api/agent/schedules/:name/enable
|
|
3436
3538
|
* Enable a disabled schedule
|
|
@@ -3439,11 +3541,11 @@ var schedulesEnableContract = c14.router({
|
|
|
3439
3541
|
method: "POST",
|
|
3440
3542
|
path: "/api/agent/schedules/:name/enable",
|
|
3441
3543
|
headers: authHeadersSchema,
|
|
3442
|
-
pathParams:
|
|
3443
|
-
name:
|
|
3544
|
+
pathParams: z18.object({
|
|
3545
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3444
3546
|
}),
|
|
3445
|
-
body:
|
|
3446
|
-
composeId:
|
|
3547
|
+
body: z18.object({
|
|
3548
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3447
3549
|
}),
|
|
3448
3550
|
responses: {
|
|
3449
3551
|
200: scheduleResponseSchema,
|
|
@@ -3461,11 +3563,11 @@ var schedulesEnableContract = c14.router({
|
|
|
3461
3563
|
method: "POST",
|
|
3462
3564
|
path: "/api/agent/schedules/:name/disable",
|
|
3463
3565
|
headers: authHeadersSchema,
|
|
3464
|
-
pathParams:
|
|
3465
|
-
name:
|
|
3566
|
+
pathParams: z18.object({
|
|
3567
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3466
3568
|
}),
|
|
3467
|
-
body:
|
|
3468
|
-
composeId:
|
|
3569
|
+
body: z18.object({
|
|
3570
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3469
3571
|
}),
|
|
3470
3572
|
responses: {
|
|
3471
3573
|
200: scheduleResponseSchema,
|
|
@@ -3476,7 +3578,7 @@ var schedulesEnableContract = c14.router({
|
|
|
3476
3578
|
summary: "Disable schedule"
|
|
3477
3579
|
}
|
|
3478
3580
|
});
|
|
3479
|
-
var scheduleRunsContract =
|
|
3581
|
+
var scheduleRunsContract = c15.router({
|
|
3480
3582
|
/**
|
|
3481
3583
|
* GET /api/agent/schedules/:name/runs
|
|
3482
3584
|
* List recent runs for a schedule
|
|
@@ -3485,12 +3587,12 @@ var scheduleRunsContract = c14.router({
|
|
|
3485
3587
|
method: "GET",
|
|
3486
3588
|
path: "/api/agent/schedules/:name/runs",
|
|
3487
3589
|
headers: authHeadersSchema,
|
|
3488
|
-
pathParams:
|
|
3489
|
-
name:
|
|
3590
|
+
pathParams: z18.object({
|
|
3591
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3490
3592
|
}),
|
|
3491
|
-
query:
|
|
3492
|
-
composeId:
|
|
3493
|
-
limit:
|
|
3593
|
+
query: z18.object({
|
|
3594
|
+
composeId: z18.string().uuid("Compose ID required"),
|
|
3595
|
+
limit: z18.coerce.number().min(0).max(100).default(5)
|
|
3494
3596
|
}),
|
|
3495
3597
|
responses: {
|
|
3496
3598
|
200: scheduleRunsResponseSchema,
|
|
@@ -3503,18 +3605,18 @@ var scheduleRunsContract = c14.router({
|
|
|
3503
3605
|
});
|
|
3504
3606
|
|
|
3505
3607
|
// ../../packages/core/src/contracts/realtime.ts
|
|
3506
|
-
import { z as
|
|
3507
|
-
var
|
|
3508
|
-
var ablyTokenRequestSchema =
|
|
3509
|
-
keyName:
|
|
3510
|
-
ttl:
|
|
3511
|
-
timestamp:
|
|
3512
|
-
capability:
|
|
3513
|
-
clientId:
|
|
3514
|
-
nonce:
|
|
3515
|
-
mac:
|
|
3608
|
+
import { z as z19 } from "zod";
|
|
3609
|
+
var c16 = initContract();
|
|
3610
|
+
var ablyTokenRequestSchema = z19.object({
|
|
3611
|
+
keyName: z19.string(),
|
|
3612
|
+
ttl: z19.number().optional(),
|
|
3613
|
+
timestamp: z19.number(),
|
|
3614
|
+
capability: z19.string(),
|
|
3615
|
+
clientId: z19.string().optional(),
|
|
3616
|
+
nonce: z19.string(),
|
|
3617
|
+
mac: z19.string()
|
|
3516
3618
|
});
|
|
3517
|
-
var runnerRealtimeTokenContract =
|
|
3619
|
+
var runnerRealtimeTokenContract = c16.router({
|
|
3518
3620
|
/**
|
|
3519
3621
|
* POST /api/runners/realtime/token
|
|
3520
3622
|
* Get an Ably token to subscribe to a runner group's job notification channel
|
|
@@ -3523,7 +3625,7 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
3523
3625
|
method: "POST",
|
|
3524
3626
|
path: "/api/runners/realtime/token",
|
|
3525
3627
|
headers: authHeadersSchema,
|
|
3526
|
-
body:
|
|
3628
|
+
body: z19.object({
|
|
3527
3629
|
group: runnerGroupSchema
|
|
3528
3630
|
}),
|
|
3529
3631
|
responses: {
|
|
@@ -3537,22 +3639,22 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
3537
3639
|
});
|
|
3538
3640
|
|
|
3539
3641
|
// ../../packages/core/src/contracts/platform.ts
|
|
3540
|
-
import { z as
|
|
3541
|
-
var paginationSchema =
|
|
3542
|
-
hasMore:
|
|
3543
|
-
nextCursor:
|
|
3642
|
+
import { z as z20 } from "zod";
|
|
3643
|
+
var paginationSchema = z20.object({
|
|
3644
|
+
hasMore: z20.boolean(),
|
|
3645
|
+
nextCursor: z20.string().nullable()
|
|
3544
3646
|
});
|
|
3545
|
-
var listQuerySchema =
|
|
3546
|
-
cursor:
|
|
3547
|
-
limit:
|
|
3647
|
+
var listQuerySchema = z20.object({
|
|
3648
|
+
cursor: z20.string().optional(),
|
|
3649
|
+
limit: z20.coerce.number().min(1).max(100).default(20)
|
|
3548
3650
|
});
|
|
3549
|
-
var
|
|
3550
|
-
var platformPaginationSchema =
|
|
3551
|
-
hasMore:
|
|
3552
|
-
nextCursor:
|
|
3553
|
-
totalPages:
|
|
3651
|
+
var c17 = initContract();
|
|
3652
|
+
var platformPaginationSchema = z20.object({
|
|
3653
|
+
hasMore: z20.boolean(),
|
|
3654
|
+
nextCursor: z20.string().nullable(),
|
|
3655
|
+
totalPages: z20.number()
|
|
3554
3656
|
});
|
|
3555
|
-
var platformLogStatusSchema =
|
|
3657
|
+
var platformLogStatusSchema = z20.enum([
|
|
3556
3658
|
"queued",
|
|
3557
3659
|
"pending",
|
|
3558
3660
|
"running",
|
|
@@ -3561,47 +3663,47 @@ var platformLogStatusSchema = z19.enum([
|
|
|
3561
3663
|
"timeout",
|
|
3562
3664
|
"cancelled"
|
|
3563
3665
|
]);
|
|
3564
|
-
var platformLogEntrySchema =
|
|
3565
|
-
id:
|
|
3566
|
-
sessionId:
|
|
3567
|
-
agentName:
|
|
3568
|
-
orgSlug:
|
|
3569
|
-
framework:
|
|
3666
|
+
var platformLogEntrySchema = z20.object({
|
|
3667
|
+
id: z20.uuid(),
|
|
3668
|
+
sessionId: z20.string().nullable(),
|
|
3669
|
+
agentName: z20.string(),
|
|
3670
|
+
orgSlug: z20.string().nullable(),
|
|
3671
|
+
framework: z20.string().nullable(),
|
|
3570
3672
|
status: platformLogStatusSchema,
|
|
3571
|
-
createdAt:
|
|
3572
|
-
startedAt:
|
|
3573
|
-
completedAt:
|
|
3673
|
+
createdAt: z20.string(),
|
|
3674
|
+
startedAt: z20.string().nullable(),
|
|
3675
|
+
completedAt: z20.string().nullable()
|
|
3574
3676
|
});
|
|
3575
|
-
var platformLogsListResponseSchema =
|
|
3576
|
-
data:
|
|
3677
|
+
var platformLogsListResponseSchema = z20.object({
|
|
3678
|
+
data: z20.array(platformLogEntrySchema),
|
|
3577
3679
|
pagination: platformPaginationSchema
|
|
3578
3680
|
});
|
|
3579
|
-
var artifactSchema =
|
|
3580
|
-
name:
|
|
3581
|
-
version:
|
|
3681
|
+
var artifactSchema = z20.object({
|
|
3682
|
+
name: z20.string().nullable(),
|
|
3683
|
+
version: z20.string().nullable()
|
|
3582
3684
|
});
|
|
3583
|
-
var platformLogDetailSchema =
|
|
3584
|
-
id:
|
|
3585
|
-
sessionId:
|
|
3586
|
-
agentName:
|
|
3587
|
-
framework:
|
|
3685
|
+
var platformLogDetailSchema = z20.object({
|
|
3686
|
+
id: z20.uuid(),
|
|
3687
|
+
sessionId: z20.string().nullable(),
|
|
3688
|
+
agentName: z20.string(),
|
|
3689
|
+
framework: z20.string().nullable(),
|
|
3588
3690
|
status: platformLogStatusSchema,
|
|
3589
|
-
prompt:
|
|
3590
|
-
error:
|
|
3591
|
-
createdAt:
|
|
3592
|
-
startedAt:
|
|
3593
|
-
completedAt:
|
|
3691
|
+
prompt: z20.string(),
|
|
3692
|
+
error: z20.string().nullable(),
|
|
3693
|
+
createdAt: z20.string(),
|
|
3694
|
+
startedAt: z20.string().nullable(),
|
|
3695
|
+
completedAt: z20.string().nullable(),
|
|
3594
3696
|
artifact: artifactSchema
|
|
3595
3697
|
});
|
|
3596
|
-
var platformLogsListContract =
|
|
3698
|
+
var platformLogsListContract = c17.router({
|
|
3597
3699
|
list: {
|
|
3598
3700
|
method: "GET",
|
|
3599
3701
|
path: "/api/platform/logs",
|
|
3600
3702
|
query: listQuerySchema.extend({
|
|
3601
|
-
search:
|
|
3602
|
-
agent:
|
|
3603
|
-
name:
|
|
3604
|
-
org:
|
|
3703
|
+
search: z20.string().optional(),
|
|
3704
|
+
agent: z20.string().optional(),
|
|
3705
|
+
name: z20.string().optional(),
|
|
3706
|
+
org: z20.string().optional(),
|
|
3605
3707
|
status: platformLogStatusSchema.optional()
|
|
3606
3708
|
}),
|
|
3607
3709
|
responses: {
|
|
@@ -3611,13 +3713,13 @@ var platformLogsListContract = c16.router({
|
|
|
3611
3713
|
summary: "List agent run logs with pagination"
|
|
3612
3714
|
}
|
|
3613
3715
|
});
|
|
3614
|
-
var platformLogsByIdContract =
|
|
3716
|
+
var platformLogsByIdContract = c17.router({
|
|
3615
3717
|
getById: {
|
|
3616
3718
|
method: "GET",
|
|
3617
3719
|
path: "/api/platform/logs/:id",
|
|
3618
3720
|
headers: authHeadersSchema,
|
|
3619
|
-
pathParams:
|
|
3620
|
-
id:
|
|
3721
|
+
pathParams: z20.object({
|
|
3722
|
+
id: z20.string().uuid("Invalid log ID")
|
|
3621
3723
|
}),
|
|
3622
3724
|
responses: {
|
|
3623
3725
|
200: platformLogDetailSchema,
|
|
@@ -3627,17 +3729,17 @@ var platformLogsByIdContract = c16.router({
|
|
|
3627
3729
|
summary: "Get agent run log details by ID"
|
|
3628
3730
|
}
|
|
3629
3731
|
});
|
|
3630
|
-
var artifactDownloadResponseSchema =
|
|
3631
|
-
url:
|
|
3632
|
-
expiresAt:
|
|
3732
|
+
var artifactDownloadResponseSchema = z20.object({
|
|
3733
|
+
url: z20.url(),
|
|
3734
|
+
expiresAt: z20.string()
|
|
3633
3735
|
});
|
|
3634
|
-
var platformArtifactDownloadContract =
|
|
3736
|
+
var platformArtifactDownloadContract = c17.router({
|
|
3635
3737
|
getDownloadUrl: {
|
|
3636
3738
|
method: "GET",
|
|
3637
3739
|
path: "/api/platform/artifacts/download",
|
|
3638
|
-
query:
|
|
3639
|
-
name:
|
|
3640
|
-
version:
|
|
3740
|
+
query: z20.object({
|
|
3741
|
+
name: z20.string().min(1, "Artifact name is required"),
|
|
3742
|
+
version: z20.string().optional()
|
|
3641
3743
|
}),
|
|
3642
3744
|
responses: {
|
|
3643
3745
|
200: artifactDownloadResponseSchema,
|
|
@@ -3649,43 +3751,43 @@ var platformArtifactDownloadContract = c16.router({
|
|
|
3649
3751
|
});
|
|
3650
3752
|
|
|
3651
3753
|
// ../../packages/core/src/contracts/compose-jobs.ts
|
|
3652
|
-
import { z as
|
|
3653
|
-
var
|
|
3654
|
-
var composeJobStatusSchema =
|
|
3754
|
+
import { z as z21 } from "zod";
|
|
3755
|
+
var c18 = initContract();
|
|
3756
|
+
var composeJobStatusSchema = z21.enum([
|
|
3655
3757
|
"pending",
|
|
3656
3758
|
"running",
|
|
3657
3759
|
"completed",
|
|
3658
3760
|
"failed"
|
|
3659
3761
|
]);
|
|
3660
|
-
var composeJobResultSchema =
|
|
3661
|
-
composeId:
|
|
3662
|
-
composeName:
|
|
3663
|
-
versionId:
|
|
3664
|
-
warnings:
|
|
3762
|
+
var composeJobResultSchema = z21.object({
|
|
3763
|
+
composeId: z21.string(),
|
|
3764
|
+
composeName: z21.string(),
|
|
3765
|
+
versionId: z21.string(),
|
|
3766
|
+
warnings: z21.array(z21.string())
|
|
3665
3767
|
});
|
|
3666
|
-
var composeJobSourceSchema =
|
|
3667
|
-
var createComposeJobRequestSchema =
|
|
3668
|
-
|
|
3669
|
-
githubUrl:
|
|
3670
|
-
overwrite:
|
|
3768
|
+
var composeJobSourceSchema = z21.enum(["github", "platform", "slack"]);
|
|
3769
|
+
var createComposeJobRequestSchema = z21.union([
|
|
3770
|
+
z21.object({
|
|
3771
|
+
githubUrl: z21.url().check(z21.startsWith("https://github.com/")),
|
|
3772
|
+
overwrite: z21.boolean().optional().default(false)
|
|
3671
3773
|
}),
|
|
3672
|
-
|
|
3673
|
-
content:
|
|
3674
|
-
instructions:
|
|
3774
|
+
z21.object({
|
|
3775
|
+
content: z21.record(z21.string(), z21.unknown()),
|
|
3776
|
+
instructions: z21.string().optional()
|
|
3675
3777
|
})
|
|
3676
3778
|
]);
|
|
3677
|
-
var composeJobResponseSchema =
|
|
3678
|
-
jobId:
|
|
3779
|
+
var composeJobResponseSchema = z21.object({
|
|
3780
|
+
jobId: z21.string(),
|
|
3679
3781
|
status: composeJobStatusSchema,
|
|
3680
|
-
githubUrl:
|
|
3782
|
+
githubUrl: z21.string().optional(),
|
|
3681
3783
|
source: composeJobSourceSchema.optional(),
|
|
3682
3784
|
result: composeJobResultSchema.optional(),
|
|
3683
|
-
error:
|
|
3684
|
-
createdAt:
|
|
3685
|
-
startedAt:
|
|
3686
|
-
completedAt:
|
|
3785
|
+
error: z21.string().optional(),
|
|
3786
|
+
createdAt: z21.string(),
|
|
3787
|
+
startedAt: z21.string().optional(),
|
|
3788
|
+
completedAt: z21.string().optional()
|
|
3687
3789
|
});
|
|
3688
|
-
var composeJobsMainContract =
|
|
3790
|
+
var composeJobsMainContract = c18.router({
|
|
3689
3791
|
/**
|
|
3690
3792
|
* POST /api/compose/jobs
|
|
3691
3793
|
* Create a new compose job from GitHub URL or platform content
|
|
@@ -3705,7 +3807,7 @@ var composeJobsMainContract = c17.router({
|
|
|
3705
3807
|
summary: "Create compose job"
|
|
3706
3808
|
}
|
|
3707
3809
|
});
|
|
3708
|
-
var composeJobsByIdContract =
|
|
3810
|
+
var composeJobsByIdContract = c18.router({
|
|
3709
3811
|
/**
|
|
3710
3812
|
* GET /api/compose/jobs/:jobId
|
|
3711
3813
|
* Get compose job status and result
|
|
@@ -3714,8 +3816,8 @@ var composeJobsByIdContract = c17.router({
|
|
|
3714
3816
|
method: "GET",
|
|
3715
3817
|
path: "/api/compose/jobs/:jobId",
|
|
3716
3818
|
headers: authHeadersSchema,
|
|
3717
|
-
pathParams:
|
|
3718
|
-
jobId:
|
|
3819
|
+
pathParams: z21.object({
|
|
3820
|
+
jobId: z21.uuid()
|
|
3719
3821
|
}),
|
|
3720
3822
|
responses: {
|
|
3721
3823
|
200: composeJobResponseSchema,
|
|
@@ -3725,7 +3827,7 @@ var composeJobsByIdContract = c17.router({
|
|
|
3725
3827
|
summary: "Get compose job status"
|
|
3726
3828
|
}
|
|
3727
3829
|
});
|
|
3728
|
-
var webhookComposeCompleteContract =
|
|
3830
|
+
var webhookComposeCompleteContract = c18.router({
|
|
3729
3831
|
/**
|
|
3730
3832
|
* POST /api/webhooks/compose/complete
|
|
3731
3833
|
* Handle compose job completion from sandbox
|
|
@@ -3734,16 +3836,16 @@ var webhookComposeCompleteContract = c17.router({
|
|
|
3734
3836
|
method: "POST",
|
|
3735
3837
|
path: "/api/webhooks/compose/complete",
|
|
3736
3838
|
headers: authHeadersSchema,
|
|
3737
|
-
body:
|
|
3738
|
-
jobId:
|
|
3739
|
-
success:
|
|
3839
|
+
body: z21.object({
|
|
3840
|
+
jobId: z21.uuid(),
|
|
3841
|
+
success: z21.boolean(),
|
|
3740
3842
|
// Result from CLI compose command
|
|
3741
3843
|
result: composeJobResultSchema.optional(),
|
|
3742
|
-
error:
|
|
3844
|
+
error: z21.string().optional()
|
|
3743
3845
|
}),
|
|
3744
3846
|
responses: {
|
|
3745
|
-
200:
|
|
3746
|
-
success:
|
|
3847
|
+
200: z21.object({
|
|
3848
|
+
success: z21.boolean()
|
|
3747
3849
|
}),
|
|
3748
3850
|
400: apiErrorSchema,
|
|
3749
3851
|
401: apiErrorSchema,
|
|
@@ -3754,8 +3856,8 @@ var webhookComposeCompleteContract = c17.router({
|
|
|
3754
3856
|
});
|
|
3755
3857
|
|
|
3756
3858
|
// ../../packages/core/src/contracts/connectors.ts
|
|
3757
|
-
import { z as
|
|
3758
|
-
var
|
|
3859
|
+
import { z as z22 } from "zod";
|
|
3860
|
+
var c19 = initContract();
|
|
3759
3861
|
var CONNECTOR_TYPES_DEF = {
|
|
3760
3862
|
axiom: {
|
|
3761
3863
|
label: "Axiom",
|
|
@@ -6245,7 +6347,7 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
6245
6347
|
}
|
|
6246
6348
|
};
|
|
6247
6349
|
var CONNECTOR_TYPES = CONNECTOR_TYPES_DEF;
|
|
6248
|
-
var connectorTypeSchema =
|
|
6350
|
+
var connectorTypeSchema = z22.enum([
|
|
6249
6351
|
"agentmail",
|
|
6250
6352
|
"ahrefs",
|
|
6251
6353
|
"atlassian",
|
|
@@ -6373,23 +6475,24 @@ function getConnectorDerivedNames(secretName) {
|
|
|
6373
6475
|
}
|
|
6374
6476
|
return null;
|
|
6375
6477
|
}
|
|
6376
|
-
var connectorResponseSchema =
|
|
6377
|
-
id:
|
|
6478
|
+
var connectorResponseSchema = z22.object({
|
|
6479
|
+
id: z22.uuid().nullable(),
|
|
6378
6480
|
type: connectorTypeSchema,
|
|
6379
|
-
authMethod:
|
|
6380
|
-
externalId:
|
|
6381
|
-
externalUsername:
|
|
6382
|
-
externalEmail:
|
|
6383
|
-
oauthScopes:
|
|
6384
|
-
|
|
6385
|
-
|
|
6481
|
+
authMethod: z22.string(),
|
|
6482
|
+
externalId: z22.string().nullable(),
|
|
6483
|
+
externalUsername: z22.string().nullable(),
|
|
6484
|
+
externalEmail: z22.string().nullable(),
|
|
6485
|
+
oauthScopes: z22.array(z22.string()).nullable(),
|
|
6486
|
+
needsReconnect: z22.boolean(),
|
|
6487
|
+
createdAt: z22.string(),
|
|
6488
|
+
updatedAt: z22.string()
|
|
6386
6489
|
});
|
|
6387
|
-
var connectorListResponseSchema =
|
|
6388
|
-
connectors:
|
|
6389
|
-
configuredTypes:
|
|
6390
|
-
connectorProvidedSecretNames:
|
|
6490
|
+
var connectorListResponseSchema = z22.object({
|
|
6491
|
+
connectors: z22.array(connectorResponseSchema),
|
|
6492
|
+
configuredTypes: z22.array(connectorTypeSchema),
|
|
6493
|
+
connectorProvidedSecretNames: z22.array(z22.string())
|
|
6391
6494
|
});
|
|
6392
|
-
var connectorsMainContract =
|
|
6495
|
+
var connectorsMainContract = c19.router({
|
|
6393
6496
|
list: {
|
|
6394
6497
|
method: "GET",
|
|
6395
6498
|
path: "/api/connectors",
|
|
@@ -6402,12 +6505,12 @@ var connectorsMainContract = c18.router({
|
|
|
6402
6505
|
summary: "List all connectors for the authenticated user"
|
|
6403
6506
|
}
|
|
6404
6507
|
});
|
|
6405
|
-
var connectorsByTypeContract =
|
|
6508
|
+
var connectorsByTypeContract = c19.router({
|
|
6406
6509
|
get: {
|
|
6407
6510
|
method: "GET",
|
|
6408
6511
|
path: "/api/connectors/:type",
|
|
6409
6512
|
headers: authHeadersSchema,
|
|
6410
|
-
pathParams:
|
|
6513
|
+
pathParams: z22.object({
|
|
6411
6514
|
type: connectorTypeSchema
|
|
6412
6515
|
}),
|
|
6413
6516
|
responses: {
|
|
@@ -6422,11 +6525,11 @@ var connectorsByTypeContract = c18.router({
|
|
|
6422
6525
|
method: "DELETE",
|
|
6423
6526
|
path: "/api/connectors/:type",
|
|
6424
6527
|
headers: authHeadersSchema,
|
|
6425
|
-
pathParams:
|
|
6528
|
+
pathParams: z22.object({
|
|
6426
6529
|
type: connectorTypeSchema
|
|
6427
6530
|
}),
|
|
6428
6531
|
responses: {
|
|
6429
|
-
204:
|
|
6532
|
+
204: c19.noBody(),
|
|
6430
6533
|
401: apiErrorSchema,
|
|
6431
6534
|
404: apiErrorSchema,
|
|
6432
6535
|
500: apiErrorSchema
|
|
@@ -6434,27 +6537,27 @@ var connectorsByTypeContract = c18.router({
|
|
|
6434
6537
|
summary: "Disconnect a connector"
|
|
6435
6538
|
}
|
|
6436
6539
|
});
|
|
6437
|
-
var connectorSessionStatusSchema =
|
|
6540
|
+
var connectorSessionStatusSchema = z22.enum([
|
|
6438
6541
|
"pending",
|
|
6439
6542
|
"complete",
|
|
6440
6543
|
"expired",
|
|
6441
6544
|
"error"
|
|
6442
6545
|
]);
|
|
6443
|
-
var connectorSessionResponseSchema =
|
|
6444
|
-
id:
|
|
6445
|
-
code:
|
|
6546
|
+
var connectorSessionResponseSchema = z22.object({
|
|
6547
|
+
id: z22.uuid(),
|
|
6548
|
+
code: z22.string(),
|
|
6446
6549
|
type: connectorTypeSchema,
|
|
6447
6550
|
status: connectorSessionStatusSchema,
|
|
6448
|
-
verificationUrl:
|
|
6449
|
-
expiresIn:
|
|
6450
|
-
interval:
|
|
6451
|
-
errorMessage:
|
|
6551
|
+
verificationUrl: z22.string(),
|
|
6552
|
+
expiresIn: z22.number(),
|
|
6553
|
+
interval: z22.number(),
|
|
6554
|
+
errorMessage: z22.string().nullable().optional()
|
|
6452
6555
|
});
|
|
6453
|
-
var connectorSessionStatusResponseSchema =
|
|
6556
|
+
var connectorSessionStatusResponseSchema = z22.object({
|
|
6454
6557
|
status: connectorSessionStatusSchema,
|
|
6455
|
-
errorMessage:
|
|
6558
|
+
errorMessage: z22.string().nullable().optional()
|
|
6456
6559
|
});
|
|
6457
|
-
var connectorSessionsContract =
|
|
6560
|
+
var connectorSessionsContract = c19.router({
|
|
6458
6561
|
/**
|
|
6459
6562
|
* POST /api/connectors/:type/sessions
|
|
6460
6563
|
* Create a new connector session for CLI device flow
|
|
@@ -6463,10 +6566,10 @@ var connectorSessionsContract = c18.router({
|
|
|
6463
6566
|
method: "POST",
|
|
6464
6567
|
path: "/api/connectors/:type/sessions",
|
|
6465
6568
|
headers: authHeadersSchema,
|
|
6466
|
-
pathParams:
|
|
6569
|
+
pathParams: z22.object({
|
|
6467
6570
|
type: connectorTypeSchema
|
|
6468
6571
|
}),
|
|
6469
|
-
body:
|
|
6572
|
+
body: z22.object({}).optional(),
|
|
6470
6573
|
responses: {
|
|
6471
6574
|
200: connectorSessionResponseSchema,
|
|
6472
6575
|
400: apiErrorSchema,
|
|
@@ -6476,7 +6579,7 @@ var connectorSessionsContract = c18.router({
|
|
|
6476
6579
|
summary: "Create connector session for CLI device flow"
|
|
6477
6580
|
}
|
|
6478
6581
|
});
|
|
6479
|
-
var connectorSessionByIdContract =
|
|
6582
|
+
var connectorSessionByIdContract = c19.router({
|
|
6480
6583
|
/**
|
|
6481
6584
|
* GET /api/connectors/:type/sessions/:sessionId
|
|
6482
6585
|
* Get connector session status (for CLI polling)
|
|
@@ -6485,9 +6588,9 @@ var connectorSessionByIdContract = c18.router({
|
|
|
6485
6588
|
method: "GET",
|
|
6486
6589
|
path: "/api/connectors/:type/sessions/:sessionId",
|
|
6487
6590
|
headers: authHeadersSchema,
|
|
6488
|
-
pathParams:
|
|
6591
|
+
pathParams: z22.object({
|
|
6489
6592
|
type: connectorTypeSchema,
|
|
6490
|
-
sessionId:
|
|
6593
|
+
sessionId: z22.uuid()
|
|
6491
6594
|
}),
|
|
6492
6595
|
responses: {
|
|
6493
6596
|
200: connectorSessionStatusResponseSchema,
|
|
@@ -6499,19 +6602,19 @@ var connectorSessionByIdContract = c18.router({
|
|
|
6499
6602
|
summary: "Get connector session status"
|
|
6500
6603
|
}
|
|
6501
6604
|
});
|
|
6502
|
-
var computerConnectorCreateResponseSchema =
|
|
6503
|
-
id:
|
|
6504
|
-
ngrokToken:
|
|
6505
|
-
bridgeToken:
|
|
6506
|
-
endpointPrefix:
|
|
6507
|
-
domain:
|
|
6605
|
+
var computerConnectorCreateResponseSchema = z22.object({
|
|
6606
|
+
id: z22.uuid(),
|
|
6607
|
+
ngrokToken: z22.string(),
|
|
6608
|
+
bridgeToken: z22.string(),
|
|
6609
|
+
endpointPrefix: z22.string(),
|
|
6610
|
+
domain: z22.string()
|
|
6508
6611
|
});
|
|
6509
|
-
var computerConnectorContract =
|
|
6612
|
+
var computerConnectorContract = c19.router({
|
|
6510
6613
|
create: {
|
|
6511
6614
|
method: "POST",
|
|
6512
6615
|
path: "/api/connectors/computer",
|
|
6513
6616
|
headers: authHeadersSchema,
|
|
6514
|
-
body:
|
|
6617
|
+
body: z22.object({}).optional(),
|
|
6515
6618
|
responses: {
|
|
6516
6619
|
200: computerConnectorCreateResponseSchema,
|
|
6517
6620
|
400: apiErrorSchema,
|
|
@@ -6537,7 +6640,7 @@ var computerConnectorContract = c18.router({
|
|
|
6537
6640
|
path: "/api/connectors/computer",
|
|
6538
6641
|
headers: authHeadersSchema,
|
|
6539
6642
|
responses: {
|
|
6540
|
-
204:
|
|
6643
|
+
204: c19.noBody(),
|
|
6541
6644
|
401: apiErrorSchema,
|
|
6542
6645
|
404: apiErrorSchema,
|
|
6543
6646
|
500: apiErrorSchema
|
|
@@ -6666,7 +6769,7 @@ function resolveFirewallRef(input) {
|
|
|
6666
6769
|
}
|
|
6667
6770
|
|
|
6668
6771
|
// ../../packages/core/src/firewall-loader.ts
|
|
6669
|
-
var MAX_RESPONSE_SIZE =
|
|
6772
|
+
var MAX_RESPONSE_SIZE = 128 * 1024;
|
|
6670
6773
|
function buildFirewallYamlUrl(ref) {
|
|
6671
6774
|
const url = resolveFirewallRef(ref);
|
|
6672
6775
|
const parsed = parseGitHubTreeUrl(url);
|
|
@@ -6752,7 +6855,8 @@ function validateRule(rule, permName, serviceName) {
|
|
|
6752
6855
|
const seg = segments[i];
|
|
6753
6856
|
if (seg.startsWith("{") && seg.endsWith("}")) {
|
|
6754
6857
|
const name = seg.slice(1, -1);
|
|
6755
|
-
const
|
|
6858
|
+
const isGreedy = name.endsWith("+") || name.endsWith("*");
|
|
6859
|
+
const baseName = isGreedy ? name.slice(0, -1) : name;
|
|
6756
6860
|
if (!baseName) {
|
|
6757
6861
|
throw new Error(
|
|
6758
6862
|
`Invalid rule "${rule}" in permission "${permName}" of firewall "${serviceName}": empty parameter name`
|
|
@@ -6764,7 +6868,7 @@ function validateRule(rule, permName, serviceName) {
|
|
|
6764
6868
|
);
|
|
6765
6869
|
}
|
|
6766
6870
|
paramNames.add(baseName);
|
|
6767
|
-
if (
|
|
6871
|
+
if (isGreedy && i !== segments.length - 1) {
|
|
6768
6872
|
throw new Error(
|
|
6769
6873
|
`Invalid rule "${rule}" in permission "${permName}" of firewall "${serviceName}": {${name}} must be the last segment`
|
|
6770
6874
|
);
|
|
@@ -6888,21 +6992,21 @@ async function expandFirewallConfigs(config, fetchFn) {
|
|
|
6888
6992
|
}
|
|
6889
6993
|
|
|
6890
6994
|
// ../../packages/core/src/contracts/user-preferences.ts
|
|
6891
|
-
import { z as
|
|
6892
|
-
var
|
|
6893
|
-
var sendModeSchema =
|
|
6894
|
-
var userPreferencesResponseSchema =
|
|
6895
|
-
timezone:
|
|
6896
|
-
notifyEmail:
|
|
6897
|
-
notifySlack:
|
|
6898
|
-
pinnedAgentIds:
|
|
6995
|
+
import { z as z23 } from "zod";
|
|
6996
|
+
var c20 = initContract();
|
|
6997
|
+
var sendModeSchema = z23.enum(["enter", "cmd-enter"]);
|
|
6998
|
+
var userPreferencesResponseSchema = z23.object({
|
|
6999
|
+
timezone: z23.string().nullable(),
|
|
7000
|
+
notifyEmail: z23.boolean(),
|
|
7001
|
+
notifySlack: z23.boolean(),
|
|
7002
|
+
pinnedAgentIds: z23.array(z23.string()),
|
|
6899
7003
|
sendMode: sendModeSchema
|
|
6900
7004
|
});
|
|
6901
|
-
var updateUserPreferencesRequestSchema =
|
|
6902
|
-
timezone:
|
|
6903
|
-
notifyEmail:
|
|
6904
|
-
notifySlack:
|
|
6905
|
-
pinnedAgentIds:
|
|
7005
|
+
var updateUserPreferencesRequestSchema = z23.object({
|
|
7006
|
+
timezone: z23.string().min(1).optional(),
|
|
7007
|
+
notifyEmail: z23.boolean().optional(),
|
|
7008
|
+
notifySlack: z23.boolean().optional(),
|
|
7009
|
+
pinnedAgentIds: z23.array(z23.string()).max(4).optional(),
|
|
6906
7010
|
sendMode: sendModeSchema.optional()
|
|
6907
7011
|
}).refine(
|
|
6908
7012
|
(data) => data.timezone !== void 0 || data.notifyEmail !== void 0 || data.notifySlack !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0,
|
|
@@ -6910,7 +7014,7 @@ var updateUserPreferencesRequestSchema = z22.object({
|
|
|
6910
7014
|
message: "At least one preference must be provided"
|
|
6911
7015
|
}
|
|
6912
7016
|
);
|
|
6913
|
-
var userPreferencesContract =
|
|
7017
|
+
var userPreferencesContract = c20.router({
|
|
6914
7018
|
/**
|
|
6915
7019
|
* GET /api/user/preferences
|
|
6916
7020
|
* Get current user's preferences
|
|
@@ -6946,17 +7050,17 @@ var userPreferencesContract = c19.router({
|
|
|
6946
7050
|
});
|
|
6947
7051
|
|
|
6948
7052
|
// ../../packages/core/src/contracts/org-list.ts
|
|
6949
|
-
import { z as
|
|
6950
|
-
var
|
|
6951
|
-
var orgListItemSchema =
|
|
6952
|
-
slug:
|
|
6953
|
-
role:
|
|
7053
|
+
import { z as z24 } from "zod";
|
|
7054
|
+
var c21 = initContract();
|
|
7055
|
+
var orgListItemSchema = z24.object({
|
|
7056
|
+
slug: z24.string(),
|
|
7057
|
+
role: z24.string()
|
|
6954
7058
|
});
|
|
6955
|
-
var orgListResponseSchema =
|
|
6956
|
-
orgs:
|
|
6957
|
-
active:
|
|
7059
|
+
var orgListResponseSchema = z24.object({
|
|
7060
|
+
orgs: z24.array(orgListItemSchema),
|
|
7061
|
+
active: z24.string().optional()
|
|
6958
7062
|
});
|
|
6959
|
-
var orgListContract =
|
|
7063
|
+
var orgListContract = c21.router({
|
|
6960
7064
|
/**
|
|
6961
7065
|
* GET /api/org/list
|
|
6962
7066
|
* List all orgs accessible to the user
|
|
@@ -6975,31 +7079,31 @@ var orgListContract = c20.router({
|
|
|
6975
7079
|
});
|
|
6976
7080
|
|
|
6977
7081
|
// ../../packages/core/src/contracts/org-members.ts
|
|
6978
|
-
import { z as
|
|
6979
|
-
var
|
|
6980
|
-
var orgRoleSchema =
|
|
6981
|
-
var orgMemberSchema =
|
|
6982
|
-
userId:
|
|
6983
|
-
email:
|
|
7082
|
+
import { z as z25 } from "zod";
|
|
7083
|
+
var c22 = initContract();
|
|
7084
|
+
var orgRoleSchema = z25.enum(["admin", "member"]);
|
|
7085
|
+
var orgMemberSchema = z25.object({
|
|
7086
|
+
userId: z25.string(),
|
|
7087
|
+
email: z25.string(),
|
|
6984
7088
|
role: orgRoleSchema,
|
|
6985
|
-
joinedAt:
|
|
7089
|
+
joinedAt: z25.string()
|
|
6986
7090
|
});
|
|
6987
|
-
var orgMembersResponseSchema =
|
|
6988
|
-
slug:
|
|
7091
|
+
var orgMembersResponseSchema = z25.object({
|
|
7092
|
+
slug: z25.string(),
|
|
6989
7093
|
role: orgRoleSchema,
|
|
6990
|
-
members:
|
|
6991
|
-
createdAt:
|
|
7094
|
+
members: z25.array(orgMemberSchema),
|
|
7095
|
+
createdAt: z25.string()
|
|
6992
7096
|
});
|
|
6993
|
-
var inviteOrgMemberRequestSchema =
|
|
6994
|
-
email:
|
|
7097
|
+
var inviteOrgMemberRequestSchema = z25.object({
|
|
7098
|
+
email: z25.string().email()
|
|
6995
7099
|
});
|
|
6996
|
-
var removeOrgMemberRequestSchema =
|
|
6997
|
-
email:
|
|
7100
|
+
var removeOrgMemberRequestSchema = z25.object({
|
|
7101
|
+
email: z25.string().email()
|
|
6998
7102
|
});
|
|
6999
|
-
var orgMessageResponseSchema =
|
|
7000
|
-
message:
|
|
7103
|
+
var orgMessageResponseSchema = z25.object({
|
|
7104
|
+
message: z25.string()
|
|
7001
7105
|
});
|
|
7002
|
-
var orgMembersContract =
|
|
7106
|
+
var orgMembersContract = c22.router({
|
|
7003
7107
|
/**
|
|
7004
7108
|
* GET /api/org/members
|
|
7005
7109
|
* Get org members and status
|
|
@@ -7044,7 +7148,7 @@ var orgMembersContract = c21.router({
|
|
|
7044
7148
|
method: "POST",
|
|
7045
7149
|
path: "/api/org/leave",
|
|
7046
7150
|
headers: authHeadersSchema,
|
|
7047
|
-
body:
|
|
7151
|
+
body: z25.object({}),
|
|
7048
7152
|
responses: {
|
|
7049
7153
|
200: orgMessageResponseSchema,
|
|
7050
7154
|
401: apiErrorSchema,
|
|
@@ -7074,22 +7178,22 @@ var orgMembersContract = c21.router({
|
|
|
7074
7178
|
});
|
|
7075
7179
|
|
|
7076
7180
|
// ../../packages/core/src/contracts/onboarding.ts
|
|
7077
|
-
import { z as
|
|
7078
|
-
var
|
|
7079
|
-
var onboardingStatusResponseSchema =
|
|
7080
|
-
needsOnboarding:
|
|
7081
|
-
hasOrg:
|
|
7082
|
-
hasModelProvider:
|
|
7083
|
-
hasDefaultAgent:
|
|
7084
|
-
defaultAgentName:
|
|
7085
|
-
defaultAgentComposeId:
|
|
7086
|
-
defaultAgentMetadata:
|
|
7087
|
-
displayName:
|
|
7088
|
-
description:
|
|
7089
|
-
sound:
|
|
7181
|
+
import { z as z26 } from "zod";
|
|
7182
|
+
var c23 = initContract();
|
|
7183
|
+
var onboardingStatusResponseSchema = z26.object({
|
|
7184
|
+
needsOnboarding: z26.boolean(),
|
|
7185
|
+
hasOrg: z26.boolean(),
|
|
7186
|
+
hasModelProvider: z26.boolean(),
|
|
7187
|
+
hasDefaultAgent: z26.boolean(),
|
|
7188
|
+
defaultAgentName: z26.string().nullable(),
|
|
7189
|
+
defaultAgentComposeId: z26.string().nullable(),
|
|
7190
|
+
defaultAgentMetadata: z26.object({
|
|
7191
|
+
displayName: z26.string().optional(),
|
|
7192
|
+
description: z26.string().optional(),
|
|
7193
|
+
sound: z26.string().optional()
|
|
7090
7194
|
}).nullable()
|
|
7091
7195
|
});
|
|
7092
|
-
var onboardingStatusContract =
|
|
7196
|
+
var onboardingStatusContract = c23.router({
|
|
7093
7197
|
getStatus: {
|
|
7094
7198
|
method: "GET",
|
|
7095
7199
|
path: "/api/onboarding/status",
|
|
@@ -7103,31 +7207,31 @@ var onboardingStatusContract = c22.router({
|
|
|
7103
7207
|
});
|
|
7104
7208
|
|
|
7105
7209
|
// ../../packages/core/src/contracts/skills.ts
|
|
7106
|
-
import { z as
|
|
7107
|
-
var
|
|
7108
|
-
var skillFrontmatterSchema =
|
|
7109
|
-
name:
|
|
7110
|
-
description:
|
|
7111
|
-
vm0_secrets:
|
|
7112
|
-
vm0_vars:
|
|
7210
|
+
import { z as z27 } from "zod";
|
|
7211
|
+
var c24 = initContract();
|
|
7212
|
+
var skillFrontmatterSchema = z27.object({
|
|
7213
|
+
name: z27.string().optional(),
|
|
7214
|
+
description: z27.string().optional(),
|
|
7215
|
+
vm0_secrets: z27.array(z27.string()).optional(),
|
|
7216
|
+
vm0_vars: z27.array(z27.string()).optional()
|
|
7113
7217
|
});
|
|
7114
|
-
var resolvedSkillSchema =
|
|
7115
|
-
storageName:
|
|
7116
|
-
versionHash:
|
|
7218
|
+
var resolvedSkillSchema = z27.object({
|
|
7219
|
+
storageName: z27.string(),
|
|
7220
|
+
versionHash: z27.string(),
|
|
7117
7221
|
frontmatter: skillFrontmatterSchema
|
|
7118
7222
|
});
|
|
7119
|
-
var skillsResolveContract =
|
|
7223
|
+
var skillsResolveContract = c24.router({
|
|
7120
7224
|
resolve: {
|
|
7121
7225
|
method: "POST",
|
|
7122
7226
|
path: "/api/skills/resolve",
|
|
7123
7227
|
headers: authHeadersSchema,
|
|
7124
|
-
body:
|
|
7125
|
-
skills:
|
|
7228
|
+
body: z27.object({
|
|
7229
|
+
skills: z27.array(z27.url()).min(1).max(100)
|
|
7126
7230
|
}),
|
|
7127
7231
|
responses: {
|
|
7128
|
-
200:
|
|
7129
|
-
resolved:
|
|
7130
|
-
unresolved:
|
|
7232
|
+
200: z27.object({
|
|
7233
|
+
resolved: z27.record(z27.string(), resolvedSkillSchema),
|
|
7234
|
+
unresolved: z27.array(z27.string())
|
|
7131
7235
|
}),
|
|
7132
7236
|
400: apiErrorSchema,
|
|
7133
7237
|
401: apiErrorSchema
|
|
@@ -8225,8 +8329,8 @@ async function resolveSkills(skillUrls) {
|
|
|
8225
8329
|
}
|
|
8226
8330
|
|
|
8227
8331
|
// src/lib/domain/yaml-validator.ts
|
|
8228
|
-
import { z as
|
|
8229
|
-
var cliAgentNameSchema =
|
|
8332
|
+
import { z as z28 } from "zod";
|
|
8333
|
+
var cliAgentNameSchema = z28.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
8230
8334
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
8231
8335
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
8232
8336
|
);
|
|
@@ -8240,7 +8344,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8240
8344
|
resolveSkillRef(skillRef);
|
|
8241
8345
|
} catch (error) {
|
|
8242
8346
|
ctx.addIssue({
|
|
8243
|
-
code:
|
|
8347
|
+
code: z28.ZodIssueCode.custom,
|
|
8244
8348
|
message: error instanceof Error ? error.message : `Invalid skill reference: ${skillRef}`,
|
|
8245
8349
|
path: ["skills", i]
|
|
8246
8350
|
});
|
|
@@ -8250,15 +8354,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8250
8354
|
}
|
|
8251
8355
|
}
|
|
8252
8356
|
);
|
|
8253
|
-
var cliComposeSchema =
|
|
8254
|
-
version:
|
|
8255
|
-
agents:
|
|
8256
|
-
volumes:
|
|
8357
|
+
var cliComposeSchema = z28.object({
|
|
8358
|
+
version: z28.string().min(1, "Missing config.version"),
|
|
8359
|
+
agents: z28.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
8360
|
+
volumes: z28.record(z28.string(), volumeConfigSchema).optional()
|
|
8257
8361
|
}).superRefine((config, ctx) => {
|
|
8258
8362
|
const agentKeys = Object.keys(config.agents);
|
|
8259
8363
|
if (agentKeys.length === 0) {
|
|
8260
8364
|
ctx.addIssue({
|
|
8261
|
-
code:
|
|
8365
|
+
code: z28.ZodIssueCode.custom,
|
|
8262
8366
|
message: "agents must have at least one agent defined",
|
|
8263
8367
|
path: ["agents"]
|
|
8264
8368
|
});
|
|
@@ -8266,7 +8370,7 @@ var cliComposeSchema = z27.object({
|
|
|
8266
8370
|
}
|
|
8267
8371
|
if (agentKeys.length > 1) {
|
|
8268
8372
|
ctx.addIssue({
|
|
8269
|
-
code:
|
|
8373
|
+
code: z28.ZodIssueCode.custom,
|
|
8270
8374
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
8271
8375
|
path: ["agents"]
|
|
8272
8376
|
});
|
|
@@ -8278,7 +8382,7 @@ var cliComposeSchema = z27.object({
|
|
|
8278
8382
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
8279
8383
|
if (!config.volumes) {
|
|
8280
8384
|
ctx.addIssue({
|
|
8281
|
-
code:
|
|
8385
|
+
code: z28.ZodIssueCode.custom,
|
|
8282
8386
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
8283
8387
|
path: ["volumes"]
|
|
8284
8388
|
});
|
|
@@ -8288,7 +8392,7 @@ var cliComposeSchema = z27.object({
|
|
|
8288
8392
|
const parts = volDeclaration.split(":");
|
|
8289
8393
|
if (parts.length !== 2) {
|
|
8290
8394
|
ctx.addIssue({
|
|
8291
|
-
code:
|
|
8395
|
+
code: z28.ZodIssueCode.custom,
|
|
8292
8396
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
8293
8397
|
path: ["agents", agentName, "volumes"]
|
|
8294
8398
|
});
|
|
@@ -8297,7 +8401,7 @@ var cliComposeSchema = z27.object({
|
|
|
8297
8401
|
const volumeKey = parts[0].trim();
|
|
8298
8402
|
if (!config.volumes[volumeKey]) {
|
|
8299
8403
|
ctx.addIssue({
|
|
8300
|
-
code:
|
|
8404
|
+
code: z28.ZodIssueCode.custom,
|
|
8301
8405
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
8302
8406
|
path: ["volumes", volumeKey]
|
|
8303
8407
|
});
|
|
@@ -9534,7 +9638,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9534
9638
|
options.autoUpdate = false;
|
|
9535
9639
|
}
|
|
9536
9640
|
if (options.autoUpdate !== false) {
|
|
9537
|
-
await startSilentUpgrade("9.
|
|
9641
|
+
await startSilentUpgrade("9.63.0");
|
|
9538
9642
|
}
|
|
9539
9643
|
try {
|
|
9540
9644
|
let result;
|
|
@@ -10356,7 +10460,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
10356
10460
|
withErrorHandler(
|
|
10357
10461
|
async (identifier, prompt, options) => {
|
|
10358
10462
|
if (options.autoUpdate !== false) {
|
|
10359
|
-
await startSilentUpgrade("9.
|
|
10463
|
+
await startSilentUpgrade("9.63.0");
|
|
10360
10464
|
}
|
|
10361
10465
|
const { org, name, version } = parseIdentifier(identifier);
|
|
10362
10466
|
let composeId;
|
|
@@ -12076,7 +12180,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
12076
12180
|
withErrorHandler(
|
|
12077
12181
|
async (prompt, options) => {
|
|
12078
12182
|
if (options.autoUpdate !== false) {
|
|
12079
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
12183
|
+
const shouldExit = await checkAndUpgrade("9.63.0", prompt);
|
|
12080
12184
|
if (shouldExit) {
|
|
12081
12185
|
process.exit(0);
|
|
12082
12186
|
}
|
|
@@ -13684,7 +13788,7 @@ var listCommand6 = new Command52().name("list").alias("ls").description("List al
|
|
|
13684
13788
|
);
|
|
13685
13789
|
return;
|
|
13686
13790
|
}
|
|
13687
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
13791
|
+
const nameWidth = Math.max(4, ...data.composes.map((c25) => c25.name.length));
|
|
13688
13792
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
13689
13793
|
" "
|
|
13690
13794
|
);
|
|
@@ -14288,7 +14392,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
14288
14392
|
if (!isInteractive()) {
|
|
14289
14393
|
throw new Error("--frequency is required (daily|weekly|monthly|once|loop)");
|
|
14290
14394
|
}
|
|
14291
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
14395
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c25) => c25.value === existingFrequency) : 0;
|
|
14292
14396
|
frequency = await promptSelect(
|
|
14293
14397
|
"Schedule frequency",
|
|
14294
14398
|
FREQUENCY_CHOICES,
|
|
@@ -14313,7 +14417,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
14313
14417
|
throw new Error("--day is required for weekly/monthly");
|
|
14314
14418
|
}
|
|
14315
14419
|
if (frequency === "weekly") {
|
|
14316
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
14420
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c25) => c25.value === existingDay) : 0;
|
|
14317
14421
|
const day2 = await promptSelect(
|
|
14318
14422
|
"Day of week",
|
|
14319
14423
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -16315,7 +16419,7 @@ import chalk69 from "chalk";
|
|
|
16315
16419
|
var listCommand11 = new Command78().name("list").alias("ls").description("List all connectors and their status").action(
|
|
16316
16420
|
withErrorHandler(async () => {
|
|
16317
16421
|
const result = await listConnectors();
|
|
16318
|
-
const connectedMap = new Map(result.connectors.map((
|
|
16422
|
+
const connectedMap = new Map(result.connectors.map((c25) => [c25.type, c25]));
|
|
16319
16423
|
const allTypesRaw = Object.keys(CONNECTOR_TYPES);
|
|
16320
16424
|
const allTypes = [];
|
|
16321
16425
|
for (const type2 of allTypesRaw) {
|
|
@@ -16337,8 +16441,8 @@ var listCommand11 = new Command78().name("list").alias("ls").description("List a
|
|
|
16337
16441
|
console.log(chalk69.dim(header));
|
|
16338
16442
|
for (const type2 of allTypes) {
|
|
16339
16443
|
const connector = connectedMap.get(type2);
|
|
16340
|
-
const status = connector ? chalk69.green("\u2713".padEnd(statusWidth)) : chalk69.dim("-".padEnd(statusWidth));
|
|
16341
|
-
const account = connector?.externalUsername ? `@${connector.externalUsername}` : chalk69.dim("-");
|
|
16444
|
+
const status = connector ? connector.needsReconnect ? chalk69.yellow("!".padEnd(statusWidth)) : chalk69.green("\u2713".padEnd(statusWidth)) : chalk69.dim("-".padEnd(statusWidth));
|
|
16445
|
+
const account = connector?.needsReconnect ? chalk69.yellow("(reconnect needed)") : connector?.externalUsername ? `@${connector.externalUsername}` : chalk69.dim("-");
|
|
16342
16446
|
const row = [type2.padEnd(typeWidth), status, account].join(" ");
|
|
16343
16447
|
console.log(row);
|
|
16344
16448
|
}
|
|
@@ -16847,16 +16951,16 @@ async function handleModelProvider(ctx) {
|
|
|
16847
16951
|
const providerType = await step.prompt(
|
|
16848
16952
|
() => promptSelect(
|
|
16849
16953
|
"Select provider type:",
|
|
16850
|
-
choices.map((
|
|
16851
|
-
title:
|
|
16852
|
-
value:
|
|
16954
|
+
choices.map((c25) => ({
|
|
16955
|
+
title: c25.label,
|
|
16956
|
+
value: c25.type
|
|
16853
16957
|
}))
|
|
16854
16958
|
)
|
|
16855
16959
|
);
|
|
16856
16960
|
if (!providerType) {
|
|
16857
16961
|
process.exit(0);
|
|
16858
16962
|
}
|
|
16859
|
-
const selectedChoice = choices.find((
|
|
16963
|
+
const selectedChoice = choices.find((c25) => c25.type === providerType);
|
|
16860
16964
|
if (selectedChoice?.helpText) {
|
|
16861
16965
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
16862
16966
|
step.detail(chalk75.dim(line));
|
|
@@ -17210,13 +17314,13 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17210
17314
|
if (latestVersion === null) {
|
|
17211
17315
|
throw new Error("Could not check for updates. Please try again later.");
|
|
17212
17316
|
}
|
|
17213
|
-
if (latestVersion === "9.
|
|
17214
|
-
console.log(chalk79.green(`\u2713 Already up to date (${"9.
|
|
17317
|
+
if (latestVersion === "9.63.0") {
|
|
17318
|
+
console.log(chalk79.green(`\u2713 Already up to date (${"9.63.0"})`));
|
|
17215
17319
|
return;
|
|
17216
17320
|
}
|
|
17217
17321
|
console.log(
|
|
17218
17322
|
chalk79.yellow(
|
|
17219
|
-
`Current version: ${"9.
|
|
17323
|
+
`Current version: ${"9.63.0"} -> Latest version: ${latestVersion}`
|
|
17220
17324
|
)
|
|
17221
17325
|
);
|
|
17222
17326
|
console.log();
|
|
@@ -17243,7 +17347,7 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17243
17347
|
const success = await performUpgrade(packageManager);
|
|
17244
17348
|
if (success) {
|
|
17245
17349
|
console.log(
|
|
17246
|
-
chalk79.green(`\u2713 Upgraded from ${"9.
|
|
17350
|
+
chalk79.green(`\u2713 Upgraded from ${"9.63.0"} to ${latestVersion}`)
|
|
17247
17351
|
);
|
|
17248
17352
|
return;
|
|
17249
17353
|
}
|
|
@@ -17257,7 +17361,7 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17257
17361
|
|
|
17258
17362
|
// src/index.ts
|
|
17259
17363
|
var program = new Command87();
|
|
17260
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
17364
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.63.0");
|
|
17261
17365
|
program.addCommand(authCommand);
|
|
17262
17366
|
program.addCommand(infoCommand);
|
|
17263
17367
|
program.addCommand(composeCommand);
|