@vm0/cli 9.248.1 → 9.249.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-2NW7BBLH.js → agent-J7UZFWFE.js} +5 -5
- package/{banking-WMZ5X4TD.js → banking-TLHPJBS5.js} +3 -3
- package/{chat-Z32JJCZG.js → chat-PWHG42AL.js} +4 -4
- package/{chunk-KU5PTS4H.js → chunk-3QXK5RR7.js} +108 -7
- package/chunk-3QXK5RR7.js.map +1 -0
- package/{chunk-HJMAS7QI.js → chunk-6IFIMWPY.js} +4 -4
- package/{chunk-Y7PXYM7M.js → chunk-HJOW32CJ.js} +2 -2
- package/{chunk-D42LBTMI.js → chunk-LDQPMTQY.js} +10 -4
- package/chunk-LDQPMTQY.js.map +1 -0
- package/{chunk-DXYKZPHD.js → chunk-PD3A7MGG.js} +2 -2
- package/{chunk-XMCVK5OU.js → chunk-XE764T2N.js} +5 -4
- package/{chunk-XMCVK5OU.js.map → chunk-XE764T2N.js.map} +1 -1
- package/{chunk-2IFOM533.js → chunk-ZJENFGWZ.js} +2 -2
- package/{chunk-N677KKA5.js → chunk-ZKWCFMDV.js} +2 -2
- package/{computer-use-Z5YA5PCS.js → computer-use-EE6NPCXS.js} +3 -3
- package/{connector-GILJG3H2.js → connector-SCLSWTMT.js} +6 -6
- package/{credit-SHY372FA.js → credit-2VN2PYRE.js} +4 -4
- package/{developer-support-OPEG7JPP.js → developer-support-V3N3BOYC.js} +3 -3
- package/{doctor-QVVF5PHS.js → doctor-AQLFJCC6.js} +3 -3
- package/{feishu-FKRRGMT2.js → feishu-XHOLF32I.js} +3 -3
- package/{finance-LDOX64UG.js → finance-TF5RU7FD.js} +3 -3
- package/{generate-CIXTADDH.js → generate-GFFAZX7Y.js} +4 -4
- package/{github-27EGMZM4.js → github-V4ZW6TI4.js} +3 -3
- package/{goal-MTTP4FTD.js → goal-TED5FUYM.js} +3 -3
- package/{host-5ACQBWFC.js → host-HKDD3CHD.js} +3 -3
- package/{logs-WME2HGIQ.js → logs-SBMQQM46.js} +4 -4
- package/{mail-BYRRYI5S.js → mail-SF5JKA2F.js} +5 -5
- package/{maps-P7V44O5J.js → maps-D5NKFEAD.js} +3 -3
- package/{model-THRT7DHX.js → model-S7CMGRIH.js} +4 -4
- package/{model-provider-HQ2SXXG7.js → model-provider-ATXIDNKM.js} +4 -4
- package/{org-H742KQAG.js → org-6JBRK5NL.js} +3 -3
- package/package.json +1 -1
- package/{phone-ZLDFGYV5.js → phone-B3UWRGWF.js} +3 -3
- package/{preference-MGBOHLDQ.js → preference-HRRRUEP3.js} +3 -3
- package/{resource-FGZYT5IL.js → resource-65P5D2LT.js} +3 -3
- package/{scrape-NCPUXX2W.js → scrape-N3AWNV2R.js} +3 -3
- package/{search-TOPTC26C.js → search-T76RE67L.js} +4 -4
- package/{secret-P3BJRVBS.js → secret-WALMH6S2.js} +3 -3
- package/{slack-FKK6PVKS.js → slack-WXDCNAI2.js} +171 -45
- package/slack-WXDCNAI2.js.map +1 -0
- package/{teams-IIXV5XX6.js → teams-LAQBLRUR.js} +3 -3
- package/{telegram-RMSYD7AV.js → telegram-5BASFBEA.js} +3 -3
- package/{variable-S6I4UDAO.js → variable-GBVHKR6I.js} +3 -3
- package/{video-HADRKBLP.js → video-3FXQGBYB.js} +2 -2
- package/{weather-L7QYR5VW.js → weather-JNMUODGJ.js} +3 -3
- package/{web-FODYCSCR.js → web-DZT26X4I.js} +3 -3
- package/{web-search-55SSMXC7.js → web-search-36UUSSUX.js} +3 -3
- package/{whoami-DT3WNKYG.js → whoami-NXYCNII4.js} +5 -5
- package/{workflow-H2IAFAGI.js → workflow-WHTBJCEF.js} +3 -3
- package/zero.js +39 -39
- package/chunk-D42LBTMI.js.map +0 -1
- package/chunk-KU5PTS4H.js.map +0 -1
- package/slack-FKK6PVKS.js.map +0 -1
- /package/{agent-2NW7BBLH.js.map → agent-J7UZFWFE.js.map} +0 -0
- /package/{banking-WMZ5X4TD.js.map → banking-TLHPJBS5.js.map} +0 -0
- /package/{chat-Z32JJCZG.js.map → chat-PWHG42AL.js.map} +0 -0
- /package/{chunk-HJMAS7QI.js.map → chunk-6IFIMWPY.js.map} +0 -0
- /package/{chunk-Y7PXYM7M.js.map → chunk-HJOW32CJ.js.map} +0 -0
- /package/{chunk-DXYKZPHD.js.map → chunk-PD3A7MGG.js.map} +0 -0
- /package/{chunk-2IFOM533.js.map → chunk-ZJENFGWZ.js.map} +0 -0
- /package/{chunk-N677KKA5.js.map → chunk-ZKWCFMDV.js.map} +0 -0
- /package/{computer-use-Z5YA5PCS.js.map → computer-use-EE6NPCXS.js.map} +0 -0
- /package/{connector-GILJG3H2.js.map → connector-SCLSWTMT.js.map} +0 -0
- /package/{credit-SHY372FA.js.map → credit-2VN2PYRE.js.map} +0 -0
- /package/{developer-support-OPEG7JPP.js.map → developer-support-V3N3BOYC.js.map} +0 -0
- /package/{doctor-QVVF5PHS.js.map → doctor-AQLFJCC6.js.map} +0 -0
- /package/{feishu-FKRRGMT2.js.map → feishu-XHOLF32I.js.map} +0 -0
- /package/{finance-LDOX64UG.js.map → finance-TF5RU7FD.js.map} +0 -0
- /package/{generate-CIXTADDH.js.map → generate-GFFAZX7Y.js.map} +0 -0
- /package/{github-27EGMZM4.js.map → github-V4ZW6TI4.js.map} +0 -0
- /package/{goal-MTTP4FTD.js.map → goal-TED5FUYM.js.map} +0 -0
- /package/{host-5ACQBWFC.js.map → host-HKDD3CHD.js.map} +0 -0
- /package/{logs-WME2HGIQ.js.map → logs-SBMQQM46.js.map} +0 -0
- /package/{mail-BYRRYI5S.js.map → mail-SF5JKA2F.js.map} +0 -0
- /package/{maps-P7V44O5J.js.map → maps-D5NKFEAD.js.map} +0 -0
- /package/{model-THRT7DHX.js.map → model-S7CMGRIH.js.map} +0 -0
- /package/{model-provider-HQ2SXXG7.js.map → model-provider-ATXIDNKM.js.map} +0 -0
- /package/{org-H742KQAG.js.map → org-6JBRK5NL.js.map} +0 -0
- /package/{phone-ZLDFGYV5.js.map → phone-B3UWRGWF.js.map} +0 -0
- /package/{preference-MGBOHLDQ.js.map → preference-HRRRUEP3.js.map} +0 -0
- /package/{resource-FGZYT5IL.js.map → resource-65P5D2LT.js.map} +0 -0
- /package/{scrape-NCPUXX2W.js.map → scrape-N3AWNV2R.js.map} +0 -0
- /package/{search-TOPTC26C.js.map → search-T76RE67L.js.map} +0 -0
- /package/{secret-P3BJRVBS.js.map → secret-WALMH6S2.js.map} +0 -0
- /package/{teams-IIXV5XX6.js.map → teams-LAQBLRUR.js.map} +0 -0
- /package/{telegram-RMSYD7AV.js.map → telegram-5BASFBEA.js.map} +0 -0
- /package/{variable-S6I4UDAO.js.map → variable-GBVHKR6I.js.map} +0 -0
- /package/{video-HADRKBLP.js.map → video-3FXQGBYB.js.map} +0 -0
- /package/{weather-L7QYR5VW.js.map → weather-JNMUODGJ.js.map} +0 -0
- /package/{web-FODYCSCR.js.map → web-DZT26X4I.js.map} +0 -0
- /package/{web-search-55SSMXC7.js.map → web-search-36UUSSUX.js.map} +0 -0
- /package/{whoami-DT3WNKYG.js.map → whoami-NXYCNII4.js.map} +0 -0
- /package/{workflow-H2IAFAGI.js.map → workflow-WHTBJCEF.js.map} +0 -0
|
@@ -5,13 +5,15 @@ import {
|
|
|
5
5
|
completeSlackFileUpload,
|
|
6
6
|
downloadSlackFile,
|
|
7
7
|
initSlackFileUpload,
|
|
8
|
+
materializeSlackFileUpload,
|
|
8
9
|
sendSlackMessage
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3QXK5RR7.js";
|
|
10
11
|
import "./chunk-LTDQISD7.js";
|
|
11
12
|
import {
|
|
13
|
+
inferWebUploadContentType,
|
|
12
14
|
source_default,
|
|
13
15
|
withErrorHandler
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XE764T2N.js";
|
|
15
17
|
import "./chunk-LRHXR7JT.js";
|
|
16
18
|
import {
|
|
17
19
|
Command
|
|
@@ -109,9 +111,171 @@ Examples:
|
|
|
109
111
|
|
|
110
112
|
// src/commands/zero/slack/upload-file.ts
|
|
111
113
|
init_esm_shims();
|
|
114
|
+
import { createHash, randomUUID } from "crypto";
|
|
112
115
|
import { statSync, readFileSync as readFileSync2 } from "fs";
|
|
113
116
|
import { basename } from "path";
|
|
114
|
-
|
|
117
|
+
function readUploadFile(path) {
|
|
118
|
+
let size;
|
|
119
|
+
try {
|
|
120
|
+
size = statSync(path).size;
|
|
121
|
+
} catch {
|
|
122
|
+
throw new Error(`File not found: ${path}`);
|
|
123
|
+
}
|
|
124
|
+
if (size === 0) {
|
|
125
|
+
throw new Error("File is empty");
|
|
126
|
+
}
|
|
127
|
+
return { content: readFileSync2(path), size };
|
|
128
|
+
}
|
|
129
|
+
function warnDeliveryRetry(operationId) {
|
|
130
|
+
console.warn(source_default.dim(` Retry with --operation-id ${operationId}`));
|
|
131
|
+
}
|
|
132
|
+
async function uploadDirectlyToSlack(initialized, options, fileContent) {
|
|
133
|
+
const uploadResponse = await fetch(initialized.uploadUrl, {
|
|
134
|
+
method: "POST",
|
|
135
|
+
body: fileContent
|
|
136
|
+
});
|
|
137
|
+
if (!uploadResponse.ok) {
|
|
138
|
+
throw new Error(
|
|
139
|
+
`File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const result = await completeSlackFileUpload({
|
|
143
|
+
fileId: initialized.fileId,
|
|
144
|
+
channel: options.channel,
|
|
145
|
+
threadTs: options.thread,
|
|
146
|
+
title: options.title,
|
|
147
|
+
initialComment: options.comment
|
|
148
|
+
});
|
|
149
|
+
console.log(source_default.green(`\u2713 File uploaded (file_id: ${result.fileId})`));
|
|
150
|
+
console.log(source_default.dim(` permalink: ${result.permalink}`));
|
|
151
|
+
}
|
|
152
|
+
async function uploadCanonicalBody(initialized, contentType, fileContent) {
|
|
153
|
+
if (!initialized.uploadUrl) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const uploadResponse = await fetch(initialized.uploadUrl, {
|
|
157
|
+
method: "PUT",
|
|
158
|
+
headers: { "Content-Type": contentType },
|
|
159
|
+
body: fileContent
|
|
160
|
+
});
|
|
161
|
+
if (!uploadResponse.ok) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
`Canonical file upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async function uploadPendingSlackBody(delivery, fileContent) {
|
|
168
|
+
try {
|
|
169
|
+
const uploadResponse = await fetch(delivery.uploadUrl, {
|
|
170
|
+
method: "POST",
|
|
171
|
+
body: fileContent
|
|
172
|
+
});
|
|
173
|
+
if (!uploadResponse.ok) {
|
|
174
|
+
return `Slack upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`;
|
|
175
|
+
}
|
|
176
|
+
return void 0;
|
|
177
|
+
} catch (error) {
|
|
178
|
+
return error instanceof Error ? error.message : "Slack upload failed";
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function completeCanonicalSlackDelivery(args) {
|
|
182
|
+
const uploadError = await uploadPendingSlackBody(
|
|
183
|
+
args.delivery,
|
|
184
|
+
args.fileContent
|
|
185
|
+
);
|
|
186
|
+
let result;
|
|
187
|
+
try {
|
|
188
|
+
result = await completeSlackFileUpload({
|
|
189
|
+
fileId: args.delivery.fileId,
|
|
190
|
+
channel: args.options.channel,
|
|
191
|
+
...args.options.thread ? { threadTs: args.options.thread } : {},
|
|
192
|
+
...args.options.title ? { title: args.options.title } : {},
|
|
193
|
+
...args.options.comment ? { initialComment: args.options.comment } : {},
|
|
194
|
+
canonicalAssetId: args.initialized.assetId,
|
|
195
|
+
operationId: args.initialized.operationId,
|
|
196
|
+
...uploadError ? { uploadError } : {}
|
|
197
|
+
});
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.warn(
|
|
200
|
+
source_default.yellow(
|
|
201
|
+
`\u26A0 Slack delivery status could not be recorded: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
202
|
+
)
|
|
203
|
+
);
|
|
204
|
+
warnDeliveryRetry(args.initialized.operationId);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (result.deliveryStatus === "failed") {
|
|
208
|
+
console.warn(
|
|
209
|
+
source_default.yellow(
|
|
210
|
+
`\u26A0 Slack delivery failed: ${result.deliveryError ?? "Unknown error"}`
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
warnDeliveryRetry(args.initialized.operationId);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
console.log(source_default.green(`\u2713 Delivered to Slack (file_id: ${result.fileId})`));
|
|
217
|
+
console.log(source_default.dim(` permalink: ${result.permalink}`));
|
|
218
|
+
}
|
|
219
|
+
async function publishCanonicalFile(initialized, options, contentType, fileContent) {
|
|
220
|
+
await uploadCanonicalBody(initialized, contentType, fileContent);
|
|
221
|
+
const materialized = await materializeSlackFileUpload({
|
|
222
|
+
assetId: initialized.assetId,
|
|
223
|
+
operationId: initialized.operationId
|
|
224
|
+
});
|
|
225
|
+
console.log(
|
|
226
|
+
source_default.green(`\u2713 File published (asset_id: ${materialized.assetId})`)
|
|
227
|
+
);
|
|
228
|
+
console.log(source_default.dim(` url: ${materialized.url}`));
|
|
229
|
+
if (materialized.delivery.status === "delivered") {
|
|
230
|
+
console.log(
|
|
231
|
+
source_default.green(
|
|
232
|
+
`\u2713 Delivered to Slack (file_id: ${materialized.delivery.fileId})`
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
console.log(source_default.dim(` permalink: ${materialized.delivery.permalink}`));
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (materialized.delivery.status === "failed") {
|
|
239
|
+
console.warn(
|
|
240
|
+
source_default.yellow(`\u26A0 Slack delivery failed: ${materialized.delivery.message}`)
|
|
241
|
+
);
|
|
242
|
+
warnDeliveryRetry(initialized.operationId);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
await completeCanonicalSlackDelivery({
|
|
246
|
+
initialized,
|
|
247
|
+
delivery: materialized.delivery,
|
|
248
|
+
options,
|
|
249
|
+
fileContent
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
async function uploadFile(options) {
|
|
253
|
+
const file = readUploadFile(options.file);
|
|
254
|
+
const filename = basename(options.file);
|
|
255
|
+
const rawContentType = options.contentType ?? inferWebUploadContentType(options.file);
|
|
256
|
+
const contentType = rawContentType.split(";")[0]?.trim().toLowerCase() ?? rawContentType;
|
|
257
|
+
const operationId = options.operationId ?? randomUUID();
|
|
258
|
+
const checksumSha256 = createHash("sha256").update(file.content).digest("hex");
|
|
259
|
+
const initialized = await initSlackFileUpload({
|
|
260
|
+
filename,
|
|
261
|
+
length: file.size,
|
|
262
|
+
canonical: {
|
|
263
|
+
operationId,
|
|
264
|
+
contentType,
|
|
265
|
+
checksumSha256,
|
|
266
|
+
channel: options.channel,
|
|
267
|
+
threadTs: options.thread,
|
|
268
|
+
title: options.title,
|
|
269
|
+
initialComment: options.comment
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
if ("fileId" in initialized) {
|
|
273
|
+
await uploadDirectlyToSlack(initialized, options, file.content);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
await publishCanonicalFile(initialized, options, contentType, file.content);
|
|
277
|
+
}
|
|
278
|
+
var uploadFileCommand = new Command().name("upload-file").description("Upload a file to a Slack channel as the bot").requiredOption("-f, --file <path>", "Local file path to upload").requiredOption("-c, --channel <id>", "Slack channel ID").option("--thread <ts>", "Thread timestamp to post as a reply").option("--title <title>", "Display title for the file").option("--comment <text>", "Initial comment to accompany the file").option("--content-type <mime>", "Override inferred content type").option("--operation-id <uuid>", "Reuse a failed upload operation").addHelpText(
|
|
115
279
|
"after",
|
|
116
280
|
`
|
|
117
281
|
Examples:
|
|
@@ -121,47 +285,9 @@ Examples:
|
|
|
121
285
|
|
|
122
286
|
Notes:
|
|
123
287
|
- Uses the bot token (not user SLACK_TOKEN), so no files:write permission is needed
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
async (options) => {
|
|
128
|
-
let fileSize;
|
|
129
|
-
try {
|
|
130
|
-
const stat = statSync(options.file);
|
|
131
|
-
fileSize = stat.size;
|
|
132
|
-
} catch {
|
|
133
|
-
throw new Error(`File not found: ${options.file}`);
|
|
134
|
-
}
|
|
135
|
-
if (fileSize === 0) {
|
|
136
|
-
throw new Error("File is empty");
|
|
137
|
-
}
|
|
138
|
-
const filename = basename(options.file);
|
|
139
|
-
const { uploadUrl, fileId } = await initSlackFileUpload({
|
|
140
|
-
filename,
|
|
141
|
-
length: fileSize
|
|
142
|
-
});
|
|
143
|
-
const fileContent = readFileSync2(options.file);
|
|
144
|
-
const uploadResponse = await fetch(uploadUrl, {
|
|
145
|
-
method: "POST",
|
|
146
|
-
body: fileContent
|
|
147
|
-
});
|
|
148
|
-
if (!uploadResponse.ok) {
|
|
149
|
-
throw new Error(
|
|
150
|
-
`File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
const result = await completeSlackFileUpload({
|
|
154
|
-
fileId,
|
|
155
|
-
channel: options.channel,
|
|
156
|
-
threadTs: options.thread,
|
|
157
|
-
title: options.title,
|
|
158
|
-
initialComment: options.comment
|
|
159
|
-
});
|
|
160
|
-
console.log(source_default.green(`\u2713 File uploaded (file_id: ${result.fileId})`));
|
|
161
|
-
console.log(source_default.dim(` permalink: ${result.permalink}`));
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
);
|
|
288
|
+
- Run-scoped calls publish to VM0 storage before Slack delivery
|
|
289
|
+
- Returns canonical asset details and Slack delivery status`
|
|
290
|
+
).action(withErrorHandler(uploadFile));
|
|
165
291
|
|
|
166
292
|
// src/commands/zero/slack/download-file.ts
|
|
167
293
|
init_esm_shims();
|
|
@@ -218,4 +344,4 @@ Examples:
|
|
|
218
344
|
export {
|
|
219
345
|
zeroSlackCommand
|
|
220
346
|
};
|
|
221
|
-
//# sourceMappingURL=slack-
|
|
347
|
+
//# sourceMappingURL=slack-WXDCNAI2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/slack/index.ts","../src/commands/zero/slack/message/index.ts","../src/commands/zero/slack/message/send.ts","../src/commands/zero/slack/upload-file.ts","../src/commands/zero/slack/download-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroSlackMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\nimport { downloadFileCommand } from \"./download-file\";\n\nexport const zeroSlackCommand = new Command()\n .name(\"slack\")\n .description(\n \"Send messages, upload files, and download files from Slack as the bot\",\n )\n .addCommand(zeroSlackMessageCommand)\n .addCommand(uploadFileCommand)\n .addCommand(downloadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n Send a message: zero slack message send -c <channel-id> -t \"Hello!\"\n Reply in a thread: zero slack message send -c <channel-id> --thread <ts> -t \"reply\"\n Upload a file: zero slack upload-file -f /tmp/report.pdf -c <channel-id>\n Download a file: zero slack download-file <file-id> -o /tmp/out.png`,\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroSlackMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Slack messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero slack message send -c <channel-id> -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sendSlackMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Slack channel or DM a user\")\n .option(\"-c, --channel <id>\", \"Channel ID\")\n .option(\"-u, --user <id>\", 'Slack user ID for DM (use \"me\" for yourself)')\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--thread <ts>\", \"Thread timestamp for replies\")\n .option(\"--blocks <json>\", \"Block Kit JSON string\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero slack message send -c C01234 -t \"Hello!\"\n DM a user: zero slack message send -u U0A8V9X98QJ -t \"Hello!\"\n DM yourself: zero slack message send -u me -t \"Hello!\"\n Reply in thread: zero slack message send -c C01234 --thread 1234567890.123456 -t \"reply\"\n Rich blocks: zero slack message send -c C01234 --blocks '[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Bold*\"}}]'\n\nNotes:\n - Either --channel or --user is required; they are mutually exclusive\n - Either --text or --blocks is required; both can be used together`,\n )\n .action(\n withErrorHandler(\n async (options: {\n channel?: string;\n user?: string;\n text?: string;\n thread?: string;\n blocks?: string;\n }) => {\n let text = options.text;\n const { channel, user, thread, blocks: blocksStr } = options;\n\n // Validate mutual exclusion: exactly one of --channel or --user\n if (!channel && !user) {\n throw new Error(\"Either --channel or --user must be provided\", {\n cause: new Error(\n 'Usage: zero slack message send -c CHANNEL_ID -t \"your message\"\\n zero slack message send -u USER_ID -t \"your message\"',\n ),\n });\n }\n if (channel && user) {\n throw new Error(\"--channel and --user are mutually exclusive\", {\n cause: new Error(\n \"Provide either --channel to send to a channel or --user to DM a user, not both\",\n ),\n });\n }\n\n // Read from stdin if text not provided and stdin is not a TTY\n // (isTTY is true only for an interactive terminal, undefined when piped).\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 // Parse blocks JSON if provided\n let blocks: Array<{ type: string; [key: string]: unknown }> | undefined;\n if (blocksStr) {\n try {\n blocks = JSON.parse(blocksStr) as Array<{\n type: string;\n [key: string]: unknown;\n }>;\n } catch {\n throw new Error(\"Invalid JSON for --blocks flag\", {\n cause: new Error(\n \"Provide a valid JSON array of Block Kit blocks\",\n ),\n });\n }\n }\n\n // Validate at least one of text or blocks\n if (!text && !blocks) {\n throw new Error(\"Either --text or --blocks must be provided\", {\n cause: new Error(\n 'Usage: zero slack message send -c CHANNEL_ID -t \"your message\"',\n ),\n });\n }\n\n const result = await sendSlackMessage({\n channel: channel || undefined,\n user: user || undefined,\n text: text || undefined,\n threadTs: thread,\n blocks,\n });\n\n const tsInfo = result.ts ? ` (ts: ${result.ts})` : \"\";\n console.log(chalk.green(`✓ Message sent${tsInfo}`));\n },\n ),\n );\n","import { createHash, randomUUID } from \"node:crypto\";\nimport { statSync, readFileSync } from \"fs\";\nimport { basename } from \"path\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type {\n SlackUploadInitResponse,\n SlackUploadMaterializeResponse,\n} from \"@vm0/api-contracts/contracts/integrations\";\nimport {\n completeSlackFileUpload,\n inferWebUploadContentType,\n initSlackFileUpload,\n materializeSlackFileUpload,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\ninterface UploadFileOptions {\n readonly file: string;\n readonly channel: string;\n readonly thread?: string;\n readonly title?: string;\n readonly comment?: string;\n readonly contentType?: string;\n readonly operationId?: string;\n}\n\ntype DirectUploadInitialization = Extract<\n SlackUploadInitResponse,\n { fileId: string }\n>;\ntype CanonicalUploadInitialization = Extract<\n SlackUploadInitResponse,\n { kind: \"canonical\" }\n>;\ntype PendingSlackDelivery = Extract<\n SlackUploadMaterializeResponse[\"delivery\"],\n { status: \"pending\" }\n>;\n\nfunction readUploadFile(path: string): {\n readonly content: Buffer;\n readonly size: number;\n} {\n let size: number;\n try {\n size = statSync(path).size;\n } catch {\n throw new Error(`File not found: ${path}`);\n }\n if (size === 0) {\n throw new Error(\"File is empty\");\n }\n return { content: readFileSync(path), size };\n}\n\nfunction warnDeliveryRetry(operationId: string): void {\n console.warn(chalk.dim(` Retry with --operation-id ${operationId}`));\n}\n\nasync function uploadDirectlyToSlack(\n initialized: DirectUploadInitialization,\n options: UploadFileOptions,\n fileContent: Buffer,\n): Promise<void> {\n const uploadResponse = await fetch(initialized.uploadUrl, {\n method: \"POST\",\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n const result = await completeSlackFileUpload({\n fileId: initialized.fileId,\n channel: options.channel,\n threadTs: options.thread,\n title: options.title,\n initialComment: options.comment,\n });\n console.log(chalk.green(`✓ File uploaded (file_id: ${result.fileId})`));\n console.log(chalk.dim(` permalink: ${result.permalink}`));\n}\n\nasync function uploadCanonicalBody(\n initialized: CanonicalUploadInitialization,\n contentType: string,\n fileContent: Buffer,\n): Promise<void> {\n if (!initialized.uploadUrl) {\n return;\n }\n const uploadResponse = await fetch(initialized.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": contentType },\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n throw new Error(\n `Canonical file upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n}\n\nasync function uploadPendingSlackBody(\n delivery: PendingSlackDelivery,\n fileContent: Buffer,\n): Promise<string | undefined> {\n try {\n const uploadResponse = await fetch(delivery.uploadUrl, {\n method: \"POST\",\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n return `Slack upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`;\n }\n return undefined;\n } catch (error) {\n return error instanceof Error ? error.message : \"Slack upload failed\";\n }\n}\n\nasync function completeCanonicalSlackDelivery(args: {\n readonly initialized: CanonicalUploadInitialization;\n readonly delivery: PendingSlackDelivery;\n readonly options: UploadFileOptions;\n readonly fileContent: Buffer;\n}): Promise<void> {\n const uploadError = await uploadPendingSlackBody(\n args.delivery,\n args.fileContent,\n );\n let result: Awaited<ReturnType<typeof completeSlackFileUpload>>;\n try {\n result = await completeSlackFileUpload({\n fileId: args.delivery.fileId,\n channel: args.options.channel,\n ...(args.options.thread ? { threadTs: args.options.thread } : {}),\n ...(args.options.title ? { title: args.options.title } : {}),\n ...(args.options.comment ? { initialComment: args.options.comment } : {}),\n canonicalAssetId: args.initialized.assetId,\n operationId: args.initialized.operationId,\n ...(uploadError ? { uploadError } : {}),\n });\n } catch (error) {\n console.warn(\n chalk.yellow(\n `⚠ Slack delivery status could not be recorded: ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n ),\n );\n warnDeliveryRetry(args.initialized.operationId);\n return;\n }\n if (result.deliveryStatus === \"failed\") {\n console.warn(\n chalk.yellow(\n `⚠ Slack delivery failed: ${result.deliveryError ?? \"Unknown error\"}`,\n ),\n );\n warnDeliveryRetry(args.initialized.operationId);\n return;\n }\n console.log(chalk.green(`✓ Delivered to Slack (file_id: ${result.fileId})`));\n console.log(chalk.dim(` permalink: ${result.permalink}`));\n}\n\nasync function publishCanonicalFile(\n initialized: CanonicalUploadInitialization,\n options: UploadFileOptions,\n contentType: string,\n fileContent: Buffer,\n): Promise<void> {\n await uploadCanonicalBody(initialized, contentType, fileContent);\n const materialized = await materializeSlackFileUpload({\n assetId: initialized.assetId,\n operationId: initialized.operationId,\n });\n console.log(\n chalk.green(`✓ File published (asset_id: ${materialized.assetId})`),\n );\n console.log(chalk.dim(` url: ${materialized.url}`));\n\n if (materialized.delivery.status === \"delivered\") {\n console.log(\n chalk.green(\n `✓ Delivered to Slack (file_id: ${materialized.delivery.fileId})`,\n ),\n );\n console.log(chalk.dim(` permalink: ${materialized.delivery.permalink}`));\n return;\n }\n if (materialized.delivery.status === \"failed\") {\n console.warn(\n chalk.yellow(`⚠ Slack delivery failed: ${materialized.delivery.message}`),\n );\n warnDeliveryRetry(initialized.operationId);\n return;\n }\n await completeCanonicalSlackDelivery({\n initialized,\n delivery: materialized.delivery,\n options,\n fileContent,\n });\n}\n\nasync function uploadFile(options: UploadFileOptions): Promise<void> {\n const file = readUploadFile(options.file);\n const filename = basename(options.file);\n const rawContentType =\n options.contentType ?? inferWebUploadContentType(options.file);\n const contentType =\n rawContentType.split(\";\")[0]?.trim().toLowerCase() ?? rawContentType;\n const operationId = options.operationId ?? randomUUID();\n const checksumSha256 = createHash(\"sha256\")\n .update(file.content)\n .digest(\"hex\");\n const initialized = await initSlackFileUpload({\n filename,\n length: file.size,\n canonical: {\n operationId,\n contentType,\n checksumSha256,\n channel: options.channel,\n threadTs: options.thread,\n title: options.title,\n initialComment: options.comment,\n },\n });\n\n if (\"fileId\" in initialized) {\n await uploadDirectlyToSlack(initialized, options, file.content);\n return;\n }\n await publishCanonicalFile(initialized, options, contentType, file.content);\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\"Upload a file to a Slack channel as the bot\")\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"-c, --channel <id>\", \"Slack channel ID\")\n .option(\"--thread <ts>\", \"Thread timestamp to post as a reply\")\n .option(\"--title <title>\", \"Display title for the file\")\n .option(\"--comment <text>\", \"Initial comment to accompany the file\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .option(\"--operation-id <uuid>\", \"Reuse a failed upload operation\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero slack upload-file -f /tmp/report.pdf -c C01234\n Upload to thread: zero slack upload-file -f /tmp/log.txt -c C01234 --thread 1234567890.123456\n With title and comment: zero slack upload-file -f /tmp/data.csv -c C01234 --title \"Daily Report\" --comment \"Here's the report\"\n\nNotes:\n - Uses the bot token (not user SLACK_TOKEN), so no files:write permission is needed\n - Run-scoped calls publish to VM0 storage before Slack delivery\n - Returns canonical asset details and Slack delivery status`,\n )\n .action(withErrorHandler(uploadFile));\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadSlackFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\n/**\n * Derive a local output path for a Slack file id.\n * Uses the system temp directory; extension is appended later once the\n * mimetype is known.\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(), `slack-${basename(fileId)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Slack file by id using the bot token\")\n .argument(\"<file-id>\", \"Slack file id (e.g. F01234ABCD)\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/slack-<file-id>)\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero slack download-file F01234ABCD\n Download to explicit path: zero slack download-file F01234ABCD -o /tmp/image.png\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/slack-F01234ABCD\",\"mimetype\":\"image/png\",\"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 bot token on the server side; no user Slack token is needed\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 downloadSlackFile(fileId, outPath);\n console.log(JSON.stringify(result));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,SAAS,oBAAoB;AAMtB,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,YAAY,gDAAgD,EAC5D,OAAO,sBAAsB,YAAY,EACzC,OAAO,mBAAmB,8CAA8C,EACxE,OAAO,wBAAwB,cAAc,EAC7C,OAAO,iBAAiB,8BAA8B,EACtD,OAAO,mBAAmB,uBAAuB,EACjD;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWF,EACC;AAAA,EACC;AAAA,IACE,OAAO,YAMD;AACJ,UAAI,OAAO,QAAQ;AACnB,YAAM,EAAE,SA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vD;AAAA,EACC;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBF,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;;;AJlDK,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;AAMF;","names":["readFileSync","readFileSync","basename","basename"]}
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
downloadTeamsFile,
|
|
7
7
|
initTeamsFileUpload,
|
|
8
8
|
sendTeamsMessage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3QXK5RR7.js";
|
|
10
10
|
import "./chunk-LTDQISD7.js";
|
|
11
11
|
import {
|
|
12
12
|
source_default,
|
|
13
13
|
withErrorHandler
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XE764T2N.js";
|
|
15
15
|
import "./chunk-LRHXR7JT.js";
|
|
16
16
|
import {
|
|
17
17
|
Command
|
|
@@ -279,4 +279,4 @@ Examples:
|
|
|
279
279
|
export {
|
|
280
280
|
zeroTeamsCommand
|
|
281
281
|
};
|
|
282
|
-
//# sourceMappingURL=teams-
|
|
282
|
+
//# sourceMappingURL=teams-LAQBLRUR.js.map
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
initTelegramFileUpload,
|
|
8
8
|
listTelegramBots,
|
|
9
9
|
sendTelegramMessage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3QXK5RR7.js";
|
|
11
11
|
import "./chunk-LTDQISD7.js";
|
|
12
12
|
import {
|
|
13
13
|
source_default,
|
|
14
14
|
withErrorHandler
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XE764T2N.js";
|
|
16
16
|
import "./chunk-LRHXR7JT.js";
|
|
17
17
|
import {
|
|
18
18
|
Command
|
|
@@ -333,4 +333,4 @@ Examples:
|
|
|
333
333
|
export {
|
|
334
334
|
zeroTelegramCommand
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=telegram-
|
|
336
|
+
//# sourceMappingURL=telegram-5BASFBEA.js.map
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
deleteZeroVariable,
|
|
10
10
|
listZeroVariables,
|
|
11
11
|
setZeroVariable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3QXK5RR7.js";
|
|
13
13
|
import "./chunk-LTDQISD7.js";
|
|
14
14
|
import {
|
|
15
15
|
source_default,
|
|
16
16
|
withErrorHandler
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XE764T2N.js";
|
|
18
18
|
import "./chunk-LRHXR7JT.js";
|
|
19
19
|
import {
|
|
20
20
|
Command
|
|
@@ -115,4 +115,4 @@ var zeroVariableCommand = new Command().name("variable").description("Read or wr
|
|
|
115
115
|
export {
|
|
116
116
|
zeroVariableCommand
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=variable-
|
|
118
|
+
//# sourceMappingURL=variable-GBVHKR6I.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
downloadWebFile,
|
|
7
7
|
transcribeAudio,
|
|
8
8
|
withErrorHandler
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XE764T2N.js";
|
|
10
10
|
import "./chunk-LRHXR7JT.js";
|
|
11
11
|
import {
|
|
12
12
|
Command
|
|
@@ -245,4 +245,4 @@ Tip (video understanding):
|
|
|
245
245
|
export {
|
|
246
246
|
zeroVideoCommand
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=video-
|
|
248
|
+
//# sourceMappingURL=video-3FXQGBYB.js.map
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
callZeroWeather
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3QXK5RR7.js";
|
|
7
7
|
import "./chunk-LTDQISD7.js";
|
|
8
8
|
import {
|
|
9
9
|
source_default,
|
|
10
10
|
withErrorHandler
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XE764T2N.js";
|
|
12
12
|
import "./chunk-LRHXR7JT.js";
|
|
13
13
|
import {
|
|
14
14
|
Command,
|
|
@@ -587,4 +587,4 @@ Notes:
|
|
|
587
587
|
export {
|
|
588
588
|
zeroWeatherCommand
|
|
589
589
|
};
|
|
590
|
-
//# sourceMappingURL=weather-
|
|
590
|
+
//# sourceMappingURL=weather-JNMUODGJ.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
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-3QXK5RR7.js";
|
|
5
5
|
import "./chunk-LTDQISD7.js";
|
|
6
6
|
import {
|
|
7
7
|
downloadWebFile,
|
|
8
8
|
uploadWebFile,
|
|
9
9
|
withErrorHandler
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XE764T2N.js";
|
|
11
11
|
import "./chunk-LRHXR7JT.js";
|
|
12
12
|
import {
|
|
13
13
|
Command
|
|
@@ -105,4 +105,4 @@ Examples:
|
|
|
105
105
|
export {
|
|
106
106
|
zeroWebCommand
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=web-
|
|
108
|
+
//# sourceMappingURL=web-DZT26X4I.js.map
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
zeroWebSearchDomainSchema,
|
|
10
10
|
zeroWebSearchRecencySchema,
|
|
11
11
|
zeroWebSearchRequestSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3QXK5RR7.js";
|
|
13
13
|
import "./chunk-LTDQISD7.js";
|
|
14
14
|
import {
|
|
15
15
|
source_default,
|
|
16
16
|
withErrorHandler
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XE764T2N.js";
|
|
18
18
|
import "./chunk-LRHXR7JT.js";
|
|
19
19
|
import {
|
|
20
20
|
Command,
|
|
@@ -147,4 +147,4 @@ Notes:
|
|
|
147
147
|
export {
|
|
148
148
|
zeroWebSearchCommand
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=web-search-
|
|
150
|
+
//# sourceMappingURL=web-search-36UUSSUX.js.map
|
|
@@ -4,15 +4,15 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
loadConnectorPermissionInfos,
|
|
6
6
|
policyIcon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6IFIMWPY.js";
|
|
8
8
|
import {
|
|
9
9
|
permissionGrantsToFirewallPolicies
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZJENFGWZ.js";
|
|
11
11
|
import {
|
|
12
12
|
getZeroAgentUserConnectors,
|
|
13
13
|
listZeroConnectors,
|
|
14
14
|
listZeroUserPermissionGrants
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3QXK5RR7.js";
|
|
16
16
|
import "./chunk-LTDQISD7.js";
|
|
17
17
|
import {
|
|
18
18
|
getActiveOrg,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getToken,
|
|
21
21
|
source_default,
|
|
22
22
|
withErrorHandler
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XE764T2N.js";
|
|
24
24
|
import {
|
|
25
25
|
decodeZeroTokenPayload
|
|
26
26
|
} from "./chunk-LRHXR7JT.js";
|
|
@@ -195,4 +195,4 @@ Notes:
|
|
|
195
195
|
export {
|
|
196
196
|
zeroWhoamiCommand
|
|
197
197
|
};
|
|
198
|
-
//# sourceMappingURL=whoami-
|
|
198
|
+
//# sourceMappingURL=whoami-NXYCNII4.js.map
|
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
listWorkflows,
|
|
20
20
|
updateWorkflow,
|
|
21
21
|
updateWorkflowAutomation
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3QXK5RR7.js";
|
|
23
23
|
import "./chunk-LTDQISD7.js";
|
|
24
24
|
import {
|
|
25
25
|
source_default,
|
|
26
26
|
withErrorHandler
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-XE764T2N.js";
|
|
28
28
|
import "./chunk-LRHXR7JT.js";
|
|
29
29
|
import {
|
|
30
30
|
Command
|
|
@@ -1792,4 +1792,4 @@ Examples:
|
|
|
1792
1792
|
export {
|
|
1793
1793
|
zeroWorkflowCommand
|
|
1794
1794
|
};
|
|
1795
|
-
//# sourceMappingURL=workflow-
|
|
1795
|
+
//# sourceMappingURL=workflow-WHTBJCEF.js.map
|