@posthog/wizard 2.81.0 → 2.82.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.
Files changed (120) hide show
  1. package/dist/{agent-interface-BFzBnz10.js → agent-interface-3YfIWZmY.js} +211 -46
  2. package/dist/agent-interface-3YfIWZmY.js.map +1 -0
  3. package/dist/{agent-prompt-loader-CbCW6YbP.js → agent-prompt-loader-hOHONY7u.js} +6 -6
  4. package/dist/{agent-prompt-loader-CbCW6YbP.js.map → agent-prompt-loader-hOHONY7u.js.map} +1 -1
  5. package/dist/{analytics-CGGE7OSa.js → analytics-B_xFshPY.js} +4 -3
  6. package/dist/analytics-B_xFshPY.js.map +1 -0
  7. package/dist/analytics-DGDr6-iD.js +2 -0
  8. package/dist/{api-ZZhiRtbb.js → api-C_9KsN-7.js} +71 -3
  9. package/dist/{api-ZZhiRtbb.js.map → api-C_9KsN-7.js.map} +1 -1
  10. package/dist/api-DhLSO3ai.js +2 -0
  11. package/dist/api-key-login-DiRuZ8Lm.js +2 -0
  12. package/dist/{api-key-login-D0KBr1dx.js → api-key-login-oUJQDmOV.js} +5 -5
  13. package/dist/{api-key-login-D0KBr1dx.js.map → api-key-login-oUJQDmOV.js.map} +1 -1
  14. package/dist/bin.js +1 -1
  15. package/dist/{bounded-fs-DwL2Tasp.js → bounded-fs-iRaQcKYL.js} +6 -4
  16. package/dist/bounded-fs-iRaQcKYL.js.map +1 -0
  17. package/dist/{ci-install-DKXrt_ow.js → ci-install-BGlijoTo.js} +4 -4
  18. package/dist/{ci-install-DKXrt_ow.js.map → ci-install-BGlijoTo.js.map} +1 -1
  19. package/dist/{debug-sB20p-Ek.js → debug-BvEbemym.js} +3 -3
  20. package/dist/{debug-sB20p-Ek.js.map → debug-BvEbemym.js.map} +1 -1
  21. package/dist/{gateway-Dg4Fm-nC.js → gateway-CWoYlPz7.js} +5 -5
  22. package/dist/{gateway-Dg4Fm-nC.js.map → gateway-CWoYlPz7.js.map} +1 -1
  23. package/dist/{headless-DhTDC9ga.js → headless-Bfi950Qh.js} +2 -2
  24. package/dist/{headless-DhTDC9ga.js.map → headless-Bfi950Qh.js.map} +1 -1
  25. package/dist/{headless-B3Ol1nkU.js → headless-Gisv3faN.js} +1 -1
  26. package/dist/{host-resolution-DDYJXiAQ.js → host-resolution-BxnNn8Jm.js} +4 -4
  27. package/dist/{host-resolution-DDYJXiAQ.js.map → host-resolution-BxnNn8Jm.js.map} +1 -1
  28. package/dist/{install-Dh8Z5R15.js → install-CDVeUT_5.js} +5 -5
  29. package/dist/{install-Dh8Z5R15.js.map → install-CDVeUT_5.js.map} +1 -1
  30. package/dist/{install-CZeR38cD.js → install-CX65IxGa.js} +1 -1
  31. package/dist/{interactive-hqHk6kz4.js → interactive-5-Numwwb.js} +3 -3
  32. package/dist/{interactive-hqHk6kz4.js.map → interactive-5-Numwwb.js.map} +1 -1
  33. package/dist/{links-rMot83W2.js → links-Dmj3Wj9X.js} +3 -3
  34. package/dist/{links-rMot83W2.js.map → links-Dmj3Wj9X.js.map} +1 -1
  35. package/dist/{main-DNIeasXx.js → main-5KNn80Vt.js} +20 -20
  36. package/dist/{main-DNIeasXx.js.map → main-5KNn80Vt.js.map} +1 -1
  37. package/dist/{mcp-SZcGfaOz.js → mcp-Buf9sfFm.js} +3 -3
  38. package/dist/{mcp-SZcGfaOz.js.map → mcp-Buf9sfFm.js.map} +1 -1
  39. package/dist/{mcp-prompt-streaming-BuRMBgbo.js → mcp-prompt-streaming-DHPxJK-F.js} +5 -5
  40. package/dist/{mcp-prompt-streaming-BuRMBgbo.js.map → mcp-prompt-streaming-DHPxJK-F.js.map} +1 -1
  41. package/dist/{models-G1j-wgwe.js → models-C9rjXPZ6.js} +2 -2
  42. package/dist/{models-G1j-wgwe.js.map → models-C9rjXPZ6.js.map} +1 -1
  43. package/dist/{oauth-session-C2fVSGfr.js → oauth-session-Bi1MLRCC.js} +45 -3
  44. package/dist/oauth-session-Bi1MLRCC.js.map +1 -0
  45. package/dist/{orchestrator-tools-BchqG7Qi.js → orchestrator-tools-DyKws92o.js} +3 -3
  46. package/dist/{orchestrator-tools-BchqG7Qi.js.map → orchestrator-tools-DyKws92o.js.map} +1 -1
  47. package/dist/{package-manager-B3_qSybg.js → package-manager-DpCdmMmB.js} +4 -4
  48. package/dist/{package-manager-B3_qSybg.js.map → package-manager-DpCdmMmB.js.map} +1 -1
  49. package/dist/{pi-Cw7CPXSl.js → pi-DTj1hsJe.js} +32 -15
  50. package/dist/pi-DTj1hsJe.js.map +1 -0
  51. package/dist/{playground-CPNrQfb3.js → playground-CiH6zZPb.js} +4 -4
  52. package/dist/{playground-CPNrQfb3.js.map → playground-CiH6zZPb.js.map} +1 -1
  53. package/dist/{posthog-integration-FAWfClH3.js → posthog-integration-CpinLWNO.js} +78 -35
  54. package/dist/posthog-integration-CpinLWNO.js.map +1 -0
  55. package/dist/{programs-Ml6OLybj.js → programs-Bq9Ju9xk.js} +28 -23
  56. package/dist/programs-Bq9Ju9xk.js.map +1 -0
  57. package/dist/programs-CnOSdQo1.js +3 -0
  58. package/dist/{provisioning-BTVL49jD.js → provisioning-D-AM_7DG.js} +4 -4
  59. package/dist/{provisioning-BTVL49jD.js.map → provisioning-D-AM_7DG.js.map} +1 -1
  60. package/dist/provisioning-D6Cqbc36.js +2 -0
  61. package/dist/{queue-tools-BQfRI_uD.js → queue-tools-BoIITT7w.js} +4 -4
  62. package/dist/{queue-tools-BQfRI_uD.js.map → queue-tools-BoIITT7w.js.map} +1 -1
  63. package/dist/{results-ycm_Tf31.js → results-CDqlHogZ.js} +2 -2
  64. package/dist/{results-ycm_Tf31.js.map → results-CDqlHogZ.js.map} +1 -1
  65. package/dist/{run-C6Ei6vvb.js → run-CfMArkpV.js} +7 -7
  66. package/dist/{run-C6Ei6vvb.js.map → run-CfMArkpV.js.map} +1 -1
  67. package/dist/{run-Bgg-ctbA.js → run-DcaVJSeI.js} +10 -10
  68. package/dist/{run-Bgg-ctbA.js.map → run-DcaVJSeI.js.map} +1 -1
  69. package/dist/{run-tool-CrN2xWzU.js → run-tool-DJZWnnR9.js} +18 -18
  70. package/dist/{run-tool-CrN2xWzU.js.map → run-tool-DJZWnnR9.js.map} +1 -1
  71. package/dist/run-tool-zMLQroVh.js +2 -0
  72. package/dist/{runners-GGYJs0Ny.js → runners-Cvnk9BcA.js} +8 -8
  73. package/dist/{runners-GGYJs0Ny.js.map → runners-Cvnk9BcA.js.map} +1 -1
  74. package/dist/{security-C36p8lu6.js → security-Cz3a-d7r.js} +5 -5
  75. package/dist/{security-C36p8lu6.js.map → security-Cz3a-d7r.js.map} +1 -1
  76. package/dist/{setup-utils-Dfgse6pY.js → setup-utils-C7kaDP5X.js} +3 -3
  77. package/dist/{setup-utils-Dfgse6pY.js.map → setup-utils-C7kaDP5X.js.map} +1 -1
  78. package/dist/{start-playground-D0TrdLmc.js → start-playground-B62_pYfu.js} +13 -13
  79. package/dist/{start-playground-D0TrdLmc.js.map → start-playground-B62_pYfu.js.map} +1 -1
  80. package/dist/{subagent-DR5caRzL.js → subagent-BBfETG17.js} +3 -3
  81. package/dist/{subagent-DR5caRzL.js.map → subagent-BBfETG17.js.map} +1 -1
  82. package/dist/{task-C1qKgsAf.js → task-CmNe3xeg.js} +28 -16
  83. package/dist/task-CmNe3xeg.js.map +1 -0
  84. package/dist/{telemetry-Ch9ZJvm7.js → telemetry-DKM7VGuJ.js} +2 -2
  85. package/dist/{telemetry-Ch9ZJvm7.js.map → telemetry-DKM7VGuJ.js.map} +1 -1
  86. package/dist/{terminal-D20JFN3J.js → terminal-Bkxwzkhn.js} +118 -93
  87. package/dist/terminal-Bkxwzkhn.js.map +1 -0
  88. package/dist/{tools-CmSMclOD.js → tools-Bm0FDT6f.js} +15 -11
  89. package/dist/tools-Bm0FDT6f.js.map +1 -0
  90. package/dist/{tools-BZseGChD.js → tools-DZCEvDv9.js} +13 -13
  91. package/dist/{tools-BZseGChD.js.map → tools-DZCEvDv9.js.map} +1 -1
  92. package/dist/{tui-BXe1D0tc.js → tui-B56jvkbi.js} +4 -4
  93. package/dist/{tui-BXe1D0tc.js.map → tui-B56jvkbi.js.map} +1 -1
  94. package/dist/{tui-DJf3ZPRh.js → tui-tKI95MSr.js} +1 -1
  95. package/dist/{upload-step-BlAN7MC5.js → upload-step-DqTgn6UB.js} +3 -3
  96. package/dist/{upload-step-BlAN7MC5.js.map → upload-step-DqTgn6UB.js.map} +1 -1
  97. package/dist/{urls-eFaChZ9d.js → urls-B82v7gfO.js} +2 -2
  98. package/dist/{urls-eFaChZ9d.js.map → urls-B82v7gfO.js.map} +1 -1
  99. package/dist/{wizard-abort-BX3O4Hg4.js → wizard-abort-Cd-7sfCw.js} +4 -4
  100. package/dist/{wizard-abort-BX3O4Hg4.js.map → wizard-abort-Cd-7sfCw.js.map} +1 -1
  101. package/dist/{yara-hooks-C4HOysrM.js → yara-hooks-BS0n3ekf.js} +4 -4
  102. package/dist/{yara-hooks-C4HOysrM.js.map → yara-hooks-BS0n3ekf.js.map} +1 -1
  103. package/dist/{yara-hooks-DV4EkkZY.js → yara-hooks-CxksH-GZ.js} +1 -1
  104. package/package.json +1 -1
  105. package/dist/agent-interface-BFzBnz10.js.map +0 -1
  106. package/dist/analytics-CGGE7OSa.js.map +0 -1
  107. package/dist/analytics-D6NAIJxP.js +0 -2
  108. package/dist/api-DM4uMJ00.js +0 -2
  109. package/dist/api-key-login-C30LRht2.js +0 -2
  110. package/dist/bounded-fs-DwL2Tasp.js.map +0 -1
  111. package/dist/oauth-session-C2fVSGfr.js.map +0 -1
  112. package/dist/pi-Cw7CPXSl.js.map +0 -1
  113. package/dist/posthog-integration-FAWfClH3.js.map +0 -1
  114. package/dist/programs-DjCmEcxb.js +0 -3
  115. package/dist/programs-Ml6OLybj.js.map +0 -1
  116. package/dist/provisioning-DL0xCJXH.js +0 -2
  117. package/dist/run-tool-tNjm8S-E.js +0 -2
  118. package/dist/task-C1qKgsAf.js.map +0 -1
  119. package/dist/terminal-D20JFN3J.js.map +0 -1
  120. package/dist/tools-CmSMclOD.js.map +0 -1
