@posthog/wizard 2.24.0 → 2.25.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 (66) hide show
  1. package/dist/{AiOptInRequiredScreen-DPn1CCeD.js → AiOptInRequiredScreen-C-D9tN6r.js} +156 -124
  2. package/dist/AiOptInRequiredScreen-C-D9tN6r.js.map +1 -0
  3. package/dist/{add-mcp-server-to-clients-BU8Owthq.js → add-mcp-server-to-clients-t0xe8gn1.js} +4 -4
  4. package/dist/{add-mcp-server-to-clients-BU8Owthq.js.map → add-mcp-server-to-clients-t0xe8gn1.js.map} +1 -1
  5. package/dist/{agent-interface-CysYcZl5.js → agent-interface-BsuUUPle.js} +403 -40
  6. package/dist/agent-interface-BsuUUPle.js.map +1 -0
  7. package/dist/{agent-runner-Br0OxBxd.js → agent-runner-L_-kJ3y3.js} +624 -17
  8. package/dist/agent-runner-L_-kJ3y3.js.map +1 -0
  9. package/dist/{analytics-BOWrR4qd.js → analytics-CDOujOSQ.js} +51 -17
  10. package/dist/analytics-CDOujOSQ.js.map +1 -0
  11. package/dist/{api-RXTR8yZo.js → api-DNS-L-1U.js} +3 -3
  12. package/dist/{api-RXTR8yZo.js.map → api-DNS-L-1U.js.map} +1 -1
  13. package/dist/bin.js +291 -75
  14. package/dist/bin.js.map +1 -1
  15. package/dist/{ci-install-BscZ60Ec.js → ci-install-_9A7tL36.js} +4 -4
  16. package/dist/{ci-install-BscZ60Ec.js.map → ci-install-_9A7tL36.js.map} +1 -1
  17. package/dist/{debug-BUdVZP84.js → debug-BwC7UkGH.js} +16 -8
  18. package/dist/debug-BwC7UkGH.js.map +1 -0
  19. package/dist/{debug-BgH07S-e.js → debug-CZQcMAJT.js} +1 -1
  20. package/dist/{environment-G0Hv6_JI.js → environment-DQPoj9sU.js} +3 -3
  21. package/dist/{environment-G0Hv6_JI.js.map → environment-DQPoj9sU.js.map} +1 -1
  22. package/dist/{interactive-fh2iyewb.js → interactive-DT5dLd7N.js} +2 -2
  23. package/dist/{interactive-fh2iyewb.js.map → interactive-DT5dLd7N.js.map} +1 -1
  24. package/dist/{mcp-prompt-streaming-DUtbxnNy.js → mcp-prompt-streaming-CBMr458Q.js} +7 -26
  25. package/dist/mcp-prompt-streaming-CBMr458Q.js.map +1 -0
  26. package/dist/{non-interactive-BfqXlY8R.js → non-interactive-csP4yGdA.js} +2 -2
  27. package/dist/{non-interactive-BfqXlY8R.js.map → non-interactive-csP4yGdA.js.map} +1 -1
  28. package/dist/{package-manager-Ca1maxU-.js → package-manager-CB4c2euf.js} +2 -2
  29. package/dist/{package-manager-Ca1maxU-.js.map → package-manager-CB4c2euf.js.map} +1 -1
  30. package/dist/{playground-4sqLVVJL.js → playground-C-lpKoKC.js} +9 -15
  31. package/dist/playground-C-lpKoKC.js.map +1 -0
  32. package/dist/{posthog-integration-Bz3HWkHn.js → posthog-integration-BL8-vC0V.js} +18 -18
  33. package/dist/{posthog-integration-Bz3HWkHn.js.map → posthog-integration-BL8-vC0V.js.map} +1 -1
  34. package/dist/{provisioning-CgwvlsIl.js → provisioning-DLOiFSM9.js} +3 -3
  35. package/dist/{provisioning-CgwvlsIl.js.map → provisioning-DLOiFSM9.js.map} +1 -1
  36. package/dist/{registry-CEnQVctL.js → registry-BbRzCV5l.js} +4 -4
  37. package/dist/{registry-CEnQVctL.js.map → registry-BbRzCV5l.js.map} +1 -1
  38. package/dist/{setup-utils-Doh69vo4.js → setup-utils-D87CyNkw.js} +8 -8
  39. package/dist/{setup-utils-Doh69vo4.js.map → setup-utils-D87CyNkw.js.map} +1 -1
  40. package/dist/smoke-test.sh +36 -1
  41. package/dist/{start-tui-CywbSvZE.js → start-tui-DnAG57vY.js} +16 -20
  42. package/dist/start-tui-DnAG57vY.js.map +1 -0
  43. package/dist/{steps-DJojDYQ-.js → steps-JaxH6u0f.js} +6 -6
  44. package/dist/{steps-DJojDYQ-.js.map → steps-JaxH6u0f.js.map} +1 -1
  45. package/dist/{task-stream-CZawuzlz.js → task-stream-BQNSp0qR.js} +4 -3
  46. package/dist/task-stream-BQNSp0qR.js.map +1 -0
  47. package/dist/{telemetry-8zMpaIuK.js → telemetry-DL28cCwY.js} +3 -3
  48. package/dist/{telemetry-8zMpaIuK.js.map → telemetry-DL28cCwY.js.map} +1 -1
  49. package/dist/{urls-BUfvQmU4.js → urls-vkJ5c0ix.js} +2 -2
  50. package/dist/{urls-BUfvQmU4.js.map → urls-vkJ5c0ix.js.map} +1 -1
  51. package/dist/{wizard-abort-Ni-mKJ58.js → wizard-abort-BRXKRL4F.js} +1 -1
  52. package/dist/{wizard-abort-BdGW4Tvi.js → wizard-abort-CLGgMAEe.js} +3 -3
  53. package/dist/{wizard-abort-BdGW4Tvi.js.map → wizard-abort-CLGgMAEe.js.map} +1 -1
  54. package/dist/{wizard-ui-YdGFRyu_.js → wizard-ui-WZ48rUgr.js} +2 -1
  55. package/dist/wizard-ui-WZ48rUgr.js.map +1 -0
  56. package/package.json +1 -1
  57. package/dist/AiOptInRequiredScreen-DPn1CCeD.js.map +0 -1
  58. package/dist/agent-interface-CysYcZl5.js.map +0 -1
  59. package/dist/agent-runner-Br0OxBxd.js.map +0 -1
  60. package/dist/analytics-BOWrR4qd.js.map +0 -1
  61. package/dist/debug-BUdVZP84.js.map +0 -1
  62. package/dist/mcp-prompt-streaming-DUtbxnNy.js.map +0 -1
  63. package/dist/playground-4sqLVVJL.js.map +0 -1
  64. package/dist/start-tui-CywbSvZE.js.map +0 -1
  65. package/dist/task-stream-CZawuzlz.js.map +0 -1
  66. package/dist/wizard-ui-YdGFRyu_.js.map +0 -1
