@posthog/wizard 2.10.3 → 2.11.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 (81) hide show
  1. package/dist/{McpScreen-23GY1pWz.js → McpScreen-DvUncZBi.js} +153 -23
  2. package/dist/McpScreen-DvUncZBi.js.map +1 -0
  3. package/dist/{add-mcp-server-to-clients-B6baHy_h.js → add-mcp-server-to-clients-Br1hDRiB.js} +157 -125
  4. package/dist/add-mcp-server-to-clients-Br1hDRiB.js.map +1 -0
  5. package/dist/{agent-runner-CBPBefLt.js → agent-runner-fWYFO4H0.js} +11 -9
  6. package/dist/agent-runner-fWYFO4H0.js.map +1 -0
  7. package/dist/{agent-skill-BVjJqol6.js → agent-skill-DJOzDaQV.js} +1 -1
  8. package/dist/{agent-skill-BVjJqol6.js.map → agent-skill-DJOzDaQV.js.map} +1 -1
  9. package/dist/analytics-CfAUlt6-.js +2 -0
  10. package/dist/{analytics-xANpxdVL.js → analytics-D3rY3TaN.js} +7 -4
  11. package/dist/analytics-D3rY3TaN.js.map +1 -0
  12. package/dist/bin.js +234 -41
  13. package/dist/bin.js.map +1 -1
  14. package/dist/{debug-CIyf0ZGx.js → debug-D-0xueVl.js} +1 -1
  15. package/dist/{debug-CyJ_3dTP.js → debug-gWEjmYVV.js} +4 -2
  16. package/dist/{debug-CyJ_3dTP.js.map → debug-gWEjmYVV.js.map} +1 -1
  17. package/dist/{defaults-DoVkE0gW.js → defaults-CPH6eWhN.js} +8 -8
  18. package/dist/defaults-CPH6eWhN.js.map +1 -0
  19. package/dist/{detection-Drfq0l8n.js → detection-B7GNzve-.js} +103 -19
  20. package/dist/detection-B7GNzve-.js.map +1 -0
  21. package/dist/{env-api-key-K8TdTDII.js → env-api-key-DU8uIEvo.js} +1 -1
  22. package/dist/{env-api-key-K8TdTDII.js.map → env-api-key-DU8uIEvo.js.map} +1 -1
  23. package/dist/file-DhSBlq-x.js +16 -0
  24. package/dist/file-DhSBlq-x.js.map +1 -0
  25. package/dist/{file-utils-BWneZy6p.js → file-utils-Dy9JncCo.js} +1 -1
  26. package/dist/{file-utils-BWneZy6p.js.map → file-utils-Dy9JncCo.js.map} +1 -1
  27. package/dist/package-json-BzVey4Bd.js +2 -0
  28. package/dist/{package-json-Ctq6LSl8.js → package-json-F_7oktsp.js} +1 -1
  29. package/dist/{package-json-Ctq6LSl8.js.map → package-json-F_7oktsp.js.map} +1 -1
  30. package/dist/{package-manager-Ls_8r9Ot.js → package-manager-D3Lo6nXf.js} +2 -2
  31. package/dist/{package-manager-Ls_8r9Ot.js.map → package-manager-D3Lo6nXf.js.map} +1 -1
  32. package/dist/paths-BL-x2rFy.js +16 -0
  33. package/dist/paths-BL-x2rFy.js.map +1 -0
  34. package/dist/posthog-ByrpqEjN.js +11 -0
  35. package/dist/posthog-ByrpqEjN.js.map +1 -0
  36. package/dist/{posthog-integration-DUZpiyxg.js → posthog-integration-D4SRhJIQ.js} +10 -9
  37. package/dist/posthog-integration-D4SRhJIQ.js.map +1 -0
  38. package/dist/{readiness-BAgN8xAg.js → readiness-gQvQNCeL.js} +10 -10
  39. package/dist/readiness-gQvQNCeL.js.map +1 -0
  40. package/dist/{registry-qfhSxTjo.js → registry-DaPKstG3.js} +6 -6
  41. package/dist/{registry-qfhSxTjo.js.map → registry-DaPKstG3.js.map} +1 -1
  42. package/dist/{router-D5A1Sb4p.js → router-SgzmfLGi.js} +11 -18
  43. package/dist/router-SgzmfLGi.js.map +1 -0
  44. package/dist/setup-utils-_ONxN-TT.js +2 -0
  45. package/dist/{setup-utils-C1h1QDiG.js → setup-utils-y4s-3uKT.js} +13 -7
  46. package/dist/setup-utils-y4s-3uKT.js.map +1 -0
  47. package/dist/{start-playground-xOLMYzst.js → start-playground-g1TxpCZ5.js} +84 -7
  48. package/dist/start-playground-g1TxpCZ5.js.map +1 -0
  49. package/dist/{start-tui-Ddo4TI9T.js → start-tui-CQef69NR.js} +305 -23
  50. package/dist/start-tui-CQef69NR.js.map +1 -0
  51. package/dist/{steps-BjvFG--8.js → steps-D1zKDqAo.js} +6 -6
  52. package/dist/{steps-BjvFG--8.js.map → steps-D1zKDqAo.js.map} +1 -1
  53. package/dist/task-stream-DX_jKDQu.js +61 -0
  54. package/dist/task-stream-DX_jKDQu.js.map +1 -0
  55. package/dist/{telemetry-CC6zPKJg.js → telemetry-CyUUSAYy.js} +2 -2
  56. package/dist/{telemetry-CC6zPKJg.js.map → telemetry-CyUUSAYy.js.map} +1 -1
  57. package/dist/{wizard-abort-XhapT0Ly.js → wizard-abort-Buodno3f.js} +3 -3
  58. package/dist/{wizard-abort-XhapT0Ly.js.map → wizard-abort-Buodno3f.js.map} +1 -1
  59. package/dist/{wizard-abort-Bc3lWNLb.js → wizard-abort-DZmO_sIZ.js} +1 -1
  60. package/dist/wizard-session-COhklXAF.js +2 -0
  61. package/dist/{wizard-session-Db6R023m.js → wizard-session-D5bggSsu.js} +1 -1
  62. package/dist/{wizard-session-Db6R023m.js.map → wizard-session-D5bggSsu.js.map} +1 -1
  63. package/dist/wizard-ui-BExOjdjA.js +14 -0
  64. package/dist/wizard-ui-BExOjdjA.js.map +1 -0
  65. package/npm-shrinkwrap.json +2 -2
  66. package/package.json +1 -1
  67. package/dist/McpScreen-23GY1pWz.js.map +0 -1
  68. package/dist/add-mcp-server-to-clients-B6baHy_h.js.map +0 -1
  69. package/dist/agent-runner-CBPBefLt.js.map +0 -1
  70. package/dist/analytics-DdTDVjqs.js +0 -2
  71. package/dist/analytics-xANpxdVL.js.map +0 -1
  72. package/dist/defaults-DoVkE0gW.js.map +0 -1
  73. package/dist/detection-Drfq0l8n.js.map +0 -1
  74. package/dist/package-json-BQgl5C3Z.js +0 -2
  75. package/dist/posthog-integration-DUZpiyxg.js.map +0 -1
  76. package/dist/readiness-BAgN8xAg.js.map +0 -1
  77. package/dist/router-D5A1Sb4p.js.map +0 -1
  78. package/dist/setup-utils-C1h1QDiG.js.map +0 -1
  79. package/dist/start-playground-xOLMYzst.js.map +0 -1
  80. package/dist/start-tui-Ddo4TI9T.js.map +0 -1
  81. package/dist/wizard-session-y7nf6aKH.js +0 -2
