@posthog/wizard 2.16.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 (88) hide show
  1. package/README.md +0 -4
  2. package/dist/{TextBlock-DJVhBkr3.js → TextBlock-CdeZog_6.js} +2 -2
  3. package/dist/{TextBlock-DJVhBkr3.js.map → TextBlock-CdeZog_6.js.map} +1 -1
  4. package/dist/{add-mcp-server-to-clients-9jQjc-CO.js → add-mcp-server-to-clients-BS6Rjcwh.js} +6 -6
  5. package/dist/{add-mcp-server-to-clients-9jQjc-CO.js.map → add-mcp-server-to-clients-BS6Rjcwh.js.map} +1 -1
  6. package/dist/{agent-interface-pBnqJL8P.js → agent-interface-B4eUlMso.js} +33 -7
  7. package/dist/agent-interface-B4eUlMso.js.map +1 -0
  8. package/dist/{agent-runner-H1FP6XTc.js → agent-runner-BxqiKVEf.js} +16 -21
  9. package/dist/{agent-runner-H1FP6XTc.js.map → agent-runner-BxqiKVEf.js.map} +1 -1
  10. package/dist/{analytics-DZaUgJte.js → analytics-DUuUurR3.js} +3 -3
  11. package/dist/{analytics-DZaUgJte.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 +763 -497
  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-B6rX6xye.js → debug-Cd0hPlZy.js} +1 -1
  20. package/dist/{debug-C4jRuzny.js → debug-ubpO6102.js} +12 -6
  21. package/dist/debug-ubpO6102.js.map +1 -0
  22. package/dist/{defaults-GbLPuHxj.js → defaults-zrYmZ2ID.js} +1 -1
  23. package/dist/{defaults-GbLPuHxj.js.map → defaults-zrYmZ2ID.js.map} +1 -1
  24. package/dist/{env-api-key-DU8uIEvo.js → env-api-key-DEl3LJBv.js} +4 -2
  25. package/dist/{env-api-key-DU8uIEvo.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-DKiaymMt.js → mcp-prompt-streaming-clGsVw8q.js} +2 -2
  33. package/dist/{mcp-prompt-streaming-DKiaymMt.js.map → mcp-prompt-streaming-clGsVw8q.js.map} +1 -1
  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-DLt75bit.js → package-manager-BqsJK3ej.js} +2 -2
  40. package/dist/{package-manager-DLt75bit.js.map → package-manager-BqsJK3ej.js.map} +1 -1
  41. package/dist/{start-playground-B40O4tye.js → playground-DlE5RNfE.js} +14 -8
  42. package/dist/playground-DlE5RNfE.js.map +1 -0
  43. package/dist/{posthog-7B92c2Ed.js → posthog-DWL8uOcl.js} +1 -1
  44. package/dist/{posthog-7B92c2Ed.js.map → posthog-DWL8uOcl.js.map} +1 -1
  45. package/dist/{posthog-integration-CukaeYil.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-C_ETLiZE.js → provisioning-D_hAuxUN.js} +3 -3
  49. package/dist/{provisioning-C_ETLiZE.js.map → provisioning-D_hAuxUN.js.map} +1 -1
  50. package/dist/{registry-DqbwO5EL.js → registry-DKgYqROt.js} +5 -5
  51. package/dist/{registry-DqbwO5EL.js.map → registry-DKgYqROt.js.map} +1 -1
  52. package/dist/setup-utils-BHZEdkNZ.js +2 -0
  53. package/dist/{setup-utils-DdAdxUTV.js → setup-utils-D-uTycLX.js} +8 -144
  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-Dpj4j0w_.js → slides-CL1mv_Kq.js} +154 -50
  58. package/dist/slides-CL1mv_Kq.js.map +1 -0
  59. package/dist/{start-tui-CH_ZzQXx.js → start-tui-DXrv6cof.js} +419 -29
  60. package/dist/start-tui-DXrv6cof.js.map +1 -0
  61. package/dist/{steps-0d9XqvI6.js → steps-CgScwqso.js} +6 -6
  62. package/dist/{steps-0d9XqvI6.js.map → steps-CgScwqso.js.map} +1 -1
  63. package/dist/{task-stream-CoEsidgG.js → task-stream-CF6QMVMv.js} +3 -3
  64. package/dist/{task-stream-CoEsidgG.js.map → task-stream-CF6QMVMv.js.map} +1 -1
  65. package/dist/{telemetry-jn2Daxl2.js → telemetry-v6O12Bep.js} +2 -2
  66. package/dist/{telemetry-jn2Daxl2.js.map → telemetry-v6O12Bep.js.map} +1 -1
  67. package/dist/{wizard-abort-BlYGA1Jk.js → wizard-abort-BGoBKgvC.js} +1 -1
  68. package/dist/{wizard-abort-BjLIgu2s.js → wizard-abort-iTaJ8wC8.js} +3 -3
  69. package/dist/{wizard-abort-BjLIgu2s.js.map → wizard-abort-iTaJ8wC8.js.map} +1 -1
  70. package/dist/{wizard-session-DPGTaJ4W.js → wizard-session-7tMjgOvP.js} +1 -1
  71. package/dist/{wizard-session-Bi95IYca.js → wizard-session-gsn8Z3bZ.js} +2 -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/agent-interface-pBnqJL8P.js.map +0 -1
  76. package/dist/analytics-DqeW7XYt.js +0 -2
  77. package/dist/debug-C4jRuzny.js.map +0 -1
  78. package/dist/detection-4eukp9HD.js +0 -206
  79. package/dist/detection-4eukp9HD.js.map +0 -1
  80. package/dist/package-json-Cttzi3C8.js +0 -2
  81. package/dist/posthog-integration-CukaeYil.js.map +0 -1
  82. package/dist/provisioning-Ch6i8dRV.js +0 -2
  83. package/dist/setup-utils-C5uZ9g60.js +0 -2
  84. package/dist/setup-utils-DdAdxUTV.js.map +0 -1
  85. package/dist/slides-Dpj4j0w_.js.map +0 -1
  86. package/dist/start-playground-B40O4tye.js.map +0 -1
  87. package/dist/start-tui-CH_ZzQXx.js.map +0 -1
  88. package/dist/wizard-session-Bi95IYca.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-C4jRuzny.js";