@@ -1,12 +1,13 @@
1
- import { M as POSTHOG_APP_URL, Q as getSkillsBaseUrl, g as SERVICE_LABELS, s as logToFile, y as getBlockingServiceKeys } from "./debug-BUdVZP84.js";
2
- import { n as isTaskStatus } from "./wizard-ui-YdGFRyu_.js";
3
- import { r as sessionProperties, t as analytics } from "./analytics-BOWrR4qd.js";
4
- import { i as withUtm, n as openTrackedLink } from "./telemetry-8zMpaIuK.js";
5
- import { n as getCloudUrlFromRegion } from "./urls-BUfvQmU4.js";
6
- import { a as fetchUserData, i as fetchSlackConnected } from "./api-RXTR8yZo.js";
1
+ import { $ as getSkillsBaseUrl, M as POSTHOG_APP_URL, g as SERVICE_LABELS, s as logToFile, y as getBlockingServiceKeys } from "./debug-BwC7UkGH.js";
2
+ import { n as isTaskStatus } from "./wizard-ui-WZ48rUgr.js";
3
+ import { r as sessionProperties, t as analytics } from "./analytics-CDOujOSQ.js";
4
+ import { i as withUtm, n as openTrackedLink } from "./telemetry-DL28cCwY.js";
5
+ import { t as getOrAskForProjectData } from "./setup-utils-D87CyNkw.js";
6
+ import { n as getCloudUrlFromRegion } from "./urls-vkJ5c0ix.js";
7
+ import { a as fetchUserData, i as fetchSlackConnected } from "./api-DNS-L-1U.js";
7
8
  import { i as buildSession } from "./wizard-session-G3VWD6hv.js";