@@ -1,13 +1,16 @@
1
- import { l as setUI, s as logToFile } from "./debug-CyJ_3dTP.js";
2
- import { i as CONTEXT_MILL_URL, l as Integration, u as OAUTH_PORTS, v as REMOTE_SKILLS_BASE_URL, w as getSkillsBaseUrl } from "./analytics-xANpxdVL.js";
3
- import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-Db6R023m.js";
4
- import { r as wizardAbort } from "./wizard-abort-XhapT0Ly.js";
5
- import { m as fetchSkillMenu, p as downloadSkill, r as getBlockingServiceKeys } from "./readiness-BAgN8xAg.js";
6
- import { n as POSTHOG_SDKS, r as STRIPE_SDKS } from "./bin.js";
7
- import { t as ALL_FEATURE_VALUES } from "./defaults-DoVkE0gW.js";
8
- import { a as getSupportedClients, i as getInstalledClients, o as removeMCPServer } from "./add-mcp-server-to-clients-B6baHy_h.js";
9
- import "./router-D5A1Sb4p.js";
10
- import { _ as SplitView, a as HNViewer, b as Icons, c as EventPlanViewer, d as ConfirmationInput, g as LoadingBox, h as ProgressList, i as LearnCard, l as LogViewer, m as PickerMenu, n as ServiceHealthList, o as TabContainer, p as useStdoutDimensions, r as TipsCard, s as ScreenContainer, t as McpScreen, u as ModalOverlay, x as WizardStore, y as Colors } from "./McpScreen-23GY1pWz.js";
1
+ import { l as setUI, s as logToFile } from "./debug-gWEjmYVV.js";
2
+ import { E as getSkillsBaseUrl, S as WIZARD_TOOLS_MENU_FLAG_KEY, i as CONTEXT_MILL_URL, l as Integration, n as analytics, p as POSTHOG_DOCS_URL, u as OAUTH_PORTS, y as REMOTE_SKILLS_BASE_URL } from "./analytics-D3rY3TaN.js";
3
+ import { n as WIZARD_LOG_FILE } from "./paths-BL-x2rFy.js";
4
+ import { l as ApiError, p as getUiHostFromHost } from "./setup-utils-y4s-3uKT.js";
5
+ import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-D5bggSsu.js";
6
+ import { r as wizardAbort } from "./wizard-abort-Buodno3f.js";
7
+ import { m as fetchSkillMenu, p as downloadSkill, r as getBlockingServiceKeys } from "./readiness-gQvQNCeL.js";
8
+ import { a as STRIPE_SDKS, i as POSTHOG_SDKS, r as fetchHealthIssues } from "./bin.js";
9
+ import { t as ALL_FEATURE_VALUES } from "./defaults-CPH6eWhN.js";
10
+ 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-Br1hDRiB.js";
11
+ import "./router-SgzmfLGi.js";
12
+ import { C as Icons, S as Colors, _ as PickerMenu, a as ServiceHealthList, b as SplitView, c as HNViewer, d as EventPlanViewer, f as LogViewer, g as useStdoutDimensions, i as SEVERITY_ORDER, l as TabContainer, m as ConfirmationInput, n as IssueTable, o as TipsCard, p as ModalOverlay, r as SEVERITY_LABEL, s as LearnCard, t as McpScreen, u as ScreenContainer, v as ProgressList, w as WizardStore, y as LoadingBox } from "./McpScreen-DvUncZBi.js";
13
+ import { spawnSync } from "node:child_process";
11
14
  import { join } from "node:path";
