@vm0/cli 9.62.7 → 9.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +549 -440
- 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.1",
|
|
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.1",
|
|
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.1"}`));
|
|
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,125 @@ 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 unsavedRunSchema = z16.object({
|
|
3119
|
+
runId: z16.string(),
|
|
3120
|
+
status: z16.string(),
|
|
3121
|
+
prompt: z16.string(),
|
|
3122
|
+
error: z16.string().nullable()
|
|
3123
|
+
});
|
|
3124
|
+
var chatThreadDetailSchema = z16.object({
|
|
3125
|
+
id: z16.string(),
|
|
3126
|
+
title: z16.string().nullable(),
|
|
3127
|
+
agentComposeId: z16.string(),
|
|
3128
|
+
chatMessages: z16.array(storedChatMessageSchema2),
|
|
3129
|
+
latestSessionId: z16.string().nullable(),
|
|
3130
|
+
unsavedRuns: z16.array(unsavedRunSchema),
|
|
3131
|
+
createdAt: z16.string(),
|
|
3132
|
+
updatedAt: z16.string()
|
|
3133
|
+
});
|
|
3134
|
+
var chatThreadsContract = c13.router({
|
|
3135
|
+
create: {
|
|
3136
|
+
method: "POST",
|
|
3137
|
+
path: "/api/chat-threads",
|
|
3138
|
+
headers: authHeadersSchema,
|
|
3139
|
+
body: z16.object({
|
|
3140
|
+
agentComposeId: z16.string().min(1),
|
|
3141
|
+
title: z16.string().optional()
|
|
3142
|
+
}),
|
|
3143
|
+
responses: {
|
|
3144
|
+
201: z16.object({ id: z16.string(), createdAt: z16.string() }),
|
|
3145
|
+
401: apiErrorSchema
|
|
3146
|
+
},
|
|
3147
|
+
summary: "Create a new chat thread"
|
|
3148
|
+
},
|
|
3149
|
+
list: {
|
|
3150
|
+
method: "GET",
|
|
3151
|
+
path: "/api/chat-threads",
|
|
3152
|
+
headers: authHeadersSchema,
|
|
3153
|
+
query: z16.object({
|
|
3154
|
+
agentComposeId: z16.string().min(1, "agentComposeId is required")
|
|
3155
|
+
}),
|
|
3156
|
+
responses: {
|
|
3157
|
+
200: z16.object({ threads: z16.array(chatThreadListItemSchema) }),
|
|
3158
|
+
401: apiErrorSchema
|
|
3159
|
+
},
|
|
3160
|
+
summary: "List chat threads for an agent"
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3163
|
+
var chatThreadByIdContract = c13.router({
|
|
3164
|
+
get: {
|
|
3165
|
+
method: "GET",
|
|
3166
|
+
path: "/api/chat-threads/:id",
|
|
3167
|
+
headers: authHeadersSchema,
|
|
3168
|
+
pathParams: z16.object({ id: z16.string() }),
|
|
3169
|
+
responses: {
|
|
3170
|
+
200: chatThreadDetailSchema,
|
|
3171
|
+
401: apiErrorSchema,
|
|
3172
|
+
404: apiErrorSchema
|
|
3173
|
+
},
|
|
3174
|
+
summary: "Get chat thread detail with messages"
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
var chatThreadRunsContract = c13.router({
|
|
3178
|
+
addRun: {
|
|
3179
|
+
method: "POST",
|
|
3180
|
+
path: "/api/chat-threads/:id/runs",
|
|
3181
|
+
headers: authHeadersSchema,
|
|
3182
|
+
pathParams: z16.object({ id: z16.string() }),
|
|
3183
|
+
body: z16.object({
|
|
3184
|
+
runId: z16.string().min(1)
|
|
3185
|
+
}),
|
|
3186
|
+
responses: {
|
|
3187
|
+
204: z16.void(),
|
|
3188
|
+
401: apiErrorSchema,
|
|
3189
|
+
404: apiErrorSchema
|
|
3190
|
+
},
|
|
3191
|
+
summary: "Associate a run to a chat thread"
|
|
3192
|
+
}
|
|
3193
|
+
});
|
|
3194
|
+
|
|
3195
|
+
// ../../packages/core/src/contracts/runners.ts
|
|
3196
|
+
import { z as z17 } from "zod";
|
|
3197
|
+
var c14 = initContract();
|
|
3198
|
+
var runnerGroupSchema = z17.string().regex(
|
|
3098
3199
|
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
3099
3200
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
3100
3201
|
);
|
|
3101
|
-
var jobSchema =
|
|
3102
|
-
runId:
|
|
3103
|
-
prompt:
|
|
3104
|
-
agentComposeVersionId:
|
|
3105
|
-
vars:
|
|
3106
|
-
checkpointId:
|
|
3202
|
+
var jobSchema = z17.object({
|
|
3203
|
+
runId: z17.uuid(),
|
|
3204
|
+
prompt: z17.string(),
|
|
3205
|
+
agentComposeVersionId: z17.string().nullable(),
|
|
3206
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
3207
|
+
checkpointId: z17.uuid().nullable(),
|
|
3208
|
+
experimentalProfile: z17.string().optional()
|
|
3107
3209
|
});
|
|
3108
|
-
var runnersPollContract =
|
|
3210
|
+
var runnersPollContract = c14.router({
|
|
3109
3211
|
poll: {
|
|
3110
3212
|
method: "POST",
|
|
3111
3213
|
path: "/api/runners/poll",
|
|
3112
3214
|
headers: authHeadersSchema,
|
|
3113
|
-
body:
|
|
3114
|
-
group: runnerGroupSchema
|
|
3215
|
+
body: z17.object({
|
|
3216
|
+
group: runnerGroupSchema,
|
|
3217
|
+
profiles: z17.array(z17.string()).optional()
|
|
3115
3218
|
}),
|
|
3116
3219
|
responses: {
|
|
3117
|
-
200:
|
|
3220
|
+
200: z17.object({
|
|
3118
3221
|
job: jobSchema.nullable()
|
|
3119
3222
|
}),
|
|
3120
3223
|
400: apiErrorSchema,
|
|
@@ -3124,94 +3227,98 @@ var runnersPollContract = c13.router({
|
|
|
3124
3227
|
summary: "Poll for pending jobs (long-polling with 30s timeout)"
|
|
3125
3228
|
}
|
|
3126
3229
|
});
|
|
3127
|
-
var storageEntrySchema =
|
|
3128
|
-
mountPath:
|
|
3129
|
-
archiveUrl:
|
|
3230
|
+
var storageEntrySchema = z17.object({
|
|
3231
|
+
mountPath: z17.string(),
|
|
3232
|
+
archiveUrl: z17.string().nullable()
|
|
3130
3233
|
});
|
|
3131
|
-
var artifactEntrySchema =
|
|
3132
|
-
mountPath:
|
|
3133
|
-
archiveUrl:
|
|
3134
|
-
vasStorageName:
|
|
3135
|
-
vasVersionId:
|
|
3234
|
+
var artifactEntrySchema = z17.object({
|
|
3235
|
+
mountPath: z17.string(),
|
|
3236
|
+
archiveUrl: z17.string().nullable(),
|
|
3237
|
+
vasStorageName: z17.string(),
|
|
3238
|
+
vasVersionId: z17.string()
|
|
3136
3239
|
});
|
|
3137
|
-
var storageManifestSchema =
|
|
3138
|
-
storages:
|
|
3240
|
+
var storageManifestSchema = z17.object({
|
|
3241
|
+
storages: z17.array(storageEntrySchema),
|
|
3139
3242
|
artifact: artifactEntrySchema.nullable(),
|
|
3140
3243
|
memory: artifactEntrySchema.nullable()
|
|
3141
3244
|
});
|
|
3142
|
-
var resumeSessionSchema =
|
|
3143
|
-
sessionId:
|
|
3144
|
-
sessionHistory:
|
|
3245
|
+
var resumeSessionSchema = z17.object({
|
|
3246
|
+
sessionId: z17.string(),
|
|
3247
|
+
sessionHistory: z17.string()
|
|
3145
3248
|
});
|
|
3146
|
-
var storedExecutionContextSchema =
|
|
3147
|
-
workingDir:
|
|
3249
|
+
var storedExecutionContextSchema = z17.object({
|
|
3250
|
+
workingDir: z17.string(),
|
|
3148
3251
|
storageManifest: storageManifestSchema.nullable(),
|
|
3149
|
-
environment:
|
|
3252
|
+
environment: z17.record(z17.string(), z17.string()).nullable(),
|
|
3150
3253
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3151
|
-
encryptedSecrets:
|
|
3254
|
+
encryptedSecrets: z17.string().nullable(),
|
|
3152
3255
|
// AES-256-GCM encrypted Record<string, string> (secret name → value)
|
|
3153
3256
|
// Maps secret names to OAuth connector types for runtime token refresh (e.g. { "GMAIL_ACCESS_TOKEN": "gmail" })
|
|
3154
|
-
secretConnectorMap:
|
|
3155
|
-
cliAgentType:
|
|
3257
|
+
secretConnectorMap: z17.record(z17.string(), z17.string()).nullable().optional(),
|
|
3258
|
+
cliAgentType: z17.string(),
|
|
3156
3259
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3157
|
-
debugNoMockClaude:
|
|
3260
|
+
debugNoMockClaude: z17.boolean().optional(),
|
|
3158
3261
|
// Dispatch timestamp for E2E timing metrics
|
|
3159
|
-
apiStartTime:
|
|
3262
|
+
apiStartTime: z17.number().optional(),
|
|
3160
3263
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3161
|
-
userTimezone:
|
|
3264
|
+
userTimezone: z17.string().optional(),
|
|
3162
3265
|
// Agent metadata for VM0_AGENT_NAME and VM0_AGENT_ORG env vars
|
|
3163
|
-
agentName:
|
|
3164
|
-
agentOrgSlug:
|
|
3266
|
+
agentName: z17.string().optional(),
|
|
3267
|
+
agentOrgSlug: z17.string().optional(),
|
|
3165
3268
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3166
|
-
memoryName:
|
|
3269
|
+
memoryName: z17.string().optional(),
|
|
3167
3270
|
// Experimental firewall for proxy-side token replacement
|
|
3168
3271
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3169
3272
|
// Experimental capabilities for agent permission enforcement
|
|
3170
|
-
experimentalCapabilities:
|
|
3273
|
+
experimentalCapabilities: z17.array(z17.enum(VALID_CAPABILITIES)).optional(),
|
|
3274
|
+
// VM profile for resource allocation (e.g., "vm0/default", "vm0/browser")
|
|
3275
|
+
experimentalProfile: z17.string().optional()
|
|
3171
3276
|
});
|
|
3172
|
-
var executionContextSchema =
|
|
3173
|
-
runId:
|
|
3174
|
-
prompt:
|
|
3175
|
-
agentComposeVersionId:
|
|
3176
|
-
vars:
|
|
3177
|
-
checkpointId:
|
|
3178
|
-
sandboxToken:
|
|
3277
|
+
var executionContextSchema = z17.object({
|
|
3278
|
+
runId: z17.uuid(),
|
|
3279
|
+
prompt: z17.string(),
|
|
3280
|
+
agentComposeVersionId: z17.string().nullable(),
|
|
3281
|
+
vars: z17.record(z17.string(), z17.string()).nullable(),
|
|
3282
|
+
checkpointId: z17.uuid().nullable(),
|
|
3283
|
+
sandboxToken: z17.string(),
|
|
3179
3284
|
// New fields for E2B parity:
|
|
3180
|
-
workingDir:
|
|
3285
|
+
workingDir: z17.string(),
|
|
3181
3286
|
storageManifest: storageManifestSchema.nullable(),
|
|
3182
|
-
environment:
|
|
3287
|
+
environment: z17.record(z17.string(), z17.string()).nullable(),
|
|
3183
3288
|
resumeSession: resumeSessionSchema.nullable(),
|
|
3184
|
-
secretValues:
|
|
3289
|
+
secretValues: z17.array(z17.string()).nullable(),
|
|
3185
3290
|
// AES-256-GCM encrypted Record<string, string> — passed through to mitm-addon for auth resolution
|
|
3186
|
-
encryptedSecrets:
|
|
3291
|
+
encryptedSecrets: z17.string().nullable(),
|
|
3187
3292
|
// Maps secret names to OAuth connector types for runtime token refresh
|
|
3188
|
-
secretConnectorMap:
|
|
3189
|
-
cliAgentType:
|
|
3293
|
+
secretConnectorMap: z17.record(z17.string(), z17.string()).nullable().optional(),
|
|
3294
|
+
cliAgentType: z17.string(),
|
|
3190
3295
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
3191
|
-
debugNoMockClaude:
|
|
3296
|
+
debugNoMockClaude: z17.boolean().optional(),
|
|
3192
3297
|
// Dispatch timestamp for E2E timing metrics
|
|
3193
|
-
apiStartTime:
|
|
3298
|
+
apiStartTime: z17.number().optional(),
|
|
3194
3299
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
3195
|
-
userTimezone:
|
|
3300
|
+
userTimezone: z17.string().optional(),
|
|
3196
3301
|
// Agent metadata
|
|
3197
|
-
agentName:
|
|
3198
|
-
agentOrgSlug:
|
|
3302
|
+
agentName: z17.string().optional(),
|
|
3303
|
+
agentOrgSlug: z17.string().optional(),
|
|
3199
3304
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
3200
|
-
memoryName:
|
|
3305
|
+
memoryName: z17.string().optional(),
|
|
3201
3306
|
// Experimental firewall for proxy-side token replacement
|
|
3202
3307
|
experimentalFirewalls: experimentalFirewallsSchema.optional(),
|
|
3203
3308
|
// Experimental capabilities for agent permission enforcement
|
|
3204
|
-
experimentalCapabilities:
|
|
3309
|
+
experimentalCapabilities: z17.array(z17.enum(VALID_CAPABILITIES)).optional(),
|
|
3310
|
+
// VM profile for resource allocation (e.g., "vm0/default", "vm0/browser")
|
|
3311
|
+
experimentalProfile: z17.string().optional()
|
|
3205
3312
|
});
|
|
3206
|
-
var runnersJobClaimContract =
|
|
3313
|
+
var runnersJobClaimContract = c14.router({
|
|
3207
3314
|
claim: {
|
|
3208
3315
|
method: "POST",
|
|
3209
3316
|
path: "/api/runners/jobs/:id/claim",
|
|
3210
3317
|
headers: authHeadersSchema,
|
|
3211
|
-
pathParams:
|
|
3212
|
-
id:
|
|
3318
|
+
pathParams: z17.object({
|
|
3319
|
+
id: z17.uuid()
|
|
3213
3320
|
}),
|
|
3214
|
-
body:
|
|
3321
|
+
body: z17.object({}),
|
|
3215
3322
|
responses: {
|
|
3216
3323
|
200: executionContextSchema,
|
|
3217
3324
|
400: apiErrorSchema,
|
|
@@ -3228,13 +3335,13 @@ var runnersJobClaimContract = c13.router({
|
|
|
3228
3335
|
});
|
|
3229
3336
|
|
|
3230
3337
|
// ../../packages/core/src/contracts/schedules.ts
|
|
3231
|
-
import { z as
|
|
3232
|
-
var
|
|
3233
|
-
var scheduleTriggerSchema =
|
|
3234
|
-
cron:
|
|
3235
|
-
at:
|
|
3236
|
-
loop:
|
|
3237
|
-
timezone:
|
|
3338
|
+
import { z as z18 } from "zod";
|
|
3339
|
+
var c15 = initContract();
|
|
3340
|
+
var scheduleTriggerSchema = z18.object({
|
|
3341
|
+
cron: z18.string().optional(),
|
|
3342
|
+
at: z18.string().optional(),
|
|
3343
|
+
loop: z18.object({ interval: z18.number().int().min(0) }).optional(),
|
|
3344
|
+
timezone: z18.string().default("UTC")
|
|
3238
3345
|
}).refine(
|
|
3239
3346
|
(data) => {
|
|
3240
3347
|
const triggers = [data.cron, data.at, data.loop].filter(Boolean);
|
|
@@ -3244,41 +3351,41 @@ var scheduleTriggerSchema = z17.object({
|
|
|
3244
3351
|
message: "Exactly one of 'cron', 'at', or 'loop' must be specified"
|
|
3245
3352
|
}
|
|
3246
3353
|
);
|
|
3247
|
-
var scheduleRunConfigSchema =
|
|
3248
|
-
agent:
|
|
3249
|
-
prompt:
|
|
3250
|
-
vars:
|
|
3251
|
-
secrets:
|
|
3252
|
-
artifactName:
|
|
3253
|
-
artifactVersion:
|
|
3254
|
-
volumeVersions:
|
|
3354
|
+
var scheduleRunConfigSchema = z18.object({
|
|
3355
|
+
agent: z18.string().min(1, "Agent reference required"),
|
|
3356
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
3357
|
+
vars: z18.record(z18.string(), z18.string()).optional(),
|
|
3358
|
+
secrets: z18.record(z18.string(), z18.string()).optional(),
|
|
3359
|
+
artifactName: z18.string().optional(),
|
|
3360
|
+
artifactVersion: z18.string().optional(),
|
|
3361
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional()
|
|
3255
3362
|
});
|
|
3256
|
-
var scheduleDefinitionSchema =
|
|
3363
|
+
var scheduleDefinitionSchema = z18.object({
|
|
3257
3364
|
on: scheduleTriggerSchema,
|
|
3258
3365
|
run: scheduleRunConfigSchema
|
|
3259
3366
|
});
|
|
3260
|
-
var scheduleYamlSchema =
|
|
3261
|
-
version:
|
|
3262
|
-
schedules:
|
|
3367
|
+
var scheduleYamlSchema = z18.object({
|
|
3368
|
+
version: z18.literal("1.0"),
|
|
3369
|
+
schedules: z18.record(z18.string(), scheduleDefinitionSchema)
|
|
3263
3370
|
});
|
|
3264
|
-
var deployScheduleRequestSchema =
|
|
3265
|
-
name:
|
|
3266
|
-
cronExpression:
|
|
3267
|
-
atTime:
|
|
3268
|
-
intervalSeconds:
|
|
3269
|
-
timezone:
|
|
3270
|
-
prompt:
|
|
3371
|
+
var deployScheduleRequestSchema = z18.object({
|
|
3372
|
+
name: z18.string().min(1).max(64, "Schedule name max 64 chars"),
|
|
3373
|
+
cronExpression: z18.string().optional(),
|
|
3374
|
+
atTime: z18.string().optional(),
|
|
3375
|
+
intervalSeconds: z18.number().int().min(0).optional(),
|
|
3376
|
+
timezone: z18.string().default("UTC"),
|
|
3377
|
+
prompt: z18.string().min(1, "Prompt required"),
|
|
3271
3378
|
// vars and secrets removed - now managed via platform tables
|
|
3272
|
-
artifactName:
|
|
3273
|
-
artifactVersion:
|
|
3274
|
-
volumeVersions:
|
|
3379
|
+
artifactName: z18.string().optional(),
|
|
3380
|
+
artifactVersion: z18.string().optional(),
|
|
3381
|
+
volumeVersions: z18.record(z18.string(), z18.string()).optional(),
|
|
3275
3382
|
// Resolved agent compose ID (CLI resolves org/name:version → composeId)
|
|
3276
|
-
composeId:
|
|
3383
|
+
composeId: z18.string().uuid("Invalid compose ID"),
|
|
3277
3384
|
// Enable schedule immediately upon creation
|
|
3278
|
-
enabled:
|
|
3385
|
+
enabled: z18.boolean().optional(),
|
|
3279
3386
|
// Per-schedule notification control (AND'd with user global preferences)
|
|
3280
|
-
notifyEmail:
|
|
3281
|
-
notifySlack:
|
|
3387
|
+
notifyEmail: z18.boolean().optional(),
|
|
3388
|
+
notifySlack: z18.boolean().optional()
|
|
3282
3389
|
}).refine(
|
|
3283
3390
|
(data) => {
|
|
3284
3391
|
const triggers = [
|
|
@@ -3292,38 +3399,38 @@ var deployScheduleRequestSchema = z17.object({
|
|
|
3292
3399
|
message: "Exactly one of 'cronExpression', 'atTime', or 'intervalSeconds' must be specified"
|
|
3293
3400
|
}
|
|
3294
3401
|
);
|
|
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:
|
|
3402
|
+
var scheduleResponseSchema = z18.object({
|
|
3403
|
+
id: z18.uuid(),
|
|
3404
|
+
composeId: z18.uuid(),
|
|
3405
|
+
composeName: z18.string(),
|
|
3406
|
+
orgSlug: z18.string(),
|
|
3407
|
+
userId: z18.string(),
|
|
3408
|
+
name: z18.string(),
|
|
3409
|
+
triggerType: z18.enum(["cron", "once", "loop"]),
|
|
3410
|
+
cronExpression: z18.string().nullable(),
|
|
3411
|
+
atTime: z18.string().nullable(),
|
|
3412
|
+
intervalSeconds: z18.number().nullable(),
|
|
3413
|
+
timezone: z18.string(),
|
|
3414
|
+
prompt: z18.string(),
|
|
3415
|
+
vars: z18.record(z18.string(), z18.string()).nullable(),
|
|
3309
3416
|
// 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:
|
|
3417
|
+
secretNames: z18.array(z18.string()).nullable(),
|
|
3418
|
+
artifactName: z18.string().nullable(),
|
|
3419
|
+
artifactVersion: z18.string().nullable(),
|
|
3420
|
+
volumeVersions: z18.record(z18.string(), z18.string()).nullable(),
|
|
3421
|
+
enabled: z18.boolean(),
|
|
3422
|
+
notifyEmail: z18.boolean(),
|
|
3423
|
+
notifySlack: z18.boolean(),
|
|
3424
|
+
nextRunAt: z18.string().nullable(),
|
|
3425
|
+
lastRunAt: z18.string().nullable(),
|
|
3426
|
+
retryStartedAt: z18.string().nullable(),
|
|
3427
|
+
consecutiveFailures: z18.number(),
|
|
3428
|
+
createdAt: z18.string(),
|
|
3429
|
+
updatedAt: z18.string()
|
|
3323
3430
|
});
|
|
3324
|
-
var runSummarySchema =
|
|
3325
|
-
id:
|
|
3326
|
-
status:
|
|
3431
|
+
var runSummarySchema = z18.object({
|
|
3432
|
+
id: z18.uuid(),
|
|
3433
|
+
status: z18.enum([
|
|
3327
3434
|
"queued",
|
|
3328
3435
|
"pending",
|
|
3329
3436
|
"running",
|
|
@@ -3331,22 +3438,22 @@ var runSummarySchema = z17.object({
|
|
|
3331
3438
|
"failed",
|
|
3332
3439
|
"timeout"
|
|
3333
3440
|
]),
|
|
3334
|
-
createdAt:
|
|
3335
|
-
completedAt:
|
|
3336
|
-
error:
|
|
3441
|
+
createdAt: z18.string(),
|
|
3442
|
+
completedAt: z18.string().nullable(),
|
|
3443
|
+
error: z18.string().nullable()
|
|
3337
3444
|
});
|
|
3338
|
-
var scheduleRunsResponseSchema =
|
|
3339
|
-
runs:
|
|
3445
|
+
var scheduleRunsResponseSchema = z18.object({
|
|
3446
|
+
runs: z18.array(runSummarySchema)
|
|
3340
3447
|
});
|
|
3341
|
-
var scheduleListResponseSchema =
|
|
3342
|
-
schedules:
|
|
3448
|
+
var scheduleListResponseSchema = z18.object({
|
|
3449
|
+
schedules: z18.array(scheduleResponseSchema)
|
|
3343
3450
|
});
|
|
3344
|
-
var deployScheduleResponseSchema =
|
|
3451
|
+
var deployScheduleResponseSchema = z18.object({
|
|
3345
3452
|
schedule: scheduleResponseSchema,
|
|
3346
|
-
created:
|
|
3453
|
+
created: z18.boolean()
|
|
3347
3454
|
// true if created, false if updated
|
|
3348
3455
|
});
|
|
3349
|
-
var schedulesMainContract =
|
|
3456
|
+
var schedulesMainContract = c15.router({
|
|
3350
3457
|
/**
|
|
3351
3458
|
* POST /api/agent/schedules
|
|
3352
3459
|
* Deploy (create or update) a schedule
|
|
@@ -3384,7 +3491,7 @@ var schedulesMainContract = c14.router({
|
|
|
3384
3491
|
summary: "List all schedules"
|
|
3385
3492
|
}
|
|
3386
3493
|
});
|
|
3387
|
-
var schedulesByNameContract =
|
|
3494
|
+
var schedulesByNameContract = c15.router({
|
|
3388
3495
|
/**
|
|
3389
3496
|
* GET /api/agent/schedules/:name
|
|
3390
3497
|
* Get schedule by name
|
|
@@ -3393,11 +3500,11 @@ var schedulesByNameContract = c14.router({
|
|
|
3393
3500
|
method: "GET",
|
|
3394
3501
|
path: "/api/agent/schedules/:name",
|
|
3395
3502
|
headers: authHeadersSchema,
|
|
3396
|
-
pathParams:
|
|
3397
|
-
name:
|
|
3503
|
+
pathParams: z18.object({
|
|
3504
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3398
3505
|
}),
|
|
3399
|
-
query:
|
|
3400
|
-
composeId:
|
|
3506
|
+
query: z18.object({
|
|
3507
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3401
3508
|
}),
|
|
3402
3509
|
responses: {
|
|
3403
3510
|
200: scheduleResponseSchema,
|
|
@@ -3415,14 +3522,14 @@ var schedulesByNameContract = c14.router({
|
|
|
3415
3522
|
method: "DELETE",
|
|
3416
3523
|
path: "/api/agent/schedules/:name",
|
|
3417
3524
|
headers: authHeadersSchema,
|
|
3418
|
-
pathParams:
|
|
3419
|
-
name:
|
|
3525
|
+
pathParams: z18.object({
|
|
3526
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3420
3527
|
}),
|
|
3421
|
-
query:
|
|
3422
|
-
composeId:
|
|
3528
|
+
query: z18.object({
|
|
3529
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3423
3530
|
}),
|
|
3424
3531
|
responses: {
|
|
3425
|
-
204:
|
|
3532
|
+
204: c15.noBody(),
|
|
3426
3533
|
401: apiErrorSchema,
|
|
3427
3534
|
403: apiErrorSchema,
|
|
3428
3535
|
404: apiErrorSchema
|
|
@@ -3430,7 +3537,7 @@ var schedulesByNameContract = c14.router({
|
|
|
3430
3537
|
summary: "Delete schedule"
|
|
3431
3538
|
}
|
|
3432
3539
|
});
|
|
3433
|
-
var schedulesEnableContract =
|
|
3540
|
+
var schedulesEnableContract = c15.router({
|
|
3434
3541
|
/**
|
|
3435
3542
|
* POST /api/agent/schedules/:name/enable
|
|
3436
3543
|
* Enable a disabled schedule
|
|
@@ -3439,11 +3546,11 @@ var schedulesEnableContract = c14.router({
|
|
|
3439
3546
|
method: "POST",
|
|
3440
3547
|
path: "/api/agent/schedules/:name/enable",
|
|
3441
3548
|
headers: authHeadersSchema,
|
|
3442
|
-
pathParams:
|
|
3443
|
-
name:
|
|
3549
|
+
pathParams: z18.object({
|
|
3550
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3444
3551
|
}),
|
|
3445
|
-
body:
|
|
3446
|
-
composeId:
|
|
3552
|
+
body: z18.object({
|
|
3553
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3447
3554
|
}),
|
|
3448
3555
|
responses: {
|
|
3449
3556
|
200: scheduleResponseSchema,
|
|
@@ -3461,11 +3568,11 @@ var schedulesEnableContract = c14.router({
|
|
|
3461
3568
|
method: "POST",
|
|
3462
3569
|
path: "/api/agent/schedules/:name/disable",
|
|
3463
3570
|
headers: authHeadersSchema,
|
|
3464
|
-
pathParams:
|
|
3465
|
-
name:
|
|
3571
|
+
pathParams: z18.object({
|
|
3572
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3466
3573
|
}),
|
|
3467
|
-
body:
|
|
3468
|
-
composeId:
|
|
3574
|
+
body: z18.object({
|
|
3575
|
+
composeId: z18.string().uuid("Compose ID required")
|
|
3469
3576
|
}),
|
|
3470
3577
|
responses: {
|
|
3471
3578
|
200: scheduleResponseSchema,
|
|
@@ -3476,7 +3583,7 @@ var schedulesEnableContract = c14.router({
|
|
|
3476
3583
|
summary: "Disable schedule"
|
|
3477
3584
|
}
|
|
3478
3585
|
});
|
|
3479
|
-
var scheduleRunsContract =
|
|
3586
|
+
var scheduleRunsContract = c15.router({
|
|
3480
3587
|
/**
|
|
3481
3588
|
* GET /api/agent/schedules/:name/runs
|
|
3482
3589
|
* List recent runs for a schedule
|
|
@@ -3485,12 +3592,12 @@ var scheduleRunsContract = c14.router({
|
|
|
3485
3592
|
method: "GET",
|
|
3486
3593
|
path: "/api/agent/schedules/:name/runs",
|
|
3487
3594
|
headers: authHeadersSchema,
|
|
3488
|
-
pathParams:
|
|
3489
|
-
name:
|
|
3595
|
+
pathParams: z18.object({
|
|
3596
|
+
name: z18.string().min(1, "Schedule name required")
|
|
3490
3597
|
}),
|
|
3491
|
-
query:
|
|
3492
|
-
composeId:
|
|
3493
|
-
limit:
|
|
3598
|
+
query: z18.object({
|
|
3599
|
+
composeId: z18.string().uuid("Compose ID required"),
|
|
3600
|
+
limit: z18.coerce.number().min(0).max(100).default(5)
|
|
3494
3601
|
}),
|
|
3495
3602
|
responses: {
|
|
3496
3603
|
200: scheduleRunsResponseSchema,
|
|
@@ -3503,18 +3610,18 @@ var scheduleRunsContract = c14.router({
|
|
|
3503
3610
|
});
|
|
3504
3611
|
|
|
3505
3612
|
// ../../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:
|
|
3613
|
+
import { z as z19 } from "zod";
|
|
3614
|
+
var c16 = initContract();
|
|
3615
|
+
var ablyTokenRequestSchema = z19.object({
|
|
3616
|
+
keyName: z19.string(),
|
|
3617
|
+
ttl: z19.number().optional(),
|
|
3618
|
+
timestamp: z19.number(),
|
|
3619
|
+
capability: z19.string(),
|
|
3620
|
+
clientId: z19.string().optional(),
|
|
3621
|
+
nonce: z19.string(),
|
|
3622
|
+
mac: z19.string()
|
|
3516
3623
|
});
|
|
3517
|
-
var runnerRealtimeTokenContract =
|
|
3624
|
+
var runnerRealtimeTokenContract = c16.router({
|
|
3518
3625
|
/**
|
|
3519
3626
|
* POST /api/runners/realtime/token
|
|
3520
3627
|
* Get an Ably token to subscribe to a runner group's job notification channel
|
|
@@ -3523,7 +3630,7 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
3523
3630
|
method: "POST",
|
|
3524
3631
|
path: "/api/runners/realtime/token",
|
|
3525
3632
|
headers: authHeadersSchema,
|
|
3526
|
-
body:
|
|
3633
|
+
body: z19.object({
|
|
3527
3634
|
group: runnerGroupSchema
|
|
3528
3635
|
}),
|
|
3529
3636
|
responses: {
|
|
@@ -3537,22 +3644,22 @@ var runnerRealtimeTokenContract = c15.router({
|
|
|
3537
3644
|
});
|
|
3538
3645
|
|
|
3539
3646
|
// ../../packages/core/src/contracts/platform.ts
|
|
3540
|
-
import { z as
|
|
3541
|
-
var paginationSchema =
|
|
3542
|
-
hasMore:
|
|
3543
|
-
nextCursor:
|
|
3647
|
+
import { z as z20 } from "zod";
|
|
3648
|
+
var paginationSchema = z20.object({
|
|
3649
|
+
hasMore: z20.boolean(),
|
|
3650
|
+
nextCursor: z20.string().nullable()
|
|
3544
3651
|
});
|
|
3545
|
-
var listQuerySchema =
|
|
3546
|
-
cursor:
|
|
3547
|
-
limit:
|
|
3652
|
+
var listQuerySchema = z20.object({
|
|
3653
|
+
cursor: z20.string().optional(),
|
|
3654
|
+
limit: z20.coerce.number().min(1).max(100).default(20)
|
|
3548
3655
|
});
|
|
3549
|
-
var
|
|
3550
|
-
var platformPaginationSchema =
|
|
3551
|
-
hasMore:
|
|
3552
|
-
nextCursor:
|
|
3553
|
-
totalPages:
|
|
3656
|
+
var c17 = initContract();
|
|
3657
|
+
var platformPaginationSchema = z20.object({
|
|
3658
|
+
hasMore: z20.boolean(),
|
|
3659
|
+
nextCursor: z20.string().nullable(),
|
|
3660
|
+
totalPages: z20.number()
|
|
3554
3661
|
});
|
|
3555
|
-
var platformLogStatusSchema =
|
|
3662
|
+
var platformLogStatusSchema = z20.enum([
|
|
3556
3663
|
"queued",
|
|
3557
3664
|
"pending",
|
|
3558
3665
|
"running",
|
|
@@ -3561,47 +3668,49 @@ var platformLogStatusSchema = z19.enum([
|
|
|
3561
3668
|
"timeout",
|
|
3562
3669
|
"cancelled"
|
|
3563
3670
|
]);
|
|
3564
|
-
var platformLogEntrySchema =
|
|
3565
|
-
id:
|
|
3566
|
-
sessionId:
|
|
3567
|
-
agentName:
|
|
3568
|
-
|
|
3569
|
-
|
|
3671
|
+
var platformLogEntrySchema = z20.object({
|
|
3672
|
+
id: z20.uuid(),
|
|
3673
|
+
sessionId: z20.string().nullable(),
|
|
3674
|
+
agentName: z20.string(),
|
|
3675
|
+
displayName: z20.string().nullable(),
|
|
3676
|
+
orgSlug: z20.string().nullable(),
|
|
3677
|
+
framework: z20.string().nullable(),
|
|
3570
3678
|
status: platformLogStatusSchema,
|
|
3571
|
-
createdAt:
|
|
3572
|
-
startedAt:
|
|
3573
|
-
completedAt:
|
|
3679
|
+
createdAt: z20.string(),
|
|
3680
|
+
startedAt: z20.string().nullable(),
|
|
3681
|
+
completedAt: z20.string().nullable()
|
|
3574
3682
|
});
|
|
3575
|
-
var platformLogsListResponseSchema =
|
|
3576
|
-
data:
|
|
3683
|
+
var platformLogsListResponseSchema = z20.object({
|
|
3684
|
+
data: z20.array(platformLogEntrySchema),
|
|
3577
3685
|
pagination: platformPaginationSchema
|
|
3578
3686
|
});
|
|
3579
|
-
var artifactSchema =
|
|
3580
|
-
name:
|
|
3581
|
-
version:
|
|
3687
|
+
var artifactSchema = z20.object({
|
|
3688
|
+
name: z20.string().nullable(),
|
|
3689
|
+
version: z20.string().nullable()
|
|
3582
3690
|
});
|
|
3583
|
-
var platformLogDetailSchema =
|
|
3584
|
-
id:
|
|
3585
|
-
sessionId:
|
|
3586
|
-
agentName:
|
|
3587
|
-
|
|
3691
|
+
var platformLogDetailSchema = z20.object({
|
|
3692
|
+
id: z20.uuid(),
|
|
3693
|
+
sessionId: z20.string().nullable(),
|
|
3694
|
+
agentName: z20.string(),
|
|
3695
|
+
displayName: z20.string().nullable(),
|
|
3696
|
+
framework: z20.string().nullable(),
|
|
3588
3697
|
status: platformLogStatusSchema,
|
|
3589
|
-
prompt:
|
|
3590
|
-
error:
|
|
3591
|
-
createdAt:
|
|
3592
|
-
startedAt:
|
|
3593
|
-
completedAt:
|
|
3698
|
+
prompt: z20.string(),
|
|
3699
|
+
error: z20.string().nullable(),
|
|
3700
|
+
createdAt: z20.string(),
|
|
3701
|
+
startedAt: z20.string().nullable(),
|
|
3702
|
+
completedAt: z20.string().nullable(),
|
|
3594
3703
|
artifact: artifactSchema
|
|
3595
3704
|
});
|
|
3596
|
-
var platformLogsListContract =
|
|
3705
|
+
var platformLogsListContract = c17.router({
|
|
3597
3706
|
list: {
|
|
3598
3707
|
method: "GET",
|
|
3599
3708
|
path: "/api/platform/logs",
|
|
3600
3709
|
query: listQuerySchema.extend({
|
|
3601
|
-
search:
|
|
3602
|
-
agent:
|
|
3603
|
-
name:
|
|
3604
|
-
org:
|
|
3710
|
+
search: z20.string().optional(),
|
|
3711
|
+
agent: z20.string().optional(),
|
|
3712
|
+
name: z20.string().optional(),
|
|
3713
|
+
org: z20.string().optional(),
|
|
3605
3714
|
status: platformLogStatusSchema.optional()
|
|
3606
3715
|
}),
|
|
3607
3716
|
responses: {
|
|
@@ -3611,13 +3720,13 @@ var platformLogsListContract = c16.router({
|
|
|
3611
3720
|
summary: "List agent run logs with pagination"
|
|
3612
3721
|
}
|
|
3613
3722
|
});
|
|
3614
|
-
var platformLogsByIdContract =
|
|
3723
|
+
var platformLogsByIdContract = c17.router({
|
|
3615
3724
|
getById: {
|
|
3616
3725
|
method: "GET",
|
|
3617
3726
|
path: "/api/platform/logs/:id",
|
|
3618
3727
|
headers: authHeadersSchema,
|
|
3619
|
-
pathParams:
|
|
3620
|
-
id:
|
|
3728
|
+
pathParams: z20.object({
|
|
3729
|
+
id: z20.string().uuid("Invalid log ID")
|
|
3621
3730
|
}),
|
|
3622
3731
|
responses: {
|
|
3623
3732
|
200: platformLogDetailSchema,
|
|
@@ -3627,17 +3736,17 @@ var platformLogsByIdContract = c16.router({
|
|
|
3627
3736
|
summary: "Get agent run log details by ID"
|
|
3628
3737
|
}
|
|
3629
3738
|
});
|
|
3630
|
-
var artifactDownloadResponseSchema =
|
|
3631
|
-
url:
|
|
3632
|
-
expiresAt:
|
|
3739
|
+
var artifactDownloadResponseSchema = z20.object({
|
|
3740
|
+
url: z20.url(),
|
|
3741
|
+
expiresAt: z20.string()
|
|
3633
3742
|
});
|
|
3634
|
-
var platformArtifactDownloadContract =
|
|
3743
|
+
var platformArtifactDownloadContract = c17.router({
|
|
3635
3744
|
getDownloadUrl: {
|
|
3636
3745
|
method: "GET",
|
|
3637
3746
|
path: "/api/platform/artifacts/download",
|
|
3638
|
-
query:
|
|
3639
|
-
name:
|
|
3640
|
-
version:
|
|
3747
|
+
query: z20.object({
|
|
3748
|
+
name: z20.string().min(1, "Artifact name is required"),
|
|
3749
|
+
version: z20.string().optional()
|
|
3641
3750
|
}),
|
|
3642
3751
|
responses: {
|
|
3643
3752
|
200: artifactDownloadResponseSchema,
|
|
@@ -3649,43 +3758,43 @@ var platformArtifactDownloadContract = c16.router({
|
|
|
3649
3758
|
});
|
|
3650
3759
|
|
|
3651
3760
|
// ../../packages/core/src/contracts/compose-jobs.ts
|
|
3652
|
-
import { z as
|
|
3653
|
-
var
|
|
3654
|
-
var composeJobStatusSchema =
|
|
3761
|
+
import { z as z21 } from "zod";
|
|
3762
|
+
var c18 = initContract();
|
|
3763
|
+
var composeJobStatusSchema = z21.enum([
|
|
3655
3764
|
"pending",
|
|
3656
3765
|
"running",
|
|
3657
3766
|
"completed",
|
|
3658
3767
|
"failed"
|
|
3659
3768
|
]);
|
|
3660
|
-
var composeJobResultSchema =
|
|
3661
|
-
composeId:
|
|
3662
|
-
composeName:
|
|
3663
|
-
versionId:
|
|
3664
|
-
warnings:
|
|
3769
|
+
var composeJobResultSchema = z21.object({
|
|
3770
|
+
composeId: z21.string(),
|
|
3771
|
+
composeName: z21.string(),
|
|
3772
|
+
versionId: z21.string(),
|
|
3773
|
+
warnings: z21.array(z21.string())
|
|
3665
3774
|
});
|
|
3666
|
-
var composeJobSourceSchema =
|
|
3667
|
-
var createComposeJobRequestSchema =
|
|
3668
|
-
|
|
3669
|
-
githubUrl:
|
|
3670
|
-
overwrite:
|
|
3775
|
+
var composeJobSourceSchema = z21.enum(["github", "platform", "slack"]);
|
|
3776
|
+
var createComposeJobRequestSchema = z21.union([
|
|
3777
|
+
z21.object({
|
|
3778
|
+
githubUrl: z21.url().check(z21.startsWith("https://github.com/")),
|
|
3779
|
+
overwrite: z21.boolean().optional().default(false)
|
|
3671
3780
|
}),
|
|
3672
|
-
|
|
3673
|
-
content:
|
|
3674
|
-
instructions:
|
|
3781
|
+
z21.object({
|
|
3782
|
+
content: z21.record(z21.string(), z21.unknown()),
|
|
3783
|
+
instructions: z21.string().optional()
|
|
3675
3784
|
})
|
|
3676
3785
|
]);
|
|
3677
|
-
var composeJobResponseSchema =
|
|
3678
|
-
jobId:
|
|
3786
|
+
var composeJobResponseSchema = z21.object({
|
|
3787
|
+
jobId: z21.string(),
|
|
3679
3788
|
status: composeJobStatusSchema,
|
|
3680
|
-
githubUrl:
|
|
3789
|
+
githubUrl: z21.string().optional(),
|
|
3681
3790
|
source: composeJobSourceSchema.optional(),
|
|
3682
3791
|
result: composeJobResultSchema.optional(),
|
|
3683
|
-
error:
|
|
3684
|
-
createdAt:
|
|
3685
|
-
startedAt:
|
|
3686
|
-
completedAt:
|
|
3792
|
+
error: z21.string().optional(),
|
|
3793
|
+
createdAt: z21.string(),
|
|
3794
|
+
startedAt: z21.string().optional(),
|
|
3795
|
+
completedAt: z21.string().optional()
|
|
3687
3796
|
});
|
|
3688
|
-
var composeJobsMainContract =
|
|
3797
|
+
var composeJobsMainContract = c18.router({
|
|
3689
3798
|
/**
|
|
3690
3799
|
* POST /api/compose/jobs
|
|
3691
3800
|
* Create a new compose job from GitHub URL or platform content
|
|
@@ -3705,7 +3814,7 @@ var composeJobsMainContract = c17.router({
|
|
|
3705
3814
|
summary: "Create compose job"
|
|
3706
3815
|
}
|
|
3707
3816
|
});
|
|
3708
|
-
var composeJobsByIdContract =
|
|
3817
|
+
var composeJobsByIdContract = c18.router({
|
|
3709
3818
|
/**
|
|
3710
3819
|
* GET /api/compose/jobs/:jobId
|
|
3711
3820
|
* Get compose job status and result
|
|
@@ -3714,8 +3823,8 @@ var composeJobsByIdContract = c17.router({
|
|
|
3714
3823
|
method: "GET",
|
|
3715
3824
|
path: "/api/compose/jobs/:jobId",
|
|
3716
3825
|
headers: authHeadersSchema,
|
|
3717
|
-
pathParams:
|
|
3718
|
-
jobId:
|
|
3826
|
+
pathParams: z21.object({
|
|
3827
|
+
jobId: z21.uuid()
|
|
3719
3828
|
}),
|
|
3720
3829
|
responses: {
|
|
3721
3830
|
200: composeJobResponseSchema,
|
|
@@ -3725,7 +3834,7 @@ var composeJobsByIdContract = c17.router({
|
|
|
3725
3834
|
summary: "Get compose job status"
|
|
3726
3835
|
}
|
|
3727
3836
|
});
|
|
3728
|
-
var webhookComposeCompleteContract =
|
|
3837
|
+
var webhookComposeCompleteContract = c18.router({
|
|
3729
3838
|
/**
|
|
3730
3839
|
* POST /api/webhooks/compose/complete
|
|
3731
3840
|
* Handle compose job completion from sandbox
|
|
@@ -3734,16 +3843,16 @@ var webhookComposeCompleteContract = c17.router({
|
|
|
3734
3843
|
method: "POST",
|
|
3735
3844
|
path: "/api/webhooks/compose/complete",
|
|
3736
3845
|
headers: authHeadersSchema,
|
|
3737
|
-
body:
|
|
3738
|
-
jobId:
|
|
3739
|
-
success:
|
|
3846
|
+
body: z21.object({
|
|
3847
|
+
jobId: z21.uuid(),
|
|
3848
|
+
success: z21.boolean(),
|
|
3740
3849
|
// Result from CLI compose command
|
|
3741
3850
|
result: composeJobResultSchema.optional(),
|
|
3742
|
-
error:
|
|
3851
|
+
error: z21.string().optional()
|
|
3743
3852
|
}),
|
|
3744
3853
|
responses: {
|
|
3745
|
-
200:
|
|
3746
|
-
success:
|
|
3854
|
+
200: z21.object({
|
|
3855
|
+
success: z21.boolean()
|
|
3747
3856
|
}),
|
|
3748
3857
|
400: apiErrorSchema,
|
|
3749
3858
|
401: apiErrorSchema,
|
|
@@ -3754,8 +3863,8 @@ var webhookComposeCompleteContract = c17.router({
|
|
|
3754
3863
|
});
|
|
3755
3864
|
|
|
3756
3865
|
// ../../packages/core/src/contracts/connectors.ts
|
|
3757
|
-
import { z as
|
|
3758
|
-
var
|
|
3866
|
+
import { z as z22 } from "zod";
|
|
3867
|
+
var c19 = initContract();
|
|
3759
3868
|
var CONNECTOR_TYPES_DEF = {
|
|
3760
3869
|
axiom: {
|
|
3761
3870
|
label: "Axiom",
|
|
@@ -6245,7 +6354,7 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
6245
6354
|
}
|
|
6246
6355
|
};
|
|
6247
6356
|
var CONNECTOR_TYPES = CONNECTOR_TYPES_DEF;
|
|
6248
|
-
var connectorTypeSchema =
|
|
6357
|
+
var connectorTypeSchema = z22.enum([
|
|
6249
6358
|
"agentmail",
|
|
6250
6359
|
"ahrefs",
|
|
6251
6360
|
"atlassian",
|
|
@@ -6373,23 +6482,24 @@ function getConnectorDerivedNames(secretName) {
|
|
|
6373
6482
|
}
|
|
6374
6483
|
return null;
|
|
6375
6484
|
}
|
|
6376
|
-
var connectorResponseSchema =
|
|
6377
|
-
id:
|
|
6485
|
+
var connectorResponseSchema = z22.object({
|
|
6486
|
+
id: z22.uuid().nullable(),
|
|
6378
6487
|
type: connectorTypeSchema,
|
|
6379
|
-
authMethod:
|
|
6380
|
-
externalId:
|
|
6381
|
-
externalUsername:
|
|
6382
|
-
externalEmail:
|
|
6383
|
-
oauthScopes:
|
|
6384
|
-
|
|
6385
|
-
|
|
6488
|
+
authMethod: z22.string(),
|
|
6489
|
+
externalId: z22.string().nullable(),
|
|
6490
|
+
externalUsername: z22.string().nullable(),
|
|
6491
|
+
externalEmail: z22.string().nullable(),
|
|
6492
|
+
oauthScopes: z22.array(z22.string()).nullable(),
|
|
6493
|
+
needsReconnect: z22.boolean(),
|
|
6494
|
+
createdAt: z22.string(),
|
|
6495
|
+
updatedAt: z22.string()
|
|
6386
6496
|
});
|
|
6387
|
-
var connectorListResponseSchema =
|
|
6388
|
-
connectors:
|
|
6389
|
-
configuredTypes:
|
|
6390
|
-
connectorProvidedSecretNames:
|
|
6497
|
+
var connectorListResponseSchema = z22.object({
|
|
6498
|
+
connectors: z22.array(connectorResponseSchema),
|
|
6499
|
+
configuredTypes: z22.array(connectorTypeSchema),
|
|
6500
|
+
connectorProvidedSecretNames: z22.array(z22.string())
|
|
6391
6501
|
});
|
|
6392
|
-
var connectorsMainContract =
|
|
6502
|
+
var connectorsMainContract = c19.router({
|
|
6393
6503
|
list: {
|
|
6394
6504
|
method: "GET",
|
|
6395
6505
|
path: "/api/connectors",
|
|
@@ -6402,12 +6512,12 @@ var connectorsMainContract = c18.router({
|
|
|
6402
6512
|
summary: "List all connectors for the authenticated user"
|
|
6403
6513
|
}
|
|
6404
6514
|
});
|
|
6405
|
-
var connectorsByTypeContract =
|
|
6515
|
+
var connectorsByTypeContract = c19.router({
|
|
6406
6516
|
get: {
|
|
6407
6517
|
method: "GET",
|
|
6408
6518
|
path: "/api/connectors/:type",
|
|
6409
6519
|
headers: authHeadersSchema,
|
|
6410
|
-
pathParams:
|
|
6520
|
+
pathParams: z22.object({
|
|
6411
6521
|
type: connectorTypeSchema
|
|
6412
6522
|
}),
|
|
6413
6523
|
responses: {
|
|
@@ -6422,11 +6532,11 @@ var connectorsByTypeContract = c18.router({
|
|
|
6422
6532
|
method: "DELETE",
|
|
6423
6533
|
path: "/api/connectors/:type",
|
|
6424
6534
|
headers: authHeadersSchema,
|
|
6425
|
-
pathParams:
|
|
6535
|
+
pathParams: z22.object({
|
|
6426
6536
|
type: connectorTypeSchema
|
|
6427
6537
|
}),
|
|
6428
6538
|
responses: {
|
|
6429
|
-
204:
|
|
6539
|
+
204: c19.noBody(),
|
|
6430
6540
|
401: apiErrorSchema,
|
|
6431
6541
|
404: apiErrorSchema,
|
|
6432
6542
|
500: apiErrorSchema
|
|
@@ -6434,27 +6544,27 @@ var connectorsByTypeContract = c18.router({
|
|
|
6434
6544
|
summary: "Disconnect a connector"
|
|
6435
6545
|
}
|
|
6436
6546
|
});
|
|
6437
|
-
var connectorSessionStatusSchema =
|
|
6547
|
+
var connectorSessionStatusSchema = z22.enum([
|
|
6438
6548
|
"pending",
|
|
6439
6549
|
"complete",
|
|
6440
6550
|
"expired",
|
|
6441
6551
|
"error"
|
|
6442
6552
|
]);
|
|
6443
|
-
var connectorSessionResponseSchema =
|
|
6444
|
-
id:
|
|
6445
|
-
code:
|
|
6553
|
+
var connectorSessionResponseSchema = z22.object({
|
|
6554
|
+
id: z22.uuid(),
|
|
6555
|
+
code: z22.string(),
|
|
6446
6556
|
type: connectorTypeSchema,
|
|
6447
6557
|
status: connectorSessionStatusSchema,
|
|
6448
|
-
verificationUrl:
|
|
6449
|
-
expiresIn:
|
|
6450
|
-
interval:
|
|
6451
|
-
errorMessage:
|
|
6558
|
+
verificationUrl: z22.string(),
|
|
6559
|
+
expiresIn: z22.number(),
|
|
6560
|
+
interval: z22.number(),
|
|
6561
|
+
errorMessage: z22.string().nullable().optional()
|
|
6452
6562
|
});
|
|
6453
|
-
var connectorSessionStatusResponseSchema =
|
|
6563
|
+
var connectorSessionStatusResponseSchema = z22.object({
|
|
6454
6564
|
status: connectorSessionStatusSchema,
|
|
6455
|
-
errorMessage:
|
|
6565
|
+
errorMessage: z22.string().nullable().optional()
|
|
6456
6566
|
});
|
|
6457
|
-
var connectorSessionsContract =
|
|
6567
|
+
var connectorSessionsContract = c19.router({
|
|
6458
6568
|
/**
|
|
6459
6569
|
* POST /api/connectors/:type/sessions
|
|
6460
6570
|
* Create a new connector session for CLI device flow
|
|
@@ -6463,10 +6573,10 @@ var connectorSessionsContract = c18.router({
|
|
|
6463
6573
|
method: "POST",
|
|
6464
6574
|
path: "/api/connectors/:type/sessions",
|
|
6465
6575
|
headers: authHeadersSchema,
|
|
6466
|
-
pathParams:
|
|
6576
|
+
pathParams: z22.object({
|
|
6467
6577
|
type: connectorTypeSchema
|
|
6468
6578
|
}),
|
|
6469
|
-
body:
|
|
6579
|
+
body: z22.object({}).optional(),
|
|
6470
6580
|
responses: {
|
|
6471
6581
|
200: connectorSessionResponseSchema,
|
|
6472
6582
|
400: apiErrorSchema,
|
|
@@ -6476,7 +6586,7 @@ var connectorSessionsContract = c18.router({
|
|
|
6476
6586
|
summary: "Create connector session for CLI device flow"
|
|
6477
6587
|
}
|
|
6478
6588
|
});
|
|
6479
|
-
var connectorSessionByIdContract =
|
|
6589
|
+
var connectorSessionByIdContract = c19.router({
|
|
6480
6590
|
/**
|
|
6481
6591
|
* GET /api/connectors/:type/sessions/:sessionId
|
|
6482
6592
|
* Get connector session status (for CLI polling)
|
|
@@ -6485,9 +6595,9 @@ var connectorSessionByIdContract = c18.router({
|
|
|
6485
6595
|
method: "GET",
|
|
6486
6596
|
path: "/api/connectors/:type/sessions/:sessionId",
|
|
6487
6597
|
headers: authHeadersSchema,
|
|
6488
|
-
pathParams:
|
|
6598
|
+
pathParams: z22.object({
|
|
6489
6599
|
type: connectorTypeSchema,
|
|
6490
|
-
sessionId:
|
|
6600
|
+
sessionId: z22.uuid()
|
|
6491
6601
|
}),
|
|
6492
6602
|
responses: {
|
|
6493
6603
|
200: connectorSessionStatusResponseSchema,
|
|
@@ -6499,19 +6609,19 @@ var connectorSessionByIdContract = c18.router({
|
|
|
6499
6609
|
summary: "Get connector session status"
|
|
6500
6610
|
}
|
|
6501
6611
|
});
|
|
6502
|
-
var computerConnectorCreateResponseSchema =
|
|
6503
|
-
id:
|
|
6504
|
-
ngrokToken:
|
|
6505
|
-
bridgeToken:
|
|
6506
|
-
endpointPrefix:
|
|
6507
|
-
domain:
|
|
6612
|
+
var computerConnectorCreateResponseSchema = z22.object({
|
|
6613
|
+
id: z22.uuid(),
|
|
6614
|
+
ngrokToken: z22.string(),
|
|
6615
|
+
bridgeToken: z22.string(),
|
|
6616
|
+
endpointPrefix: z22.string(),
|
|
6617
|
+
domain: z22.string()
|
|
6508
6618
|
});
|
|
6509
|
-
var computerConnectorContract =
|
|
6619
|
+
var computerConnectorContract = c19.router({
|
|
6510
6620
|
create: {
|
|
6511
6621
|
method: "POST",
|
|
6512
6622
|
path: "/api/connectors/computer",
|
|
6513
6623
|
headers: authHeadersSchema,
|
|
6514
|
-
body:
|
|
6624
|
+
body: z22.object({}).optional(),
|
|
6515
6625
|
responses: {
|
|
6516
6626
|
200: computerConnectorCreateResponseSchema,
|
|
6517
6627
|
400: apiErrorSchema,
|
|
@@ -6537,7 +6647,7 @@ var computerConnectorContract = c18.router({
|
|
|
6537
6647
|
path: "/api/connectors/computer",
|
|
6538
6648
|
headers: authHeadersSchema,
|
|
6539
6649
|
responses: {
|
|
6540
|
-
204:
|
|
6650
|
+
204: c19.noBody(),
|
|
6541
6651
|
401: apiErrorSchema,
|
|
6542
6652
|
404: apiErrorSchema,
|
|
6543
6653
|
500: apiErrorSchema
|
|
@@ -6666,7 +6776,7 @@ function resolveFirewallRef(input) {
|
|
|
6666
6776
|
}
|
|
6667
6777
|
|
|
6668
6778
|
// ../../packages/core/src/firewall-loader.ts
|
|
6669
|
-
var MAX_RESPONSE_SIZE =
|
|
6779
|
+
var MAX_RESPONSE_SIZE = 128 * 1024;
|
|
6670
6780
|
function buildFirewallYamlUrl(ref) {
|
|
6671
6781
|
const url = resolveFirewallRef(ref);
|
|
6672
6782
|
const parsed = parseGitHubTreeUrl(url);
|
|
@@ -6889,21 +6999,21 @@ async function expandFirewallConfigs(config, fetchFn) {
|
|
|
6889
6999
|
}
|
|
6890
7000
|
|
|
6891
7001
|
// ../../packages/core/src/contracts/user-preferences.ts
|
|
6892
|
-
import { z as
|
|
6893
|
-
var
|
|
6894
|
-
var sendModeSchema =
|
|
6895
|
-
var userPreferencesResponseSchema =
|
|
6896
|
-
timezone:
|
|
6897
|
-
notifyEmail:
|
|
6898
|
-
notifySlack:
|
|
6899
|
-
pinnedAgentIds:
|
|
7002
|
+
import { z as z23 } from "zod";
|
|
7003
|
+
var c20 = initContract();
|
|
7004
|
+
var sendModeSchema = z23.enum(["enter", "cmd-enter"]);
|
|
7005
|
+
var userPreferencesResponseSchema = z23.object({
|
|
7006
|
+
timezone: z23.string().nullable(),
|
|
7007
|
+
notifyEmail: z23.boolean(),
|
|
7008
|
+
notifySlack: z23.boolean(),
|
|
7009
|
+
pinnedAgentIds: z23.array(z23.string()),
|
|
6900
7010
|
sendMode: sendModeSchema
|
|
6901
7011
|
});
|
|
6902
|
-
var updateUserPreferencesRequestSchema =
|
|
6903
|
-
timezone:
|
|
6904
|
-
notifyEmail:
|
|
6905
|
-
notifySlack:
|
|
6906
|
-
pinnedAgentIds:
|
|
7012
|
+
var updateUserPreferencesRequestSchema = z23.object({
|
|
7013
|
+
timezone: z23.string().min(1).optional(),
|
|
7014
|
+
notifyEmail: z23.boolean().optional(),
|
|
7015
|
+
notifySlack: z23.boolean().optional(),
|
|
7016
|
+
pinnedAgentIds: z23.array(z23.string()).max(4).optional(),
|
|
6907
7017
|
sendMode: sendModeSchema.optional()
|
|
6908
7018
|
}).refine(
|
|
6909
7019
|
(data) => data.timezone !== void 0 || data.notifyEmail !== void 0 || data.notifySlack !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0,
|
|
@@ -6911,7 +7021,7 @@ var updateUserPreferencesRequestSchema = z22.object({
|
|
|
6911
7021
|
message: "At least one preference must be provided"
|
|
6912
7022
|
}
|
|
6913
7023
|
);
|
|
6914
|
-
var userPreferencesContract =
|
|
7024
|
+
var userPreferencesContract = c20.router({
|
|
6915
7025
|
/**
|
|
6916
7026
|
* GET /api/user/preferences
|
|
6917
7027
|
* Get current user's preferences
|
|
@@ -6947,17 +7057,17 @@ var userPreferencesContract = c19.router({
|
|
|
6947
7057
|
});
|
|
6948
7058
|
|
|
6949
7059
|
// ../../packages/core/src/contracts/org-list.ts
|
|
6950
|
-
import { z as
|
|
6951
|
-
var
|
|
6952
|
-
var orgListItemSchema =
|
|
6953
|
-
slug:
|
|
6954
|
-
role:
|
|
7060
|
+
import { z as z24 } from "zod";
|
|
7061
|
+
var c21 = initContract();
|
|
7062
|
+
var orgListItemSchema = z24.object({
|
|
7063
|
+
slug: z24.string(),
|
|
7064
|
+
role: z24.string()
|
|
6955
7065
|
});
|
|
6956
|
-
var orgListResponseSchema =
|
|
6957
|
-
orgs:
|
|
6958
|
-
active:
|
|
7066
|
+
var orgListResponseSchema = z24.object({
|
|
7067
|
+
orgs: z24.array(orgListItemSchema),
|
|
7068
|
+
active: z24.string().optional()
|
|
6959
7069
|
});
|
|
6960
|
-
var orgListContract =
|
|
7070
|
+
var orgListContract = c21.router({
|
|
6961
7071
|
/**
|
|
6962
7072
|
* GET /api/org/list
|
|
6963
7073
|
* List all orgs accessible to the user
|
|
@@ -6976,31 +7086,31 @@ var orgListContract = c20.router({
|
|
|
6976
7086
|
});
|
|
6977
7087
|
|
|
6978
7088
|
// ../../packages/core/src/contracts/org-members.ts
|
|
6979
|
-
import { z as
|
|
6980
|
-
var
|
|
6981
|
-
var orgRoleSchema =
|
|
6982
|
-
var orgMemberSchema =
|
|
6983
|
-
userId:
|
|
6984
|
-
email:
|
|
7089
|
+
import { z as z25 } from "zod";
|
|
7090
|
+
var c22 = initContract();
|
|
7091
|
+
var orgRoleSchema = z25.enum(["admin", "member"]);
|
|
7092
|
+
var orgMemberSchema = z25.object({
|
|
7093
|
+
userId: z25.string(),
|
|
7094
|
+
email: z25.string(),
|
|
6985
7095
|
role: orgRoleSchema,
|
|
6986
|
-
joinedAt:
|
|
7096
|
+
joinedAt: z25.string()
|
|
6987
7097
|
});
|
|
6988
|
-
var orgMembersResponseSchema =
|
|
6989
|
-
slug:
|
|
7098
|
+
var orgMembersResponseSchema = z25.object({
|
|
7099
|
+
slug: z25.string(),
|
|
6990
7100
|
role: orgRoleSchema,
|
|
6991
|
-
members:
|
|
6992
|
-
createdAt:
|
|
7101
|
+
members: z25.array(orgMemberSchema),
|
|
7102
|
+
createdAt: z25.string()
|
|
6993
7103
|
});
|
|
6994
|
-
var inviteOrgMemberRequestSchema =
|
|
6995
|
-
email:
|
|
7104
|
+
var inviteOrgMemberRequestSchema = z25.object({
|
|
7105
|
+
email: z25.string().email()
|
|
6996
7106
|
});
|
|
6997
|
-
var removeOrgMemberRequestSchema =
|
|
6998
|
-
email:
|
|
7107
|
+
var removeOrgMemberRequestSchema = z25.object({
|
|
7108
|
+
email: z25.string().email()
|
|
6999
7109
|
});
|
|
7000
|
-
var orgMessageResponseSchema =
|
|
7001
|
-
message:
|
|
7110
|
+
var orgMessageResponseSchema = z25.object({
|
|
7111
|
+
message: z25.string()
|
|
7002
7112
|
});
|
|
7003
|
-
var orgMembersContract =
|
|
7113
|
+
var orgMembersContract = c22.router({
|
|
7004
7114
|
/**
|
|
7005
7115
|
* GET /api/org/members
|
|
7006
7116
|
* Get org members and status
|
|
@@ -7045,7 +7155,7 @@ var orgMembersContract = c21.router({
|
|
|
7045
7155
|
method: "POST",
|
|
7046
7156
|
path: "/api/org/leave",
|
|
7047
7157
|
headers: authHeadersSchema,
|
|
7048
|
-
body:
|
|
7158
|
+
body: z25.object({}),
|
|
7049
7159
|
responses: {
|
|
7050
7160
|
200: orgMessageResponseSchema,
|
|
7051
7161
|
401: apiErrorSchema,
|
|
@@ -7075,22 +7185,22 @@ var orgMembersContract = c21.router({
|
|
|
7075
7185
|
});
|
|
7076
7186
|
|
|
7077
7187
|
// ../../packages/core/src/contracts/onboarding.ts
|
|
7078
|
-
import { z as
|
|
7079
|
-
var
|
|
7080
|
-
var onboardingStatusResponseSchema =
|
|
7081
|
-
needsOnboarding:
|
|
7082
|
-
hasOrg:
|
|
7083
|
-
hasModelProvider:
|
|
7084
|
-
hasDefaultAgent:
|
|
7085
|
-
defaultAgentName:
|
|
7086
|
-
defaultAgentComposeId:
|
|
7087
|
-
defaultAgentMetadata:
|
|
7088
|
-
displayName:
|
|
7089
|
-
description:
|
|
7090
|
-
sound:
|
|
7188
|
+
import { z as z26 } from "zod";
|
|
7189
|
+
var c23 = initContract();
|
|
7190
|
+
var onboardingStatusResponseSchema = z26.object({
|
|
7191
|
+
needsOnboarding: z26.boolean(),
|
|
7192
|
+
hasOrg: z26.boolean(),
|
|
7193
|
+
hasModelProvider: z26.boolean(),
|
|
7194
|
+
hasDefaultAgent: z26.boolean(),
|
|
7195
|
+
defaultAgentName: z26.string().nullable(),
|
|
7196
|
+
defaultAgentComposeId: z26.string().nullable(),
|
|
7197
|
+
defaultAgentMetadata: z26.object({
|
|
7198
|
+
displayName: z26.string().optional(),
|
|
7199
|
+
description: z26.string().optional(),
|
|
7200
|
+
sound: z26.string().optional()
|
|
7091
7201
|
}).nullable()
|
|
7092
7202
|
});
|
|
7093
|
-
var onboardingStatusContract =
|
|
7203
|
+
var onboardingStatusContract = c23.router({
|
|
7094
7204
|
getStatus: {
|
|
7095
7205
|
method: "GET",
|
|
7096
7206
|
path: "/api/onboarding/status",
|
|
@@ -7104,31 +7214,31 @@ var onboardingStatusContract = c22.router({
|
|
|
7104
7214
|
});
|
|
7105
7215
|
|
|
7106
7216
|
// ../../packages/core/src/contracts/skills.ts
|
|
7107
|
-
import { z as
|
|
7108
|
-
var
|
|
7109
|
-
var skillFrontmatterSchema =
|
|
7110
|
-
name:
|
|
7111
|
-
description:
|
|
7112
|
-
vm0_secrets:
|
|
7113
|
-
vm0_vars:
|
|
7217
|
+
import { z as z27 } from "zod";
|
|
7218
|
+
var c24 = initContract();
|
|
7219
|
+
var skillFrontmatterSchema = z27.object({
|
|
7220
|
+
name: z27.string().optional(),
|
|
7221
|
+
description: z27.string().optional(),
|
|
7222
|
+
vm0_secrets: z27.array(z27.string()).optional(),
|
|
7223
|
+
vm0_vars: z27.array(z27.string()).optional()
|
|
7114
7224
|
});
|
|
7115
|
-
var resolvedSkillSchema =
|
|
7116
|
-
storageName:
|
|
7117
|
-
versionHash:
|
|
7225
|
+
var resolvedSkillSchema = z27.object({
|
|
7226
|
+
storageName: z27.string(),
|
|
7227
|
+
versionHash: z27.string(),
|
|
7118
7228
|
frontmatter: skillFrontmatterSchema
|
|
7119
7229
|
});
|
|
7120
|
-
var skillsResolveContract =
|
|
7230
|
+
var skillsResolveContract = c24.router({
|
|
7121
7231
|
resolve: {
|
|
7122
7232
|
method: "POST",
|
|
7123
7233
|
path: "/api/skills/resolve",
|
|
7124
7234
|
headers: authHeadersSchema,
|
|
7125
|
-
body:
|
|
7126
|
-
skills:
|
|
7235
|
+
body: z27.object({
|
|
7236
|
+
skills: z27.array(z27.url()).min(1).max(100)
|
|
7127
7237
|
}),
|
|
7128
7238
|
responses: {
|
|
7129
|
-
200:
|
|
7130
|
-
resolved:
|
|
7131
|
-
unresolved:
|
|
7239
|
+
200: z27.object({
|
|
7240
|
+
resolved: z27.record(z27.string(), resolvedSkillSchema),
|
|
7241
|
+
unresolved: z27.array(z27.string())
|
|
7132
7242
|
}),
|
|
7133
7243
|
400: apiErrorSchema,
|
|
7134
7244
|
401: apiErrorSchema
|
|
@@ -7392,6 +7502,11 @@ var FEATURE_SWITCHES = {
|
|
|
7392
7502
|
maintainer: "ethan@vm0.ai",
|
|
7393
7503
|
enabled: false,
|
|
7394
7504
|
enabledUserHashes: STAFF_USER_HASHES
|
|
7505
|
+
},
|
|
7506
|
+
["dataExport" /* DataExport */]: {
|
|
7507
|
+
maintainer: "ethan@vm0.ai",
|
|
7508
|
+
enabled: false,
|
|
7509
|
+
enabledUserHashes: STAFF_USER_HASHES
|
|
7395
7510
|
}
|
|
7396
7511
|
};
|
|
7397
7512
|
async function isFeatureEnabled(key, userId) {
|
|
@@ -8226,8 +8341,8 @@ async function resolveSkills(skillUrls) {
|
|
|
8226
8341
|
}
|
|
8227
8342
|
|
|
8228
8343
|
// src/lib/domain/yaml-validator.ts
|
|
8229
|
-
import { z as
|
|
8230
|
-
var cliAgentNameSchema =
|
|
8344
|
+
import { z as z28 } from "zod";
|
|
8345
|
+
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(
|
|
8231
8346
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
8232
8347
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
8233
8348
|
);
|
|
@@ -8241,7 +8356,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8241
8356
|
resolveSkillRef(skillRef);
|
|
8242
8357
|
} catch (error) {
|
|
8243
8358
|
ctx.addIssue({
|
|
8244
|
-
code:
|
|
8359
|
+
code: z28.ZodIssueCode.custom,
|
|
8245
8360
|
message: error instanceof Error ? error.message : `Invalid skill reference: ${skillRef}`,
|
|
8246
8361
|
path: ["skills", i]
|
|
8247
8362
|
});
|
|
@@ -8251,15 +8366,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8251
8366
|
}
|
|
8252
8367
|
}
|
|
8253
8368
|
);
|
|
8254
|
-
var cliComposeSchema =
|
|
8255
|
-
version:
|
|
8256
|
-
agents:
|
|
8257
|
-
volumes:
|
|
8369
|
+
var cliComposeSchema = z28.object({
|
|
8370
|
+
version: z28.string().min(1, "Missing config.version"),
|
|
8371
|
+
agents: z28.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
8372
|
+
volumes: z28.record(z28.string(), volumeConfigSchema).optional()
|
|
8258
8373
|
}).superRefine((config, ctx) => {
|
|
8259
8374
|
const agentKeys = Object.keys(config.agents);
|
|
8260
8375
|
if (agentKeys.length === 0) {
|
|
8261
8376
|
ctx.addIssue({
|
|
8262
|
-
code:
|
|
8377
|
+
code: z28.ZodIssueCode.custom,
|
|
8263
8378
|
message: "agents must have at least one agent defined",
|
|
8264
8379
|
path: ["agents"]
|
|
8265
8380
|
});
|
|
@@ -8267,7 +8382,7 @@ var cliComposeSchema = z27.object({
|
|
|
8267
8382
|
}
|
|
8268
8383
|
if (agentKeys.length > 1) {
|
|
8269
8384
|
ctx.addIssue({
|
|
8270
|
-
code:
|
|
8385
|
+
code: z28.ZodIssueCode.custom,
|
|
8271
8386
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
8272
8387
|
path: ["agents"]
|
|
8273
8388
|
});
|
|
@@ -8279,7 +8394,7 @@ var cliComposeSchema = z27.object({
|
|
|
8279
8394
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
8280
8395
|
if (!config.volumes) {
|
|
8281
8396
|
ctx.addIssue({
|
|
8282
|
-
code:
|
|
8397
|
+
code: z28.ZodIssueCode.custom,
|
|
8283
8398
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
8284
8399
|
path: ["volumes"]
|
|
8285
8400
|
});
|
|
@@ -8289,7 +8404,7 @@ var cliComposeSchema = z27.object({
|
|
|
8289
8404
|
const parts = volDeclaration.split(":");
|
|
8290
8405
|
if (parts.length !== 2) {
|
|
8291
8406
|
ctx.addIssue({
|
|
8292
|
-
code:
|
|
8407
|
+
code: z28.ZodIssueCode.custom,
|
|
8293
8408
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
8294
8409
|
path: ["agents", agentName, "volumes"]
|
|
8295
8410
|
});
|
|
@@ -8298,7 +8413,7 @@ var cliComposeSchema = z27.object({
|
|
|
8298
8413
|
const volumeKey = parts[0].trim();
|
|
8299
8414
|
if (!config.volumes[volumeKey]) {
|
|
8300
8415
|
ctx.addIssue({
|
|
8301
|
-
code:
|
|
8416
|
+
code: z28.ZodIssueCode.custom,
|
|
8302
8417
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
8303
8418
|
path: ["volumes", volumeKey]
|
|
8304
8419
|
});
|
|
@@ -9535,7 +9650,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9535
9650
|
options.autoUpdate = false;
|
|
9536
9651
|
}
|
|
9537
9652
|
if (options.autoUpdate !== false) {
|
|
9538
|
-
await startSilentUpgrade("9.
|
|
9653
|
+
await startSilentUpgrade("9.63.1");
|
|
9539
9654
|
}
|
|
9540
9655
|
try {
|
|
9541
9656
|
let result;
|
|
@@ -10357,7 +10472,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
10357
10472
|
withErrorHandler(
|
|
10358
10473
|
async (identifier, prompt, options) => {
|
|
10359
10474
|
if (options.autoUpdate !== false) {
|
|
10360
|
-
await startSilentUpgrade("9.
|
|
10475
|
+
await startSilentUpgrade("9.63.1");
|
|
10361
10476
|
}
|
|
10362
10477
|
const { org, name, version } = parseIdentifier(identifier);
|
|
10363
10478
|
let composeId;
|
|
@@ -12077,7 +12192,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
12077
12192
|
withErrorHandler(
|
|
12078
12193
|
async (prompt, options) => {
|
|
12079
12194
|
if (options.autoUpdate !== false) {
|
|
12080
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
12195
|
+
const shouldExit = await checkAndUpgrade("9.63.1", prompt);
|
|
12081
12196
|
if (shouldExit) {
|
|
12082
12197
|
process.exit(0);
|
|
12083
12198
|
}
|
|
@@ -13426,30 +13541,16 @@ var listCommand5 = new Command43().name("list").description("List all accessible
|
|
|
13426
13541
|
// src/commands/org/use.ts
|
|
13427
13542
|
import { Command as Command44 } from "commander";
|
|
13428
13543
|
import chalk40 from "chalk";
|
|
13429
|
-
var useCommand = new Command44().name("use").description("Switch to a different organization").argument("
|
|
13430
|
-
withErrorHandler(
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
"Organization slug is required. Use --personal to switch to personal org."
|
|
13440
|
-
);
|
|
13441
|
-
}
|
|
13442
|
-
const orgList = await listOrgs();
|
|
13443
|
-
const target = orgList.orgs.find((s) => s.slug === slug);
|
|
13444
|
-
if (!target) {
|
|
13445
|
-
throw new Error(
|
|
13446
|
-
`Organization '${slug}' not found or not accessible.`
|
|
13447
|
-
);
|
|
13448
|
-
}
|
|
13449
|
-
await saveConfig({ activeOrg: slug });
|
|
13450
|
-
console.log(chalk40.green(`\u2713 Switched to organization: ${slug}`));
|
|
13451
|
-
}
|
|
13452
|
-
)
|
|
13544
|
+
var useCommand = new Command44().name("use").description("Switch to a different organization").argument("<slug>", "Organization slug to switch to").action(
|
|
13545
|
+
withErrorHandler(async (slug) => {
|
|
13546
|
+
const orgList = await listOrgs();
|
|
13547
|
+
const target = orgList.orgs.find((s) => s.slug === slug);
|
|
13548
|
+
if (!target) {
|
|
13549
|
+
throw new Error(`Organization '${slug}' not found or not accessible.`);
|
|
13550
|
+
}
|
|
13551
|
+
await saveConfig({ activeOrg: slug });
|
|
13552
|
+
console.log(chalk40.green(`\u2713 Switched to organization: ${slug}`));
|
|
13553
|
+
})
|
|
13453
13554
|
);
|
|
13454
13555
|
|
|
13455
13556
|
// src/commands/org/members.ts
|
|
@@ -13507,10 +13608,18 @@ import chalk44 from "chalk";
|
|
|
13507
13608
|
var leaveCommand = new Command48().name("leave").description("Leave the current organization").action(
|
|
13508
13609
|
withErrorHandler(async () => {
|
|
13509
13610
|
await leaveOrg();
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13611
|
+
const { orgs } = await listOrgs();
|
|
13612
|
+
if (orgs.length === 0) {
|
|
13613
|
+
await saveConfig({ activeOrg: void 0 });
|
|
13614
|
+
console.log(chalk44.green("\u2713 Left organization."));
|
|
13615
|
+
console.log(
|
|
13616
|
+
chalk44.yellow("No remaining organizations. Run: vm0 auth login")
|
|
13617
|
+
);
|
|
13618
|
+
return;
|
|
13619
|
+
}
|
|
13620
|
+
const nextOrg = orgs[0].slug;
|
|
13621
|
+
await saveConfig({ activeOrg: nextOrg });
|
|
13622
|
+
console.log(chalk44.green(`\u2713 Left organization. Switched to: ${nextOrg}`));
|
|
13514
13623
|
})
|
|
13515
13624
|
);
|
|
13516
13625
|
|
|
@@ -13685,7 +13794,7 @@ var listCommand6 = new Command52().name("list").alias("ls").description("List al
|
|
|
13685
13794
|
);
|
|
13686
13795
|
return;
|
|
13687
13796
|
}
|
|
13688
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
13797
|
+
const nameWidth = Math.max(4, ...data.composes.map((c25) => c25.name.length));
|
|
13689
13798
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
13690
13799
|
" "
|
|
13691
13800
|
);
|
|
@@ -14289,7 +14398,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
14289
14398
|
if (!isInteractive()) {
|
|
14290
14399
|
throw new Error("--frequency is required (daily|weekly|monthly|once|loop)");
|
|
14291
14400
|
}
|
|
14292
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
14401
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c25) => c25.value === existingFrequency) : 0;
|
|
14293
14402
|
frequency = await promptSelect(
|
|
14294
14403
|
"Schedule frequency",
|
|
14295
14404
|
FREQUENCY_CHOICES,
|
|
@@ -14314,7 +14423,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
14314
14423
|
throw new Error("--day is required for weekly/monthly");
|
|
14315
14424
|
}
|
|
14316
14425
|
if (frequency === "weekly") {
|
|
14317
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
14426
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c25) => c25.value === existingDay) : 0;
|
|
14318
14427
|
const day2 = await promptSelect(
|
|
14319
14428
|
"Day of week",
|
|
14320
14429
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -16316,7 +16425,7 @@ import chalk69 from "chalk";
|
|
|
16316
16425
|
var listCommand11 = new Command78().name("list").alias("ls").description("List all connectors and their status").action(
|
|
16317
16426
|
withErrorHandler(async () => {
|
|
16318
16427
|
const result = await listConnectors();
|
|
16319
|
-
const connectedMap = new Map(result.connectors.map((
|
|
16428
|
+
const connectedMap = new Map(result.connectors.map((c25) => [c25.type, c25]));
|
|
16320
16429
|
const allTypesRaw = Object.keys(CONNECTOR_TYPES);
|
|
16321
16430
|
const allTypes = [];
|
|
16322
16431
|
for (const type2 of allTypesRaw) {
|
|
@@ -16338,8 +16447,8 @@ var listCommand11 = new Command78().name("list").alias("ls").description("List a
|
|
|
16338
16447
|
console.log(chalk69.dim(header));
|
|
16339
16448
|
for (const type2 of allTypes) {
|
|
16340
16449
|
const connector = connectedMap.get(type2);
|
|
16341
|
-
const status = connector ? chalk69.green("\u2713".padEnd(statusWidth)) : chalk69.dim("-".padEnd(statusWidth));
|
|
16342
|
-
const account = connector?.externalUsername ? `@${connector.externalUsername}` : chalk69.dim("-");
|
|
16450
|
+
const status = connector ? connector.needsReconnect ? chalk69.yellow("!".padEnd(statusWidth)) : chalk69.green("\u2713".padEnd(statusWidth)) : chalk69.dim("-".padEnd(statusWidth));
|
|
16451
|
+
const account = connector?.needsReconnect ? chalk69.yellow("(reconnect needed)") : connector?.externalUsername ? `@${connector.externalUsername}` : chalk69.dim("-");
|
|
16343
16452
|
const row = [type2.padEnd(typeWidth), status, account].join(" ");
|
|
16344
16453
|
console.log(row);
|
|
16345
16454
|
}
|
|
@@ -16848,16 +16957,16 @@ async function handleModelProvider(ctx) {
|
|
|
16848
16957
|
const providerType = await step.prompt(
|
|
16849
16958
|
() => promptSelect(
|
|
16850
16959
|
"Select provider type:",
|
|
16851
|
-
choices.map((
|
|
16852
|
-
title:
|
|
16853
|
-
value:
|
|
16960
|
+
choices.map((c25) => ({
|
|
16961
|
+
title: c25.label,
|
|
16962
|
+
value: c25.type
|
|
16854
16963
|
}))
|
|
16855
16964
|
)
|
|
16856
16965
|
);
|
|
16857
16966
|
if (!providerType) {
|
|
16858
16967
|
process.exit(0);
|
|
16859
16968
|
}
|
|
16860
|
-
const selectedChoice = choices.find((
|
|
16969
|
+
const selectedChoice = choices.find((c25) => c25.type === providerType);
|
|
16861
16970
|
if (selectedChoice?.helpText) {
|
|
16862
16971
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
16863
16972
|
step.detail(chalk75.dim(line));
|
|
@@ -17211,13 +17320,13 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17211
17320
|
if (latestVersion === null) {
|
|
17212
17321
|
throw new Error("Could not check for updates. Please try again later.");
|
|
17213
17322
|
}
|
|
17214
|
-
if (latestVersion === "9.
|
|
17215
|
-
console.log(chalk79.green(`\u2713 Already up to date (${"9.
|
|
17323
|
+
if (latestVersion === "9.63.1") {
|
|
17324
|
+
console.log(chalk79.green(`\u2713 Already up to date (${"9.63.1"})`));
|
|
17216
17325
|
return;
|
|
17217
17326
|
}
|
|
17218
17327
|
console.log(
|
|
17219
17328
|
chalk79.yellow(
|
|
17220
|
-
`Current version: ${"9.
|
|
17329
|
+
`Current version: ${"9.63.1"} -> Latest version: ${latestVersion}`
|
|
17221
17330
|
)
|
|
17222
17331
|
);
|
|
17223
17332
|
console.log();
|
|
@@ -17244,7 +17353,7 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17244
17353
|
const success = await performUpgrade(packageManager);
|
|
17245
17354
|
if (success) {
|
|
17246
17355
|
console.log(
|
|
17247
|
-
chalk79.green(`\u2713 Upgraded from ${"9.
|
|
17356
|
+
chalk79.green(`\u2713 Upgraded from ${"9.63.1"} to ${latestVersion}`)
|
|
17248
17357
|
);
|
|
17249
17358
|
return;
|
|
17250
17359
|
}
|
|
@@ -17258,7 +17367,7 @@ var upgradeCommand = new Command86().name("upgrade").description("Upgrade vm0 CL
|
|
|
17258
17367
|
|
|
17259
17368
|
// src/index.ts
|
|
17260
17369
|
var program = new Command87();
|
|
17261
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
17370
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.63.1");
|
|
17262
17371
|
program.addCommand(authCommand);
|
|
17263
17372
|
program.addCommand(infoCommand);
|
|
17264
17373
|
program.addCommand(composeCommand);
|