@posthog/wizard 2.15.0 → 2.16.1

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 (89) hide show
  1. package/README.md +0 -4
  2. package/dist/{TextBlock-B_8bXLLs.js → TextBlock-CdeZog_6.js} +4 -4
  3. package/dist/TextBlock-CdeZog_6.js.map +1 -0
  4. package/dist/{add-mcp-server-to-clients-Dq0n2yzq.js → add-mcp-server-to-clients-BS6Rjcwh.js} +6 -6
  5. package/dist/{add-mcp-server-to-clients-Dq0n2yzq.js.map → add-mcp-server-to-clients-BS6Rjcwh.js.map} +1 -1
  6. package/dist/{agent-interface-yB_27jG8.js → agent-interface-B4eUlMso.js} +33 -7
  7. package/dist/agent-interface-B4eUlMso.js.map +1 -0
  8. package/dist/{agent-runner-C9sSudE0.js → agent-runner-BxqiKVEf.js} +21 -22
  9. package/dist/{agent-runner-C9sSudE0.js.map → agent-runner-BxqiKVEf.js.map} +1 -1
  10. package/dist/{analytics-Da4QHjMw.js → analytics-DUuUurR3.js} +3 -3
  11. package/dist/{analytics-Da4QHjMw.js.map → analytics-DUuUurR3.js.map} +1 -1
  12. package/dist/api-B8OR0N1V.js +2 -0
  13. package/dist/api-CGJ1iGps.js +138 -0
  14. package/dist/api-CGJ1iGps.js.map +1 -0
  15. package/dist/bin.js +808 -476
  16. package/dist/bin.js.map +1 -1
  17. package/dist/ci-install-DD7WMmIF.js +73 -0
  18. package/dist/ci-install-DD7WMmIF.js.map +1 -0
  19. package/dist/{debug-D5kt4fxB.js → debug-Cd0hPlZy.js} +1 -1
  20. package/dist/{debug-DRKLej5r.js → debug-ubpO6102.js} +14 -6
  21. package/dist/debug-ubpO6102.js.map +1 -0
  22. package/dist/{defaults-CPH6eWhN.js → defaults-zrYmZ2ID.js} +1 -1
  23. package/dist/{defaults-CPH6eWhN.js.map → defaults-zrYmZ2ID.js.map} +1 -1
  24. package/dist/{env-api-key-HFqv1l-z.js → env-api-key-DEl3LJBv.js} +4 -2
  25. package/dist/{env-api-key-HFqv1l-z.js.map → env-api-key-DEl3LJBv.js.map} +1 -1
  26. package/dist/environment-BAaC5THg.js +22 -0
  27. package/dist/environment-BAaC5THg.js.map +1 -0
  28. package/dist/{file-utils-DnTSiTJw.js → file-utils-DPmgn9Vm.js} +1 -1
  29. package/dist/{file-utils-DnTSiTJw.js.map → file-utils-DPmgn9Vm.js.map} +1 -1
  30. package/dist/interactive-BaMAq88Q.js +11 -0
  31. package/dist/interactive-BaMAq88Q.js.map +1 -0
  32. package/dist/mcp-prompt-streaming-clGsVw8q.js +200 -0
  33. package/dist/mcp-prompt-streaming-clGsVw8q.js.map +1 -0
  34. package/dist/non-interactive-l2AKE3jD.js +12 -0
  35. package/dist/non-interactive-l2AKE3jD.js.map +1 -0
  36. package/dist/package-json-CumwmZpv.js +2 -0
  37. package/dist/{package-json-v_g2YlN1.js → package-json-Cynjr9k4.js} +1 -1
  38. package/dist/{package-json-v_g2YlN1.js.map → package-json-Cynjr9k4.js.map} +1 -1
  39. package/dist/{package-manager-DlTISyej.js → package-manager-BqsJK3ej.js} +2 -2
  40. package/dist/{package-manager-DlTISyej.js.map → package-manager-BqsJK3ej.js.map} +1 -1
  41. package/dist/{start-playground-Bxd2KG2L.js → playground-DlE5RNfE.js} +297 -8
  42. package/dist/playground-DlE5RNfE.js.map +1 -0
  43. package/dist/{posthog-B1G0raJU.js → posthog-DWL8uOcl.js} +1 -1
  44. package/dist/{posthog-B1G0raJU.js.map → posthog-DWL8uOcl.js.map} +1 -1
  45. package/dist/{posthog-integration-D-DyEJvz.js → posthog-integration-Bf_vtWI9.js} +229 -21
  46. package/dist/posthog-integration-Bf_vtWI9.js.map +1 -0
  47. package/dist/provisioning-BlBnlcFd.js +2 -0
  48. package/dist/{provisioning-DmN8ZDbE.js → provisioning-D_hAuxUN.js} +3 -3
  49. package/dist/{provisioning-DmN8ZDbE.js.map → provisioning-D_hAuxUN.js.map} +1 -1
  50. package/dist/{registry-CofBzIdU.js → registry-DKgYqROt.js} +5 -5
  51. package/dist/{registry-CofBzIdU.js.map → registry-DKgYqROt.js.map} +1 -1
  52. package/dist/setup-utils-BHZEdkNZ.js +2 -0
  53. package/dist/{setup-utils-_P-or31U.js → setup-utils-D-uTycLX.js} +24 -90
  54. package/dist/setup-utils-D-uTycLX.js.map +1 -0
  55. package/dist/skill-CnOQAZXp.js +29 -0
  56. package/dist/skill-CnOQAZXp.js.map +1 -0
  57. package/dist/{slides-D3I6JzlG.js → slides-CL1mv_Kq.js} +692 -68
  58. package/dist/slides-CL1mv_Kq.js.map +1 -0
  59. package/dist/{start-tui-Bl8fCbp_.js → start-tui-DXrv6cof.js} +470 -31
  60. package/dist/start-tui-DXrv6cof.js.map +1 -0
  61. package/dist/{steps-B-vmvb2V.js → steps-CgScwqso.js} +6 -6
  62. package/dist/{steps-B-vmvb2V.js.map → steps-CgScwqso.js.map} +1 -1
  63. package/dist/{task-stream-z6QFZtpC.js → task-stream-CF6QMVMv.js} +3 -3
  64. package/dist/{task-stream-z6QFZtpC.js.map → task-stream-CF6QMVMv.js.map} +1 -1
  65. package/dist/{telemetry-XO0SlTFs.js → telemetry-v6O12Bep.js} +2 -2
  66. package/dist/{telemetry-XO0SlTFs.js.map → telemetry-v6O12Bep.js.map} +1 -1
  67. package/dist/{wizard-abort-CuaS1eXn.js → wizard-abort-BGoBKgvC.js} +1 -1
  68. package/dist/{wizard-abort-uolun8Q3.js → wizard-abort-iTaJ8wC8.js} +3 -3
  69. package/dist/{wizard-abort-uolun8Q3.js.map → wizard-abort-iTaJ8wC8.js.map} +1 -1
  70. package/dist/{wizard-session-DxU5ZMBN.js → wizard-session-7tMjgOvP.js} +1 -1
  71. package/dist/{wizard-session-BlgiX-5d.js → wizard-session-gsn8Z3bZ.js} +5 -3
  72. package/dist/wizard-session-gsn8Z3bZ.js.map +1 -0
  73. package/dist/wizard-ui-YdGFRyu_.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/TextBlock-B_8bXLLs.js.map +0 -1
  76. package/dist/agent-interface-yB_27jG8.js.map +0 -1
  77. package/dist/analytics-BnR9904x.js +0 -2
  78. package/dist/debug-DRKLej5r.js.map +0 -1
  79. package/dist/detection-0Pz2NncX.js +0 -206
  80. package/dist/detection-0Pz2NncX.js.map +0 -1
  81. package/dist/package-json-Cttzi3C8.js +0 -2
  82. package/dist/posthog-integration-D-DyEJvz.js.map +0 -1
  83. package/dist/provisioning-COeHnCVG.js +0 -2
  84. package/dist/setup-utils-C5iSJ3eg.js +0 -2
  85. package/dist/setup-utils-_P-or31U.js.map +0 -1
  86. package/dist/slides-D3I6JzlG.js.map +0 -1
  87. package/dist/start-playground-Bxd2KG2L.js.map +0 -1
  88. package/dist/start-tui-Bl8fCbp_.js.map +0 -1
  89. package/dist/wizard-session-BlgiX-5d.js.map +0 -1
