@posthog/wizard 2.19.0 → 2.20.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 (67) hide show
  1. package/README.md +11 -0
  2. package/dist/{add-mcp-server-to-clients-CjnvTVj0.js → add-mcp-server-to-clients-iV7BuQpD.js} +4 -4
  3. package/dist/{add-mcp-server-to-clients-CjnvTVj0.js.map → add-mcp-server-to-clients-iV7BuQpD.js.map} +1 -1
  4. package/dist/{agent-interface-CQU6x4Hj.js → agent-interface-B-LAvrNL.js} +163 -52
  5. package/dist/agent-interface-B-LAvrNL.js.map +1 -0
  6. package/dist/{agent-runner-Cj7saDkL.js → agent-runner-w2Qu9M13.js} +10 -9
  7. package/dist/{agent-runner-Cj7saDkL.js.map → agent-runner-w2Qu9M13.js.map} +1 -1
  8. package/dist/{analytics-Df-Xb81i.js → analytics-C8lJzXjY.js} +2 -2
  9. package/dist/{analytics-Df-Xb81i.js.map → analytics-C8lJzXjY.js.map} +1 -1
  10. package/dist/{api-Dw6_orDE.js → api-eUlUinVy.js} +25 -4
  11. package/dist/{api-Dw6_orDE.js.map → api-eUlUinVy.js.map} +1 -1
  12. package/dist/bin.js +74 -47
  13. package/dist/bin.js.map +1 -1
  14. package/dist/check-screens.tsx +124 -0
  15. package/dist/{ci-install-BKAvFfK6.js → ci-install-CSo7Q1pK.js} +4 -4
  16. package/dist/{ci-install-BKAvFfK6.js.map → ci-install-CSo7Q1pK.js.map} +1 -1
  17. package/dist/{debug-DnMO6O8O.js → debug-BJu_sS4l.js} +2 -2
  18. package/dist/{debug-DnMO6O8O.js.map → debug-BJu_sS4l.js.map} +1 -1
  19. package/dist/{debug-Cp_wNn8i.js → debug-CTViFiF-.js} +1 -1
  20. package/dist/{environment-Ls0H9ljT.js → environment-Dk_dWk3t.js} +3 -3
  21. package/dist/{environment-Ls0H9ljT.js.map → environment-Dk_dWk3t.js.map} +1 -1
  22. package/dist/{interactive-D15byhpc.js → interactive-BS2rIf1v.js} +2 -2
  23. package/dist/{interactive-D15byhpc.js.map → interactive-BS2rIf1v.js.map} +1 -1
  24. package/dist/{mcp-prompt-streaming-DQOTQfW1.js → mcp-prompt-streaming-BiMrlLl0.js} +4 -4
  25. package/dist/{mcp-prompt-streaming-DQOTQfW1.js.map → mcp-prompt-streaming-BiMrlLl0.js.map} +1 -1
  26. package/dist/{non-interactive-DcFLJtl_.js → non-interactive-C39d_KIp.js} +2 -2
  27. package/dist/{non-interactive-DcFLJtl_.js.map → non-interactive-C39d_KIp.js.map} +1 -1
  28. package/dist/{package-manager-DUPgLGpQ.js → package-manager-BfOTvFt-.js} +2 -2
  29. package/dist/{package-manager-DUPgLGpQ.js.map → package-manager-BfOTvFt-.js.map} +1 -1
  30. package/dist/{playground-BZ0hGjbL.js → playground-3OeRB7JU.js} +15 -9
  31. package/dist/playground-3OeRB7JU.js.map +1 -0
  32. package/dist/{posthog-integration-C8qhJnI3.js → posthog-integration-8iTgqy2J.js} +17 -11
  33. package/dist/posthog-integration-8iTgqy2J.js.map +1 -0
  34. package/dist/{provisioning-C-2ExcqY.js → provisioning-DxaT7bWw.js} +3 -3
  35. package/dist/{provisioning-C-2ExcqY.js.map → provisioning-DxaT7bWw.js.map} +1 -1
  36. package/dist/{registry-hBUgaWFx.js → registry-apQfB3rf.js} +4 -4
  37. package/dist/{registry-hBUgaWFx.js.map → registry-apQfB3rf.js.map} +1 -1
  38. package/dist/{setup-utils-DetnhXo0.js → setup-utils-B9xqAXXl.js} +10 -9
  39. package/dist/setup-utils-B9xqAXXl.js.map +1 -0
  40. package/dist/{slides-mT2s9wM_.js → slides-BEshbXqG.js} +290 -122
  41. package/dist/slides-BEshbXqG.js.map +1 -0
  42. package/dist/{start-tui-BfXoErKg.js → start-tui-CCpKnZOY.js} +243 -56
  43. package/dist/start-tui-CCpKnZOY.js.map +1 -0
  44. package/dist/{steps-SoDXSUxe.js → steps-DKbDDnVH.js} +6 -6
  45. package/dist/{steps-SoDXSUxe.js.map → steps-DKbDDnVH.js.map} +1 -1
  46. package/dist/{task-stream-CZRj6auI.js → task-stream-CZawuzlz.js} +2 -2
  47. package/dist/{task-stream-CZRj6auI.js.map → task-stream-CZawuzlz.js.map} +1 -1
  48. package/dist/{telemetry-CPcMFxcO.js → telemetry-DUeOcmpo.js} +2 -2
  49. package/dist/{telemetry-CPcMFxcO.js.map → telemetry-DUeOcmpo.js.map} +1 -1
  50. package/dist/{urls-BO7doNJG.js → urls-B6wBIwr1.js} +2 -2
  51. package/dist/{urls-BO7doNJG.js.map → urls-B6wBIwr1.js.map} +1 -1
  52. package/dist/wizard-abort-D8XZdVAR.js +2 -0
  53. package/dist/{wizard-abort-CDXufkqJ.js → wizard-abort-DhGgTlUA.js} +12 -7
  54. package/dist/wizard-abort-DhGgTlUA.js.map +1 -0
  55. package/dist/{wizard-session-d27JGRGi.js → wizard-session-G3VWD6hv.js} +3 -1
  56. package/dist/{wizard-session-d27JGRGi.js.map → wizard-session-G3VWD6hv.js.map} +1 -1
  57. package/dist/{wizard-session-y304gEEI.js → wizard-session-wPJtNl4c.js} +1 -1
  58. package/dist/wizard-ui-YdGFRyu_.js.map +1 -1
  59. package/package.json +4 -2
  60. package/dist/agent-interface-CQU6x4Hj.js.map +0 -1
  61. package/dist/playground-BZ0hGjbL.js.map +0 -1
  62. package/dist/posthog-integration-C8qhJnI3.js.map +0 -1
  63. package/dist/setup-utils-DetnhXo0.js.map +0 -1
  64. package/dist/slides-mT2s9wM_.js.map +0 -1
  65. package/dist/start-tui-BfXoErKg.js.map +0 -1
  66. package/dist/wizard-abort-CDXufkqJ.js.map +0 -1
  67. package/dist/wizard-abort-CtMY57ZE.js +0 -2
