@vm0/cli 9.132.11 → 9.134.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/{chunk-S72CJD3V.js → chunk-2MZO4LKL.js} +128 -39
- package/{chunk-S72CJD3V.js.map → chunk-2MZO4LKL.js.map} +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +90 -21
- package/zero.js.map +1 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
deployZeroSchedule,
|
|
31
31
|
disableZeroSchedule,
|
|
32
32
|
downloadSlackFile,
|
|
33
|
+
downloadTelegramFile,
|
|
33
34
|
downloadWebFile,
|
|
34
35
|
enableZeroSchedule,
|
|
35
36
|
extractSecretNamesFromApis,
|
|
@@ -112,7 +113,7 @@ import {
|
|
|
112
113
|
upsertZeroOrgModelProvider,
|
|
113
114
|
withErrorHandler,
|
|
114
115
|
zeroAgentCustomSkillNameSchema
|
|
115
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-2MZO4LKL.js";
|
|
116
117
|
import {
|
|
117
118
|
__toESM,
|
|
118
119
|
init_esm_shims
|
|
@@ -13922,7 +13923,7 @@ var FEATURE_SWITCHES = {
|
|
|
13922
13923
|
},
|
|
13923
13924
|
["auditLink" /* AuditLink */]: {
|
|
13924
13925
|
maintainer: "ethan@vm0.ai",
|
|
13925
|
-
description: "Show audit log links in
|
|
13926
|
+
description: "Show audit log links in integration replies",
|
|
13926
13927
|
enabled: false
|
|
13927
13928
|
},
|
|
13928
13929
|
["audioInput" /* AudioInput */]: {
|
|
@@ -13950,6 +13951,12 @@ var FEATURE_SWITCHES = {
|
|
|
13950
13951
|
description: "Replace the Invite people button in the agent chat page header with a New button that creates a new chat thread",
|
|
13951
13952
|
enabled: false
|
|
13952
13953
|
},
|
|
13954
|
+
["chatArtifactsDrawer" /* ChatArtifactsDrawer */]: {
|
|
13955
|
+
maintainer: "ethan@vm0.ai",
|
|
13956
|
+
description: "Show an artifacts button in the chat header that opens a drawer listing uploaded files grouped by run",
|
|
13957
|
+
enabled: false,
|
|
13958
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
13959
|
+
},
|
|
13953
13960
|
["chatThreadReadIndicator" /* ChatThreadReadIndicator */]: {
|
|
13954
13961
|
maintainer: "ethan@vm0.ai",
|
|
13955
13962
|
description: "Show the unread watermark dot and bold title for chat threads with unread messages in the sidebar",
|
|
@@ -16729,6 +16736,65 @@ Examples:
|
|
|
16729
16736
|
Download a file: zero slack download-file <file-id> -o /tmp/out.png`
|
|
16730
16737
|
);
|
|
16731
16738
|
|
|
16739
|
+
// src/commands/zero/telegram/index.ts
|
|
16740
|
+
init_esm_shims();
|
|
16741
|
+
|
|
16742
|
+
// src/commands/zero/telegram/download-file.ts
|
|
16743
|
+
init_esm_shims();
|
|
16744
|
+
import { join as join2 } from "path";
|
|
16745
|
+
import { tmpdir as tmpdir2 } from "os";
|
|
16746
|
+
function defaultOutPath2(fileId) {
|
|
16747
|
+
return join2(tmpdir2(), `telegram-${fileId}`);
|
|
16748
|
+
}
|
|
16749
|
+
var downloadFileCommand2 = new Command().name("download-file").description("Download a Telegram file by id using the bot token").argument("<file-id>", "Telegram file id from a [Telegram file] block").option(
|
|
16750
|
+
"-o, --out <path>",
|
|
16751
|
+
"Output path for the downloaded file (default: /tmp/telegram-<file-id>)"
|
|
16752
|
+
).requiredOption(
|
|
16753
|
+
"--bot-id <bot-id>",
|
|
16754
|
+
"Telegram bot id from the [Telegram file] block"
|
|
16755
|
+
).addHelpText(
|
|
16756
|
+
"after",
|
|
16757
|
+
`
|
|
16758
|
+
Examples:
|
|
16759
|
+
Download to default temp path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789
|
|
16760
|
+
Download to explicit path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789 -o /tmp/photo.jpg
|
|
16761
|
+
|
|
16762
|
+
Output:
|
|
16763
|
+
Prints a JSON object to stdout on success:
|
|
16764
|
+
{"path":"/tmp/telegram-AgACAgUAAxkBAA","mimetype":"image/jpeg","size":12345}
|
|
16765
|
+
|
|
16766
|
+
How to read the downloaded file:
|
|
16767
|
+
- Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool
|
|
16768
|
+
- Videos (mp4/mov/webm): extract frames first with
|
|
16769
|
+
ffmpeg -i <path> -vf "fps=1" -q:v 2 /tmp/<file-id>_frame_%03d.jpg
|
|
16770
|
+
then view the extracted frames
|
|
16771
|
+
- PDF/text/csv/json/markdown: read the file directly
|
|
16772
|
+
|
|
16773
|
+
Notes:
|
|
16774
|
+
- Uses the Telegram bot token on the server side
|
|
16775
|
+
- Streams the file bytes directly to disk`
|
|
16776
|
+
).action(
|
|
16777
|
+
withErrorHandler(
|
|
16778
|
+
async (fileId, options) => {
|
|
16779
|
+
const outPath = options.out ?? defaultOutPath2(fileId);
|
|
16780
|
+
const result = await downloadTelegramFile(
|
|
16781
|
+
fileId,
|
|
16782
|
+
options.botId,
|
|
16783
|
+
outPath
|
|
16784
|
+
);
|
|
16785
|
+
console.log(JSON.stringify(result));
|
|
16786
|
+
}
|
|
16787
|
+
)
|
|
16788
|
+
);
|
|
16789
|
+
|
|
16790
|
+
// src/commands/zero/telegram/index.ts
|
|
16791
|
+
var zeroTelegramCommand = new Command().name("telegram").description("Download files from Telegram as the bot").addCommand(downloadFileCommand2).addHelpText(
|
|
16792
|
+
"after",
|
|
16793
|
+
`
|
|
16794
|
+
Examples:
|
|
16795
|
+
Download a file: zero telegram download-file <file-id> --bot-id <bot-id> -o /tmp/out.jpg`
|
|
16796
|
+
);
|
|
16797
|
+
|
|
16732
16798
|
// src/commands/zero/variable/index.ts
|
|
16733
16799
|
init_esm_shims();
|
|
16734
16800
|
|
|
@@ -16977,7 +17043,7 @@ init_esm_shims();
|
|
|
16977
17043
|
// src/lib/skill-directory.ts
|
|
16978
17044
|
init_esm_shims();
|
|
16979
17045
|
import { readFileSync as readFileSync7, readdirSync } from "fs";
|
|
16980
|
-
import { join as
|
|
17046
|
+
import { join as join3 } from "path";
|
|
16981
17047
|
var IGNORED_NAMES = /* @__PURE__ */ new Set(["node_modules", ".git", ".DS_Store"]);
|
|
16982
17048
|
function readSkillDirectory(dirPath) {
|
|
16983
17049
|
const files = [];
|
|
@@ -16987,11 +17053,11 @@ function readSkillDirectory(dirPath) {
|
|
|
16987
17053
|
if (entry.name.startsWith(".") || IGNORED_NAMES.has(entry.name)) continue;
|
|
16988
17054
|
const relPath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
16989
17055
|
if (entry.isDirectory()) {
|
|
16990
|
-
walk(
|
|
17056
|
+
walk(join3(dir, entry.name), relPath);
|
|
16991
17057
|
} else {
|
|
16992
17058
|
files.push({
|
|
16993
17059
|
path: relPath,
|
|
16994
|
-
content: readFileSync7(
|
|
17060
|
+
content: readFileSync7(join3(dir, entry.name), "utf-8")
|
|
16995
17061
|
});
|
|
16996
17062
|
}
|
|
16997
17063
|
}
|
|
@@ -17753,12 +17819,12 @@ init_esm_shims();
|
|
|
17753
17819
|
import { execFile } from "child_process";
|
|
17754
17820
|
import { readFile, unlink } from "fs/promises";
|
|
17755
17821
|
import { randomUUID } from "crypto";
|
|
17756
|
-
import { join as
|
|
17757
|
-
import { tmpdir as
|
|
17822
|
+
import { join as join4 } from "path";
|
|
17823
|
+
import { tmpdir as tmpdir3 } from "os";
|
|
17758
17824
|
import { promisify } from "util";
|
|
17759
17825
|
var execFileAsync = promisify(execFile);
|
|
17760
17826
|
async function captureScreenshot() {
|
|
17761
|
-
const tmpPath =
|
|
17827
|
+
const tmpPath = join4(tmpdir3(), `vm0-screenshot-${randomUUID()}.jpg`);
|
|
17762
17828
|
try {
|
|
17763
17829
|
await execFileAsync("screencapture", ["-x", "-t", "jpg", tmpPath]);
|
|
17764
17830
|
const info = await getScreenInfo();
|
|
@@ -17787,7 +17853,7 @@ async function captureScreenshot() {
|
|
|
17787
17853
|
}
|
|
17788
17854
|
}
|
|
17789
17855
|
async function captureRegionScreenshot(region) {
|
|
17790
|
-
const tmpPath =
|
|
17856
|
+
const tmpPath = join4(tmpdir3(), `vm0-zoom-${randomUUID()}.jpg`);
|
|
17791
17857
|
try {
|
|
17792
17858
|
const regionArg = `${region.x},${region.y},${region.width},${region.height}`;
|
|
17793
17859
|
await execFileAsync("screencapture", [
|
|
@@ -18479,7 +18545,7 @@ var hostStopCommand = new Command().name("stop").description("Stop and unregiste
|
|
|
18479
18545
|
// src/commands/zero/computer-use/client.ts
|
|
18480
18546
|
init_esm_shims();
|
|
18481
18547
|
import { writeFile, mkdir } from "fs/promises";
|
|
18482
|
-
import { join as
|
|
18548
|
+
import { join as join5 } from "path";
|
|
18483
18549
|
|
|
18484
18550
|
// src/lib/computer-use/client.ts
|
|
18485
18551
|
init_esm_shims();
|
|
@@ -18547,7 +18613,7 @@ var clientScreenshotCommand = new Command().name("screenshot").description("Capt
|
|
|
18547
18613
|
const dir = "/tmp/computer-use";
|
|
18548
18614
|
await mkdir(dir, { recursive: true });
|
|
18549
18615
|
const timestamp = Date.now();
|
|
18550
|
-
const filePath =
|
|
18616
|
+
const filePath = join5(dir, `screenshot-${timestamp}.${data.format}`);
|
|
18551
18617
|
const buffer = Buffer.from(data.image, "base64");
|
|
18552
18618
|
await writeFile(filePath, buffer);
|
|
18553
18619
|
process.stdout.write(`${filePath}
|
|
@@ -18575,7 +18641,7 @@ var clientZoomCommand = new Command().name("zoom").description("Capture a region
|
|
|
18575
18641
|
const dir = "/tmp/computer-use";
|
|
18576
18642
|
await mkdir(dir, { recursive: true });
|
|
18577
18643
|
const timestamp = Date.now();
|
|
18578
|
-
const filePath =
|
|
18644
|
+
const filePath = join5(dir, `zoom-${timestamp}.${data.format}`);
|
|
18579
18645
|
const buffer = Buffer.from(data.image, "base64");
|
|
18580
18646
|
await writeFile(filePath, buffer);
|
|
18581
18647
|
process.stdout.write(`${filePath}
|
|
@@ -18772,12 +18838,12 @@ init_esm_shims();
|
|
|
18772
18838
|
|
|
18773
18839
|
// src/commands/zero/web/download-file.ts
|
|
18774
18840
|
init_esm_shims();
|
|
18775
|
-
import { join as
|
|
18776
|
-
import { tmpdir as
|
|
18777
|
-
function
|
|
18778
|
-
return
|
|
18841
|
+
import { join as join6 } from "path";
|
|
18842
|
+
import { tmpdir as tmpdir4 } from "os";
|
|
18843
|
+
function defaultOutPath3(fileId) {
|
|
18844
|
+
return join6(tmpdir4(), `web-${fileId}`);
|
|
18779
18845
|
}
|
|
18780
|
-
var
|
|
18846
|
+
var downloadFileCommand3 = new Command().name("download-file").description("Download a web-uploaded file by id").argument("<file-id>", "File id (UUID returned by the upload API)").option(
|
|
18781
18847
|
"-o, --out <path>",
|
|
18782
18848
|
"Output path for the downloaded file (default: /tmp/web-<file-id>)"
|
|
18783
18849
|
).addHelpText(
|
|
@@ -18803,7 +18869,7 @@ Notes:
|
|
|
18803
18869
|
- Streams the file bytes directly to disk`
|
|
18804
18870
|
).action(
|
|
18805
18871
|
withErrorHandler(async (fileId, options) => {
|
|
18806
|
-
const outPath = options.out ??
|
|
18872
|
+
const outPath = options.out ?? defaultOutPath3(fileId);
|
|
18807
18873
|
const result = await downloadWebFile(fileId, outPath);
|
|
18808
18874
|
console.log(JSON.stringify(result));
|
|
18809
18875
|
})
|
|
@@ -18827,7 +18893,7 @@ Notes:
|
|
|
18827
18893
|
- Returned URL is permanent (serves a short-lived signed redirect on access)
|
|
18828
18894
|
- Safe to persist in chat messages or share over external channels
|
|
18829
18895
|
- Max file size: 1 GB
|
|
18830
|
-
- Allowed types: png / jpeg / gif / webp / svg / mp4 / webm / mov / pdf / txt / csv / md / json`
|
|
18896
|
+
- Allowed types: png / jpeg / gif / webp / svg / mp4 / webm / mov / pdf / txt / csv / md / html / json`
|
|
18831
18897
|
).action(
|
|
18832
18898
|
withErrorHandler(
|
|
18833
18899
|
async (options) => {
|
|
@@ -18840,7 +18906,7 @@ Notes:
|
|
|
18840
18906
|
);
|
|
18841
18907
|
|
|
18842
18908
|
// src/commands/zero/web/index.ts
|
|
18843
|
-
var zeroWebCommand = new Command().name("web").description("Upload and download files via the web chat endpoint").addCommand(
|
|
18909
|
+
var zeroWebCommand = new Command().name("web").description("Upload and download files via the web chat endpoint").addCommand(downloadFileCommand3).addCommand(uploadFileCommand2).addHelpText(
|
|
18844
18910
|
"after",
|
|
18845
18911
|
`
|
|
18846
18912
|
Examples:
|
|
@@ -18860,6 +18926,7 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
18860
18926
|
search: "chat-message:read",
|
|
18861
18927
|
chat: "chat-message:write",
|
|
18862
18928
|
slack: "slack:write",
|
|
18929
|
+
telegram: "file:read",
|
|
18863
18930
|
whoami: null,
|
|
18864
18931
|
"developer-support": null,
|
|
18865
18932
|
"computer-use": "computer-use:write",
|
|
@@ -18876,6 +18943,7 @@ var DEFAULT_COMMANDS = [
|
|
|
18876
18943
|
zeroSecretCommand,
|
|
18877
18944
|
zeroChatCommand,
|
|
18878
18945
|
zeroSlackCommand,
|
|
18946
|
+
zeroTelegramCommand,
|
|
18879
18947
|
zeroVariableCommand,
|
|
18880
18948
|
zeroLogsCommand,
|
|
18881
18949
|
zeroSearchCommand,
|
|
@@ -18902,12 +18970,13 @@ function registerZeroCommands(prog, commands) {
|
|
|
18902
18970
|
var program = new Command();
|
|
18903
18971
|
program.name("zero").description(
|
|
18904
18972
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
18905
|
-
).version("9.
|
|
18973
|
+
).version("9.134.1").addHelpText(
|
|
18906
18974
|
"after",
|
|
18907
18975
|
`
|
|
18908
18976
|
Examples:
|
|
18909
18977
|
Check a connector? zero doctor check-connector --env-name <ENV_NAME>
|
|
18910
18978
|
Send a Slack message? zero slack message send --help
|
|
18979
|
+
Download Telegram? zero telegram download-file --help
|
|
18911
18980
|
Set up a schedule? zero schedule setup --help
|
|
18912
18981
|
Update yourself? zero agent --help
|
|
18913
18982
|
Manage custom skills? zero skill --help
|