@posthog/wizard 2.69.0 → 2.70.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 (99) hide show
  1. package/dist/{add-mcp-server-to-clients-Cl2HBuxp.js → add-mcp-server-to-clients-D2z2adQL.js} +4 -4
  2. package/dist/{add-mcp-server-to-clients-Cl2HBuxp.js.map → add-mcp-server-to-clients-D2z2adQL.js.map} +1 -1
  3. package/dist/{agent-interface-CI89BrWE.js → agent-interface-NZHof8u3.js} +8 -8
  4. package/dist/{agent-interface-CI89BrWE.js.map → agent-interface-NZHof8u3.js.map} +1 -1
  5. package/dist/{agent-prompt-loader-Dc1g5Oub.js → agent-prompt-loader-CQijHoX1.js} +5 -5
  6. package/dist/{agent-prompt-loader-Dc1g5Oub.js.map → agent-prompt-loader-CQijHoX1.js.map} +1 -1
  7. package/dist/{agent-runner-D5dhuE4z.js → agent-runner-CK9z7-0z.js} +14 -14
  8. package/dist/{agent-runner-D5dhuE4z.js.map → agent-runner-CK9z7-0z.js.map} +1 -1
  9. package/dist/analytics-CbkGZjMp.js +2 -0
  10. package/dist/{analytics-D90QbLf5.js → analytics-DXPSL5IY.js} +13 -3
  11. package/dist/analytics-DXPSL5IY.js.map +1 -0
  12. package/dist/{api-BHhrT6wb.js → api-CeapT_rn.js} +3 -3
  13. package/dist/{api-BHhrT6wb.js.map → api-CeapT_rn.js.map} +1 -1
  14. package/dist/bin.js +50 -50
  15. package/dist/bin.js.map +1 -1
  16. package/dist/{bounded-fs-BhlVkP1r.js → bounded-fs-DdHuSE1X.js} +3 -3
  17. package/dist/{bounded-fs-BhlVkP1r.js.map → bounded-fs-DdHuSE1X.js.map} +1 -1
  18. package/dist/{ci-install-94wC3a4K.js → ci-install-c-n8dJng.js} +4 -4
  19. package/dist/{ci-install-94wC3a4K.js.map → ci-install-c-n8dJng.js.map} +1 -1
  20. package/dist/{debug-DtixqVEY.js → debug-D2KQFr3-.js} +1 -1
  21. package/dist/{debug-CifTS9lQ.js → debug-D5YT7Lil.js} +3 -3
  22. package/dist/{debug-CifTS9lQ.js.map → debug-D5YT7Lil.js.map} +1 -1
  23. package/dist/{env-api-key-CwhtZrik.js → env-api-key-ClK4nxHy.js} +2 -2
  24. package/dist/{env-api-key-CwhtZrik.js.map → env-api-key-ClK4nxHy.js.map} +1 -1
  25. package/dist/{environment-DhacWZf7.js → environment-DbDconLv.js} +4 -4
  26. package/dist/{environment-DhacWZf7.js.map → environment-DbDconLv.js.map} +1 -1
  27. package/dist/{file-watcher-L28OpUV2.js → file-watcher-CQj0wp1a.js} +2 -2
  28. package/dist/{file-watcher-L28OpUV2.js.map → file-watcher-CQj0wp1a.js.map} +1 -1
  29. package/dist/{headless-ui-DNcOVJxU.js → headless-ui-BKU7MJQf.js} +2 -2
  30. package/dist/{headless-ui-DNcOVJxU.js.map → headless-ui-BKU7MJQf.js.map} +1 -1
  31. package/dist/{interactive-DlNrV77o.js → interactive-Bfvo61oS.js} +2 -2
  32. package/dist/{interactive-DlNrV77o.js.map → interactive-Bfvo61oS.js.map} +1 -1
  33. package/dist/{mcp-CJEem9qs.js → mcp-C_pqYZQY.js} +2 -2
  34. package/dist/{mcp-CJEem9qs.js.map → mcp-C_pqYZQY.js.map} +1 -1
  35. package/dist/{mcp-prompt-streaming-DER7MG3q.js → mcp-prompt-streaming-DOHJxT8K.js} +4 -4
  36. package/dist/{mcp-prompt-streaming-DER7MG3q.js.map → mcp-prompt-streaming-DOHJxT8K.js.map} +1 -1
  37. package/dist/{non-interactive-CbvniKHm.js → non-interactive-CkBbj2As.js} +2 -2
  38. package/dist/{non-interactive-CbvniKHm.js.map → non-interactive-CkBbj2As.js.map} +1 -1
  39. package/dist/{orchestrator-tools-Czf3Wo_y.js → orchestrator-tools-DaVjzCRn.js} +3 -3
  40. package/dist/{orchestrator-tools-Czf3Wo_y.js.map → orchestrator-tools-DaVjzCRn.js.map} +1 -1
  41. package/dist/{package-json-GEU2VZlS.js → package-json-xt3eeyBI.js} +1 -1
  42. package/dist/{package-json-GEU2VZlS.js.map → package-json-xt3eeyBI.js.map} +1 -1
  43. package/dist/{package-manager-CNNlFA2q.js → package-manager-BD3WR7Ta.js} +2 -2
  44. package/dist/{package-manager-CNNlFA2q.js.map → package-manager-BD3WR7Ta.js.map} +1 -1
  45. package/dist/{pi-kpN-bO9z.js → pi-uDtK02b4.js} +11 -11
  46. package/dist/{pi-kpN-bO9z.js.map → pi-uDtK02b4.js.map} +1 -1
  47. package/dist/{playground-ZYaQmfBa.js → playground-ELiBuGN0.js} +7 -7
  48. package/dist/{playground-ZYaQmfBa.js.map → playground-ELiBuGN0.js.map} +1 -1
  49. package/dist/{posthog-D1zHPgYJ.js → posthog-DISFn-54.js} +2 -2
  50. package/dist/{posthog-D1zHPgYJ.js.map → posthog-DISFn-54.js.map} +1 -1
  51. package/dist/{posthog-integration-DdeIUkYw.js → posthog-integration-BGk6dYzS.js} +92 -28
  52. package/dist/posthog-integration-BGk6dYzS.js.map +1 -0
  53. package/dist/{provisioning-e3roaLgp.js → provisioning-DoKcXygK.js} +3 -3
  54. package/dist/{provisioning-e3roaLgp.js.map → provisioning-DoKcXygK.js.map} +1 -1
  55. package/dist/{queue-tools-zrqCiy6q.js → queue-tools-B75RxrcC.js} +3 -3
  56. package/dist/{queue-tools-zrqCiy6q.js.map → queue-tools-B75RxrcC.js.map} +1 -1
  57. package/dist/{registry-C1t8v5tE.js → registry-DbwlUbvA.js} +6 -6
  58. package/dist/{registry-C1t8v5tE.js.map → registry-DbwlUbvA.js.map} +1 -1
  59. package/dist/{security-CIfhIscL.js → security-lqzh7NaZ.js} +5 -5
  60. package/dist/{security-CIfhIscL.js.map → security-lqzh7NaZ.js.map} +1 -1
  61. package/dist/{setup-utils-B_06xag2.js → setup-utils-DeIoqwPw.js} +9 -9
  62. package/dist/{setup-utils-B_06xag2.js.map → setup-utils-DeIoqwPw.js.map} +1 -1
  63. package/dist/{start-tui-BafJXVNT.js → start-tui-ebV_ynrs.js} +258 -133
  64. package/dist/start-tui-ebV_ynrs.js.map +1 -0
  65. package/dist/{steps-DR-Yo_IT.js → steps-BB2izees.js} +7 -7
  66. package/dist/{steps-DR-Yo_IT.js.map → steps-BB2izees.js.map} +1 -1
  67. package/dist/{store-DSUCWMRO.js → store-BbDrhStP.js} +40 -6
  68. package/dist/store-BbDrhStP.js.map +1 -0
  69. package/dist/{subagent-DjZM3G7y.js → subagent-oTBoYK3h.js} +2 -2
  70. package/dist/{subagent-DjZM3G7y.js.map → subagent-oTBoYK3h.js.map} +1 -1
  71. package/dist/{task-Czzz3tzt.js → task-BPsA2HrW.js} +12 -12
  72. package/dist/{task-Czzz3tzt.js.map → task-BPsA2HrW.js.map} +1 -1
  73. package/dist/{task-stream-uxG6wJfj.js → task-stream-DffFXskR.js} +5 -5
  74. package/dist/{task-stream-uxG6wJfj.js.map → task-stream-DffFXskR.js.map} +1 -1
  75. package/dist/{tasks-CVmG8qFw.js → tasks-CmyTWgU7.js} +2 -2
  76. package/dist/{tasks-CVmG8qFw.js.map → tasks-CmyTWgU7.js.map} +1 -1
  77. package/dist/{telemetry-B1VEXHpL.js → telemetry-DfZNqwpb.js} +3 -3
  78. package/dist/{telemetry-B1VEXHpL.js.map → telemetry-DfZNqwpb.js.map} +1 -1
  79. package/dist/{terminal-Czuo0x8i.js → terminal-DTJLXrQX.js} +12 -12
  80. package/dist/{terminal-Czuo0x8i.js.map → terminal-DTJLXrQX.js.map} +1 -1
  81. package/dist/{tools-DOZg9n3A.js → tools-B4s78y8L.js} +6 -6
  82. package/dist/{tools-DOZg9n3A.js.map → tools-B4s78y8L.js.map} +1 -1
  83. package/dist/{wizard-abort-BZOeapsf.js → wizard-abort-CE6vlOGM.js} +1 -1
  84. package/dist/{wizard-abort-CFMdj6sZ.js → wizard-abort-XQFt0vkZ.js} +4 -4
  85. package/dist/{wizard-abort-CFMdj6sZ.js.map → wizard-abort-XQFt0vkZ.js.map} +1 -1
  86. package/dist/{wizard-session-C_7r3-rO.js → wizard-session-Bki7dQhv.js} +12 -2
  87. package/dist/wizard-session-Bki7dQhv.js.map +1 -0
  88. package/dist/{wizard-session-D1KQqUml.js → wizard-session-gbYCXdBf.js} +1 -1
  89. package/dist/yara-hooks-COTd_ALD.js +2 -0
  90. package/dist/{yara-hooks-CmQT-oBy.js → yara-hooks-gZxdqlkx.js} +4 -4
  91. package/dist/{yara-hooks-CmQT-oBy.js.map → yara-hooks-gZxdqlkx.js.map} +1 -1
  92. package/package.json +1 -1
  93. package/dist/analytics-D90QbLf5.js.map +0 -1
  94. package/dist/analytics-Dmf_Jm3K.js +0 -2
  95. package/dist/posthog-integration-DdeIUkYw.js.map +0 -1
  96. package/dist/start-tui-BafJXVNT.js.map +0 -1
  97. package/dist/store-DSUCWMRO.js.map +0 -1
  98. package/dist/wizard-session-C_7r3-rO.js.map +0 -1
  99. package/dist/yara-hooks-BhNAWw7W.js +0 -2