12
15
  import path from "path";
13
16
  import { Box, Text, render, useInput } from "ink";
@@ -259,6 +262,225 @@ const HealthCheckScreen = ({ store }) => {
259
262
  });
260
263
  };
261
264
  //#endregion
265
+ //#region src/ui/tui/screens/doctor/DoctorIntroScreen.tsx
266
+ const DoctorIntroScreen = ({ store }) => {
267
+ useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
268
+ return /* @__PURE__ */ jsxs(Box, {
269
+ flexDirection: "column",
270
+ children: [
271
+ /* @__PURE__ */ jsxs(Box, {
272
+ flexDirection: "column",
273
+ marginBottom: 1,
274
+ children: [/* @__PURE__ */ jsx(Text, {
275
+ bold: true,
276
+ color: Colors.accent,
277
+ children: "PostHog Doctor"
278
+ }), /* @__PURE__ */ jsx(Text, {
279
+ dimColor: true,
280
+ children: "Scan your project configuration for issues that may need attention."
281
+ })]
282
+ }),
283
+ /* @__PURE__ */ jsxs(Box, {
284
+ flexDirection: "column",
285
+ marginBottom: 1,
286
+ children: [/* @__PURE__ */ jsx(Text, { children: "The wizard will:" }), /* @__PURE__ */ jsxs(Box, {
287
+ paddingLeft: 2,
288
+ flexDirection: "column",
289
+ children: [
290
+ /* @__PURE__ */ jsxs(Text, { children: [Icons.bullet, " Sign you in to PostHog"] }),
291
+ /* @__PURE__ */ jsxs(Text, { children: [Icons.bullet, " Fetch active health issues for your project"] }),
292
+ /* @__PURE__ */ jsxs(Text, { children: [Icons.bullet, " Show you what needs to be resolved, with docs links"] })
293
+ ]
294
+ })]
295
+ }),
296
+ /* @__PURE__ */ jsx(PickerMenu, {
297
+ options: [{
298
+ label: "Continue",
299
+ value: "continue"
300
+ }, {
301
+ label: "Cancel",
302
+ value: "cancel"
303
+ }],
304
+ onSelect: (value) => {
305
+ if (value === "cancel") process.exit(0);
306
+ else store.completeSetup();
307
+ }
308
+ })
309
+ ]
310
+ });
311
+ };
312
+ //#endregion
313
+ //#region src/ui/tui/screens/doctor/DoctorReportScreen.tsx
314
+ const DoctorReportScreen = ({ store }) => {
315
+ useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
316
+ const { credentials } = store.session;
317
+ const accessToken = credentials?.accessToken;
318
+ const host = credentials?.host;
319
+ const projectId = credentials?.projectId;
320
+ const [state, setState] = useState({ kind: "loading" });
321
+ useEffect(() => {
322
+ if (!accessToken || !host || projectId == null) return;
323
+ let cancelled = false;
324
+ (async () => {
325
+ try {
326
+ const issues = await fetchHealthIssues(accessToken, host, projectId);
327
+ if (!cancelled) setState({
328
+ kind: "ready",
329
+ issues
330
+ });
331
+ } catch (err) {
332
+ if (!cancelled) setState({
333
+ kind: "error",
334
+ message: err instanceof ApiError && err.statusCode === 401 ? "Your PostHog session has expired. Re-run the wizard to sign in again." : err instanceof Error ? err.message : String(err)
335
+ });
336
+ }
337
+ })();
338
+ return () => {
339
+ cancelled = true;
340
+ };
341
+ }, [
342
+ accessToken,
343
+ host,
344
+ projectId
345
+ ]);
346
+ if (!credentials) return /* @__PURE__ */ jsx(LoadingBox, { message: "Waiting for authentication..." });
347
+ if (state.kind === "loading") return /* @__PURE__ */ jsxs(Box, {
348
+ flexDirection: "column",
349
+ children: [/* @__PURE__ */ jsx(Header, {
350
+ host: credentials.host,
351
+ projectId: credentials.projectId
352
+ }), /* @__PURE__ */ jsx(LoadingBox, { message: "Fetching health issues..." })]
353
+ });
354
+ const healthUrl = `${getUiHostFromHost(credentials.host)}/project/${credentials.projectId}/health`;
355
+ if (state.kind === "error") return /* @__PURE__ */ jsxs(Box, {
356
+ flexDirection: "column",
357
+ children: [
358
+ /* @__PURE__ */ jsx(Header, {
359
+ host: credentials.host,
360
+ projectId: credentials.projectId
361
+ }),
362
+ /* @__PURE__ */ jsxs(Box, {
363
+ flexDirection: "column",
364
+ marginY: 1,
365
+ children: [/* @__PURE__ */ jsxs(Text, {
366
+ color: Colors.error,
367
+ bold: true,
368
+ children: [Icons.squareFilled, " Failed to fetch health issues"]
369
+ }), /* @__PURE__ */ jsx(Text, {
370
+ dimColor: true,
371
+ children: state.message
372
+ })]
373
+ }),
374
+ /* @__PURE__ */ jsx(PickerMenu, {
375
+ options: [{
376
+ label: "Continue",
377
+ value: "continue"
378
+ }],
379
+ onSelect: () => {
380
+ store.setOutroData({
381
+ kind: "error",
382
+ message: "Failed to fetch health issues",
383
+ body: state.message,
384
+ docsUrl: POSTHOG_DOCS_URL
385
+ });
386
+ }
387
+ })
388
+ ]
389
+ });
390
+ const { issues } = state;
391
+ if (issues.length === 0) return /* @__PURE__ */ jsxs(Box, {
392
+ flexDirection: "column",
393
+ children: [
394
+ /* @__PURE__ */ jsx(Header, {
395
+ host: credentials.host,
396
+ projectId: credentials.projectId
397
+ }),
398
+ /* @__PURE__ */ jsx(Box, {
399
+ marginY: 1,
400
+ children: /* @__PURE__ */ jsxs(Text, {
401
+ color: Colors.success,
402
+ bold: true,
403
+ children: [Icons.check, " No active issues — you're all set!"]
404
+ })
405
+ }),
406
+ /* @__PURE__ */ jsx(PickerMenu, {
407
+ options: [{
408
+ label: "Continue",
409
+ value: "continue"
410
+ }],
411
+ onSelect: () => {
412
+ store.setOutroData({
413
+ kind: "success",
414
+ message: "No active issues — your project looks healthy.",
415
+ docsUrl: POSTHOG_DOCS_URL,
416
+ continueUrl: healthUrl
417
+ });
418
+ }
419
+ })
420
+ ]
421
+ });
422
+ return /* @__PURE__ */ jsxs(Box, {
423
+ flexDirection: "column",
424
+ children: [
425
+ /* @__PURE__ */ jsx(Header, {
426
+ host: credentials.host,
427
+ projectId: credentials.projectId
428
+ }),
429
+ /* @__PURE__ */ jsx(Box, {
430
+ marginTop: 1,
431
+ children: /* @__PURE__ */ jsx(Text, { children: formatSummaryLine(issues) })
432
+ }),
433
+ /* @__PURE__ */ jsx(Box, {
434
+ flexDirection: "column",
435
+ marginBottom: 1,
436
+ children: /* @__PURE__ */ jsx(IssueTable, { issues })
437
+ }),
438
+ /* @__PURE__ */ jsx(PickerMenu, {
439
+ options: [{
440
+ label: "Continue",
441
+ value: "continue"
442
+ }],
443
+ onSelect: () => {
444
+ store.setOutroData({
445
+ kind: "success",
446
+ message: `Found ${issues.length} active issue${issues.length === 1 ? "" : "s"}.`,
447
+ body: "Open the dashboard in PostHog to dismiss or resolve issues.",
448
+ docsUrl: POSTHOG_DOCS_URL,
449
+ continueUrl: healthUrl
450
+ });
451
+ }
452
+ })
453
+ ]
454
+ });
455
+ };
456
+ const Header = ({ host, projectId }) => /* @__PURE__ */ jsxs(Box, {
457
+ flexDirection: "column",
458
+ children: [/* @__PURE__ */ jsx(Text, {
459
+ bold: true,
460
+ color: Colors.accent,
461
+ children: "PostHog Doctor Report"
462
+ }), /* @__PURE__ */ jsxs(Text, {
463
+ dimColor: true,
464
+ children: [
465
+ "Project ",
466
+ projectId,
467
+ " ",
468
+ Icons.bullet,
469
+ " ",
470
+ host
471
+ ]
472
+ })]
473
+ });
474
+ function formatSummaryLine(issues) {
475
+ const parts = [];
476
+ for (const sev of SEVERITY_ORDER) {
477
+ const n = issues.filter((i) => i.severity === sev).length;
478
+ if (n > 0) parts.push(`${n} ${SEVERITY_LABEL[sev].toLowerCase()}`);
479
+ }
480
+ const suffix = parts.length > 0 ? `: ${parts.join(", ")}` : "";
481
+ return `${issues.length} active issue${issues.length === 1 ? "" : "s"}${suffix}`;
482
+ }
483
+ //#endregion
262
484
  //#region src/ui/tui/screens/SettingsOverrideScreen.tsx
