@posthog/wizard 2.38.1 → 2.39.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 (97) hide show
  1. package/README.md +70 -13
  2. package/dist/{add-mcp-server-to-clients-BB1_aH5M.js → add-mcp-server-to-clients-Ci0I1vbS.js} +6 -6
  3. package/dist/{add-mcp-server-to-clients-BB1_aH5M.js.map → add-mcp-server-to-clients-Ci0I1vbS.js.map} +1 -1
  4. package/dist/{agent-interface-kOuzXg84.js → agent-interface-BR3zAUpM.js} +30 -623
  5. package/dist/agent-interface-BR3zAUpM.js.map +1 -0
  6. package/dist/{agent-runner-DZhaiwD5.js → agent-runner-B1fzwFzc.js} +33 -18
  7. package/dist/agent-runner-B1fzwFzc.js.map +1 -0
  8. package/dist/{analytics-Z_2kCTpB.js → analytics-C7Oc3yWZ.js} +3 -2
  9. package/dist/analytics-C7Oc3yWZ.js.map +1 -0
  10. package/dist/analytics-tVERo8XR.js +2 -0
  11. package/dist/{api-CwhOyprf.js → api-DSG-l8Ql.js} +3 -3
  12. package/dist/{api-CwhOyprf.js.map → api-DSG-l8Ql.js.map} +1 -1
  13. package/dist/bin.js +513 -137
  14. package/dist/bin.js.map +1 -1
  15. package/dist/{ci-install-CWDY86uB.js → ci-install-DeAd2HYP.js} +4 -4
  16. package/dist/{ci-install-CWDY86uB.js.map → ci-install-DeAd2HYP.js.map} +1 -1
  17. package/dist/{debug-CaRHQrDY.js → debug-BZnZ7Gvh.js} +39 -16
  18. package/dist/debug-BZnZ7Gvh.js.map +1 -0
  19. package/dist/{debug-BmdpjMub.js → debug-DtgfvuKF.js} +1 -1
  20. package/dist/{defaults-a0e6IRjP.js → defaults-BxiMLkQY.js} +1 -1
  21. package/dist/{defaults-a0e6IRjP.js.map → defaults-BxiMLkQY.js.map} +1 -1
  22. package/dist/{env-api-key-DEl3LJBv.js → env-api-key-DDVkPQmo.js} +1 -1
  23. package/dist/{env-api-key-DEl3LJBv.js.map → env-api-key-DDVkPQmo.js.map} +1 -1
  24. package/dist/{environment-knibpXF2.js → environment-QNoUem74.js} +3 -3
  25. package/dist/{environment-knibpXF2.js.map → environment-QNoUem74.js.map} +1 -1
  26. package/dist/{file-utils-DWYX_G1o.js → file-utils-UqdMTR9x.js} +2 -2
  27. package/dist/{file-utils-DWYX_G1o.js.map → file-utils-UqdMTR9x.js.map} +1 -1
  28. package/dist/{headless-ui-C4JCi9Zz.js → headless-ui-DtFktXIa.js} +2 -2
  29. package/dist/{headless-ui-C4JCi9Zz.js.map → headless-ui-DtFktXIa.js.map} +1 -1
  30. package/dist/{host-resolution-C18FwVrM.js → host-resolution-DjQvur4X.js} +3 -3
  31. package/dist/{host-resolution-C18FwVrM.js.map → host-resolution-DjQvur4X.js.map} +1 -1
  32. package/dist/{interactive-46qgS-UA.js → interactive-_8v2Ymw2.js} +2 -2
  33. package/dist/{interactive-46qgS-UA.js.map → interactive-_8v2Ymw2.js.map} +1 -1
  34. package/dist/{mcp-QWL5Obf3.js → mcp-BX34188X.js} +2 -2
  35. package/dist/{mcp-QWL5Obf3.js.map → mcp-BX34188X.js.map} +1 -1
  36. package/dist/{mcp-prompt-streaming-BpNkFksF.js → mcp-prompt-streaming-l1zsmQQc.js} +4 -4
  37. package/dist/{mcp-prompt-streaming-BpNkFksF.js.map → mcp-prompt-streaming-l1zsmQQc.js.map} +1 -1
  38. package/dist/{non-interactive-3_T1d0cj.js → non-interactive-BBCGIDP5.js} +2 -2
  39. package/dist/{non-interactive-3_T1d0cj.js.map → non-interactive-BBCGIDP5.js.map} +1 -1
  40. package/dist/{package-manager-C5VVQHQ-.js → package-manager-FY9qPU4z.js} +2 -2
  41. package/dist/{package-manager-C5VVQHQ-.js.map → package-manager-FY9qPU4z.js.map} +1 -1
  42. package/dist/{playground-CbzUpMuN.js → playground-B9Gesj-w.js} +5 -5
  43. package/dist/{playground-CbzUpMuN.js.map → playground-B9Gesj-w.js.map} +1 -1
  44. package/dist/{posthog-BESrI6-T.js → posthog-BHbtnNQE.js} +1 -1
  45. package/dist/{posthog-BESrI6-T.js.map → posthog-BHbtnNQE.js.map} +1 -1
  46. package/dist/{posthog-integration-6vdi4wRB.js → posthog-integration-CMNtIV97.js} +39 -20
  47. package/dist/posthog-integration-CMNtIV97.js.map +1 -0
  48. package/dist/{provisioning-DK0tS98H.js → provisioning-BInfIJy5.js} +4 -4
  49. package/dist/{provisioning-DK0tS98H.js.map → provisioning-BInfIJy5.js.map} +1 -1
  50. package/dist/{registry-DfXVjxsP.js → registry-BsPnELr-.js} +11 -8
  51. package/dist/{registry-DfXVjxsP.js.map → registry-BsPnELr-.js.map} +1 -1
  52. package/dist/security-CSlaLY6P.js +204 -0
  53. package/dist/security-CSlaLY6P.js.map +1 -0
  54. package/dist/{setup-utils-v9I6PQyP.js → setup-utils-DfRLklZ3.js} +9 -9
  55. package/dist/{setup-utils-v9I6PQyP.js.map → setup-utils-DfRLklZ3.js.map} +1 -1
  56. package/dist/{start-tui-CylEL6i_.js → start-tui-H_BSAFdp.js} +143 -81
  57. package/dist/start-tui-H_BSAFdp.js.map +1 -0
  58. package/dist/{steps-DQdpexNM.js → steps-z89LzfJG.js} +7 -7
  59. package/dist/{steps-DQdpexNM.js.map → steps-z89LzfJG.js.map} +1 -1
  60. package/dist/{store-Db0X2V5D.js → store-B3B76DgD.js} +7 -5
  61. package/dist/{store-Db0X2V5D.js.map → store-B3B76DgD.js.map} +1 -1
  62. package/dist/{subagent-Pk9jRXRf.js → subagent-CV59ljO1.js} +2 -2
  63. package/dist/{subagent-Pk9jRXRf.js.map → subagent-CV59ljO1.js.map} +1 -1
  64. package/dist/{task-stream-rC4IEUHC.js → task-stream-d-R9J0g4.js} +2 -2
  65. package/dist/{task-stream-rC4IEUHC.js.map → task-stream-d-R9J0g4.js.map} +1 -1
  66. package/dist/{tasks-B46phMJu.js → tasks-DkX454Mg.js} +2 -2
  67. package/dist/{tasks-B46phMJu.js.map → tasks-DkX454Mg.js.map} +1 -1
  68. package/dist/{telemetry-BJAHymMq.js → telemetry-BCIe6Kli.js} +3 -3
  69. package/dist/{telemetry-BJAHymMq.js.map → telemetry-BCIe6Kli.js.map} +1 -1
  70. package/dist/{terminal-BTQSAkC-.js → terminal-CPXW44sU.js} +13 -12
  71. package/dist/{terminal-BTQSAkC-.js.map → terminal-CPXW44sU.js.map} +1 -1
  72. package/dist/{tools-C_m5knXt.js → tools-C4BqVrt6.js} +4 -4
  73. package/dist/{tools-C_m5knXt.js.map → tools-C4BqVrt6.js.map} +1 -1
  74. package/dist/types-evL_rPob.js +46 -0
  75. package/dist/types-evL_rPob.js.map +1 -0
  76. package/dist/{urls-BCmeQMIb.js → urls-D1AehCBN.js} +2 -2
  77. package/dist/{urls-BCmeQMIb.js.map → urls-D1AehCBN.js.map} +1 -1
  78. package/dist/warlock-smoke-test.ts +165 -0
  79. package/dist/{wizard-abort-DkngXmxN.js → wizard-abort-5fOIcY8w.js} +3 -3
  80. package/dist/{wizard-abort-DkngXmxN.js.map → wizard-abort-5fOIcY8w.js.map} +1 -1
  81. package/dist/{wizard-abort-CMzW4LVM.js → wizard-abort-Ce2RceZ1.js} +1 -1
  82. package/dist/{wizard-tools-C8nVWLeI.js → wizard-tools-xvIrJeNN.js} +44 -102
  83. package/dist/wizard-tools-xvIrJeNN.js.map +1 -0
  84. package/dist/yara-hooks-7MEXlgqm.js +2 -0
  85. package/dist/yara-hooks-DNn1Jqih.js +635 -0
  86. package/dist/yara-hooks-DNn1Jqih.js.map +1 -0
  87. package/package.json +5 -3
  88. package/dist/agent-interface-kOuzXg84.js.map +0 -1
  89. package/dist/agent-runner-DZhaiwD5.js.map +0 -1
  90. package/dist/analytics-B1SC2jaf.js +0 -2
  91. package/dist/analytics-Z_2kCTpB.js.map +0 -1
  92. package/dist/debug-CaRHQrDY.js.map +0 -1
  93. package/dist/posthog-integration-6vdi4wRB.js.map +0 -1
  94. package/dist/security-BMVH_bjk.js +0 -431
  95. package/dist/security-BMVH_bjk.js.map +0 -1
  96. package/dist/start-tui-CylEL6i_.js.map +0 -1
  97. package/dist/wizard-tools-C8nVWLeI.js.map +0 -1
