@posthog/wizard 2.38.1 → 2.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/{add-mcp-server-to-clients-BB1_aH5M.js → add-mcp-server-to-clients-CHSzsAG8.js} +5 -5
  2. package/dist/{add-mcp-server-to-clients-BB1_aH5M.js.map → add-mcp-server-to-clients-CHSzsAG8.js.map} +1 -1
  3. package/dist/{agent-interface-kOuzXg84.js → agent-interface-DExARWay.js} +6 -6
  4. package/dist/{agent-interface-kOuzXg84.js.map → agent-interface-DExARWay.js.map} +1 -1
  5. package/dist/{agent-runner-DZhaiwD5.js → agent-runner-CMfTmM3B.js} +16 -16
  6. package/dist/{agent-runner-DZhaiwD5.js.map → agent-runner-CMfTmM3B.js.map} +1 -1
  7. package/dist/{analytics-Z_2kCTpB.js → analytics-Ciob-x8a.js} +2 -2
  8. package/dist/{analytics-Z_2kCTpB.js.map → analytics-Ciob-x8a.js.map} +1 -1
  9. package/dist/analytics-DbfiRvPS.js +2 -0
  10. package/dist/{api-CwhOyprf.js → api-T_WHs3qZ.js} +3 -3
  11. package/dist/{api-CwhOyprf.js.map → api-T_WHs3qZ.js.map} +1 -1
  12. package/dist/bin.js +163 -69
  13. package/dist/bin.js.map +1 -1
  14. package/dist/{ci-install-CWDY86uB.js → ci-install-DJN5aT7W.js} +4 -4
  15. package/dist/{ci-install-CWDY86uB.js.map → ci-install-DJN5aT7W.js.map} +1 -1
  16. package/dist/{debug-BmdpjMub.js → debug-Cne-cLxd.js} +1 -1
  17. package/dist/{debug-CaRHQrDY.js → debug-D1lORUFs.js} +6 -10
  18. package/dist/debug-D1lORUFs.js.map +1 -0
  19. package/dist/{environment-knibpXF2.js → environment-BEsDCA2q.js} +3 -3
  20. package/dist/{environment-knibpXF2.js.map → environment-BEsDCA2q.js.map} +1 -1
  21. package/dist/{file-utils-DWYX_G1o.js → file-utils-Cn3dzlo-.js} +2 -2
  22. package/dist/{file-utils-DWYX_G1o.js.map → file-utils-Cn3dzlo-.js.map} +1 -1
  23. package/dist/{headless-ui-C4JCi9Zz.js → headless-ui-DGunpK-s.js} +2 -2
  24. package/dist/{headless-ui-C4JCi9Zz.js.map → headless-ui-DGunpK-s.js.map} +1 -1
  25. package/dist/{host-resolution-C18FwVrM.js → host-resolution-BnUJZKId.js} +3 -3
  26. package/dist/{host-resolution-C18FwVrM.js.map → host-resolution-BnUJZKId.js.map} +1 -1
  27. package/dist/{interactive-46qgS-UA.js → interactive-BB2IDSWP.js} +2 -2
  28. package/dist/{interactive-46qgS-UA.js.map → interactive-BB2IDSWP.js.map} +1 -1
  29. package/dist/{mcp-QWL5Obf3.js → mcp-CgA5vyiS.js} +2 -2
  30. package/dist/{mcp-QWL5Obf3.js.map → mcp-CgA5vyiS.js.map} +1 -1
  31. package/dist/{mcp-prompt-streaming-BpNkFksF.js → mcp-prompt-streaming-CGAkq9qR.js} +4 -4
  32. package/dist/{mcp-prompt-streaming-BpNkFksF.js.map → mcp-prompt-streaming-CGAkq9qR.js.map} +1 -1
  33. package/dist/{non-interactive-3_T1d0cj.js → non-interactive-Dko5F3vh.js} +2 -2
  34. package/dist/{non-interactive-3_T1d0cj.js.map → non-interactive-Dko5F3vh.js.map} +1 -1
  35. package/dist/{package-manager-C5VVQHQ-.js → package-manager-WKKQADHM.js} +2 -2
  36. package/dist/{package-manager-C5VVQHQ-.js.map → package-manager-WKKQADHM.js.map} +1 -1
  37. package/dist/{playground-CbzUpMuN.js → playground-UtT6zbjE.js} +5 -5
  38. package/dist/{playground-CbzUpMuN.js.map → playground-UtT6zbjE.js.map} +1 -1
  39. package/dist/{posthog-integration-6vdi4wRB.js → posthog-integration-CWXSng0W.js} +39 -20
  40. package/dist/posthog-integration-CWXSng0W.js.map +1 -0
  41. package/dist/{provisioning-DK0tS98H.js → provisioning-CgomM26T.js} +4 -4
  42. package/dist/{provisioning-DK0tS98H.js.map → provisioning-CgomM26T.js.map} +1 -1
  43. package/dist/{registry-DfXVjxsP.js → registry-BQIX-25O.js} +11 -8
  44. package/dist/{registry-DfXVjxsP.js.map → registry-BQIX-25O.js.map} +1 -1
  45. package/dist/{security-BMVH_bjk.js → security-pJOYY5LO.js} +3 -3
  46. package/dist/{security-BMVH_bjk.js.map → security-pJOYY5LO.js.map} +1 -1
  47. package/dist/{setup-utils-v9I6PQyP.js → setup-utils-DLGNk8T6.js} +9 -9
  48. package/dist/{setup-utils-v9I6PQyP.js.map → setup-utils-DLGNk8T6.js.map} +1 -1
  49. package/dist/{start-tui-CylEL6i_.js → start-tui-BjCKghQq.js} +131 -71
  50. package/dist/start-tui-BjCKghQq.js.map +1 -0
  51. package/dist/{steps-DQdpexNM.js → steps-XjV9CiqH.js} +7 -7
  52. package/dist/{steps-DQdpexNM.js.map → steps-XjV9CiqH.js.map} +1 -1
  53. package/dist/{store-Db0X2V5D.js → store-CDIxU0rr.js} +7 -5
  54. package/dist/{store-Db0X2V5D.js.map → store-CDIxU0rr.js.map} +1 -1
  55. package/dist/{subagent-Pk9jRXRf.js → subagent-S5Yh16IJ.js} +2 -2
  56. package/dist/{subagent-Pk9jRXRf.js.map → subagent-S5Yh16IJ.js.map} +1 -1
  57. package/dist/{tasks-B46phMJu.js → tasks-wbjOdifO.js} +2 -2
  58. package/dist/{tasks-B46phMJu.js.map → tasks-wbjOdifO.js.map} +1 -1
  59. package/dist/{telemetry-BJAHymMq.js → telemetry-BfnR7gtf.js} +3 -3
  60. package/dist/{telemetry-BJAHymMq.js.map → telemetry-BfnR7gtf.js.map} +1 -1
  61. package/dist/{terminal-BTQSAkC-.js → terminal-BvRwVeQp.js} +11 -11
  62. package/dist/{terminal-BTQSAkC-.js.map → terminal-BvRwVeQp.js.map} +1 -1
  63. package/dist/{tools-C_m5knXt.js → tools-CbtYlZV4.js} +4 -4
  64. package/dist/{tools-C_m5knXt.js.map → tools-CbtYlZV4.js.map} +1 -1
  65. package/dist/{urls-BCmeQMIb.js → urls-CilgPbS-.js} +2 -2
  66. package/dist/{urls-BCmeQMIb.js.map → urls-CilgPbS-.js.map} +1 -1
  67. package/dist/{wizard-abort-DkngXmxN.js → wizard-abort-Cp5Y7f8C.js} +3 -3
  68. package/dist/{wizard-abort-DkngXmxN.js.map → wizard-abort-Cp5Y7f8C.js.map} +1 -1
  69. package/dist/{wizard-abort-CMzW4LVM.js → wizard-abort-DHrEGqaC.js} +1 -1
  70. package/dist/{wizard-tools-C8nVWLeI.js → wizard-tools-DQTfAzSV.js} +28 -62
  71. package/dist/wizard-tools-DQTfAzSV.js.map +1 -0
  72. package/package.json +2 -1
  73. package/dist/analytics-B1SC2jaf.js +0 -2
  74. package/dist/debug-CaRHQrDY.js.map +0 -1
  75. package/dist/posthog-integration-6vdi4wRB.js.map +0 -1
  76. package/dist/start-tui-CylEL6i_.js.map +0 -1
  77. package/dist/wizard-tools-C8nVWLeI.js.map +0 -1