@@ -1,15 +1,16 @@
1
- import { M as POSTHOG_DOCS_URL, O as Integration, R as REMOTE_SKILLS_BASE_URL, U as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, k as OAUTH_PORTS, l as WIZARD_LOG_FILE, m as setUI, q as getSkillsBaseUrl, s as logToFile, y as getBlockingServiceKeys } from "./debug-DRKLej5r.js";
2
- import { n as analytics } from "./analytics-Da4QHjMw.js";
3
- import { d as extractOAuthCode, l as ApiError, m as getUiHostFromHost } from "./setup-utils-_P-or31U.js";
4
- import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-BlgiX-5d.js";
5
- import { r as wizardAbort } from "./wizard-abort-uolun8Q3.js";
6
- import { _ as AUDIT_SEVERITY_STYLE, d as downloadSkill, f as fetchSkillMenu, h as AUDIT_CHECKS_KEY, m as AUDIT_CHECKS_FILE, v as coerceAuditChecks, y as getAuditChecks } from "./agent-interface-yB_27jG8.js";
7
- import { o as Colors, s as Icons } from "./TextBlock-B_8bXLLs.js";
8
- import { t as EVENT_PLAN_FILE } from "./posthog-integration-D-DyEJvz.js";
9
- import { a as SOURCE_MAPS_CONTEXT_KEYS, c as fetchHealthIssues, d as STRIPE_SDKS, i as DISPLAY_NAME, l as getContentBlocks, n as Program, r as getProgramConfig, u as POSTHOG_SDKS } from "./bin.js";
10
- import { t as ALL_FEATURE_VALUES } from "./defaults-CPH6eWhN.js";
11
- 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-Dq0n2yzq.js";
12
- import { C as ProgressList, D as WizardStore, S as useKeyBindings, T as SplitView, _ as ModalOverlay, a as IssueTable, b as useStdoutDimensions, c as ServiceHealthList, f as HNViewer, g as LogViewer, h as EventPlanViewer, i as McpScreen, l as TipsCard, m as ScreenContainer, n as AUDIT_AREA_SLIDES, o as SEVERITY_LABEL, p as TabContainer, r as AuditChecksViewer, s as SEVERITY_ORDER, t as AUDIT_3000_AREA_SLIDES, u as LearnCard, v as ConfirmationInput, w as LoadingBox, x as PickerMenu } from "./slides-D3I6JzlG.js";
1
+ import { M as POSTHOG_DOCS_URL, O as Integration, R as REMOTE_SKILLS_BASE_URL, U as WIZARD_TOOLS_MENU_FLAG_KEY, _ as SIGNUP_WIZARD_READINESS_CONFIG, d as relativeToInstallDir, k as OAUTH_PORTS, l as WIZARD_LOG_FILE, m as setUI, q as getSkillsBaseUrl, s as logToFile, y as getBlockingServiceKeys } from "./debug-ubpO6102.js";
2
+ import { t as analytics } from "./analytics-DUuUurR3.js";
3
+ import { f as getUiHostFromHost, l as extractOAuthCode, r as getOrAskForProjectData } from "./setup-utils-D-uTycLX.js";
4
+ import { n as ApiError } from "./api-CGJ1iGps.js";
5
+ import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-gsn8Z3bZ.js";
6
+ import { r as wizardAbort } from "./wizard-abort-iTaJ8wC8.js";
7
+ import { _ as AUDIT_SEVERITY_STYLE, d as downloadSkill, f as fetchSkillMenu, h as AUDIT_CHECKS_KEY, m as AUDIT_CHECKS_FILE, v as coerceAuditChecks, y as getAuditChecks } from "./agent-interface-B4eUlMso.js";
8
+ import { t as EVENT_PLAN_FILE } from "./posthog-integration-Bf_vtWI9.js";
9
+ import { o as Colors, s as Icons } from "./TextBlock-CdeZog_6.js";
10
+ import { a as getProgramConfig, f as getContentBlocks, i as Program, m as STRIPE_SDKS, o as DISPLAY_NAME, p as POSTHOG_SDKS, s as SOURCE_MAPS_CONTEXT_KEYS, u as fetchHealthIssues } from "./bin.js";
11
+ import { A as WizardStore, C as useStdoutDimensions, D as LoadingBox, E as ProgressList, O as SplitView, T as useKeyBindings, _ as ScreenContainer, a as McpSuggestedPromptsScreen, b as ModalOverlay, c as IssueTable, d as ServiceHealthList, f as TipsCard, g as TabContainer, h as HNViewer, i as AuditChecksViewer, l as SEVERITY_LABEL, n as AUDIT_AREA_SLIDES, p as LearnCard, r as VisualBox, s as McpScreen, t as AUDIT_3000_AREA_SLIDES, u as SEVERITY_ORDER, v as EventPlanViewer, w as PickerMenu, x as ConfirmationInput, y as LogViewer } from "./slides-CL1mv_Kq.js";
12
+ import { t as ALL_FEATURE_VALUES } from "./defaults-zrYmZ2ID.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-BS6Rjcwh.js";
13
14
  import { spawn, spawnSync } from "node:child_process";
