@vm0/cli 9.276.1 → 9.276.2

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.
Files changed (103) hide show
  1. package/{agent-Y2VPFJTJ.js → agent-6ITXJMRI.js} +5 -5
  2. package/{banking-Y5WT7M34.js → banking-42ENCWTB.js} +4 -4
  3. package/{browser-H55S7OEH.js → browser-SO3OMW7W.js} +4 -4
  4. package/{chat-P6UC665V.js → chat-HKPUUBZ5.js} +5 -5
  5. package/{chunk-DCTUWMGG.js → chunk-3HO2YPJ7.js} +3 -5
  6. package/chunk-3HO2YPJ7.js.map +1 -0
  7. package/{chunk-OHA5XMTM.js → chunk-H5EY44XP.js} +2 -2
  8. package/{chunk-7MOGRZIF.js → chunk-HP56K4IH.js} +1 -7
  9. package/chunk-HP56K4IH.js.map +1 -0
  10. package/{chunk-WVWTGU3D.js → chunk-PWTMDZXF.js} +2 -2
  11. package/{chunk-NUK6BSMQ.js → chunk-QFLEPOFZ.js} +2 -2
  12. package/{chunk-52BQC77O.js → chunk-RSN3T2HL.js} +2 -2
  13. package/{chunk-JPHMTCJS.js → chunk-VBS2LZRM.js} +11 -7
  14. package/{chunk-JPHMTCJS.js.map → chunk-VBS2LZRM.js.map} +1 -1
  15. package/{chunk-VH6AYJ2T.js → chunk-VEPOQ7CY.js} +4 -4
  16. package/{chunk-X6A4NKYJ.js → chunk-YEA6WZTH.js} +10 -3
  17. package/{chunk-X6A4NKYJ.js.map → chunk-YEA6WZTH.js.map} +1 -1
  18. package/{computer-use-IIMQVGVS.js → computer-use-VOM7GCLC.js} +4 -4
  19. package/{connector-BOSPE34U.js → connector-5KE577OI.js} +6 -6
  20. package/{credit-HCG4ZY2S.js → credit-LJEZMXAC.js} +5 -5
  21. package/{developer-support-OQFPD6WL.js → developer-support-CTGXYJ76.js} +4 -4
  22. package/{doctor-4MUE6KKK.js → doctor-M7J2DURH.js} +5 -5
  23. package/{feishu-ZZAR72ZM.js → feishu-WNA7YZU5.js} +4 -4
  24. package/{finance-QPLN4RKW.js → finance-MZKXGURA.js} +4 -4
  25. package/{generate-KGLIGGYD.js → generate-YCT7EXEC.js} +6 -6
  26. package/{github-IVVDB43M.js → github-KSDGGF6A.js} +4 -4
  27. package/{goal-O5AXGFTU.js → goal-X3HQ72QS.js} +4 -4
  28. package/{host-25ULGADV.js → host-WY2FGWZC.js} +4 -4
  29. package/{logs-JUK326FY.js → logs-IBV7W6ZE.js} +6 -6
  30. package/{mail-FTPC3QXX.js → mail-YQMBJDYH.js} +6 -6
  31. package/{maps-EWXICPSJ.js → maps-4DLR4ZXS.js} +4 -4
  32. package/{model-OOYMO6RP.js → model-SATA2MAX.js} +5 -5
  33. package/{model-provider-JTY2NTCE.js → model-provider-JUMPLHAH.js} +5 -5
  34. package/{org-JOUYJEBD.js → org-IS5U6VUN.js} +4 -4
  35. package/package.json +1 -1
  36. package/{people-search-Y64QIJ7A.js → people-search-AGKDK64T.js} +4 -4
  37. package/{phone-DT3XBSU4.js → phone-GLY2FEBE.js} +4 -4
  38. package/{preference-JUOFGAIR.js → preference-DJHZ6S6Z.js} +4 -4
  39. package/{recognize-WSEXD3D2.js → recognize-6IIZXIA7.js} +4 -4
  40. package/{resource-OMELMO73.js → resource-ZPUBGTPE.js} +4 -4
  41. package/{scrape-CHKGSKK6.js → scrape-77OQC5UK.js} +4 -4
  42. package/{search-5TB6SYTY.js → search-GXDC6G5B.js} +6 -6
  43. package/{secret-AIV5RRZT.js → secret-TVTCDFMW.js} +4 -4
  44. package/{slack-5FG5YGYU.js → slack-73645HEZ.js} +4 -4
  45. package/{teams-PZQSLTEP.js → teams-M2AJTHIS.js} +4 -4
  46. package/{telegram-NKZQNHE3.js → telegram-ARAHFEGY.js} +4 -4
  47. package/{upgrade-ARASMGTA.js → upgrade-6OWI3JS2.js} +3 -3
  48. package/{variable-C5UWLXPG.js → variable-4U4DJTTI.js} +4 -4
  49. package/{video-FHJSJDWV.js → video-SQTSIULB.js} +3 -3
  50. package/{weather-UEPFRQEG.js → weather-RUVZN7YL.js} +4 -4
  51. package/{web-3LQQFMED.js → web-QL4CLTB7.js} +4 -4
  52. package/{web-search-TXH5O7YM.js → web-search-3EXUOOVM.js} +4 -4
  53. package/{whoami-IFTY3LVR.js → whoami-4PHYIXKP.js} +5 -5
  54. package/{workflow-RLCIZUED.js → workflow-YP2JTAKU.js} +5 -5
  55. package/zero.js +45 -46
  56. package/zero.js.map +1 -1
  57. package/chunk-7MOGRZIF.js.map +0 -1
  58. package/chunk-DCTUWMGG.js.map +0 -1
  59. /package/{agent-Y2VPFJTJ.js.map → agent-6ITXJMRI.js.map} +0 -0
  60. /package/{banking-Y5WT7M34.js.map → banking-42ENCWTB.js.map} +0 -0
  61. /package/{browser-H55S7OEH.js.map → browser-SO3OMW7W.js.map} +0 -0
  62. /package/{chat-P6UC665V.js.map → chat-HKPUUBZ5.js.map} +0 -0
  63. /package/{chunk-OHA5XMTM.js.map → chunk-H5EY44XP.js.map} +0 -0
  64. /package/{chunk-WVWTGU3D.js.map → chunk-PWTMDZXF.js.map} +0 -0
  65. /package/{chunk-NUK6BSMQ.js.map → chunk-QFLEPOFZ.js.map} +0 -0
  66. /package/{chunk-52BQC77O.js.map → chunk-RSN3T2HL.js.map} +0 -0
  67. /package/{chunk-VH6AYJ2T.js.map → chunk-VEPOQ7CY.js.map} +0 -0
  68. /package/{computer-use-IIMQVGVS.js.map → computer-use-VOM7GCLC.js.map} +0 -0
  69. /package/{connector-BOSPE34U.js.map → connector-5KE577OI.js.map} +0 -0
  70. /package/{credit-HCG4ZY2S.js.map → credit-LJEZMXAC.js.map} +0 -0
  71. /package/{developer-support-OQFPD6WL.js.map → developer-support-CTGXYJ76.js.map} +0 -0
  72. /package/{doctor-4MUE6KKK.js.map → doctor-M7J2DURH.js.map} +0 -0
  73. /package/{feishu-ZZAR72ZM.js.map → feishu-WNA7YZU5.js.map} +0 -0
  74. /package/{finance-QPLN4RKW.js.map → finance-MZKXGURA.js.map} +0 -0
  75. /package/{generate-KGLIGGYD.js.map → generate-YCT7EXEC.js.map} +0 -0
  76. /package/{github-IVVDB43M.js.map → github-KSDGGF6A.js.map} +0 -0
  77. /package/{goal-O5AXGFTU.js.map → goal-X3HQ72QS.js.map} +0 -0
  78. /package/{host-25ULGADV.js.map → host-WY2FGWZC.js.map} +0 -0
  79. /package/{logs-JUK326FY.js.map → logs-IBV7W6ZE.js.map} +0 -0
  80. /package/{mail-FTPC3QXX.js.map → mail-YQMBJDYH.js.map} +0 -0
  81. /package/{maps-EWXICPSJ.js.map → maps-4DLR4ZXS.js.map} +0 -0
  82. /package/{model-OOYMO6RP.js.map → model-SATA2MAX.js.map} +0 -0
  83. /package/{model-provider-JTY2NTCE.js.map → model-provider-JUMPLHAH.js.map} +0 -0
  84. /package/{org-JOUYJEBD.js.map → org-IS5U6VUN.js.map} +0 -0
  85. /package/{people-search-Y64QIJ7A.js.map → people-search-AGKDK64T.js.map} +0 -0
  86. /package/{phone-DT3XBSU4.js.map → phone-GLY2FEBE.js.map} +0 -0
  87. /package/{preference-JUOFGAIR.js.map → preference-DJHZ6S6Z.js.map} +0 -0
  88. /package/{recognize-WSEXD3D2.js.map → recognize-6IIZXIA7.js.map} +0 -0
  89. /package/{resource-OMELMO73.js.map → resource-ZPUBGTPE.js.map} +0 -0
  90. /package/{scrape-CHKGSKK6.js.map → scrape-77OQC5UK.js.map} +0 -0
  91. /package/{search-5TB6SYTY.js.map → search-GXDC6G5B.js.map} +0 -0
  92. /package/{secret-AIV5RRZT.js.map → secret-TVTCDFMW.js.map} +0 -0
  93. /package/{slack-5FG5YGYU.js.map → slack-73645HEZ.js.map} +0 -0
  94. /package/{teams-PZQSLTEP.js.map → teams-M2AJTHIS.js.map} +0 -0
  95. /package/{telegram-NKZQNHE3.js.map → telegram-ARAHFEGY.js.map} +0 -0
  96. /package/{upgrade-ARASMGTA.js.map → upgrade-6OWI3JS2.js.map} +0 -0
  97. /package/{variable-C5UWLXPG.js.map → variable-4U4DJTTI.js.map} +0 -0
  98. /package/{video-FHJSJDWV.js.map → video-SQTSIULB.js.map} +0 -0
  99. /package/{weather-UEPFRQEG.js.map → weather-RUVZN7YL.js.map} +0 -0
  100. /package/{web-3LQQFMED.js.map → web-QL4CLTB7.js.map} +0 -0
  101. /package/{web-search-TXH5O7YM.js.map → web-search-3EXUOOVM.js.map} +0 -0
  102. /package/{whoami-IFTY3LVR.js.map → whoami-4PHYIXKP.js.map} +0 -0
  103. /package/{workflow-RLCIZUED.js.map → workflow-YP2JTAKU.js.map} +0 -0
