@vm0/cli 9.70.0 → 9.70.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 +128 -32
- 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.70.
|
|
48
|
+
release: "9.70.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.70.
|
|
67
|
+
version: "9.70.1",
|
|
68
68
|
command: process.argv.slice(2).join(" ")
|
|
69
69
|
});
|
|
70
70
|
Sentry.setContext("runtime", {
|
|
@@ -675,7 +675,7 @@ function getConfigPath() {
|
|
|
675
675
|
return join2(homedir2(), ".vm0", "config.json");
|
|
676
676
|
}
|
|
677
677
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
678
|
-
console.log(chalk4.bold(`VM0 CLI v${"9.70.
|
|
678
|
+
console.log(chalk4.bold(`VM0 CLI v${"9.70.1"}`));
|
|
679
679
|
console.log();
|
|
680
680
|
const config = await loadConfig();
|
|
681
681
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -3371,6 +3371,7 @@ var storedChatMessageSchema2 = z18.object({
|
|
|
3371
3371
|
role: z18.enum(["user", "assistant"]),
|
|
3372
3372
|
content: z18.string(),
|
|
3373
3373
|
runId: z18.string().optional(),
|
|
3374
|
+
error: z18.string().optional(),
|
|
3374
3375
|
createdAt: z18.string()
|
|
3375
3376
|
});
|
|
3376
3377
|
var unsavedRunSchema = z18.object({
|
|
@@ -4420,12 +4421,46 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
4420
4421
|
authorizationUrl: "https://slack.com/oauth/v2/authorize",
|
|
4421
4422
|
tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
4422
4423
|
scopes: [
|
|
4424
|
+
// Channels
|
|
4423
4425
|
"channels:read",
|
|
4424
4426
|
"channels:history",
|
|
4427
|
+
// Messaging
|
|
4425
4428
|
"chat:write",
|
|
4429
|
+
// Users
|
|
4426
4430
|
"users:read",
|
|
4427
4431
|
"users:read.email",
|
|
4428
|
-
|
|
4432
|
+
// Files
|
|
4433
|
+
"files:read",
|
|
4434
|
+
"files:write",
|
|
4435
|
+
// Direct messages (high priority)
|
|
4436
|
+
"im:history",
|
|
4437
|
+
"im:write",
|
|
4438
|
+
// Reactions (high priority)
|
|
4439
|
+
"reactions:read",
|
|
4440
|
+
"reactions:write",
|
|
4441
|
+
// Search (high priority)
|
|
4442
|
+
"search:read",
|
|
4443
|
+
// Private channels (high priority)
|
|
4444
|
+
"groups:read",
|
|
4445
|
+
"groups:history",
|
|
4446
|
+
// Reminders (medium priority)
|
|
4447
|
+
"reminders:read",
|
|
4448
|
+
"reminders:write",
|
|
4449
|
+
// Pins (medium priority)
|
|
4450
|
+
"pins:read",
|
|
4451
|
+
"pins:write",
|
|
4452
|
+
// User groups (medium priority)
|
|
4453
|
+
"usergroups:read",
|
|
4454
|
+
// Multi-person DMs (medium priority)
|
|
4455
|
+
"mpim:history",
|
|
4456
|
+
// Do Not Disturb (low priority)
|
|
4457
|
+
"dnd:read",
|
|
4458
|
+
// Bookmarks (low priority)
|
|
4459
|
+
"bookmarks:read",
|
|
4460
|
+
// Team info (low priority)
|
|
4461
|
+
"team:read",
|
|
4462
|
+
// Custom emoji (low priority)
|
|
4463
|
+
"emoji:read"
|
|
4429
4464
|
],
|
|
4430
4465
|
environmentMapping: {
|
|
4431
4466
|
SLACK_TOKEN: "$secrets.SLACK_ACCESS_TOKEN"
|
|
@@ -7904,6 +7939,67 @@ var zeroAgentInstructionsContract = c26.router({
|
|
|
7904
7939
|
}
|
|
7905
7940
|
});
|
|
7906
7941
|
|
|
7942
|
+
// ../../packages/core/src/contracts/zero-connectors.ts
|
|
7943
|
+
import { z as z31 } from "zod";
|
|
7944
|
+
var c27 = initContract();
|
|
7945
|
+
var zeroConnectorsMainContract = c27.router({
|
|
7946
|
+
list: {
|
|
7947
|
+
method: "GET",
|
|
7948
|
+
path: "/api/zero/connectors",
|
|
7949
|
+
headers: authHeadersSchema,
|
|
7950
|
+
responses: {
|
|
7951
|
+
200: connectorListResponseSchema,
|
|
7952
|
+
401: apiErrorSchema,
|
|
7953
|
+
500: apiErrorSchema
|
|
7954
|
+
},
|
|
7955
|
+
summary: "List all connectors (zero proxy)"
|
|
7956
|
+
}
|
|
7957
|
+
});
|
|
7958
|
+
var zeroConnectorsByTypeContract = c27.router({
|
|
7959
|
+
delete: {
|
|
7960
|
+
method: "DELETE",
|
|
7961
|
+
path: "/api/zero/connectors/:type",
|
|
7962
|
+
headers: authHeadersSchema,
|
|
7963
|
+
pathParams: z31.object({ type: connectorTypeSchema }),
|
|
7964
|
+
responses: {
|
|
7965
|
+
204: c27.noBody(),
|
|
7966
|
+
401: apiErrorSchema,
|
|
7967
|
+
404: apiErrorSchema
|
|
7968
|
+
},
|
|
7969
|
+
summary: "Disconnect a connector (zero proxy)"
|
|
7970
|
+
}
|
|
7971
|
+
});
|
|
7972
|
+
var zeroConnectorScopeDiffContract = c27.router({
|
|
7973
|
+
getScopeDiff: {
|
|
7974
|
+
method: "GET",
|
|
7975
|
+
path: "/api/zero/connectors/:type/scope-diff",
|
|
7976
|
+
headers: authHeadersSchema,
|
|
7977
|
+
pathParams: z31.object({ type: connectorTypeSchema }),
|
|
7978
|
+
responses: {
|
|
7979
|
+
200: scopeDiffResponseSchema,
|
|
7980
|
+
401: apiErrorSchema,
|
|
7981
|
+
404: apiErrorSchema
|
|
7982
|
+
},
|
|
7983
|
+
summary: "Get scope diff for a connector"
|
|
7984
|
+
}
|
|
7985
|
+
});
|
|
7986
|
+
|
|
7987
|
+
// ../../packages/core/src/contracts/zero-org.ts
|
|
7988
|
+
var c28 = initContract();
|
|
7989
|
+
var zeroOrgContract = c28.router({
|
|
7990
|
+
get: {
|
|
7991
|
+
method: "GET",
|
|
7992
|
+
path: "/api/zero/org",
|
|
7993
|
+
headers: authHeadersSchema,
|
|
7994
|
+
responses: {
|
|
7995
|
+
200: orgResponseSchema,
|
|
7996
|
+
401: apiErrorSchema,
|
|
7997
|
+
404: apiErrorSchema
|
|
7998
|
+
},
|
|
7999
|
+
summary: "Get current org (zero proxy)"
|
|
8000
|
+
}
|
|
8001
|
+
});
|
|
8002
|
+
|
|
7907
8003
|
// ../../packages/core/src/storage-names.ts
|
|
7908
8004
|
function getInstructionsStorageName(agentName) {
|
|
7909
8005
|
return `agent-instructions@${agentName}`;
|
|
@@ -8955,8 +9051,8 @@ async function resolveSkills(skillUrls) {
|
|
|
8955
9051
|
}
|
|
8956
9052
|
|
|
8957
9053
|
// src/lib/domain/yaml-validator.ts
|
|
8958
|
-
import { z as
|
|
8959
|
-
var cliAgentNameSchema =
|
|
9054
|
+
import { z as z32 } from "zod";
|
|
9055
|
+
var cliAgentNameSchema = z32.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
8960
9056
|
/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
|
|
8961
9057
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
8962
9058
|
);
|
|
@@ -8970,7 +9066,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8970
9066
|
resolveSkillRef(skillRef);
|
|
8971
9067
|
} catch (error) {
|
|
8972
9068
|
ctx.addIssue({
|
|
8973
|
-
code:
|
|
9069
|
+
code: z32.ZodIssueCode.custom,
|
|
8974
9070
|
message: error instanceof Error ? error.message : `Invalid skill reference: ${skillRef}`,
|
|
8975
9071
|
path: ["skills", i]
|
|
8976
9072
|
});
|
|
@@ -8980,15 +9076,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
|
|
|
8980
9076
|
}
|
|
8981
9077
|
}
|
|
8982
9078
|
);
|
|
8983
|
-
var cliComposeSchema =
|
|
8984
|
-
version:
|
|
8985
|
-
agents:
|
|
8986
|
-
volumes:
|
|
9079
|
+
var cliComposeSchema = z32.object({
|
|
9080
|
+
version: z32.string().min(1, "Missing config.version"),
|
|
9081
|
+
agents: z32.record(cliAgentNameSchema, cliAgentDefinitionSchema),
|
|
9082
|
+
volumes: z32.record(z32.string(), volumeConfigSchema).optional()
|
|
8987
9083
|
}).superRefine((config, ctx) => {
|
|
8988
9084
|
const agentKeys = Object.keys(config.agents);
|
|
8989
9085
|
if (agentKeys.length === 0) {
|
|
8990
9086
|
ctx.addIssue({
|
|
8991
|
-
code:
|
|
9087
|
+
code: z32.ZodIssueCode.custom,
|
|
8992
9088
|
message: "agents must have at least one agent defined",
|
|
8993
9089
|
path: ["agents"]
|
|
8994
9090
|
});
|
|
@@ -8996,7 +9092,7 @@ var cliComposeSchema = z31.object({
|
|
|
8996
9092
|
}
|
|
8997
9093
|
if (agentKeys.length > 1) {
|
|
8998
9094
|
ctx.addIssue({
|
|
8999
|
-
code:
|
|
9095
|
+
code: z32.ZodIssueCode.custom,
|
|
9000
9096
|
message: "Multiple agents not supported yet. Only one agent allowed.",
|
|
9001
9097
|
path: ["agents"]
|
|
9002
9098
|
});
|
|
@@ -9008,7 +9104,7 @@ var cliComposeSchema = z31.object({
|
|
|
9008
9104
|
if (agentVolumes && agentVolumes.length > 0) {
|
|
9009
9105
|
if (!config.volumes) {
|
|
9010
9106
|
ctx.addIssue({
|
|
9011
|
-
code:
|
|
9107
|
+
code: z32.ZodIssueCode.custom,
|
|
9012
9108
|
message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
|
|
9013
9109
|
path: ["volumes"]
|
|
9014
9110
|
});
|
|
@@ -9018,7 +9114,7 @@ var cliComposeSchema = z31.object({
|
|
|
9018
9114
|
const parts = volDeclaration.split(":");
|
|
9019
9115
|
if (parts.length !== 2) {
|
|
9020
9116
|
ctx.addIssue({
|
|
9021
|
-
code:
|
|
9117
|
+
code: z32.ZodIssueCode.custom,
|
|
9022
9118
|
message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
|
|
9023
9119
|
path: ["agents", agentName, "volumes"]
|
|
9024
9120
|
});
|
|
@@ -9027,7 +9123,7 @@ var cliComposeSchema = z31.object({
|
|
|
9027
9123
|
const volumeKey = parts[0].trim();
|
|
9028
9124
|
if (!config.volumes[volumeKey]) {
|
|
9029
9125
|
ctx.addIssue({
|
|
9030
|
-
code:
|
|
9126
|
+
code: z32.ZodIssueCode.custom,
|
|
9031
9127
|
message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
|
|
9032
9128
|
path: ["volumes", volumeKey]
|
|
9033
9129
|
});
|
|
@@ -10226,7 +10322,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
10226
10322
|
options.autoUpdate = false;
|
|
10227
10323
|
}
|
|
10228
10324
|
if (options.autoUpdate !== false) {
|
|
10229
|
-
await startSilentUpgrade("9.70.
|
|
10325
|
+
await startSilentUpgrade("9.70.1");
|
|
10230
10326
|
}
|
|
10231
10327
|
try {
|
|
10232
10328
|
let result;
|
|
@@ -11051,7 +11147,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
11051
11147
|
withErrorHandler(
|
|
11052
11148
|
async (identifier, prompt, options) => {
|
|
11053
11149
|
if (options.autoUpdate !== false) {
|
|
11054
|
-
await startSilentUpgrade("9.70.
|
|
11150
|
+
await startSilentUpgrade("9.70.1");
|
|
11055
11151
|
}
|
|
11056
11152
|
const { org, name, version } = parseIdentifier(identifier);
|
|
11057
11153
|
let composeId;
|
|
@@ -12789,7 +12885,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
12789
12885
|
withErrorHandler(
|
|
12790
12886
|
async (prompt, options) => {
|
|
12791
12887
|
if (options.autoUpdate !== false) {
|
|
12792
|
-
const shouldExit = await checkAndUpgrade("9.70.
|
|
12888
|
+
const shouldExit = await checkAndUpgrade("9.70.1", prompt);
|
|
12793
12889
|
if (shouldExit) {
|
|
12794
12890
|
process.exit(0);
|
|
12795
12891
|
}
|
|
@@ -15141,7 +15237,7 @@ var listCommand9 = new Command65().name("list").alias("ls").description("List al
|
|
|
15141
15237
|
);
|
|
15142
15238
|
return;
|
|
15143
15239
|
}
|
|
15144
|
-
const nameWidth = Math.max(4, ...data.composes.map((
|
|
15240
|
+
const nameWidth = Math.max(4, ...data.composes.map((c29) => c29.name.length));
|
|
15145
15241
|
const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
|
|
15146
15242
|
" "
|
|
15147
15243
|
);
|
|
@@ -15742,7 +15838,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
|
|
|
15742
15838
|
if (!isInteractive()) {
|
|
15743
15839
|
throw new Error("--frequency is required (daily|weekly|monthly|once|loop)");
|
|
15744
15840
|
}
|
|
15745
|
-
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((
|
|
15841
|
+
const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c29) => c29.value === existingFrequency) : 0;
|
|
15746
15842
|
frequency = await promptSelect(
|
|
15747
15843
|
"Schedule frequency",
|
|
15748
15844
|
FREQUENCY_CHOICES,
|
|
@@ -15767,7 +15863,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
|
|
|
15767
15863
|
throw new Error("--day is required for weekly/monthly");
|
|
15768
15864
|
}
|
|
15769
15865
|
if (frequency === "weekly") {
|
|
15770
|
-
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((
|
|
15866
|
+
const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c29) => c29.value === existingDay) : 0;
|
|
15771
15867
|
const day2 = await promptSelect(
|
|
15772
15868
|
"Day of week",
|
|
15773
15869
|
DAY_OF_WEEK_CHOICES,
|
|
@@ -17217,7 +17313,7 @@ import chalk76 from "chalk";
|
|
|
17217
17313
|
var listCommand13 = new Command86().name("list").alias("ls").description("List all connectors and their status").action(
|
|
17218
17314
|
withErrorHandler(async () => {
|
|
17219
17315
|
const result = await listConnectors();
|
|
17220
|
-
const connectedMap = new Map(result.connectors.map((
|
|
17316
|
+
const connectedMap = new Map(result.connectors.map((c29) => [c29.type, c29]));
|
|
17221
17317
|
const allTypesRaw = Object.keys(CONNECTOR_TYPES);
|
|
17222
17318
|
const allTypes = [];
|
|
17223
17319
|
for (const type2 of allTypesRaw) {
|
|
@@ -17778,16 +17874,16 @@ async function handleModelProvider(ctx) {
|
|
|
17778
17874
|
const providerType = await step.prompt(
|
|
17779
17875
|
() => promptSelect(
|
|
17780
17876
|
"Select provider type:",
|
|
17781
|
-
choices.map((
|
|
17782
|
-
title:
|
|
17783
|
-
value:
|
|
17877
|
+
choices.map((c29) => ({
|
|
17878
|
+
title: c29.label,
|
|
17879
|
+
value: c29.type
|
|
17784
17880
|
}))
|
|
17785
17881
|
)
|
|
17786
17882
|
);
|
|
17787
17883
|
if (!providerType) {
|
|
17788
17884
|
process.exit(0);
|
|
17789
17885
|
}
|
|
17790
|
-
const selectedChoice = choices.find((
|
|
17886
|
+
const selectedChoice = choices.find((c29) => c29.type === providerType);
|
|
17791
17887
|
if (selectedChoice?.helpText) {
|
|
17792
17888
|
for (const line of selectedChoice.helpText.split("\n")) {
|
|
17793
17889
|
step.detail(chalk82.dim(line));
|
|
@@ -18141,13 +18237,13 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
|
|
|
18141
18237
|
if (latestVersion === null) {
|
|
18142
18238
|
throw new Error("Could not check for updates. Please try again later.");
|
|
18143
18239
|
}
|
|
18144
|
-
if (latestVersion === "9.70.
|
|
18145
|
-
console.log(chalk86.green(`\u2713 Already up to date (${"9.70.
|
|
18240
|
+
if (latestVersion === "9.70.1") {
|
|
18241
|
+
console.log(chalk86.green(`\u2713 Already up to date (${"9.70.1"})`));
|
|
18146
18242
|
return;
|
|
18147
18243
|
}
|
|
18148
18244
|
console.log(
|
|
18149
18245
|
chalk86.yellow(
|
|
18150
|
-
`Current version: ${"9.70.
|
|
18246
|
+
`Current version: ${"9.70.1"} -> Latest version: ${latestVersion}`
|
|
18151
18247
|
)
|
|
18152
18248
|
);
|
|
18153
18249
|
console.log();
|
|
@@ -18174,7 +18270,7 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
|
|
|
18174
18270
|
const success = await performUpgrade(packageManager);
|
|
18175
18271
|
if (success) {
|
|
18176
18272
|
console.log(
|
|
18177
|
-
chalk86.green(`\u2713 Upgraded from ${"9.70.
|
|
18273
|
+
chalk86.green(`\u2713 Upgraded from ${"9.70.1"} to ${latestVersion}`)
|
|
18178
18274
|
);
|
|
18179
18275
|
return;
|
|
18180
18276
|
}
|
|
@@ -18248,7 +18344,7 @@ var whoamiCommand = new Command95().name("whoami").description("Show current ide
|
|
|
18248
18344
|
|
|
18249
18345
|
// src/index.ts
|
|
18250
18346
|
var program = new Command96();
|
|
18251
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.70.
|
|
18347
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.70.1");
|
|
18252
18348
|
program.addCommand(authCommand);
|
|
18253
18349
|
program.addCommand(infoCommand);
|
|
18254
18350
|
program.addCommand(composeCommand);
|