14
15
  import { join } from "node:path";
15
16
  import * as fs$1 from "fs";
@@ -33,8 +34,7 @@ var InkUI = class {
33
34
  }
34
35
  outro(message) {
35
36
  this.store.pushStatus(stripAnsi(message));
36
- const existing = this.store.session.outroData;
37
- this.store.setOutroData(existing ?? {
37
+ if (!this.store.session.outroData) this.store.setOutroData({
38
38
  kind: "success",
39
39
  message: stripAnsi(message)
40
40
  });
@@ -61,6 +61,12 @@ var InkUI = class {
61
61
  setCredentials(credentials) {
62
62
  this.store.setCredentials(credentials);
63
63
  }
64
+ setRoleAtOrganization(role) {
65
+ this.store.setRoleAtOrganization(role);
66
+ }
67
+ setApiUser(user) {
68
+ this.store.setApiUser(user);
69
+ }
64
70
  setDetectedFramework(label) {
65
71
  this.store.setDetectedFramework(label);
66
72
  }
@@ -146,6 +152,17 @@ var InkUI = class {
146
152
  setDashboardUrl(url) {
147
153
  this.store.setDashboardUrl(url);
148
154
  }
155
+ setNotebookUrl(url) {
156
+ this.store.setNotebookUrl(url);
157
+ }
158
+ setOutroData(data) {
159
+ const live = this.store.session;
160
+ this.store.setOutroData({
161
+ ...data,
162
+ dashboardUrl: live.dashboardUrl ?? data.dashboardUrl ?? void 0,
163
+ notebookUrl: live.notebookUrl ?? data.notebookUrl ?? void 0
164
+ });
165
+ }
149
166
  setFrameworkContext(key, value) {
150
167
  this.store.setFrameworkContext(key, value);
151
168
  }
@@ -1025,7 +1042,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1025
1042
  })),
1026
1043
  onSelect: (value) => {
1027
1044
  const integration = Array.isArray(value) ? value[0] : value;
1028
- import("./registry-CofBzIdU.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1045
+ import("./registry-DKgYqROt.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1029
1046
  const config = FRAMEWORK_REGISTRY[integration];
1030
1047
  store.setFrameworkConfig(integration, config);
1031
1048
  store.setDetectedFramework(config.metadata.name);
@@ -2235,18 +2252,28 @@ const openLink$1 = (url) => {
2235
2252
  stdio: "ignore"
2236
2253
  }).unref();
2237
2254
  };
2238
- const AuditAreaPane = ({ checks, reportPath }) => {
2255
+ const AuditAreaPane = ({ checks, reportPath, slides = AUDIT_AREA_SLIDES, dashboardUrl, notebookUrl }) => {
2239
2256
  const activeArea = checks.filter((c) => c.status === "pending")[0]?.area;
2240
- const slide = activeArea ? AUDIT_AREA_SLIDES.find((s) => s.area === activeArea) ?? fallbackSlide$1(activeArea) : null;
2257
+ const slide = activeArea ? slides.find((s) => s.area === activeArea) ?? fallbackSlide$1(activeArea) : null;
2241
2258
  useInput((input) => {
2242
2259
  if (input.toLowerCase() === "o" && slide?.docsUrl) openLink$1(slide.docsUrl);
2243
2260
  });
2244
- if (slide) return /* @__PURE__ */ jsx(ActiveSlide$1, {
2245
- slide,
2246
- hasFindings: checks.some(isFinding$1)
2261
+ const urlsFooter = dashboardUrl || notebookUrl ? /* @__PURE__ */ jsx(UrlsFooter, {
2262
+ dashboardUrl,
2263
+ notebookUrl
2264
+ }) : null;
2265
+ if (slide) return /* @__PURE__ */ jsxs(Box, {
2266
+ flexDirection: "column",
2267
+ children: [/* @__PURE__ */ jsx(ActiveSlide$1, {
2268
+ slide,
2269
+ hasFindings: checks.some(isFinding$1)
2270
+ }), urlsFooter]
2247
2271
  });
2248
2272
  if (checks.length === 0) return null;
2249
- return /* @__PURE__ */ jsx(WritingReport$1, { reportPath });
2273
+ return /* @__PURE__ */ jsxs(Box, {
2274
+ flexDirection: "column",
2275
+ children: [/* @__PURE__ */ jsx(WritingReport$1, { reportPath }), urlsFooter]
2276
+ });
2250
2277
  };
2251
2278
  const ActiveSlide$1 = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2252
2279
  flexDirection: "column",
@@ -2284,6 +2311,25 @@ const ActiveSlide$1 = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2284
2311
  })
2285
2312
  ]
2286
2313
  });
2314
+ const UrlsFooter = ({ dashboardUrl, notebookUrl }) => /* @__PURE__ */ jsxs(Box, {
2315
+ flexDirection: "column",
2316
+ paddingX: 1,
2317
+ marginTop: 1,
2318
+ children: [
2319
+ /* @__PURE__ */ jsx(Text, {
2320
+ dimColor: true,
2321
+ children: "─".repeat(40)
2322
+ }),
2323
+ dashboardUrl && /* @__PURE__ */ jsxs(Text, { children: ["Dashboard: ", /* @__PURE__ */ jsx(Text, {
2324
+ color: "cyan",
2325
+ children: dashboardUrl
2326
+ })] }),
2327
+ notebookUrl && /* @__PURE__ */ jsxs(Text, { children: ["Notebook: ", /* @__PURE__ */ jsx(Text, {
2328
+ color: "cyan",
2329
+ children: notebookUrl
2330
+ })] })
2331
+ ]
2332
+ });
2287
2333
  const WritingReport$1 = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2288
2334
  flexDirection: "column",
2289
2335
  paddingX: 1,
@@ -2312,6 +2358,327 @@ const WritingReport$1 = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2312
2358
  ]