8
- import { m as fetchSkillMenu, y as AUDIT_SEVERITY_STYLE } from "./agent-interface-CysYcZl5.js";
9
- import { c as computeVisibleRange, d as isObjectBlock, f as Colors, l as isClearBlock, p as Icons, s as TextBlock, u as isLinesBlock } from "./posthog-integration-Bz3HWkHn.js";
9
+ import { C as AUDIT_SEVERITY_STYLE, h as fetchSkillMenu } from "./agent-interface-BsuUUPle.js";
10
+ import { c as computeVisibleRange, d as isObjectBlock, f as Colors, l as isClearBlock, p as Icons, s as TextBlock, u as isLinesBlock } from "./posthog-integration-BL8-vC0V.js";
10
11
  import { a as PromptLabel, c as PROGRAM_REGISTRY, i as useKeyboardHintsContext, l as Program, m as getKindMeta, n as useKeyBindings, r as KeyboardHintsProvider, t as PickerMenu, u as getProgramConfig } from "./bin.js";
11
12
  import { n as AVAILABLE_FEATURES, o as isAllFeaturesSelected, t as ALL_FEATURE_VALUES } from "./defaults-BNWIWzjc.js";
12
13
  import opn from "opn";
@@ -803,7 +804,7 @@ const LoadingBox = ({ message }) => {
803
804
  * Extracted from StatusTab logic.
804
805
  */
805
806
  const ProgressList = ({ items, title }) => {
806
- const completed = items.filter((t) => t.status === "completed").length;
807
+ const resolved = items.filter((t) => t.status === "completed" || t.status === "skipped").length;
807
808
  const total = items.length;
808
809
  return /* @__PURE__ */ jsxs(Box, {
809
810
  flexDirection: "column",
@@ -814,14 +815,16 @@ const ProgressList = ({ items, title }) => {
814
815
  }), /* @__PURE__ */ jsx(Text, { children: " " })] }),
815
816
  items.length === 0 && /* @__PURE__ */ jsx(LoadingBox, { message: "Analyzing project..." }),
816
817
  items.map((item, i) => {
818
+ const skipped = item.status === "skipped";
817
819
  const icon = item.status === "completed" ? Icons.squareFilled : item.status === "in_progress" ? Icons.triangleRight : Icons.squareOpen;
818
820
  const color = item.status === "completed" ? Colors.success : item.status === "in_progress" ? Colors.primary : Colors.muted;
819
- const label = item.status === "in_progress" && item.activeForm ? item.activeForm : item.label;
821
+ const label = skipped ? `${item.label} (skipped)` : item.status === "in_progress" && item.activeForm ? item.activeForm : item.label;
820
822
  return /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
821
823
  color,
822
824
  children: icon
823
825
  }), /* @__PURE__ */ jsxs(Text, {
824
- dimColor: item.status === "pending",
826
+ dimColor: item.status === "pending" || skipped,
827
+ strikethrough: skipped,
825
828
  children: [" ", label]
826
829
  })] }, i);
827
830
  }),
@@ -830,7 +833,7 @@ const ProgressList = ({ items, title }) => {
830
833
  gap: 1,
831
834
  children: [/* @__PURE__ */ jsx(Spinner, {}), /* @__PURE__ */ jsx(Text, {
832
835
  dimColor: true,
833
- children: completed < total ? `Progress: ${completed}/${total} completed` : "Cleaning up..."
836
+ children: resolved < total ? `Progress: ${resolved}/${total} completed` : "Cleaning up..."
834
837
  })]
835
838
  })
836
839
  ]