@@ -1,23 +1,22 @@
1
1
  import { n as ErrorCodes } from "./emit-BqLCdV8Y.js";
2
- import { d as relativeToInstallDir, i as getLogFilePath, o as logToFile } from "./debug-sB20p-Ek.js";
3
- import { A as POSTHOG_APP_URL, B as REPLAY_VISION_SUPPORTED, D as Integration, E as ISSUES_URL, F as POSTHOG_PRIVACY_URL, J as WIZARD_OAUTH_SCOPES, M as POSTHOG_DOCS_URL, O as OAUTH_PORTS, P as POSTHOG_ORG_AI_SETTINGS_URL, Q as WIZARD_PROVISIONING_SCOPES, R as POSTHOG_TERMS_URL, V as SETUP_REPORT_FILE, i as sessionProperties, k as OAUTH_TIMEOUT_MS, m as DUMMY_PROJECT_API_KEY, n as analytics, nt as WIZARD_USER_AGENT, rt as getSkillsBaseUrl } from "./analytics-CGGE7OSa.js";
4
- import { A as getProvisioningScopesForProgram, B as SOURCE_MAPS_CONTEXT_KEYS, C as oauthErrorFromTokenBody, D as getCommandPath, E as findProgramConfig, F as detectErrorTrackingProjects, G as detectSelfDrivingIntegrationProjects, H as NO_DEFAULT_LIMIT, J as POSTHOG_PRESENT_KEY, K as GITHUB_REQUIRED_BODY, L as detectSourceMapsProjects, O as getOAuthScopesForProgram, P as ERROR_TRACKING_PROJECT_PATH_KEY, R as DISPLAY_NAME, S as oauthErrorFromCallbackParams, T as Program, U as PRICING_LONG, W as PRICING_SHORT, Y as SELF_DRIVING_INTEGRATE_PATH_KEY, _ as missingOAuthScopes, at as evaluateWizardReadiness, b as buildCallbackErrorHtml, c as buildSession, d as SessionStore, et as CONNECT_SLACK_SCOPE_ADDITIONS, f as applyAgentProgress, g as getOAuthClientId, h as OAuthTokenResponseSchema, it as SIGNUP_WIZARD_READINESS_CONFIG, j as getSubcommandPrograms, k as getProgramConfig, nt as getAuditChecks, ot as getBlockingServiceKeys, q as GITHUB_REQUIRED_MESSAGE, rt as SERVICE_LABELS, tt as withScopeAdditions, v as parseOAuthScopes, x as buildOAuthFailureMessage, y as OAuthError, z as MANUAL_SDK_VARIANTS } from "./programs-Ml6OLybj.js";
2
+ import { d as relativeToInstallDir, i as getLogFilePath, o as logToFile } from "./debug-BvEbemym.js";
3
+ import { A as POSTHOG_APP_URL, B as REPLAY_VISION_SUPPORTED, D as Integration, E as ISSUES_URL, F as POSTHOG_PRIVACY_URL, J as WIZARD_OAUTH_SCOPES, M as POSTHOG_DOCS_URL, O as OAUTH_PORTS, P as POSTHOG_ORG_AI_SETTINGS_URL, Q as WIZARD_PROVISIONING_SCOPES, R as POSTHOG_TERMS_URL, V as SETUP_REPORT_FILE, i as sessionProperties, k as OAUTH_TIMEOUT_MS, m as DUMMY_PROJECT_API_KEY, n as analytics, nt as WIZARD_USER_AGENT, rt as getSkillsBaseUrl } from "./analytics-B_xFshPY.js";
4
+ import { A as getProvisioningScopesForProgram, B as SOURCE_MAPS_CONTEXT_KEYS, C as oauthErrorFromTokenBody, D as getCommandPath, E as findProgramConfig, F as detectErrorTrackingProjects, G as detectSelfDrivingIntegrationProjects, H as NO_DEFAULT_LIMIT, J as POSTHOG_PRESENT_KEY, K as GITHUB_REQUIRED_BODY, L as detectSourceMapsProjects, O as getOAuthScopesForProgram, P as ERROR_TRACKING_PROJECT_PATH_KEY, R as DISPLAY_NAME, S as oauthErrorFromCallbackParams, T as Program, U as PRICING_LONG, W as PRICING_SHORT, Y as SELF_DRIVING_INTEGRATE_PATH_KEY, _ as missingOAuthScopes, at as evaluateWizardReadiness, b as buildCallbackErrorHtml, c as buildSession, d as SessionStore, et as CONNECT_SLACK_SCOPE_ADDITIONS, f as applyAgentProgress, g as getOAuthClientId, h as OAuthTokenResponseSchema, it as SIGNUP_WIZARD_READINESS_CONFIG, j as getSubcommandPrograms, k as getProgramConfig, nt as getAuditChecks, ot as getBlockingServiceKeys, q as GITHUB_REQUIRED_MESSAGE, rt as SERVICE_LABELS, tt as withScopeAdditions, v as parseOAuthScopes, x as buildOAuthFailureMessage, y as OAuthError, z as MANUAL_SDK_VARIANTS } from "./programs-Bq9Ju9xk.js";
5
5
  import "./errors-DhFeR8Sp.js";