2313
2359
  });
2314
2360
  //#endregion
2361
+ //#region src/ui/tui/screens/audit/slides/events-audit/detectSdk.tsx
2362
+ const DetectVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2363
+ /* @__PURE__ */ jsx(Text, {
2364
+ dimColor: true,
2365
+ children: "package.json"
2366
+ }),
2367
+ /* @__PURE__ */ jsxs(Text, { children: [
2368
+ /* @__PURE__ */ jsx(Text, {
2369
+ dimColor: true,
2370
+ children: " └─ "
2371
+ }),
2372
+ /* @__PURE__ */ jsx(Text, {
2373
+ color: "green",
2374
+ children: "posthog-js"
2375
+ }),
2376
+ /* @__PURE__ */ jsx(Text, {
2377
+ dimColor: true,
2378
+ children: " ^1.200.0"
2379
+ })
2380
+ ] }),
2381
+ /* @__PURE__ */ jsx(Text, {
2382
+ dimColor: true,
2383
+ children: "requirements.txt"
2384
+ }),
2385
+ /* @__PURE__ */ jsxs(Text, { children: [
2386
+ /* @__PURE__ */ jsx(Text, {
2387
+ dimColor: true,
2388
+ children: " └─ "
2389
+ }),
2390
+ /* @__PURE__ */ jsx(Text, {
2391
+ color: "green",
2392
+ children: "posthog"
2393
+ }),
2394
+ /* @__PURE__ */ jsx(Text, {
2395
+ dimColor: true,
2396
+ children: " ==4.0.1"
2397
+ })
2398
+ ] })
2399
+ ] });
2400
+ const DetectSdkSlide = {
2401
+ area: "Detect SDK",
2402
+ intro: [
2403
+ "First we find which PostHog SDKs your project uses. The audit needs to know the right languages and frameworks before it looks at any code.",
2404
+ "Only dependency manifests get read here: package.json, requirements.txt, go.mod, and similar files. Source files come in a later step.",
2405
+ "If your project is a monorepo with more than one SDK, we handle each one."
2406
+ ],
2407
+ visual: /* @__PURE__ */ jsx(DetectVisual, {}),
2408
+ docsUrl: "https://posthog.com/docs/libraries"
2409
+ };
2410
+ //#endregion
2411
+ //#region src/ui/tui/screens/audit/slides/events-audit/scanSites.tsx
2412
+ const ScanVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2413
+ /* @__PURE__ */ jsx(Text, {
2414
+ dimColor: true,
2415
+ children: "grep -rn 'posthog\\.(capture|identify|group)'"
2416
+ }),
2417
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2418
+ color: "cyan",
2419
+ children: "src/checkout/Checkout.tsx:88"
2420
+ }), /* @__PURE__ */ jsx(Text, {
2421
+ dimColor: true,
2422
+ children: " posthog.capture(...)"
2423
+ })] }),
2424
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2425
+ color: "cyan",
2426
+ children: "src/auth/login.ts:42"
2427
+ }), /* @__PURE__ */ jsx(Text, {
2428
+ dimColor: true,
2429
+ children: " posthog.identify(...)"
2430
+ })] }),
2431
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2432
+ color: "cyan",
2433
+ children: "src/onboarding/step.tsx:17"
2434
+ }), /* @__PURE__ */ jsx(Text, {
2435
+ dimColor: true,
2436
+ children: " posthog.capture(...)"
2437
+ })] })
2438
+ ] });
2439
+ const ScanSitesSlide = {
2440
+ area: "Scan capture sites",
2441
+ intro: [
2442
+ "Next we map every place your code captures PostHog events. This is the inventory the rest of the audit builds on.",
2443
+ "We search your project for PostHog SDK calls: capture, identify, group, and more. No source files are opened yet, that comes in the next step.",
2444
+ "Test files are excluded so they don't pollute the inventory."
2445
+ ],
2446
+ visual: /* @__PURE__ */ jsx(ScanVisual, {}),
2447
+ docsUrl: "https://posthog.com/docs/product-analytics/capture-events"
2448
+ };
2449
+ //#endregion
2450
+ //#region src/ui/tui/screens/audit/slides/events-audit/enrichSites.tsx
2451
+ const EnrichVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2452
+ /* @__PURE__ */ jsx(Text, {
2453
+ dimColor: true,
2454
+ children: "orchestrator"
2455
+ }),
2456
+ /* @__PURE__ */ jsx(Text, {
2457
+ dimColor: true,
2458
+ children: " │"
2459
+ }),
2460
+ /* @__PURE__ */ jsxs(Text, { children: [
2461
+ /* @__PURE__ */ jsx(Text, {
2462
+ dimColor: true,
2463
+ children: " ├─ "
2464
+ }),
2465
+ /* @__PURE__ */ jsx(Text, {
2466
+ color: "cyan",
2467
+ children: "subagent 1"
2468
+ }),
2469
+ /* @__PURE__ */ jsx(Text, {
2470
+ dimColor: true,
2471
+ children: " → part-1.json"
2472
+ })
2473
+ ] }),
2474
+ /* @__PURE__ */ jsxs(Text, { children: [
2475
+ /* @__PURE__ */ jsx(Text, {
2476
+ dimColor: true,
2477
+ children: " ├─ "
2478
+ }),
2479
+ /* @__PURE__ */ jsx(Text, {
2480
+ color: "cyan",
2481
+ children: "subagent 2"
2482
+ }),
2483
+ /* @__PURE__ */ jsx(Text, {
2484
+ dimColor: true,
2485
+ children: " → part-2.json"
2486
+ })
2487
+ ] }),
2488
+ /* @__PURE__ */ jsxs(Text, { children: [
2489
+ /* @__PURE__ */ jsx(Text, {
2490
+ dimColor: true,
2491
+ children: " └─ "
2492
+ }),
2493
+ /* @__PURE__ */ jsx(Text, {
2494
+ color: "cyan",
2495
+ children: "subagent N"
2496
+ }),
2497
+ /* @__PURE__ */ jsx(Text, {
2498
+ dimColor: true,
2499
+ children: " → part-N.json"
2500
+ })
2501
+ ] })
2502
+ ] });
2503
+ const EnrichSitesSlide = {
2504
+ area: "Enrich",
2505
+ intro: [
2506
+ "Now we look inside each file that captures events. The goal is to know not just that an event fires, but what it is, where it lives, and what data goes with it.",
2507
+ "For every capture site we pull out the event name, the properties, the area of your codebase it sits in, and the surrounding function or component.",
2508
+ "This is the only step that opens source files. Large codebases run in parallel so it finishes in one pass."
2509
+ ],
2510
+ visual: /* @__PURE__ */ jsx(EnrichVisual, {}),
2511
+ docsUrl: "https://posthog.com/docs/product-analytics/best-practices"
2512
+ };
2513
+ //#endregion
2514
+ //#region src/ui/tui/screens/audit/slides/events-audit/queryVolume.tsx
2515
+ const QueryVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2516
+ /* @__PURE__ */ jsx(Text, {
2517
+ dimColor: true,
2518
+ children: "SELECT event, count() AS volume_30d"
2519
+ }),
2520
+ /* @__PURE__ */ jsx(Text, {
2521
+ dimColor: true,
2522
+ children: "FROM events WHERE timestamp > now() - INTERVAL 30 DAY"
2523
+ }),
2524
+ /* @__PURE__ */ jsx(Text, {
2525
+ dimColor: true,
2526
+ children: "GROUP BY event ORDER BY volume_30d DESC"
2527
+ }),
2528
+ /* @__PURE__ */ jsx(Text, { children: " " }),
2529
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2530
+ color: "cyan",
2531
+ children: "pageview "
2532
+ }), /* @__PURE__ */ jsx(Text, {
2533
+ color: "green",
2534
+ children: "12,430"
2535
+ })] }),
2536
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2537
+ color: "cyan",
2538
+ children: "signup_completed "
2539
+ }), /* @__PURE__ */ jsx(Text, {
2540
+ color: "green",
2541
+ children: " 840"
2542
+ })] })
2543
+ ] });
2544
+ const QueryVolumeSlide = {
2545
+ area: "Query PostHog",
2546
+ intro: [
2547
+ "We ask PostHog how often each event in the inventory has fired in the last 30 days.",
2548
+ "Events your code captures but PostHog has never seen are flagged as phantoms. Phantoms usually mean a typo, a dead code path, or instrumentation that hasn't shipped yet. Worth cleaning up.",
2549
+ "If PostHog isn't reachable the audit still finishes. The report just notes where volume numbers would have gone."
2550
+ ],
2551
+ visual: /* @__PURE__ */ jsx(QueryVisual, {}),
2552
+ docsUrl: "https://posthog.com/docs/product-analytics/sql"
2553
+ };
2554
+ //#endregion
2555
+ //#region src/ui/tui/screens/audit/slides/events-audit/writeReport.tsx
2556
+ const ReportVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2557
+ /* @__PURE__ */ jsx(Text, {
2558
+ dimColor: true,
2559
+ children: "posthog-events-audit-report.md"
2560
+ }),
2561
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2562
+ dimColor: true,
2563
+ children: " # "
2564
+ }), /* @__PURE__ */ jsx(Text, { children: "Identity & segmentation" })] }),
2565
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2566
+ dimColor: true,
2567
+ children: " # "
2568
+ }), /* @__PURE__ */ jsx(Text, { children: "Coverage map" })] }),
2569
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2570
+ dimColor: true,
2571
+ children: " # "
2572
+ }), /* @__PURE__ */ jsx(Text, { children: "Data quality" })] }),
2573
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2574
+ dimColor: true,
2575
+ children: " # "
2576
+ }), /* @__PURE__ */ jsx(Text, { children: "Events by file & area" })] })
2577
+ ] });
2578
+ const WriteReportSlide = {
2579
+ area: "Write report",
2580
+ intro: [
2581
+ "We package everything we found into one report at ./posthog-events-audit-report.md. This is what you hand to the team.",
2582
+ "The report covers how users get identified, which parts of your codebase capture which events, data quality issues like duplicates and phantoms, and a volume map of every event your code captures.",
2583
+ "Nothing in your project is modified. The report is the only file you keep."
2584
+ ],
2585
+ visual: /* @__PURE__ */ jsx(ReportVisual, {}),
2586
+ docsUrl: "https://posthog.com/docs/product-analytics/best-practices"
2587
+ };
2588
+ //#endregion
2589
+ //#region src/ui/tui/screens/audit/slides/events-audit/createDashboard.tsx
2590
+ const DashboardVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2591
+ /* @__PURE__ */ jsx(Text, {
2592
+ dimColor: true,
2593
+ children: "events audit dashboard"
2594
+ }),
2595
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2596
+ color: "cyan",
2597
+ children: "pageview "
2598
+ }), /* @__PURE__ */ jsx(Text, {
2599
+ color: "green",
2600
+ children: "████████████"
2601
+ })] }),
2602
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2603
+ color: "cyan",
2604
+ children: "signup "
2605
+ }), /* @__PURE__ */ jsx(Text, {
2606
+ color: "green",
2607
+ children: "████████"
2608
+ })] }),
2609
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2610
+ color: "cyan",
2611
+ children: "activated "
2612
+ }), /* @__PURE__ */ jsx(Text, {
2613
+ color: "green",
2614
+ children: "█████"
2615
+ })] }),
2616
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2617
+ color: "cyan",
2618
+ children: "purchased "
2619
+ }), /* @__PURE__ */ jsx(Text, {
2620
+ color: "green",
2621
+ children: "██"
2622
+ })] })
2623
+ ] });
2624
+ const CreateDashboardSlide = {
2625
+ area: "Create dashboard",
2626
+ intro: ["Finally we build a live PostHog dashboard for the events your code captures. Use it to watch volume over time, spot new phantoms, and see how traffic shifts as you ship changes.", "Open the dashboard from the wrap-up screen when the audit completes."],
2627
+ visual: /* @__PURE__ */ jsx(DashboardVisual, {}),
2628
+ docsUrl: "https://posthog.com/docs/product-analytics/dashboards"
2629
+ };
2630
+ //#endregion
2631
+ //#region src/ui/tui/screens/audit/slides/events-audit/uploadNotebook.tsx
2632
+ const NotebookVisual = () => /* @__PURE__ */ jsxs(VisualBox, { children: [
2633
+ /* @__PURE__ */ jsx(Text, {
2634
+ dimColor: true,
2635
+ children: "posthog-events-audit-report.md"
2636
+ }),
2637
+ /* @__PURE__ */ jsx(Text, {
2638
+ dimColor: true,
2639
+ children: " │"
2640
+ }),
2641
+ /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
2642
+ dimColor: true,
2643
+ children: " ▼ "
2644
+ }), /* @__PURE__ */ jsx(Text, {
2645
+ color: "cyan",
2646
+ children: "PostHog notebook"
2647
+ })] }),
2648
+ /* @__PURE__ */ jsx(Text, {
2649
+ dimColor: true,
2650
+ children: " # Identity & segmentation"
2651
+ }),
2652
+ /* @__PURE__ */ jsx(Text, {
2653
+ dimColor: true,
2654
+ children: " # Coverage map"
2655
+ }),
2656
+ /* @__PURE__ */ jsx(Text, {
2657
+ dimColor: true,
2658
+ children: " # Events by file & area"
2659
+ })
2660
+ ] });
2661
+ //#endregion
2662
+ //#region src/ui/tui/screens/audit/slides/events-audit/index.ts
2663
+ const EVENTS_AUDIT_AREA_SLIDES = [
2664
+ DetectSdkSlide,
2665
+ ScanSitesSlide,
2666
+ EnrichSitesSlide,
2667
+ QueryVolumeSlide,
2668
+ WriteReportSlide,
2669
+ CreateDashboardSlide,
2670
+ {
2671
+ area: "Upload notebook",
2672
+ intro: [
2673
+ "Next we upload the report into a PostHog notebook so you can share it with your team as a URL.",
2674
+ "Hang tight.",
2675
+ "The markdown file on disk is still there for you to read locally."
2676
+ ],
2677
+ visual: /* @__PURE__ */ jsx(NotebookVisual, {}),
2678
+ docsUrl: "https://posthog.com/docs/notebooks"
2679
+ }
2680
+ ];
2681
+ //#endregion
2315
2682
  //#region src/ui/tui/screens/audit/PendingChecksList.tsx
