@vm0/cli 9.59.3 → 9.59.5
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 +108 -76
- 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.59.
|
|
48
|
+
release: "9.59.5",
|
|
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.59.
|
|
67
|
+
version: "9.59.5",
|
|
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.59.
|
|
676
|
+
console.log(chalk4.bold(`VM0 CLI v${"9.59.5"}`));
|
|
677
677
|
console.log();
|
|
678
678
|
const config = await loadConfig();
|
|
679
679
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -785,18 +785,6 @@ import { z as z4 } from "zod";
|
|
|
785
785
|
// ../../packages/core/src/contracts/runners.ts
|
|
786
786
|
import { z as z3 } from "zod";
|
|
787
787
|
var c = initContract();
|
|
788
|
-
var firewallRuleSchema = z3.object({
|
|
789
|
-
domain: z3.string().optional(),
|
|
790
|
-
ip: z3.string().optional(),
|
|
791
|
-
/** Terminal rule - value is the action (ALLOW or DENY) */
|
|
792
|
-
final: z3.enum(["ALLOW", "DENY"]).optional(),
|
|
793
|
-
/** Action for domain/ip rules */
|
|
794
|
-
action: z3.enum(["ALLOW", "DENY"]).optional()
|
|
795
|
-
});
|
|
796
|
-
var experimentalFirewallSchema = z3.object({
|
|
797
|
-
enabled: z3.boolean(),
|
|
798
|
-
rules: z3.array(firewallRuleSchema).optional()
|
|
799
|
-
});
|
|
800
788
|
var runnerGroupSchema = z3.string().regex(
|
|
801
789
|
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
802
790
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
@@ -874,7 +862,6 @@ var storedExecutionContextSchema = z3.object({
|
|
|
874
862
|
// Maps secret names to OAuth connector types for runtime token refresh (e.g. { "GMAIL_ACCESS_TOKEN": "gmail" })
|
|
875
863
|
secretConnectorMap: z3.record(z3.string(), z3.string()).nullable().optional(),
|
|
876
864
|
cliAgentType: z3.string(),
|
|
877
|
-
experimentalFirewall: experimentalFirewallSchema.optional(),
|
|
878
865
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
879
866
|
debugNoMockClaude: z3.boolean().optional(),
|
|
880
867
|
// Dispatch timestamp for E2E timing metrics
|
|
@@ -907,8 +894,6 @@ var executionContextSchema = z3.object({
|
|
|
907
894
|
// Maps secret names to OAuth connector types for runtime token refresh
|
|
908
895
|
secretConnectorMap: z3.record(z3.string(), z3.string()).nullable().optional(),
|
|
909
896
|
cliAgentType: z3.string(),
|
|
910
|
-
// Experimental firewall configuration
|
|
911
|
-
experimentalFirewall: experimentalFirewallSchema.optional(),
|
|
912
897
|
// Debug flag to force real Claude in mock environments (internal use only)
|
|
913
898
|
debugNoMockClaude: z3.boolean().optional(),
|
|
914
899
|
// Dispatch timestamp for E2E timing metrics
|
|
@@ -954,6 +939,20 @@ var composeVersionQuerySchema = z4.string().min(1, "Missing version query parame
|
|
|
954
939
|
"Version must be 8-64 hex characters or 'latest'"
|
|
955
940
|
);
|
|
956
941
|
var AGENT_NAME_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9-]{1,62}[a-zA-Z0-9]$/;
|
|
942
|
+
var VALID_CAPABILITIES = [
|
|
943
|
+
"volume:read",
|
|
944
|
+
"volume:write",
|
|
945
|
+
"artifact:read",
|
|
946
|
+
"artifact:write",
|
|
947
|
+
"memory:read",
|
|
948
|
+
"memory:write",
|
|
949
|
+
"agent:read",
|
|
950
|
+
"agent:write",
|
|
951
|
+
"agent-run:read",
|
|
952
|
+
"agent-run:write",
|
|
953
|
+
"schedule:read",
|
|
954
|
+
"schedule:write"
|
|
955
|
+
];
|
|
957
956
|
var agentNameSchema = z4.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
|
|
958
957
|
AGENT_NAME_REGEX,
|
|
959
958
|
"Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
|
|
@@ -992,12 +991,6 @@ var agentDefinitionSchema = z4.object({
|
|
|
992
991
|
"Runner group must be in org/name format (e.g., acme/production)"
|
|
993
992
|
)
|
|
994
993
|
}).optional(),
|
|
995
|
-
/**
|
|
996
|
-
* Experimental firewall configuration for network egress control.
|
|
997
|
-
* Requires experimental_runner to be configured.
|
|
998
|
-
* When enabled, filters outbound traffic by domain/IP rules.
|
|
999
|
-
*/
|
|
1000
|
-
experimental_firewall: experimentalFirewallSchema.optional(),
|
|
1001
994
|
/**
|
|
1002
995
|
* External services for proxy-side token replacement.
|
|
1003
996
|
* CLI input: map format { slack: { permissions: [...] | "all" } }
|
|
@@ -1009,6 +1002,13 @@ var agentDefinitionSchema = z4.object({
|
|
|
1009
1002
|
permissions: z4.union([z4.literal("all"), z4.array(z4.string()).min(1)])
|
|
1010
1003
|
})
|
|
1011
1004
|
).optional(),
|
|
1005
|
+
/**
|
|
1006
|
+
* Capabilities that the agent is allowed to use.
|
|
1007
|
+
* Validated against VALID_CAPABILITIES at compose time.
|
|
1008
|
+
*/
|
|
1009
|
+
experimental_capabilities: z4.array(z4.enum(VALID_CAPABILITIES)).refine((arr) => new Set(arr).size === arr.length, {
|
|
1010
|
+
message: "Duplicate capabilities are not allowed"
|
|
1011
|
+
}).optional(),
|
|
1012
1012
|
/**
|
|
1013
1013
|
* Agent metadata for display and personalization.
|
|
1014
1014
|
* - displayName: Human-readable name shown in the UI (preserves original casing).
|
|
@@ -6451,7 +6451,7 @@ var computerConnectorContract = c18.router({
|
|
|
6451
6451
|
|
|
6452
6452
|
// ../../packages/core/src/contracts/services.ts
|
|
6453
6453
|
function bearerAuth(secretName) {
|
|
6454
|
-
return { headers: { Authorization: `Bearer \${secrets.${secretName}}` } };
|
|
6454
|
+
return { headers: { Authorization: `Bearer \${{ secrets.${secretName} }}` } };
|
|
6455
6455
|
}
|
|
6456
6456
|
var FULL_ACCESS_PERMISSION = {
|
|
6457
6457
|
name: "full-access",
|
|
@@ -6620,7 +6620,7 @@ var SERVICE_CONFIGS = {
|
|
|
6620
6620
|
apis: [
|
|
6621
6621
|
api("https://api.notion.com/v1", {
|
|
6622
6622
|
headers: {
|
|
6623
|
-
Authorization: "Bearer ${secrets.NOTION_TOKEN}",
|
|
6623
|
+
Authorization: "Bearer ${{ secrets.NOTION_TOKEN }}",
|
|
6624
6624
|
"Notion-Version": "2022-06-28"
|
|
6625
6625
|
}
|
|
6626
6626
|
})
|
|
@@ -6672,14 +6672,14 @@ var SERVICE_CONFIGS = {
|
|
|
6672
6672
|
hume: {
|
|
6673
6673
|
apis: [
|
|
6674
6674
|
api("https://api.hume.ai", {
|
|
6675
|
-
headers: { "X-Hume-Api-Key": "${secrets.HUME_TOKEN}" }
|
|
6675
|
+
headers: { "X-Hume-Api-Key": "${{ secrets.HUME_TOKEN }}" }
|
|
6676
6676
|
})
|
|
6677
6677
|
]
|
|
6678
6678
|
},
|
|
6679
6679
|
heygen: {
|
|
6680
6680
|
apis: [
|
|
6681
6681
|
api("https://api.heygen.com", {
|
|
6682
|
-
headers: { "x-api-key": "${secrets.HEYGEN_TOKEN}" }
|
|
6682
|
+
headers: { "x-api-key": "${{ secrets.HEYGEN_TOKEN }}" }
|
|
6683
6683
|
})
|
|
6684
6684
|
]
|
|
6685
6685
|
},
|
|
@@ -6724,12 +6724,12 @@ var SERVICE_CONFIGS = {
|
|
|
6724
6724
|
apis: [
|
|
6725
6725
|
api("https://api.jotform.com", {
|
|
6726
6726
|
headers: {
|
|
6727
|
-
APIKEY: "${secrets.JOTFORM_TOKEN}"
|
|
6727
|
+
APIKEY: "${{ secrets.JOTFORM_TOKEN }}"
|
|
6728
6728
|
}
|
|
6729
6729
|
}),
|
|
6730
6730
|
api("https://eu-api.jotform.com", {
|
|
6731
6731
|
headers: {
|
|
6732
|
-
APIKEY: "${secrets.JOTFORM_TOKEN}"
|
|
6732
|
+
APIKEY: "${{ secrets.JOTFORM_TOKEN }}"
|
|
6733
6733
|
}
|
|
6734
6734
|
})
|
|
6735
6735
|
]
|
|
@@ -6741,22 +6741,22 @@ var SERVICE_CONFIGS = {
|
|
|
6741
6741
|
apis: [
|
|
6742
6742
|
api("https://eu1.make.com/api/v2", {
|
|
6743
6743
|
headers: {
|
|
6744
|
-
Authorization: "Token ${secrets.MAKE_TOKEN}"
|
|
6744
|
+
Authorization: "Token ${{ secrets.MAKE_TOKEN }}"
|
|
6745
6745
|
}
|
|
6746
6746
|
}),
|
|
6747
6747
|
api("https://eu2.make.com/api/v2", {
|
|
6748
6748
|
headers: {
|
|
6749
|
-
Authorization: "Token ${secrets.MAKE_TOKEN}"
|
|
6749
|
+
Authorization: "Token ${{ secrets.MAKE_TOKEN }}"
|
|
6750
6750
|
}
|
|
6751
6751
|
}),
|
|
6752
6752
|
api("https://us1.make.com/api/v2", {
|
|
6753
6753
|
headers: {
|
|
6754
|
-
Authorization: "Token ${secrets.MAKE_TOKEN}"
|
|
6754
|
+
Authorization: "Token ${{ secrets.MAKE_TOKEN }}"
|
|
6755
6755
|
}
|
|
6756
6756
|
}),
|
|
6757
6757
|
api("https://us2.make.com/api/v2", {
|
|
6758
6758
|
headers: {
|
|
6759
|
-
Authorization: "Token ${secrets.MAKE_TOKEN}"
|
|
6759
|
+
Authorization: "Token ${{ secrets.MAKE_TOKEN }}"
|
|
6760
6760
|
}
|
|
6761
6761
|
})
|
|
6762
6762
|
]
|
|
@@ -6765,7 +6765,7 @@ var SERVICE_CONFIGS = {
|
|
|
6765
6765
|
apis: [
|
|
6766
6766
|
api("https://api.metabase.com", {
|
|
6767
6767
|
headers: {
|
|
6768
|
-
"x-api-key": "${secrets.METABASE_TOKEN}"
|
|
6768
|
+
"x-api-key": "${{ secrets.METABASE_TOKEN }}"
|
|
6769
6769
|
}
|
|
6770
6770
|
})
|
|
6771
6771
|
]
|
|
@@ -6861,7 +6861,7 @@ var SERVICE_CONFIGS = {
|
|
|
6861
6861
|
similarweb: {
|
|
6862
6862
|
apis: [
|
|
6863
6863
|
api("https://api.similarweb.com", {
|
|
6864
|
-
headers: { "api-key": "${secrets.SIMILARWEB_API_KEY}" }
|
|
6864
|
+
headers: { "api-key": "${{ secrets.SIMILARWEB_API_KEY }}" }
|
|
6865
6865
|
})
|
|
6866
6866
|
]
|
|
6867
6867
|
},
|
|
@@ -6892,14 +6892,14 @@ var SERVICE_CONFIGS = {
|
|
|
6892
6892
|
pdf4me: {
|
|
6893
6893
|
apis: [
|
|
6894
6894
|
api("https://api.pdf4me.com", {
|
|
6895
|
-
headers: { Authorization: "${secrets.PDF4ME_TOKEN}" }
|
|
6895
|
+
headers: { Authorization: "${{ secrets.PDF4ME_TOKEN }}" }
|
|
6896
6896
|
})
|
|
6897
6897
|
]
|
|
6898
6898
|
},
|
|
6899
6899
|
pdfco: {
|
|
6900
6900
|
apis: [
|
|
6901
6901
|
api("https://api.pdf.co/v1", {
|
|
6902
|
-
headers: { "x-api-key": "${secrets.PDFCO_TOKEN}" }
|
|
6902
|
+
headers: { "x-api-key": "${{ secrets.PDFCO_TOKEN }}" }
|
|
6903
6903
|
})
|
|
6904
6904
|
]
|
|
6905
6905
|
},
|
|
@@ -6912,7 +6912,7 @@ var SERVICE_CONFIGS = {
|
|
|
6912
6912
|
browserbase: {
|
|
6913
6913
|
apis: [
|
|
6914
6914
|
api("https://api.browserbase.com/v1", {
|
|
6915
|
-
headers: { "X-BB-API-Key": "${secrets.BROWSERBASE_TOKEN}" }
|
|
6915
|
+
headers: { "X-BB-API-Key": "${{ secrets.BROWSERBASE_TOKEN }}" }
|
|
6916
6916
|
})
|
|
6917
6917
|
]
|
|
6918
6918
|
},
|
|
@@ -6924,7 +6924,7 @@ var SERVICE_CONFIGS = {
|
|
|
6924
6924
|
explorium: {
|
|
6925
6925
|
apis: [
|
|
6926
6926
|
api("https://api.explorium.ai", {
|
|
6927
|
-
headers: { api_key: "${secrets.EXPLORIUM_TOKEN}" }
|
|
6927
|
+
headers: { api_key: "${{ secrets.EXPLORIUM_TOKEN }}" }
|
|
6928
6928
|
})
|
|
6929
6929
|
]
|
|
6930
6930
|
},
|
|
@@ -6934,21 +6934,21 @@ var SERVICE_CONFIGS = {
|
|
|
6934
6934
|
scrapeninja: {
|
|
6935
6935
|
apis: [
|
|
6936
6936
|
api("https://scrapeninja.p.rapidapi.com", {
|
|
6937
|
-
headers: { "X-RapidAPI-Key": "${secrets.SCRAPENINJA_TOKEN}" }
|
|
6937
|
+
headers: { "X-RapidAPI-Key": "${{ secrets.SCRAPENINJA_TOKEN }}" }
|
|
6938
6938
|
})
|
|
6939
6939
|
]
|
|
6940
6940
|
},
|
|
6941
6941
|
elevenlabs: {
|
|
6942
6942
|
apis: [
|
|
6943
6943
|
api("https://api.elevenlabs.io", {
|
|
6944
|
-
headers: { "xi-api-key": "${secrets.ELEVENLABS_TOKEN}" }
|
|
6944
|
+
headers: { "xi-api-key": "${{ secrets.ELEVENLABS_TOKEN }}" }
|
|
6945
6945
|
})
|
|
6946
6946
|
]
|
|
6947
6947
|
},
|
|
6948
6948
|
devto: {
|
|
6949
6949
|
apis: [
|
|
6950
6950
|
api("https://dev.to/api", {
|
|
6951
|
-
headers: { "api-key": "${secrets.DEVTO_TOKEN}" }
|
|
6951
|
+
headers: { "api-key": "${{ secrets.DEVTO_TOKEN }}" }
|
|
6952
6952
|
})
|
|
6953
6953
|
]
|
|
6954
6954
|
},
|
|
@@ -6964,7 +6964,7 @@ var SERVICE_CONFIGS = {
|
|
|
6964
6964
|
qdrant: {
|
|
6965
6965
|
apis: [
|
|
6966
6966
|
api("https://cloud.qdrant.io", {
|
|
6967
|
-
headers: { "api-key": "${secrets.QDRANT_TOKEN}" }
|
|
6967
|
+
headers: { "api-key": "${{ secrets.QDRANT_TOKEN }}" }
|
|
6968
6968
|
})
|
|
6969
6969
|
]
|
|
6970
6970
|
},
|
|
@@ -6980,7 +6980,7 @@ var SERVICE_CONFIGS = {
|
|
|
6980
6980
|
apis: [
|
|
6981
6981
|
api("https://api.zeptomail.com/v1.1", {
|
|
6982
6982
|
headers: {
|
|
6983
|
-
Authorization: "Zoho-enczapikey ${secrets.ZEPTOMAIL_TOKEN}"
|
|
6983
|
+
Authorization: "Zoho-enczapikey ${{ secrets.ZEPTOMAIL_TOKEN }}"
|
|
6984
6984
|
}
|
|
6985
6985
|
})
|
|
6986
6986
|
]
|
|
@@ -6991,14 +6991,14 @@ var SERVICE_CONFIGS = {
|
|
|
6991
6991
|
shortio: {
|
|
6992
6992
|
apis: [
|
|
6993
6993
|
api("https://api.short.io", {
|
|
6994
|
-
headers: { Authorization: "${secrets.SHORTIO_TOKEN}" }
|
|
6994
|
+
headers: { Authorization: "${{ secrets.SHORTIO_TOKEN }}" }
|
|
6995
6995
|
})
|
|
6996
6996
|
]
|
|
6997
6997
|
},
|
|
6998
6998
|
supadata: {
|
|
6999
6999
|
apis: [
|
|
7000
7000
|
api("https://api.supadata.ai/v1", {
|
|
7001
|
-
headers: { "x-api-key": "${secrets.SUPADATA_TOKEN}" }
|
|
7001
|
+
headers: { "x-api-key": "${{ secrets.SUPADATA_TOKEN }}" }
|
|
7002
7002
|
})
|
|
7003
7003
|
]
|
|
7004
7004
|
},
|
|
@@ -7008,7 +7008,7 @@ var SERVICE_CONFIGS = {
|
|
|
7008
7008
|
tldv: {
|
|
7009
7009
|
apis: [
|
|
7010
7010
|
api("https://pasta.tldv.io", {
|
|
7011
|
-
headers: { "x-api-key": "${secrets.TLDV_TOKEN}" }
|
|
7011
|
+
headers: { "x-api-key": "${{ secrets.TLDV_TOKEN }}" }
|
|
7012
7012
|
})
|
|
7013
7013
|
]
|
|
7014
7014
|
},
|
|
@@ -8901,24 +8901,42 @@ import * as path2 from "path";
|
|
|
8901
8901
|
import * as fs from "fs/promises";
|
|
8902
8902
|
import * as path from "path";
|
|
8903
8903
|
import * as os2 from "os";
|
|
8904
|
-
import {
|
|
8904
|
+
import { execFile } from "child_process";
|
|
8905
8905
|
import { promisify } from "util";
|
|
8906
|
-
var
|
|
8906
|
+
var execFileAsync = promisify(execFile);
|
|
8907
|
+
function sanitizeGitArg(value, label) {
|
|
8908
|
+
if (!/^[a-zA-Z0-9._/\-@]+$/.test(value)) {
|
|
8909
|
+
throw new Error(
|
|
8910
|
+
`Invalid ${label}: contains disallowed characters. Only alphanumeric, dash, underscore, dot, slash, and @ are permitted.`
|
|
8911
|
+
);
|
|
8912
|
+
}
|
|
8913
|
+
if (value.startsWith("-")) {
|
|
8914
|
+
throw new Error(`Invalid ${label}: must not start with a dash`);
|
|
8915
|
+
}
|
|
8916
|
+
return value;
|
|
8917
|
+
}
|
|
8907
8918
|
async function downloadGitHubSkill(parsed, destDir) {
|
|
8908
|
-
const
|
|
8919
|
+
const owner = sanitizeGitArg(parsed.owner, "repository owner");
|
|
8920
|
+
const repo = sanitizeGitArg(parsed.repo, "repository name");
|
|
8921
|
+
const branch = sanitizeGitArg(parsed.branch, "branch name");
|
|
8922
|
+
const repoUrl = `https://github.com/${owner}/${repo}.git`;
|
|
8909
8923
|
const skillDir = path.join(destDir, parsed.skillName);
|
|
8910
8924
|
const tempDir = await fs.mkdtemp(path.join(os2.tmpdir(), "vm0-skill-"));
|
|
8911
8925
|
try {
|
|
8912
|
-
await
|
|
8913
|
-
await
|
|
8914
|
-
|
|
8926
|
+
await execFileAsync("git", ["init"], { cwd: tempDir });
|
|
8927
|
+
await execFileAsync("git", ["remote", "add", "origin", repoUrl], {
|
|
8928
|
+
cwd: tempDir
|
|
8929
|
+
});
|
|
8930
|
+
await execFileAsync("git", ["config", "core.sparseCheckout", "true"], {
|
|
8931
|
+
cwd: tempDir
|
|
8932
|
+
});
|
|
8915
8933
|
const sparsePattern = parsed.path || "/*";
|
|
8916
8934
|
const sparseFile = path.join(tempDir, ".git", "info", "sparse-checkout");
|
|
8917
8935
|
await fs.writeFile(sparseFile, sparsePattern + "\n");
|
|
8918
|
-
await
|
|
8936
|
+
await execFileAsync("git", ["fetch", "--depth", "1", "origin", branch], {
|
|
8919
8937
|
cwd: tempDir
|
|
8920
8938
|
});
|
|
8921
|
-
await
|
|
8939
|
+
await execFileAsync("git", ["checkout", branch], { cwd: tempDir });
|
|
8922
8940
|
await fs.mkdir(path.dirname(skillDir), { recursive: true });
|
|
8923
8941
|
if (parsed.path) {
|
|
8924
8942
|
const fetchedPath = path.join(tempDir, parsed.path);
|
|
@@ -8937,11 +8955,16 @@ async function downloadGitHubSkill(parsed, destDir) {
|
|
|
8937
8955
|
}
|
|
8938
8956
|
}
|
|
8939
8957
|
async function getDefaultBranch(owner, repo) {
|
|
8940
|
-
const
|
|
8958
|
+
const safeOwner = sanitizeGitArg(owner, "repository owner");
|
|
8959
|
+
const safeRepo = sanitizeGitArg(repo, "repository name");
|
|
8960
|
+
const repoUrl = `https://github.com/${safeOwner}/${safeRepo}.git`;
|
|
8941
8961
|
try {
|
|
8942
|
-
const { stdout } = await
|
|
8943
|
-
|
|
8944
|
-
|
|
8962
|
+
const { stdout } = await execFileAsync("git", [
|
|
8963
|
+
"ls-remote",
|
|
8964
|
+
"--symref",
|
|
8965
|
+
repoUrl,
|
|
8966
|
+
"HEAD"
|
|
8967
|
+
]);
|
|
8945
8968
|
const match = stdout.match(/ref: refs\/heads\/([^\s]+)/);
|
|
8946
8969
|
if (!match) {
|
|
8947
8970
|
throw new Error(
|
|
@@ -8969,25 +8992,34 @@ async function downloadGitHubDirectory(url) {
|
|
|
8969
8992
|
`Invalid GitHub URL: ${url}. Expected format: https://github.com/{owner}/{repo}[/tree/{branch}[/path]]`
|
|
8970
8993
|
);
|
|
8971
8994
|
}
|
|
8972
|
-
const
|
|
8995
|
+
const safeOwner = sanitizeGitArg(parsed.owner, "repository owner");
|
|
8996
|
+
const safeRepo = sanitizeGitArg(parsed.repo, "repository name");
|
|
8997
|
+
const repoUrl = `https://github.com/${safeOwner}/${safeRepo}.git`;
|
|
8973
8998
|
const tempDir = await fs.mkdtemp(path.join(os2.tmpdir(), "vm0-github-"));
|
|
8974
8999
|
try {
|
|
8975
9000
|
try {
|
|
8976
|
-
await
|
|
9001
|
+
await execFileAsync("git", ["--version"]);
|
|
8977
9002
|
} catch {
|
|
8978
9003
|
throw new Error(
|
|
8979
9004
|
"git command not found. Please install git to use GitHub URLs."
|
|
8980
9005
|
);
|
|
8981
9006
|
}
|
|
8982
|
-
const branch =
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
9007
|
+
const branch = sanitizeGitArg(
|
|
9008
|
+
parsed.branch ?? await getDefaultBranch(safeOwner, safeRepo),
|
|
9009
|
+
"branch name"
|
|
9010
|
+
);
|
|
9011
|
+
await execFileAsync("git", ["init"], { cwd: tempDir });
|
|
9012
|
+
await execFileAsync("git", ["remote", "add", "origin", repoUrl], {
|
|
9013
|
+
cwd: tempDir
|
|
9014
|
+
});
|
|
9015
|
+
await execFileAsync("git", ["config", "core.sparseCheckout", "true"], {
|
|
9016
|
+
cwd: tempDir
|
|
9017
|
+
});
|
|
8986
9018
|
const sparsePattern = parsed.path ?? "/*";
|
|
8987
9019
|
const sparseFile = path.join(tempDir, ".git", "info", "sparse-checkout");
|
|
8988
9020
|
await fs.writeFile(sparseFile, sparsePattern + "\n");
|
|
8989
9021
|
try {
|
|
8990
|
-
await
|
|
9022
|
+
await execFileAsync("git", ["fetch", "--depth", "1", "origin", branch], {
|
|
8991
9023
|
cwd: tempDir
|
|
8992
9024
|
});
|
|
8993
9025
|
} catch (error) {
|
|
@@ -9000,7 +9032,7 @@ async function downloadGitHubDirectory(url) {
|
|
|
9000
9032
|
}
|
|
9001
9033
|
throw error;
|
|
9002
9034
|
}
|
|
9003
|
-
await
|
|
9035
|
+
await execFileAsync("git", ["checkout", branch], { cwd: tempDir });
|
|
9004
9036
|
const downloadedDir = parsed.path ? path.join(tempDir, parsed.path) : tempDir;
|
|
9005
9037
|
return {
|
|
9006
9038
|
dir: downloadedDir,
|
|
@@ -9913,7 +9945,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
9913
9945
|
options.autoUpdate = false;
|
|
9914
9946
|
}
|
|
9915
9947
|
if (options.autoUpdate !== false) {
|
|
9916
|
-
await startSilentUpgrade("9.59.
|
|
9948
|
+
await startSilentUpgrade("9.59.5");
|
|
9917
9949
|
}
|
|
9918
9950
|
try {
|
|
9919
9951
|
let result;
|
|
@@ -11087,7 +11119,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
11087
11119
|
withErrorHandler(
|
|
11088
11120
|
async (identifier, prompt, options) => {
|
|
11089
11121
|
if (options.autoUpdate !== false) {
|
|
11090
|
-
await startSilentUpgrade("9.59.
|
|
11122
|
+
await startSilentUpgrade("9.59.5");
|
|
11091
11123
|
}
|
|
11092
11124
|
const { org, name, version } = parseIdentifier(identifier);
|
|
11093
11125
|
if (org && !options.experimentalSharedAgent) {
|
|
@@ -12774,7 +12806,7 @@ var cookAction = new Command34().name("cook").description("Quick start: prepare,
|
|
|
12774
12806
|
withErrorHandler(
|
|
12775
12807
|
async (prompt, options) => {
|
|
12776
12808
|
if (options.autoUpdate !== false) {
|
|
12777
|
-
const shouldExit = await checkAndUpgrade("9.59.
|
|
12809
|
+
const shouldExit = await checkAndUpgrade("9.59.5", prompt);
|
|
12778
12810
|
if (shouldExit) {
|
|
12779
12811
|
process.exit(0);
|
|
12780
12812
|
}
|
|
@@ -18125,13 +18157,13 @@ var upgradeCommand = new Command90().name("upgrade").description("Upgrade vm0 CL
|
|
|
18125
18157
|
if (latestVersion === null) {
|
|
18126
18158
|
throw new Error("Could not check for updates. Please try again later.");
|
|
18127
18159
|
}
|
|
18128
|
-
if (latestVersion === "9.59.
|
|
18129
|
-
console.log(chalk84.green(`\u2713 Already up to date (${"9.59.
|
|
18160
|
+
if (latestVersion === "9.59.5") {
|
|
18161
|
+
console.log(chalk84.green(`\u2713 Already up to date (${"9.59.5"})`));
|
|
18130
18162
|
return;
|
|
18131
18163
|
}
|
|
18132
18164
|
console.log(
|
|
18133
18165
|
chalk84.yellow(
|
|
18134
|
-
`Current version: ${"9.59.
|
|
18166
|
+
`Current version: ${"9.59.5"} -> Latest version: ${latestVersion}`
|
|
18135
18167
|
)
|
|
18136
18168
|
);
|
|
18137
18169
|
console.log();
|
|
@@ -18158,7 +18190,7 @@ var upgradeCommand = new Command90().name("upgrade").description("Upgrade vm0 CL
|
|
|
18158
18190
|
const success = await performUpgrade(packageManager);
|
|
18159
18191
|
if (success) {
|
|
18160
18192
|
console.log(
|
|
18161
|
-
chalk84.green(`\u2713 Upgraded from ${"9.59.
|
|
18193
|
+
chalk84.green(`\u2713 Upgraded from ${"9.59.5"} to ${latestVersion}`)
|
|
18162
18194
|
);
|
|
18163
18195
|
return;
|
|
18164
18196
|
}
|
|
@@ -18172,7 +18204,7 @@ var upgradeCommand = new Command90().name("upgrade").description("Upgrade vm0 CL
|
|
|
18172
18204
|
|
|
18173
18205
|
// src/index.ts
|
|
18174
18206
|
var program = new Command91();
|
|
18175
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.59.
|
|
18207
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.59.5");
|
|
18176
18208
|
program.addCommand(authCommand);
|
|
18177
18209
|
program.addCommand(infoCommand);
|
|
18178
18210
|
program.addCommand(composeCommand);
|