@@ -1,22 +1,22 @@
1
1
  import { l as ErrorCodes } from "./errors-BSdz2lsl.js";
2
- import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-CifTS9lQ.js";
3
- import { n as analytics } from "./analytics-D90QbLf5.js";
4
- import { i as readProjectFile, t as IGNORED_DIRS } from "./bounded-fs-BhlVkP1r.js";
5
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-B_06xag2.js";
6
- import { t as ApiError } from "./api-BHhrT6wb.js";
7
- import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-C_7r3-rO.js";
8
- import { i as wizardAbort } from "./wizard-abort-CFMdj6sZ.js";
9
- import { a as formatCostUsd, o as formatTokenCount } from "./agent-runner-D5dhuE4z.js";
10
- import { O as downloadSkill, k as fetchSkillMenu } from "./agent-interface-CI89BrWE.js";
11
- import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./yara-hooks-CmQT-oBy.js";
12
- import { t as FRAMEWORK_REGISTRY } from "./registry-C1t8v5tE.js";
13
- import { b as getDetectedWarehouseSources, h as Icons, m as Colors, t as SETUP_REPORT_FILE, w as detectProjectsWithAgent } from "./posthog-integration-DdeIUkYw.js";
2
+ import { $ as REMOTE_SKILLS_BASE_URL, K as POSTHOG_ORG_AI_SETTINGS_URL, L as Integration, R as OAUTH_PORTS, U as POSTHOG_DOCS_URL, Z as POSTHOG_TERMS_URL, d as relativeToInstallDir, g as SIGNUP_WIZARD_READINESS_CONFIG, l as WIZARD_LOG_FILE, p as setUI, q as POSTHOG_PRIVACY_URL, s as logToFile, v as getBlockingServiceKeys, z as OAUTH_TIMEOUT_MS } from "./debug-D5YT7Lil.js";
3
+ import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-Bki7dQhv.js";
4
+ import { n as analytics } from "./analytics-DXPSL5IY.js";
5
+ import { i as readProjectFile, t as IGNORED_DIRS } from "./bounded-fs-DdHuSE1X.js";
6
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-DeIoqwPw.js";
7
+ import { t as ApiError } from "./api-CeapT_rn.js";
8
+ import { i as wizardAbort } from "./wizard-abort-XQFt0vkZ.js";
9
+ import { a as formatCostUsd, o as formatTokenCount } from "./agent-runner-CK9z7-0z.js";
10
+ import { O as downloadSkill, k as fetchSkillMenu } from "./agent-interface-NZHof8u3.js";
11
+ import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./yara-hooks-gZxdqlkx.js";
12
+ import { t as FRAMEWORK_REGISTRY } from "./registry-DbwlUbvA.js";
13
+ import { T as detectProjectsWithAgent, h as Icons, m as Colors, t as SETUP_REPORT_FILE, x as getDetectedWarehouseSources } from "./posthog-integration-BGk6dYzS.js";
14
14
  import { A as STRIPE_SDKS, C as MANUAL_SDK_VARIANTS, D as fetchHealthIssues, O as getContentBlocks, S as MANUAL_SDK_INSTALL, T as SOURCE_MAPS_CONTEXT_KEYS, _ as detectSelfDrivingIntegrationProjects, a as useStdoutDimensions, b as DISPLAY_NAME, f as Program, g as PRICING_SHORT, h as PRICING_LONG, k as POSTHOG_SDKS, m as NO_DEFAULT_LIMIT, n as useKeyBindings, p as getProgramConfig, t as PickerMenu, v as SELF_DRIVING_INTEGRATE_PATH_KEY, y as AUTOMATABLE_VARIANTS } from "./bin.js";