@@ -1,20 +1,21 @@
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-BZnZ7Gvh.js";
2
+ import { n as analytics } from "./analytics-C7Oc3yWZ.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-DfRLklZ3.js";
4
+ import { o as getUiHostFromHost } from "./urls-D1AehCBN.js";
5
+ import { t as ApiError } from "./api-DSG-l8Ql.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-5fOIcY8w.js";
8
+ import { a as formatTokenCount, i as formatCostUsd } from "./agent-runner-B1fzwFzc.js";
9
+ import { i as fetchSkillMenu, r as downloadSkill } from "./wizard-tools-xvIrJeNN.js";
10
+ import { a as coerceAuditChecks, i as AUDIT_SEVERITY_STYLE, n as AUDIT_CHECKS_KEY, o as getAuditChecks, t as AUDIT_CHECKS_FILE } from "./types-evL_rPob.js";
11
+ import { m as EVENT_PLAN_FILE } from "./yara-hooks-DNn1Jqih.js";
12
+ import { t as FRAMEWORK_REGISTRY } from "./registry-BsPnELr-.js";
13
+ import { g as detectProjectsWithAgent, m as Icons, p as Colors, t as SETUP_REPORT_FILE } from "./posthog-integration-CMNtIV97.js";
13
14
  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";
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";
15
+ import { r as totalTokenCount, t as WizardStore } from "./store-B3B76DgD.js";
16
+ 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-CPXW44sU.js";
17
+ import { t as ALL_FEATURE_VALUES } from "./defaults-BxiMLkQY.js";
18
+ 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-Ci0I1vbS.js";
18
19
  import * as fs$1 from "fs";
