@vm0/cli 9.254.2 → 9.256.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{agent-NSQIRPVB.js → agent-EVQN2LPX.js} +7 -7
- package/{banking-IQ7MX2B4.js → banking-YA4UBYKV.js} +5 -5
- package/browser-K37YB6WN.js +186 -0
- package/browser-K37YB6WN.js.map +1 -0
- package/{chat-SC5PGHDZ.js → chat-UFNIPVLN.js} +6 -6
- package/{chunk-F6JKPYD2.js → chunk-AAZBHQPP.js} +2 -2
- package/{chunk-X6PT2M2I.js → chunk-CIALZM7O.js} +2 -2
- package/{chunk-UUKFGXX5.js → chunk-GF22PXYF.js} +2 -2
- package/{chunk-4MPNBXFO.js → chunk-ITSKDZFI.js} +2 -2
- package/{chunk-SXD7ESWU.js → chunk-KLSQEQC4.js} +82 -151
- package/chunk-KLSQEQC4.js.map +1 -0
- package/{chunk-TV6RSLOX.js → chunk-M4F24YFV.js} +3 -3
- package/{chunk-OTH23BP4.js → chunk-OQSXOSCD.js} +84 -2
- package/chunk-OQSXOSCD.js.map +1 -0
- package/{chunk-BSFDG7MC.js → chunk-P2FBG2BA.js} +2 -2
- package/{chunk-7OBI7V4O.js → chunk-SLUCBVKQ.js} +589 -512
- package/chunk-SLUCBVKQ.js.map +1 -0
- package/{chunk-MNHYBPQB.js → chunk-VQ3ILWFQ.js} +4 -4
- package/{chunk-D4OTAABD.js → chunk-X5FAOKYK.js} +7 -3
- package/chunk-X5FAOKYK.js.map +1 -0
- package/{computer-use-C7D4GLBU.js → computer-use-C6VLY2LY.js} +5 -5
- package/{connector-FW3TFVAJ.js → connector-SJF25IFP.js} +15 -83
- package/connector-SJF25IFP.js.map +1 -0
- package/{credit-YDQVARRO.js → credit-LYZ2HJ6F.js} +7 -7
- package/{developer-support-NPRGXXF2.js → developer-support-3ISSXZCF.js} +5 -5
- package/{doctor-D7DAFSV3.js → doctor-ISR6CR7B.js} +7 -7
- package/{feishu-UDSN4AVE.js → feishu-3MULYZGN.js} +5 -5
- package/{finance-O7WTSZ7W.js → finance-7BH57FKM.js} +5 -5
- package/{generate-ERHBA3S5.js → generate-5RN37TB2.js} +7 -7
- package/{github-LFJ6JXXJ.js → github-V6IISTKM.js} +5 -5
- package/{goal-GFUDKA42.js → goal-VHURZA6I.js} +5 -5
- package/{host-4NPMKE4M.js → host-FPYIZNEY.js} +5 -5
- package/{logs-IAMPNPZU.js → logs-SOU4VJKD.js} +6 -6
- package/{mail-KZJLXDSP.js → mail-CYM7COJU.js} +67 -17
- package/mail-CYM7COJU.js.map +1 -0
- package/{maps-QC6LW3XN.js → maps-M743J55Y.js} +5 -5
- package/{model-ZCBZUROI.js → model-UP6QUEBW.js} +6 -6
- package/{model-provider-KHT4TJAD.js → model-provider-OFR5IFKC.js} +6 -6
- package/{org-PGERW5HL.js → org-TMYRDS6T.js} +5 -5
- package/package.json +1 -1
- package/{people-search-KOWVJQ7J.js → people-search-PGGRVJE2.js} +5 -5
- package/{phone-UDZRVU4K.js → phone-XDSMT3L2.js} +5 -5
- package/{preference-CW4D6H22.js → preference-HJZXDNPF.js} +5 -5
- package/{resource-UTBKHQYI.js → resource-EPIY47XQ.js} +5 -5
- package/{scrape-HSJGZHJP.js → scrape-RARAUZOC.js} +5 -5
- package/{search-E3XYG3EQ.js → search-DXXHHWDZ.js} +6 -6
- package/{secret-FHYLUY5C.js → secret-AGFBP5RY.js} +5 -5
- package/{slack-KNNFCXQL.js → slack-K2QEL2LI.js} +5 -5
- package/{teams-SE2UBCFO.js → teams-KIJXDVOL.js} +5 -5
- package/{telegram-MBCYOZOW.js → telegram-S5K3IMKH.js} +5 -5
- package/{upgrade-HCODAAIE.js → upgrade-6I5DNVPS.js} +4 -4
- package/{variable-VK42DTQ3.js → variable-IRTOV55E.js} +5 -5
- package/{video-5HT4OTPO.js → video-3ZDBT2PC.js} +4 -4
- package/{weather-JYVT7MJV.js → weather-4TPUCJLD.js} +5 -5
- package/{web-4ZYLQGTN.js → web-ZK5I2YXJ.js} +5 -5
- package/{web-search-BUSZ7LN5.js → web-search-OI6ACM3G.js} +5 -5
- package/{whoami-DD32L4F2.js → whoami-FJGFKNBS.js} +7 -7
- package/{workflow-SW7Q4HHX.js → workflow-4ODQQIVH.js} +5 -5
- package/zero.js +54 -44
- package/zero.js.map +1 -1
- package/chunk-7OBI7V4O.js.map +0 -1
- package/chunk-D4OTAABD.js.map +0 -1
- package/chunk-OTH23BP4.js.map +0 -1
- package/chunk-SXD7ESWU.js.map +0 -1
- package/connector-FW3TFVAJ.js.map +0 -1
- package/mail-KZJLXDSP.js.map +0 -1
- /package/{agent-NSQIRPVB.js.map → agent-EVQN2LPX.js.map} +0 -0
- /package/{banking-IQ7MX2B4.js.map → banking-YA4UBYKV.js.map} +0 -0
- /package/{chat-SC5PGHDZ.js.map → chat-UFNIPVLN.js.map} +0 -0
- /package/{chunk-F6JKPYD2.js.map → chunk-AAZBHQPP.js.map} +0 -0
- /package/{chunk-X6PT2M2I.js.map → chunk-CIALZM7O.js.map} +0 -0
- /package/{chunk-UUKFGXX5.js.map → chunk-GF22PXYF.js.map} +0 -0
- /package/{chunk-4MPNBXFO.js.map → chunk-ITSKDZFI.js.map} +0 -0
- /package/{chunk-TV6RSLOX.js.map → chunk-M4F24YFV.js.map} +0 -0
- /package/{chunk-BSFDG7MC.js.map → chunk-P2FBG2BA.js.map} +0 -0
- /package/{chunk-MNHYBPQB.js.map → chunk-VQ3ILWFQ.js.map} +0 -0
- /package/{computer-use-C7D4GLBU.js.map → computer-use-C6VLY2LY.js.map} +0 -0
- /package/{credit-YDQVARRO.js.map → credit-LYZ2HJ6F.js.map} +0 -0
- /package/{developer-support-NPRGXXF2.js.map → developer-support-3ISSXZCF.js.map} +0 -0
- /package/{doctor-D7DAFSV3.js.map → doctor-ISR6CR7B.js.map} +0 -0
- /package/{feishu-UDSN4AVE.js.map → feishu-3MULYZGN.js.map} +0 -0
- /package/{finance-O7WTSZ7W.js.map → finance-7BH57FKM.js.map} +0 -0
- /package/{generate-ERHBA3S5.js.map → generate-5RN37TB2.js.map} +0 -0
- /package/{github-LFJ6JXXJ.js.map → github-V6IISTKM.js.map} +0 -0
- /package/{goal-GFUDKA42.js.map → goal-VHURZA6I.js.map} +0 -0
- /package/{host-4NPMKE4M.js.map → host-FPYIZNEY.js.map} +0 -0
- /package/{logs-IAMPNPZU.js.map → logs-SOU4VJKD.js.map} +0 -0
- /package/{maps-QC6LW3XN.js.map → maps-M743J55Y.js.map} +0 -0
- /package/{model-ZCBZUROI.js.map → model-UP6QUEBW.js.map} +0 -0
- /package/{model-provider-KHT4TJAD.js.map → model-provider-OFR5IFKC.js.map} +0 -0
- /package/{org-PGERW5HL.js.map → org-TMYRDS6T.js.map} +0 -0
- /package/{people-search-KOWVJQ7J.js.map → people-search-PGGRVJE2.js.map} +0 -0
- /package/{phone-UDZRVU4K.js.map → phone-XDSMT3L2.js.map} +0 -0
- /package/{preference-CW4D6H22.js.map → preference-HJZXDNPF.js.map} +0 -0
- /package/{resource-UTBKHQYI.js.map → resource-EPIY47XQ.js.map} +0 -0
- /package/{scrape-HSJGZHJP.js.map → scrape-RARAUZOC.js.map} +0 -0
- /package/{search-E3XYG3EQ.js.map → search-DXXHHWDZ.js.map} +0 -0
- /package/{secret-FHYLUY5C.js.map → secret-AGFBP5RY.js.map} +0 -0
- /package/{slack-KNNFCXQL.js.map → slack-K2QEL2LI.js.map} +0 -0
- /package/{teams-SE2UBCFO.js.map → teams-KIJXDVOL.js.map} +0 -0
- /package/{telegram-MBCYOZOW.js.map → telegram-S5K3IMKH.js.map} +0 -0
- /package/{upgrade-HCODAAIE.js.map → upgrade-6I5DNVPS.js.map} +0 -0
- /package/{variable-VK42DTQ3.js.map → variable-IRTOV55E.js.map} +0 -0
- /package/{video-5HT4OTPO.js.map → video-3ZDBT2PC.js.map} +0 -0
- /package/{weather-JYVT7MJV.js.map → weather-4TPUCJLD.js.map} +0 -0
- /package/{web-4ZYLQGTN.js.map → web-ZK5I2YXJ.js.map} +0 -0
- /package/{web-search-BUSZ7LN5.js.map → web-search-OI6ACM3G.js.map} +0 -0
- /package/{whoami-DD32L4F2.js.map → whoami-FJGFKNBS.js.map} +0 -0
- /package/{workflow-SW7Q4HHX.js.map → workflow-4ODQQIVH.js.map} +0 -0
|
@@ -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-CIALZM7O.js";
|
|
7
7
|
import {
|
|
8
8
|
getZeroConnectorCatalogPermissions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SLUCBVKQ.js";
|
|
10
10
|
import {
|
|
11
11
|
source_default
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M4F24YFV.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-VQ3ILWFQ.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 */]: {
|
|
@@ -468,6 +467,11 @@ var FEATURE_SWITCHES = {
|
|
|
468
467
|
enabled: false,
|
|
469
468
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
470
469
|
},
|
|
470
|
+
["zeroBrowser" /* ZeroBrowser */]: {
|
|
471
|
+
maintainer: "liangyou@vm0.ai",
|
|
472
|
+
description: "Show the Zero Browser command in the Zero CLI.",
|
|
473
|
+
enabled: false
|
|
474
|
+
},
|
|
471
475
|
["composerConnectorPermissions" /* ComposerConnectorPermissions */]: {
|
|
472
476
|
maintainer: "ming@vm0.ai",
|
|
473
477
|
description: "Show the configure-permissions entry in the chat composer connector popover, opening the agent\xD7connector firewall dialog inline.",
|
|
@@ -525,4 +529,4 @@ export {
|
|
|
525
529
|
isFeatureEnabled,
|
|
526
530
|
decodeZeroTokenPayload
|
|
527
531
|
};
|
|
528
|
-
//# sourceMappingURL=chunk-
|
|
532
|
+
//# sourceMappingURL=chunk-X5FAOKYK.js.map
|
|
@@ -0,0 +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: 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,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,I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AM,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":[]}
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
fetchComputerUseScreenshot,
|
|
13
13
|
getComputerUseCommand,
|
|
14
14
|
listComputerUseHosts
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-SLUCBVKQ.js";
|
|
16
|
+
import "./chunk-ITSKDZFI.js";
|
|
17
17
|
import {
|
|
18
18
|
ApiRequestError,
|
|
19
19
|
withErrorHandler
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-M4F24YFV.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-C6VLY2LY.js.map
|
|
@@ -3,14 +3,21 @@ 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-CIALZM7O.js";
|
|
7
7
|
import {
|
|
8
|
+
CALLBACK_PROMPT_PLACEHOLDER,
|
|
9
|
+
addRequestedCallbackSearchParams,
|
|
8
10
|
availableConnectorRefs,
|
|
11
|
+
connectorActionCallbackAvailable,
|
|
12
|
+
connectorActionUrl,
|
|
13
|
+
currentChatSupportsActionCallback,
|
|
9
14
|
findConnectorStatusItem,
|
|
15
|
+
printCallbackActionUrlExample,
|
|
16
|
+
printCallbackTurnInstruction,
|
|
10
17
|
resolveAgentContext,
|
|
11
18
|
resolveManualGrantAuthMethod,
|
|
12
19
|
searchPublicConnectorCatalog
|
|
13
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OQSXOSCD.js";
|
|
14
21
|
import {
|
|
15
22
|
UNKNOWN_PERMISSION_GRANT,
|
|
16
23
|
connectZeroConnectorManualGrant,
|
|
@@ -25,20 +32,20 @@ import {
|
|
|
25
32
|
getZeroCustomConnector,
|
|
26
33
|
listZeroConnectorCatalogStatus,
|
|
27
34
|
listZeroCustomConnectors
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-SLUCBVKQ.js";
|
|
36
|
+
import "./chunk-ITSKDZFI.js";
|
|
30
37
|
import {
|
|
31
38
|
getPlatformOrigin,
|
|
32
39
|
toPlatformUrl
|
|
33
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-AAZBHQPP.js";
|
|
34
41
|
import "./chunk-SB7EZ2ZO.js";
|
|
35
42
|
import {
|
|
36
43
|
ApiRequestError,
|
|
37
44
|
getApiUrl,
|
|
38
45
|
source_default,
|
|
39
46
|
withErrorHandler
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-M4F24YFV.js";
|
|
48
|
+
import "./chunk-X5FAOKYK.js";
|
|
42
49
|
import {
|
|
43
50
|
Command,
|
|
44
51
|
Option
|
|
@@ -75,81 +82,6 @@ function printComputerUsePermissionGuidance() {
|
|
|
75
82
|
);
|
|
76
83
|
}
|
|
77
84
|
|
|
78
|
-
// src/commands/zero/connector/action-url.ts
|
|
79
|
-
init_esm_shims();
|
|
80
|
-
var CALLBACK_PROMPT_PLACEHOLDER = "SOMETHING_AGENT_WANT_TO_BE_CALLBACK";
|
|
81
|
-
function connectorActionCallbackAvailable() {
|
|
82
|
-
return Boolean(process.env.ZERO_CHAT_THREAD_ID?.trim());
|
|
83
|
-
}
|
|
84
|
-
function currentChatThreadId(agentId) {
|
|
85
|
-
const threadId = process.env.ZERO_CHAT_THREAD_ID?.trim();
|
|
86
|
-
const currentAgentId = process.env.ZERO_AGENT_ID?.trim();
|
|
87
|
-
if (!threadId || !currentAgentId || agentId !== currentAgentId) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
return threadId;
|
|
91
|
-
}
|
|
92
|
-
function currentChatSupportsActionCallback(agentId) {
|
|
93
|
-
return currentChatThreadId(agentId) !== null;
|
|
94
|
-
}
|
|
95
|
-
function addCallbackSearchParams(params, threadId, callbackPrompt) {
|
|
96
|
-
params.set("threadId", threadId);
|
|
97
|
-
params.set("callbackPrompt", callbackPrompt);
|
|
98
|
-
}
|
|
99
|
-
function addRequestedCallbackSearchParams(params, callbackPrompt, agentId) {
|
|
100
|
-
if (callbackPrompt === void 0) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const normalizedPrompt = callbackPrompt.trim();
|
|
104
|
-
if (!normalizedPrompt) {
|
|
105
|
-
throw new Error("--callback-prompt cannot be empty");
|
|
106
|
-
}
|
|
107
|
-
const threadId = currentChatThreadId(agentId);
|
|
108
|
-
if (!threadId) {
|
|
109
|
-
throw new Error(
|
|
110
|
-
"--callback-prompt can only target the current Zero web chat thread and agent"
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
addCallbackSearchParams(params, threadId, normalizedPrompt);
|
|
114
|
-
}
|
|
115
|
-
function connectorActionUrl(args) {
|
|
116
|
-
const url = new URL(args.path, args.origin);
|
|
117
|
-
if (args.agentId) {
|
|
118
|
-
url.searchParams.set("agentId", args.agentId);
|
|
119
|
-
}
|
|
120
|
-
return url.toString();
|
|
121
|
-
}
|
|
122
|
-
function callbackActionUrlExample(actionUrl, agentId) {
|
|
123
|
-
const threadId = currentChatThreadId(agentId);
|
|
124
|
-
if (!threadId) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
const url = new URL(actionUrl);
|
|
128
|
-
addCallbackSearchParams(
|
|
129
|
-
url.searchParams,
|
|
130
|
-
threadId,
|
|
131
|
-
CALLBACK_PROMPT_PLACEHOLDER
|
|
132
|
-
);
|
|
133
|
-
return url.toString();
|
|
134
|
-
}
|
|
135
|
-
function printCallbackActionUrlExample(actionUrl, agentId) {
|
|
136
|
-
const callbackUrl = callbackActionUrlExample(actionUrl, agentId);
|
|
137
|
-
if (!callbackUrl) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
console.log("");
|
|
141
|
-
console.log(
|
|
142
|
-
"Or, if this is the only connector or permission action needed, use the callback URL below. After the user completes this action, Zero will automatically start the next round with the callback prompt:"
|
|
143
|
-
);
|
|
144
|
-
console.log(callbackUrl);
|
|
145
|
-
}
|
|
146
|
-
function printCallbackTurnInstruction() {
|
|
147
|
-
console.log("");
|
|
148
|
-
console.log(
|
|
149
|
-
"After sharing this callback URL, end the current turn. When the user completes the action, Zero will automatically start the next round with the callback prompt."
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
85
|
// src/commands/zero/connector/check.ts
|
|
154
86
|
function stripUrlQueryAndFragment(url) {
|
|
155
87
|
const queryIndex = url.indexOf("?");
|
|
@@ -1557,4 +1489,4 @@ var zeroConnectorCommand = new Command().name("connector").description("Manage a
|
|
|
1557
1489
|
export {
|
|
1558
1490
|
zeroConnectorCommand
|
|
1559
1491
|
};
|
|
1560
|
-
//# sourceMappingURL=connector-
|
|
1492
|
+
//# sourceMappingURL=connector-SJF25IFP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/zero/connector/index.ts","../src/commands/zero/connector/check.ts","../src/commands/zero/connector/computer-use-guidance.ts","../src/commands/zero/connector/connect.ts","../src/commands/zero/connector/list.ts","../src/commands/zero/connector/connected-as.ts","../src/commands/zero/connector/search.ts","../src/commands/zero/connector/status.ts","../src/commands/zero/connector/custom/index.ts","../src/commands/zero/connector/permission-request.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { checkConnectorCommand } from \"./check\";\nimport { connectCommand } from \"./connect\";\nimport { listCommand } from \"./list\";\nimport { searchCommand } from \"./search\";\nimport { statusCommand } from \"./status\";\nimport { customConnectorCommand } from \"./custom\";\nimport { permissionRequestCommand } from \"./permission-request\";\n\nexport const zeroConnectorCommand = new Command()\n .name(\"connector\")\n .description(\"Manage and diagnose third-party service connections\")\n .addCommand(checkConnectorCommand)\n .addCommand(customConnectorCommand)\n .addCommand(connectCommand)\n .addCommand(listCommand)\n .addCommand(searchCommand)\n .addCommand(statusCommand)\n .addCommand(permissionRequestCommand);\n","import { Command, Option } from \"commander\";\nimport type { ConnectorRef } from \"@vm0/api-contracts/contracts/connector-identity\";\nimport type {\n ConnectorCheckDiagnosticResult,\n ConnectorCheckPolicy,\n ConnectorCheckRequest,\n} from \"@vm0/api-contracts/contracts/zero-connector-check\";\n\nimport { getApiUrl } from \"../../../lib/api/config\";\nimport {\n diagnoseZeroConnectorCheck,\n getZeroConnector,\n} from \"../../../lib/api/domains/zero-connectors\";\nimport { getZeroAgentUserConnectors } from \"../../../lib/api/domains/zero-agents\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { toPlatformUrl } from \"../doctor/platform-url\";\nimport {\n isComputerUsePermissionTarget,\n printComputerUsePermissionGuidance,\n} from \"./computer-use-guidance\";\nimport {\n CALLBACK_PROMPT_PLACEHOLDER,\n connectorActionUrl,\n currentChatSupportsActionCallback,\n printCallbackActionUrlExample,\n} from \"./action-url\";\n\ninterface CheckConnectorOptions {\n readonly connector?: string;\n readonly envName?: string;\n readonly url?: string;\n readonly method: string;\n readonly checkPermission?: string;\n}\n\ntype ValidatedCheckConnectorOptions = CheckConnectorOptions &\n (\n | { readonly url: string }\n | { readonly url?: undefined; readonly envName: string }\n );\n\ntype ResolvedDiagnostic = Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"resolved\" }\n>;\ntype ResolvedUrlDiagnostic = Extract<\n ResolvedDiagnostic,\n { readonly mode: \"url\" }\n>;\ntype ResolvedEnvironmentDiagnostic = Extract<\n ResolvedDiagnostic,\n { readonly mode: \"environment\" }\n>;\ntype UrlDiagnosticRequest = Extract<\n ConnectorCheckRequest,\n { readonly mode: \"url\" }\n>;\n\ninterface DiagContext {\n readonly environmentNames: readonly string[] | null;\n readonly connectorRef: ConnectorRef;\n readonly label: string;\n readonly connectorAvailable: boolean;\n readonly credentialResolution: \"network-boundary\" | \"none\";\n readonly run: ResolvedDiagnostic[\"run\"];\n readonly platformOrigin: string;\n readonly agentId: string | undefined;\n}\n\nfunction stripUrlQueryAndFragment(url: string): string {\n const queryIndex = url.indexOf(\"?\");\n const fragmentIndex = url.indexOf(\"#\");\n let end = url.length;\n if (queryIndex !== -1) end = Math.min(end, queryIndex);\n if (fragmentIndex !== -1) end = Math.min(end, fragmentIndex);\n return url.slice(0, end);\n}\n\nfunction rawUrlAuthorityHasUserinfo(url: string): boolean {\n const schemeEnd = url.indexOf(\"://\");\n if (schemeEnd === -1) return false;\n\n const authorityStart = schemeEnd + 3;\n let authorityEnd = url.length;\n for (const delimiter of [\"/\", \"?\", \"#\"]) {\n const delimiterIndex = url.indexOf(delimiter, authorityStart);\n if (delimiterIndex !== -1) {\n authorityEnd = Math.min(authorityEnd, delimiterIndex);\n }\n }\n return url.slice(authorityStart, authorityEnd).includes(\"@\");\n}\n\nfunction shellQuoteArg(value: string): string {\n return `'${value.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\nfunction connectorSelectionCommand(\n url: string,\n method: string,\n connectorRef: string,\n): string {\n const args = [\n `--url ${shellQuoteArg(url)}`,\n `--connector ${shellQuoteArg(connectorRef)}`,\n ];\n if (method !== \"GET\") {\n args.push(`--method ${shellQuoteArg(method)}`);\n }\n return `zero connector check ${args.join(\" \")}`;\n}\n\nfunction rawPathFromUrl(url: string): string | undefined {\n const sanitizedUrl = stripUrlQueryAndFragment(url);\n const schemeEnd = sanitizedUrl.indexOf(\"://\");\n if (schemeEnd === -1) return undefined;\n\n const pathStart = sanitizedUrl.indexOf(\"/\", schemeEnd + 3);\n return pathStart === -1 ? \"/\" : sanitizedUrl.slice(pathStart);\n}\n\nfunction isComputerUseCheckTarget(opts: CheckConnectorOptions): boolean {\n return isComputerUsePermissionTarget({\n connectorRef: opts.connector ?? \"\",\n path: opts.url === undefined ? undefined : rawPathFromUrl(opts.url),\n permission: opts.checkPermission,\n });\n}\n\nfunction validateCheckConnectorOptions(\n opts: CheckConnectorOptions,\n command: Command,\n): asserts opts is ValidatedCheckConnectorOptions {\n const hasUrl = opts.url !== undefined;\n // Reject embedded credentials before the diagnostic request leaves the client.\n if (opts.url !== undefined && rawUrlAuthorityHasUserinfo(opts.url)) {\n throw unsafeInputError(\"invalid-url\");\n }\n if (opts.connector !== undefined && !hasUrl) {\n throw new Error(\n \"--connector can only be used with --url. Add --url <URL> or remove --connector.\",\n );\n }\n if (opts.checkPermission !== undefined && hasUrl) {\n throw new Error(\n \"--check-permission cannot be used with --url because the permission is derived from the request. Remove --check-permission.\",\n );\n }\n if (opts.checkPermission?.trim() === \"\") {\n throw new Error(\"--check-permission requires a non-empty permission name.\");\n }\n if (!hasUrl && command.getOptionValueSource(\"method\") === \"cli\") {\n throw new Error(\n \"--method can only be used with --url. Add --url <URL> or remove --method.\",\n );\n }\n if (opts.envName === undefined && !hasUrl) {\n throw new Error(\n \"Either --env-name or --url is required. Use --help for usage.\",\n );\n }\n}\n\nfunction buildDiagnosticRequest(\n opts: ValidatedCheckConnectorOptions,\n method: string,\n): ConnectorCheckRequest {\n if (opts.url !== undefined) {\n return {\n mode: \"url\",\n method,\n url: stripUrlQueryAndFragment(opts.url),\n ...(opts.connector !== undefined ? { connectorRef: opts.connector } : {}),\n ...(opts.envName !== undefined ? { environmentName: opts.envName } : {}),\n };\n }\n\n return {\n mode: \"environment\",\n environmentName: opts.envName,\n ...(opts.checkPermission !== undefined\n ? { permission: opts.checkPermission }\n : {}),\n };\n}\n\nfunction requireUrlRequest(\n request: ConnectorCheckRequest,\n): UrlDiagnosticRequest {\n if (request.mode !== \"url\") {\n throw new Error(\n \"Connector diagnostic returned a URL-only outcome for an environment request.\",\n );\n }\n return request;\n}\n\nfunction requestedEnvironmentName(request: ConnectorCheckRequest): string {\n if (request.environmentName === undefined) {\n throw new Error(\n \"Connector diagnostic returned an environment outcome without an environment name.\",\n );\n }\n return request.environmentName;\n}\n\nfunction unsafeInputError(\n reason: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"unsafe-input\" }\n >[\"reason\"],\n): Error {\n switch (reason) {\n case \"invalid-method\":\n return new Error(\n \"connector check requires --method to be a supported HTTP method.\",\n );\n case \"invalid-url\":\n return new Error(\n \"connector check requires --url to be a valid absolute http or https URL.\",\n );\n case \"unsafe-path\":\n return new Error(\n \"connector check cannot diagnose unsafe URL paths because they are blocked before permission policy evaluation.\",\n );\n }\n}\n\nfunction ambiguousConnectorError(\n request: UrlDiagnosticRequest,\n result: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"ambiguous\" }\n >,\n): Error {\n const candidates = [...result.candidates].sort((left, right) => {\n return left.connectorRef.localeCompare(right.connectorRef);\n });\n const commands = candidates.map((candidate) => {\n return ` ${connectorSelectionCommand(request.url, request.method, candidate.connectorRef)}`;\n });\n return new Error(\n `Multiple connectors match ${request.method} ${request.url}: ${candidates\n .map((candidate) => {\n return candidate.connectorRef;\n })\n .join(\", \")}\\nSelect one explicitly:\\n${commands.join(\"\\n\")}`,\n );\n}\n\nfunction unknownConnectorError(request: ConnectorCheckRequest): Error {\n if (request.mode === \"url\" && request.connectorRef !== undefined) {\n return new Error(\n `Unknown connector type: ${request.connectorRef}\\nRun: zero connector search ${shellQuoteArg(request.connectorRef)}`,\n );\n }\n return new Error(\"The requested connector is unknown.\");\n}\n\nfunction noMatchError(\n result: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"no-match\" }\n >,\n): Error {\n return new Error(\n result.scope === \"run\"\n ? \"No connector found for provided URL — no connector configured for the current run matches this URL\"\n : \"No connector found for provided URL — no registered connector base URL matches this URL\",\n );\n}\n\nfunction connectorMismatchError(\n request: UrlDiagnosticRequest,\n result: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"connector-mismatch\" }\n >,\n): Error {\n const requestedRef = request.connectorRef ?? \"the requested connector\";\n return new Error(\n `Connector ${requestedRef} does not own ${request.method} ${request.url}; the matching connector is ${result.connector.connectorRef}\\nRun: ${connectorSelectionCommand(request.url, request.method, result.connector.connectorRef)}`,\n );\n}\n\nfunction environmentNotOwnedError(\n request: ConnectorCheckRequest,\n result: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"environment-not-owned\" }\n >,\n): Error {\n const environmentName = requestedEnvironmentName(request);\n return new Error(\n `${environmentName} is not an environment name for the ${result.connector.label} connector. Remove --env-name to use the matched route metadata.`,\n );\n}\n\nfunction environmentNotUsedError(\n request: ConnectorCheckRequest,\n result: Extract<\n ConnectorCheckDiagnosticResult,\n { readonly outcome: \"environment-not-used\" }\n >,\n): Error {\n const environmentName = requestedEnvironmentName(request);\n return new Error(\n `${environmentName} is not used by the matched API route. Expected one of: ${result.environmentNames.join(\", \") || \"none\"}. Remove --env-name to use the matched route metadata.`,\n );\n}\n\nfunction resolvedDiagnostic(\n request: ConnectorCheckRequest,\n result: ConnectorCheckDiagnosticResult,\n): ResolvedDiagnostic {\n switch (result.outcome) {\n case \"resolved\":\n return result;\n case \"unsafe-input\":\n throw unsafeInputError(result.reason);\n case \"unknown-connector\":\n throw unknownConnectorError(request);\n case \"unknown-environment\":\n throw new Error(\n `Unknown environment name: ${requestedEnvironmentName(request)} — not managed by any connector`,\n );\n case \"no-match\":\n throw noMatchError(result);\n case \"ambiguous\":\n throw ambiguousConnectorError(requireUrlRequest(request), result);\n case \"connector-mismatch\":\n throw connectorMismatchError(requireUrlRequest(request), result);\n case \"environment-not-owned\":\n throw environmentNotOwnedError(request, result);\n case \"environment-not-used\":\n throw environmentNotUsedError(request, result);\n case \"unresolved-dynamic-base\":\n throw new Error(\n `No authoritative ${result.connector.label} base URL is available for this diagnostic. Verify the ${result.connector.connectorRef} connector configuration for the affected context and retry.`,\n );\n case \"run-context-unavailable\":\n throw new Error(\n \"The current run context is unavailable for connector diagnosis. Retry from an active run or start a new run.\",\n );\n }\n}\n\nfunction printDiagnosticSummary(\n request: ConnectorCheckRequest,\n result: ResolvedDiagnostic,\n): void {\n if (result.mode === \"url\") {\n const urlRequest = requireUrlRequest(request);\n console.log(\n `URL ${urlRequest.url} matches the ${result.connector.label} connector (type: ${result.connector.connectorRef}).`,\n );\n console.log(` Matched base URL: ${result.base}`);\n console.log(` Relative path: ${result.relativePath}`);\n if (result.environmentNames === null) {\n console.log(\" Environment names: unavailable\");\n } else {\n console.log(\n ` Environment names: [${result.environmentNames.join(\", \")}]`,\n );\n }\n return;\n }\n\n console.log(\n `${result.environmentName} is managed by the ${result.connector.label} connector (type: ${result.connector.connectorRef}).`,\n );\n}\n\nfunction diagnosticEnvironmentNames(\n result: ResolvedDiagnostic,\n): readonly string[] | null {\n return result.mode === \"url\"\n ? result.environmentNames\n : [result.environmentName];\n}\n\nfunction printConnectorConnectionStatus(\n ctx: DiagContext,\n isConnected: boolean,\n isExpired: boolean,\n hasPermission: boolean,\n): void {\n console.log(\n \"### 2a: Connector status (user must configure via OAuth login or API key)\",\n );\n console.log(\"\");\n if (!ctx.connectorAvailable) {\n console.log(\n `The ${ctx.label} connector is not available for this account.`,\n );\n } else if (!isConnected) {\n console.log(`The ${ctx.label} connector is not connected.`);\n if (ctx.agentId && hasPermission) {\n const connectUrl = connectorActionUrl({\n origin: ctx.platformOrigin,\n path: `/connectors/${ctx.connectorRef}/connect`,\n agentId: ctx.agentId,\n });\n console.log(`Connect it at: [Connect ${ctx.label}](${connectUrl})`);\n printCallbackActionUrlExample(connectUrl, ctx.agentId);\n } else if (!ctx.agentId) {\n const connectUrl = connectorActionUrl({\n origin: ctx.platformOrigin,\n path: `/connectors/${ctx.connectorRef}/connect`,\n });\n console.log(`Connect it at: [Connect ${ctx.label}](${connectUrl})`);\n }\n } else if (isExpired) {\n const url = connectorActionUrl({\n origin: ctx.platformOrigin,\n path: `/connectors/${ctx.connectorRef}/connect`,\n agentId: ctx.agentId,\n });\n console.log(\n `The ${ctx.label} connector is connected but has expired and needs to be reconnected.`,\n );\n console.log(`Reconnect it at: [Reconnect ${ctx.label}](${url})`);\n printCallbackActionUrlExample(url, ctx.agentId);\n } else {\n console.log(`The ${ctx.label} connector is connected and active.`);\n }\n console.log(\"\");\n}\n\nfunction printAgentAuthorizationStatus(\n ctx: DiagContext,\n isConnected: boolean,\n isExpired: boolean,\n hasPermission: boolean,\n): void {\n if (!ctx.agentId) {\n console.log(\"ZERO_AGENT_ID is not set — cannot check agent authorization.\");\n } else if (isExpired) {\n console.log(\n `Skipped — agent authorization can only be checked once the ${ctx.label} connector is reconnected (see 2a).`,\n );\n } else if (hasPermission) {\n console.log(\n isConnected\n ? `The ${ctx.label} connector is authorized for this agent.`\n : `The ${ctx.label} connector is authorized for this agent, but it is not connected.`,\n );\n } else {\n const url = connectorActionUrl({\n origin: ctx.platformOrigin,\n path: `/connectors/${ctx.connectorRef}/authorize`,\n agentId: ctx.agentId,\n });\n console.log(\n isConnected\n ? `The ${ctx.label} connector is not authorized for this agent (${ctx.agentId}).`\n : `The ${ctx.label} connector needs to be connected and authorized for this agent (${ctx.agentId}).`,\n );\n console.log(`Authorize it at: [Authorize ${ctx.label}](${url})`);\n printCallbackActionUrlExample(url, ctx.agentId);\n }\n}\n\nfunction printConnectorAuthorizationStatus(\n ctx: DiagContext,\n isConnected: boolean,\n isExpired: boolean,\n hasPermission: boolean,\n): void {\n console.log(\n \"### 2b: Agent authorization (user must authorize agent to use this connector)\",\n );\n console.log(\"\");\n if (!ctx.connectorAvailable) {\n console.log(\n `Skipped — the ${ctx.label} connector is not available for this account.`,\n );\n } else {\n printAgentAuthorizationStatus(ctx, isConnected, isExpired, hasPermission);\n }\n console.log(\n `This run uses agent-scoped connector authorization for ${ctx.label} access.`,\n );\n console.log(\"\");\n}\n\nfunction checkEnvironmentNames(ctx: DiagContext): void {\n console.log(\"## Step 1: Sandbox environment name\");\n console.log(\"\");\n if (ctx.environmentNames === null) {\n console.log(\n \"Environment metadata is unavailable for this run's sanitized firewall entry, so no environment name was guessed.\",\n );\n console.log(\"\");\n return;\n }\n if (ctx.environmentNames.length === 0) {\n console.log(\n \"The matched API route does not use a sandbox environment name.\",\n );\n console.log(\"\");\n return;\n }\n\n let environmentPresent = false;\n for (const environmentName of ctx.environmentNames) {\n const present = Boolean(process.env[environmentName]);\n environmentPresent ||= present;\n console.log(\n `Checking process.env.${environmentName}: ${present ? \"present\" : \"not present\"}`,\n );\n }\n if (environmentPresent) {\n console.log(\n \"At least one connector value is present in the sandbox environment. These values may be non-secret connector settings or credential placeholders; real credentials are never injected and are resolved at the network boundary for registered base URLs.\",\n );\n } else {\n console.log(\n \"No value found for these environment names. Note: credential replacement at the network boundary is independent of these names — the proxy injects auth headers based on the destination URL.\",\n );\n }\n console.log(\"\");\n}\n\nasync function checkConnectorStatus(ctx: DiagContext): Promise<{\n readonly isConnected: boolean;\n readonly isExpired: boolean;\n readonly hasPermission: boolean;\n}> {\n console.log(\"## Step 2: Connector configuration\");\n console.log(\"\");\n console.log(\n \"A Connector holds the real credentials (OAuth tokens or API keys) for an external service. These credentials are never injected into the sandbox. Instead, when the sandbox sends an HTTP request to a base URL registered by the Connector, the network boundary intercepts the request and replaces the auth headers with real credentials. For this to work, three conditions must be met:\",\n );\n console.log(\"\");\n\n const [connector, enabledTypes] = await Promise.all([\n getZeroConnector(ctx.connectorRef),\n ctx.agentId\n ? getZeroAgentUserConnectors(ctx.agentId)\n : Promise.resolve(null),\n ]);\n\n const isConnected = connector !== null;\n const isExpired = connector?.connectionStatus === \"reconnect-required\";\n const hasPermission =\n enabledTypes !== null && enabledTypes.includes(ctx.connectorRef);\n\n printConnectorConnectionStatus(ctx, isConnected, isExpired, hasPermission);\n printConnectorAuthorizationStatus(ctx, isConnected, isExpired, hasPermission);\n\n return { isConnected, isExpired, hasPermission };\n}\n\nfunction checkConnectorDomains(ctx: DiagContext): boolean | null {\n console.log(\n \"### 2c: Registered base URLs (credential replacement only applies to URLs matching these prefixes)\",\n );\n console.log(\"\");\n\n switch (ctx.run.status) {\n case \"not-scoped\":\n console.log(\n \"This diagnostic is not scoped to a run — skipping the run base URL check.\",\n );\n console.log(\"\");\n return null;\n case \"not-configured\":\n console.log(\n `No configuration found for the ${ctx.label} connector in this run.`,\n );\n console.log(\n \"This means no base URLs are registered for credential replacement for this connector.\",\n );\n console.log(\"\");\n return false;\n case \"configured\":\n console.log(\n `The ${ctx.label} connector is configured for this run with the following base URLs:`,\n );\n for (const base of ctx.run.bases) {\n console.log(` - ${base}`);\n }\n console.log(\"\");\n if (ctx.credentialResolution === \"network-boundary\") {\n console.log(\n \"Credentials are resolved at the network boundary for requests matching these registered base URLs.\",\n );\n }\n console.log(\"\");\n return true;\n }\n}\n\nfunction printUnavailablePolicy(\n policy: Extract<\n ConnectorCheckPolicy,\n {\n readonly outcome: \"unavailable\";\n }\n >,\n): void {\n switch (policy.basis) {\n case \"not-run-scoped\":\n console.log(\n \"Result: Permission policy is unavailable because this diagnostic is not scoped to a run.\",\n );\n return;\n case \"policies-unavailable\":\n console.log(\n \"Result: Network policies are unavailable for this run, so the permission status cannot be determined.\",\n );\n return;\n case \"connector-not-configured\":\n console.log(\n \"Result: The connector is not configured for this run, so requests cannot receive credentials.\",\n );\n return;\n }\n}\n\nfunction printNamedPolicyResult(\n connectorRef: string,\n permission: string,\n policy: ConnectorCheckPolicy,\n agentId: string | undefined,\n): void {\n switch (policy.outcome) {\n case \"allow\": {\n switch (policy.basis) {\n case \"allow-list\":\n console.log(\n `Result: \"${permission}\" is in the allow list — allowed.`,\n );\n return;\n case \"not-blocked\":\n console.log(\n `Result: \"${permission}\" is not blocked by the deny or ask list — allowed.`,\n );\n return;\n case \"no-policy\":\n console.log(\n `Result: No policy entry exists for this connector — \"${permission}\" is allowed.`,\n );\n return;\n case \"unknown-policy\":\n console.log(\n `Result: The server policy allows \"${permission}\" through the unknown-endpoint policy.`,\n );\n return;\n }\n break;\n }\n case \"deny\":\n console.log(\n policy.basis === \"deny-list\"\n ? `Result: \"${permission}\" is in the deny list — denied.`\n : `Result: The unknown-endpoint policy denies \"${permission}\".`,\n );\n printPermissionRequestCommands(\n connectorRef,\n permission,\n agentId,\n \"To request this permission, run\",\n );\n return;\n case \"ask\":\n console.log(\n policy.basis === \"ask-list\"\n ? `Result: \"${permission}\" is in the ask list — blocked until approval.`\n : `Result: The unknown-endpoint policy blocks \"${permission}\" until approval.`,\n );\n printPermissionRequestCommands(\n connectorRef,\n permission,\n agentId,\n \"To request this permission, run\",\n );\n return;\n case \"unavailable\":\n printUnavailablePolicy(policy);\n return;\n }\n}\n\nfunction permissionRequestCommand(\n connectorRef: string,\n permission: string,\n): string {\n return `zero connector permission-request ${connectorRef} --permission ${permission}`;\n}\n\nfunction printPermissionRequestCommands(\n connectorRef: string,\n permission: string,\n agentId: string | undefined,\n introduction: string,\n): void {\n const command = permissionRequestCommand(connectorRef, permission);\n console.log(`${introduction}: ${command}`);\n if (!currentChatSupportsActionCallback(agentId)) {\n return;\n }\n\n console.log(\"\");\n console.log(\n \"Or, if this is the only connector or permission action needed, run the callback command below. After the user completes this action, Zero will automatically start the next round with the callback prompt:\",\n );\n console.log(`${command} --callback-prompt \"${CALLBACK_PROMPT_PLACEHOLDER}\"`);\n}\n\nfunction printUnknownEndpointPolicy(\n connectorRef: string,\n policy: ConnectorCheckPolicy,\n agentId: string | undefined,\n): void {\n switch (policy.outcome) {\n case \"allow\":\n console.log(\n policy.basis === \"no-policy\"\n ? \"Result: No policy entry exists for this connector, so the request is allowed.\"\n : \"Result: No permission matched. The unknown endpoint policy allows this request.\",\n );\n return;\n case \"deny\":\n console.log(\n \"Result: No permission matched. The unknown endpoint policy denies this request.\",\n );\n printPermissionRequestCommands(\n connectorRef,\n \"__unknown__\",\n agentId,\n \"To request access to unknown endpoints, run\",\n );\n return;\n case \"ask\":\n console.log(\n \"Result: No permission matched. The unknown endpoint policy requires approval.\",\n );\n printPermissionRequestCommands(\n connectorRef,\n \"__unknown__\",\n agentId,\n \"To request access to unknown endpoints, run\",\n );\n return;\n case \"unavailable\":\n printUnavailablePolicy(policy);\n return;\n }\n}\n\nfunction printUrlPermissionDiagnostic(\n result: ResolvedUrlDiagnostic,\n agentId: string | undefined,\n): void {\n console.log(\"## Step 3: Permission policy check (auto-detected from URL)\");\n console.log(\"\");\n console.log(\n `Matching ${result.method} ${result.relativePath} (relative to base URL ${result.base}) against the ${result.connector.label} connector's permission rules.`,\n );\n console.log(\"\");\n\n if (result.permission.kind === \"matched\") {\n console.log(\n `Matched permissions: [${result.permission.permissions\n .map((permission) => {\n return permission.name;\n })\n .join(\", \")}]`,\n );\n console.log(\"\");\n for (const permission of result.permission.permissions) {\n printNamedPolicyResult(\n result.connector.connectorRef,\n permission.name,\n permission.policy,\n agentId,\n );\n }\n } else {\n console.log(\n `No named permission matches ${result.method} ${result.relativePath}. This request falls through to the unknown-endpoint policy.`,\n );\n console.log(\"\");\n printUnknownEndpointPolicy(\n result.connector.connectorRef,\n result.permission.policy,\n agentId,\n );\n }\n console.log(\"\");\n}\n\nfunction printEnvironmentPermissionDiagnostic(\n result: ResolvedEnvironmentDiagnostic,\n permissionName: string | undefined,\n agentId: string | undefined,\n): void {\n if (result.permission === null) {\n return;\n }\n if (permissionName === undefined) {\n throw new Error(\n \"Connector diagnostic returned a permission outcome without a requested permission.\",\n );\n }\n console.log(\"## Step 3: Permission policy check\");\n console.log(\"\");\n console.log(\n `Checking permission: \"${permissionName}\" for the ${result.connector.label} connector.`,\n );\n console.log(\"\");\n printNamedPolicyResult(\n result.connector.connectorRef,\n permissionName,\n result.permission,\n agentId,\n );\n console.log(\"\");\n}\n\nfunction printRediagnoseHint(\n opts: CheckConnectorOptions,\n method: string,\n): void {\n const args: string[] = [];\n if (opts.url !== undefined) {\n args.push(`--url ${shellQuoteArg(stripUrlQueryAndFragment(opts.url))}`);\n if (opts.connector !== undefined) {\n args.push(`--connector ${shellQuoteArg(opts.connector)}`);\n }\n if (opts.envName !== undefined) {\n args.push(`--env-name ${shellQuoteArg(opts.envName)}`);\n }\n if (method !== \"GET\") {\n args.push(`--method ${shellQuoteArg(method)}`);\n }\n } else if (opts.envName !== undefined) {\n args.push(`--env-name ${shellQuoteArg(opts.envName)}`);\n }\n if (opts.checkPermission !== undefined) {\n args.push(`--check-permission ${shellQuoteArg(opts.checkPermission)}`);\n }\n console.log(\n `To re-diagnose after changes, run: zero connector check ${args.join(\" \")}`,\n );\n}\n\nexport const checkConnectorCommand = new Command()\n .name(\"check\")\n .description(\n \"Diagnose connector health: environment names, connector configuration, and permission policies\",\n )\n .addOption(\n new Option(\n \"--env-name <ENV_NAME>\",\n \"The connector environment name to check (e.g. GITHUB_TOKEN)\",\n ),\n )\n .addOption(\n new Option(\n \"--url <URL>\",\n \"A full URL to diagnose — matches connector ownership, route environment names, and permission (e.g. https://api.github.com/repos/owner/repo)\",\n ),\n )\n .addOption(\n new Option(\n \"--connector <type>\",\n \"Select the connector when multiple connectors own the same URL route\",\n ),\n )\n .addOption(\n new Option(\n \"--method <METHOD>\",\n \"HTTP method to use when matching permissions with --url\",\n ).default(\"GET\"),\n )\n .addOption(\n new Option(\n \"--check-permission <name>\",\n \"Check whether a specific permission is allowed or denied (e.g. contents:read)\",\n ),\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n zero connector check --env-name GITHUB_TOKEN\n zero connector check --url https://api.github.com/repos/owner/repo\n zero connector check --url https://api.accounts.nintendo.com/2.0.0/users/me --connector nintendo-store\n zero connector check --url https://slack.com/api/chat.postMessage --method POST\n zero connector check --env-name SLACK_TOKEN --check-permission chat:write\n\nHow connectors work:\n A Connector holds the real credentials for an external service. These credentials\n are never injected into the sandbox. Instead, when the sandbox sends an HTTP\n request to a base URL registered by the Connector, the network boundary intercepts\n the request and replaces the auth headers with real credentials.\n\n This command checks each part of that pipeline and reports what it finds.`,\n )\n .action(\n withErrorHandler(async (opts: CheckConnectorOptions, command: Command) => {\n validateCheckConnectorOptions(opts, command);\n if (isComputerUseCheckTarget(opts)) {\n printComputerUsePermissionGuidance();\n return;\n }\n const method = opts.method.toUpperCase();\n const request = buildDiagnosticRequest(opts, method);\n const diagnostic = await diagnoseZeroConnectorCheck(request);\n const result = resolvedDiagnostic(request, diagnostic);\n\n printDiagnosticSummary(request, result);\n console.log(\"\");\n\n const platformUrl = toPlatformUrl(await getApiUrl());\n const ctx: DiagContext = {\n environmentNames: diagnosticEnvironmentNames(result),\n connectorRef: result.connector.connectorRef,\n label: result.connector.label,\n connectorAvailable: result.connector.visibility === \"available\",\n credentialResolution: result.connector.credentialResolution,\n run: result.run,\n platformOrigin: platformUrl.origin,\n agentId: process.env.ZERO_AGENT_ID || undefined,\n };\n\n checkEnvironmentNames(ctx);\n const { isConnected, isExpired, hasPermission } =\n await checkConnectorStatus(ctx);\n const configuredForRun = checkConnectorDomains(ctx);\n\n if (configuredForRun === false) {\n console.log(\n `Steps 1-2 summary: The ${ctx.label} connector is not configured for this run. Check the agent authorization settings, then start a new run after updating them.`,\n );\n } else if (isConnected && !isExpired && hasPermission) {\n console.log(\n `Steps 1-2 summary: The ${ctx.label} connector is connected, active, and authorized. Outbound requests to the registered base URLs will have credentials injected at the network boundary.`,\n );\n }\n console.log(\"\");\n\n if (result.mode === \"url\") {\n printUrlPermissionDiagnostic(result, ctx.agentId);\n } else {\n printEnvironmentPermissionDiagnostic(\n result,\n request.mode === \"environment\" ? request.permission : undefined,\n ctx.agentId,\n );\n }\n\n printRediagnoseHint(opts, method);\n }),\n );\n","const COMPUTER_USE_CONNECTOR_REF = \"computer-use\";\nconst COMPUTER_USE_CAPABILITY = \"computer-use:write\";\nconst COMPUTER_USE_PATH_PREFIX = \"/computer-use\";\nconst COMPUTER_USE_PATH_PREFIX_WITH_SLASH = `${COMPUTER_USE_PATH_PREFIX}/`;\n\ninterface ComputerUsePermissionTarget {\n readonly connectorRef: string;\n readonly path?: string;\n readonly permission?: string;\n}\n\nexport function isComputerUsePermissionTarget(\n target: ComputerUsePermissionTarget,\n): boolean {\n return (\n target.connectorRef === COMPUTER_USE_CONNECTOR_REF ||\n target.permission === COMPUTER_USE_CAPABILITY ||\n target.path === COMPUTER_USE_PATH_PREFIX ||\n target.path?.startsWith(COMPUTER_USE_PATH_PREFIX_WITH_SLASH) === true\n );\n}\n\nexport function printComputerUsePermissionGuidance(): void {\n console.log(\"Computer Use access is not managed as a connector permission.\");\n console.log(\n \"The current run token needs computer-use:write, which is issued only when a Zero Desktop Computer Use host is selected for the chat or thread before the run starts.\",\n );\n console.log(\n \"Open Zero Desktop, make sure Computer Use is online, select the Computer Use host for this chat/thread, then start a new run. Existing run tokens cannot be upgraded in place.\",\n );\n console.log(\n \"Run `zero whoami` to confirm whether the current ZERO_TOKEN includes computer-use:write.\",\n );\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport {\n connectZeroConnectorManualGrant,\n listZeroConnectorCatalogStatus,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport {\n availableConnectorRefs,\n findConnectorStatusItem,\n resolveManualGrantAuthMethod,\n} from \"./public-catalog\";\n\ninterface ConnectOptions {\n readonly authMethod?: string;\n readonly value?: readonly string[];\n readonly json?: boolean;\n}\n\nfunction collectValue(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nfunction parseConnectorValues(rawValues: readonly string[] | undefined) {\n if (!rawValues || rawValues.length === 0) {\n throw new Error(\"At least one --value NAME=VALUE is required\", {\n cause: new Error(\n \"Example: zero connector connect zendesk --value apiToken=token\",\n ),\n });\n }\n\n const values: Record<string, string> = {};\n for (const rawValue of rawValues) {\n const separatorIndex = rawValue.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new Error(\"Invalid --value format\", {\n cause: new Error(\"Use --value NAME=VALUE\"),\n });\n }\n\n const name = rawValue.slice(0, separatorIndex);\n if (!name.trim()) {\n throw new Error(\"Invalid --value format\", {\n cause: new Error(\"Field name cannot be empty\"),\n });\n }\n\n values[name] = rawValue.slice(separatorIndex + 1);\n }\n\n return values;\n}\n\nexport const connectCommand = new Command()\n .name(\"connect\")\n .description(\"Connect a connector with manual grant values\")\n .argument(\"<type>\", \"Connector type (e.g., zendesk)\")\n .option(\"--auth-method <method>\", \"Connector auth method to use\")\n .option(\n \"--value <name=value>\",\n \"Connector field value; repeat for multiple fields\",\n collectValue,\n [],\n )\n .option(\"--json\", \"Print the connector response as JSON\")\n .action(\n withErrorHandler(async (type: string, options: ConnectOptions) => {\n const values = parseConnectorValues(options.value);\n const catalog = await listZeroConnectorCatalogStatus();\n const connectorMetadata = findConnectorStatusItem(\n catalog.connectors,\n type,\n );\n if (!connectorMetadata) {\n throw new Error(`Unknown or unavailable connector: ${type}`, {\n cause: new Error(\n `Available connectors: ${availableConnectorRefs(catalog.connectors)}`,\n ),\n });\n }\n\n const authMethod = resolveManualGrantAuthMethod(\n connectorMetadata,\n options.authMethod,\n );\n const connector = await connectZeroConnectorManualGrant(\n connectorMetadata.connectorRef,\n authMethod.id,\n values,\n );\n\n if (options.json) {\n console.log(JSON.stringify(connector, null, 2));\n return;\n }\n\n console.log(chalk.green(`✓ ${connectorMetadata.label} connected`));\n console.log(chalk.dim(` Type: ${connector.type}`));\n console.log(chalk.dim(` Auth Method: ${connector.authMethod}`));\n console.log(chalk.dim(` Run: zero connector status ${connector.type}`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { padEndAnsi, renderConnectedAsCell, stripAnsi } from \"./connected-as\";\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List all connectors and their status\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .action(\n withErrorHandler(async (options: { agent?: string }) => {\n const [{ connectors }, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n\n const allTypes = connectors.map((connector) => {\n return connector.connectorRef;\n });\n\n const typeWidth = Math.max(\n 4,\n ...allTypes.map((t) => {\n return t.length;\n }),\n );\n\n const connectedAsHeader = \"CONNECTED AS\";\n const connectedCells = connectors.map((connector) => {\n return renderConnectedAsCell(connector);\n });\n const connectedAsWidth = Math.max(\n connectedAsHeader.length,\n ...connectedCells.map((c) => {\n return stripAnsi(c).length;\n }),\n );\n\n const authorizedHeader = agentCtx\n ? `AUTHORIZED FOR ${agentCtx.displayName}`\n : null;\n\n // Print header\n const headerParts = [\n \"TYPE\".padEnd(typeWidth),\n connectedAsHeader.padEnd(connectedAsWidth),\n ];\n if (authorizedHeader) headerParts.push(authorizedHeader);\n console.log(chalk.dim(headerParts.join(\" \")));\n\n // Print rows\n for (let i = 0; i < allTypes.length; i++) {\n const type = allTypes[i]!;\n const connectedCell = padEndAnsi(connectedCells[i]!, connectedAsWidth);\n const parts = [type.padEnd(typeWidth), connectedCell];\n if (agentCtx) {\n parts.push(\n agentCtx.authorizedTypes.has(type)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(parts.join(\" \"));\n }\n }),\n );\n","import chalk from \"chalk\";\nimport type { PublicConnectorStatus } from \"./public-catalog\";\n\nfunction renderIdentity(connector: PublicConnectorStatus): string {\n if (connector.connection?.externalUsername) {\n return `@${connector.connection.externalUsername}`;\n }\n if (connector.connection?.externalEmail)\n return connector.connection.externalEmail;\n return \"-\";\n}\n\nexport function renderConnectedAsCell(\n connector: PublicConnectorStatus | undefined,\n): string {\n if (!connector || connector.connectionStatus === \"not-connected\") {\n return chalk.dim(\"(not connected)\");\n }\n const identity = renderIdentity(connector);\n if (connector.connectionStatus === \"reconnect-required\") {\n return chalk.yellow(`${identity} (reconnect needed)`);\n }\n if (\n connector.scopeMismatch ||\n connector.connectionStatus === \"scope-mismatch\"\n ) {\n return chalk.yellow(`${identity} (permissions update available)`);\n }\n return identity;\n}\n\nconst ESC = \"\\u001b\";\nconst ANSI_PATTERN = new RegExp(`${ESC}\\\\[[0-9;]*m`, \"g\");\n\nexport function stripAnsi(s: string): string {\n return s.replace(ANSI_PATTERN, \"\");\n}\n\nexport function padEndAnsi(s: string, width: number): string {\n const visible = stripAnsi(s).length;\n return s + \" \".repeat(Math.max(0, width - visible));\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { padEndAnsi, renderConnectedAsCell, stripAnsi } from \"./connected-as\";\nimport { searchPublicConnectorCatalog } from \"./public-catalog\";\n\nconst DEFAULT_LIMIT = 5;\nconst EXACT_MATCH_THRESHOLD = 80;\n\nfunction parseLimit(raw: string): number {\n const trimmed = raw.trim();\n const n = Number(trimmed);\n if (!/^\\d+$/.test(trimmed) || !Number.isSafeInteger(n) || n <= 0) {\n throw new Error(`--limit must be a positive integer, got \"${raw}\".`);\n }\n return n;\n}\n\nexport const searchCommand = new Command()\n .name(\"search\")\n .description(\n \"Search connectors by type, label, category, generation type, or tag\",\n )\n .argument(\"<keyword>\", \"Search keyword (case-insensitive)\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .option(\n \"--limit <n>\",\n `Maximum number of results to display (default ${DEFAULT_LIMIT})`,\n parseLimit,\n DEFAULT_LIMIT,\n )\n .action(\n withErrorHandler(\n async (keyword: string, options: { agent?: string; limit: number }) => {\n const trimmed = keyword.trim();\n if (!trimmed) {\n throw new Error(\"Keyword cannot be empty.\");\n }\n\n const [{ connectors }, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n const { results, total } = searchPublicConnectorCatalog(\n connectors,\n trimmed,\n options.limit,\n );\n\n if (results.length === 0) {\n console.log(\"No matches found.\");\n return;\n }\n\n const topScore = results[0]!.score;\n if (topScore < EXACT_MATCH_THRESHOLD) {\n console.log(\"No exact match. Showing closest:\");\n }\n if (total > options.limit) {\n console.log(`Too many results (top ${options.limit} of ${total}):`);\n }\n\n const typeHeader = \"TYPE\";\n const connectedAsHeader = \"CONNECTED AS\";\n\n const connectedCells = results.map((r) => {\n return renderConnectedAsCell(r.connector);\n });\n\n const typeWidth = Math.max(\n typeHeader.length,\n ...results.map((r) => {\n return r.connector.connectorRef.length;\n }),\n );\n const connectedAsWidth = Math.max(\n connectedAsHeader.length,\n ...connectedCells.map((c) => {\n return stripAnsi(c).length;\n }),\n );\n\n const headerParts = [\n typeHeader.padEnd(typeWidth),\n connectedAsHeader.padEnd(connectedAsWidth),\n ];\n if (agentCtx) {\n headerParts.push(`AUTHORIZED FOR ${agentCtx.displayName}`);\n }\n console.log(chalk.dim(headerParts.join(\" \")));\n\n for (let i = 0; i < results.length; i++) {\n const result = results[i]!;\n const parts = [\n result.connector.connectorRef.padEnd(typeWidth),\n padEndAnsi(connectedCells[i]!, connectedAsWidth),\n ];\n if (agentCtx) {\n parts.push(\n agentCtx.authorizedTypes.has(result.connector.connectorRef)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(parts.join(\" \"));\n }\n },\n ),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { listZeroConnectorCatalogStatus } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { resolveAgentContext } from \"./agent-context\";\nimport { getPlatformOrigin } from \"../doctor/platform-url\";\nimport {\n availableConnectorRefs,\n findConnectorStatusItem,\n type PublicConnectorStatus,\n} from \"./public-catalog\";\nimport {\n connectorActionUrl,\n printCallbackActionUrlExample,\n} from \"./action-url\";\n\nconst LABEL_WIDTH = 16;\n\ntype AgentContext = NonNullable<\n Awaited<ReturnType<typeof resolveAgentContext>>\n>;\n\nfunction printConnectorDetails(connector: PublicConnectorStatus): void {\n if (connector.connectionStatus === \"not-connected\") {\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${chalk.dim(\"not connected\")}`,\n );\n return;\n }\n\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${\n connector.connectionStatus === \"reconnect-required\"\n ? chalk.yellow(\"reconnect needed\")\n : chalk.green(\"connected\")\n }`,\n );\n if (connector.connection?.externalUsername) {\n console.log(\n `${\"Account:\".padEnd(LABEL_WIDTH)}@${connector.connection.externalUsername}`,\n );\n } else if (connector.connection?.externalEmail) {\n console.log(\n `${\"Account:\".padEnd(LABEL_WIDTH)}${connector.connection.externalEmail}`,\n );\n }\n if (connector.connection?.authMethod) {\n console.log(\n `${\"Auth Method:\".padEnd(LABEL_WIDTH)}${connector.connection.authMethod}`,\n );\n }\n if (connector.scopeMismatch) {\n console.log(\n `${\"Permissions:\".padEnd(LABEL_WIDTH)}${chalk.yellow(\"update available\")}`,\n );\n }\n if (connector.tokenExpiresAt) {\n console.log(\n `${\"Token Expires:\".padEnd(LABEL_WIDTH)}${connector.tokenExpiresAt}`,\n );\n }\n}\n\nasync function printAgentAction(\n connector: PublicConnectorStatus,\n agentCtx: AgentContext,\n): Promise<void> {\n const connectorRef = connector.connectorRef;\n const authorized = agentCtx.authorizedTypes.has(connectorRef);\n const isConnected = connector.connected;\n const needsReconnect = connector.connectionStatus === \"reconnect-required\";\n const agentLabel =\n agentCtx.displayName === agentCtx.agentId\n ? agentCtx.agentId\n : `${agentCtx.displayName} (${agentCtx.agentId})`;\n\n console.log();\n if (needsReconnect) {\n const origin = await getPlatformOrigin();\n const url = connectorActionUrl({\n origin,\n path: `/connectors/${connectorRef}/connect`,\n agentId: agentCtx.agentId,\n });\n console.log(\n `The ${connectorRef} connector is connected but needs to be reconnected before agent ${agentLabel} can use it.`,\n );\n console.log(`Reconnect it at: [Reconnect ${connectorRef}](${url})`);\n printCallbackActionUrlExample(url, agentCtx.agentId);\n } else if (authorized && !isConnected) {\n const origin = await getPlatformOrigin();\n const url = connectorActionUrl({\n origin,\n path: `/connectors/${connectorRef}/connect`,\n agentId: agentCtx.agentId,\n });\n console.log(\n `The ${connectorRef} connector is authorized for agent ${agentLabel}, but it is not connected.`,\n );\n console.log(`Connect it at: [Connect ${connectorRef}](${url})`);\n printCallbackActionUrlExample(url, agentCtx.agentId);\n } else if (authorized) {\n console.log(\n `The ${connectorRef} connector is authorized for agent ${agentLabel}.`,\n );\n } else if (!isConnected) {\n const origin = await getPlatformOrigin();\n const url = connectorActionUrl({\n origin,\n path: `/connectors/${connectorRef}/connect`,\n agentId: agentCtx.agentId,\n });\n console.log(\n `The ${connectorRef} connector is not connected. Once connected, it will be authorized for agent ${agentLabel}.`,\n );\n console.log(\n `Connect and authorize it at: [Connect ${connectorRef}](${url})`,\n );\n printCallbackActionUrlExample(url, agentCtx.agentId);\n } else {\n const origin = await getPlatformOrigin();\n const url = connectorActionUrl({\n origin,\n path: `/connectors/${connectorRef}/authorize`,\n agentId: agentCtx.agentId,\n });\n console.log(\n `The ${connectorRef} connector is not authorized for agent ${agentLabel}.`,\n );\n console.log(`Authorize it at: [Authorize ${connectorRef}](${url})`);\n printCallbackActionUrlExample(url, agentCtx.agentId);\n }\n}\n\nasync function printStandaloneAction(\n connector: PublicConnectorStatus,\n): Promise<void> {\n const connectorRef = connector.connectorRef;\n if (\n connector.connectionStatus === \"connected\" ||\n connector.connectionStatus === \"scope-mismatch\"\n ) {\n return;\n }\n\n const origin = await getPlatformOrigin();\n console.log();\n if (connector.connectionStatus === \"reconnect-required\") {\n const url = `${origin}/connectors`;\n console.log(\n `The ${connectorRef} connector is connected but needs to be reconnected.`,\n );\n console.log(`Reconnect it at: [Reconnect ${connectorRef}](${url})`);\n } else {\n const url = `${origin}/connectors/${connectorRef}/connect`;\n console.log(`Connect it at: [Connect ${connectorRef}](${url})`);\n }\n}\n\nexport const statusCommand = new Command()\n .name(\"status\")\n .description(\"Show detailed status of a connector\")\n .argument(\"<type>\", \"Connector type (e.g., github)\")\n .option(\"--agent <id>\", \"Show authorization state for the given agent\")\n .action(\n withErrorHandler(async (type: string, options: { agent?: string }) => {\n const [catalog, agentCtx] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n resolveAgentContext(options.agent),\n ]);\n const connector = findConnectorStatusItem(catalog.connectors, type);\n if (!connector) {\n throw new Error(`Unknown or unavailable connector: ${type}`, {\n cause: new Error(\n `Available connectors: ${availableConnectorRefs(catalog.connectors)}`,\n ),\n });\n }\n\n console.log(`Connector: ${chalk.cyan(connector.connectorRef)}`);\n console.log();\n\n printConnectorDetails(connector);\n\n if (agentCtx) {\n await printAgentAction(connector, agentCtx);\n } else {\n await printStandaloneAction(connector);\n }\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { readFile } from \"node:fs/promises\";\nimport { customConnectorProposalSchema } from \"@vm0/api-contracts/contracts/zero-custom-connectors\";\nimport {\n getZeroAgent,\n getZeroAgentCustomConnectors,\n getZeroCustomConnector,\n listZeroCustomConnectors,\n} from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\nimport { getPlatformOrigin } from \"../../doctor/platform-url\";\n\nconst LABEL_WIDTH = 18;\n\nfunction renderConnected(connector: {\n readonly connected: boolean;\n readonly missingRequiredFields: readonly string[];\n}): string {\n if (connector.connected) {\n return chalk.green(\"connected\");\n }\n if (connector.missingRequiredFields.length === 0) {\n return chalk.dim(\"not connected\");\n }\n return chalk.yellow(`missing ${connector.missingRequiredFields.join(\", \")}`);\n}\n\nfunction encodeBase64UrlJson(value: unknown): string {\n return Buffer.from(JSON.stringify(value), \"utf8\").toString(\"base64url\");\n}\n\nfunction isJsonObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nasync function resolveCustomAgentContext(agentId: string | undefined): Promise<{\n readonly agentId: string;\n readonly displayName: string;\n readonly authorizedIds: Set<string>;\n} | null> {\n const resolvedAgentId = agentId ?? process.env.ZERO_AGENT_ID;\n if (!resolvedAgentId) {\n return null;\n }\n const [agent, enabledIds] = await Promise.all([\n getZeroAgent(resolvedAgentId),\n getZeroAgentCustomConnectors(resolvedAgentId),\n ]);\n return {\n agentId: agent.agentId,\n displayName: agent.displayName ?? agent.agentId,\n authorizedIds: new Set(enabledIds),\n };\n}\n\nconst listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List org custom connectors\")\n .option(\"--agent <id>\", \"Show per-agent authorization column\")\n .action(\n withErrorHandler(async (options: { agent?: string }) => {\n const [connectors, agentCtx] = await Promise.all([\n listZeroCustomConnectors(),\n resolveCustomAgentContext(options.agent),\n ]);\n const idWidth = Math.max(\n 2,\n ...connectors.map((connector) => {\n return connector.id.length;\n }),\n );\n const nameWidth = Math.max(\n 4,\n ...connectors.map((connector) => {\n return connector.displayName.length;\n }),\n );\n const header = [\"ID\".padEnd(idWidth), \"NAME\".padEnd(nameWidth), \"STATUS\"];\n if (agentCtx) {\n header.push(`AUTHORIZED FOR ${agentCtx.displayName}`);\n }\n console.log(chalk.dim(header.join(\" \")));\n for (const connector of connectors) {\n const row = [\n connector.id.padEnd(idWidth),\n connector.displayName.padEnd(nameWidth),\n renderConnected(connector),\n ];\n if (agentCtx) {\n row.push(\n agentCtx.authorizedIds.has(connector.id)\n ? chalk.green(\"✓\")\n : chalk.dim(\"-\"),\n );\n }\n console.log(row.join(\" \"));\n }\n }),\n );\n\nconst statusCommand = new Command()\n .name(\"status\")\n .description(\"Show detailed status of a custom connector\")\n .argument(\"<connector-id>\", \"Custom connector id\")\n .option(\"--agent <id>\", \"Show authorization state for the given agent\")\n .action(\n withErrorHandler(\n async (connectorId: string, options: { agent?: string }) => {\n const [connector, agentCtx] = await Promise.all([\n getZeroCustomConnector(connectorId),\n resolveCustomAgentContext(options.agent),\n ]);\n if (!connector) {\n throw new Error(`Custom connector not found: ${connectorId}`);\n }\n console.log(`Custom connector: ${chalk.cyan(connector.displayName)}`);\n console.log();\n console.log(`${\"ID:\".padEnd(LABEL_WIDTH)}${connector.id}`);\n console.log(\n `${\"Status:\".padEnd(LABEL_WIDTH)}${renderConnected(connector)}`,\n );\n console.log(\n `${\"Prefixes:\".padEnd(LABEL_WIDTH)}${connector.prefixTemplates.join(\", \")}`,\n );\n console.log(\n `${\"Fields:\".padEnd(LABEL_WIDTH)}${connector.fields\n .map((field) => {\n return `${field.kind}:${field.key}${field.required ? \"\" : \"?\"}`;\n })\n .join(\", \")}`,\n );\n if (connector.headerInjections.length > 0) {\n console.log(\n `${\"Headers:\".padEnd(LABEL_WIDTH)}${connector.headerInjections\n .map((header) => {\n return header.name;\n })\n .join(\", \")}`,\n );\n }\n if (connector.queryInjections.length > 0) {\n console.log(\n `${\"Query params:\".padEnd(LABEL_WIDTH)}${connector.queryInjections\n .map((query) => {\n return query.name;\n })\n .join(\", \")}`,\n );\n }\n if (agentCtx) {\n console.log(\n `${\"Authorized:\".padEnd(LABEL_WIDTH)}${\n agentCtx.authorizedIds.has(connector.id)\n ? chalk.green(\"yes\")\n : chalk.yellow(\"no\")\n }`,\n );\n }\n },\n ),\n );\n\nconst proposeCommand = new Command()\n .name(\"propose\")\n .description(\"Create a browser save link for a custom connector proposal\")\n .requiredOption(\"--proposal-file <path>\", \"JSON proposal file\")\n .option(\"--connector-id <id>\", \"Override connector id for update proposals\")\n .option(\"--agent <id>\", \"Authorize this agent when the proposal is saved\")\n .action(\n withErrorHandler(\n async (options: {\n proposalFile: string;\n connectorId?: string;\n agent?: string;\n }) => {\n const raw = await readFile(options.proposalFile, \"utf8\");\n const proposalJson: unknown = JSON.parse(raw);\n if (!isJsonObject(proposalJson)) {\n throw new Error(\"Proposal file must contain a JSON object\");\n }\n const parsed = customConnectorProposalSchema.parse({\n ...proposalJson,\n ...(options.connectorId ? { connectorId: options.connectorId } : {}),\n });\n const origin = await getPlatformOrigin();\n const params = new URLSearchParams({\n p: encodeBase64UrlJson(parsed),\n });\n const agentId = options.agent ?? process.env.ZERO_AGENT_ID;\n if (agentId) {\n params.set(\"agentId\", agentId);\n }\n const url = `${origin}/connectors/custom/proposal?${params.toString()}`;\n console.log(`[Configure ${parsed.displayName}](${url})`);\n console.log();\n console.log(\n \"Open this link to review, save values, and authorize the connector.\",\n );\n },\n ),\n );\n\nexport const customConnectorCommand = new Command()\n .name(\"custom\")\n .description(\"Inspect and propose org custom connectors\")\n .addCommand(listCommand)\n .addCommand(statusCommand)\n .addCommand(proposeCommand);\n","import { Command, Option } from \"commander\";\nimport { findFirewallMetadataPermission } from \"@vm0/connectors/firewall-metadata/policy\";\nimport { UNKNOWN_PERMISSION_GRANT } from \"@vm0/connectors/firewall-types\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { getPlatformOrigin } from \"../doctor/platform-url\";\nimport {\n isComputerUsePermissionTarget,\n printComputerUsePermissionGuidance,\n} from \"./computer-use-guidance\";\nimport {\n ApiRequestError,\n createComputerUseAuthorizationRequest,\n getZeroConnectorCatalogPermissions,\n} from \"../../../lib/api\";\nimport {\n addRequestedCallbackSearchParams,\n connectorActionCallbackAvailable,\n printCallbackTurnInstruction,\n} from \"./action-url\";\n\nfunction permissionDescription(permission: string): string {\n return permission === UNKNOWN_PERMISSION_GRANT\n ? \"unknown endpoints\"\n : `the \"${permission}\" permission`;\n}\n\nfunction printSensitivePermissionGuidance(\n connectorRef: string,\n permission: string,\n): void {\n // Slack chat:write: strongly recommend bot-based messaging over user identity\n if (connectorRef === \"slack\" && permission === \"chat:write\") {\n console.log(\"\");\n console.log(\n \"IMPORTANT: Granting chat:write allows sending messages AS THE USER's identity, not as a bot.\",\n );\n console.log(\n \"Use `zero slack message send -c <channel> -t <text>` to send messages as the bot instead — this is the recommended approach for most use cases.\",\n );\n console.log(\n \"Only allow this permission below if acting as the user is specifically required.\",\n );\n console.log(\"\");\n }\n\n // Gmail send permissions: strongly recommend draft-based workflow over direct send.\n if (\n connectorRef === \"gmail\" &&\n (permission === \"messages.send\" || permission === \"drafts.send\")\n ) {\n console.log(\"\");\n console.log(\n \"IMPORTANT: Granting Gmail send permissions allows the agent to send emails directly as the user.\",\n );\n console.log(\n \"Consider keeping messages.send and drafts.send disabled and using drafts.write instead — the agent can create drafts for the user to review and send manually.\",\n );\n console.log(\n \"Only allow this permission below if direct sending is specifically required.\",\n );\n console.log(\"\");\n }\n}\n\nfunction printPermissionRequestMessage(args: {\n readonly permission: string;\n readonly label: string;\n readonly url: string;\n}): void {\n console.log(\n `You can allow ${permissionDescription(args.permission)} for your connector access: [Manage ${args.label} permissions](${args.url})`,\n );\n}\n\nfunction printComputerUseAuthorizationLink(args: {\n readonly authorizationUrl: string;\n readonly expiresAt: string;\n}): void {\n console.log(\n \"Computer Use needs a Zero Desktop host selected before a run starts.\",\n );\n console.log(\n \"Ask the user to authorize a host for future runs in this chat or Slack thread:\",\n );\n console.log(args.authorizationUrl);\n console.log(\n `This link expires at ${args.expiresAt}. Existing run tokens cannot be upgraded in place; start a new run after authorization.`,\n );\n}\n\nasync function printComputerUsePermissionRequestMessage(): Promise<void> {\n if (!process.env.ZERO_TOKEN) {\n printComputerUsePermissionGuidance();\n return;\n }\n\n try {\n const request = await createComputerUseAuthorizationRequest();\n printComputerUseAuthorizationLink({\n authorizationUrl: request.authorizationUrl,\n expiresAt: request.expiresAt,\n });\n } catch (error) {\n if (error instanceof ApiRequestError) {\n console.log(\n `Computer Use authorization link unavailable: ${error.message}`,\n );\n printComputerUsePermissionGuidance();\n return;\n }\n const message = error instanceof Error ? error.message : \"Unknown error\";\n console.log(`Computer Use authorization link unavailable: ${message}`);\n printComputerUsePermissionGuidance();\n }\n}\n\nasync function outputPermissionRequestMessage(\n connectorRef: string,\n label: string,\n permission: string,\n agentId: string | undefined,\n callbackPrompt: string | undefined,\n): Promise<void> {\n const platformOrigin = await getPlatformOrigin();\n\n const urlParams = new URLSearchParams({\n ref: connectorRef,\n permission,\n action: \"allow\",\n });\n addRequestedCallbackSearchParams(urlParams, callbackPrompt, agentId);\n\n const pagePath = agentId ? `/agents/${agentId}/permissions` : \"/agents\";\n const url = `${platformOrigin}${pagePath}?${urlParams.toString()}`;\n\n printSensitivePermissionGuidance(connectorRef, permission);\n printPermissionRequestMessage({\n permission,\n label,\n url,\n });\n if (callbackPrompt !== undefined) {\n printCallbackTurnInstruction();\n }\n}\n\nconst callbackPromptOption = new Option(\n \"--callback-prompt <prompt>\",\n \"Start the next web chat round with this prompt after the permission is granted\",\n);\nconst callbackPromptAvailable = connectorActionCallbackAvailable();\nif (!callbackPromptAvailable) {\n callbackPromptOption.hideHelp();\n}\nconst callbackPromptExample = callbackPromptAvailable\n ? ' zero connector permission-request github --permission contents:write --callback-prompt \"Re-check the permission, then continue the previous task\"\\n'\n : \"\";\nconst callbackPromptNotes = callbackPromptAvailable\n ? \" - Use --callback-prompt only when this turn needs exactly one connector or permission action\\n - Callback prompts are included in the URL; keep them concise and do not include secrets\\n\"\n : \"\";\n\nexport const permissionRequestCommand = new Command()\n .name(\"permission-request\")\n .description(\"Request permission to use a connector capability\")\n .argument(\"<connector-ref>\", \"The connector type (e.g. github)\")\n .addOption(\n new Option(\n \"--permission <name>\",\n \"The permission name to request\",\n ).makeOptionMandatory(),\n )\n .addOption(\n new Option(\n \"--agent <id>\",\n \"Agent ID whose permission page should be opened (defaults to ZERO_AGENT_ID)\",\n ),\n )\n .addOption(callbackPromptOption)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero connector permission-request github --permission contents:read\n${callbackPromptExample} zero connector permission-request gmail --permission messages.write --agent <agent-id>\n zero connector permission-request cloudflare --permission __unknown__\n zero connector permission-request computer-use --permission computer-use:write\n\nNotes:\n - Outputs a platform URL for the user to allow the permission\n - Use --permission __unknown__ to request access to unknown endpoints\n - Use --agent to request a permission for another agent; defaults to ZERO_AGENT_ID\n - The user chooses the permission duration on the confirmation page\n${callbackPromptNotes} - Permission requests update the current user's connector grants after confirmation`,\n )\n .action(\n withErrorHandler(\n async (\n connectorRef: string,\n opts: {\n permission: string;\n agent?: string;\n callbackPrompt?: string;\n },\n ) => {\n if (\n isComputerUsePermissionTarget({\n connectorRef,\n permission: opts.permission,\n })\n ) {\n if (opts.callbackPrompt !== undefined) {\n throw new Error(\n \"--callback-prompt is not supported for Computer Use authorization requests\",\n );\n }\n await printComputerUsePermissionRequestMessage();\n return;\n }\n\n const agentId = opts.agent ?? process.env.ZERO_AGENT_ID;\n\n const metadata = await getZeroConnectorCatalogPermissions(connectorRef);\n if (!metadata) {\n throw new Error(`Unknown connector type: ${connectorRef}`);\n }\n\n if (\n opts.permission !== UNKNOWN_PERMISSION_GRANT &&\n !findFirewallMetadataPermission(metadata, opts.permission)\n ) {\n throw new Error(\n `Unknown permission \"${opts.permission}\" for ${connectorRef}`,\n );\n }\n\n await outputPermissionRequestMessage(\n connectorRef,\n metadata.label,\n opts.permission,\n agentId,\n opts.callbackPrompt,\n );\n },\n ),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,IAAM,6BAA6B;AACnC,IAAM,0BAA0B;AAChC,IAAM,2BAA2B;AACjC,IAAM,sCAAsC,GAAG,wBAAwB;AAQhE,SAAS,8BACd,QACS;AACT,SACE,OAAO,iBAAiB,8BACxB,OAAO,eAAe,2BACtB,OAAO,SAAS,4BAChB,OAAO,MAAM,WAAW,mCAAmC,MAAM;AAErE;AAEO,SAAS,qCAA2C;AACzD,UAAQ,IAAI,+DAA+D;AAC3E,UAAQ;AAAA,IACN;AAAA,EACF;AACA,UAAQ;AAAA,IACN;AAAA,EACF;AACA,UAAQ;AAAA,IACN;AAAA,EACF;AACF;;;ADoCA,SAAS,yBAAyB,KAAqB;AACrD,QAAM,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAM,gBAAgB,IAAI,QAAQ,GAAG;AACrC,MAAI,MAAM,IAAI;AACd,MA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EACzB,WAAW,WAAW,EACtB,WAAW,aAAa,EACxB,WAAW,aAAa,EACxB,WAAWC,yBAAwB;","names":["LABEL_WIDTH","listCommand","statusCommand","permissionRequestCommand","permissionRequestCommand"]}
|
|
@@ -5,27 +5,27 @@ import {
|
|
|
5
5
|
currentPlanAllowsVideo,
|
|
6
6
|
currentPlanCanBuyCredits,
|
|
7
7
|
currentTokenCanReadBilling
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GF22PXYF.js";
|
|
9
9
|
import {
|
|
10
10
|
createZeroCreditCheckout,
|
|
11
11
|
getZeroBillingStatus,
|
|
12
12
|
getZeroOrgMembers
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-SLUCBVKQ.js";
|
|
14
|
+
import "./chunk-ITSKDZFI.js";
|
|
15
15
|
import {
|
|
16
16
|
planUpgradeUrl
|
|
17
17
|
} from "./chunk-W75R7EZF.js";
|
|
18
18
|
import {
|
|
19
19
|
getPlatformOrigin
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AAZBHQPP.js";
|
|
21
21
|
import "./chunk-SB7EZ2ZO.js";
|
|
22
22
|
import {
|
|
23
23
|
source_default,
|
|
24
24
|
withErrorHandler
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-M4F24YFV.js";
|
|
26
26
|
import {
|
|
27
27
|
decodeZeroTokenPayload
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-X5FAOKYK.js";
|
|
29
29
|
import {
|
|
30
30
|
Command,
|
|
31
31
|
Option
|
|
@@ -163,4 +163,4 @@ var zeroCreditCommand = new Command().name("credit").description("View credit ba
|
|
|
163
163
|
export {
|
|
164
164
|
zeroCreditCommand
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=credit-
|
|
166
|
+
//# sourceMappingURL=credit-LYZ2HJ6F.js.map
|
|
@@ -4,13 +4,13 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
requestDeveloperSupportConsent,
|
|
6
6
|
submitDeveloperSupport
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-SLUCBVKQ.js";
|
|
8
|
+
import "./chunk-ITSKDZFI.js";
|
|
9
9
|
import "./chunk-SB7EZ2ZO.js";
|
|
10
10
|
import {
|
|
11
11
|
withErrorHandler
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-M4F24YFV.js";
|
|
13
|
+
import "./chunk-X5FAOKYK.js";
|
|
14
14
|
import {
|
|
15
15
|
Command
|
|
16
16
|
} from "./chunk-LD4ZVU4O.js";
|
|
@@ -61,4 +61,4 @@ Notes:
|
|
|
61
61
|
export {
|
|
62
62
|
zeroDeveloperSupportCommand
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=developer-support-
|
|
64
|
+
//# sourceMappingURL=developer-support-3ISSXZCF.js.map
|