@vm0/cli 9.270.1 → 9.271.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/{agent-KVO2AHTE.js → agent-O4PIZ7NO.js} +6 -6
- package/{banking-6JBGRQZ2.js → banking-K3T7FGVL.js} +4 -4
- package/{browser-6AAL6Z2G.js → browser-ZUXV2DZI.js} +4 -4
- package/{chat-PN7A2MC4.js → chat-FQ65YTRM.js} +5 -5
- package/{chunk-TRGD5ZVE.js → chunk-CCUKVMAH.js} +2 -2
- package/{chunk-LRNTCZW5.js → chunk-D7TEG7WN.js} +2 -2
- package/{chunk-XBAPAKU7.js → chunk-EINTZ5MX.js} +13 -5
- package/chunk-EINTZ5MX.js.map +1 -0
- package/{chunk-6APTUGDE.js → chunk-JXUQQIUP.js} +12 -4
- package/chunk-JXUQQIUP.js.map +1 -0
- package/{chunk-VD3OZARF.js → chunk-MOWAU52B.js} +2 -2
- package/{chunk-DVGDO4XK.js → chunk-RFTCX5UZ.js} +2 -2
- package/{chunk-TIFCWQ2H.js → chunk-TC7IZRA2.js} +2 -2
- package/{chunk-NZHREXMF.js → chunk-TM6A5MNI.js} +1 -11
- package/{chunk-NZHREXMF.js.map → chunk-TM6A5MNI.js.map} +1 -1
- package/{chunk-IRYWZDHD.js → chunk-TZDXFY6G.js} +289 -396
- package/chunk-TZDXFY6G.js.map +1 -0
- package/{chunk-ZAE7DA72.js → chunk-VSL4HRIA.js} +2 -2
- package/{chunk-XNBEOZ72.js → chunk-X7YXT2UE.js} +14 -9
- package/chunk-X7YXT2UE.js.map +1 -0
- package/{computer-use-RL4LFXTU.js → computer-use-LAD5XLHX.js} +4 -4
- package/{connector-65CXKHFD.js → connector-AVTEZ5M4.js} +7 -7
- package/{credit-BATZHIJM.js → credit-I45PC4IZ.js} +5 -5
- package/{developer-support-HC57MCE5.js → developer-support-HG2427DE.js} +4 -4
- package/{doctor-CZTLPLHN.js → doctor-NEF5PDLF.js} +5 -5
- package/{feishu-N4TRYP4I.js → feishu-C7TLUZNW.js} +10 -6
- package/{feishu-N4TRYP4I.js.map → feishu-C7TLUZNW.js.map} +1 -1
- package/{finance-AXTNCFO2.js → finance-QRINPXNY.js} +4 -4
- package/{generate-2WUDNC2R.js → generate-OR4TSIMU.js} +6 -6
- package/{github-Z3ZI2RYC.js → github-B6FLS3YK.js} +10 -6
- package/{github-Z3ZI2RYC.js.map → github-B6FLS3YK.js.map} +1 -1
- package/{goal-PZTLMPFS.js → goal-QXSEQGAT.js} +4 -4
- package/{host-7IU7PNIP.js → host-4TKBODTL.js} +4 -4
- package/{logs-DEQEA2ZP.js → logs-WBT4C34D.js} +7 -7
- package/{mail-VRSTZSXB.js → mail-GVDB4DW2.js} +6 -6
- package/{maps-AV5OEWNN.js → maps-7PWULA7U.js} +4 -4
- package/{model-GHSABQLU.js → model-54YGVJAR.js} +5 -5
- package/{model-provider-HJWYN6GP.js → model-provider-ZPDGFYK3.js} +5 -5
- package/{org-YKYRZPQI.js → org-4IZEIH7U.js} +4 -4
- package/package.json +1 -1
- package/{people-search-4OQEQRVD.js → people-search-3MYEUXPL.js} +4 -4
- package/{phone-6KIDS46N.js → phone-374WD72N.js} +10 -6
- package/{phone-6KIDS46N.js.map → phone-374WD72N.js.map} +1 -1
- package/{preference-BQVHQ6QD.js → preference-6MJRMHWU.js} +4 -4
- package/{resource-GB6GNOG4.js → resource-LHAF45BR.js} +5 -5
- package/{scrape-GG3RREIS.js → scrape-IWNRA5Y6.js} +4 -4
- package/{search-GHER6HN2.js → search-D65TMXEQ.js} +7 -7
- package/{secret-LCXB3H4Z.js → secret-HCD3ZCX2.js} +4 -4
- package/{slack-OIZNRNOX.js → slack-R4LKBTX6.js} +9 -5
- package/slack-R4LKBTX6.js.map +1 -0
- package/{teams-LGUWTNHC.js → teams-3JJJ2G3A.js} +10 -6
- package/{teams-LGUWTNHC.js.map → teams-3JJJ2G3A.js.map} +1 -1
- package/{telegram-TKRKSM3A.js → telegram-2E2UM67J.js} +10 -6
- package/{telegram-TKRKSM3A.js.map → telegram-2E2UM67J.js.map} +1 -1
- package/{upgrade-MJNLJUGT.js → upgrade-J6FYUUYV.js} +3 -3
- package/{variable-ET7USLRD.js → variable-YXJ6NH3N.js} +4 -4
- package/{video-AGASRAND.js → video-GYS2CSQF.js} +3 -3
- package/{weather-HHZJCP3Y.js → weather-N5IWRZPG.js} +4 -4
- package/{web-XUTUHLJZ.js → web-LPR6C2K7.js} +4 -4
- package/{web-search-UTGH6NH5.js → web-search-BT6BDI5E.js} +4 -4
- package/{whoami-EIGE5O6D.js → whoami-YV26HEXS.js} +6 -6
- package/{workflow-IC64RX7P.js → workflow-T2R3IE2A.js} +5 -5
- package/zero.js +43 -43
- package/chunk-6APTUGDE.js.map +0 -1
- package/chunk-IRYWZDHD.js.map +0 -1
- package/chunk-XBAPAKU7.js.map +0 -1
- package/chunk-XNBEOZ72.js.map +0 -1
- package/slack-OIZNRNOX.js.map +0 -1
- /package/{agent-KVO2AHTE.js.map → agent-O4PIZ7NO.js.map} +0 -0
- /package/{banking-6JBGRQZ2.js.map → banking-K3T7FGVL.js.map} +0 -0
- /package/{browser-6AAL6Z2G.js.map → browser-ZUXV2DZI.js.map} +0 -0
- /package/{chat-PN7A2MC4.js.map → chat-FQ65YTRM.js.map} +0 -0
- /package/{chunk-TRGD5ZVE.js.map → chunk-CCUKVMAH.js.map} +0 -0
- /package/{chunk-LRNTCZW5.js.map → chunk-D7TEG7WN.js.map} +0 -0
- /package/{chunk-VD3OZARF.js.map → chunk-MOWAU52B.js.map} +0 -0
- /package/{chunk-DVGDO4XK.js.map → chunk-RFTCX5UZ.js.map} +0 -0
- /package/{chunk-TIFCWQ2H.js.map → chunk-TC7IZRA2.js.map} +0 -0
- /package/{chunk-ZAE7DA72.js.map → chunk-VSL4HRIA.js.map} +0 -0
- /package/{computer-use-RL4LFXTU.js.map → computer-use-LAD5XLHX.js.map} +0 -0
- /package/{connector-65CXKHFD.js.map → connector-AVTEZ5M4.js.map} +0 -0
- /package/{credit-BATZHIJM.js.map → credit-I45PC4IZ.js.map} +0 -0
- /package/{developer-support-HC57MCE5.js.map → developer-support-HG2427DE.js.map} +0 -0
- /package/{doctor-CZTLPLHN.js.map → doctor-NEF5PDLF.js.map} +0 -0
- /package/{finance-AXTNCFO2.js.map → finance-QRINPXNY.js.map} +0 -0
- /package/{generate-2WUDNC2R.js.map → generate-OR4TSIMU.js.map} +0 -0
- /package/{goal-PZTLMPFS.js.map → goal-QXSEQGAT.js.map} +0 -0
- /package/{host-7IU7PNIP.js.map → host-4TKBODTL.js.map} +0 -0
- /package/{logs-DEQEA2ZP.js.map → logs-WBT4C34D.js.map} +0 -0
- /package/{mail-VRSTZSXB.js.map → mail-GVDB4DW2.js.map} +0 -0
- /package/{maps-AV5OEWNN.js.map → maps-7PWULA7U.js.map} +0 -0
- /package/{model-GHSABQLU.js.map → model-54YGVJAR.js.map} +0 -0
- /package/{model-provider-HJWYN6GP.js.map → model-provider-ZPDGFYK3.js.map} +0 -0
- /package/{org-YKYRZPQI.js.map → org-4IZEIH7U.js.map} +0 -0
- /package/{people-search-4OQEQRVD.js.map → people-search-3MYEUXPL.js.map} +0 -0
- /package/{preference-BQVHQ6QD.js.map → preference-6MJRMHWU.js.map} +0 -0
- /package/{resource-GB6GNOG4.js.map → resource-LHAF45BR.js.map} +0 -0
- /package/{scrape-GG3RREIS.js.map → scrape-IWNRA5Y6.js.map} +0 -0
- /package/{search-GHER6HN2.js.map → search-D65TMXEQ.js.map} +0 -0
- /package/{secret-LCXB3H4Z.js.map → secret-HCD3ZCX2.js.map} +0 -0
- /package/{upgrade-MJNLJUGT.js.map → upgrade-J6FYUUYV.js.map} +0 -0
- /package/{variable-ET7USLRD.js.map → variable-YXJ6NH3N.js.map} +0 -0
- /package/{video-AGASRAND.js.map → video-GYS2CSQF.js.map} +0 -0
- /package/{weather-HHZJCP3Y.js.map → weather-N5IWRZPG.js.map} +0 -0
- /package/{web-XUTUHLJZ.js.map → web-LPR6C2K7.js.map} +0 -0
- /package/{web-search-UTGH6NH5.js.map → web-search-BT6BDI5E.js.map} +0 -0
- /package/{whoami-EIGE5O6D.js.map → whoami-YV26HEXS.js.map} +0 -0
- /package/{workflow-IC64RX7P.js.map → workflow-T2R3IE2A.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/teams/index.ts","../src/commands/zero/teams/message/index.ts","../src/commands/zero/teams/message/send.ts","../src/commands/zero/teams/upload-file.ts","../src/commands/zero/teams/download-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroTeamsMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\nimport { downloadFileCommand } from \"./download-file\";\n\nexport const zeroTeamsCommand = new Command()\n .name(\"teams\")\n .description(\n \"Send messages, upload files, and download files from Microsoft Teams as the bot\",\n )\n .addCommand(zeroTeamsMessageCommand)\n .addCommand(uploadFileCommand)\n .addCommand(downloadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n Send a message: zero teams message send -c <conversation-id> -t \"Hello!\"\n DM a user: zero teams message send -u me -t \"Hello!\"\n Reply in a thread: zero teams message send -c <conversation-id> --thread <activity-id> -t \"reply\"\n Upload a file: zero teams upload-file -f /tmp/report.pdf -c <conversation-id>\n Download a file: zero teams download-file <file-id> -o /tmp/out.png`,\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroTeamsMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Microsoft Teams messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero teams message send -c <conversation-id> -t \"Hello!\"\n zero teams message send -u me -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport type { SendTeamsMessageBody } from \"@vm0/api-contracts/contracts/integrations\";\nimport chalk from \"chalk\";\nimport { sendTeamsMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\ntype TeamsCardInput = NonNullable<SendTeamsMessageBody[\"card\"]>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseTeamsCard(value: string): TeamsCardInput {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new Error(\"Invalid JSON for --card flag\", {\n cause: new Error(\"Provide a valid Adaptive Card JSON object\"),\n });\n }\n\n if (\n !isRecord(parsed) ||\n parsed.type !== \"AdaptiveCard\" ||\n typeof parsed.version !== \"string\"\n ) {\n throw new Error(\"Invalid Adaptive Card for --card flag\", {\n cause: new Error(\n 'Provide a JSON object with \"type\": \"AdaptiveCard\" and a version',\n ),\n });\n }\n\n return parsed as TeamsCardInput;\n}\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Microsoft Teams conversation or DM a user\")\n .option(\"-c, --conversation-id <id>\", \"Teams conversation ID\")\n .option(\"-u, --user <id>\", 'Teams user ID for DM (use \"me\" for yourself)')\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--activity-id <id>\", \"Activity ID to reply to\")\n .option(\"--thread <id>\", \"Alias for --activity-id\")\n .option(\"--card <json>\", \"Adaptive Card JSON string\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero teams message send -c 19:thread@thread.tacv2 -t \"Hello!\"\n DM a user: zero teams message send -u 29:user-id -t \"Hello!\"\n DM yourself: zero teams message send -u me -t \"Hello!\"\n Thread reply: zero teams message send -c 19:thread@thread.tacv2 --thread root-activity -t \"reply\"\n Adaptive Card: zero teams message send -c 19:thread@thread.tacv2 --card '{\"type\":\"AdaptiveCard\",\"version\":\"1.4\",\"body\":[{\"type\":\"TextBlock\",\"text\":\"Hello\",\"wrap\":true}]}'\n\nNotes:\n - Either --conversation-id or --user is required; they are mutually exclusive\n - Either --text or --card is required; text can be provided with --text or piped on stdin\n - Use the Conversation ID and Activity ID from the current Teams run prompt`,\n )\n .action(\n withErrorHandler(\n async (options: {\n conversationId?: string;\n user?: string;\n text?: string;\n activityId?: string;\n thread?: string;\n card?: string;\n }) => {\n let text = options.text;\n const { conversationId, user, card: cardJson } = options;\n\n if (!conversationId && !user) {\n throw new Error(\n \"Either --conversation-id or --user must be provided\",\n {\n cause: new Error(\n 'Usage: zero teams message send -c CONVERSATION_ID -t \"your message\"\\n zero teams message send -u USER_ID -t \"your message\"',\n ),\n },\n );\n }\n if (conversationId && user) {\n throw new Error(\n \"--conversation-id and --user are mutually exclusive\",\n {\n cause: new Error(\n \"Provide either --conversation-id to send to a conversation or --user to DM a user, not both\",\n ),\n },\n );\n }\n\n const activityId = options.activityId ?? options.thread;\n if (user && activityId) {\n throw new Error(\n \"--activity-id and --thread can only be used with --conversation-id\",\n {\n cause: new Error(\n \"Thread replies require an existing Teams conversation\",\n ),\n },\n );\n }\n\n if (!text && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin not readable; fall through to the missing-text validation.\n }\n }\n\n const card = cardJson ? parseTeamsCard(cardJson) : undefined;\n\n if (!text && !card) {\n throw new Error(\n \"Either --text, --card, or piped stdin must be provided\",\n {\n cause: new Error(\n 'Usage: zero teams message send -c CONVERSATION_ID -t \"your message\"',\n ),\n },\n );\n }\n\n const body: SendTeamsMessageBody = {\n ...(conversationId ? { conversationId } : { user }),\n ...(activityId ? { activityId } : {}),\n ...(text ? { text } : {}),\n ...(card ? { card } : {}),\n };\n const result = await sendTeamsMessage({\n ...body,\n });\n\n const activityInfo = result.activityId\n ? ` (activity_id: ${result.activityId})`\n : \"\";\n console.log(chalk.green(`✓ Message sent${activityInfo}`));\n },\n ),\n );\n","import { readFileSync, statSync } from \"fs\";\nimport { basename, extname } from \"path\";\nimport { Command } from \"commander\";\nimport { completeTeamsFileUpload, initTeamsFileUpload } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mov\": \"video/quicktime\",\n \".pdf\": \"application/pdf\",\n \".txt\": \"text/plain\",\n \".csv\": \"text/csv\",\n \".md\": \"text/markdown\",\n \".json\": \"application/json\",\n};\n\nfunction inferContentType(localPath: string): string {\n const ext = extname(localPath).toLowerCase();\n return MIME_BY_EXTENSION[ext] ?? \"application/octet-stream\";\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\n \"Upload a local file to a Microsoft Teams conversation as the bot\",\n )\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"-c, --conversation-id <id>\", \"Teams conversation ID\")\n .option(\"--activity-id <id>\", \"Activity ID to reply to\")\n .option(\"-t, --text <message>\", \"Message text to accompany the file\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero teams upload-file -f /tmp/report.pdf -c 19:thread@thread.tacv2\n Upload to thread: zero teams upload-file -f /tmp/log.txt -c 19:thread@thread.tacv2 --activity-id root-activity\n With message text: zero teams upload-file -f /tmp/data.csv -c 19:thread@thread.tacv2 -t \"Daily report\"\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"activityId\":\"...\",\"conversationId\":\"19:...\",\"filename\":\"report.pdf\",\"mimetype\":\"application/pdf\",\"size\":12345,\"url\":\"https://...\"}\n\nNotes:\n - Uploads through VM0 storage first, then sends the Teams message with the file URL\n - Use the Conversation ID and Activity ID from the current Teams run prompt`,\n )\n .action(\n withErrorHandler(\n async (options: {\n file: string;\n conversationId: string;\n activityId?: string;\n text?: string;\n contentType?: string;\n }) => {\n let fileSize: number;\n try {\n const stat = statSync(options.file);\n if (!stat.isFile()) {\n throw new Error(`Not a regular file: ${options.file}`);\n }\n fileSize = stat.size;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"Not \")) {\n throw error;\n }\n throw new Error(`File not found: ${options.file}`);\n }\n\n if (fileSize === 0) {\n throw new Error(\"File is empty\");\n }\n\n const filename = basename(options.file);\n const contentType =\n options.contentType ?? inferContentType(options.file);\n const prepared = await initTeamsFileUpload({\n filename,\n contentType,\n length: fileSize,\n });\n\n const fileContent = readFileSync(options.file);\n const uploadResponse = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": prepared.contentType },\n body: new Uint8Array(fileContent),\n });\n\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n\n const result = await completeTeamsFileUpload({\n uploadId: prepared.uploadId,\n conversationId: options.conversationId,\n activityId: options.activityId,\n contentType: prepared.contentType,\n text: options.text,\n });\n\n console.log(JSON.stringify(result));\n },\n ),\n );\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadTeamsFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nfunction defaultOutPath(fileId: string): string {\n return join(tmpdir(), `teams-${basename(fileId).slice(0, 48)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Microsoft Teams file by signed file id\")\n .argument(\"<file-id>\", \"Microsoft Teams file id from a [Teams file] block\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/teams-<file-id>)\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero teams download-file <file-id>\n Download to explicit path: zero teams download-file <file-id> -o /tmp/file.png\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/teams-...\",\"mimetype\":\"image/png\",\"size\":12345}\n\nNotes:\n - Use the file id from a [Teams file] block in the prompt\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(async (fileId: string, options: { out?: string }) => {\n const outPath = options.out ?? defaultOutPath(fileId);\n const result = await downloadTeamsFile(fileId, outPath);\n console.log(JSON.stringify(result));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,SAAS,oBAAoB;AAS7B,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,eAAe,OAA+B;AACrD,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,KAAK;AAAA,EAC3B,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC;AAAA,MAC9C,OAAO,IAAI,MAAM,2CAA2C;AAAA,IAC9D,CAAC;AAAA,EACH;AAEA,MACE,CAAC,SAAS,MAAM,KAChB,OAAO,SAAS,kBAChB,OAAO,OAAO,YAAY,UAC1B;AACA,UAAM,IAAI,MAAM,yCAAyC;AAAA,MACvD,OAAO,IAAI;AAAA,QACT;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAEO,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,YAAY,+DAA+D,EAC3E,OAAO,8BAA8B,uBAAuB,EAC5D,OAAO,mBAAmB,8CAA8C,EACxE,OAAO,wBAAwB,cAAc,EAC7C,OAAO,sBAAsB,yBAAyB,EACtD,OAAO,iBAAiB,yBAAyB,EACjD,OAAO,iBAAiB,2BAA2B,EACnD;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYF,EACC;AAAA,EACC;AAAA,IACE,OAAO,YAOD;AACJ,UAAI,OAAO,QAAQ;AACnB,YAAM,EAAE,gBAAgB,MAAM,MAAM,SAAS,IAAI;AAEjD,UAAI,CAAC,kBAAkB,CAAC,MAAM;AAC5B,cAAM,IAAI;AAAA,UACR;AAAA,UACA;AAAA,YACE,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AAA;AAYF,EACC;AAAA,EACC,iBAAiB,OAAO,QAAgB,YAA8B;AACpE,UAAM,UAAU,QAAQ,OAAO,eAAe,MAAM;AACpD,UAAM,SAAS,MAAM,kBAAkB,QAAQ,OAAO;AACtD,YAAQ,IAAI,KAAK,UAAU,MAAM,CAAC;AAAA,EACpC,CAAC;AACH;;;AJlCK,IAAM,mBAAmB,IAAI,QAAQ,EACzC,KAAK,OAAO,EACZ;AAAA,EACC;AACF,EACC,WAAW,uBAAuB,EAClC,WAAW,iBAAiB,EAC5B,WAAW,mBAAmB,EAC9B;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOF;","names":["readFileSync","readFileSync","basename","basename"]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/teams/index.ts","../src/commands/zero/teams/message/index.ts","../src/commands/zero/teams/message/send.ts","../src/commands/zero/teams/upload-file.ts","../src/commands/zero/teams/download-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroTeamsMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\nimport { downloadFileCommand } from \"./download-file\";\n\nexport const zeroTeamsCommand = new Command()\n .name(\"teams\")\n .description(\n \"Send messages, upload files, and download files from Microsoft Teams as the bot\",\n )\n .addCommand(zeroTeamsMessageCommand)\n .addCommand(uploadFileCommand)\n .addCommand(downloadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n Send a message: zero teams message send -c <conversation-id> -t \"Hello!\"\n DM a user: zero teams message send -u me -t \"Hello!\"\n Reply in a thread: zero teams message send -c <conversation-id> --thread <activity-id> -t \"reply\"\n Upload a file: zero teams upload-file -f /tmp/report.pdf -c <conversation-id>\n Download a file: zero teams download-file <file-id> -o /tmp/out.png`,\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroTeamsMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Microsoft Teams messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero teams message send -c <conversation-id> -t \"Hello!\"\n zero teams message send -u me -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport type { SendTeamsMessageBody } from \"@vm0/api-contracts/contracts/integrations\";\nimport chalk from \"chalk\";\nimport { sendTeamsMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\ntype TeamsCardInput = NonNullable<SendTeamsMessageBody[\"card\"]>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseTeamsCard(value: string): TeamsCardInput {\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch {\n throw new Error(\"Invalid JSON for --card flag\", {\n cause: new Error(\"Provide a valid Adaptive Card JSON object\"),\n });\n }\n\n if (\n !isRecord(parsed) ||\n parsed.type !== \"AdaptiveCard\" ||\n typeof parsed.version !== \"string\"\n ) {\n throw new Error(\"Invalid Adaptive Card for --card flag\", {\n cause: new Error(\n 'Provide a JSON object with \"type\": \"AdaptiveCard\" and a version',\n ),\n });\n }\n\n return parsed as TeamsCardInput;\n}\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Microsoft Teams conversation or DM a user\")\n .option(\"-c, --conversation-id <id>\", \"Teams conversation ID\")\n .option(\"-u, --user <id>\", 'Teams user ID for DM (use \"me\" for yourself)')\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--activity-id <id>\", \"Activity ID to reply to\")\n .option(\"--thread <id>\", \"Alias for --activity-id\")\n .option(\"--card <json>\", \"Adaptive Card JSON string\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero teams message send -c 19:thread@thread.tacv2 -t \"Hello!\"\n DM a user: zero teams message send -u 29:user-id -t \"Hello!\"\n DM yourself: zero teams message send -u me -t \"Hello!\"\n Thread reply: zero teams message send -c 19:thread@thread.tacv2 --thread root-activity -t \"reply\"\n Adaptive Card: zero teams message send -c 19:thread@thread.tacv2 --card '{\"type\":\"AdaptiveCard\",\"version\":\"1.4\",\"body\":[{\"type\":\"TextBlock\",\"text\":\"Hello\",\"wrap\":true}]}'\n\nNotes:\n - Either --conversation-id or --user is required; they are mutually exclusive\n - Either --text or --card is required; text can be provided with --text or piped on stdin\n - Use the Conversation ID and Activity ID from the current Teams run prompt`,\n )\n .action(\n withErrorHandler(\n async (options: {\n conversationId?: string;\n user?: string;\n text?: string;\n activityId?: string;\n thread?: string;\n card?: string;\n }) => {\n let text = options.text;\n const { conversationId, user, card: cardJson } = options;\n\n if (!conversationId && !user) {\n throw new Error(\n \"Either --conversation-id or --user must be provided\",\n {\n cause: new Error(\n 'Usage: zero teams message send -c CONVERSATION_ID -t \"your message\"\\n zero teams message send -u USER_ID -t \"your message\"',\n ),\n },\n );\n }\n if (conversationId && user) {\n throw new Error(\n \"--conversation-id and --user are mutually exclusive\",\n {\n cause: new Error(\n \"Provide either --conversation-id to send to a conversation or --user to DM a user, not both\",\n ),\n },\n );\n }\n\n const activityId = options.activityId ?? options.thread;\n if (user && activityId) {\n throw new Error(\n \"--activity-id and --thread can only be used with --conversation-id\",\n {\n cause: new Error(\n \"Thread replies require an existing Teams conversation\",\n ),\n },\n );\n }\n\n if (!text && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin not readable; fall through to the missing-text validation.\n }\n }\n\n const card = cardJson ? parseTeamsCard(cardJson) : undefined;\n\n if (!text && !card) {\n throw new Error(\n \"Either --text, --card, or piped stdin must be provided\",\n {\n cause: new Error(\n 'Usage: zero teams message send -c CONVERSATION_ID -t \"your message\"',\n ),\n },\n );\n }\n\n const body: SendTeamsMessageBody = {\n ...(conversationId ? { conversationId } : { user }),\n ...(activityId ? { activityId } : {}),\n ...(text ? { text } : {}),\n ...(card ? { card } : {}),\n };\n const result = await sendTeamsMessage({\n ...body,\n });\n\n const activityInfo = result.activityId\n ? ` (activity_id: ${result.activityId})`\n : \"\";\n console.log(chalk.green(`✓ Message sent${activityInfo}`));\n },\n ),\n );\n","import { readFileSync, statSync } from \"fs\";\nimport { basename, extname } from \"path\";\nimport { Command } from \"commander\";\nimport { completeTeamsFileUpload, initTeamsFileUpload } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mov\": \"video/quicktime\",\n \".pdf\": \"application/pdf\",\n \".txt\": \"text/plain\",\n \".csv\": \"text/csv\",\n \".md\": \"text/markdown\",\n \".json\": \"application/json\",\n};\n\nfunction inferContentType(localPath: string): string {\n const ext = extname(localPath).toLowerCase();\n return MIME_BY_EXTENSION[ext] ?? \"application/octet-stream\";\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\n \"Upload a local file to a Microsoft Teams conversation as the bot\",\n )\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"-c, --conversation-id <id>\", \"Teams conversation ID\")\n .option(\"--activity-id <id>\", \"Activity ID to reply to\")\n .option(\"-t, --text <message>\", \"Message text to accompany the file\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero teams upload-file -f /tmp/report.pdf -c 19:thread@thread.tacv2\n Upload to thread: zero teams upload-file -f /tmp/log.txt -c 19:thread@thread.tacv2 --activity-id root-activity\n With message text: zero teams upload-file -f /tmp/data.csv -c 19:thread@thread.tacv2 -t \"Daily report\"\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"activityId\":\"...\",\"conversationId\":\"19:...\",\"filename\":\"report.pdf\",\"mimetype\":\"application/pdf\",\"size\":12345,\"url\":\"https://...\"}\n\nNotes:\n - Uploads through VM0 storage first, then sends the Teams message with the file URL\n - Use the Conversation ID and Activity ID from the current Teams run prompt`,\n )\n .action(\n withErrorHandler(\n async (options: {\n file: string;\n conversationId: string;\n activityId?: string;\n text?: string;\n contentType?: string;\n }) => {\n let fileSize: number;\n try {\n const stat = statSync(options.file);\n if (!stat.isFile()) {\n throw new Error(`Not a regular file: ${options.file}`);\n }\n fileSize = stat.size;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"Not \")) {\n throw error;\n }\n throw new Error(`File not found: ${options.file}`);\n }\n\n if (fileSize === 0) {\n throw new Error(\"File is empty\");\n }\n\n const filename = basename(options.file);\n const contentType =\n options.contentType ?? inferContentType(options.file);\n const prepared = await initTeamsFileUpload({\n filename,\n contentType,\n length: fileSize,\n supportsUploadHeaders: true,\n });\n\n const fileContent = readFileSync(options.file);\n const uploadResponse = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": prepared.contentType,\n ...prepared.uploadHeaders,\n },\n body: new Uint8Array(fileContent),\n });\n\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n\n const result = await completeTeamsFileUpload({\n uploadId: prepared.uploadId,\n conversationId: options.conversationId,\n activityId: options.activityId,\n contentType: prepared.contentType,\n text: options.text,\n });\n\n console.log(JSON.stringify(result));\n },\n ),\n );\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadTeamsFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nfunction defaultOutPath(fileId: string): string {\n return join(tmpdir(), `teams-${basename(fileId).slice(0, 48)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Microsoft Teams file by signed file id\")\n .argument(\"<file-id>\", \"Microsoft Teams file id from a [Teams file] block\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/teams-<file-id>)\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero teams download-file <file-id>\n Download to explicit path: zero teams download-file <file-id> -o /tmp/file.png\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/teams-...\",\"mimetype\":\"image/png\",\"size\":12345}\n\nNotes:\n - Use the file id from a [Teams file] block in the prompt\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(async (fileId: string, options: { out?: string }) => {\n const outPath = options.out ?? defaultOutPath(fileId);\n const result = await downloadTeamsFile(fileId, outPath);\n console.log(JSON.stringify(result));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,SAAS,oBAAoB;AAS7B,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,eAAe,OAA+B;AACrD,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,KAAK;AAAA,EAC3B,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC;AAAA,MAC9C,OAAO,IAAI,MAAM,2CAA2C;AAAA,IAC9D,CAAC;AAAA,EACH;AAEA,MACE,CAAC,SAAS,MAAM,KAChB,OAAO,SAAS,kBAChB,OAAO,OAAO,YAAY,UAC1B;AACA,UAAM,IAAI,MAAM,yCAAyC;AAAA,MACvD,OAAO,IAAI;AAAA,QACT;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAEO,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,YAAY,+DAA+D,EAC3E,OAAO,8BAA8B,uBAAuB,EAC5D,OAAO,mBAAmB,8CAA8C,EACxE,OAAO,wBAAwB,cAAc,EAC7C,OAAO,sBAAsB,yBAAyB,EACtD,OAAO,iBAAiB,yBAAyB,EACjD,OAAO,iBAAiB,2BAA2B,EACnD;AAAA,EACC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AAc;AAKvB,SAAS,eAAe,QAAwB;AAC9C,SAAO,KAAK,OAAO,GAAG,SAASC,UAAS,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE;AAChE;AAEO,IAAM,sBAAsB,IAAI,QAAQ,EAC5C,KAAK,eAAe,EACpB,YAAY,mDAAmD,EAC/D,SAAS,aAAa,mDAAmD,EACzE;AAAA,EACC;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYF,EACC;AAAA,EACC,iBAAiB,OAAO,QAAgB,YAA8B;AACpE,UAAM,UAAU,QAAQ,OAAO,eAAe,MAAM;AACpD,UAAM,SAAS,MAAM,kBAAkB,QAAQ,OAAO;AACtD,YAAQ,IAAI,KAAK,UAAU,MAAM,CAAC;AAAA,EACpC,CAAC;AACH;;;AJlCK,IAAM,mBAAmB,IAAI,QAAQ,EACzC,KAAK,OAAO,EACZ;AAAA,EACC;AACF,EACC,WAAW,uBAAuB,EAClC,WAAW,iBAAiB,EAC5B,WAAW,mBAAmB,EAC9B;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOF;","names":["readFileSync","readFileSync","basename","basename"]}
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
initTelegramFileUpload,
|
|
8
8
|
listTelegramBots,
|
|
9
9
|
sendTelegramMessage
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-TZDXFY6G.js";
|
|
11
|
+
import "./chunk-JXUQQIUP.js";
|
|
12
12
|
import "./chunk-MA22KQYU.js";
|
|
13
13
|
import {
|
|
14
14
|
source_default,
|
|
15
15
|
withErrorHandler
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-D7TEG7WN.js";
|
|
17
17
|
import "./chunk-MD3YWUKO.js";
|
|
18
18
|
import {
|
|
19
19
|
Command
|
|
@@ -293,12 +293,16 @@ Notes:
|
|
|
293
293
|
const prepared = await initTelegramFileUpload({
|
|
294
294
|
filename,
|
|
295
295
|
contentType,
|
|
296
|
-
length: fileSize
|
|
296
|
+
length: fileSize,
|
|
297
|
+
supportsUploadHeaders: true
|
|
297
298
|
});
|
|
298
299
|
const fileContent = readFileSync2(options.file);
|
|
299
300
|
const uploadResponse = await fetch(prepared.uploadUrl, {
|
|
300
301
|
method: "PUT",
|
|
301
|
-
headers: {
|
|
302
|
+
headers: {
|
|
303
|
+
"Content-Type": prepared.contentType,
|
|
304
|
+
...prepared.uploadHeaders
|
|
305
|
+
},
|
|
302
306
|
body: new Uint8Array(fileContent)
|
|
303
307
|
});
|
|
304
308
|
if (!uploadResponse.ok) {
|
|
@@ -334,4 +338,4 @@ Examples:
|
|
|
334
338
|
export {
|
|
335
339
|
zeroTelegramCommand
|
|
336
340
|
};
|
|
337
|
-
//# sourceMappingURL=telegram-
|
|
341
|
+
//# sourceMappingURL=telegram-2E2UM67J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/telegram/index.ts","../src/commands/zero/telegram/bot/index.ts","../src/commands/zero/telegram/bot/list.ts","../src/commands/zero/telegram/download-file.ts","../src/commands/zero/telegram/message/index.ts","../src/commands/zero/telegram/message/send.ts","../src/commands/zero/telegram/upload-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroTelegramBotCommand } from \"./bot\";\nimport { downloadFileCommand } from \"./download-file\";\nimport { zeroTelegramMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\n\nexport const zeroTelegramCommand = new Command()\n .name(\"telegram\")\n .description(\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n )\n .addCommand(zeroTelegramBotCommand)\n .addCommand(zeroTelegramMessageCommand)\n .addCommand(downloadFileCommand)\n .addCommand(uploadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n List bots: zero telegram bot list\n Send a message: zero telegram message send --bot-id <bot-id> -c <chat-id> -t \"Hello!\"\n Upload a file: zero telegram upload-file -f /tmp/report.pdf --bot-id <bot-id> -c <chat-id>\n Download a file: zero telegram download-file <file-id> --bot-id <bot-id> -o /tmp/out.jpg`,\n );\n","import { Command } from \"commander\";\nimport { listCommand } from \"./list\";\n\nexport const zeroTelegramBotCommand = new Command()\n .name(\"bot\")\n .description(\"Inspect Telegram bots\")\n .addCommand(listCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram bot list`,\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listTelegramBots } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\nimport type { TelegramBotListItem } from \"@vm0/api-contracts/contracts/integrations\";\n\nfunction usernameLabel(bot: TelegramBotListItem): string {\n if (!bot.username) return \"-\";\n return bot.username.startsWith(\"@\") ? bot.username : `@${bot.username}`;\n}\n\nfunction statusLabel(bot: TelegramBotListItem): string {\n if (bot.tokenStatus === \"valid\") return chalk.green(\"valid\");\n if (bot.tokenStatus === \"invalid\") return chalk.red(\"invalid\");\n return chalk.yellow(\"unknown\");\n}\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List Telegram bots available in the active organization\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram bot list\n\nNotes:\n - Use this to find the --bot-id value before sending Telegram messages.`,\n )\n .action(\n withErrorHandler(async () => {\n const result = await listTelegramBots();\n const { bots } = result;\n\n if (bots.length === 0) {\n console.log(chalk.dim(\"No Telegram bots found\"));\n console.log(\n chalk.dim(\" Add one from Settings > Integrations > Telegram\"),\n );\n return;\n }\n\n const botIdWidth = Math.max(\n 6,\n ...bots.map((bot) => {\n return bot.id.length;\n }),\n );\n const usernameWidth = Math.max(\n 8,\n ...bots.map((bot) => {\n return usernameLabel(bot).length;\n }),\n );\n const agentWidth = Math.max(\n 5,\n ...bots.map((bot) => {\n return (bot.agent?.name ?? \"-\").length;\n }),\n );\n\n const header = [\n \"BOT ID\".padEnd(botIdWidth),\n \"USERNAME\".padEnd(usernameWidth),\n \"AGENT\".padEnd(agentWidth),\n \"CONNECTED\",\n \"TOKEN\",\n ].join(\" \");\n console.log(chalk.dim(header));\n\n for (const bot of bots) {\n const row = [\n bot.id.padEnd(botIdWidth),\n usernameLabel(bot).padEnd(usernameWidth),\n (bot.agent?.name ?? \"-\").padEnd(agentWidth),\n (bot.isConnected ? \"yes\" : \"no\").padEnd(9),\n statusLabel(bot),\n ].join(\" \");\n console.log(row);\n }\n }),\n );\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadTelegramFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\n/**\n * Derive a local output path for a Telegram file id.\n * Uses the system temp directory.\n *\n * `basename` strips any path separators from `fileId` so a hostile id like\n * `../etc/passwd` cannot escape `tmpdir()`.\n */\nfunction defaultOutPath(fileId: string): string {\n return join(tmpdir(), `telegram-${basename(fileId)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Telegram file by id using the bot token\")\n .argument(\"<file-id>\", \"Telegram file id from a [Telegram file] block\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/telegram-<file-id>)\",\n )\n .requiredOption(\n \"--bot-id <bot-id>\",\n \"Telegram bot id from the [Telegram file] block\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789\n Download to explicit path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789 -o /tmp/photo.jpg\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/telegram-AgACAgUAAxkBAA\",\"mimetype\":\"image/jpeg\",\"size\":12345}\n\nHow to read the downloaded file:\n - Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool\n - Videos (mp4/mov/webm): transcribe audio first with\n zero video transcribe --url <download-url>\n or extract frames with\n ffmpeg -i <path> -vf \"fps=1\" -q:v 2 /tmp/<file-id>_frame_%03d.jpg\n - PDF/text/csv/json/markdown: read the file directly\n\nNotes:\n - Uses the Telegram bot token on the server side\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(\n async (fileId: string, options: { out?: string; botId: string }) => {\n const outPath = options.out ?? defaultOutPath(fileId);\n const result = await downloadTelegramFile(\n fileId,\n options.botId,\n outPath,\n );\n console.log(JSON.stringify(result));\n },\n ),\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroTelegramMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Telegram messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram message send --bot-id <bot-id> -c <chat-id> -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sendTelegramMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\nfunction parsePositiveInteger(value: string, flag: string): number {\n const parsed = Number(value);\n if (!Number.isInteger(parsed) || parsed <= 0) {\n throw new Error(`${flag} must be a positive integer`);\n }\n return parsed;\n}\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Telegram chat as the bot\")\n .requiredOption(\"--bot-id <id>\", \"Telegram bot ID\")\n .requiredOption(\"-c, --chat-id <id>\", \"Telegram chat ID\")\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--reply-to-message-id <id>\", \"Message ID to reply to\")\n .option(\"--message-thread-id <id>\", \"Telegram forum topic thread ID\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero telegram message send --bot-id 123456789 -c -1001234567890 -t \"Hello!\"\n Reply to message: zero telegram message send --bot-id 123456789 -c -1001234567890 --reply-to-message-id 42 -t \"reply\"\n Forum topic message: zero telegram message send --bot-id 123456789 -c -1001234567890 --message-thread-id 7 -t \"topic update\"\n\nNotes:\n - Message text can be provided with --text or piped on stdin\n - Choose an explicit --bot-id. Run \"zero telegram bot list\" to inspect available bots.`,\n )\n .action(\n withErrorHandler(\n async (options: {\n botId: string;\n chatId: string;\n text?: string;\n replyToMessageId?: string;\n messageThreadId?: string;\n }) => {\n let text = options.text;\n if (!text && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin not readable (e.g. test runner with no piped input);\n // fall through to the missing-text validation below.\n }\n }\n\n if (!text) {\n throw new Error(\"Either --text or piped stdin must be provided\", {\n cause: new Error(\n 'Usage: zero telegram message send --bot-id BOT_ID -c CHAT_ID -t \"your message\"',\n ),\n });\n }\n\n const result = await sendTelegramMessage({\n botId: options.botId,\n chatId: options.chatId,\n text,\n replyToMessageId: options.replyToMessageId\n ? parsePositiveInteger(\n options.replyToMessageId,\n \"reply-to-message-id\",\n )\n : undefined,\n messageThreadId: options.messageThreadId\n ? parsePositiveInteger(options.messageThreadId, \"message-thread-id\")\n : undefined,\n });\n\n console.log(\n chalk.green(`✓ Message sent (message_id: ${result.messageId})`),\n );\n },\n ),\n );\n","import { readFileSync, statSync } from \"fs\";\nimport { basename, extname } from \"path\";\nimport { Command } from \"commander\";\nimport {\n completeTelegramFileUpload,\n initTelegramFileUpload,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mov\": \"video/quicktime\",\n \".pdf\": \"application/pdf\",\n \".txt\": \"text/plain\",\n \".csv\": \"text/csv\",\n \".md\": \"text/markdown\",\n \".json\": \"application/json\",\n};\n\nfunction inferContentType(localPath: string): string {\n const ext = extname(localPath).toLowerCase();\n return MIME_BY_EXTENSION[ext] ?? \"application/octet-stream\";\n}\n\nfunction parseMessageThreadId(value: string | undefined): number | undefined {\n if (!value) return undefined;\n const parsed = Number(value);\n if (!Number.isSafeInteger(parsed) || parsed <= 0) {\n throw new Error(\"message-thread-id must be a positive integer\");\n }\n return parsed;\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\"Upload a local file to a Telegram chat as the bot\")\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"--bot-id <bot-id>\", \"Telegram bot id to send through\")\n .requiredOption(\"-c, --chat-id <chat-id>\", \"Telegram chat id or @channel\")\n .option(\"--caption <text>\", \"Caption to accompany the file\")\n .option(\"--message-thread-id <id>\", \"Forum topic message thread id\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero telegram upload-file -f /tmp/report.pdf --bot-id 123456789 -c -1001234567890\n Upload to a topic: zero telegram upload-file -f /tmp/log.txt --bot-id 123456789 -c -1001234567890 --message-thread-id 42\n With a caption: zero telegram upload-file -f /tmp/data.csv --bot-id 123456789 -c @channel --caption \"Daily report\"\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"messageId\":123,\"chatId\":\"-1001234567890\",\"fileId\":\"...\",\"filename\":\"report.pdf\",\"mimetype\":\"application/pdf\",\"size\":12345,\"url\":\"https://...\"}\n\nNotes:\n - Uses the Telegram bot token on the server side\n - Uploads through VM0 storage first, then asks Telegram to fetch the file URL\n - VM0 does not apply file type or size restrictions before calling Telegram`,\n )\n .action(\n withErrorHandler(\n async (options: {\n file: string;\n botId: string;\n chatId: string;\n caption?: string;\n messageThreadId?: string;\n contentType?: string;\n }) => {\n let fileSize: number;\n try {\n const stat = statSync(options.file);\n if (!stat.isFile()) {\n throw new Error(`Not a regular file: ${options.file}`);\n }\n fileSize = stat.size;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"Not \")) {\n throw error;\n }\n throw new Error(`File not found: ${options.file}`);\n }\n\n if (fileSize === 0) {\n throw new Error(\"File is empty\");\n }\n const filename = basename(options.file);\n const contentType =\n options.contentType ?? inferContentType(options.file);\n const messageThreadId = parseMessageThreadId(options.messageThreadId);\n\n const prepared = await initTelegramFileUpload({\n filename,\n contentType,\n length: fileSize,\n });\n\n const fileContent = readFileSync(options.file);\n const uploadResponse = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": prepared.contentType },\n body: new Uint8Array(fileContent),\n });\n\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n\n const result = await completeTelegramFileUpload({\n uploadId: prepared.uploadId,\n botId: options.botId,\n chatId: options.chatId,\n contentType: prepared.contentType,\n caption: options.caption,\n messageThreadId,\n });\n\n console.log(JSON.stringify(result));\n },\n ),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAMA,SAAS,cAAc,KAAkC;AACvD,MAAI,CAAC,IAAI,SAAU,QAAO;AAC1B,SAAO,IAAI,SAAS,WAAW,GAAG,IAAI,IAAI,WAAW,IAAI,IAAI,QAAQ;AACvE;AAEA,SAAS,YAAY,KAAkC;AACrD,MAAI,IAAI,gBAAgB,QAAS,QAAO,eAAM,MAAM,OAAO;AAC3D,MAAI,IAAI,gBAAgB,UAAW,QAAO,eAAM,IAAI,SAAS;AAC7D,SAAO,eAAM,OAAO,SAAS;AAC/B;AAEO,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,MAAM,IAAI,EACV,YAAY,yDAAyD,EACrE;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF,EACC;AAAA,EACC,iBAAiB,YAAY;AAC3B,UAAM,SAAS,MAAM,iBAAiB;AACtC,UAAM,EAAE,KAAK,IAAI;AAEjB,QAAI,KAAK,WAAW,GAAG;AACrB,cAAQ,IAAI,eAAM,IAAI,wBAAwB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ACV,CAAC;AAED,YAAM,cAAcC,cAAa,QAAQ,IAAI;AAC7C,YAAM,iBAAiB,MAAM,MAAM,SAAS,WAAW;AAAA,QACrD,QAAQ;AAAA,QACR,SAAS,EAAE,gBAAgB,SAAS,YAAY;AAAA,QAChD,MAAM,IAAI,WAAW,WAAW;AAAA,MAClC,CAAC;AAED,UAAI,CAAC,eAAe,IAAI;AACtB,cAAM,IAAI;AAAA,UACR,uBAAuB,eAAe,MAAM,IAAI,eAAe,UAAU;AAAA,QAC3E;AAAA,MACF;AAEA,YAAM,SAAS,MAAM,2BAA2B;AAAA,QAC9C,UAAU,SAAS;AAAA,QACnB,OAAO,QAAQ;AAAA,QACf,QAAQ,QAAQ;AAAA,QAChB,aAAa,SAAS;AAAA,QACtB,SAAS,QAAQ;AAAA,QACjB;AAAA,MACF,CAAC;AAED,cAAQ,IAAI,KAAK,UAAU,MAAM,CAAC;AAAA,IACpC;AAAA,EACF;AACF;;;AN3HK,IAAM,sBAAsB,IAAI,QAAQ,EAC5C,KAAK,UAAU,EACf;AAAA,EACC;AACF,EACC,WAAW,sBAAsB,EACjC,WAAW,0BAA0B,EACrC,WAAW,mBAAmB,EAC9B,WAAW,iBAAiB,EAC5B;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF;","names":["readFileSync","basename","basename","readFileSync"]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/telegram/index.ts","../src/commands/zero/telegram/bot/index.ts","../src/commands/zero/telegram/bot/list.ts","../src/commands/zero/telegram/download-file.ts","../src/commands/zero/telegram/message/index.ts","../src/commands/zero/telegram/message/send.ts","../src/commands/zero/telegram/upload-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroTelegramBotCommand } from \"./bot\";\nimport { downloadFileCommand } from \"./download-file\";\nimport { zeroTelegramMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\n\nexport const zeroTelegramCommand = new Command()\n .name(\"telegram\")\n .description(\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n )\n .addCommand(zeroTelegramBotCommand)\n .addCommand(zeroTelegramMessageCommand)\n .addCommand(downloadFileCommand)\n .addCommand(uploadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n List bots: zero telegram bot list\n Send a message: zero telegram message send --bot-id <bot-id> -c <chat-id> -t \"Hello!\"\n Upload a file: zero telegram upload-file -f /tmp/report.pdf --bot-id <bot-id> -c <chat-id>\n Download a file: zero telegram download-file <file-id> --bot-id <bot-id> -o /tmp/out.jpg`,\n );\n","import { Command } from \"commander\";\nimport { listCommand } from \"./list\";\n\nexport const zeroTelegramBotCommand = new Command()\n .name(\"bot\")\n .description(\"Inspect Telegram bots\")\n .addCommand(listCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram bot list`,\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listTelegramBots } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\nimport type { TelegramBotListItem } from \"@vm0/api-contracts/contracts/integrations\";\n\nfunction usernameLabel(bot: TelegramBotListItem): string {\n if (!bot.username) return \"-\";\n return bot.username.startsWith(\"@\") ? bot.username : `@${bot.username}`;\n}\n\nfunction statusLabel(bot: TelegramBotListItem): string {\n if (bot.tokenStatus === \"valid\") return chalk.green(\"valid\");\n if (bot.tokenStatus === \"invalid\") return chalk.red(\"invalid\");\n return chalk.yellow(\"unknown\");\n}\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List Telegram bots available in the active organization\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram bot list\n\nNotes:\n - Use this to find the --bot-id value before sending Telegram messages.`,\n )\n .action(\n withErrorHandler(async () => {\n const result = await listTelegramBots();\n const { bots } = result;\n\n if (bots.length === 0) {\n console.log(chalk.dim(\"No Telegram bots found\"));\n console.log(\n chalk.dim(\" Add one from Settings > Integrations > Telegram\"),\n );\n return;\n }\n\n const botIdWidth = Math.max(\n 6,\n ...bots.map((bot) => {\n return bot.id.length;\n }),\n );\n const usernameWidth = Math.max(\n 8,\n ...bots.map((bot) => {\n return usernameLabel(bot).length;\n }),\n );\n const agentWidth = Math.max(\n 5,\n ...bots.map((bot) => {\n return (bot.agent?.name ?? \"-\").length;\n }),\n );\n\n const header = [\n \"BOT ID\".padEnd(botIdWidth),\n \"USERNAME\".padEnd(usernameWidth),\n \"AGENT\".padEnd(agentWidth),\n \"CONNECTED\",\n \"TOKEN\",\n ].join(\" \");\n console.log(chalk.dim(header));\n\n for (const bot of bots) {\n const row = [\n bot.id.padEnd(botIdWidth),\n usernameLabel(bot).padEnd(usernameWidth),\n (bot.agent?.name ?? \"-\").padEnd(agentWidth),\n (bot.isConnected ? \"yes\" : \"no\").padEnd(9),\n statusLabel(bot),\n ].join(\" \");\n console.log(row);\n }\n }),\n );\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadTelegramFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\n/**\n * Derive a local output path for a Telegram file id.\n * Uses the system temp directory.\n *\n * `basename` strips any path separators from `fileId` so a hostile id like\n * `../etc/passwd` cannot escape `tmpdir()`.\n */\nfunction defaultOutPath(fileId: string): string {\n return join(tmpdir(), `telegram-${basename(fileId)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Telegram file by id using the bot token\")\n .argument(\"<file-id>\", \"Telegram file id from a [Telegram file] block\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/telegram-<file-id>)\",\n )\n .requiredOption(\n \"--bot-id <bot-id>\",\n \"Telegram bot id from the [Telegram file] block\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789\n Download to explicit path: zero telegram download-file AgACAgUAAxkBAA --bot-id 123456789 -o /tmp/photo.jpg\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/telegram-AgACAgUAAxkBAA\",\"mimetype\":\"image/jpeg\",\"size\":12345}\n\nHow to read the downloaded file:\n - Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool\n - Videos (mp4/mov/webm): transcribe audio first with\n zero video transcribe --url <download-url>\n or extract frames with\n ffmpeg -i <path> -vf \"fps=1\" -q:v 2 /tmp/<file-id>_frame_%03d.jpg\n - PDF/text/csv/json/markdown: read the file directly\n\nNotes:\n - Uses the Telegram bot token on the server side\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(\n async (fileId: string, options: { out?: string; botId: string }) => {\n const outPath = options.out ?? defaultOutPath(fileId);\n const result = await downloadTelegramFile(\n fileId,\n options.botId,\n outPath,\n );\n console.log(JSON.stringify(result));\n },\n ),\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroTelegramMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Telegram messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero telegram message send --bot-id <bot-id> -c <chat-id> -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sendTelegramMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\nfunction parsePositiveInteger(value: string, flag: string): number {\n const parsed = Number(value);\n if (!Number.isInteger(parsed) || parsed <= 0) {\n throw new Error(`${flag} must be a positive integer`);\n }\n return parsed;\n}\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Telegram chat as the bot\")\n .requiredOption(\"--bot-id <id>\", \"Telegram bot ID\")\n .requiredOption(\"-c, --chat-id <id>\", \"Telegram chat ID\")\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--reply-to-message-id <id>\", \"Message ID to reply to\")\n .option(\"--message-thread-id <id>\", \"Telegram forum topic thread ID\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero telegram message send --bot-id 123456789 -c -1001234567890 -t \"Hello!\"\n Reply to message: zero telegram message send --bot-id 123456789 -c -1001234567890 --reply-to-message-id 42 -t \"reply\"\n Forum topic message: zero telegram message send --bot-id 123456789 -c -1001234567890 --message-thread-id 7 -t \"topic update\"\n\nNotes:\n - Message text can be provided with --text or piped on stdin\n - Choose an explicit --bot-id. Run \"zero telegram bot list\" to inspect available bots.`,\n )\n .action(\n withErrorHandler(\n async (options: {\n botId: string;\n chatId: string;\n text?: string;\n replyToMessageId?: string;\n messageThreadId?: string;\n }) => {\n let text = options.text;\n if (!text && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin not readable (e.g. test runner with no piped input);\n // fall through to the missing-text validation below.\n }\n }\n\n if (!text) {\n throw new Error(\"Either --text or piped stdin must be provided\", {\n cause: new Error(\n 'Usage: zero telegram message send --bot-id BOT_ID -c CHAT_ID -t \"your message\"',\n ),\n });\n }\n\n const result = await sendTelegramMessage({\n botId: options.botId,\n chatId: options.chatId,\n text,\n replyToMessageId: options.replyToMessageId\n ? parsePositiveInteger(\n options.replyToMessageId,\n \"reply-to-message-id\",\n )\n : undefined,\n messageThreadId: options.messageThreadId\n ? parsePositiveInteger(options.messageThreadId, \"message-thread-id\")\n : undefined,\n });\n\n console.log(\n chalk.green(`✓ Message sent (message_id: ${result.messageId})`),\n );\n },\n ),\n );\n","import { readFileSync, statSync } from \"fs\";\nimport { basename, extname } from \"path\";\nimport { Command } from \"commander\";\nimport {\n completeTelegramFileUpload,\n initTelegramFileUpload,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nconst MIME_BY_EXTENSION: Record<string, string> = {\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".svg\": \"image/svg+xml\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mov\": \"video/quicktime\",\n \".pdf\": \"application/pdf\",\n \".txt\": \"text/plain\",\n \".csv\": \"text/csv\",\n \".md\": \"text/markdown\",\n \".json\": \"application/json\",\n};\n\nfunction inferContentType(localPath: string): string {\n const ext = extname(localPath).toLowerCase();\n return MIME_BY_EXTENSION[ext] ?? \"application/octet-stream\";\n}\n\nfunction parseMessageThreadId(value: string | undefined): number | undefined {\n if (!value) return undefined;\n const parsed = Number(value);\n if (!Number.isSafeInteger(parsed) || parsed <= 0) {\n throw new Error(\"message-thread-id must be a positive integer\");\n }\n return parsed;\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\"Upload a local file to a Telegram chat as the bot\")\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"--bot-id <bot-id>\", \"Telegram bot id to send through\")\n .requiredOption(\"-c, --chat-id <chat-id>\", \"Telegram chat id or @channel\")\n .option(\"--caption <text>\", \"Caption to accompany the file\")\n .option(\"--message-thread-id <id>\", \"Forum topic message thread id\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero telegram upload-file -f /tmp/report.pdf --bot-id 123456789 -c -1001234567890\n Upload to a topic: zero telegram upload-file -f /tmp/log.txt --bot-id 123456789 -c -1001234567890 --message-thread-id 42\n With a caption: zero telegram upload-file -f /tmp/data.csv --bot-id 123456789 -c @channel --caption \"Daily report\"\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"messageId\":123,\"chatId\":\"-1001234567890\",\"fileId\":\"...\",\"filename\":\"report.pdf\",\"mimetype\":\"application/pdf\",\"size\":12345,\"url\":\"https://...\"}\n\nNotes:\n - Uses the Telegram bot token on the server side\n - Uploads through VM0 storage first, then asks Telegram to fetch the file URL\n - VM0 does not apply file type or size restrictions before calling Telegram`,\n )\n .action(\n withErrorHandler(\n async (options: {\n file: string;\n botId: string;\n chatId: string;\n caption?: string;\n messageThreadId?: string;\n contentType?: string;\n }) => {\n let fileSize: number;\n try {\n const stat = statSync(options.file);\n if (!stat.isFile()) {\n throw new Error(`Not a regular file: ${options.file}`);\n }\n fileSize = stat.size;\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"Not \")) {\n throw error;\n }\n throw new Error(`File not found: ${options.file}`);\n }\n\n if (fileSize === 0) {\n throw new Error(\"File is empty\");\n }\n const filename = basename(options.file);\n const contentType =\n options.contentType ?? inferContentType(options.file);\n const messageThreadId = parseMessageThreadId(options.messageThreadId);\n\n const prepared = await initTelegramFileUpload({\n filename,\n contentType,\n length: fileSize,\n supportsUploadHeaders: true,\n });\n\n const fileContent = readFileSync(options.file);\n const uploadResponse = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": prepared.contentType,\n ...prepared.uploadHeaders,\n },\n body: new Uint8Array(fileContent),\n });\n\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n\n const result = await completeTelegramFileUpload({\n uploadId: prepared.uploadId,\n botId: options.botId,\n chatId: options.chatId,\n contentType: prepared.contentType,\n caption: options.caption,\n messageThreadId,\n });\n\n console.log(JSON.stringify(result));\n },\n ),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAMA,SAAS,cAAc,KAAkC;AACvD,MAAI,CAAC,IAAI,SAAU,QAAO;AAC1B,SAAO,IAAI,SAAS,WAAW,GAAG,IAAI,IAAI,WAAW,IAAI,IAAI,QAAQ;AACvE;AAEA,SAAS,YAAY,KAAkC;AACrD,MAAI,IAAI,gBAAgB,QAAS,QAAO,eAAM,MAAM,OAAO;AAC3D,MAAI,IAAI,gBAAgB,UAAW,QAAO,eAAM,IAAI,SAAS;AAC7D,SAAO,eAAM,OAAO,SAAS;AAC/B;AAEO,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,MAAM,IAAI,EACV,YAAY,yD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|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CCUKVMAH.js";
|
|
10
10
|
import "./chunk-MA22KQYU.js";
|
|
11
11
|
import {
|
|
12
12
|
source_default,
|
|
13
13
|
withErrorHandler
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D7TEG7WN.js";
|
|
15
15
|
import "./chunk-MD3YWUKO.js";
|
|
16
16
|
import {
|
|
17
17
|
Command,
|
|
@@ -47,4 +47,4 @@ Output:
|
|
|
47
47
|
export {
|
|
48
48
|
zeroUpgradeCommand
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=upgrade-
|
|
50
|
+
//# sourceMappingURL=upgrade-J6FYUUYV.js.map
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
deleteZeroVariable,
|
|
10
10
|
listZeroVariables,
|
|
11
11
|
setZeroVariable
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-TZDXFY6G.js";
|
|
13
|
+
import "./chunk-JXUQQIUP.js";
|
|
14
14
|
import "./chunk-MA22KQYU.js";
|
|
15
15
|
import {
|
|
16
16
|
source_default,
|
|
17
17
|
withErrorHandler
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-D7TEG7WN.js";
|
|
19
19
|
import "./chunk-MD3YWUKO.js";
|
|
20
20
|
import {
|
|
21
21
|
Command
|
|
@@ -116,4 +116,4 @@ var zeroVariableCommand = new Command().name("variable").description("Read or wr
|
|
|
116
116
|
export {
|
|
117
117
|
zeroVariableCommand
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=variable-
|
|
119
|
+
//# sourceMappingURL=variable-YXJ6NH3N.js.map
|
|
@@ -4,11 +4,11 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
downloadWebFile,
|
|
6
6
|
transcribeAudio
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JXUQQIUP.js";
|
|
8
8
|
import "./chunk-MA22KQYU.js";
|
|
9
9
|
import {
|
|
10
10
|
withErrorHandler
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D7TEG7WN.js";
|
|
12
12
|
import "./chunk-MD3YWUKO.js";
|
|
13
13
|
import {
|
|
14
14
|
Command
|
|
@@ -247,4 +247,4 @@ Tip (video understanding):
|
|
|
247
247
|
export {
|
|
248
248
|
zeroVideoCommand
|
|
249
249
|
};
|
|
250
|
-
//# sourceMappingURL=video-
|
|
250
|
+
//# sourceMappingURL=video-GYS2CSQF.js.map
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
callZeroWeather
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-TZDXFY6G.js";
|
|
7
|
+
import "./chunk-JXUQQIUP.js";
|
|
8
8
|
import "./chunk-MA22KQYU.js";
|
|
9
9
|
import {
|
|
10
10
|
source_default,
|
|
11
11
|
withErrorHandler
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-D7TEG7WN.js";
|
|
13
13
|
import "./chunk-MD3YWUKO.js";
|
|
14
14
|
import {
|
|
15
15
|
Command,
|
|
@@ -588,4 +588,4 @@ Notes:
|
|
|
588
588
|
export {
|
|
589
589
|
zeroWeatherCommand
|
|
590
590
|
};
|
|
591
|
-
//# sourceMappingURL=weather-
|
|
591
|
+
//# sourceMappingURL=weather-N5IWRZPG.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-TZDXFY6G.js";
|
|
5
5
|
import {
|
|
6
6
|
downloadWebFile,
|
|
7
7
|
uploadWebFile
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JXUQQIUP.js";
|
|
9
9
|
import "./chunk-MA22KQYU.js";
|
|
10
10
|
import {
|
|
11
11
|
withErrorHandler
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-D7TEG7WN.js";
|
|
13
13
|
import "./chunk-MD3YWUKO.js";
|
|
14
14
|
import {
|
|
15
15
|
Command
|
|
@@ -107,4 +107,4 @@ Examples:
|
|
|
107
107
|
export {
|
|
108
108
|
zeroWebCommand
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=web-
|
|
110
|
+
//# sourceMappingURL=web-LPR6C2K7.js.map
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
zeroWebSearchDomainSchema,
|
|
10
10
|
zeroWebSearchRecencySchema,
|
|
11
11
|
zeroWebSearchRequestSchema
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-TZDXFY6G.js";
|
|
13
|
+
import "./chunk-JXUQQIUP.js";
|
|
14
14
|
import "./chunk-MA22KQYU.js";
|
|
15
15
|
import {
|
|
16
16
|
source_default,
|
|
17
17
|
withErrorHandler
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-D7TEG7WN.js";
|
|
19
19
|
import "./chunk-MD3YWUKO.js";
|
|
20
20
|
import {
|
|
21
21
|
Command,
|
|
@@ -148,4 +148,4 @@ Notes:
|
|
|
148
148
|
export {
|
|
149
149
|
zeroWebSearchCommand
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=web-search-
|
|
151
|
+
//# sourceMappingURL=web-search-BT6BDI5E.js.map
|
|
@@ -3,17 +3,17 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
policyIcon
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MOWAU52B.js";
|
|
7
7
|
import {
|
|
8
8
|
connectorPermissionGrantsToFirewallPolicies,
|
|
9
9
|
loadConnectorPermissionInfos
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VSL4HRIA.js";
|
|
11
11
|
import {
|
|
12
12
|
getZeroAgentUserConnectors,
|
|
13
13
|
listZeroConnectors,
|
|
14
14
|
listZeroUserPermissionGrants
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-TZDXFY6G.js";
|
|
16
|
+
import "./chunk-JXUQQIUP.js";
|
|
17
17
|
import "./chunk-MA22KQYU.js";
|
|
18
18
|
import {
|
|
19
19
|
getActiveOrg,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getToken,
|
|
22
22
|
source_default,
|
|
23
23
|
withErrorHandler
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-D7TEG7WN.js";
|
|
25
25
|
import {
|
|
26
26
|
decodeZeroTokenPayload
|
|
27
27
|
} from "./chunk-MD3YWUKO.js";
|
|
@@ -196,4 +196,4 @@ Notes:
|
|
|
196
196
|
export {
|
|
197
197
|
zeroWhoamiCommand
|
|
198
198
|
};
|
|
199
|
-
//# sourceMappingURL=whoami-
|
|
199
|
+
//# sourceMappingURL=whoami-YV26HEXS.js.map
|
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
listZeroModelPolicies,
|
|
26
26
|
updateWorkflow,
|
|
27
27
|
updateWorkflowAutomation
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-TZDXFY6G.js";
|
|
29
|
+
import "./chunk-JXUQQIUP.js";
|
|
30
30
|
import "./chunk-MA22KQYU.js";
|
|
31
31
|
import {
|
|
32
32
|
source_default,
|
|
33
33
|
withErrorHandler
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-D7TEG7WN.js";
|
|
35
35
|
import {
|
|
36
36
|
isFeatureEnabled
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-X7YXT2UE.js";
|
|
38
38
|
import {
|
|
39
39
|
decodeZeroTokenPayload
|
|
40
40
|
} from "./chunk-MD3YWUKO.js";
|
|
@@ -2848,4 +2848,4 @@ Examples:
|
|
|
2848
2848
|
export {
|
|
2849
2849
|
zeroWorkflowCommand
|
|
2850
2850
|
};
|
|
2851
|
-
//# sourceMappingURL=workflow-
|
|
2851
|
+
//# sourceMappingURL=workflow-T2R3IE2A.js.map
|