@vm0/cli 9.255.0 → 9.257.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-YXVPOZDT.js → agent-6PNU7NKA.js} +7 -7
- package/{banking-K734DGW4.js → banking-LIKZNNA3.js} +5 -5
- package/{browser-GMLGBTV7.js → browser-4R2YDR62.js} +49 -23
- package/browser-4R2YDR62.js.map +1 -0
- package/{chat-I2URW23Z.js → chat-PSSM3NZI.js} +6 -6
- package/{chunk-DQB537B5.js → chunk-AXPECIRA.js} +8 -7
- package/chunk-AXPECIRA.js.map +1 -0
- package/{chunk-MDKQRZ7S.js → chunk-DIK5B4ZQ.js} +79 -57
- package/{chunk-MDKQRZ7S.js.map → chunk-DIK5B4ZQ.js.map} +1 -1
- package/{chunk-BKR7J5QP.js → chunk-GF22PXYF.js} +2 -2
- package/{chunk-RKXDWJW5.js → chunk-KDNGT5NT.js} +2 -30
- package/chunk-KDNGT5NT.js.map +1 -0
- package/{chunk-24QJ7H5R.js → chunk-NAXSTGVS.js} +2 -2
- package/{chunk-UKQRMBLJ.js → chunk-OMZ7JNGC.js} +2 -2
- package/{chunk-7PFY5Y77.js → chunk-RKOGVYZD.js} +3 -3
- package/{chunk-ZLP3TODB.js → chunk-RLKJ2XNZ.js} +2 -2
- package/{chunk-45FQJCB2.js → chunk-TP7AVH5K.js} +2 -2
- package/{chunk-H4LRAOOF.js → chunk-X5FAOKYK.js} +2 -3
- package/{chunk-H4LRAOOF.js.map → chunk-X5FAOKYK.js.map} +1 -1
- package/{chunk-BYD553JQ.js → chunk-ZQOFNY34.js} +4 -4
- package/{computer-use-OVYDVFLM.js → computer-use-54M26ZHL.js} +5 -5
- package/{connector-ZJ4GNXOR.js → connector-NQP2OC55.js} +8 -8
- package/{credit-5F56FMHI.js → credit-IHTXTFPT.js} +7 -7
- package/{developer-support-DMN7JGPX.js → developer-support-Z2A6DWF7.js} +5 -5
- package/{doctor-Y724BLON.js → doctor-KTLE2XJI.js} +7 -7
- package/{feishu-T5ZIWV53.js → feishu-GKPQY3AW.js} +5 -5
- package/{finance-4ZRCXMFS.js → finance-KIIZG3ZI.js} +5 -5
- package/{generate-JFRB6NBZ.js → generate-76I6OUDC.js} +7 -7
- package/{github-ZXWGL5Q6.js → github-YU7FN4T4.js} +5 -5
- package/{goal-22N3CH3F.js → goal-XJUAREVX.js} +5 -5
- package/{host-I7S5PYUY.js → host-7BZHM6UL.js} +5 -5
- package/{logs-4HV44EMA.js → logs-6HBWQTDR.js} +6 -6
- package/{mail-U5LPAC7X.js → mail-UHSIDK2L.js} +7 -7
- package/{maps-PF5WHYEC.js → maps-E7UDZIQW.js} +5 -5
- package/{model-JMQSUUFJ.js → model-JNX4ATJD.js} +6 -6
- package/{model-provider-AJCWCCNB.js → model-provider-3OJOREKY.js} +6 -6
- package/{org-7Q3J66NB.js → org-HFW3TZVX.js} +5 -5
- package/package.json +1 -1
- package/{people-search-GUIJICYT.js → people-search-P4DUITUE.js} +5 -5
- package/{phone-6U27VFNC.js → phone-HEDFCVAX.js} +5 -5
- package/{preference-BFLHPME6.js → preference-ZFGOHT3I.js} +5 -5
- package/{resource-C3PAGM7Y.js → resource-JOLB3ZCJ.js} +5 -5
- package/{scrape-5XL47HZY.js → scrape-YMTMJRHW.js} +5 -5
- package/{search-B2V6NTUP.js → search-ZJJZXAVE.js} +6 -6
- package/{secret-QORKNSMC.js → secret-HE7UT6PO.js} +5 -5
- package/{slack-MD6HYUDE.js → slack-CMNXWUKS.js} +5 -5
- package/{teams-LO3PPNA2.js → teams-ZSHKKQUD.js} +5 -5
- package/{telegram-BZUBR4QS.js → telegram-VLCEN6MM.js} +5 -5
- package/{upgrade-63B4TM4E.js → upgrade-WX3U7MZI.js} +4 -4
- package/{variable-FW7F63SB.js → variable-H54WRRXG.js} +5 -5
- package/{video-RWCQZ4XP.js → video-XJJZZYSG.js} +4 -4
- package/{weather-ST6CIHV4.js → weather-XWXK6CZY.js} +5 -5
- package/{web-GBSYVVYF.js → web-5UY5AYFW.js} +5 -5
- package/{web-search-AZXILILB.js → web-search-4MQUXAQH.js} +5 -5
- package/{whoami-UI67766P.js → whoami-XWFEH6TT.js} +7 -7
- package/{workflow-CXWRSWUP.js → workflow-GAXXRI6N.js} +5 -5
- package/zero.js +43 -43
- package/browser-GMLGBTV7.js.map +0 -1
- package/chunk-DQB537B5.js.map +0 -1
- package/chunk-RKXDWJW5.js.map +0 -1
- /package/{agent-YXVPOZDT.js.map → agent-6PNU7NKA.js.map} +0 -0
- /package/{banking-K734DGW4.js.map → banking-LIKZNNA3.js.map} +0 -0
- /package/{chat-I2URW23Z.js.map → chat-PSSM3NZI.js.map} +0 -0
- /package/{chunk-BKR7J5QP.js.map → chunk-GF22PXYF.js.map} +0 -0
- /package/{chunk-24QJ7H5R.js.map → chunk-NAXSTGVS.js.map} +0 -0
- /package/{chunk-UKQRMBLJ.js.map → chunk-OMZ7JNGC.js.map} +0 -0
- /package/{chunk-7PFY5Y77.js.map → chunk-RKOGVYZD.js.map} +0 -0
- /package/{chunk-ZLP3TODB.js.map → chunk-RLKJ2XNZ.js.map} +0 -0
- /package/{chunk-45FQJCB2.js.map → chunk-TP7AVH5K.js.map} +0 -0
- /package/{chunk-BYD553JQ.js.map → chunk-ZQOFNY34.js.map} +0 -0
- /package/{computer-use-OVYDVFLM.js.map → computer-use-54M26ZHL.js.map} +0 -0
- /package/{connector-ZJ4GNXOR.js.map → connector-NQP2OC55.js.map} +0 -0
- /package/{credit-5F56FMHI.js.map → credit-IHTXTFPT.js.map} +0 -0
- /package/{developer-support-DMN7JGPX.js.map → developer-support-Z2A6DWF7.js.map} +0 -0
- /package/{doctor-Y724BLON.js.map → doctor-KTLE2XJI.js.map} +0 -0
- /package/{feishu-T5ZIWV53.js.map → feishu-GKPQY3AW.js.map} +0 -0
- /package/{finance-4ZRCXMFS.js.map → finance-KIIZG3ZI.js.map} +0 -0
- /package/{generate-JFRB6NBZ.js.map → generate-76I6OUDC.js.map} +0 -0
- /package/{github-ZXWGL5Q6.js.map → github-YU7FN4T4.js.map} +0 -0
- /package/{goal-22N3CH3F.js.map → goal-XJUAREVX.js.map} +0 -0
- /package/{host-I7S5PYUY.js.map → host-7BZHM6UL.js.map} +0 -0
- /package/{logs-4HV44EMA.js.map → logs-6HBWQTDR.js.map} +0 -0
- /package/{mail-U5LPAC7X.js.map → mail-UHSIDK2L.js.map} +0 -0
- /package/{maps-PF5WHYEC.js.map → maps-E7UDZIQW.js.map} +0 -0
- /package/{model-JMQSUUFJ.js.map → model-JNX4ATJD.js.map} +0 -0
- /package/{model-provider-AJCWCCNB.js.map → model-provider-3OJOREKY.js.map} +0 -0
- /package/{org-7Q3J66NB.js.map → org-HFW3TZVX.js.map} +0 -0
- /package/{people-search-GUIJICYT.js.map → people-search-P4DUITUE.js.map} +0 -0
- /package/{phone-6U27VFNC.js.map → phone-HEDFCVAX.js.map} +0 -0
- /package/{preference-BFLHPME6.js.map → preference-ZFGOHT3I.js.map} +0 -0
- /package/{resource-C3PAGM7Y.js.map → resource-JOLB3ZCJ.js.map} +0 -0
- /package/{scrape-5XL47HZY.js.map → scrape-YMTMJRHW.js.map} +0 -0
- /package/{search-B2V6NTUP.js.map → search-ZJJZXAVE.js.map} +0 -0
- /package/{secret-QORKNSMC.js.map → secret-HE7UT6PO.js.map} +0 -0
- /package/{slack-MD6HYUDE.js.map → slack-CMNXWUKS.js.map} +0 -0
- /package/{teams-LO3PPNA2.js.map → teams-ZSHKKQUD.js.map} +0 -0
- /package/{telegram-BZUBR4QS.js.map → telegram-VLCEN6MM.js.map} +0 -0
- /package/{upgrade-63B4TM4E.js.map → upgrade-WX3U7MZI.js.map} +0 -0
- /package/{variable-FW7F63SB.js.map → variable-H54WRRXG.js.map} +0 -0
- /package/{video-RWCQZ4XP.js.map → video-XJJZZYSG.js.map} +0 -0
- /package/{weather-ST6CIHV4.js.map → weather-XWXK6CZY.js.map} +0 -0
- /package/{web-GBSYVVYF.js.map → web-5UY5AYFW.js.map} +0 -0
- /package/{web-search-AZXILILB.js.map → web-search-4MQUXAQH.js.map} +0 -0
- /package/{whoami-UI67766P.js.map → whoami-XWFEH6TT.js.map} +0 -0
- /package/{workflow-CXWRSWUP.js.map → workflow-GAXXRI6N.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
decodeZeroTokenPayload
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X5FAOKYK.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -29,4 +29,4 @@ export {
|
|
|
29
29
|
currentPlanAllowsVideo,
|
|
30
30
|
currentTokenCanReadBilling
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-GF22PXYF.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getActiveToken,
|
|
7
7
|
getBaseUrl,
|
|
8
8
|
headersWithCliClientHeaders
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AXPECIRA.js";
|
|
10
10
|
import {
|
|
11
11
|
init_esm_shims
|
|
12
12
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -120,10 +120,6 @@ async function downloadWebFile(fileId, outPath) {
|
|
|
120
120
|
const headers = {
|
|
121
121
|
Authorization: `Bearer ${token}`
|
|
122
122
|
};
|
|
123
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
124
|
-
if (bypassSecret) {
|
|
125
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
126
|
-
}
|
|
127
123
|
const response = await fetch(url, {
|
|
128
124
|
headers: headersWithCliClientHeaders(headers)
|
|
129
125
|
});
|
|
@@ -202,10 +198,6 @@ function authenticatedJsonHeaders(token) {
|
|
|
202
198
|
Authorization: `Bearer ${token}`,
|
|
203
199
|
"Content-Type": "application/json"
|
|
204
200
|
};
|
|
205
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
206
|
-
if (bypassSecret) {
|
|
207
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
208
|
-
}
|
|
209
201
|
return headersWithCliClientHeaders(headers);
|
|
210
202
|
}
|
|
211
203
|
function isRecord(value) {
|
|
@@ -446,10 +438,6 @@ async function uploadWebFile(localPath, options) {
|
|
|
446
438
|
Authorization: `Bearer ${token}`,
|
|
447
439
|
"Content-Type": "application/json"
|
|
448
440
|
};
|
|
449
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
450
|
-
if (bypassSecret) {
|
|
451
|
-
prepareHeaders["x-vercel-protection-bypass"] = bypassSecret;
|
|
452
|
-
}
|
|
453
441
|
const prepareUrl = new URL("/api/zero/uploads/prepare", baseUrl);
|
|
454
442
|
const prepareRes = await fetch(prepareUrl, {
|
|
455
443
|
method: "POST",
|
|
@@ -512,10 +500,6 @@ async function generateWebVoice(options) {
|
|
|
512
500
|
Authorization: `Bearer ${token}`,
|
|
513
501
|
"Content-Type": "application/json"
|
|
514
502
|
};
|
|
515
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
516
|
-
if (bypassSecret) {
|
|
517
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
518
|
-
}
|
|
519
503
|
const response = await fetch(new URL("/api/zero/voice-io/speech", baseUrl), {
|
|
520
504
|
method: "POST",
|
|
521
505
|
headers: headersWithCliClientHeaders(headers),
|
|
@@ -544,10 +528,6 @@ async function generateWebImage(options) {
|
|
|
544
528
|
Authorization: `Bearer ${token}`,
|
|
545
529
|
"Content-Type": "application/json"
|
|
546
530
|
};
|
|
547
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
548
|
-
if (bypassSecret) {
|
|
549
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
550
|
-
}
|
|
551
531
|
const response = await fetch(
|
|
552
532
|
new URL("/api/zero/image-io/generate", baseUrl),
|
|
553
533
|
{
|
|
@@ -596,10 +576,6 @@ async function generateWebVideo(options) {
|
|
|
596
576
|
Authorization: `Bearer ${token}`,
|
|
597
577
|
"Content-Type": "application/json"
|
|
598
578
|
};
|
|
599
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
600
|
-
if (bypassSecret) {
|
|
601
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
602
|
-
}
|
|
603
579
|
const response = await fetch(
|
|
604
580
|
new URL("/api/zero/video-io/generate", baseUrl),
|
|
605
581
|
{
|
|
@@ -631,10 +607,6 @@ async function transcribeAudio(audioPath, options = {}) {
|
|
|
631
607
|
const headers = {
|
|
632
608
|
Authorization: `Bearer ${token}`
|
|
633
609
|
};
|
|
634
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
635
|
-
if (bypassSecret) {
|
|
636
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
637
|
-
}
|
|
638
610
|
const url = new URL("/api/zero/voice-io/stt", baseUrl);
|
|
639
611
|
if (options.verbose) {
|
|
640
612
|
url.searchParams.set("verbose", "true");
|
|
@@ -676,4 +648,4 @@ export {
|
|
|
676
648
|
generateWebVideo,
|
|
677
649
|
transcribeAudio
|
|
678
650
|
};
|
|
679
|
-
//# sourceMappingURL=chunk-
|
|
651
|
+
//# sourceMappingURL=chunk-KDNGT5NT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/api/domains/web.ts"],"sourcesContent":["import { createWriteStream, readFileSync, statSync } from \"node:fs\";\nimport { basename, extname } from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { pipeline } from \"node:stream/promises\";\nimport { setTimeout as delay } from \"node:timers/promises\";\nimport { Realtime, type AuthOptions, type InboundMessage } from \"ably\";\nimport type {\n ZeroBuiltInGenerationAcceptedResponse,\n ZeroBuiltInGenerationResponse,\n} from \"@vm0/api-contracts/contracts/zero-built-in-generation\";\nimport { ApiRequestError, getBaseUrl } from \"../core/client-factory\";\nimport { getActiveToken } from \"../config\";\nimport { headersWithCliClientHeaders } from \"../client-headers\";\n\nconst BUILT_IN_GENERATION_POLL_INTERVAL_MS = 2_000;\nconst BUILT_IN_GENERATION_WAIT_TIMEOUT_MS_BY_TYPE = {\n image: 15 * 60 * 1000,\n video: 30 * 60 * 1000,\n presentation: 60 * 60 * 1000,\n website: 60 * 60 * 1000,\n} as const satisfies Record<\n ZeroBuiltInGenerationAcceptedResponse[\"type\"],\n number\n>;\nconst ABLY_CONNECT_TIMEOUT_MS = 10_000;\n\n/**\n * Minimal extension → MIME map covering the server allowlist for\n * `/api/zero/uploads/prepare`. Kept in this file rather than a shared module\n * to match the YAGNI pattern used elsewhere in the CLI.\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 \".avif\": \"image/avif\",\n \".svg\": \"image/svg+xml\",\n \".bmp\": \"image/bmp\",\n \".heic\": \"image/heic\",\n \".heif\": \"image/heif\",\n \".tif\": \"image/tiff\",\n \".tiff\": \"image/tiff\",\n \".psd\": \"image/vnd.adobe.photoshop\",\n \".mp4\": \"video/mp4\",\n \".webm\": \"video/webm\",\n \".mov\": \"video/quicktime\",\n \".aac\": \"audio/aac\",\n \".flac\": \"audio/flac\",\n \".m4a\": \"audio/mp4\",\n \".mp3\": \"audio/mpeg\",\n \".mpga\": \"audio/mpga\",\n \".oga\": \"audio/ogg\",\n \".ogg\": \"audio/ogg\",\n \".opus\": \"audio/opus\",\n \".wav\": \"audio/wav\",\n \".wave\": \"audio/wave\",\n \".pdf\": \"application/pdf\",\n \".txt\": \"text/plain\",\n \".csv\": \"text/csv\",\n \".md\": \"text/markdown\",\n \".html\": \"text/html\",\n \".htm\": \"text/html\",\n \".json\": \"application/json\",\n \".xml\": \"application/xml\",\n \".yaml\": \"application/yaml\",\n \".yml\": \"application/yaml\",\n \".tsv\": \"text/tab-separated-values\",\n \".doc\": \"application/msword\",\n \".docx\":\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \".docm\": \"application/vnd.ms-word.document.macroenabled.12\",\n \".dotm\": \"application/vnd.ms-word.template.macroenabled.12\",\n \".dotx\":\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.template\",\n \".odt\": \"application/vnd.oasis.opendocument.text\",\n \".rtf\": \"application/rtf\",\n \".xls\": \"application/vnd.ms-excel\",\n \".xlsx\": \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \".xlsb\": \"application/vnd.ms-excel.sheet.binary.macroenabled.12\",\n \".xlsm\": \"application/vnd.ms-excel.sheet.macroenabled.12\",\n \".xltm\": \"application/vnd.ms-excel.template.macroenabled.12\",\n \".xltx\":\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\",\n \".ods\": \"application/vnd.oasis.opendocument.spreadsheet\",\n \".ppt\": \"application/vnd.ms-powerpoint\",\n \".pptx\":\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \".potm\": \"application/vnd.ms-powerpoint.template.macroenabled.12\",\n \".potx\":\n \"application/vnd.openxmlformats-officedocument.presentationml.template\",\n \".odp\": \"application/vnd.oasis.opendocument.presentation\",\n \".ppsx\":\n \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\",\n \".ppsm\": \"application/vnd.ms-powerpoint.slideshow.macroenabled.12\",\n \".pptm\": \"application/vnd.ms-powerpoint.presentation.macroenabled.12\",\n \".zip\": \"application/zip\",\n \".rar\": \"application/vnd.rar\",\n \".7z\": \"application/x-7z-compressed\",\n \".tar\": \"application/x-tar\",\n \".gz\": \"application/gzip\",\n \".tgz\": \"application/gzip\",\n \".bz2\": \"application/x-bzip2\",\n \".xz\": \"application/x-xz\",\n \".pages\": \"application/vnd.apple.pages\",\n \".numbers\": \"application/vnd.apple.numbers\",\n \".key\": \"application/vnd.apple.keynote\",\n \".parquet\": \"application/vnd.apache.parquet\",\n \".sqlite\": \"application/vnd.sqlite3\",\n \".sqlite3\": \"application/vnd.sqlite3\",\n \".db\": \"application/vnd.sqlite3\",\n \".epub\": \"application/epub+zip\",\n \".ai\": \"application/postscript\",\n};\n\nexport function inferWebUploadContentType(localPath: string): string {\n const ext = extname(localPath).toLowerCase();\n return MIME_BY_EXTENSION[ext] ?? \"application/octet-stream\";\n}\n\ninterface DownloadWebFileResult {\n path: string;\n mimetype: string;\n size: number;\n}\n\n/**\n * Download a web-uploaded file to a local path, streaming the response body\n * to disk. Authenticates via ZERO_TOKEN. Response is binary, so this bypasses\n * the typed contract client.\n */\nexport async function downloadWebFile(\n fileId: string,\n outPath: string,\n): Promise<DownloadWebFileResult> {\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const url = new URL(\"/api/zero/web/download-file\", baseUrl);\n url.searchParams.set(\"file_id\", fileId);\n\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n };\n\n const response = await fetch(url, {\n headers: headersWithCliClientHeaders(headers),\n });\n\n if (!response.ok) {\n let message = `Failed to download web file (HTTP ${response.status})`;\n let code = \"UNKNOWN\";\n try {\n const body = (await response.json()) as {\n error?: { message?: string; code?: string };\n };\n if (body.error?.message) message = body.error.message;\n if (body.error?.code) code = body.error.code;\n } catch {\n // ignore parse errors — keep generic message\n }\n throw new ApiRequestError(message, code, response.status);\n }\n\n if (!response.body) {\n throw new ApiRequestError(\n \"Web download response has no body\",\n \"EMPTY_BODY\",\n 502,\n );\n }\n\n const mimetype =\n response.headers.get(\"x-file-mimetype\") ??\n response.headers.get(\"content-type\") ??\n \"application/octet-stream\";\n\n // Cast required: Web API ReadableStream and Node.js ReadableStream are\n // structurally compatible but have incompatible type declarations.\n await pipeline(\n Readable.fromWeb(response.body as never),\n createWriteStream(outPath),\n );\n\n const contentLengthHeader = response.headers.get(\"content-length\");\n const size = contentLengthHeader ? Number(contentLengthHeader) : 0;\n\n return { path: outPath, mimetype, size };\n}\n\ninterface UploadWebFileResult {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n url: string;\n}\n\ninterface GenerateWebVoiceOptions {\n text: string;\n voice?: string;\n instructions?: string;\n}\n\ninterface GenerateWebVoiceResult {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n url: string;\n durationSeconds: number;\n creditsCharged: number;\n model: string;\n voice: string;\n}\n\ninterface GenerateWebImageOptions {\n prompt: string;\n model?: string;\n size?: string;\n quality?: string;\n background?: string;\n outputFormat?: string;\n outputCompression?: number;\n moderation?: string;\n seed?: number;\n safetyTolerance?: string;\n enhancePrompt?: boolean;\n imageUrls?: readonly string[];\n maskImageUrl?: string;\n inputFidelity?: string;\n imagePromptStrength?: number;\n}\n\ninterface GenerateWebImageResult {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n url: string;\n creditsCharged: number;\n model: string;\n provider: string;\n imageSize: string;\n quality: string;\n background: string;\n outputFormat: string;\n outputCompression?: number;\n moderation?: string;\n safetyTolerance?: string;\n revisedPrompt?: string;\n usage?: {\n textInputTokens: number;\n imageInputTokens: number;\n imageOutputTokens: number;\n totalTokens: number;\n };\n billingCategory?: string;\n billingQuantity?: number;\n sourceUrl?: string;\n seed?: number;\n sourceImageUrls?: string[];\n maskImageUrl?: string;\n inputFidelity?: string;\n imagePromptStrength?: number;\n}\n\ninterface GenerateWebVideoOptions {\n prompt: string;\n model?: string;\n aspectRatio?: string;\n duration?: string;\n resolution?: string;\n generateAudio?: boolean;\n negativePrompt?: string;\n seed?: number;\n autoFix?: boolean;\n safetyTolerance?: string;\n imageUrls?: string[];\n videoUrls?: string[];\n audioUrls?: string[];\n firstFrameImageUrl?: string;\n lastFrameImageUrl?: string;\n}\n\ninterface GenerateWebVideoResult {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n url: string;\n durationSeconds: number;\n creditsCharged: number;\n model: string;\n aspectRatio: string;\n duration: string;\n resolution: string;\n generateAudio: boolean;\n sourceUrl: string;\n requestId?: string;\n}\n\nfunction shouldIncludePayloadValue(value: unknown): boolean {\n if (value === undefined) {\n return false;\n }\n return !Array.isArray(value) || value.length > 0;\n}\n\nfunction compactPayload(\n entries: readonly (readonly [string, unknown])[],\n): Record<string, unknown> {\n return Object.fromEntries(\n entries.filter(([, value]) => {\n return shouldIncludePayloadValue(value);\n }),\n );\n}\n\nfunction generateWebVideoPayload(\n options: GenerateWebVideoOptions,\n): Record<string, unknown> {\n return compactPayload([\n [\"prompt\", options.prompt],\n [\"model\", options.model],\n [\"aspectRatio\", options.aspectRatio],\n [\"duration\", options.duration],\n [\"resolution\", options.resolution],\n [\"generateAudio\", options.generateAudio],\n [\"negativePrompt\", options.negativePrompt],\n [\"seed\", options.seed],\n [\"autoFix\", options.autoFix],\n [\"safetyTolerance\", options.safetyTolerance],\n [\"imageUrls\", options.imageUrls],\n [\"videoUrls\", options.videoUrls],\n [\"audioUrls\", options.audioUrls],\n [\"firstFrameImageUrl\", options.firstFrameImageUrl],\n [\"lastFrameImageUrl\", options.lastFrameImageUrl],\n ]);\n}\n\ninterface PrepareUploadResponse {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n uploadUrl: string;\n url: string;\n}\n\ninterface CompleteUploadResponse {\n id: string;\n filename: string;\n contentType: string;\n size: number;\n url: string;\n}\n\nasync function parseErrorBody(\n response: Response,\n fallback: string,\n): Promise<{ message: string; code: string }> {\n let message = `${fallback} (HTTP ${response.status})`;\n let code = \"UNKNOWN\";\n try {\n const body = (await response.json()) as {\n error?: { message?: string; code?: string };\n };\n if (body.error?.message) message = body.error.message;\n if (body.error?.code) code = body.error.code;\n } catch {\n // ignore parse errors — keep generic message\n }\n return { message, code };\n}\n\nfunction authenticatedJsonHeaders(token: string): Headers {\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n return headersWithCliClientHeaders(headers);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isBuiltInGenerationAcceptedResponse(\n value: unknown,\n): value is ZeroBuiltInGenerationAcceptedResponse {\n if (!isRecord(value)) {\n return false;\n }\n return (\n typeof value.generationId === \"string\" &&\n value.status === \"queued\" &&\n (value.type === \"image\" ||\n value.type === \"video\" ||\n value.type === \"presentation\" ||\n value.type === \"website\") &&\n isRecord(value.realtime)\n );\n}\n\ninterface BuiltInGenerationNotifier {\n wait(timeoutMs: number): Promise<void>;\n close(): void;\n}\n\nfunction createBuiltInGenerationRealtime(\n accepted: ZeroBuiltInGenerationAcceptedResponse,\n): Realtime {\n let nextAuthRequest = accepted.realtime.tokenRequest;\n const authCallback: NonNullable<AuthOptions[\"authCallback\"]> = (\n _params,\n callback,\n ) => {\n const current = nextAuthRequest;\n nextAuthRequest = accepted.realtime.tokenRequest;\n callback(null, current);\n };\n\n return new Realtime({\n authCallback,\n autoConnect: true,\n disconnectedRetryTimeout: 5000,\n suspendedRetryTimeout: 15_000,\n });\n}\n\nfunction waitForRealtimeConnected(\n ably: Realtime,\n timeoutMs = ABLY_CONNECT_TIMEOUT_MS,\n): Promise<void> {\n if (ably.connection.state === \"connected\") {\n return Promise.resolve();\n }\n if (ably.connection.state === \"failed\") {\n return Promise.reject(new Error(\"Ably connection failed\"));\n }\n\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new Error(\"Timed out connecting to Ably\"));\n }, timeoutMs);\n\n ably.connection.once(\"connected\", () => {\n clearTimeout(timer);\n resolve();\n });\n ably.connection.once(\"failed\", (stateChange) => {\n clearTimeout(timer);\n reject(\n new Error(\n `Ably connection failed: ${stateChange?.reason?.message ?? \"unknown\"}`,\n ),\n );\n });\n });\n}\n\nasync function createBuiltInGenerationNotifier(\n accepted: ZeroBuiltInGenerationAcceptedResponse,\n): Promise<BuiltInGenerationNotifier | null> {\n const ably = createBuiltInGenerationRealtime(accepted);\n\n try {\n await waitForRealtimeConnected(ably);\n const channel = ably.channels.get(accepted.realtime.channelName);\n\n let pendingEvent = false;\n let closed = false;\n let wake: (() => void) | null = null;\n\n const wakeWaiter = () => {\n const current = wake;\n wake = null;\n current?.();\n };\n\n const onMessage = (_message: InboundMessage) => {\n if (wake) {\n wakeWaiter();\n return;\n }\n pendingEvent = true;\n };\n\n await channel.subscribe(accepted.realtime.eventName, onMessage);\n\n return {\n wait(timeoutMs: number): Promise<void> {\n if (pendingEvent || closed || timeoutMs <= 0) {\n pendingEvent = false;\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n function done() {\n clearTimeout(timer);\n if (wake === done) {\n wake = null;\n }\n resolve();\n }\n const timer = setTimeout(done, timeoutMs);\n wake = done;\n });\n },\n close(): void {\n if (closed) {\n return;\n }\n closed = true;\n channel.unsubscribe(accepted.realtime.eventName, onMessage);\n wakeWaiter();\n ably.close();\n },\n };\n } catch {\n ably.close();\n return null;\n }\n}\n\nasync function getBuiltInGenerationStatus(\n baseUrl: string,\n token: string,\n generationId: string,\n): Promise<ZeroBuiltInGenerationResponse> {\n const response = await fetch(\n new URL(`/api/zero/built-in-generations/${generationId}`, baseUrl),\n { headers: authenticatedJsonHeaders(token) },\n );\n\n if (!response.ok) {\n const { message, code } = await parseErrorBody(\n response,\n \"Failed to get generation status\",\n );\n throw new ApiRequestError(message, code, response.status);\n }\n\n return (await response.json()) as ZeroBuiltInGenerationResponse;\n}\n\nfunction readBuiltInGenerationResult<T>(\n status: ZeroBuiltInGenerationResponse,\n fallback: string,\n): T | undefined {\n if (status.status === \"completed\") {\n if (!status.result) {\n throw new ApiRequestError(\n `${fallback} returned no result`,\n \"EMPTY_RESULT\",\n 502,\n );\n }\n return status.result as T;\n }\n\n if (status.status === \"failed\") {\n const code = status.error?.code ?? \"GENERATION_FAILED\";\n throw new ApiRequestError(\n status.error?.message ?? `${fallback} failed`,\n code,\n statusForBuiltInGenerationError(code),\n );\n }\n\n return undefined;\n}\n\nfunction statusForBuiltInGenerationError(code: string): number {\n if (code === \"BAD_REQUEST\") {\n return 400;\n }\n if (code === \"INSUFFICIENT_CREDITS\") {\n return 402;\n }\n if (code === \"NOT_CONFIGURED\") {\n return 503;\n }\n if (code === \"GENERATION_TIMEOUT\") {\n return 504;\n }\n if (\n code.startsWith(\"BYTEPLUS_INVALID_PARAMETER\") ||\n code.startsWith(\"BYTEPLUS_INPUT_\")\n ) {\n return 400;\n }\n if (code.startsWith(\"BYTEPLUS_\")) {\n return 502;\n }\n if (code.startsWith(\"NO_\") || code.endsWith(\"_FAILED\")) {\n return 502;\n }\n return 500;\n}\n\nasync function waitForBuiltInGenerationResult<T>(args: {\n readonly accepted: ZeroBuiltInGenerationAcceptedResponse;\n readonly baseUrl: string;\n readonly token: string;\n readonly fallback: string;\n}): Promise<T> {\n let notifier: BuiltInGenerationNotifier | null = null;\n let notifierCreated = false;\n const startedAt = Date.now();\n const timeoutMs =\n BUILT_IN_GENERATION_WAIT_TIMEOUT_MS_BY_TYPE[args.accepted.type];\n\n try {\n while (Date.now() - startedAt < timeoutMs) {\n const status = await getBuiltInGenerationStatus(\n args.baseUrl,\n args.token,\n args.accepted.generationId,\n );\n const result = readBuiltInGenerationResult<T>(status, args.fallback);\n if (result) {\n return result;\n }\n\n const elapsed = Date.now() - startedAt;\n const remaining = timeoutMs - elapsed;\n const waitMs = Math.min(BUILT_IN_GENERATION_POLL_INTERVAL_MS, remaining);\n if (!notifierCreated) {\n notifier = await createBuiltInGenerationNotifier(args.accepted);\n notifierCreated = true;\n }\n if (notifier) {\n await notifier.wait(waitMs);\n } else {\n await delay(waitMs);\n }\n }\n } finally {\n notifier?.close();\n }\n\n throw new ApiRequestError(\n `${args.fallback} timed out (generationId: ${args.accepted.generationId})`,\n \"GENERATION_TIMEOUT\",\n 504,\n );\n}\n\nasync function readBuiltInGenerationResponse<T>(args: {\n readonly response: Response;\n readonly baseUrl: string;\n readonly token: string;\n readonly fallback: string;\n}): Promise<T> {\n const body: unknown = await args.response.json();\n if (isBuiltInGenerationAcceptedResponse(body)) {\n return waitForBuiltInGenerationResult<T>({\n accepted: body,\n baseUrl: args.baseUrl,\n token: args.token,\n fallback: args.fallback,\n });\n }\n if (args.response.status === 202) {\n throw new ApiRequestError(\n `${args.fallback} returned an invalid generation response`,\n \"INVALID_GENERATION_RESPONSE\",\n 502,\n );\n }\n return body as T;\n}\n\n/**\n * Upload a local file and receive back metadata including a public CDN URL.\n * Authenticates via ZERO_TOKEN (`file:write` capability) or a CLI\n * PAT / Clerk session.\n *\n * Three-step flow:\n * 1. POST /api/zero/uploads/prepare — server signs a PUT URL for R2\n * 2. PUT the file bytes directly to R2\n * 3. POST /api/zero/uploads/complete — server verifies the object and\n * records any run-scoped upload association\n *\n * Step 2 never touches the Next.js runtime, which lifts the cap from\n * Vercel's ~4.5 MB body limit up to R2's 5 GB single-PUT limit.\n */\nexport async function uploadWebFile(\n localPath: string,\n options?: { contentType?: string },\n): Promise<UploadWebFileResult> {\n const stats = statSync(localPath);\n if (!stats.isFile()) {\n throw new ApiRequestError(\n `Not a regular file: ${localPath}`,\n \"BAD_REQUEST\",\n 400,\n );\n }\n\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const filename = basename(localPath);\n const contentType =\n options?.contentType ?? inferWebUploadContentType(localPath);\n\n const prepareHeaders: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n\n const prepareUrl = new URL(\"/api/zero/uploads/prepare\", baseUrl);\n const prepareRes = await fetch(prepareUrl, {\n method: \"POST\",\n headers: headersWithCliClientHeaders(prepareHeaders),\n body: JSON.stringify({ filename, contentType, size: stats.size }),\n });\n\n if (!prepareRes.ok) {\n const { message, code } = await parseErrorBody(\n prepareRes,\n \"Failed to prepare upload\",\n );\n throw new ApiRequestError(message, code, prepareRes.status);\n }\n\n const prepared = (await prepareRes.json()) as PrepareUploadResponse;\n\n const bytes = readFileSync(localPath);\n const putRes = await fetch(prepared.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": prepared.contentType },\n body: new Uint8Array(bytes),\n });\n\n if (!putRes.ok) {\n throw new ApiRequestError(\n `Failed to upload file to storage (HTTP ${putRes.status})`,\n \"UPLOAD_FAILED\",\n putRes.status,\n );\n }\n\n const completeUrl = new URL(\"/api/zero/uploads/complete\", baseUrl);\n const completeRes = await fetch(completeUrl, {\n method: \"POST\",\n headers: headersWithCliClientHeaders(prepareHeaders),\n body: JSON.stringify({\n id: prepared.id,\n contentType: prepared.contentType,\n }),\n });\n\n if (!completeRes.ok) {\n const { message, code } = await parseErrorBody(\n completeRes,\n \"Failed to complete upload\",\n );\n throw new ApiRequestError(message, code, completeRes.status);\n }\n\n const completed = (await completeRes.json()) as CompleteUploadResponse;\n\n return {\n id: completed.id,\n filename: completed.filename,\n contentType: completed.contentType,\n size: completed.size,\n url: completed.url,\n };\n}\n\n/**\n * Generate billed speech audio from text and receive the public CDN URL.\n * Authenticates via ZERO_TOKEN (`file:write` capability) or a CLI PAT /\n * Clerk session.\n */\nexport async function generateWebVoice(\n options: GenerateWebVoiceOptions,\n): Promise<GenerateWebVoiceResult> {\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n\n const response = await fetch(new URL(\"/api/zero/voice-io/speech\", baseUrl), {\n method: \"POST\",\n headers: headersWithCliClientHeaders(headers),\n body: JSON.stringify({\n text: options.text,\n ...(options.voice ? { voice: options.voice } : {}),\n ...(options.instructions ? { instructions: options.instructions } : {}),\n }),\n });\n\n if (!response.ok) {\n const { message, code } = await parseErrorBody(\n response,\n \"Failed to generate voice\",\n );\n throw new ApiRequestError(message, code, response.status);\n }\n\n return (await response.json()) as GenerateWebVoiceResult;\n}\n\n/**\n * Generate a billed image from a prompt and receive the public CDN URL.\n * Authenticates via ZERO_TOKEN (`file:write` capability) or a CLI PAT /\n * Clerk session.\n */\nexport async function generateWebImage(\n options: GenerateWebImageOptions,\n): Promise<GenerateWebImageResult> {\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n\n const response = await fetch(\n new URL(\"/api/zero/image-io/generate\", baseUrl),\n {\n method: \"POST\",\n headers: headersWithCliClientHeaders(headers),\n body: JSON.stringify({\n prompt: options.prompt,\n ...(options.model ? { model: options.model } : {}),\n ...(options.size ? { size: options.size } : {}),\n ...(options.quality ? { quality: options.quality } : {}),\n ...(options.background ? { background: options.background } : {}),\n ...(options.outputFormat ? { outputFormat: options.outputFormat } : {}),\n ...(options.outputCompression !== undefined\n ? { outputCompression: options.outputCompression }\n : {}),\n ...(options.moderation ? { moderation: options.moderation } : {}),\n ...(options.seed !== undefined ? { seed: options.seed } : {}),\n ...(options.safetyTolerance\n ? { safetyTolerance: options.safetyTolerance }\n : {}),\n ...(options.enhancePrompt !== undefined\n ? { enhancePrompt: options.enhancePrompt }\n : {}),\n ...(options.imageUrls && options.imageUrls.length > 0\n ? { imageUrls: options.imageUrls }\n : {}),\n ...(options.maskImageUrl ? { maskImageUrl: options.maskImageUrl } : {}),\n ...(options.inputFidelity\n ? { inputFidelity: options.inputFidelity }\n : {}),\n ...(options.imagePromptStrength !== undefined\n ? { imagePromptStrength: options.imagePromptStrength }\n : {}),\n }),\n },\n );\n\n if (!response.ok) {\n const { message, code } = await parseErrorBody(\n response,\n \"Failed to generate image\",\n );\n throw new ApiRequestError(message, code, response.status);\n }\n\n return readBuiltInGenerationResponse<GenerateWebImageResult>({\n response,\n baseUrl,\n token,\n fallback: \"Failed to generate image\",\n });\n}\n\n/**\n * Generate a billed video from a prompt and receive the public CDN URL.\n * Authenticates via ZERO_TOKEN (`file:write` capability) or a CLI PAT /\n * Clerk session.\n */\nexport async function generateWebVideo(\n options: GenerateWebVideoOptions,\n): Promise<GenerateWebVideoResult> {\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n \"Content-Type\": \"application/json\",\n };\n\n const response = await fetch(\n new URL(\"/api/zero/video-io/generate\", baseUrl),\n {\n method: \"POST\",\n headers: headersWithCliClientHeaders(headers),\n body: JSON.stringify(generateWebVideoPayload(options)),\n },\n );\n\n if (!response.ok) {\n const { message, code } = await parseErrorBody(\n response,\n \"Failed to generate video\",\n );\n throw new ApiRequestError(message, code, response.status);\n }\n\n return readBuiltInGenerationResponse<GenerateWebVideoResult>({\n response,\n baseUrl,\n token,\n fallback: \"Failed to generate video\",\n });\n}\n\nexport interface TranscribeAudioSegment {\n readonly start: number;\n readonly end: number;\n readonly text: string;\n}\n\ninterface TranscribeAudioResult {\n readonly text: string;\n readonly segments?: readonly TranscribeAudioSegment[];\n}\n\nexport async function transcribeAudio(\n audioPath: string,\n options: { readonly verbose?: boolean } = {},\n): Promise<TranscribeAudioResult> {\n const baseUrl = await getBaseUrl();\n const token = await getActiveToken();\n if (!token) {\n throw new ApiRequestError(\"Not authenticated\", \"UNAUTHORIZED\", 401);\n }\n\n const headers: Record<string, string> = {\n Authorization: `Bearer ${token}`,\n };\n\n const url = new URL(\"/api/zero/voice-io/stt\", baseUrl);\n if (options.verbose) {\n url.searchParams.set(\"verbose\", \"true\");\n }\n\n const audioData = readFileSync(audioPath);\n const filename = basename(audioPath);\n const ext = extname(filename).toLowerCase();\n const mimeMap: Record<string, string> = {\n \".mp3\": \"audio/mpeg\",\n \".mp4\": \"audio/mp4\",\n \".m4a\": \"audio/m4a\",\n \".wav\": \"audio/wav\",\n \".webm\": \"audio/webm\",\n };\n const mimeType = mimeMap[ext] ?? \"audio/mpeg\";\n\n const formData = new FormData();\n formData.append(\"file\", new Blob([audioData], { type: mimeType }), filename);\n\n const response = await fetch(url, {\n method: \"POST\",\n headers: headersWithCliClientHeaders(headers),\n body: formData,\n });\n\n if (!response.ok) {\n const { message, code } = await parseErrorBody(\n response,\n \"Transcription failed\",\n );\n throw new ApiRequestError(message, code, response.status);\n }\n\n return (await response.json()) as TranscribeAudioResult;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA,SAAS,mBAAmB,cAAc,gBAAgB;AAC1D,SAAS,UAAU,eAAe;AAClC,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,cAAc,aAAa;AACpC,SAAS,gBAAuD;AAShE,IAAM,uCAAuC;AAC7C,IAAM,8CAA8C;AAAA,EAClD,OAAO,KAAK,KAAK;AAAA,EACjB,OAAO,KAAK,KAAK;AAAA,EACjB,cAAc,KAAK,KAAK;AAAA,EACxB,SAAS,KAAK,KAAK;AACrB;AAIA,IAAM,0BAA0B;AAOhC,IAAM,oBAA4C;AAAA,EAChD,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAA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OAAO;AACV,UAAM,IAAI,gBAAgB,qBAAqB,gBAAgB,GAAG;AAAA,EACpE;AAEA,QAAM,UAAkC;AAAA,IACtC,eAAe,UAAU,KAAK;AAAA,EAChC;AAEA,QAAM,MAAM,IAAI,IAAI,0BAA0B,OAAO;AACrD,MAAI,QAAQ,SAAS;AACnB,QAAI,aAAa,IAAI,WAAW,MAAM;AAAA,EACxC;AAEA,QAAM,YAAY,aAAa,SAAS;AACxC,QAAM,WAAW,SAAS,SAAS;AACnC,QAAM,MAAM,QAAQ,QAAQ,EAAE,YAAY;AAC1C,QAAM,UAAkC;AAAA,IACtC,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACA,QAAM,WAAW,QAAQ,GAAG,KAAK;AAEjC,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,IAAI,KAAK,CAAC,SAAS,GAAG,EAAE,MAAM,SAAS,CAAC,GAAG,QAAQ;AAE3E,QAAM,WAAW,MAAM,MAAM,KAAK;AAAA,IAChC,QAAQ;AAAA,IACR,SAAS,4BAA4B,OAAO;AAAA,IAC5C,MAAM;AAAA,EACR,CAAC;AAED,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,EAAE,SAAS,KAAK,IAAI,MAAM;AAAA,MAC9B;AAAA,MACA;AAAA,IACF;AACA,UAAM,IAAI,gBAAgB,SAAS,MAAM,SAAS,MAAM;AAAA,EAC1D;AAEA,SAAQ,MAAM,SAAS,KAAK;AAC9B;","names":[]}
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
getApiUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AXPECIRA.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
toPlatformUrl,
|
|
43
43
|
getPlatformOrigin
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-NAXSTGVS.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
MODEL_PROVIDER_TYPES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AXPECIRA.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
formatModelProviderRoute,
|
|
41
41
|
formatModelPolicyStatus
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-OMZ7JNGC.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
runnerGroupSchema,
|
|
18
18
|
searchZeroLogs,
|
|
19
19
|
zeroAgentVisibilitySchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
21
21
|
import {
|
|
22
22
|
apiErrorSchema,
|
|
23
23
|
external_exports,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
upsertModelProviderRequestSchema,
|
|
32
32
|
upsertModelProviderResponseSchema,
|
|
33
33
|
withErrorHandler
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AXPECIRA.js";
|
|
35
35
|
import {
|
|
36
36
|
Command
|
|
37
37
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -33399,4 +33399,4 @@ export {
|
|
|
33399
33399
|
runLogsSearch,
|
|
33400
33400
|
searchCommand
|
|
33401
33401
|
};
|
|
33402
|
-
//# sourceMappingURL=chunk-
|
|
33402
|
+
//# sourceMappingURL=chunk-RKOGVYZD.js.map
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
getZeroAgent,
|
|
6
6
|
getZeroAgentUserConnectors
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
8
8
|
import {
|
|
9
9
|
init_esm_shims
|
|
10
10
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -347,4 +347,4 @@ export {
|
|
|
347
347
|
resolveManualGrantAuthMethod,
|
|
348
348
|
resolveAgentContext
|
|
349
349
|
};
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
350
|
+
//# sourceMappingURL=chunk-RLKJ2XNZ.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
UNKNOWN_PERMISSION_GRANT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
9
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -130,4 +130,4 @@ export {
|
|
|
130
130
|
resolveFirewallMetadataPolicies,
|
|
131
131
|
permissionGrantsToFirewallPolicies
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-TP7AVH5K.js.map
|
|
@@ -445,8 +445,7 @@ var FEATURE_SWITCHES = {
|
|
|
445
445
|
["planUpgradeGuidance" /* PlanUpgradeGuidance */]: {
|
|
446
446
|
maintainer: "ethan@vm0.ai",
|
|
447
447
|
description: "Show plan-upgrade guidance in Zero CLI help and render billing plan links as rich chat cards.",
|
|
448
|
-
enabled:
|
|
449
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES,
|
|
448
|
+
enabled: true,
|
|
450
449
|
userOverridable: false
|
|
451
450
|
},
|
|
452
451
|
["orgPlanEntitlementReads" /* OrgPlanEntitlementReads */]: {
|
|
@@ -530,4 +529,4 @@ export {
|
|
|
530
529
|
isFeatureEnabled,
|
|
531
530
|
decodeZeroTokenPayload
|
|
532
531
|
};
|
|
533
|
-
//# sourceMappingURL=chunk-
|
|
532
|
+
//# sourceMappingURL=chunk-X5FAOKYK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/connectors/src/feature-switch-key.ts","../../../packages/core/src/feature-switch.ts","../../../packages/core/src/feature-switch-key.ts","../../../packages/core/src/identity-hash.ts","../src/lib/api/zero-token.ts"],"sourcesContent":["/**\n * Feature switch keys\n *\n * Defines all available feature switch identifiers.\n */\nexport enum FeatureSwitchKey {\n Dummy = \"dummy\",\n ExternalConnectorCatalog = \"externalConnectorCatalog\",\n AhrefsConnector = \"ahrefsConnector\",\n BillConnector = \"billConnector\",\n BentomlConnector = \"bentomlConnector\",\n BoxConnector = \"boxConnector\",\n CanvaConnector = \"canvaConnector\",\n CalComConnector = \"calComConnector\",\n CopperConnector = \"copperConnector\",\n DatadogConnector = \"datadogConnector\",\n DeelConnector = \"deelConnector\",\n DocuSignConnector = \"docusignConnector\",\n DropboxConnector = \"dropboxConnector\",\n FigmaConnector = \"figmaConnector\",\n ExpensifyConnector = \"expensifyConnector\",\n GoogleContactsConnector = \"googleContactsConnector\",\n GoogleFormsConnector = \"googleFormsConnector\",\n MercuryConnector = \"mercuryConnector\",\n NeonConnector = \"neonConnector\",\n NetSuiteConnector = \"netSuiteConnector\",\n GarminConnectConnector = \"garminConnectConnector\",\n QuickBooksConnector = \"quickbooksConnector\",\n RedditConnector = \"redditConnector\",\n SupabaseConnector = \"supabaseConnector\",\n WebflowConnector = \"webflowConnector\",\n CloseConnector = \"closeConnector\",\n MetaAdsConnector = \"metaAdsConnector\",\n TikTokAdsConnector = \"tiktokAdsConnector\",\n AwsConnector = \"awsConnector\",\n PosthogConnector = \"posthogConnector\",\n PayPalConnector = \"payPalConnector\",\n RampConnector = \"rampConnector\",\n MailchimpConnector = \"mailchimpConnector\",\n ResendConnector = \"resendConnector\",\n PexelsConnector = \"pexelsConnector\",\n SpotifyConnector = \"spotifyConnector\",\n ZeroDebug = \"zeroDebug\",\n CanonicalSlackIngress = \"canonicalSlackIngress\",\n CanonicalSlackWebVisibility = \"canonicalSlackWebVisibility\",\n CanonicalSlackAssets = \"canonicalSlackAssets\",\n ZeroWeather = \"zeroWeather\",\n ZeroFinance = \"zeroFinance\",\n ZeroPeopleSearch = \"zeroPeopleSearch\",\n ZeroBrowser = \"zeroBrowser\",\n Banking = \"banking\",\n Lab = \"lab\",\n NotionWorkflowAutomations = \"notionWorkflowAutomations\",\n GithubWebhookAutomations = \"githubWebhookAutomations\",\n GithubWorkflowRunAutomations = \"githubWorkflowRunAutomations\",\n MorningBrief = \"morningBrief\",\n ManualMorningBrief = \"manualMorningBrief\",\n TestOauthConnector = \"testOauthConnector\",\n FreshdeskConnector = \"freshdeskConnector\",\n StabilityAiConnector = \"stabilityAiConnector\",\n ZoomConnector = \"zoomConnector\",\n WorkdayConnector = \"workdayConnector\",\n CodexFastMode = \"codexFastMode\",\n RealAgentInPreview = \"realAgentInPreview\",\n ComposerUploadPopover = \"composerUploadPopover\",\n StructuredPrompt = \"structuredPrompt\",\n\n ZapierConnector = \"zapierConnector\",\n HtmlArtifactCommentEditing = \"htmlArtifactCommentEditing\",\n ComputerUseDesktopPlugins = \"computerUseDesktopPlugins\",\n AgentUnreadIndicators = \"agentUnreadIndicators\",\n ChatThreadUnifiedSearch = \"chatThreadUnifiedSearch\",\n ComposerChatThreadSuggestions = \"composerChatThreadSuggestions\",\n SidebarSubscriptionUsage = \"sidebarSubscriptionUsage\",\n TeamsIntegration = \"teamsIntegration\",\n FeishuIntegration = \"feishuIntegration\",\n PresentationExport = \"presentationExport\",\n Artifacts = \"artifacts\",\n HostedArtifactVersions = \"hostedArtifactVersions\",\n VideoArtifactPosters = \"videoArtifactPosters\",\n WebsiteTemplateV2 = \"websiteTemplateV2\",\n PlanUpgradeGuidance = \"planUpgradeGuidance\",\n OrgPlanEntitlementReads = \"orgPlanEntitlementReads\",\n WorkflowConnectorReadiness = \"workflowConnectorReadiness\",\n ZeroMail = \"zeroMail\",\n ComposerConnectorPermissions = \"composerConnectorPermissions\",\n ThreeColumnNav = \"threeColumnNav\",\n ChatHistoryBackfillProgress = \"chatHistoryBackfillProgress\",\n}\n","/**\n * Feature switch system\n *\n * Provides centralized feature flag management with user-identity based overrides.\n * User IDs are stored as FNV-1a hashes to avoid exposing plain-text identifiers in source code.\n *\n * NOT AN AUTHORIZATION BOUNDARY. User-overridable switches can be self-enabled\n * through `POST /api/zero/feature-switches`, and `userOverridable: false` only\n * excludes a switch from that API. For money-granting, credential, or\n * privilege-escalation endpoints, gate with a hard identity check (e.g.\n * `isStaffOrg()` from `./staff-org`) instead of this system.\n */\n\nimport { FeatureSwitchKey } from \"./feature-switch-key\";\nimport { STAFF_ORG_ID_HASHES, fnv1a } from \"./identity-hash\";\n\nexport interface FeatureSwitch {\n readonly maintainer: string;\n readonly description?: string;\n readonly enabled: boolean;\n readonly enabledUserHashes?: readonly string[];\n readonly enabledEmailHashes?: readonly string[];\n readonly enabledOrgIdHashes?: readonly string[];\n readonly userOverridable?: boolean;\n}\n\nexport interface FeatureSwitchMetadata {\n readonly maintainer: string;\n readonly description?: string;\n readonly userOverridable: boolean;\n}\n\nexport interface FeatureSwitchContext {\n readonly userId?: string;\n readonly email?: string;\n readonly orgId?: string;\n readonly overrides?: Partial<Record<FeatureSwitchKey, boolean>>;\n}\n\n/**\n * Registry of all feature switches\n */\nconst FEATURE_SWITCHES: Record<FeatureSwitchKey, FeatureSwitch> = {\n [FeatureSwitchKey.Dummy]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Test-only feature switch for flag system validation\",\n enabled: true,\n },\n [FeatureSwitchKey.ExternalConnectorCatalog]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Use the accepted external catalog as the global source for official connectors\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.AhrefsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ahrefs SEO connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BillConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BILL Spend & Expense connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BentomlConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BentoML model serving connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BoxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Box file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CanvaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Canva design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CalComConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Cal.com scheduling connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CopperConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Copper CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DatadogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Datadog observability connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DeelConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Deel HR connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DocuSignConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the DocuSign e-signature connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DropboxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Dropbox file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.FigmaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Figma design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ExpensifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Expensify accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleContactsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Contacts connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleFormsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Forms connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MercuryConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mercury banking connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NeonConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Neon serverless Postgres connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NetSuiteConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Oracle NetSuite ERP connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GarminConnectConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Garmin Connect wellness connector\",\n enabled: false,\n },\n [FeatureSwitchKey.QuickBooksConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the QuickBooks accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RedditConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Reddit connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.SupabaseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Supabase database connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.CloseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Close CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.WebflowConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Webflow site management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MetaAdsConnector]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Enable the Meta Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.TikTokAdsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the TikTok Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.AwsConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description: \"Enable the temporary AWS remote login connector\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PosthogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PostHog analytics connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PayPalConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PayPal payments connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RampConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ramp spend management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MailchimpConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mailchimp email marketing connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ResendConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Resend email service connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PexelsConnector]: {\n maintainer: \"bingjie@vm0.ai\",\n description: \"Enable the Pexels stock photo and video connector\",\n enabled: false,\n },\n [FeatureSwitchKey.SpotifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Spotify connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.ZeroDebug]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Reveal activity debug surfaces, activity log navigation, appended system prompts, and Debug preferences\",\n enabled: false,\n },\n [FeatureSwitchKey.CanonicalSlackIngress]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Route newly admitted per-user Slack threads through canonical chat ingress.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackWebVisibility]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show canonical Slack chat threads in Web chat surfaces for enrolled users.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackAssets]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Canonicalize direct Slack inputs and run-scoped Slack file publications.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroWeather]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed Google-backed Zero Weather and Air Quality APIs and weather:read ZERO_TOKEN capability.\",\n enabled: true,\n },\n [FeatureSwitchKey.ZeroFinance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed APIDojo-backed Zero Finance API and finance:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroPeopleSearch]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable managed Perplexity People Search and the people-search:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Banking]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Enable the managed Zero Banking gateway and banking:read ZERO_TOKEN capability for Finicity-backed accounts, balances, and transactions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Lab]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Show the Lab page for toggling experimental features\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.MorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the daily 7:00 local-time Morning Brief email built from GitHub, Gmail, and Google Calendar.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.ManualMorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show a Send now button in Settings that triggers a Morning Brief immediately for testing.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.NotionWorkflowAutomations]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Notion event workflow automations, starting with child pages created under a configured parent page.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.GithubWorkflowRunAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable GitHub Actions workflow run completed event automations.\",\n enabled: true,\n },\n [FeatureSwitchKey.GithubWebhookAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show creation entry points for GitHub workflow job, pull request review, deployment status, and issue comment automations.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.TestOauthConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable the test-oauth connector, a synthetic OAuth 2.0 provider used only for automated tests. Off in prod.\",\n enabled: false,\n },\n [FeatureSwitchKey.FreshdeskConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Freshdesk helpdesk connector\",\n enabled: false,\n },\n [FeatureSwitchKey.StabilityAiConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Stability AI image generation connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ZoomConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zoom connector (OAuth 2.0) for meetings, past participants, and cloud recordings access\",\n enabled: false,\n },\n [FeatureSwitchKey.WorkdayConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Workday HCM and finance connector\",\n enabled: false,\n },\n\n [FeatureSwitchKey.CodexFastMode]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Codex fast mode for ChatGPT subscription GPT 5.5 and GPT 5.6 web chat runs.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.RealAgentInPreview]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Send preview chat runs through real agent CLIs instead of preview mock runners.\",\n enabled: false,\n },\n [FeatureSwitchKey.ComposerUploadPopover]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Use the Upload popover in the chat composer instead of the legacy paperclip attachment button.\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.StructuredPrompt]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable structured user prompt rendering, sends, and drafts while preserving the legacy content fallback.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZapierConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zapier connector. When disabled, Zapier is hidden from the connectors list and cannot be connected.\",\n enabled: false,\n },\n [FeatureSwitchKey.HtmlArtifactCommentEditing]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable the HTML artifact comment-editing workflow for collecting DOM comments and preparing instrumented working-copy edits.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComputerUseDesktopPlugins]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Zero Desktop Computer Use plugins for local resources, starting with the bundled filesystem plugin gateway.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.AgentUnreadIndicators]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat unread indicators in sidebar pinned agent lists and the conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatThreadUnifiedSearch]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat thread title results from the local event-driven thread cache in the command-shift-a conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComposerChatThreadSuggestions]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Suggest titled chat threads from the current agent when typing @ in the chat composer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatHistoryBackfillProgress]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Progress bar under the chat thread header showing history backfill progress while older messages load.\",\n // Not rolled out to anyone yet; enable per-user via the Lab page.\n enabled: false,\n },\n [FeatureSwitchKey.ThreeColumnNav]: {\n maintainer: \"ming@vm0.ai\",\n description:\n \"Slack-style three-column navigation: a labeled icon rail, a pinned-agents and chat-threads list column, and the conversation pane.\",\n enabled: false,\n // Ming only for the first pass; widen to staff once it settles.\n enabledEmailHashes: [\"54757055\"], // fnv1a(\"ming@vm0.ai\")\n },\n [FeatureSwitchKey.SidebarSubscriptionUsage]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show Codex and Claude Code personal subscription usage in the Zero sidebar footer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.TeamsIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show standalone Microsoft Teams integration settings, connect flows, and Works page entry points.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.FeishuIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show the Feishu direct-message integration and Works page entry point.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PresentationExport]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable downloading presentation artifacts as PPTX files and uploading them as native, editable Google Slides decks.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Artifacts]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Show the Artifacts manage page for generated artifacts in the current organization.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.HostedArtifactVersions]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Create immutable hosted artifact versions behind stable site aliases.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.VideoArtifactPosters]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate poster images asynchronously when video artifacts are recorded.\",\n enabled: false,\n enabledUserHashes: [\"032a75d8\"],\n },\n [FeatureSwitchKey.WebsiteTemplateV2]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate websites from refreshed self-contained template packages. When off, website generation uses the existing package versions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PlanUpgradeGuidance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show plan-upgrade guidance in Zero CLI help and render billing plan links as rich chat cards.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.OrgPlanEntitlementReads]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Read runtime plan capability limits from org_plan_entitlements instead of deriving them from org_metadata.tier.\",\n enabled: true,\n userOverridable: false,\n },\n [FeatureSwitchKey.WorkflowConnectorReadiness]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show the manual connector readiness check on workflow settings pages.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.ZeroMail]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable persistent Gmail and Outlook draft cards created through the Zero Mail CLI.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroBrowser]: {\n maintainer: \"liangyou@vm0.ai\",\n description: \"Show the Zero Browser command in the Zero CLI.\",\n enabled: false,\n },\n [FeatureSwitchKey.ComposerConnectorPermissions]: {\n maintainer: \"ming@vm0.ai\",\n description:\n \"Show the configure-permissions entry in the chat composer connector popover, opening the agent×connector firewall dialog inline.\",\n enabled: false,\n userOverridable: true,\n },\n};\n\ninterface ResolvedHashes {\n readonly userHash?: string;\n readonly emailHash?: string;\n readonly orgIdHash?: string;\n}\n\nfunction evaluateSwitch(fs: FeatureSwitch, hashes: ResolvedHashes): boolean {\n if (fs.enabled) return true;\n if (hashes.userHash && fs.enabledUserHashes?.includes(hashes.userHash))\n return true;\n if (hashes.emailHash && fs.enabledEmailHashes?.includes(hashes.emailHash))\n return true;\n if (hashes.orgIdHash && fs.enabledOrgIdHashes?.includes(hashes.orgIdHash))\n return true;\n return false;\n}\n\n/**\n * Evaluate all feature switches at once for the given context.\n *\n * Computes identity hashes once and checks all switches synchronously.\n */\nexport function getAllFeatureStates(\n ctx?: FeatureSwitchContext,\n): Record<FeatureSwitchKey, boolean> {\n const switches = Object.values(FEATURE_SWITCHES);\n const hashes: ResolvedHashes = {\n userHash:\n ctx?.userId &&\n switches.some((s) => {\n return s.enabledUserHashes?.length;\n })\n ? fnv1a(ctx.userId)\n : undefined,\n emailHash:\n ctx?.email &&\n switches.some((s) => {\n return s.enabledEmailHashes?.length;\n })\n ? fnv1a(ctx.email.toLowerCase())\n : undefined,\n orgIdHash:\n ctx?.orgId &&\n switches.some((s) => {\n return s.enabledOrgIdHashes?.length;\n })\n ? fnv1a(ctx.orgId)\n : undefined,\n };\n\n const result = {} as Record<FeatureSwitchKey, boolean>;\n for (const key of Object.values(FeatureSwitchKey)) {\n result[key] = evaluateSwitch(FEATURE_SWITCHES[key], hashes);\n }\n\n if (ctx?.overrides) {\n for (const [key, value] of Object.entries(ctx.overrides)) {\n if (key in FEATURE_SWITCHES && value !== undefined) {\n result[key as FeatureSwitchKey] = value;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Return the description for every feature switch.\n */\nexport function getFeatureSwitchDescriptions(): Record<\n FeatureSwitchKey,\n string | undefined\n> {\n const result = {} as Record<FeatureSwitchKey, string | undefined>;\n for (const key of Object.values(FeatureSwitchKey)) {\n result[key] = FEATURE_SWITCHES[key].description;\n }\n return result;\n}\n\n/**\n * Return display metadata for every feature switch.\n */\nexport function getFeatureSwitchMetadata(): Record<\n FeatureSwitchKey,\n FeatureSwitchMetadata\n> {\n const result = {} as Record<FeatureSwitchKey, FeatureSwitchMetadata>;\n for (const key of Object.values(FeatureSwitchKey)) {\n const featureSwitch = FEATURE_SWITCHES[key];\n result[key] = {\n maintainer: featureSwitch.maintainer,\n description: featureSwitch.description,\n userOverridable: featureSwitch.userOverridable !== false,\n };\n }\n return result;\n}\n\nexport function isUserOverridableFeatureSwitch(\n key: string,\n): key is FeatureSwitchKey {\n if (!(key in FEATURE_SWITCHES)) {\n return false;\n }\n return FEATURE_SWITCHES[key as FeatureSwitchKey].userOverridable !== false;\n}\n\nexport function getUserOverridableFeatureSwitchKeys(): readonly FeatureSwitchKey[] {\n return Object.values(FeatureSwitchKey).filter(isUserOverridableFeatureSwitch);\n}\n\nexport function filterUserOverridableFeatureSwitchOverrides(\n switches: Record<string, boolean>,\n): Record<string, boolean> {\n const filtered: Record<string, boolean> = {};\n for (const [key, value] of Object.entries(switches)) {\n if (isUserOverridableFeatureSwitch(key)) {\n filtered[key] = value;\n }\n }\n return filtered;\n}\n\n/**\n * Check if a feature is enabled for the given context.\n *\n * `ctx` is required so callers must pass identity (userId/orgId/email) or an\n * explicit `{}`. A switch gated by `enabledUserHashes` / `enabledOrgIdHashes`\n * silently returns `false` when ctx omits identity, which has caused bugs.\n * Client-side callers should usually read the platform `featureSwitch$` signal\n * instead — it also merges DB overrides on top of identity context.\n */\nexport function isFeatureEnabled(\n key: FeatureSwitchKey,\n ctx: FeatureSwitchContext,\n): boolean {\n const override = ctx.overrides?.[key];\n if (override !== undefined) {\n return override;\n }\n\n const featureSwitch = FEATURE_SWITCHES[key];\n if (featureSwitch.enabled) {\n return true;\n }\n if (ctx.userId && featureSwitch.enabledUserHashes?.length) {\n if (featureSwitch.enabledUserHashes.includes(fnv1a(ctx.userId)))\n return true;\n }\n if (ctx.email && featureSwitch.enabledEmailHashes?.length) {\n if (\n featureSwitch.enabledEmailHashes.includes(fnv1a(ctx.email.toLowerCase()))\n )\n return true;\n }\n if (ctx.orgId && featureSwitch.enabledOrgIdHashes?.length) {\n if (featureSwitch.enabledOrgIdHashes.includes(fnv1a(ctx.orgId)))\n return true;\n }\n return false;\n}\n","export { FeatureSwitchKey } from \"@vm0/connectors/feature-switch-key\";\n","/**\n * Identity hashing — FNV-1a 32-bit hash used to reference users / orgs / emails\n * without embedding plain-text identifiers in source code.\n *\n * Shared between the feature-switch registry (UI rollout targeting) and\n * `staff-org.ts` (authorization primitive). The hash is deterministic and\n * synchronous; no crypto API needed.\n */\n\nexport function fnv1a(input: string): string {\n let h = 2166136261 >>> 0;\n for (let i = 0; i < input.length; i++) {\n h ^= input.charCodeAt(i);\n h = Math.imul(h, 16777619) >>> 0;\n }\n return h.toString(16).padStart(8, \"0\");\n}\n\n/**\n * Hashes of internal staff org IDs.\n *\n * This list is the source of truth for `isStaffOrg()` — adding an entry here\n * grants that org access to every endpoint that uses `isStaffOrg` as an\n * authorization check. Treat changes with the same care as role grants.\n */\nexport const STAFF_ORG_ID_HASHES: readonly string[] = [\n \"afce210e\", // org_3ANttyrbWYJk6JKRSTRLEsbsDLe\n];\n","import type { FeatureSwitchKey } from \"@vm0/connectors/feature-switch-key\";\n\nexport interface ZeroTokenPayload {\n userId: string;\n runId: string;\n orgId: string;\n scope: string;\n capabilities: string[];\n featureSwitchOverrides?: Partial<Record<FeatureSwitchKey, boolean>>;\n iat: number;\n exp: number;\n}\n\n/**\n * Decode a ZERO_TOKEN JWT payload.\n * Only decodes — does NOT verify signature (server does that).\n * If no token is provided, reads from process.env.ZERO_TOKEN.\n * Returns undefined if token is missing, malformed, or not a zero-scoped token.\n */\nexport function decodeZeroTokenPayload(\n token?: string,\n): ZeroTokenPayload | undefined {\n const raw = token ?? process.env.ZERO_TOKEN;\n if (!raw) return undefined;\n\n const prefix = \"vm0_sandbox_\";\n if (!raw.startsWith(prefix)) return undefined;\n const jwt = raw.slice(prefix.length);\n\n const parts = jwt.split(\".\");\n if (parts.length !== 3) return undefined;\n\n try {\n const payload = JSON.parse(\n Buffer.from(parts[1]!, \"base64url\").toString(),\n ) as ZeroTokenPayload;\n if (payload.scope === \"zero\" && Array.isArray(payload.capabilities)) {\n return payload;\n }\n } catch {\n // Malformed token — fall through\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;AAAA;;;ACAA;;;ACAA;;;ACAA;AASO,SAAS,MAAM,OAAuB;AAC3C,MAAI,IAAI,eAAe;AACvB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,SAAK,MAAM,WAAW,CAAC;AACvB,QAAI,KAAK,KAAK,GAAG,QAAQ,MAAM;AAAA,EACjC;AACA,SAAO,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AACvC;AASO,IAAM,sBAAyC;AAAA,EACpD;AAAA;AACF;;;AFeA,IAAM,mBAA4D;AAAA,EAChE,oBAAuB,GAAG;AAAA,IACxB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA,0DAA0C,GAAG;AAAA,IAC3C,YAAY;AAAA,IACZ,aACE;AAAA,IACF,SAAS;AAAA,IACT,iBAAiB;AAAA,EACnB;AAAA,EACA,wCAAiC,GAAG;AAAA,IAClC,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA,oCAA+B,GAAG;AAAA,IAChC,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA,0CAAkC,GAAG;AAAA,IACnC,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA,kCAA8B,GAAG;AAAA,IAC/B,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AAAA,EACA,sCAAgC,GAAG;AAAA,IACjC,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,SAAS;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ature-switch.ts","../../../packages/core/src/feature-switch-key.ts","../../../packages/core/src/identity-hash.ts","../src/lib/api/zero-token.ts"],"sourcesContent":["/**\n * Feature switch keys\n *\n * Defines all available feature switch identifiers.\n */\nexport enum FeatureSwitchKey {\n Dummy = \"dummy\",\n ExternalConnectorCatalog = \"externalConnectorCatalog\",\n AhrefsConnector = \"ahrefsConnector\",\n BillConnector = \"billConnector\",\n BentomlConnector = \"bentomlConnector\",\n BoxConnector = \"boxConnector\",\n CanvaConnector = \"canvaConnector\",\n CalComConnector = \"calComConnector\",\n CopperConnector = \"copperConnector\",\n DatadogConnector = \"datadogConnector\",\n DeelConnector = \"deelConnector\",\n DocuSignConnector = \"docusignConnector\",\n DropboxConnector = \"dropboxConnector\",\n FigmaConnector = \"figmaConnector\",\n ExpensifyConnector = \"expensifyConnector\",\n GoogleContactsConnector = \"googleContactsConnector\",\n GoogleFormsConnector = \"googleFormsConnector\",\n MercuryConnector = \"mercuryConnector\",\n NeonConnector = \"neonConnector\",\n NetSuiteConnector = \"netSuiteConnector\",\n GarminConnectConnector = \"garminConnectConnector\",\n QuickBooksConnector = \"quickbooksConnector\",\n RedditConnector = \"redditConnector\",\n SupabaseConnector = \"supabaseConnector\",\n WebflowConnector = \"webflowConnector\",\n CloseConnector = \"closeConnector\",\n MetaAdsConnector = \"metaAdsConnector\",\n TikTokAdsConnector = \"tiktokAdsConnector\",\n AwsConnector = \"awsConnector\",\n PosthogConnector = \"posthogConnector\",\n PayPalConnector = \"payPalConnector\",\n RampConnector = \"rampConnector\",\n MailchimpConnector = \"mailchimpConnector\",\n ResendConnector = \"resendConnector\",\n PexelsConnector = \"pexelsConnector\",\n SpotifyConnector = \"spotifyConnector\",\n ZeroDebug = \"zeroDebug\",\n CanonicalSlackIngress = \"canonicalSlackIngress\",\n CanonicalSlackWebVisibility = \"canonicalSlackWebVisibility\",\n CanonicalSlackAssets = \"canonicalSlackAssets\",\n ZeroWeather = \"zeroWeather\",\n ZeroFinance = \"zeroFinance\",\n ZeroPeopleSearch = \"zeroPeopleSearch\",\n ZeroBrowser = \"zeroBrowser\",\n Banking = \"banking\",\n Lab = \"lab\",\n NotionWorkflowAutomations = \"notionWorkflowAutomations\",\n GithubWebhookAutomations = \"githubWebhookAutomations\",\n GithubWorkflowRunAutomations = \"githubWorkflowRunAutomations\",\n MorningBrief = \"morningBrief\",\n ManualMorningBrief = \"manualMorningBrief\",\n TestOauthConnector = \"testOauthConnector\",\n FreshdeskConnector = \"freshdeskConnector\",\n StabilityAiConnector = \"stabilityAiConnector\",\n ZoomConnector = \"zoomConnector\",\n WorkdayConnector = \"workdayConnector\",\n CodexFastMode = \"codexFastMode\",\n RealAgentInPreview = \"realAgentInPreview\",\n ComposerUploadPopover = \"composerUploadPopover\",\n StructuredPrompt = \"structuredPrompt\",\n\n ZapierConnector = \"zapierConnector\",\n HtmlArtifactCommentEditing = \"htmlArtifactCommentEditing\",\n ComputerUseDesktopPlugins = \"computerUseDesktopPlugins\",\n AgentUnreadIndicators = \"agentUnreadIndicators\",\n ChatThreadUnifiedSearch = \"chatThreadUnifiedSearch\",\n ComposerChatThreadSuggestions = \"composerChatThreadSuggestions\",\n SidebarSubscriptionUsage = \"sidebarSubscriptionUsage\",\n TeamsIntegration = \"teamsIntegration\",\n FeishuIntegration = \"feishuIntegration\",\n PresentationExport = \"presentationExport\",\n Artifacts = \"artifacts\",\n HostedArtifactVersions = \"hostedArtifactVersions\",\n VideoArtifactPosters = \"videoArtifactPosters\",\n WebsiteTemplateV2 = \"websiteTemplateV2\",\n PlanUpgradeGuidance = \"planUpgradeGuidance\",\n OrgPlanEntitlementReads = \"orgPlanEntitlementReads\",\n WorkflowConnectorReadiness = \"workflowConnectorReadiness\",\n ZeroMail = \"zeroMail\",\n ComposerConnectorPermissions = \"composerConnectorPermissions\",\n ThreeColumnNav = \"threeColumnNav\",\n ChatHistoryBackfillProgress = \"chatHistoryBackfillProgress\",\n}\n","/**\n * Feature switch system\n *\n * Provides centralized feature flag management with user-identity based overrides.\n * User IDs are stored as FNV-1a hashes to avoid exposing plain-text identifiers in source code.\n *\n * NOT AN AUTHORIZATION BOUNDARY. User-overridable switches can be self-enabled\n * through `POST /api/zero/feature-switches`, and `userOverridable: false` only\n * excludes a switch from that API. For money-granting, credential, or\n * privilege-escalation endpoints, gate with a hard identity check (e.g.\n * `isStaffOrg()` from `./staff-org`) instead of this system.\n */\n\nimport { FeatureSwitchKey } from \"./feature-switch-key\";\nimport { STAFF_ORG_ID_HASHES, fnv1a } from \"./identity-hash\";\n\nexport interface FeatureSwitch {\n readonly maintainer: string;\n readonly description?: string;\n readonly enabled: boolean;\n readonly enabledUserHashes?: readonly string[];\n readonly enabledEmailHashes?: readonly string[];\n readonly enabledOrgIdHashes?: readonly string[];\n readonly userOverridable?: boolean;\n}\n\nexport interface FeatureSwitchMetadata {\n readonly maintainer: string;\n readonly description?: string;\n readonly userOverridable: boolean;\n}\n\nexport interface FeatureSwitchContext {\n readonly userId?: string;\n readonly email?: string;\n readonly orgId?: string;\n readonly overrides?: Partial<Record<FeatureSwitchKey, boolean>>;\n}\n\n/**\n * Registry of all feature switches\n */\nconst FEATURE_SWITCHES: Record<FeatureSwitchKey, FeatureSwitch> = {\n [FeatureSwitchKey.Dummy]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Test-only feature switch for flag system validation\",\n enabled: true,\n },\n [FeatureSwitchKey.ExternalConnectorCatalog]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Use the accepted external catalog as the global source for official connectors\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.AhrefsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ahrefs SEO connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BillConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BILL Spend & Expense connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BentomlConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BentoML model serving connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BoxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Box file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CanvaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Canva design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CalComConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Cal.com scheduling connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CopperConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Copper CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DatadogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Datadog observability connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DeelConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Deel HR connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DocuSignConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the DocuSign e-signature connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DropboxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Dropbox file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.FigmaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Figma design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ExpensifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Expensify accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleContactsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Contacts connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleFormsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Forms connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MercuryConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mercury banking connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NeonConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Neon serverless Postgres connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NetSuiteConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Oracle NetSuite ERP connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GarminConnectConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Garmin Connect wellness connector\",\n enabled: false,\n },\n [FeatureSwitchKey.QuickBooksConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the QuickBooks accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RedditConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Reddit connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.SupabaseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Supabase database connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.CloseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Close CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.WebflowConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Webflow site management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MetaAdsConnector]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Enable the Meta Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.TikTokAdsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the TikTok Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.AwsConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description: \"Enable the temporary AWS remote login connector\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PosthogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PostHog analytics connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PayPalConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PayPal payments connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RampConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ramp spend management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MailchimpConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mailchimp email marketing connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ResendConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Resend email service connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PexelsConnector]: {\n maintainer: \"bingjie@vm0.ai\",\n description: \"Enable the Pexels stock photo and video connector\",\n enabled: false,\n },\n [FeatureSwitchKey.SpotifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Spotify connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.ZeroDebug]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Reveal activity debug surfaces, activity log navigation, appended system prompts, and Debug preferences\",\n enabled: false,\n },\n [FeatureSwitchKey.CanonicalSlackIngress]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Route newly admitted per-user Slack threads through canonical chat ingress.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackWebVisibility]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show canonical Slack chat threads in Web chat surfaces for enrolled users.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackAssets]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Canonicalize direct Slack inputs and run-scoped Slack file publications.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroWeather]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed Google-backed Zero Weather and Air Quality APIs and weather:read ZERO_TOKEN capability.\",\n enabled: true,\n },\n [FeatureSwitchKey.ZeroFinance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed APIDojo-backed Zero Finance API and finance:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroPeopleSearch]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable managed Perplexity People Search and the people-search:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Banking]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Enable the managed Zero Banking gateway and banking:read ZERO_TOKEN capability for Finicity-backed accounts, balances, and transactions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Lab]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Show the Lab page for toggling experimental features\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.MorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the daily 7:00 local-time Morning Brief email built from GitHub, Gmail, and Google Calendar.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.ManualMorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show a Send now button in Settings that triggers a Morning Brief immediately for testing.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.NotionWorkflowAutomations]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Notion event workflow automations, starting with child pages created under a configured parent page.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.GithubWorkflowRunAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable GitHub Actions workflow run completed event automations.\",\n enabled: true,\n },\n [FeatureSwitchKey.GithubWebhookAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show creation entry points for GitHub workflow job, pull request review, deployment status, and issue comment automations.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.TestOauthConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable the test-oauth connector, a synthetic OAuth 2.0 provider used only for automated tests. Off in prod.\",\n enabled: false,\n },\n [FeatureSwitchKey.FreshdeskConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Freshdesk helpdesk connector\",\n enabled: false,\n },\n [FeatureSwitchKey.StabilityAiConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Stability AI image generation connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ZoomConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zoom connector (OAuth 2.0) for meetings, past participants, and cloud recordings access\",\n enabled: false,\n },\n [FeatureSwitchKey.WorkdayConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Workday HCM and finance connector\",\n enabled: false,\n },\n\n [FeatureSwitchKey.CodexFastMode]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Codex fast mode for ChatGPT subscription GPT 5.5 and GPT 5.6 web chat runs.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.RealAgentInPreview]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Send preview chat runs through real agent CLIs instead of preview mock runners.\",\n enabled: false,\n },\n [FeatureSwitchKey.ComposerUploadPopover]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Use the Upload popover in the chat composer instead of the legacy paperclip attachment button.\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.StructuredPrompt]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable structured user prompt rendering, sends, and drafts while preserving the legacy content fallback.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZapierConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zapier connector. When disabled, Zapier is hidden from the connectors list and cannot be connected.\",\n enabled: false,\n },\n [FeatureSwitchKey.HtmlArtifactCommentEditing]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable the HTML artifact comment-editing workflow for collecting DOM comments and preparing instrumented working-copy edits.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComputerUseDesktopPlugins]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Zero Desktop Computer Use plugins for local resources, starting with the bundled filesystem plugin gateway.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.AgentUnreadIndicators]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat unread indicators in sidebar pinned agent lists and the conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatThreadUnifiedSearch]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat thread title results from the local event-driven thread cache in the command-shift-a conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComposerChatThreadSuggestions]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Suggest titled chat threads from the current agent when typing @ in the chat composer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatHistoryBackfillProgress]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Progress bar under the chat thread header showing history backfill progress while older messages load.\",\n // Not rolled out to anyone yet; enable per-user via the Lab page.\n enabled: false,\n },\n [FeatureSwitchKey.ThreeColumnNav]: {\n maintainer: \"ming@vm0.ai\",\n description:\n \"Slack-style three-column navigation: a labeled icon rail, a pinned-agents and chat-threads list column, and the conversation pane.\",\n enabled: false,\n // Ming only for the first pass; widen to staff once it settles.\n enabledEmailHashes: [\"54757055\"], // fnv1a(\"ming@vm0.ai\")\n },\n [FeatureSwitchKey.SidebarSubscriptionUsage]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show Codex and Claude Code personal subscription usage in the Zero sidebar footer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.TeamsIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show standalone Microsoft Teams integration settings, connect flows, and Works page entry points.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.FeishuIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show the Feishu direct-message integration and Works page entry point.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PresentationExport]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable downloading presentation artifacts as PPTX files and uploading them as native, editable Google Slides decks.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Artifacts]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Show the Artifacts manage page for generated artifacts in the current organization.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.HostedArtifactVersions]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Create immutable hosted artifact versions behind stable site aliases.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.VideoArtifactPosters]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate poster images asynchronously when video artifacts are recorded.\",\n enabled: false,\n enabledUserHashes: [\"032a75d8\"],\n },\n [FeatureSwitchKey.WebsiteTemplateV2]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate websites from refreshed self-contained template packages. When off, website generation uses the existing package versions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PlanUpgradeGuidance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show plan-upgrade guidance in Zero CLI help and render billing plan links as rich chat cards.\",\n enabled: true,\n userOverridable: false,\n },\n [FeatureSwitchKey.OrgPlanEntitlementReads]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Read runtime plan capability limits from org_plan_entitlements instead of deriving them from org_metadata.tier.\",\n enabled: true,\n userOverridable: false,\n },\n [FeatureSwitchKey.WorkflowConnectorReadiness]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show the manual connector readiness check on workflow settings pages.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.ZeroMail]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable persistent Gmail and Outlook draft cards created through the Zero Mail CLI.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroBrowser]: {\n maintainer: \"liangyou@vm0.ai\",\n description: \"Show the Zero Browser command in the Zero CLI.\",\n enabled: false,\n },\n [FeatureSwitchKey.ComposerConnectorPermissions]: {\n maintainer: \"ming@vm0.ai\",\n description:\n \"Show the configure-permissions entry in the chat composer connector popover, opening the agent×connector firewall dialog inline.\",\n enabled: false,\n userOverridable: true,\n },\n};\n\ninterface ResolvedHashes {\n readonly userHash?: string;\n readonly emailHash?: string;\n readonly orgIdHash?: string;\n}\n\nfunction evaluateSwitch(fs: FeatureSwitch, hashes: ResolvedHashes): boolean {\n if (fs.enabled) return true;\n if (hashes.userHash && fs.enabledUserHashes?.includes(hashes.userHash))\n return true;\n if (hashes.emailHash && fs.enabledEmailHashes?.includes(hashes.emailHash))\n return true;\n if (hashes.orgIdHash && fs.enabledOrgIdHashes?.includes(hashes.orgIdHash))\n return true;\n return false;\n}\n\n/**\n * Evaluate all feature switches at once for the given context.\n *\n * Computes identity hashes once and checks all switches synchronously.\n */\nexport function getAllFeatureStates(\n ctx?: FeatureSwitchContext,\n): Record<FeatureSwitchKey, boolean> {\n const switches = Object.values(FEATURE_SWITCHES);\n const hashes: ResolvedHashes = {\n userHash:\n ctx?.userId &&\n switches.some((s) => {\n return s.enabledUserHashes?.length;\n })\n ? fnv1a(ctx.userId)\n : undefined,\n emailHash:\n ctx?.email &&\n switches.some((s) => {\n return s.enabledEmailHashes?.length;\n })\n ? fnv1a(ctx.email.toLowerCase())\n : undefined,\n orgIdHash:\n ctx?.orgId &&\n switches.some((s) => {\n return s.enabledOrgIdHashes?.length;\n })\n ? fnv1a(ctx.orgId)\n : undefined,\n };\n\n const result = {} as Record<FeatureSwitchKey, boolean>;\n for (const key of Object.values(FeatureSwitchKey)) {\n result[key] = evaluateSwitch(FEATURE_SWITCHES[key], hashes);\n }\n\n if (ctx?.overrides) {\n for (const [key, value] of Object.entries(ctx.overrides)) {\n if (key in FEATURE_SWITCHES && value !== undefined) {\n result[key as FeatureSwitchKey] = value;\n }\n }\n }\n\n return result;\n}\n\n/**\n * Return the description for every feature switch.\n */\nexport function getFeatureSwitchDescriptions(): Record<\n FeatureSwitchKey,\n string | undefined\n> {\n const result = {} as Record<FeatureSwitchKey, string | undefined>;\n for (const key of Object.values(FeatureSwitchKey)) {\n result[key] = FEATURE_SWITCHES[key].description;\n }\n return result;\n}\n\n/**\n * Return display metadata for every feature switch.\n */\nexport function getFeatureSwitchMetadata(): Record<\n FeatureSwitchKey,\n FeatureSwitchMetadata\n> {\n const result = {} as Record<FeatureSwitchKey, FeatureSwitchMetadata>;\n for (const key of Object.values(FeatureSwitchKey)) {\n const featureSwitch = FEATURE_SWITCHES[key];\n result[key] = {\n maintainer: featureSwitch.maintainer,\n description: featureSwitch.description,\n userOverridable: featureSwitch.userOverridable !== false,\n };\n }\n return result;\n}\n\nexport function isUserOverridableFeatureSwitch(\n key: string,\n): key is FeatureSwitchKey {\n if (!(key in FEATURE_SWITCHES)) {\n return false;\n }\n return FEATURE_SWITCHES[key as FeatureSwitchKey].userOverridable !== false;\n}\n\nexport function getUserOverridableFeatureSwitchKeys(): readonly FeatureSwitchKey[] {\n return Object.values(FeatureSwitchKey).filter(isUserOverridableFeatureSwitch);\n}\n\nexport function filterUserOverridableFeatureSwitchOverrides(\n switches: Record<string, boolean>,\n): Record<string, boolean> {\n const filtered: Record<string, boolean> = {};\n for (const [key, value] of Object.entries(switches)) {\n if (isUserOverridableFeatureSwitch(key)) {\n filtered[key] = value;\n }\n }\n return filtered;\n}\n\n/**\n * Check if a feature is enabled for the given context.\n *\n * `ctx` is required so callers must pass identity (userId/orgId/email) or an\n * explicit `{}`. A switch gated by `enabledUserHashes` / `enabledOrgIdHashes`\n * silently returns `false` when ctx omits identity, which has caused bugs.\n * Client-side callers should usually read the platform `featureSwitch$` signal\n * instead — it also merges DB overrides on top of identity context.\n */\nexport function isFeatureEnabled(\n key: FeatureSwitchKey,\n ctx: FeatureSwitchContext,\n): boolean {\n const override = ctx.overrides?.[key];\n if (override !== undefined) {\n return override;\n }\n\n const featureSwitch = FEATURE_SWITCHES[key];\n if (featureSwitch.enabled) {\n return true;\n }\n if (ctx.userId && featureSwitch.enabledUserHashes?.length) {\n if (featureSwitch.enabledUserHashes.includes(fnv1a(ctx.userId)))\n return true;\n }\n if (ctx.email && featureSwitch.enabledEmailHashes?.length) {\n if (\n featureSwitch.enabledEmailHashes.includes(fnv1a(ctx.email.toLowerCase()))\n )\n return true;\n }\n if (ctx.orgId && featureSwitch.enabledOrgIdHashes?.length) {\n if (featureSwitch.enabledOrgIdHashes.includes(fnv1a(ctx.orgId)))\n return true;\n }\n return false;\n}\n","export { FeatureSwitchKey } from \"@vm0/connectors/feature-switch-key\";\n","/**\n * Identity hashing — FNV-1a 32-bit hash used to reference users / orgs / emails\n * without embedding plain-text identifiers in source code.\n *\n * Shared between the feature-switch registry (UI rollout targeting) and\n * `staff-org.ts` (authorization primitive). The hash is deterministic and\n * synchronous; no crypto API needed.\n */\n\nexport function fnv1a(input: string): string {\n let h = 2166136261 >>> 0;\n for (let i = 0; i < input.length; i++) {\n h ^= input.charCodeAt(i);\n h = Math.imul(h, 16777619) >>> 0;\n }\n return h.toString(16).padStart(8, \"0\");\n}\n\n/**\n * Hashes of internal staff org IDs.\n *\n * This list is the source of truth for `isStaffOrg()` — adding an entry here\n * grants that org access to every endpoint that uses `isStaffOrg` as an\n * authorization check. Treat changes with the same care as role grants.\n */\nexport const STAFF_ORG_ID_HASHES: readonly string[] = [\n \"afce210e\", // org_3ANttyrbWYJk6JKRSTRLEsbsDLe\n];\n","import type { FeatureSwitchKey } from \"@vm0/connectors/feature-switch-key\";\n\nexport interface ZeroTokenPayload {\n userId: string;\n runId: string;\n orgId: string;\n scope: string;\n capabilities: string[];\n featureSwitchOverrides?: Partial<Record<FeatureSwitchKey, boolean>>;\n iat: number;\n exp: number;\n}\n\n/**\n * Decode a ZERO_TOKEN JWT payload.\n * Only decodes — does NOT verify signature (server does that).\n * If no token is provided, reads from process.env.ZERO_TOKEN.\n * Returns undefined if token is missing, malformed, or not a zero-scoped token.\n */\nexport function decodeZeroTokenPayload(\n token?: string,\n): ZeroTokenPayload | undefined {\n const raw = token ?? process.env.ZERO_TOKEN;\n if (!raw) return undefined;\n\n const prefix = \"vm0_sandbox_\";\n if (!raw.startsWith(prefix)) return undefined;\n const jwt = raw.slice(prefix.length);\n\n const parts = jwt.split(\".\");\n if (parts.length !== 3) return undefined;\n\n try {\n const payload = JSON.parse(\n Buffer.from(parts[1]!, \"base64url\").toString(),\n ) as ZeroTokenPayload;\n if (payload.scope === \"zero\" && Array.isArray(payload.capabilities)) {\n return payload;\n }\n } catch {\n // Malformed token — fall through\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;AAAA;;;ACAA;;;ACAA;;;ACAA;AASO,SAAS,MAAM,OAAuB;AAC3C,MAAI,I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EACX;AACA,MAAI,IAAI,SAAS,cAAc,oBAAoB,QAAQ;AACzD,QACE,cAAc,mBAAmB,SAAS,MAAM,IAAI,MAAM,YAAY,CAAC,CAAC;AAExE,aAAO;AAAA,EACX;AACA,MAAI,IAAI,SAAS,cAAc,oBAAoB,QAAQ;AACzD,QAAI,cAAc,mBAAmB,SAAS,MAAM,IAAI,KAAK,CAAC;AAC5D,aAAO;AAAA,EACX;AACA,SAAO;AACT;;;AGtrBA;AAmBO,SAAS,uBACd,OAC8B;AAC9B,QAAM,MAAM,SAAS,QAAQ,IAAI;AACjC,MAAI,CAAC,IAAK,QAAO;AAEjB,QAAM,SAAS;AACf,MAAI,CAAC,IAAI,WAAW,MAAM,EAAG,QAAO;AACpC,QAAM,MAAM,IAAI,MAAM,OAAO,MAAM;AAEnC,QAAM,QAAQ,IAAI,MAAM,GAAG;AAC3B,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,MAAI;AACF,UAAM,UAAU,KAAK;AAAA,MACnB,OAAO,KAAK,MAAM,CAAC,GAAI,WAAW,EAAE,SAAS;AAAA,IAC/C;AACA,QAAI,QAAQ,UAAU,UAAU,MAAM,QAAQ,QAAQ,YAAY,GAAG;AACnE,aAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AACA,SAAO;AACT;","names":[]}
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
resolveFirewallMetadataPolicies
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TP7AVH5K.js";
|
|
7
7
|
import {
|
|
8
8
|
getZeroConnectorCatalogPermissions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
10
10
|
import {
|
|
11
11
|
source_default
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AXPECIRA.js";
|
|
13
13
|
import {
|
|
14
14
|
init_esm_shims
|
|
15
15
|
} from "./chunk-3VVCUQPB.js";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
policyIcon,
|
|
90
90
|
loadConnectorPermissionInfos
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-ZQOFNY34.js.map
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
fetchComputerUseScreenshot,
|
|
13
13
|
getComputerUseCommand,
|
|
14
14
|
listComputerUseHosts
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
16
|
+
import "./chunk-KDNGT5NT.js";
|
|
17
17
|
import {
|
|
18
18
|
ApiRequestError,
|
|
19
19
|
withErrorHandler
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-AXPECIRA.js";
|
|
21
|
+
import "./chunk-X5FAOKYK.js";
|
|
22
22
|
import {
|
|
23
23
|
Command
|
|
24
24
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -970,4 +970,4 @@ export {
|
|
|
970
970
|
formatComputerUseResultForConsole,
|
|
971
971
|
zeroComputerUseCommand
|
|
972
972
|
};
|
|
973
|
-
//# sourceMappingURL=computer-use-
|
|
973
|
+
//# sourceMappingURL=computer-use-54M26ZHL.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
findFirewallMetadataPermission
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TP7AVH5K.js";
|
|
7
7
|
import {
|
|
8
8
|
CALLBACK_PROMPT_PLACEHOLDER,
|
|
9
9
|
addRequestedCallbackSearchParams,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveAgentContext,
|
|
18
18
|
resolveManualGrantAuthMethod,
|
|
19
19
|
searchPublicConnectorCatalog
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RLKJ2XNZ.js";
|
|
21
21
|
import {
|
|
22
22
|
UNKNOWN_PERMISSION_GRANT,
|
|
23
23
|
connectZeroConnectorManualGrant,
|
|
@@ -32,20 +32,20 @@ import {
|
|
|
32
32
|
getZeroCustomConnector,
|
|
33
33
|
listZeroConnectorCatalogStatus,
|
|
34
34
|
listZeroCustomConnectors
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-DIK5B4ZQ.js";
|
|
36
|
+
import "./chunk-KDNGT5NT.js";
|
|
37
37
|
import {
|
|
38
38
|
getPlatformOrigin,
|
|
39
39
|
toPlatformUrl
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-NAXSTGVS.js";
|
|
41
41
|
import "./chunk-SB7EZ2ZO.js";
|
|
42
42
|
import {
|
|
43
43
|
ApiRequestError,
|
|
44
44
|
getApiUrl,
|
|
45
45
|
source_default,
|
|
46
46
|
withErrorHandler
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-AXPECIRA.js";
|
|
48
|
+
import "./chunk-X5FAOKYK.js";
|
|
49
49
|
import {
|
|
50
50
|
Command,
|
|
51
51
|
Option
|
|
@@ -1489,4 +1489,4 @@ var zeroConnectorCommand = new Command().name("connector").description("Manage a
|
|
|
1489
1489
|
export {
|
|
1490
1490
|
zeroConnectorCommand
|
|
1491
1491
|
};
|
|
1492
|
-
//# sourceMappingURL=connector-
|
|
1492
|
+
//# sourceMappingURL=connector-NQP2OC55.js.map
|