@@ -1,20 +1,21 @@
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-DnMO6O8O.js";
2
- import { t as analytics } from "./analytics-Df-Xb81i.js";
3
- import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-DetnhXo0.js";
4
- import { a as getUiHostFromHost } from "./urls-BO7doNJG.js";
5
- import { t as ApiError } from "./api-Dw6_orDE.js";
6
- import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-d27JGRGi.js";
7
- import { r as wizardAbort } from "./wizard-abort-CDXufkqJ.js";
8
- import { b as getAuditChecks, f as downloadSkill, g as AUDIT_CHECKS_KEY, h as AUDIT_CHECKS_FILE, p as fetchSkillMenu, v as AUDIT_SEVERITY_STYLE, y as coerceAuditChecks } from "./agent-interface-CQU6x4Hj.js";
9
- import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-C8qhJnI3.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-BJu_sS4l.js";
2
+ import { t as analytics } from "./analytics-C8lJzXjY.js";
3
+ import { o as extractOAuthCode, t as getOrAskForProjectData } from "./setup-utils-B9xqAXXl.js";
4
+ import { a as getUiHostFromHost } from "./urls-B6wBIwr1.js";
5
+ import { i as fetchSlackConnected, t as ApiError } from "./api-eUlUinVy.js";
6
+ import { t as ADDITIONAL_FEATURE_LABELS } from "./wizard-session-G3VWD6hv.js";
7
+ import { i as wizardAbort } from "./wizard-abort-DhGgTlUA.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-B-LAvrNL.js";
9
+ import { f as Colors, p as Icons, t as EVENT_PLAN_FILE } from "./posthog-integration-8iTgqy2J.js";
10
10
  import { a as getProgramConfig, d as getContentBlocks, f as POSTHOG_SDKS, i as Program, o as DISPLAY_NAME, p as STRIPE_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-mT2s9wM_.js";
11
+ import { D as ProgressList, E as useKeyBindings, O as LoadingBox, S as ConfirmationInput, T as PickerMenu, _ as TabContainer, a as McpSuggestedPromptsScreen, b as LogViewer, c as McpScreen, d as SEVERITY_ORDER, f as ServiceHealthList, g as HNViewer, i as AuditChecksViewer, j as WizardStore, k as SplitView, l as IssueTable, m as LearnCard, n as AUDIT_AREA_SLIDES, p as TipsCard, r as VisualBox, s as getSlackAppCard, t as AUDIT_3000_AREA_SLIDES, u as SEVERITY_LABEL, v as ScreenContainer, w as useStdoutDimensions, x as ModalOverlay, y as EventPlanViewer } from "./slides-BEshbXqG.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-CjnvTVj0.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-iV7BuQpD.js";
14
14
  import { spawn, spawnSync } from "node:child_process";
15
15
  import { join } from "node:path";
16
16
  import * as fs$1 from "fs";
17
17
  import path from "path";
18
+ import opn from "opn";
18
19
  import { Box, Text, render, useInput } from "ink";
19
20
  import { Fragment, createElement, useEffect, useMemo, useState, useSyncExternalStore } from "react";
20
21
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -535,13 +536,6 @@ function formatSummaryLine(issues) {
535
536
  }
536
537
  //#endregion
537
538
  //#region src/ui/tui/screens/SettingsOverrideScreen.tsx
538
- function sourcePath(source) {
539
- switch (source) {
540
- case "project": return ".claude/settings.json";
541
- case "managed": return "/Library/Application Support/ClaudeCode/managed-settings.json";
542
- default: return source;
543
- }
544
- }
545
539
  const SettingsOverrideScreen = ({ store }) => {
546
540
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
547
541
  const [feedback, setFeedback] = useState(null);
@@ -565,11 +559,10 @@ const SettingsOverrideScreen = ({ store }) => {
565
559
  flexDirection: "column",
566
560
  marginBottom: 1,
567
561
  children: [/* @__PURE__ */ jsxs(Text, { children: [
568
- "Your settings file at",
569
- " ",
562
+ "Your settings file at ",
570
563
  /* @__PURE__ */ jsx(Text, {
571
564
  bold: true,
572
- children: sourcePath(conflict.source)
565
+ children: conflict.path
573
566
  }),
574
567
  " sets:"
575
568
  ] }), /* @__PURE__ */ jsx(Box, {
@@ -585,7 +578,7 @@ const SettingsOverrideScreen = ({ store }) => {
585
578
  })
586
579
  ] }, key))
587
580
  })]