2
- import { n as analytics } from "./analytics-DZaUgJte.js";
3
- import { d as extractOAuthCode, l as ApiError, m as getUiHostFromHost, r as getOrAskForProjectData } from "./setup-utils-DdAdxUTV.js";
4
- import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-Bi95IYca.js";
5
- import { r as wizardAbort } from "./wizard-abort-BjLIgu2s.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-pBnqJL8P.js";
7
- import { o as Colors, s as Icons } from "./TextBlock-DJVhBkr3.js";
8
- import { t as EVENT_PLAN_FILE } from "./posthog-integration-CukaeYil.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-GbLPuHxj.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-9jQjc-CO.js";
12
- import { C as PickerMenu, D as SplitView, E as LoadingBox, S as useStdoutDimensions, T as ProgressList, _ as EventPlanViewer, b as ConfirmationInput, c as SEVERITY_LABEL, d as TipsCard, f as LearnCard, g as ScreenContainer, h as TabContainer, i as McpSuggestedPromptsScreen, k as WizardStore, l as SEVERITY_ORDER, m as HNViewer, n as AUDIT_AREA_SLIDES, o as McpScreen, r as AuditChecksViewer, s as IssueTable, t as AUDIT_3000_AREA_SLIDES, u as ServiceHealthList, v as LogViewer, w as useKeyBindings, y as ModalOverlay } from "./slides-Dpj4j0w_.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
  });
@@ -152,6 +152,17 @@ var InkUI = class {
152
152
  setDashboardUrl(url) {
153
153
  this.store.setDashboardUrl(url);
154
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
+ }
155
166
  setFrameworkContext(key, value) {
156
167
  this.store.setFrameworkContext(key, value);
157
168
  }
@@ -1031,7 +1042,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1031
1042
  })),
1032
1043
  onSelect: (value) => {
1033
1044
  const integration = Array.isArray(value) ? value[0] : value;
1034
- import("./registry-DqbwO5EL.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1045
+ import("./registry-DKgYqROt.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1035
1046
  const config = FRAMEWORK_REGISTRY[integration];
1036
1047
  store.setFrameworkConfig(integration, config);
1037
1048
  store.setDetectedFramework(config.metadata.name);
@@ -2241,18 +2252,28 @@ const openLink$1 = (url) => {
2241
2252
  stdio: "ignore"
2242
2253
  }).unref();
2243
2254
  };
2244
- const AuditAreaPane = ({ checks, reportPath }) => {
2255
+ const AuditAreaPane = ({ checks, reportPath, slides = AUDIT_AREA_SLIDES, dashboardUrl, notebookUrl }) => {
2245
2256
  const activeArea = checks.filter((c) => c.status === "pending")[0]?.area;
2246
- 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;
2247
2258
  useInput((input) => {
2248
2259
  if (input.toLowerCase() === "o" && slide?.docsUrl) openLink$1(slide.docsUrl);
2249
2260
  });
2250
- if (slide) return /* @__PURE__ */ jsx(ActiveSlide$1, {
2251
- slide,
2252
- 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]
2253
2271
  });
2254
2272
  if (checks.length === 0) return null;
2255
- return /* @__PURE__ */ jsx(WritingReport$1, { reportPath });
2273
+ return /* @__PURE__ */ jsxs(Box, {
2274
+ flexDirection: "column",
2275
+ children: [/* @__PURE__ */ jsx(WritingReport$1, { reportPath }), urlsFooter]
2276
+ });
2256
2277
  };
2257
2278
  const ActiveSlide$1 = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2258
2279
  flexDirection: "column",
@@ -2290,6 +2311,25 @@ const ActiveSlide$1 = ({ slide, hasFindings }) => /* @__PURE__ */ jsxs(Box, {
2290
2311
  })
2291
2312
  ]