19
20
  import path from "path";
20
21
  import { join as join$1 } from "node:path";
@@ -269,7 +270,7 @@ const HealthCheckScreen = ({ store }) => {
269
270
  if (menu) {
270
271
  const prefix = `integration-${integration}`;
271
272
  const skills = (menu.categories["integration"] ?? []).filter((s) => s.id.startsWith(prefix));
272
- for (const skill of skills) downloadSkill(skill, store.session.installDir, ".posthog/skills");
273
+ for (const skill of skills) await downloadSkill(skill, store.session.installDir, ".posthog/skills");
273
274
  }
274
275
  setDownloaded(true);
275
276
  };
@@ -1079,7 +1080,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1079
1080
  })),
1080
1081
  onSelect: (value) => {
1081
1082
  const integration = Array.isArray(value) ? value[0] : value;
1082
- import("./registry-DfXVjxsP.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1083
+ import("./registry-BsPnELr-.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1083
1084
  const config = FRAMEWORK_REGISTRY[integration];
1084
1085
  store.setFrameworkConfig(integration, config);
1085
1086
  store.setDetectedFramework(config.metadata.name);
@@ -2087,7 +2088,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2087
2088
  ]
2088
2089
  })]
2089
2090
  }),
2090
- /* @__PURE__ */ jsx(BlockedSummary$1, { blocked }),
2091
+ /* @__PURE__ */ jsx(BlockedSummary, { blocked }),
2091
2092
  /* @__PURE__ */ jsx(Box, {
2092
2093
  marginTop: 1,
2093
2094
  children: /* @__PURE__ */ jsx(PickerMenu, {
@@ -2142,7 +2143,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2142
2143
  }),
2143
2144
  /* @__PURE__ */ jsx(Box, {
2144
2145
  marginTop: 1,
2145
- children: /* @__PURE__ */ jsx(BlockedSummary$1, { blocked })
2146
+ children: /* @__PURE__ */ jsx(BlockedSummary, { blocked })
2146
2147
  })
2147
2148
  ]
2148
2149
  });