15
- import { r as totalTokenCount, t as WizardStore } from "./store-DSUCWMRO.js";
16
- import { A as EventPlanViewer, C as VisualizerTab, D as HNViewer, F as ConfirmationInput, L as ProgressList, M as LinkText, N as extractUrls, O as TabContainer, P as ModalOverlay, R as LoadingBox, S as ServiceHealthList, T as LearnCard, a as useSkillEntry, b as SEVERITY_LABEL, c as SlackConnectScreen, d as AuditChecksViewer, f as seedDemoEvents, g as probeProjectData, i as SkillSourceInfo, j as LogViewer, k as ScreenContainer, l as AUDIT_AREA_SLIDES, m as McpSuggestedPromptsScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as McpScreen, w as TipsCard, x as SEVERITY_ORDER, y as IssueTable, z as SplitView } from "./terminal-Czuo0x8i.js";
15
+ import { r as totalTokenCount, t as WizardStore } from "./store-BbDrhStP.js";
16
+ import { A as EventPlanViewer, C as VisualizerTab, D as HNViewer, F as ConfirmationInput, L as ProgressList, M as LinkText, N as extractUrls, O as TabContainer, P as ModalOverlay, R as LoadingBox, S as ServiceHealthList, T as LearnCard, a as useSkillEntry, b as SEVERITY_LABEL, c as SlackConnectScreen, d as AuditChecksViewer, f as seedDemoEvents, g as probeProjectData, i as SkillSourceInfo, j as LogViewer, k as ScreenContainer, l as AUDIT_AREA_SLIDES, m as McpSuggestedPromptsScreen, n as releaseTerminal, o as OutroScreen, r as AiOptInRequiredScreen, s as useDismissOnAnyKey, t as enterDarkTerminal, u as VisualBox, v as McpScreen, w as TipsCard, x as SEVERITY_ORDER, y as IssueTable, z as SplitView } from "./terminal-DTJLXrQX.js";
17
17
  import { c as namesWithStatus, d as toClientResult, l as redactSecrets, t as ALL_FEATURE_VALUES } from "./defaults-DI642M3n.js";