@@ -1202,8 +1205,10 @@ const ModalOverlay = ({ borderColor, title, titleColor, width = 68, children, fe
1202
1205
  * a log that grows into the hundreds of MB, producing OOM-grade allocation
1203
1206
  * pressure on V8's heap.
1204
1207
  */
1205
- /** Rows consumed by TitleBar + spacer + ScreenContainer padding + status bar + tab bar */
1206
- const CHROME_ROWS$1 = 8;
1208
+ /** Rows consumed by TitleBar + spacer + ScreenContainer padding + status bar +
1209
+ * tab bar, with a couple rows of headroom so the tail never crowds the status
1210
+ * bar below it. */
1211
+ const CHROME_ROWS$1 = 10;
1207
1212
  /** Bytes read from the end of the log per refresh — large enough to contain
1208
1213
  * any practical visible window of lines, small enough to allocate cheaply. */
1209
1214
  const TAIL_BYTES = 256 * 1024;
@@ -3719,7 +3724,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
3719
3724
  const kit = getRolePrompts(session.roleAtOrganization, session.integration);
3720
3725
  const crossSell = useMemo(() => getCrossSellPrompts(session.roleAtOrganization), [session.roleAtOrganization]);
3721
3726
  const greeting = useMemo(() => getRoleGreeting(session.roleAtOrganization), [session.roleAtOrganization]);
3722
- const [phase, setPhase] = useState(() => store.session.credentials ? "choose" : "authenticating");
3727
+ const [phase, setPhase] = useState("choose");
3723
3728
  const [loginError, setLoginError] = useState(null);
3724
3729
  const startedTutorialRef = useRef(false);
3725
3730
  const [runningPrompt, setRunningPrompt] = useState(null);
@@ -3761,28 +3766,6 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
3761
3766
  services,
3762
3767
  store
3763
3768
  ]);
3764
- const credentials = session.credentials;
3765
- const slackConnected = session.slackConnected;
3766
- useEffect(() => {
3767
- if (!credentials || slackConnected !== null) return;
3768
- let cancelled = false;
3769
- const controller = new AbortController();
3770
- services.checkSlackConnected(credentials, controller.signal).then((connected) => {
3771
- if (!cancelled) store.setSlackConnected(connected);
3772
- }).catch((err) => {
3773
- if (cancelled) return;
3774
- analytics.captureException(err instanceof Error ? err : new Error(String(err)), { step: "slack_connected_check" });
3775
- });
3776
- return () => {
3777
- cancelled = true;
3778
- controller.abort();
3779
- };
3780
- }, [
3781
- credentials,
3782
- slackConnected,
3783
- services,
3784
- store
3785
- ]);
3786
3769
  useEffect(() => {
3787
3770
  if (phase !== "running") return;
3788
3771
  if (!runningPrompt) return;
@@ -3870,9 +3853,6 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
3870
3853
  analytics.wizardCapture("mcp suggested prompts choose", { choice: "login" });
3871
3854
  startedTutorialRef.current = true;
3872
3855
  setPhase(session.credentials ? "greeting" : "authenticating");
3873
- } else if (choice === "connect-slack") {
3874
- analytics.wizardCapture("mcp suggested prompts choose", { choice: "connect-slack" });
3875
- openTrackedLink(getSlackAppCard().setupUrl, "mcp-prompts-slack-setup");
3876
3856
  } else {
3877
3857
  analytics.wizardCapture("mcp suggested prompts choose", { choice: "exit" });
3878
3858
  enterGoodbye();
@@ -3945,7 +3925,6 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
3945
3925
  children: [
3946
3926
  phase === "choose" && /* @__PURE__ */ jsx(ChoosePhase, {
3947
3927
  error: loginError,
3948
- slackConnected,
3949
3928
  onSelect: handleChoice
3950
3929
  }),
3951
3930
  phase === "authenticating" && /* @__PURE__ */ jsx(AuthenticatingPhase, { loginUrl: session.loginUrl }),
@@ -4008,7 +3987,7 @@ const McpSuggestedPromptsScreen = ({ store, services }) => {
4008
3987
  })
4009
3988
  });
4010
3989
  };