@@ -1,20 +1,20 @@
1
- import { F as Integration, I as OAUTH_PORTS, J as POSTHOG_TERMS_URL, L as OAUTH_TIMEOUT_MS, U as POSTHOG_ORG_AI_SETTINGS_URL, V as POSTHOG_DOCS_URL, W as POSTHOG_PRIVACY_URL, X as REMOTE_SKILLS_BASE_URL, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, st as WIZARD_TOOLS_MENU_FLAG_KEY, y as getBlockingServiceKeys } from "./debug-CaRHQrDY.js";
2
- import { n as analytics } from "./analytics-Z_2kCTpB.js";
3
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-v9I6PQyP.js";
4
- import { o as getUiHostFromHost } from "./urls-BCmeQMIb.js";
5
- import { t as ApiError } from "./api-CwhOyprf.js";
1
+ import { B as POSTHOG_DOCS_URL, F as OAUTH_PORTS, H as POSTHOG_ORG_AI_SETTINGS_URL, I as OAUTH_TIMEOUT_MS, P as Integration, U as POSTHOG_PRIVACY_URL, Y as REMOTE_SKILLS_BASE_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, ot as WIZARD_TOOLS_MENU_FLAG_KEY, p as setUI, q as POSTHOG_TERMS_URL, s as logToFile, v as getBlockingServiceKeys } from "./debug-D1lORUFs.js";
2
+ import { n as analytics } from "./analytics-Ciob-x8a.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-DLGNk8T6.js";
4
+ import { o as getUiHostFromHost } from "./urls-CilgPbS-.js";
5
+ import { t as ApiError } from "./api-T_WHs3qZ.js";
6
6
  import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-BoXAZEOf.js";
