@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
package/chunk-D4OTAABD.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 Banking = \"banking\",\n Lab = \"lab\",\n NotionWorkflowAutomations = \"notionWorkflowAutomations\",\n GithubWebhookAutomations = \"githubWebhookAutomations\",\n GithubWorkflowRunAutomations = \"githubWorkflowRunAutomations\",\n MorningBrief = \"morningBrief\",\n ManualMorningBrief = \"manualMorningBrief\",\n TestOauthConnector = \"testOauthConnector\",\n FreshdeskConnector = \"freshdeskConnector\",\n StabilityAiConnector = \"stabilityAiConnector\",\n ZoomConnector = \"zoomConnector\",\n WorkdayConnector = \"workdayConnector\",\n CodexFastMode = \"codexFastMode\",\n RealAgentInPreview = \"realAgentInPreview\",\n ComposerUploadPopover = \"composerUploadPopover\",\n StructuredPrompt = \"structuredPrompt\",\n\n ZapierConnector = \"zapierConnector\",\n HtmlArtifactCommentEditing = \"htmlArtifactCommentEditing\",\n ComputerUseDesktopPlugins = \"computerUseDesktopPlugins\",\n AgentUnreadIndicators = \"agentUnreadIndicators\",\n ChatThreadUnifiedSearch = \"chatThreadUnifiedSearch\",\n ComposerChatThreadSuggestions = \"composerChatThreadSuggestions\",\n SidebarSubscriptionUsage = \"sidebarSubscriptionUsage\",\n TeamsIntegration = \"teamsIntegration\",\n FeishuIntegration = \"feishuIntegration\",\n PresentationExport = \"presentationExport\",\n Artifacts = \"artifacts\",\n HostedArtifactVersions = \"hostedArtifactVersions\",\n VideoArtifactPosters = \"videoArtifactPosters\",\n WebsiteTemplateV2 = \"websiteTemplateV2\",\n PlanUpgradeGuidance = \"planUpgradeGuidance\",\n OrgPlanEntitlementReads = \"orgPlanEntitlementReads\",\n WorkflowConnectorReadiness = \"workflowConnectorReadiness\",\n ZeroMail = \"zeroMail\",\n ComposerConnectorPermissions = \"composerConnectorPermissions\",\n ThreeColumnNav = \"threeColumnNav\",\n ChatHistoryBackfillProgress = \"chatHistoryBackfillProgress\",\n}\n","/**\n * Feature switch system\n *\n * Provides centralized feature flag management with user-identity based overrides.\n * User IDs are stored as FNV-1a hashes to avoid exposing plain-text identifiers in source code.\n *\n * NOT AN AUTHORIZATION BOUNDARY. User-overridable switches can be self-enabled\n * through `POST /api/zero/feature-switches`, and `userOverridable: false` only\n * excludes a switch from that API. For money-granting, credential, or\n * privilege-escalation endpoints, gate with a hard identity check (e.g.\n * `isStaffOrg()` from `./staff-org`) instead of this system.\n */\n\nimport { FeatureSwitchKey } from \"./feature-switch-key\";\nimport { STAFF_ORG_ID_HASHES, fnv1a } from \"./identity-hash\";\n\nexport interface FeatureSwitch {\n readonly maintainer: string;\n readonly description?: string;\n readonly enabled: boolean;\n readonly enabledUserHashes?: readonly string[];\n readonly enabledEmailHashes?: readonly string[];\n readonly enabledOrgIdHashes?: readonly string[];\n readonly userOverridable?: boolean;\n}\n\nexport interface FeatureSwitchMetadata {\n readonly maintainer: string;\n readonly description?: string;\n readonly userOverridable: boolean;\n}\n\nexport interface FeatureSwitchContext {\n readonly userId?: string;\n readonly email?: string;\n readonly orgId?: string;\n readonly overrides?: Partial<Record<FeatureSwitchKey, boolean>>;\n}\n\n/**\n * Registry of all feature switches\n */\nconst FEATURE_SWITCHES: Record<FeatureSwitchKey, FeatureSwitch> = {\n [FeatureSwitchKey.Dummy]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Test-only feature switch for flag system validation\",\n enabled: true,\n },\n [FeatureSwitchKey.ExternalConnectorCatalog]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Use the accepted external catalog as the global source for official connectors\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.AhrefsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ahrefs SEO connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BillConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BILL Spend & Expense connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BentomlConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BentoML model serving connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BoxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Box file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CanvaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Canva design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CalComConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Cal.com scheduling connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CopperConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Copper CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DatadogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Datadog observability connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DeelConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Deel HR connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DocuSignConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the DocuSign e-signature connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DropboxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Dropbox file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.FigmaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Figma design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ExpensifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Expensify accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleContactsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Contacts connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleFormsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Forms connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MercuryConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mercury banking connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NeonConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Neon serverless Postgres connector\",\n enabled: false,\n },\n [FeatureSwitchKey.NetSuiteConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Oracle NetSuite ERP connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GarminConnectConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Garmin Connect wellness connector\",\n enabled: false,\n },\n [FeatureSwitchKey.QuickBooksConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the QuickBooks accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RedditConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Reddit connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.SupabaseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Supabase database connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.CloseConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Close CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.WebflowConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Webflow site management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MetaAdsConnector]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Enable the Meta Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.TikTokAdsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the TikTok Ads Manager connector\",\n enabled: false,\n },\n [FeatureSwitchKey.AwsConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description: \"Enable the temporary AWS remote login connector\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PosthogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PostHog analytics connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PayPalConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the PayPal payments connector\",\n enabled: false,\n },\n [FeatureSwitchKey.RampConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ramp spend management connector\",\n enabled: false,\n },\n [FeatureSwitchKey.MailchimpConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Mailchimp email marketing connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ResendConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Resend email service connector\",\n enabled: false,\n },\n [FeatureSwitchKey.PexelsConnector]: {\n maintainer: \"bingjie@vm0.ai\",\n description: \"Enable the Pexels stock photo and video connector\",\n enabled: false,\n },\n [FeatureSwitchKey.SpotifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Spotify connector integration\",\n enabled: false,\n },\n [FeatureSwitchKey.ZeroDebug]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Reveal activity debug surfaces, activity log navigation, appended system prompts, and Debug preferences\",\n enabled: false,\n },\n [FeatureSwitchKey.CanonicalSlackIngress]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Route newly admitted per-user Slack threads through canonical chat ingress.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackWebVisibility]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show canonical Slack chat threads in Web chat surfaces for enrolled users.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CanonicalSlackAssets]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Canonicalize direct Slack inputs and run-scoped Slack file publications.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroWeather]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed Google-backed Zero Weather and Air Quality APIs and weather:read ZERO_TOKEN capability.\",\n enabled: true,\n },\n [FeatureSwitchKey.ZeroFinance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the managed APIDojo-backed Zero Finance API and finance:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroPeopleSearch]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable managed Perplexity People Search and the people-search:read ZERO_TOKEN capability.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Banking]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Enable the managed Zero Banking gateway and banking:read ZERO_TOKEN capability for Finicity-backed accounts, balances, and transactions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Lab]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Show the Lab page for toggling experimental features\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.MorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable the daily 7:00 local-time Morning Brief email built from GitHub, Gmail, and Google Calendar.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.ManualMorningBrief]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show a Send now button in Settings that triggers a Morning Brief immediately for testing.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: true,\n },\n [FeatureSwitchKey.NotionWorkflowAutomations]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Notion event workflow automations, starting with child pages created under a configured parent page.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.GithubWorkflowRunAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable GitHub Actions workflow run completed event automations.\",\n enabled: true,\n },\n [FeatureSwitchKey.GithubWebhookAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show creation entry points for GitHub workflow job, pull request review, deployment status, and issue comment automations.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.TestOauthConnector]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable the test-oauth connector, a synthetic OAuth 2.0 provider used only for automated tests. Off in prod.\",\n enabled: false,\n },\n [FeatureSwitchKey.FreshdeskConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Freshdesk helpdesk connector\",\n enabled: false,\n },\n [FeatureSwitchKey.StabilityAiConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Stability AI image generation connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ZoomConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zoom connector (OAuth 2.0) for meetings, past participants, and cloud recordings access\",\n enabled: false,\n },\n [FeatureSwitchKey.WorkdayConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Workday HCM and finance connector\",\n enabled: false,\n },\n\n [FeatureSwitchKey.CodexFastMode]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Codex fast mode for ChatGPT subscription GPT 5.5 and GPT 5.6 web chat runs.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.RealAgentInPreview]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Send preview chat runs through real agent CLIs instead of preview mock runners.\",\n enabled: false,\n },\n [FeatureSwitchKey.ComposerUploadPopover]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Use the Upload popover in the chat composer instead of the legacy paperclip attachment button.\",\n enabled: false,\n userOverridable: false,\n },\n [FeatureSwitchKey.StructuredPrompt]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable structured user prompt rendering, sends, and drafts while preserving the legacy content fallback.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZapierConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable the Zapier connector. When disabled, Zapier is hidden from the connectors list and cannot be connected.\",\n enabled: false,\n },\n [FeatureSwitchKey.HtmlArtifactCommentEditing]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable the HTML artifact comment-editing workflow for collecting DOM comments and preparing instrumented working-copy edits.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComputerUseDesktopPlugins]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Zero Desktop Computer Use plugins for local resources, starting with the bundled filesystem plugin gateway.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.AgentUnreadIndicators]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat unread indicators in sidebar pinned agent lists and the conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatThreadUnifiedSearch]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat thread title results from the local event-driven thread cache in the command-shift-a conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ComposerChatThreadSuggestions]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Suggest titled chat threads from the current agent when typing @ in the chat composer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatHistoryBackfillProgress]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Progress bar under the chat thread header showing history backfill progress while older messages load.\",\n // Not rolled out to anyone yet; enable per-user via the Lab page.\n enabled: false,\n },\n [FeatureSwitchKey.ThreeColumnNav]: {\n maintainer: \"ming@vm0.ai\",\n description:\n \"Slack-style three-column navigation: a labeled icon rail, a pinned-agents and chat-threads list column, and the conversation pane.\",\n enabled: false,\n // Ming only for the first pass; widen to staff once it settles.\n enabledEmailHashes: [\"54757055\"], // fnv1a(\"ming@vm0.ai\")\n },\n [FeatureSwitchKey.SidebarSubscriptionUsage]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show Codex and Claude Code personal subscription usage in the Zero sidebar footer.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.TeamsIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show standalone Microsoft Teams integration settings, connect flows, and Works page entry points.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.FeishuIntegration]: {\n maintainer: \"linghan@vm0.ai\",\n description:\n \"Show the Feishu direct-message integration and Works page entry point.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PresentationExport]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable downloading presentation artifacts as PPTX files and uploading them as native, editable Google Slides decks.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.Artifacts]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Show the Artifacts manage page for generated artifacts in the current organization.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.HostedArtifactVersions]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Create immutable hosted artifact versions behind stable site aliases.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.VideoArtifactPosters]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate poster images asynchronously when video artifacts are recorded.\",\n enabled: false,\n enabledUserHashes: [\"032a75d8\"],\n },\n [FeatureSwitchKey.WebsiteTemplateV2]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Generate websites from refreshed self-contained template packages. When off, website generation uses the existing package versions.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PlanUpgradeGuidance]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show plan-upgrade guidance in Zero CLI help and render billing plan links as rich chat cards.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.OrgPlanEntitlementReads]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Read runtime plan capability limits from org_plan_entitlements instead of deriving them from org_metadata.tier.\",\n enabled: true,\n userOverridable: false,\n },\n [FeatureSwitchKey.WorkflowConnectorReadiness]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Show the manual connector readiness check on workflow settings pages.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n userOverridable: false,\n },\n [FeatureSwitchKey.ZeroMail]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable persistent Gmail and Outlook draft cards created through the Zero Mail CLI.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.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","export interface ZeroTokenPayload {\n userId: string;\n runId: string;\n orgId: string;\n scope: string;\n capabilities: string[];\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 //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S,MAAM,IAAI,MAAM,CAAC;AAC5D,aAAO;AAAA,EACX;AACA,MAAI,IAAI,SAAS,cAAc,oBAAoB,QAAQ;AACzD,QACE,cAAc,mBAAmB,SAAS,MAAM,IAAI,MAAM,YAAY,CAAC,CAAC;AAExE,aAAO;AAAA,EACX;AACA,MAAI,IAAI,SAAS,cAAc,oBAAoB,QAAQ;AACzD,QAAI,cAAc,mBAAmB,SAAS,MAAM,IAAI,KAAK,CAAC;AAC5D,aAAO;AAAA,EACX;AACA,SAAO;AACT;;;AGlrBA;AAgBO,SAAS,uBACd,OAC8B;AAC9B,QAAM,MAAM,SAAS,QAAQ,IAAI;AACjC,MAAI,CAAC,IAAK,QAAO;AAEjB,QAAM,SAAS;AACf,MAAI,CAAC,IAAI,WAAW,MAAM,EAAG,QAAO;AACpC,QAAM,MAAM,IAAI,MAAM,OAAO,MAAM;AAEnC,QAAM,QAAQ,IAAI,MAAM,GAAG;AAC3B,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,MAAI;AACF,UAAM,UAAU,KAAK;AAAA,MACnB,OAAO,KAAK,MAAM,CAAC,GAAI,WAAW,EAAE,SAAS;AAAA,IAC/C;AACA,QAAI,QAAQ,UAAU,UAAU,MAAM,QAAQ,QAAQ,YAAY,GAAG;AACnE,aAAO;AAAA,IACT;AAAA,EACF,QAAQ;AAAA,EAER;AACA,SAAO;AACT;","names":[]}
|
package/chunk-OTH23BP4.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/connector/public-catalog.ts","../src/commands/zero/connector/agent-context.ts"],"sourcesContent":["import type {\n PublicConnectorCatalogAuthMethodDetail,\n PublicConnectorCatalogItem,\n PublicConnectorCatalogStatusItem,\n} from \"@vm0/api-contracts/contracts/zero-connector-catalog\";\n\nexport type PublicConnectorStatus = PublicConnectorCatalogStatusItem;\n\ninterface PublicConnectorSearchResult {\n readonly connector: PublicConnectorStatus;\n readonly score: number;\n readonly matchedField: string;\n}\n\ninterface PublicConnectorSearchOutput {\n readonly results: readonly PublicConnectorSearchResult[];\n readonly total: number;\n}\n\nconst TOKEN_BOUNDARY = /[_\\-\\s]+/;\nconst CASE_BOUNDARY = /(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/;\nconst MIN_SCORE = 10;\n\nfunction tokenize(input: string): Set<string> {\n const tokens = new Set<string>();\n for (const chunk of input.split(TOKEN_BOUNDARY)) {\n if (!chunk) continue;\n for (const sub of chunk.split(CASE_BOUNDARY)) {\n const lower = sub.toLowerCase();\n if (lower) tokens.add(lower);\n }\n }\n return tokens;\n}\n\nfunction publicStrings(connector: PublicConnectorCatalogItem): string[] {\n return [\n connector.connectorRef,\n connector.label,\n connector.description,\n connector.category,\n ...connector.tags,\n ...connector.generation,\n ...connector.authMethods.flatMap((authMethod) => {\n return [\n authMethod.id,\n authMethod.label,\n ...(authMethod.description ? [authMethod.description] : []),\n ];\n }),\n ];\n}\n\ntype ScoreHit = { score: number; matchedField: string };\n\nfunction best(candidates: readonly (ScoreHit | null)[]): ScoreHit | null {\n return candidates.reduce<ScoreHit | null>((bestHit, hit) => {\n if (!hit) return bestHit;\n if (!bestHit || hit.score > bestHit.score) return hit;\n return bestHit;\n }, null);\n}\n\nfunction scoreExact(\n keywordLower: string,\n skipPrivateIdentifierMatches: boolean,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n if (connector.connectorRef.toLowerCase() === keywordLower) {\n return { score: 100, matchedField: \"connectorRef\" };\n }\n if (connector.label.toLowerCase() === keywordLower) {\n return { score: 80, matchedField: \"label\" };\n }\n for (const tag of connector.tags) {\n if (skipPrivateIdentifierMatches && tag.includes(\"_\")) continue;\n if (tag.toLowerCase() === keywordLower) {\n return { score: 70, matchedField: `tag:${tag}` };\n }\n }\n for (const generationType of connector.generation) {\n if (generationType.toLowerCase() === keywordLower) {\n return { score: 65, matchedField: `generation:${generationType}` };\n }\n }\n for (const authMethod of connector.authMethods) {\n if (authMethod.id.toLowerCase() === keywordLower) {\n return { score: 60, matchedField: `auth-method:${authMethod.id}` };\n }\n if (authMethod.label.toLowerCase() === keywordLower) {\n return { score: 60, matchedField: `auth-method:${authMethod.label}` };\n }\n }\n if (connector.category.toLowerCase() === keywordLower) {\n return { score: 55, matchedField: \"category\" };\n }\n return null;\n}\n\nfunction scoreSubstring(\n keywordLower: string,\n skipPrivateIdentifierMatches: boolean,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const candidates: ScoreHit[] = [];\n if (connector.connectorRef.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 50, matchedField: \"connectorRef\" });\n }\n if (connector.label.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 50, matchedField: \"label\" });\n }\n for (const tag of connector.tags) {\n if (skipPrivateIdentifierMatches && tag.includes(\"_\")) continue;\n if (tag.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 25, matchedField: `tag:${tag}` });\n }\n }\n for (const generationType of connector.generation) {\n if (generationType.toLowerCase().includes(keywordLower)) {\n candidates.push({\n score: 25,\n matchedField: `generation:${generationType}`,\n });\n }\n }\n for (const authMethod of connector.authMethods) {\n if (\n authMethod.id.toLowerCase().includes(keywordLower) ||\n authMethod.label.toLowerCase().includes(keywordLower)\n ) {\n candidates.push({\n score: 20,\n matchedField: `auth-method:${authMethod.id}`,\n });\n }\n }\n if (connector.category.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 20, matchedField: \"category\" });\n }\n if (connector.description.toLowerCase().includes(keywordLower)) {\n candidates.push({ score: 15, matchedField: \"description\" });\n }\n\n return best(candidates);\n}\n\nfunction scoreTokens(\n keywordTokens: ReadonlySet<string>,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const candidateTokens = new Set<string>();\n for (const source of publicStrings(connector)) {\n for (const token of tokenize(source)) {\n candidateTokens.add(token);\n }\n }\n\n let intersection = 0;\n let firstCommon = \"\";\n for (const token of keywordTokens) {\n if (candidateTokens.has(token)) {\n intersection++;\n if (!firstCommon) firstCommon = token;\n }\n }\n if (intersection === 0) return null;\n return { score: 10 * intersection, matchedField: `token:${firstCommon}` };\n}\n\nfunction scoreConnector(\n keywordLower: string,\n keyword: string,\n keywordTokens: ReadonlySet<string>,\n connector: PublicConnectorStatus,\n): ScoreHit | null {\n const skipPrivateIdentifierMatches =\n /^[A-Za-z0-9_]+$/.test(keyword) && keyword.includes(\"_\");\n const tokenHit = skipPrivateIdentifierMatches\n ? null\n : scoreTokens(keywordTokens, connector);\n const hit = best([\n scoreExact(keywordLower, skipPrivateIdentifierMatches, connector),\n scoreSubstring(keywordLower, skipPrivateIdentifierMatches, connector),\n tokenHit,\n ]);\n if (!hit || hit.score < MIN_SCORE) return null;\n return hit;\n}\n\nexport function searchPublicConnectorCatalog(\n connectors: readonly PublicConnectorStatus[],\n keyword: string,\n limit: number,\n): PublicConnectorSearchOutput {\n const trimmed = keyword.trim();\n if (!trimmed) return { results: [], total: 0 };\n\n const keywordLower = trimmed.toLowerCase();\n const keywordTokens = tokenize(trimmed);\n const hits = connectors.flatMap(\n (connector): PublicConnectorSearchResult[] => {\n const hit = scoreConnector(\n keywordLower,\n trimmed,\n keywordTokens,\n connector,\n );\n if (!hit) return [];\n return [\n {\n connector,\n score: hit.score,\n matchedField: hit.matchedField,\n },\n ];\n },\n );\n\n hits.sort((a, b) => {\n if (b.score !== a.score) return b.score - a.score;\n return a.connector.connectorRef.localeCompare(b.connector.connectorRef);\n });\n\n return {\n results: hits.slice(0, limit),\n total: hits.length,\n };\n}\n\nexport function findConnectorStatusItem(\n connectors: readonly PublicConnectorStatus[],\n connectorRef: string,\n): PublicConnectorStatus | null {\n const exact = connectors.find((connector) => {\n return connector.connectorRef === connectorRef;\n });\n if (exact) return exact;\n\n const lower = connectorRef.toLowerCase();\n return (\n connectors.find((connector) => {\n return connector.connectorRef.toLowerCase() === lower;\n }) ?? null\n );\n}\n\nexport function availableConnectorRefs(\n connectors: readonly PublicConnectorStatus[],\n): string {\n return connectors\n .map((connector) => {\n return connector.connectorRef;\n })\n .join(\", \");\n}\n\nexport function resolveManualGrantAuthMethod(\n connector: PublicConnectorStatus,\n rawAuthMethod: string | undefined,\n): PublicConnectorCatalogAuthMethodDetail {\n if (rawAuthMethod) {\n const authMethod = connector.authMethods.find((method) => {\n return method.id === rawAuthMethod;\n });\n if (!authMethod) {\n throw new Error(\n `${connector.connectorRef} connector does not have ${rawAuthMethod} auth method`,\n {\n cause: new Error(\n `Available auth methods: ${connector.authMethods\n .map((method) => {\n return method.id;\n })\n .join(\", \")}`,\n ),\n },\n );\n }\n\n if (authMethod.grantKind === \"manual\") {\n return authMethod;\n }\n\n throw new Error(\n `${connector.connectorRef} ${authMethod.id} auth method does not use a manual grant`,\n );\n }\n\n const manualAuthMethods = connector.authMethods.filter((method) => {\n return method.grantKind === \"manual\";\n });\n const authMethod = manualAuthMethods[0];\n if (manualAuthMethods.length === 1 && authMethod) {\n return authMethod;\n }\n if (manualAuthMethods.length === 0) {\n throw new Error(\n `${connector.connectorRef} connector does not use a manual grant`,\n );\n }\n\n throw new Error(\n `${connector.connectorRef} connector has multiple manual grant auth methods`,\n {\n cause: new Error(\n `Pass --auth-method ${manualAuthMethods\n .map((method) => {\n return method.id;\n })\n .join(\"|\")}`,\n ),\n },\n );\n}\n","import { getZeroAgent, getZeroAgentUserConnectors } from \"../../../lib/api\";\n\ninterface AgentContext {\n agentId: string;\n displayName: string;\n authorizedTypes: Set<string>;\n}\n\nexport async function resolveAgentContext(\n flagAgentId: string | undefined,\n): Promise<AgentContext | null> {\n const agentId = flagAgentId ?? process.env.ZERO_AGENT_ID;\n if (!agentId) return null;\n\n const [agent, enabledTypes] = await Promise.all([\n getZeroAgent(agentId),\n getZeroAgentUserConnectors(agentId),\n ]);\n\n return {\n agentId: agent.agentId,\n displayName: agent.displayName ?? agent.agentId,\n authorizedTypes: new Set(enabledTypes),\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAmBA,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AACtB,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