18
- import { t as startFileWatcher } from "./file-watcher-L28OpUV2.js";
19
- 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-Cl2HBuxp.js";
18
+ import { t as startFileWatcher } from "./file-watcher-CQj0wp1a.js";
19
+ 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-D2z2adQL.js";
20
20
  import { existsSync, readFileSync, readdirSync } from "fs";
21
21
  import path, { join } from "path";
22
22
  import { join as join$1 } from "node:path";
@@ -928,6 +928,70 @@ const ManualAuthCodeScreen = ({ store }) => {
928
928
  });
929
929
  };
930
930
  //#endregion
931
+ //#region src/ui/tui/components/PrivacyPanel.tsx
932
+ /**
933
+ * PrivacyPanel — Shared disclosure component.
934
+ *
935
+ * Single source of truth for the wizard's privacy disclosure, rendered
936
+ * identically from the intro screen (the `PRIVACY_PANEL_LABEL` menu option)
937
+ * and as an overlay from the auth screen ([I] keystroke).
938
+ *
939
+ * Must fit in a default-sized macOS Terminal (~24 rows). Two condensed
940
+ * paragraphs carry the top-level disclosure; the link footer follows.
941
+ * Users who want the full legal text follow the Terms / Privacy URLs to
942
+ * their browser.
943
+ *
944
+ * The scan paragraph is opt-in per caller. It ends by pointing at a control,
945
+ * so it may only render on a screen that puts one below the panel — three of
946
+ * the four callers show `Back` and nothing else, and would be promising a
947
+ * choice that is not there.
948
+ */
949
+ /**
950
+ * The panel's name everywhere it is referenced: intro menu, screen titles, and
951
+ * the auth screen's [I] hint. One constant so the five spellings this replaced
952
+ * cannot come back.
953
+ */
954
+ const PRIVACY_PANEL_LABEL = "Privacy & data";
955
+ const PrivacyPanel = ({ canOptOut = false } = {}) => {
956
+ useEffect(() => {
957
+ analytics.wizardCapture("privacy panel shown");
958
+ }, []);
959
+ return /* @__PURE__ */ jsxs(Box, {
960
+ flexDirection: "column",
961
+ width: 64,
962
+ flexShrink: 0,
963
+ children: [
964
+ /* @__PURE__ */ jsx(Text, { children: "We use Anthropic and OpenAI models via the PostHog LLM gateway to read your source files as AI context. .env* file contents, secrets, and anything matched by the security scanner stay on your machine." }),
965
+ /* @__PURE__ */ jsx(Box, {
966
+ marginTop: 1,
967
+ children: /* @__PURE__ */ jsx(Text, { children: "To use the wizard, AI features must be enabled in your organization's settings." })
968
+ }),
969
+ /* @__PURE__ */ jsxs(Box, {
970
+ marginTop: 1,
971
+ flexDirection: "column",
972
+ children: [
973
+ /* @__PURE__ */ jsxs(Text, { children: ["Terms: ", /* @__PURE__ */ jsx(Text, {
974
+ color: "cyan",
975
+ children: POSTHOG_TERMS_URL
976
+ })] }),
977
+ /* @__PURE__ */ jsxs(Text, { children: ["Privacy: ", /* @__PURE__ */ jsx(Text, {
978
+ color: "cyan",
979
+ children: POSTHOG_PRIVACY_URL
980
+ })] }),
981
+ /* @__PURE__ */ jsxs(Text, { children: ["AI settings: ", /* @__PURE__ */ jsx(Text, {
982
+ color: "cyan",
983
+ children: POSTHOG_ORG_AI_SETTINGS_URL
984
+ })] })
985
+ ]
986
+ }),
987
+ canOptOut && /* @__PURE__ */ jsx(Box, {
988
+ marginTop: 1,
989
+ children: /* @__PURE__ */ jsx(Text, { children: "We also read dependency files and .env variable names to discover tools we can connect to and integrate with. We share that list with PostHog to suggest features. You can opt out of sharing below." })
990
+ })
991
+ ]
992
+ });
993
+ };
994
+ //#endregion
931
995
  //#region src/ui/tui/screens/IntroScreenLayout.tsx