7
- import { i as wizardAbort } from "./wizard-abort-DkngXmxN.js";
8
- import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-DZhaiwD5.js";
9
- import { S as EVENT_PLAN_FILE } from "./agent-interface-kOuzXg84.js";
10
- import { _ as coerceAuditChecks, g as AUDIT_SEVERITY_STYLE, i as fetchSkillMenu, m as AUDIT_CHECKS_KEY, p as AUDIT_CHECKS_FILE, r as downloadSkill, v as getAuditChecks } from "./wizard-tools-C8nVWLeI.js";
11
- import { t as FRAMEWORK_REGISTRY } from "./registry-DfXVjxsP.js";
12
- import { g as detectProjectsWithAgent, m as Icons, p as Colors, t as SETUP_REPORT_FILE } from "./posthog-integration-6vdi4wRB.js";
7
+ import { i as wizardAbort } from "./wizard-abort-Cp5Y7f8C.js";
8
+ import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-CMfTmM3B.js";
9
+ import { S as EVENT_PLAN_FILE } from "./agent-interface-DExARWay.js";
10
+ import { _ as coerceAuditChecks, g as AUDIT_SEVERITY_STYLE, i as fetchSkillMenu, m as AUDIT_CHECKS_KEY, p as AUDIT_CHECKS_FILE, r as downloadSkill, v as getAuditChecks } from "./wizard-tools-DQTfAzSV.js";
11
+ import { t as FRAMEWORK_REGISTRY } from "./registry-BQIX-25O.js";
12
+ import { g as detectProjectsWithAgent, m as Icons, p as Colors, t as SETUP_REPORT_FILE } from "./posthog-integration-CWXSng0W.js";
13
13
  import { C as STRIPE_SDKS, S as POSTHOG_SDKS, _ as SOURCE_MAPS_CONTEXT_KEYS, b as getDetectedWarehouseSources, d as Program, f as getProgramConfig, g as DISPLAY_NAME, h as AUTOMATABLE_VARIANTS, m as SELF_DRIVING_INTEGRATE_PATH_KEY, n as useKeyBindings, p as detectSelfDrivingIntegrationProjects, t as PickerMenu, x as getContentBlocks, y as fetchHealthIssues } from "./bin.js";