package/zero.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/zero.ts","../src/instrument.ts","../src/lib/network/proxy.ts"],"sourcesContent":["// Zero CLI entry point - standalone binary for zero platform commands\n// Sentry must be initialized before any other imports\nimport \"./instrument.js\";\nimport { Command } from \"commander\";\nimport { FeatureSwitchKey } from \"@vm0/core/feature-switch-key\";\nimport { isFeatureEnabled } from \"@vm0/core/feature-switch\";\nimport { configureGlobalProxyFromEnv } from \"./lib/network/proxy.js\";\nimport {\n decodeZeroTokenPayload,\n type ZeroTokenPayload,\n} from \"./lib/api/zero-token.js\";\n\ninterface ZeroCommandDefinition {\n name: string;\n description: string;\n load: () => Promise<Command>;\n}\n\n/**\n * Map of command names to the capability required to see them.\n * Commands not in this map are hidden when ZERO_TOKEN is active.\n * Use an array when a top-level command has subcommands with different\n * capability gates and any one of them should make the command visible.\n * Use `null` for commands that should always be visible in sandbox.\n */\nconst COMMAND_CAPABILITY_MAP: Record<\n string,\n string | readonly string[] | null\n> = {\n agent: \"agent:read\",\n workflow: \"agent:read\",\n goal: [\"goal:read\", \"goal:agent-result:write\", \"goal:user-control:write\"],\n connector: [\"connector:read\", \"connector:write\"],\n mail: \"connector:read\",\n doctor: null,\n credit: [\"billing:read\", \"billing:write\"],\n upgrade: null,\n model: null,\n \"model-provider\": null,\n logs: \"agent-run:read\",\n search: \"chat-event:read\",\n chat: [\n \"chat-event:read\",\n \"chat-event:write\",\n \"chat-thread:read\",\n \"chat-thread:write\",\n ],\n resource: null,\n github: [\"github:read\", \"github:write\"],\n slack: \"slack:write\",\n feishu: \"feishu:write\",\n teams: \"teams:write\",\n telegram: [\"telegram:read\", \"telegram:write\"],\n phone: [\"phone:read\", \"phone:write\"],\n whoami: null,\n \"developer-support\": null,\n \"computer-use\": \"computer-use:write\",\n browser: [\"browser:read\", \"browser:write\"],\n intro: null,\n generate: null,\n web: null,\n video: null,\n host: [\"host:read\", \"host:write\"],\n maps: \"maps:read\",\n weather: \"weather:read\",\n scrape: \"scrape:read\",\n \"people-search\": \"people-search:read\",\n \"web-search\": \"web-search:read\",\n recognize: \"image-recognition:write\",\n finance: \"finance:read\",\n banking: \"banking:read\",\n};\n\nconst COMMAND_FEATURE_SWITCH_MAP: Readonly<\n Partial<Record<string, FeatureSwitchKey>>\n> = {\n browser: FeatureSwitchKey.ZeroBrowser,\n recognize: FeatureSwitchKey.ZeroImageRecognition,\n};\n\nconst RUN_ONLY_COMMANDS = new Set([\"recognize\"]);\n\ntype FeatureSwitchOverrides = Partial<Record<FeatureSwitchKey, boolean>>;\n\nconst ZERO_COMMAND_DEFINITIONS: readonly ZeroCommandDefinition[] = [\n {\n name: \"org\",\n description: \"Manage organization settings, members, and providers\",\n load: async () => {\n return (await import(\"./commands/zero/org\")).zeroOrgCommand;\n },\n },\n {\n name: \"model\",\n description: \"List available models and model-switching guidance\",\n load: async () => {\n return (await import(\"./commands/zero/model\")).zeroModelCommand;\n },\n },\n {\n name: \"model-provider\",\n description: \"Inspect model provider routing\",\n load: async () => {\n return (await import(\"./commands/zero/model-provider\"))\n .zeroModelProviderCommand;\n },\n },\n {\n name: \"agent\",\n description: \"View or manage zero agents\",\n load: async () => {\n return (await import(\"./commands/zero/agent\")).zeroAgentCommand;\n },\n },\n {\n name: \"connector\",\n description: \"Check third-party service connections (GitHub, Slack, etc.)\",\n load: async () => {\n return (await import(\"./commands/zero/connector\")).zeroConnectorCommand;\n },\n },\n {\n name: \"mail\",\n description: \"Review and send mail through Gmail or Outlook Mail\",\n load: async () => {\n return (await import(\"./commands/zero/mail\")).zeroMailCommand;\n },\n },\n {\n name: \"credit\",\n description: \"View or buy credits\",\n load: async () => {\n return (await import(\"./commands/zero/credit\")).zeroCreditCommand;\n },\n },\n {\n name: \"upgrade\",\n description: \"Create a workspace plan upgrade link\",\n load: async () => {\n return (await import(\"./commands/zero/upgrade\")).zeroUpgradeCommand;\n },\n },\n {\n name: \"doctor\",\n description:\n \"Diagnose runtime issues (connector health, permission denials)\",\n load: async () => {\n return (await import(\"./commands/zero/doctor\")).zeroDoctorCommand;\n },\n },\n {\n name: \"preference\",\n description: \"View or update user preferences (timezone, notifications)\",\n load: async () => {\n return (await import(\"./commands/zero/preference\")).zeroPreferenceCommand;\n },\n },\n {\n name: \"secret\",\n description: \"Read or write secrets (API keys, tokens)\",\n load: async () => {\n return (await import(\"./commands/zero/secret\")).zeroSecretCommand;\n },\n },\n {\n name: \"github\",\n description: \"Upload and download GitHub files\",\n load: async () => {\n return (await import(\"./commands/zero/github\")).zeroGithubCommand;\n },\n },\n {\n name: \"slack\",\n description:\n \"Send messages, upload files, and download files from Slack as the bot\",\n load: async () => {\n return (await import(\"./commands/zero/slack\")).zeroSlackCommand;\n },\n },\n {\n name: \"feishu\",\n description: \"Send messages to Feishu as an organization bot\",\n load: async () => {\n return (await import(\"./commands/zero/feishu\")).zeroFeishuCommand;\n },\n },\n {\n name: \"teams\",\n description:\n \"Send Microsoft Teams messages, upload files, and download files\",\n load: async () => {\n return (await import(\"./commands/zero/teams\")).zeroTeamsCommand;\n },\n },\n {\n name: \"telegram\",\n description:\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n load: async () => {\n return (await import(\"./commands/zero/telegram\")).zeroTelegramCommand;\n },\n },\n {\n name: \"phone\",\n description: \"Send AgentPhone messages, upload files, and download media\",\n load: async () => {\n return (await import(\"./commands/zero/phone\")).zeroPhoneCommand;\n },\n },\n {\n name: \"variable\",\n description: \"Read or write non-sensitive configuration values\",\n load: async () => {\n return (await import(\"./commands/zero/variable\")).zeroVariableCommand;\n },\n },\n {\n name: \"logs\",\n description: \"View and search agent run logs\",\n load: async () => {\n return (await import(\"./commands/zero/logs\")).zeroLogsCommand;\n },\n },\n {\n name: \"search\",\n description: \"Search logs, chat, or get a recipe for external sources\",\n load: async () => {\n return (await import(\"./commands/zero/search\")).zeroSearchCommand;\n },\n },\n {\n name: \"chat\",\n description: \"Manage the current web chat thread\",\n load: async () => {\n return (await import(\"./commands/zero/chat\")).zeroChatCommand;\n },\n },\n {\n name: \"resource\",\n description: \"Pull registry resources from private R2-backed archives\",\n load: async () => {\n return (await import(\"./commands/zero/resource\")).zeroResourceCommand;\n },\n },\n {\n name: \"whoami\",\n description: \"Show agent identity, run ID, and capabilities\",\n load: async () => {\n return (await import(\"./commands/zero/whoami\")).zeroWhoamiCommand;\n },\n },\n {\n name: \"intro\",\n description: \"Print Zero's self-introduction and capability guide\",\n load: async () => {\n return (await import(\"./commands/zero/intro\")).zeroIntroCommand;\n },\n },\n {\n name: \"workflow\",\n description: \"Manage workflows\",\n load: async () => {\n return (await import(\"./commands/zero/workflow\")).zeroWorkflowCommand;\n },\n },\n {\n name: \"goal\",\n description: \"Manage the current thread goal\",\n load: async () => {\n return (await import(\"./commands/zero/goal\")).zeroGoalCommand;\n },\n },\n {\n name: \"developer-support\",\n description: \"Submit a diagnostic report to the dev team\",\n load: async () => {\n return (await import(\"./commands/zero/developer-support\"))\n .zeroDeveloperSupportCommand;\n },\n },\n {\n name: \"computer-use\",\n description: \"Desktop app computer use through Zero CLI\",\n load: async () => {\n return (await import(\"./commands/zero/computer-use\"))\n .zeroComputerUseCommand;\n },\n },\n {\n name: \"browser\",\n description: \"Managed remote browser sessions for agent-browser\",\n load: async () => {\n return (await import(\"./commands/zero/browser\")).zeroBrowserCommand;\n },\n },\n {\n name: \"generate\",\n description:\n \"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance\",\n load: async () => {\n return (await import(\"./commands/zero/generate\")).generateCommand;\n },\n },\n {\n name: \"web\",\n description: \"Upload and download files via the web chat endpoint\",\n load: async () => {\n return (await import(\"./commands/zero/web\")).zeroWebCommand;\n },\n },\n {\n name: \"video\",\n description: \"Video processing utilities\",\n load: async () => {\n return (await import(\"./commands/zero/video\")).zeroVideoCommand;\n },\n },\n {\n name: \"host\",\n description: \"Publish static sites and clone owned hosted site files\",\n load: async () => {\n return (await import(\"./commands/zero/host\")).zeroHostCommand;\n },\n },\n {\n name: \"maps\",\n description: \"Use managed zero maps services\",\n load: async () => {\n return (await import(\"./commands/zero/maps\")).zeroMapsCommand;\n },\n },\n {\n name: \"weather\",\n description: \"Use managed Zero weather services\",\n load: async () => {\n return (await import(\"./commands/zero/weather\")).zeroWeatherCommand;\n },\n },\n {\n name: \"scrape\",\n description: \"Scrape public web pages through managed zero scrape\",\n load: async () => {\n return (await import(\"./commands/zero/scrape\")).zeroScrapeCommand;\n },\n },\n {\n name: \"people-search\",\n description: \"Find professionals through managed zero people search\",\n load: async () => {\n return (await import(\"./commands/zero/people-search\"))\n .zeroPeopleSearchCommand;\n },\n },\n {\n name: \"web-search\",\n description: \"Search the public web through managed zero web search\",\n load: async () => {\n return (await import(\"./commands/zero/web-search\")).zeroWebSearchCommand;\n },\n },\n {\n name: \"recognize\",\n description: \"Recognize one image through a managed multimodal model\",\n load: async () => {\n return (await import(\"./commands/zero/recognize\")).zeroRecognizeCommand;\n },\n },\n {\n name: \"finance\",\n description: \"Query financial instruments through managed zero finance\",\n load: async () => {\n return (await import(\"./commands/zero/finance\")).zeroFinanceCommand;\n },\n },\n {\n name: \"banking\",\n description: \"Use managed zero banking services\",\n load: async () => {\n return (await import(\"./commands/zero/banking\")).zeroBankingCommand;\n },\n },\n];\n\nconst ZERO_COMMAND_DEFINITION_BY_NAME = new Map(\n ZERO_COMMAND_DEFINITIONS.map((definition) => {\n return [definition.name, definition];\n }),\n);\n\nfunction createZeroCommandStub(definition: ZeroCommandDefinition): Command {\n return new Command(definition.name).description(definition.description);\n}\n\nfunction buildDefaultCommands(): Command[] {\n return ZERO_COMMAND_DEFINITIONS.map(createZeroCommandStub);\n}\n\nfunction shouldHideCommand(\n name: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): boolean {\n if (!isCommandFeatureEnabled(name, payload, featureSwitchOverrides)) {\n return true;\n }\n if (!payload) return RUN_ONLY_COMMANDS.has(name);\n const requiredCap = COMMAND_CAPABILITY_MAP[name];\n if (requiredCap === undefined) return true;\n if (requiredCap === null) return false;\n if (typeof requiredCap !== \"string\") {\n return !requiredCap.some((capability) => {\n return payload.capabilities.includes(capability);\n });\n }\n return !payload.capabilities.includes(requiredCap);\n}\n\nfunction isCommandFeatureEnabled(\n name: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): boolean {\n const featureSwitch = COMMAND_FEATURE_SWITCH_MAP[name];\n const overrides = featureSwitchOverrides ?? payload?.featureSwitchOverrides;\n return (\n !featureSwitch ||\n isFeatureEnabled(featureSwitch, {\n userId: payload?.userId,\n orgId: payload?.orgId,\n overrides,\n })\n );\n}\n\nfunction addZeroCommand(\n prog: Command,\n cmd: Command,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): void {\n const hidden = shouldHideCommand(cmd.name(), payload, featureSwitchOverrides);\n prog.addCommand(cmd, hidden ? { hidden: true } : {});\n}\n\nfunction getNonOptionArgs(argv: string[]): string[] {\n const args: string[] = [];\n\n for (const arg of argv.slice(2)) {\n if (arg === \"--\") {\n break;\n }\n if (arg.startsWith(\"-\")) {\n continue;\n }\n args.push(arg);\n }\n\n return args;\n}\n\nfunction getRequestedZeroCommandName(argv = process.argv): string | undefined {\n const [firstArg, secondArg] = getNonOptionArgs(argv);\n\n if (!firstArg) {\n return undefined;\n }\n\n if (firstArg === \"help\") {\n return secondArg;\n }\n\n return firstArg;\n}\n\nasync function loadZeroCommand(\n name: string | undefined,\n): Promise<Command | undefined> {\n if (!name) {\n return undefined;\n }\n\n return ZERO_COMMAND_DEFINITION_BY_NAME.get(name)?.load();\n}\n\nfunction commandExampleIfVisible(\n name: string,\n example: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): string[] {\n return shouldHideCommand(name, payload, featureSwitchOverrides)\n ? []\n : [example];\n}\n\nexport function buildZeroHelpText(\n payload: ZeroTokenPayload | undefined = decodeZeroTokenPayload(),\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): string {\n const canReadHost = !payload || payload.capabilities.includes(\"host:read\");\n const canWriteHost = !payload || payload.capabilities.includes(\"host:write\");\n const examples = [\n \" Check a connector? zero connector check --env-name <ENV_NAME>\",\n ...(payload && !payload.capabilities.includes(\"billing:read\")\n ? []\n : [\" Check credits? zero credit\"]),\n ...(payload && !payload.capabilities.includes(\"billing:write\")\n ? []\n : [\" Buy credits? zero credit 20000\"]),\n ...commandExampleIfVisible(\n \"upgrade\",\n \" Upgrade plan? zero upgrade pro\",\n payload,\n featureSwitchOverrides,\n ),\n \" Send a Slack message? zero slack message send --help\",\n ...commandExampleIfVisible(\n \"feishu\",\n \" Send Feishu? zero feishu message send --help\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"mail\",\n \" Link Gmail draft? zero mail link --help\",\n payload,\n featureSwitchOverrides,\n ),\n \" Send Teams? zero teams message send --help\",\n \" Upload Teams? zero teams upload-file --help\",\n \" Download Teams? zero teams download-file --help\",\n \" Upload GitHub? zero github upload-file --help\",\n \" Download GitHub? zero github download-file --help\",\n \" List Telegram bots? zero telegram bot list\",\n \" Send Telegram? zero telegram message send --help\",\n \" Upload Telegram? zero telegram upload-file --help\",\n \" Download Telegram? zero telegram download-file --help\",\n \" Send AgentPhone? zero phone message --help\",\n \" Upload AgentPhone? zero phone upload-file --help\",\n \" Download AgentPhone? zero phone download-file --help\",\n \" List models? zero model ls\",\n \" Model routing? zero model-provider ls\",\n \" Update yourself? zero agent --help\",\n \" Manage workflows? zero workflow --help\",\n ...commandExampleIfVisible(\n \"chat\",\n ' Rename this chat? zero chat rename \"New title\"',\n payload,\n featureSwitchOverrides,\n ),\n \" Introduce Zero? zero intro\",\n \" List generators? zero generate --help\",\n ' Generate image? zero generate image --raw-prompt \"...\"',\n ' Generate website? zero generate website --prompt \"...\"',\n ' Generate voice? zero generate voice --prompt \"...\"',\n ...(canWriteHost\n ? [\" Host a static site? zero host ./dist --site my-site --spa\"]\n : []),\n ...(canReadHost\n ? [\" Clone hosted site? zero host clone <public-slug>\"]\n : []),\n ...commandExampleIfVisible(\n \"maps\",\n ' Get directions? zero maps directions --origin \"SFO\" --destination \"Mountain View\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"weather\",\n \" Check weather? zero weather current --lat 39.9042 --lng 116.4074 --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"scrape\",\n \" Scrape a web page? zero scrape https://example.com --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"web-search\",\n ' Search the public web? zero web-search \"latest news\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"recognize\",\n ' Recognize an image? zero recognize --file ./image.png --prompt \"Describe it\"',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"finance\",\n \" Get a market quote? zero finance quote AAPL --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"people-search\",\n ' Find a professional? zero people-search \"platform engineering leaders\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"banking\",\n \" Read bank data? zero banking accounts --json\",\n payload,\n featureSwitchOverrides,\n ),\n \" Check your identity? zero whoami\",\n ];\n\n return `\\nExamples:\\n${examples.join(\"\\n\")}`;\n}\n\n/**\n * Register commands with visibility based on ZERO_TOKEN capabilities.\n * Commands not granted by the token are registered as hidden via\n * Commander's public `addCommand(cmd, { hidden: true })` API.\n * Without ZERO_TOKEN, globally available commands stay visible while\n * run-only commands remain hidden.\n *\n * @param commands - override default commands (used in tests)\n */\nexport function registerZeroCommands(\n prog: Command,\n commands?: Command[],\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): void {\n const token = process.env.ZERO_TOKEN;\n const payload = token ? decodeZeroTokenPayload(token) : undefined;\n\n for (const cmd of commands ?? buildDefaultCommands()) {\n if (!isCommandFeatureEnabled(cmd.name(), payload, featureSwitchOverrides)) {\n continue;\n }\n addZeroCommand(prog, cmd, payload, featureSwitchOverrides);\n }\n}\n\nconst program = new Command();\n\ndeclare const __CLI_VERSION__: string;\n\nprogram\n .name(\"zero\")\n .description(\n \"Zero CLI — interact with the zero platform from inside the sandbox\",\n )\n .version(__CLI_VERSION__)\n .addHelpText(\"after\", () => {\n return buildZeroHelpText();\n });\n\nexport { program };\n\nif (\n process.argv[1]?.endsWith(\"zero.js\") ||\n process.argv[1]?.endsWith(\"zero.ts\") ||\n process.argv[1]?.endsWith(\"zero\")\n) {\n await configureGlobalProxyFromEnv();\n const requestedCommand = await loadZeroCommand(getRequestedZeroCommandName());\n registerZeroCommands(\n program,\n requestedCommand ? [requestedCommand] : undefined,\n );\n program.parse();\n}\n","declare const __CLI_VERSION__: string;\ndeclare const __DEFAULT_SENTRY_DSN__: string;\n\nconst DSN = process.env.SENTRY_DSN ?? __DEFAULT_SENTRY_DSN__;\n\nconst OPERATIONAL_ERROR_PATTERNS = [\n /not authenticated/i,\n /not found/i,\n /agent not found/i,\n /version not found/i,\n /checkpoint not found/i,\n /session not found/i,\n /file not found/i,\n /environment file not found/i,\n /invalid format/i,\n /invalid.*config/i,\n /rate limit/i,\n /concurrent run limit/i,\n /insufficient.*credit/i,\n /no model provider/i,\n /network error/i,\n /network issue/i,\n /fetch failed/i,\n /connection refused/i,\n /timeout/i,\n /ECONNREFUSED/i,\n /ETIMEDOUT/i,\n /forbidden/i,\n /access denied/i,\n];\n\nfunction isOperationalError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n\n const message = error.message;\n return OPERATIONAL_ERROR_PATTERNS.some((pattern) => {\n return pattern.test(message);\n });\n}\n\nif (DSN) {\n const [Sentry, os] = await Promise.all([\n import(\"@sentry/node\"),\n import(\"node:os\"),\n ]);\n\n Sentry.init({\n dsn: DSN,\n environment: process.env.SENTRY_ENVIRONMENT ?? \"production\",\n release: __CLI_VERSION__,\n sendDefaultPii: false,\n tracesSampleRate: 0,\n shutdownTimeout: 500,\n initialScope: {\n tags: {\n app: \"cli\",\n },\n },\n // Filter out operational errors - only send programmer errors (bugs)\n beforeSend(event, hint) {\n const error = hint.originalException;\n if (isOperationalError(error)) {\n return null; // Drop operational errors\n }\n return event;\n },\n });\n\n Sentry.setContext(\"cli\", {\n version: __CLI_VERSION__,\n command: process.argv.slice(2).join(\" \"),\n });\n\n Sentry.setContext(\"runtime\", {\n node_version: process.version,\n os_platform: os.platform(),\n os_release: os.release(),\n });\n}\n\nfunction handleEpipe(err: NodeJS.ErrnoException) {\n if (err.code === \"EPIPE\") {\n process.exit(0);\n }\n throw err;\n}\n\nprocess.stdout.on(\"error\", handleEpipe);\nprocess.stderr.on(\"error\", handleEpipe);\n","interface ProxyConfig {\n httpProxy?: string;\n httpsProxy?: string;\n noProxy?: string;\n}\n\nlet configured = false;\n\nfunction getEnvValue(\n lowercaseKey: string,\n uppercaseKey: string,\n): string | null {\n const lowercaseValue = process.env[lowercaseKey]?.trim();\n if (lowercaseValue) {\n return lowercaseValue;\n }\n\n const uppercaseValue = process.env[uppercaseKey]?.trim();\n if (uppercaseValue) {\n return uppercaseValue;\n }\n\n return null;\n}\n\nfunction getProxyConfigFromEnv(): ProxyConfig | null {\n const httpProxy = getEnvValue(\"http_proxy\", \"HTTP_PROXY\");\n const httpsProxy = getEnvValue(\"https_proxy\", \"HTTPS_PROXY\");\n\n if (!httpProxy && !httpsProxy) {\n return null;\n }\n\n const noProxy = getEnvValue(\"no_proxy\", \"NO_PROXY\");\n const config: ProxyConfig = {};\n\n if (httpProxy) {\n config.httpProxy = httpProxy;\n }\n\n if (httpsProxy) {\n config.httpsProxy = httpsProxy;\n }\n\n if (noProxy) {\n config.noProxy = noProxy;\n }\n\n return config;\n}\n\nexport async function configureGlobalProxyFromEnv(): Promise<void> {\n if (configured) {\n return;\n }\n\n const config = getProxyConfigFromEnv();\n if (!config) {\n return;\n }\n\n try {\n const { EnvHttpProxyAgent, setGlobalDispatcher } = await import(\"undici\");\n const dispatcher = new EnvHttpProxyAgent(config);\n setGlobalDispatcher(dispatcher);\n configured = true;\n } catch (error) {\n throw new Error(\n \"Invalid proxy configuration. Check HTTP_PROXY/HTTPS_PROXY/NO_PROXY values.\",\n {\n cause: error instanceof Error ? error : undefined,\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAGA,IAAM,MAAM,QAAQ,IAAI,cAAc;AAEtC,IAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,mBAAmB,OAAyB;AACnD,MAAI,EAAE,iBAAiB,QAAQ;AAC7B,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,MAAM;AACtB,SAAO,2BAA2B,KAAK,CAAC,YAAY;AAClD,WAAO,QAAQ,KAAK,OAAO;AAAA,EAC7B,CAAC;AACH;AAEA,IAAI,KAAK;AACP,QAAM,CAAC,QAAQ,EAAE,IAAI,MAAM,QAAQ,IAAI;AAAA,IACrC,OAAO,mBAAc;AAAA,IACrB,OAAO,IAAS;AAAA,EAClB,CAAC;AAED,SAAO,KAAK;AAAA,IAC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,CAAC,gBAAgB,IAAI;AAAA,EAC1C;AACA,UAAQ,MAAM;AAChB;","names":[]}
1
+ {"version":3,"sources":["../src/zero.ts","../src/instrument.ts","../src/lib/network/proxy.ts"],"sourcesContent":["// Zero CLI entry point - standalone binary for zero platform commands\n// Sentry must be initialized before any other imports\nimport \"./instrument.js\";\nimport { Command } from \"commander\";\nimport { FeatureSwitchKey } from \"@vm0/core/feature-switch-key\";\nimport { isFeatureEnabled } from \"@vm0/core/feature-switch\";\nimport { configureGlobalProxyFromEnv } from \"./lib/network/proxy.js\";\nimport {\n decodeZeroTokenPayload,\n type ZeroTokenPayload,\n} from \"./lib/api/zero-token.js\";\n\ninterface ZeroCommandDefinition {\n name: string;\n description: string;\n load: () => Promise<Command>;\n}\n\n/**\n * Map of command names to the capability required to see them.\n * Commands not in this map are hidden when ZERO_TOKEN is active.\n * Use an array when a top-level command has subcommands with different\n * capability gates and any one of them should make the command visible.\n * Use `null` for commands that should always be visible in sandbox.\n */\nconst COMMAND_CAPABILITY_MAP: Record<\n string,\n string | readonly string[] | null\n> = {\n agent: \"agent:read\",\n workflow: \"agent:read\",\n goal: [\"goal:read\", \"goal:agent-result:write\", \"goal:user-control:write\"],\n connector: [\"connector:read\", \"connector:write\"],\n mail: \"connector:read\",\n doctor: null,\n credit: [\"billing:read\", \"billing:write\"],\n upgrade: null,\n model: null,\n \"model-provider\": null,\n logs: \"agent-run:read\",\n search: \"chat-event:read\",\n chat: [\n \"chat-event:read\",\n \"chat-event:write\",\n \"chat-thread:read\",\n \"chat-thread:write\",\n ],\n resource: null,\n github: [\"github:read\", \"github:write\"],\n slack: \"slack:write\",\n feishu: \"feishu:write\",\n teams: \"teams:write\",\n telegram: [\"telegram:read\", \"telegram:write\"],\n phone: [\"phone:read\", \"phone:write\"],\n whoami: null,\n \"developer-support\": null,\n \"computer-use\": \"computer-use:write\",\n browser: [\"browser:read\", \"browser:write\"],\n intro: null,\n generate: null,\n web: null,\n video: null,\n host: [\"host:read\", \"host:write\"],\n maps: \"maps:read\",\n weather: \"weather:read\",\n scrape: \"scrape:read\",\n \"people-search\": \"people-search:read\",\n \"web-search\": \"web-search:read\",\n recognize: \"image-recognition:write\",\n finance: \"finance:read\",\n banking: \"banking:read\",\n};\n\nconst COMMAND_FEATURE_SWITCH_MAP: Readonly<\n Partial<Record<string, FeatureSwitchKey>>\n> = {\n browser: FeatureSwitchKey.ZeroBrowser,\n};\n\nconst RUN_ONLY_COMMANDS = new Set([\"recognize\"]);\n\ntype FeatureSwitchOverrides = Partial<Record<FeatureSwitchKey, boolean>>;\n\nconst ZERO_COMMAND_DEFINITIONS: readonly ZeroCommandDefinition[] = [\n {\n name: \"org\",\n description: \"Manage organization settings, members, and providers\",\n load: async () => {\n return (await import(\"./commands/zero/org\")).zeroOrgCommand;\n },\n },\n {\n name: \"model\",\n description: \"List available models and model-switching guidance\",\n load: async () => {\n return (await import(\"./commands/zero/model\")).zeroModelCommand;\n },\n },\n {\n name: \"model-provider\",\n description: \"Inspect model provider routing\",\n load: async () => {\n return (await import(\"./commands/zero/model-provider\"))\n .zeroModelProviderCommand;\n },\n },\n {\n name: \"agent\",\n description: \"View or manage zero agents\",\n load: async () => {\n return (await import(\"./commands/zero/agent\")).zeroAgentCommand;\n },\n },\n {\n name: \"connector\",\n description: \"Check third-party service connections (GitHub, Slack, etc.)\",\n load: async () => {\n return (await import(\"./commands/zero/connector\")).zeroConnectorCommand;\n },\n },\n {\n name: \"mail\",\n description: \"Review and send mail through Gmail or Outlook Mail\",\n load: async () => {\n return (await import(\"./commands/zero/mail\")).zeroMailCommand;\n },\n },\n {\n name: \"credit\",\n description: \"View or buy credits\",\n load: async () => {\n return (await import(\"./commands/zero/credit\")).zeroCreditCommand;\n },\n },\n {\n name: \"upgrade\",\n description: \"Create a workspace plan upgrade link\",\n load: async () => {\n return (await import(\"./commands/zero/upgrade\")).zeroUpgradeCommand;\n },\n },\n {\n name: \"doctor\",\n description:\n \"Diagnose runtime issues (connector health, permission denials)\",\n load: async () => {\n return (await import(\"./commands/zero/doctor\")).zeroDoctorCommand;\n },\n },\n {\n name: \"preference\",\n description: \"View or update user preferences (timezone, notifications)\",\n load: async () => {\n return (await import(\"./commands/zero/preference\")).zeroPreferenceCommand;\n },\n },\n {\n name: \"secret\",\n description: \"Read or write secrets (API keys, tokens)\",\n load: async () => {\n return (await import(\"./commands/zero/secret\")).zeroSecretCommand;\n },\n },\n {\n name: \"github\",\n description: \"Upload and download GitHub files\",\n load: async () => {\n return (await import(\"./commands/zero/github\")).zeroGithubCommand;\n },\n },\n {\n name: \"slack\",\n description:\n \"Send messages, upload files, and download files from Slack as the bot\",\n load: async () => {\n return (await import(\"./commands/zero/slack\")).zeroSlackCommand;\n },\n },\n {\n name: \"feishu\",\n description: \"Send messages to Feishu as an organization bot\",\n load: async () => {\n return (await import(\"./commands/zero/feishu\")).zeroFeishuCommand;\n },\n },\n {\n name: \"teams\",\n description:\n \"Send Microsoft Teams messages, upload files, and download files\",\n load: async () => {\n return (await import(\"./commands/zero/teams\")).zeroTeamsCommand;\n },\n },\n {\n name: \"telegram\",\n description:\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n load: async () => {\n return (await import(\"./commands/zero/telegram\")).zeroTelegramCommand;\n },\n },\n {\n name: \"phone\",\n description: \"Send AgentPhone messages, upload files, and download media\",\n load: async () => {\n return (await import(\"./commands/zero/phone\")).zeroPhoneCommand;\n },\n },\n {\n name: \"variable\",\n description: \"Read or write non-sensitive configuration values\",\n load: async () => {\n return (await import(\"./commands/zero/variable\")).zeroVariableCommand;\n },\n },\n {\n name: \"logs\",\n description: \"View and search agent run logs\",\n load: async () => {\n return (await import(\"./commands/zero/logs\")).zeroLogsCommand;\n },\n },\n {\n name: \"search\",\n description: \"Search logs, chat, or get a recipe for external sources\",\n load: async () => {\n return (await import(\"./commands/zero/search\")).zeroSearchCommand;\n },\n },\n {\n name: \"chat\",\n description: \"Manage the current web chat thread\",\n load: async () => {\n return (await import(\"./commands/zero/chat\")).zeroChatCommand;\n },\n },\n {\n name: \"resource\",\n description: \"Pull registry resources from private R2-backed archives\",\n load: async () => {\n return (await import(\"./commands/zero/resource\")).zeroResourceCommand;\n },\n },\n {\n name: \"whoami\",\n description: \"Show agent identity, run ID, and capabilities\",\n load: async () => {\n return (await import(\"./commands/zero/whoami\")).zeroWhoamiCommand;\n },\n },\n {\n name: \"intro\",\n description: \"Print Zero's self-introduction and capability guide\",\n load: async () => {\n return (await import(\"./commands/zero/intro\")).zeroIntroCommand;\n },\n },\n {\n name: \"workflow\",\n description: \"Manage workflows\",\n load: async () => {\n return (await import(\"./commands/zero/workflow\")).zeroWorkflowCommand;\n },\n },\n {\n name: \"goal\",\n description: \"Manage the current thread goal\",\n load: async () => {\n return (await import(\"./commands/zero/goal\")).zeroGoalCommand;\n },\n },\n {\n name: \"developer-support\",\n description: \"Submit a diagnostic report to the dev team\",\n load: async () => {\n return (await import(\"./commands/zero/developer-support\"))\n .zeroDeveloperSupportCommand;\n },\n },\n {\n name: \"computer-use\",\n description: \"Desktop app computer use through Zero CLI\",\n load: async () => {\n return (await import(\"./commands/zero/computer-use\"))\n .zeroComputerUseCommand;\n },\n },\n {\n name: \"browser\",\n description: \"Managed remote browser sessions for agent-browser\",\n load: async () => {\n return (await import(\"./commands/zero/browser\")).zeroBrowserCommand;\n },\n },\n {\n name: \"generate\",\n description:\n \"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance\",\n load: async () => {\n return (await import(\"./commands/zero/generate\")).generateCommand;\n },\n },\n {\n name: \"web\",\n description: \"Upload and download files via the web chat endpoint\",\n load: async () => {\n return (await import(\"./commands/zero/web\")).zeroWebCommand;\n },\n },\n {\n name: \"video\",\n description: \"Video processing utilities\",\n load: async () => {\n return (await import(\"./commands/zero/video\")).zeroVideoCommand;\n },\n },\n {\n name: \"host\",\n description: \"Publish static sites and clone owned hosted site files\",\n load: async () => {\n return (await import(\"./commands/zero/host\")).zeroHostCommand;\n },\n },\n {\n name: \"maps\",\n description: \"Use managed zero maps services\",\n load: async () => {\n return (await import(\"./commands/zero/maps\")).zeroMapsCommand;\n },\n },\n {\n name: \"weather\",\n description: \"Use managed Zero weather services\",\n load: async () => {\n return (await import(\"./commands/zero/weather\")).zeroWeatherCommand;\n },\n },\n {\n name: \"scrape\",\n description: \"Scrape public web pages through managed zero scrape\",\n load: async () => {\n return (await import(\"./commands/zero/scrape\")).zeroScrapeCommand;\n },\n },\n {\n name: \"people-search\",\n description: \"Find professionals through managed zero people search\",\n load: async () => {\n return (await import(\"./commands/zero/people-search\"))\n .zeroPeopleSearchCommand;\n },\n },\n {\n name: \"web-search\",\n description: \"Search the public web through managed zero web search\",\n load: async () => {\n return (await import(\"./commands/zero/web-search\")).zeroWebSearchCommand;\n },\n },\n {\n name: \"recognize\",\n description: \"Recognize one image through a managed multimodal model\",\n load: async () => {\n return (await import(\"./commands/zero/recognize\")).zeroRecognizeCommand;\n },\n },\n {\n name: \"finance\",\n description: \"Query financial instruments through managed zero finance\",\n load: async () => {\n return (await import(\"./commands/zero/finance\")).zeroFinanceCommand;\n },\n },\n {\n name: \"banking\",\n description: \"Use managed zero banking services\",\n load: async () => {\n return (await import(\"./commands/zero/banking\")).zeroBankingCommand;\n },\n },\n];\n\nconst ZERO_COMMAND_DEFINITION_BY_NAME = new Map(\n ZERO_COMMAND_DEFINITIONS.map((definition) => {\n return [definition.name, definition];\n }),\n);\n\nfunction createZeroCommandStub(definition: ZeroCommandDefinition): Command {\n return new Command(definition.name).description(definition.description);\n}\n\nfunction buildDefaultCommands(): Command[] {\n return ZERO_COMMAND_DEFINITIONS.map(createZeroCommandStub);\n}\n\nfunction shouldHideCommand(\n name: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): boolean {\n if (!isCommandFeatureEnabled(name, payload, featureSwitchOverrides)) {\n return true;\n }\n if (!payload) return RUN_ONLY_COMMANDS.has(name);\n const requiredCap = COMMAND_CAPABILITY_MAP[name];\n if (requiredCap === undefined) return true;\n if (requiredCap === null) return false;\n if (typeof requiredCap !== \"string\") {\n return !requiredCap.some((capability) => {\n return payload.capabilities.includes(capability);\n });\n }\n return !payload.capabilities.includes(requiredCap);\n}\n\nfunction isCommandFeatureEnabled(\n name: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): boolean {\n const featureSwitch = COMMAND_FEATURE_SWITCH_MAP[name];\n const overrides = featureSwitchOverrides ?? payload?.featureSwitchOverrides;\n return (\n !featureSwitch ||\n isFeatureEnabled(featureSwitch, {\n userId: payload?.userId,\n orgId: payload?.orgId,\n overrides,\n })\n );\n}\n\nfunction addZeroCommand(\n prog: Command,\n cmd: Command,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): void {\n const hidden = shouldHideCommand(cmd.name(), payload, featureSwitchOverrides);\n prog.addCommand(cmd, hidden ? { hidden: true } : {});\n}\n\nfunction getNonOptionArgs(argv: string[]): string[] {\n const args: string[] = [];\n\n for (const arg of argv.slice(2)) {\n if (arg === \"--\") {\n break;\n }\n if (arg.startsWith(\"-\")) {\n continue;\n }\n args.push(arg);\n }\n\n return args;\n}\n\nfunction getRequestedZeroCommandName(argv = process.argv): string | undefined {\n const [firstArg, secondArg] = getNonOptionArgs(argv);\n\n if (!firstArg) {\n return undefined;\n }\n\n if (firstArg === \"help\") {\n return secondArg;\n }\n\n return firstArg;\n}\n\nasync function loadZeroCommand(\n name: string | undefined,\n): Promise<Command | undefined> {\n if (!name) {\n return undefined;\n }\n\n return ZERO_COMMAND_DEFINITION_BY_NAME.get(name)?.load();\n}\n\nfunction commandExampleIfVisible(\n name: string,\n example: string,\n payload: ZeroTokenPayload | undefined,\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): string[] {\n return shouldHideCommand(name, payload, featureSwitchOverrides)\n ? []\n : [example];\n}\n\nexport function buildZeroHelpText(\n payload: ZeroTokenPayload | undefined = decodeZeroTokenPayload(),\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): string {\n const canReadHost = !payload || payload.capabilities.includes(\"host:read\");\n const canWriteHost = !payload || payload.capabilities.includes(\"host:write\");\n const examples = [\n \" Check a connector? zero connector check --env-name <ENV_NAME>\",\n ...(payload && !payload.capabilities.includes(\"billing:read\")\n ? []\n : [\" Check credits? zero credit\"]),\n ...(payload && !payload.capabilities.includes(\"billing:write\")\n ? []\n : [\" Buy credits? zero credit 20000\"]),\n ...commandExampleIfVisible(\n \"upgrade\",\n \" Upgrade plan? zero upgrade pro\",\n payload,\n featureSwitchOverrides,\n ),\n \" Send a Slack message? zero slack message send --help\",\n ...commandExampleIfVisible(\n \"feishu\",\n \" Send Feishu? zero feishu message send --help\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"mail\",\n \" Link Gmail draft? zero mail link --help\",\n payload,\n featureSwitchOverrides,\n ),\n \" Send Teams? zero teams message send --help\",\n \" Upload Teams? zero teams upload-file --help\",\n \" Download Teams? zero teams download-file --help\",\n \" Upload GitHub? zero github upload-file --help\",\n \" Download GitHub? zero github download-file --help\",\n \" List Telegram bots? zero telegram bot list\",\n \" Send Telegram? zero telegram message send --help\",\n \" Upload Telegram? zero telegram upload-file --help\",\n \" Download Telegram? zero telegram download-file --help\",\n \" Send AgentPhone? zero phone message --help\",\n \" Upload AgentPhone? zero phone upload-file --help\",\n \" Download AgentPhone? zero phone download-file --help\",\n \" List models? zero model ls\",\n \" Model routing? zero model-provider ls\",\n \" Update yourself? zero agent --help\",\n \" Manage workflows? zero workflow --help\",\n ...commandExampleIfVisible(\n \"chat\",\n ' Rename this chat? zero chat rename \"New title\"',\n payload,\n featureSwitchOverrides,\n ),\n \" Introduce Zero? zero intro\",\n \" List generators? zero generate --help\",\n ' Generate image? zero generate image --raw-prompt \"...\"',\n ' Generate website? zero generate website --prompt \"...\"',\n ' Generate voice? zero generate voice --prompt \"...\"',\n ...(canWriteHost\n ? [\" Host a static site? zero host ./dist --site my-site --spa\"]\n : []),\n ...(canReadHost\n ? [\" Clone hosted site? zero host clone <public-slug>\"]\n : []),\n ...commandExampleIfVisible(\n \"maps\",\n ' Get directions? zero maps directions --origin \"SFO\" --destination \"Mountain View\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"weather\",\n \" Check weather? zero weather current --lat 39.9042 --lng 116.4074 --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"scrape\",\n \" Scrape a web page? zero scrape https://example.com --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"web-search\",\n ' Search the public web? zero web-search \"latest news\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"recognize\",\n ' Recognize an image? zero recognize --file ./image.png --prompt \"Describe it\"',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"finance\",\n \" Get a market quote? zero finance quote AAPL --json\",\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"people-search\",\n ' Find a professional? zero people-search \"platform engineering leaders\" --json',\n payload,\n featureSwitchOverrides,\n ),\n ...commandExampleIfVisible(\n \"banking\",\n \" Read bank data? zero banking accounts --json\",\n payload,\n featureSwitchOverrides,\n ),\n \" Check your identity? zero whoami\",\n ];\n\n return `\\nExamples:\\n${examples.join(\"\\n\")}`;\n}\n\n/**\n * Register commands with visibility based on ZERO_TOKEN capabilities.\n * Commands not granted by the token are registered as hidden via\n * Commander's public `addCommand(cmd, { hidden: true })` API.\n * Without ZERO_TOKEN, globally available commands stay visible while\n * run-only commands remain hidden.\n *\n * @param commands - override default commands (used in tests)\n */\nexport function registerZeroCommands(\n prog: Command,\n commands?: Command[],\n featureSwitchOverrides?: FeatureSwitchOverrides,\n): void {\n const token = process.env.ZERO_TOKEN;\n const payload = token ? decodeZeroTokenPayload(token) : undefined;\n\n for (const cmd of commands ?? buildDefaultCommands()) {\n if (!isCommandFeatureEnabled(cmd.name(), payload, featureSwitchOverrides)) {\n continue;\n }\n addZeroCommand(prog, cmd, payload, featureSwitchOverrides);\n }\n}\n\nconst program = new Command();\n\ndeclare const __CLI_VERSION__: string;\n\nprogram\n .name(\"zero\")\n .description(\n \"Zero CLI — interact with the zero platform from inside the sandbox\",\n )\n .version(__CLI_VERSION__)\n .addHelpText(\"after\", () => {\n return buildZeroHelpText();\n });\n\nexport { program };\n\nif (\n process.argv[1]?.endsWith(\"zero.js\") ||\n process.argv[1]?.endsWith(\"zero.ts\") ||\n process.argv[1]?.endsWith(\"zero\")\n) {\n await configureGlobalProxyFromEnv();\n const requestedCommand = await loadZeroCommand(getRequestedZeroCommandName());\n registerZeroCommands(\n program,\n requestedCommand ? [requestedCommand] : undefined,\n );\n program.parse();\n}\n","declare const __CLI_VERSION__: string;\ndeclare const __DEFAULT_SENTRY_DSN__: string;\n\nconst DSN = process.env.SENTRY_DSN ?? __DEFAULT_SENTRY_DSN__;\n\nconst OPERATIONAL_ERROR_PATTERNS = [\n /not authenticated/i,\n /not found/i,\n /agent not found/i,\n /version not found/i,\n /checkpoint not found/i,\n /session not found/i,\n /file not found/i,\n /environment file not found/i,\n /invalid format/i,\n /invalid.*config/i,\n /rate limit/i,\n /concurrent run limit/i,\n /insufficient.*credit/i,\n /no model provider/i,\n /network error/i,\n /network issue/i,\n /fetch failed/i,\n /connection refused/i,\n /timeout/i,\n /ECONNREFUSED/i,\n /ETIMEDOUT/i,\n /forbidden/i,\n /access denied/i,\n];\n\nfunction isOperationalError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n\n const message = error.message;\n return OPERATIONAL_ERROR_PATTERNS.some((pattern) => {\n return pattern.test(message);\n });\n}\n\nif (DSN) {\n const [Sentry, os] = await Promise.all([\n import(\"@sentry/node\"),\n import(\"node:os\"),\n ]);\n\n Sentry.init({\n dsn: DSN,\n environment: process.env.SENTRY_ENVIRONMENT ?? \"production\",\n release: __CLI_VERSION__,\n sendDefaultPii: false,\n tracesSampleRate: 0,\n shutdownTimeout: 500,\n initialScope: {\n tags: {\n app: \"cli\",\n },\n },\n // Filter out operational errors - only send programmer errors (bugs)\n beforeSend(event, hint) {\n const error = hint.originalException;\n if (isOperationalError(error)) {\n return null; // Drop operational errors\n }\n return event;\n },\n });\n\n Sentry.setContext(\"cli\", {\n version: __CLI_VERSION__,\n command: process.argv.slice(2).join(\" \"),\n });\n\n Sentry.setContext(\"runtime\", {\n node_version: process.version,\n os_platform: os.platform(),\n os_release: os.release(),\n });\n}\n\nfunction handleEpipe(err: NodeJS.ErrnoException) {\n if (err.code === \"EPIPE\") {\n process.exit(0);\n }\n throw err;\n}\n\nprocess.stdout.on(\"error\", handleEpipe);\nprocess.stderr.on(\"error\", handleEpipe);\n","interface ProxyConfig {\n httpProxy?: string;\n httpsProxy?: string;\n noProxy?: string;\n}\n\nlet configured = false;\n\nfunction getEnvValue(\n lowercaseKey: string,\n uppercaseKey: string,\n): string | null {\n const lowercaseValue = process.env[lowercaseKey]?.trim();\n if (lowercaseValue) {\n return lowercaseValue;\n }\n\n const uppercaseValue = process.env[uppercaseKey]?.trim();\n if (uppercaseValue) {\n return uppercaseValue;\n }\n\n return null;\n}\n\nfunction getProxyConfigFromEnv(): ProxyConfig | null {\n const httpProxy = getEnvValue(\"http_proxy\", \"HTTP_PROXY\");\n const httpsProxy = getEnvValue(\"https_proxy\", \"HTTPS_PROXY\");\n\n if (!httpProxy && !httpsProxy) {\n return null;\n }\n\n const noProxy = getEnvValue(\"no_proxy\", \"NO_PROXY\");\n const config: ProxyConfig = {};\n\n if (httpProxy) {\n config.httpProxy = httpProxy;\n }\n\n if (httpsProxy) {\n config.httpsProxy = httpsProxy;\n }\n\n if (noProxy) {\n config.noProxy = noProxy;\n }\n\n return config;\n}\n\nexport async function configureGlobalProxyFromEnv(): Promise<void> {\n if (configured) {\n return;\n }\n\n const config = getProxyConfigFromEnv();\n if (!config) {\n return;\n }\n\n try {\n const { EnvHttpProxyAgent, setGlobalDispatcher } = await import(\"undici\");\n const dispatcher = new EnvHttpProxyAgent(config);\n setGlobalDispatcher(dispatcher);\n configured = true;\n } catch (error) {\n throw new Error(\n \"Invalid proxy configuration. Check HTTP_PROXY/HTTPS_PROXY/NO_PROXY values.\",\n {\n cause: error instanceof Error ? error : undefined,\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAGA,IAAM,MAAM,QAAQ,IAAI,cAAc;AAEtC,IAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAAS,mBAAmB,OAAyB;AACnD,MAAI,EAAE,iBAAiB,QAAQ;AAC7B,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,MAAM;AACtB,SAAO,2BAA2B,KAAK,CAAC,YAAY;AAClD,WAAO,QAAQ,KAAK,OAAO;AAAA,EAC7B,CAAC;AACH;AAEA,IAAI,KAAK;AACP,QAAM,CAAC,QAAQ,EAAE,IAAI,MAAM,QAAQ,IAAI;AAAA,IACrC,OAAO,mBAAc;AAAA,IACrB,OAAO,IAAS;AAAA,EAClB,CAAC;AAED,SAAO,KAAK;AAAA,IACV,KAAK;AAAA,IACL,aAAa,QAAQ,IAAI,sBAAsB;AAAA,IAC/C,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,cAAc;AAAA,MACZ,MAAM;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,IACF;AAAA;AAAA,IAEA,WAAW,OAAO,MAAM;AACtB,YAAM,QAAQ,KAAK;AACnB,UAAI,mBAAmB,KAAK,GAAG;AAC7B,eAAO;AAAA,MACT;AACA,aAAO;AAA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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AAAA;AAAA,EAAgB,SAAS,KAAK,IAAI,CAAC;AAC5C;AAWO,SAAS,qBACd,MACA,UACA,wBACM;AACN,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,UAAU,QAAQ,uBAAuB,KAAK,IAAI;AAExD,aAAW,OAAO,YAAY,qBAAqB,GAAG;AACpD,QAAI,CAAC,wBAAwB,IAAI,KAAK,GAAG,SAAS,sBAAsB,GAAG;AACzE;AAAA,IACF;AACA,mBAAe,MAAM,KAAK,SAAS,sBAAsB;AAAA,EAC3D;AACF;AAEA,IAAM,UAAU,IAAI,QAAQ;AAI5B,QACG,KAAK,MAAM,EACX;AAAA,EACC;AACF,EACC,QAAQ,SAAe,EACvB,YAAY,SAAS,MAAM;AAC1B,SAAO,kBAAkB;AAC3B,CAAC;AAIH,IACE,QAAQ,KAAK,CAAC,GAAG,SAAS,SAAS,KACnC,QAAQ,KAAK,CAAC,GAAG,SAAS,SAAS,KACnC,QAAQ,KAAK,CAAC,GAAG,SAAS,MAAM,GAChC;AACA,QAAM,4BAA4B;AAClC,QAAM,mBAAmB,MAAM,gBAAgB,4BAA4B,CAAC;AAC5E;AAAA,IACE;AAAA,IACA,mBAAmB,CAAC,gBAAgB,IAAI;AAAA,EAC1C;AACA,UAAQ,MAAM;AAChB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/feature-switch-key.ts","../../../packages/core/src/feature-switch.ts","../../../packages/core/src/identity-hash.ts"],"sourcesContent":["/**\n * Feature switch keys\n *\n * Defines all available feature switch identifiers.\n */\nexport enum FeatureSwitchKey {\n Dummy = \"dummy\",\n AhrefsConnector = \"ahrefsConnector\",\n BillConnector = \"billConnector\",\n BentomlConnector = \"bentomlConnector\",\n BoxConnector = \"boxConnector\",\n CanvaConnector = \"canvaConnector\",\n CalComConnector = \"calComConnector\",\n CopperConnector = \"copperConnector\",\n DatadogConnector = \"datadogConnector\",\n DeelConnector = \"deelConnector\",\n DocuSignConnector = \"docusignConnector\",\n DropboxConnector = \"dropboxConnector\",\n FigmaConnector = \"figmaConnector\",\n ExpensifyConnector = \"expensifyConnector\",\n GoogleContactsConnector = \"googleContactsConnector\",\n GoogleFormsConnector = \"googleFormsConnector\",\n JoggAiConnector = \"joggAiConnector\",\n JoggAiBuiltIn = \"joggAiBuiltIn\",\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 ZeroBrowser = \"zeroBrowser\",\n ZeroChatMessaging = \"zeroChatMessaging\",\n ZeroImageRecognition = \"zeroImageRecognition\",\n ZeroMailReplyFollowUp = \"zeroMailReplyFollowUp\",\n RustZeroCli = \"rustZeroCli\",\n Banking = \"banking\",\n Lab = \"lab\",\n NotionWorkflowAutomations = \"notionWorkflowAutomations\",\n GithubWebhookAutomations = \"githubWebhookAutomations\",\n MorningBrief = \"morningBrief\",\n ManualMorningBrief = \"manualMorningBrief\",\n TestOauthConnector = \"testOauthConnector\",\n FreshdeskConnector = \"freshdeskConnector\",\n StabilityAiConnector = \"stabilityAiConnector\",\n ZoomConnector = \"zoomConnector\",\n WorkdayConnector = \"workdayConnector\",\n CodexFastMode = \"codexFastMode\",\n RealAgentInPreview = \"realAgentInPreview\",\n ComposerUploadPopover = \"composerUploadPopover\",\n StructuredPromptInlineTemplates = \"structuredPromptInlineTemplates\",\n CustomModelGateways = \"customModelGateways\",\n\n ZapierConnector = \"zapierConnector\",\n ComputerUseDesktopPlugins = \"computerUseDesktopPlugins\",\n ChatThreadUnifiedSearch = \"chatThreadUnifiedSearch\",\n ChatErrorRecovery = \"chatErrorRecovery\",\n PwaChatKeyboardGestures = \"pwaChatKeyboardGestures\",\n SidebarSubscriptionUsage = \"sidebarSubscriptionUsage\",\n TeamsIntegration = \"teamsIntegration\",\n FeishuIntegration = \"feishuIntegration\",\n StrapiIntegration = \"strapiIntegration\",\n ArtifactKeyV2 = \"artifactKeyV2\",\n HostedArtifactVersions = \"hostedArtifactVersions\",\n HtmlResourceIndex = \"htmlResourceIndex\",\n WorkflowConnectorReadiness = \"workflowConnectorReadiness\",\n ComposerConnectorPermissions = \"composerConnectorPermissions\",\n ThreeColumnNav = \"threeColumnNav\",\n ChatThreadSidebarAutoOpen = \"chatThreadSidebarAutoOpen\",\n ArtifactSidebarInlineOpen = \"artifactSidebarInlineOpen\",\n CustomConnectorCliCreate = \"customConnectorCliCreate\",\n CustomConnectorOAuth2 = \"customConnectorOAuth2\",\n MermaidDiagrams = \"mermaidDiagrams\",\n CustomConnectorPermissions = \"customConnectorPermissions\",\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. Every registered switch accepts user overrides\n * through `POST /api/zero/feature-switches`. 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}\n\nexport interface FeatureSwitchMetadata {\n readonly maintainer: string;\n readonly description?: string;\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\nconst CUSTOM_MODEL_GATEWAY_ORG_ID_HASHES = [\n ...STAFF_ORG_ID_HASHES,\n \"a6e60503\", // geo rollout workspace\n] as const;\n\n/**\n * Registry of all feature switches\n */\nconst FEATURE_SWITCHES: Record<FeatureSwitchKey, FeatureSwitch> = {\n [FeatureSwitchKey.Dummy]: {\n maintainer: \"ethan@vm0.ai\",\n description: \"Test-only feature switch for flag system validation\",\n enabled: true,\n },\n [FeatureSwitchKey.AhrefsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Ahrefs SEO connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BillConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BILL Spend & Expense connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BentomlConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the BentoML model serving connector\",\n enabled: false,\n },\n [FeatureSwitchKey.BoxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Box file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CanvaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Canva design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CalComConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Cal.com scheduling connector\",\n enabled: false,\n },\n [FeatureSwitchKey.CopperConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Copper CRM connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DatadogConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Datadog observability connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DeelConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Deel HR connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DocuSignConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the DocuSign e-signature connector\",\n enabled: false,\n },\n [FeatureSwitchKey.DropboxConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Dropbox file storage connector\",\n enabled: false,\n },\n [FeatureSwitchKey.FigmaConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Figma design connector\",\n enabled: false,\n },\n [FeatureSwitchKey.ExpensifyConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Expensify accounting connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleContactsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Contacts connector\",\n enabled: false,\n },\n [FeatureSwitchKey.GoogleFormsConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the Google Forms connector\",\n enabled: false,\n },\n [FeatureSwitchKey.JoggAiConnector]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable the JoggAI video generation connector\",\n enabled: true,\n },\n [FeatureSwitchKey.JoggAiBuiltIn]: {\n maintainer: \"yuma@vm0.ai\",\n description: \"Enable vm0-managed JoggAI talking-avatar video generation\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\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.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 },\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 },\n [FeatureSwitchKey.NotionWorkflowAutomations]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Notion event workflow automations, starting with child pages created under a configured parent page.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.GithubWebhookAutomations]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show creation entry points for GitHub workflow job, pull request review, deployment status, and issue comment automations.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\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 },\n [FeatureSwitchKey.StructuredPromptInlineTemplates]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Enable multiple inline artifact templates in structured chat prompts.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.CustomModelGateways]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable admin-defined Anthropic Messages and OpenAI Responses model gateway connections.\",\n enabled: false,\n enabledOrgIdHashes: CUSTOM_MODEL_GATEWAY_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.ComputerUseDesktopPlugins]: {\n maintainer: \"lancy@vm0.ai\",\n description:\n \"Enable Zero Desktop Computer Use plugins for local resources, starting with the bundled filesystem plugin gateway.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatThreadUnifiedSearch]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Show chat thread title results from the local event-driven thread cache in the command-shift-a conversation picker.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatErrorRecovery]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Replace supported Codex and Claude Code limit errors with recovery actions in chat.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.PwaChatKeyboardGestures]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Keep the PWA chat composer pinned above the software keyboard and support swipe-to-dismiss gestures.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ChatThreadSidebarAutoOpen]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Automatically open the latest sidebar-capable card from a running or successfully completed chat run when the utility sidebar is closed and split view is available.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.MermaidDiagrams]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Render ```mermaid code blocks in assistant markdown as diagrams, and tell the web chat agent that they are rendered.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ArtifactSidebarInlineOpen]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Open an artifact clicked in a chat thread inside the already-open artifact sidebar instead of stacking the page-global lightbox over it.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\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.StrapiIntegration]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Enable Strapi integration settings and Strapi entry-published workflow automations.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ArtifactKeyV2]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Store new user artifacts under flat, ten-character hashed public keys.\",\n enabled: true,\n },\n [FeatureSwitchKey.HostedArtifactVersions]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Create immutable hosted artifact versions behind stable site aliases.\",\n enabled: true,\n },\n [FeatureSwitchKey.HtmlResourceIndex]: {\n maintainer: \"bingjie@vm0.ai\",\n description:\n \"Use target-specific static indexes for HTML generation resource selection.\",\n enabled: true,\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 },\n [FeatureSwitchKey.ZeroMailReplyFollowUp]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Enable Zero Mail reply follow-up for staff after all API deployments can read Gmail event configurations with threadId.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroBrowser]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable thread-scoped Cloud browser access in chat and the Zero CLI.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroChatMessaging]: {\n maintainer: \"ethan@vm0.ai\",\n description:\n \"Advertise zero chat create, send, and cancel in the agent system prompt without gating the CLI commands or API.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.ZeroImageRecognition]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Enable managed image recognition for Zero runs whose selected model does not support image input.\",\n enabled: false,\n enabledOrgIdHashes: STAFF_ORG_ID_HASHES,\n },\n [FeatureSwitchKey.RustZeroCli]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Use the runner-bundled Rust zero-cli entry point for Zero CLI commands.\",\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 },\n [FeatureSwitchKey.CustomConnectorCliCreate]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Allow Zero CLI agents to create and configure custom connectors directly.\",\n enabled: true,\n },\n [FeatureSwitchKey.CustomConnectorOAuth2]: {\n maintainer: \"liangyou@vm0.ai\",\n description:\n \"Allow org admins to add OAuth 2.0 authentication to custom connectors.\",\n enabled: true,\n },\n [FeatureSwitchKey.CustomConnectorPermissions]: {\n maintainer: \"yuma@vm0.ai\",\n description:\n \"Allow users to manage agent permission grants for custom connectors.\",\n enabled: 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 };\n }\n return result;\n}\n\n/** Keep overrides for currently registered feature switches. */\nexport function filterFeatureSwitchOverrides(\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 (key in FEATURE_SWITCHES) {\n filtered[key] = value;\n }\n }\n return filtered;\n}\n\n/**\n * Check if a feature is enabled for the given context.\n *\n * `ctx` is required so callers must pass identity (userId/orgId/email) or an\n * explicit `{}`. A switch gated by `enabledUserHashes` / `enabledOrgIdHashes`\n * silently returns `false` when ctx omits identity, which has caused bugs.\n * Client-side callers should usually read the platform `featureSwitch$` signal\n * instead — it also merges DB overrides on top of identity context.\n */\nexport function isFeatureEnabled(\n key: FeatureSwitchKey,\n ctx: FeatureSwitchContext,\n): boolean {\n const override = ctx.overrides?.[key];\n if (override !== undefined) {\n return override;\n }\n\n const featureSwitch = FEATURE_SWITCHES[key];\n if (featureSwitch.enabled) {\n return true;\n }\n if (ctx.userId && featureSwitch.enabledUserHashes?.length) {\n if (featureSwitch.enabledUserHashes.includes(fnv1a(ctx.userId)))\n return true;\n }\n if (ctx.email && featureSwitch.enabledEmailHashes?.length) {\n if (\n featureSwitch.enabledEmailHashes.includes(fnv1a(ctx.email.toLowerCase()))\n )\n return true;\n }\n if (ctx.orgId && featureSwitch.enabledOrgIdHashes?.length) {\n if (featureSwitch.enabledOrgIdHashes.includes(fnv1a(ctx.orgId)))\n return true;\n }\n return false;\n}\n","/**\n * Identity hashing — FNV-1a 32-bit hash used to reference users / orgs / emails\n * without embedding plain-text identifiers in source code.\n *\n * Shared between the feature-switch registry (UI rollout targeting) and\n * `staff-org.ts` (authorization primitive). The hash is deterministic and\n * synchronous; no crypto API needed.\n */\n\nexport function fnv1a(input: string): string {\n let h = 2166136261 >>> 0;\n for (let i = 0; i < input.length; i++) {\n h ^= input.charCodeAt(i);\n h = Math.imul(h, 16777619) >>> 0;\n }\n return h.toString(16).padStart(8, \"0\");\n}\n\n/**\n * Hashes of internal staff org IDs.\n *\n * This list is the source of truth for `isStaffOrg()` — adding an entry here\n * grants that org access to every endpoint that uses `isStaffOrg` as an\n * authorization check. Treat changes with the same care as role grants.\n */\nexport const STAFF_ORG_ID_HASHES: readonly string[] = [\n \"afce210e\", // org_3ANttyrbWYJk6JKRSTRLEsbsDLe\n];\n"],"mappings":";;;;;;;;AAAA;;;ACAA;;;ACAA;AASO,SAAS,MAAM,OAAuB;AAC3C,MAAI,IAAI,eAAe;AACvB,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,SAAK,MAAM,WAAW,CAAC;AACvB,QAAI,KAAK,KAAK,GAAG,QAAQ,MAAM;AAAA,EACjC;AACA,SAAO,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG;AACvC;AASO,IAAM,sBAAyC;AAAA,EACpD;AAAA;AACF;;;ADSA,IAAM,qCAAqC;AAAA,EACzC,GAAG;AAAA,EACH;AAAA;AACF;AAKA,IAAM,mB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