932
996
  /**
933
997
  * IntroScreenLayout ��� Shared visual shell for all program intro screens.
@@ -967,14 +1031,57 @@ const DEFAULT_SUBTITLE = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PUR
967
1031
  dimColor: true,
968
1032
  children: ".env* file contents will not leave your machine."
969
1033
  })] });
970
- const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubtitle = true, subtitle, body, showDetection = true, detectionRows, children, menuOptions, menuAlign = "center", onSelect, programLabel, skillId, errorView }) => {
971
- const resolvedMenuOptions = menuOptions === void 0 ? [{
972
- label: "Continue",
973
- value: "continue"
974
- }, {
975
- label: "Cancel",
976
- value: "cancel"
977
- }] : menuOptions;
1034
+ /** Default menu when a screen passes none. */
1035
+ const DEFAULT_MENU = [{
1036
+ label: "Continue",
1037
+ value: "continue"
1038
+ }, {
1039
+ label: "Cancel",
1040
+ value: "cancel"
1041
+ }];
1042
+ /**
1043
+ * The menu for the current view. The disclosure row is appended here rather
1044
+ * than left to each screen: ten intro screens would otherwise carry the same
1045
+ * row, view and back handler, which is how this panel came to answer to five
1046
+ * different names and to sit two levels deep on the one screen that had it.
1047
+ *
1048
+ * Pure and exported so the guarantee is testable without a renderer.
1049
+ */
1050
+ function buildIntroMenu({ menuOptions, showPrivacy = true, showingPrivacy = false, privacyOptions }) {
1051
+ if (showingPrivacy) {
1052
+ const back = {
1053
+ label: "Back",
1054
+ value: "privacy-back",
1055
+ ...privacyOptions?.some((o) => o.icon) ? { icon: { glyph: " " } } : {}
1056
+ };
1057
+ return [...privacyOptions ?? [], back];
1058
+ }
1059
+ const base = menuOptions === void 0 ? DEFAULT_MENU : menuOptions;
1060
+ if (base === null || !showPrivacy) return base;
1061
+ const row = {
1062
+ label: PRIVACY_PANEL_LABEL,
1063
+ value: "privacy"
1064
+ };
1065
+ const insertAt = base.at(-1)?.value === "cancel" ? base.length - 1 : base.length;
1066
+ return [
1067
+ ...base.slice(0, insertAt),
1068
+ row,
1069
+ ...base.slice(insertAt)
1070
+ ];
1071
+ }
1072
+ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubtitle = true, subtitle, body, showDetection = true, detectionRows, children, menuOptions, menuAlign = "center", showPrivacy = true, privacyOptions, onSelect, programLabel, skillId, errorView }) => {
1073
+ const [showingPrivacy, setShowingPrivacy] = useState(false);
1074
+ const resolvedMenuOptions = buildIntroMenu({
1075
+ menuOptions,
1076
+ showPrivacy,
1077
+ showingPrivacy,
1078
+ privacyOptions
1079
+ });
1080
+ const handleSelect = (value) => {
1081
+ if (value === "privacy") return setShowingPrivacy(true);
1082
+ if (value === "privacy-back") return setShowingPrivacy(false);
1083
+ onSelect?.(value);
1084
+ };
978
1085
  if (errorView) return /* @__PURE__ */ jsxs(Box, {
979
1086
  flexDirection: "column",
980
1087
  flexGrow: 1,
@@ -997,14 +1104,19 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
997
1104
  flexDirection: "column",
998
1105
  alignItems: "center",
999
1106
  children: [
1000
- /* @__PURE__ */ jsx(WizardTitle, { title }),
1001
- showSubtitle && /* @__PURE__ */ jsx(Box, {
1107
+ /* @__PURE__ */ jsx(WizardTitle, { title: showingPrivacy ? PRIVACY_PANEL_LABEL : title }),
1108
+ showSubtitle && !showingPrivacy && /* @__PURE__ */ jsx(Box, {
1002
1109
  flexDirection: "column",
1003
1110
  alignItems: "center",
1004
1111
  marginTop: 1,
1005
1112
  children: subtitle ?? DEFAULT_SUBTITLE
1006
1113
  }),
1007
- body && /* @__PURE__ */ jsx(Box, {
1114
+ showingPrivacy ? /* @__PURE__ */ jsx(Box, {
1115
+ flexDirection: "column",
1116
+ alignItems: "center",
1117
+ marginTop: 1,
1118
+ children: /* @__PURE__ */ jsx(PrivacyPanel, { canOptOut: privacyOptions !== void 0 })
1119
+ }) : body && /* @__PURE__ */ jsx(Box, {
1008
1120
  flexDirection: "column",
1009
1121
  alignItems: "center",
1010
1122
  marginTop: 1,
@@ -1012,8 +1124,8 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
1012
1124
  })
1013
1125
  ]
1014
1126
  }),
1015
- children,
1016
- showDetection && /* @__PURE__ */ jsxs(Box, {
1127
+ !showingPrivacy && children,
1128
+ showDetection && !showingPrivacy && /* @__PURE__ */ jsxs(Box, {
1017
1129
  flexDirection: "column",
1018
1130
  marginTop: 1,
1019
1131
  children: [
@@ -1064,7 +1176,7 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
1064
1176
  children: /* @__PURE__ */ jsx(PickerMenu, {
1065
1177
  options: resolvedMenuOptions,
1066
1178
  onSelect: (value) => {
1067
- onSelect(Array.isArray(value) ? value[0] : value);
1179
+ handleSelect(Array.isArray(value) ? value[0] : value);
1068
1180
  }
1069
1181
  }, resolvedMenuOptions.map((o) => o.value).join(","))
1070
1182
  })
@@ -1073,55 +1185,6 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
1073
1185
  }) });
1074
1186
  };
1075
1187
  //#endregion
1076
- //#region src/ui/tui/components/PrivacyPanel.tsx
1077
- /**
1078
- * PrivacyPanel — Shared disclosure component.
1079
- *
1080
- * Single source of truth for the wizard's privacy disclosure, rendered
1081
- * identically from the intro screen ("Privacy & data usage" menu option)
1082
- * and as an overlay from the auth screen ([I] keystroke).
1083
- *
1084
- * Must fit in a default-sized macOS Terminal (~24 rows). Two condensed
1085
- * paragraphs carry the top-level disclosure; the link footer follows.
1086
- * Users who want the full legal text follow the Terms / Privacy URLs to
1087
- * their browser.
1088
- */
1089
- const PrivacyPanel = () => {
1090
- useEffect(() => {
1091
- analytics.wizardCapture("privacy panel shown");
1092
- }, []);
1093
- return /* @__PURE__ */ jsxs(Box, {
1094
- flexDirection: "column",
1095
- width: 64,
1096
- flexShrink: 0,
1097
- children: [
1098
- /* @__PURE__ */ jsx(Text, { children: "We use Anthropic's Claude via the PostHog LLM gateway to read your source files as AI context. .env* files, secrets, and anything matched by the security scanner stay on your machine." }),
1099
- /* @__PURE__ */ jsx(Box, {
1100
- marginTop: 1,
1101
- children: /* @__PURE__ */ jsx(Text, { children: "To use the wizard, AI features must be enabled in your organization's settings." })
1102
- }),
1103
- /* @__PURE__ */ jsxs(Box, {
1104
- marginTop: 1,
1105
- flexDirection: "column",
1106
- children: [
1107
- /* @__PURE__ */ jsxs(Text, { children: ["Terms: ", /* @__PURE__ */ jsx(Text, {
1108
- color: "cyan",
1109
- children: POSTHOG_TERMS_URL
1110
- })] }),
1111
- /* @__PURE__ */ jsxs(Text, { children: ["Privacy: ", /* @__PURE__ */ jsx(Text, {
1112
- color: "cyan",
1113
- children: POSTHOG_PRIVACY_URL
1114
- })] }),
1115
- /* @__PURE__ */ jsxs(Text, { children: ["AI settings: ", /* @__PURE__ */ jsx(Text, {
1116
- color: "cyan",
1117
- children: POSTHOG_ORG_AI_SETTINGS_URL
1118
- })] })
1119
- ]
1120
- })
1121
- ]
1122
- });
1123
- };
1124
- //#endregion
1125
1188
  //#region src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx
1126
1189
  /**
1127
1190
  * PostHogIntegrationIntroScreen — Intro screen for the core PostHog integration.
@@ -1132,6 +1195,87 @@ const PrivacyPanel = () => {
1132
1195
  * 3. Unsupported version: upgrade prompt
1133
1196
  * 4. Detection succeeded: continue/change-framework/cancel
1134
1197
  */
1198
+ /**
1199
+ * Replaces IntroScreenLayout's DEFAULT_SUBTITLE for this screen only. The
1200
+ * shared default (".env* file contents will not leave your machine") is true
1201
+ * of values and false of variable names, which this screen reads and reports.
1202
+ * Two lines carry the fact and name the screen that holds the detail, so the
1203
+ * disclosure reaches people who never open it.
1204
+ */
1205
+ const SUBTITLE = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1206
+ /* @__PURE__ */ jsx(Text, {
1207
+ dimColor: true,
1208
+ children: "We'll use AI to analyze your project and complete work."
1209
+ }),
1210
+ /* @__PURE__ */ jsxs(Text, {
1211
+ dimColor: true,
1212
+ children: [
1213
+ "Review what data is shared in \"",
1214
+ PRIVACY_PANEL_LABEL,
1215
+ ".\""
1216
+ ]
1217
+ }),
1218
+ /* @__PURE__ */ jsx(Text, {
1219
+ dimColor: true,
1220
+ children: ".env* values stay on your machine."
1221
+ })
1222
+ ] });
1223
+ /**
1224
+ * Exported so a test can measure every label against the menu's column.
1225
+ * `Privacy & data` is not here: IntroScreenLayout appends it to every intro
1226
+ * menu, so no screen carries its own copy.
1227
+ */
1228
+ const CONTINUE_MENU_OPTIONS = [
1229
+ {
1230
+ label: "Continue",
1231
+ value: "continue"
1232
+ },
1233
+ {
1234
+ label: "Change framework",
1235
+ value: "framework"
1236
+ },
1237
+ {
1238
+ label: "More info",
1239
+ value: "more-info"
1240
+ },
1241
+ {
1242
+ label: "Cancel",
1243
+ value: "cancel"
1244
+ }
1245
+ ];
1246
+ /**
1247
+ * A blank, unselectable row. Navigation skips disabled options, so this is a
1248
+ * margin the menu can hold rather than one the layout has to special-case.
1249
+ */
1250
+ const MENU_SPACER = {
1251
+ label: "",
1252
+ value: "spacer",
1253
+ disabled: true
1254
+ };
1255
+ /**
1256
+ * The sharing choice, as two explicit rows rather than one toggle. A toggle
1257
+ * label has to describe either the current state or the next action, and a
1258
+ * reader cannot tell which; two rows with the filled diamond on the live one
1259
+ * say both at once. The trailing spacer separates them from the Back that
1260
+ * IntroScreenLayout appends, since leaving the screen is a different kind of
1261
+ * act from changing something on it.
1262
+ */
1263
+ function sharingOptions(sharing) {
1264
+ const mark = (on) => ({ glyph: on ? Icons.diamond : Icons.diamondOpen });
1265
+ return [
1266
+ {
1267
+ label: "Share tools",
1268
+ value: "share",
1269
+ icon: mark(sharing)
1270
+ },
1271
+ {
1272
+ label: "Don't share tools",
1273
+ value: "no-share",
1274
+ icon: mark(!sharing)
1275
+ },
1276
+ MENU_SPACER
1277
+ ];
1278
+ }
1135
1279
  /** Framework picker shown when auto-detection fails. */
