@vm0/cli 9.262.0 → 9.262.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{agent-G2H6DSZ3.js → agent-6YV2KHEN.js} +6 -6
- package/{banking-YJ2WJXRT.js → banking-4RFSN7CU.js} +4 -4
- package/{browser-KTSG7UEK.js → browser-2EZLEC4G.js} +4 -4
- package/{chat-M7NIBLJW.js → chat-HDAHO5SL.js} +5 -5
- package/{chunk-2MSZN5MT.js → chunk-22KOLNFD.js} +7 -8
- package/chunk-22KOLNFD.js.map +1 -0
- package/{chunk-TUH7TUDB.js → chunk-ADIWUWBQ.js} +92 -46
- package/chunk-ADIWUWBQ.js.map +1 -0
- package/{chunk-E4MQDHY4.js → chunk-HO2L7BC4.js} +2 -2
- package/{chunk-L2MOJJ4L.js → chunk-KAONOQXS.js} +2 -2
- package/{chunk-TSL6BCE2.js → chunk-KPMRZD4D.js} +2 -2
- package/{chunk-IJMIEJHF.js → chunk-MFUEQNVE.js} +19 -6
- package/chunk-MFUEQNVE.js.map +1 -0
- package/{chunk-6MOAF4PQ.js → chunk-ONG2SHUO.js} +4 -4
- package/{chunk-MLA6TCJI.js → chunk-RWLO4HVQ.js} +2 -2
- package/{chunk-LCYIC5ZE.js → chunk-SJI7XYIA.js} +2 -2
- package/{chunk-SI2P32V7.js → chunk-SOV44EFN.js} +1 -1
- package/{chunk-SI2P32V7.js.map → chunk-SOV44EFN.js.map} +1 -1
- package/{chunk-KSRQW7AK.js → chunk-ZCVAOPA4.js} +2 -2
- package/{computer-use-XEWT2XAN.js → computer-use-7EOACOT7.js} +4 -4
- package/{connector-M533RJDC.js → connector-ORHZIJPG.js} +7 -7
- package/{credit-DMSQHP7U.js → credit-OPVI2HG2.js} +5 -5
- package/{developer-support-ITBJGU4I.js → developer-support-HCQMXBWE.js} +4 -4
- package/{doctor-2AJUHM2S.js → doctor-2YCC3YGR.js} +5 -5
- package/{feishu-S4W7OD4B.js → feishu-PPDNSVIF.js} +4 -4
- package/{finance-LNCBR3A7.js → finance-47LQYYME.js} +4 -4
- package/{generate-RYIR5C5Y.js → generate-NQ7KWLMB.js} +6 -6
- package/{github-7VFUCZBZ.js → github-4WYN64MV.js} +4 -4
- package/{goal-AJXZXAUZ.js → goal-CNUBTBHN.js} +4 -4
- package/{host-B7NS3B2R.js → host-NVLWUYWR.js} +4 -4
- package/{logs-4ITERBY5.js → logs-HMGQGQ2G.js} +7 -7
- package/{mail-H2NC47SY.js → mail-EJKL3S2H.js} +6 -6
- package/{maps-COKAVHN4.js → maps-KAY7LZ3E.js} +4 -4
- package/{model-TZK7ORZH.js → model-2PUFZ4AJ.js} +5 -5
- package/{model-provider-O6XQCOGS.js → model-provider-6RI5M6EK.js} +5 -5
- package/{org-KGAHX5CD.js → org-BFE2PKGI.js} +4 -4
- package/package.json +1 -1
- package/{people-search-UHF2LNBC.js → people-search-L74XCGPJ.js} +4 -4
- package/{phone-4O3JLTR2.js → phone-N2I6P7UL.js} +4 -4
- package/{preference-R6PSSOEP.js → preference-TRQCSDC3.js} +4 -4
- package/{resource-CPTKUX7D.js → resource-6HTSQDGM.js} +5 -5
- package/{scrape-RM4FBCJ4.js → scrape-DRU54LLU.js} +4 -4
- package/{search-RFHFA24C.js → search-T7MG63IW.js} +7 -7
- package/{secret-FNO4B45O.js → secret-IGAULGIU.js} +4 -4
- package/{slack-A7XMWUOO.js → slack-V55XT5BC.js} +4 -4
- package/{teams-2QHVRALD.js → teams-WDUZFJ3Z.js} +4 -4
- package/{telegram-AMLKCV6D.js → telegram-DVO2FR3E.js} +4 -4
- package/{upgrade-23M3NQSX.js → upgrade-XMPBHUM2.js} +3 -3
- package/{variable-GBXYGTO2.js → variable-ER3T3AAX.js} +4 -4
- package/{video-DTJ45PZT.js → video-RW5QRRGR.js} +3 -3
- package/{weather-ZRYY4IOG.js → weather-ZPZTJG36.js} +4 -4
- package/{web-BWMBN5XR.js → web-UL3FTPH5.js} +4 -4
- package/{web-search-I55B64HY.js → web-search-QYCBILB2.js} +4 -4
- package/{whoami-PRYUPQG4.js → whoami-NKUC62VN.js} +6 -6
- package/{workflow-3WX524ZP.js → workflow-J7EGXQJT.js} +5 -5
- package/zero.js +43 -43
- package/chunk-2MSZN5MT.js.map +0 -1
- package/chunk-IJMIEJHF.js.map +0 -1
- package/chunk-TUH7TUDB.js.map +0 -1
- /package/{agent-G2H6DSZ3.js.map → agent-6YV2KHEN.js.map} +0 -0
- /package/{banking-YJ2WJXRT.js.map → banking-4RFSN7CU.js.map} +0 -0
- /package/{browser-KTSG7UEK.js.map → browser-2EZLEC4G.js.map} +0 -0
- /package/{chat-M7NIBLJW.js.map → chat-HDAHO5SL.js.map} +0 -0
- /package/{chunk-E4MQDHY4.js.map → chunk-HO2L7BC4.js.map} +0 -0
- /package/{chunk-L2MOJJ4L.js.map → chunk-KAONOQXS.js.map} +0 -0
- /package/{chunk-TSL6BCE2.js.map → chunk-KPMRZD4D.js.map} +0 -0
- /package/{chunk-6MOAF4PQ.js.map → chunk-ONG2SHUO.js.map} +0 -0
- /package/{chunk-MLA6TCJI.js.map → chunk-RWLO4HVQ.js.map} +0 -0
- /package/{chunk-LCYIC5ZE.js.map → chunk-SJI7XYIA.js.map} +0 -0
- /package/{chunk-KSRQW7AK.js.map → chunk-ZCVAOPA4.js.map} +0 -0
- /package/{computer-use-XEWT2XAN.js.map → computer-use-7EOACOT7.js.map} +0 -0
- /package/{connector-M533RJDC.js.map → connector-ORHZIJPG.js.map} +0 -0
- /package/{credit-DMSQHP7U.js.map → credit-OPVI2HG2.js.map} +0 -0
- /package/{developer-support-ITBJGU4I.js.map → developer-support-HCQMXBWE.js.map} +0 -0
- /package/{doctor-2AJUHM2S.js.map → doctor-2YCC3YGR.js.map} +0 -0
- /package/{feishu-S4W7OD4B.js.map → feishu-PPDNSVIF.js.map} +0 -0
- /package/{finance-LNCBR3A7.js.map → finance-47LQYYME.js.map} +0 -0
- /package/{generate-RYIR5C5Y.js.map → generate-NQ7KWLMB.js.map} +0 -0
- /package/{github-7VFUCZBZ.js.map → github-4WYN64MV.js.map} +0 -0
- /package/{goal-AJXZXAUZ.js.map → goal-CNUBTBHN.js.map} +0 -0
- /package/{host-B7NS3B2R.js.map → host-NVLWUYWR.js.map} +0 -0
- /package/{logs-4ITERBY5.js.map → logs-HMGQGQ2G.js.map} +0 -0
- /package/{mail-H2NC47SY.js.map → mail-EJKL3S2H.js.map} +0 -0
- /package/{maps-COKAVHN4.js.map → maps-KAY7LZ3E.js.map} +0 -0
- /package/{model-TZK7ORZH.js.map → model-2PUFZ4AJ.js.map} +0 -0
- /package/{model-provider-O6XQCOGS.js.map → model-provider-6RI5M6EK.js.map} +0 -0
- /package/{org-KGAHX5CD.js.map → org-BFE2PKGI.js.map} +0 -0
- /package/{people-search-UHF2LNBC.js.map → people-search-L74XCGPJ.js.map} +0 -0
- /package/{phone-4O3JLTR2.js.map → phone-N2I6P7UL.js.map} +0 -0
- /package/{preference-R6PSSOEP.js.map → preference-TRQCSDC3.js.map} +0 -0
- /package/{resource-CPTKUX7D.js.map → resource-6HTSQDGM.js.map} +0 -0
- /package/{scrape-RM4FBCJ4.js.map → scrape-DRU54LLU.js.map} +0 -0
- /package/{search-RFHFA24C.js.map → search-T7MG63IW.js.map} +0 -0
- /package/{secret-FNO4B45O.js.map → secret-IGAULGIU.js.map} +0 -0
- /package/{slack-A7XMWUOO.js.map → slack-V55XT5BC.js.map} +0 -0
- /package/{teams-2QHVRALD.js.map → teams-WDUZFJ3Z.js.map} +0 -0
- /package/{telegram-AMLKCV6D.js.map → telegram-DVO2FR3E.js.map} +0 -0
- /package/{upgrade-23M3NQSX.js.map → upgrade-XMPBHUM2.js.map} +0 -0
- /package/{variable-GBXYGTO2.js.map → variable-ER3T3AAX.js.map} +0 -0
- /package/{video-DTJ45PZT.js.map → video-RW5QRRGR.js.map} +0 -0
- /package/{weather-ZRYY4IOG.js.map → weather-ZPZTJG36.js.map} +0 -0
- /package/{web-BWMBN5XR.js.map → web-UL3FTPH5.js.map} +0 -0
- /package/{web-search-I55B64HY.js.map → web-search-QYCBILB2.js.map} +0 -0
- /package/{whoami-PRYUPQG4.js.map → whoami-NKUC62VN.js.map} +0 -0
- /package/{workflow-3WX524ZP.js.map → workflow-J7EGXQJT.js.map} +0 -0
|
@@ -4,14 +4,14 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
loadConnectorPermissionInfos,
|
|
6
6
|
policyIcon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ONG2SHUO.js";
|
|
8
8
|
import {
|
|
9
9
|
isInteractive,
|
|
10
10
|
promptConfirm
|
|
11
11
|
} from "./chunk-NU6ECB2E.js";
|
|
12
12
|
import {
|
|
13
13
|
permissionGrantsToFirewallPolicies
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SJI7XYIA.js";
|
|
15
15
|
import {
|
|
16
16
|
createZeroAgent,
|
|
17
17
|
deleteZeroAgent,
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
listZeroUserPermissionGrants,
|
|
24
24
|
updateZeroAgent,
|
|
25
25
|
updateZeroAgentInstructions
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-ADIWUWBQ.js";
|
|
27
|
+
import "./chunk-HO2L7BC4.js";
|
|
28
28
|
import "./chunk-MA22KQYU.js";
|
|
29
29
|
import {
|
|
30
30
|
source_default,
|
|
31
31
|
withErrorHandler
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-KPMRZD4D.js";
|
|
33
33
|
import "./chunk-MD3YWUKO.js";
|
|
34
34
|
import {
|
|
35
35
|
Command
|
|
@@ -594,4 +594,4 @@ Notes:
|
|
|
594
594
|
export {
|
|
595
595
|
zeroAgentCommand
|
|
596
596
|
};
|
|
597
|
-
//# sourceMappingURL=agent-
|
|
597
|
+
//# sourceMappingURL=agent-6YV2KHEN.js.map
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from "node:module";
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
callZeroBanking
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ADIWUWBQ.js";
|
|
7
|
+
import "./chunk-HO2L7BC4.js";
|
|
8
8
|
import "./chunk-MA22KQYU.js";
|
|
9
9
|
import {
|
|
10
10
|
source_default,
|
|
11
11
|
withErrorHandler
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KPMRZD4D.js";
|
|
13
13
|
import "./chunk-MD3YWUKO.js";
|
|
14
14
|
import {
|
|
15
15
|
Command,
|
|
@@ -114,4 +114,4 @@ Notes:
|
|
|
114
114
|
export {
|
|
115
115
|
zeroBankingCommand
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=banking-
|
|
117
|
+
//# sourceMappingURL=banking-4RFSN7CU.js.map
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
leaseZeroBrowser,
|
|
11
11
|
useZeroBrowser,
|
|
12
12
|
zeroBrowserCreateRequestSchema
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-ADIWUWBQ.js";
|
|
14
|
+
import "./chunk-HO2L7BC4.js";
|
|
15
15
|
import "./chunk-MA22KQYU.js";
|
|
16
16
|
import {
|
|
17
17
|
source_default,
|
|
18
18
|
withErrorHandler
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KPMRZD4D.js";
|
|
20
20
|
import "./chunk-MD3YWUKO.js";
|
|
21
21
|
import {
|
|
22
22
|
Command,
|
|
@@ -209,4 +209,4 @@ Notes:
|
|
|
209
209
|
export {
|
|
210
210
|
zeroBrowserCommand
|
|
211
211
|
};
|
|
212
|
-
//# sourceMappingURL=browser-
|
|
212
|
+
//# sourceMappingURL=browser-2EZLEC4G.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-FKYDKKID.js";
|
|
9
9
|
import {
|
|
10
10
|
formatModelProviderRoute
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KAONOQXS.js";
|
|
12
12
|
import {
|
|
13
13
|
chatThreadEventSchema,
|
|
14
14
|
chatThreadSnapshotProjectionSchema,
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
listZeroModelPolicies,
|
|
19
19
|
renameZeroChatThread,
|
|
20
20
|
updateZeroChatThreadModelSelection
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-ADIWUWBQ.js";
|
|
22
|
+
import "./chunk-HO2L7BC4.js";
|
|
23
23
|
import "./chunk-MA22KQYU.js";
|
|
24
24
|
import {
|
|
25
25
|
getApiUrl,
|
|
26
26
|
source_default,
|
|
27
27
|
withErrorHandler
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-KPMRZD4D.js";
|
|
29
29
|
import {
|
|
30
30
|
decodeZeroTokenPayload
|
|
31
31
|
} from "./chunk-MD3YWUKO.js";
|
|
@@ -647,4 +647,4 @@ Examples:
|
|
|
647
647
|
export {
|
|
648
648
|
zeroChatCommand
|
|
649
649
|
};
|
|
650
|
-
//# sourceMappingURL=chat-
|
|
650
|
+
//# sourceMappingURL=chat-HDAHO5SL.js.map
|
|
@@ -214,6 +214,11 @@ var FEATURE_SWITCHES = {
|
|
|
214
214
|
description: "Reveal activity debug surfaces, activity log navigation, appended system prompts, and Debug preferences",
|
|
215
215
|
enabled: false
|
|
216
216
|
},
|
|
217
|
+
["languagePreference" /* LanguagePreference */]: {
|
|
218
|
+
maintainer: "yuma@vm0.ai",
|
|
219
|
+
description: "Enable workspace language bootstrap, persistence, and the Settings preference entry.",
|
|
220
|
+
enabled: false
|
|
221
|
+
},
|
|
217
222
|
["zeroFinance" /* ZeroFinance */]: {
|
|
218
223
|
maintainer: "ethan@vm0.ai",
|
|
219
224
|
description: "Enable the managed APIDojo-backed Zero Finance API and finance:read ZERO_TOKEN capability.",
|
|
@@ -352,8 +357,7 @@ var FEATURE_SWITCHES = {
|
|
|
352
357
|
["newChatThreadSidebar" /* NewChatThreadSidebar */]: {
|
|
353
358
|
maintainer: "ethan@vm0.ai",
|
|
354
359
|
description: "Thread-owned utility sidebar for chat threads: one shared shell for the artifacts list, artifact detail, email draft, browser, and automations panels. When off, the legacy search-param sidebars stay in place.",
|
|
355
|
-
enabled:
|
|
356
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
360
|
+
enabled: true
|
|
357
361
|
},
|
|
358
362
|
["composerSkillSubstringSearch" /* ComposerSkillSubstringSearch */]: {
|
|
359
363
|
maintainer: "yuma@vm0.ai",
|
|
@@ -415,11 +419,6 @@ var FEATURE_SWITCHES = {
|
|
|
415
419
|
description: "Generate poster images asynchronously when video artifacts are recorded.",
|
|
416
420
|
enabled: true
|
|
417
421
|
},
|
|
418
|
-
["websiteTemplateV2" /* WebsiteTemplateV2 */]: {
|
|
419
|
-
maintainer: "bingjie@vm0.ai",
|
|
420
|
-
description: "Generate websites from refreshed self-contained template packages. When off, website generation uses the existing package versions.",
|
|
421
|
-
enabled: true
|
|
422
|
-
},
|
|
423
422
|
["imageStyleR2" /* ImageStyleR2 */]: {
|
|
424
423
|
maintainer: "bingjie@vm0.ai",
|
|
425
424
|
description: "Resolve archive-enabled image styles from private R2 packages. When off, image style authoring continues reading vm0-skills from GitHub.",
|
|
@@ -484,4 +483,4 @@ function isFeatureEnabled(key, ctx) {
|
|
|
484
483
|
export {
|
|
485
484
|
isFeatureEnabled
|
|
486
485
|
};
|
|
487
|
-
//# sourceMappingURL=chunk-
|
|
486
|
+
//# sourceMappingURL=chunk-22KOLNFD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/core/src/feature-switch-key.ts","../../../packages/core/src/feature-switch.ts","../../../packages/core/src/identity-hash.ts"],"sourcesContent":["/**\n * Feature switch keys\n *\n * Defines all available feature switch identifiers.\n */\nexport enum FeatureSwitchKey {\n Dummy = \"dummy\",\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 JoggAiConnector = \"joggAiConnector\",\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 LanguagePreference = \"languagePreference\",\n ZeroFinance = \"zeroFinance\",\n ZeroPeopleSearch = \"zeroPeopleSearch\",\n ZeroBrowser = \"zeroBrowser\",\n ZeroMailReplyFollowUp = \"zeroMailReplyFollowUp\",\n Banking = \"banking\",\n Lab = \"lab\",\n NotionWorkflowAutomations = \"notionWorkflowAutomations\",\n GithubWebhookAutomations = \"githubWebhookAutomations\",\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 CodexSessionPruning = \"codexSessionPruning\",\n ClaudeSessionPruning = \"claudeSessionPruning\",\n RealAgentInPreview = \"realAgentInPreview\",\n ComposerUploadPopover = \"composerUploadPopover\",\n StructuredPrompt = \"structuredPrompt\",\n StructuredPromptInlineTemplates = \"structuredPromptInlineTemplates\",\n\n ZapierConnector = \"zapierConnector\",\n ComputerUseDesktopPlugins = \"computerUseDesktopPlugins\",\n ChatThreadUnifiedSearch = \"chatThreadUnifiedSearch\",\n ComposerSkillSubstringSearch = \"composerSkillSubstringSearch\",\n SidebarSubscriptionUsage = \"sidebarSubscriptionUsage\",\n SlackDmSessionRouting = \"slackDmSessionRouting\",\n TeamsIntegration = \"teamsIntegration\",\n FeishuIntegration = \"feishuIntegration\",\n Artifacts = \"artifacts\",\n HostedArtifactVersions = \"hostedArtifactVersions\",\n VideoArtifactPosters = \"videoArtifactPosters\",\n ImageStyleR2 = \"imageStyleR2\",\n OrgPlanEntitlementReads = \"orgPlanEntitlementReads\",\n WorkflowConnectorReadiness = \"workflowConnectorReadiness\",\n ComposerConnectorPermissions = \"composerConnectorPermissions\",\n ThreeColumnNav = \"threeColumnNav\",\n ChatHistoryBackfillProgress = \"chatHistoryBackfillProgress\",\n NewChatThreadSidebar = \"newChatThreadSidebar\",\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.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.JoggAiConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the JoggAI video generation 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.LanguagePreference]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable workspace language bootstrap, persistence, and the Settings preference entry.\",\n enabled: false,\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.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.CodexSessionPruning]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Prune oversized Codex checkpoint histories to the latest native compact generation.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ClaudeSessionPruning]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Prune oversized Claude Code checkpoint histories to the latest native compact generation.\",\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.StructuredPromptInlineTemplates]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable multiple inline artifact templates in structured chat prompts.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\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.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.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.NewChatThreadSidebar]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Thread-owned utility sidebar for chat threads: one shared shell for the artifacts list, artifact detail, email draft, browser, and automations panels. When off, the legacy search-param sidebars stay in place.\",\n enabled: true,\n },\n [FeatureSwitchKey.ComposerSkillSubstringSearch]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Match chat composer slash skill suggestions by any slug substring instead of only prefixes.\",\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.SlackDmSessionRouting]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Reuse agent/model-scoped sessions for top-level Slack direct messages after compatible callback readers are deployed.\",\n enabled: false,\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.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: true,\n },\n [FeatureSwitchKey.ImageStyleR2]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Resolve archive-enabled image styles from private R2 packages. When off, image style authoring continues reading vm0-skills from GitHub.\",\n enabled: true,\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.ZeroMailReplyFollowUp]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable Zero Mail reply follow-up after all API deployments can read Gmail event configurations with threadId.\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.ZeroBrowser]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable thread-scoped Cloud browser access in chat and the Zero CLI.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\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","/**\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"],"mappings":";;;;;;;;AAAA;;;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,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AAuC,GAAG;AAAA,IACxC,YAAY;AAAA,IACZ,aACE;AAAA,IACF,SAAS;AAAA,IACT,iBAAiB;AAAA,EACnB;AAAA,EACA,gCAA6B,GAAG;AAAA,IAC9B,YAAY;AAAA,IACZ,aACE;AAAA,IACF,SAAS;AAAA,IACT,oBAAoB;AAAA,EACtB;AAAA,EACA,kEAA8C,GAAG;AAAA,IAC/C,YAAY;AAAA,IACZ,aACE;AAAA,IACF,SAAS;AAAA,IACT,iBAAiB;AAAA,EACnB;AACF;AAuIO,SAAS,iBACd,KACA,KACS;AACT,QAAM,WAAW,IAAI,YAAY,GAAG;AACpC,MAAI,aAAa,QAAW;AAC1B,WAAO;AAAA,EACT;AAEA,QAAM,gBAAgB,iBAAiB,GAAG;AAC1C,MAAI,cAAc,SAAS;AACzB,WAAO;AAAA,EACT;AACA,MAAI,IAAI,UAAU,cAAc,mBAAmB,QAAQ;AACzD,QAAI,cAAc,kBAAkB,SAAS,MAAM,IAAI,MAAM,CAAC;AAC5D,aAAO;AAAA,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;","names":[]}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
updateOrgModelPoliciesRequestSchema,
|
|
22
22
|
upsertModelProviderRequestSchema,
|
|
23
23
|
upsertModelProviderResponseSchema
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KPMRZD4D.js";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__esm,
|
|
@@ -697,8 +697,14 @@ init_esm_shims();
|
|
|
697
697
|
init_esm_shims();
|
|
698
698
|
var c2 = initContract();
|
|
699
699
|
var sendModeSchema = external_exports.enum(["enter", "cmd-enter"]);
|
|
700
|
+
var userLocaleSchema = external_exports.enum(["en-US", "zh-CN"]);
|
|
700
701
|
var userPreferencesResponseSchema = external_exports.object({
|
|
701
702
|
timezone: external_exports.string().nullable(),
|
|
703
|
+
/**
|
|
704
|
+
* Optional during rollout so the new frontend can distinguish an older API
|
|
705
|
+
* (field absent) from a user who has not selected a language yet (null).
|
|
706
|
+
*/
|
|
707
|
+
locale: userLocaleSchema.nullable().optional(),
|
|
702
708
|
// Pinned agents are exposed as membership only. The API returns a stable
|
|
703
709
|
// canonical order and ignores client-provided order on writes.
|
|
704
710
|
pinnedAgentIds: external_exports.array(external_exports.string()),
|
|
@@ -713,6 +719,7 @@ var userPreferencesResponseSchema = external_exports.object({
|
|
|
713
719
|
});
|
|
714
720
|
var updateUserPreferencesRequestSchema = external_exports.object({
|
|
715
721
|
timezone: external_exports.string().min(1).optional(),
|
|
722
|
+
locale: userLocaleSchema.optional(),
|
|
716
723
|
// Membership update only; request order is not used for display ordering.
|
|
717
724
|
pinnedAgentIds: external_exports.array(external_exports.string()).optional(),
|
|
718
725
|
sendMode: sendModeSchema.optional(),
|
|
@@ -720,7 +727,7 @@ var updateUserPreferencesRequestSchema = external_exports.object({
|
|
|
720
727
|
captureNetworkBodiesRemaining: external_exports.number().int().min(0).optional()
|
|
721
728
|
}).refine(
|
|
722
729
|
(data) => {
|
|
723
|
-
return data.timezone !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0 || data.morningBriefEnabled !== void 0 || data.captureNetworkBodiesRemaining !== void 0;
|
|
730
|
+
return data.timezone !== void 0 || data.locale !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0 || data.morningBriefEnabled !== void 0 || data.captureNetworkBodiesRemaining !== void 0;
|
|
724
731
|
},
|
|
725
732
|
{
|
|
726
733
|
message: "At least one preference must be provided"
|
|
@@ -3311,6 +3318,32 @@ var zeroGoalsContract = c12.router({
|
|
|
3311
3318
|
}
|
|
3312
3319
|
});
|
|
3313
3320
|
|
|
3321
|
+
// ../../packages/api-contracts/src/contracts/user-message-rollout.ts
|
|
3322
|
+
init_esm_shims();
|
|
3323
|
+
function isRecord(value) {
|
|
3324
|
+
return typeof value === "object" && value !== null;
|
|
3325
|
+
}
|
|
3326
|
+
function normalizePrecedingStructuredPrompt(value) {
|
|
3327
|
+
if (!isRecord(value)) {
|
|
3328
|
+
return value;
|
|
3329
|
+
}
|
|
3330
|
+
const { structuredPrompt, ...canonical } = value;
|
|
3331
|
+
if ("userMessage" in canonical || structuredPrompt === void 0) {
|
|
3332
|
+
return canonical;
|
|
3333
|
+
}
|
|
3334
|
+
return { ...canonical, userMessage: structuredPrompt };
|
|
3335
|
+
}
|
|
3336
|
+
function normalizePrecedingDraftStructuredPrompt(value) {
|
|
3337
|
+
if (!isRecord(value)) {
|
|
3338
|
+
return value;
|
|
3339
|
+
}
|
|
3340
|
+
const { draftStructuredPrompt, ...canonical } = value;
|
|
3341
|
+
if ("draftUserMessage" in canonical || draftStructuredPrompt === void 0) {
|
|
3342
|
+
return canonical;
|
|
3343
|
+
}
|
|
3344
|
+
return { ...canonical, draftUserMessage: draftStructuredPrompt };
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3314
3347
|
// ../../packages/api-contracts/src/contracts/chat-threads.ts
|
|
3315
3348
|
var c13 = initContract();
|
|
3316
3349
|
var attachFileSchema = external_exports.object({
|
|
@@ -3652,7 +3685,7 @@ var chatMessageRecommendedFollowupsSchema = external_exports.preprocess((value)
|
|
|
3652
3685
|
}, external_exports.array(chatMessageRecommendedFollowupSchema));
|
|
3653
3686
|
var inputPromptEventSchema = chatEventBaseSchema.extend({
|
|
3654
3687
|
eventType: external_exports.literal("input.prompt"),
|
|
3655
|
-
|
|
3688
|
+
userMessage: userMessageDocumentSchema.optional(),
|
|
3656
3689
|
attachFiles: external_exports.array(resolvedAttachFileSchema).optional(),
|
|
3657
3690
|
generationTemplate: generationTemplateRequestSchema.optional()
|
|
3658
3691
|
}).strict();
|
|
@@ -3665,7 +3698,7 @@ var inputAutomationEventSchema = chatEventBaseSchema.extend({
|
|
|
3665
3698
|
}).strict();
|
|
3666
3699
|
var inputRejectedEventSchema = chatEventBaseSchema.extend({
|
|
3667
3700
|
eventType: external_exports.literal("input.rejected"),
|
|
3668
|
-
|
|
3701
|
+
userMessage: userMessageDocumentSchema.optional(),
|
|
3669
3702
|
error: external_exports.string(),
|
|
3670
3703
|
attachFiles: external_exports.array(resolvedAttachFileSchema).optional(),
|
|
3671
3704
|
generationTemplate: generationTemplateRequestSchema.optional()
|
|
@@ -3789,7 +3822,7 @@ var assistantEventCompatibilityResponseShape = {
|
|
|
3789
3822
|
*/
|
|
3790
3823
|
revokesMessageId: external_exports.string().optional()
|
|
3791
3824
|
};
|
|
3792
|
-
var
|
|
3825
|
+
var canonicalChatEventResponseSchema = external_exports.discriminatedUnion("eventType", [
|
|
3793
3826
|
inputPromptEventSchema.extend(userEventCompatibilityResponseShape).strict(),
|
|
3794
3827
|
inputAutomationEventSchema.extend(userEventCompatibilityResponseShape).strict(),
|
|
3795
3828
|
inputRejectedEventSchema.extend(userEventCompatibilityResponseShape).strict(),
|
|
@@ -3815,6 +3848,10 @@ var chatEventResponseSchema = external_exports.discriminatedUnion("eventType", [
|
|
|
3815
3848
|
goalChangedEventSchema.extend(assistantEventCompatibilityResponseShape).strict(),
|
|
3816
3849
|
usageRecordedEventSchema.extend(assistantEventCompatibilityResponseShape).strict()
|
|
3817
3850
|
]);
|
|
3851
|
+
var chatEventResponseSchema = external_exports.preprocess(
|
|
3852
|
+
normalizePrecedingStructuredPrompt,
|
|
3853
|
+
canonicalChatEventResponseSchema
|
|
3854
|
+
);
|
|
3818
3855
|
var legacyPagedChatMessageBaseSchema = external_exports.object({
|
|
3819
3856
|
id: external_exports.string(),
|
|
3820
3857
|
content: external_exports.string().nullable(),
|
|
@@ -3840,23 +3877,26 @@ var legacyPagedChatMessageBaseSchema = external_exports.object({
|
|
|
3840
3877
|
workflowSnapshot: workflowSnapshotSchema.optional(),
|
|
3841
3878
|
createdAt: external_exports.string()
|
|
3842
3879
|
});
|
|
3843
|
-
var legacyPagedChatMessageSchema = external_exports.
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3880
|
+
var legacyPagedChatMessageSchema = external_exports.preprocess(
|
|
3881
|
+
normalizePrecedingStructuredPrompt,
|
|
3882
|
+
external_exports.discriminatedUnion("role", [
|
|
3883
|
+
legacyPagedChatMessageBaseSchema.extend({
|
|
3884
|
+
role: external_exports.literal("user"),
|
|
3885
|
+
userMessage: userMessageDocumentSchema.optional()
|
|
3886
|
+
}).strict(),
|
|
3887
|
+
legacyPagedChatMessageBaseSchema.extend({
|
|
3888
|
+
role: external_exports.literal("assistant"),
|
|
3889
|
+
thinking: external_exports.string().optional(),
|
|
3890
|
+
runLifecycleEvent: external_exports.enum(["completed", "failed", "cancelled"]).optional(),
|
|
3891
|
+
recommendedFollowups: chatMessageRecommendedFollowupsSchema.optional()
|
|
3892
|
+
}).strict()
|
|
3893
|
+
])
|
|
3894
|
+
);
|
|
3855
3895
|
var chatMessageCompatibilityResponseSchema = external_exports.union([
|
|
3856
3896
|
chatEventResponseSchema,
|
|
3857
3897
|
legacyPagedChatMessageSchema
|
|
3858
3898
|
]);
|
|
3859
|
-
if (chatEventTypeSchema.options.length !== chatEventSchema.options.length || chatEventTypeSchema.options.length !==
|
|
3899
|
+
if (chatEventTypeSchema.options.length !== chatEventSchema.options.length || chatEventTypeSchema.options.length !== canonicalChatEventResponseSchema.options.length) {
|
|
3860
3900
|
throw new Error("ChatEvent schema must cover the complete event catalog");
|
|
3861
3901
|
}
|
|
3862
3902
|
var pagedChatMessageSchema = legacyPagedChatMessageSchema;
|
|
@@ -3872,27 +3912,30 @@ var chatThreadMetadataSchema = external_exports.object({
|
|
|
3872
3912
|
title: external_exports.string().nullable(),
|
|
3873
3913
|
selectedModel: external_exports.string().nullable()
|
|
3874
3914
|
});
|
|
3875
|
-
var chatThreadDraftSchema = external_exports.
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3915
|
+
var chatThreadDraftSchema = external_exports.preprocess(
|
|
3916
|
+
normalizePrecedingDraftStructuredPrompt,
|
|
3917
|
+
external_exports.object({
|
|
3918
|
+
draftContent: external_exports.string().nullable(),
|
|
3919
|
+
draftUserMessage: userMessageDocumentSchema.nullable().optional(),
|
|
3920
|
+
draftAttachments: external_exports.array(persistedAttachmentSchema).nullable()
|
|
3921
|
+
})
|
|
3922
|
+
);
|
|
3880
3923
|
var selectedModelRequestSchema = requestedRunModelSchema;
|
|
3881
|
-
function
|
|
3924
|
+
function isRecord2(value) {
|
|
3882
3925
|
return typeof value === "object" && value !== null;
|
|
3883
3926
|
}
|
|
3884
3927
|
function legacyModelSelectionModel(value) {
|
|
3885
3928
|
if (value === null) {
|
|
3886
3929
|
return null;
|
|
3887
3930
|
}
|
|
3888
|
-
if (!
|
|
3931
|
+
if (!isRecord2(value)) {
|
|
3889
3932
|
return void 0;
|
|
3890
3933
|
}
|
|
3891
3934
|
const selectedModel = value.selectedModel;
|
|
3892
3935
|
return typeof selectedModel === "string" ? selectedModel : void 0;
|
|
3893
3936
|
}
|
|
3894
3937
|
function normalizeLegacyModelSelectionInput(value, options) {
|
|
3895
|
-
if (!
|
|
3938
|
+
if (!isRecord2(value) || "model" in value || !("modelSelection" in value)) {
|
|
3896
3939
|
return value;
|
|
3897
3940
|
}
|
|
3898
3941
|
const legacyModelSelection = legacyModelSelectionModel(value.modelSelection);
|
|
@@ -3950,7 +3993,7 @@ var chatNormalSendBodyShape = {
|
|
|
3950
3993
|
*/
|
|
3951
3994
|
model: selectedModelRequestSchema.optional(),
|
|
3952
3995
|
runOptions: chatRunOptionsRequestSchema.optional(),
|
|
3953
|
-
|
|
3996
|
+
userMessage: userMessageDocumentSchema.optional(),
|
|
3954
3997
|
generationTemplate: generationTemplateRequestSchema.optional(),
|
|
3955
3998
|
computerUseHostId: external_exports.string().uuid().nullable().optional(),
|
|
3956
3999
|
cloudBrowserEnabled: external_exports.boolean().optional(),
|
|
@@ -4084,7 +4127,7 @@ var chatThreadsContract = c13.router({
|
|
|
4084
4127
|
200: external_exports.object({
|
|
4085
4128
|
/**
|
|
4086
4129
|
* Thread ids owned by the caller that currently hold an unsent draft
|
|
4087
|
-
* (non-empty `draftContent`, a
|
|
4130
|
+
* (non-empty `draftContent`, a user message, or one+
|
|
4088
4131
|
* `draftAttachments`).
|
|
4089
4132
|
*/
|
|
4090
4133
|
draftThreadIds: external_exports.array(external_exports.string())
|
|
@@ -4149,7 +4192,7 @@ var chatThreadByIdContract = c13.router({
|
|
|
4149
4192
|
pathParams: chatThreadIdPathParamsSchema,
|
|
4150
4193
|
body: external_exports.object({
|
|
4151
4194
|
draftContent: external_exports.string().nullable().optional(),
|
|
4152
|
-
|
|
4195
|
+
draftUserMessage: userMessageDocumentSchema.nullable().optional(),
|
|
4153
4196
|
draftAttachments: external_exports.array(persistedAttachmentSchema).nullable().optional()
|
|
4154
4197
|
}),
|
|
4155
4198
|
responses: {
|
|
@@ -4368,7 +4411,7 @@ var chatMessagesContract = c13.router({
|
|
|
4368
4411
|
chatThreadSortEventId: external_exports.undefined().optional(),
|
|
4369
4412
|
model: external_exports.undefined().optional(),
|
|
4370
4413
|
runOptions: external_exports.undefined().optional(),
|
|
4371
|
-
|
|
4414
|
+
userMessage: external_exports.undefined().optional(),
|
|
4372
4415
|
generationTemplate: external_exports.undefined().optional(),
|
|
4373
4416
|
computerUseHostId: external_exports.undefined().optional(),
|
|
4374
4417
|
cloudBrowserEnabled: external_exports.undefined().optional(),
|
|
@@ -4388,7 +4431,7 @@ var chatMessagesContract = c13.router({
|
|
|
4388
4431
|
chatThreadSortEventId: external_exports.undefined().optional(),
|
|
4389
4432
|
model: external_exports.undefined().optional(),
|
|
4390
4433
|
runOptions: external_exports.undefined().optional(),
|
|
4391
|
-
|
|
4434
|
+
userMessage: external_exports.undefined().optional(),
|
|
4392
4435
|
generationTemplate: external_exports.undefined().optional(),
|
|
4393
4436
|
computerUseHostId: external_exports.undefined().optional(),
|
|
4394
4437
|
cloudBrowserEnabled: external_exports.undefined().optional(),
|
|
@@ -4434,7 +4477,7 @@ var chatEventsContract = c13.router({
|
|
|
4434
4477
|
chatThreadSortEventId: external_exports.undefined().optional(),
|
|
4435
4478
|
model: external_exports.undefined().optional(),
|
|
4436
4479
|
runOptions: external_exports.undefined().optional(),
|
|
4437
|
-
|
|
4480
|
+
userMessage: external_exports.undefined().optional(),
|
|
4438
4481
|
generationTemplate: external_exports.undefined().optional(),
|
|
4439
4482
|
computerUseHostId: external_exports.undefined().optional(),
|
|
4440
4483
|
hasTextContent: external_exports.undefined().optional(),
|
|
@@ -4453,7 +4496,7 @@ var chatEventsContract = c13.router({
|
|
|
4453
4496
|
chatThreadSortEventId: external_exports.undefined().optional(),
|
|
4454
4497
|
model: external_exports.undefined().optional(),
|
|
4455
4498
|
runOptions: external_exports.undefined().optional(),
|
|
4456
|
-
|
|
4499
|
+
userMessage: external_exports.undefined().optional(),
|
|
4457
4500
|
generationTemplate: external_exports.undefined().optional(),
|
|
4458
4501
|
computerUseHostId: external_exports.undefined().optional(),
|
|
4459
4502
|
hasTextContent: external_exports.undefined().optional(),
|
|
@@ -4756,14 +4799,17 @@ var zeroAgentInstructionsResponseSchema = external_exports.object({
|
|
|
4756
4799
|
var zeroAgentInstructionsRequestSchema = external_exports.object({
|
|
4757
4800
|
content: external_exports.string()
|
|
4758
4801
|
});
|
|
4759
|
-
var zeroAgentDraftResponseSchema = external_exports.
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4802
|
+
var zeroAgentDraftResponseSchema = external_exports.preprocess(
|
|
4803
|
+
normalizePrecedingDraftStructuredPrompt,
|
|
4804
|
+
external_exports.object({
|
|
4805
|
+
draftContent: external_exports.string().nullable(),
|
|
4806
|
+
draftUserMessage: userMessageDocumentSchema.nullable().optional(),
|
|
4807
|
+
draftAttachments: external_exports.array(persistedAttachmentSchema).nullable()
|
|
4808
|
+
})
|
|
4809
|
+
);
|
|
4764
4810
|
var zeroAgentDraftRequestSchema = external_exports.object({
|
|
4765
4811
|
draftContent: external_exports.string().nullable().optional(),
|
|
4766
|
-
|
|
4812
|
+
draftUserMessage: userMessageDocumentSchema.nullable().optional(),
|
|
4767
4813
|
draftAttachments: external_exports.array(persistedAttachmentSchema).nullable().optional()
|
|
4768
4814
|
});
|
|
4769
4815
|
var zeroAgentsMainContract = c14.router({
|
|
@@ -9276,7 +9322,7 @@ function authenticatedJsonHeaders(token) {
|
|
|
9276
9322
|
};
|
|
9277
9323
|
return headers;
|
|
9278
9324
|
}
|
|
9279
|
-
function
|
|
9325
|
+
function isRecord3(value) {
|
|
9280
9326
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9281
9327
|
}
|
|
9282
9328
|
async function parseErrorBody(response) {
|
|
@@ -9284,7 +9330,7 @@ async function parseErrorBody(response) {
|
|
|
9284
9330
|
let code = response.status === 404 ? "NOT_FOUND" : "UNKNOWN";
|
|
9285
9331
|
try {
|
|
9286
9332
|
const body = await response.json();
|
|
9287
|
-
if (
|
|
9333
|
+
if (isRecord3(body) && isRecord3(body.error)) {
|
|
9288
9334
|
if (typeof body.error.message === "string") {
|
|
9289
9335
|
message = body.error.message;
|
|
9290
9336
|
}
|
|
@@ -9329,7 +9375,7 @@ function authenticatedJsonHeaders2(token) {
|
|
|
9329
9375
|
};
|
|
9330
9376
|
return headers;
|
|
9331
9377
|
}
|
|
9332
|
-
function
|
|
9378
|
+
function isRecord4(value) {
|
|
9333
9379
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9334
9380
|
}
|
|
9335
9381
|
async function parseErrorBody2(response) {
|
|
@@ -9337,7 +9383,7 @@ async function parseErrorBody2(response) {
|
|
|
9337
9383
|
let code = response.status === 404 ? "NOT_FOUND" : "UNKNOWN";
|
|
9338
9384
|
try {
|
|
9339
9385
|
const body = await response.json();
|
|
9340
|
-
if (
|
|
9386
|
+
if (isRecord4(body) && isRecord4(body.error)) {
|
|
9341
9387
|
if (typeof body.error.message === "string") {
|
|
9342
9388
|
message = body.error.message;
|
|
9343
9389
|
}
|
|
@@ -9793,7 +9839,7 @@ function authenticatedJsonHeaders3(token) {
|
|
|
9793
9839
|
};
|
|
9794
9840
|
return headers;
|
|
9795
9841
|
}
|
|
9796
|
-
function
|
|
9842
|
+
function isRecord5(value) {
|
|
9797
9843
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9798
9844
|
}
|
|
9799
9845
|
async function parseErrorBody3(response) {
|
|
@@ -9801,7 +9847,7 @@ async function parseErrorBody3(response) {
|
|
|
9801
9847
|
let code = response.status === 404 ? "NOT_FOUND" : "UNKNOWN";
|
|
9802
9848
|
try {
|
|
9803
9849
|
const body = await response.json();
|
|
9804
|
-
if (
|
|
9850
|
+
if (isRecord5(body) && isRecord5(body.error)) {
|
|
9805
9851
|
if (typeof body.error.message === "string") {
|
|
9806
9852
|
message = body.error.message;
|
|
9807
9853
|
}
|
|
@@ -13240,4 +13286,4 @@ export {
|
|
|
13240
13286
|
getHostedSiteFiles,
|
|
13241
13287
|
getHostedSiteDeployments
|
|
13242
13288
|
};
|
|
13243
|
-
//# sourceMappingURL=chunk-
|
|
13289
|
+
//# sourceMappingURL=chunk-ADIWUWBQ.js.map
|