6
- import { r as withUtm, t as openTrackedLink } from "./links-rMot83W2.js";
7
- import { t as withProgress } from "./telemetry-Ch9ZJvm7.js";
8
- import { t as detectOrgAndProject } from "./setup-utils-Dfgse6pY.js";
9
- import { r as currentCredentials } from "./oauth-session-C2fVSGfr.js";
10
- import { g as isGrantRevoked } from "./agent-interface-BFzBnz10.js";
11
- import { a as getOAuthUrl, i as getIntegrationAuthorizeUrl, s as resolveBaseUrl } from "./urls-eFaChZ9d.js";
12
- import { t as HostResolution } from "./host-resolution-DDYJXiAQ.js";
13
- import { A as formatCostUsd, C as FRAMEWORK_REGISTRY, E as streamMcpPrompt, c as POSTHOG_SDKS, j as formatTokenCount, k as computeTokenCostUsd, l as STRIPE_SDKS, p as getDetectedWarehouseSources } from "./posthog-integration-FAWfClH3.js";
14
- import { y as fetchSkillMenu } from "./yara-hooks-C4HOysrM.js";
15
- import { n as namesWithStatus, o as summarizeFailure, t as isOk } from "./results-ycm_Tf31.js";
16
- import { f as getKindMeta, l as MCP_TUTORIAL_SCOPE_ADDITIONS, n as getTool, p as fetchHealthIssues, t as Tool } from "./tools-BZseGChD.js";
17
- import { a as fetchGithubConnected, c as fetchUserData, n as ApiError, o as fetchProjectData, s as fetchSlackConnected } from "./api-ZZhiRtbb.js";
6
+ import { r as withUtm, t as openTrackedLink } from "./links-Dmj3Wj9X.js";
7
+ import { t as withProgress } from "./telemetry-DKM7VGuJ.js";
8
+ import { t as detectOrgAndProject } from "./setup-utils-C7kaDP5X.js";
9
+ import { r as currentCredentials, s as rotateAfterUnauthorized } from "./oauth-session-Bi1MLRCC.js";
10
+ import { a as getOAuthUrl, i as getIntegrationAuthorizeUrl, s as resolveBaseUrl } from "./urls-B82v7gfO.js";
11
+ import { t as HostResolution } from "./host-resolution-BxnNn8Jm.js";
12
+ import { A as formatCostUsd, C as FRAMEWORK_REGISTRY, E as streamMcpPrompt, c as POSTHOG_SDKS, j as formatTokenCount, k as computeTokenCostUsd, l as STRIPE_SDKS, p as getDetectedWarehouseSources } from "./posthog-integration-CpinLWNO.js";
13
+ import { y as fetchSkillMenu } from "./yara-hooks-BS0n3ekf.js";
14
+ import { c as fetchProjectData, l as fetchSlackConnected, n as ApiError, o as fetchGithubConnected, u as fetchUserData } from "./api-C_9KsN-7.js";
15
+ import { n as namesWithStatus, o as summarizeFailure, t as isOk } from "./results-CDqlHogZ.js";
16
+ import { f as getKindMeta, l as MCP_TUTORIAL_SCOPE_ADDITIONS, n as getTool, p as fetchHealthIssues } from "./tools-DZCEvDv9.js";
18
17
  import { n as AVAILABLE_FEATURES, o as isAllFeaturesSelected, t as ALL_FEATURE_VALUES } from "./defaults-DDVl3tKN.js";
