@vm0/cli 9.209.2 → 9.209.3
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/{chunk-6P4FKVEV.js → chunk-O6UJMPWI.js} +10 -4
- package/{chunk-6P4FKVEV.js.map → chunk-O6UJMPWI.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +44 -8
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
uo,
|
|
75
75
|
volumeConfigSchema,
|
|
76
76
|
withErrorHandler
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-O6UJMPWI.js";
|
|
78
78
|
import {
|
|
79
79
|
external_exports
|
|
80
80
|
} from "./chunk-S3DAXIKY.js";
|
|
@@ -411,7 +411,7 @@ function getConfigPath() {
|
|
|
411
411
|
return join(os.homedir(), ".vm0", "config.json");
|
|
412
412
|
}
|
|
413
413
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
414
|
-
console.log(source_default.bold(`VM0 CLI v${"9.209.
|
|
414
|
+
console.log(source_default.bold(`VM0 CLI v${"9.209.3"}`));
|
|
415
415
|
console.log();
|
|
416
416
|
const config = await loadConfig();
|
|
417
417
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -1113,7 +1113,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
1113
1113
|
options.autoUpdate = false;
|
|
1114
1114
|
}
|
|
1115
1115
|
if (options.autoUpdate !== false) {
|
|
1116
|
-
await startSilentUpgrade("9.209.
|
|
1116
|
+
await startSilentUpgrade("9.209.3");
|
|
1117
1117
|
}
|
|
1118
1118
|
try {
|
|
1119
1119
|
const { config, agentName, agent, basePath } = await loadAndValidateConfig(resolvedConfigFile);
|
|
@@ -1210,7 +1210,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
1210
1210
|
withErrorHandler(
|
|
1211
1211
|
async (identifier, prompt, options) => {
|
|
1212
1212
|
if (options.autoUpdate !== false) {
|
|
1213
|
-
await startSilentUpgrade("9.209.
|
|
1213
|
+
await startSilentUpgrade("9.209.3");
|
|
1214
1214
|
}
|
|
1215
1215
|
const { name, version } = parseIdentifier(identifier);
|
|
1216
1216
|
let composeId;
|
|
@@ -3016,13 +3016,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
3016
3016
|
if (latestVersion === null) {
|
|
3017
3017
|
throw new Error("Could not check for updates. Please try again later.");
|
|
3018
3018
|
}
|
|
3019
|
-
if (latestVersion === "9.209.
|
|
3020
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.209.
|
|
3019
|
+
if (latestVersion === "9.209.3") {
|
|
3020
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.209.3"})`));
|
|
3021
3021
|
return;
|
|
3022
3022
|
}
|
|
3023
3023
|
console.log(
|
|
3024
3024
|
source_default.yellow(
|
|
3025
|
-
`Current version: ${"9.209.
|
|
3025
|
+
`Current version: ${"9.209.3"} -> Latest version: ${latestVersion}`
|
|
3026
3026
|
)
|
|
3027
3027
|
);
|
|
3028
3028
|
console.log();
|
|
@@ -3049,7 +3049,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
3049
3049
|
const success = await performUpgrade(packageManager);
|
|
3050
3050
|
if (success) {
|
|
3051
3051
|
console.log(
|
|
3052
|
-
source_default.green(`\u2713 Upgraded from ${"9.209.
|
|
3052
|
+
source_default.green(`\u2713 Upgraded from ${"9.209.3"} to ${latestVersion}`)
|
|
3053
3053
|
);
|
|
3054
3054
|
return;
|
|
3055
3055
|
}
|
|
@@ -3116,7 +3116,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
3116
3116
|
|
|
3117
3117
|
// src/index.ts
|
|
3118
3118
|
var program = new Command();
|
|
3119
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.209.
|
|
3119
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.209.3");
|
|
3120
3120
|
program.addCommand(authCommand);
|
|
3121
3121
|
program.addCommand(infoCommand);
|
|
3122
3122
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -178,7 +178,7 @@ import {
|
|
|
178
178
|
uploadWebFile,
|
|
179
179
|
upsertZeroOrgModelProvider,
|
|
180
180
|
withErrorHandler
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-O6UJMPWI.js";
|
|
182
182
|
import {
|
|
183
183
|
CONNECTOR_TYPES,
|
|
184
184
|
CONNECTOR_TYPE_KEYS,
|
|
@@ -14485,13 +14485,13 @@ init_esm_shims();
|
|
|
14485
14485
|
|
|
14486
14486
|
// src/lib/host/publish-static-site.ts
|
|
14487
14487
|
init_esm_shims();
|
|
14488
|
-
import { readFile as readFile3 } from "fs/promises";
|
|
14489
14488
|
|
|
14490
14489
|
// src/lib/host/static-site.ts
|
|
14491
14490
|
init_esm_shims();
|
|
14492
14491
|
import { createHash } from "crypto";
|
|
14493
14492
|
import { readdir, readFile as readFile2, stat } from "fs/promises";
|
|
14494
14493
|
import { extname as extname4, relative, resolve, sep, dirname, posix } from "path";
|
|
14494
|
+
var DEFAULT_HOSTED_SITE_ROBOTS_TXT = "User-agent: *\nDisallow: /\n";
|
|
14495
14495
|
var MIME_BY_EXTENSION4 = {
|
|
14496
14496
|
".html": "text/html; charset=utf-8",
|
|
14497
14497
|
".htm": "text/html; charset=utf-8",
|
|
@@ -14617,6 +14617,24 @@ async function hashFile(path2) {
|
|
|
14617
14617
|
const bytes = await readFile2(path2);
|
|
14618
14618
|
return createHash("sha256").update(bytes).digest("hex");
|
|
14619
14619
|
}
|
|
14620
|
+
function textFile(path2, content) {
|
|
14621
|
+
const bytes = new TextEncoder().encode(content);
|
|
14622
|
+
return {
|
|
14623
|
+
content: bytes,
|
|
14624
|
+
path: path2,
|
|
14625
|
+
size: bytes.byteLength,
|
|
14626
|
+
sha256: createHash("sha256").update(bytes).digest("hex"),
|
|
14627
|
+
contentType: inferContentType4(path2)
|
|
14628
|
+
};
|
|
14629
|
+
}
|
|
14630
|
+
function ensureDefaultRobots(files, options) {
|
|
14631
|
+
if (options.defaultRobots !== "disallow-all" || files.some((file) => {
|
|
14632
|
+
return file.path === "/robots.txt";
|
|
14633
|
+
})) {
|
|
14634
|
+
return files;
|
|
14635
|
+
}
|
|
14636
|
+
return [...files, textFile("/robots.txt", DEFAULT_HOSTED_SITE_ROBOTS_TXT)];
|
|
14637
|
+
}
|
|
14620
14638
|
async function walk(root, dir, files) {
|
|
14621
14639
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
14622
14640
|
for (const entry of entries) {
|
|
@@ -14654,6 +14672,9 @@ async function assertReferencesExist(files) {
|
|
|
14654
14672
|
if (!shouldValidateReferences(ext)) {
|
|
14655
14673
|
continue;
|
|
14656
14674
|
}
|
|
14675
|
+
if (!file.absolutePath) {
|
|
14676
|
+
throw new Error(`Hosted-site file has no source: ${file.path}`);
|
|
14677
|
+
}
|
|
14657
14678
|
const text = await readFile2(file.absolutePath, "utf8");
|
|
14658
14679
|
const references = collectReferences(ext, text);
|
|
14659
14680
|
for (const reference of references) {
|
|
@@ -14672,7 +14693,7 @@ async function assertReferencesExist(files) {
|
|
|
14672
14693
|
}
|
|
14673
14694
|
}
|
|
14674
14695
|
}
|
|
14675
|
-
async function scanStaticSite(rootPath) {
|
|
14696
|
+
async function scanStaticSite(rootPath, options = {}) {
|
|
14676
14697
|
const root = resolve(rootPath);
|
|
14677
14698
|
const rootStat = await stat(root);
|
|
14678
14699
|
if (!rootStat.isDirectory()) {
|
|
@@ -14686,17 +14707,32 @@ async function scanStaticSite(rootPath) {
|
|
|
14686
14707
|
throw new Error("Hosted site directory must include index.html");
|
|
14687
14708
|
}
|
|
14688
14709
|
await assertReferencesExist(files);
|
|
14710
|
+
const publishFiles = [...ensureDefaultRobots(files, options)];
|
|
14689
14711
|
return {
|
|
14690
14712
|
root,
|
|
14691
|
-
files:
|
|
14713
|
+
files: publishFiles.sort((a, b) => {
|
|
14692
14714
|
return a.path.localeCompare(b.path);
|
|
14693
14715
|
})
|
|
14694
14716
|
};
|
|
14695
14717
|
}
|
|
14718
|
+
async function readStaticSiteFile(file) {
|
|
14719
|
+
if (file.content) {
|
|
14720
|
+
return file.content;
|
|
14721
|
+
}
|
|
14722
|
+
if (!file.absolutePath) {
|
|
14723
|
+
throw new Error(`Hosted-site file has no source: ${file.path}`);
|
|
14724
|
+
}
|
|
14725
|
+
const bytes = await readFile2(file.absolutePath);
|
|
14726
|
+
return new Uint8Array(bytes);
|
|
14727
|
+
}
|
|
14696
14728
|
|
|
14697
14729
|
// src/lib/host/publish-static-site.ts
|
|
14698
14730
|
async function publishStaticSite(options) {
|
|
14699
|
-
const
|
|
14731
|
+
const artifactKind = options.artifactKind ?? "hosted-site";
|
|
14732
|
+
const scan = await scanStaticSite(
|
|
14733
|
+
options.dir,
|
|
14734
|
+
artifactKind === "hosted-site" ? { defaultRobots: "disallow-all" } : {}
|
|
14735
|
+
);
|
|
14700
14736
|
const totalSize = scan.files.reduce((sum, file) => {
|
|
14701
14737
|
return sum + file.size;
|
|
14702
14738
|
}, 0);
|
|
@@ -14707,7 +14743,7 @@ async function publishStaticSite(options) {
|
|
|
14707
14743
|
const prepared = await prepareHostedSite({
|
|
14708
14744
|
site: options.site,
|
|
14709
14745
|
...options.slugSuffix !== void 0 && { slugSuffix: options.slugSuffix },
|
|
14710
|
-
artifactKind
|
|
14746
|
+
artifactKind,
|
|
14711
14747
|
spaFallback: Boolean(options.spaFallback),
|
|
14712
14748
|
files: scan.files.map((file) => {
|
|
14713
14749
|
return {
|
|
@@ -14730,7 +14766,7 @@ async function publishStaticSite(options) {
|
|
|
14730
14766
|
throw new Error(`Missing upload URL for ${file.path}`);
|
|
14731
14767
|
}
|
|
14732
14768
|
options.onProgress?.({ phase: "uploading", path: file.path });
|
|
14733
|
-
const bytes = await
|
|
14769
|
+
const bytes = await readStaticSiteFile(file);
|
|
14734
14770
|
const response = await fetch(uploadUrl, {
|
|
14735
14771
|
method: "PUT",
|
|
14736
14772
|
headers: { "Content-Type": file.contentType },
|
|
@@ -16107,7 +16143,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
16107
16143
|
var program = new Command();
|
|
16108
16144
|
program.name("zero").description(
|
|
16109
16145
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
16110
|
-
).version("9.209.
|
|
16146
|
+
).version("9.209.3").addHelpText("after", () => {
|
|
16111
16147
|
return buildZeroHelpText();
|
|
16112
16148
|
});
|
|
16113
16149
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|