14
- import { r as totalTokenCount, t as WizardStore } from "./store-Db0X2V5D.js";
15
- import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as SEVERITY_ORDER, a as useSkillEntry, b as LearnCard, c as SlackConnectScreen, d as AuditChecksViewer, f as McpSuggestedPromptsScreen, g as SEVERITY_LABEL, h as IssueTable, i as SkillSourceInfo, k as ModalOverlay, l as AUDIT_AREA_SLIDES, m as McpScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as ServiceHealthList, w as ScreenContainer, y as TipsCard } from "./terminal-BTQSAkC-.js";
14
+ import { r as totalTokenCount, t as WizardStore } from "./store-CDIxU0rr.js";
15
+ import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as SEVERITY_ORDER, a as useSkillEntry, b as LearnCard, c as SlackConnectScreen, d as AuditChecksViewer, f as McpSuggestedPromptsScreen, g as SEVERITY_LABEL, h as IssueTable, i as SkillSourceInfo, k as ModalOverlay, l as AUDIT_AREA_SLIDES, m as McpScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as ServiceHealthList, w as ScreenContainer, y as TipsCard } from "./terminal-BvRwVeQp.js";
16
16
  import { t as ALL_FEATURE_VALUES } from "./defaults-a0e6IRjP.js";
17
- import { a as getSupportedClients, c as removeMCPServer, i as getInstalledClients, o as getSupportedPluginClients, s as installPlugins, u as isPluginCapable } from "./add-mcp-server-to-clients-BB1_aH5M.js";
17
+ import { a as getSupportedClients, c as removeMCPServer, i as getInstalledClients, o as getSupportedPluginClients, s as installPlugins, u as isPluginCapable } from "./add-mcp-server-to-clients-CHSzsAG8.js";
18
18
  import * as fs$1 from "fs";
19
19
  import path from "path";
20
20
  import { join as join$1 } from "node:path";
@@ -269,7 +269,7 @@ const HealthCheckScreen = ({ store }) => {
269
269
  if (menu) {
270
270
  const prefix = `integration-${integration}`;
271
271
  const skills = (menu.categories["integration"] ?? []).filter((s) => s.id.startsWith(prefix));
272
- for (const skill of skills) downloadSkill(skill, store.session.installDir, ".posthog/skills");
272
+ for (const skill of skills) await downloadSkill(skill, store.session.installDir, ".posthog/skills");
273
273
  }
274
274
  setDownloaded(true);
275
275
  };
@@ -1079,7 +1079,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1079
1079
  })),
1080
1080
  onSelect: (value) => {
1081
1081
  const integration = Array.isArray(value) ? value[0] : value;
1082
- import("./registry-DfXVjxsP.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1082
+ import("./registry-BQIX-25O.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1083
1083
  const config = FRAMEWORK_REGISTRY[integration];
1084
1084
  store.setFrameworkConfig(integration, config);
1085
1085
  store.setDetectedFramework(config.metadata.name);
@@ -2087,7 +2087,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2087
2087
  ]
2088
2088
  })]
2089
2089
  }),