@@ -2151,7 +2152,7 @@ const SourceMapsDetectScreen = ({ store }) => {
2151
2152
  * Collapses the non-instrumentable projects into a short count line (or two)
2152
2153
  * instead of listing every one — a monorepo can have dozens.
2153
2154
  */
2154
- const BlockedSummary$1 = ({ blocked }) => {
2155
+ const BlockedSummary = ({ blocked }) => {
2155
2156
  const unsupported = blocked.filter((p) => p.variant == null).length;
2156
2157
  const missingSdk = blocked.length - unsupported;
2157
2158
  if (blocked.length === 0) return null;
@@ -2479,10 +2480,11 @@ const SelfDrivingIntroScreen = ({ store }) => {
2479
2480
  marginTop: 1,
2480
2481
  paddingLeft: 4,
2481
2482
  children: [
2482
- /* @__PURE__ */ jsxs(Text, { children: ["•", " Watches errors, replays, and connected tools"] }),
2483
- /* @__PURE__ */ jsxs(Text, { children: ["•", " Runs scouts — scheduled checks that scan for issues"] }),
2483
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Watches your signal sources: errors, replays, connected tools"] }),
2484
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Runs scouts – scheduled agents that scan for issues"] }),
2485
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Groups signals into prioritized reports in your inbox"] }),
2484
2486
  /* @__PURE__ */ jsxs(Text, { children: ["•", " Researches findings in your code via GitHub"] }),
2485
- /* @__PURE__ */ jsxs(Text, { children: ["•", " Surfaces everything in your Self-driving inbox"] })
2487
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Measures shipped fixes, and reopens the loop if the pattern persists"] })
2486
2488
  ]
2487
2489
  })
2488
2490
  ]
@@ -2494,7 +2496,7 @@ const SelfDrivingIntroScreen = ({ store }) => {
2494
2496
  /* @__PURE__ */ jsx(Box, {
2495
2497
  flexDirection: "column",
2496
2498
  marginTop: 1,
2497
- children: /* @__PURE__ */ jsx(Text, { children: "PostHog finds — and can fix — issues in your product." })
2499
+ children: /* @__PURE__ */ jsx(Text, { children: "PostHog watches how people really use your product, finds issues, and proposes fixes." })
2498
2500
  }),
2499
2501
  /* @__PURE__ */ jsxs(Box, {
2500
2502
  flexDirection: "column",
@@ -2502,10 +2504,10 @@ const SelfDrivingIntroScreen = ({ store }) => {
2502
2504
  alignItems: "center",
2503
2505
  children: [/* @__PURE__ */ jsx(Text, {
2504
2506
  dimColor: true,
2505
- children: "It turns on signal sources (errors, replays, connected tools)"
2507
+ children: "An agent will connect GitHub, enable signal sources, and tune your scouts."
2506
2508
  }), /* @__PURE__ */ jsx(Text, {
2507
2509
  dimColor: true,
2508
- children: "and scouts — scheduled checks that flag issues to your inbox."
2510
+ children: "About 10 minutes, with a few questions along the way."
2509
2511
  })]
2510
2512
  })
2511
2513
  ]
@@ -2609,7 +2611,7 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
2609
2611
  flexDirection: "column",
2610
2612
  children: /* @__PURE__ */ jsx(Text, {
2611
2613
  dimColor: true,
2612
- children: "We didn't find an existing PostHog integration in your project. Before you can self-drive, you'll need to integrate PostHog into your project to capture events and generate signals."
2614
+ children: "This will kick off an agent to explore your project and find existing PostHog integrations. Self-driving reads PostHog data, so we'll set that up first: it gives your signal sources something to watch."
2613
2615
  })
2614
2616
  }),
