@posthog/wizard 2.24.1 → 2.26.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 (69) hide show
  1. package/dist/{add-mcp-server-to-clients-CfwEQT_z.js → add-mcp-server-to-clients-C58l_KpV.js} +4 -4
  2. package/dist/{add-mcp-server-to-clients-CfwEQT_z.js.map → add-mcp-server-to-clients-C58l_KpV.js.map} +1 -1
  3. package/dist/{agent-interface-D1vtN6Wn.js → agent-interface-Dq_4h2eN.js} +435 -45
  4. package/dist/agent-interface-Dq_4h2eN.js.map +1 -0
  5. package/dist/{agent-runner-CBbkS0Ro.js → agent-runner-BNGW3osc.js} +748 -132
  6. package/dist/agent-runner-BNGW3osc.js.map +1 -0
  7. package/dist/{analytics-CUr82BDl.js → analytics-BX3LKPch.js} +51 -17
  8. package/dist/analytics-BX3LKPch.js.map +1 -0
  9. package/dist/{api-CI3Z74NG.js → api-DCHci5SD.js} +9 -5
  10. package/dist/api-DCHci5SD.js.map +1 -0
  11. package/dist/bin.js +830 -120
  12. package/dist/bin.js.map +1 -1
  13. package/dist/{ci-install-D_kxNmbJ.js → ci-install-CHIbwXio.js} +5 -5
  14. package/dist/{ci-install-D_kxNmbJ.js.map → ci-install-CHIbwXio.js.map} +1 -1
  15. package/dist/{debug-DxA_f5QT.js → debug-BizeRFR0.js} +17 -8
  16. package/dist/debug-BizeRFR0.js.map +1 -0
  17. package/dist/{debug-zMvpNYb2.js → debug-fg4BAKKA.js} +1 -1
  18. package/dist/{environment-CyS37cmM.js → environment-DS5Pq9Wm.js} +3 -3
  19. package/dist/{environment-CyS37cmM.js.map → environment-DS5Pq9Wm.js.map} +1 -1
  20. package/dist/{interactive-CG6FFqSw.js → interactive-DE3WDjk7.js} +3 -3
  21. package/dist/{interactive-CG6FFqSw.js.map → interactive-DE3WDjk7.js.map} +1 -1
  22. package/dist/{mcp-prompt-streaming-DQz4FSb1.js → mcp-prompt-streaming-zsYd1zJx.js} +7 -26
  23. package/dist/mcp-prompt-streaming-zsYd1zJx.js.map +1 -0
  24. package/dist/{non-interactive-DWtHX3ZR.js → non-interactive-DNah9u3t.js} +2 -2
  25. package/dist/{non-interactive-DWtHX3ZR.js.map → non-interactive-DNah9u3t.js.map} +1 -1
  26. package/dist/{package-manager-BWUS4CP0.js → package-manager-Dma9-zGs.js} +2 -2
  27. package/dist/{package-manager-BWUS4CP0.js.map → package-manager-Dma9-zGs.js.map} +1 -1
  28. package/dist/{playground-D7AhMMF5.js → playground-Cwe0Q9HW.js} +146 -49
  29. package/dist/playground-Cwe0Q9HW.js.map +1 -0
  30. package/dist/{posthog-integration-DexZ2uHU.js → posthog-integration-CAYZdk0r.js} +11 -11
  31. package/dist/{posthog-integration-DexZ2uHU.js.map → posthog-integration-CAYZdk0r.js.map} +1 -1
  32. package/dist/{provisioning-9c-AQbsa.js → provisioning-BmL4ro-o.js} +10 -6
  33. package/dist/{provisioning-9c-AQbsa.js.map → provisioning-BmL4ro-o.js.map} +1 -1
  34. package/dist/{registry-CO7JVZyE.js → registry-C3wcDM3X.js} +4 -4
  35. package/dist/{registry-CO7JVZyE.js.map → registry-C3wcDM3X.js.map} +1 -1
  36. package/dist/{setup-utils-0U-_Md2G.js → setup-utils-CNWIMZ-d.js} +71 -16
  37. package/dist/setup-utils-CNWIMZ-d.js.map +1 -0
  38. package/dist/smoke-test.sh +36 -1
  39. package/dist/{start-tui-WNb3ET14.js → start-tui-CS802Ww9.js} +311 -54
  40. package/dist/start-tui-CS802Ww9.js.map +1 -0
  41. package/dist/{steps-BAUXDCC4.js → steps-BX44xr30.js} +6 -6
  42. package/dist/{steps-BAUXDCC4.js.map → steps-BX44xr30.js.map} +1 -1
  43. package/dist/{task-stream-CZawuzlz.js → task-stream-BQNSp0qR.js} +4 -3
  44. package/dist/task-stream-BQNSp0qR.js.map +1 -0
  45. package/dist/{telemetry-ycqCpNPr.js → telemetry-BH-MgWPT.js} +3 -3
  46. package/dist/{telemetry-ycqCpNPr.js.map → telemetry-BH-MgWPT.js.map} +1 -1
  47. package/dist/{AiOptInRequiredScreen-_33FOcVo.js → terminal-BSiupnOQ.js} +1058 -92
  48. package/dist/terminal-BSiupnOQ.js.map +1 -0
  49. package/dist/{urls-C8aJWvgh.js → urls-BuEABcmF.js} +2 -2
  50. package/dist/{urls-C8aJWvgh.js.map → urls-BuEABcmF.js.map} +1 -1
  51. package/dist/{wizard-abort-DWXyJdws.js → wizard-abort-CR3w2Efg.js} +1 -1
  52. package/dist/{wizard-abort-C6gRLxUE.js → wizard-abort-Dl2MJOP9.js} +3 -3
  53. package/dist/{wizard-abort-C6gRLxUE.js.map → wizard-abort-Dl2MJOP9.js.map} +1 -1
  54. package/dist/wizard-session-G3VWD6hv.js.map +1 -1
  55. package/dist/{wizard-ui-YdGFRyu_.js → wizard-ui-WZ48rUgr.js} +2 -1
  56. package/dist/wizard-ui-WZ48rUgr.js.map +1 -0
  57. package/package.json +1 -1
  58. package/dist/AiOptInRequiredScreen-_33FOcVo.js.map +0 -1
  59. package/dist/agent-interface-D1vtN6Wn.js.map +0 -1
  60. package/dist/agent-runner-CBbkS0Ro.js.map +0 -1
  61. package/dist/analytics-CUr82BDl.js.map +0 -1
  62. package/dist/api-CI3Z74NG.js.map +0 -1
  63. package/dist/debug-DxA_f5QT.js.map +0 -1
  64. package/dist/mcp-prompt-streaming-DQz4FSb1.js.map +0 -1
  65. package/dist/playground-D7AhMMF5.js.map +0 -1
  66. package/dist/setup-utils-0U-_Md2G.js.map +0 -1
  67. package/dist/start-tui-WNb3ET14.js.map +0 -1
  68. package/dist/task-stream-CZawuzlz.js.map +0 -1
  69. package/dist/wizard-ui-YdGFRyu_.js.map +0 -1