1136
1280
  const FrameworkPicker = ({ store, onComplete }) => {
1137
1281
  return /* @__PURE__ */ jsx(PickerMenu, {
@@ -1144,7 +1288,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1144
1288
  })),
1145
1289
  onSelect: (value) => {
1146
1290
  const integration = Array.isArray(value) ? value[0] : value;
1147
- import("./registry-C1t8v5tE.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1291
+ import("./registry-DbwlUbvA.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1148
1292
  const config = FRAMEWORK_REGISTRY[integration];
1149
1293
  store.setFrameworkConfig(integration, config);
1150
1294
  store.setDetectedFramework(config.metadata.name);
@@ -1159,6 +1303,7 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
1159
1303
  const [manuallySelected, setManuallySelected] = useState(false);
1160
1304
  const [view, setView] = useState("default");
1161
1305
  const { session } = store;
1306
+ const sharing = session.scanConsent !== "declined";
1162
1307
  const config = session.frameworkConfig;
1163
1308
  const frameworkLabel = session.detectedFrameworkLabel ?? config?.metadata.name;
1164
1309
  const { skillEntry, fetchFailed } = useSkillEntry(session.skillId);
@@ -1166,7 +1311,7 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
1166
1311
  const needsFrameworkPick = session.detectionComplete && !session.frameworkConfig;
1167
1312
  const unsupported = session.unsupportedVersion;
1168
1313
  const showContinue = session.frameworkConfig !== null && !detecting && !pickingFramework && view === "default" && !unsupported;
1169
- const title = view === "privacy" ? "Wizard privacy & usage" : detecting ? "PostHog Wizard starting up" : "PostHog Wizard 🦔";
1314
+ const title = detecting ? "PostHog Wizard starting up" : "PostHog Wizard 🦔";
1170
1315
  let body = null;
1171
1316
  if (detecting) body = /* @__PURE__ */ jsx(Box, {
1172
1317
  marginY: 1,
@@ -1235,8 +1380,7 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
1235
1380
  })
1236
1381
  ]
1237
1382
  });