2615
2617
  /* @__PURE__ */ jsx(Box, {
@@ -2629,12 +2631,11 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
2629
2631
  //#region src/ui/tui/screens/SelfDrivingIntegrationDetectScreen.tsx
2630
2632
  /**
2631
2633
  * 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.
2634
+ * streams progress, then renders a picker of projects. Two kinds are offered:
2635
+ * set-up-here (supported framework, no SDK yet; writes framework + path for
2636
+ * the integrate-run phase) and continue-with-existing (already has PostHog;
2637
+ * sets integrate=false and skips straight to Self-driving). On a detection
2638
+ * error, falls back to a manual framework picker.
2638
2639
  *
2639
2640
  * Runs after auth — the detector needs credentials.
2640
2641
  */
@@ -2656,6 +2657,13 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2656
2657
  store.setFrameworkContext(SELF_DRIVING_INTEGRATE_PATH_KEY, p.path);
2657
2658
  store.setFrameworkConfig(p.integration, FRAMEWORK_REGISTRY[p.integration]);
2658
2659
  };
2660
+ const continueWithExisting = (p) => {
2661
+ store.setFrameworkContext(SELF_DRIVING_INTEGRATE_PATH_KEY, p.path);
2662
+ store.setIntegrate(false, {
2663
+ via: "existing-integration-detected",
2664
+ path: p.path
2665
+ });
2666
+ };
2659
2667
  useEffect(() => {
2660
2668
  if (!accessToken || started.current) return;
2661
2669
  started.current = true;
@@ -2748,8 +2756,25 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2748
2756
  });
2749
2757
  const { report } = state;
2750
2758
  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, {
2759
+ const existing = report.projects.filter((p) => p.continuable);
2760
+ const unsupported = report.projects.filter((p) => !p.instrumentable && !p.continuable);
2761
+ const NEW = "new:";
2762
+ const EXISTING = "existing:";
2763
+ const dispatch = (value) => {
2764
+ const v = Array.isArray(value) ? value[0] : value;
2765
+ if (v === CANCEL) {
2766
+ process.exit(0);
2767
+ return;
2768
+ }
2769
+ if (v.startsWith(EXISTING)) {
2770
+ const p = existing.find((x) => x.path === v.slice(9));
2771
+ if (p) continueWithExisting(p);
2772
+ return;
2773
+ }
2774
+ const p = instrumentable.find((x) => x.path === v.slice(4));
2775
+ if (p) choose(p);
2776
+ };
2777
+ if (instrumentable.length === 0 && existing.length === 0) return /* @__PURE__ */ jsxs(Box, {
2753
2778
  flexDirection: "column",
2754
2779
  children: [
2755
2780
  /* @__PURE__ */ jsxs(Box, {
@@ -2768,7 +2793,7 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2768
2793
  ]
2769
2794
  })]
2770
2795
  }),
2771
- /* @__PURE__ */ jsx(BlockedSummary, { blocked }),
2796
+ /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported }),
2772
2797
  /* @__PURE__ */ jsx(Box, {
2773
2798
  marginTop: 1,
2774
2799
  children: /* @__PURE__ */ jsx(PickerMenu, {
@@ -2781,14 +2806,73 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2781
2806
  })
2782
2807
  ]
2783
2808
  });