@@ -1,16 +1,16 @@
1
- import { A as OAUTH_PORTS, J as WIZARD_TOOLS_MENU_FLAG_KEY, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-DxA_f5QT.js";
2
- import { t as analytics } from "./analytics-CUr82BDl.js";
3
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-0U-_Md2G.js";
4
- import { a as getUiHostFromHost } from "./urls-C8aJWvgh.js";
5
- import { t as ApiError } from "./api-CI3Z74NG.js";
1
+ import { A as OAUTH_PORTS, L as POSTHOG_ORG_AI_SETTINGS_URL, P as POSTHOG_DOCS_URL, R as POSTHOG_PRIVACY_URL, U as REMOTE_SKILLS_BASE_URL, V as POSTHOG_TERMS_URL, Y as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, j as OAUTH_TIMEOUT_MS, k as Integration, l as WIZARD_LOG_FILE, m as setUI, s as logToFile, y as getBlockingServiceKeys } from "./debug-BizeRFR0.js";
2
+ import { t as analytics } from "./analytics-BX3LKPch.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-CNWIMZ-d.js";
4
+ import { a as getUiHostFromHost } from "./urls-BuEABcmF.js";
5
+ import { t as ApiError } from "./api-DCHci5SD.js";
6
6
  import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-G3VWD6hv.js";
7
- import { i as wizardAbort } from "./wizard-abort-C6gRLxUE.js";
8
- import { _ as AUDIT_CHECKS_KEY, b as coerceAuditChecks, g as AUDIT_CHECKS_FILE, m as fetchSkillMenu, p as downloadSkill, x as getAuditChecks, y as AUDIT_SEVERITY_STYLE } from "./agent-interface-D1vtN6Wn.js";
9
- import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-DexZ2uHU.js";
10
- import { _ as POSTHOG_SDKS, d as DISPLAY_NAME, f as SOURCE_MAPS_CONTEXT_KEYS, g as getContentBlocks, h as fetchHealthIssues, l as Program, n as useKeyBindings, t as PickerMenu, u as getProgramConfig, v as STRIPE_SDKS } from "./bin.js";
11
- import { A as SplitView, C as LogViewer, D as useStdoutDimensions, M as WizardStore, O as ProgressList, S as EventPlanViewer, T as ConfirmationInput, _ as LearnCard, a as SlackConnectScreen, b as TabContainer, c as AuditChecksViewer, d as McpScreen, f as IssueTable, g as TipsCard, h as ServiceHealthList, i as OutroScreen, k as LoadingBox, l as McpSuggestedPromptsScreen, m as SEVERITY_ORDER, n as SkillSourceInfo, o as AUDIT_AREA_SLIDES, p as SEVERITY_LABEL, r as useSkillEntry, s as VisualBox, t as AiOptInRequiredScreen, w as ModalOverlay, x as ScreenContainer, y as HNViewer } from "./AiOptInRequiredScreen-_33FOcVo.js";
7
+ import { i as wizardAbort } from "./wizard-abort-Dl2MJOP9.js";
8
+ import { C as AUDIT_SEVERITY_STYLE, T as getAuditChecks, b as AUDIT_CHECKS_FILE, h as fetchSkillMenu, m as downloadSkill, w as coerceAuditChecks, x as AUDIT_CHECKS_KEY } from "./agent-interface-Dq_4h2eN.js";
9
+ import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-CAYZdk0r.js";
10
+ import { _ as POSTHOG_SDKS, d as getProgramConfig, f as DISPLAY_NAME, g as getContentBlocks, h as fetchHealthIssues, n as useKeyBindings, p as SOURCE_MAPS_CONTEXT_KEYS, t as PickerMenu, u as Program, v as STRIPE_SDKS } from "./bin.js";
11
+ import { A as ConfirmationInput, C as TabContainer, D as LinkText, E as LogViewer, F as SplitView, L as WizardStore, M as useStdoutDimensions, N as ProgressList, O as extractUrls, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as ServiceHealthList, a as useSkillEntry, b as LearnCard, c as AUDIT_AREA_SLIDES, d as McpSuggestedPromptsScreen, g as SEVERITY_ORDER, h as SEVERITY_LABEL, i as SkillSourceInfo, k as ModalOverlay, l as VisualBox, m as IssueTable, n as releaseTerminal, o as OutroScreen, p as McpScreen, r as AiOptInRequiredScreen, s as SlackConnectScreen, t as enterDarkTerminal, u as AuditChecksViewer, v as VisualizerTab, w as ScreenContainer, y as TipsCard } from "./terminal-BSiupnOQ.js";
12
12
  import { t as ALL_FEATURE_VALUES } from "./defaults-BNWIWzjc.js";
13
- 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-CfwEQT_z.js";
13
+ 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-C58l_KpV.js";
14
14
  import * as fs$1 from "fs";
15
15
  import path from "path";
16
16
  import { join as join$1 } from "node:path";
@@ -18,8 +18,8 @@ import { spawn, spawnSync } from "node:child_process";
18
18
  import { Box, Text, render, useInput } from "ink";
19
19
  import { Fragment, createElement, useEffect, useMemo, useState, useSyncExternalStore } from "react";
20
20
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
21
- import { Spinner, TextInput } from "@inkjs/ui";
22
21
  import { access, readdir, rm } from "node:fs/promises";
22
+ import { Spinner, TextInput } from "@inkjs/ui";
23
23
  //#region src/ui/tui/ink-ui.ts
24
24
  const ANSI_RE = /\x1b\[[0-9;]*m/g;
25
25
  function stripAnsi(s) {
@@ -158,6 +158,9 @@ var InkUI = class {
158
158
  setDashboardUrl(url) {
159
159
  this.store.setDashboardUrl(url);
160
160
  }
161
+ setStage(stage) {
162
+ this.store.setCurrentStage(stage);
163
+ }
161
164
  setNotebookUrl(url) {
162
165
  this.store.setNotebookUrl(url);
163
166
  }
@@ -864,7 +867,15 @@ const WizardTitle = ({ title }) => /* @__PURE__ */ jsxs(Text, {
864
867
  title
865
868
  ]
866
869
  });
867
- const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubtitle = true, body, showDetection = true, detectionRows, children, menuOptions, menuAlign = "center", onSelect, programLabel, skillId, errorView }) => {
870
+ /** Generic subtitle shown when a screen doesn't supply its own. */
871
+ const DEFAULT_SUBTITLE = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
872
+ dimColor: true,
873
+ children: "We'll use AI to analyze your project and complete work."
874
+ }), /* @__PURE__ */ jsx(Text, {
875
+ dimColor: true,
876
+ children: ".env* file contents will not leave your machine."
877
+ })] });
878
+ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubtitle = true, subtitle, body, showDetection = true, detectionRows, children, menuOptions, menuAlign = "center", onSelect, programLabel, skillId, errorView }) => {
868
879
  const resolvedMenuOptions = menuOptions === void 0 ? [{
869
880
  label: "Continue",
870
881
  value: "continue"
@@ -895,17 +906,11 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
895
906
  alignItems: "center",
896
907
  children: [
897
908
  /* @__PURE__ */ jsx(WizardTitle, { title }),
898
- showSubtitle && /* @__PURE__ */ jsxs(Box, {
909
+ showSubtitle && /* @__PURE__ */ jsx(Box, {
899
910
  flexDirection: "column",
900
911
  alignItems: "center",
901
912
  marginTop: 1,
902
- children: [/* @__PURE__ */ jsx(Text, {
903
- dimColor: true,
904
- children: "We'll use AI to analyze your project and complete work."
905
- }), /* @__PURE__ */ jsx(Text, {
906
- dimColor: true,
907
- children: ".env* file contents will not leave your machine."
908
- })]
913
+ children: subtitle ?? DEFAULT_SUBTITLE
909
914
  }),
910
915
  body && /* @__PURE__ */ jsx(Box, {
911
916
  flexDirection: "column",
@@ -1060,7 +1065,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1060
1065
  })),
1061
1066
  onSelect: (value) => {
1062
1067
  const integration = Array.isArray(value) ? value[0] : value;
1063
- import("./registry-CO7JVZyE.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1068
+ import("./registry-C3wcDM3X.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1064
1069
  const config = FRAMEWORK_REGISTRY[integration];
1065
1070
  store.setFrameworkConfig(integration, config);
1066
1071
  store.setDetectedFramework(config.metadata.name);
@@ -1404,7 +1409,7 @@ const RevenueIntroScreen = ({ store }) => {
1404
1409
  }), /* @__PURE__ */ jsx(Box, {
1405
1410
  marginTop: 1,
1406
1411
  flexDirection: "column",
1407
- children: /* @__PURE__ */ jsx(DetectErrorBody$1, { error: detectError })
1412
+ children: /* @__PURE__ */ jsx(DetectErrorBody$2, { error: detectError })
1408
1413
  })]
1409
1414
  }), /* @__PURE__ */ jsx(PickerMenu, {
1410
1415
  options: [{
@@ -1448,7 +1453,7 @@ const RevenueIntroScreen = ({ store }) => {
1448
1453
  }
1449
1454
  });
1450
1455
  };
1451
- const DetectErrorBody$1 = ({ error }) => {
1456
+ const DetectErrorBody$2 = ({ error }) => {
1452
1457
  switch (error.kind) {
1453
1458
  case "bad-directory": {
1454
1459
  const reasonText = {
@@ -1710,7 +1715,7 @@ const SourceMapsIntroScreen = ({ store }) => {
1710
1715
  }), /* @__PURE__ */ jsx(Box, {
1711
1716
  marginTop: 1,
1712
1717
  flexDirection: "column",
1713
- children: /* @__PURE__ */ jsx(DetectErrorBody, { error: detectError })
1718
+ children: /* @__PURE__ */ jsx(DetectErrorBody$1, { error: detectError })
1714
1719
  })]
1715
1720
  }), /* @__PURE__ */ jsx(PickerMenu, {
1716
1721
  options: [{
@@ -1792,7 +1797,7 @@ const NATIVE_PLATFORM_DOCS = {
1792
1797
  url: "https://posthog.com/docs/error-tracking/upload-source-maps/flutter"
1793
1798
  }
1794
1799
  };
1795
- const DetectErrorBody = ({ error }) => {
1800
+ const DetectErrorBody$1 = ({ error }) => {
1796
1801
  switch (error.kind) {
1797
1802
  case "bad-directory": {
1798
1803
  const reasonText = {
@@ -2172,6 +2177,168 @@ const AgentSkillIntroScreen = ({ store }) => {
2172
2177
  });
2173
2178
  };
2174
2179
  //#endregion
2180
+ //#region src/ui/tui/screens/SelfDrivingIntroScreen.tsx
2181
+ /**
2182
+ * SelfDrivingIntroScreen — Welcome screen for the self-driving flow.
2183
+ *
2184
+ * Composes IntroScreenLayout with prerequisite-detection state:
2185
+ * - Detection succeeded: explains what Self-driving turns on, continue/cancel
2186
+ * - Detection failed: shows the error via errorView + exit prompt
2187
+ *
2188
+ * Reads `frameworkContext.detectError` set by
2189
+ * detectSelfDrivingPrerequisites().
2190
+ */
2191
+ const SelfDrivingIntroScreen = ({ store }) => {
2192
+ useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
2193
+ const [showingMoreInfo, setShowingMoreInfo] = useState(false);
2194
+ const { session } = store;
2195
+ const detectError = session.frameworkContext.detectError;
2196
+ const subtitle = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, {
2197
+ dimColor: true,
2198
+ children: "We'll use AI to analyze your project and set up PostHog Self-driving."
2199
+ }), /* @__PURE__ */ jsx(Text, {
2200
+ dimColor: true,
2201
+ children: ".env* file contents will not leave your machine."
2202
+ })] });
2203
+ const body = showingMoreInfo ? /* @__PURE__ */ jsxs(Box, {
2204
+ flexDirection: "column",
2205
+ width: 56,
2206
+ flexShrink: 0,
2207
+ children: [
2208
+ /* @__PURE__ */ jsxs(Text, { children: [
2209
+ "The wizard is an agent that executes PostHog tasks. Its code is open source: ",
2210
+ /* @__PURE__ */ jsx(Text, {
2211
+ color: "cyan",
2212
+ children: "https://github.com/PostHog/wizard"
2213
+ }),
2214
+ "."
2215
+ ] }),
2216
+ /* @__PURE__ */ jsx(Box, {
2217
+ flexDirection: "column",
2218
+ marginTop: 1,
2219
+ children: /* @__PURE__ */ jsxs(Text, { children: [
2220
+ "The",
2221
+ " ",
2222
+ /* @__PURE__ */ jsx(Text, {
2223
+ italic: true,
2224
+ color: "cyan",
2225
+ children: session.programLabel
2226
+ }),
2227
+ " ",
2228
+ "program turns on PostHog Self-driving for this project:"
2229
+ ] })
2230
+ }),
2231
+ /* @__PURE__ */ jsxs(Box, {
2232
+ flexDirection: "column",
2233
+ marginTop: 1,
2234
+ paddingLeft: 4,
2235
+ children: [
2236
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Watches errors, replays, and connected tools"] }),
2237
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Runs scouts — scheduled checks that scan for issues"] }),
2238
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Researches findings in your code via GitHub"] }),
2239
+ /* @__PURE__ */ jsxs(Text, { children: ["•", " Surfaces everything in your Self-driving inbox"] })
2240
+ ]
2241
+ })
2242
+ ]
2243
+ }) : /* @__PURE__ */ jsxs(Box, {
2244
+ flexDirection: "column",
2245
+ alignItems: "center",
2246
+ children: [
2247
+ /* @__PURE__ */ jsx(Text, { children: "Let's set up PostHog Self-driving." }),
2248
+ /* @__PURE__ */ jsx(Box, {
2249
+ flexDirection: "column",
2250
+ marginTop: 1,
2251
+ children: /* @__PURE__ */ jsx(Text, { children: "PostHog finds — and can fix — issues in your product." })
2252
+ }),
2253
+ /* @__PURE__ */ jsxs(Box, {
2254
+ flexDirection: "column",
2255
+ marginTop: 1,
2256
+ alignItems: "center",
2257
+ children: [/* @__PURE__ */ jsx(Text, {
2258
+ dimColor: true,
2259
+ children: "It turns on signal sources (errors, replays, connected tools)"
2260
+ }), /* @__PURE__ */ jsx(Text, {
2261
+ dimColor: true,
2262
+ children: "and scouts — scheduled checks that flag issues to your inbox."
2263
+ })]
2264
+ })
2265
+ ]
2266
+ });
2267
+ const errorView = detectError ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Box, {
2268
+ flexDirection: "column",
2269
+ marginBottom: 1,
2270
+ children: [/* @__PURE__ */ jsxs(Text, {
2271
+ color: "red",
2272
+ bold: true,
2273
+ children: ["✘", " Cannot set up PostHog Self-driving"]
2274
+ }), /* @__PURE__ */ jsx(Box, {
2275
+ marginTop: 1,
2276
+ flexDirection: "column",
2277
+ children: /* @__PURE__ */ jsx(DetectErrorBody, { error: detectError })
2278
+ })]
2279
+ }), /* @__PURE__ */ jsx(PickerMenu, {
2280
+ options: [{
2281
+ label: "Exit",
2282
+ value: "exit"
2283
+ }],
2284
+ onSelect: () => process.exit(1)
2285
+ })] }) : void 0;
2286
+ const menuOptions = showingMoreInfo ? [{
2287
+ label: "Back",
2288
+ value: "back"
2289
+ }] : [
2290
+ {
2291
+ label: "Continue",
2292
+ value: "continue"
2293
+ },
2294
+ {
2295
+ label: "More info",
2296
+ value: "more-info"
2297
+ },
2298
+ {
2299
+ label: "Cancel",
2300
+ value: "cancel"
2301
+ }
2302
+ ];
2303
+ return /* @__PURE__ */ jsx(IntroScreenLayout, {
2304
+ installDir: session.installDir,
2305
+ showSubtitle: !showingMoreInfo,
2306
+ subtitle,
2307
+ body,
2308
+ showDetection: !showingMoreInfo,
2309
+ errorView,
2310
+ programLabel: session.programLabel,
2311
+ skillId: session.skillId,
2312
+ menuOptions,
2313
+ onSelect: (value) => {
2314
+ if (value === "cancel") process.exit(0);
2315
+ else if (value === "more-info") setShowingMoreInfo(true);
2316
+ else if (value === "back") setShowingMoreInfo(false);
2317
+ else store.completeSetup();
2318
+ }
2319
+ });
2320
+ };
2321
+ const DetectErrorBody = ({ error }) => {
2322
+ switch (error.kind) {
2323
+ case "bad-directory": {
2324
+ const reasonText = {
2325
+ missing: "does not exist",
2326
+ "not-dir": "is not a directory",
2327
+ unreadable: "could not be accessed"
2328
+ }[error.reason];
2329
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Text, { children: [
2330
+ "This path ",
2331
+ reasonText,
2332
+ ":"
2333
+ ] }), /* @__PURE__ */ jsxs(Text, {
2334
+ dimColor: true,
2335
+ children: [" ", error.path]
2336
+ })] });
2337
+ }
2338
+ default: return /* @__PURE__ */ jsx(Text, { children: "Self-driving could not start in this directory. Try again, or reach out to wizard@posthog.com." });
2339
+ }
2340
+ };
2341
+ //#endregion
2175
2342
  //#region src/ui/tui/screens/audit/AuditIntroScreen.tsx