263
485
  function sourcePath(source) {
264
486
  switch (source) {
@@ -578,6 +800,19 @@ const IntroScreenLayout = ({ installDir, title = "PostHog Wizard 🦔", showSubt
578
800
  * 3. Unsupported version: upgrade prompt
579
801
  * 4. Detection succeeded: continue/change-framework/cancel
580
802
  */
803
+ const TOOLS = [{
804
+ label: "Troubleshoot Integration",
805
+ command: "doctor"
806
+ }];
807
+ function launchTool(command, installDir) {
808
+ releaseTerminal();
809
+ const result = spawnSync(process.execPath, [
810
+ process.argv[1],
811
+ command,
812
+ `--install-dir=${installDir}`
813
+ ], { stdio: "inherit" });
814
+ process.exit(result.status ?? 0);
815
+ }
581
816
  /** Framework picker shown when auto-detection fails. */
582
817
  const FrameworkPicker = ({ store, onComplete }) => {
583
818
  return /* @__PURE__ */ jsx(PickerMenu, {
@@ -590,7 +825,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
590
825
  })),
591
826
  onSelect: (value) => {
592
827
  const integration = Array.isArray(value) ? value[0] : value;
593
- import("./registry-qfhSxTjo.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
828
+ import("./registry-DaPKstG3.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
594
829
  const config = FRAMEWORK_REGISTRY[integration];
595
830
  store.setFrameworkConfig(integration, config);
596
831
  store.setDetectedFramework(config.metadata.name);
@@ -603,14 +838,25 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
603
838
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
604
839
  const [pickingFramework, setPickingFramework] = useState(false);
605
840
  const [manuallySelected, setManuallySelected] = useState(false);
606
- const [showingMoreInfo, setShowingMoreInfo] = useState(false);
841
+ const [view, setView] = useState("default");
842
+ const [toolsEnabled, setToolsEnabled] = useState(false);
843
+ useEffect(() => {
844
+ let cancelled = false;
845
+ analytics.getAllFlagsForWizard().then((flags) => {
846
+ const value = flags[WIZARD_TOOLS_MENU_FLAG_KEY];
847
+ if (!cancelled && value && value !== "false") setToolsEnabled(true);
848
+ });
849
+ return () => {
850
+ cancelled = true;
851
+ };
852
+ }, []);
607
853
  const { session } = store;
608
854
  const config = session.frameworkConfig;
609
855
  const frameworkLabel = session.detectedFrameworkLabel ?? config?.metadata.name;
610
856
  const detecting = !session.detectionComplete;
611
857
  const needsFrameworkPick = session.detectionComplete && !session.frameworkConfig;
612
858
  const unsupported = session.unsupportedVersion;
613
- const showContinue = session.frameworkConfig !== null && !detecting && !pickingFramework && !showingMoreInfo && !unsupported;
859
+ const showContinue = session.frameworkConfig !== null && !detecting && !pickingFramework && view === "default" && !unsupported;
614
860
  const title = detecting ? "PostHog Wizard starting up" : "PostHog Wizard 🦔";
615
861
  let body = null;
616
862
  if (detecting) body = /* @__PURE__ */ jsx(Box, {
@@ -631,9 +877,10 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
631
877
  store,
632
878
  onComplete: () => setPickingFramework(false)
633
879
  });
634
- else if (showingMoreInfo) body = /* @__PURE__ */ jsxs(Box, {
880
+ else if (view === "more-info") body = /* @__PURE__ */ jsxs(Box, {
635
881
  flexDirection: "column",
636
882
  width: 56,
883
+ flexShrink: 0,
637
884
  children: [
638
885
  /* @__PURE__ */ jsxs(Text, { children: ["The wizard is an agent that executes PostHog tasks. Its code is open source: ", /* @__PURE__ */ jsx(Text, {
639
886
  color: "cyan",
@@ -739,7 +986,14 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
739
986
  ]
740
987
  });
741
988
  let menuOptions = null;
742
- if (showingMoreInfo) menuOptions = [{
989
+ if (view === "tools") menuOptions = [...TOOLS.map((t) => ({
990
+ label: t.label,
991
+ value: t.command
992
+ })), {
993
+ label: "Back",
994
+ value: "back"
995
+ }];
996
+ else if (view === "more-info") menuOptions = [{
743
997
  label: "Back",
744
998
  value: "back"
745
999
  }];
@@ -752,6 +1006,10 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
752
1006
  label: "Change framework",
753
1007
  value: "framework"
754
1008
  },
1009
+ ...toolsEnabled ? [{
1010
+ label: "Tools",
1011
+ value: "tools"
1012
+ }] : [],
755
1013
  {
756
1014
  label: "More info",
757
1015
  value: "more-info"
@@ -762,18 +1020,24 @@ const PostHogIntegrationIntroScreen = ({ store }) => {
762
1020
  }
763
1021
  ];
764
1022
  const handleSelect = (value) => {
1023
+ if (view === "tools") {
1024
+ if (value === "back") setView("default");
1025
+ else launchTool(value, session.installDir);
1026
+ return;
1027
+ }
765
1028
  if (value === "cancel") process.exit(0);
766
1029
  else if (value === "framework") {
767
1030
  setPickingFramework(true);
768
1031
  setManuallySelected(true);
769
- } else if (value === "more-info") setShowingMoreInfo(true);
770
- else if (value === "back") setShowingMoreInfo(false);
1032
+ } else if (value === "more-info") setView("more-info");
1033
+ else if (value === "tools") setView("tools");
1034
+ else if (value === "back") setView("default");
771
1035
  else store.completeSetup();
772
1036
  };
773
1037
  return /* @__PURE__ */ jsx(IntroScreenLayout, {
774
1038
  installDir: session.installDir,
775
1039
  title,
776
- showSubtitle: !showingMoreInfo,
1040
+ showSubtitle: view === "default",
777
1041
  body,
778
1042
  showDetection: showContinue,
779
1043
  detectionRows,
@@ -816,6 +1080,7 @@ const RevenueIntroScreen = ({ store }) => {
816
1080
  const body = showingMoreInfo ? /* @__PURE__ */ jsxs(Box, {
817
1081
  flexDirection: "column",
818
1082
  width: 56,
1083
+ flexShrink: 0,
819
1084
  children: [
820
1085
  /* @__PURE__ */ jsxs(Text, { children: [
821
1086
  "The wizard is an agent that executes PostHog tasks. Its code is open source: ",
@@ -1094,6 +1359,7 @@ const AgentSkillIntroScreen = ({ store }) => {
1094
1359
  if (showingMoreInfo) body = /* @__PURE__ */ jsxs(Box, {
1095
1360
  flexDirection: "column",
1096
1361
  width: 56,
1362
+ flexShrink: 0,
1097
1363
  children: [
1098
1364
  /* @__PURE__ */ jsx(Box, {
1099
1365
  flexDirection: "column",
@@ -1318,7 +1584,6 @@ const AuthScreen = ({ store }) => {
1318
1584
  * No prompts — the agent runs headlessly.
1319
1585
  * LearnCard shows animated educational content and reacts to discovered features.
1320
1586
  */
1321
- const LOG_FILE = "/tmp/posthog-wizard.log";
1322
1587
  const RunScreen = ({ store }) => {
1323
1588
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
1324
1589
  const [columns] = useStdoutDimensions();
@@ -1367,7 +1632,7 @@ const RunScreen = ({ store }) => {
1367
1632
  {
1368
1633
  id: "logs",
1369
1634
  label: "Tail logs",
1370
- component: /* @__PURE__ */ jsx(LogViewer, { filePath: LOG_FILE })
1635
+ component: /* @__PURE__ */ jsx(LogViewer, { filePath: WIZARD_LOG_FILE })
1371
1636
  },
1372
1637
  {
1373
1638
  id: "hn",
@@ -1763,7 +2028,10 @@ function createMcpInstaller() {
1763
2028
  name: c.name,
1764
2029
  raw: c
1765
2030
  }));
1766
- return supported.map((c) => ({ name: c.name }));
2031
+ return supported.map((c) => ({
2032
+ name: c.name,
2033
+ supportsPlugin: isPluginCapable(c) && c.supportsPlugin()
2034
+ }));
1767
2035
  },
1768
2036
  async install(clientNames, features, apiKey) {
1769
2037
  const resolvedFeatures = features ?? [...ALL_FEATURE_VALUES];
@@ -1786,6 +2054,15 @@ function createMcpInstaller() {
1786
2054
  if (installed.length === 0) return [];
1787
2055
  await removeMCPServer(installed);
1788
2056
  return installed.map((c) => c.name);
2057
+ },
2058
+ async installPlugins(clientNames) {
2059
+ const pluginClients = getSupportedPluginClients(cachedClients.filter((c) => clientNames.includes(c.name)).map((c) => c.raw));
2060
+ const installed = await installPlugins(pluginClients);
2061
+ analytics.wizardCapture("mcp plugins installed", {
2062
+ clients: installed,
2063
+ attempted: pluginClients.map((c) => c.name)
2064
+ });
2065
+ return installed;
1789
2066
  }
1790
2067
  };
1791
2068
  }
@@ -1804,6 +2081,8 @@ function createScreens(store, services) {
1804
2081
  ["revenue-intro"]: /* @__PURE__ */ jsx(RevenueIntroScreen, { store }),
1805
2082
  ["agent-skill-intro"]: /* @__PURE__ */ jsx(AgentSkillIntroScreen, { store }),
1806
2083
  ["health-check"]: /* @__PURE__ */ jsx(HealthCheckScreen, { store }),
2084
+ ["doctor-intro"]: /* @__PURE__ */ jsx(DoctorIntroScreen, { store }),
2085
+ ["doctor-report"]: /* @__PURE__ */ jsx(DoctorReportScreen, { store }),
1807
2086
  ["setup"]: /* @__PURE__ */ jsx(SetupScreen, { store }),
1808
2087
  ["auth"]: /* @__PURE__ */ jsx(AuthScreen, { store }),
1809
2088
  ["run"]: /* @__PURE__ */ jsx(RunScreen, { store }),
@@ -1852,6 +2131,9 @@ const LEAVE_ALT_SCREEN = "\x1B[?1049l";
1852
2131
  const GREEN = "\x1B[32m";
1853
2132
  const BOLD = "\x1B[1m";
1854
2133
  const DIM = "\x1B[2m";
2134
+ function releaseTerminal() {
2135
+ process.stdout.write(RESET_ATTRS + LEAVE_ALT_SCREEN);
2136
+ }
1855
2137
  function getExitLine(store) {
1856
2138
  const outro = store.session.outroData;
1857
2139
  const label = store.session.workflowLabel ?? "Wizard";
@@ -1869,7 +2151,7 @@ function startTUI(version, flow = "posthog-integration") {
1869
2151
  if (cleaned) return;
1870
2152
  cleaned = true;
1871
2153
  inkUnmount();
1872
- process.stdout.write(RESET_ATTRS + LEAVE_ALT_SCREEN);
2154
+ releaseTerminal();
1873
2155
  process.stdout.write(getExitLine(store) + "\n");
1874
2156
  };
1875
2157
  process.on("exit", cleanup);
@@ -1882,4 +2164,4 @@ function startTUI(version, flow = "posthog-integration") {
1882
2164
  //#endregion
1883
2165
  export { startTUI };
1884
2166
 
1885
- //# sourceMappingURL=start-tui-Ddo4TI9T.js.map
2167
+ //# sourceMappingURL=start-tui-CQef69NR.js.map