2316
2683
  function groupByArea$1(checks) {
2317
2684
  const order = [];
@@ -2432,6 +2799,13 @@ const AuditRunScreen = ({ store }) => {
2432
2799
  const checks = getAuditChecks(store.session);
2433
2800
  const reportPath = `./${getProgramConfig(store.router.activeProgram).reportFile ?? "posthog-audit-report.md"}`;
2434
2801
  const pendingChecksList = /* @__PURE__ */ jsx(PendingChecksList, { checks });
2802
+ const areaPane = /* @__PURE__ */ jsx(AuditAreaPane, {
2803
+ checks,
2804
+ reportPath,
2805
+ slides: store.session.skillId === "events-audit" ? EVENTS_AUDIT_AREA_SLIDES : AUDIT_AREA_SLIDES,
2806
+ dashboardUrl: store.session.dashboardUrl,
2807
+ notebookUrl: store.session.notebookUrl
2808
+ });
2435
2809
  return /* @__PURE__ */ jsx(TabContainer, {
2436
2810
  tabs: [
2437
2811
  {
@@ -2442,10 +2816,7 @@ const AuditRunScreen = ({ store }) => {
2442
2816
  flexGrow: 1,
2443
2817
  children: pendingChecksList
2444
2818
  }) : /* @__PURE__ */ jsx(SplitView, {
2445
- left: /* @__PURE__ */ jsx(AuditAreaPane, {
2446
- checks,
2447
- reportPath
2448
- }),
2819
+ left: areaPane,
2449
2820
  right: pendingChecksList
2450
2821
  })
2451
2822
  },
@@ -2545,7 +2916,7 @@ const AuditChecksOutroSection = ({ checks, installDir }) => {
2545
2916
  children: [
2546
2917
  "… and ",
2547
2918
  hidden,
2548
- " more see the report."
2919
+ " more. See the report for details."
2549
2920
  ]
2550
2921
  })] })
