@posthog/wizard 2.80.0 → 2.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +204 -72
- package/dist/{PickerMenu-m4CCPX4f.js → PickerMenu-BGGeYqd-.js} +104 -4
- package/dist/PickerMenu-BGGeYqd-.js.map +1 -0
- package/dist/README.md +13 -8
- package/dist/{agent-interface-CzyCmp7q.js → agent-interface-BFzBnz10.js} +289 -361
- package/dist/agent-interface-BFzBnz10.js.map +1 -0
- package/dist/{agent-prompt-loader-4wMxlYSX.js → agent-prompt-loader-CbCW6YbP.js} +6 -5
- package/dist/agent-prompt-loader-CbCW6YbP.js.map +1 -0
- package/dist/analytics-CGGE7OSa.js +735 -0
- package/dist/analytics-CGGE7OSa.js.map +1 -0
- package/dist/analytics-D6NAIJxP.js +2 -0
- package/dist/api-DM4uMJ00.js +2 -0
- package/dist/{api-C3Dc4LFl.js → api-ZZhiRtbb.js} +3 -3
- package/dist/api-ZZhiRtbb.js.map +1 -0
- package/dist/api-key-login-C30LRht2.js +2 -0
- package/dist/api-key-login-D0KBr1dx.js +55 -0
- package/dist/api-key-login-D0KBr1dx.js.map +1 -0
- package/dist/bin.js +2 -2
- package/dist/bin.js.map +1 -1
- package/dist/{bounded-fs-CC_NDtoP.js → bounded-fs-DwL2Tasp.js} +3 -3
- package/dist/{bounded-fs-CC_NDtoP.js.map → bounded-fs-DwL2Tasp.js.map} +1 -1
- package/dist/{ci-install-DfcAMhlu.js → ci-install-DKXrt_ow.js} +21 -25
- package/dist/ci-install-DKXrt_ow.js.map +1 -0
- package/dist/console-log-DJiTqYT2.js +32 -0
- package/dist/console-log-DJiTqYT2.js.map +1 -0
- package/dist/{debug-DyARf5TF.js → debug-sB20p-Ek.js} +18 -52
- package/dist/debug-sB20p-Ek.js.map +1 -0
- package/dist/{defaults-DpfMnH2q.js → defaults-DDVl3tKN.js} +2 -51
- package/dist/defaults-DDVl3tKN.js.map +1 -0
- package/dist/{emit-BSetXzDV.js → emit-BqLCdV8Y.js} +2 -1
- package/dist/{emit-BSetXzDV.js.map → emit-BqLCdV8Y.js.map} +1 -1
- package/dist/{errors-C2domSkK.js → errors-DhFeR8Sp.js} +5 -5
- package/dist/{errors-C2domSkK.js.map → errors-DhFeR8Sp.js.map} +1 -1
- package/dist/family-picker-BKs-tTyu.js +46 -0
- package/dist/family-picker-BKs-tTyu.js.map +1 -0
- package/dist/{gateway-BmjYUSua.js → gateway-Dg4Fm-nC.js} +122 -11
- package/dist/gateway-Dg4Fm-nC.js.map +1 -0
- package/dist/headless-B3Ol1nkU.js +3 -0
- package/dist/headless-DhTDC9ga.js +10 -0
- package/dist/headless-DhTDC9ga.js.map +1 -0
- package/dist/{host-resolution-DVSb7kXb.js → host-resolution-DDYJXiAQ.js} +4 -4
- package/dist/{host-resolution-DVSb7kXb.js.map → host-resolution-DDYJXiAQ.js.map} +1 -1
- package/dist/install-CZeR38cD.js +2 -0
- package/dist/{install-Bk5TNk27.js → install-Dh8Z5R15.js} +62 -143
- package/dist/install-Dh8Z5R15.js.map +1 -0
- package/dist/interactive-hqHk6kz4.js +11 -0
- package/dist/interactive-hqHk6kz4.js.map +1 -0
- package/dist/{links-9LWZPSCq.js → links-rMot83W2.js} +3 -3
- package/dist/{links-9LWZPSCq.js.map → links-rMot83W2.js.map} +1 -1
- package/dist/{main-DKPjFHEV.js → main-DNIeasXx.js} +205 -470
- package/dist/main-DNIeasXx.js.map +1 -0
- package/dist/{mcp-Co8VRF62.js → mcp-SZcGfaOz.js} +3 -4
- package/dist/{mcp-Co8VRF62.js.map → mcp-SZcGfaOz.js.map} +1 -1
- package/dist/mcp-install-smoke-test.ts +2 -2
- package/dist/{mcp-prompt-streaming-ljCVoQ9I.js → mcp-prompt-streaming-BuRMBgbo.js} +12 -12
- package/dist/mcp-prompt-streaming-BuRMBgbo.js.map +1 -0
- package/dist/mode-label-DB3ol_sj.js +9 -0
- package/dist/mode-label-DB3ol_sj.js.map +1 -0
- package/dist/{models-Dba8ITeo.js → models-G1j-wgwe.js} +2 -2
- package/dist/{models-Dba8ITeo.js.map → models-G1j-wgwe.js.map} +1 -1
- package/dist/non-interactive-DkldwWDM.js +18 -0
- package/dist/non-interactive-DkldwWDM.js.map +1 -0
- package/dist/{oauth-session-D-RfcVmr.js → oauth-session-C2fVSGfr.js} +3 -3
- package/dist/{oauth-session-D-RfcVmr.js.map → oauth-session-C2fVSGfr.js.map} +1 -1
- package/dist/{orchestrator-tools-CVJ1F9Ub.js → orchestrator-tools-BchqG7Qi.js} +3 -3
- package/dist/{orchestrator-tools-CVJ1F9Ub.js.map → orchestrator-tools-BchqG7Qi.js.map} +1 -1
- package/dist/{package-json-Cowya9-3.js → package-json-2UrhE6kP.js} +1 -1
- package/dist/{package-json-Cowya9-3.js.map → package-json-2UrhE6kP.js.map} +1 -1
- package/dist/package-json-Dblip2_X.js +2 -0
- package/dist/package-manager-B3_qSybg.js +105 -0
- package/dist/package-manager-B3_qSybg.js.map +1 -0
- package/dist/{pi-B5YTBRDv.js → pi-Cw7CPXSl.js} +17 -19
- package/dist/pi-Cw7CPXSl.js.map +1 -0
- package/dist/playground-CPNrQfb3.js +12 -0
- package/dist/playground-CPNrQfb3.js.map +1 -0
- package/dist/posthog-integration-FAWfClH3.js +10304 -0
- package/dist/posthog-integration-FAWfClH3.js.map +1 -0
- package/dist/programs-DjCmEcxb.js +3 -0
- package/dist/programs-Ml6OLybj.js +5402 -0
- package/dist/programs-Ml6OLybj.js.map +1 -0
- package/dist/{provisioning-CLhuKqXH.js → provisioning-BTVL49jD.js} +4 -5
- package/dist/{provisioning-CLhuKqXH.js.map → provisioning-BTVL49jD.js.map} +1 -1
- package/dist/provisioning-DL0xCJXH.js +2 -0
- package/dist/{queue-tools-knnPQP0e.js → queue-tools-BQfRI_uD.js} +6 -8
- package/dist/queue-tools-BQfRI_uD.js.map +1 -0
- package/dist/results-ycm_Tf31.js +90 -0
- package/dist/results-ycm_Tf31.js.map +1 -0
- package/dist/run-Bgg-ctbA.js +264 -0
- package/dist/run-Bgg-ctbA.js.map +1 -0
- package/dist/run-C6Ei6vvb.js +246 -0
- package/dist/run-C6Ei6vvb.js.map +1 -0
- package/dist/run-tool-CrN2xWzU.js +2436 -0
- package/dist/run-tool-CrN2xWzU.js.map +1 -0
- package/dist/run-tool-tNjm8S-E.js +2 -0
- package/dist/runners-GGYJs0Ny.js +271 -0
- package/dist/runners-GGYJs0Ny.js.map +1 -0
- package/dist/{security-BvdSFDuM.js → security-C36p8lu6.js} +44 -52
- package/dist/security-C36p8lu6.js.map +1 -0
- package/dist/setup-utils-Dfgse6pY.js +118 -0
- package/dist/setup-utils-Dfgse6pY.js.map +1 -0
- package/dist/smoke-test.sh +1 -1
- package/dist/{playground-BLsCfHmQ.js → start-playground-D0TrdLmc.js} +44 -34
- package/dist/start-playground-D0TrdLmc.js.map +1 -0
- package/dist/{subagent-D_Sqak94.js → subagent-DR5caRzL.js} +7 -7
- package/dist/subagent-DR5caRzL.js.map +1 -0
- package/dist/{task-DiTI6Sak.js → task-C1qKgsAf.js} +18 -18
- package/dist/task-C1qKgsAf.js.map +1 -0
- package/dist/{tasks-ChZ_F1YP.js → tasks-BfJhVky2.js} +1 -1
- package/dist/tasks-BfJhVky2.js.map +1 -0
- package/dist/{telemetry-BNKsDxNS.js → telemetry-Ch9ZJvm7.js} +2 -2
- package/dist/{telemetry-BNKsDxNS.js.map → telemetry-Ch9ZJvm7.js.map} +1 -1
- package/dist/terminal-D20JFN3J.js +16188 -0
- package/dist/terminal-D20JFN3J.js.map +1 -0
- package/dist/tools-BZseGChD.js +544 -0
- package/dist/tools-BZseGChD.js.map +1 -0
- package/dist/{tools-C8LQ8QFz.js → tools-CmSMclOD.js} +9 -9
- package/dist/tools-CmSMclOD.js.map +1 -0
- package/dist/tui-BXe1D0tc.js +25 -0
- package/dist/tui-BXe1D0tc.js.map +1 -0
- package/dist/tui-DJf3ZPRh.js +2 -0
- package/dist/{steps-Hc28zVc_.js → upload-step-BlAN7MC5.js} +14 -16
- package/dist/upload-step-BlAN7MC5.js.map +1 -0
- package/dist/{urls-BI4kJ4qQ.js → urls-eFaChZ9d.js} +2 -2
- package/dist/{urls-BI4kJ4qQ.js.map → urls-eFaChZ9d.js.map} +1 -1
- package/dist/warlock-smoke-test.ts +1 -2
- package/dist/{wizard-abort-DBKtfnBR.js → wizard-abort-BX3O4Hg4.js} +40 -33
- package/dist/wizard-abort-BX3O4Hg4.js.map +1 -0
- package/dist/{yara-hooks-C3L6lBij.js → yara-hooks-C4HOysrM.js} +283 -21
- package/dist/yara-hooks-C4HOysrM.js.map +1 -0
- package/dist/yara-hooks-DV4EkkZY.js +2 -0
- package/package.json +7 -6
- package/dist/PickerMenu-m4CCPX4f.js.map +0 -1
- package/dist/agent-BkBbVuNq.js +0 -3189
- package/dist/agent-BkBbVuNq.js.map +0 -1
- package/dist/agent-QGK2YzlX.js +0 -6
- package/dist/agent-interface-CzyCmp7q.js.map +0 -1
- package/dist/agent-prompt-loader-4wMxlYSX.js.map +0 -1
- package/dist/analytics-B6q5PN7a.js +0 -301
- package/dist/analytics-B6q5PN7a.js.map +0 -1
- package/dist/analytics-BXtfK9o7.js +0 -2
- package/dist/api-C3Dc4LFl.js.map +0 -1
- package/dist/api-yNjrfZs2.js +0 -2
- package/dist/check-screens.tsx +0 -190
- package/dist/ci-install-DfcAMhlu.js.map +0 -1
- package/dist/constants-DO4X70po.js +0 -260
- package/dist/constants-DO4X70po.js.map +0 -1
- package/dist/debug-BueK5mRR.js +0 -2
- package/dist/debug-DyARf5TF.js.map +0 -1
- package/dist/defaults-DpfMnH2q.js.map +0 -1
- package/dist/endpoints-D-4KxZiB.js +0 -108
- package/dist/endpoints-D-4KxZiB.js.map +0 -1
- package/dist/env-api-key-CHGLe0iz.js +0 -2
- package/dist/env-api-key-COf0U-Au.js +0 -17
- package/dist/env-api-key-COf0U-Au.js.map +0 -1
- package/dist/environment-DrLaSsA8.js +0 -39
- package/dist/environment-DrLaSsA8.js.map +0 -1
- package/dist/environment-hBj7ngmO.js +0 -2
- package/dist/file-CVA9ocIC.js +0 -60
- package/dist/file-CVA9ocIC.js.map +0 -1
- package/dist/file-CmoKK_Pp.js +0 -2
- package/dist/file-watcher-C3Su8vXm.js +0 -123
- package/dist/file-watcher-C3Su8vXm.js.map +0 -1
- package/dist/gateway-BmjYUSua.js.map +0 -1
- package/dist/headless-ui-CUbv12Yx.js +0 -44
- package/dist/headless-ui-CUbv12Yx.js.map +0 -1
- package/dist/install-Bk5TNk27.js.map +0 -1
- package/dist/install-F4wm3RSl.js +0 -2
- package/dist/interactive-C5LNvDj6.js +0 -11
- package/dist/interactive-C5LNvDj6.js.map +0 -1
- package/dist/local-dev-McsurOC-.js +0 -135
- package/dist/local-dev-McsurOC-.js.map +0 -1
- package/dist/logging-ui-p6XKVmTx.js +0 -226
- package/dist/logging-ui-p6XKVmTx.js.map +0 -1
- package/dist/main-DKPjFHEV.js.map +0 -1
- package/dist/mcp-prompt-streaming-ljCVoQ9I.js.map +0 -1
- package/dist/mint-failure-C0HyvEwO.js +0 -6403
- package/dist/mint-failure-C0HyvEwO.js.map +0 -1
- package/dist/non-interactive-CLMJrj_7.js +0 -18
- package/dist/non-interactive-CLMJrj_7.js.map +0 -1
- package/dist/package-json--ppioh2F.js +0 -2
- package/dist/pi-B5YTBRDv.js.map +0 -1
- package/dist/playground-BLsCfHmQ.js.map +0 -1
- package/dist/posthog-B2E0hpZt.js +0 -2
- package/dist/posthog-B42rt_1S.js +0 -124
- package/dist/posthog-B42rt_1S.js.map +0 -1
- package/dist/project-data--L-WZyvj.js +0 -2
- package/dist/project-data-BO9IXn9y.js +0 -1131
- package/dist/project-data-BO9IXn9y.js.map +0 -1
- package/dist/provisioning-C01REIU2.js +0 -2
- package/dist/queue-tools-knnPQP0e.js.map +0 -1
- package/dist/registry-B3rC5U4b.js +0 -3464
- package/dist/registry-B3rC5U4b.js.map +0 -1
- package/dist/registry-BamsM7J9.js +0 -2
- package/dist/run-agent-legacy-CwUmPfQF.js +0 -2
- package/dist/run-agent-legacy-DWBajsMh.js +0 -3467
- package/dist/run-agent-legacy-DWBajsMh.js.map +0 -1
- package/dist/runners-D1PqqpjA.js +0 -834
- package/dist/runners-D1PqqpjA.js.map +0 -1
- package/dist/security-BvdSFDuM.js.map +0 -1
- package/dist/setup-utils-ChXXTi1m.js +0 -301
- package/dist/setup-utils-ChXXTi1m.js.map +0 -1
- package/dist/start-tui-DicLfgsj.js +0 -6964
- package/dist/start-tui-DicLfgsj.js.map +0 -1
- package/dist/steps-Hc28zVc_.js.map +0 -1
- package/dist/store-COCO6U0P.js +0 -5
- package/dist/store-D3509G87.js +0 -1030
- package/dist/store-D3509G87.js.map +0 -1
- package/dist/subagent-D_Sqak94.js.map +0 -1
- package/dist/task-DiTI6Sak.js.map +0 -1
- package/dist/task-status-CmrrR7zo.js +0 -16
- package/dist/task-status-CmrrR7zo.js.map +0 -1
- package/dist/task-stream-BckhG_cB.js +0 -363
- package/dist/task-stream-BckhG_cB.js.map +0 -1
- package/dist/tasks-ChZ_F1YP.js.map +0 -1
- package/dist/terminal-PK9bCLRi.js +0 -7222
- package/dist/terminal-PK9bCLRi.js.map +0 -1
- package/dist/tools-C8LQ8QFz.js.map +0 -1
- package/dist/ui-tPNpM6vj.js +0 -15
- package/dist/ui-tPNpM6vj.js.map +0 -1
- package/dist/version-5_ydHkM6.js +0 -6
- package/dist/version-5_ydHkM6.js.map +0 -1
- package/dist/wizard-abort-BVjqLyeA.js +0 -3
- package/dist/wizard-abort-DBKtfnBR.js.map +0 -1
- package/dist/wizard-session-B7BHnay0.js +0 -2
- package/dist/wizard-session-BYw6LzpS.js +0 -133
- package/dist/wizard-session-BYw6LzpS.js.map +0 -1
- package/dist/yara-hooks-C3L6lBij.js.map +0 -1
- package/dist/yara-hooks-CF_IsoaA.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-Bk5TNk27.js","names":["fs","path","path","os","PLUGIN_MARKETPLACE","PLUGIN_MARKETPLACE_SOURCE","PLUGIN_REF","RUN_TIMEOUT_MS","MAX_OUTPUT_BYTES","path","os","fs","execSync","z","os","path","z","os","path","path","fs","z","path","fs","os"],"sources":["../src/shared/mcp-clients/MCPClient.ts","../src/shared/mcp-clients/clients/cursor.ts","../src/shared/mcp-clients/clients/claude-code.ts","../src/shared/mcp-clients/clients/claude-web.ts","../src/shared/mcp-clients/clients/visual-studio-code.ts","../src/shared/mcp-clients/clients/zed.ts","../src/shared/mcp-clients/clients/codex.ts","../src/shared/mcp-clients/clients/opencode.ts","../src/shared/mcp-clients/plugin-client.ts","../src/shared/mcp-clients/install.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport * as jsonc from 'jsonc-parser';\nimport { getDefaultServerConfig } from './defaults';\nimport type { InstallResult } from './results';\n\nexport type MCPServerConfig = Record<string, unknown>;\n\nexport abstract class MCPClient {\n name: string;\n abstract getConfigPath(): Promise<string>;\n abstract getServerPropertyName(): string;\n abstract isServerInstalled(local?: boolean): Promise<boolean>;\n abstract addServer(\n apiKey?: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<InstallResult>;\n abstract removeServer(local?: boolean): Promise<InstallResult>;\n abstract isClientSupported(): Promise<boolean>;\n}\n\nexport abstract class DefaultMCPClient extends MCPClient {\n name = 'Default';\n\n constructor() {\n super();\n }\n\n getServerPropertyName(): string {\n return 'mcpServers';\n }\n\n getServerConfig(\n apiKey: string | undefined,\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return getDefaultServerConfig(apiKey, selectedFeatures, local);\n }\n\n async isServerInstalled(local?: boolean): Promise<boolean> {\n try {\n const configPath = await this.getConfigPath();\n\n if (!fs.existsSync(configPath)) {\n return false;\n }\n\n const configContent = await fs.promises.readFile(configPath, 'utf8');\n const config = jsonc.parse(configContent) as Record<string, any>;\n const serverPropertyName = this.getServerPropertyName();\n const serverName = local ? 'posthog-local' : 'posthog';\n\n return (\n serverPropertyName in config && serverName in config[serverPropertyName]\n );\n } catch {\n return false;\n }\n }\n\n async addServer(\n apiKey?: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<InstallResult> {\n try {\n const configPath = await this.getConfigPath();\n const configDir = path.dirname(configPath);\n\n await fs.promises.mkdir(configDir, { recursive: true });\n\n const serverPropertyName = this.getServerPropertyName();\n let configContent = '';\n let existingConfig = {};\n\n if (fs.existsSync(configPath)) {\n configContent = await fs.promises.readFile(configPath, 'utf8');\n existingConfig = jsonc.parse(configContent) || {};\n }\n\n const newServerConfig = this.getServerConfig(\n apiKey,\n selectedFeatures,\n local,\n );\n const typedConfig = existingConfig as Record<string, any>;\n if (!typedConfig[serverPropertyName]) {\n typedConfig[serverPropertyName] = {};\n }\n const serverName = local ? 'posthog-local' : 'posthog';\n\n // An identical entry means this config is already set up — leave the file\n // untouched and report it, so a re-run says \"already installed\" instead of\n // claiming a write that changed nothing. A differing entry (new features,\n // new key) still gets overwritten and reported as installed.\n const existingServerConfig = typedConfig[serverPropertyName][serverName];\n if (\n existingServerConfig !== undefined &&\n JSON.stringify(existingServerConfig) === JSON.stringify(newServerConfig)\n ) {\n return { success: true, alreadyInstalled: true };\n }\n\n typedConfig[serverPropertyName][serverName] = newServerConfig;\n\n const edits = jsonc.modify(\n configContent,\n [serverPropertyName, serverName],\n newServerConfig,\n {\n formattingOptions: {\n tabSize: 2,\n insertSpaces: true,\n },\n },\n );\n\n const modifiedContent = jsonc.applyEdits(configContent, edits);\n\n await fs.promises.writeFile(configPath, modifiedContent, 'utf8');\n\n return { success: true };\n } catch (error) {\n return {\n success: false,\n reason: error instanceof Error ? error.message : String(error),\n };\n }\n }\n\n async removeServer(local?: boolean): Promise<InstallResult> {\n let configPath = '';\n try {\n configPath = await this.getConfigPath();\n\n if (!fs.existsSync(configPath)) {\n return { success: true, alreadyInstalled: true };\n }\n\n const configContent = await fs.promises.readFile(configPath, 'utf8');\n const config = jsonc.parse(configContent) as Record<string, any>;\n const serverPropertyName = this.getServerPropertyName();\n\n const serverName = local ? 'posthog-local' : 'posthog';\n\n if (\n serverPropertyName in config &&\n serverName in config[serverPropertyName]\n ) {\n const edits = jsonc.modify(\n configContent,\n [serverPropertyName, serverName],\n undefined,\n {\n formattingOptions: {\n tabSize: 2,\n insertSpaces: true,\n },\n },\n );\n\n const modifiedContent = jsonc.applyEdits(configContent, edits);\n\n await fs.promises.writeFile(configPath, modifiedContent, 'utf8');\n\n return { success: true };\n }\n // No PostHog entry to delete — the config changed under us between the\n // detection pass and now. Nothing failed, so don't report a failure.\n return { success: true, alreadyInstalled: true };\n } catch (error) {\n return {\n success: false,\n reason: `${configPath}: ${\n error instanceof Error ? error.message : String(error)\n }`,\n };\n }\n }\n}\n","import {\n DefaultMCPClient,\n MCPServerConfig,\n} from '@shared/mcp-clients/MCPClient';\nimport * as path from 'path';\nimport * as os from 'os';\nimport {\n DefaultMCPClientConfig,\n getNativeHTTPServerConfig,\n} from '@shared/mcp-clients/defaults';\nimport { z } from 'zod';\n\nexport const CursorMCPConfig = DefaultMCPClientConfig;\n\nexport type CursorMCPConfig = z.infer<typeof DefaultMCPClientConfig>;\n\nexport class CursorMCPClient extends DefaultMCPClient {\n name = 'Cursor';\n\n constructor() {\n super();\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' || process.platform === 'win32',\n );\n }\n\n async getConfigPath(): Promise<string> {\n return Promise.resolve(path.join(os.homedir(), '.cursor', 'mcp.json'));\n }\n\n getServerConfig(\n apiKey: string | undefined,\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return getNativeHTTPServerConfig(apiKey, selectedFeatures, local);\n }\n}\n","import { DefaultMCPClient } from '@shared/mcp-clients/MCPClient';\nimport {\n DefaultMCPClientConfig,\n buildMCPUrl,\n} from '@shared/mcp-clients/defaults';\nimport {\n PluginCapable,\n PluginInstallResult,\n} from '@shared/mcp-clients/plugin-client';\nimport {\n redactSecrets,\n scrubHomePaths,\n type InstallResult,\n} from '@shared/mcp-clients/results';\nimport { LoginCapable } from '@shared/mcp-clients/login-client';\nimport { z } from 'zod';\nimport { execSync, execFile } from 'child_process';\nimport { analytics } from '@utils/analytics';\nimport { debug } from '@utils/debug';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as fs from 'fs';\n\nexport const ClaudeCodeMCPConfig = DefaultMCPClientConfig;\n\nexport type ClaudeCodeMCPConfig = z.infer<typeof DefaultMCPClientConfig>;\n\n// `plugin install <name>` only resolves against marketplaces the user already\n// registered, and the wizard never opens Claude Code interactively — so without\n// the add below the install dies with `not found in any configured marketplace`.\n// Our own marketplace, not Anthropic's: that one carries us as a pinned sha, so\n// installing through it would gate plugin releases on Anthropic bumping the pin.\nconst PLUGIN_NAME = 'posthog';\nconst PLUGIN_MARKETPLACE = 'posthog';\nconst PLUGIN_MARKETPLACE_SOURCE = 'PostHog/ai-plugin';\nconst PLUGIN_REF = `${PLUGIN_NAME}@${PLUGIN_MARKETPLACE}`;\n\n/** The plugin is missing from every catalog the CLI can currently see. */\nconst NOT_IN_A_MARKETPLACE = /not found in/i;\n\n/** One `plugin list --json` row; the CLI returns more fields than we read. */\ninterface ListedPlugin {\n /** `<plugin>@<marketplace>`, e.g. `posthog@posthog`. */\n id: string;\n /**\n * A plugin disabled in `/plugin` stays listed with `enabled: false`. It is\n * still installed, but it contributes no MCP server, so treating it as\n * installed reports \"you are good to go\" with nothing serving posthog.\n */\n enabled?: boolean;\n}\n\ninterface ListedMarketplace {\n name: string;\n /**\n * `owner/repo`, present since the CLI started emitting `--json`. A\n * marketplace merely *named* `posthog` may be someone else's, and installing\n * from it would ship a different plugin under our name.\n */\n repo?: string;\n}\n\ntype ClaudeRun = { ok: boolean; output: string };\n\n/**\n * `plugin marketplace add` clones a git repository, the slowest thing we run.\n * Past this the command is not slow, it is stuck, and a clone waiting on a\n * credential prompt would otherwise hang the wizard with the spinner frozen.\n */\nconst RUN_TIMEOUT_MS = 120_000;\n\n/**\n * `execFile` kills the child once output passes this. The default is 1 MB,\n * which a verbose clone can reach, and the kill then looks like Claude Code\n * rejecting the install rather than us cutting it off.\n */\nconst MAX_OUTPUT_BYTES = 16 * 1024 * 1024;\n\n/**\n * Our catalog, by name *and* repository. A marketplace merely called `posthog`\n * may be someone else's, and neither installing from it nor removing it is\n * ours to do. `repo` is absent on CLIs predating it, where the name is all\n * there is.\n */\nconst isOurMarketplace = (m: ListedMarketplace | undefined): boolean =>\n m?.name === PLUGIN_MARKETPLACE &&\n (m.repo === undefined ||\n m.repo.toLowerCase() === PLUGIN_MARKETPLACE_SOURCE.toLowerCase());\n\nexport class ClaudeCodeMCPClient\n extends DefaultMCPClient\n implements PluginCapable, LoginCapable\n{\n name = 'Claude Code';\n private claudeBinaryPath: string | null = null;\n\n constructor() {\n super();\n }\n\n private findClaudeBinary(): string | null {\n if (this.claudeBinaryPath) {\n return this.claudeBinaryPath;\n }\n\n // Common installation paths for Claude Code CLI\n const possiblePaths = [\n path.join(os.homedir(), '.claude', 'local', 'claude'),\n '/usr/local/bin/claude',\n '/opt/homebrew/bin/claude',\n ];\n\n for (const claudePath of possiblePaths) {\n if (fs.existsSync(claudePath)) {\n debug(` Found claude binary at: ${claudePath}`);\n this.claudeBinaryPath = claudePath;\n return claudePath;\n }\n }\n\n // Try PATH as fallback\n try {\n execSync('command -v claude', { stdio: 'pipe' });\n debug(' Found claude in PATH');\n this.claudeBinaryPath = 'claude';\n return 'claude';\n } catch {\n // Not in PATH\n }\n\n return null;\n }\n\n isClientSupported(): Promise<boolean> {\n try {\n debug(' Checking for Claude Code...');\n const claudeBinary = this.findClaudeBinary();\n\n if (!claudeBinary) {\n debug(' Claude Code not found. Installation paths checked:');\n debug(` - ${path.join(os.homedir(), '.claude', 'local', 'claude')}`);\n debug(` - /usr/local/bin/claude`);\n debug(` - /opt/homebrew/bin/claude`);\n debug(` - PATH`);\n return Promise.resolve(false);\n }\n\n const output = execSync(`${claudeBinary} --version`, { stdio: 'pipe' });\n const version = output.toString().trim();\n debug(` Claude Code detected: ${version}`);\n return Promise.resolve(true);\n } catch (error) {\n debug(\n ` Claude Code check failed: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n return Promise.resolve(false);\n }\n }\n\n isServerInstalled(local?: boolean): Promise<boolean> {\n const binary = this.findClaudeBinary();\n if (!binary) return Promise.resolve(false);\n const serverName = local ? 'posthog-local' : 'posthog';\n // `mcp get <name>` exits non-zero when the entry doesn't exist. A substring\n // scan of `mcp list` also matches the claude.ai \"PostHog\" connector and the\n // plugin's `plugin:posthog:posthog`, reporting installed forever.\n try {\n execSync(`${binary} mcp get ${serverName}`, { stdio: 'pipe' });\n return Promise.resolve(true);\n } catch {\n return Promise.resolve(false);\n }\n }\n\n getConfigPath(): Promise<string> {\n throw new Error('Not implemented');\n }\n\n addServer(\n apiKey?: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<InstallResult> {\n const binary = this.findClaudeBinary();\n if (!binary)\n return Promise.resolve({\n success: false,\n reason: 'The claude CLI is no longer on your PATH.',\n });\n\n const serverName = local ? 'posthog-local' : 'posthog';\n const url = buildMCPUrl(selectedFeatures, local);\n const args = [\n 'mcp',\n 'add',\n '--transport',\n 'http',\n '--scope',\n 'user',\n serverName,\n url,\n ];\n if (apiKey) {\n args.push('--header', `Authorization: Bearer ${apiKey}`);\n }\n\n try {\n execSync(`${binary} ${args.map((a) => JSON.stringify(a)).join(' ')}`, {\n stdio: 'pipe',\n });\n return Promise.resolve({ success: true });\n } catch (error) {\n // The failing command echoes back the Authorization header we passed, so\n // redact before this reaches a log, the screen, or an exception report.\n const msg = redactSecrets(\n error instanceof Error ? error.message : String(error),\n );\n if (msg.includes('already exists')) {\n return Promise.resolve({ success: true, alreadyInstalled: true });\n }\n analytics.captureException(\n new Error(`Claude Code MCP add failed: ${msg}`),\n );\n return Promise.resolve({ success: false, reason: msg });\n }\n }\n\n /** Claude Code's own login runs its OAuth and owns the token; the wizard only surfaces the command. */\n loginCommand(local?: boolean): string {\n return `claude mcp login ${local ? 'posthog-local' : 'posthog'}`;\n }\n\n /** The plugin bundles its own `posthog` server, addressed as `plugin:<plugin>:<server>`. */\n pluginLoginCommand(): string {\n return 'claude mcp login plugin:posthog:posthog';\n }\n\n async removePlugin(): Promise<PluginInstallResult> {\n const binary = this.findClaudeBinary();\n if (!binary)\n return {\n success: false,\n reason: 'The claude CLI is no longer on your PATH.',\n };\n\n // `plugin uninstall posthog` removes exactly one match, so with both\n // `posthog@posthog` and `posthog@claude-plugins-official` installed the bare\n // call leaves the other copy enabled — and `mcp remove` would be lying.\n const ids = await this.installedPluginIds(binary);\n // `installPlugin` registers the marketplace, so removal owes the user the\n // other half: a machine left with our catalog and no plugin is a state the\n // wizard created. `codex.ts` clears both on the same call.\n const marketplace = await this.ourMarketplaceRegistered(binary);\n\n const nothingInstalled =\n ids?.length === 0 || (ids === null && !(await this.isPluginInstalled()));\n if (nothingInstalled && !marketplace) {\n return { success: true, alreadyInstalled: true };\n }\n\n const targets = nothingInstalled ? [] : ids?.length ? ids : [PLUGIN_NAME];\n const failures: string[] = [];\n for (const target of targets) {\n const run = await this.runClaude(binary, ['plugin', 'uninstall', target]);\n if (!run.ok) failures.push(`${target}: ${run.output}`);\n }\n\n // Only when we know it is there: `marketplace remove` exits non-zero on a\n // marketplace that is absent, which would report a failure for a no-op.\n if (marketplace) {\n const run = await this.runClaude(binary, [\n 'plugin',\n 'marketplace',\n 'remove',\n PLUGIN_MARKETPLACE,\n ]);\n if (!run.ok) failures.push(`${PLUGIN_MARKETPLACE}: ${run.output}`);\n }\n\n if (failures.length === 0) return { success: true };\n\n const reason = failures.join('; ');\n analytics.captureException(\n new Error(`Claude Code plugin uninstall failed: ${reason}`),\n );\n return { success: false, reason };\n }\n\n removeServer(local?: boolean): Promise<InstallResult> {\n const claudeBinary = this.findClaudeBinary();\n if (!claudeBinary) {\n return Promise.resolve({\n success: false,\n reason: 'The claude CLI is no longer on your PATH.',\n });\n }\n\n const serverName = local ? 'posthog-local' : 'posthog';\n const command = `${claudeBinary} mcp remove --scope user ${serverName}`;\n\n try {\n execSync(command, { stdio: 'pipe' });\n } catch (error) {\n const reason = redactSecrets(\n error instanceof Error ? error.message : String(error),\n );\n // Removing something that isn't there is the requested end state, not a\n // failure to report.\n if (/no( such)? mcp server|not found/i.test(reason)) {\n return Promise.resolve({ success: true, alreadyInstalled: true });\n }\n analytics.captureException(\n new Error(`Failed to remove server from Claude Code: ${reason}`),\n );\n return Promise.resolve({ success: false, reason });\n }\n\n return Promise.resolve({ success: true });\n }\n\n /** The plugin ships mcp.json with the posthog server — no direct entry needed. */\n pluginBundlesMcpServer(): boolean {\n return true;\n }\n\n supportsPlugin(): boolean {\n return this.findClaudeBinary() !== null;\n }\n\n // Async on purpose: these calls clone git repos and take seconds, and\n // execSync would block the event loop and freeze the TUI spinner. Never\n // throws; the caller decides what a failure means.\n private runClaude(binary: string, args: string[]): Promise<ClaudeRun> {\n return new Promise((resolve) => {\n execFile(\n binary,\n args,\n { timeout: RUN_TIMEOUT_MS, maxBuffer: MAX_OUTPUT_BYTES },\n (error, stdout) => {\n if (!error)\n return resolve({ ok: true, output: stdout?.toString() ?? '' });\n if (error.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER')\n return resolve({\n ok: false,\n output:\n 'claude produced more output than the wizard can hold, so it was stopped',\n });\n if (error.killed || error.signal)\n return resolve({\n ok: false,\n output: `claude did not finish within ${\n RUN_TIMEOUT_MS / 1000\n }s, so it was stopped`,\n });\n // execFile puts `Command failed: <cmd>` and stderr in the message, the\n // same text execSync produced, so failure matching is unchanged.\n resolve({\n ok: false,\n output: scrubHomePaths(redactSecrets(error.message)),\n });\n },\n );\n });\n }\n\n /** Null when `--json` is unsupported, the command failed, or output didn't parse — never \"nothing installed\". */\n private async listJson<T>(\n binary: string,\n args: string[],\n ): Promise<T[] | null> {\n const result = await this.runClaude(binary, [...args, '--json']);\n if (!result.ok) return null;\n try {\n const parsed: unknown = JSON.parse(result.output);\n return Array.isArray(parsed) ? (parsed as T[]) : null;\n } catch {\n return null;\n }\n }\n\n // Every installed copy, from any marketplace: Claude Code permits\n // `posthog@posthog` and `posthog@claude-plugins-official` at the same time.\n // Null means the probe is unavailable, which is not the same as none.\n private async installedPlugins(\n binary: string,\n ): Promise<ListedPlugin[] | null> {\n const listed = await this.listJson<ListedPlugin>(binary, [\n 'plugin',\n 'list',\n ]);\n if (!listed) return null;\n return listed.filter(\n (p): p is ListedPlugin =>\n typeof p?.id === 'string' && p.id.split('@')[0] === PLUGIN_NAME,\n );\n }\n\n private async installedPluginIds(binary: string): Promise<string[] | null> {\n const listed = await this.installedPlugins(binary);\n return listed?.map((p) => p.id) ?? null;\n }\n\n async isPluginInstalled(): Promise<boolean> {\n const binary = this.findClaudeBinary();\n if (!binary) return false;\n\n // Presence, not health: `index.ts` asks this to decide whether there is\n // anything to remove, and a disabled plugin still has to be uninstalled.\n // Whether it actually serves is `installPlugin`'s question, not this one.\n const listed = await this.installedPlugins(binary);\n if (listed) return listed.length > 0;\n\n // Older CLI without `--json`. A substring scan also matches a plugin merely\n // named `posthog-something`, which is why it's the fallback and not the path.\n const plain = await this.runClaude(binary, ['plugin', 'list']);\n return plain.ok && plain.output.toLowerCase().includes(PLUGIN_NAME);\n }\n\n async installPlugin(): Promise<PluginInstallResult> {\n const binary = this.findClaudeBinary();\n if (!binary)\n return {\n success: false,\n reason: 'The claude CLI is no longer on your PATH.',\n };\n\n // Ask before installing so a re-run reports \"already installed\" rather than\n // relying on the CLI's error text to spot the no-op.\n //\n // A plugin disabled in `/plugin` is installed but serves nothing, and\n // Claude Code takes its MCP server from the plugin. Reporting it as\n // already installed leaves the user with no server and a screen saying\n // they are done, so fall through and install: the CLI re-enables it.\n const listed = await this.installedPlugins(binary);\n const serving = listed\n ? listed.some((p) => p.enabled !== false)\n : await this.isPluginInstalled();\n if (serving) {\n return { success: true, alreadyInstalled: true };\n }\n\n const marketplaceFailure = await this.ensurePluginMarketplace(binary);\n\n let result = await this.runClaude(binary, [\n 'plugin',\n 'install',\n PLUGIN_REF,\n ]);\n\n // A registered but stale catalog still reports the plugin as missing.\n if (!result.ok && NOT_IN_A_MARKETPLACE.test(result.output)) {\n await this.runClaude(binary, [\n 'plugin',\n 'marketplace',\n 'update',\n PLUGIN_MARKETPLACE,\n ]);\n result = await this.runClaude(binary, ['plugin', 'install', PLUGIN_REF]);\n }\n\n // Last resort: let Claude Code resolve the bare name against whatever the\n // user does have, the way the wizard always did. Never worse than before.\n if (!result.ok && NOT_IN_A_MARKETPLACE.test(result.output)) {\n result = await this.runClaude(binary, ['plugin', 'install', PLUGIN_NAME]);\n }\n\n if (result.ok) return { success: true };\n\n const msg = result.output;\n if (msg.includes('already installed') || msg.includes('already exists')) {\n return { success: true, alreadyInstalled: true };\n }\n // `not found in any configured marketplace` is also what the pre-PR bug\n // produced, so without the marketplace-add failure beside it the new root\n // cause is indistinguishable from the old one in error tracking.\n const failure = new Error(`Claude Code plugin install failed: ${msg}`);\n if (marketplaceFailure) {\n analytics.captureException(failure, { marketplaceFailure });\n } else {\n analytics.captureException(failure);\n }\n return { success: false, reason: msg };\n }\n\n // Best-effort: a failure here only matters if the install also fails, since\n // the user may hold the plugin in another catalog that the fallback finds.\n /** Registered, and ours: a catalog merely named `posthog` is someone else's. */\n private async ourMarketplaceRegistered(\n binary: string,\n ): Promise<boolean | null> {\n const listed = await this.listJson<ListedMarketplace>(binary, [\n 'plugin',\n 'marketplace',\n 'list',\n ]);\n return listed ? listed.some(isOurMarketplace) : null;\n }\n\n private async ensurePluginMarketplace(\n binary: string,\n ): Promise<string | undefined> {\n const listed = await this.listJson<ListedMarketplace>(binary, [\n 'plugin',\n 'marketplace',\n 'list',\n ]);\n if (listed?.some(isOurMarketplace)) {\n debug(` Marketplace ${PLUGIN_MARKETPLACE} already registered`);\n return undefined;\n }\n\n // `marketplace add` is idempotent on Claude Code and exits 0 when the\n // marketplace is already on disk, so there's no \"already added\" text to\n // special-case here — unlike the Codex CLI, where it exits non-zero.\n const added = await this.runClaude(binary, [\n 'plugin',\n 'marketplace',\n 'add',\n PLUGIN_MARKETPLACE_SOURCE,\n ]);\n if (!added.ok) {\n debug(` Marketplace add failed: ${added.output}`);\n return added.output;\n }\n return undefined;\n }\n}\n","import { MCPClient } from '@shared/mcp-clients/MCPClient';\nimport type { InstallResult } from '@shared/mcp-clients/results';\nimport { BrowserFinishable } from '@shared/mcp-clients/browser-client';\nimport { openTrackedLink } from '@utils/links';\n\n/**\n * Claude Desktop / Claude.ai (web). PostHog ships here as a hosted connector,\n * not a local config — so instead of writing files we open the connector\n * directory page and let the user sign in and click \"Connect\".\n */\nexport class ClaudeWebMCPClient extends MCPClient implements BrowserFinishable {\n name = 'Claude Desktop/Web';\n connectorUrl = 'https://claude.ai/directory/connectors/posthog';\n finishInstruction = 'Sign in and click \"Connect\" to finish.';\n\n isClientSupported(): Promise<boolean> {\n // Browser-based — available on every platform.\n return Promise.resolve(true);\n }\n\n isServerInstalled(): Promise<boolean> {\n // The connector lives in the user's Claude account; nothing local to\n // inspect. Returning false also keeps it out of `mcp remove`.\n return Promise.resolve(false);\n }\n\n addServer(): Promise<InstallResult> {\n // Not a PostHog property, so no UTMs — just the tracked open.\n openTrackedLink(this.connectorUrl, 'claude-web-connector', {\n auto: true,\n skipUtm: true,\n });\n return Promise.resolve({ success: true });\n }\n\n removeServer(): Promise<InstallResult> {\n // The connector lives in the user's Claude account, so `mcp remove` can't\n // touch it. It never reaches here today (isServerInstalled is always\n // false), but say where to go if it ever does.\n return Promise.resolve({\n success: false,\n reason:\n 'This connector is managed in your Claude account — remove it at claude.ai/settings/connectors.',\n });\n }\n\n getConfigPath(): Promise<string> {\n throw new Error('Not implemented');\n }\n\n getServerPropertyName(): string {\n throw new Error('Not implemented');\n }\n}\n\nexport default ClaudeWebMCPClient;\n","import z from 'zod';\nimport * as path from 'path';\nimport * as os from 'os';\nimport {\n DefaultMCPClient,\n MCPServerConfig,\n} from '@shared/mcp-clients/MCPClient';\nimport { getNativeHTTPServerConfig } from '@shared/mcp-clients/defaults';\nimport { runtimeEnv } from '@env';\n\nexport const VisualStudioCodeMCPConfig = z\n .object({\n servers: z.record(\n z.string(),\n z.union([\n z.object({\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.string()).optional(),\n }),\n z.object({\n type: z.enum(['http', 'sse']),\n url: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n ]),\n ),\n })\n .passthrough();\n\nexport type VisualStudioCodeMCPConfig = z.infer<\n typeof VisualStudioCodeMCPConfig\n>;\n\nexport class VisualStudioCodeClient extends DefaultMCPClient {\n name = 'Visual Studio Code';\n\n getServerPropertyName(): string {\n return 'servers';\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' ||\n process.platform === 'win32' ||\n process.platform === 'linux',\n );\n }\n\n async getConfigPath(): Promise<string> {\n const homeDir = os.homedir();\n const isWindows = process.platform === 'win32';\n const isMac = process.platform === 'darwin';\n const isLinux = process.platform === 'linux';\n\n if (isMac) {\n return Promise.resolve(\n path.join(\n homeDir,\n 'Library',\n 'Application Support',\n 'Code',\n 'User',\n 'mcp.json',\n ),\n );\n }\n\n if (isWindows) {\n return Promise.resolve(\n path.join(runtimeEnv('APPDATA') || '', 'Code', 'User', 'mcp.json'),\n );\n }\n\n if (isLinux) {\n return Promise.resolve(\n path.join(homeDir, '.config', 'Code', 'User', 'mcp.json'),\n );\n }\n\n throw new Error(`Unsupported platform: ${process.platform}`);\n }\n\n getServerConfig(\n apiKey: string | undefined,\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return {\n type: 'http',\n ...getNativeHTTPServerConfig(apiKey, selectedFeatures, local),\n };\n }\n}\n","import z from 'zod';\nimport * as path from 'path';\nimport * as os from 'os';\nimport {\n DefaultMCPClient,\n MCPServerConfig,\n} from '@shared/mcp-clients/MCPClient';\nimport { getNativeHTTPServerConfig } from '@shared/mcp-clients/defaults';\nimport { runtimeEnv } from '@env';\n\nexport const ZedMCPConfig = z\n .object({\n context_servers: z.record(\n z.string(),\n z.union([\n z.object({\n enabled: z.boolean().optional(),\n source: z.string().optional(),\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.string()).optional(),\n }),\n z.object({\n enabled: z.boolean().optional(),\n url: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n ]),\n ),\n })\n .passthrough();\n\nexport type ZedMCPConfig = z.infer<typeof ZedMCPConfig>;\n\nexport class ZedClient extends DefaultMCPClient {\n name = 'Zed';\n\n getServerPropertyName(): string {\n return 'context_servers';\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' || process.platform === 'linux',\n );\n }\n\n async getConfigPath(): Promise<string> {\n const homeDir = os.homedir();\n const isMac = process.platform === 'darwin';\n const isLinux = process.platform === 'linux';\n\n if (isMac) {\n return Promise.resolve(\n path.join(homeDir, '.config', 'zed', 'settings.json'),\n );\n }\n\n if (isLinux) {\n // https://zed.dev/docs/configuring-zed#settings-files\n const xdgConfigHome = runtimeEnv('XDG_CONFIG_HOME');\n if (xdgConfigHome) {\n return Promise.resolve(\n path.join(xdgConfigHome, 'zed', 'settings.json'),\n );\n }\n return Promise.resolve(\n path.join(homeDir, '.config', 'zed', 'settings.json'),\n );\n }\n\n throw new Error(`Unsupported platform: ${process.platform}`);\n }\n\n getServerConfig(\n apiKey: string | undefined,\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return {\n enabled: true,\n ...getNativeHTTPServerConfig(apiKey, selectedFeatures, local),\n };\n }\n}\n","import { z } from 'zod';\nimport { execSync, execFile, type ExecFileException } from 'node:child_process';\nimport * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\n\nimport { LoginCapable } from '@shared/mcp-clients/login-client';\nimport { DefaultMCPClient } from '@shared/mcp-clients/MCPClient';\nimport {\n DefaultMCPClientConfig,\n buildMCPUrl,\n} from '@shared/mcp-clients/defaults';\nimport {\n PluginCapable,\n PluginInstallResult,\n} from '@shared/mcp-clients/plugin-client';\nimport {\n redactSecrets,\n scrubHomePaths,\n expectedFailureHint,\n type ExpectedFailure,\n type InstallResult,\n} from '@shared/mcp-clients/results';\n\nimport { analytics } from '@utils/analytics';\n\nconst PLUGIN_MARKETPLACE = 'posthog';\nconst PLUGIN_MARKETPLACE_SOURCE = 'PostHog/ai-plugin';\nconst PLUGIN_REF = `posthog@${PLUGIN_MARKETPLACE}`;\n\n/**\n * The plugin's row in `codex plugin list`, whose STATUS column reads\n * `installed, enabled` or `not installed`. Registering the marketplace only\n * publishes the catalog, so the marketplace section in config.toml says nothing\n * about whether the plugin itself is there.\n */\nconst listedAsInstalled = (stdout: string): boolean => {\n const row = new RegExp(`^${PLUGIN_REF}\\\\s+(.*)$`, 'm').exec(stdout)?.[1];\n return !!row && /\\binstalled\\b/.test(row) && !/\\bnot installed\\b/.test(row);\n};\n\n/**\n * What `reportSpawnFailure` was doing, for hint scoping and for the report.\n * A union rather than loose strings: a hint scoped to a stage nobody passes is\n * silently dead, which is how `marketplace add` lost its hint the first time.\n */\ntype CodexStage =\n | 'MCP add'\n | 'MCP remove'\n | 'plugin install'\n | 'plugin uninstall'\n | 'marketplace add';\n\nconst PLUGIN_STAGES: CodexStage[] = [\n 'plugin install',\n 'plugin uninstall',\n 'marketplace add',\n];\nconst MCP_STAGES: CodexStage[] = ['MCP add', 'MCP remove'];\nconst ALL_STAGES: CodexStage[] = [...PLUGIN_STAGES, ...MCP_STAGES];\n\n/**\n * Wording that proves the file codex choked on is the plugin's, not the user's.\n * Serde phrasing alone (\"invalid type\", \"is no longer supported\") says nothing\n * about whose file it came from, and blaming `~/.codex/config.toml` for our own\n * broken manifest sends the user to edit a file that is fine.\n */\nconst OUR_MANIFEST =\n /ai-plugin|plugin\\.toml|plugin\\.json|marketplace\\.toml|posthog@posthog/i;\n\n/**\n * Failures in the user's own environment. Reporting them files issues nobody\n * can action, so hand back a hint instead. Drawn from what the codex install\n * path actually produced in the field.\n *\n * Every entry is scoped: a hint that fires on the wrong stage tells the user to\n * run a command that has nothing to do with what just failed.\n */\nconst EXPECTED_FAILURES: ExpectedFailure[] = [\n {\n // `plugin`/`marketplace` subcommands a pre-plugin codex doesn't have.\n match:\n /unexpected argument|unknown (command|option|argument)|Missing option/i,\n stages: PLUGIN_STAGES,\n hint: 'your codex CLI is too old for plugins — update codex, then run `codex plugin marketplace add PostHog/ai-plugin`',\n },\n {\n // The same wording during `mcp add` is a flag we passed, not a plugin\n // subcommand, so the plugin advice above would send the user nowhere.\n match:\n /unexpected argument|unknown (command|option|argument)|Missing option/i,\n stages: MCP_STAGES,\n hint: 'your codex CLI is too old for this install — update codex, then run `npx @posthog/wizard mcp add` again',\n },\n {\n match: /ENOENT|not found in PATH|spawn .* ENOENT/i,\n stages: ALL_STAGES,\n hint: 'your codex install looks broken — reinstall codex, then run `codex plugin marketplace add PostHog/ai-plugin`',\n },\n {\n // Either codex says outright that it could not load its configuration, or\n // serde phrasing appears alongside `config.toml`. Bare serde wording cannot\n // tell the user's file from the plugin's, and `config.toml` on its own\n // silences any failure that merely mentions the path — both send someone to\n // edit a file that is fine, so the ambiguous case stays reportable.\n match:\n /failed to load (bootstrap )?configuration|OPENAI_API_KEY|Missing OpenAI API key|(?=[\\s\\S]*config\\.toml)[\\s\\S]*(invalid type|unknown field|is no longer supported|must contain at least one)/i,\n stages: ALL_STAGES,\n unless: OUR_MANIFEST,\n hint: 'codex could not read its own config — fix what it reports in ~/.codex/config.toml, then retry',\n },\n {\n match:\n /EACCES|EPERM|permission denied|read-only file system|not permitted/i,\n stages: ALL_STAGES,\n // git says `Permission denied (publickey)` when an SSH clone of the\n // marketplace cannot authenticate to GitHub. Nothing on ~/.codex is wrong\n // there, so the hint below would send the user to chmod a directory that\n // is already fine while the real cause goes unreported.\n unless: /permission denied \\((?:publickey|password|gssapi)/i,\n hint: 'codex could not write to its config — fix the permissions on ~/.codex, then retry',\n },\n {\n match: /ENOSPC|no space left/i,\n stages: ALL_STAGES,\n hint: 'the disk is full — free some space, then retry',\n },\n {\n // A clone that fails because the repo is missing is our publishing problem,\n // not the user's network, and telling them to check their connection buries\n // a renamed or deleted PostHog/ai-plugin where nobody will see it.\n match:\n /git clone .* failed|ENOTFOUND|ETIMEDOUT|ECONNREFUSED|could not resolve host/i,\n stages: ALL_STAGES,\n unless:\n /repository not found|not found|404|does not exist|authentication failed/i,\n hint: 'codex could not reach GitHub to download the plugin — check your network, then retry',\n },\n];\n\ninterface CodexRun {\n ok: boolean;\n /** Never blank on a failure: the cause, or the exit status when there is none. */\n output: string;\n}\n\n/**\n * A clone of the plugin marketplace is the slowest thing we run. Past this the\n * command is not slow, it is stuck, and the wizard should say so rather than\n * wait forever.\n */\nconst RUN_TIMEOUT_MS = 120_000;\n\n/**\n * `execFile` kills the child once output passes this. The default is 1 MB,\n * which a verbose clone can reach, and the kill then looks like codex rejecting\n * the install rather than us cutting it off.\n */\nconst MAX_OUTPUT_BYTES = 16 * 1024 * 1024;\n\n/**\n * What `execFile` puts in `error.message` when the command itself never spoke:\n * the full binary path and arguments. That path contains the user's home\n * directory, so reporting it fingerprints one root cause per machine — the\n * failure this reporting was built to stop. Never send it onward.\n */\nconst COMMAND_FAILED_PREAMBLE = /^Command failed:.*$/m;\n\n/**\n * The cause when neither stream carried one. `execFile` always sets a message,\n * so there is no \"empty error\" case to fall through — the message just isn't\n * usable as it stands.\n */\nconst describeExecFailure = (error: ExecFileException): string => {\n if (error.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER')\n return 'codex produced more output than the wizard can hold, so it was stopped';\n if (error.killed)\n return `codex did not finish within ${\n RUN_TIMEOUT_MS / 1000\n }s, so it was stopped`;\n if (error.signal) return `codex was killed by ${error.signal}`;\n\n const said = error.message.replace(COMMAND_FAILED_PREAMBLE, '').trim();\n if (said) return said;\n if (typeof error.code === 'number')\n return `codex exited with code ${error.code}`;\n if (error.code) return `codex failed with ${error.code}`;\n return 'codex failed without reporting a reason';\n};\n\n/**\n * One codex invocation. Async on purpose: `plugin marketplace add` and\n * `plugin add` clone git repositories and take seconds, and a synchronous child\n * process blocks the event loop, which freezes the TUI spinner on its first\n * frame. Never throws; the caller decides what a failure means.\n *\n * A failure's cause is split across the error and the two streams, and none of\n * them carries it when the process merely exits non-zero — reading one alone\n * reported a blank reason and filed an exception carrying nothing.\n */\nconst runCodex = (\n binary: string,\n args: string[],\n env?: NodeJS.ProcessEnv,\n): Promise<CodexRun> =>\n new Promise((resolve) => {\n const child = execFile(\n binary,\n args,\n { env, timeout: RUN_TIMEOUT_MS, maxBuffer: MAX_OUTPUT_BYTES },\n (error, stdout, stderr) => {\n if (!error) return resolve({ ok: true, output: stdout ?? '' });\n // stderr first: it carries what codex actually said, and the TUI shows\n // the first line. `error.message` leads with our own invocation, so\n // preferring it would show the user the command instead of the cause.\n const said = [stderr, stdout]\n .map((p) => (p ? String(p).trim() : ''))\n .filter(Boolean)\n .join('\\n');\n // A kill is ours, not codex's, so it outranks whatever the streams got\n // out before we cut them off.\n const stopped =\n error.killed ||\n !!error.signal ||\n error.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER';\n resolve({\n ok: false,\n output: redactSecrets(\n stopped || !said ? describeExecFailure(error) : said,\n ),\n });\n },\n );\n // codex asks for nothing on stdin here. Leaving the pipe open means a\n // command that does ask waits on input that never comes, and the promise\n // never settles. `spawnSync` closed it for us.\n child.stdin?.end();\n });\n\n/**\n * Turn a failed spawn into a result: an expected local failure becomes a hint,\n * anything else is reported under a constant message so one root cause stays\n * one issue, with the varying detail in properties.\n */\nconst reportSpawnFailure = (\n stage: CodexStage,\n details: string,\n): InstallResult => {\n const hint = expectedFailureHint(details, EXPECTED_FAILURES, stage);\n if (hint) {\n // Hinting takes a failure out of error tracking, so without this the only\n // evidence a pattern has started over-matching is that our exception count\n // fell, which reads as the fix working. An event keeps the count.\n analytics.wizardCapture('mcp expected failure hinted', {\n client: 'Codex',\n stage,\n hint,\n details: scrubHomePaths(details),\n });\n return { success: false, reason: hint };\n }\n analytics.captureException(new Error(`Codex ${stage} failed`), {\n stage,\n details: scrubHomePaths(details),\n });\n return { success: false, reason: details };\n};\n\n/** Wording codex uses when the thing we're adding is already registered. */\nconst ALREADY_INSTALLED_PATTERN =\n /already (installed|exists|added|registered)/i;\n/** Wording that means the opposite: a cache entry exists but the plugin doesn't. */\nconst STALE_MARKETPLACE_CACHE = /already added from a different source/i;\n\n/**\n * Codex allows servers 10s to finish the MCP initialize handshake, and a remote\n * OAuth handshake can exceed that on a cold start — the \"servers were not\n * initialized\" warning.\n */\nconst STARTUP_TIMEOUT_SEC = 30;\n\n/**\n * The server's table header. TOML accepts a bare or quoted key for the same\n * table, and matching only the bare form means we append a second definition of\n * a table that already exists — a duplicate-key error that takes the user's\n * whole config down, not just PostHog's entry.\n */\nconst sectionHeader = (serverName: string): RegExp =>\n new RegExp(\n `^\\\\[mcp_servers\\\\.(?:${serverName}|\"${serverName}\")\\\\][ \\\\t]*$`,\n 'm',\n );\n\n/**\n * Set `key = value` inside a section body, inserting it when absent. Scans the\n * whole body rather than the line after the header: TOML does not care about\n * key order, and assuming it does means silently matching nothing.\n */\nconst setKey = (body: string, key: string, value: string): string => {\n const existing = new RegExp(`^[ \\\\t]*${key}[ \\\\t]*=.*$`, 'm');\n return existing.test(body)\n ? body.replace(existing, `${key} = ${value}`)\n : `\\n${key} = ${value}${body}`;\n};\n\nexport const CodexMCPConfig = DefaultMCPClientConfig;\n\nexport type CodexMCPConfig = z.infer<typeof DefaultMCPClientConfig>;\n\nexport class CodexMCPClient\n extends DefaultMCPClient\n implements PluginCapable, LoginCapable\n{\n name = 'Codex';\n private codexBinaryPath: string | null = null;\n\n constructor() {\n super();\n }\n\n private findCodexBinary(): string | null {\n if (this.codexBinaryPath) return this.codexBinaryPath;\n try {\n const resolved = execSync('command -v codex', { stdio: 'pipe' })\n .toString()\n .trim();\n if (resolved) {\n this.codexBinaryPath = resolved;\n return resolved;\n }\n } catch {\n // not in PATH\n }\n return null;\n }\n\n private configPath(): string {\n return path.join(os.homedir(), '.codex', 'config.toml');\n }\n\n isClientSupported(): Promise<boolean> {\n return Promise.resolve(this.findCodexBinary() !== null);\n }\n\n getConfigPath(): Promise<string> {\n throw new Error('Not implemented');\n }\n\n isServerInstalled(local?: boolean): Promise<boolean> {\n const serverName = local ? 'posthog-local' : 'posthog';\n // The `[mcp_servers.<name>]` section in config.toml — both the CLI and the\n // desktop app read (and `codex mcp add` writes) this file, and a substring\n // scan of `mcp list` matches unrelated posthog-ish servers.\n try {\n const contents = fs.readFileSync(this.configPath(), 'utf-8');\n return Promise.resolve(sectionHeader(serverName).test(contents));\n } catch {\n return Promise.resolve(false);\n }\n }\n\n async addServer(\n apiKey?: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<InstallResult> {\n const serverName = local ? 'posthog-local' : 'posthog';\n const url = buildMCPUrl(selectedFeatures, local);\n\n // Api-key installs go through the CLI for its bearer-token env wiring.\n if (apiKey) {\n const binary = this.findCodexBinary();\n if (!binary)\n return {\n success: false,\n reason: 'An API-key install into Codex needs the codex CLI.',\n };\n const args = [\n 'mcp',\n 'add',\n serverName,\n '--url',\n url,\n '--bearer-token-env-var',\n 'POSTHOG_AUTH_HEADER',\n ];\n const env = { ...process.env, POSTHOG_AUTH_HEADER: `Bearer ${apiKey}` };\n const result = await runCodex(binary, args, env);\n if (!result.ok) {\n if (ALREADY_INSTALLED_PATTERN.test(result.output)) {\n return { success: true, alreadyInstalled: true };\n }\n return reportSpawnFailure('MCP add', result.output);\n }\n return { success: true };\n }\n\n // OAuth installs write config.toml directly: running `codex mcp add` here\n // would hang the wizard on its built-in OAuth browser wait. Codex nags\n // about the unauthenticated server until the surfaced `codex mcp login`\n // runs — the same interim state as Claude Code's \"needs authentication\".\n return this.writeServerSection(serverName, url);\n }\n\n /**\n * Create or update the `[mcp_servers.<name>]` section in config.toml, editing\n * in place so the user's other servers, key order, and comments survive.\n */\n private writeServerSection(serverName: string, url: string): InstallResult {\n const configPath = this.configPath();\n try {\n // A machine that has codex installed but has never run it has no\n // ~/.codex at all — `codex mcp add` used to create it for us.\n fs.mkdirSync(path.dirname(configPath), { recursive: true });\n const contents = fs.existsSync(configPath)\n ? fs.readFileSync(configPath, 'utf-8')\n : '';\n\n const header = sectionHeader(serverName).exec(contents);\n if (!header) {\n const gap = contents === '' || contents.endsWith('\\n\\n') ? '' : '\\n';\n const pad = contents === '' || contents.endsWith('\\n') ? '' : '\\n';\n this.write(\n configPath,\n `${contents}${pad}${gap}[mcp_servers.${serverName}]\\n` +\n `url = \"${url}\"\\nstartup_timeout_sec = ${STARTUP_TIMEOUT_SEC}\\n`,\n );\n return { success: true };\n }\n\n // Everything up to the next table header belongs to this server.\n const start = header.index + header[0].length;\n const rest = contents.slice(start);\n const next = /^\\[/m.exec(rest);\n const end = next ? start + next.index : contents.length;\n\n const body = contents.slice(start, end);\n const updated = setKey(\n setKey(body, 'url', `\"${url}\"`),\n 'startup_timeout_sec',\n String(STARTUP_TIMEOUT_SEC),\n );\n if (updated === body) return { success: true, alreadyInstalled: true };\n\n this.write(\n configPath,\n contents.slice(0, start) + updated + contents.slice(end),\n );\n return { success: true };\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n // Constant message, varying detail in properties: the reason carries the\n // config path, so interpolating it filed one issue per user.\n analytics.captureException(new Error('Codex config.toml write failed'), {\n details: scrubHomePaths(reason),\n });\n return { success: false, reason };\n }\n }\n\n /** Write via a sibling temp file: a crash mid-write must not truncate the config. */\n private write(configPath: string, contents: string): void {\n const tmp = `${configPath}.wizard-tmp`;\n fs.writeFileSync(tmp, contents);\n fs.renameSync(tmp, configPath);\n }\n\n /** Codex's own login runs its OAuth and owns the token; the wizard only surfaces the command. */\n loginCommand(local?: boolean): string | null {\n if (!this.findCodexBinary()) return null;\n return `codex mcp login ${local ? 'posthog-local' : 'posthog'}`;\n }\n\n async removeServer(local?: boolean): Promise<InstallResult> {\n const binary = this.findCodexBinary();\n if (!binary)\n return {\n success: false,\n reason: 'The codex CLI is no longer on your PATH.',\n };\n\n // `local` was ignored here, so `mcp remove --local` reported success while\n // leaving the posthog-local server in place.\n const serverName = local ? 'posthog-local' : 'posthog';\n const result = await runCodex(binary, ['mcp', 'remove', serverName]);\n\n if (!result.ok) {\n return reportSpawnFailure('MCP remove', result.output);\n }\n\n return { success: true };\n }\n\n /** The codex marketplace plugin ships skills only — the MCP server needs its own entry. */\n pluginBundlesMcpServer(): boolean {\n return false;\n }\n\n supportsPlugin(): boolean {\n return this.findCodexBinary() !== null;\n }\n\n /** The plugin itself, as the CLI reports it. The install decision's question. */\n private async isPluginPresent(): Promise<boolean> {\n const binary = this.findCodexBinary();\n if (!binary) return false;\n const result = await runCodex(binary, [\n 'plugin',\n 'list',\n '-m',\n PLUGIN_MARKETPLACE,\n ]);\n return result.ok && listedAsInstalled(result.output);\n }\n\n /**\n * Anything of ours left on the machine, which is what `index.ts` asks before\n * offering removal. A registered marketplace with no plugin is a state the\n * wizard created — and the state this branch exists to correct — so removal\n * has to see it, or `removePlugin` never runs and the catalog stays forever.\n */\n async isPluginInstalled(): Promise<boolean> {\n return (await this.isPluginPresent()) || this.isMarketplaceRegistered();\n }\n\n /** The catalog, which the plugin is installed *from* — not the plugin. */\n private isMarketplaceRegistered(): boolean {\n try {\n const contents = fs.readFileSync(this.configPath(), 'utf-8');\n return contents\n .toLowerCase()\n .includes(`[marketplaces.${PLUGIN_MARKETPLACE}]`);\n } catch {\n return false;\n }\n }\n\n async removePlugin(): Promise<PluginInstallResult> {\n const binary = this.findCodexBinary();\n if (!binary)\n return {\n success: false,\n reason: 'The codex CLI is no longer on your PATH.',\n };\n\n // Both halves are removed, and either alone is enough to act on: a user\n // left with a registered marketplace and no plugin still needs it cleared.\n const steps: string[][] = [];\n if (await this.isPluginPresent())\n steps.push(['plugin', 'remove', PLUGIN_REF]);\n if (this.isMarketplaceRegistered())\n steps.push(['plugin', 'marketplace', 'remove', PLUGIN_MARKETPLACE]);\n\n if (steps.length === 0) return { success: true, alreadyInstalled: true };\n\n for (const args of steps) {\n const result = await runCodex(binary, args);\n if (!result.ok) {\n return reportSpawnFailure('plugin uninstall', result.output);\n }\n }\n return { success: true };\n }\n\n async installPlugin(): Promise<PluginInstallResult> {\n const binary = this.findCodexBinary();\n if (!binary)\n return {\n success: false,\n reason: 'The codex CLI is no longer on your PATH.',\n };\n\n // The plugin, not the catalog: a registered marketplace with no plugin is\n // exactly the broken state this installs over, so asking the wider question\n // here would skip the install and leave it broken.\n if (await this.isPluginPresent()) {\n return { success: true, alreadyInstalled: true };\n }\n\n // `codex plugin marketplace add` exits non-zero once the marketplace is\n // registered, so ask config.toml first. Without this the second run of\n // `mcp add` looked like a failure and reported nothing at all.\n const marketplace = this.isMarketplaceRegistered()\n ? null\n : await this.registerMarketplace(binary);\n if (marketplace && !marketplace.success) return marketplace;\n\n // Registering the catalog does not install from it. Skipping this left the\n // user with a marketplace, no skills, and a wizard reporting success.\n const result = await runCodex(binary, ['plugin', 'add', PLUGIN_REF]);\n\n if (!result.ok) {\n // The listing above can report \"not installed\" when it merely failed to\n // run, and every other spawn here reads codex's own wording rather than\n // turning a no-op into a reported failure.\n if (ALREADY_INSTALLED_PATTERN.test(result.output)) {\n return { success: true, alreadyInstalled: true };\n }\n return reportSpawnFailure('plugin install', result.output);\n }\n\n return { success: true };\n }\n\n /**\n * Add the catalog the plugin is published in. A stale cache directory with no\n * config.toml entry reports the marketplace as added from a different source;\n * clear it and retry once.\n */\n private async registerMarketplace(\n binary: string,\n ): Promise<PluginInstallResult> {\n const run = () =>\n runCodex(binary, [\n 'plugin',\n 'marketplace',\n 'add',\n PLUGIN_MARKETPLACE_SOURCE,\n ]);\n\n let result = await run();\n\n if (!result.ok && STALE_MARKETPLACE_CACHE.test(result.output)) {\n const staleDir = path.join(\n os.homedir(),\n '.codex',\n '.tmp',\n 'marketplaces',\n PLUGIN_MARKETPLACE,\n );\n try {\n fs.rmSync(staleDir, { recursive: true, force: true });\n } catch {\n // ignore — retry anyway\n }\n result = await run();\n }\n\n if (!result.ok) {\n const details = result.output;\n // Registered by something other than us — the plugin add below can still\n // resolve against it. The stale-cache wording is excluded: that one means\n // the marketplace is NOT usable, and only reaches here if the retry failed.\n if (\n ALREADY_INSTALLED_PATTERN.test(details) &&\n !STALE_MARKETPLACE_CACHE.test(details)\n ) {\n return { success: true };\n }\n return reportSpawnFailure('marketplace add', details);\n }\n return { success: true };\n }\n}\n\nexport default CodexMCPClient;\n","import z from 'zod';\nimport * as path from 'path';\nimport * as os from 'os';\nimport * as fs from 'fs';\nimport { execSync } from 'node:child_process';\nimport {\n DefaultMCPClient,\n MCPServerConfig,\n} from '@shared/mcp-clients/MCPClient';\nimport { getNativeHTTPServerConfig } from '@shared/mcp-clients/defaults';\nimport { runtimeEnv } from '@env';\n\nexport const OpenCodeMCPConfig = z\n .object({\n mcp: z.record(\n z.string(),\n z.object({\n type: z.literal('remote'),\n url: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n ),\n })\n .passthrough();\n\nexport type OpenCodeMCPConfig = z.infer<typeof OpenCodeMCPConfig>;\n\nexport class OpenCodeMCPClient extends DefaultMCPClient {\n name = 'OpenCode';\n private opencodeBinaryPath: string | null = null;\n\n override getServerPropertyName(): string {\n return 'mcp';\n }\n\n private findOpenCodeBinary(): string | null {\n if (this.opencodeBinaryPath) return this.opencodeBinaryPath;\n try {\n const resolved = execSync('command -v opencode', { stdio: 'pipe' })\n .toString()\n .trim();\n if (resolved) {\n this.opencodeBinaryPath = resolved;\n return resolved;\n }\n } catch {\n // not in PATH\n }\n return null;\n }\n\n isClientSupported(): Promise<boolean> {\n return Promise.resolve(this.findOpenCodeBinary() !== null);\n }\n\n getConfigPath(): Promise<string> {\n const configDir = this.resolveConfigDir();\n const jsoncPath = path.join(configDir, 'opencode.jsonc');\n const jsonPath = path.join(configDir, 'opencode.json');\n if (fs.existsSync(jsoncPath)) return Promise.resolve(jsoncPath);\n return Promise.resolve(jsonPath);\n }\n\n private resolveConfigDir(): string {\n const envDir = runtimeEnv('OPENCODE_CONFIG_DIR');\n if (envDir) return envDir;\n\n const xdgHome = runtimeEnv('XDG_CONFIG_HOME');\n if (xdgHome) return path.join(xdgHome, 'opencode');\n\n return path.join(os.homedir(), '.config', 'opencode');\n }\n\n override getServerConfig(\n apiKey: string | undefined,\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return {\n type: 'remote',\n ...getNativeHTTPServerConfig(apiKey, selectedFeatures, local),\n };\n }\n}\n","import type { InstallResult } from './results';\n\nexport type PluginInstallResult = InstallResult;\n\nexport interface PluginCapable {\n supportsPlugin(): boolean;\n isPluginInstalled(): Promise<boolean>;\n installPlugin(): Promise<PluginInstallResult>;\n /** Uninstall the plugin. Absent when the client CLI has no uninstall surface. */\n removePlugin?(): Promise<PluginInstallResult>;\n /** True when the plugin ships its own posthog MCP server, making a direct entry redundant. */\n pluginBundlesMcpServer(): boolean;\n}\n\nexport function isPluginCapable<T>(client: T): client is T & PluginCapable {\n return (\n typeof client === 'object' &&\n client !== null &&\n 'supportsPlugin' in client &&\n 'installPlugin' in client\n );\n}\n","import type { Integration } from '@shared/constants';\nimport type { CloudRegion } from '@utils/types';\nimport { withProgress } from '@utils/telemetry';\nimport { analytics } from '@utils/analytics';\nimport { getUI } from '@ui';\nimport { MCPClient } from './MCPClient';\nimport { CursorMCPClient } from './clients/cursor';\nimport { ClaudeCodeMCPClient } from './clients/claude-code';\nimport { ClaudeWebMCPClient } from './clients/claude-web';\nimport { VisualStudioCodeClient } from './clients/visual-studio-code';\nimport { ZedClient } from './clients/zed';\nimport { CodexMCPClient } from './clients/codex';\nimport { OpenCodeMCPClient } from './clients/opencode';\nimport { ALL_FEATURE_VALUES } from './defaults';\nimport { debug } from '@utils/debug';\nimport { isPluginCapable, PluginCapable } from './plugin-client';\nimport {\n McpClientStatus,\n namesWithStatus,\n toClientResult,\n type McpClientResult,\n} from './results';\n\nexport const getSupportedClients = async (): Promise<MCPClient[]> => {\n const allClients = [\n new ClaudeCodeMCPClient(),\n new ClaudeWebMCPClient(),\n new CodexMCPClient(),\n new CursorMCPClient(),\n new VisualStudioCodeClient(),\n new ZedClient(),\n new OpenCodeMCPClient(),\n ];\n const supportedClients: MCPClient[] = [];\n\n debug('Checking for supported MCP clients...');\n for (const client of allClients) {\n const isSupported = await client.isClientSupported();\n debug(`${client.name}: ${isSupported ? '✓ supported' : '✗ not supported'}`);\n if (isSupported) {\n supportedClients.push(client);\n }\n }\n debug(\n `Found ${supportedClients.length} supported client(s): ${supportedClients\n .map((c) => c.name)\n .join(', ')}`,\n );\n\n return supportedClients;\n};\n\n/** Per-client outcome, so a scripted caller can turn a failure into an exit code. */\nexport interface McpStepOutcome {\n /** Clients that ended up with the server, whether we wrote it or it was already there. */\n installed: string[];\n failed: string[];\n}\n\n/**\n * Add MCP server to clients. No prompts — pure orchestration.\n * Prompts are handled by McpScreen (TUI) or auto-accepted (CI).\n */\nexport const addMCPServerToClientsStep = async ({\n integration,\n local = false,\n ci = false,\n cloudRegion: _cloudRegion,\n features,\n apiKey,\n}: {\n integration?: Integration;\n local?: boolean;\n ci?: boolean;\n cloudRegion?: CloudRegion;\n features?: string[];\n apiKey?: string;\n}): Promise<McpStepOutcome> => {\n const ui = getUI();\n\n // CI mode: skip MCP installation entirely\n if (ci) {\n ui.log.info('Skipping MCP installation (CI mode)');\n return { installed: [], failed: [] };\n }\n\n const supportedClients = await getSupportedClients();\n\n if (supportedClients.length === 0) {\n ui.log.info(\n 'No supported MCP clients detected. Skipping MCP installation.',\n );\n return { installed: [], failed: [] };\n }\n\n // Auto-install to all supported clients\n const results = await withProgress('adding mcp servers', () =>\n addMCPServer(\n supportedClients,\n apiKey,\n features ?? [...ALL_FEATURE_VALUES],\n local,\n ),\n );\n\n const installed = namesWithStatus(results, McpClientStatus.Changed);\n const already = namesWithStatus(results, McpClientStatus.Unchanged);\n const failed = results.filter((r) => r.status === McpClientStatus.Failed);\n\n // Report each outcome on its own — a blanket \"Added the MCP server to: ...\"\n // hid both the no-op re-runs and the outright failures.\n if (installed.length > 0) {\n ui.log.success(`Added the MCP server to:\\n${bulletList(installed)}`);\n }\n if (already.length > 0) {\n ui.log.info(\n `The PostHog MCP server was already installed, so nothing changed for:\\n${bulletList(\n already,\n )}`,\n );\n }\n if (failed.length > 0) {\n ui.log.warn(\n `Couldn't add the MCP server to:\\n${bulletList(\n failed.map((r) => (r.detail ? `${r.name} — ${r.detail}` : r.name)),\n )}`,\n );\n }\n\n const withServer = [...installed, ...already];\n\n analytics.wizardCapture('mcp servers added', {\n // `clients` stays \"every client that ended up with the MCP server\", which is\n // what it meant before — the new properties break that down.\n clients: withServer,\n already_installed_clients: already,\n failed_clients: failed.map((r) => r.name),\n attempted_clients: supportedClients.map((c) => c.name),\n integration,\n });\n\n return { installed: withServer, failed: failed.map((r) => r.name) };\n};\n\nconst bulletList = (items: string[]): string =>\n items.map((item) => ` - ${item}`).join('\\n');\n\nexport const removeMCPServerFromClientsStep = async ({\n integration,\n local = false,\n}: {\n integration?: Integration;\n local?: boolean;\n}): Promise<string[]> => {\n const ui = getUI();\n const installedClients = await getInstalledClients(local);\n if (installedClients.length === 0) {\n ui.log.info(\n 'The PostHog MCP server is not installed for any supported client. Nothing to remove.',\n );\n analytics.wizardCapture('mcp no servers to remove', {\n integration,\n });\n return [];\n }\n\n // Auto-remove from all installed clients\n const results = await withProgress('removing mcp servers', () =>\n removeMCPServer(installedClients, local),\n );\n\n const removed = namesWithStatus(results, McpClientStatus.Changed);\n const nothingToDo = namesWithStatus(results, McpClientStatus.Unchanged);\n const failed = results.filter((r) => r.status === McpClientStatus.Failed);\n\n // This step used to print nothing at all, so a non-TTY `mcp remove` gave no\n // hint whether anything happened — let alone whether a client failed.\n if (removed.length > 0) {\n ui.log.success(`Removed the MCP server from:\\n${bulletList(removed)}`);\n }\n if (nothingToDo.length > 0) {\n ui.log.info(\n `No PostHog MCP entry left to remove for:\\n${bulletList(nothingToDo)}`,\n );\n }\n if (failed.length > 0) {\n ui.log.warn(\n `Couldn't remove the MCP server from:\\n${bulletList(\n failed.map((r) => (r.detail ? `${r.name} — ${r.detail}` : r.name)),\n )}`,\n );\n }\n\n analytics.wizardCapture('mcp servers removed', {\n clients: removed,\n nothing_to_remove_clients: nothingToDo,\n failed_clients: failed.map((r) => r.name),\n attempted_clients: installedClients.map((c) => c.name),\n integration,\n });\n\n return removed;\n};\n\nexport const getInstalledClients = async (\n local?: boolean,\n): Promise<MCPClient[]> => {\n const clients = await getSupportedClients();\n const installedClients: MCPClient[] = [];\n\n for (const client of clients) {\n // The plugin bundles its own posthog MCP server, so for removal purposes a\n // plugin install counts as installed even with no config entry (`--local`\n // targets only the local-dev entry and leaves the plugin alone).\n const pluginInstalled =\n !local && isPluginCapable(client) && (await client.isPluginInstalled());\n if ((await client.isServerInstalled(local)) || pluginInstalled) {\n installedClients.push(client);\n }\n }\n\n return installedClients;\n};\n\nexport const addMCPServer = async (\n clients: MCPClient[],\n personalApiKey?: string,\n selectedFeatures?: string[],\n local?: boolean,\n): Promise<McpClientResult[]> => {\n const results: McpClientResult[] = [];\n for (const client of clients) {\n try {\n const result = await client.addServer(\n personalApiKey,\n selectedFeatures,\n local,\n );\n results.push(toClientResult(client.name, result));\n } catch (err) {\n debug(`[addMCPServer] addServer threw for ${client.name}: ${err}`);\n results.push(\n toClientResult(client.name, {\n success: false,\n reason: err instanceof Error ? err.message : String(err),\n }),\n );\n }\n }\n return results;\n};\n\nexport const getSupportedPluginClients = (\n clients: MCPClient[],\n): Array<MCPClient & PluginCapable> => {\n return clients.filter(isPluginCapable).filter((c) => c.supportsPlugin());\n};\n\nexport const installPlugins = async (\n clients: Array<MCPClient & PluginCapable>,\n): Promise<McpClientResult[]> => {\n const results: McpClientResult[] = [];\n for (const client of clients) {\n try {\n results.push(toClientResult(client.name, await client.installPlugin()));\n } catch (err) {\n debug(`[installPlugins] installPlugin threw for ${client.name}: ${err}`);\n results.push(\n toClientResult(client.name, {\n success: false,\n reason: err instanceof Error ? err.message : String(err),\n }),\n );\n }\n }\n return results;\n};\n\nexport const removeMCPServer = async (\n clients: MCPClient[],\n local?: boolean,\n): Promise<McpClientResult[]> => {\n const results: McpClientResult[] = [];\n for (const client of clients) {\n try {\n let result = await client.removeServer(local);\n // The plugin bundles its own posthog server — leaving it installed makes\n // the removal a lie (`--local` never touches the plugin).\n if (!local && isPluginCapable(client) && client.removePlugin) {\n const plugin = await client.removePlugin();\n result =\n !result.success || !plugin.success\n ? {\n success: false,\n reason: [result.reason, plugin.reason]\n .filter(Boolean)\n .join('; '),\n }\n : {\n success: true,\n ...(result.alreadyInstalled && plugin.alreadyInstalled\n ? { alreadyInstalled: true }\n : {}),\n };\n }\n results.push(toClientResult(client.name, result));\n } catch (err) {\n debug(`[removeMCPServer] removeServer threw for ${client.name}: ${err}`);\n results.push(\n toClientResult(client.name, {\n success: false,\n reason: err instanceof Error ? err.message : String(err),\n }),\n );\n }\n }\n return results;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,IAAsB,YAAtB,MAAgC;CAC9B;;AAaF,IAAsB,mBAAtB,cAA+C,UAAU;CACvD,OAAO;CAEP,cAAc;AACZ,SAAO;;CAGT,wBAAgC;AAC9B,SAAO;;CAGT,gBACE,QACA,kBACA,OACiB;AACjB,SAAO,uBAAuB,QAAQ,kBAAkB,MAAM;;CAGhE,MAAM,kBAAkB,OAAmC;AACzD,MAAI;GACF,MAAM,aAAa,MAAM,KAAK,eAAe;AAE7C,OAAI,CAACA,KAAG,WAAW,WAAW,CAC5B,QAAO;GAGT,MAAM,gBAAgB,MAAMA,KAAG,SAAS,SAAS,YAAY,OAAO;GACpE,MAAM,SAAS,MAAM,MAAM,cAAc;GACzC,MAAM,qBAAqB,KAAK,uBAAuB;GACvD,MAAM,aAAa,QAAQ,kBAAkB;AAE7C,UACE,sBAAsB,UAAU,cAAc,OAAO;UAEjD;AACN,UAAO;;;CAIX,MAAM,UACJ,QACA,kBACA,OACwB;AACxB,MAAI;GACF,MAA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Sl.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { X as posthogIntegrationConfig } from "./mint-failure-C0HyvEwO.js";
|
|
2
|
-
import { i as runWizard } from "./runners-D1PqqpjA.js";
|
|
3
|
-
//#region src/cli/commands/basic-integration/interactive.ts
|
|
4
|
-
/** Default flow: run the posthog-integration program through the TUI. */
|
|
5
|
-
function runInteractive(argv) {
|
|
6
|
-
runWizard(posthogIntegrationConfig, argv);
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { runInteractive };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=interactive-C5LNvDj6.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-C5LNvDj6.js","names":[],"sources":["../src/cli/commands/basic-integration/interactive.ts"],"sourcesContent":["import type { Arguments } from 'yargs';\nimport { runWizard } from '@cli/runners';\nimport { posthogIntegrationConfig } from '@programs/posthog-integration/index';\n\n/** Default flow: run the posthog-integration program through the TUI. */\nexport function runInteractive(argv: Arguments): void {\n runWizard(posthogIntegrationConfig, argv);\n}\n"],"mappings":";;;;AAKA,SAAgB,eAAe,MAAuB;AACpD,WAAU,0BAA0B,KAAK"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
//#region src/shared/local-dev.ts
|
|
2
|
-
/**
|
|
3
|
-
* Local development targets: context-mill (skills), MCP, and PostHog. Each is
|
|
4
|
-
* independently switchable — CI runs local skills against the *production* MCP
|
|
5
|
-
* — with `--local-dev` as a shorthand for all three.
|
|
6
|
-
*
|
|
7
|
-
* `wizard mcp add --local` is unrelated: it writes a `posthog-local` entry into
|
|
8
|
-
* the user's editor config rather than retargeting this run. Hence no
|
|
9
|
-
* `--local` here.
|
|
10
|
-
*/
|
|
11
|
-
const CONTEXT_MILL_LOCAL_URL = "http://localhost:8765";
|
|
12
|
-
const MCP_LOCAL_URL = "http://localhost:8787/mcp";
|
|
13
|
-
/** Pins the API, app, OAuth, and the LLM gateway derived from them. */
|
|
14
|
-
const POSTHOG_LOCAL_URL = "http://localhost:8010";
|
|
15
|
-
/**
|
|
16
|
-
* A specific flag beats `--local-dev` in both directions. `??` is load-bearing:
|
|
17
|
-
* it falls through only on `undefined`, so giving the specific flags a yargs
|
|
18
|
-
* `default: false` would silently break both the umbrella and `--no-local-mcp`.
|
|
19
|
-
*/
|
|
20
|
-
function resolveLocalDev(flags) {
|
|
21
|
-
const umbrella = flags.localDev ?? false;
|
|
22
|
-
return {
|
|
23
|
-
localMcp: flags.localMcp ?? umbrella,
|
|
24
|
-
localContextMill: flags.localContextMill ?? umbrella,
|
|
25
|
-
localPosthog: flags.localPosthog ?? umbrella
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/** yargs populates both spellings, so read either. */
|
|
29
|
-
function localDevFromArgv(argv) {
|
|
30
|
-
const read = (kebab, camel) => {
|
|
31
|
-
const value = argv[camel] ?? argv[kebab];
|
|
32
|
-
return typeof value === "boolean" ? value : void 0;
|
|
33
|
-
};
|
|
34
|
-
return resolveLocalDev({
|
|
35
|
-
localDev: read("local-dev", "localDev"),
|
|
36
|
-
localMcp: read("local-mcp", "localMcp"),
|
|
37
|
-
localContextMill: read("local-context-mill", "localContextMill"),
|
|
38
|
-
localPosthog: read("local-posthog", "localPosthog")
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const PRODUCTION_TARGETS = {
|
|
42
|
-
localMcp: false,
|
|
43
|
-
localContextMill: false,
|
|
44
|
-
localPosthog: false
|
|
45
|
-
};
|
|
46
|
-
let resolved = null;
|
|
47
|
-
/**
|
|
48
|
-
* Resolve this process's targets. Called once from the yargs middleware, which
|
|
49
|
-
* covers every command and the env-var spellings alike.
|
|
50
|
-
*/
|
|
51
|
-
function initLocalDev(argv) {
|
|
52
|
-
resolved = localDevFromArgv(argv);
|
|
53
|
-
return resolved;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Where this run points. Resolved once because the flags are parsed at startup
|
|
57
|
-
* and never change; threading them through state let call sites read whichever
|
|
58
|
-
* field they happened to have, which is how the intro screens ended up asking
|
|
59
|
-
* the MCP flag where to fetch skills.
|
|
60
|
-
*
|
|
61
|
-
* Uninitialized means no CLI parse ran (a direct-call test) — production.
|
|
62
|
-
*/
|
|
63
|
-
function getLocalDev() {
|
|
64
|
-
return resolved ?? PRODUCTION_TARGETS;
|
|
65
|
-
}
|
|
66
|
-
const LOCAL_SERVICES = [
|
|
67
|
-
{
|
|
68
|
-
key: "localContextMill",
|
|
69
|
-
label: "context-mill",
|
|
70
|
-
flag: "--local-context-mill",
|
|
71
|
-
url: `${CONTEXT_MILL_LOCAL_URL}/skill-menu.json`,
|
|
72
|
-
startHint: "npm run dev (in the context-mill repo)"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: "localMcp",
|
|
76
|
-
label: "MCP server",
|
|
77
|
-
flag: "--local-mcp",
|
|
78
|
-
url: MCP_LOCAL_URL,
|
|
79
|
-
startHint: "hogli start (or pnpm dev:local-resources in posthog/services/mcp)"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
key: "localPosthog",
|
|
83
|
-
label: "PostHog",
|
|
84
|
-
flag: "--local-posthog",
|
|
85
|
-
url: POSTHOG_LOCAL_URL,
|
|
86
|
-
startHint: "./bin/start (in the posthog repo)"
|
|
87
|
-
}
|
|
88
|
-
];
|
|
89
|
-
const PROBE_TIMEOUT_MS = 2e3;
|
|
90
|
-
const PROBE_ATTEMPTS = 3;
|
|
91
|
-
const PROBE_BACKOFF_MS = 250;
|
|
92
|
-
async function isReachable(url) {
|
|
93
|
-
for (let attempt = 1; attempt <= PROBE_ATTEMPTS; attempt++) try {
|
|
94
|
-
await fetch(url, { signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) });
|
|
95
|
-
return true;
|
|
96
|
-
} catch {
|
|
97
|
-
if (attempt < PROBE_ATTEMPTS) await new Promise((r) => setTimeout(r, PROBE_BACKOFF_MS * 2 ** (attempt - 1)));
|
|
98
|
-
}
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Probe every service the flags asked to be local. Returns one message naming
|
|
103
|
-
* each unreachable one, or undefined if all are up (or none were requested).
|
|
104
|
-
*
|
|
105
|
-
* Without this a dead local server surfaces late and badly: a missing
|
|
106
|
-
* context-mill looks like a registry outage, a missing MCP fails mid-run after
|
|
107
|
-
* the agent has already edited files.
|
|
108
|
-
*/
|
|
109
|
-
async function checkLocalServices(resolved) {
|
|
110
|
-
const requested = LOCAL_SERVICES.filter((s) => resolved[s.key]);
|
|
111
|
-
if (requested.length === 0) return void 0;
|
|
112
|
-
const reachable = await Promise.all(requested.map((s) => isReachable(s.url)));
|
|
113
|
-
const dead = requested.filter((_, i) => !reachable[i]);
|
|
114
|
-
if (dead.length === 0) return void 0;
|
|
115
|
-
return [
|
|
116
|
-
`Local ${dead.length === 1 ? "service is" : "services are"} not running:`,
|
|
117
|
-
"",
|
|
118
|
-
...dead.map((s) => ` ${s.label} — nothing listening at ${new URL(s.url).origin}\n requested by ${s.flag}\n start it with: ${s.startHint}`),
|
|
119
|
-
"",
|
|
120
|
-
"Start the missing services, or drop the flag to use production."
|
|
121
|
-
].join("\n");
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* `--local-mcp` used to select local skills too; anyone still relying on that
|
|
125
|
-
* would silently get production skills. Temporary — drop after a release or two.
|
|
126
|
-
*/
|
|
127
|
-
function localMcpSkillsNotice(flags) {
|
|
128
|
-
if (flags.localMcp !== true) return void 0;
|
|
129
|
-
if (flags.localContextMill !== void 0 || flags.localDev === true) return;
|
|
130
|
-
return "--local-mcp now points only at the local MCP server. For local skills, add --local-context-mill (or use --local-dev for both).";
|
|
131
|
-
}
|
|
132
|
-
//#endregion
|
|
133
|
-
export { getLocalDev as a, resolveLocalDev as c, checkLocalServices as i, MCP_LOCAL_URL as n, initLocalDev as o, POSTHOG_LOCAL_URL as r, localMcpSkillsNotice as s, CONTEXT_MILL_LOCAL_URL as t };
|
|
134
|
-
|
|
135
|
-
//# sourceMappingURL=local-dev-McsurOC-.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-dev-McsurOC-.js","names":[],"sources":["../src/shared/local-dev.ts"],"sourcesContent":["/**\n * Local development targets: context-mill (skills), MCP, and PostHog. Each is\n * independently switchable — CI runs local skills against the *production* MCP\n * — with `--local-dev` as a shorthand for all three.\n *\n * `wizard mcp add --local` is unrelated: it writes a `posthog-local` entry into\n * the user's editor config rather than retargeting this run. Hence no\n * `--local` here.\n */\n\nexport const CONTEXT_MILL_LOCAL_URL = 'http://localhost:8765';\nexport const MCP_LOCAL_URL = 'http://localhost:8787/mcp';\n/** Pins the API, app, OAuth, and the LLM gateway derived from them. */\nexport const POSTHOG_LOCAL_URL = 'http://localhost:8010';\n\n/**\n * Raw yargs values. The three specific flags are declared without a `default`\n * so they stay `undefined` when absent — see `resolveLocalDev`.\n */\nexport type LocalDevFlags = {\n localDev?: boolean;\n localMcp?: boolean;\n localContextMill?: boolean;\n localPosthog?: boolean;\n};\n\nexport type ResolvedLocalDev = {\n localMcp: boolean;\n localContextMill: boolean;\n localPosthog: boolean;\n};\n\n/**\n * A specific flag beats `--local-dev` in both directions. `??` is load-bearing:\n * it falls through only on `undefined`, so giving the specific flags a yargs\n * `default: false` would silently break both the umbrella and `--no-local-mcp`.\n */\nexport function resolveLocalDev(flags: LocalDevFlags): ResolvedLocalDev {\n const umbrella = flags.localDev ?? false;\n return {\n localMcp: flags.localMcp ?? umbrella,\n localContextMill: flags.localContextMill ?? umbrella,\n localPosthog: flags.localPosthog ?? umbrella,\n };\n}\n\n/** yargs populates both spellings, so read either. */\nexport function localDevFromArgv(\n argv: Record<string, unknown>,\n): ResolvedLocalDev {\n const read = (kebab: string, camel: string): boolean | undefined => {\n const value = argv[camel] ?? argv[kebab];\n return typeof value === 'boolean' ? value : undefined;\n };\n return resolveLocalDev({\n localDev: read('local-dev', 'localDev'),\n localMcp: read('local-mcp', 'localMcp'),\n localContextMill: read('local-context-mill', 'localContextMill'),\n localPosthog: read('local-posthog', 'localPosthog'),\n });\n}\n\nconst PRODUCTION_TARGETS: ResolvedLocalDev = {\n localMcp: false,\n localContextMill: false,\n localPosthog: false,\n};\n\nlet resolved: ResolvedLocalDev | null = null;\n\n/**\n * Resolve this process's targets. Called once from the yargs middleware, which\n * covers every command and the env-var spellings alike.\n */\nexport function initLocalDev(argv: Record<string, unknown>): ResolvedLocalDev {\n resolved = localDevFromArgv(argv);\n return resolved;\n}\n\n/**\n * Where this run points. Resolved once because the flags are parsed at startup\n * and never change; threading them through state let call sites read whichever\n * field they happened to have, which is how the intro screens ended up asking\n * the MCP flag where to fetch skills.\n *\n * Uninitialized means no CLI parse ran (a direct-call test) — production.\n */\nexport function getLocalDev(): ResolvedLocalDev {\n return resolved ?? PRODUCTION_TARGETS;\n}\n\n/** Tests only. */\nexport function resetLocalDev(): void {\n resolved = null;\n}\n\ntype LocalService = {\n key: keyof ResolvedLocalDev;\n label: string;\n flag: string;\n /** Probed for reachability — any HTTP reply proves the port is bound. */\n url: string;\n startHint: string;\n};\n\nconst LOCAL_SERVICES: readonly LocalService[] = [\n {\n key: 'localContextMill',\n label: 'context-mill',\n flag: '--local-context-mill',\n url: `${CONTEXT_MILL_LOCAL_URL}/skill-menu.json`,\n startHint: 'npm run dev (in the context-mill repo)',\n },\n {\n key: 'localMcp',\n label: 'MCP server',\n flag: '--local-mcp',\n url: MCP_LOCAL_URL,\n startHint:\n 'hogli start (or pnpm dev:local-resources in posthog/services/mcp)',\n },\n {\n key: 'localPosthog',\n label: 'PostHog',\n flag: '--local-posthog',\n url: POSTHOG_LOCAL_URL,\n startHint: './bin/start (in the posthog repo)',\n },\n] as const;\n\n// Retries because this gate gates `fetchWithRetry` (see fetch-retry.ts) — a\n// blip it would ride out must not abort the run instead. A missing server\n// refuses instantly, so the retries only cost time when one is slow to answer,\n// which is exactly when they're worth paying for.\nconst PROBE_TIMEOUT_MS = 2_000;\nconst PROBE_ATTEMPTS = 3;\nconst PROBE_BACKOFF_MS = 250;\n\nasync function isReachable(url: string): Promise<boolean> {\n for (let attempt = 1; attempt <= PROBE_ATTEMPTS; attempt++) {\n try {\n // Any reply — including 404 or 405 — proves something is listening, which\n // is the only question here. Deliberately not `fetchWithRetry`: that\n // treats a non-ok status as failure, and here it is a pass.\n await fetch(url, { signal: AbortSignal.timeout(PROBE_TIMEOUT_MS) });\n return true;\n } catch {\n if (attempt < PROBE_ATTEMPTS) {\n await new Promise((r) =>\n setTimeout(r, PROBE_BACKOFF_MS * 2 ** (attempt - 1)),\n );\n }\n }\n }\n return false;\n}\n\n/**\n * Probe every service the flags asked to be local. Returns one message naming\n * each unreachable one, or undefined if all are up (or none were requested).\n *\n * Without this a dead local server surfaces late and badly: a missing\n * context-mill looks like a registry outage, a missing MCP fails mid-run after\n * the agent has already edited files.\n */\nexport async function checkLocalServices(\n resolved: ResolvedLocalDev,\n): Promise<string | undefined> {\n const requested = LOCAL_SERVICES.filter((s) => resolved[s.key]);\n if (requested.length === 0) return undefined;\n\n const reachable = await Promise.all(requested.map((s) => isReachable(s.url)));\n const dead = requested.filter((_, i) => !reachable[i]);\n if (dead.length === 0) return undefined;\n\n return [\n `Local ${dead.length === 1 ? 'service is' : 'services are'} not running:`,\n '',\n ...dead.map(\n (s) =>\n ` ${s.label} — nothing listening at ${new URL(s.url).origin}\\n` +\n ` requested by ${s.flag}\\n` +\n ` start it with: ${s.startHint}`,\n ),\n '',\n 'Start the missing services, or drop the flag to use production.',\n ].join('\\n');\n}\n\n/**\n * `--local-mcp` used to select local skills too; anyone still relying on that\n * would silently get production skills. Temporary — drop after a release or two.\n */\nexport function localMcpSkillsNotice(flags: LocalDevFlags): string | undefined {\n if (flags.localMcp !== true) return undefined;\n if (flags.localContextMill !== undefined || flags.localDev === true) {\n return undefined;\n }\n return (\n '--local-mcp now points only at the local MCP server. ' +\n 'For local skills, add --local-context-mill (or use --local-dev for both).'\n );\n}\n"],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D;AACN,MAAI,UAAU,eACZ,OAAM,IAAI,SAAS,MACjB,WAAW,GAAG,mBAAmB,MAAM,UAAU,GAAG,CACrD;;AAIP,QAAO;;;;;;;;;;AAWT,eAAsB,mBACpB,UAC6B;CAC7B,MAAM,YAAY,eAAe,QAAQ,MAAM,SAAS,EAAE,KAAK;AAC/D,KAAI,UAAU,WAAW,EAAG,QAAO,KAAA;CAEnC,MAAM,YAAY,MAAM,QAAQ,IAAI,UAAU,KAAK,MAAM,YAAY,EAAE,IAAI,CAAC,CAAC;CAC7E,MAAM,OAAO,UAAU,QAAQ,GAAG,MAAM,CAAC,UAAU,GAAG;AACtD,KAAI,KAAK,WAAW,EAAG,QAAO,KAAA;AAE9B,QAAO;EACL,SAAS,KAAK,WAAW,IAAI,eAAe,eAAe;EAC3D;EACA,GAAG,KAAK,KACL,MACC,KAAK,EAAE,MAAM,0BAA0B,IAAI,IAAI,EAAE,IAAI,CAAC,OAAO,qBACzC,EAAE,KAAK,uBACL,EAAE,YAC3B;EACD;EACA;EACD,CAAC,KAAK,KAAK;;;;;;AAOd,SAAgB,qBAAqB,OAA0C;AAC7E,KAAI,MAAM,aAAa,KAAM,QAAO,KAAA;AACpC,KAAI,MAAM,qBAAqB,KAAA,KAAa,MAAM,aAAa,KAC7D;AAEF,QACE"}
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { s as logToFile } from "./debug-DyARf5TF.js";
|
|
2
|
-
import { E as OAUTH_TIMEOUT_MS } from "./constants-DO4X70po.js";
|
|
3
|
-
import "./task-status-CmrrR7zo.js";
|
|
4
|
-
import { n as checkSkillsOriginHealth } from "./endpoints-D-4KxZiB.js";
|
|
5
|
-
//#region src/shared/health-checks/readiness.ts
|
|
6
|
-
const SERVICE_LABELS = { skillsOrigin: "Skills download" };
|
|
7
|
-
const DEFAULT_WIZARD_READINESS_CONFIG = { downBlocksRun: ["skillsOrigin"] };
|
|
8
|
-
const SIGNUP_WIZARD_READINESS_CONFIG = DEFAULT_WIZARD_READINESS_CONFIG;
|
|
9
|
-
async function checkAllExternalServices() {
|
|
10
|
-
return { skillsOrigin: await checkSkillsOriginHealth() };
|
|
11
|
-
}
|
|
12
|
-
function describeResult(label, h) {
|
|
13
|
-
const parts = [`${label}: ${h.status}`];
|
|
14
|
-
if (h.rawIndicator) parts.push(`indicator=${h.rawIndicator}`);
|
|
15
|
-
if (h.error) parts.push(h.error);
|
|
16
|
-
return parts.join(" — ");
|
|
17
|
-
}
|
|
18
|
-
const READINESS_TIMEOUT_MS = 2e4;
|
|
19
|
-
async function evaluateWizardReadiness(config = DEFAULT_WIZARD_READINESS_CONFIG) {
|
|
20
|
-
try {
|
|
21
|
-
const health = await Promise.race([checkAllExternalServices(), new Promise((resolve) => setTimeout(() => resolve(allUnknown("Health check timed out")), READINESS_TIMEOUT_MS))]);
|
|
22
|
-
const blockingKeys = getBlockingServiceKeys(health, config);
|
|
23
|
-
const reasons = blockingKeys.map((key) => describeResult(SERVICE_LABELS[key], health[key]));
|
|
24
|
-
if (blockingKeys.length > 0) {
|
|
25
|
-
logToFile(`[health-checks] blocked by: ${blockingKeys.map((key) => {
|
|
26
|
-
const h = health[key];
|
|
27
|
-
return `${key} (${h.status}${h.error ? ` — ${h.error}` : ""})`;
|
|
28
|
-
}).join(", ")}`);
|
|
29
|
-
return {
|
|
30
|
-
decision: "no",
|
|
31
|
-
health,
|
|
32
|
-
reasons
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
decision: "yes",
|
|
37
|
-
health,
|
|
38
|
-
reasons
|
|
39
|
-
};
|
|
40
|
-
} catch (err) {
|
|
41
|
-
logToFile(`[health-checks] error: ${err instanceof Error ? err.message : err}`);
|
|
42
|
-
return {
|
|
43
|
-
decision: "yes",
|
|
44
|
-
health: allUnknown("Unexpected error"),
|
|
45
|
-
reasons: []
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function getBlockingServiceKeys(health, config = DEFAULT_WIZARD_READINESS_CONFIG) {
|
|
50
|
-
return Object.keys(health).filter((key) => {
|
|
51
|
-
const result = health[key];
|
|
52
|
-
if (config.downBlocksRun.includes(key) && (result.status === "down" || result.status === "no-connection")) return true;
|
|
53
|
-
if ((config.degradedBlocksRun ?? []).includes(key) && result.status !== "healthy") return true;
|
|
54
|
-
return false;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/** Build an AllServicesHealth where every service is Degraded with the given error. */
|
|
58
|
-
function allUnknown(error) {
|
|
59
|
-
return { skillsOrigin: {
|
|
60
|
-
status: "degraded",
|
|
61
|
-
error
|
|
62
|
-
} };
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/headless/renderers/logging-ui.ts
|
|
66
|
-
var LoggingUI = class {
|
|
67
|
-
intro(message) {
|
|
68
|
-
console.log(`┌ ${message}`);
|
|
69
|
-
}
|
|
70
|
-
outro(message) {
|
|
71
|
-
console.log(`└ ${message}`);
|
|
72
|
-
}
|
|
73
|
-
outroError(data) {
|
|
74
|
-
console.log(`✖ ${data.message ?? "Wizard aborted"}`);
|
|
75
|
-
if (data.body) console.log(`│ ${data.body}`);
|
|
76
|
-
if (data.docsUrl) console.log(`│ Docs: ${data.docsUrl}`);
|
|
77
|
-
}
|
|
78
|
-
waitForOutroDismissed() {
|
|
79
|
-
return Promise.resolve();
|
|
80
|
-
}
|
|
81
|
-
waitForAiOptIn() {
|
|
82
|
-
return Promise.resolve();
|
|
83
|
-
}
|
|
84
|
-
cancel(message) {
|
|
85
|
-
console.log(`■ ${message}`);
|
|
86
|
-
}
|
|
87
|
-
log = {
|
|
88
|
-
info(message) {
|
|
89
|
-
console.log(`│ ${message}`);
|
|
90
|
-
},
|
|
91
|
-
warn(message) {
|
|
92
|
-
console.log(`▲ ${message}`);
|
|
93
|
-
},
|
|
94
|
-
error(message) {
|
|
95
|
-
console.log(`✖ ${message}`);
|
|
96
|
-
},
|
|
97
|
-
success(message) {
|
|
98
|
-
console.log(`✔ ${message}`);
|
|
99
|
-
},
|
|
100
|
-
step(message) {
|
|
101
|
-
console.log(`◇ ${message}`);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
note(message) {
|
|
105
|
-
console.log(`│ ${message}`);
|
|
106
|
-
}
|
|
107
|
-
spinner() {
|
|
108
|
-
return {
|
|
109
|
-
start(message) {
|
|
110
|
-
if (message) console.log(`◌ ${message}`);
|
|
111
|
-
},
|
|
112
|
-
stop(message) {
|
|
113
|
-
if (message) console.log(`● ${message}`);
|
|
114
|
-
},
|
|
115
|
-
message(msg) {
|
|
116
|
-
if (msg) console.log(`◌ ${msg}`);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
pushStatus(message) {
|
|
121
|
-
console.log(`◇ ${message}`);
|
|
122
|
-
}
|
|
123
|
-
setDetectedFramework(label) {
|
|
124
|
-
console.log(`✔ Framework: ${label}`);
|
|
125
|
-
}
|
|
126
|
-
onEnterScreen(_screen, _fn) {}
|
|
127
|
-
setLoginUrl(url) {
|
|
128
|
-
if (url) {
|
|
129
|
-
console.log(`│ If the browser didn't open automatically, use this link:`);
|
|
130
|
-
console.log(`│ ${url}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
setAuthorizeUrl(_url) {}
|
|
134
|
-
showBlockingOutage(result) {
|
|
135
|
-
console.log(`▲ Service health issues detected.`);
|
|
136
|
-
const blockingKeys = getBlockingServiceKeys(result.health);
|
|
137
|
-
if (blockingKeys.length > 0) {
|
|
138
|
-
console.log(`│`);
|
|
139
|
-
console.log(`│ Blocking services:`);
|
|
140
|
-
for (const key of blockingKeys) {
|
|
141
|
-
const status = result.health[key].status;
|
|
142
|
-
const error = result.health[key].error;
|
|
143
|
-
const label = SERVICE_LABELS[key];
|
|
144
|
-
const detail = error ? ` — ${error}` : "";
|
|
145
|
-
console.log(`│ ✖ ${label}: ${status}${detail}`);
|
|
146
|
-
}
|
|
147
|
-
console.log(`│`);
|
|
148
|
-
}
|
|
149
|
-
for (const reason of result.reasons) console.log(`│ ${reason}`);
|
|
150
|
-
console.log(`│ Continuing anyway — health checks are advisory in non-interactive runs.`);
|
|
151
|
-
return Promise.resolve();
|
|
152
|
-
}
|
|
153
|
-
setReadinessWarnings(result) {
|
|
154
|
-
console.log(`▲ Service health warnings detected.`);
|
|
155
|
-
for (const reason of result.reasons) console.log(`│ ${reason}`);
|
|
156
|
-
}
|
|
157
|
-
showPortConflict(_processInfo) {
|
|
158
|
-
return Promise.resolve();
|
|
159
|
-
}
|
|
160
|
-
waitForManualAuthCode() {
|
|
161
|
-
return new Promise(() => {});
|
|
162
|
-
}
|
|
163
|
-
showTaskNotice(_notice) {
|
|
164
|
-
return Promise.resolve(false);
|
|
165
|
-
}
|
|
166
|
-
cancelTaskNotice() {}
|
|
167
|
-
showSettingsOverride(_conflicts, _backupAndFix) {
|
|
168
|
-
return Promise.resolve();
|
|
169
|
-
}
|
|
170
|
-
requestQuestion(_question) {
|
|
171
|
-
return Promise.reject(/* @__PURE__ */ new Error("wizard_ask is not available in CI / non-interactive mode. Re-run the wizard without --ci to answer interactively."));
|
|
172
|
-
}
|
|
173
|
-
cancelPendingQuestion() {}
|
|
174
|
-
showAuthError(detail) {
|
|
175
|
-
console.log(`✖ Authentication failed (401)`);
|
|
176
|
-
if (detail?.hasSettingsConflict) {
|
|
177
|
-
console.log(`│ Claude Code auth is conflicting with the wizard. Please try again after logging out:`);
|
|
178
|
-
console.log(`│ claude auth logout`);
|
|
179
|
-
} else {
|
|
180
|
-
console.log(`│ The PostHog LLM Gateway rejected the API key. Common causes:`);
|
|
181
|
-
console.log(`│ - Wrong key type: pass a personal API key (phx_xxx). pha_ is an OAuth access token, phc_ is a project key.`);
|
|
182
|
-
console.log(`│ - Missing scope: the personal API key needs the "llm_gateway:read" scope.`);
|
|
183
|
-
console.log(`│ - Expired or revoked key.`);
|
|
184
|
-
console.log(`│ - Region mismatch: --region must match the region the key was issued in (us vs eu).`);
|
|
185
|
-
}
|
|
186
|
-
if (detail?.logFilePath) console.log(`│ Verbose log: ${detail.logFilePath}`);
|
|
187
|
-
}
|
|
188
|
-
showSessionTimeout() {
|
|
189
|
-
const minutes = Math.round(OAUTH_TIMEOUT_MS / 6e4);
|
|
190
|
-
console.log(`✖ Login timed out. The OAuth link timed out after ${minutes} minutes.`);
|
|
191
|
-
console.log(`│ Re-run the wizard to get a fresh link and try again.`);
|
|
192
|
-
}
|
|
193
|
-
startRun() {}
|
|
194
|
-
setCredentials(_credentials) {}
|
|
195
|
-
setAccessToken(_credentials) {}
|
|
196
|
-
setRoleAtOrganization(_role) {}
|
|
197
|
-
setApiUser(_user) {}
|
|
198
|
-
lastTodoLine = "";
|
|
199
|
-
syncTodos(todos) {
|
|
200
|
-
const completed = todos.filter((t) => t.status === "completed").length;
|
|
201
|
-
const active = todos.filter((t) => t.status === "in_progress");
|
|
202
|
-
if (active.length === 0) return;
|
|
203
|
-
const labels = active.map((t) => t.activeForm || t.content).join(" · ");
|
|
204
|
-
const line = `◌ [${completed}/${todos.length}] ${labels}`;
|
|
205
|
-
if (line === this.lastTodoLine) return;
|
|
206
|
-
this.lastTodoLine = line;
|
|
207
|
-
console.log(line);
|
|
208
|
-
}
|
|
209
|
-
setEventPlan(_events) {}
|
|
210
|
-
setDashboardUrl(_url) {}
|
|
211
|
-
setStage(_stage) {}
|
|
212
|
-
setNotebookUrl(_url) {}
|
|
213
|
-
setHandoffText(_text) {}
|
|
214
|
-
addTokenUsage(_delta) {}
|
|
215
|
-
setFinalTokenCostUsd(_costUsd) {}
|
|
216
|
-
setOutroData(_data) {}
|
|
217
|
-
setFrameworkContext(_key, _value) {}
|
|
218
|
-
getFrameworkContext(_key) {}
|
|
219
|
-
waitForGate(_stepId) {
|
|
220
|
-
return Promise.resolve();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
//#endregion
|
|
224
|
-
export { getBlockingServiceKeys as a, evaluateWizardReadiness as i, SERVICE_LABELS as n, SIGNUP_WIZARD_READINESS_CONFIG as r, LoggingUI as t };
|
|
225
|
-
|
|
226
|
-
//# sourceMappingURL=logging-ui-p6XKVmTx.js.map
|