588
- }, conflict.source)), /* @__PURE__ */ jsx(Text, {
581
+ }, conflict.path)), /* @__PURE__ */ jsx(Text, {
589
582
  dimColor: true,
590
583
  children: "These settings override credentials and prevent the Wizard from reaching the PostHog LLM Gateway. We can back up the file and continue."
591
584
  })]
@@ -594,16 +587,20 @@ const SettingsOverrideScreen = ({ store }) => {
594
587
  //#endregion
595
588
  //#region src/ui/tui/screens/ManagedSettingsScreen.tsx
596
589
  /**
597
- * ManagedSettingsScreen — Modal when IT/org-managed settings contain overrides
598
- * that block the Wizard from reaching the PostHog LLM Gateway.
590
+ * ManagedSettingsScreen — Modal for read-only settings conflicts that block
591
+ * the Wizard from reaching the PostHog LLM Gateway: org-managed settings, the
592
+ * user's global `~/.claude` config, and gitignored project-local overrides.
599
593
  *
600
- * Unlike SettingsOverrideScreen, the wizard cannot back up or modify these files.
601
- * The user must contact their IT administrator to resolve the conflict.
594
+ * Unlike SettingsOverrideScreen, the wizard cannot safely back up or remove
595
+ * these files for the user, so it names the exact file and key and asks the
596
+ * user to fix it and re-run. Managed (root-owned) files need an IT admin; the
597
+ * rest the user can edit themselves.
602
598
  */
603
599
  function sourceLabel(source) {
604
600
  switch (source) {
605
- case "managed": return "Managed settings (IT/org-managed)";
606
- case "project": return ".claude/settings.json";
601
+ case "managed": return "Organization-managed settings";
602
+ case "user": return "Your global Claude Code settings";
603
+ case "project-local": return "Project-local settings";
607
604
  default: return source;
608
605
  }
609
606
  }
@@ -611,12 +608,13 @@ const ManagedSettingsScreen = ({ store }) => {
611
608
  useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
612
609
  const readOnlyConflicts = store.session.settingsConflicts?.filter((c) => !c.writable);
613
610
  if (!readOnlyConflicts || readOnlyConflicts.length === 0) return null;
611
+ const hasManaged = readOnlyConflicts.some((c) => c.source === "managed");
614
612
  return /* @__PURE__ */ jsxs(ModalOverlay, {
615
613
  borderColor: "red",
616
- title: `${Icons.warning} Organization settings conflict`,
617
- width: 68,
614
+ title: `${Icons.warning} Settings conflict`,
615
+ width: 72,
618
616
  footer: /* @__PURE__ */ jsx(ConfirmationInput, {
619
- message: "Contact your IT administrator to resolve this.",
617
+ message: "Fix the file(s) above, then re-run the Wizard.",
620
618
  confirmLabel: "",
621
619
  cancelLabel: "Exit [Esc]",
622
620
  onConfirm: () => process.exit(1),
@@ -625,33 +623,40 @@ const ManagedSettingsScreen = ({ store }) => {
625
623
  children: [
626
624
  /* @__PURE__ */ jsx(Text, {
627
625
  dimColor: true,
628
- children: "Your organization's managed settings contain overrides that prevent the Wizard from reaching the PostHog LLM Gateway."
626
+ children: "These Claude Code settings override credentials and prevent the Wizard from reaching the PostHog LLM Gateway."
629
627
  }),
630
628
  readOnlyConflicts.map((conflict) => /* @__PURE__ */ jsxs(Box, {
631
629
  flexDirection: "column",
632
630
  marginTop: 1,
633
- children: [/* @__PURE__ */ jsx(Text, {
634
- bold: true,
635
- children: sourceLabel(conflict.source)
636
- }), /* @__PURE__ */ jsx(Box, {
637
- flexDirection: "column",
638
- paddingLeft: 2,
639
- children: conflict.keys.map((key) => /* @__PURE__ */ jsxs(Text, { children: [
640
- Icons.bullet,
641
- " ",
642
- /* @__PURE__ */ jsx(Text, {
643
- color: "yellow",
644
- bold: true,
645
- children: key
646
- })
647
- ] }, key))
648
- })]
649
- }, conflict.source)),
631
+ children: [
632
+ /* @__PURE__ */ jsx(Text, {
633
+ bold: true,
634
+ children: sourceLabel(conflict.source)
635
+ }),
636
+ /* @__PURE__ */ jsx(Text, {
637
+ dimColor: true,
638
+ children: conflict.path
639
+ }),
640
+ /* @__PURE__ */ jsx(Box, {
641
+ flexDirection: "column",
642
+ paddingLeft: 2,
643
+ children: conflict.keys.map((key) => /* @__PURE__ */ jsxs(Text, { children: [
644
+ Icons.bullet,
645
+ " ",
646
+ /* @__PURE__ */ jsx(Text, {
647
+ color: "yellow",
648
+ bold: true,
649
+ children: key
650
+ })
651
+ ] }, key))
652
+ })
653
+ ]
654
+ }, conflict.path)),
650
655
  /* @__PURE__ */ jsx(Box, {
651
656
  marginTop: 1,
652
657
  children: /* @__PURE__ */ jsx(Text, {
653
658
  dimColor: true,
654
- children: "Try running \"claude auth logout\" or contact your IT administrator to resolve this."
659
+ children: hasManaged ? "Remove these keys (or run \"claude auth logout\"). Managed files are root-owned — ask your IT administrator." : "Remove these keys, or run \"claude auth logout\", then re-run the Wizard."
655
660
  })
656
661
  })
657
662
  ]
@@ -1042,7 +1047,7 @@ const FrameworkPicker = ({ store, onComplete }) => {
1042
1047
  })),
1043
1048
  onSelect: (value) => {
1044
1049
  const integration = Array.isArray(value) ? value[0] : value;
1045
- import("./registry-hBUgaWFx.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1050
+ import("./registry-apQfB3rf.js").then((n) => n.n).then(({ FRAMEWORK_REGISTRY }) => {
1046
1051
  const config = FRAMEWORK_REGISTRY[integration];
1047
1052
  store.setFrameworkConfig(integration, config);
1048
1053
  store.setDetectedFramework(config.metadata.name);
@@ -4259,6 +4264,155 @@ const RunScreen = ({ store }) => {
4259
4264
  });
4260
4265
  };
4261
4266
  //#endregion
4267
+ //#region src/ui/tui/screens/SlackConnectScreen.tsx
4268
+ /**
4269
+ * SlackConnectScreen — the dedicated "Connect Slack" step shown after the
4270
+ * MCP tutorial (`wizard mcp tutorial`) and after a successful install
4271
+ * (`wizard mcp add`).
4272
+ *
4273
+ * Presents the PostHog Slack app plus role-tailored use-cases. The copy
4274
+ * adapts to whether Slack is already connected (polled while the screen
4275
+ * is up, held as local state):
4276
+ * • not connected (or unknown) — nudge + "Open Slack setup", which
4277
+ * launches the browser at the integration settings page and keeps
4278
+ * the screen alive; the poll flips it to connected once the user
4279
+ * finishes the manual OAuth step in the browser.
4280
+ * • already connected — confirm it and skip the connect CTA, so users
4281
+ * who already have it aren't nagged.
4282
+ * "Skip" / "Done" / esc dismiss the step (`slackStepDismissed`) and let
4283
+ * the router advance to exit.
4284
+ */
4285
+ var ChoiceValue = /* @__PURE__ */ function(ChoiceValue) {
4286
+ ChoiceValue["Open"] = "open";
4287
+ ChoiceValue["Skip"] = "skip";
4288
+ return ChoiceValue;
4289
+ }(ChoiceValue || {});
4290
+ const POLL_INTERVAL_MS = 3e3;
4291
+ const SlackConnectScreen = ({ store }) => {
4292
+ useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
4293
+ const role = store.session.roleAtOrganization;
4294
+ const slack = getSlackAppCard();
4295
+ useEffect(() => {
4296
+ analytics.wizardCapture("slack connect shown", { role });
4297
+ }, []);
4298
+ const connected = store.session.slackConnected === true;
4299
+ const credentials = store.session.credentials;
4300
+ useEffect(() => {
4301
+ if (!credentials || connected) return;
4302
+ let cancelled = false;
4303
+ let timer;
4304
+ const controller = new AbortController();
4305
+ const check = () => {
4306
+ fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host, controller.signal).then((isConnected) => {
4307
+ if (cancelled) return;
4308
+ if (isConnected) store.setSlackConnected(true);
4309
+ else timer = setTimeout(check, POLL_INTERVAL_MS);
4310
+ }).catch((err) => {
4311
+ if (cancelled) return;
4312
+ analytics.captureException(err instanceof Error ? err : new Error(String(err)), { step: "slack_connected_check" });
4313
+ });
4314
+ };
4315
+ check();
4316
+ return () => {
4317
+ cancelled = true;
4318
+ if (timer) clearTimeout(timer);
4319
+ controller.abort();
4320
+ };
4321
+ }, [
4322
+ credentials,
4323
+ connected,
4324
+ store
4325
+ ]);
4326
+ const dismiss = () => {
4327
+ analytics.wizardCapture("slack connect skipped", {
4328
+ role,
4329
+ connected
4330
+ });
4331
+ store.setSlackStepDismissed();
4332
+ };
4333
+ const handleSelect = (value) => {
4334
+ if ((Array.isArray(value) ? value[0] : value) === "open") {
4335
+ analytics.wizardCapture("slack connect opened", { role });
4336
+ opn(slack.setupUrl, { wait: false }).catch(() => {});
4337
+ return;
4338
+ }
4339
+ dismiss();
4340
+ };
4341
+ useKeyBindings("slack-connect", [{
4342
+ match: "escape",
4343
+ label: "esc",
4344
+ action: connected ? "done" : "skip",
4345
+ handler: () => dismiss()
4346
+ }]);
4347
+ return /* @__PURE__ */ jsx(Box, {
4348
+ flexDirection: "column",
4349
+ flexGrow: 1,
4350
+ children: /* @__PURE__ */ jsxs(Box, {
4351
+ marginTop: 1,
4352
+ flexDirection: "column",
4353
+ children: [
4354
+ connected ? /* @__PURE__ */ jsxs(Text, {
4355
+ bold: true,
4356
+ color: Colors.success,
4357
+ children: [Icons.check, " Slack connected"]
4358
+ }) : /* @__PURE__ */ jsx(Text, {
4359
+ bold: true,
4360
+ color: Colors.accent,
4361
+ children: slack.headline
4362
+ }),
4363
+ /* @__PURE__ */ jsx(Box, {
4364
+ marginTop: 1,
4365
+ children: /* @__PURE__ */ jsx(Text, { children: connected ? "Slack is connected — here's what you can do:" : slack.pitch })
4366
+ }),
4367
+ /* @__PURE__ */ jsx(Box, {
4368
+ marginTop: 1,
4369
+ flexDirection: "column",
4370
+ children: slack.capabilities.map((capability, i) => /* @__PURE__ */ jsx(Box, {
4371
+ marginTop: i === 0 ? 0 : 1,
4372
+ children: /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
4373
+ color: "cyan",
4374
+ children: [Icons.diamond, " "]
4375
+ }), capability] })
4376
+ }, i))
4377
+ }),
4378
+ /* @__PURE__ */ jsxs(Box, {
4379
+ marginTop: 1,
4380
+ flexDirection: "column",
4381
+ children: [!connected && /* @__PURE__ */ jsxs(Text, {
4382
+ dimColor: true,
4383
+ children: ["Connect it: ", /* @__PURE__ */ jsx(Text, {
4384
+ color: "cyan",
4385
+ children: slack.setupUrl
4386
+ })]
4387
+ }), /* @__PURE__ */ jsxs(Text, {
4388
+ dimColor: true,
4389
+ children: ["Learn more: ", /* @__PURE__ */ jsx(Text, {
4390
+ color: "cyan",
4391
+ children: slack.learnMoreUrl
4392
+ })]
4393
+ })]
4394
+ }),
4395
+ /* @__PURE__ */ jsx(Box, {
4396
+ marginTop: 1,
4397
+ children: /* @__PURE__ */ jsx(PickerMenu, {
4398
+ options: connected ? [{
4399
+ label: "Done",
4400
+ value: "skip"
4401
+ }] : [{
4402
+ label: "Open Slack setup",
4403
+ value: "open"
4404
+ }, {
4405
+ label: "Skip",
4406
+ value: "skip"
4407
+ }],
4408
+ onSelect: handleSelect
4409
+ })
4410
+ })
4411
+ ]
4412
+ })
4413
+ });
4414
+ };
4415
+ //#endregion
4262
4416
  //#region src/ui/tui/screens/KeepSkillsScreen.tsx