2809
+ if (instrumentable.length === 0) return /* @__PURE__ */ jsxs(Box, {
2810
+ flexDirection: "column",
2811
+ children: [
2812
+ /* @__PURE__ */ jsxs(Box, {
2813
+ flexDirection: "column",
2814
+ marginBottom: 1,
2815
+ children: [/* @__PURE__ */ jsxs(Text, {
2816
+ bold: true,
2817
+ color: Colors.accent,
2818
+ children: [Icons.check, " PostHog is already set up"]
2819
+ }), /* @__PURE__ */ jsx(Text, {
2820
+ dimColor: true,
2821
+ children: "Continue straight to Self-driving."
2822
+ })]
2823
+ }),
2824
+ /* @__PURE__ */ jsx(PickerMenu, {
2825
+ message: existing.length === 1 ? "Continue with your existing PostHog install?" : "Which project should Self-driving use?",
2826
+ options: [...existing.map((p) => ({
2827
+ label: projectLabel(p),
2828
+ value: `${EXISTING}${p.path}`
2829
+ })), {
2830
+ label: "Exit",
2831
+ value: CANCEL
2832
+ }],
2833
+ onSelect: dispatch
2834
+ }),
2835
+ /* @__PURE__ */ jsx(Box, {
2836
+ marginTop: 1,
2837
+ children: /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported })
2838
+ })
2839
+ ]
2840
+ });
2784
2841
  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
- }];
2842
+ const HEAD = "head:";
2843
+ const spacer = (id) => ({
2844
+ label: " ",
2845
+ value: `${HEAD}${id}`,
2846
+ disabled: true
2847
+ });
2848
+ const heading = (id, label) => ({
2849
+ label,
2850
+ value: `${HEAD}${id}`,
2851
+ disabled: true,
2852
+ header: true
2853
+ });
2854
+ const options = [
2855
+ heading("new", "New PostHog integration:"),
2856
+ ...instrumentable.map((p) => ({
2857
+ label: projectLabel(p),
2858
+ value: `${NEW}${p.path}`,
2859
+ indent: true
2860
+ })),
2861
+ ...existing.length > 0 ? [
2862
+ spacer("gap1"),
2863
+ heading("existing", "Existing integrations:"),
2864
+ ...existing.map((p) => ({
2865
+ label: projectLabel(p),
2866
+ value: `${EXISTING}${p.path}`,
2867
+ indent: true
2868
+ }))
2869
+ ] : [],
2870
+ spacer("gap2"),
2871
+ {
2872
+ label: "Cancel",
2873
+ value: CANCEL
2874
+ }
2875
+ ];
2792
2876
  return /* @__PURE__ */ jsxs(Box, {
2793
2877
  flexDirection: "column",
2794
2878
  children: [
@@ -2807,57 +2891,35 @@ const SelfDrivingIntegrationDetectScreen = ({ store }) => {
2807
2891
  })
2808
2892
  }),