1238
- else if (view === "privacy") body = /* @__PURE__ */ jsx(PrivacyPanel, {});
1239
- else if (showContinue) body = /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: "Let's do two hours of work in eight minutes." }) }) });
1383
+ else if (showContinue) body = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { children: "Let's do two hours of work in eight minutes." }) });
1240
1384
  const detectionRows = [];
1241
1385
  if (frameworkLabel) {
1242
1386
  const suffixParts = [];
@@ -1299,32 +1443,8 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
1299
1443
  if (view === "more-info") menuOptions = [{
1300
1444
  label: "Back",
1301
1445
  value: "back"
1302
- }, {
1303
- label: "Privacy & data usage",
1304
- value: "privacy"
1305
- }];
1306
- else if (view === "privacy") menuOptions = [{
1307
- label: "Back",
1308
- value: "back"
1309
1446
  }];
1310
- else if (showContinue) menuOptions = [
1311
- {
1312
- label: "Continue",
1313
- value: "continue"
1314
- },
1315
- {
1316
- label: "Change framework",
1317
- value: "framework"
1318
- },
1319
- {
1320
- label: "More info",
1321
- value: "more-info"
1322
- },
1323
- {
1324
- label: "Cancel",
1325
- value: "cancel"
1326
- }
1327
- ];
1447
+ else if (showContinue) menuOptions = CONTINUE_MENU_OPTIONS;
1328
1448
  const handleSelect = (value) => {
1329
1449
  analytics.wizardCapture("intro menu selected", {
1330
1450
  value,
@@ -1335,19 +1455,25 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
1335
1455
  setPickingFramework(true);
1336
1456
  setManuallySelected(true);
1337
1457
  } else if (value === "more-info") setView("more-info");
1338
- else if (value === "privacy") setView("privacy");
1339
- else if (value === "back") setView(view === "privacy" ? "more-info" : "default");
1340
- else store.completeSetup();
1458
+ else if (value === "back") setView("default");
1459
+ else if (value === "share") store.grantSharing();
1460
+ else if (value === "no-share") store.declineSharing();
1461
+ else if (value === "continue") {
1462
+ if (session.scanConsent === "undecided") store.grantSharing();
1463
+ store.completeSetup();
1464
+ }
1341
1465
  };
1342
1466
  return /* @__PURE__ */ jsx(IntroScreenLayout, {
1343
1467
  installDir: session.installDir,
1344
1468
  title,
1345
1469
  showSubtitle: view === "default",
1470
+ subtitle: SUBTITLE,
1346
1471
  body,
1347
1472
  showDetection: showContinue,
1348
1473
  detectionRows,
1349
1474
  menuOptions: unsupported ? null : menuOptions,
1350
1475
  menuAlign: "center",
1476
+ privacyOptions: sharingOptions(sharing),
1351
1477
  onSelect: handleSelect,
1352
1478
  programLabel: session.programLabel,
1353
1479
  skillId: session.skillId,
@@ -1874,7 +2000,7 @@ const SourceMapsIntroScreen = ({ store }) => {
1874
2000
  })
1875
2001
  })
1876
2002
  ]