2090
- /* @__PURE__ */ jsx(BlockedSummary$1, { blocked }),
2090
+ /* @__PURE__ */ jsx(BlockedSummary, { blocked }),
2091
2091
  /* @__PURE__ */ jsx(Box, {
2092
2092
  marginTop: 1,
2093
2093
  children: /* @__PURE__ */ jsx(PickerMenu, {
@@ -2142,7 +2142,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2142
2142
  }),
2143
2143
  /* @__PURE__ */ jsx(Box, {
2144
2144
  marginTop: 1,
2145
- children: /* @__PURE__ */ jsx(BlockedSummary$1, { blocked })
2145
+ children: /* @__PURE__ */ jsx(BlockedSummary, { blocked })
2146
2146
  })
2147
2147
  ]
2148
2148
  });
@@ -2151,7 +2151,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2151
2151
  * Collapses the non-instrumentable projects into a short count line (or two)
2152
2152
  * instead of listing every one — a monorepo can have dozens.
2153
2153
  */
2154
- const BlockedSummary$1 = ({ blocked }) => {
2154
+ const BlockedSummary = ({ blocked }) => {
2155
2155
  const unsupported = blocked.filter((p) => p.variant == null).length;
2156
2156
  const missingSdk = blocked.length - unsupported;
2157
2157
  if (blocked.length === 0) return null;
@@ -2629,12 +2629,11 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
2629
2629
  //#region src/ui/tui/screens/SelfDrivingIntegrationDetectScreen.tsx
2630
2630
  /**
2631
2631
  * SelfDrivingIntegrationDetectScreen — runs the Haiku detector over the repo,
2632
- * streams progress, then renders a picker of the projects PostHog can be set up
2633
- * in (a supported framework, no SDK yet). The user picks one — a single project
2634
- * or the repo root is still shown as a one-item menu to confirm — and the choice
2635
- * (framework + path) is written to the session; the integrate-run phase sets
2636
- * PostHog up there. On a detection error, falls back to a manual framework
2637
- * picker so the run can still proceed.
2632
+ * streams progress, then renders a picker of projects. Two kinds are offered:
2633
+ * set-up-here (supported framework, no SDK yet; writes framework + path for
2634
+ * the integrate-run phase) and continue-with-existing (already has PostHog;
2635
+ * sets integrate=false and skips straight to Self-driving). On a detection
2636
+ * error, falls back to a manual framework picker.
2638
2637
  *
2639
2638
  * Runs after auth — the detector needs credentials.
2640
2639
  */
@@ -2656,6 +2655,13 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2656
2655
  store.setFrameworkContext(SELF_DRIVING_INTEGRATE_PATH_KEY, p.path);
2657
2656
  store.setFrameworkConfig(p.integration, FRAMEWORK_REGISTRY[p.integration]);
2658
2657
  };
2658
+ const continueWithExisting = (p) => {
2659
+ store.setFrameworkContext(SELF_DRIVING_INTEGRATE_PATH_KEY, p.path);
2660
+ store.setIntegrate(false, {
2661
+ via: "existing-integration-detected",
2662
+ path: p.path
2663
+ });
2664
+ };
2659
2665
  useEffect(() => {
2660
2666
  if (!accessToken || started.current) return;
2661
2667
  started.current = true;
@@ -2748,8 +2754,25 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2748
2754
  });
2749
2755
  const { report } = state;
2750
2756
  const instrumentable = report.projects.filter((p) => p.instrumentable);
2751
- const blocked = report.projects.filter((p) => !p.instrumentable);
2752
- if (instrumentable.length === 0) return /* @__PURE__ */ jsxs(Box, {
2757
+ const existing = report.projects.filter((p) => p.continuable);
2758
+ const unsupported = report.projects.filter((p) => !p.instrumentable && !p.continuable);
2759
+ const NEW = "new:";
2760
+ const EXISTING = "existing:";
2761
+ const dispatch = (value) => {
2762
+ const v = Array.isArray(value) ? value[0] : value;
2763
+ if (v === CANCEL) {
2764
+ process.exit(0);
2765
+ return;
2766
+ }
2767
+ if (v.startsWith(EXISTING)) {
2768
+ const p = existing.find((x) => x.path === v.slice(9));
2769
+ if (p) continueWithExisting(p);
2770
+ return;
2771
+ }
2772
+ const p = instrumentable.find((x) => x.path === v.slice(4));
2773
+ if (p) choose(p);
2774
+ };
2775
+ if (instrumentable.length === 0 && existing.length === 0) return /* @__PURE__ */ jsxs(Box, {
2753
2776
  flexDirection: "column",
2754
2777
  children: [
2755
2778
  /* @__PURE__ */ jsxs(Box, {
@@ -2768,7 +2791,7 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2768
2791
  ]
2769
2792
  })]
2770
2793
  }),
2771
- /* @__PURE__ */ jsx(BlockedSummary, { blocked }),
2794
+ /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported }),
2772
2795
  /* @__PURE__ */ jsx(Box, {
2773
2796
  marginTop: 1,
2774
2797
  children: /* @__PURE__ */ jsx(PickerMenu, {
@@ -2781,14 +2804,73 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2781
2804
  })
2782
2805
  ]
2783
2806
  });
