@vm0/cli 9.24.1 → 9.25.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 +328 -123
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -61,7 +61,7 @@ if (DSN) {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
Sentry.setContext("cli", {
|
|
64
|
-
version: "9.
|
|
64
|
+
version: "9.25.0",
|
|
65
65
|
command: process.argv.slice(2).join(" ")
|
|
66
66
|
});
|
|
67
67
|
Sentry.setContext("runtime", {
|
|
@@ -72,7 +72,7 @@ if (DSN) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/index.ts
|
|
75
|
-
import { Command as
|
|
75
|
+
import { Command as Command75 } from "commander";
|
|
76
76
|
|
|
77
77
|
// src/commands/auth/index.ts
|
|
78
78
|
import { Command as Command5 } from "commander";
|
|
@@ -1965,7 +1965,7 @@ var secretNameSchema = z14.string().min(1, "Secret name is required").max(255, "
|
|
|
1965
1965
|
/^[A-Z][A-Z0-9_]*$/,
|
|
1966
1966
|
"Secret name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_API_KEY)"
|
|
1967
1967
|
);
|
|
1968
|
-
var secretTypeSchema = z14.enum(["user", "model-provider"]);
|
|
1968
|
+
var secretTypeSchema = z14.enum(["user", "model-provider", "connector"]);
|
|
1969
1969
|
var secretResponseSchema = z14.object({
|
|
1970
1970
|
id: z14.string().uuid(),
|
|
1971
1971
|
name: z14.string(),
|
|
@@ -3234,6 +3234,34 @@ var webhookComposeCompleteContract = c19.router({
|
|
|
3234
3234
|
// ../../packages/core/src/contracts/connectors.ts
|
|
3235
3235
|
import { z as z24 } from "zod";
|
|
3236
3236
|
var c20 = initContract();
|
|
3237
|
+
var CONNECTOR_TYPES = {
|
|
3238
|
+
github: {
|
|
3239
|
+
label: "GitHub",
|
|
3240
|
+
helpText: "Connect your GitHub account to access repositories and GitHub features",
|
|
3241
|
+
authMethods: {
|
|
3242
|
+
oauth: {
|
|
3243
|
+
label: "OAuth (Recommended)",
|
|
3244
|
+
helpText: "Sign in with GitHub to grant access.",
|
|
3245
|
+
secrets: {
|
|
3246
|
+
GITHUB_ACCESS_TOKEN: {
|
|
3247
|
+
label: "Access Token",
|
|
3248
|
+
required: true
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
},
|
|
3253
|
+
defaultAuthMethod: "oauth",
|
|
3254
|
+
environmentMapping: {
|
|
3255
|
+
GH_TOKEN: "$secrets.GITHUB_ACCESS_TOKEN",
|
|
3256
|
+
GITHUB_TOKEN: "$secrets.GITHUB_ACCESS_TOKEN"
|
|
3257
|
+
},
|
|
3258
|
+
oauth: {
|
|
3259
|
+
authorizationUrl: "https://github.com/login/oauth/authorize",
|
|
3260
|
+
tokenUrl: "https://github.com/login/oauth/access_token",
|
|
3261
|
+
scopes: ["repo"]
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
};
|
|
3237
3265
|
var connectorTypeSchema = z24.enum(["github"]);
|
|
3238
3266
|
var connectorResponseSchema = z24.object({
|
|
3239
3267
|
id: z24.string().uuid(),
|
|
@@ -4575,6 +4603,43 @@ async function updateModelProviderModel(type, selectedModel) {
|
|
|
4575
4603
|
handleError(result, "Failed to update model provider");
|
|
4576
4604
|
}
|
|
4577
4605
|
|
|
4606
|
+
// src/lib/api/domains/connectors.ts
|
|
4607
|
+
import { initClient as initClient10 } from "@ts-rest/core";
|
|
4608
|
+
async function listConnectors() {
|
|
4609
|
+
const config = await getClientConfig();
|
|
4610
|
+
const client = initClient10(connectorsMainContract, config);
|
|
4611
|
+
const result = await client.list({ headers: {} });
|
|
4612
|
+
if (result.status === 200) {
|
|
4613
|
+
return result.body;
|
|
4614
|
+
}
|
|
4615
|
+
handleError(result, "Failed to list connectors");
|
|
4616
|
+
}
|
|
4617
|
+
async function deleteConnector(type) {
|
|
4618
|
+
const config = await getClientConfig();
|
|
4619
|
+
const client = initClient10(connectorsByTypeContract, config);
|
|
4620
|
+
const result = await client.delete({
|
|
4621
|
+
params: { type }
|
|
4622
|
+
});
|
|
4623
|
+
if (result.status === 204) {
|
|
4624
|
+
return;
|
|
4625
|
+
}
|
|
4626
|
+
handleError(result, `Connector "${type}" not found`);
|
|
4627
|
+
}
|
|
4628
|
+
async function getConnector(type) {
|
|
4629
|
+
const config = await getClientConfig();
|
|
4630
|
+
const client = initClient10(connectorsByTypeContract, config);
|
|
4631
|
+
const result = await client.get({
|
|
4632
|
+
params: { type }
|
|
4633
|
+
});
|
|
4634
|
+
if (result.status === 200) {
|
|
4635
|
+
return result.body;
|
|
4636
|
+
}
|
|
4637
|
+
if (result.status === 404) {
|
|
4638
|
+
return null;
|
|
4639
|
+
}
|
|
4640
|
+
handleError(result, `Failed to get connector "${type}"`);
|
|
4641
|
+
}
|
|
4642
|
+
|
|
4578
4643
|
// src/lib/api/domains/usage.ts
|
|
4579
4644
|
async function getUsage(options) {
|
|
4580
4645
|
const baseUrl = await getBaseUrl();
|
|
@@ -5836,7 +5901,7 @@ async function finalizeCompose(config, agent, variables, options) {
|
|
|
5836
5901
|
);
|
|
5837
5902
|
}
|
|
5838
5903
|
if (options.autoUpdate !== false) {
|
|
5839
|
-
await silentUpgradeAfterCommand("9.
|
|
5904
|
+
await silentUpgradeAfterCommand("9.25.0");
|
|
5840
5905
|
}
|
|
5841
5906
|
return result;
|
|
5842
5907
|
}
|
|
@@ -6952,7 +7017,7 @@ var CodexEventRenderer = class {
|
|
|
6952
7017
|
};
|
|
6953
7018
|
|
|
6954
7019
|
// src/lib/api/api-client.ts
|
|
6955
|
-
import { initClient as
|
|
7020
|
+
import { initClient as initClient11 } from "@ts-rest/core";
|
|
6956
7021
|
var ApiClient = class {
|
|
6957
7022
|
async getHeaders() {
|
|
6958
7023
|
const token = await getToken();
|
|
@@ -6978,7 +7043,7 @@ var ApiClient = class {
|
|
|
6978
7043
|
async getComposeByName(name, scope) {
|
|
6979
7044
|
const baseUrl = await this.getBaseUrl();
|
|
6980
7045
|
const headers = await this.getHeaders();
|
|
6981
|
-
const client =
|
|
7046
|
+
const client = initClient11(composesMainContract, {
|
|
6982
7047
|
baseUrl,
|
|
6983
7048
|
baseHeaders: headers,
|
|
6984
7049
|
jsonQuery: true
|
|
@@ -6999,7 +7064,7 @@ var ApiClient = class {
|
|
|
6999
7064
|
async getComposeById(id) {
|
|
7000
7065
|
const baseUrl = await this.getBaseUrl();
|
|
7001
7066
|
const headers = await this.getHeaders();
|
|
7002
|
-
const client =
|
|
7067
|
+
const client = initClient11(composesByIdContract, {
|
|
7003
7068
|
baseUrl,
|
|
7004
7069
|
baseHeaders: headers,
|
|
7005
7070
|
jsonQuery: true
|
|
@@ -7021,7 +7086,7 @@ var ApiClient = class {
|
|
|
7021
7086
|
async getComposeVersion(composeId, version) {
|
|
7022
7087
|
const baseUrl = await this.getBaseUrl();
|
|
7023
7088
|
const headers = await this.getHeaders();
|
|
7024
|
-
const client =
|
|
7089
|
+
const client = initClient11(composesVersionsContract, {
|
|
7025
7090
|
baseUrl,
|
|
7026
7091
|
baseHeaders: headers,
|
|
7027
7092
|
jsonQuery: true
|
|
@@ -7042,7 +7107,7 @@ var ApiClient = class {
|
|
|
7042
7107
|
async createOrUpdateCompose(body) {
|
|
7043
7108
|
const baseUrl = await this.getBaseUrl();
|
|
7044
7109
|
const headers = await this.getHeaders();
|
|
7045
|
-
const client =
|
|
7110
|
+
const client = initClient11(composesMainContract, {
|
|
7046
7111
|
baseUrl,
|
|
7047
7112
|
baseHeaders: headers,
|
|
7048
7113
|
jsonQuery: true
|
|
@@ -7065,7 +7130,7 @@ var ApiClient = class {
|
|
|
7065
7130
|
async createRun(body) {
|
|
7066
7131
|
const baseUrl = await this.getBaseUrl();
|
|
7067
7132
|
const headers = await this.getHeaders();
|
|
7068
|
-
const client =
|
|
7133
|
+
const client = initClient11(runsMainContract, {
|
|
7069
7134
|
baseUrl,
|
|
7070
7135
|
baseHeaders: headers,
|
|
7071
7136
|
jsonQuery: true
|
|
@@ -7081,7 +7146,7 @@ var ApiClient = class {
|
|
|
7081
7146
|
async getEvents(runId, options) {
|
|
7082
7147
|
const baseUrl = await this.getBaseUrl();
|
|
7083
7148
|
const headers = await this.getHeaders();
|
|
7084
|
-
const client =
|
|
7149
|
+
const client = initClient11(runEventsContract, {
|
|
7085
7150
|
baseUrl,
|
|
7086
7151
|
baseHeaders: headers,
|
|
7087
7152
|
jsonQuery: true
|
|
@@ -7103,7 +7168,7 @@ var ApiClient = class {
|
|
|
7103
7168
|
async getSystemLog(runId, options) {
|
|
7104
7169
|
const baseUrl = await this.getBaseUrl();
|
|
7105
7170
|
const headers = await this.getHeaders();
|
|
7106
|
-
const client =
|
|
7171
|
+
const client = initClient11(runSystemLogContract, {
|
|
7107
7172
|
baseUrl,
|
|
7108
7173
|
baseHeaders: headers,
|
|
7109
7174
|
jsonQuery: true
|
|
@@ -7126,7 +7191,7 @@ var ApiClient = class {
|
|
|
7126
7191
|
async getMetrics(runId, options) {
|
|
7127
7192
|
const baseUrl = await this.getBaseUrl();
|
|
7128
7193
|
const headers = await this.getHeaders();
|
|
7129
|
-
const client =
|
|
7194
|
+
const client = initClient11(runMetricsContract, {
|
|
7130
7195
|
baseUrl,
|
|
7131
7196
|
baseHeaders: headers,
|
|
7132
7197
|
jsonQuery: true
|
|
@@ -7149,7 +7214,7 @@ var ApiClient = class {
|
|
|
7149
7214
|
async getAgentEvents(runId, options) {
|
|
7150
7215
|
const baseUrl = await this.getBaseUrl();
|
|
7151
7216
|
const headers = await this.getHeaders();
|
|
7152
|
-
const client =
|
|
7217
|
+
const client = initClient11(runAgentEventsContract, {
|
|
7153
7218
|
baseUrl,
|
|
7154
7219
|
baseHeaders: headers,
|
|
7155
7220
|
jsonQuery: true
|
|
@@ -7172,7 +7237,7 @@ var ApiClient = class {
|
|
|
7172
7237
|
async getNetworkLogs(runId, options) {
|
|
7173
7238
|
const baseUrl = await this.getBaseUrl();
|
|
7174
7239
|
const headers = await this.getHeaders();
|
|
7175
|
-
const client =
|
|
7240
|
+
const client = initClient11(runNetworkLogsContract, {
|
|
7176
7241
|
baseUrl,
|
|
7177
7242
|
baseHeaders: headers,
|
|
7178
7243
|
jsonQuery: true
|
|
@@ -7198,7 +7263,7 @@ var ApiClient = class {
|
|
|
7198
7263
|
async getScope() {
|
|
7199
7264
|
const baseUrl = await this.getBaseUrl();
|
|
7200
7265
|
const headers = await this.getHeaders();
|
|
7201
|
-
const client =
|
|
7266
|
+
const client = initClient11(scopeContract, {
|
|
7202
7267
|
baseUrl,
|
|
7203
7268
|
baseHeaders: headers,
|
|
7204
7269
|
jsonQuery: true
|
|
@@ -7217,7 +7282,7 @@ var ApiClient = class {
|
|
|
7217
7282
|
async createScope(body) {
|
|
7218
7283
|
const baseUrl = await this.getBaseUrl();
|
|
7219
7284
|
const headers = await this.getHeaders();
|
|
7220
|
-
const client =
|
|
7285
|
+
const client = initClient11(scopeContract, {
|
|
7221
7286
|
baseUrl,
|
|
7222
7287
|
baseHeaders: headers,
|
|
7223
7288
|
jsonQuery: true
|
|
@@ -7236,7 +7301,7 @@ var ApiClient = class {
|
|
|
7236
7301
|
async updateScope(body) {
|
|
7237
7302
|
const baseUrl = await this.getBaseUrl();
|
|
7238
7303
|
const headers = await this.getHeaders();
|
|
7239
|
-
const client =
|
|
7304
|
+
const client = initClient11(scopeContract, {
|
|
7240
7305
|
baseUrl,
|
|
7241
7306
|
baseHeaders: headers,
|
|
7242
7307
|
jsonQuery: true
|
|
@@ -7256,7 +7321,7 @@ var ApiClient = class {
|
|
|
7256
7321
|
async getSession(sessionId) {
|
|
7257
7322
|
const baseUrl = await this.getBaseUrl();
|
|
7258
7323
|
const headers = await this.getHeaders();
|
|
7259
|
-
const client =
|
|
7324
|
+
const client = initClient11(sessionsByIdContract, {
|
|
7260
7325
|
baseUrl,
|
|
7261
7326
|
baseHeaders: headers,
|
|
7262
7327
|
jsonQuery: true
|
|
@@ -7278,7 +7343,7 @@ var ApiClient = class {
|
|
|
7278
7343
|
async getCheckpoint(checkpointId) {
|
|
7279
7344
|
const baseUrl = await this.getBaseUrl();
|
|
7280
7345
|
const headers = await this.getHeaders();
|
|
7281
|
-
const client =
|
|
7346
|
+
const client = initClient11(checkpointsByIdContract, {
|
|
7282
7347
|
baseUrl,
|
|
7283
7348
|
baseHeaders: headers,
|
|
7284
7349
|
jsonQuery: true
|
|
@@ -7299,7 +7364,7 @@ var ApiClient = class {
|
|
|
7299
7364
|
async prepareStorage(body) {
|
|
7300
7365
|
const baseUrl = await this.getBaseUrl();
|
|
7301
7366
|
const headers = await this.getHeaders();
|
|
7302
|
-
const client =
|
|
7367
|
+
const client = initClient11(storagesPrepareContract, {
|
|
7303
7368
|
baseUrl,
|
|
7304
7369
|
baseHeaders: headers,
|
|
7305
7370
|
jsonQuery: true
|
|
@@ -7318,7 +7383,7 @@ var ApiClient = class {
|
|
|
7318
7383
|
async commitStorage(body) {
|
|
7319
7384
|
const baseUrl = await this.getBaseUrl();
|
|
7320
7385
|
const headers = await this.getHeaders();
|
|
7321
|
-
const client =
|
|
7386
|
+
const client = initClient11(storagesCommitContract, {
|
|
7322
7387
|
baseUrl,
|
|
7323
7388
|
baseHeaders: headers,
|
|
7324
7389
|
jsonQuery: true
|
|
@@ -7337,7 +7402,7 @@ var ApiClient = class {
|
|
|
7337
7402
|
async getStorageDownload(query) {
|
|
7338
7403
|
const baseUrl = await this.getBaseUrl();
|
|
7339
7404
|
const headers = await this.getHeaders();
|
|
7340
|
-
const client =
|
|
7405
|
+
const client = initClient11(storagesDownloadContract, {
|
|
7341
7406
|
baseUrl,
|
|
7342
7407
|
baseHeaders: headers,
|
|
7343
7408
|
jsonQuery: true
|
|
@@ -7362,7 +7427,7 @@ var ApiClient = class {
|
|
|
7362
7427
|
async listStorages(query) {
|
|
7363
7428
|
const baseUrl = await this.getBaseUrl();
|
|
7364
7429
|
const headers = await this.getHeaders();
|
|
7365
|
-
const client =
|
|
7430
|
+
const client = initClient11(storagesListContract, {
|
|
7366
7431
|
baseUrl,
|
|
7367
7432
|
baseHeaders: headers,
|
|
7368
7433
|
jsonQuery: true
|
|
@@ -7382,7 +7447,7 @@ var ApiClient = class {
|
|
|
7382
7447
|
async deploySchedule(body) {
|
|
7383
7448
|
const baseUrl = await this.getBaseUrl();
|
|
7384
7449
|
const headers = await this.getHeaders();
|
|
7385
|
-
const client =
|
|
7450
|
+
const client = initClient11(schedulesMainContract, {
|
|
7386
7451
|
baseUrl,
|
|
7387
7452
|
baseHeaders: headers,
|
|
7388
7453
|
jsonQuery: true
|
|
@@ -7401,7 +7466,7 @@ var ApiClient = class {
|
|
|
7401
7466
|
async listSchedules() {
|
|
7402
7467
|
const baseUrl = await this.getBaseUrl();
|
|
7403
7468
|
const headers = await this.getHeaders();
|
|
7404
|
-
const client =
|
|
7469
|
+
const client = initClient11(schedulesMainContract, {
|
|
7405
7470
|
baseUrl,
|
|
7406
7471
|
baseHeaders: headers,
|
|
7407
7472
|
jsonQuery: true
|
|
@@ -7420,7 +7485,7 @@ var ApiClient = class {
|
|
|
7420
7485
|
async getScheduleByName(params) {
|
|
7421
7486
|
const baseUrl = await this.getBaseUrl();
|
|
7422
7487
|
const headers = await this.getHeaders();
|
|
7423
|
-
const client =
|
|
7488
|
+
const client = initClient11(schedulesByNameContract, {
|
|
7424
7489
|
baseUrl,
|
|
7425
7490
|
baseHeaders: headers,
|
|
7426
7491
|
jsonQuery: true
|
|
@@ -7442,7 +7507,7 @@ var ApiClient = class {
|
|
|
7442
7507
|
async deleteSchedule(params) {
|
|
7443
7508
|
const baseUrl = await this.getBaseUrl();
|
|
7444
7509
|
const headers = await this.getHeaders();
|
|
7445
|
-
const client =
|
|
7510
|
+
const client = initClient11(schedulesByNameContract, {
|
|
7446
7511
|
baseUrl,
|
|
7447
7512
|
baseHeaders: headers,
|
|
7448
7513
|
jsonQuery: true
|
|
@@ -7464,7 +7529,7 @@ var ApiClient = class {
|
|
|
7464
7529
|
async enableSchedule(params) {
|
|
7465
7530
|
const baseUrl = await this.getBaseUrl();
|
|
7466
7531
|
const headers = await this.getHeaders();
|
|
7467
|
-
const client =
|
|
7532
|
+
const client = initClient11(schedulesEnableContract, {
|
|
7468
7533
|
baseUrl,
|
|
7469
7534
|
baseHeaders: headers,
|
|
7470
7535
|
jsonQuery: true
|
|
@@ -7486,7 +7551,7 @@ var ApiClient = class {
|
|
|
7486
7551
|
async disableSchedule(params) {
|
|
7487
7552
|
const baseUrl = await this.getBaseUrl();
|
|
7488
7553
|
const headers = await this.getHeaders();
|
|
7489
|
-
const client =
|
|
7554
|
+
const client = initClient11(schedulesEnableContract, {
|
|
7490
7555
|
baseUrl,
|
|
7491
7556
|
baseHeaders: headers,
|
|
7492
7557
|
jsonQuery: true
|
|
@@ -7508,7 +7573,7 @@ var ApiClient = class {
|
|
|
7508
7573
|
async listScheduleRuns(params) {
|
|
7509
7574
|
const baseUrl = await this.getBaseUrl();
|
|
7510
7575
|
const headers = await this.getHeaders();
|
|
7511
|
-
const client =
|
|
7576
|
+
const client = initClient11(scheduleRunsContract, {
|
|
7512
7577
|
baseUrl,
|
|
7513
7578
|
baseHeaders: headers,
|
|
7514
7579
|
jsonQuery: true
|
|
@@ -7533,7 +7598,7 @@ var ApiClient = class {
|
|
|
7533
7598
|
async listPublicAgents(query) {
|
|
7534
7599
|
const baseUrl = await this.getBaseUrl();
|
|
7535
7600
|
const headers = await this.getHeaders();
|
|
7536
|
-
const client =
|
|
7601
|
+
const client = initClient11(publicAgentsListContract, {
|
|
7537
7602
|
baseUrl,
|
|
7538
7603
|
baseHeaders: headers,
|
|
7539
7604
|
jsonQuery: true
|
|
@@ -7552,7 +7617,7 @@ var ApiClient = class {
|
|
|
7552
7617
|
async listPublicArtifacts(query) {
|
|
7553
7618
|
const baseUrl = await this.getBaseUrl();
|
|
7554
7619
|
const headers = await this.getHeaders();
|
|
7555
|
-
const client =
|
|
7620
|
+
const client = initClient11(publicArtifactsListContract, {
|
|
7556
7621
|
baseUrl,
|
|
7557
7622
|
baseHeaders: headers,
|
|
7558
7623
|
jsonQuery: true
|
|
@@ -7571,7 +7636,7 @@ var ApiClient = class {
|
|
|
7571
7636
|
async getPublicArtifact(id) {
|
|
7572
7637
|
const baseUrl = await this.getBaseUrl();
|
|
7573
7638
|
const headers = await this.getHeaders();
|
|
7574
|
-
const client =
|
|
7639
|
+
const client = initClient11(publicArtifactByIdContract, {
|
|
7575
7640
|
baseUrl,
|
|
7576
7641
|
baseHeaders: headers,
|
|
7577
7642
|
jsonQuery: true
|
|
@@ -7590,7 +7655,7 @@ var ApiClient = class {
|
|
|
7590
7655
|
async listPublicVolumes(query) {
|
|
7591
7656
|
const baseUrl = await this.getBaseUrl();
|
|
7592
7657
|
const headers = await this.getHeaders();
|
|
7593
|
-
const client =
|
|
7658
|
+
const client = initClient11(publicVolumesListContract, {
|
|
7594
7659
|
baseUrl,
|
|
7595
7660
|
baseHeaders: headers,
|
|
7596
7661
|
jsonQuery: true
|
|
@@ -7609,7 +7674,7 @@ var ApiClient = class {
|
|
|
7609
7674
|
async getPublicVolume(id) {
|
|
7610
7675
|
const baseUrl = await this.getBaseUrl();
|
|
7611
7676
|
const headers = await this.getHeaders();
|
|
7612
|
-
const client =
|
|
7677
|
+
const client = initClient11(publicVolumeByIdContract, {
|
|
7613
7678
|
baseUrl,
|
|
7614
7679
|
baseHeaders: headers,
|
|
7615
7680
|
jsonQuery: true
|
|
@@ -7648,7 +7713,7 @@ var ApiClient = class {
|
|
|
7648
7713
|
async listCredentials() {
|
|
7649
7714
|
const baseUrl = await this.getBaseUrl();
|
|
7650
7715
|
const headers = await this.getHeaders();
|
|
7651
|
-
const client =
|
|
7716
|
+
const client = initClient11(credentialsMainContract, {
|
|
7652
7717
|
baseUrl,
|
|
7653
7718
|
baseHeaders: headers,
|
|
7654
7719
|
jsonQuery: true
|
|
@@ -7667,7 +7732,7 @@ var ApiClient = class {
|
|
|
7667
7732
|
async getCredential(name) {
|
|
7668
7733
|
const baseUrl = await this.getBaseUrl();
|
|
7669
7734
|
const headers = await this.getHeaders();
|
|
7670
|
-
const client =
|
|
7735
|
+
const client = initClient11(credentialsByNameContract, {
|
|
7671
7736
|
baseUrl,
|
|
7672
7737
|
baseHeaders: headers,
|
|
7673
7738
|
jsonQuery: true
|
|
@@ -7688,7 +7753,7 @@ var ApiClient = class {
|
|
|
7688
7753
|
async setCredential(body) {
|
|
7689
7754
|
const baseUrl = await this.getBaseUrl();
|
|
7690
7755
|
const headers = await this.getHeaders();
|
|
7691
|
-
const client =
|
|
7756
|
+
const client = initClient11(credentialsMainContract, {
|
|
7692
7757
|
baseUrl,
|
|
7693
7758
|
baseHeaders: headers,
|
|
7694
7759
|
jsonQuery: true
|
|
@@ -7707,7 +7772,7 @@ var ApiClient = class {
|
|
|
7707
7772
|
async deleteCredential(name) {
|
|
7708
7773
|
const baseUrl = await this.getBaseUrl();
|
|
7709
7774
|
const headers = await this.getHeaders();
|
|
7710
|
-
const client =
|
|
7775
|
+
const client = initClient11(credentialsByNameContract, {
|
|
7711
7776
|
baseUrl,
|
|
7712
7777
|
baseHeaders: headers,
|
|
7713
7778
|
jsonQuery: true
|
|
@@ -7728,7 +7793,7 @@ var ApiClient = class {
|
|
|
7728
7793
|
async getRealtimeToken(runId) {
|
|
7729
7794
|
const baseUrl = await this.getBaseUrl();
|
|
7730
7795
|
const headers = await this.getHeaders();
|
|
7731
|
-
const client =
|
|
7796
|
+
const client = initClient11(realtimeTokenContract, {
|
|
7732
7797
|
baseUrl,
|
|
7733
7798
|
baseHeaders: headers,
|
|
7734
7799
|
jsonQuery: true
|
|
@@ -8279,7 +8344,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
8279
8344
|
}
|
|
8280
8345
|
showNextSteps(result);
|
|
8281
8346
|
if (options.autoUpdate !== false) {
|
|
8282
|
-
await silentUpgradeAfterCommand("9.
|
|
8347
|
+
await silentUpgradeAfterCommand("9.25.0");
|
|
8283
8348
|
}
|
|
8284
8349
|
} catch (error) {
|
|
8285
8350
|
handleRunError(error, identifier);
|
|
@@ -9780,7 +9845,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
|
|
|
9780
9845
|
).option("-y, --yes", "Skip confirmation prompts").option("-v, --verbose", "Show full tool inputs and outputs").addOption(new Option5("--debug-no-mock-claude").hideHelp()).addOption(new Option5("--no-auto-update").hideHelp()).action(
|
|
9781
9846
|
async (prompt, options) => {
|
|
9782
9847
|
if (options.autoUpdate !== false) {
|
|
9783
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
9848
|
+
const shouldExit = await checkAndUpgrade("9.25.0", prompt);
|
|
9784
9849
|
if (shouldExit) {
|
|
9785
9850
|
process.exit(0);
|
|
9786
9851
|
}
|
|
@@ -13093,12 +13158,12 @@ var setDefaultCommand = new Command64().name("set-default").description("Set a m
|
|
|
13093
13158
|
var modelProviderCommand = new Command65().name("model-provider").description("Manage model providers for agent runs").addCommand(listCommand8).addCommand(setupCommand2).addCommand(deleteCommand4).addCommand(setDefaultCommand);
|
|
13094
13159
|
|
|
13095
13160
|
// src/commands/connector/index.ts
|
|
13096
|
-
import { Command as
|
|
13161
|
+
import { Command as Command70 } from "commander";
|
|
13097
13162
|
|
|
13098
13163
|
// src/commands/connector/connect.ts
|
|
13099
13164
|
import { Command as Command66 } from "commander";
|
|
13100
13165
|
import chalk62 from "chalk";
|
|
13101
|
-
import { initClient as
|
|
13166
|
+
import { initClient as initClient12 } from "@ts-rest/core";
|
|
13102
13167
|
function delay2(ms) {
|
|
13103
13168
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13104
13169
|
}
|
|
@@ -13127,7 +13192,7 @@ var connectCommand = new Command66().name("connect").description("Connect a thir
|
|
|
13127
13192
|
const apiUrl = await getApiUrl();
|
|
13128
13193
|
const headers = await getHeaders2();
|
|
13129
13194
|
console.log(`Connecting ${chalk62.cyan(type)}...`);
|
|
13130
|
-
const sessionsClient =
|
|
13195
|
+
const sessionsClient = initClient12(connectorSessionsContract, {
|
|
13131
13196
|
baseUrl: apiUrl,
|
|
13132
13197
|
baseHeaders: headers,
|
|
13133
13198
|
jsonQuery: true
|
|
@@ -13148,13 +13213,12 @@ var connectCommand = new Command66().name("connect").description("Connect a thir
|
|
|
13148
13213
|
console.log(chalk62.green("\nSession created"));
|
|
13149
13214
|
console.log(chalk62.cyan(`
|
|
13150
13215
|
To connect, visit: ${verificationUrl}`));
|
|
13151
|
-
console.log(`Session code: ${chalk62.bold(session.code)}`);
|
|
13152
13216
|
console.log(
|
|
13153
13217
|
`
|
|
13154
13218
|
The session expires in ${Math.floor(session.expiresIn / 60)} minutes.`
|
|
13155
13219
|
);
|
|
13156
13220
|
console.log("\nWaiting for authorization...");
|
|
13157
|
-
const sessionClient =
|
|
13221
|
+
const sessionClient = initClient12(connectorSessionByIdContract, {
|
|
13158
13222
|
baseUrl: apiUrl,
|
|
13159
13223
|
baseHeaders: headers,
|
|
13160
13224
|
jsonQuery: true
|
|
@@ -13208,29 +13272,170 @@ Connection failed: ${status.errorMessage || "Unknown error"}`
|
|
|
13208
13272
|
process.exit(1);
|
|
13209
13273
|
});
|
|
13210
13274
|
|
|
13275
|
+
// src/commands/connector/list.ts
|
|
13276
|
+
import { Command as Command67 } from "commander";
|
|
13277
|
+
import chalk63 from "chalk";
|
|
13278
|
+
var listCommand9 = new Command67().name("list").alias("ls").description("List all connectors and their status").action(async () => {
|
|
13279
|
+
try {
|
|
13280
|
+
const result = await listConnectors();
|
|
13281
|
+
const connectedMap = new Map(result.connectors.map((c25) => [c25.type, c25]));
|
|
13282
|
+
const allTypes = Object.keys(CONNECTOR_TYPES);
|
|
13283
|
+
const typeWidth = Math.max(4, ...allTypes.map((t) => t.length));
|
|
13284
|
+
const statusText = "STATUS";
|
|
13285
|
+
const statusWidth = statusText.length;
|
|
13286
|
+
const header = [
|
|
13287
|
+
"TYPE".padEnd(typeWidth),
|
|
13288
|
+
statusText.padEnd(statusWidth),
|
|
13289
|
+
"ACCOUNT"
|
|
13290
|
+
].join(" ");
|
|
13291
|
+
console.log(chalk63.dim(header));
|
|
13292
|
+
for (const type of allTypes) {
|
|
13293
|
+
const connector = connectedMap.get(type);
|
|
13294
|
+
const status = connector ? chalk63.green("\u2713".padEnd(statusWidth)) : chalk63.dim("-".padEnd(statusWidth));
|
|
13295
|
+
const account = connector?.externalUsername ? `@${connector.externalUsername}` : chalk63.dim("-");
|
|
13296
|
+
const row = [type.padEnd(typeWidth), status, account].join(" ");
|
|
13297
|
+
console.log(row);
|
|
13298
|
+
}
|
|
13299
|
+
console.log();
|
|
13300
|
+
console.log(chalk63.dim("To connect a service:"));
|
|
13301
|
+
console.log(chalk63.dim(" vm0 connector connect <type>"));
|
|
13302
|
+
} catch (error) {
|
|
13303
|
+
if (error instanceof Error) {
|
|
13304
|
+
if (error.message.includes("Not authenticated")) {
|
|
13305
|
+
console.error(chalk63.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
13306
|
+
} else {
|
|
13307
|
+
console.error(chalk63.red(`\u2717 ${error.message}`));
|
|
13308
|
+
}
|
|
13309
|
+
} else {
|
|
13310
|
+
console.error(chalk63.red("\u2717 An unexpected error occurred"));
|
|
13311
|
+
}
|
|
13312
|
+
process.exit(1);
|
|
13313
|
+
}
|
|
13314
|
+
});
|
|
13315
|
+
|
|
13316
|
+
// src/commands/connector/status.ts
|
|
13317
|
+
import { Command as Command68 } from "commander";
|
|
13318
|
+
import chalk64 from "chalk";
|
|
13319
|
+
var LABEL_WIDTH = 16;
|
|
13320
|
+
var statusCommand7 = new Command68().name("status").description("Show detailed status of a connector").argument("<type>", "Connector type (e.g., github)").action(async (type) => {
|
|
13321
|
+
try {
|
|
13322
|
+
const parseResult = connectorTypeSchema.safeParse(type);
|
|
13323
|
+
if (!parseResult.success) {
|
|
13324
|
+
console.error(chalk64.red(`\u2717 Unknown connector type: ${type}`));
|
|
13325
|
+
console.log();
|
|
13326
|
+
console.log("Available connectors:");
|
|
13327
|
+
for (const [t, config] of Object.entries(CONNECTOR_TYPES)) {
|
|
13328
|
+
console.log(` ${chalk64.cyan(t)} - ${config.label}`);
|
|
13329
|
+
}
|
|
13330
|
+
process.exit(1);
|
|
13331
|
+
}
|
|
13332
|
+
const connector = await getConnector(parseResult.data);
|
|
13333
|
+
console.log(`Connector: ${chalk64.cyan(type)}`);
|
|
13334
|
+
console.log();
|
|
13335
|
+
if (connector) {
|
|
13336
|
+
console.log(
|
|
13337
|
+
`${"Status:".padEnd(LABEL_WIDTH)}${chalk64.green("connected")}`
|
|
13338
|
+
);
|
|
13339
|
+
console.log(
|
|
13340
|
+
`${"Account:".padEnd(LABEL_WIDTH)}@${connector.externalUsername}`
|
|
13341
|
+
);
|
|
13342
|
+
console.log(
|
|
13343
|
+
`${"Auth Method:".padEnd(LABEL_WIDTH)}${connector.authMethod}`
|
|
13344
|
+
);
|
|
13345
|
+
if (connector.oauthScopes && connector.oauthScopes.length > 0) {
|
|
13346
|
+
console.log(
|
|
13347
|
+
`${"OAuth Scopes:".padEnd(LABEL_WIDTH)}${connector.oauthScopes.join(", ")}`
|
|
13348
|
+
);
|
|
13349
|
+
}
|
|
13350
|
+
console.log(
|
|
13351
|
+
`${"Connected:".padEnd(LABEL_WIDTH)}${formatDateTime(connector.createdAt)}`
|
|
13352
|
+
);
|
|
13353
|
+
if (connector.updatedAt !== connector.createdAt) {
|
|
13354
|
+
console.log(
|
|
13355
|
+
`${"Last Updated:".padEnd(LABEL_WIDTH)}${formatDateTime(connector.updatedAt)}`
|
|
13356
|
+
);
|
|
13357
|
+
}
|
|
13358
|
+
console.log();
|
|
13359
|
+
console.log(chalk64.dim("To disconnect:"));
|
|
13360
|
+
console.log(chalk64.dim(` vm0 connector disconnect ${type}`));
|
|
13361
|
+
} else {
|
|
13362
|
+
console.log(
|
|
13363
|
+
`${"Status:".padEnd(LABEL_WIDTH)}${chalk64.dim("not connected")}`
|
|
13364
|
+
);
|
|
13365
|
+
console.log();
|
|
13366
|
+
console.log(chalk64.dim("To connect:"));
|
|
13367
|
+
console.log(chalk64.dim(` vm0 connector connect ${type}`));
|
|
13368
|
+
}
|
|
13369
|
+
} catch (error) {
|
|
13370
|
+
if (error instanceof Error) {
|
|
13371
|
+
if (error.message.includes("Not authenticated")) {
|
|
13372
|
+
console.error(chalk64.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
13373
|
+
} else {
|
|
13374
|
+
console.error(chalk64.red(`\u2717 ${error.message}`));
|
|
13375
|
+
}
|
|
13376
|
+
} else {
|
|
13377
|
+
console.error(chalk64.red("\u2717 An unexpected error occurred"));
|
|
13378
|
+
}
|
|
13379
|
+
process.exit(1);
|
|
13380
|
+
}
|
|
13381
|
+
});
|
|
13382
|
+
|
|
13383
|
+
// src/commands/connector/disconnect.ts
|
|
13384
|
+
import { Command as Command69 } from "commander";
|
|
13385
|
+
import chalk65 from "chalk";
|
|
13386
|
+
var disconnectCommand = new Command69().name("disconnect").description("Disconnect a third-party service").argument("<type>", "Connector type to disconnect (e.g., github)").action(async (type) => {
|
|
13387
|
+
try {
|
|
13388
|
+
const parseResult = connectorTypeSchema.safeParse(type);
|
|
13389
|
+
if (!parseResult.success) {
|
|
13390
|
+
console.error(chalk65.red(`\u2717 Unknown connector type: ${type}`));
|
|
13391
|
+
console.log();
|
|
13392
|
+
console.log("Available connectors:");
|
|
13393
|
+
for (const [t, config] of Object.entries(CONNECTOR_TYPES)) {
|
|
13394
|
+
console.log(` ${chalk65.cyan(t)} - ${config.label}`);
|
|
13395
|
+
}
|
|
13396
|
+
process.exit(1);
|
|
13397
|
+
}
|
|
13398
|
+
await deleteConnector(parseResult.data);
|
|
13399
|
+
console.log(chalk65.green(`\u2713 Disconnected ${type}`));
|
|
13400
|
+
} catch (error) {
|
|
13401
|
+
if (error instanceof Error) {
|
|
13402
|
+
if (error.message.includes("not found")) {
|
|
13403
|
+
console.error(chalk65.red(`\u2717 Connector "${type}" is not connected`));
|
|
13404
|
+
} else if (error.message.includes("Not authenticated")) {
|
|
13405
|
+
console.error(chalk65.red("\u2717 Not authenticated. Run: vm0 auth login"));
|
|
13406
|
+
} else {
|
|
13407
|
+
console.error(chalk65.red(`\u2717 ${error.message}`));
|
|
13408
|
+
}
|
|
13409
|
+
} else {
|
|
13410
|
+
console.error(chalk65.red("\u2717 An unexpected error occurred"));
|
|
13411
|
+
}
|
|
13412
|
+
process.exit(1);
|
|
13413
|
+
}
|
|
13414
|
+
});
|
|
13415
|
+
|
|
13211
13416
|
// src/commands/connector/index.ts
|
|
13212
|
-
var connectorCommand = new
|
|
13417
|
+
var connectorCommand = new Command70().name("connector").description("Manage third-party service connections").addCommand(listCommand9).addCommand(statusCommand7).addCommand(connectCommand).addCommand(disconnectCommand);
|
|
13213
13418
|
|
|
13214
13419
|
// src/commands/onboard/index.ts
|
|
13215
|
-
import { Command as
|
|
13216
|
-
import
|
|
13420
|
+
import { Command as Command71 } from "commander";
|
|
13421
|
+
import chalk69 from "chalk";
|
|
13217
13422
|
import { mkdir as mkdir8 } from "fs/promises";
|
|
13218
13423
|
import { existsSync as existsSync11 } from "fs";
|
|
13219
13424
|
|
|
13220
13425
|
// src/lib/ui/welcome-box.ts
|
|
13221
|
-
import
|
|
13426
|
+
import chalk66 from "chalk";
|
|
13222
13427
|
var gradientColors = [
|
|
13223
|
-
|
|
13428
|
+
chalk66.hex("#FFAB5E"),
|
|
13224
13429
|
// Line 1 - lightest
|
|
13225
|
-
|
|
13430
|
+
chalk66.hex("#FF9642"),
|
|
13226
13431
|
// Line 2
|
|
13227
|
-
|
|
13432
|
+
chalk66.hex("#FF8228"),
|
|
13228
13433
|
// Line 3
|
|
13229
|
-
|
|
13434
|
+
chalk66.hex("#FF6D0A"),
|
|
13230
13435
|
// Line 4
|
|
13231
|
-
|
|
13436
|
+
chalk66.hex("#E85D00"),
|
|
13232
13437
|
// Line 5
|
|
13233
|
-
|
|
13438
|
+
chalk66.hex("#CC4E00")
|
|
13234
13439
|
// Line 6 - darkest
|
|
13235
13440
|
];
|
|
13236
13441
|
var vm0LogoLines = [
|
|
@@ -13252,15 +13457,15 @@ function renderVm0Banner() {
|
|
|
13252
13457
|
function renderOnboardWelcome() {
|
|
13253
13458
|
renderVm0Banner();
|
|
13254
13459
|
console.log(` Build agentic workflows using natural language.`);
|
|
13255
|
-
console.log(` ${
|
|
13460
|
+
console.log(` ${chalk66.dim("Currently in beta, enjoy it free.")}`);
|
|
13256
13461
|
console.log(
|
|
13257
|
-
` ${
|
|
13462
|
+
` ${chalk66.dim("Star us on GitHub: https://github.com/vm0-ai/vm0")}`
|
|
13258
13463
|
);
|
|
13259
13464
|
console.log();
|
|
13260
13465
|
}
|
|
13261
13466
|
|
|
13262
13467
|
// src/lib/ui/step-runner.ts
|
|
13263
|
-
import
|
|
13468
|
+
import chalk67 from "chalk";
|
|
13264
13469
|
function createStepRunner(options = true) {
|
|
13265
13470
|
const opts = typeof options === "boolean" ? { interactive: options } : options;
|
|
13266
13471
|
const interactive = opts.interactive ?? true;
|
|
@@ -13275,25 +13480,25 @@ function createStepRunner(options = true) {
|
|
|
13275
13480
|
}
|
|
13276
13481
|
for (const [i, step] of completedSteps.entries()) {
|
|
13277
13482
|
if (step.failed) {
|
|
13278
|
-
console.log(
|
|
13483
|
+
console.log(chalk67.red(`\u2717 ${step.label}`));
|
|
13279
13484
|
} else {
|
|
13280
|
-
console.log(
|
|
13485
|
+
console.log(chalk67.green(`\u25CF ${step.label}`));
|
|
13281
13486
|
}
|
|
13282
13487
|
const isLastStep = i === completedSteps.length - 1;
|
|
13283
13488
|
if (!isLastStep || !isFinal) {
|
|
13284
|
-
console.log(
|
|
13489
|
+
console.log(chalk67.dim("\u2502"));
|
|
13285
13490
|
}
|
|
13286
13491
|
}
|
|
13287
13492
|
}
|
|
13288
13493
|
async function executeStep(label, fn, isFinal) {
|
|
13289
13494
|
let stepFailed = false;
|
|
13290
|
-
console.log(
|
|
13495
|
+
console.log(chalk67.yellow(`\u25CB ${label}`));
|
|
13291
13496
|
const ctx = {
|
|
13292
13497
|
connector() {
|
|
13293
|
-
console.log(
|
|
13498
|
+
console.log(chalk67.dim("\u2502"));
|
|
13294
13499
|
},
|
|
13295
13500
|
detail(message) {
|
|
13296
|
-
console.log(`${
|
|
13501
|
+
console.log(`${chalk67.dim("\u2502")} ${message}`);
|
|
13297
13502
|
},
|
|
13298
13503
|
async prompt(promptFn) {
|
|
13299
13504
|
return await promptFn();
|
|
@@ -13310,12 +13515,12 @@ function createStepRunner(options = true) {
|
|
|
13310
13515
|
redrawCompletedSteps(isFinal);
|
|
13311
13516
|
} else {
|
|
13312
13517
|
if (stepFailed) {
|
|
13313
|
-
console.log(
|
|
13518
|
+
console.log(chalk67.red(`\u2717 ${label}`));
|
|
13314
13519
|
} else {
|
|
13315
|
-
console.log(
|
|
13520
|
+
console.log(chalk67.green(`\u25CF ${label}`));
|
|
13316
13521
|
}
|
|
13317
13522
|
if (!isFinal) {
|
|
13318
|
-
console.log(
|
|
13523
|
+
console.log(chalk67.dim("\u2502"));
|
|
13319
13524
|
}
|
|
13320
13525
|
}
|
|
13321
13526
|
}
|
|
@@ -13472,7 +13677,7 @@ async function setupModelProvider(type, secret, options) {
|
|
|
13472
13677
|
|
|
13473
13678
|
// src/lib/domain/onboard/claude-setup.ts
|
|
13474
13679
|
import { spawn as spawn3 } from "child_process";
|
|
13475
|
-
import
|
|
13680
|
+
import chalk68 from "chalk";
|
|
13476
13681
|
var MARKETPLACE_NAME = "vm0-skills";
|
|
13477
13682
|
var MARKETPLACE_REPO = "vm0-ai/vm0-skills";
|
|
13478
13683
|
var PLUGIN_ID = "vm0@vm0-skills";
|
|
@@ -13509,12 +13714,12 @@ async function runClaudeCommand(args, cwd) {
|
|
|
13509
13714
|
}
|
|
13510
13715
|
function handlePluginError(error, context) {
|
|
13511
13716
|
const displayContext = context ?? "Claude plugin";
|
|
13512
|
-
console.error(
|
|
13717
|
+
console.error(chalk68.red(`Failed to install ${displayContext}`));
|
|
13513
13718
|
if (error instanceof Error) {
|
|
13514
|
-
console.error(
|
|
13719
|
+
console.error(chalk68.red(error.message));
|
|
13515
13720
|
}
|
|
13516
13721
|
console.error(
|
|
13517
|
-
|
|
13722
|
+
chalk68.dim("Please ensure Claude CLI is installed and accessible.")
|
|
13518
13723
|
);
|
|
13519
13724
|
process.exit(1);
|
|
13520
13725
|
}
|
|
@@ -13557,7 +13762,7 @@ async function updateMarketplace() {
|
|
|
13557
13762
|
]);
|
|
13558
13763
|
if (!result.success) {
|
|
13559
13764
|
console.warn(
|
|
13560
|
-
|
|
13765
|
+
chalk68.yellow(
|
|
13561
13766
|
`Warning: Could not update marketplace: ${result.error ?? "unknown error"}`
|
|
13562
13767
|
)
|
|
13563
13768
|
);
|
|
@@ -13595,7 +13800,7 @@ async function handleAuthentication(ctx) {
|
|
|
13595
13800
|
return;
|
|
13596
13801
|
}
|
|
13597
13802
|
if (!ctx.interactive) {
|
|
13598
|
-
console.error(
|
|
13803
|
+
console.error(chalk69.red("Error: Not authenticated"));
|
|
13599
13804
|
console.error("Run 'vm0 auth login' first or set VM0_TOKEN");
|
|
13600
13805
|
process.exit(1);
|
|
13601
13806
|
}
|
|
@@ -13603,16 +13808,16 @@ async function handleAuthentication(ctx) {
|
|
|
13603
13808
|
onInitiating: () => {
|
|
13604
13809
|
},
|
|
13605
13810
|
onDeviceCodeReady: (url, code, expiresIn) => {
|
|
13606
|
-
step.detail(`Copy code: ${
|
|
13607
|
-
step.detail(`Open: ${
|
|
13608
|
-
step.detail(
|
|
13811
|
+
step.detail(`Copy code: ${chalk69.cyan.bold(code)}`);
|
|
13812
|
+
step.detail(`Open: ${chalk69.cyan(url)}`);
|
|
13813
|
+
step.detail(chalk69.dim(`Expires in ${expiresIn} minutes`));
|
|
13609
13814
|
},
|
|
13610
13815
|
onPolling: () => {
|
|
13611
13816
|
},
|
|
13612
13817
|
onSuccess: () => {
|
|
13613
13818
|
},
|
|
13614
13819
|
onError: (error) => {
|
|
13615
|
-
console.error(
|
|
13820
|
+
console.error(chalk69.red(`
|
|
13616
13821
|
${error.message}`));
|
|
13617
13822
|
process.exit(1);
|
|
13618
13823
|
}
|
|
@@ -13626,7 +13831,7 @@ async function handleModelProvider(ctx) {
|
|
|
13626
13831
|
return;
|
|
13627
13832
|
}
|
|
13628
13833
|
if (!ctx.interactive) {
|
|
13629
|
-
console.error(
|
|
13834
|
+
console.error(chalk69.red("Error: No model provider configured"));
|
|
13630
13835
|
console.error("Run 'vm0 model-provider setup' first");
|
|
13631
13836
|
process.exit(1);
|
|
13632
13837
|
}
|
|
@@ -13647,14 +13852,14 @@ async function handleModelProvider(ctx) {
|
|
|
13647
13852
|
const selectedChoice = choices.find((c25) => c25.type === providerType);
|
|
13648
13853
|
if (selectedChoice?.helpText) {
|
|
13649
13854
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
13650
|
-
step.detail(
|
|
13855
|
+
step.detail(chalk69.dim(line));
|
|
13651
13856
|
}
|
|
13652
13857
|
}
|
|
13653
13858
|
const secret = await step.prompt(
|
|
13654
13859
|
() => promptPassword(`Enter your ${selectedChoice?.secretLabel ?? "secret"}:`)
|
|
13655
13860
|
);
|
|
13656
13861
|
if (!secret) {
|
|
13657
|
-
console.log(
|
|
13862
|
+
console.log(chalk69.dim("Cancelled"));
|
|
13658
13863
|
process.exit(0);
|
|
13659
13864
|
}
|
|
13660
13865
|
let selectedModel;
|
|
@@ -13673,7 +13878,7 @@ async function handleModelProvider(ctx) {
|
|
|
13673
13878
|
() => promptSelect("Select model:", modelChoices)
|
|
13674
13879
|
);
|
|
13675
13880
|
if (modelSelection === void 0) {
|
|
13676
|
-
console.log(
|
|
13881
|
+
console.log(chalk69.dim("Cancelled"));
|
|
13677
13882
|
process.exit(0);
|
|
13678
13883
|
}
|
|
13679
13884
|
selectedModel = modelSelection === "" ? void 0 : modelSelection;
|
|
@@ -13683,7 +13888,7 @@ async function handleModelProvider(ctx) {
|
|
|
13683
13888
|
});
|
|
13684
13889
|
const modelNote = result.provider.selectedModel ? ` with model: ${result.provider.selectedModel}` : "";
|
|
13685
13890
|
step.detail(
|
|
13686
|
-
|
|
13891
|
+
chalk69.green(
|
|
13687
13892
|
`${providerType} ${result.created ? "created" : "updated"}${result.isDefault ? ` (default for ${result.framework})` : ""}${modelNote}`
|
|
13688
13893
|
)
|
|
13689
13894
|
);
|
|
@@ -13714,7 +13919,7 @@ async function handleAgentCreation(ctx) {
|
|
|
13714
13919
|
agentName = inputName;
|
|
13715
13920
|
if (existsSync11(agentName)) {
|
|
13716
13921
|
step.detail(
|
|
13717
|
-
|
|
13922
|
+
chalk69.yellow(`${agentName}/ already exists, choose another name`)
|
|
13718
13923
|
);
|
|
13719
13924
|
} else {
|
|
13720
13925
|
folderExists = false;
|
|
@@ -13723,22 +13928,22 @@ async function handleAgentCreation(ctx) {
|
|
|
13723
13928
|
} else {
|
|
13724
13929
|
if (!validateAgentName(agentName)) {
|
|
13725
13930
|
console.error(
|
|
13726
|
-
|
|
13931
|
+
chalk69.red(
|
|
13727
13932
|
"Invalid agent name: must be 3-64 chars, alphanumeric + hyphens"
|
|
13728
13933
|
)
|
|
13729
13934
|
);
|
|
13730
13935
|
process.exit(1);
|
|
13731
13936
|
}
|
|
13732
13937
|
if (existsSync11(agentName)) {
|
|
13733
|
-
console.error(
|
|
13938
|
+
console.error(chalk69.red(`${agentName}/ already exists`));
|
|
13734
13939
|
console.log();
|
|
13735
13940
|
console.log("Remove it first or choose a different name:");
|
|
13736
|
-
console.log(
|
|
13941
|
+
console.log(chalk69.cyan(` rm -rf ${agentName}`));
|
|
13737
13942
|
process.exit(1);
|
|
13738
13943
|
}
|
|
13739
13944
|
}
|
|
13740
13945
|
await mkdir8(agentName, { recursive: true });
|
|
13741
|
-
step.detail(
|
|
13946
|
+
step.detail(chalk69.green(`Created ${agentName}/`));
|
|
13742
13947
|
});
|
|
13743
13948
|
return agentName;
|
|
13744
13949
|
}
|
|
@@ -13754,7 +13959,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13754
13959
|
shouldInstall = confirmed ?? true;
|
|
13755
13960
|
}
|
|
13756
13961
|
if (!shouldInstall) {
|
|
13757
|
-
step.detail(
|
|
13962
|
+
step.detail(chalk69.dim("Skipped"));
|
|
13758
13963
|
return;
|
|
13759
13964
|
}
|
|
13760
13965
|
const scope = "project";
|
|
@@ -13762,7 +13967,7 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13762
13967
|
const agentDir = `${process.cwd()}/${agentName}`;
|
|
13763
13968
|
const result = await installVm0Plugin(scope, agentDir);
|
|
13764
13969
|
step.detail(
|
|
13765
|
-
|
|
13970
|
+
chalk69.green(`Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
13766
13971
|
);
|
|
13767
13972
|
pluginInstalled = true;
|
|
13768
13973
|
} catch (error) {
|
|
@@ -13773,18 +13978,18 @@ async function handlePluginInstallation(ctx, agentName) {
|
|
|
13773
13978
|
}
|
|
13774
13979
|
function printNextSteps(agentName, pluginInstalled) {
|
|
13775
13980
|
console.log();
|
|
13776
|
-
console.log(
|
|
13981
|
+
console.log(chalk69.bold("Next step:"));
|
|
13777
13982
|
console.log();
|
|
13778
13983
|
if (pluginInstalled) {
|
|
13779
13984
|
console.log(
|
|
13780
|
-
` ${
|
|
13985
|
+
` ${chalk69.cyan(`cd ${agentName} && claude "/${PRIMARY_SKILL_NAME} let's build an agent"`)}`
|
|
13781
13986
|
);
|
|
13782
13987
|
} else {
|
|
13783
|
-
console.log(` ${
|
|
13988
|
+
console.log(` ${chalk69.cyan(`cd ${agentName} && vm0 init`)}`);
|
|
13784
13989
|
}
|
|
13785
13990
|
console.log();
|
|
13786
13991
|
}
|
|
13787
|
-
var onboardCommand = new
|
|
13992
|
+
var onboardCommand = new Command71().name("onboard").description("Guided setup for new VM0 users").option("-y, --yes", "Skip confirmation prompts").option("--name <name>", `Agent name (default: ${DEFAULT_AGENT_NAME})`).action(async (options) => {
|
|
13788
13993
|
const interactive = isInteractive();
|
|
13789
13994
|
if (interactive) {
|
|
13790
13995
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
@@ -13807,15 +14012,15 @@ var onboardCommand = new Command68().name("onboard").description("Guided setup f
|
|
|
13807
14012
|
});
|
|
13808
14013
|
|
|
13809
14014
|
// src/commands/setup-claude/index.ts
|
|
13810
|
-
import { Command as
|
|
13811
|
-
import
|
|
13812
|
-
var setupClaudeCommand = new
|
|
13813
|
-
console.log(
|
|
14015
|
+
import { Command as Command72 } from "commander";
|
|
14016
|
+
import chalk70 from "chalk";
|
|
14017
|
+
var setupClaudeCommand = new Command72().name("setup-claude").description("Install VM0 Claude Plugin").option("--agent-dir <dir>", "Agent directory to run install in").option("--scope <scope>", "Installation scope (user or project)", "project").action(async (options) => {
|
|
14018
|
+
console.log(chalk70.dim("Installing VM0 Claude Plugin..."));
|
|
13814
14019
|
const scope = options.scope === "user" ? "user" : "project";
|
|
13815
14020
|
try {
|
|
13816
14021
|
const result = await installVm0Plugin(scope, options.agentDir);
|
|
13817
14022
|
console.log(
|
|
13818
|
-
|
|
14023
|
+
chalk70.green(`\u2713 Installed ${result.pluginId} (scope: ${result.scope})`)
|
|
13819
14024
|
);
|
|
13820
14025
|
} catch (error) {
|
|
13821
14026
|
handlePluginError(error);
|
|
@@ -13824,19 +14029,19 @@ var setupClaudeCommand = new Command69().name("setup-claude").description("Insta
|
|
|
13824
14029
|
console.log("Next step:");
|
|
13825
14030
|
const cdPrefix = options.agentDir ? `cd ${options.agentDir} && ` : "";
|
|
13826
14031
|
console.log(
|
|
13827
|
-
|
|
14032
|
+
chalk70.cyan(
|
|
13828
14033
|
` ${cdPrefix}claude "/${PRIMARY_SKILL_NAME} let's build a workflow"`
|
|
13829
14034
|
)
|
|
13830
14035
|
);
|
|
13831
14036
|
});
|
|
13832
14037
|
|
|
13833
14038
|
// src/commands/dev-tool/index.ts
|
|
13834
|
-
import { Command as
|
|
14039
|
+
import { Command as Command74 } from "commander";
|
|
13835
14040
|
|
|
13836
14041
|
// src/commands/dev-tool/compose.ts
|
|
13837
|
-
import { Command as
|
|
13838
|
-
import
|
|
13839
|
-
import { initClient as
|
|
14042
|
+
import { Command as Command73 } from "commander";
|
|
14043
|
+
import chalk71 from "chalk";
|
|
14044
|
+
import { initClient as initClient13 } from "@ts-rest/core";
|
|
13840
14045
|
function sleep2(ms) {
|
|
13841
14046
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
13842
14047
|
}
|
|
@@ -13845,7 +14050,7 @@ function timestamp() {
|
|
|
13845
14050
|
}
|
|
13846
14051
|
async function createComposeJob(githubUrl, overwrite) {
|
|
13847
14052
|
const config = await getClientConfig();
|
|
13848
|
-
const client =
|
|
14053
|
+
const client = initClient13(composeJobsMainContract, config);
|
|
13849
14054
|
const result = await client.create({
|
|
13850
14055
|
body: { githubUrl, overwrite }
|
|
13851
14056
|
});
|
|
@@ -13862,7 +14067,7 @@ async function createComposeJob(githubUrl, overwrite) {
|
|
|
13862
14067
|
}
|
|
13863
14068
|
async function getComposeJobStatus(jobId) {
|
|
13864
14069
|
const config = await getClientConfig();
|
|
13865
|
-
const client =
|
|
14070
|
+
const client = initClient13(composeJobsByIdContract, config);
|
|
13866
14071
|
const result = await client.getById({
|
|
13867
14072
|
params: { jobId }
|
|
13868
14073
|
});
|
|
@@ -13887,7 +14092,7 @@ async function pollUntilComplete(jobId, intervalMs, timeoutMs, jsonMode) {
|
|
|
13887
14092
|
const job = await getComposeJobStatus(jobId);
|
|
13888
14093
|
if (!jsonMode) {
|
|
13889
14094
|
console.log(
|
|
13890
|
-
|
|
14095
|
+
chalk71.dim(`[${timestamp()}] Polling... status=${job.status}`)
|
|
13891
14096
|
);
|
|
13892
14097
|
}
|
|
13893
14098
|
if (job.status === "completed" || job.status === "failed") {
|
|
@@ -13897,7 +14102,7 @@ async function pollUntilComplete(jobId, intervalMs, timeoutMs, jsonMode) {
|
|
|
13897
14102
|
}
|
|
13898
14103
|
throw new Error(`Timeout after ${timeoutMs / 1e3} seconds`);
|
|
13899
14104
|
}
|
|
13900
|
-
var composeCommand2 = new
|
|
14105
|
+
var composeCommand2 = new Command73().name("compose").description("Test server-side GitHub compose API").argument("<github-url>", "GitHub URL to compose from").option("--overwrite", "Overwrite existing compose", false).option(
|
|
13901
14106
|
"--interval <seconds>",
|
|
13902
14107
|
"Polling interval in seconds",
|
|
13903
14108
|
(v) => parseInt(v, 10),
|
|
@@ -13920,7 +14125,7 @@ var composeCommand2 = new Command70().name("compose").description("Test server-s
|
|
|
13920
14125
|
options.overwrite
|
|
13921
14126
|
);
|
|
13922
14127
|
if (!options.json) {
|
|
13923
|
-
console.log(`Job ID: ${
|
|
14128
|
+
console.log(`Job ID: ${chalk71.cyan(jobId)}`);
|
|
13924
14129
|
console.log();
|
|
13925
14130
|
}
|
|
13926
14131
|
if (initialStatus === "completed" || initialStatus === "failed") {
|
|
@@ -13954,7 +14159,7 @@ var composeCommand2 = new Command70().name("compose").description("Test server-s
|
|
|
13954
14159
|
);
|
|
13955
14160
|
} else {
|
|
13956
14161
|
console.error(
|
|
13957
|
-
|
|
14162
|
+
chalk71.red(
|
|
13958
14163
|
`\u2717 ${error instanceof Error ? error.message : String(error)}`
|
|
13959
14164
|
)
|
|
13960
14165
|
);
|
|
@@ -13965,21 +14170,21 @@ var composeCommand2 = new Command70().name("compose").description("Test server-s
|
|
|
13965
14170
|
);
|
|
13966
14171
|
function displayResult(job) {
|
|
13967
14172
|
if (job.status === "completed" && job.result) {
|
|
13968
|
-
console.log(
|
|
13969
|
-
console.log(` Compose ID: ${
|
|
13970
|
-
console.log(` Name: ${
|
|
13971
|
-
console.log(` Version: ${
|
|
14173
|
+
console.log(chalk71.green("\u2713 Compose completed!"));
|
|
14174
|
+
console.log(` Compose ID: ${chalk71.cyan(job.result.composeId)}`);
|
|
14175
|
+
console.log(` Name: ${chalk71.cyan(job.result.composeName)}`);
|
|
14176
|
+
console.log(` Version: ${chalk71.cyan(job.result.versionId.slice(0, 8))}`);
|
|
13972
14177
|
if (job.result.warnings.length > 0) {
|
|
13973
14178
|
console.log();
|
|
13974
|
-
console.log(
|
|
14179
|
+
console.log(chalk71.yellow(" Warnings:"));
|
|
13975
14180
|
for (const warning of job.result.warnings) {
|
|
13976
|
-
console.log(
|
|
14181
|
+
console.log(chalk71.yellow(` - ${warning}`));
|
|
13977
14182
|
}
|
|
13978
14183
|
}
|
|
13979
14184
|
} else if (job.status === "failed") {
|
|
13980
|
-
console.log(
|
|
14185
|
+
console.log(chalk71.red("\u2717 Compose failed!"));
|
|
13981
14186
|
if (job.error) {
|
|
13982
|
-
console.log(` Error: ${
|
|
14187
|
+
console.log(` Error: ${chalk71.red(job.error)}`);
|
|
13983
14188
|
}
|
|
13984
14189
|
} else {
|
|
13985
14190
|
console.log(`Status: ${job.status}`);
|
|
@@ -13987,11 +14192,11 @@ function displayResult(job) {
|
|
|
13987
14192
|
}
|
|
13988
14193
|
|
|
13989
14194
|
// src/commands/dev-tool/index.ts
|
|
13990
|
-
var devToolCommand = new
|
|
14195
|
+
var devToolCommand = new Command74().name("dev-tool").description("Developer tools for testing and debugging").addCommand(composeCommand2);
|
|
13991
14196
|
|
|
13992
14197
|
// src/index.ts
|
|
13993
|
-
var program = new
|
|
13994
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
14198
|
+
var program = new Command75();
|
|
14199
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.25.0");
|
|
13995
14200
|
program.addCommand(authCommand);
|
|
13996
14201
|
program.addCommand(infoCommand);
|
|
13997
14202
|
program.addCommand(composeCommand);
|