2551
2922
  ]
@@ -2585,6 +2956,20 @@ const AuditOutroScreen = ({ store }) => {
2585
2956
  bold: true,
2586
2957
  children: ["✔ ", outroData.message || "Audit complete!"]
2587
2958
  }),
2959
+ outroData.dashboardUrl && /* @__PURE__ */ jsx(Box, {
2960
+ marginTop: 1,
2961
+ children: /* @__PURE__ */ jsxs(Text, { children: ["Dashboard: ", /* @__PURE__ */ jsx(Text, {
2962
+ color: "cyan",
2963
+ children: outroData.dashboardUrl
2964
+ })] })
2965
+ }),
2966
+ outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
2967
+ marginTop: 1,
2968
+ children: /* @__PURE__ */ jsxs(Text, { children: ["Notebook: ", /* @__PURE__ */ jsx(Text, {
2969
+ color: "cyan",
2970
+ children: outroData.notebookUrl
2971
+ })] })
2972
+ }),
2588
2973
  outroData.reportFile && /* @__PURE__ */ jsxs(Box, {
2589
2974
  flexDirection: "column",
2590
2975
  marginTop: 1,
@@ -2597,7 +2982,7 @@ const AuditOutroScreen = ({ store }) => {
2597
2982
  /* @__PURE__ */ jsx(Text, { children: join(store.session.installDir, outroData.reportFile) }),
2598
2983
  /* @__PURE__ */ jsx(Text, {
2599
2984
  dimColor: true,
2600
- children: "A markdown file in your project folder open it in any editor to read the full audit."
2985
+ children: "A markdown file in your project folder. Open it in any editor to read the full audit."
2601
2986
  })
2602
2987
  ]
2603
2988
  }),