2807
+ if (instrumentable.length === 0) return /* @__PURE__ */ jsxs(Box, {
2808
+ flexDirection: "column",
2809
+ children: [
2810
+ /* @__PURE__ */ jsxs(Box, {
2811
+ flexDirection: "column",
2812
+ marginBottom: 1,
2813
+ children: [/* @__PURE__ */ jsxs(Text, {
2814
+ bold: true,
2815
+ color: Colors.accent,
2816
+ children: [Icons.check, " PostHog is already set up"]
2817
+ }), /* @__PURE__ */ jsx(Text, {
2818
+ dimColor: true,
2819
+ children: "Continue straight to Self-driving."
2820
+ })]
2821
+ }),
2822
+ /* @__PURE__ */ jsx(PickerMenu, {
2823
+ message: existing.length === 1 ? "Continue with your existing PostHog install?" : "Which project should Self-driving use?",
2824
+ options: [...existing.map((p) => ({
2825
+ label: projectLabel(p),
2826
+ value: `${EXISTING}${p.path}`
2827
+ })), {
2828
+ label: "Exit",
2829
+ value: CANCEL
2830
+ }],
2831
+ onSelect: dispatch
2832
+ }),
2833
+ /* @__PURE__ */ jsx(Box, {
2834
+ marginTop: 1,
2835
+ children: /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported })
2836
+ })
2837
+ ]
2838
+ });
2784
2839
  const single = instrumentable.length === 1;
2785
- const options = [...instrumentable.map((p) => ({
2786
- label: projectLabel(p),
2787
- value: p.path
2788
- })), {
2789
- label: "Cancel",
2790
- value: CANCEL
2791
- }];
2840
+ const HEAD = "head:";
2841
+ const spacer = (id) => ({
2842
+ label: " ",
2843
+ value: `${HEAD}${id}`,
2844
+ disabled: true
2845
+ });
2846
+ const heading = (id, label) => ({
2847
+ label,
2848
+ value: `${HEAD}${id}`,
2849
+ disabled: true,
2850
+ header: true
2851
+ });
2852
+ const options = [
2853
+ heading("new", "New PostHog integration:"),
2854
+ ...instrumentable.map((p) => ({
2855
+ label: projectLabel(p),
2856
+ value: `${NEW}${p.path}`,
2857
+ indent: true
2858
+ })),
2859
+ ...existing.length > 0 ? [
2860
+ spacer("gap1"),
2861
+ heading("existing", "Existing integrations:"),
2862
+ ...existing.map((p) => ({
2863
+ label: projectLabel(p),
2864
+ value: `${EXISTING}${p.path}`,
2865
+ indent: true
2866
+ }))
2867
+ ] : [],
2868
+ spacer("gap2"),
2869
+ {
2870
+ label: "Cancel",
2871
+ value: CANCEL
2872
+ }
2873
+ ];
2792
2874
  return /* @__PURE__ */ jsxs(Box, {
2793
2875
  flexDirection: "column",
2794
2876
  children: [
@@ -2807,57 +2889,35 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2807
2889
  })
2808
2890
  }),