19
- import { n as provisionNewAccount, r as requestDeepLink, t as ProvisionedAccountUnreadableError } from "./provisioning-BTVL49jD.js";
20
- import { r as wizardAbort } from "./wizard-abort-BX3O4Hg4.js";
18
+ import { n as provisionNewAccount, r as requestDeepLink, t as ProvisionedAccountUnreadableError } from "./provisioning-D-AM_7DG.js";
19
+ import { r as wizardAbort } from "./wizard-abort-Cd-7sfCw.js";
21
20
  import { a as useStdoutDimensions, c as wrapAndTruncate, d as isObjectBlock, f as ConfirmButton, h as Icons, i as useKeyboardHintsContext, l as isClearBlock, m as Colors, n as useKeyBindings, o as computeVisibleRange, p as PromptLabel, r as KeyboardHintsProvider, s as wordWrap, t as PickerMenu, u as isLinesBlock } from "./PickerMenu-BGGeYqd-.js";
22
21
  import * as fs$1 from "fs";
23
22
  import path from "path";
@@ -7054,7 +7053,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
7054
7053
  })),
7055
7054
  onSelect: (value) => {
7056
7055
  const integration = Array.isArray(value) ? value[0] : value;
7057
- import("./programs-DjCmEcxb.js").then(({ FRAMEWORK_REGISTRY }) => {
7056
+ import("./programs-CnOSdQo1.js").then(({ FRAMEWORK_REGISTRY }) => {
7058
7057
  const config = FRAMEWORK_REGISTRY[integration];
7059
7058
  store.setFrameworkConfig(integration, config);
7060
7059
  store.setDetectedFramework(config.metadata.name);
@@ -8849,10 +8848,10 @@ async function checkGithubConnected(store, signal) {
8849
8848
  try {
8850
8849
  return await check(credentials);
8851
8850
  } catch (err) {
8852
- if (!isUnauthorized(err) || !credentials.refreshToken || isGrantRevoked()) throw err;
8853
- const rotated = await currentCredentials(credentials, true);
8854
- if (rotated.accessToken === credentials.accessToken) throw err;
8855
- return check(rotated);
8851
+ if (!isUnauthorized(err)) throw err;
8852
+ const recovery = await rotateAfterUnauthorized(credentials, { requireRefreshToken: true });
8853
+ if (recovery.kind !== "rotated") throw err;
8854
+ return check(recovery.credentials);
8856
8855
  }
8857
8856
  }
8858
8857
  function useGithubConnection(store) {
@@ -9675,10 +9674,11 @@ const TUI_TOOLS$3 = { "posthog-doctor": {
9675
9674
  * importing business logic directly. Testable, no dynamic imports.
9676
9675
  *
9677
9676
  * Supports two modes via the `mode` prop:
9678
- * - 'install': detect clients → confirm → [pick clients] → pick features → install
9677
+ * - 'install': detect clients → pick clients (esc cancels) → pick features → install
9679
9678
  * - 'remove': detect installed clients → confirm → remove
9680
9679
  *
9681
- * When done, calls store.setMcpComplete(). The router resolves to outro.
9680
+ * A successful install ends on one screen: results, any login commands, sample
9681
+ * prompts and the tutorial command. When done, calls store.setMcpComplete().
9682
9682
  */
9683
9683
  const markDone = (store, outcome, clients = [], featuresSelected, loginCommands = []) => {
9684
9684
  store.setMcpComplete(outcome, clients, featuresSelected, loginCommands);
@@ -9770,7 +9770,7 @@ const DoneContinue = ({ onContinue }) => {
9770
9770
  })
9771
9771
  });
9772
9772
  };
9773
- const McpScreen = ({ store, installer, mode = "install" }) => {
9773
+ const McpScreen = ({ store, installer, mode = "install", samplePrompts = [] }) => {
9774
9774
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
9775
9775
  useInput(() => void 0);
9776
9776
  const isRemove = mode === "remove";
@@ -9781,6 +9781,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9781
9781
  const [pluginResults, setPluginResults] = useState([]);
9782
9782
  const [detectError, setDetectError] = useState(null);
9783
9783
  const [flowError, setFlowError] = useState(null);
9784
+ const [loginCommands, setLoginCommands] = useState([]);
9784
9785
  const finishFlow = useRef(null);
9785
9786
  useEffect(() => {
9786
9787
  (async () => {
@@ -9791,7 +9792,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9791
9792
  setTimeout(() => markDone(store, "no_clients"), 1500);
9792
9793
  } else {
9793
9794
  setClients(detected);
9794
- setPhase("ask");
9795
+ setPhase(isRemove ? "ask" : "pick");
9795
9796
  }
9796
9797
  } catch (err) {
9797
9798
  setDetectError(errorText(err));
@@ -9817,14 +9818,15 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9817
9818
  }
9818
9819
  setPhase("feature-select");
9819
9820
  };
9820
- const handleConfirm = () => {
9821
- if (isRemove) doRemove();
9822
- else if (clients.length === 1) proceedAfterClientPick([clients[0].name]);
9823
- else setPhase("pick");
9824
- };
9825
9821
  const handleSkip = () => {
9826
9822
  markDone(store, "skipped");
9827
9823
  };
9824
+ useKeyBindings("mcp-skip", phase === "pick" ? [{
9825
+ match: "escape",
9826
+ label: "esc",
9827
+ action: "cancel",
9828
+ handler: handleSkip
9829
+ }] : []);
9828
9830
  const doInstall = async (names, features) => {
9829
9831
  setPhase("working");
9830
9832
  let mcpResult = [];
@@ -9849,6 +9851,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9849
9851
  const outcome = ready.length > 0 ? "installed" : "failed";
9850
9852
  const featuresReport = reportFeatures(features ?? [...ALL_FEATURE_VALUES]);
9851
9853
  const logins = oauthFlow ? pendingLoginCommands(clients, mcpResult, pluginResult) : [];
9854
+ setLoginCommands(logins);
9852
9855
  finishFlow.current = doneOnEnter(store, outcome, ready.map((r) => r.name), featuresReport, logins);
9853
9856
  setPhase("done");
9854
9857
  };
@@ -9865,11 +9868,7 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9865
9868
  finishFlow.current = doneOnEnter(store, removed.length > 0 ? "installed" : "failed", removed.map((r) => r.name));
9866
9869
  setPhase("done");
9867
9870
  };
9868
- const installValueBullets = [
9869
- "Ask your agent: \"List my feature flags\" — and it does.",
9870
- "Run SQL, build dashboards, ship flags, all from your IDE.",
9871
- "No copy-pasting tokens or context. Your agent has the keys."
9872
- ];
9871
+ const installValueLines = ["Ask your agent: \"List my feature flags\" — and it does.", "Run SQL, build dashboards, ship flags, all from your IDE."];
9873
9872
  const okMcpNames = mcpResults.filter(isOk).map((r) => r.name);
9874
9873
  const finishNotes = clients.flatMap((c) => c.finish && okMcpNames.includes(c.name) ? [{
9875
9874
  name: c.name,
@@ -9883,13 +9882,14 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9883
9882
  const pluginAlreadyInstalled = namesWithStatus(pluginResults, "unchanged");
9884
9883
  const failures = [...mcpResults, ...pluginResults].filter((r) => r.status === "failed").map((r) => r.detail ? `${r.name} — ${r.detail}` : r.name);
9885
9884
  const hasAnyResult = installedNow.length + alreadyInstalled.length + pluginInstalled.length + pluginAlreadyInstalled.length + failures.length + finishNotes.length > 0;
9885
+ const installSucceeded = !isRemove && [...mcpResults, ...pluginResults].some(isOk);
9886
9886
  return /* @__PURE__ */ jsxs(Box, {
9887
9887
  flexDirection: "column",
9888
9888
  flexGrow: 1,
9889
9889
  children: [/* @__PURE__ */ jsx(Text, {
9890
9890
  bold: true,
9891
9891
  color: Colors.accent,
9892
- children: isRemove ? "Remove the PostHog MCP" : "Install the MCP so you can chat to your data"
9892
+ children: isRemove ? "Remove the PostHog MCP" : phase === "done" && installSucceeded ? "You're all set — chat to your data from your client" : "Install the MCP so you can chat to your data"
9893
9893
  }), /* @__PURE__ */ jsxs(Box, {
9894
9894
  marginTop: 1,
9895
9895
  flexDirection: "column",
@@ -9924,36 +9924,28 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9924
9924
  " MCP clients detected. Skipping..."
9925
9925
  ]
9926
9926
  })),
9927
- phase === "ask" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
9928
- !isRemove && /* @__PURE__ */ jsx(Box, {
9929
- flexDirection: "column",
9930
- marginBottom: 1,
9931
- children: installValueBullets.map((bullet) => /* @__PURE__ */ jsxs(Text, {
9932
- dimColor: true,
9933
- children: [
9934
- "•",
9935
- " ",
9936
- bullet
9937
- ]
9938
- }, bullet))
9939
- }),
9940
- /* @__PURE__ */ jsxs(Text, {
9941
- dimColor: true,
9942
- children: ["Detected: ", clients.map((c) => c.name).join(", ")]
9943
- }),
9944
- /* @__PURE__ */ jsx(Box, {
9945
- marginTop: 1,
9946
- children: /* @__PURE__ */ jsx(ConfirmationInput, {
9947
- message: `${isRemove ? "Remove" : "Install"} the PostHog MCP server${clients.some((c) => c.supportsPlugin) ? " and plugin" : ""}?`,
9948
- confirmLabel: isRemove ? "Remove" : "Install",
9949
- cancelLabel: "No thanks",
9950
- onConfirm: handleConfirm,
9951
- onCancel: handleSkip
9952
- })
9927
+ phase === "ask" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Text, {
9928
+ dimColor: true,
9929
+ children: ["Detected: ", clients.map((c) => c.name).join(", ")]
9930
+ }), /* @__PURE__ */ jsx(Box, {
9931
+ marginTop: 1,
9932
+ children: /* @__PURE__ */ jsx(ConfirmationInput, {
9933
+ message: `Remove the PostHog MCP server${clients.some((c) => c.supportsPlugin) ? " and plugin" : ""}?`,
9934
+ confirmLabel: "Remove",
9935
+ cancelLabel: "No thanks",
9936
+ onConfirm: () => void doRemove(),
9937
+ onCancel: handleSkip
9953
9938
  })
9954
- ] }),
9955
- phase === "pick" && /* @__PURE__ */ jsx(PickerMenu, {
9956
- message: "Select editor to install",
9939
+ })] }),
9940
+ phase === "pick" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Box, {
9941
+ flexDirection: "column",
9942
+ marginBottom: 1,
9943
+ children: installValueLines.map((line) => /* @__PURE__ */ jsx(Text, {
9944
+ dimColor: true,
9945
+ children: line
9946
+ }, line))
9947
+ }), /* @__PURE__ */ jsx(PickerMenu, {
9948
+ message: `Select clients to install the PostHog MCP server${clients.some((c) => c.supportsPlugin) ? " and plugin" : ""}`,
9957
9949
  options: clients.map((c) => ({
9958
9950
  label: c.name,
9959
9951
  value: c.name,
@@ -9962,9 +9954,14 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
9962
9954
  })),
9963
9955
  mode: "multi",
9964
9956
  onSelect: (selected) => {
9965
- proceedAfterClientPick(Array.isArray(selected) ? selected : [selected]);
9957
+ const names = Array.isArray(selected) ? selected : [selected];
9958
+ if (names.length === 0) {
9959
+ handleSkip();
9960
+ return;
9961
+ }
9962
+ proceedAfterClientPick(names);
9966
9963
  }
9967
- }),
9964
+ })] }),
9968
9965
  phase === "feature-select" && /* @__PURE__ */ jsx(GroupedPickerMenu, {
9969
9966
  message: "Select the PostHog areas your agent can reach",
9970
9967
  groups: AVAILABLE_FEATURES,
@@ -10027,6 +10024,21 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
10027
10024
  icon: "✖",
10028
10025
  note: "Run with --debug for the full output, or report it at github.com/PostHog/wizard/issues."
10029
10026
  }),
10027
+ loginCommands.length > 0 && /* @__PURE__ */ jsxs(Box, {
10028
+ flexDirection: "column",
10029
+ marginBottom: 1,
10030
+ children: [/* @__PURE__ */ jsx(Box, {
10031
+ marginBottom: 1,
10032
+ children: /* @__PURE__ */ jsx(Text, { children: "Authenticate to finish (opens your browser):" })
10033
+ }), loginCommands.map((command) => /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
10034
+ dimColor: true,
10035
+ children: "$ "
10036
+ }), /* @__PURE__ */ jsx(Text, {
10037
+ bold: true,
10038
+ color: Colors.primary,
10039
+ children: command
10040
+ })] }, command))]
10041
+ }),
10030
10042
  finishNotes.map((note) => /* @__PURE__ */ jsxs(Box, {
10031
10043
  flexDirection: "column",
10032
10044
  marginTop: 1,
@@ -10060,7 +10072,37 @@ const McpScreen = ({ store, installer, mode = "install" }) => {
10060
10072
  children: [" ", "(If it didn't open, paste the URL above.)"]
10061
10073
  })
10062
10074
  ]
10063
- }, note.name))
10075
+ }, note.name)),
10076
+ installSucceeded && /* @__PURE__ */ jsxs(Box, {
10077
+ flexDirection: "column",
10078
+ marginTop: finishNotes.length > 0 ? 1 : 0,
10079
+ children: [samplePrompts.length > 0 && /* @__PURE__ */ jsxs(Box, {
10080
+ flexDirection: "column",
10081
+ marginBottom: 1,
10082
+ children: [/* @__PURE__ */ jsx(Text, { children: "Open your client and try a prompt like:" }), samplePrompts.map((prompt) => /* @__PURE__ */ jsxs(Text, { children: [
10083
+ /* @__PURE__ */ jsx(Text, {
10084
+ color: Colors.primary,
10085
+ children: Icons.triangleSmallRight
10086
+ }),
10087
+ " ",
10088
+ /* @__PURE__ */ jsx(Text, {
10089
+ dimColor: true,
10090
+ children: prompt
10091
+ })
10092
+ ] }, prompt))]
10093
+ }), /* @__PURE__ */ jsxs(Text, {
10094
+ dimColor: true,
10095
+ children: [
10096
+ "Take the guided tour anytime with",
10097
+ " ",
10098
+ /* @__PURE__ */ jsx(Text, {
10099
+ bold: true,
10100
+ children: "npx @posthog/wizard mcp tutorial"
10101
+ }),
10102
+ "."
10103
+ ]
10104
+ })]
10105
+ })
10064
10106
  ] }) : flowError ? /* @__PURE__ */ jsxs(Box, {
10065
10107
  flexDirection: "column",
10066
10108
  children: [
@@ -10099,13 +10141,6 @@ const MCP_ADD_FLOW = [{
10099
10141
  label: "Add MCP server",
10100
10142
  screenId: "mcp-add",
10101
10143
  isComplete: (s) => s.mcpComplete
10102
- }, {
10103
- id: "mcp-suggested-prompts",
10104
- label: "Suggested prompts",
10105
- screenId: "mcp-suggested-prompts",
10106
- show: (s) => s.mcpOutcome === "installed",
10107
- isComplete: (s) => s.mcpSuggestedPromptsDismissed,
10108
- reportsAsProgramId: "mcp-tutorial"
10109
10144
  }];
10110
10145
  /**
10111
10146
  * `wizard mcp remove` — single-step uninstall flow.
@@ -11585,9 +11620,7 @@ async function probeProjectData(args) {
11585
11620
  //#endregion
11586
11621
  //#region src/tui/tools/mcp/screens/McpSuggestedPromptsScreen.tsx
11587
11622
  /**
11588
- * McpSuggestedPromptsScreen — shown after MCP install succeeds in the
11589
- * standalone `wizard mcp add` tool, and as the entry point for
11590
- * `wizard mcp tutorial`.
11623
+ * McpSuggestedPromptsScreen — the `wizard mcp tutorial` screen.
11591
11624
  *
11592
11625
  * Phases:
11593
11626
  * 1. Choose — opens with a Log in / Exit picker, framed by a
@@ -11634,7 +11667,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
11634
11667
  ...properties
11635
11668
  });
11636
11669
  }, [programId]);
11637
- const [phase, setPhase] = useState(store.router.activeProgram === Tool.McpTutorial ? "choose" : "goodbye");
11670
+ const [phase, setPhase] = useState("choose");
11638
11671
  const [profile, setProfile] = useState(null);
11639
11672
  const greeting = useMemo(() => getRoleGreeting(session.roleAtOrganization), [session.roleAtOrganization]);
11640
11673
  const pickerCandidates = useMemo(() => getTutorialPicker(session.roleAtOrganization, session.integration, profile), [
@@ -13320,7 +13353,8 @@ function createMcpSuggestedPromptsServices(store) {
13320
13353
  const shared = { screens: {
13321
13354
  ["mcp-add"]: (store, services) => /* @__PURE__ */ jsx(McpScreen, {
13322
13355
  store,
13323
- installer: services.mcpInstaller
13356
+ installer: services.mcpInstaller,
13357
+ samplePrompts: getRolePrompts(store.session.roleAtOrganization, store.session.integration).slice(0, 3).map((p) => p.prompt)
13324
13358
  }),
13325
13359
  ["mcp-remove"]: (store, services) => /* @__PURE__ */ jsx(McpScreen, {
13326
13360
  store,
@@ -16054,19 +16088,10 @@ var WizardStore = class {
16054
16088
  list.push(fn);
16055
16089
  this._enterScreenHooks.set(screen, list);
16056
16090
  }
16057
- /**
16058
- * The program `screen` reports under — its step's `reportsAsProgramId` if it
16059
- * claims one, else the running program (also the fallback for overlays and
16060
- * screens with no owning step).
16061
- */
16062
- _programIdForScreen(screen) {
16063
- const program = this.router.activeProgram;
16064
- return flowOwner(program).flow.find((s) => s.screenId === screen)?.reportsAsProgramId ?? program;
16065
- }
16066
16091
  /** The program the visible screen reports under; screens stamp this on their
16067
16092
  * own events rather than relying on the run-level `program_id` tag. */
16068
16093
  get analyticsProgramId() {
16069
- return this._programIdForScreen(this.router.resolve(this));
16094
+ return this.router.activeProgram;
16070
16095
  }
16071
16096
  /**
16072
16097
  * Detect screen transitions, run enter-screen hooks, and fire analytics.
@@ -16081,7 +16106,7 @@ var WizardStore = class {
16081
16106
  if (hooks) for (const fn of hooks) fn();
16082
16107
  analytics.wizardCapture(`screen ${next}`, {
16083
16108
  from_screen: prev,
16084
- program_id: this._programIdForScreen(next),
16109
+ program_id: this.router.activeProgram,
16085
16110
  ...sessionProperties(this.session)
16086
16111
  });
16087
16112
  }
@@ -16185,4 +16210,4 @@ function releaseTerminal() {
16185
16210
  //#endregion
16186
16211
  export { AUDIT_AREA_SLIDES as A, totalTokenCount as B, assembleProfile as C, getTuiProgram as D, IssueTable as E, ContentSequencer as F, ModalOverlay as G, LogViewer as H, HNViewer as I, ProgressList as J, ConfirmationInput as K, TabContainer as L, IntroScreenLayout as M, PRIVACY_PANEL_LABEL as N, displayProgress as O, PrivacyPanel as P, getContentBlocks$5 as Q, ScreenContainer as R, McpSuggestedPromptsScreen as S, McpScreen as T, LinkText as U, EventPlanViewer as V, extractUrls as W, SplitView as X, LoadingBox as Y, CardLayout as Z, getTuiTool as _, SlackConnectScreen as a, extractOAuthCode as b, LearnCard as c, MINT_FAILURE_BODY as d, MINT_FAILURE_CONTACT as f, listFlowOwners as g, flowOwner as h, OutroScreen as i, AuditChecksViewer as j, useDismissOnAnyKey as k, AiOptInRequiredScreen as l, isRunFailure as m, releaseTerminal as n, TipsCard as o, MINT_FAILURE_MESSAGE as p, GroupedPickerMenu as q, WizardStore as r, VisualizerTab as s, enterDarkTerminal as t, ServiceHealthList as u, seededProfile as v, TAILORED_ROLES as w, abortOnScreens as x, getOrAskForProjectData as y, ViewportTooSmall as z };
16187
16212
 
16188
- //# sourceMappingURL=terminal-D20JFN3J.js.map
16213
+ //# sourceMappingURL=terminal-Bkxwzkhn.js.map