2292
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
+ });
2293
2333
  const WritingReport$1 = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2294
2334
  flexDirection: "column",
2295
2335
  paddingX: 1,
@@ -2318,6 +2358,327 @@ const WritingReport$1 = ({ reportPath }) => /* @__PURE__ */ jsxs(Box, {
2318
2358
  ]
2319
2359
  });
2320
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
2321
2682
  //#region src/ui/tui/screens/audit/PendingChecksList.tsx
2322
2683
  function groupByArea$1(checks) {
2323
2684
  const order = [];
@@ -2438,6 +2799,13 @@ const AuditRunScreen = ({ store }) => {
2438
2799
  const checks = getAuditChecks(store.session);
2439
2800
  const reportPath = `./${getProgramConfig(store.router.activeProgram).reportFile ?? "posthog-audit-report.md"}`;
2440
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
+ });
2441
2809
  return /* @__PURE__ */ jsx(TabContainer, {
2442
2810
  tabs: [
2443
2811
  {
@@ -2448,10 +2816,7 @@ const AuditRunScreen = ({ store }) => {
2448
2816
  flexGrow: 1,
2449
2817
  children: pendingChecksList
2450
2818
  }) : /* @__PURE__ */ jsx(SplitView, {
2451
- left: /* @__PURE__ */ jsx(AuditAreaPane, {
2452
- checks,
2453
- reportPath
2454
- }),
2819
+ left: areaPane,
2455
2820
  right: pendingChecksList
2456
2821
  })
2457
2822
  },
@@ -2551,7 +2916,7 @@ const AuditChecksOutroSection = ({ checks, installDir }) => {
2551
2916
  children: [
2552
2917
  "… and ",
2553
2918
  hidden,
2554
- " more see the report."
2919
+ " more. See the report for details."
2555
2920
  ]
2556
2921
  })] })
2557
2922
  ]
@@ -2591,6 +2956,20 @@ const AuditOutroScreen = ({ store }) => {
2591
2956
  bold: true,
2592
2957
  children: ["✔ ", outroData.message || "Audit complete!"]
2593
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
+ }),
2594
2973
  outroData.reportFile && /* @__PURE__ */ jsxs(Box, {
2595
2974
  flexDirection: "column",
2596
2975
  marginTop: 1,
@@ -2603,7 +2982,7 @@ const AuditOutroScreen = ({ store }) => {
2603
2982
  /* @__PURE__ */ jsx(Text, { children: join(store.session.installDir, outroData.reportFile) }),
2604
2983
  /* @__PURE__ */ jsx(Text, {
2605
2984
  dimColor: true,
2606
- 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."
2607
2986
  })
2608
2987
  ]
2609
2988
  }),
@@ -4122,6 +4501,17 @@ const OutroScreen = ({ store }) => {
4122
4501
  })
4123
4502
  ] })
4124
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
+ }),
4125
4515
  outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
4126
4516
  marginTop: 1,
4127
4517
  children: /* @__PURE__ */ jsxs(Text, { children: ["Learn more: ", /* @__PURE__ */ jsx(Text, {
@@ -4514,7 +4904,7 @@ function createMcpSuggestedPromptsServices(_store) {
4514
4904
  };
4515
4905
  }
4516
4906
  async function* runProductionPromptStreaming(args) {
4517
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DKiaymMt.js");
4907
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-clGsVw8q.js");
4518
4908
  yield* runMcpPromptViaSdk(args);
4519
4909
  }
4520
4910
  //#endregion
@@ -4636,4 +5026,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
4636
5026
  //#endregion
4637
5027
  export { startTUI };
4638
5028
 
4639
- //# sourceMappingURL=start-tui-CH_ZzQXx.js.map
5029
+ //# sourceMappingURL=start-tui-DXrv6cof.js.map