4263
4417
  /**
4264
4418
  * KeepSkillsScreen — Ask whether to keep installed skills in .claude/skills/.
@@ -4613,6 +4767,7 @@ const AuthErrorScreen = ({ store }) => {
4613
4767
  });
4614
4768
  const detail = store.session.authErrorDetail;
4615
4769
  const hasSettingsConflict = detail?.hasSettingsConflict ?? true;
4770
+ const conflicts = detail?.conflicts ?? [];
4616
4771
  const logFilePath = detail?.logFilePath;
4617
4772
  return /* @__PURE__ */ jsxs(Box, {
4618
4773
  flexDirection: "column",
@@ -4627,13 +4782,32 @@ const AuthErrorScreen = ({ store }) => {
4627
4782
  /* @__PURE__ */ jsx(Box, {
4628
4783
  flexDirection: "column",
4629
4784
  marginTop: 1,
4630
- children: /* @__PURE__ */ jsx(Text, { children: "The Wizard couldn't connect to the PostHog LLM Gateway. Claude Code settings on this machine are overriding the Wizard's credentials." })
4785
+ children: /* @__PURE__ */ jsx(Text, { children: "The Wizard couldn't connect to the PostHog LLM Gateway. Claude Code settings on this machine override the Wizard's credentials." })
4786
+ }),
4787
+ conflicts.length > 0 && /* @__PURE__ */ jsx(Box, {
4788
+ flexDirection: "column",
4789
+ marginTop: 1,
4790
+ paddingLeft: 2,
4791
+ children: conflicts.map((conflict) => /* @__PURE__ */ jsxs(Text, { children: [
4792
+ "•",
4793
+ " ",
4794
+ /* @__PURE__ */ jsx(Text, {
4795
+ bold: true,
4796
+ children: conflict.path
4797
+ }),
4798
+ " sets",
4799
+ " ",
4800
+ /* @__PURE__ */ jsx(Text, {
4801
+ color: "yellow",
4802
+ children: conflict.keys.join(", ")
4803
+ })
4804
+ ] }, conflict.path))
4631
4805
  }),
4632
4806
  /* @__PURE__ */ jsx(Box, {
4633
4807
  marginTop: 1,
4634
4808
  children: /* @__PURE__ */ jsx(Text, {
4635
4809
  dimColor: true,
4636
- children: "Try logging out of Claude Code temporarily and re-running the Wizard:"
4810
+ children: "Remove those keys from the file(s) above, or log out of Claude Code, then re-run the Wizard:"
4637
4811
  })
4638
4812
  }),
4639
4813
  /* @__PURE__ */ jsx(Box, {
@@ -4910,11 +5084,15 @@ function createMcpSuggestedPromptsServices(_store) {
4910
5084
  user: result.user
4911
5085
  };
4912
5086
  },
5087
+ checkSlackConnected: async (credentials, signal) => {
5088
+ const { fetchSlackConnected } = await import("./api-eUlUinVy.js").then((n) => n.n);
5089
+ return fetchSlackConnected(credentials.accessToken, credentials.projectId, credentials.host, signal);
5090
+ },
4913
5091
  runPromptStreaming: (args) => runProductionPromptStreaming(args)
4914
5092
  };
4915
5093
  }
4916
5094
  async function* runProductionPromptStreaming(args) {
4917
- const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-DQOTQfW1.js");
5095
+ const { runMcpPromptViaSdk } = await import("./mcp-prompt-streaming-BiMrlLl0.js");
4918
5096
  yield* runMcpPromptViaSdk(args);
4919
5097
  }
4920
5098
  //#endregion
@@ -4959,6 +5137,7 @@ function createScreens(store, services) {
4959
5137
  store,
4960
5138
  services: services.mcpSuggestedPromptsServices
4961
5139
  }),
5140
+ ["slack-connect"]: /* @__PURE__ */ jsx(SlackConnectScreen, { store }),
4962
5141
  ["keep-skills"]: /* @__PURE__ */ jsx(KeepSkillsScreen, { store }),
4963
5142
  ["outro"]: /* @__PURE__ */ jsx(OutroScreen, { store }),
4964
5143
  ["exit"]: /* @__PURE__ */ jsx(ExitScreen, {}),
@@ -5017,7 +5196,11 @@ function startTUI(version, program = Program.PostHogIntegration) {
5017
5196
  const store = new WizardStore(program);
5018
5197
  store.version = version;
5019
5198
  setUI(new InkUI(store));
5020
- const { unmount: inkUnmount } = render(createElement(App, { store }));
5199
+ const { unmount: inkUnmount, waitUntilExit } = render(createElement(App, { store }));
5200
+ store.runInitHooks();
5201
+ process.stdin.on("error", (err) => {
5202
+ if (err.code !== "EIO") throw err;
5203
+ });
5021
5204
  let cleaned = false;
5022
5205
  const cleanup = () => {
5023
5206
  if (cleaned) return;
@@ -5028,6 +5211,10 @@ function startTUI(version, program = Program.PostHogIntegration) {
5028
5211
  process.stdout.write(getExitLine(store) + "\n");
5029
5212
  };
5030
5213
  process.on("exit", cleanup);
5214
+ waitUntilExit().then(() => {
5215
+ cleanup();
5216
+ process.exit(process.exitCode ?? 0);
5217
+ });
5031
5218
  return {
5032
5219
  unmount: cleanup,
5033
5220
  store,
@@ -5037,4 +5224,4 @@ function startTUI(version, program = Program.PostHogIntegration) {
5037
5224
  //#endregion
5038
5225
  export { startTUI };
5039
5226
 
5040
- //# sourceMappingURL=start-tui-BfXoErKg.js.map
5227
+ //# sourceMappingURL=start-tui-CCpKnZOY.js.map