@@ -4116,6 +4501,17 @@ const OutroScreen = ({ store }) => {
4116
4501
  })
4117
4502
  ] })
4118
4503
  }),
4504
+ outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
4505
+ marginTop: 1,
4506
+ children: /* @__PURE__ */ jsxs(Text, { children: [
4507
+ "And uploaded the report to a PostHog notebook:",
4508
+ " ",
4509
+ /* @__PURE__ */ jsx(Text, {
4510
+ color: "cyan",
4511
+ children: outroData.notebookUrl
4512
+ })
4513
+ ] })
4514
+ }),
4119
4515
  outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
4120
4516
  marginTop: 1,
4121
4517
  children: /* @__PURE__ */ jsxs(Text, { children: ["Learn more: ", /* @__PURE__ */ jsx(Text, {
@@ -4476,9 +4872,48 @@ function createMcpInstaller() {
4476
4872
  };
4477
4873
  }
4478
4874
  //#endregion
4875
+ //#region src/ui/tui/services/mcp-suggested-prompts-services.ts
4876
+ /**
4877
+ * Production services. The `runPromptStreaming` implementation lives
4878
+ * in a separate module so the heavy SDK import is only paid when
4879
+ * actually invoked.
4880
+ */
4881
+ function createMcpSuggestedPromptsServices(_store) {
4882
+ return {
4883
+ performLogin: async () => {
4884
+ const result = await getOrAskForProjectData({
4885
+ signup: false,
4886
+ ci: false,
4887
+ apiKey: void 0,
4888
+ projectId: void 0,
4889
+ email: void 0,
4890
+ region: void 0
4891
+ });
4892
+ return {
4893
+ credentials: {
4894
+ accessToken: result.accessToken,
4895
+ projectApiKey: result.projectApiKey,
4896
+ host: result.host,
4897
+ projectId: result.projectId
4898
+ },
4899
+ roleAtOrganization: result.roleAtOrganization,
4900
+ user: result.user
4901
+ };
4902
+ },
4903
+ runPromptStreaming: (args) => runProductionPromptStreaming(args)
4904
+ };
4905
+ }
4906
+ async function* runProductionPromptStreaming(args) {
4907
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-clGsVw8q.js");
4908
+ yield* runMcpPromptViaSdk(args);
4909
+ }
4910
+ //#endregion
4479
4911
  //#region src/ui/tui/screen-registry.tsx
4480
- function createServices() {
4481
- return { mcpInstaller: createMcpInstaller() };
4912
+ function createServices(store) {
4913
+ return {
4914
+ mcpInstaller: createMcpInstaller(),
4915
+ mcpSuggestedPromptsServices: createMcpSuggestedPromptsServices(store)
4916
+ };
4482
4917
  }
4483
4918
  function createScreens(store, services) {
4484
4919
  return {
@@ -4510,6 +4945,10 @@ function createScreens(store, services) {
4510
4945
  store,
4511
4946
  installer: services.mcpInstaller
4512
4947
  }),
4948
+ ["mcp-suggested-prompts"]: /* @__PURE__ */ jsx(McpSuggestedPromptsScreen, {
4949
+ store,
4950
+ services: services.mcpSuggestedPromptsServices
4951
+ }),
4513
4952
  ["keep-skills"]: /* @__PURE__ */ jsx(KeepSkillsScreen, { store }),
4514
4953
  ["outro"]: /* @__PURE__ */ jsx(OutroScreen, { store }),
4515
4954
  ["exit"]: /* @__PURE__ */ jsx(ExitScreen, {}),
@@ -4527,7 +4966,7 @@ function createScreens(store, services) {
4527
4966
  //#endregion
4528
4967
  //#region src/ui/tui/App.tsx
4529
4968
  const App = ({ store }) => {
4530
- const services = useMemo(() => createServices(), []);
4969
+ const services = useMemo(() => createServices(store), [store]);
4531
4970
  return /* @__PURE__ */ jsx(ScreenContainer, {
4532
4971
  store,
4533
4972
  screens: useMemo(() => createScreens(store, services), [store, services])
@@ -4587,4 +5026,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
4587
5026
  //#endregion
4588
5027
  export { startTUI };
4589
5028
 
4590
- //# sourceMappingURL=start-tui-Bl8fCbp_.js.map
5029
+ //# sourceMappingURL=start-tui-DXrv6cof.js.map