4011
- const ChoosePhase = ({ error, slackConnected, onSelect }) => {
3990
+ const ChoosePhase = ({ error, onSelect }) => {
4012
3991
  return /* @__PURE__ */ jsxs(Box, {
4013
3992
  flexDirection: "column",
4014
3993
  children: [
@@ -4047,57 +4026,18 @@ const ChoosePhase = ({ error, slackConnected, onSelect }) => {
4047
4026
  }), " And lots more..."] })
4048
4027
  ]
4049
4028
  }),
4050
- /* @__PURE__ */ jsx(Box, {
4051
- marginTop: 1,
4052
- flexDirection: "column",
4053
- children: slackConnected ? /* @__PURE__ */ jsxs(Text, { children: [
4054
- /* @__PURE__ */ jsx(Text, {
4055
- color: Colors.success,
4056
- children: Icons.check
4057
- }),
4058
- " Slack is connected — analyze data and ship product changes there by tagging",
4059
- " ",
4060
- /* @__PURE__ */ jsx(Text, {
4061
- bold: true,
4062
- children: "@PostHog"
4063
- }),
4064
- "."
4065
- ] }) : /* @__PURE__ */ jsxs(Text, { children: [
4066
- "You can also connect PostHog to Slack, so you can analyze data and ship product changes there by tagging ",
4067
- /* @__PURE__ */ jsx(Text, {
4068
- bold: true,
4069
- children: "@PostHog"
4070
- }),
4071
- "."
4072
- ] })
4073
- }),
4074
4029
  /* @__PURE__ */ jsx(Box, {
4075
4030
  marginTop: 1,
4076
4031
  children: /* @__PURE__ */ jsx(Text, { children: "Want a live demo using real data from your project?" })
4077
4032
  }),
4078
4033
  /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PickerMenu, {
4079
- options: [
4080
- {
4081
- label: "Start MCP tutorial",
4082
- value: "login"
4083
- },
4084
- slackConnected ? {
4085
- label: "Already connected to Slack",
4086
- value: "connect-slack",
4087
- icon: {
4088
- glyph: Icons.check,
4089
- color: Colors.success
4090
- },
4091
- disabled: true
4092
- } : {
4093
- label: "Connect Slack now",
4094
- value: "connect-slack"
4095
- },
4096
- {
4097
- label: "Exit",
4098
- value: "exit"
4099
- }
4100
- ],
4034
+ options: [{
4035
+ label: "Start MCP tutorial",
4036
+ value: "login"
4037
+ }, {
4038
+ label: "Exit",
4039
+ value: "exit"
4040
+ }],
4101
4041
  onSelect
4102
4042
  }) }),