2176
2343
  const AuditIntroScreen = ({ store }) => {
2177
2344
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
@@ -3379,7 +3546,11 @@ const RunScreen = ({ store }) => {
3379
3546
  const learnBlocks = useMemo(() => {
3380
3547
  return (getProgramConfig(activeProgram).getContentBlocks ?? getContentBlocks)(store);
3381
3548
  }, [store, activeProgram]);
3382
- const leftPane = store.learnCardComplete ? /* @__PURE__ */ jsx(TipsCard, { store }) : /* @__PURE__ */ jsx(LearnCard, {
3549
+ const programTips = getProgramConfig(activeProgram).getTips?.(store);
3550
+ const leftPane = store.learnCardComplete ? /* @__PURE__ */ jsx(TipsCard, {
3551
+ store,
3552
+ tips: programTips
3553
+ }) : /* @__PURE__ */ jsx(LearnCard, {
3383
3554
  store,
3384
3555
  blocks: learnBlocks,
3385
3556
  onComplete: () => store.setLearnCardComplete()
@@ -3412,6 +3583,11 @@ const RunScreen = ({ store }) => {
3412
3583
  label: "Tail logs",
3413
3584
  component: /* @__PURE__ */ jsx(LogViewer, { filePath: WIZARD_LOG_FILE })
3414
3585
  },
3586
+ {
3587
+ id: "visualizer",
3588
+ label: "Visualizer",
3589
+ component: /* @__PURE__ */ jsx(VisualizerTab, { store })
3590
+ },
3415
3591
  {
3416
3592
  id: "hn",
3417
3593
  label: "HN",
@@ -3767,6 +3943,62 @@ const SessionTimeoutScreen = ({ store }) => {
3767
3943
  });
3768
3944
  };
3769
3945
  //#endregion
3946
+ //#region src/utils/clipboard.ts
3947
+ /**
3948
+ * Best-effort clipboard write — no third-party dependency.
3949
+ *
3950
+ * Used as a fallback so users can paste a URL their terminal can't linkify
3951
+ * (e.g. macOS Terminal.app, which lacks OSC 8 hyperlink support). Shells out to
3952
+ * the platform clipboard binary over stdin; never throws — returns false when no
3953
+ * clipboard command is reachable (CI, headless, or the binary isn't installed).
3954
+ *
3955
+ * Text is passed via stdin (never as an argv) so there's no shell-injection
3956
+ * surface, and `spawn` runs without a shell.
3957
+ */
3958
+ /** Platform clipboard commands, in preference order. */
3959
+ function clipboardCommands() {
3960
+ if (process.platform === "darwin") return [{
3961
+ cmd: "pbcopy",
3962
+ args: []
3963
+ }];
3964
+ if (process.platform === "win32") return [{
3965
+ cmd: "clip",
3966
+ args: []
3967
+ }];
3968
+ return [
3969
+ {
3970
+ cmd: "wl-copy",
3971
+ args: []
3972
+ },
3973
+ {
3974
+ cmd: "xclip",
3975
+ args: ["-selection", "clipboard"]
3976
+ },
3977
+ {
3978
+ cmd: "xsel",
3979
+ args: ["--clipboard", "--input"]
3980
+ }
3981
+ ];
3982
+ }
3983
+ function writeWith({ cmd, args }, text) {
3984
+ return new Promise((resolve) => {
3985
+ try {
3986
+ const child = spawn(cmd, args);
3987
+ child.on("error", () => resolve(false));
3988
+ child.stdin.on("error", () => resolve(false));
3989
+ child.on("close", (code) => resolve(code === 0));
3990
+ child.stdin.end(text);
3991
+ } catch {
3992
+ resolve(false);
3993
+ }
3994
+ });
3995
+ }
3996
+ async function copyToClipboard(text) {
3997
+ for (const command of clipboardCommands()) if (await writeWith(command, text)) return true;
3998
+ logToFile("[clipboard] no working clipboard command found");
3999
+ return false;
4000
+ }
4001
+ //#endregion
3770
4002
  //#region src/ui/tui/screens/WizardAskScreen.tsx
3771
4003
  /**
3772
4004
  * WizardAskScreen — Overlay for the `wizard_ask` MCP tool.
@@ -3781,6 +4013,22 @@ const WizardAskScreen = ({ store }) => {
3781
4013
  const [index, setIndex] = useState(0);
3782
4014
  const [answers, setAnswers] = useState({});
3783
4015
  const [lastPendingId, setLastPendingId] = useState(null);
4016
+ const [copied, setCopied] = useState(false);
4017
+ const richLinks = pending?.richLinks ?? false;
4018
+ const currentPrompt = pending?.questions[index]?.prompt ?? "";
4019
+ const promptUrls = richLinks ? extractUrls(currentPrompt) : [];
4020
+ const soleUrl = promptUrls.length === 1 ? promptUrls[0] : null;
4021
+ useEffect(() => {
4022
+ setCopied(false);
4023
+ if (!soleUrl) return;
4024
+ let active = true;
4025
+ copyToClipboard(soleUrl).then((ok) => {
4026
+ if (active && ok) setCopied(true);
4027
+ });
4028
+ return () => {
4029
+ active = false;
4030
+ };
4031
+ }, [soleUrl]);
3784
4032
  if (!pending) return null;
3785
4033
  if (pending.id !== lastPendingId) {
3786
4034
  setLastPendingId(pending.id);
@@ -3819,7 +4067,14 @@ const WizardAskScreen = ({ store }) => {
3819
4067
  }),
3820
4068
  /* @__PURE__ */ jsx(Box, {
3821
4069
  flexDirection: "column",
3822
- children: /* @__PURE__ */ jsx(Text, { children: question.prompt })
4070
+ children: pending.richLinks ? /* @__PURE__ */ jsx(LinkText, { text: question.prompt }) : /* @__PURE__ */ jsx(Text, { children: question.prompt })
4071
+ }),
4072
+ pending.richLinks && copied && /* @__PURE__ */ jsx(Box, {
4073
+ marginTop: 1,
4074
+ children: /* @__PURE__ */ jsx(Text, {
4075
+ dimColor: true,
4076
+ children: "Link copied to clipboard — paste it in your browser if it isn't clickable."
4077
+ })
3823
4078
  }),
3824
4079
  /* @__PURE__ */ jsx(Box, {
3825
4080
  marginTop: 1,
@@ -3842,16 +4097,21 @@ const QuestionInput = ({ question, onSubmit }) => {
3842
4097
  onSubmit(Array.isArray(value) ? value[0] : value);
3843
4098
  }
3844
4099
  });
3845
- case "multi": return /* @__PURE__ */ jsx(PickerMenu, {
3846
- mode: "multi",
3847
- options: (question.options ?? []).map((o) => ({
4100
+ case "multi": {
4101
+ const multiOptions = (question.options ?? []).map((o) => ({
3848
4102
  label: o.label,
3849
- value: o.value
3850
- })),
3851
- onSelect: (value) => {
3852
- onSubmit(Array.isArray(value) ? value : [value]);
3853
- }
3854
- });
4103
+ value: o.value,
4104
+ description: o.description
4105
+ }));
4106
+ return /* @__PURE__ */ jsx(PickerMenu, {
4107
+ mode: "multi",
4108
+ optionMarginBottom: multiOptions.some((o) => o.description) ? 1 : 0,
4109
+ options: multiOptions,
4110
+ onSelect: (value) => {
4111
+ onSubmit(Array.isArray(value) ? value : [value]);
4112
+ }
4113
+ });
4114
+ }
3855
4115
  case "text": return /* @__PURE__ */ jsxs(Box, {
3856
4116
  flexDirection: "column",
3857
4117
  width: "100%",
@@ -3974,7 +4234,7 @@ function createMcpSuggestedPromptsServices(_store) {
3974
4234
  };
3975
4235
  }
3976
4236
  async function* runProductionPromptStreaming(args) {
3977
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DQz4FSb1.js");
4237
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-zsYd1zJx.js");
3978
4238
  yield* runMcpPromptViaSdk(args);
3979
4239
  }
3980
4240
  //#endregion
@@ -4000,6 +4260,7 @@ function createScreens(store, services) {
4000
4260
  ["source-maps-outro"]: /* @__PURE__ */ jsx(SourceMapsOutroScreen, { store }),
4001
4261
  ["migration-intro"]: /* @__PURE__ */ jsx(MigrationIntroScreen, { store }),
4002
4262
  ["agent-skill-intro"]: /* @__PURE__ */ jsx(AgentSkillIntroScreen, { store }),
4263
+ ["self-driving-intro"]: /* @__PURE__ */ jsx(SelfDrivingIntroScreen, { store }),
4003
4264
  ["audit-intro"]: /* @__PURE__ */ jsx(AuditIntroScreen, { store }),
4004
4265
  ["audit-run"]: /* @__PURE__ */ jsx(AuditRunScreen, { store }),
4005
4266
  ["audit-outro"]: /* @__PURE__ */ jsx(AuditOutroScreen, { store }),
@@ -4044,7 +4305,7 @@ const App = ({ store }) => {
4044
4305
  };
4045
4306
  //#endregion
4046
4307
  //#region src/ui/tui/exit-line.ts
4047
- const RESET_ATTRS$1 = "\x1B[0m";
4308
+ const RESET_ATTRS = "\x1B[0m";
4048
4309
  const GREEN = "\x1B[32m";
4049
4310
  const BOLD = "\x1B[1m";
4050
4311
  const DIM = "\x1B[2m";
@@ -4053,11 +4314,16 @@ function getExitLine(store) {
4053
4314
  const label = store.session.programLabel ?? "Wizard";
4054
4315
  if (outro?.kind === "success") {
4055
4316
  const message = outro.message ?? `${label} completed successfully.`;
4056
- const headline = `${GREEN}${BOLD}✔${RESET_ATTRS$1} ${message}${outro.reportFile && !message.includes(outro.reportFile) ? ` Check ./${outro.reportFile} for details.` : ""}`;
4057
- if (outro.handoffPrompt) return `${headline}\n\n${DIM}Hand this to your coding agent to finish up (triple-click to select):${RESET_ATTRS$1}\n` + outro.handoffPrompt;
4058
- return headline;
4317
+ const parts = [`${GREEN}${BOLD}✔${RESET_ATTRS} ${message}${outro.reportFile && !message.includes(outro.reportFile) ? ` Check ./${outro.reportFile} for details.` : ""}`];
4318
+ if (outro.primaryLink) parts.push(`${DIM}${outro.primaryLink.label}:${RESET_ATTRS}\n${outro.primaryLink.url}`);
4319
+ if (outro.nextSteps) {
4320
+ const bullets = outro.nextSteps.items.map((item) => `${DIM} • ${item}${RESET_ATTRS}`).join("\n");
4321
+ parts.push(`${DIM}${outro.nextSteps.heading}${RESET_ATTRS}\n${bullets}`);
4322
+ }
4323
+ if (outro.handoffPrompt) parts.push(`${DIM}Hand this to your coding agent to finish up (triple-click to select):${RESET_ATTRS}\n` + outro.handoffPrompt);
4324
+ return parts.join("\n\n");
4059
4325
  }
4060
- return `${DIM}${label} exited.${RESET_ATTRS$1}`;
4326
+ return `${DIM}${label} exited.${RESET_ATTRS}`;
4061
4327
  }
4062
4328
  //#endregion
4063
4329
  //#region src/ui/tui/start-tui.ts
@@ -4068,17 +4334,8 @@ function getExitLine(store) {
4068
4334
  * doesn't pollute scrollback history. On exit, the previous terminal
4069
4335
  * content is restored and a single exit summary line is printed.
4070
4336
  */
4071
- const RESET_ATTRS = "\x1B[0m";
4072
- const CLEAR_SCREEN = "\x1B[2J";
4073
- const CURSOR_HOME = "\x1B[H";
4074
- const BG_BLACK = "\x1B[48;2;0;0;0m";
4075
- const ENTER_ALT_SCREEN = "\x1B[?1049h";
4076
- const LEAVE_ALT_SCREEN = "\x1B[?1049l";
4077
- function releaseTerminal() {
4078
- process.stdout.write(RESET_ATTRS + LEAVE_ALT_SCREEN);
4079
- }
4080
4337
  function startTUI(version, program = Program.PostHogIntegration) {
4081
- process.stdout.write(ENTER_ALT_SCREEN + BG_BLACK + CLEAR_SCREEN + CURSOR_HOME);
4338
+ enterDarkTerminal();
4082
4339
  const store = new WizardStore(program);
4083
4340
  store.version = version;
4084
4341
  setUI(new InkUI(store));
@@ -4111,4 +4368,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
4111
4368
  //#endregion
4112
4369
  export { startTUI };
4113
4370
 
4114
- //# sourceMappingURL=start-tui-WNb3ET14.js.map
4371
+ //# sourceMappingURL=start-tui-CS802Ww9.js.map