1877
- }) : view === "privacy" ? /* @__PURE__ */ jsx(PrivacyPanel, {}) : /* @__PURE__ */ jsxs(Box, {
2003
+ }) : /* @__PURE__ */ jsxs(Box, {
1878
2004
  flexDirection: "column",
1879
2005
  width: 60,
1880
2006
  children: [/* @__PURE__ */ jsx(Text, { children: "The Wizard will run an agent to detect your project's framework(s), download the relevant docs, and implement source-map uploads for you." }), /* @__PURE__ */ jsx(Box, {
@@ -1885,12 +2011,6 @@ const SourceMapsIntroScreen = ({ store }) => {
1885
2011
  const menuOptions = view === "more-info" ? [{
1886
2012
  label: "Back",
1887
2013
  value: "back"
1888
- }, {
1889
- label: "Privacy & data usage",
1890
- value: "privacy"
1891
- }] : view === "privacy" ? [{
1892
- label: "Back",
1893
- value: "back"
1894
2014
  }] : [
1895
2015
  {
1896
2016
  label: "Continue",
@@ -1905,10 +2025,9 @@ const SourceMapsIntroScreen = ({ store }) => {
1905
2025
  value: "cancel"
1906
2026
  }
1907
2027
  ];
1908
- const title = view === "privacy" ? "Wizard privacy & usage" : "PostHog Wizard 🦔";
1909
2028
  return /* @__PURE__ */ jsx(IntroScreenLayout, {
1910
2029
  installDir: session.installDir,
1911
- title,
2030
+ title: "PostHog Wizard 🦔",
1912
2031
  showSubtitle: view === "default",
1913
2032
  body,
1914
2033
  showDetection: view === "default",
@@ -1918,8 +2037,7 @@ const SourceMapsIntroScreen = ({ store }) => {
1918
2037
  onSelect: (value) => {
1919
2038
  if (value === "cancel") process.exit(0);
1920
2039
  else if (value === "more-info") setView("more-info");
1921
- else if (value === "privacy") setView("privacy");
1922
- else if (value === "back") setView(view === "privacy" ? "more-info" : "default");
2040
+ else if (value === "back") setView("default");
1923
2041
  else store.completeSetup();
1924
2042
  }
1925
2043
  });
@@ -2997,10 +3115,11 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
2997
3115
  });
2998
3116
  if (showPrivacy) return /* @__PURE__ */ jsx(IntroScreenLayout, {
2999
3117
  installDir: store.session.installDir,
3000
- title: "Wizard privacy & usage",
3118
+ title: PRIVACY_PANEL_LABEL,
3001
3119
  showSubtitle: false,
3002
3120
  showDetection: false,
3003
3121
  body: /* @__PURE__ */ jsx(PrivacyPanel, {}),
3122
+ showPrivacy: false,
3004
3123
  menuOptions: [{
3005
3124
  label: "Back",
3006
3125
  value: "back"
@@ -3087,7 +3206,8 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
3087
3206
  color: Colors.accent,
3088
3207
  children: "[I]"
3089
3208
  }),
3090
- " privacy & usage"
3209
+ " ",
3210
+ PRIVACY_PANEL_LABEL
3091
3211
  ]
3092
3212
  })
3093
3213
  })
@@ -3196,10 +3316,14 @@ const SelfDrivingIntegrationCheckScreen = ({ store }) => {
3196
3316
  marginTop: 1,
3197
3317
  children: /* @__PURE__ */ jsxs(Text, {
3198
3318
  dimColor: true,
3199
- children: [/* @__PURE__ */ jsx(Text, {
3200
- color: Colors.accent,
3201
- children: "[I]"
3202
- }), " privacy & usage"]
3319
+ children: [
3320
+ /* @__PURE__ */ jsx(Text, {
3321
+ color: Colors.accent,
3322
+ children: "[I]"
3323
+ }),
3324
+ " ",
3325
+ PRIVACY_PANEL_LABEL
3326
+ ]
3203
3327
  })
3204
3328
  })
3205
3329
  ]
@@ -4699,17 +4823,18 @@ const AuthScreen = ({ store }) => {
4699
4823
  bindings.push({
4700
4824
  match: ["i", "I"],
4701
4825
  label: "I",
4702
- action: "privacy info",
4826
+ action: PRIVACY_PANEL_LABEL.toLowerCase(),
4703
4827
  handler: () => setShowPrivacy(true)
4704
4828
  });
4705
4829
  }
4706
4830
  useKeyBindings("auth", bindings);
4707
4831
  if (showPrivacy) return /* @__PURE__ */ jsx(IntroScreenLayout, {
4708
4832
  installDir: session.installDir,
4709
- title: "Wizard privacy & usage",
4833
+ title: PRIVACY_PANEL_LABEL,
4710
4834
  showSubtitle: false,
4711
4835
  showDetection: false,
4712
4836
  body: /* @__PURE__ */ jsx(PrivacyPanel, {}),
4837
+ showPrivacy: false,
4713
4838
  menuOptions: [{
4714
4839
  label: "Back",
4715
4840
  value: "back"
@@ -4757,7 +4882,7 @@ const AuthScreen = ({ store }) => {
4757
4882
  /* @__PURE__ */ jsx(Text, {
4758
4883
  bold: true,
4759
4884
  dimColor: true,
4760
- children: "How does the wizard use your data?"
4885
+ children: PRIVACY_PANEL_LABEL
4761
4886
  }),
4762
4887
  /* @__PURE__ */ jsxs(Text, {
4763
4888
  dimColor: true,
@@ -5639,7 +5764,7 @@ function createMcpSuggestedPromptsServices(store) {
5639
5764
  };
5640
5765
  }
5641
5766
  async function* runProductionPromptStreaming(args) {
5642
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DER7MG3q.js");
5767
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DOHJxT8K.js");
5643
5768
  yield* runMcpPromptViaSdk(args);
5644
5769
  }
5645
5770
  //#endregion
@@ -5832,4 +5957,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5832
5957
  //#endregion
5833
5958
  export { startTUI };
5834
5959
 
5835
- //# sourceMappingURL=start-tui-BafJXVNT.js.map
5960
+ //# sourceMappingURL=start-tui-ebV_ynrs.js.map