2809
2891
  /* @__PURE__ */ jsx(PickerMenu, {
2810
- message: single ? "Set up PostHog here? Confirm to continue." : "Which project should we set up PostHog in?",
2892
+ message: single && existing.length === 0 ? "Set up PostHog here? Confirm to continue." : void 0,
2811
2893
  options,
2812
- onSelect: (value) => {
2813
- const path = Array.isArray(value) ? value[0] : value;
2814
- if (path === CANCEL) {
2815
- process.exit(0);
2816
- return;
2817
- }
2818
- const chosen = instrumentable.find((p) => p.path === path);
2819
- if (chosen) choose(chosen);
2820
- }
2894
+ onSelect: dispatch
2821
2895
  }),
2822
2896
  /* @__PURE__ */ jsx(Box, {
2823
2897
  marginTop: 1,
2824
- children: /* @__PURE__ */ jsx(BlockedSummary, { blocked })
2898
+ children: /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported })
2825
2899
  })
2826
2900
  ]
2827
2901
  });
2828
2902
  };
2829
2903
  /**
2830
- * Collapses the projects we didn't offer into short count lines — already has
2831
- * PostHog, or an unsupported stack. A monorepo can have many, so we summarise.
2904
+ * Collapses unsupported-stack projects into a count line (already-has-PostHog
2905
+ * projects are real picker options, not summarised).
2832
2906
  */
2833
- const BlockedSummary = ({ blocked }) => {
2834
- const alreadyIntegrated = blocked.filter((p) => p.hasPostHog).length;
2835
- const unsupported = blocked.length - alreadyIntegrated;
2836
- if (blocked.length === 0) return null;
2837
- return /* @__PURE__ */ jsxs(Box, {
2907
+ const UnsupportedSummary = ({ unsupported }) => {
2908
+ if (unsupported.length === 0) return null;
2909
+ return /* @__PURE__ */ jsx(Box, {
2838
2910
  flexDirection: "column",
2839
- children: [alreadyIntegrated > 0 && /* @__PURE__ */ jsxs(Text, {
2911
+ children: /* @__PURE__ */ jsxs(Text, {
2840
2912
  dimColor: true,
2841
2913
  children: [
2842
2914
  "(… ",
2843
- alreadyIntegrated,
2915
+ unsupported.length,
2844
2916
  " project",
2845
- alreadyIntegrated === 1 ? "" : "s",
2846
- " ",
2847
- "already ",
2848
- alreadyIntegrated === 1 ? "has" : "have",
2849
- " PostHog)"
2850
- ]
2851
- }), unsupported > 0 && /* @__PURE__ */ jsxs(Text, {
2852
- dimColor: true,
2853
- children: [
2854
- "(… ",
2855
- unsupported,
2856
- " project",
2857
- unsupported === 1 ? "" : "s",
2917
+ unsupported.length === 1 ? "" : "s",
2858
2918
  " not supported yet)"
2859
2919
  ]
2860
- })]
2920
+ })
2861
2921
  });
2862
2922
  };
2863
2923
  //#endregion
@@ -4953,7 +5013,7 @@ function createMcpSuggestedPromptsServices(store) {
4953
5013
  };
4954
5014
  }
4955
5015
  async function* runProductionPromptStreaming(args) {
4956
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-BpNkFksF.js");
5016
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-CGAkq9qR.js");
4957
5017
  yield* runMcpPromptViaSdk(args);
4958
5018
  }
4959
5019
  //#endregion
@@ -5125,4 +5185,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5125
5185
  //#endregion
5126
5186
  export { startTUI };
5127
5187
 
5128
- //# sourceMappingURL=start-tui-CylEL6i_.js.map
5188
+ //# sourceMappingURL=start-tui-BjCKghQq.js.map