4103
4043
  error && /* @__PURE__ */ jsx(Box, {
@@ -5166,9 +5106,11 @@ const AUDIT_AREA_SLIDES = [
5166
5106
  * "Skip" / "Done" / esc dismiss the step (`slackStepDismissed`) and let
5167
5107
  * the router advance to exit.
5168
5108
  *
5169
- * The mcp and integration flows arrive here already authenticated. In the
5170
- * standalone `wizard slack` flow the program's `onInit` runs the OAuth
5171
- * while this screen renders the auth-wait state.
5109
+ * The mcp and integration flows arrive here already authenticated. The
5110
+ * standalone `wizard slack` flow lands without credentials and only
5111
+ * triggers OAuth when the user explicitly picks "Open Slack setup" —
5112
+ * once authed, the connected-state poll lets the screen flip to the
5113
+ * "Slack connected" copy without nagging users who already have it.
5172
5114
  */
5173
5115
  const POLL_INTERVAL_MS = 3e3;
5174
5116
  const SlackConnectScreen = ({ store }) => {
@@ -5178,10 +5120,16 @@ const SlackConnectScreen = ({ store }) => {
5178
5120
  const setupUrl = withUtm(slack.setupUrl, "slack-connect-setup");
5179
5121
  const learnMoreUrl = withUtm(slack.learnMoreUrl, "slack-connect-learn-more");
5180
5122
  const credentials = store.session.credentials;
5181
- const awaitingLogin = store.router.activeProgram === Program.SlackConnect && !credentials;
5182
5123
  const connectedState = store.session.slackConnected;
5183
5124
  const connected = connectedState === true;
5184
- const known = connectedState !== null || !credentials && !awaitingLogin;
5125
+ const [phase, setPhase] = useState("nudge");
5126
+ const [loginError, setLoginError] = useState(null);
5127
+ const [setupOpened, setSetupOpened] = useState(false);
5128
+ const openSlackSetup = () => {
5129
+ openTrackedLink(setupUrl, "slack-connect-setup");
5130
+ setSetupOpened(true);
5131
+ };
5132
+ const known = connectedState !== null;
5185
5133
  const impressionFired = useRef(false);
5186
5134
  useEffect(() => {
5187
5135
  if (!known || impressionFired.current) return;
@@ -5195,6 +5143,12 @@ const SlackConnectScreen = ({ store }) => {
5195
5143
  connected,
5196
5144
  role
5197
5145
  ]);
5146
+ const nudgeImpressionFired = useRef(false);
5147
+ useEffect(() => {
5148
+ if (credentials || nudgeImpressionFired.current) return;
5149
+ nudgeImpressionFired.current = true;
5150
+ analytics.wizardCapture("slack connect nudge shown", { role });
5151
+ }, [credentials, role]);
5198
5152
  useEffect(() => {
5199
5153
  if (!credentials || connected) return;
5200
5154
  let cancelled = false;
@@ -5228,27 +5182,83 @@ const SlackConnectScreen = ({ store }) => {
5228
5182
  store
5229
5183
  ]);
5230
5184
  const dismiss = () => {
5231
- analytics.wizardCapture(connected ? "slack connect done" : "slack connect skipped", {
5185
+ if (connected) analytics.wizardCapture("slack connect done", { role });
5186
+ else analytics.wizardCapture("slack connect skipped", {
5232
5187
  role,
5233
- connected
5188
+ connection_state: credentials ? "not_connected" : "unknown"
5234
5189
  });
5235
5190
  store.setSlackStepDismissed();
5236
5191
  };
5237
5192
  const handleSelect = (value) => {
5238
5193
  if ((Array.isArray(value) ? value[0] : value) === "open") {
5239
5194
  analytics.wizardCapture("slack connect opened", { role });
5240
- openTrackedLink(setupUrl, "slack-connect-setup");
5195
+ setLoginError(null);
5196
+ if (credentials) {
5197
+ openSlackSetup();
5198
+ return;
5199
+ }
5200
+ setPhase("authenticating");
5241
5201
  return;
5242
5202
  }
5243
5203
  dismiss();
5244
5204
  };
5205
+ useEffect(() => {
5206
+ if (phase !== "authenticating") return;
5207
+ let cancelled = false;
5208
+ (async () => {
5209
+ try {
5210
+ const data = await getOrAskForProjectData({
5211
+ signup: false,
5212
+ ci: false,
5213
+ apiKey: void 0,
5214
+ projectId: void 0,
5215
+ programId: Program.SlackConnect
5216
+ });
5217
+ if (cancelled) return;
5218
+ store.setCredentials({
5219
+ accessToken: data.accessToken,
5220
+ projectApiKey: data.projectApiKey,
5221
+ host: data.host,
5222
+ projectId: data.projectId
5223
+ });
5224
+ store.setRoleAtOrganization(data.roleAtOrganization);
5225
+ store.setApiUser(data.user);
5226
+ store.setLoginUrl(null);
5227
+ openSlackSetup();
5228
+ setPhase("nudge");
5229
+ } catch (err) {
5230
+ if (cancelled) return;
5231
+ const message = err instanceof Error ? err.message : String(err);
5232
+ logToFile(`[SlackConnectScreen] login failed: ${message}`);
5233
+ analytics.captureException(err instanceof Error ? err : new Error(String(err)), { step: "slack_connect_login" });
5234
+ store.setLoginUrl(null);
5235
+ setLoginError(message);
5236
+ setPhase("nudge");
5237
+ }
5238
+ })();
5239
+ return () => {
5240
+ cancelled = true;
5241
+ };
5242
+ }, [
5243
+ phase,
5244
+ role,
5245
+ setupUrl,
5246
+ store
5247
+ ]);
5245
5248
  useKeyBindings("slack-connect", [{
5246
5249
  match: "escape",
5247
5250
  label: "esc",
5248
- action: connected ? "done" : "skip",
5249
- handler: () => dismiss()
5251
+ action: phase === "authenticating" ? "cancel" : connected ? "done" : "skip",
5252
+ handler: () => {
5253
+ if (phase === "authenticating") {
5254
+ store.setLoginUrl(null);
5255
+ setPhase("nudge");
5256
+ return;
5257
+ }
5258
+ dismiss();
5259
+ }
5250
5260
  }]);
5251
- if (awaitingLogin) return /* @__PURE__ */ jsxs(Box, {
5261
+ if (phase === "authenticating") return /* @__PURE__ */ jsxs(Box, {
5252
5262
  flexDirection: "column",
5253
5263
  flexGrow: 1,
5254
5264
  marginTop: 1,
@@ -5274,6 +5284,7 @@ const SlackConnectScreen = ({ store }) => {
5274
5284
  marginTop: 1,
5275
5285
  children: /* @__PURE__ */ jsx(LoadingBox, { message: "Checking for an existing Slack connection..." })
5276
5286
  });
5287
+ const awaitingBrowser = setupOpened && !connected;
5277
5288
  return /* @__PURE__ */ jsx(Box, {
5278
5289
  flexDirection: "column",
5279
5290
  flexGrow: 1,
@@ -5285,6 +5296,10 @@ const SlackConnectScreen = ({ store }) => {
5285
5296
  bold: true,
5286
5297
  color: Colors.success,
5287
5298
  children: [Icons.check, " Slack connected"]
5299
+ }) : awaitingBrowser ? /* @__PURE__ */ jsx(Text, {
5300
+ bold: true,
5301
+ color: Colors.accent,
5302
+ children: "Finish connecting Slack"
5288
5303
  }) : /* @__PURE__ */ jsx(Text, {
5289
5304
  bold: true,
5290
5305
  color: Colors.accent,
@@ -5292,7 +5307,7 @@ const SlackConnectScreen = ({ store }) => {
5292
5307
  }),
5293
5308
  /* @__PURE__ */ jsx(Box, {
5294
5309
  marginTop: 1,
5295
- children: /* @__PURE__ */ jsx(Text, { children: connected ? "Slack is connected — here's what you can do:" : slack.pitch })
5310
+ children: /* @__PURE__ */ jsx(Text, { children: connected ? "Slack is connected — here's what you can do:" : awaitingBrowser ? "We've opened PostHog's Slack setup page in your browser. Authorize the Slack app there — we'll detect the connection automatically and continue." : slack.pitch })
5296
5311
  }),
5297
5312
  /* @__PURE__ */ jsx(Box, {
5298
5313
  marginTop: 1,
@@ -5310,7 +5325,7 @@ const SlackConnectScreen = ({ store }) => {
5310
5325
  flexDirection: "column",
5311
5326
  children: [!connected && /* @__PURE__ */ jsxs(Text, {
5312
5327
  dimColor: true,
5313
- children: ["Connect it: ", /* @__PURE__ */ jsx(Text, {
5328
+ children: [awaitingBrowser ? "Setup page: " : "Connect it: ", /* @__PURE__ */ jsx(Text, {
5314
5329
  color: "cyan",
5315
5330
  children: setupUrl
5316
5331
  })]
@@ -5328,6 +5343,12 @@ const SlackConnectScreen = ({ store }) => {
5328
5343
  options: connected ? [{
5329
5344
  label: "Done",
5330
5345
  value: "skip"
5346
+ }] : awaitingBrowser ? [{
5347
+ label: "Re-open Slack setup",
5348
+ value: "open"
5349
+ }, {
5350
+ label: "Skip / Continue",
5351
+ value: "skip"
5331
5352
  }] : [{
5332
5353
  label: "Open Slack setup",
5333
5354
  value: "open"
@@ -5337,6 +5358,17 @@ const SlackConnectScreen = ({ store }) => {
5337
5358
  }],
5338
5359
  onSelect: handleSelect
5339
5360
  })
5361
+ }),
5362
+ loginError && /* @__PURE__ */ jsx(Box, {
5363
+ marginTop: 1,
5364
+ children: /* @__PURE__ */ jsxs(Text, {
5365
+ color: "red",
5366
+ children: [
5367
+ "Login failed: ",
5368
+ loginError,
5369
+ ". Try again or skip."
5370
+ ]
5371
+ })
5340
5372
  })
5341
5373
  ]
5342
5374
  })
@@ -5377,6 +5409,28 @@ const OutroScreen = ({ store }) => {
5377
5409
  bold: true,
5378
5410
  children: ["✔ ", outroData.message || "Done!"]
5379
5411
  }),
5412
+ outroData.dashboardUrl && /* @__PURE__ */ jsx(Box, {
5413
+ marginTop: 1,
5414
+ children: /* @__PURE__ */ jsxs(Text, { children: [
5415
+ "Dashboard:",
5416
+ " ",
5417
+ /* @__PURE__ */ jsx(Text, {
5418
+ color: "cyan",
5419
+ children: withUtm(outroData.dashboardUrl, "outro-dashboard")
5420
+ })
5421
+ ] })
5422
+ }),
5423
+ outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
5424
+ marginTop: 1,
5425
+ children: /* @__PURE__ */ jsxs(Text, { children: [
5426
+ "Notebook:",
5427
+ " ",
5428
+ /* @__PURE__ */ jsx(Text, {
5429
+ color: "cyan",
5430
+ children: withUtm(outroData.notebookUrl, "outro-notebook")
5431
+ })
5432
+ ] })
5433
+ }),
5380
5434
  outroData.body && /* @__PURE__ */ jsx(Box, {
5381
5435
  marginTop: 1,
5382
5436
  children: /* @__PURE__ */ jsx(Text, {
@@ -5423,28 +5477,6 @@ const OutroScreen = ({ store }) => {
5423
5477
  })
5424
5478
  ] }, event.name))]
5425
5479
  }),
5426
- outroData.dashboardUrl && /* @__PURE__ */ jsx(Box, {
5427
- marginTop: 1,
5428
- children: /* @__PURE__ */ jsxs(Text, { children: [
5429
- "We've also made you a dashboard:",
5430
- " ",
5431
- /* @__PURE__ */ jsx(Text, {
5432
- color: "cyan",
5433
- children: withUtm(outroData.dashboardUrl, "outro-dashboard")
5434
- })
5435
- ] })
5436
- }),
5437
- outroData.notebookUrl && /* @__PURE__ */ jsx(Box, {
5438
- marginTop: 1,
5439
- children: /* @__PURE__ */ jsxs(Text, { children: [
5440
- "And uploaded the report to a PostHog notebook:",
5441
- " ",
5442
- /* @__PURE__ */ jsx(Text, {
5443
- color: "cyan",
5444
- children: withUtm(outroData.notebookUrl, "outro-notebook")
5445
- })
5446
- ] })
5447
- }),
5448
5480
  outroData.docsUrl && /* @__PURE__ */ jsx(Box, {
5449
5481
  marginTop: 1,
5450
5482
  children: /* @__PURE__ */ jsxs(Text, { children: [
@@ -5824,4 +5856,4 @@ const AiOptInRequiredScreen = ({ store }) => {
5824
5856
  //#endregion
5825
5857
  export { SplitView as A, LogViewer as C, useStdoutDimensions as D, GroupedPickerMenu as E, WizardStore as M, ProgressList as O, EventPlanViewer as S, ConfirmationInput as T, LearnCard as _, SlackConnectScreen as a, TabContainer as b, AuditChecksViewer as c, McpScreen as d, IssueTable as f, TipsCard as g, ServiceHealthList as h, OutroScreen as i, CardLayout as j, LoadingBox as k, McpSuggestedPromptsScreen as l, SEVERITY_ORDER as m, SkillSourceInfo as n, AUDIT_AREA_SLIDES as o, SEVERITY_LABEL as p, useSkillEntry as r, VisualBox as s, AiOptInRequiredScreen as t, TAILORED_ROLES as u, ContentSequencer as v, ModalOverlay as w, ScreenContainer as x, HNViewer as y };
5826
5858
 
5827
- //# sourceMappingURL=AiOptInRequiredScreen-DPn1CCeD.js.map
5859
+ //# sourceMappingURL=AiOptInRequiredScreen-C-D9tN6r.js.map