2809
2893
  /* @__PURE__ */ jsx(PickerMenu, {
2810
- message: single ? "Set up PostHog here? Confirm to continue." : "Which project should we set up PostHog in?",
2894
+ message: single && existing.length === 0 ? "Set up PostHog here? Confirm to continue." : void 0,
2811
2895
  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
- }
2896
+ onSelect: dispatch
2821
2897
  }),
2822
2898
  /* @__PURE__ */ jsx(Box, {
2823
2899
  marginTop: 1,
2824
- children: /* @__PURE__ */ jsx(BlockedSummary, { blocked })
2900
+ children: /* @__PURE__ */ jsx(UnsupportedSummary, { unsupported })
2825
2901
  })
2826
2902
  ]
2827
2903
  });
2828
2904
  };
2829
2905
  /**
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.
2906
+ * Collapses unsupported-stack projects into a count line (already-has-PostHog
2907
+ * projects are real picker options, not summarised).
2832
2908
  */
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, {
2909
+ const UnsupportedSummary = ({ unsupported }) => {
2910
+ if (unsupported.length === 0) return null;
2911
+ return /* @__PURE__ */ jsx(Box, {
2838
2912
  flexDirection: "column",
2839
- children: [alreadyIntegrated > 0 && /* @__PURE__ */ jsxs(Text, {
2913
+ children: /* @__PURE__ */ jsxs(Text, {
2840
2914
  dimColor: true,
2841
2915
  children: [
2842
2916
  "(… ",
2843
- alreadyIntegrated,
2917
+ unsupported.length,
2844
2918
  " 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",
2919
+ unsupported.length === 1 ? "" : "s",
2858
2920
  " not supported yet)"
2859
2921
  ]
2860
- })]
2922
+ })
2861
2923
  });
2862
2924
  };
2863
2925
  //#endregion
@@ -2891,14 +2953,14 @@ const SelfDrivingHandoffScreen = ({ store }) => {
2891
2953
  marginTop: 1,
2892
2954
  children: /* @__PURE__ */ jsx(Text, {
2893
2955
  dimColor: true,
2894
- children: "PostHog is now integrated in your project. Now, let's connect to GitHub, turns on signal sources, and runs scouts that watch your product data and surface what needs attention."
2956
+ children: "Next, the agent connects GitHub, turns on signal sources, and tunes the scouts that watch your product data."
2895
2957
  })
2896
2958
  }),
2897
2959
  /* @__PURE__ */ jsx(Box, {
2898
2960
  marginTop: 1,
2899
2961
  children: /* @__PURE__ */ jsx(Text, {
2900
2962
  dimColor: true,
2901
- children: "This should take about 20 minutes and will occasionally need your input."
2963
+ children: "About 10 more minutes, and it needs your input a few times. Keep this terminal open."
2902
2964
  })
2903
2965
  })
2904
2966
  ]
@@ -4953,7 +5015,7 @@ function createMcpSuggestedPromptsServices(store) {
4953
5015
  };
4954
5016
  }
4955
5017
  async function* runProductionPromptStreaming(args) {
4956
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-BpNkFksF.js");
5018
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-l1zsmQQc.js");
4957
5019
  yield* runMcpPromptViaSdk(args);
4958
5020
  }
4959
5021
  //#endregion
@@ -5125,4 +5187,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5125
5187
  //#endregion
5126
5188
  export { startTUI };
5127
5189
 
5128
- //# sourceMappingURL=start-tui-CylEL6i_.js.map
5190
+ //# sourceMappingURL=start-tui-H_BSAFdp.js.map